## Functions

<dl>
<dt><a href="#getInputParams">getInputParams()</a></dt>
<dd><p>获取插件输入参数</p>
</dd>
<dt><a href="#getProjectName">getProjectName()</a></dt>
<dd><p>获取项目名称</p>
</dd>
<dt><a href="#getProjectAmeCN">getProjectAmeCN()</a></dt>
<dd><p>获取项目中文名</p>
</dd>
<dt><a href="#getPipelineId">getPipelineId()</a></dt>
<dd><p>获取流水线ID</p>
</dd>
<dt><a href="#getPipelineName">getPipelineName()</a></dt>
<dd><p>获取流水线名称</p>
</dd>
<dt><a href="#getPipelineBuildId">getPipelineBuildId()</a></dt>
<dd><p>获取流水线构建ID</p>
</dd>
<dt><a href="#getPipelineBuildNum">getPipelineBuildNum()</a></dt>
<dd><p>获取流水线构建号</p>
</dd>
<dt><a href="#getPipelineStartType">getPipelineStartType()</a></dt>
<dd><p>获取流水线启动方式</p>
</dd>
<dt><a href="#getPipelineStartUserId">getPipelineStartUserId()</a></dt>
<dd><p>获取流水线启动人员ID</p>
</dd>
<dt><a href="#getPipelineStartUserName">getPipelineStartUserName()</a></dt>
<dd><p>获取流水线启动人员名称</p>
</dd>
<dt><a href="#getPipelineTimeStartMills">getPipelineTimeStartMills()</a></dt>
<dd><p>获取流水线启动时间（毫秒）</p>
</dd>
<dt><a href="#getPipelineVersion">getPipelineVersion()</a></dt>
<dd><p>获取流水线编排版本</p>
</dd>
<dt><a href="#getBkWorkspace">getBkWorkspace()</a></dt>
<dd><p>获取流水线工作空间</p>
</dd>
<dt><a href="#getTestVersionFlag">getTestVersionFlag()</a></dt>
<dd><p>当前插件是否是测试版本标识</p>
</dd>
<dt><a href="#getSensitiveConf">getSensitiveConf(key)</a></dt>
<dd><p>获取插件敏感信息字段</p>
</dd>
<dt><a href="#getArtifactUrls">getArtifactUrls(artifactoryType, path)</a></dt>
<dd><p>获取已归档构件的下载链接</p>
</dd>
<dt><a href="#getArtifactProperties">getArtifactProperties(artifactoryType, path)</a></dt>
<dd><p>获取已归档构件的元数据</p>
</dd>
<dt><a href="#setArtifactProperties">setArtifactProperties(artifactoryType, path, properties)</a></dt>
<dd><p>设置已归档文件元数据</p>
</dd>
<dt><a href="#setOutput">setOutput(output)</a></dt>
<dd><p>设置 插件执行结果、输出参数</p>
</dd>
<dt><a href="#getCommits">getCommits()</a></dt>
<dd><p>获取当前构建下的代码变更记录</p>
</dd>
<dt><a href="#getCredential">getCredential(credentialId)</a></dt>
<dd><p>根据凭据ID，获取凭据内容</p>
</dd>
<dt><a href="#download">download(fileUrl, fileName)</a> ⇒ <code>String</code></dt>
<dd></dd>
<dt><a href="#upload">upload(downloadUrl, uploadUrl, params, headers, fileField)</a></dt>
<dd></dd>
<dt><a href="#sendRTX">sendRTX(receivers, title, body)</a></dt>
<dd></dd>
<dt><a href="#sendWechat">sendWechat(receivers, body)</a></dt>
<dd></dd>
<dt><a href="#sendEmail">sendEmail(receivers:, cc, body, title, contentType)</a></dt>
<dd></dd>
<dt><a href="#sendSMS">sendSMS(receivers, body:)</a></dt>
<dd></dd>
<dt><a href="#sendWework">sendWework(receivers, body, receiverType, textType)</a></dt>
<dd></dd>
<dt><a href="#sendWeworkMedia">sendWeworkMedia(receivers, mediaName, filePath, receiverType, mediaType)</a></dt>
<dd></dd>
<dt><a href="#getRepoInfo">getRepoInfo(repositoryId, repositoryType)</a></dt>
<dd></dd>
<dt><a href="#getOauthInfo">getOauthInfo(userId)</a></dt>
<dd><p>根据用户rtx获取代码库oauth信息</p>
</dd>
</dl>

