{"version":3,"sources":["../../../src/scripts/CreateFetcherClass/index.ts","../../../src/func/Save/save.ts","../../../src/config/index.ts","../../../src/func/Typescript/TypeNameMaker/index.ts","../../../src/helper/index.ts","../../../src/func/PathMapper/index.ts","../../../src/func/MethodIterator/index.ts","../../../src/scripts/CreateFetcherClass/fetcherTemplate.ts"],"sourcesContent":["/* eslint-disable no-async-promise-executor */\nimport {Spec} from '../../types.ts';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport {save} from '../../func/Save/save.ts';\nimport {definitionFullName, pathSplit} from '../../helper/index.ts';\nimport {PathIterator} from '../../func/PathMapper/index.ts';\nimport {camelCase} from '../../func/Typescript/TypeNameMaker/index.ts';\nimport {fetcherTemplate} from './fetcherTemplate.ts';\nimport {configStore} from '../../config/index.ts';\n\n/** */\nexport async function createFetcherClass(definations: Spec[]) {\n  const header =\n    \"/* eslint-disable @typescript-eslint/no-unused-vars */\\nimport { ContentType, HttpClient, getData,AxiosOpt } from '../client'\";\n  const ngheader = `/* eslint-disable @typescript-eslint/no-unused-vars */\\n\n    import { HttpHeaders, HttpParams, HttpRequest } from \"@angular/common/http\";\n    import {  HttpClient } from \"../client\";`;\n  return new Promise<'done' | 'error'>(async resolve => {\n    let hasError: 'done' | 'error' = 'done';\n    const spinner = ora('Create definitions Fetcher').info();\n    try {\n      const fetcher = definations.map(\n        async defination =>\n          new Promise(async resolve => {\n            spinner.text =\n              'Create definitions Fetcher:' + defination.info.title;\n            //\n\n            const iteratedPaths = PathIterator(defination.paths);\n\n            const apis = iteratedPaths?.map((path, index) => {\n              return fetcherTemplate({\n                ...path,\n                index,\n                len: iteratedPaths.length,\n              });\n            });\n            const {definationName} = pathSplit(\n              iteratedPaths?.[0].objectName as string\n            );\n            const data =\n              ` ${configStore?.hook === 'NG' ? ngheader : header}\n              import { ${camelCase(definationName)} } from \"../types\";\n          export class ${camelCase(\n            defination.info.title.replace('.', '')\n          )}Apis${\n            configStore?.hook === 'NG'\n              ? ' extends HttpClient'\n              : '<SecurityDataType = unknown> extends HttpClient<SecurityDataType>'\n          } {\n\n            public Api = {\n             ` +\n              apis?.join('') +\n              `\n            };\\n}`;\n\n            await save({\n              data,\n              fileName: 'index',\n              location: definitionFullName(defination) + '/api',\n              extention: '.' + configStore?.fileTypes.api,\n            });\n            //\n            spinner.clear();\n            resolve(data);\n          })\n      );\n\n      await Promise.all(fetcher);\n    } catch (error) {\n      spinner.fail();\n      hasError = 'error';\n      console.error(chalk.redBright(' └ ' + error));\n    }\n    spinner.text = 'Create definitions Fetcher';\n    hasError === 'done' && spinner.succeed();\n    resolve(hasError);\n  });\n}\n","import {format} from 'prettier';\nimport fs from 'fs';\nimport {configStore} from '../../config/index.ts';\nimport {ISaveBatch, ISaveFile} from '../../types.ts';\nimport ora from 'ora';\nimport chalk from 'chalk';\nimport makeDir from 'make-dir';\n\nconst writeFs = async ({\n  data,\n  fileName,\n  location,\n}: ISaveFile): Promise<fs.WriteStream> => {\n  // eslint-disable-next-line no-async-promise-executor\n  return new Promise(async (resolve, reject) => {\n    const dir = await makeDir(location);\n    if (dir) {\n      const file = fs\n        .createWriteStream(location + '/' + fileName)\n        .once('open', () => {\n          file.write(data);\n          file.end();\n        })\n        .once('error', error => {\n          reject(error);\n        })\n        .once('finish', () => {\n          resolve(file);\n        });\n    }\n  });\n};\n\nconst getPrettierFileData = async (\n  data: unknown,\n  beautify = true\n): Promise<string> => {\n  if (beautify) {\n    const beauty = await format(`${data}`, configStore?.prettier);\n    return `${beauty}`;\n  }\n  return `${data}`;\n};\n\nexport async function save({\n  fileName,\n  data,\n  location,\n  beautify,\n  extention,\n  comment,\n}: ISaveFile) {\n  if (data) {\n    const spinner = ora(\n      chalk.gray(' ├ Saving :\"' + fileName + '\" in :\"' + location + '\"')\n    );\n    try {\n      const fileData = await getPrettierFileData(data, beautify);\n      const dataStr = comment ? `\\n /* ${comment} */\\n` + fileData : fileData;\n      await writeFs({\n        data: dataStr,\n        fileName: fileName + extention,\n        location: configStore?.outDir + '/' + location,\n      });\n      spinner.succeed();\n    } catch (error) {\n      spinner.fail();\n      console.error(chalk.redBright(' └ ' + error));\n    }\n  }\n}\n\nexport function saveBatch({files, location, beautify, extention}: ISaveBatch) {\n  const promisses = files.map(file => {\n    if (file.data.length) {\n      return save({\n        data: file.data,\n        fileName: file.name,\n        beautify,\n        location,\n        extention,\n        comment: file.comment,\n      });\n    } else {\n      return null;\n      // console.warn(\n      //   chalk.green(\n      //     ` └ ${file.name} in ${location} not saved duo to empty string! `\n      //   )\n      // );\n    }\n  });\n  return Promise.all(promisses);\n}\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport {cosmiconfig} from 'cosmiconfig';\nimport {IConfig} from '../types.ts';\nimport {ConfigStore} from './store/store.ts';\nconst spinner = ora('get hookgenrc config file');\nconst explorer = () => cosmiconfig('hookgenrc');\n// eslint-disable-next-line prefer-const\nexport let configStore: ConfigStore | undefined = undefined;\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n//@ts-ignore\nexport async function getConfig(): Promise<IConfig | undefined> {\n  spinner.start();\n  try {\n    const configFile = await explorer().load('./hookgenrc.json');\n    if (configFile?.isEmpty) {\n      spinner.warn();\n      console.warn(chalk.yellow(' └ codegen file is empty!'));\n      return Promise.resolve(undefined);\n    } else {\n      spinner.succeed();\n      configStore = new ConfigStore(configFile?.config as IConfig);\n      return configFile?.config as IConfig;\n    }\n  } catch (error) {\n    spinner.fail();\n    console.error(\n      chalk.bgRedBright(error ? error : ' └ Error get config file')\n    );\n    throw new Error(\n      chalk.bgRedBright(error ? error : ' └ Error get config file')\n    );\n  }\n}\n","import {camelize, capitalize} from '../../../helper/index.ts';\n\nexport function typeNameMaker(name: string, extra = 'Set') {\n  return 'I' + camelCase(name) + extra;\n}\nexport function typeNameSpaceMaker(\n  name: string,\n  namespace: string,\n  extra = 'Set'\n) {\n  return (\n    namespace + '.I' + capitalize(camelize(nameRefineWithDot(name))) + extra\n  );\n}\n\nexport function nameRefine(name: string) {\n  const reg = /[^a-zA-Z0-9]/g;\n\n  return name.toString().replace(reg, '');\n}\nexport function nameRefineWithDot(name: string) {\n  const reg = /[^a-zA-Z0-9.]/g;\n\n  return name.toString().replace(reg, '');\n}\n\nexport function nameStringify(name: string) {\n  return \"'\" + name + \"'\";\n}\n\nexport function camelCase(name: string) {\n  return capitalize(camelize(nameRefine(name)));\n}\n","import {OpenAPIV3} from 'openapi-types';\nimport {typeNameMaker} from '../func/Typescript/TypeNameMaker/index.ts';\nimport {Spec, isReference} from '../types.ts';\nconst repoTypes: string[] = [''];\nexport function capitalize(string: string) {\n  return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function camelize(str: string) {\n  return str\n    .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (word, index) => {\n      return index === 0 ? word.toLowerCase() : word.toUpperCase();\n    })\n    .replace(/\\s+/g, '');\n}\n\nexport const primitiveJs = (\n  key: 'string' | 'number' | 'boolean' | 'integer' | undefined\n) => {\n  switch (key) {\n    case 'integer':\n      return 'number';\n    case 'number':\n      return 'number';\n    case 'boolean':\n      return 'boolean';\n    case 'string':\n      return 'string';\n\n    default:\n      return 'unknown';\n  }\n};\n\nexport const definitionFullName = (defination: Spec) => {\n  return defination.info.title + '_' + defination.info.version;\n};\n\nexport const isDuplication = (name: string, data: string[]): boolean => {\n  const iName = typeNameMaker(name);\n  const include = repoTypes.some(item => item.includes(iName));\n  const dataInclude = data.some(item => item.includes(iName));\n  if (include && dataInclude) {\n    return true;\n  }\n  repoTypes.push(iName);\n  return false;\n};\n\nexport const isNullable = (\n  schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject\n): boolean | undefined => {\n  if (!isReference(schema)) {\n    return schema.nullable;\n  }\n  return undefined;\n};\n\nexport const definationComment = (defination: Spec, data: string[][]) => {\n  data.forEach(fileData => {\n    fileData.push(\n      `\\n/* ${defination.info.title} - ${defination.info.version} */\\n`\n    );\n  });\n};\nexport const getDefinationComment = (defination: Spec) => {\n  return ` ${defination.info.title} - ${defination.info.version}`;\n};\n\nexport function statusString(status: string) {\n  const okReg = /2\\d\\d/g;\n  const badReg = /400/g;\n  if (okReg.test(status)) {\n    return 'Ok';\n  }\n\n  if (badReg) {\n    return 'Bad';\n  }\n\n  return;\n}\n\nexport const pathSplit = (path: string) => {\n  const reg = /\\/{\\w*}/g;\n  const regBracketsParams = /{(.*?)}/g;\n  const refinePath = path.replace(reg, '');\n\n  const bracketsParams = path\n    .match(regBracketsParams)\n    ?.map(params => {\n      const name = params.replace(/{|}/g, '');\n      return 'By' + capitalize(name);\n    })\n    .join('');\n\n  const pathScope = refinePath.split('/') as string[];\n  const definationName = pathScope[1] as string;\n  const scopeName = pathScope[3] as string;\n  const itemName =\n    (((pathScope[pathScope.length - 1] as string) +\n      capitalize(pathScope[pathScope.length - 2])) as string) +\n    (bracketsParams || '');\n\n  return {pathScope, definationName, scopeName, itemName};\n};\n","import {OpenAPIV3} from 'openapi-types';\nimport chalk from 'chalk';\n\ntype PathItemObject = OpenAPIV3.PathItemObject;\nexport interface IPathIterator {\n  objectName: string;\n  objectPath: PathItemObject;\n}\nexport function PathIterator(Path: PathItemObject) {\n  if (!Path) {\n    console.warn(\n      chalk.yellow(\n        ' └ Defination Object must be include at least one Path but it is undefined!'\n      )\n    );\n    return;\n  }\n  const entries = Object.entries(Path);\n  const object = entries.map(cur => {\n    return {\n      objectName: cur[0],\n      objectPath: cur[1] as PathItemObject,\n    };\n  });\n\n  return object;\n}\n","import {OpenAPIV3} from 'openapi-types';\nimport chalk from 'chalk';\n\ntype PathItemObject = OpenAPIV3.PathItemObject;\ntype IMethod = Omit<\n  PathItemObject,\n  '$ref' | 'description' | 'parameters' | 'servers' | 'summary'\n>;\n\nexport interface MethodIterator {\n  objectName: string;\n  objectMethod: OpenAPIV3.OperationObject;\n}\nexport function MethodIterator(Method: IMethod | undefined) {\n  if (!Method) {\n    console.warn(\n      chalk.yellow(\n        ' └ Path Object must be include at least one method but it is undefined!'\n      )\n    );\n    return;\n  }\n  const entries = Object.entries(Method);\n  const object = entries.map(cur => {\n    return {\n      objectName: cur[0],\n      objectMethod: cur[1] as OpenAPIV3.OperationObject,\n    };\n  });\n\n  return object;\n}\n","import {OpenAPIV3} from 'openapi-types';\nimport {MethodIterator} from '../../func/MethodIterator/index.ts';\nimport {capitalize, pathSplit} from '../../helper/index.ts';\nimport {camelCase} from '../../func/Typescript/TypeNameMaker/index.ts';\nimport {configStore} from '../../config/index.ts';\nlet openedScope: string | undefined = undefined;\n\ninterface IApiTemplate {\n  path: string;\n  method: string;\n  media: OpenAPIV3.OperationObject;\n}\ntype PathItemObject = OpenAPIV3.PathItemObject;\nexport function fetcherTemplate({\n  objectName,\n  objectPath,\n  index,\n  len,\n}: {\n  objectName: string;\n  objectPath: PathItemObject;\n  index: number;\n  len: number;\n}) {\n  const {scopeName} = pathSplit(objectName);\n  const iteratedMathods = MethodIterator(objectPath);\n  const tagName = camelCase(\n    scopeName || iteratedMathods?.[0].objectMethod.tags?.[0] || '_NO_TAG'\n  );\n  const apis = iteratedMathods\n    ?.map(method => {\n      return apiTemplate({\n        method: method.objectName,\n        path: objectName,\n        media: method.objectMethod,\n      });\n    })\n    .join('');\n\n  if (openedScope !== tagName) {\n    const result =\n      index === 0\n        ? '_' + tagName + ':{' + apis\n        : ' \\n}, \\n _' + tagName + ':{' + apis;\n    openedScope = tagName;\n\n    return index + 1 === len ? result + '}, ' : result;\n  } else {\n    return index + 1 === len ? apis + '}, ' : apis;\n  }\n}\nexport const getContentBody = (\n  requestBody: OpenAPIV3.RequestBodyObject | undefined\n) => {\n  if (requestBody !== undefined && requestBody.content !== undefined) {\n    if (Object.keys(requestBody.content).some(item => item.includes('json'))) {\n      return 'Json';\n    } else if (\n      Object.keys(requestBody.content).some(item => item.includes('form-data'))\n    ) {\n      return 'FormData';\n    } else if (\n      Object.keys(requestBody.content).some(item => item.includes('text/plain'))\n    ) {\n      return 'Text';\n    } else if (\n      Object.keys(requestBody.content).some(item =>\n        item.includes('url-encoded')\n      )\n    ) {\n      return 'UrlEncoded';\n    }\n    return 'Json';\n  }\n  return 'Json';\n};\n\nexport function apiTemplate({\n  method,\n  path,\n  media: {description, deprecated, tags, summary},\n}: IApiTemplate) {\n  const {definationName, scopeName, itemName} = pathSplit(path);\n  if (!method) {\n    return '';\n  }\n\n  const tagName = camelCase(scopeName || tags?.[0] || '');\n  const typeRoot = `${camelCase(definationName)}.${\n    tagName ? tagName + '.' : ''\n  }${capitalize(method)}`;\n  const name = camelCase(itemName);\n  const requestType = `${typeRoot}.Request.`;\n  const responseType = `${typeRoot}.Response.`;\n\n  const axiosResponse = `\\n/**\n  ${deprecated ? '* @deprecated' : '* '}\n   * ${description ? description : 'No description'}\n   * @summary  ${summary}\n   * @tags ${tags}\n   * @name ${name}\n   * @request ${capitalize(method)}:${path}\n    ${deprecated ? '' : '*/ '}\n   ${\n     camelCase(method) + name\n   } :async (args?:${requestType}${name}, options?: AxiosOpt) => {\n     const {data: axiosData} = await this.request<${responseType}${name}, ${requestType}${name}>({\n      ...options,\n      path: \\`${path.replace('{', '${args?.params?.')}\\`,\n      method: '${capitalize(method)}',\n      body: getData(args?.data),\n      format: 'json',\n      query:{...getData(args?.params),...args?.header},\n    });\n     return axiosData${\n       configStore?.resourcePick ? '.' + configStore?.resourcePick : ''\n     }; \n  },\n  ${deprecated ? '*/' : ' '}`;\n\n  const ngResponse = `\\n/**\n  ${deprecated ? '* @deprecated' : '* '}\n   * ${description ? description : 'No description'}\n   * @summary  ${summary}\n   * @tags ${tags}\n   * @name ${name}\n   * @request ${capitalize(method)}:${path}\n    ${deprecated ? '' : '*/ '}\n   ${\n     camelCase(method) + name\n   } : (args?:${requestType}${name}, options?: HttpRequest<${responseType}${name}>) => {\n     return this.request<${responseType}${name}, ${requestType}${name}['data']>({\n      ...options,\n      url:\\`${path.replace('{', '${args?.params?.')}\\`,\n      method:'${capitalize(method)}',\n       body: args?.data,\n       responseType: 'json',\n       params: new HttpParams({ fromObject: args?.params }),\n       headers: new HttpHeaders({ ...args?.header }),\n    })\n     \n  },\n  ${deprecated ? '*/' : ' '}`;\n\n  return configStore?.hook === 'NG' ? ngResponse : axiosResponse;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAAkB;AAClB,IAAAC,cAAgB;;;ACHhB,sBAAqB;AACrB,gBAAe;;;ACDf,mBAAkB;AAClB,iBAAgB;AAChB,yBAA0B;AAG1B,IAAM,cAAU,WAAAC,SAAI,2BAA2B;AAGxC,IAAI,cAAuC;;;ADJlD,IAAAC,cAAgB;AAChB,IAAAC,gBAAkB;AAClB,sBAAoB;AAEpB,IAAM,UAAU,CAAO,OAImB,iBAJnB,KAImB,WAJnB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACF,GAA0C;AAExC,SAAO,IAAI,QAAQ,CAAO,SAAS,WAAW;AAC5C,UAAM,MAAM,UAAM,gBAAAC,SAAQ,QAAQ;AAClC,QAAI,KAAK;AACP,YAAM,OAAO,UAAAC,QACV,kBAAkB,WAAW,MAAM,QAAQ,EAC3C,KAAK,QAAQ,MAAM;AAClB,aAAK,MAAM,IAAI;AACf,aAAK,IAAI;AAAA,MACX,CAAC,EACA,KAAK,SAAS,WAAS;AACtB,eAAO,KAAK;AAAA,MACd,CAAC,EACA,KAAK,UAAU,MAAM;AACpB,gBAAQ,IAAI;AAAA,MACd,CAAC;AAAA,IACL;AAAA,EACF,EAAC;AACH;AAEA,IAAM,sBAAsB,CAC1B,MACA,WAAW,SACS;AApCtB;AAqCE,MAAI,UAAU;AACZ,UAAM,SAAS,UAAM,wBAAO,GAAG,IAAI,KAAI,wCAAa,QAAQ;AAC5D,WAAO,GAAG,MAAM;AAAA,EAClB;AACA,SAAO,GAAG,IAAI;AAChB;AAEA,SAAsB,KAAK,IAOb;AAAA,6CAPa;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,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,gCAAgC,WAAW,KAAK;AAGlD,oBAAM,gBAAgB,aAAa,WAAW,KAAK;AAEnD,oBAAM,OAAO,+CAAe,IAAI,CAAC,MAAM,UAAU;AAC/C,uBAAO,gBAAgB,iCAClB,OADkB;AAAA,kBAErB;AAAA,kBACA,KAAK,cAAc;AAAA,gBACrB,EAAC;AAAA,cACH;AACA,oBAAM,EAAC,eAAc,IAAI;AAAA,gBACvB,+CAAgB,GAAG;AAAA,cACrB;AACA,oBAAM,OACJ,MAAI,wCAAa,UAAS,OAAO,WAAW,MAAM;AAAA,yBACvC,UAAU,cAAc,CAAC;AAAA,yBACzB;AAAA,gBACb,WAAW,KAAK,MAAM,QAAQ,KAAK,EAAE;AAAA,cACvC,CAAC,SACC,wCAAa,UAAS,OAClB,wBACA,mEACN;AAAA;AAAA;AAAA,kBAII,6BAAM,KAAK,OACX;AAAA;AAAA;AAGF,oBAAM,KAAK;AAAA,gBACT;AAAA,gBACA,UAAU;AAAA,gBACV,UAAU,mBAAmB,UAAU,IAAI;AAAA,gBAC3C,WAAW,QAAM,wCAAa,UAAU;AAAA,cAC1C,CAAC;AAED,cAAAA,SAAQ,MAAM;AACd,cAAAE,SAAQ,IAAI;AAAA,YACd,EAAC;AAAA;AAAA,QACL;AAEA,cAAM,QAAQ,IAAI,OAAO;AAAA,MAC3B,SAAS,OAAO;AACd,QAAAF,SAAQ,KAAK;AACb,mBAAW;AACX,gBAAQ,MAAM,cAAAG,QAAM,UAAU,aAAQ,KAAK,CAAC;AAAA,MAC9C;AACA,MAAAH,SAAQ,OAAO;AACf,mBAAa,UAAUA,SAAQ,QAAQ;AACvC,cAAQ,QAAQ;AAAA,IAClB,EAAC;AAAA,EACH;AAAA;","names":["import_chalk","import_ora","ora","import_ora","import_chalk","makeDir","fs","spinner","ora","chalk","import_chalk","chalk","import_chalk","chalk","spinner","ora","resolve","chalk"]}