@robotical/webapp-types 3.18.13 → 3.19.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.
Files changed (31) hide show
  1. package/dist-types/src/application/ApplicationManager/ApplicationManager.d.ts +21 -10
  2. package/dist-types/src/application/ApplicationManager/ApplicationManager.js +297 -83
  3. package/dist-types/src/application/RAFTs/Cog/Cog.d.ts +2 -0
  4. package/dist-types/src/application/RAFTs/Cog/Cog.js +3 -0
  5. package/dist-types/src/application/RAFTs/Marty/Marty.js +7 -3
  6. package/dist-types/src/application/RAFTs/Marty/MartyWifiManager.d.ts +6 -18
  7. package/dist-types/src/application/RAFTs/Marty/MartyWifiManager.js +25 -274
  8. package/dist-types/src/application/RAFTs/RAFT.d.ts +8 -2
  9. package/dist-types/src/application/RAFTs/RAFT.js +23 -4
  10. package/dist-types/src/application/RAFTs/RaftWifiManager.d.ts +24 -0
  11. package/dist-types/src/application/RAFTs/RaftWifiManager.js +329 -0
  12. package/dist-types/src/application/communicators/WrapperCommunicator.js +7 -3
  13. package/dist-types/src/components/modals/VerificationModal/index.js +4 -1
  14. package/dist-types/src/components/modals/WifiConnectionModal/index.d.ts +6 -0
  15. package/dist-types/src/components/modals/WifiConnectionModal/index.js +41 -0
  16. package/dist-types/src/i18n.js +43 -3
  17. package/dist-types/src/store/ConnectionMethodPreference.d.ts +7 -0
  18. package/dist-types/src/store/ConnectionMethodPreference.js +44 -0
  19. package/dist-types/src/store/SelectedRaftContext.d.ts +3 -1
  20. package/dist-types/src/store/SelectedRaftContext.js +1 -1
  21. package/dist-types/src/types/raft.d.ts +23 -0
  22. package/dist-types/src/utils/helpers/wifi-configuration-subtitle-gen.d.ts +2 -1
  23. package/dist-types/src/utils/helpers/wifi-configuration-subtitle-gen.js +26 -22
  24. package/dist-types/src/utils/wifi-connection.d.ts +18 -0
  25. package/dist-types/src/utils/wifi-connection.js +97 -0
  26. package/dist-types/src/wrapper-app/WrapperAppManager.d.ts +3 -2
  27. package/dist-types/src/wrapper-app/WrapperAppManager.js +149 -45
  28. package/dist-types/src/wrapper-app/communicators/WebAppCommunicator.js +1 -1
  29. package/dist-types/src/wrapper-app/connectors/ConnectorFactory.d.ts +1 -0
  30. package/dist-types/src/wrapper-app/connectors/ConnectorFactory.js +15 -11
  31. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { RaftConnectionMethod, RaftTypeE } from "../../types/raft";
1
+ import { ConnectableRaftType, RaftConnectionMethod, RaftConnectOptions, RaftTypeE } from "../../types/raft";
2
2
  import WebAppCommunicator from "../../wrapper-app/communicators/WebAppCommunicator";
3
3
  import RAFT from "../RAFTs/RAFT";
4
4
  import Marty from "../RAFTs/Marty/Marty";
