diff --git a/package.json b/package.json index 6108eab..0342902 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@serverless/tencent-laravel", "description": "Tencent Cloud Laravel Serverless Component", - "version": "0.1.2", + "version": "0.1.3", "main": "serverless.js", "publishConfig": { "access": "public" @@ -47,8 +47,8 @@ }, "dependencies": { "@serverless/core": "^1.1.1", - "@serverless/tencent-apigateway": "^2.0.0", - "@serverless/tencent-scf": "^2.0.2", + "@serverless/tencent-apigateway": "^2.0.4", + "@serverless/tencent-scf": "^2.0.9", "ext": "^1.4.0", "type": "^2.0.0" }, diff --git a/src/index.js b/src/index.js index 6ee6558..e8367ae 100644 --- a/src/index.js +++ b/src/index.js @@ -64,6 +64,7 @@ class TencentLaravel extends Component { const tencentCloudFunction = await this.load('@serverless/tencent-scf') const tencentApiGateway = await this.load('@serverless/tencent-apigateway') + inputs.fromClientRemark = inputs.fromClientRemark || 'tencent-laravel' const tencentCloudFunctionOutputs = await tencentCloudFunction(inputs) const apigwParam = { serviceName: inputs.serviceName, @@ -94,6 +95,7 @@ class TencentLaravel extends Component { apigwParam.endpoints[0].auth = inputs.apigatewayConf.auth } + apigwParam.fromClientRemark = inputs.fromClientRemark || 'tencent-laravel' const tencentApiGatewayOutputs = await tencentApiGateway(apigwParam) const outputs = { region: inputs.region, @@ -111,13 +113,16 @@ class TencentLaravel extends Component { return outputs } - async remove() { + async remove(inputs = {}) { this.context.status('Removing') + const removeInput = { + fromClientRemark: inputs.fromClientRemark || 'tencent-laravel' + } const tencentCloudFunction = await this.load('@serverless/tencent-scf') const tencentApiGateway = await this.load('@serverless/tencent-apigateway') - await tencentCloudFunction.remove() - await tencentApiGateway.remove() + await tencentCloudFunction.remove(removeInput) + await tencentApiGateway.remove(removeInput) this.state = {} await this.save()