{"version":3,"sources":["jsdelivr-header.js","/npm/zenapi-generate-api@1.0.11/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAOA,MAAM,GAAK,QAAQ,MACb,KAAO,QAAQ,QAGf,WAAa,QAAQ,0BAM3B,OAAO,QAAU,CACf,mBAAoB,IAClB,IAIE,OAFA,GAAG,WAAW,KAAK,QAAQ,UAAW,KAAM,YAAa,EAAM,KAAK,KAAM,GAAG,UAAU,KAAO,GAAG,UAAU,MAEpG,KAAK,QAAQ,UAAW,KAAM,YAAa,EAAM,KAAK,IAC/D,CAAE,MAAO,GAEP,OAAO,KAAK,QAAQ,UAAW,KAAM,YAAa,WACpD,GAEF,OAAQ,QAAQ,YAChB,QAAS,CAIP,kDAAmD,CACjD,SAAU,uBAIZ,+CAAgD,CAC9C,SAAU,oBAIZ,6CAA8C,CAC5C,SAAU,kBAKZ,qDAAsD,CACpD,SAAU,2BAIZ,+CAAgD,CAC9C,SAAU","file":"/npm/zenapi-generate-api@1.0.11/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/zenapi-generate-api@1.0.11/lib/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","'use strict';\n\n/**\n * Module dependencies\n */\n\n// Node.js core.\nconst fs = require('fs');\nconst path = require('path');\n\n// Local dependencies.\nconst routesJSON = require('../json/routes.json.js');\n\n/**\n * Generate a core API\n */\n\nmodule.exports = {\n  templatesDirectory: scope => {\n    try {\n      // Try to reach the path. If it fail, throw an error.\n      fs.accessSync(path.resolve(__dirname, '..', 'templates', scope.args.tpl), fs.constants.R_OK | fs.constants.W_OK);\n\n      return path.resolve(__dirname, '..', 'templates', scope.args.tpl);\n    } catch (e) {\n      // Default template is Mongoose\n      return path.resolve(__dirname, '..', 'templates', 'mongoose');\n    }\n  },\n  before: require('./before'),\n  targets: {\n\n    // Use the default `controller` file as a template for\n    // every generated controller.\n    ':folderPrefix/:folderName/controllers/:filename': {\n      template: 'controller.template'\n    },\n\n    // every generated controller.\n    ':folderPrefix/:folderName/services/:filename': {\n      template: 'service.template'\n    },\n\n    // Copy an empty JavaScript model where every functions will be.\n    ':folderPrefix/:folderName/models/:filename': {\n      template: 'model.template'\n    },\n\n    // Copy the generated JSON model for the connection,\n    // schema and attributes.\n    ':folderPrefix/:folderName/models/:filenameSettings': {\n      template: 'model.settings.template'\n    },\n\n    // Generate routes.\n    ':folderPrefix/:folderName/config/routes.json': {\n      jsonfile: routesJSON\n    }\n  }\n};\n"]}