> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:info

> 使用 arc:info 描述脚本元数据，包括列定义、输入参数以及脚本生成的输出。

export const siteNameShort = "知行之桥";

`arc:info` 关键字用来为脚本描述元数据。这些信息被应用程序用来实现对用户输入基本的错误检查和设置默认值。`arc:info` 关键字可包含以下内容：

* 列定义
* 脚本期望的输入参数
* 脚本产生的输出

## 脚本参数

以下的参数可以为脚本本身定义：

* **desc\[ription]**：脚本的描述。如果未提供描述，则使用脚本的名称。
* **title**：脚本的标题。如果未提供标题，则使用脚本的名称。
* **methods**：可以对脚本执行的 HTTP 方法。SELECT，INSERT，UPDATE 和 DELETE 分别对应 HTTP GET，POST，PUT／PATCH／MERGE 和 DELETE。
* **url**：脚本作者的 URL。
* **keywords**：描述脚本的关键词。

## 输入，输出和列参数

`arc:info` 关键字在其作用域中还有其它的参数，定义了列以及脚本输入和输出。
<Note>这些参数不是 {siteNameShort}Script 关键字，而是 `arc:info` 的其它信息。</Note>

### 输入

输入参数可以用作描述脚本的输入。

```xml theme={null}
<input
  name="name"
  desc="Example of an input parameter"
  default="defValue"
  req="true"
  values="value1, value2, value3"
  xs:type="string" 
/>
```

* **name**：输入的名称。一个含字母数字的字符串，还可以包含以下内容：
  * `#` 表示输入可以有多个值
  * `myprefix:\*` 表示一组具有相同前缀的输入
  * `\*` 表示任意的输入参数。
* **desc\[ription]**：对输入的简短描述。
* **xs:type**：输入的数据类型。支持 `string`，`int`，`double`，`datetime` 和 `boolean` 类型。
* **def\[ault]**：当输入值未在脚本调用中提供时，使用的默认值。
* **key**：输入是否是主键。
* **req\[uired]**：输入值是否是必需的。如果必需的输入未提供且没有默认值时，将会抛出错误。允许值为 `true` 和 `false`。
* **values**：输入允许值的列表，以逗号分隔。如果指定，当特定的 input 未能与允许值匹配到时，将会抛出错误。
* **alias**：输入的别名。
* **other**：前缀为 `other:` 的属性，可提供更多信息。这些其它属性可以是特定于运算器的。

### 输出

输出参数用来描述运算器的输出。然而，应用程序会忽略掉它们。因此，运算器的输出可以完全独立于在 info 块中定义的内容。

```xml theme={null}
<output  name="Id" 
         desc="The unique identifier of the record."
         xs:type="string"
         other:xPath="content/properties/Id" 
/>
```

* **name**：输出的名称。“myprefix:\*” 表示一组具有相同前缀的输出，“\*”表示任意的输出参数。
* **xs:type**：输出的数据类型。支持 string，int，double，datetime 和 boolean 类型。
* **desc\[ription]**：对输出的简短描述。
* **columnsize**: 字符串的最大字符长度或数字输出的精度。精度是数字的位数。
* **other**：前缀为 “other:” 的属性，可提供更多信息。例如，other:xPath 指定了在本地或远程资源中节点的 XPath。该 XPath 可以是相对于 RepeatElement 的。

## 示例

描述接收后事件的输入：

```xml theme={null}
<arc:info title="After Receive"  desc="This event is fired after receiving a file.">
  <input name="Filename"         desc="The name of the file that was sent." />
  <input name="FilePath"         desc="The path of the file that was received." />
  <input name="MessageId"        desc="The Id of the transmission." />
  <input name="ErrorMessage"     desc="If an error occurred, this will contain the error message." />
</arc:info>
```

## 另请参阅

* [arc:script](./op-arc-script)：创建一个脚本代码块。
* [arc:call](./op-arc-call)：调用脚本或运算器。
* [arc:set](./op-arc-set)：在对象中设置属性。
