@intuitionrobotics/thunderstorm 0.45.3 → 0.46.0

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.
Files changed (224) hide show
  1. package/app-backend/api/v1/utils/version/_assert.js +0 -20
  2. package/app-backend/api/v1/utils/version/_assert.js.map +1 -1
  3. package/app-backend/api/v1/utils/version/assert.js +0 -20
  4. package/app-backend/api/v1/utils/version/assert.js.map +1 -1
  5. package/app-backend/core/BaseStorm.d.ts +1 -1
  6. package/app-backend/core/BaseStorm.js +2 -22
  7. package/app-backend/core/BaseStorm.js.map +1 -1
  8. package/app-backend/core/Storm.js +9 -27
  9. package/app-backend/core/Storm.js.map +1 -1
  10. package/app-backend/exceptions.d.ts +2 -2
  11. package/app-backend/exceptions.js +2 -22
  12. package/app-backend/exceptions.js.map +1 -1
  13. package/app-backend/modules/CleanupScheduler.js +5 -4
  14. package/app-backend/modules/CleanupScheduler.js.map +1 -1
  15. package/app-backend/modules/FirestoreBackupScheduler.d.ts +1 -1
  16. package/app-backend/modules/FirestoreBackupScheduler.js +23 -9
  17. package/app-backend/modules/FirestoreBackupScheduler.js.map +1 -1
  18. package/app-backend/modules/ForceUpgrade.d.ts +1 -1
  19. package/app-backend/modules/ForceUpgrade.js +8 -26
  20. package/app-backend/modules/ForceUpgrade.js.map +1 -1
  21. package/app-backend/modules/SlackModule.d.ts +2 -4
  22. package/app-backend/modules/SlackModule.js +9 -30
  23. package/app-backend/modules/SlackModule.js.map +1 -1
  24. package/app-backend/modules/http/AxiosHttpModule.js +3 -23
  25. package/app-backend/modules/http/AxiosHttpModule.js.map +1 -1
  26. package/app-backend/modules/proxy/RemoteProxy.d.ts +2 -1
  27. package/app-backend/modules/proxy/RemoteProxy.js +11 -30
  28. package/app-backend/modules/proxy/RemoteProxy.js.map +1 -1
  29. package/app-backend/modules/proxy/RemoteProxyCaller.d.ts +1 -1
  30. package/app-backend/modules/proxy/RemoteProxyCaller.js +11 -29
  31. package/app-backend/modules/proxy/RemoteProxyCaller.js.map +1 -1
  32. package/app-backend/modules/server/HttpServer.d.ts +2 -1
  33. package/app-backend/modules/server/HttpServer.js +9 -31
  34. package/app-backend/modules/server/HttpServer.js.map +1 -1
  35. package/app-backend/modules/server/server-api.d.ts +3 -1
  36. package/app-backend/modules/server/server-api.js +27 -25
  37. package/app-backend/modules/server/server-api.js.map +1 -1
  38. package/app-backend/modules/server/server-errors.d.ts +1 -1
  39. package/app-backend/modules/server/server-errors.js +7 -26
  40. package/app-backend/modules/server/server-errors.js.map +1 -1
  41. package/app-backend/utils/LogClient_File.d.ts +2 -2
  42. package/app-backend/utils/LogClient_File.js +12 -30
  43. package/app-backend/utils/LogClient_File.js.map +1 -1
  44. package/app-backend/utils/file.js +0 -20
  45. package/app-backend/utils/file.js.map +1 -1
  46. package/app-backend/utils/promisify-request.js +2 -22
  47. package/app-backend/utils/promisify-request.js.map +1 -1
  48. package/app-backend/utils/to-be-removed.js +0 -20
  49. package/app-backend/utils/to-be-removed.js.map +1 -1
  50. package/app-backend/utils/types.d.ts +1 -1
  51. package/app-backend/utils/types.js +2 -22
  52. package/app-backend/utils/types.js.map +1 -1
  53. package/app-frontend/components/ActionButton.js +0 -20
  54. package/app-frontend/components/ActionButton.js.map +1 -1
  55. package/app-frontend/components/DropDown.js +5 -24
  56. package/app-frontend/components/DropDown.js.map +1 -1
  57. package/app-frontend/components/FilterInput.js +4 -23
  58. package/app-frontend/components/FilterInput.js.map +1 -1
  59. package/app-frontend/components/GenericSelect.js +0 -20
  60. package/app-frontend/components/GenericSelect.js.map +1 -1
  61. package/app-frontend/components/Overlay.js +0 -20
  62. package/app-frontend/components/Overlay.js.map +1 -1
  63. package/app-frontend/components/TS_Input.js +3 -23
  64. package/app-frontend/components/TS_Input.js.map +1 -1
  65. package/app-frontend/components/TS_Table.d.ts +1 -1
  66. package/app-frontend/components/TS_Table.js +0 -20
  67. package/app-frontend/components/TS_Table.js.map +1 -1
  68. package/app-frontend/components/TS_TextArea.js +0 -20
  69. package/app-frontend/components/TS_TextArea.js.map +1 -1
  70. package/app-frontend/components/adapter/Adapter.js +6 -26
  71. package/app-frontend/components/adapter/Adapter.js.map +1 -1
  72. package/app-frontend/components/adapter/BaseRenderer.js +0 -20
  73. package/app-frontend/components/adapter/BaseRenderer.js.map +1 -1
  74. package/app-frontend/components/checkbox/TS_Checkbox.d.ts +2 -2
  75. package/app-frontend/components/checkbox/TS_Checkbox.js +2 -1
  76. package/app-frontend/components/checkbox/TS_Checkbox.js.map +1 -1
  77. package/app-frontend/components/checkbox/TS_CheckboxField.js +0 -18
  78. package/app-frontend/components/checkbox/TS_CheckboxField.js.map +1 -1
  79. package/app-frontend/components/form/Form.d.ts +2 -1
  80. package/app-frontend/components/form/Form.js +2 -22
  81. package/app-frontend/components/form/Form.js.map +1 -1
  82. package/app-frontend/components/form/types.d.ts +2 -1
  83. package/app-frontend/components/form/types.js +0 -20
  84. package/app-frontend/components/form/types.js.map +1 -1
  85. package/app-frontend/components/playground/Example_NewProps.js +0 -20
  86. package/app-frontend/components/playground/Example_NewProps.js.map +1 -1
  87. package/app-frontend/components/playground/Playground.js +1 -21
  88. package/app-frontend/components/playground/Playground.js.map +1 -1
  89. package/app-frontend/components/tree/MenuComponent.js +2 -22
  90. package/app-frontend/components/tree/MenuComponent.js.map +1 -1
  91. package/app-frontend/components/tree/MultiTypeAdaptor.js +2 -22
  92. package/app-frontend/components/tree/MultiTypeAdaptor.js.map +1 -1
  93. package/app-frontend/components/tree/SimpleTreeNodeRenderer.js +0 -20
  94. package/app-frontend/components/tree/SimpleTreeNodeRenderer.js.map +1 -1
  95. package/app-frontend/components/tree/Tree.js +3 -23
  96. package/app-frontend/components/tree/Tree.js.map +1 -1
  97. package/app-frontend/components/tree/types.js +0 -20
  98. package/app-frontend/components/tree/types.js.map +1 -1
  99. package/app-frontend/components/treeicons.js.map +1 -1
  100. package/app-frontend/components/types.js +0 -20
  101. package/app-frontend/components/types.js.map +1 -1
  102. package/app-frontend/core/AbstractThunder.d.ts +0 -3
  103. package/app-frontend/core/AbstractThunder.js +0 -32
  104. package/app-frontend/core/AbstractThunder.js.map +1 -1
  105. package/app-frontend/core/AppPage.js +0 -20
  106. package/app-frontend/core/AppPage.js.map +1 -1
  107. package/app-frontend/core/AppWrapper.js +2 -23
  108. package/app-frontend/core/AppWrapper.js.map +1 -1
  109. package/app-frontend/core/BaseComponent.d.ts +2 -4
  110. package/app-frontend/core/BaseComponent.js +18 -41
  111. package/app-frontend/core/BaseComponent.js.map +1 -1
  112. package/app-frontend/core/SimpleScriptInjector.js +2 -22
  113. package/app-frontend/core/SimpleScriptInjector.js.map +1 -1
  114. package/app-frontend/core/Thunder.js +3 -22
  115. package/app-frontend/core/Thunder.js.map +1 -1
  116. package/app-frontend/core/thunder-dispatcher.d.ts +2 -1
  117. package/app-frontend/core/thunder-dispatcher.js +13 -23
  118. package/app-frontend/core/thunder-dispatcher.js.map +1 -1
  119. package/app-frontend/modules/ConnectivityModule.d.ts +1 -1
  120. package/app-frontend/modules/ConnectivityModule.js +2 -2
  121. package/app-frontend/modules/ConnectivityModule.js.map +1 -1
  122. package/app-frontend/modules/ForceUpgrade.d.ts +1 -1
  123. package/app-frontend/modules/ForceUpgrade.js +4 -23
  124. package/app-frontend/modules/ForceUpgrade.js.map +1 -1
  125. package/app-frontend/modules/HistoryModule.d.ts +3 -5
  126. package/app-frontend/modules/HistoryModule.js +9 -28
  127. package/app-frontend/modules/HistoryModule.js.map +1 -1
  128. package/app-frontend/modules/ResourcesModule.d.ts +1 -4
  129. package/app-frontend/modules/ResourcesModule.js +2 -25
  130. package/app-frontend/modules/ResourcesModule.js.map +1 -1
  131. package/app-frontend/modules/StorageModule.d.ts +1 -4
  132. package/app-frontend/modules/StorageModule.js +4 -26
  133. package/app-frontend/modules/StorageModule.js.map +1 -1
  134. package/app-frontend/modules/ThunderstormModule.d.ts +1 -1
  135. package/app-frontend/modules/ThunderstormModule.js +3 -3
  136. package/app-frontend/modules/ThunderstormModule.js.map +1 -1
  137. package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js +0 -20
  138. package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js.map +1 -1
  139. package/app-frontend/modules/component-loader/entry-component-loading-module.d.ts +1 -1
  140. package/app-frontend/modules/component-loader/entry-component-loading-module.js +4 -25
  141. package/app-frontend/modules/component-loader/entry-component-loading-module.js.map +1 -1
  142. package/app-frontend/modules/dialog/Dialog.js +0 -22
  143. package/app-frontend/modules/dialog/Dialog.js.map +1 -1
  144. package/app-frontend/modules/dialog/DialogModule.d.ts +1 -1
  145. package/app-frontend/modules/dialog/DialogModule.js +2 -22
  146. package/app-frontend/modules/dialog/DialogModule.js.map +1 -1
  147. package/app-frontend/modules/http/HttpClient.js +0 -20
  148. package/app-frontend/modules/http/HttpClient.js.map +1 -1
  149. package/app-frontend/modules/http/XhrHttpModule.js +9 -10
  150. package/app-frontend/modules/http/XhrHttpModule.js.map +1 -1
  151. package/app-frontend/modules/locale/LocaleModule.d.ts +1 -4
  152. package/app-frontend/modules/locale/LocaleModule.js +5 -24
  153. package/app-frontend/modules/locale/LocaleModule.js.map +1 -1
  154. package/app-frontend/modules/locale/types.d.ts +0 -3
  155. package/app-frontend/modules/locale/types.js +0 -20
  156. package/app-frontend/modules/locale/types.js.map +1 -1
  157. package/app-frontend/modules/menu/MenuAndButton.js +2 -2
  158. package/app-frontend/modules/menu/MenuAndButton.js.map +1 -1
  159. package/app-frontend/modules/menu/MenuModule.d.ts +1 -1
  160. package/app-frontend/modules/menu/MenuModule.js +4 -3
  161. package/app-frontend/modules/menu/MenuModule.js.map +1 -1
  162. package/app-frontend/modules/menu/PopupMenu.js +2 -2
  163. package/app-frontend/modules/menu/PopupMenu.js.map +1 -1
  164. package/app-frontend/modules/routing/RoutingModule.d.ts +1 -1
  165. package/app-frontend/modules/routing/RoutingModule.js +6 -25
  166. package/app-frontend/modules/routing/RoutingModule.js.map +1 -1
  167. package/app-frontend/modules/routing/route.js +0 -20
  168. package/app-frontend/modules/routing/route.js.map +1 -1
  169. package/app-frontend/modules/toaster/BaseToaster.js +0 -22
  170. package/app-frontend/modules/toaster/BaseToaster.js.map +1 -1
  171. package/app-frontend/modules/toaster/Toaster.js +0 -20
  172. package/app-frontend/modules/toaster/Toaster.js.map +1 -1
  173. package/app-frontend/modules/toaster/ToasterModule.d.ts +1 -1
  174. package/app-frontend/modules/toaster/ToasterModule.js +5 -25
  175. package/app-frontend/modules/toaster/ToasterModule.js.map +1 -1
  176. package/app-frontend/modules/tooltip/Tooltip.js +2 -22
  177. package/app-frontend/modules/tooltip/Tooltip.js.map +1 -1
  178. package/app-frontend/modules/tooltip/TooltipModule.d.ts +1 -1
  179. package/app-frontend/modules/tooltip/TooltipModule.js +4 -23
  180. package/app-frontend/modules/tooltip/TooltipModule.js.map +1 -1
  181. package/app-frontend/tools/KeyboardListener.js +0 -17
  182. package/app-frontend/tools/KeyboardListener.js.map +1 -1
  183. package/app-frontend/tools/Stylable.js +0 -20
  184. package/app-frontend/tools/Stylable.js.map +1 -1
  185. package/app-frontend/types/renderer-map.js +0 -20
  186. package/app-frontend/types/renderer-map.js.map +1 -1
  187. package/app-frontend/utils/tools.js +3 -23
  188. package/app-frontend/utils/tools.js.map +1 -1
  189. package/index.d.ts +0 -6
  190. package/index.js +0 -37
  191. package/index.js.map +1 -1
  192. package/package.json +4 -4
  193. package/shared/BaseHttpModule.d.ts +1 -1
  194. package/shared/BaseHttpModule.js +6 -5
  195. package/shared/BaseHttpModule.js.map +1 -1
  196. package/shared/BaseHttpRequest.js +9 -27
  197. package/shared/BaseHttpRequest.js.map +1 -1
  198. package/shared/consts.js +0 -20
  199. package/shared/consts.js.map +1 -1
  200. package/shared/force-upgrade.js +0 -20
  201. package/shared/force-upgrade.js.map +1 -1
  202. package/shared/request-types.js +0 -20
  203. package/shared/request-types.js.map +1 -1
  204. package/shared/types.js +0 -20
  205. package/shared/types.js.map +1 -1
  206. package/test-backend/StormTester.js +6 -26
  207. package/test-backend/StormTester.js.map +1 -1
  208. package/test-frontend/ThunderTester.js +0 -20
  209. package/test-frontend/ThunderTester.js.map +1 -1
  210. package/app-backend/modules/_imports.d.ts +0 -10
  211. package/app-backend/modules/_imports.js +0 -43
  212. package/app-backend/modules/_imports.js.map +0 -1
  213. package/app-frontend/components/GenericTabs.d.ts +0 -4
  214. package/app-frontend/components/GenericTabs.js +0 -11
  215. package/app-frontend/components/GenericTabs.js.map +0 -1
  216. package/backend-test.d.ts +0 -1
  217. package/backend-test.js +0 -34
  218. package/backend-test.js.map +0 -1
  219. package/backend.d.ts +0 -17
  220. package/backend.js +0 -50
  221. package/backend.js.map +0 -1
  222. package/frontend.d.ts +0 -55
  223. package/frontend.js +0 -88
  224. package/frontend.js.map +0 -1
