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SAAS,GAAG,KAAK,OAAQ,KAAK,YAAa,KAAK,OAAQ,GAChF,EAAO,eAAiB,SAAS,GAAG,KAAK,OAAQ,KAAK,YAAa,KAAK,OAAQ,EAAQ,EAAS,KAAK,UAC/F,CACT,CAAE,MAAO,GACP,MAAM,CACR,CACF,CAEA,UAAM,CAAK,EAAU,GACnB,EAAU,GAAW,CAAC,EACtB,IAAI,EAAU,GACV,EAAe,MAAC,EAA+C,MAAM,aAAa,KAAK,QAAU,CAAC,GACtG,IAAK,IAAI,KAAe,EAAc,CACpC,IAAI,EAAU,KAAK,OAAO,SAAS,GACnC,IACE,IAAI,QAAgB,KAAK,OAAO,KAAK,EAAQ,OAC7C,EAAQ,KAAK,IAEW,IAApB,EAAQ,SACV,EAAQ,KAAK,QAAQ,SAGC,IAApB,EAAQ,WACc,IAApB,EAAQ,QACV,EAAQ,KAAK,QAAQ,QAErB,EAAQ,KAAK,OAAO,qBAEhB,IAAI,SAAQ,GAAW,EAAQ,KAAK,MAAO,KAErD,CAAE,MAAO,GACP,MAAM,CACR,CACF,CACA,OAAO,CACT,EAGF,OAAO,QAAU","file":"/npm/kvandake-dockerode-compose@1.3.2/compose.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/kvandake-dockerode-compose@1.3.2/compose.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const { readYamlEnvSync } = require('yaml-env-defaults');\nconst stream = require('stream');\n\nconst secrets = require('./lib/secrets');\nconst volumes = require('./lib/volumes');\nconst configs = require('./lib/configs');\nconst networks = require('./lib/networks');\nconst services = require('./lib/services');\nconst tools = require('./lib/tools');\n\nclass Compose {\n  constructor(dockerode, file, projectName, customEnv = undefined) {\n    this.docker = dockerode;\n\n    if (file === undefined || projectName === undefined) {\n      throw new Error('please specify a file and a project name');\n    }\n\n    this.file = file;\n    this.projectName = projectName;\n    this.loadYaml = (path) => readYamlEnvSync(path, customEnv);\n\n    try {\n      this.recipe = this.loadYaml(file);\n    } catch (e) {\n      throw e;\n    }\n  }\n\n  async down(options) {\n    var output = {};\n    try { \n      output.file = this.file;\n      output.services = await services.down(this.docker, this.projectName, this.recipe, output, options);\n      output.networks = await networks.down(this.docker, this.projectName, this.recipe, output);\n      if (options !== undefined) {\n        if (options.volumes) {\n          output.volumes = await volumes.down(this.docker, this.projectName, this.recipe, output);\n        }\n      }\n      return output;\n    } catch (e) {\n      throw e;\n    }\n  }\n\n  async up(options) {\n    var output = {};\n    try {\n      output.file = this.file;\n      output.secrets = await secrets(this.docker, this.projectName, this.recipe, output);\n      output.volumes = await volumes.up(this.docker, this.projectName, this.recipe, output);\n      output.configs = await configs(this.docker, this.projectName, this.recipe, output);\n      output.networks = await networks.up(this.docker, this.projectName, this.recipe, output);\n      output.services = await services.up(this.docker, this.projectName, this.recipe, output, options, this.loadYaml);\n      return output;\n    } catch (e) {\n      throw e;\n    }\n  }\n\n  async pull(serviceN, options) {\n    options = options || {};\n    var streams = [];\n    var serviceNames = (serviceN === undefined || serviceN === null) ? tools.sortServices(this.recipe) : [serviceN];\n    for (var serviceName of serviceNames) {\n      var service = this.recipe.services[serviceName];\n      try {\n        var streami = await this.docker.pull(service.image);\n        streams.push(streami);\n\n        if (options.verbose === true) {\n          streami.pipe(process.stdout);\n        }\n\n        if (options.streams !== true) {\n          if (options.verbose === true) {\n            streami.pipe(process.stdout);\n          } else {\n            streami.pipe(stream.PassThrough());\n          }\n          await new Promise(fulfill => streami.once('end', fulfill));\n        }\n      } catch (e) {\n        throw e;\n      }\n    }\n    return streams;\n  }\n}\n\nmodule.exports = Compose;"]}