Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function deleteCaches(c,cb){
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
console.log('deleting cache ' + c.name)
opts.cache = c.name
console.log(opts)
cb(null,sdk.deletecache(opts))
}
function deleteApis(it,cb){
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
opts.directory = it.dir
opts.api = it.proxy
console.log('undeploying ' + opts.api)
sdk.undeploy(opts)
.then(function(){
console.log('undeployed ' + opts.api)
return sdk.delete(opts)
},function(err){
console.log(err)
return sdk.delete(opts)
})
.then(function(){
console.log('deleted ' + opts.api)
cb(null, 'done')
},function(err){
gulp.task('clean',function(){
opts.api = PROXY_NAME
opts.proxies = PROXY_NAME
opts.environments = 'test'
var sdk = apigeetool.getPromiseSDK()
return sdk.undeploy(opts)
.then(function(){ return sdk.delete(opts)})
console.log(app)
})
gulp.task('deploy',function(){
opts.api = proxy_name
return apigeetool.getPromiseSDK()
.deployProxy(opts)
})
function createApp(app){
var defer = q.defer()
var sdk = apigeetool.getPromiseSDK()
var opts=baseopts()
opts.name = app.name
opts.apiProducts = app.apiProducts
opts.email = app.email
opts.callback = app.callback
sdk.createApp(opts)
.then(function(appresponse){
defer.resolve(appresponse)
},function(err){
defer.reject(err)
})
return defer.promise
}
gulp.task('deploy',function(){
opts.api = proxy_name
return apigeetool.getPromiseSDK()
.deployProxy(opts)
})
function createApps(app,cb){
var sdk = apigeetool.getPromiseSDK()
var opts=baseopts()
opts.name = app.name
opts.apiProducts = app.apiProducts
opts.email = app.email
opts.callback = app.callback
cb(null,sdk.createApp(opts))
}
var apigeetool = require('apigeetool')
var lib = require('../../lib')
var async = require('async')
var lodash = require('lodash')
var sdk = apigeetool.getPromiseSDK()
var adapter = function () {
this.clean = clean
this.build = build
this.deploy = deploy
}
function build(context, resourceName, subResourceName, params, cb) {
lib.print('meta','building app resources')
cb()
}
function deploy(context, resourceName, subResourceName, params, cb) {
lib.print('meta','deploying app resources')
var config = context.getConfig(resourceName, subResourceName)
function createApp(app){
var defer = q.defer()
var sdk = apigeetool.getPromiseSDK()
var opts=baseopts()
opts.name = app.name
opts.apiProducts = app.apiProducts
opts.email = app.email
opts.callback = app.callback
sdk.createApp(opts)
.then(function(appresponse){
defer.resolve(appresponse)
},function(err){
defer.reject(err)
})
return defer.promise
}
function createProducts (prod,cb) {
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
prod.productName = prod.name,
opts.productDesc = prod.displayName
var proxies = ''
for(var p in prod.proxies) proxies += prod.proxies[p] +','
opts.proxies = proxies
var env = ''
for(var e in prod.environments) env += prod.environments[e] + ','
opts.environments = env
var scopes = ''
for(var s in prod.scopes) scopes += prod.scopes[s] + ','
opts.scopes =s
opts.productName = prod.name
cb(null,sdk.createProduct(opts))
}