@@ -28,6 +28,7 @@ export default class ApplicationManager {
28
28
  private _connectAttemptSequence;
29
29
  private _activeConnectAttemptId;
30
30
  private _disconnectPromises;
31
+ private _pendingWifiLocators;
31
32
  connectedRaftsContext: ConnectedRaftItem[];
32
33
  returnToMainApp: () => void;
33
34
  carouselNavigatorManager: CarouselNavigatorManager;
@@ -67,12 +68,20 @@ export default class ApplicationManager {
67
68
  private addConnectedRaftToContext;
68
69
  private publishLocalVerifiedConnection;
69
70
  private confirmQrVerifiedConnection;
71
+ private getWifiManager;
72
+ pauseWifiConnection(raftId: string, pause: boolean): Promise<boolean>;
73
+ getCachedWifiStatus(raftId: string): RaftWifiConnStatus | undefined;
74
+ wifiConnect(raftId: string, ssid: string, password: string): Promise<boolean>;
75
+ wifiDisconnect(raftId: string): Promise<boolean>;
76
+ getWiFiConnStatus(raftId: string): Promise<boolean | null>;
77
+ getWifiScanResults(raftId: string): Promise<RaftWifiScanResults | RaftOKFail | boolean>;
78
+ private getMartyWifiManager;
70
79
  pauseWifiConnectionMarty(raftId: string, pause: boolean): Promise<boolean>;
71
- getCachedWifiStatusMarty(martyId: string): RaftWifiConnStatus | undefined;
72
- wifiConnectMarty(martyId: string, ssid: string, password: string): Promise<boolean>;
73
- wifiDisconnectMarty(martyId: string): Promise<boolean>;
74
- getWiFiConnStatusMarty(martyId: string): Promise<boolean | null>;
75
- getWifiScanResultsMarty(martyId: string): Promise<RaftWifiScanResults | RaftOKFail | boolean>;
80
+ getCachedWifiStatusMarty(raftId: string): RaftWifiConnStatus | undefined;
81
+ wifiConnectMarty(raftId: string, ssid: string, password: string): Promise<boolean>;
82
+ wifiDisconnectMarty(raftId: string): Promise<boolean>;
83
+ getWiFiConnStatusMarty(raftId: string): Promise<boolean | null>;
84
+ getWifiScanResultsMarty(raftId: string): Promise<RaftWifiScanResults | RaftOKFail | boolean>;
76
85
  calibrateMarty(martyId: string, cmd: string, joints: string): Promise<false | RaftOKFail | undefined>;
77
86
  calibrateColourSensorsMarty(raftId: string, stage: ColourSensorCalibrationStage): Promise<unknown>;
78
87
  resetColourSensorOffsetsMarty(raftId: string): Promise<unknown>;
@@ -91,20 +100,22 @@ export default class ApplicationManager {
91
100
  deleteAddOnMarty(martyId: string, addOnSN: string): Promise<any>;
92
101
  createNewCog(id: string): Cog;
93
102
  createNewMarty(id: string): Marty;
94
- connectGenericMarty(afterRaftConnectedCb: (raft: RAFT) => void): Promise<void>;
95
- connectGenericCog(afterRaftConnectedCb: (raft: RAFT) => void): Promise<void>;
103
+ connectGenericMarty(afterRaftConnectedCb: (raft: RAFT) => void, options?: RaftConnectOptions): Promise<void>;
104
+ connectGenericCog(afterRaftConnectedCb: (raft: RAFT) => void, options?: RaftConnectOptions): Promise<void>;
96
105
  /**
97
106
  * Generic Connect method
98
107
  * This method is called from various environments (connection button, blocksjr, blocks etc.)
99
108
  * Known issue: connecting to a raft from within a platform won't add the newly connected raft to the connectedRafts hook
100
109
  */
101
- connectGeneric(afterRaftConnectedCb: (raft: RAFT) => void, uuids?: string[], shouldShowQrModal?: boolean): Promise<void>;
110
+ connectGeneric(afterRaftConnectedCb: (raft: RAFT) => void, uuids?: string[], shouldShowQrModal?: boolean, options?: RaftConnectOptions): Promise<void>;
102
111
  private _clearConnectPromise;
103
112
  private _dismissConnectAttempt;
104
113
  private _isConnectAttemptActive;
105
114
  private _getConnectResultDisposition;
106
115
  private _createConnectingModal;
116
+ private _resolveConnectOptions;
107
117
  private _connectGeneric;
118
+ private _connectWithResolvedOptions;
108
119
  /**
109
120
  * Disconnect from RAFT generic
110
121
  * This method is called from various environments (connection button, blocksjr, blocks etc.)
@@ -114,7 +125,7 @@ export default class ApplicationManager {
114
125
  * Selects a RAFT in Phone's verification modal
115
126
  */
116
127
  selectRaft(ricToConnectTo: FOUND_RAFT_ON_DISCOVERY_RESPONSE['foundRIC'], method: RaftConnectionMethod): Promise<RAFT | null>;
117
- connectToRIC(method: RaftConnectionMethod, uuids: string[], withoutVerification?: boolean, getResultDisposition?: () => ConnectResultDisposition): Promise<RAFT | null>;
128
+ connectToRIC(method: RaftConnectionMethod, uuids: string[], withoutVerification?: boolean, getResultDisposition?: () => ConnectResultDisposition, locator?: string, expectedRaftType?: ConnectableRaftType): Promise<RAFT | null>;
118
129
  /**
119
130
  * Warranty Service bluetooth scan for device
120
131
  * It scans for a device and gets the device object