Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
},
Expand Down
11 changes: 8 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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()
Expand Down