<a name="getInputParams"></a>

## getInputParams()
获取插件输入参数

**Kind**: global function  
<a name="getProjectName"></a>

## getProjectName()
获取项目名称

**Kind**: global function  
<a name="getProjectAmeCN"></a>

## getProjectAmeCN()
获取项目中文名

**Kind**: global function  
<a name="getPipelineId"></a>

## getPipelineId()
获取流水线ID

**Kind**: global function  
<a name="getPipelineName"></a>

## getPipelineName()
获取流水线名称

**Kind**: global function  
<a name="getPipelineBuildId"></a>

## getPipelineBuildId()
获取流水线构建ID

**Kind**: global function  
<a name="getPipelineBuildNum"></a>

## getPipelineBuildNum()
获取流水线构建号

**Kind**: global function  
<a name="getPipelineStartType"></a>

## getPipelineStartType()
获取流水线启动方式

**Kind**: global function  
<a name="getPipelineStartUserId"></a>

## getPipelineStartUserId()
获取流水线启动人员ID

**Kind**: global function  
<a name="getPipelineStartUserName"></a>

## getPipelineStartUserName()
获取流水线启动人员名称

**Kind**: global function  
<a name="getPipelineTimeStartMills"></a>

## getPipelineTimeStartMills()
获取流水线启动时间（毫秒）

**Kind**: global function  
<a name="getPipelineVersion"></a>

## getPipelineVersion()
获取流水线编排版本

**Kind**: global function  
<a name="getBkWorkspace"></a>

## getBkWorkspace()
获取流水线工作空间

**Kind**: global function  
<a name="getTestVersionFlag"></a>

## getTestVersionFlag()
当前插件是否是测试版本标识

**Kind**: global function  
<a name="getSensitiveConf"></a>

## getSensitiveConf(key)
获取插件敏感信息字段

**Kind**: global function  

| Param | Type |
| --- | --- |
| key | <code>String</code> | 

<a name="getArtifactUrls"></a>

## getArtifactUrls(artifactoryType, path)
获取已归档构件的下载链接

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| artifactoryType | <code>String</code> | 构件源 PIPELINE 从本次已归档构件中获取, CUSTOM_DIR 从自定义版本仓库中获取 |
| path | <code>String</code> | 构件的相对路径 |

<a name="getArtifactProperties"></a>

## getArtifactProperties(artifactoryType, path)
获取已归档构件的元数据

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| artifactoryType | <code>String</code> | 构件源 PIPELINE 从本次已归档构件中获取, CUSTOM_DIR 从自定义版本仓库中获取 |
| path | <code>String</code> | 构件的相对路径 |

<a name="setArtifactProperties"></a>

## setArtifactProperties(artifactoryType, path, properties)
设置已归档文件元数据

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| artifactoryType | <code>String</code> | 构件源 PIPELINE 从本次已归档构件中获取, CUSTOM_DIR 从自定义版本仓库中获取 |
| path | <code>String</code> | 构件的相对路径 |
| properties | <code>Object</code> | 文件元数据 |

<a name="setOutput"></a>

## setOutput(output)
设置 插件执行结果、输出参数

**Kind**: global function  

| Param | Type |
| --- | --- |
| output | <code>Object</code> | 

<a name="getCommits"></a>

## getCommits()
获取当前构建下的代码变更记录

**Kind**: global function  
<a name="getCredential"></a>

## getCredential(credentialId)
根据凭据ID，获取凭据内容

**Kind**: global function  

| Param | Type |
| --- | --- |
| credentialId | <code>String</code> | 

<a name="download"></a>

## download(fileUrl, fileName) ⇒ <code>String</code>
**Kind**: global function  
**Summary**: 下载文件到本地  
**Returns**: <code>String</code> - filePathLocal 下载后存储的本地路径  

