@serverless/enterprise-plugin
Advanced tools
Comparing version 0.2.2-55-g7341d16 to 0.2.2-57-gb398540
@@ -49,4 +49,4 @@ "use strict"; | ||
sub, | ||
subDetails, | ||
type, | ||
subDetails, | ||
apigResource, | ||
@@ -157,37 +157,43 @@ apiId, | ||
sub = _step.value; | ||
type = Object.keys(sub)[0]; | ||
subDetails = {}; | ||
type = void 0; | ||
if (type === 'http') { | ||
apigResource = _lodash.default.find(cfnStack.Stacks[0].Outputs, function (_ref2) { | ||
var OutputKey = _ref2.OutputKey; | ||
return !OutputKey.endsWith('Websocket') && OutputKey.match(ctx.provider.naming.getServiceEndpointRegex()); | ||
}); | ||
apiId = apigResource && apigResource.OutputValue.split('https://')[1].split('.')[0]; | ||
subDetails = { | ||
path: sub.http.path, | ||
method: sub.http.method, | ||
cors: sub.http.cors, | ||
integration: sub.http.integration, | ||
restApiId: apiId | ||
}; | ||
} else if (sub[type] instanceof Object) { | ||
Object.assign(subDetails, sub[type]); | ||
if (typeof sub === 'string') { | ||
type = sub; | ||
} else { | ||
Object.assign(subDetails, { | ||
[type]: sub[type] | ||
}); | ||
} | ||
type = Object.keys(sub)[0]; | ||
if (type === 'websocket') { | ||
_apigResource = _lodash.default.find(cfnStack.Stacks[0].Outputs, function (_ref3) { | ||
var OutputKey = _ref3.OutputKey; | ||
return OutputKey.endsWith('Websocket') && OutputKey.match(ctx.provider.naming.getServiceEndpointRegex()); | ||
}); | ||
_apiId = _apigResource && _apigResource.OutputValue.split('wss://')[1].split('.')[0]; | ||
subDetails.websocketApiId = _apiId; | ||
if (type === 'http') { | ||
apigResource = _lodash.default.find(cfnStack.Stacks[0].Outputs, function (_ref2) { | ||
var OutputKey = _ref2.OutputKey; | ||
return !OutputKey.endsWith('Websocket') && OutputKey.match(ctx.provider.naming.getServiceEndpointRegex()); | ||
}); | ||
apiId = apigResource && apigResource.OutputValue.split('https://')[1].split('.')[0]; | ||
subDetails = { | ||
path: sub.http.path, | ||
method: sub.http.method, | ||
cors: sub.http.cors, | ||
integration: sub.http.integration, | ||
restApiId: apiId | ||
}; | ||
} else if (sub[type] instanceof Object) { | ||
Object.assign(subDetails, sub[type]); | ||
} else { | ||
Object.assign(subDetails, { | ||
[type]: sub[type] | ||
}); | ||
} | ||
if (type === 'websocket') { | ||
_apigResource = _lodash.default.find(cfnStack.Stacks[0].Outputs, function (_ref3) { | ||
var OutputKey = _ref3.OutputKey; | ||
return OutputKey.endsWith('Websocket') && OutputKey.match(ctx.provider.naming.getServiceEndpointRegex()); | ||
}); | ||
_apiId = _apigResource && _apigResource.OutputValue.split('wss://')[1].split('.')[0]; | ||
subDetails.websocketApiId = _apiId; | ||
} | ||
} | ||
deployment.setSubscription(_objectSpread({ | ||
type: type, | ||
type, | ||
function: fnName | ||
@@ -194,0 +200,0 @@ }, subDetails)); |
{ | ||
"name": "@serverless/enterprise-plugin", | ||
"version": "0.2.2-55-g7341d16", | ||
"version": "0.2.2-57-gb398540", | ||
"description": "The Serverless Enterprise plugin", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
564134
8346