diff --git a/.eslintignore b/.eslintignore index 18f2b36..65c4725 100755 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ coverage dist node_modules +component diff --git a/.prettierignore b/.prettierignore index deca64c..fdb530a 100755 --- a/.prettierignore +++ b/.prettierignore @@ -21,3 +21,4 @@ env.js package-lock.json yarn.lock CHANGELOG.md +component diff --git a/docs/configure.md b/docs/configure.md index 706c8cf..c79c83f 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -43,16 +43,16 @@ pyramid: Main param description -| Param | Required/Optional | Default | Description | -| --------------------------------------------------- | :---------------: | :----------: | :------------------------------------------------------------------------------------------ | -| region | Optional | ap-guangzhou | | -| pyramidProjectName | Required | | Pyramid Projct Name | -| functionName | Optional | | ServerlessCloudFunction Name | -| serviceName | Optional | | API-Gateway service name, default to create a new serivce | -| serviceId | Optional | | API-Gateway service id, if it has will use this APII-Gateway service | -| code | Optional | | Default is current working directory | -| [functionConf](#funtionConf-param-description) | Optional | | Function configure | -| [apigatewayConf](#apigatewayConf-param-description) | Optional | | API-Gateway configure | +| Param | Required/Optional | Default | Description | +| --------------------------------------------------- | :---------------: | :----------: | :------------------------------------------------------------------- | +| region | Optional | ap-guangzhou | | +| pyramidProjectName | Required | | Pyramid Projct Name | +| functionName | Optional | | ServerlessCloudFunction Name | +| serviceName | Optional | | API-Gateway service name, default to create a new serivce | +| serviceId | Optional | | API-Gateway service id, if it has will use this APII-Gateway service | +| code | Optional | | Default is current working directory | +| [functionConf](#funtionConf-param-description) | Optional | | Function configure | +| [apigatewayConf](#apigatewayConf-param-description) | Optional | | API-Gateway configure | ### funtionConf param description diff --git a/package.json b/package.json index 94e8ce0..4a905e2 100755 --- a/package.json +++ b/package.json @@ -47,8 +47,8 @@ }, "dependencies": { "@serverless/core": "^1.1.1", - "@serverless/tencent-apigateway": "^2.0.4", - "@serverless/tencent-scf": "^2.0.9", + "@serverless/tencent-apigateway": "^2.1.4", + "@serverless/tencent-scf": "^3.0.0", "ext": "^1.4.0", "type": "^2.0.0" }, diff --git a/serverless.js b/serverless.js index cdf4a46..d8cc561 100644 --- a/serverless.js +++ b/serverless.js @@ -46,6 +46,7 @@ class TencentPyramid extends Component { `PyramidComponent_${random({ length: 6 })}` inputs.codeUri = ensureString(inputs.code, { isOptional: true }) || process.cwd() inputs.region = ensureString(inputs.region, { default: 'ap-guangzhou' }) + inputs.namespace = ensureString(inputs.namespace, { default: 'default' }) inputs.include = ensureIterable(inputs.include, { default: [], ensureItem: ensureString }) inputs.exclude = ensureIterable(inputs.exclude, { default: [], ensureItem: ensureString }) inputs.apigatewayConf = ensurePlainObject(inputs.apigatewayConf, { default: {} }) @@ -114,10 +115,12 @@ class TencentPyramid extends Component { method: 'ANY', function: { isIntegratedResponse: true, - functionName: tencentCloudFunctionOutputs.Name + functionName: tencentCloudFunctionOutputs.Name, + functionNamespace: inputs.namespace } } - ] + ], + customDomain: inputs.apigatewayConf.customDomain } if (inputs.apigatewayConf && inputs.apigatewayConf.auth) {