| Param | Type | Description |
| --- | --- | --- |
| fileUrl | <code>String</code> | 下载链接 |
| fileName | <code>String</code> | 本地储存的文件名，选填 |

<a name="upload"></a>

## upload(downloadUrl, uploadUrl, params, headers, fileField)
**Kind**: global function  
**Summary:**: 从仓库获取构件，并推送到第三方系统  

| Param | Type | Description |
| --- | --- | --- |
| downloadUrl | <code>String</code> | 仓库下载链接 |
| uploadUrl | <code>String</code> | 第三方系统地址 |
| params | <code>Object</code> | 请求参数 |
| headers | <code>Object</code> | 请求头部 |
| fileField | <code>String</code> | 文件字段名称 |

<a name="sendRTX"></a>

## sendRTX(receivers, title, body)
**Kind**: global function  
**Summary:**: 发送企业微信通知  

| Param | Type | Description |
| --- | --- | --- |
| receivers | <code>Array</code> \| <code>String</code> | 接收人集合 |
| title | <code>string</code> | 通知标题 |
| body | <code>string</code> | 通知内容 |

<a name="sendWechat"></a>

## sendWechat(receivers, body)
**Kind**: global function  
**Summary:**: 发送微信通知  

| Param | Type | Description |
| --- | --- | --- |
| receivers | <code>Array</code> \| <code>String</code> | 接收人集合 |
| body | <code>string</code> | 通知内容 |

<a name="sendEmail"></a>

## sendEmail(receivers:, cc, body, title, contentType)
**Kind**: global function  
**Summary:**: 发送邮件通知  

| Param | Type | Description |
| --- | --- | --- |
| receivers: | <code>Array</code> \| <code>String</code> | 接收人集合 |
| cc | <code>string</code> | 抄送人集合 |
| body | <code>string</code> | 通知内容 |
| title | <code>string</code> | 通知标题 |
| contentType | <code>string</code> | TEXT普通文本  HTML html |

<a name="sendSMS"></a>

## sendSMS(receivers, body:)
**Kind**: global function  
**Summary:**: 发送短信通知  

| Param | Type | Description |
| --- | --- | --- |
| receivers | <code>Array</code> \| <code>String</code> | : 接收人集合 |
| body: | <code>String</code> | 通知内容 |

<a name="sendWework"></a>

## sendWework(receivers, body, receiverType, textType)
**Kind**: global function  
**Summary:**: 发送企业微信文本通知  

| Param | Type | Description |
| --- | --- | --- |
| receivers | <code>Array</code> \| <code>String</code> | : 接收人集合 |
| body | <code>String</code> | 通知内容 |
| receiverType | <code>String</code> | 接收人类型，默认值："single"，企业微信人员名称: single, 企业微信群类型：group |
| textType | <code>String</code> | 通知内容文本类型，默认值："text", 普通文本： text, markdown文本: markdown |

<a name="sendWeworkMedia"></a>

## sendWeworkMedia(receivers, mediaName, filePath, receiverType, mediaType)
**Kind**: global function  
**Summary:**: 发送企业微信多媒体文件  

| Param | Type | Description |
| --- | --- | --- |
| receivers | <code>Array</code> \| <code>String</code> | : 接收人集合 |
| mediaName | <code>String</code> | 文件名称 |
| filePath | <code>String</code> | 需要发送的文件路径 |
| receiverType | <code>String</code> | 接收人类型，默认值："single"，企业微信人员名称: single, 企业微信群类型：group |
| mediaType | <code>String</code> | 通知内容文本类型，默认值："image", [image, voice, video, file] |

<a name="getRepoInfo"></a>

## getRepoInfo(repositoryId, repositoryType)
**Kind**: global function  
**Summary:**: 根据代码库ID或者别名获取代码库信息  

| Param | Type | Description |
| --- | --- | --- |
| repositoryId | <code>string</code> | ID或Name内容，可在蓝盾代码库服务获得具体内容 |
| repositoryType | <code>string</code> | 支持两种类型：ID 代码库hashId， NAME 代码库别名， 默认类型是ID |

<a name="getOauthInfo"></a>

## getOauthInfo(userId)
根据用户rtx获取代码库oauth信息

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| userId | <code>string</code> | 用户RTX |

