Skip to content

Commit c460bf3

Browse files
committed
update
1 parent 3604f92 commit c460bf3

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/lib/index.js":{"size":689,"mtime":1549010110884,"results":{"filePath":"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/lib/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"hashOfConfig":"1icshje"},"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/lib/package/kinesis/compileKinesisProxy.js":{"size":194,"mtime":1549010670041,"results":{"filePath":"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/lib/package/kinesis/compileKinesisProxy.js","messages":[{"ruleId":"no-unused-vars","severity":2,"message":"'serviceProxy' is defined but never used.","line":6,"column":64,"nodeType":"Identifier","endLine":6,"endColumn":76}],"errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"hashOfConfig":"1icshje"},"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/lib/utils.js":{"size":252,"mtime":1549010517992,"results":{"filePath":"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/lib/utils.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"hashOfConfig":"1icshje"},"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/prettier.config.js":{"size":125,"mtime":1549005304573,"results":{"filePath":"/Users/horike/src/sls-proxy-plugin/custom_serverless_plugins/serverless-apigateway-service-proxy/prettier.config.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"hashOfConfig":"1icshje"}}

lib/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
'use strict'
2+
const utils = require('./utils')
3+
const compileKinesisProxy = require('./package/kinesis/compileKinesisProxy')
24

35
class ServerlessApigatewayServiceProxy {
46
constructor(serverless, options) {
@@ -8,6 +10,13 @@ class ServerlessApigatewayServiceProxy {
810
this.service = this.serverless.service.service
911
this.region = this.provider.getRegion()
1012
this.stage = this.provider.getStage()
13+
Object.assign(this, compileKinesisProxy, utils)
14+
15+
this.hooks = {
16+
'package:compileEvents': async () => {
17+
await this.compileKinesisProxy()
18+
}
19+
}
1120
}
1221
}
1322

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
const BbPromise = require('bluebird')
3+
4+
module.exports = {
5+
async compileKinesisProxy() {
6+
await BbPromise.all(this.getAllServiceProxies().map(async () => {}))
7+
}
8+
}

lib/utils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict'
2+
3+
module.exports = {
4+
getAllServiceProxies() {
5+
if (this.serverless.service.custom && this.serverless.service.custom.apiGatewayServiceProxy) {
6+
return this.serverless.service.custom.apiGatewayServiceProxy
7+
}
8+
return []
9+
}
10+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "serverless-apigateway-service-proxy",
33
"version": "0.0.1",
44
"description": "The Serverless Framewrok plugin for supporting AWS service proxy integration of API Gateway",
5-
"main": "index.js",
5+
"main": "lib/index.js",
66
"scripts": {
77
"lint": "eslint .",
88
"test": "jest tests.js",

0 commit comments

Comments
 (0)