From dbe782f79016cbcbe45461c0240bb1365073ba5f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 23 Aug 2020 11:22:57 +0530 Subject: [PATCH 1/2] removed feedMask as it causing issue with trigger creation --- deploy/lib/deployTriggers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/lib/deployTriggers.js b/deploy/lib/deployTriggers.js index 7706ee2..efc4074 100644 --- a/deploy/lib/deployTriggers.js +++ b/deploy/lib/deployTriggers.js @@ -25,7 +25,7 @@ module.exports = { deployTriggers() { const triggers = this.getTriggers(this.serverless.service.triggers); - if(triggers.length) { + if (triggers.length) { this.serverless.cli.log('Deploying Triggers...'); } @@ -35,7 +35,7 @@ module.exports = { }, getTriggers(triggers) { - const feedMask = { feed: undefined }; + return Object.keys(triggers) .map(t => { const trigger = triggers[t]; @@ -49,7 +49,7 @@ module.exports = { }, }); } - return Object.assign(trigger, feedMask); + return trigger; }); }, }; From 22361f6a39243f6b4b360f679365b3980a5639cf Mon Sep 17 00:00:00 2001 From: Sathish Soundararajan Date: Tue, 10 Nov 2020 14:44:24 +0530 Subject: [PATCH 2/2] fix for apigw issue when using packages in function name --- deploy/lib/deployApiGw.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/deploy/lib/deployApiGw.js b/deploy/lib/deployApiGw.js index 5548e06..faa8443 100644 --- a/deploy/lib/deployApiGw.js +++ b/deploy/lib/deployApiGw.js @@ -14,10 +14,10 @@ module.exports = { this.serverless.cli.log(`Deployed API Gateway Route: ${JSON.stringify(route)}`); } }).catch(err => { - throw new this.serverless.classes.Error( - `Failed to deploy API Gateway route due to error: ${err.message}` - ); - }) + throw new this.serverless.classes.Error( + `Failed to deploy API Gateway route due to error: ${err.message}` + ); + }) }); }, @@ -27,21 +27,24 @@ module.exports = { .then(ow => ow.actions.list()) .then(allActions => { - for(let path in swagger.paths) { - for(let verb in swagger.paths[path]) { - const operation = swagger.paths[path][verb] + for (let path in swagger.paths) { + for (let verb in swagger.paths[path]) { + const operation = swagger.paths[path][verb] if (operation['x-openwhisk'].namespace === '_') { const swaggerAction = operation['x-openwhisk'] const action = allActions.find(item => item.name === swaggerAction.action) - swaggerAction.namespace = action.namespace - swaggerAction.url = swaggerAction.url.replace(/web\/_/, `web/${action.namespace}`) + + const namespace = action.namespace.split("/")[0] + + swaggerAction.namespace = namespace + swaggerAction.url = swaggerAction.url.replace(/web\/_/, `web/${namespace}`) const id = operation.operationId const stmts = swagger["x-ibm-configuration"].assembly.execute[0]['operation-switch'].case const stmt = stmts.find(stmt => stmt.operations[0] === id) - const invoke = stmt.execute[stmt.execute.length -1].invoke - invoke['target-url'] = invoke['target-url'].replace(/web\/_/, `web/${action.namespace}`) + const invoke = stmt.execute[stmt.execute.length - 1].invoke + invoke['target-url'] = invoke['target-url'].replace(/web\/_/, `web/${namespace}`) } } }