@@ -1,24 +1,4 @@
1
1
  "use strict";
2
- /*
3
- * Thunderstorm is a full web app framework!
4
- *
5
- * Typescript & Express backend infrastructure that natively runs on firebase function
6
- * Typescript & React frontend infrastructure
7
- *
8
- * Copyright (C) 2020 Intuition Robotics
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
2
  Object.defineProperty(exports, "__esModule", { value: true });
23
3
  const HttpServer_1 = require("../../../../modules/server/HttpServer");
24
4
  module.exports = new HttpServer_1.RouteResolver(require, __dirname);
@@ -1 +1 @@
1
- {"version":3,"file":"_assert.js","sourceRoot":"","sources":["../../../../../../src/main/app-backend/api/v1/utils/version/_assert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAEH,sEAAoE;AAEpE,MAAM,CAAC,OAAO,GAAG,IAAI,0BAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"_assert.js","sourceRoot":"","sources":["../../../../../../src/main/app-backend/api/v1/utils/version/_assert.ts"],"names":[],"mappings":";;AACA,sEAAoE;AAEpE,MAAM,CAAC,OAAO,GAAG,IAAI,0BAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC"}
@@ -1,24 +1,4 @@
1
1
  "use strict";
2
- /*
3
- * Thunderstorm is a full web app framework!
4
- *
5
- * Typescript & Express backend infrastructure that natively runs on firebase function
6
- * Typescript & React frontend infrastructure
7
- *
8
- * Copyright (C) 2020 Intuition Robotics
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
23
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
24
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1 +1 @@
1
- {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../../../../src/main/app-backend/api/v1/utils/version/assert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;AAGH,uEAI6C;AAC7C,sEAG+C;AAC/C,uDAAuD;AACvD,mEAA+D;AAI/D,MAAM,0BACL,SAAQ,sBAAqC;IAE7C;QACC,KAAK,CAAC,kBAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,cAAc,CAAC,yCAAyB,EAAE,sCAAsB,CAAC,CAAC;IACxE,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAU;;YAClG,OAAO,2BAAY,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,0BAA0B,EAAE,CAAC"}
1
+ {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../../../../src/main/app-backend/api/v1/utils/version/assert.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,uEAI6C;AAC7C,sEAG+C;AAC/C,uDAAuD;AACvD,mEAA+D;AAI/D,MAAM,0BACL,SAAQ,sBAAqC;IAE7C;QACC,KAAK,CAAC,kBAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,cAAc,CAAC,yCAAyB,EAAE,sCAAsB,CAAC,CAAC;IACxE,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAU;;YAClG,OAAO,2BAAY,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,0BAA0B,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ModuleManager } from "@intuitionrobotics/ts-common";
1
+ import { ModuleManager } from "@intuitionrobotics/ts-common/core/module-manager";
2
2
  export declare abstract class BaseStorm extends ModuleManager {
3
3
  private envKey;
4
4
  setEnvironment(envKey: string): this;
@@ -1,28 +1,8 @@
1
1
  "use strict";
2
- /*
3
- * Thunderstorm is a full web app framework!
4
- *
5
- * Typescript & Express backend infrastructure that natively runs on firebase function
6
- * Typescript & React frontend infrastructure
7
- *
8
- * Copyright (C) 2020 Intuition Robotics
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
2
  Object.defineProperty(exports, "__esModule", { value: true });
23
3
  exports.BaseStorm = void 0;
24
- const ts_common_1 = require("@intuitionrobotics/ts-common");
25
- class BaseStorm extends ts_common_1.ModuleManager {
4
+ const module_manager_1 = require("@intuitionrobotics/ts-common/core/module-manager");
5
+ class BaseStorm extends module_manager_1.ModuleManager {
26
6
  constructor() {
27
7
  super(...arguments);
28
8
  this.envKey = "dev";
@@ -1 +1 @@
1
- {"version":3,"file":"BaseStorm.js","sourceRoot":"","sources":["../../../src/main/app-backend/core/BaseStorm.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,4DAA2D;AAE3D,MAAsB,SAClB,SAAQ,yBAAa;IADzB;;QAEY,WAAM,GAAW,KAAK,CAAC;IASnC,CAAC;IARG,cAAc,CAAC,MAAc;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc;QACV,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ;AAXD,8BAWC"}
1
+ {"version":3,"file":"BaseStorm.js","sourceRoot":"","sources":["../../../src/main/app-backend/core/BaseStorm.ts"],"names":[],"mappings":";;;AACA,qFAA+E;AAE/E,MAAsB,SAClB,SAAQ,8BAAa;IADzB;;QAEY,WAAM,GAAW,KAAK,CAAC;IASnC,CAAC;IARG,cAAc,CAAC,MAAc;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc;QACV,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ;AAXD,8BAWC"}
@@ -1,29 +1,11 @@
1
1
  "use strict";
2
- /*
3
- * Thunderstorm is a full web app framework!
4
- *
5
- * Typescript & Express backend infrastructure that natively runs on firebase function
6
- * Typescript & React frontend infrastructure
7
- *
8
- * Copyright (C) 2020 Intuition Robotics
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
2
  Object.defineProperty(exports, "__esModule", { value: true });
23
3
  exports.Storm = void 0;
24
- const backend_1 = require("@intuitionrobotics/firebase/backend");
25
- const ts_common_1 = require("@intuitionrobotics/ts-common");
26
- const backend_functions_1 = require("@intuitionrobotics/firebase/backend-functions");
4
+ const FirebaseModule_1 = require("@intuitionrobotics/firebase/app-backend/FirebaseModule");
5
+ const LogClient_Function_1 = require("@intuitionrobotics/ts-common/core/logger/LogClient_Function");
6
+ const BeLogged_1 = require("@intuitionrobotics/ts-common/core/logger/BeLogged");
7
+ const LogClient_Terminal_1 = require("@intuitionrobotics/ts-common/core/logger/LogClient_Terminal");
8
+ const firebase_function_1 = require("@intuitionrobotics/firebase/app-backend/functions/firebase-function");
27
9
  const HttpServer_1 = require("../modules/server/HttpServer");
28
10
  const server_api_1 = require("../modules/server/server-api");
29
11
  const BaseStorm_1 = require("./BaseStorm");
@@ -35,7 +17,7 @@ class Storm extends BaseStorm_1.BaseStorm {
35
17
  this.apis = [];
36
18
  this.express = _express || express();
37
19
  this.httpServer = new HttpServer_1.HttpServer_Class(this.express);
38
- this.addModules(this.httpServer, backend_1.FirebaseModule);
20
+ this.addModules(this.httpServer, FirebaseModule_1.FirebaseModule);
39
21
  }
40
22
  static getInstance() {
41
23
  return Storm.instance;
@@ -45,7 +27,7 @@ class Storm extends BaseStorm_1.BaseStorm {
45
27
  }
46
28
  init() {
47
29
  var _a;
48
- ts_common_1.BeLogged.addClient(process.env.GCLOUD_PROJECT && process.env.FUNCTIONS_EMULATOR ? ts_common_1.LogClient_Terminal : ts_common_1.LogClient_Function);
30
+ BeLogged_1.BeLogged.addClient(process.env.GCLOUD_PROJECT && process.env.FUNCTIONS_EMULATOR ? LogClient_Terminal_1.LogClient_Terminal : LogClient_Function_1.LogClient_Function);
49
31
  server_api_1.ServerApi.isDebug = !!((_a = this.config) === null || _a === void 0 ? void 0 : _a.isDebug);
50
32
  super.init();
51
33
  const urlPrefix = !process.env.GCLOUD_PROJECT ? this.initialPath : "";
@@ -66,8 +48,8 @@ class Storm extends BaseStorm_1.BaseStorm {
66
48
  return this;
67
49
  }
68
50
  startServer(onStarted) {
69
- const modulesAsFunction = this.modules.filter((module) => module instanceof backend_functions_1.FirebaseFunction);
70
- this.functions = [new backend_functions_1.Firebase_ExpressFunction(this.httpServer.express),
51
+ const modulesAsFunction = this.modules.filter((module) => module instanceof firebase_function_1.FirebaseFunction);
52
+ this.functions = [new firebase_function_1.Firebase_ExpressFunction(this.httpServer.express),
71
53
  ...modulesAsFunction];
72
54
  this.init();
73
55
  onStarted && onStarted().catch(e => this.logError(e));
@@ -1 +1 @@
1
- {"version":3,"file":"Storm.js","sourceRoot":"","sources":["../../../src/main/app-backend/core/Storm.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,iEAAmE;AACnE,4DAAsG;AACtG,qFAAyG;AACzG,6DAA6E;AAC7E,6DAAuD;AACvD,2CAAsC;AAEtC,mCAAmC;AAEnC,MAAa,KACT,SAAQ,qBAAS;IAQjB,YAAY,QAAkB;QAC1B,KAAK,EAAE,CAAC;QANJ,cAAS,GAAU,EAAE,CAAC;QACtB,SAAI,GAAqB,EAAE,CAAC;QAMhC,IAAI,CAAC,OAAO,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,IAAI,6BAAgB,CAAC,IAAI,CAAC,OA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AC,aAAa,GAAG,aAAa,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,mBAAmB,CAAC,WAAmB;QACnC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,SAA+B;QACvC,MAAM,iBAAiB,GAAuB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAc,EAA8B,EAAE,CAAC,MAAM,YAAY,oCAAgB,CAAC,CAAC;QAEtJ,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,4CAAwB,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACnE,GAAG,iBAAiB,CAAC,CAAC;QAE1B,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,SAAS,IAAI,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;QAE/B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;YAC9C,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC;QACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;IAED,KAAK,CAAC,SAA+B;QACjC,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;CACJ;AAxED,sBAwEC"}
@@ -1,5 +1,5 @@
1
- import { CustomException } from "@intuitionrobotics/ts-common";
2
- import { ErrorBody, ErrorResponse } from "../index";
1
+ import { CustomException } from "@intuitionrobotics/ts-common/core/exceptions";
2
+ import { ErrorBody, ErrorResponse } from "../shared/types";
3
3
  export declare class ApiException<E extends object | void = void> extends CustomException {
4
4
  readonly responseBody: ErrorResponse<E>;
5
5
  readonly responseCode: number;
@@ -1,28 +1,8 @@
1
1
  "use strict";
2
- /*
3
- * Thunderstorm is a full web app framework!
4
- *
5
- * Typescript & Express backend infrastructure that natively runs on firebase function
6
- * Typescript & React frontend infrastructure
7
- *
8
- * Copyright (C) 2020 Intuition Robotics
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
2
  Object.defineProperty(exports, "__esModule", { value: true });
23
3
  exports.ApiException = void 0;
24
- const ts_common_1 = require("@intuitionrobotics/ts-common");
25
- class ApiException extends ts_common_1.CustomException {
4
+ const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
5
+ class ApiException extends exceptions_1.CustomException {
26
6
  constructor(responseCode, debugMessage, cause) {
27
7
  super(ApiException, `${responseCode}-${JSON.stringify(debugMessage)}`, cause);
28
8
  this.responseBody = {};
@@ -1 +1 @@
1
- {"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/main/app-backend/exceptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,4DAA8D;AAM9D,MAAa,YACZ,SAAQ,2BAAe;IAUvB,YAAY,YAAoB,EAAE,YAAqB,EAAE,KAAa;QACrE,KAAK,CAAC,YAAY,EAAE,GAAG,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAT/D,iBAAY,GAAqB,EAAE,CAAC;QAGpC,iBAAY,GAAG,CAAC,SAAuB,EAAE,EAAE;YAC1D,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;YACpC,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;QAKD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC/D,CAAC;CAED;AAlBD,oCAkBC"}
1
+ {"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/main/app-backend/exceptions.ts"],"names":[],"mappings":";;;AACA,6EAA6E;AAI7E,MAAa,YACT,SAAQ,4BAAe;IAUvB,YAAY,YAAoB,EAAE,YAAqB,EAAE,KAAa;QAClE,KAAK,CAAC,YAAY,EAAE,GAAG,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QATlE,iBAAY,GAAqB,EAAE,CAAC;QAGpC,iBAAY,GAAG,CAAC,SAAuB,EAAE,EAAE;YACvD,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;YACpC,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;QAKE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAClE,CAAC;CAEJ;AAlBD,oCAkBC"}
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CleanupScheduler = exports.CleanupScheduler_Class = void 0;
13
- const ts_common_1 = require("@intuitionrobotics/ts-common");
14
13
  const firebase_function_1 = require("@intuitionrobotics/firebase/app-backend/functions/firebase-function");
15
14
  const FirebaseModule_1 = require("@intuitionrobotics/firebase/app-backend/FirebaseModule");
16
- const dispatch_onCleanupSchedulerAct = new ts_common_1.Dispatcher("__onCleanupSchedulerAct");
15
+ const dispatcher_1 = require("@intuitionrobotics/ts-common/core/dispatcher");
16
+ const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
17
+ const dispatch_onCleanupSchedulerAct = new dispatcher_1.Dispatcher("__onCleanupSchedulerAct");
17
18
  class CleanupScheduler_Class extends firebase_function_1.FirebaseScheduledFunction {
18
19
  constructor() {
19
20
  super("CleanupScheduler");
@@ -22,11 +23,11 @@ class CleanupScheduler_Class extends firebase_function_1.FirebaseScheduledFuncti
22
23
  const cleanups = dispatch_onCleanupSchedulerAct.dispatchModule([]);
23
24
  yield Promise.all(cleanups.map((cleanupItem) => __awaiter(this, void 0, void 0, function* () {
24
25
  const doc = yield cleanupStatusCollection.queryUnique({ where: { moduleKey: cleanupItem.moduleKey } });
25
- if (doc && doc.timestamp + cleanupItem.interval > ts_common_1.currentTimeMillies())
26
+ if (doc && doc.timestamp + cleanupItem.interval > date_time_tools_1.currentTimeMillies())
26
27
  return;
27
28
  try {
28
29
  yield cleanupItem.cleanup();
29
- yield cleanupStatusCollection.upsert({ timestamp: ts_common_1.currentTimeMillies(), moduleKey: cleanupItem.moduleKey });
30
+ yield cleanupStatusCollection.upsert({ timestamp: date_time_tools_1.currentTimeMillies(), moduleKey: cleanupItem.moduleKey });
30
31
  }
31
32
  catch (e) {
32
33
  this.logWarning(`cleanup of ${cleanupItem.moduleKey} has failed with error '${e}'`);
@@ -1 +1 @@
1
- {"version":3,"file":"CleanupScheduler.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/CleanupScheduler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAGsC;AACtC,2GAA8G;AAC9G,2FAAsF;AAiBtF,MAAM,8BAA8B,GAAG,IAAI,sBAAU,CAAmD,yBAAyB,CAAC,CAAC;AAEnI,MAAa,sBACZ,SAAQ,6CAAyB;IAEjC;QACC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAI3B,qBAAgB,GAAG,GAAuB,EAAE;YAC3C,MAAM,uBAAuB,GAAG,+BAAc,CAAC,kBAAkB,E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{ ActDetailsDoc } from "./CleanupScheduler";
3
3
  import { FirestoreCollection } from "@intuitionrobotics/firebase/app-backend/firestore/FirestoreCollection";
4
- import { FirestoreQuery } from "@intuitionrobotics/firebase";
4
+ import { FirestoreQuery } from "@intuitionrobotics/firebase/shared/types";
5
5
  export declare type BackupDoc = ActDetailsDoc & {
6
6
  backupPath: string;
7
7
  };
@@ -10,17 +10,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.FirestoreBackupScheduler = exports.FirestoreBackupScheduler_Class = void 0;
13
- const ts_common_1 = require("@intuitionrobotics/ts-common");
14
13
  const firebase_function_1 = require("@intuitionrobotics/firebase/app-backend/functions/firebase-function");
15
14
  const FirebaseModule_1 = require("@intuitionrobotics/firebase/app-backend/FirebaseModule");
16
- const dispatch_onFirestoreBackupSchedulerAct = new ts_common_1.Dispatcher("__onFirestoreBackupSchedulerAct");
15
+ const dispatcher_1 = require("@intuitionrobotics/ts-common/core/dispatcher");
16
+ const array_tools_1 = require("@intuitionrobotics/ts-common/utils/array-tools");
17
+ const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
18
+ const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
19
+ const utils_1 = require("@intuitionrobotics/ts-common/core/logger/utils");
20
+ const error_handling_1 = require("@intuitionrobotics/ts-common/core/error-handling");
21
+ const dispatch_onFirestoreBackupSchedulerAct = new dispatcher_1.Dispatcher("__onFirestoreBackupSchedulerAct");
17
22
  class FirestoreBackupScheduler_Class extends firebase_function_1.FirebaseScheduledFunction {
18
23
  constructor() {
19
24
  super("FirestoreBackupScheduler");
20
25
  this.onScheduledEvent = () => __awaiter(this, void 0, void 0, function* () {
21
26
  const backupStatusCollection = FirebaseModule_1.FirebaseModule.createAdminSession().getFirestore().getCollection('firestore-backup-status', ["moduleKey", "timestamp"]);
22
27
  const backups = [];
23
- ts_common_1.filterInstances(dispatch_onFirestoreBackupSchedulerAct.dispatchModule([])).forEach(backupArray => {
28
+ array_tools_1.filterInstances(dispatch_onFirestoreBackupSchedulerAct.dispatchModule([])).forEach(backupArray => {
24
29
  backups.push(...backupArray);
25
30
  });
26
31
  const bucket = yield FirebaseModule_1.FirebaseModule.createAdminSession().getStorage().getOrCreateBucket();
@@ -32,16 +37,25 @@ class FirestoreBackupScheduler_Class extends firebase_function_1.FirebaseSchedul
32
37
  };
33
38
  const docs = yield backupStatusCollection.query(query);
34
39
  const latestDoc = docs[0];
35
- if (latestDoc && latestDoc.timestamp + backupItem.interval > ts_common_1.currentTimeMillies())
40
+ if (latestDoc && latestDoc.timestamp + backupItem.interval > date_time_tools_1.currentTimeMillies())
36
41
  return;
37
- const backupPath = `backup/firestore/${backupItem.moduleKey}/${ts_common_1.currentTimeMillies()}.json`;
42
+ const backupPath = `backup/firestore/${backupItem.moduleKey}/${date_time_tools_1.currentTimeMillies()}.json`;
38
43
  try {
39
44
  const toBackupData = yield backupItem.collection.query(backupItem.backupQuery);
40
45
  yield (yield bucket.getFile(backupPath)).write(toBackupData);
41
- yield backupStatusCollection.upsert({ timestamp: ts_common_1.currentTimeMillies(), moduleKey: backupItem.moduleKey, backupPath });
46
+ yield backupStatusCollection.upsert({
47
+ timestamp: date_time_tools_1.currentTimeMillies(),
48
+ moduleKey: backupItem.moduleKey,
49
+ backupPath
50
+ });
42
51
  const keepInterval = backupItem.keepInterval;
43
52
  if (keepInterval) {
44
- const queryOld = { where: { moduleKey: backupItem.moduleKey, timestamp: { $lt: ts_common_1.currentTimeMillies() - keepInterval } } };
53
+ const queryOld = {
54
+ where: {
55
+ moduleKey: backupItem.moduleKey,
56
+ timestamp: { $lt: date_time_tools_1.currentTimeMillies() - keepInterval }
57
+ }
58
+ };
45
59
  const oldDocs = yield backupStatusCollection.query(queryOld);
46
60
  yield Promise.all(oldDocs.map((oldDoc) => __awaiter(this, void 0, void 0, function* () {
47
61
  yield (yield bucket.getFile(oldDoc.backupPath)).delete();
@@ -51,8 +65,8 @@ class FirestoreBackupScheduler_Class extends firebase_function_1.FirebaseSchedul
51
65
  }
52
66
  catch (e) {
53
67
  this.logWarning(`backup of ${backupItem.moduleKey} has failed with error`, e);
54
- const errorMessage = `Error backing up firestore collection config:\n ${ts_common_1.__stringify(backupItem, true)}\nError: ${ts_common_1._logger_logException(e)}`;
55
- yield ts_common_1.dispatch_onServerError.dispatchModuleAsync([ts_common_1.ServerErrorSeverity.Critical, this, errorMessage]);
68
+ const errorMessage = `Error backing up firestore collection config:\n ${tools_1.__stringify(backupItem, true)}\nError: ${utils_1._logger_logException(e)}`;
69
+ yield error_handling_1.dispatch_onServerError.dispatchModuleAsync([error_handling_1.ServerErrorSeverity.Critical, this, errorMessage]);
56
70
  }
57
71
  })));
58
72
  });
@@ -1 +1 @@
1
- {"version":3,"file":"FirestoreBackupScheduler.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/FirestoreBackupScheduler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAQsC;AACtC,2GAA8G;AAC9G,2FAAsF;AAqBtF,MAAM,sCAAsC,GAAG,IAAI,sBAAU,CAC5D,iCAAiC,CAAC,CAAC;AAEpC,MAAa,8BACZ,SAAQ,6CAAyB;IAEjC;QACC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAInC,qBAAgB,GAAG,GAAuB,EAAE;YAC3C,MAAM,sBAAsB,GAAG,+BAAc,CAAC,kBAAkB,EAAE,CAAC,YAAY,EAAE,CAAC,aAAa,CAAY,yBAAyB,EACzB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;YACvI,MAAM,OAAO,GAAkC,EAAE,CAAC;YAClD,2BAAe,CAAC,sCAAsC,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBAChG,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;YAEH,MAAM,M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C,CAAC,EAAE,CAAC;oBAE3I,MAAM,uCAAsB,CAAC,mBAAmB,CAAC,CAAC,oCAAmB,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;iBAExG;YACL,CAAC,CAAA,CAAC,CAAC,CAAC;QACR,CAAC,CAAA,CAAC;QAzDE,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;CAyDJ;AA/DD,wEA+DC;AAEY,QAAA,wBAAwB,GAAG,IAAI,8BAA8B,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
- import { Module } from "@intuitionrobotics/ts-common";
2
1
  import { ServerApi_Middleware } from "./server/HttpServer";
3
2
  import { UpgradeRequired } from "../../shared/force-upgrade";
4
3
  import { PlatformName } from "../../shared/consts";
5
4
  import { ExpressRequest } from "../utils/types";
5
+ import { Module } from "@intuitionrobotics/ts-common/core/module";
6
6
  declare type VersionConfig = {
7
7
  [K in PlatformName]: {
8
8
  regexp: string;
@@ -1,24 +1,4 @@
1
1
  "use strict";
2
- /*
3
- * Thunderstorm is a full web app framework!
4
- *
5
- * Typescript & Express backend infrastructure that natively runs on firebase function
6
- * Typescript & React frontend infrastructure
7
- *
8
- * Copyright (C) 2020 Intuition Robotics
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
23
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
24
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -30,16 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30
10
  };
31
11
  Object.defineProperty(exports, "__esModule", { value: true });
32
12
  exports.ForceUpgrade = void 0;
33
- const ts_common_1 = require("@intuitionrobotics/ts-common");
34
13
  const HttpServer_1 = require("./server/HttpServer");
35
14
  const exceptions_1 = require("../exceptions");
36
15
  const force_upgrade_1 = require("../../shared/force-upgrade");
16
+ const module_1 = require("@intuitionrobotics/ts-common/core/module");
17
+ const exceptions_2 = require("@intuitionrobotics/ts-common/core/exceptions");
18
+ const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
37
19
  const Header_PlatformVersion = new HttpServer_1.HeaderKey(force_upgrade_1.HeaderKey_PlatformVersion);
38
20
  const Header_PlatformName = new HttpServer_1.HeaderKey(force_upgrade_1.HeaderKey_PlatformName);
39
21
  // const DefaultRegexps: { [k in PlatformName]: string } = {
40
22
  // chrome: "Chrome/([0-9\.]+)"
41
23
  // };
42
- class ForceUpgrade_Class extends ts_common_1.Module {
24
+ class ForceUpgrade_Class extends module_1.Module {
43
25
  constructor() {
44
26
  super("ForceUpgrade");
45
27
  }
@@ -56,7 +38,7 @@ class ForceUpgrade_Class extends ts_common_1.Module {
56
38
  const regex = new RegExp(platformNameConfig.regexp);
57
39
  const match = platformVersion.match(regex);
58
40
  if (!match)
59
- throw new ts_common_1.BadImplementationException(`Error extracting version.. \nVersion: '${platformVersion}'\n config: '${ts_common_1.__stringify(this.config)}'`);
41
+ throw new exceptions_2.BadImplementationException(`Error extracting version.. \nVersion: '${platformVersion}'\n config: '${tools_1.__stringify(this.config)}'`);
60
42
  const minimumValidVersion = platformNameConfig.minimumValidVersion;
61
43
  if (!minimumValidVersion)
62
44
  return {
@@ -64,13 +46,13 @@ class ForceUpgrade_Class extends ts_common_1.Module {
64
46
  };
65
47
  const matchGroups = match.groups;
66
48
  if (!matchGroups)
67
- throw new ts_common_1.BadImplementationException(`If minimumValidVersion is provided ${platformNameConfig.minimumValidVersion}, then groups in regex have to be defined ${ts_common_1.__stringify(match)}. i.e. "(?<first>[0-9]+).(?<second>[0-9]+).(?<third>[0-9]+)"`);
49
+ throw new exceptions_2.BadImplementationException(`If minimumValidVersion is provided ${platformNameConfig.minimumValidVersion}, then groups in regex have to be defined ${tools_1.__stringify(match)}. i.e. "(?<first>[0-9]+).(?<second>[0-9]+).(?<third>[0-9]+)"`);
68
50
  const minimumVersionMatch = minimumValidVersion.match(regex);
69
51
  if (!minimumVersionMatch)
70
- throw new ts_common_1.BadImplementationException(`Error extracting minimum valid version. \nVersion: '${minimumValidVersion}'\n config: '${ts_common_1.__stringify(this.config)}'`);
52
+ throw new exceptions_2.BadImplementationException(`Error extracting minimum valid version. \nVersion: '${minimumValidVersion}'\n config: '${tools_1.__stringify(this.config)}'`);
71
53
  const versionsGroups = minimumVersionMatch.groups;
72
54
  if (!versionsGroups)
73
- throw new ts_common_1.BadImplementationException(`If minimumValidVersion is provided ${platformNameConfig.minimumValidVersion}, then groups in regex have to be defined ${ts_common_1.__stringify(minimumVersionMatch)}. i.e. "(?<first>[0-9]+).(?<second>[0-9]+).(?<third>[0-9]+)"`);
55
+ throw new exceptions_2.BadImplementationException(`If minimumValidVersion is provided ${platformNameConfig.minimumValidVersion}, then groups in regex have to be defined ${tools_1.__stringify(minimumVersionMatch)}. i.e. "(?<first>[0-9]+).(?<second>[0-9]+).(?<third>[0-9]+)"`);
74
56
  const versions = Object.values(matchGroups);
75
57
  const minimumVersions = Object.values(versionsGroups);
76
58
  for (let i = 0; i < versions.length; i++) {
@@ -1 +1 @@
1
- {"version":3,"file":"ForceUpgrade.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/ForceUpgrade.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;AAEH,4DAIsC;AACtC,oDAG6B;AAE7B,8CAA2C;AAC3C,8DAIoC;AAWpC,MAAM,sBAAsB,GAAG,IAAI,sBAAS,CAAC,yCAAyB,CAAC,CAAC;AACxE,MAAM,mBA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M,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;YAEhC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI;gBACb,OAAO,EAAC,eAAe,EAAE,IAAI,EAAC,CAAA;SAC/B;QAED,OAAO,EAAC,eAAe,EAAE,KAAK,EAAC,CAAA;IAChC,CAAC;IAEK,aAAa,CAAC,OAAuB;;YAC1C,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YACrD,IAAI,eAAe,CAAC,eAAe;gBAClC,MAAM,IAAI,yBAAY,CAAkB,GAAG,EAAE,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,eAAe,EAAC,CAAC,CAAA;QACnI,CAAC;KAAA;;AA9De,6BAAU,GAAyB,CAAO,OAAuB,EAAE,EAAE,kDAAC,OAAA,oBAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA,GAAA,CAAC;AAiE9G,QAAA,YAAY,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
@@ -1,7 +1,5 @@
1
- /**
2
- * Created by AlanBen on 29/08/2019.
3
- */
4
- import { Module, OnApplicationError, ServerErrorSeverity } from "@intuitionrobotics/ts-common";
1
+ import { OnApplicationError, ServerErrorSeverity } from "@intuitionrobotics/ts-common/core/error-handling";
2
+ import { Module } from "@intuitionrobotics/ts-common/core/module";
5
3
  import { WebClientOptions } from "@slack/web-api";
