@things-factory/integration-base 6.2.44 → 6.2.49
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/connector/operato-connector.js +10 -7
- package/dist-server/engine/connector/operato-connector.js.map +1 -1
- package/dist-server/engine/types.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js +15 -9
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-type.js +2 -1
- package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/integration/connector/graphql-connector.ja.md +23 -0
- package/helps/integration/connector/graphql-connector.ko.md +23 -0
- package/helps/integration/connector/graphql-connector.ms.md +23 -0
- package/helps/integration/connector/graphql-connector.zh.md +23 -0
- package/helps/integration/connector/mqtt-connector.ja.md +17 -0
- package/helps/integration/connector/mqtt-connector.ko.md +17 -0
- package/helps/integration/connector/mqtt-connector.ms.md +17 -0
- package/helps/integration/connector/mqtt-connector.zh.md +17 -0
- package/helps/integration/connector/mssql-connector.ja.md +38 -0
- package/helps/integration/connector/mssql-connector.ko.md +38 -0
- package/helps/integration/connector/mssql-connector.ms.md +38 -0
- package/helps/integration/connector/mssql-connector.zh.md +38 -0
- package/helps/integration/connector/postgresql-connector.ja.md +34 -0
- package/helps/integration/connector/postgresql-connector.ko.md +34 -0
- package/helps/integration/connector/postgresql-connector.ms.md +34 -0
- package/helps/integration/connector/postgresql-connector.zh.md +34 -0
- package/helps/integration/connector/sqlite-connector.ja.md +17 -0
- package/helps/integration/connector/sqlite-connector.ko.md +17 -0
- package/helps/integration/connector/sqlite-connector.ms.md +17 -0
- package/helps/integration/connector/sqlite-connector.zh.md +17 -0
- package/helps/integration/task/book-up-scenario.ja.md +27 -0
- package/helps/integration/task/book-up-scenario.ko.md +27 -0
- package/helps/integration/task/book-up-scenario.md +21 -21
- package/helps/integration/task/book-up-scenario.ms.md +27 -0
- package/helps/integration/task/book-up-scenario.zh.md +27 -0
- package/helps/integration/task/csv-readline.ja.md +10 -0
- package/helps/integration/task/csv-readline.ko.md +10 -0
- package/helps/integration/task/csv-readline.md +5 -6
- package/helps/integration/task/csv-readline.ms.md +9 -0
- package/helps/integration/task/csv-readline.zh.md +9 -0
- package/helps/integration/task/data-mapper.ja.md +14 -0
- package/helps/integration/task/data-mapper.ko.md +14 -0
- package/helps/integration/task/data-mapper.md +11 -11
- package/helps/integration/task/data-mapper.ms.md +14 -0
- package/helps/integration/task/data-mapper.zh.md +14 -0
- package/helps/integration/task/database-query.ja.md +1 -1
- package/helps/integration/task/database-query.ko.md +1 -1
- package/helps/integration/task/database-query.md +1 -1
- package/helps/integration/task/database-query.ms.md +1 -1
- package/helps/integration/task/database-query.zh.md +1 -1
- package/helps/integration/task/empty-check.ja.md +10 -0
- package/helps/integration/task/empty-check.ko.md +10 -0
- package/helps/integration/task/empty-check.md +7 -7
- package/helps/integration/task/empty-check.ms.md +10 -0
- package/helps/integration/task/empty-check.zh.md +10 -0
- package/helps/integration/task/end.ja.md +7 -0
- package/helps/integration/task/end.ko.md +3 -0
- package/helps/integration/task/end.md +6 -2
- package/helps/integration/task/end.ms.md +7 -0
- package/helps/integration/task/end.zh.md +7 -0
- package/helps/integration/task/floating-point.ja.md +34 -0
- package/helps/integration/task/floating-point.ko.md +34 -0
- package/helps/integration/task/floating-point.md +1 -1
- package/helps/integration/task/floating-point.ms.md +34 -0
- package/helps/integration/task/floating-point.zh.md +34 -0
- package/helps/integration/task/goto.ja.md +8 -0
- package/helps/integration/task/goto.ko.md +8 -0
- package/helps/integration/task/goto.md +4 -4
- package/helps/integration/task/goto.ms.md +8 -0
- package/helps/integration/task/goto.zh.md +8 -0
- package/helps/integration/task/graphql-mutate.ja.md +1 -1
- package/helps/integration/task/graphql-mutate.ko.md +1 -1
- package/helps/integration/task/graphql-mutate.md +1 -1
- package/helps/integration/task/graphql-mutate.ms.md +1 -1
- package/helps/integration/task/graphql-mutate.zh.md +1 -1
- package/helps/integration/task/graphql-query.ja.md +1 -1
- package/helps/integration/task/graphql-query.ko.md +1 -1
- package/helps/integration/task/graphql-query.md +1 -1
- package/helps/integration/task/graphql-query.ms.md +1 -1
- package/helps/integration/task/graphql-query.zh.md +1 -1
- package/helps/integration/task/headless-scrap.ja.md +13 -0
- package/helps/integration/task/headless-scrap.ko.md +13 -0
- package/helps/integration/task/headless-scrap.md +10 -10
- package/helps/integration/task/headless-scrap.ms.md +13 -0
- package/helps/integration/task/headless-scrap.zh.md +13 -0
- package/helps/integration/task/http-get.ja.md +1 -1
- package/helps/integration/task/http-get.ko.md +1 -1
- package/helps/integration/task/http-get.md +1 -1
- package/helps/integration/task/http-get.ms.md +1 -1
- package/helps/integration/task/http-get.zh.md +1 -1
- package/helps/integration/task/http-post.ja.md +1 -1
- package/helps/integration/task/http-post.ko.md +1 -1
- package/helps/integration/task/http-post.md +1 -1
- package/helps/integration/task/http-post.ms.md +1 -1
- package/helps/integration/task/http-post.zh.md +1 -1
- package/helps/integration/task/local-graphql-mutate.ja.md +43 -0
- package/helps/integration/task/local-graphql-mutate.ko.md +44 -0
- package/helps/integration/task/local-graphql-mutate.md +10 -14
- package/helps/integration/task/local-graphql-mutate.ms.md +40 -0
- package/helps/integration/task/local-graphql-mutate.zh.md +40 -0
- package/helps/integration/task/local-graphql-query.ja.md +42 -0
- package/helps/integration/task/local-graphql-query.ko.md +44 -0
- package/helps/integration/task/local-graphql-query.md +10 -14
- package/helps/integration/task/local-graphql-query.ms.md +41 -0
- package/helps/integration/task/local-graphql-query.zh.md +40 -0
- package/helps/integration/task/log.ja.md +1 -1
- package/helps/integration/task/log.ko.md +1 -1
- package/helps/integration/task/log.md +1 -1
- package/helps/integration/task/log.ms.md +1 -1
- package/helps/integration/task/log.zh.md +1 -1
- package/helps/integration/task/mqtt-publish.ja.md +10 -0
- package/helps/integration/task/mqtt-publish.ko.md +10 -0
- package/helps/integration/task/mqtt-publish.md +7 -7
- package/helps/integration/task/mqtt-publish.ms.md +10 -0
- package/helps/integration/task/mqtt-publish.zh.md +10 -0
- package/helps/integration/task/mqtt-subscribe.ja.md +15 -0
- package/helps/integration/task/mqtt-subscribe.ko.md +15 -0
- package/helps/integration/task/mqtt-subscribe.md +12 -12
- package/helps/integration/task/mqtt-subscribe.ms.md +15 -0
- package/helps/integration/task/mqtt-subscribe.zh.md +15 -0
- package/helps/integration/task/oracle-procedure.ja.md +1 -1
- package/helps/integration/task/oracle-procedure.ko.md +1 -1
- package/helps/integration/task/oracle-procedure.md +1 -1
- package/helps/integration/task/oracle-procedure.ms.md +1 -1
- package/helps/integration/task/oracle-procedure.zh.md +1 -1
- package/helps/integration/task/pick-pending-scenario.ja.md +13 -0
- package/helps/integration/task/pick-pending-scenario.ko.md +13 -0
- package/helps/integration/task/pick-pending-scenario.md +10 -10
- package/helps/integration/task/pick-pending-scenario.ms.md +13 -0
- package/helps/integration/task/pick-pending-scenario.zh.md +13 -0
- package/helps/integration/task/publish.ja.md +16 -0
- package/helps/integration/task/publish.ko.md +16 -0
- package/helps/integration/task/publish.md +10 -10
- package/helps/integration/task/publish.ms.md +16 -0
- package/helps/integration/task/publish.zh.md +16 -0
- package/helps/integration/task/random.ja.md +13 -0
- package/helps/integration/task/random.ko.md +13 -0
- package/helps/integration/task/random.md +9 -9
- package/helps/integration/task/random.ms.md +13 -0
- package/helps/integration/task/random.zh.md +13 -0
- package/helps/integration/task/script.ja.md +1 -1
- package/helps/integration/task/script.ko.md +1 -1
- package/helps/integration/task/script.md +1 -1
- package/helps/integration/task/script.ms.md +1 -1
- package/helps/integration/task/script.zh.md +1 -1
- package/helps/integration/task/set-domain.ja.md +25 -0
- package/helps/integration/task/set-domain.ko.md +25 -0
- package/helps/integration/task/set-domain.md +12 -12
- package/helps/integration/task/set-domain.ms.md +25 -0
- package/helps/integration/task/set-domain.zh.md +25 -0
- package/helps/integration/task/sleep.ja.md +8 -0
- package/helps/integration/task/sleep.ko.md +8 -0
- package/helps/integration/task/sleep.md +5 -5
- package/helps/integration/task/sleep.ms.md +8 -0
- package/helps/integration/task/sleep.zh.md +8 -0
- package/helps/integration/task/state-read.ja.md +1 -1
- package/helps/integration/task/state-read.ms.md +1 -1
- package/helps/integration/task/state-read.zh.md +1 -1
- package/helps/integration/task/state-write.ja.md +1 -1
- package/helps/integration/task/state-write.ms.md +1 -1
- package/helps/integration/task/state-write.zh.md +1 -1
- package/helps/integration/task/throw.ja.md +12 -0
- package/helps/integration/task/throw.ko.md +12 -0
- package/helps/integration/task/throw.md +10 -10
- package/helps/integration/task/throw.ms.md +12 -0
- package/helps/integration/task/throw.zh.md +12 -0
- package/helps/integration/task/variables.ja.md +37 -0
- package/helps/integration/task/variables.ko.md +37 -0
- package/helps/integration/task/variables.md +11 -11
- package/helps/integration/task/variables.ms.md +37 -0
- package/helps/integration/task/variables.zh.md +37 -0
- package/package.json +7 -7
- package/server/engine/connector/operato-connector.ts +23 -5
- package/server/engine/types.ts +1 -0
- package/server/service/scenario-instance/scenario-instance-mutation.ts +28 -9
- package/server/service/scenario-instance/scenario-instance-type.ts +2 -1
- /package/helps/integration/connector/{operato-connector.kr.md → operato-connector.ko.md} +0 -0
@@ -1,8 +1,8 @@
|
|
1
|
-
# sleep
|
1
|
+
# sleep
|
2
2
|
|
3
|
-
'sleep'
|
3
|
+
Waits for the specified duration as given by the 'sleep' parameter and moves on to the next task when the specified time elapses.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Parameters
|
6
6
|
|
7
|
-
-
|
8
|
-
-
|
7
|
+
- Duration
|
8
|
+
- Sets the time to wait. The unit is milliseconds (ms).
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# throw
|
2
|
+
|
3
|
+
シナリオの実行中に故意に異常な例外をスローするためのタスクです。
|
4
|
+
(正常な終了を示す 'end' タスクと区別する必要があります。)
|
5
|
+
Throwがシナリオの実行中に実行されると、シナリオの 'preventErrorPropagation' 属性に応じて、例外が親シナリオに伝播されるか、シナリオ内で捕捉され、親シナリオのタスクが通常通り進行することができます。
|
6
|
+
|
7
|
+
- preventErrorPropagation が true の場合
|
8
|
+
- 親シナリオが存在する場合:シナリオを開始した親 'scenario' タスクにも例外が渡されます。結果として、親シナリオも異常な例外が発生します。
|
9
|
+
- 親シナリオが存在しない場合:シナリオはシナリオエンジンによって異常終了と見なされます。
|
10
|
+
- preventErrorPropagation が false の場合
|
11
|
+
- 親シナリオが存在する場合:例外はシナリオを開始した親 'scenario' タスクに渡されないため、結果として親シナリオは通常の進行を続けます。
|
12
|
+
- 親シナリオが存在しない場合:シナリオはシナリオエンジンによって正常終了と見なされます。
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# throw
|
2
|
+
|
3
|
+
Scenario 진행 중에 강제로 비정상 예외를 던지기 위한 태스크이다.
|
4
|
+
(정상종료를 의미하는 'end' 태스크와 구분할 필요가 있다.)
|
5
|
+
Scenario 진행 중에 Throw를 하게 되면, 해당 시나리오의 'preventErrorPropagation' 속성에 따라서, 부모 시나리오에 예외가 전파되거나 해당 시나리오에서 캐치되어 정상적으로 상위 시나리오의 태스크가 진행될 수도 있다.
|
6
|
+
|
7
|
+
- preventErrorPropagation 이 true 인 경우
|
8
|
+
- 부모 시나리오가 있는 경우 : 해당 시나리오를 시작한 부모 'scenario' 태스크에도 예외가 전달된다. 결과적으로 부모 시나리오도 비정상 예외가 발생하게 된다.
|
9
|
+
- 부모 시나리오가 없는 경우 : 해당 시나리오는 시나리오 엔진에 의해 비정상 종료로 처리된다.
|
10
|
+
- preventErrorPropagation 이 false 인 경우
|
11
|
+
- 부모 시나리오가 있는 경우 : 해당 시나리오를 시작한 부모 'scenario' 태스크에 예외가 전달되지 않으므로, 결과적으로 부모 시나리오도 정상적인 진행이 계속된다.
|
12
|
+
- 부모 시나리오가 없는 경우 : 해당 시나리오는 시나리오 엔진에 의해 정상 종료로 처리된다.
|
@@ -1,12 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# throw
|
2
2
|
|
3
|
-
|
4
|
-
(
|
5
|
-
|
3
|
+
A task for intentionally throwing an abnormal exception during the scenario execution.
|
4
|
+
(It needs to be distinguished from the 'end' task, which signifies normal termination.)
|
5
|
+
When Throw is executed during the scenario, depending on the 'preventErrorPropagation' attribute of the scenario, the exception may be propagated to the parent scenario or caught within the scenario, allowing the parent scenario's tasks to proceed normally.
|
6
6
|
|
7
|
-
- preventErrorPropagation
|
8
|
-
-
|
9
|
-
-
|
10
|
-
- preventErrorPropagation
|
11
|
-
-
|
12
|
-
-
|
7
|
+
- When preventErrorPropagation is true
|
8
|
+
- If there is a parent scenario: The exception is also passed to the parent 'scenario' task that started the scenario. As a result, the parent scenario also experiences an abnormal exception.
|
9
|
+
- If there is no parent scenario: The scenario is treated as an abnormal termination by the scenario engine.
|
10
|
+
- When preventErrorPropagation is false
|
11
|
+
- If there is a parent scenario: The exception is not passed to the parent 'scenario' task that started the scenario. As a result, the parent scenario continues its normal progress.
|
12
|
+
- If there is no parent scenario: The scenario is treated as a normal termination by the scenario engine.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# throw
|
2
|
+
|
3
|
+
Tugas untuk sengaja melemparkan pengecualian yang tidak normal selama eksekusi skenario.
|
4
|
+
(Harus dibedakan dari tugas 'end', yang menandakan terminasi normal.)
|
5
|
+
Ketika Throw dieksekusi selama skenario, tergantung pada atribut 'preventErrorPropagation' dari skenario, pengecualian dapat dipropagasi ke skenario induk atau ditangkap dalam skenario tersebut, memungkinkan tugas skenario induk untuk melanjutkan dengan normal.
|
6
|
+
|
7
|
+
- Ketika preventErrorPropagation bernilai true
|
8
|
+
- Jika ada skenario induk: Pengecualian juga diteruskan ke tugas 'scenario' induk yang memulai skenario. Sebagai hasilnya, skenario induk juga mengalami pengecualian yang tidak normal.
|
9
|
+
- Jika tidak ada skenario induk: Skenario dianggap sebagai terminasi yang tidak normal oleh mesin skenario.
|
10
|
+
- Ketika preventErrorPropagation bernilai false
|
11
|
+
- Jika ada skenario induk: Pengecualian tidak diteruskan ke tugas 'scenario' induk yang memulai skenario. Sebagai hasilnya, skenario induk melanjutkan kemajuan normalnya.
|
12
|
+
- Jika tidak ada skenario induk: Skenario dianggap sebagai terminasi normal oleh mesin skenario.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# throw
|
2
|
+
|
3
|
+
用于在场景执行期间故意引发异常的任务。
|
4
|
+
(需要与表示正常终止的 'end' 任务区分开来。)
|
5
|
+
当在场景执行期间执行Throw时,取决于场景的 'preventErrorPropagation' 属性,异常可能会传播到父场景,或者在场景内捕获,从而允许父场景的任务正常进行。
|
6
|
+
|
7
|
+
- 当 preventErrorPropagation 为 true 时
|
8
|
+
- 如果有父场景:异常也会传递到启动场景的父 'scenario' 任务。结果,父场景也会经历异常。
|
9
|
+
- 如果没有父场景:场景被场景引擎视为异常终止。
|
10
|
+
- 当 preventErrorPropagation 为 false 时
|
11
|
+
- 如果有父场景:异常不会传递到启动场景的父 'scenario' 任务。结果,父场景将继续正常进展。
|
12
|
+
- 如果没有父场景:场景被场景引擎视为正常终止。
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# variables
|
2
|
+
|
3
|
+
これは[シナリオコンテキスト](../concept/scenario-context.md)のデータにシナリオの入力変数を追加するタスクです。
|
4
|
+
Variables Taskはその後のステップのタスクでシナリオ入力変数を使用できるように、シナリオが開始されたときに受け取った入力変数をそのまま返すタスクです。
|
5
|
+
|
6
|
+
例えば、
|
7
|
+
|
8
|
+
- シナリオの入力変数の値
|
9
|
+
|
10
|
+
```
|
11
|
+
{
|
12
|
+
inputA: "ABC",
|
13
|
+
inputB: "DEF"
|
14
|
+
}
|
15
|
+
```
|
16
|
+
|
17
|
+
そして、
|
18
|
+
|
19
|
+
- Variables Taskの名前が "VARIABLES" の場合、
|
20
|
+
- Variables Taskが完了した後、Scenario Contextのデータには次のような値が追加されます。
|
21
|
+
|
22
|
+
```
|
23
|
+
# scenario.context.data
|
24
|
+
{
|
25
|
+
...,
|
26
|
+
VARIALBES: {
|
27
|
+
inputA: "ABC",
|
28
|
+
inputB: "DEF"
|
29
|
+
},
|
30
|
+
...
|
31
|
+
}
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
## パラメータ
|
36
|
+
|
37
|
+
このタスクには特定の属性が定義されていません。
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# variables
|
2
|
+
|
3
|
+
Scenario의 입력변수를 [Scenario Context](../concept/scenario-context.md) Data에 추가하는 태스크이다.
|
4
|
+
Variables Task는 이후 Step의 Task에서 Scenario Input 변수를 사용할 수 있도록, Scenario 시작 시에 받은 Input 변수들을 그대로 리턴하는 태스크이다.
|
5
|
+
|
6
|
+
예를 들어,
|
7
|
+
|
8
|
+
- Scenario Input 변수값
|
9
|
+
|
10
|
+
```
|
11
|
+
{
|
12
|
+
inputA: "ABC",
|
13
|
+
inputB: "DEF"
|
14
|
+
}
|
15
|
+
```
|
16
|
+
|
17
|
+
이고,
|
18
|
+
|
19
|
+
- Variables Task의 이름이 "VARIABLES" 인 경우,
|
20
|
+
- Variables Task가 완료된 후에 Scenario Context의 Data에는 다음과 같은 값이 추가되게 된다.
|
21
|
+
|
22
|
+
```
|
23
|
+
# scenario.context.data
|
24
|
+
{
|
25
|
+
...,
|
26
|
+
VARIALBES: {
|
27
|
+
inputA: "ABC",
|
28
|
+
inputB: "DEF"
|
29
|
+
},
|
30
|
+
...
|
31
|
+
}
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
## parameters
|
36
|
+
|
37
|
+
이 Task에는 별도 속성이 정의되지 않는다.
|
@@ -1,11 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# variables
|
2
2
|
|
3
|
-
Scenario
|
4
|
-
Variables Task
|
3
|
+
This is a task that adds Scenario input variables to the [Scenario Context](../concept/scenario-context.md) Data.
|
4
|
+
The Variables Task returns the input variables received at the start of the Scenario as they are, allowing Scenario Input variables to be used in subsequent Step tasks.
|
5
5
|
|
6
|
-
|
6
|
+
For example,
|
7
7
|
|
8
|
-
- Scenario Input
|
8
|
+
- Scenario Input variable values
|
9
9
|
|
10
10
|
```
|
11
11
|
{
|
@@ -14,16 +14,16 @@ Variables Task는 이후 Step의 Task에서 Scenario Input 변수를 사용할
|
|
14
14
|
}
|
15
15
|
```
|
16
16
|
|
17
|
-
|
17
|
+
And,
|
18
18
|
|
19
|
-
- Variables Task
|
20
|
-
- Variables Task
|
19
|
+
- If the name of the Variables Task is "VARIABLES",
|
20
|
+
- After the Variables Task is completed, the following values will be added to the Scenario Context's Data:
|
21
21
|
|
22
22
|
```
|
23
23
|
# scenario.context.data
|
24
24
|
{
|
25
25
|
...,
|
26
|
-
|
26
|
+
VARIABLES: {
|
27
27
|
inputA: "ABC",
|
28
28
|
inputB: "DEF"
|
29
29
|
},
|
@@ -32,6 +32,6 @@ Variables Task는 이후 Step의 Task에서 Scenario Input 변수를 사용할
|
|
32
32
|
|
33
33
|
```
|
34
34
|
|
35
|
-
##
|
35
|
+
## Parameters
|
36
36
|
|
37
|
-
|
37
|
+
This task does not have specific attributes defined.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# variables
|
2
|
+
|
3
|
+
Ini adalah tugas yang menambah pembolehubah input Skenario ke Data [Konteks Skenario](../concept/scenario-context.md).
|
4
|
+
Tugas Pembolehubah mengembalikan pembolehubah input yang diterima pada permulaan Skenario sebagaimana adanya, membolehkan pembolehubah input Skenario digunakan dalam tugas Langkah berikutnya.
|
5
|
+
|
6
|
+
Sebagai contoh,
|
7
|
+
|
8
|
+
- Nilai pembolehubah input Skenario
|
9
|
+
|
10
|
+
```
|
11
|
+
{
|
12
|
+
inputA: "ABC",
|
13
|
+
inputB: "DEF"
|
14
|
+
}
|
15
|
+
```
|
16
|
+
|
17
|
+
Dan,
|
18
|
+
|
19
|
+
- Jika nama Tugas Pembolehubah adalah "VARIABLES",
|
20
|
+
- Setelah Tugas Pembolehubah selesai, nilai berikut akan ditambahkan ke Data Konteks Skenario:
|
21
|
+
|
22
|
+
```
|
23
|
+
# scenario.context.data
|
24
|
+
{
|
25
|
+
...,
|
26
|
+
VARIABLES: {
|
27
|
+
inputA: "ABC",
|
28
|
+
inputB: "DEF"
|
29
|
+
},
|
30
|
+
...
|
31
|
+
}
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
## Parameter
|
36
|
+
|
37
|
+
Tugas ini tidak mempunyai atribut khusus yang ditentukan.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# variables
|
2
|
+
|
3
|
+
这是一个将场景输入变量添加到[场景上下文](../concept/scenario-context.md)数据中的任务。
|
4
|
+
Variables Task将在场景开始时接收到的输入变量原样返回,从而允许在后续步骤任务中使用场景输入变量。
|
5
|
+
|
6
|
+
例如,
|
7
|
+
|
8
|
+
- 场景输入变量值
|
9
|
+
|
10
|
+
```
|
11
|
+
{
|
12
|
+
inputA: "ABC",
|
13
|
+
inputB: "DEF"
|
14
|
+
}
|
15
|
+
```
|
16
|
+
|
17
|
+
而且,
|
18
|
+
|
19
|
+
- 如果Variables Task的名称为 "VARIABLES",
|
20
|
+
- Variables Task完成后,将以下值添加到场景上下文的数据中:
|
21
|
+
|
22
|
+
```
|
23
|
+
# scenario.context.data
|
24
|
+
{
|
25
|
+
...,
|
26
|
+
VARIABLES: {
|
27
|
+
inputA: "ABC",
|
28
|
+
inputB: "DEF"
|
29
|
+
},
|
30
|
+
...
|
31
|
+
}
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
## 参数
|
36
|
+
|
37
|
+
此任务没有特定定义的属性。
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/integration-base",
|
3
|
-
"version": "6.2.
|
3
|
+
"version": "6.2.49",
|
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.2.
|
30
|
-
"@things-factory/auth-base": "^6.2.
|
29
|
+
"@things-factory/api": "^6.2.49",
|
30
|
+
"@things-factory/auth-base": "^6.2.49",
|
31
31
|
"@things-factory/env": "^6.2.33",
|
32
|
-
"@things-factory/oauth2-client": "^6.2.
|
33
|
-
"@things-factory/scheduler-client": "^6.2.
|
34
|
-
"@things-factory/shell": "^6.2.
|
32
|
+
"@things-factory/oauth2-client": "^6.2.49",
|
33
|
+
"@things-factory/scheduler-client": "^6.2.49",
|
34
|
+
"@things-factory/shell": "^6.2.48",
|
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": "57266c96220301729f9c5cd633af1a4e2a651096"
|
50
50
|
}
|
@@ -40,12 +40,31 @@ const cache = new InMemoryCache({
|
|
40
40
|
export const GRAPHQL_URI = '/graphql'
|
41
41
|
export const SUBSCRIPTION_URI = GRAPHQL_URI
|
42
42
|
|
43
|
-
async function checkPermission(
|
44
|
-
|
43
|
+
async function checkPermission(
|
44
|
+
privilegeObject: PrivilegeObject,
|
45
|
+
user: User,
|
46
|
+
domain: Domain,
|
47
|
+
protectedIP: boolean
|
48
|
+
): Promise<boolean> {
|
49
|
+
if (!privilegeObject) {
|
45
50
|
return true
|
46
51
|
}
|
47
52
|
|
48
|
-
const {
|
53
|
+
const {
|
54
|
+
owner: domainOwnerGranted,
|
55
|
+
super: superUserGranted,
|
56
|
+
category,
|
57
|
+
privilege,
|
58
|
+
protected: protectedIPOnly
|
59
|
+
} = privilegeObject
|
60
|
+
|
61
|
+
if (protectedIPOnly && !protectedIP) {
|
62
|
+
return false
|
63
|
+
}
|
64
|
+
|
65
|
+
if (!privilege || !category) {
|
66
|
+
return true
|
67
|
+
}
|
49
68
|
|
50
69
|
return (
|
51
70
|
(domainOwnerGranted && (await process.domainOwnerGranted(domain, user))) ||
|
@@ -62,7 +81,6 @@ interface SubscriberData {
|
|
62
81
|
;``
|
63
82
|
|
64
83
|
export class OperatoConnector implements Connector {
|
65
|
-
private subscriptions: SubscriberData[] = []
|
66
84
|
private context: any
|
67
85
|
|
68
86
|
async ready(connectionConfigs) {
|
@@ -224,7 +242,7 @@ export class OperatoConnector implements Connector {
|
|
224
242
|
throw new Error(`scenario is not found - ${tag}`)
|
225
243
|
}
|
226
244
|
|
227
|
-
if (!(await checkPermission(scenario.privilege, user, domain))) {
|
245
|
+
if (!(await checkPermission(scenario.privilege, user, domain, false))) {
|
228
246
|
const { category, privilege } = scenario.privilege || {}
|
229
247
|
throw new Error(`Unauthorized! ${category}-${privilege} privilege required`)
|
230
248
|
}
|
package/server/engine/types.ts
CHANGED
@@ -31,12 +31,31 @@ async function findScenario(
|
|
31
31
|
return scenario as any
|
32
32
|
}
|
33
33
|
|
34
|
-
async function checkPermission(
|
35
|
-
|
34
|
+
async function checkPermission(
|
35
|
+
privilegeObject: PrivilegeObject,
|
36
|
+
user: User,
|
37
|
+
domain: Domain,
|
38
|
+
protectedIP?: boolean
|
39
|
+
): Promise<boolean> {
|
40
|
+
if (!privilegeObject) {
|
36
41
|
return true
|
37
42
|
}
|
38
43
|
|
39
|
-
const {
|
44
|
+
const {
|
45
|
+
owner: domainOwnerGranted,
|
46
|
+
super: superUserGranted,
|
47
|
+
category,
|
48
|
+
privilege,
|
49
|
+
protected: protectedIPOnly
|
50
|
+
} = privilegeObject || {}
|
51
|
+
|
52
|
+
if (protectedIPOnly && !protectedIP) {
|
53
|
+
return false
|
54
|
+
}
|
55
|
+
|
56
|
+
if (!privilege || !category) {
|
57
|
+
return true
|
58
|
+
}
|
40
59
|
|
41
60
|
return (
|
42
61
|
(domainOwnerGranted && (await process.domainOwnerGranted(domain, user))) ||
|
@@ -56,7 +75,7 @@ export class ScenarioInstanceMutation {
|
|
56
75
|
@Arg('variables', type => ScalarObject, { nullable: true }) variables: any,
|
57
76
|
@Ctx() context: ResolverContext
|
58
77
|
): Promise<ScenarioInstance> {
|
59
|
-
const { domain, user, lng } = context.state
|
78
|
+
const { domain, user, lng, protected: protectedIP } = context.state
|
60
79
|
|
61
80
|
debug('runScenario', scenarioName, instanceName, variables)
|
62
81
|
|
@@ -70,7 +89,7 @@ export class ScenarioInstanceMutation {
|
|
70
89
|
)
|
71
90
|
}
|
72
91
|
|
73
|
-
if (!(await checkPermission(scenario.privilege, user, domain))) {
|
92
|
+
if (!(await checkPermission(scenario.privilege, user, domain, protectedIP))) {
|
74
93
|
throw new Error(`Unauthorized!`)
|
75
94
|
}
|
76
95
|
|
@@ -96,7 +115,7 @@ export class ScenarioInstanceMutation {
|
|
96
115
|
@Arg('variables', type => ScalarObject, { nullable: true }) variables: any,
|
97
116
|
@Ctx() context: ResolverContext
|
98
117
|
): Promise<ScenarioInstance> {
|
99
|
-
const { domain, user, lng } = context.state
|
118
|
+
const { domain, user, lng, protected: protectedIP } = context.state
|
100
119
|
|
101
120
|
debug('startScenario', instanceName, scenarioName, variables)
|
102
121
|
|
@@ -110,7 +129,7 @@ export class ScenarioInstanceMutation {
|
|
110
129
|
)
|
111
130
|
}
|
112
131
|
|
113
|
-
if (!(await checkPermission(scenario.privilege, user, domain))) {
|
132
|
+
if (!(await checkPermission(scenario.privilege, user, domain, protectedIP))) {
|
114
133
|
throw new Error(`Unauthorized!`)
|
115
134
|
}
|
116
135
|
|
@@ -123,7 +142,7 @@ export class ScenarioInstanceMutation {
|
|
123
142
|
@Arg('instanceName', { nullable: true }) instanceName: string,
|
124
143
|
@Ctx() context: ResolverContext
|
125
144
|
): Promise<ScenarioInstance | undefined> {
|
126
|
-
const { domain, user } = context.state
|
145
|
+
const { domain, user, protected: protectedIP } = context.state
|
127
146
|
|
128
147
|
debug('stopScenario', instanceName)
|
129
148
|
|
@@ -140,7 +159,7 @@ export class ScenarioInstanceMutation {
|
|
140
159
|
|
141
160
|
var scenario = await findScenario(scenarioInstance.scenarioName, domain)
|
142
161
|
|
143
|
-
if (!(await checkPermission(scenario.privilege, user, domain))) {
|
162
|
+
if (!(await checkPermission(scenario.privilege, user, domain, protectedIP))) {
|
144
163
|
throw new Error(`Unauthorized!`)
|
145
164
|
}
|
146
165
|
|
@@ -153,7 +153,7 @@ export class ScenarioInstance {
|
|
153
153
|
}
|
154
154
|
|
155
155
|
constructor(instanceName, { name: scenarioName, steps, domain: scenarioDomain }, context?) {
|
156
|
-
var { domain, user, lng } = context || {}
|
156
|
+
var { domain, user, lng, protected: protectedIP } = context || {}
|
157
157
|
domain ||= scenarioDomain
|
158
158
|
|
159
159
|
this.instanceName = instanceName
|
@@ -167,6 +167,7 @@ export class ScenarioInstance {
|
|
167
167
|
domain,
|
168
168
|
user,
|
169
169
|
lng,
|
170
|
+
protected: protectedIP,
|
170
171
|
logger:
|
171
172
|
context?.logger ||
|
172
173
|
createLogger({
|
File without changes
|