@things-factory/integration-base 7.0.1-alpha.100 → 7.0.1-alpha.103

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-base",
3
- "version": "7.0.1-alpha.100",
3
+ "version": "7.0.1-alpha.103",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -27,12 +27,12 @@
27
27
  "dependencies": {
28
28
  "@apollo/client": "^3.6.9",
29
29
  "@operato/moment-timezone-es": "^2.0.0-alpha.0",
30
- "@things-factory/api": "^7.0.1-alpha.100",
31
- "@things-factory/auth-base": "^7.0.1-alpha.100",
30
+ "@things-factory/api": "^7.0.1-alpha.103",
31
+ "@things-factory/auth-base": "^7.0.1-alpha.103",
32
32
  "@things-factory/env": "^7.0.1-alpha.71",
33
- "@things-factory/oauth2-client": "^7.0.1-alpha.100",
34
- "@things-factory/scheduler-client": "^7.0.1-alpha.100",
35
- "@things-factory/shell": "^7.0.1-alpha.100",
33
+ "@things-factory/oauth2-client": "^7.0.1-alpha.103",
34
+ "@things-factory/scheduler-client": "^7.0.1-alpha.103",
35
+ "@things-factory/shell": "^7.0.1-alpha.103",
36
36
  "@things-factory/utils": "^7.0.1-alpha.71",
37
37
  "async-mqtt": "^2.5.0",
38
38
  "chance": "^1.1.11",
@@ -43,5 +43,5 @@
43
43
  "readline": "^1.3.0",
44
44
  "vm2": "^3.9.11"
45
45
  },
46
- "gitHead": "f5062c5559383d06fc8f9f870b56163952557c70"
46
+ "gitHead": "b192bdfb7c0caf36a1815ed40ed6e9c97046c4f5"
47
47
  }
@@ -43,7 +43,12 @@ export async function runScenario(instanceName: string, scenarioName: string, va
43
43
 
44
44
  if (!(await checkPermission(scenario.privilege, user, domain, unsafeIP, prohibitedPrivileges))) {
45
45
  const { category, privilege } = scenario.privilege || {}
46
- throw new Error(`Unauthorized! ${category && privilege ? category + ':' + privilege + ' privilege' : 'ownership granted'} required`)
46
+
47
+ console.error(`Unauthorized! ${category && privilege ? category + ':' + privilege + ' privilege' : 'ownership granted'} required`)
48
+
49
+ throw new Error(context.t('error.scenario run unauthorized', {
50
+ scenario: scenarioName
51
+ }))
47
52
  }
48
53
 
49
54
  /* 시나리오 인스턴스를 생성한다. */
@@ -56,7 +61,15 @@ export async function runScenario(instanceName: string, scenarioName: string, va
56
61
  client: GraphqlLocalClient.client
57
62
  })
58
63
 
59
- await instance.run()
64
+ try {
65
+ await instance.run()
66
+ } catch(err) {
67
+ console.error(err)
68
+
69
+ throw new Error(context.t('error.scenario run error', {
70
+ scenario: scenarioName
71
+ }))
72
+ }
60
73
 
61
74
  return instance
62
75
  }
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "error.scenario not found": "scenario '{scenario}' not found.",
3
+ "error.scenario run error": "an error occurred while processing the '{scenario}' request. please contact the administrator.",
4
+ "error.scenario run unauthorized": "you do not have permission to run the {scenario} scenario. please contact the administrator.",
3
5
  "error.schedule is not set": "schedule should be set for the scenario '{scenario}' in order to register as a schedule",
4
6
  "error.timezone is not set": "timezone should be set for the scenario '{scenario}' in order to register as a schedule",
5
7
  "error.scenario instance not found": "scenario instance '{instance}' not found.",
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "error.scenario not found": "シナリオ'{scenario}'が見つかりません.",
3
+ "error.scenario run error": "シナリオ '{scenario}' のリクエストを処理中にエラーが発生しました。管理者に連絡してください。",
4
+ "error.scenario run unauthorized": "シナリオ {scenario} を実行する権限がありません。管理者に連絡してください。",
3
5
  "error.schedule is not set": "スケジュールとして登録するためにはシナリオ'{scenario}'にスケジュール情報が設定される必要があります.",
4
6
  "error.timezone is not set": "スケジュールとして登録するためにはシナリオ'{scenario}'にタイム ゾーン情報が設定される必要があります.",
5
7
  "error.scenario instance not found": "シナリオ インスタンス'{instance}'が見つかりません. 既に終了している可能性があります.",
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "error.scenario not found": "시나리오 '{scenario}'를 찾을 수 없습니다.",
3
+ "error.scenario run error": "시나리오 '{scenario}' 요청을 처리하는 중 오류가 발생했습니다. 관리자에게 문의하십시오.",
4
+ "error.scenario run unauthorized": "시나리오 {scenario}를 실행할 권한이 없습니다. 관리자에게 문의하십히오.",
3
5
  "error.schedule is not set": "스케쥴로 등록하기 위해서는 시나리오 '{scenario}'에 스케쥴 정보가 설정되어야 합니다.",
4
6
  "error.timezone is not set": "스케쥴로 등록하기 위해서는 시나리오 '{scenario}'에 타임존 정보가 설정되어야 합니다.",
5
7
  "error.scenario instance not found": "시나리오 인스턴스 '{instance}'를 찾을 수 없습니다. 이미 종료되었을 수 있습니다.",
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "error.scenario not found": "Tidak dapat mencari senario '{scenario}'.",
3
+ "error.scenario run error": "Ralat berlaku semasa memproses permintaan senario '{scenario}'. Sila hubungi pentadbir.",
4
+ "error.scenario run unauthorized": "Anda tidak mempunyai kebenaran untuk menjalankan senario {scenario}. Sila hubungi pentadbir.",
3
5
  "error.schedule is not set": "Untuk mendaftarkan sebagai jadual, maklumat jadual mesti diset dalam senario '{scenario}'.",
4
6
  "error.timezone is not set": "Untuk mendaftarkan sebagai jadual, maklumat zon masa mesti diset dalam senario '{scenario}'.",
5
7
  "error.scenario instance not found": "Tidak dapat mencari instans senario '{instance}'. Mungkin telah berakhir.",
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "error.scenario not found": "无法找到场景 '{scenario}'。",
3
+ "error.scenario run error": "处理场景 '{scenario}' 请求时发生错误。请联系管理员。",
4
+ "error.scenario run unauthorized": "没有执行场景 {scenario} 的权限。请联系管理员。",
3
5
  "error.schedule is not set": "要注册为计划,场景 '{scenario}' 需要设置计划信息。",
4
6
  "error.timezone is not set": "要注册为计划,场景 '{scenario}' 需要设置时区信息。",
5
7
  "error.scenario instance not found": "无法找到场景实例 '{instance}'。它可能已经结束。",