{"id":18248175,"url":"https://github.com/serverless-components/tencent-types","last_synced_at":"2025-06-25T22:35:07.866Z","repository":{"id":42695044,"uuid":"390949069","full_name":"serverless-components/tencent-types","owner":"serverless-components","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-01T05:08:17.000Z","size":211,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-14T15:36:43.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless-components.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-30T05:59:10.000Z","updated_at":"2021-12-27T03:09:06.000Z","dependencies_parsed_at":"2022-08-24T02:00:15.377Z","dependency_job_id":null,"html_url":"https://github.com/serverless-components/tencent-types","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-components","download_url":"https://codeload.github.com/serverless-components/tencent-types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247918704,"owners_count":21018041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:36:09.568Z","updated_at":"2025-04-08T19:51:12.087Z","avatar_url":"https://github.com/serverless-components.png","language":"JavaScript","readme":"# tencent-component-types\n\nThis repo contains types used to validate `serverless.yml` and an SCF instance used to sync types to our redis database.\nDesign doc: https://hackmd.io/4q5NJy6pRse5xfM9E0Tkrw\n\n## 配置说明\n\n配置示例: [./scf@0.0.4.yml](./scf@0.0.4.yml)\n\n### 支持的类型\n\n| type     | 可选的限制条件\t\t\t\t\t|\n| ---  | ---  |\n| string   | required, min, max, regex, allow                                |\n| number   | required, min, max, allow                                       |\n| boolean  | required                                                  |\n| object   | required                                                      |\n| array    | required, min, max                                              |\n| datetime | required                                                     |\n| url      | required                                                     |\n\n\n### TYPE YML 支持的字段列表\n\n| field        | 必填 | 备注                         |\n| ------------ | ---- | ---------------------------- |\n| message      | 否   | 全局消息，每一次部署都展示给用户   |\n| messageLevel | 否   | 默认 `warning`(不中断部署)，可设置为 `error`                |\n| inputs       | 否   | 对 inputs 内容进行校验的规则 |\n\n\n#### inputs 中支持的字段\n\n| type     | 必填 | 示例                                            | 备注        |\n| -------- | ---- | ----------------------------------------------- | ----------- |\n| type     | 是   | string/number/boolean/object/array/datetime/url |             |\n| required | 否   |                                                 | 默认 false  |\n| rules    | 否   | 用户填写多个规则                 |    数组类型         |\n| items    | 否   |                                                 | 数组类型    |\n| keys     | 否   |                                                 | Object 类型 |\n\n#### 关于 message 和 level\n\n字段可以配置自定义的错误消息 `message`，和错误等级 `level`。`level` 默认为 `error` 等级，用户某字段的配置不符合规定时会中断用户部署。如果设为 `warning` 则只会提示用户，不会中断部署\n\n\u003e 只有一个规则时，可以将规则直接写在inputs字段条件中，不需要嵌套在 rules\n\n## Types 版本匹配规则\n\n1. 如果用户没有指定组件版本，使用该组件最新版 types 进行校验\n2. 如果用户指定了组件版本，使用的小于等于组件版本，并且是最新版的 types 进行校验\n\n## 关于用于同步 types 的 SCF instance\n\n除了配置必要的环境变量，在 invoke 之前需要在腾讯云控制台将 SCF 加入 redis 所在的私有网络(VPC)\n\n## How to use\n\n- To sync types to dev env: run [this workflow](https://github.com/serverless-components/tencent-types/actions/workflows/dev.yml)\n- To sync types to prod env: run [this workflow](https://github.com/serverless-components/tencent-types/actions/workflows/prod.yml)\n\n\n## 关于 multi-scf 服务端校验规则\n\n由于 multi-scf 校验规则的特殊性，除了定义在 types 中的校验规则，在服务端做了如下校验\n\n- functions 定义支持 object 类型和 array 类型\n- triggers 引用的 function 必须已经定义\n- 当 function.type 为 web 时，允许 function.handler 与 function.image 都不定义\n- function.handler 存在时，必须为字符串类型\n- function.memorySize 存在时，必须为数字类型且不小于 64\n- function.timeout 存在时，必须为数字类型且不小于1\n- environment 环境变量必须为 arryay，并且每个 item 必须包含 key, value 配置\n- 当 function.image 存在时，installDependency 不能为 true\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Ftencent-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-components%2Ftencent-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Ftencent-types/lists"}