6
4
  declare type ConfigType = {
7
5
  token: string;
@@ -1,24 +1,4 @@
1
1
  "use strict";
2
- /*
3
- * Thunderstorm is a full web app framework!
4
- *
5
- * Typescript & Express backend infrastructure that natively runs on firebase function
6
- * Typescript & React frontend infrastructure
7
- *
8
- * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
23
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
24
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -30,12 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30
10
  };
31
11
  Object.defineProperty(exports, "__esModule", { value: true });
32
12
  exports.Slack_ServerApiError = exports.Slack_ServerApiError_Class = exports.SlackModule = exports.SlackModule_Class = void 0;
33
- /**
34
- * Created by AlanBen on 29/08/2019.
35
- */
36
- const ts_common_1 = require("@intuitionrobotics/ts-common");
13
+ const error_handling_1 = require("@intuitionrobotics/ts-common/core/error-handling");
14
+ const module_1 = require("@intuitionrobotics/ts-common/core/module");
15
+ const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
37
16
  const web_api_1 = require("@slack/web-api");
38
- class SlackModule_Class extends ts_common_1.Module {
17
+ class SlackModule_Class extends module_1.Module {
39
18
  constructor() {
40
19
  super("SlackModule");
41
20
  this.messageMap = {};
@@ -53,7 +32,7 @@ class SlackModule_Class extends ts_common_1.Module {
53
32
  channel: this.config.defaultChannel
54
33
  } : slackMessage;
55
34
  const time = this.messageMap[parameters.text];
56
- if (time && ts_common_1.currentTimeMillies() - time < (this.config.throttlingTime || ts_common_1.Minute))
35
+ if (time && date_time_tools_1.currentTimeMillies() - time < (this.config.throttlingTime || date_time_tools_1.Minute))
57
36
  return;
58
37
  try {
59
38
  return yield this.postMessageImpl(parameters);
@@ -66,23 +45,23 @@ class SlackModule_Class extends ts_common_1.Module {
66
45
  postMessageImpl(message) {
67
46
  return __awaiter(this, void 0, void 0, function* () {
68
47
  const res = yield this.web.chat.postMessage(message);
69
- this.messageMap[message.text] = ts_common_1.currentTimeMillies();
48
+ this.messageMap[message.text] = date_time_tools_1.currentTimeMillies();
70
49
  this.logDebug(`A message was posted to channel: ${message.channel} with message id ${res.ts} which contains the message ${message.text}`);
71
50
  });
72
51
  }
73
52
  }
74
53
  exports.SlackModule_Class = SlackModule_Class;
75
54
  exports.SlackModule = new SlackModule_Class();
76
- class Slack_ServerApiError_Class extends ts_common_1.Module {
55
+ class Slack_ServerApiError_Class extends module_1.Module {
77
56
  constructor() {
78
57
  super("Slack_ServerApiError");
79
- this.setDefaultConfig({ exclude: [], minLevel: ts_common_1.ServerErrorSeverity.Info });
58
+ this.setConfig({ exclude: [], minLevel: error_handling_1.ServerErrorSeverity.Info });
80
59
  }
81
60
  init() {
82
61
  }
83
62
  __processApplicationError(errorLevel, module, message) {
84
63
  return __awaiter(this, void 0, void 0, function* () {
85
- if (ts_common_1.ServerErrorSeverity_Ordinal.indexOf(errorLevel) < ts_common_1.ServerErrorSeverity_Ordinal.indexOf(this.config.minLevel))
64
+ if (error_handling_1.ServerErrorSeverity_Ordinal.indexOf(errorLevel) < error_handling_1.ServerErrorSeverity_Ordinal.indexOf(this.config.minLevel))
86
65
  return;
87
66
  for (const key of this.config.exclude || []) {
88
67
  if (message.includes(key))
@@ -1 +1 @@
1
- {"version":3,"file":"SlackModule.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/SlackModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;AAEH;;GAEG;AAEH,4DAOsC;AACtC,4CAA6E;AA6B7E,MAAa,iBACT,SAAQ,kBAAkB;IAI1B;QACI,KAAK,CAAC,aAAa,CAAC,CAAC;QAHjB,eAAU,GAAe,EAAE,CAAC;IAIpC,CAAC;IAES,IAAI;QACV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;YAClB,OAAM;QACV,mGAAmG;QAEnG,IAAI,CAAC,GAAG,GAAG,IAAI,mB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ES,IAAI;IACd,CAAC;IAEK,yBAAyB,CAAC,UAA+B,EAAE,MAAc,EAAE,OAAe;;YAC5F,IAAI,4CAA2B,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,4CAA2B,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAC3G,OAAO;YAEX,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE;gBACzC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;oBACrB,OAAM;aACb;YAED,MAAM,mBAAW,CAAC,WAAW,CAAC,SAAS,OAAO,QAAQ,CAAC,CAAC;QAC5D,CAAC;KAAA;CACJ;AAtBD,gEAsBC;AAEY,QAAA,oBAAoB,GAAG,IAAI,0BAA0B,EAAE,CAAC"}
@@ -10,30 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AxiosHttpModule = exports.AxiosHttpModule_Class = void 0;
13
- /*
14
- * Thunderstorm is a full web app framework!
15
- *
16
- * Typescript & Express backend infrastructure that natively runs on firebase function
17
- * Typescript & React frontend infrastructure
18
- *
19
- * Copyright (C) 2020 Alan Ben
20
- *
21
- * Licensed under the Apache License, Version 2.0 (the "License");
22
- * you may not use this file except in compliance with the License.
23
- * You may obtain a copy of the License at
24
- *
25
- * http://www.apache.org/licenses/LICENSE-2.0
26
- *
27
- * Unless required by applicable law or agreed to in writing, software
28
- * distributed under the License is distributed on an "AS IS" BASIS,
29
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30
- * See the License for the specific language governing permissions and
31
- * limitations under the License.
32
- */
33
13
  // noinspection TypeScriptPreferShortImport
34
14
  const axios_1 = require("axios");
35
15
  const types_1 = require("../../../shared/types");
36
- const ts_common_1 = require("@intuitionrobotics/ts-common");
16
+ const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
37
17
  const BaseHttpRequest_1 = require("../../../shared/BaseHttpRequest");
38
18
  const BaseHttpModule_1 = require("../../../shared/BaseHttpModule");
39
19
  const fs = require("fs");
@@ -88,7 +68,7 @@ class AxiosHttpRequest extends BaseHttpRequest_1.BaseHttpRequest {
88
68
  }
89
69
  getStatus() {
90
70
  if (!this.status)
91
- throw new ts_common_1.BadImplementationException('Missing status..');
71
+ throw new exceptions_1.BadImplementationException('Missing status..');
92
72
  return this.status;
93
73
  }
94
74
  getResponse() {
@@ -176,7 +156,7 @@ class AxiosHttpRequest extends BaseHttpRequest_1.BaseHttpRequest {
176
156
  }
177
157
  getResponseHeader(headerKey) {
178
158
  if (!this.response)
179
- throw new ts_common_1.BadImplementationException(`axios didn't return yet`);
159
+ throw new exceptions_1.BadImplementationException(`axios didn't return yet`);
180
160
  return this.response.headers[headerKey];
181
161
  }
182
162
  }