@abihealth/goapp-react-native 1.31.0 → 1.32.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.
- package/CHANGELOG.md +14 -0
- package/dist/common/helpers/eventHandler.d.ts +2 -0
- package/dist/common/types/prescription.d.ts +1 -1
- package/dist/video-consultations/api/video.d.ts +1 -1
- package/dist/video-consultations/api/video.js +3 -3
- package/dist/video-consultations/components/VideoConsultation.js +3 -2
- package/dist/video-consultations/screens/JoinVideoCallScreen.d.ts +7 -2
- package/dist/video-consultations/screens/JoinVideoCallScreen.js +6 -3
- package/dist/video-consultations/screens/VideoCallScreen.d.ts +5 -1
- package/dist/video-consultations/screens/VideoCallScreen.js +55 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.32.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.31.1...goapp-react-native-v1.32.0) (2025-05-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* enhance event handling and video call functionality with new event callbacks ([#205](https://github.com/abiglobalhealth/react-native-sdk/issues/205)) ([86e9257](https://github.com/abiglobalhealth/react-native-sdk/commit/86e9257d57d3f4e6c2eb1d64785d4bc2113d71b4))
|
|
9
|
+
|
|
10
|
+
## [1.31.1](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.31.0...goapp-react-native-v1.31.1) (2025-05-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add optional to delivery address ([#203](https://github.com/abiglobalhealth/react-native-sdk/issues/203)) ([26f2ae3](https://github.com/abiglobalhealth/react-native-sdk/commit/26f2ae37b2d65804f85fab6fede99ad70c3f4ca5))
|
|
16
|
+
|
|
3
17
|
## [1.31.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.30.1...goapp-react-native-v1.31.0) (2025-05-23)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -12,6 +12,8 @@ export interface EventHandlers {
|
|
|
12
12
|
onPrescriptionSubmitted?: EventCallback;
|
|
13
13
|
onSummaryGenerated?: EventCallback;
|
|
14
14
|
onConsultationEnded?: EventCallback;
|
|
15
|
+
onVideoCallJoined?: () => void;
|
|
16
|
+
onVideoCallLeft?: () => void;
|
|
15
17
|
}
|
|
16
18
|
export declare const mapConsultationStatusToEvent: (consultation: Consultation) => CONSULTATION_EVENT;
|
|
17
19
|
export declare const handleEvent: (consultation: ConsultationContextProps["consultation"], eventHandlers?: EventHandlers) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConsultationResponse, CreateConsultationRequest } from '../../common/api/models/consultation';
|
|
2
2
|
import { HKDeliveryAddress } from '../../common/types/deliveryAddress';
|
|
3
3
|
import { HangOutRequest } from './models/video';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const hangOutVideoCall: (body: HangOutRequest) => Promise<ConsultationResponse>;
|
|
5
5
|
export declare const updateDeliveryAddress: (consultationId: string, address: HKDeliveryAddress) => Promise<ConsultationResponse>;
|
|
6
6
|
export declare const createVideoConsultation: (_: CreateConsultationRequest) => Promise<ConsultationResponse>;
|
|
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createVideoConsultation = exports.updateDeliveryAddress = exports.
|
|
6
|
+
exports.createVideoConsultation = exports.updateDeliveryAddress = exports.hangOutVideoCall = void 0;
|
|
7
7
|
var axios_1 = __importDefault(require("axios"));
|
|
8
8
|
var VIDEO_CONSULTATION_URL = '/video-consultation';
|
|
9
9
|
var HANGOUT_URL = '/hangout';
|
|
10
10
|
var DELIVERY_ADDRESS_URL = '/update-delivery-address';
|
|
11
|
-
var
|
|
11
|
+
var hangOutVideoCall = function (body) {
|
|
12
12
|
return axios_1.default.patch("".concat(VIDEO_CONSULTATION_URL).concat(HANGOUT_URL), body).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
14
|
+
exports.hangOutVideoCall = hangOutVideoCall;
|
|
15
15
|
var updateDeliveryAddress = function (consultationId, address) {
|
|
16
16
|
return axios_1.default
|
|
17
17
|
.post("".concat(VIDEO_CONSULTATION_URL, "/").concat(consultationId).concat(DELIVERY_ADDRESS_URL), { address: address })
|
|
@@ -22,6 +22,7 @@ var VideoConsultation = function (_a) {
|
|
|
22
22
|
(0, eventHandler_1.handleEvent)(consultation, eventHandlers);
|
|
23
23
|
}, [consultation, eventHandlers]);
|
|
24
24
|
var getConsultationScreen = (0, react_1.useCallback)(function (consultation) {
|
|
25
|
+
var _a;
|
|
25
26
|
var validActiveType = (0, valid_active_type_1.checkValidActiveType)(consultation, consultation_1.CASE_TYPE.VIDEO);
|
|
26
27
|
if (!validActiveType)
|
|
27
28
|
return <NotValidActiveTypeScreen_1.NotValidActiveTypeScreen caseType={consultation.type}/>;
|
|
@@ -33,11 +34,11 @@ var VideoConsultation = function (_a) {
|
|
|
33
34
|
var status = consultation.status, professional = consultation.professional, prescription = consultation.prescription;
|
|
34
35
|
switch (status) {
|
|
35
36
|
case consultation_1.CONSULTATION_STATUS.ONGOING_VIDEO_CALL:
|
|
36
|
-
return <JoinVideoCallScreen_1.JoinVideoCallScreen professional={professional}
|
|
37
|
+
return (<JoinVideoCallScreen_1.JoinVideoCallScreen professional={professional} onVideoCallJoined={eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onVideoCallJoined} onVideoCallLeft={eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onVideoCallLeft}/>);
|
|
37
38
|
case consultation_1.CONSULTATION_STATUS.VIDEO_CALL_ENDED:
|
|
38
39
|
return <PreparingSummaryScreen_1.PreparingSummaryScreen professional={professional}/>;
|
|
39
40
|
case consultation_1.CONSULTATION_STATUS.WAITING_FOR_INFO:
|
|
40
|
-
if (prescription === null || prescription === void 0 ? void 0 : prescription.data.delivery.address)
|
|
41
|
+
if ((_a = prescription === null || prescription === void 0 ? void 0 : prescription.data.delivery) === null || _a === void 0 ? void 0 : _a.address)
|
|
41
42
|
return <ProcessingPrescriptionScreen_1.ProcessingPrescriptionScreen />;
|
|
42
43
|
return <DeliveryAddressScreen_1.DeliveryAddressScreen initialDeliveryAddress={deliveryAddress}/>;
|
|
43
44
|
default:
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { EventHandlers } from '../../common/helpers/eventHandler';
|
|
1
2
|
import { Professional } from '../../common/types/professional';
|
|
2
3
|
import React from 'react';
|
|
3
|
-
|
|
4
|
+
interface JoinVideoCallScreenProps {
|
|
4
5
|
professional: Professional;
|
|
5
|
-
|
|
6
|
+
onVideoCallJoined?: EventHandlers['onVideoCallJoined'];
|
|
7
|
+
onVideoCallLeft?: EventHandlers['onVideoCallLeft'];
|
|
8
|
+
}
|
|
9
|
+
export declare const JoinVideoCallScreen: ({ professional, onVideoCallJoined, onVideoCallLeft }: JoinVideoCallScreenProps) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -53,7 +53,7 @@ var react_1 = __importStar(require("react"));
|
|
|
53
53
|
var react_native_1 = require("react-native");
|
|
54
54
|
var VideoCallScreen_1 = __importDefault(require("./VideoCallScreen"));
|
|
55
55
|
var JoinVideoCallScreen = function (_a) {
|
|
56
|
-
var professional = _a.professional;
|
|
56
|
+
var professional = _a.professional, onVideoCallJoined = _a.onVideoCallJoined, onVideoCallLeft = _a.onVideoCallLeft;
|
|
57
57
|
var t = (0, useTranslation_1.useTranslation)().t;
|
|
58
58
|
var theme = (0, useTheme_1.useTheme)();
|
|
59
59
|
var styles = getStyles(theme);
|
|
@@ -62,12 +62,15 @@ var JoinVideoCallScreen = function (_a) {
|
|
|
62
62
|
var customComponents = screens === null || screens === void 0 ? void 0 : screens.JoinScreen;
|
|
63
63
|
var onJoinVideoCall = function () {
|
|
64
64
|
setJoined(true);
|
|
65
|
+
onVideoCallJoined === null || onVideoCallJoined === void 0 ? void 0 : onVideoCallJoined();
|
|
65
66
|
};
|
|
66
67
|
if (joined)
|
|
67
|
-
return <VideoCallScreen_1.default />;
|
|
68
|
+
return <VideoCallScreen_1.default onVideoCallLeft={onVideoCallLeft}/>;
|
|
68
69
|
return (<ScreenWrapper_1.ScreenWrapper header={<Header_1.Header title={t('general.consultation.videoConsultation.title')} leftIcon={<VideoConsultationIcon_1.VideoConsultationIcon />} rightIcon={<CloseIcon_1.CloseIcon />}/>} containerStyle={[styles.container, customComponents === null || customComponents === void 0 ? void 0 : customComponents.containerStyle]}>
|
|
69
70
|
<Text_1.Text variant="h2" center>
|
|
70
|
-
{t('video.calling.physician_female', {
|
|
71
|
+
{t('video.calling.physician_female', {
|
|
72
|
+
name: (0, professional_1.getProfessionalLabel)(professional)
|
|
73
|
+
})}
|
|
71
74
|
</Text_1.Text>
|
|
72
75
|
|
|
73
76
|
<react_native_1.View style={styles.animationContainer}>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { EventHandlers } from '../../common/helpers/eventHandler';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
+
interface VideoCallScreenProps {
|
|
4
|
+
onVideoCallLeft?: EventHandlers['onVideoCallLeft'];
|
|
5
|
+
}
|
|
6
|
+
export declare const VideoCallScreen: ({ onVideoCallLeft }: VideoCallScreenProps) => React.JSX.Element;
|
|
3
7
|
export default VideoCallScreen;
|
|
@@ -32,6 +32,42 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
+
function step(op) {
|
|
49
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
+
switch (op[0]) {
|
|
54
|
+
case 0: case 1: t = op; break;
|
|
55
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
+
default:
|
|
59
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
+
if (t[2]) _.ops.pop();
|
|
64
|
+
_.trys.pop(); continue;
|
|
65
|
+
}
|
|
66
|
+
op = body.call(thisArg, _);
|
|
67
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
35
71
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
72
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
73
|
};
|
|
@@ -50,20 +86,33 @@ var VideoConsultationIcon_1 = require("../icons/VideoConsultationIcon");
|
|
|
50
86
|
var react_1 = __importStar(require("react"));
|
|
51
87
|
var react_native_1 = require("react-native");
|
|
52
88
|
var EndingVideoScreen_1 = require("./EndingVideoScreen");
|
|
53
|
-
var VideoCallScreen = function () {
|
|
89
|
+
var VideoCallScreen = function (_a) {
|
|
90
|
+
var onVideoCallLeft = _a.onVideoCallLeft;
|
|
54
91
|
var t = (0, useTranslation_1.useTranslation)().t;
|
|
55
92
|
var theme = (0, useTheme_1.useTheme)();
|
|
56
93
|
var styles = getStyles(theme);
|
|
57
94
|
var consultation = (0, useConsultation_1.useConsultation)().consultation;
|
|
58
95
|
var videoCall = consultation.videoCall, professional = consultation.professional;
|
|
59
|
-
var
|
|
96
|
+
var _b = (0, react_1.useState)((videoCall === null || videoCall === void 0 ? void 0 : videoCall.patientHangout) || false), isHangOut = _b[0], setIsHangOut = _b[1];
|
|
60
97
|
if (!videoCall)
|
|
61
98
|
return <Text_1.Text>Video call info not found</Text_1.Text>;
|
|
62
99
|
var uuid = videoCall.uuid, patientToken = videoCall.patientToken, appId = videoCall.appId, room = videoCall.room;
|
|
63
|
-
var endCall = function () {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
100
|
+
var endCall = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
101
|
+
return __generator(this, function (_a) {
|
|
102
|
+
switch (_a.label) {
|
|
103
|
+
case 0:
|
|
104
|
+
setIsHangOut(true);
|
|
105
|
+
onVideoCallLeft === null || onVideoCallLeft === void 0 ? void 0 : onVideoCallLeft();
|
|
106
|
+
return [4 /*yield*/, (0, video_1.hangOutVideoCall)({ consultationId: consultation.id, room: room }).catch(function (error) {
|
|
107
|
+
console.error('Error ending video call:', error);
|
|
108
|
+
setIsHangOut(false);
|
|
109
|
+
})];
|
|
110
|
+
case 1:
|
|
111
|
+
_a.sent();
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}); };
|
|
67
116
|
if (isHangOut) {
|
|
68
117
|
return <EndingVideoScreen_1.EndingVideoScreen professional={professional}/>;
|
|
69
118
|
}
|