@things-factory/integration-base 6.1.99 → 6.1.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/engine/task/http-get.js +4 -7
- package/dist-server/engine/task/http-get.js.map +1 -1
- package/dist-server/engine/task/http-post.js +1 -0
- package/dist-server/engine/task/http-post.js.map +1 -1
- package/dist-server/engine/task/log.js +23 -9
- package/dist-server/engine/task/log.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/integration/concept/template-literal.ja.md +31 -0
- package/helps/integration/concept/template-literal.ko.md +31 -0
- package/helps/integration/concept/template-literal.md +31 -0
- package/helps/integration/concept/template-literal.zh.md +31 -0
- package/helps/integration/task/book-up-scenario.md +5 -2
- package/helps/integration/task/http-get.ja.md +31 -0
- package/helps/integration/task/http-get.ko.md +28 -0
- package/helps/integration/task/http-get.md +28 -0
- package/helps/integration/task/http-get.ms.md +28 -0
- package/helps/integration/task/http-get.zh.md +28 -0
- package/helps/integration/task/http-post.ja.md +35 -0
- package/helps/integration/task/http-post.ko.md +34 -0
- package/helps/integration/task/http-post.md +35 -0
- package/helps/integration/task/http-post.ms.md +37 -0
- package/helps/integration/task/http-post.zh.md +35 -0
- package/helps/integration/task/log.ja.md +11 -0
- package/helps/integration/task/log.ko.md +16 -0
- package/helps/integration/task/log.md +12 -11
- package/helps/integration/task/log.ms.md +15 -0
- package/helps/integration/task/log.zh.md +11 -0
- package/package.json +7 -7
- package/server/engine/task/http-get.ts +6 -10
- package/server/engine/task/http-post.ts +2 -0
- package/server/engine/task/log.ts +27 -10
@@ -11,3 +11,34 @@ const name = 'Alice'
|
|
11
11
|
const greeting = `Hello, ${name}!`
|
12
12
|
console.log(greeting) // 出力: Hello, Alice!
|
13
13
|
```
|
14
|
+
|
15
|
+
### タスクで使用できる変数には 'data'、'variables'、および 'domain' が含まれます。
|
16
|
+
|
17
|
+
- data
|
18
|
+
- タスク(ステップ)を含むシナリオのコンテキストデータで、各ステップの名前と実行結果を属性として、シナリオインスタンス内でキーと値のペアとして保持します。
|
19
|
+
- variables
|
20
|
+
- タスク(ステップ)を含むシナリオのコンテキストデータで、シナリオインスタンスが開始される際に渡されたパラメータの名前と値を、キーと値のペアとして保持します。
|
21
|
+
- domain
|
22
|
+
- タスク(ステップ)を含むシナリオのコンテキストデータで、このタスクが実行されるテナントに関する情報を保持します。
|
23
|
+
|
24
|
+
```
|
25
|
+
// テンプレートリテラルを使用して URL パスを構築する例。
|
26
|
+
https://abc.com:8000/fetch-tools?search=${variables.search}
|
27
|
+
```
|
28
|
+
|
29
|
+
```
|
30
|
+
// テンプレートリテラルを使用してログ文字列を構築する例。
|
31
|
+
result code: ${data.result.code}
|
32
|
+
```
|
33
|
+
|
34
|
+
```
|
35
|
+
// テンプレートリテラルを使用して GraphQL クエリを構築する例。
|
36
|
+
query {
|
37
|
+
fetchTools(search="${variables.search}") {
|
38
|
+
items {
|
39
|
+
id
|
40
|
+
name
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
```
|
@@ -11,3 +11,34 @@ const name = 'Alice'
|
|
11
11
|
const greeting = `Hello, ${name}!`
|
12
12
|
console.log(greeting) // 출력: Hello, Alice!
|
13
13
|
```
|
14
|
+
|
15
|
+
### 태스크에서 활용할 수 있는 변수는 'data', 'variables' 그리고, 'domain' 등이 있다.
|
16
|
+
|
17
|
+
- data
|
18
|
+
- 태스크(step)를 포함하는 시나리오의 컨텍스트 데이터로서 시나리오 인스턴스에서 수행한 각 스텝의 이름과 실행 결과를 속성의 key와 value로 유지하는 object이다.
|
19
|
+
- variables
|
20
|
+
- 태스크(step)를 포함하는 시나리오의 컨텍스트 데이터로서 시나리오 인스턴스가 시작될 때 넘겨진 파라미터들의 이름과 값을 속성의 key와 value로 유지하는 object이다.
|
21
|
+
- domain
|
22
|
+
- 태스크(step)를 포함하는 시나리오의 컨텍스트 데이터로서 이 태스크가 실행되는 테넌시 정보를 가지고 있다.
|
23
|
+
|
24
|
+
```
|
25
|
+
// 템플릿 리터럴을 활용해서 URL path에 활용하는 예시.
|
26
|
+
https://abc.com:8000/fetch-tools?search=${variables.search}
|
27
|
+
```
|
28
|
+
|
29
|
+
```
|
30
|
+
// 템플릿 리터럴을 활용해서 logging string에 활용하는 예시.
|
31
|
+
result code: ${data.result.code}
|
32
|
+
```
|
33
|
+
|
34
|
+
```
|
35
|
+
// 템플릿 리터럴을 활용해서 graphq query에 활용하는 예시.
|
36
|
+
query {
|
37
|
+
fetchTools(search="${variables.search}") {
|
38
|
+
items {
|
39
|
+
id
|
40
|
+
name
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
```
|
@@ -11,3 +11,34 @@ const name = 'Alice'
|
|
11
11
|
const greeting = `Hello, ${name}!`
|
12
12
|
console.log(greeting) // Output: Hello, Alice!
|
13
13
|
```
|
14
|
+
|
15
|
+
### Variables that can be used in tasks include 'data', 'variables', and 'domain'.
|
16
|
+
|
17
|
+
- data
|
18
|
+
- Contextual data for the scenario containing the task (step), maintaining the names and execution results of each step as attributes with key-value pairs in the scenario instance.
|
19
|
+
- variables
|
20
|
+
- Contextual data for the scenario containing the task (step), maintaining the names and values of parameters passed when the scenario instance starts as attributes with key-value pairs.
|
21
|
+
- domain
|
22
|
+
- Contextual data for the scenario containing the task (step), holding information about the tenancy in which this task is executed.
|
23
|
+
|
24
|
+
```
|
25
|
+
// Example of using template literals to construct a URL path.
|
26
|
+
https://abc.com:8000/fetch-tools?search=${variables.search}
|
27
|
+
```
|
28
|
+
|
29
|
+
```
|
30
|
+
// Example of using template literals to construct a logging string.
|
31
|
+
result code: ${data.result.code}
|
32
|
+
```
|
33
|
+
|
34
|
+
```
|
35
|
+
// Example of using template literals to construct a GraphQL query.
|
36
|
+
query {
|
37
|
+
fetchTools(search="${variables.search}") {
|
38
|
+
items {
|
39
|
+
id
|
40
|
+
name
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
```
|
@@ -11,3 +11,34 @@ const name = 'Alice'
|
|
11
11
|
const greeting = `你好,${name}!`
|
12
12
|
console.log(greeting) // 输出:你好,Alice!
|
13
13
|
```
|
14
|
+
|
15
|
+
### 任务中可以使用的变量包括 'data'、'variables' 和 'domain'。
|
16
|
+
|
17
|
+
- data
|
18
|
+
- 作为包含任务(步骤)的场景的上下文数据,以属性的键值对形式在场景实例中维护每个步骤的名称和执行结果。
|
19
|
+
- variables
|
20
|
+
- 作为包含任务(步骤)的场景的上下文数据,以属性的键值对形式在场景实例中维护在场景实例启动时传递的参数的名称和值。
|
21
|
+
- domain
|
22
|
+
- 作为包含任务(步骤)的场景的上下文数据,保存有关执行此任务的租户信息。
|
23
|
+
|
24
|
+
```
|
25
|
+
// 使用模板字面量构建 URL 路径的示例。
|
26
|
+
https://abc.com:8000/fetch-tools?search=${variables.search}
|
27
|
+
```
|
28
|
+
|
29
|
+
```
|
30
|
+
// 使用模板字面量构建日志字符串的示例。
|
31
|
+
result code: ${data.result.code}
|
32
|
+
```
|
33
|
+
|
34
|
+
```
|
35
|
+
// 使用模板字面量构建 GraphQL 查询的示例。
|
36
|
+
query {
|
37
|
+
fetchTools(search="${variables.search}") {
|
38
|
+
items {
|
39
|
+
id
|
40
|
+
name
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
```
|
@@ -4,10 +4,12 @@
|
|
4
4
|
|
5
5
|
## parameters
|
6
6
|
|
7
|
-
- scenario
|
7
|
+
- scenario
|
8
|
+
- 필수입력값
|
8
9
|
- [지연 큐](../concept/pending-queue.md)에 추가될 지연 시나리오를 선택한다.
|
9
|
-
- delay
|
10
|
+
- delay
|
10
11
|
|
12
|
+
- 필수입력값
|
11
13
|
- 지연 시간을 초 seconds 단위로 지정한다. -1로 지정하면, 지연없이 바로 [pickup](./pick-pending-scenario.md) 될 수 있다.
|
12
14
|
- 이 값에는 변수를 적용할 수 있다.
|
13
15
|
- 예시
|
@@ -22,3 +24,4 @@
|
|
22
24
|
- 시나리오에 변수로 전달될 [accessor](../concept/data-accessor.md) 값을 설정한다.
|
23
25
|
- tag
|
24
26
|
- 시나리오에 붙여질 태그를 설정한다.
|
27
|
+
- 예약된 시나리오들은 이 태그값으로 그룹핑되므로, 시나리오큐 모니터링기능에서 이 태그값으로 조회할 수 있다.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# HTTP Get タスク
|
2
|
+
|
3
|
+
これは HTTP プロトコルの GET メソッドを実行するタスクです。
|
4
|
+
|
5
|
+
## パラメータ
|
6
|
+
|
7
|
+
- パス(Path)
|
8
|
+
|
9
|
+
- HTTP 呼び出しの対象パスを設定します。
|
10
|
+
- パスは、接続のエンドポイントにパスを追加して URL を完成させます。
|
11
|
+
- 接続のエンドポイントが 'https://abc.com:8080' で、パス(path)が '/users/def' の場合、URL は 'https://abc.com:8080/users/def' になります。
|
12
|
+
- パスは[テンプレートリテラル](../concept/template-literal.md)をサポートしており、data、variables、domain などの変数を使用できます。
|
13
|
+
|
14
|
+
- ヘッダー(Headers)
|
15
|
+
|
16
|
+
- リクエストに含めるヘッダー値を追加します。
|
17
|
+
- 各ヘッダーの値は[テンプレートリテラル](../concept/template-literal.md)をサポートしており、data、variables、domain などの変数を使用できます。
|
18
|
+
|
19
|
+
- 検索パラメータ(Search Params)
|
20
|
+
|
21
|
+
- リクエストに含める検索パラメータ値を追加します。
|
22
|
+
- 各パラメータの値は[テンプレートリテラル](../concept/template-literal.md)をサポートしており、data、variables、domain などの変数を使用できます。
|
23
|
+
- 設定された検索パラメータは、HTTP GET メソッドの呼び出し時に URL の検索部分にエンコードされます。
|
24
|
+
|
25
|
+
## 結果
|
26
|
+
|
27
|
+
- HTTP GET メソッドの呼び出し結果のデータ形式は、応答の "content-type" ヘッダーの設定に
|
28
|
+
|
29
|
+
従います。
|
30
|
+
|
31
|
+
- HTTP 応答の 'content-type' ヘッダーの値が 'application/json' の場合、オブジェクト形式で返されます。それ以外の場合は文字列形式で返されます。
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# HTTP Get Task
|
2
|
+
|
3
|
+
HTTP 프로토콜 get 메쏘드를 실행하는 테스크이다.
|
4
|
+
|
5
|
+
## parameters
|
6
|
+
|
7
|
+
- 경로(path)
|
8
|
+
|
9
|
+
- HTTP 호출 대상 경로를 설정한다.
|
10
|
+
- 지정된 커넥션의 endpoint를 베이스로 path가 추가되어 URL이 완성된다.
|
11
|
+
- connection endpoint가 'https://abc.com:8080' 이고, 경로(path)가 '/users/def' 이라면, URL 'https://abc.com:8080/users/def' 가 된다.
|
12
|
+
- 경로(path)는 [템플릿 리터럴](../concept/template-literal.md)이 적용되므로, data, variables, domain 등의 변수를 활용할 수 있다.
|
13
|
+
|
14
|
+
- Headers
|
15
|
+
|
16
|
+
- 요청시에 포함될 header 값을 추가한다.
|
17
|
+
- 각 헤더의 값은 [템플릿 리터럴](../concept/template-literal.md)이 적용되므로, data, variables, domain 등의 변수를 활용할 수 있다.
|
18
|
+
|
19
|
+
- Search Params
|
20
|
+
|
21
|
+
- 요청시에 포함될 search params 값을 추가한다.
|
22
|
+
- 각 파라미터의 값은 [템플릿 리터럴](../concept/template-literal.md)이 적용되므로, data, variables, domain 등의 변수를 활용할 수 있다.
|
23
|
+
- 설정된 Search Params는 HTTP get 메쏘드 호출시 URL의 search 파트로 엔코딩된다.
|
24
|
+
|
25
|
+
## 결과
|
26
|
+
|
27
|
+
- HTTP Get 메쏘드의 호출 결과 데이타 형식은 응답의 "content-type" 헤더의 설정을 따른다.
|
28
|
+
- HTTP 응답의 'content-type' 헤더 값이 'application/json'이면 오브젝트 형식이되며, 그 외는 모두 문자열로 리턴된다.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# HTTP Get Task
|
2
|
+
|
3
|
+
This is a task that executes the HTTP protocol's GET method.
|
4
|
+
|
5
|
+
## Parameters
|
6
|
+
|
7
|
+
- Path
|
8
|
+
|
9
|
+
- Sets the target path for the HTTP call.
|
10
|
+
- The URL is completed by adding the path to the base of the connection's endpoint.
|
11
|
+
- If the connection endpoint is 'https://abc.com:8080' and the path is '/users/def', then the URL becomes 'https://abc.com:8080/users/def'.
|
12
|
+
- The path supports [template literals](../concept/template-literal.md), allowing the use of variables such as data, variables, and domain.
|
13
|
+
|
14
|
+
- Headers
|
15
|
+
|
16
|
+
- Adds header values to be included in the request.
|
17
|
+
- The value of each header supports [template literals](../concept/template-literal.md), allowing the use of variables such as data, variables, and domain.
|
18
|
+
|
19
|
+
- Search Params
|
20
|
+
|
21
|
+
- Adds search parameter values to be included in the request.
|
22
|
+
- The value of each parameter supports [template literals](../concept/template-literal.md), allowing the use of variables such as data, variables, and domain.
|
23
|
+
- The configured search params are encoded into the URL's search part when making the HTTP GET method call.
|
24
|
+
|
25
|
+
## Result
|
26
|
+
|
27
|
+
- The data format of the HTTP GET method's response follows the setting of the "content-type" header in the response.
|
28
|
+
- If the "content-type" header value of the HTTP response is 'application/json', it returns an object format. Otherwise, it returns a string format.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Tugasan HTTP Get
|
2
|
+
|
3
|
+
Ini adalah tugas yang melaksanakan kaedah GET protokol HTTP.
|
4
|
+
|
5
|
+
## Parameter
|
6
|
+
|
7
|
+
- Laluan (Path)
|
8
|
+
|
9
|
+
- Menetapkan laluan sasaran untuk panggilan HTTP.
|
10
|
+
- URL disempurnakan dengan menambah laluan kepada pangkalan titik akhir sambungan.
|
11
|
+
- Jika titik akhir sambungan adalah 'https://abc.com:8080' dan laluan adalah '/users/def', maka URL menjadi 'https://abc.com:8080/users/def'.
|
12
|
+
- Laluan menyokong [literal templat](../concept/template-literal.md), membenarkan penggunaan pembolehubah seperti data, variables, dan domain.
|
13
|
+
|
14
|
+
- Headers
|
15
|
+
|
16
|
+
- Menambah nilai tajuk yang akan disertakan dalam permintaan.
|
17
|
+
- Nilai setiap tajuk menyokong [literal templat](../concept/template-literal.md), membenarkan penggunaan pembolehubah seperti data, variables, dan domain.
|
18
|
+
|
19
|
+
- Parameter Carian (Search Params)
|
20
|
+
|
21
|
+
- Menambah nilai parameter carian yang akan disertakan dalam permintaan.
|
22
|
+
- Nilai setiap parameter menyokong [literal templat](../concept/template-literal.md), membenarkan penggunaan pembolehubah seperti data, variables, dan domain.
|
23
|
+
- Parameter carian yang dikonfigurasi akan dikodkan ke bahagian carian URL semasa panggilan kaedah HTTP GET.
|
24
|
+
|
25
|
+
## Hasil
|
26
|
+
|
27
|
+
- Format data daripada kaedah respons HTTP GET mengikut tetapan tajuk "content-type" dalam respons.
|
28
|
+
- Jika nilai tajuk "content-type" respons HTTP adalah 'application/json', ia mengembalikan format objek. Jika tidak, ia mengembalikan format rentetan.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# HTTP Get 任务
|
2
|
+
|
3
|
+
这是一个执行 HTTP 协议的 GET 方法的任务。
|
4
|
+
|
5
|
+
## 参数
|
6
|
+
|
7
|
+
- 路径(Path)
|
8
|
+
|
9
|
+
- 设置 HTTP 调用的目标路径。
|
10
|
+
- 通过将路径添加到连接的端点的基础上,构成完整的 URL。
|
11
|
+
- 如果连接的端点是 'https://abc.com:8080',路径(path)是 '/users/def',那么 URL 将变为 'https://abc.com:8080/users/def'。
|
12
|
+
- 路径支持[模板文字(template literals)](../concept/template-literal.md),允许使用诸如 data、variables 和 domain 等变量。
|
13
|
+
|
14
|
+
- Headers
|
15
|
+
|
16
|
+
- 添加要包含在请求中的标头值。
|
17
|
+
- 每个标头的值都支持[模板文字(template literals)](../concept/template-literal.md),允许使用诸如 data、variables 和 domain 等变量。
|
18
|
+
|
19
|
+
- Search Params
|
20
|
+
|
21
|
+
- 添加要包含在请求中的搜索参数值。
|
22
|
+
- 每个参数的值都支持[模板文字(template literals)](../concept/template-literal.md),允许使用诸如 data、variables 和 domain 等变量。
|
23
|
+
- 配置的搜索参数在进行 HTTP GET 方法调用时将被编码到 URL 的搜索部分中。
|
24
|
+
|
25
|
+
## 结果
|
26
|
+
|
27
|
+
- HTTP GET 方法响应的数据格式遵循响应中的 "content-type" 标头的设置。
|
28
|
+
- 如果 HTTP 响应的 "content-type" 标头值是 'application/json',则返回对象格式。否则,返回字符串格式。
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# HTTP Post タスク
|
2
|
+
|
3
|
+
これは HTTP プロトコルの POST メソッドを実行するタスクです。
|
4
|
+
|
5
|
+
## パラメータ
|
6
|
+
|
7
|
+
- パス(Path)
|
8
|
+
|
9
|
+
- HTTP 呼び出しの対象パスを設定します。
|
10
|
+
- パスは、接続のエンドポイントにパスを追加して URL を完成させます。
|
11
|
+
- 接続のエンドポイントが 'https://abc.com:8080' で、パス(path)が '/users/def' の場合、URL は 'https://abc.com:8080/users/def' になります。
|
12
|
+
- パスは[テンプレートリテラル](../concept/template-literal.md)をサポートしており、data、variables、domain などの変数を使用できます。
|
13
|
+
|
14
|
+
- ヘッダー(Headers)
|
15
|
+
|
16
|
+
- リクエストに含めるヘッダー値を追加します。
|
17
|
+
- 各ヘッダーの値は[テンプレートリテラル](../concept/template-literal.md)をサポートしており、data、variables、domain などの変数を使用できます。
|
18
|
+
|
19
|
+
- コンテンツタイプ(Content Type)
|
20
|
+
|
21
|
+
- POST リクエストの内容の形式を設定します。
|
22
|
+
- この形式は、リクエストに含まれる 'content-type' ヘッダーに追加されます。
|
23
|
+
- 'text/plain':リクエストの本文形式がテキストを示します。
|
24
|
+
- 'application/json':リクエストの本文形式が JSON オブジェクトを示します。
|
25
|
+
- 'application/x-www-form-urlencoded':リクエストの本文形式が検索パラメータ形式を示します。
|
26
|
+
|
27
|
+
- アクセサ [accessor](../concept/data-accessor.md)
|
28
|
+
|
29
|
+
- POST リクエストの本文として使用されるシナリオコンテキスト内のデータからステップ(step)を設定します。
|
30
|
+
- そのステップの結果値がこのリクエストの本文として使用されます。
|
31
|
+
|
32
|
+
## 結果
|
33
|
+
|
34
|
+
- HTTP POST メソッドの呼び出し結果のデータ形式は、応答の "content-type" ヘッダーの設定に従います。
|
35
|
+
- HTTP 応答の 'content-type' ヘッダーの値が 'application/json' の場合、オブジェクト形式で返されます。それ以外の場合は文字列形式で返されます。
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# HTTP Post Task
|
2
|
+
|
3
|
+
HTTP 프로토콜 post 메쏘드를 실행하는 테스크이다.
|
4
|
+
|
5
|
+
## parameters
|
6
|
+
|
7
|
+
- 경로(path)
|
8
|
+
|
9
|
+
- HTTP 호출 대상 경로를 설정한다.
|
10
|
+
- 지정된 커넥션의 endpoint를 베이스로 path가 추가되어 URL이 완성된다.
|
11
|
+
- connection endpoint가 'https://abc.com:8080' 이고, 경로(path)가 '/users/def' 이라면, URL 'https://abc.com:8080/users/def' 가 된다.
|
12
|
+
- 경로(path)는 [템플릿 리터럴](../concept/template-literal.md)이 적용되므로, data, variables, domain 등의 변수를 활용할 수 있다.
|
13
|
+
|
14
|
+
- Headers
|
15
|
+
|
16
|
+
- 요청시에 포함될 header 값을 추가한다.
|
17
|
+
- 각 헤더의 값은 [템플릿 리터럴](../concept/template-literal.md)이 적용되므로, data, variables, domain 등의 변수를 활용할 수 있다.
|
18
|
+
|
19
|
+
- Content Type
|
20
|
+
|
21
|
+
- Post 요청의 내용이 어떤 형식인지를 설정한다.
|
22
|
+
- 이 형식은 요청시에 포함될 헤더의 'content-type'에 추가된다.
|
23
|
+
- 'text/plain' : 요청의 body 형식이 텍스트임을 의미한다.
|
24
|
+
- 'application/json': 요청의 body 형식이 JSON오브젝트임을 의미한다.
|
25
|
+
- 'application/x-www-form-urlencoded' : 요청의 body형식이 search parameter형식임을 의미한다.
|
26
|
+
|
27
|
+
- 접근자 [accessor](../concept/data-accessor.md)
|
28
|
+
- 시나리오 컨텍스트의 data중에서 Post 요청의 body로 사용될 스텝(step)을 설정한다.
|
29
|
+
- 해당 스텝의 결과값이 이 요청의 body로 사용된다.
|
30
|
+
|
31
|
+
## 결과
|
32
|
+
|
33
|
+
- HTTP Post 메쏘드의 호출 결과 데이타 형식은 응답의 "content-type" 헤더의 설정을 따른다.
|
34
|
+
- HTTP 응답의 'content-type' 헤더 값이 'application/json'이면 오브젝트 형식이되며, 그 외는 모두 문자열로 리턴된다.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# HTTP Post Task
|
2
|
+
|
3
|
+
This is a task that executes the HTTP protocol's POST method.
|
4
|
+
|
5
|
+
## Parameters
|
6
|
+
|
7
|
+
- Path
|
8
|
+
|
9
|
+
- Sets the target path for the HTTP call.
|
10
|
+
- The URL is completed by adding the path to the base of the connection's endpoint.
|
11
|
+
- If the connection endpoint is 'https://abc.com:8080' and the path is '/users/def', then the URL becomes 'https://abc.com:8080/users/def'.
|
12
|
+
- The path supports [template literals](../concept/template-literal.md), allowing the use of variables such as data, variables, and domain.
|
13
|
+
|
14
|
+
- Headers
|
15
|
+
|
16
|
+
- Adds header values to be included in the request.
|
17
|
+
- The value of each header supports [template literals](../concept/template-literal.md), allowing the use of variables such as data, variables, and domain.
|
18
|
+
|
19
|
+
- Content Type
|
20
|
+
|
21
|
+
- Sets the format of the content in the POST request.
|
22
|
+
- This format is added to the 'content-type' header included in the request.
|
23
|
+
- 'text/plain': Indicates that the body format of the request is text.
|
24
|
+
- 'application/json': Indicates that the body format of the request is a JSON object.
|
25
|
+
- 'application/x-www-form-urlencoded': Indicates that the body format of the request is in the search parameter format.
|
26
|
+
|
27
|
+
- Accessor [accessor](../concept/data-accessor.md)
|
28
|
+
|
29
|
+
- Sets the step from the data in the scenario context that will be used as the body of the POST request.
|
30
|
+
- The result value of that step is used as the body of this request.
|
31
|
+
|
32
|
+
## Result
|
33
|
+
|
34
|
+
- The data format of the HTTP POST method's response follows the setting of the "content-type" header in the response.
|
35
|
+
- If the "content-type" header value of the HTTP response is 'application/json', it returns an object format. Otherwise, it returns a string format.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Tugasan HTTP Post
|
2
|
+
|
3
|
+
Ini adalah tugas yang melaksanakan kaedah POST protokol HTTP.
|
4
|
+
|
5
|
+
## Parameter
|
6
|
+
|
7
|
+
- Laluan (
|
8
|
+
|
9
|
+
Path)
|
10
|
+
|
11
|
+
- Menetapkan laluan sasaran untuk panggilan HTTP.
|
12
|
+
- URL disempurnakan dengan menambah laluan kepada pangkalan titik akhir sambungan.
|
13
|
+
- Jika titik akhir sambungan adalah 'https://abc.com:8080' dan laluan adalah '/users/def', maka URL menjadi 'https://abc.com:8080/users/def'.
|
14
|
+
- Laluan menyokong [literal templat](../concept/template-literal.md), membenarkan penggunaan pembolehubah seperti data, variables, dan domain.
|
15
|
+
|
16
|
+
- Headers
|
17
|
+
|
18
|
+
- Menambah nilai tajuk yang akan disertakan dalam permintaan.
|
19
|
+
- Nilai setiap tajuk menyokong [literal templat](../concept/template-literal.md), membenarkan penggunaan pembolehubah seperti data, variables, dan domain.
|
20
|
+
|
21
|
+
- Jenis Kandungan (Content Type)
|
22
|
+
|
23
|
+
- Menetapkan format kandungan dalam permintaan POST.
|
24
|
+
- Format ini ditambahkan kepada tajuk 'content-type' yang disertakan dalam permintaan.
|
25
|
+
- 'text/plain': Menunjukkan bahawa format badan permintaan adalah teks.
|
26
|
+
- 'application/json': Menunjukkan bahawa format badan permintaan adalah objek JSON.
|
27
|
+
- 'application/x-www-form-urlencoded': Menunjukkan bahawa format badan permintaan adalah dalam format parameter carian.
|
28
|
+
|
29
|
+
- Aksesori [accessor](../concept/data-accessor.md)
|
30
|
+
|
31
|
+
- Menetapkan langkah daripada data dalam konteks senario yang akan digunakan sebagai badan permintaan POST.
|
32
|
+
- Nilai hasil langkah itu digunakan sebagai badan permintaan ini.
|
33
|
+
|
34
|
+
## Hasil
|
35
|
+
|
36
|
+
- Format data daripada kaedah respons HTTP POST mengikut tetapan tajuk "content-type" dalam respons.
|
37
|
+
- Jika nilai tajuk "content-type" respons HTTP adalah 'application/json', ia mengembalikan format objek. Jika tidak, ia mengembalikan format rentetan.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# HTTP Post 任务
|
2
|
+
|
3
|
+
这是一个执行 HTTP 协议的 POST 方法的任务。
|
4
|
+
|
5
|
+
## 参数
|
6
|
+
|
7
|
+
- 路径(Path)
|
8
|
+
|
9
|
+
- 设置 HTTP 调用的目标路径。
|
10
|
+
- 通过将路径添加到连接的端点的基础上,构成完整的 URL。
|
11
|
+
- 如果连接的端点是 'https://abc.com:8080',路径(path)是 '/users/def',那么 URL 将变为 'https://abc.com:8080/users/def'。
|
12
|
+
- 路径支持[模板文字(template literals)](../concept/template-literal.md),允许使用诸如 data、variables 和 domain 等变量。
|
13
|
+
|
14
|
+
- 头部(Headers)
|
15
|
+
|
16
|
+
- 添加要包含在请求中的标头值。
|
17
|
+
- 每个标头的值都支持[模板文字(template literals)](../concept/template-literal.md),允许使用诸如 data、variables 和 domain 等变量。
|
18
|
+
|
19
|
+
- 内容类型(Content Type)
|
20
|
+
|
21
|
+
- 设置 POST 请求中内容的格式。
|
22
|
+
- 此格式将添加到请求中的 'content-type' 标头。
|
23
|
+
- 'text/plain':表示请求的正文格式为文本。
|
24
|
+
- 'application/json':表示请求的正文格式为 JSON 对象。
|
25
|
+
- 'application/x-www-form-urlencoded':表示请求的正文格式为搜索参数格式。
|
26
|
+
|
27
|
+
- 访问器 [accessor](../concept/data-accessor.md)
|
28
|
+
|
29
|
+
- 设置场景上下文中用作 POST 请求正文的步骤(step)。
|
30
|
+
- 该步骤的结果值将用作此请求的正文。
|
31
|
+
|
32
|
+
## 结果
|
33
|
+
|
34
|
+
- HTTP POST 方法响应的数据格式遵循响应中的 "content-type" 标头的设置。
|
35
|
+
- 如果 HTTP 响应的 "content-type" 标头值是 'application/json',则返回对象格式。否则,返回字符串格式。
|
@@ -0,0 +1,11 @@
|
|
1
|
+
## パラメータ
|
2
|
+
|
3
|
+
- メッセージ
|
4
|
+
- 必要に応じて特定のメッセージをログとして残すために使用します。メッセージログが有効であるためには、アクセサが空である必要があります。
|
5
|
+
- 設定したメッセージはログの内容に含まれます。
|
6
|
+
- [テンプレートリテラル](../concept/template-literal.md)が適用され、data、variables、domain などの変数を使用できます。
|
7
|
+
- アクセサ [accessor](../concept/data-accessor.md)
|
8
|
+
- シナリオ内のステップの名前を示し、そのステップの結果値を出力したい場合は、このアクセサを使用します。
|
9
|
+
- このアクセサの結果はログに記録されます。
|
10
|
+
- レベル
|
11
|
+
- ログメッセージのレベルを設定します。レベルには'info'、'warn'、'error'のいずれかを選択できます。
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# log Task
|
2
|
+
|
3
|
+
시나리오의 상태가 값의 변화를 확인하기 위해서 로그를 출력하는 기능이다.
|
4
|
+
해당 로그는 어플리케이션의 logs 폴더에 저장되며 'scenario-시나리오명'으로 시작하는 로그 파일에 저장된다.
|
5
|
+
|
6
|
+
## parameters
|
7
|
+
|
8
|
+
- 메시지
|
9
|
+
- 특정한 메시지를 로그로 남겨둘 필요가 있을 경우 사용하며 메시지의 로그가 유효하기 위해서는 접근자가 빈 상태로 있어야 한다.
|
10
|
+
- 설정된 메시지는 로그의 내용에 남겨진다.
|
11
|
+
- [템플릿 리터럴](../concept/template-literal.md)이 적용되므로, data, variables, domain 등의 변수를 활용할 수 있다.
|
12
|
+
- 접근자 [accessor](../concept/data-accessor.md)
|
13
|
+
- 시나리오 내의 하나의 스텝이름으로, 해당 스텝의 결과 값을 출력하고자 할 경우에 접근자를 사용한다.
|
14
|
+
- 이 접근자 결과는 로그에 남겨진다.
|
15
|
+
- 레벨
|
16
|
+
- 로그 메시지의 레벨을 설정할 수 있다. 레벨은 'info', 'warn', 'error' 중에 하나를 선택할 수 있다.
|
@@ -1,14 +1,15 @@
|
|
1
|
-
#
|
1
|
+
# Log Task
|
2
2
|
|
3
|
-
|
4
|
-
해당 로그는 어플리케이션의 logs 폴더에 저장되며 'scenario-시나리오명'으로 시작하는 로그 파일에 저장된다.
|
3
|
+
This feature is used to log changes in the value of a scenario's state for monitoring purposes. The generated logs are stored in the 'logs' folder of the application and are saved in log files starting with 'scenario-scenarioName'.
|
5
4
|
|
6
|
-
##
|
5
|
+
## Parameters
|
7
6
|
|
8
|
-
-
|
9
|
-
-
|
10
|
-
-
|
11
|
-
-
|
12
|
-
|
13
|
-
-
|
14
|
-
-
|
7
|
+
- Message
|
8
|
+
- Used to leave a specific message as a log if necessary, and for the message log to be valid, the accessor must be empty.
|
9
|
+
- The configured message will be included in the log's content.
|
10
|
+
- [Template literals](../concept/template-literal.md) are applied, allowing the use of variables like data, variables, and domain.
|
11
|
+
- Accessor [accessor](../concept/data-accessor.md)
|
12
|
+
- Represents the name of a step within the scenario; when you want to output the result value of that step, use this accessor.
|
13
|
+
- The result of this accessor will be recorded in the log.
|
14
|
+
- Level
|
15
|
+
- Sets the level of the log message. The levels can be 'info', 'warn', or 'error'.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
## Tugasan Log
|
2
|
+
|
3
|
+
Fungsi ini digunakan untuk mencatat perubahan dalam nilai status sesuatu senario untuk tujuan pemantauan. Log yang dihasilkan disimpan dalam folder 'logs' aplikasi dan disimpan dalam fail log yang bermula dengan 'senario-namaSenario'.
|
4
|
+
|
5
|
+
## Parameter
|
6
|
+
|
7
|
+
- Mesej
|
8
|
+
- Digunakan untuk meninggalkan mesej tertentu sebagai log jika perlu, dan untuk log mesej menjadi sah, accessor harus kosong.
|
9
|
+
- Mesej yang dikonfigurasi akan dimasukkan dalam kandungan log.
|
10
|
+
- [Literal templat](../concept/template-literal.md) digunakan, membenarkan penggunaan pemboleh ubah seperti data, variables, dan domain.
|
11
|
+
- Accessor [accessor](../concept/data-accessor.md)
|
12
|
+
- Mewakili nama langkah dalam senario; apabila anda ingin mengeluarkan nilai hasil langkah tersebut, gunakan accessor ini.
|
13
|
+
- Hasil accessor ini akan direkodkan dalam log.
|
14
|
+
- Tahap
|
15
|
+
- Menetapkan tahap mesej log. Tahap boleh menjadi 'info', 'warn', atau 'error'.
|
@@ -0,0 +1,11 @@
|
|
1
|
+
## 参数
|
2
|
+
|
3
|
+
- 消息
|
4
|
+
- 如果需要,在日志中留下特定消息,以便记录消息的日志有效,访问器必须为空。
|
5
|
+
- 配置的消息将包含在日志的内容中。
|
6
|
+
- 应用[模板文字](../concept/template-literal.md),允许使用变量如 data、variables 和 domain。
|
7
|
+
- 访问器 [accessor](../concept/data-accessor.md)
|
8
|
+
- 表示场景内某个步骤的名称;当您希望输出该步骤的结果值时,请使用此访问器。
|
9
|
+
- 此访问器的结果将被记录在日志中。
|
10
|
+
- 级别
|
11
|
+
- 设置日志消息的级别。级别可以是'info'、'warn'或'error'。
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/integration-base",
|
3
|
-
"version": "6.1.
|
3
|
+
"version": "6.1.101",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -26,12 +26,12 @@
|
|
26
26
|
},
|
27
27
|
"dependencies": {
|
28
28
|
"@apollo/client": "^3.6.9",
|
29
|
-
"@things-factory/api": "^6.1.
|
30
|
-
"@things-factory/auth-base": "^6.1.
|
29
|
+
"@things-factory/api": "^6.1.101",
|
30
|
+
"@things-factory/auth-base": "^6.1.101",
|
31
31
|
"@things-factory/env": "^6.1.99",
|
32
|
-
"@things-factory/oauth2-client": "^6.1.
|
33
|
-
"@things-factory/scheduler-client": "^6.1.
|
34
|
-
"@things-factory/shell": "^6.1.
|
32
|
+
"@things-factory/oauth2-client": "^6.1.101",
|
33
|
+
"@things-factory/scheduler-client": "^6.1.101",
|
34
|
+
"@things-factory/shell": "^6.1.101",
|
35
35
|
"async-mqtt": "^2.5.0",
|
36
36
|
"chance": "^1.1.11",
|
37
37
|
"cross-fetch": "^3.0.4",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"devDependencies": {
|
47
47
|
"@types/cron": "^2.0.1"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "1ecb1d6fca22c20751878c234b9139ff0dac7766"
|
50
50
|
}
|
@@ -68,17 +68,11 @@ async function HttpGet(step, { logger, data, domain, variables }) {
|
|
68
68
|
|
69
69
|
var response = await fetch(url, fetchOptions)
|
70
70
|
|
71
|
-
var responseData = await response.text()
|
72
|
-
|
73
|
-
const responseContentType = response.headers.get('content-type')
|
74
|
-
if (responseContentType && responseContentType.indexOf('application/json') !== -1) {
|
75
|
-
responseData = JSON.parse(responseData)
|
76
|
-
}
|
77
|
-
|
78
|
-
logger.info(`http-get : \n${JSON.stringify(responseData, null, 2)}`)
|
79
|
-
|
80
71
|
return {
|
81
|
-
data:
|
72
|
+
data:
|
73
|
+
response.ok && response.headers.get('content-type').includes('application/json')
|
74
|
+
? await response.json()
|
75
|
+
: await response.text()
|
82
76
|
}
|
83
77
|
}
|
84
78
|
|
@@ -100,4 +94,6 @@ HttpGet.parameterSpec = [
|
|
100
94
|
}
|
101
95
|
]
|
102
96
|
|
97
|
+
HttpGet.help = 'integration/task/http-get'
|
98
|
+
|
103
99
|
TaskRegistry.registerTaskHandler('http-get', HttpGet)
|