@intuitionrobotics/thunderstorm 0.46.0 → 0.47.1
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/app-backend/api/v1/utils/version/_assert.js +20 -0
- package/app-backend/api/v1/utils/version/_assert.js.map +1 -1
- package/app-backend/api/v1/utils/version/assert.js +20 -0
- package/app-backend/api/v1/utils/version/assert.js.map +1 -1
- package/app-backend/core/BaseStorm.d.ts +1 -1
- package/app-backend/core/BaseStorm.js +22 -2
- package/app-backend/core/BaseStorm.js.map +1 -1
- package/app-backend/core/Storm.d.ts +7 -0
- package/app-backend/core/Storm.js +46 -9
- package/app-backend/core/Storm.js.map +1 -1
- package/app-backend/exceptions.d.ts +3 -3
- package/app-backend/exceptions.js +2 -2
- package/app-backend/exceptions.js.map +1 -1
- package/app-backend/modules/CleanupScheduler.d.ts +2 -2
- package/app-backend/modules/CleanupScheduler.js +5 -6
- package/app-backend/modules/CleanupScheduler.js.map +1 -1
- package/app-backend/modules/FirestoreBackupScheduler.d.ts +3 -3
- package/app-backend/modules/FirestoreBackupScheduler.js +9 -23
- package/app-backend/modules/FirestoreBackupScheduler.js.map +1 -1
- package/app-backend/modules/ForceUpgrade.d.ts +2 -2
- package/app-backend/modules/ForceUpgrade.js +28 -8
- package/app-backend/modules/ForceUpgrade.js.map +1 -1
- package/app-backend/modules/SlackModule.d.ts +5 -6
- package/app-backend/modules/SlackModule.js +7 -9
- package/app-backend/modules/SlackModule.js.map +1 -1
- package/app-backend/modules/_imports.d.ts +10 -0
- package/app-backend/modules/_imports.js +47 -0
- package/app-backend/modules/_imports.js.map +1 -0
- package/app-backend/modules/http/AxiosHttpModule.d.ts +7 -17
- package/app-backend/modules/http/AxiosHttpModule.js +47 -20
- package/app-backend/modules/http/AxiosHttpModule.js.map +1 -1
- package/app-backend/modules/http/types.d.ts +5 -5
- package/app-backend/modules/proxy/RemoteProxy.d.ts +3 -4
- package/app-backend/modules/proxy/RemoteProxy.js +30 -11
- package/app-backend/modules/proxy/RemoteProxy.js.map +1 -1
- package/app-backend/modules/proxy/RemoteProxyCaller.d.ts +7 -7
- package/app-backend/modules/proxy/RemoteProxyCaller.js +30 -12
- package/app-backend/modules/proxy/RemoteProxyCaller.js.map +1 -1
- package/app-backend/modules/server/HttpServer.d.ts +5 -6
- package/app-backend/modules/server/HttpServer.js +32 -10
- package/app-backend/modules/server/HttpServer.js.map +1 -1
- package/app-backend/modules/server/server-api.d.ts +9 -13
- package/app-backend/modules/server/server-api.js +23 -52
- package/app-backend/modules/server/server-api.js.map +1 -1
- package/app-backend/modules/server/server-errors.d.ts +2 -2
- package/app-backend/modules/server/server-errors.js +26 -7
- package/app-backend/modules/server/server-errors.js.map +1 -1
- package/app-backend/utils/LogClient_File.d.ts +2 -2
- package/app-backend/utils/LogClient_File.js +30 -12
- package/app-backend/utils/LogClient_File.js.map +1 -1
- package/app-backend/utils/file.js +20 -0
- package/app-backend/utils/file.js.map +1 -1
- package/app-backend/utils/promisify-request.js +4 -5
- package/app-backend/utils/promisify-request.js.map +1 -1
- package/app-backend/utils/to-be-removed.js +2 -2
- package/app-backend/utils/to-be-removed.js.map +1 -1
- package/app-backend/utils/types.d.ts +10 -7
- package/app-backend/utils/types.js +22 -2
- package/app-backend/utils/types.js.map +1 -1
- package/app-frontend/components/ActionButton.js +20 -0
- package/app-frontend/components/ActionButton.js.map +1 -1
- package/app-frontend/components/DropDown.d.ts +4 -4
- package/app-frontend/components/DropDown.js +25 -6
- package/app-frontend/components/DropDown.js.map +1 -1
- package/app-frontend/components/FilterInput.d.ts +2 -2
- package/app-frontend/components/FilterInput.js +23 -4
- package/app-frontend/components/FilterInput.js.map +1 -1
- package/app-frontend/components/GenericSelect.d.ts +2 -2
- package/app-frontend/components/GenericSelect.js.map +1 -1
- package/app-frontend/components/GenericTabs.d.ts +4 -0
- package/app-frontend/components/GenericTabs.js +11 -0
- package/app-frontend/components/GenericTabs.js.map +1 -0
- package/app-frontend/components/Overlay.d.ts +2 -2
- package/app-frontend/components/Overlay.js +20 -0
- package/app-frontend/components/Overlay.js.map +1 -1
- package/app-frontend/components/TS_Input.d.ts +2 -2
- package/app-frontend/components/TS_Input.js +23 -3
- package/app-frontend/components/TS_Input.js.map +1 -1
- package/app-frontend/components/TS_Table.d.ts +8 -8
- package/app-frontend/components/TS_Table.js +20 -0
- package/app-frontend/components/TS_Table.js.map +1 -1
- package/app-frontend/components/TS_TextArea.d.ts +2 -2
- package/app-frontend/components/TS_TextArea.js +20 -0
- package/app-frontend/components/TS_TextArea.js.map +1 -1
- package/app-frontend/components/Tabs.d.ts +2 -2
- package/app-frontend/components/adapter/Adapter.d.ts +15 -15
- package/app-frontend/components/adapter/Adapter.js +6 -6
- package/app-frontend/components/adapter/Adapter.js.map +1 -1
- package/app-frontend/components/adapter/BaseRenderer.d.ts +7 -7
- package/app-frontend/components/adapter/BaseRenderer.js +20 -0
- package/app-frontend/components/adapter/BaseRenderer.js.map +1 -1
- package/app-frontend/components/checkbox/TS_Checkbox.d.ts +3 -3
- package/app-frontend/components/checkbox/TS_Checkbox.js +1 -2
- package/app-frontend/components/checkbox/TS_Checkbox.js.map +1 -1
- package/app-frontend/components/checkbox/TS_CheckboxField.d.ts +3 -3
- package/app-frontend/components/checkbox/TS_CheckboxField.js +18 -0
- package/app-frontend/components/checkbox/TS_CheckboxField.js.map +1 -1
- package/app-frontend/components/form/Form.d.ts +4 -5
- package/app-frontend/components/form/Form.js +22 -2
- package/app-frontend/components/form/Form.js.map +1 -1
- package/app-frontend/components/form/types.d.ts +5 -6
- package/app-frontend/components/form/types.js +20 -0
- package/app-frontend/components/form/types.js.map +1 -1
- package/app-frontend/components/playground/Playground.d.ts +3 -3
- package/app-frontend/components/playground/Playground.js +2 -3
- package/app-frontend/components/playground/Playground.js.map +1 -1
- package/app-frontend/components/tree/MenuComponent.d.ts +1 -1
- package/app-frontend/components/tree/MenuComponent.js +22 -2
- package/app-frontend/components/tree/MenuComponent.js.map +1 -1
- package/app-frontend/components/tree/MultiTypeAdaptor.d.ts +1 -1
- package/app-frontend/components/tree/MultiTypeAdaptor.js +22 -2
- package/app-frontend/components/tree/MultiTypeAdaptor.js.map +1 -1
- package/app-frontend/components/tree/SimpleTreeNodeRenderer.js +20 -0
- package/app-frontend/components/tree/SimpleTreeNodeRenderer.js.map +1 -1
- package/app-frontend/components/tree/Tree.d.ts +4 -4
- package/app-frontend/components/tree/Tree.js +13 -13
- package/app-frontend/components/tree/Tree.js.map +1 -1
- package/app-frontend/components/tree/types.d.ts +1 -1
- package/app-frontend/components/tree/types.js +20 -0
- package/app-frontend/components/tree/types.js.map +1 -1
- package/app-frontend/components/treeicons.js.map +1 -1
- package/app-frontend/components/types.d.ts +2 -2
- package/app-frontend/components/types.js +20 -0
- package/app-frontend/components/types.js.map +1 -1
- package/app-frontend/core/AbstractThunder.d.ts +4 -1
- package/app-frontend/core/AbstractThunder.js +32 -0
- package/app-frontend/core/AbstractThunder.js.map +1 -1
- package/app-frontend/core/AppPage.d.ts +1 -1
- package/app-frontend/core/AppPage.js +20 -0
- package/app-frontend/core/AppPage.js.map +1 -1
- package/app-frontend/core/AppWrapper.d.ts +1 -1
- package/app-frontend/core/AppWrapper.js +23 -2
- package/app-frontend/core/AppWrapper.js.map +1 -1
- package/app-frontend/core/BaseComponent.d.ts +1 -2
- package/app-frontend/core/BaseComponent.js +18 -18
- package/app-frontend/core/BaseComponent.js.map +1 -1
- package/app-frontend/core/SimpleScriptInjector.d.ts +1 -1
- package/app-frontend/core/SimpleScriptInjector.js +22 -2
- package/app-frontend/core/SimpleScriptInjector.js.map +1 -1
- package/app-frontend/core/Thunder.js +27 -8
- package/app-frontend/core/Thunder.js.map +1 -1
- package/app-frontend/core/thunder-dispatcher.d.ts +5 -6
- package/app-frontend/core/thunder-dispatcher.js +7 -19
- package/app-frontend/core/thunder-dispatcher.js.map +1 -1
- package/app-frontend/modules/ConnectivityModule.d.ts +1 -1
- package/app-frontend/modules/ConnectivityModule.js +4 -4
- package/app-frontend/modules/ConnectivityModule.js.map +1 -1
- package/app-frontend/modules/ForceUpgrade.d.ts +2 -2
- package/app-frontend/modules/ForceUpgrade.js +25 -6
- package/app-frontend/modules/ForceUpgrade.js.map +1 -1
- package/app-frontend/modules/HistoryModule.d.ts +2 -3
- package/app-frontend/modules/HistoryModule.js +6 -10
- package/app-frontend/modules/HistoryModule.js.map +1 -1
- package/app-frontend/modules/ResourcesModule.d.ts +2 -2
- package/app-frontend/modules/ResourcesModule.js +2 -2
- package/app-frontend/modules/ResourcesModule.js.map +1 -1
- package/app-frontend/modules/StorageModule.d.ts +1 -1
- package/app-frontend/modules/StorageModule.js +5 -6
- package/app-frontend/modules/StorageModule.js.map +1 -1
- package/app-frontend/modules/ThunderstormModule.d.ts +2 -2
- package/app-frontend/modules/ThunderstormModule.js +3 -3
- package/app-frontend/modules/ThunderstormModule.js.map +1 -1
- package/app-frontend/modules/component-loader/ReactEntryComponentInjector.d.ts +3 -3
- package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js +20 -0
- package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js.map +1 -1
- package/app-frontend/modules/component-loader/entry-component-loading-module.d.ts +1 -1
- package/app-frontend/modules/component-loader/entry-component-loading-module.js +25 -4
- package/app-frontend/modules/component-loader/entry-component-loading-module.js.map +1 -1
- package/app-frontend/modules/dialog/Dialog.d.ts +5 -5
- package/app-frontend/modules/dialog/Dialog.js +23 -1
- package/app-frontend/modules/dialog/Dialog.js.map +1 -1
- package/app-frontend/modules/dialog/DialogModule.d.ts +3 -3
- package/app-frontend/modules/dialog/DialogModule.js +24 -4
- package/app-frontend/modules/dialog/DialogModule.js.map +1 -1
- package/app-frontend/modules/http/HttpClient.js +20 -0
- package/app-frontend/modules/http/HttpClient.js.map +1 -1
- package/app-frontend/modules/http/XhrHttpModule.d.ts +3 -19
- package/app-frontend/modules/http/XhrHttpModule.js +21 -22
- package/app-frontend/modules/http/XhrHttpModule.js.map +1 -1
- package/app-frontend/modules/locale/LocaleModule.d.ts +2 -2
- package/app-frontend/modules/locale/LocaleModule.js +6 -7
- package/app-frontend/modules/locale/LocaleModule.js.map +1 -1
- package/app-frontend/modules/locale/types.d.ts +3 -3
- package/app-frontend/modules/menu/MenuAndButton.d.ts +1 -1
- package/app-frontend/modules/menu/MenuAndButton.js +3 -3
- package/app-frontend/modules/menu/MenuAndButton.js.map +1 -1
- package/app-frontend/modules/menu/MenuModule.d.ts +3 -3
- package/app-frontend/modules/menu/MenuModule.js +5 -6
- package/app-frontend/modules/menu/MenuModule.js.map +1 -1
- package/app-frontend/modules/menu/PopupMenu.d.ts +3 -3
- package/app-frontend/modules/menu/PopupMenu.js +4 -4
- package/app-frontend/modules/menu/PopupMenu.js.map +1 -1
- package/app-frontend/modules/routing/RoutingModule.d.ts +4 -4
- package/app-frontend/modules/routing/RoutingModule.js +25 -6
- package/app-frontend/modules/routing/RoutingModule.js.map +1 -1
- package/app-frontend/modules/routing/route.d.ts +1 -1
- package/app-frontend/modules/routing/route.js +20 -0
- package/app-frontend/modules/routing/route.js.map +1 -1
- package/app-frontend/modules/toaster/BaseToaster.d.ts +4 -4
- package/app-frontend/modules/toaster/BaseToaster.js +22 -0
- package/app-frontend/modules/toaster/BaseToaster.js.map +1 -1
- package/app-frontend/modules/toaster/Toaster.js +20 -0
- package/app-frontend/modules/toaster/Toaster.js.map +1 -1
- package/app-frontend/modules/toaster/ToasterModule.d.ts +5 -5
- package/app-frontend/modules/toaster/ToasterModule.js +28 -8
- package/app-frontend/modules/toaster/ToasterModule.js.map +1 -1
- package/app-frontend/modules/tooltip/Tooltip.d.ts +2 -2
- package/app-frontend/modules/tooltip/Tooltip.js +22 -2
- package/app-frontend/modules/tooltip/Tooltip.js.map +1 -1
- package/app-frontend/modules/tooltip/TooltipModule.d.ts +3 -3
- package/app-frontend/modules/tooltip/TooltipModule.js +25 -6
- package/app-frontend/modules/tooltip/TooltipModule.js.map +1 -1
- package/app-frontend/tools/KeyboardListener.d.ts +1 -1
- package/app-frontend/tools/KeyboardListener.js +17 -0
- package/app-frontend/tools/KeyboardListener.js.map +1 -1
- package/app-frontend/tools/Stylable.d.ts +1 -1
- package/app-frontend/tools/Stylable.js +20 -0
- package/app-frontend/tools/Stylable.js.map +1 -1
- package/app-frontend/types/renderer-map.js +21 -1
- package/app-frontend/types/renderer-map.js.map +1 -1
- package/app-frontend/utils/tools.js +23 -3
- package/app-frontend/utils/tools.js.map +1 -1
- package/app-frontend/widgets/FieldEditor.d.ts +1 -1
- package/app-frontend/widgets/FieldEditorClick.d.ts +2 -2
- package/app-frontend/widgets/FieldEditorClick.js +3 -3
- package/app-frontend/widgets/FieldEditorClick.js.map +1 -1
- package/app-frontend/widgets/FieldEditorWithButtons.d.ts +2 -2
- package/app-frontend/widgets/FieldEditorWithButtons.js +3 -3
- package/app-frontend/widgets/FieldEditorWithButtons.js.map +1 -1
- package/app-frontend/widgets/click-to-drag/ClickToDrag.d.ts +2 -2
- package/app-frontend/widgets/click-to-drag/OverlayWithDocumentListener.d.ts +2 -2
- package/app-frontend/widgets/click-to-drag/OverlayWithDocumentListener.js.map +1 -1
- package/backend-test.d.ts +1 -0
- package/backend-test.js +38 -0
- package/backend-test.js.map +1 -0
- package/backend.d.ts +17 -0
- package/backend.js +54 -0
- package/backend.js.map +1 -0
- package/frontend.d.ts +54 -0
- package/frontend.js +91 -0
- package/frontend.js.map +1 -0
- package/index.d.ts +6 -0
- package/index.js +41 -0
- package/index.js.map +1 -1
- package/package.json +9 -9
- package/shared/BaseHttpModule.d.ts +4 -6
- package/shared/BaseHttpModule.js +5 -6
- package/shared/BaseHttpModule.js.map +1 -1
- package/shared/BaseHttpRequest.d.ts +5 -7
- package/shared/BaseHttpRequest.js +12 -13
- package/shared/BaseHttpRequest.js.map +1 -1
- package/shared/consts.d.ts +1 -1
- package/shared/consts.js +20 -0
- package/shared/consts.js.map +1 -1
- package/shared/force-upgrade.d.ts +2 -2
- package/shared/force-upgrade.js +20 -0
- package/shared/force-upgrade.js.map +1 -1
- package/shared/request-types.d.ts +5 -5
- package/shared/request-types.js +21 -1
- package/shared/request-types.js.map +1 -1
- package/shared/types.d.ts +12 -11
- package/shared/types.js +21 -1
- package/shared/types.js.map +1 -1
- package/test-backend/StormTester.js +27 -7
- package/test-backend/StormTester.js.map +1 -1
- package/test-frontend/ThunderTester.js +20 -0
- package/test-frontend/ThunderTester.js.map +1 -1
- package/app-frontend/components/playground/Example_NewProps.d.ts +0 -23
- package/app-frontend/components/playground/Example_NewProps.js +0 -43
- package/app-frontend/components/playground/Example_NewProps.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,2 +1,43 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
29
|
+
}) : (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
o[k2] = m[k];
|
|
32
|
+
}));
|
|
33
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
34
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
__exportStar(require("./shared/types"), exports);
|
|
38
|
+
__exportStar(require("./shared/request-types"), exports);
|
|
39
|
+
__exportStar(require("./shared/force-upgrade"), exports);
|
|
40
|
+
__exportStar(require("./shared/consts"), exports);
|
|
41
|
+
__exportStar(require("./shared/BaseHttpRequest"), exports);
|
|
42
|
+
__exportStar(require("./shared/BaseHttpModule"), exports);
|
|
2
43
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,iDAA+B;AAC/B,yDAAuC;AACvC,yDAAuC;AACvC,kDAAgC;AAChC,2DAAyC;AACzC,0DAAwC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuitionrobotics/thunderstorm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.1",
|
|
4
4
|
"description": "Thunderstorm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"IR",
|
|
7
7
|
"express",
|
|
8
8
|
"infra",
|
|
9
|
-
"nu-art",
|
|
10
9
|
"thunderstorm",
|
|
11
10
|
"typescript"
|
|
12
11
|
],
|
|
@@ -24,16 +23,17 @@
|
|
|
24
23
|
"types": "./index.d.ts",
|
|
25
24
|
"sideEffects": false,
|
|
26
25
|
"scripts": {
|
|
27
|
-
"build": "tsc"
|
|
26
|
+
"build": "tsc -v && tsc -p src/main/tsconfig.json --rootDir ./src/main --outDir dist"
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
30
|
-
"@intuitionrobotics/firebase": "~0.
|
|
31
|
-
"@intuitionrobotics/ts-common": "~0.
|
|
29
|
+
"@intuitionrobotics/firebase": "~0.47.0",
|
|
30
|
+
"@intuitionrobotics/ts-common": "~0.47.0",
|
|
32
31
|
"@slack/web-api": "^5.1.0",
|
|
33
32
|
"axios": "^1.4.0",
|
|
34
33
|
"body-parser": "^1.19.0",
|
|
35
34
|
"buffer": "^6.0.3",
|
|
36
35
|
"compression": "^1.7.4",
|
|
36
|
+
"csstype": "3.1.2",
|
|
37
37
|
"express": "^4.16.4",
|
|
38
38
|
"history": "^4.9.0",
|
|
39
39
|
"react": "^16.0.0",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"react-select": "^4.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@intuitionrobotics/testelot": "~0.
|
|
45
|
+
"@intuitionrobotics/testelot": "~0.47.0",
|
|
46
46
|
"@types/compression": "^1.7.0",
|
|
47
47
|
"@types/express": "^4.16.1",
|
|
48
48
|
"@types/history": "^4.7.2",
|
|
49
|
-
"@types/node": "^
|
|
50
|
-
"@types/react": "^16.
|
|
49
|
+
"@types/node": "^18.0.0",
|
|
50
|
+
"@types/react": "^16.0.0",
|
|
51
51
|
"@types/react-dom": "^16.0.0",
|
|
52
52
|
"@types/react-router": "^5.1.4",
|
|
53
53
|
"@types/react-router-dom": "^5.1.3",
|
|
54
54
|
"@types/react-select": "^4.0.0",
|
|
55
55
|
"ts-node": "^9.1.1",
|
|
56
56
|
"tslint": "^5.16.0",
|
|
57
|
-
"typescript": "
|
|
57
|
+
"typescript": "^5.3.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ApiTypeBinder, HttpMethod } from "./types";
|
|
2
|
-
import { Module } from "@intuitionrobotics/ts-common
|
|
1
|
+
import { ApiTypeBinder, HttpMethod, QueryParams } from "./types";
|
|
2
|
+
import { Module } from "@intuitionrobotics/ts-common";
|
|
3
3
|
import { RequestErrorHandler, RequestSuccessHandler, ResponseHandler } from "./request-types";
|
|
4
4
|
import { BaseHttpRequest } from "./BaseHttpRequest";
|
|
5
|
-
|
|
5
|
+
export type HttpConfig = {
|
|
6
6
|
origin?: string;
|
|
7
7
|
timeout?: number;
|
|
8
8
|
compress?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare type DeriveRealBinder<Binder> = Binder extends ApiTypeBinder<infer U, infer R, infer B, infer P> ? ApiTypeBinder<U, R, B, P> : void;
|
|
11
10
|
export declare abstract class BaseHttpModule_Class<Config extends HttpConfig = HttpConfig> extends Module<Config> {
|
|
12
11
|
private defaultErrorHandlers;
|
|
13
12
|
private defaultSuccessHandlers;
|
|
@@ -21,7 +20,7 @@ export declare abstract class BaseHttpModule_Class<Config extends HttpConfig = H
|
|
|
21
20
|
init(): void;
|
|
22
21
|
shouldCompress(): boolean | undefined;
|
|
23
22
|
addDefaultHeader(key: string, header: (() => string | string[]) | string | string[]): void;
|
|
24
|
-
abstract createRequest<Binder extends ApiTypeBinder<
|
|
23
|
+
abstract createRequest<Binder extends ApiTypeBinder<U, R, B, P, E>, U extends string = Binder["url"], R = Binder["response"], B = Binder["body"], P extends QueryParams = Binder["queryParams"], E extends void | object = Binder["error"]>(method: HttpMethod, key: string, data?: string): BaseHttpRequest<Binder>;
|
|
25
24
|
processDefaultResponseHandlers: (httpRequest: BaseHttpRequest<any>) => boolean;
|
|
26
25
|
addDefaultResponseHandler(defaultResponseHandler: ResponseHandler): void;
|
|
27
26
|
removeDefaultResponseHandler(defaultResponseHandler: ResponseHandler): void;
|
|
@@ -30,4 +29,3 @@ export declare abstract class BaseHttpModule_Class<Config extends HttpConfig = H
|
|
|
30
29
|
handleRequestFailure: RequestErrorHandler<any>;
|
|
31
30
|
handleRequestSuccess: RequestSuccessHandler;
|
|
32
31
|
}
|
|
33
|
-
export {};
|
package/shared/BaseHttpModule.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseHttpModule_Class = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
class BaseHttpModule_Class extends module_1.Module {
|
|
4
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
5
|
+
class BaseHttpModule_Class extends ts_common_1.Module {
|
|
7
6
|
constructor(name) {
|
|
8
7
|
super(name);
|
|
9
8
|
this.defaultErrorHandlers = [];
|
|
@@ -39,7 +38,7 @@ class BaseHttpModule_Class extends module_1.Module {
|
|
|
39
38
|
successHandler(request);
|
|
40
39
|
}
|
|
41
40
|
};
|
|
42
|
-
this.
|
|
41
|
+
this.setDefaultConfig({ compress: true });
|
|
43
42
|
}
|
|
44
43
|
init() {
|
|
45
44
|
this.timeout = this.config.timeout || this.timeout;
|
|
@@ -51,10 +50,10 @@ class BaseHttpModule_Class extends module_1.Module {
|
|
|
51
50
|
this.defaultHeaders[key.toLowerCase()] = header;
|
|
52
51
|
}
|
|
53
52
|
addDefaultResponseHandler(defaultResponseHandler) {
|
|
54
|
-
this.defaultResponseHandler
|
|
53
|
+
(0, ts_common_1.addItemToArray)(this.defaultResponseHandler, defaultResponseHandler);
|
|
55
54
|
}
|
|
56
55
|
removeDefaultResponseHandler(defaultResponseHandler) {
|
|
57
|
-
|
|
56
|
+
(0, ts_common_1.removeItemFromArray)(this.defaultResponseHandler, defaultResponseHandler);
|
|
58
57
|
}
|
|
59
58
|
setErrorHandlers(defaultErrorHandlers) {
|
|
60
59
|
this.defaultErrorHandlers = defaultErrorHandlers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseHttpModule.js","sourceRoot":"","sources":["../../src/main/shared/BaseHttpModule.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"BaseHttpModule.js","sourceRoot":"","sources":["../../src/main/shared/BaseHttpModule.ts"],"names":[],"mappings":";;;AAuBA,4DAA0F;AAY1F,MAAsB,oBAClB,SAAQ,kBAAc;IAUtB,YAAY,IAAY;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;QATR,yBAAoB,GAA+B,EAAE,CAAC;QACtD,2BAAsB,GAA4B,EAAE,CAAC;QAGnD,YAAO,GAAW,KAAK,CAAC;QACjB,2BAAsB,GAAsB,EAAE,CAAC;QAC7C,mBAAc,GAAmE,EAAE,CAAC;QA0BvG,mCAA8B,GAAG,CAAC,WAAiC,EAAE,EAAE;YACnE,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,KAAK,MAAM,eAAe,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;gBACxD,QAAQ,GAAG,QAAQ,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;YACxD,CAAC;YAED,OAAO,QAAQ,CAAC;QACpB,CAAC,CAAC;QAkBF,yBAAoB,GAA6B,CAAC,OAA6B,EAAE,QAA6B,EAAE,EAAE;YAC9G,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;YAC1C,MAAM,OAAO,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,CAAC;YAEvC,IAAI,CAAC,QAAQ,CAAC,yBAAyB,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC;YACjE,IAAI,OAAO;gBACP,IAAI,CAAC,QAAQ,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;YAE9C,IAAI,OAAO;gBACP,IAAI,CAAC,QAAQ,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;YAE9C,KAAK,MAAM,YAAY,IAAI,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BAAkB,CAAC,oBAA6C;QAC5D,IAAI,CAAC,sBAAsB,GAAG,oBAAoB,CAAC;IACvD,CAAC;CA6BJ;AAvFD,oDAuFC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ApiTypeBinder,
|
|
1
|
+
import { ApiTypeBinder, ErrorResponse, HttpMethod, QueryParams } from "./types";
|
|
2
2
|
import { RequestErrorHandler, RequestSuccessHandler, TS_Progress } from "./request-types";
|
|
3
|
-
|
|
3
|
+
type DefaultHeaders = {
|
|
4
4
|
[s: string]: ((url: string) => string | string[]) | string | string[];
|
|
5
5
|
};
|
|
6
|
-
export declare abstract class BaseHttpRequest<Binder extends ApiTypeBinder<U, R, B, P, E>, U extends string =
|
|
6
|
+
export declare abstract class BaseHttpRequest<Binder extends ApiTypeBinder<U, R, B, P, E>, U extends string = Binder["url"], R = Binder["response"], B = Binder["body"], P extends QueryParams = Binder["queryParams"], E extends void | object = Binder["error"]> {
|
|
7
7
|
key: string;
|
|
8
8
|
requestData: string | undefined;
|
|
9
9
|
errorMessage: string;
|
|
@@ -16,9 +16,7 @@ export declare abstract class BaseHttpRequest<Binder extends ApiTypeBinder<U, R,
|
|
|
16
16
|
protected timeout: number;
|
|
17
17
|
protected body: B;
|
|
18
18
|
protected url: string;
|
|
19
|
-
protected params
|
|
20
|
-
[K in keyof P]?: P[K];
|
|
21
|
-
};
|
|
19
|
+
protected params?: P;
|
|
22
20
|
protected responseType: string;
|
|
23
21
|
private defaultHeaders;
|
|
24
22
|
protected label: string;
|
|
@@ -63,7 +61,7 @@ export declare abstract class BaseHttpRequest<Binder extends ApiTypeBinder<U, R,
|
|
|
63
61
|
protected prepareJsonBody(bodyObject: B): any;
|
|
64
62
|
setBody(bodyAsString: any, _compress?: boolean): this;
|
|
65
63
|
asJson(): R;
|
|
66
|
-
asText(): R
|
|
64
|
+
asText(): NonNullable<R>;
|
|
67
65
|
protected resolveResponse(): R;
|
|
68
66
|
private handleFailure;
|
|
69
67
|
private isValidStatus;
|
|
@@ -10,17 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.BaseHttpRequest = void 0;
|
|
13
|
-
const
|
|
13
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
14
14
|
const types_1 = require("./types");
|
|
15
15
|
const request_types_1 = require("./request-types");
|
|
16
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
17
|
-
const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
|
|
18
16
|
class BaseHttpRequest {
|
|
19
17
|
constructor(requestKey, requestData) {
|
|
20
18
|
this.headers = {};
|
|
21
19
|
this.method = types_1.HttpMethod.GET;
|
|
22
20
|
this.timeout = 10000;
|
|
23
|
-
this.params = {};
|
|
24
21
|
this.defaultHeaders = {};
|
|
25
22
|
this.aborted = false;
|
|
26
23
|
this.addDefaultHeaders = () => {
|
|
@@ -43,7 +40,7 @@ class BaseHttpRequest {
|
|
|
43
40
|
}
|
|
44
41
|
// I want this to follow through
|
|
45
42
|
default:
|
|
46
|
-
throw new
|
|
43
|
+
throw new ts_common_1.BadImplementationException("Headers values can only be of type: (() => string | string[]) | string | string[] ");
|
|
47
44
|
}
|
|
48
45
|
});
|
|
49
46
|
};
|
|
@@ -111,14 +108,17 @@ class BaseHttpRequest {
|
|
|
111
108
|
setUrlParams(params) {
|
|
112
109
|
if (!params)
|
|
113
110
|
return this;
|
|
114
|
-
|
|
111
|
+
(0, ts_common_1._keys)(params).forEach((key) => {
|
|
115
112
|
const param = params[key];
|
|
116
113
|
return param && typeof param === "string" && this.setUrlParam(key, param);
|
|
117
114
|
});
|
|
118
115
|
return this;
|
|
119
116
|
}
|
|
120
117
|
setUrlParam(key, value) {
|
|
121
|
-
|
|
118
|
+
if (!this.params)
|
|
119
|
+
this.params = {};
|
|
120
|
+
else
|
|
121
|
+
delete this.params[key];
|
|
122
122
|
this.params[key] = value;
|
|
123
123
|
return this;
|
|
124
124
|
}
|
|
@@ -128,7 +128,7 @@ class BaseHttpRequest {
|
|
|
128
128
|
}
|
|
129
129
|
setRelativeUrl(relativeUrl) {
|
|
130
130
|
if (!this.origin)
|
|
131
|
-
throw new
|
|
131
|
+
throw new ts_common_1.BadImplementationException('if you want to use relative urls, you need to set an origin');
|
|
132
132
|
this.url = this.origin + relativeUrl;
|
|
133
133
|
return this;
|
|
134
134
|
}
|
|
@@ -191,13 +191,13 @@ class BaseHttpRequest {
|
|
|
191
191
|
asJson() {
|
|
192
192
|
const response = this.getResponse();
|
|
193
193
|
if (!response)
|
|
194
|
-
throw new
|
|
194
|
+
throw new ts_common_1.BadImplementationException("No xhr.response...");
|
|
195
195
|
return JSON.parse(response);
|
|
196
196
|
}
|
|
197
197
|
asText() {
|
|
198
198
|
const response = this.getResponse();
|
|
199
199
|
if (!response)
|
|
200
|
-
throw new
|
|
200
|
+
throw new ts_common_1.BadImplementationException("No xhr object... maybe you didn't wait for the request to return??");
|
|
201
201
|
return response;
|
|
202
202
|
}
|
|
203
203
|
resolveResponse() {
|
|
@@ -238,8 +238,7 @@ class BaseHttpRequest {
|
|
|
238
238
|
if (this.aborted)
|
|
239
239
|
throw new request_types_1.HttpException(this.getStatus(), this.url); // should be status 0
|
|
240
240
|
// run this anyway to have consistent behaviour
|
|
241
|
-
(_a = this.defaultResponseHandler) === null || _a === void 0 ? void 0 : _a.call(
|
|
242
|
-
this, this);
|
|
241
|
+
(_a = this.defaultResponseHandler) === null || _a === void 0 ? void 0 : _a.call(this, this);
|
|
243
242
|
if (!this.isValidStatus()) {
|
|
244
243
|
this.handleFailure();
|
|
245
244
|
throw new request_types_1.HttpException(this.getStatus(), this.url);
|
|
@@ -264,7 +263,7 @@ class BaseHttpRequest {
|
|
|
264
263
|
this.handleRequestSuccess(this);
|
|
265
264
|
resolve();
|
|
266
265
|
});
|
|
267
|
-
|
|
266
|
+
(0, ts_common_1._setTimeout)(() => {
|
|
268
267
|
const label = this.label || `http request: ${this.key}`;
|
|
269
268
|
new Promise(toCall)
|
|
270
269
|
.then(() => console.log(`Async call completed: ${label}`))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseHttpRequest.js","sourceRoot":"","sources":["../../src/main/shared/BaseHttpRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"BaseHttpRequest.js","sourceRoot":"","sources":["../../src/main/shared/BaseHttpRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAA4F;AAC5F,mCAA8E;AAC9E,mDAAuG;AAIvG,MAAsB,eAAe;IAgCjC,YAAY,UAAkB,EAAE,WAAoB;QAjB1C,YAAO,GAA8B,EAAE,CAAC;QACxC,WAAM,GAAe,kBAAU,CAAC,GAAG,CAAC;QACpC,YAAO,GAAW,KAAK,CAAC;QAK1B,mBAAc,GAAmB,EAAE,CAAC;QAMlC,YAAO,GAAY,KAAK,CAAC;QA0S3B,sBAAiB,GAAG,GAAG,EAAE;YAC7B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC9C,qFAAqF;gBACrF,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;oBAClB,OAAO;gBAEX,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;gBAChD,QAAQ,OAAO,aAAa,EAAE,CAAC;oBAC3B,KAAK,UAAU;wBACX,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;wBAC7C,OAAO;oBAEX,KAAK,QAAQ;wBACT,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;wBACnC,OAAO;oBAEX,KAAK,QAAQ;wBACT,IAAI,KAAK,CAAC,OAAO,CAAC,aAA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B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;gBACrB,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAEtC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YACxC,eAAe,KAAI,MAAM,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA,CAAC;YACrE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAChC,OAAO,EAAE,CAAC;QACd,CAAC,CAAA,CAAC;QAEF,IAAA,uBAAW,EAAC,GAAG,EAAE;YACb,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,iBAAiB,IAAI,CAAC,GAAG,EAAE,CAAC;YACxD,IAAI,OAAO,CAAC,MAAM,CAAC;iBACd,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,KAAK,EAAE,CAAC,CAAC;iBACzD,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAYD,KAAK;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;CAgCJ;AAlWD,0CAkWC"}
|
package/shared/consts.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export declare const HeaderKey_Env = "x-env";
|
|
|
2
2
|
export declare const HeaderKey_CurrentPage = "x-current-page";
|
|
3
3
|
export declare const HeaderKey_FunctionExecutionId = "function-execution-id";
|
|
4
4
|
export declare const HeaderKey_JWT = "jwt";
|
|
5
|
-
export
|
|
5
|
+
export type PlatformName = string;
|
package/shared/consts.js
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
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
|
+
*/
|
|
2
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
23
|
exports.HeaderKey_JWT = exports.HeaderKey_FunctionExecutionId = exports.HeaderKey_CurrentPage = exports.HeaderKey_Env = void 0;
|
|
4
24
|
exports.HeaderKey_Env = "x-env";
|
package/shared/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/main/shared/consts.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/main/shared/consts.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC;AACxB,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AACzC,QAAA,6BAA6B,GAAG,uBAAuB,CAAC;AACxD,QAAA,aAAa,GAAG,KAAK,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiWithQuery } from "./types";
|
|
2
2
|
export declare const HeaderKey_PlatformVersion = "x-platform-version";
|
|
3
3
|
export declare const HeaderKey_PlatformName = "x-platform-name";
|
|
4
|
-
export
|
|
4
|
+
export type UpgradeRequired = {
|
|
5
5
|
upgradeRequired?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type ApiBinder_AssertAppVersion = ApiWithQuery<string, UpgradeRequired>;
|
package/shared/force-upgrade.js
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
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
|
+
*/
|
|
2
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
23
|
exports.HeaderKey_PlatformName = exports.HeaderKey_PlatformVersion = void 0;
|
|
4
24
|
exports.HeaderKey_PlatformVersion = "x-platform-version";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"force-upgrade.js","sourceRoot":"","sources":["../../src/main/shared/force-upgrade.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"force-upgrade.js","sourceRoot":"","sources":["../../src/main/shared/force-upgrade.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAIU,QAAA,yBAAyB,GAAG,oBAAoB,CAAC;AACjD,QAAA,sBAAsB,GAAG,iBAAiB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ErrorResponse } from "./types";
|
|
2
2
|
import { BaseHttpRequest } from "./BaseHttpRequest";
|
|
3
3
|
export declare class HttpException extends Error {
|
|
4
|
-
constructor(responseCode: number, url: string, e?:
|
|
4
|
+
constructor(responseCode: number, url: string, e?: any);
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type TS_Progress = {
|
|
7
7
|
readonly lengthComputable: boolean;
|
|
8
8
|
readonly loaded: number;
|
|
9
9
|
readonly target: any;
|
|
@@ -12,6 +12,6 @@ export declare type TS_Progress = {
|
|
|
12
12
|
export interface OnRequestListener {
|
|
13
13
|
__onRequestCompleted: (key: string, success: boolean, requestData?: string) => void;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
15
|
+
export type RequestErrorHandler<E extends void | object> = (request: BaseHttpRequest<any>, resError?: ErrorResponse<E>) => void;
|
|
16
|
+
export type RequestSuccessHandler = (request: BaseHttpRequest<any>) => void;
|
|
17
|
+
export type ResponseHandler = (request: BaseHttpRequest<any>) => boolean;
|
package/shared/request-types.js
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
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
|
+
*/
|
|
2
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
23
|
exports.HttpException = void 0;
|
|
4
24
|
class HttpException extends Error {
|
|
5
25
|
constructor(responseCode, url, e) {
|
|
6
|
-
super(`${responseCode} - ${url}` + "\n" + (e === null || e === void 0 ? void 0 : e.message) + "\n" + (e === null || e === void 0 ? void 0 : e.stack));
|
|
26
|
+
super(`${responseCode} - ${url}` + "\n" + (e instanceof Error ? ((e === null || e === void 0 ? void 0 : e.message) + "\n" + (e === null || e === void 0 ? void 0 : e.stack)) : JSON.stringify(e)));
|
|
7
27
|
}
|
|
8
28
|
}
|
|
9
29
|
exports.HttpException = HttpException;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-types.js","sourceRoot":"","sources":["../../src/main/shared/request-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"request-types.js","sourceRoot":"","sources":["../../src/main/shared/request-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAKH,MAAa,aACT,SAAQ,KAAK;IACb,YAAY,YAAoB,EAAE,GAAW,EAAE,CAAO;QAClD,KAAK,CAAC,GAAG,YAAY,MAAM,GAAG,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,IAAG,IAAI,IAAG,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzH,CAAC;CACJ;AALD,sCAKC"}
|
package/shared/types.d.ts
CHANGED
|
@@ -8,22 +8,23 @@ export declare enum HttpMethod {
|
|
|
8
8
|
OPTIONS = "options",
|
|
9
9
|
HEAD = "head"
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type QueryParams = {
|
|
12
12
|
[key: string]: string | undefined;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
export
|
|
14
|
+
export type ApiTypeBinder<U extends string | void, R, B, P extends QueryParams | {}, E = any> = {
|
|
15
|
+
url: U;
|
|
16
|
+
response: R;
|
|
17
|
+
body: B;
|
|
18
|
+
queryParams: P;
|
|
19
|
+
error: E;
|
|
20
|
+
};
|
|
21
|
+
export type ApiWithBody<U extends string, B, R, E = any> = ApiTypeBinder<U, R, B, {}, E>;
|
|
22
|
+
export type ApiWithQuery<U extends string, R, P extends QueryParams | {} = {}, E = any> = ApiTypeBinder<U, R, void, P, E>;
|
|
23
|
+
export type ErrorBody<E extends object | void = void> = {
|
|
23
24
|
type: string;
|
|
24
25
|
body: E;
|
|
25
26
|
};
|
|
26
|
-
export
|
|
27
|
+
export type ErrorResponse<E extends object | void = void> = {
|
|
27
28
|
debugMessage?: string;
|
|
28
29
|
error?: ErrorBody<E>;
|
|
29
30
|
};
|
package/shared/types.js
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
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
|
+
*/
|
|
2
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
23
|
exports.HttpMethod = void 0;
|
|
4
24
|
var HttpMethod;
|
|
@@ -11,5 +31,5 @@ var HttpMethod;
|
|
|
11
31
|
HttpMethod["PUT"] = "put";
|
|
12
32
|
HttpMethod["OPTIONS"] = "options";
|
|
13
33
|
HttpMethod["HEAD"] = "head";
|
|
14
|
-
})(HttpMethod
|
|
34
|
+
})(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
|
|
15
35
|
//# sourceMappingURL=types.js.map
|
package/shared/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/main/shared/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/main/shared/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,IAAY,UASX;AATD,WAAY,UAAU;IACrB,yBAAe,CAAA;IACf,2BAAgB,CAAA;IAChB,yBAAe,CAAA;IACf,6BAAiB,CAAA;IACjB,+BAAkB,CAAA;IAClB,yBAAe,CAAA;IACf,iCAAmB,CAAA;IACnB,2BAAgB,CAAA;AACjB,CAAC,EATW,UAAU,0BAAV,UAAU,QASrB"}
|
|
@@ -1,4 +1,24 @@
|
|
|
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
|
+
*/
|
|
2
22
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
23
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
24
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,32 +30,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
30
|
};
|
|
11
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
32
|
exports.StormTester = void 0;
|
|
33
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
13
34
|
const BaseStorm_1 = require("../app-backend/core/BaseStorm");
|
|
14
35
|
const fs = require("fs");
|
|
36
|
+
const backend_1 = require("@intuitionrobotics/firebase/backend");
|
|
15
37
|
const testelot_1 = require("@intuitionrobotics/testelot");
|
|
16
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
17
|
-
const FirebaseModule_1 = require("@intuitionrobotics/firebase/app-backend/FirebaseModule");
|
|
18
38
|
class StormTester extends BaseStorm_1.BaseStorm {
|
|
19
39
|
constructor() {
|
|
20
40
|
super();
|
|
21
41
|
this.reporter = new testelot_1.Reporter();
|
|
22
42
|
this.prepare = () => {
|
|
23
|
-
|
|
43
|
+
backend_1.FirebaseModule_Class.localAdminConfigId = "test-permissions";
|
|
24
44
|
let pathToServiceAccount = process.env.npm_config_service_account || process.argv.find((arg) => arg.startsWith("--service-account="));
|
|
25
45
|
if (!pathToServiceAccount)
|
|
26
|
-
throw new
|
|
46
|
+
throw new ts_common_1.ImplementationMissingException("could not find path to service account!!!");
|
|
27
47
|
pathToServiceAccount = pathToServiceAccount.replace("--service-account=", "");
|
|
28
48
|
const key = JSON.parse(fs.readFileSync(pathToServiceAccount, "utf8"));
|
|
29
|
-
|
|
49
|
+
backend_1.FirebaseModule.setDefaultConfig({ "test-permissions": key });
|
|
30
50
|
};
|
|
31
51
|
this.runTestsImpl = () => __awaiter(this, void 0, void 0, function* () {
|
|
32
52
|
if (!this.scenario)
|
|
33
|
-
throw new
|
|
53
|
+
throw new ts_common_1.ImplementationMissingException("No test specified!!");
|
|
34
54
|
this.prepare();
|
|
35
55
|
this.init();
|
|
36
56
|
this.reporter.init();
|
|
37
57
|
testelot_1.Action.resolveTestsToRun();
|
|
38
|
-
const scenario = testelot_1.__scenario("root", this.reporter);
|
|
58
|
+
const scenario = (0, testelot_1.__scenario)("root", this.reporter);
|
|
39
59
|
scenario.add(this.scenario);
|
|
40
60
|
yield scenario.run();
|
|
41
61
|
});
|