sos-portal-components-react 0.1.2 → 0.2.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/CHANGELOG.md +23 -0
- package/README.md +5 -0
- package/dist/LiveKitRealtimeCallClient.d.ts +50 -0
- package/dist/LiveKitRealtimeCallClient.d.ts.map +1 -0
- package/dist/LiveKitRealtimeCallClient.js +40 -0
- package/dist/LiveKitRealtimeCallClient.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +25 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.2.1 - 2026-11-07
|
|
6
|
+
|
|
7
|
+
- Pin `sos-data-utils-ts@0.6.28`, the exact release that owns the portal RTC
|
|
8
|
+
Communication contract consumed by `LiveKitRealtimeCallClient`. Clean npm
|
|
9
|
+
installs no longer retain a nested pre-RTC data-utils release.
|
|
10
|
+
|
|
11
|
+
## 0.2.0 - 2026-11-07
|
|
12
|
+
|
|
13
|
+
- Establish this package as the shared presentation boundary consumed directly
|
|
14
|
+
by CH Personal and Professional in every flavour. Product portals provide
|
|
15
|
+
authorization, policy and BFF adapters; UHC compatibility exports no longer
|
|
16
|
+
own the active implementation.
|
|
17
|
+
- Export `SubjectConversationChat` as the single subject-channel renderer over
|
|
18
|
+
canonical Communications. It projects text, governed attachments, clinical
|
|
19
|
+
Bundles, ICS/files, audio and call events without owning persistence,
|
|
20
|
+
signaling or recipient authority.
|
|
21
|
+
- Export `LiveKitRealtimeCallClient` as a dynamically loaded web RTC adapter
|
|
22
|
+
designed for later Expo substitution. It consumes only the short grant
|
|
23
|
+
issued by the BFF and never receives LiveKit API credentials.
|
|
24
|
+
- Separate CH all-local, telephone-assistant, optional web-assistant and RTC
|
|
25
|
+
integration profiles. Calls use a host-injected dedicated RTC client while
|
|
26
|
+
invitations, terminal events and unanswered audio render as Communications.
|
|
27
|
+
|
|
5
28
|
## 0.1.2 - 2026-11-07
|
|
6
29
|
|
|
7
30
|
- Document and enforce one shared UI contract for Demo, Test Network, web and
|
package/README.md
CHANGED
|
@@ -7,6 +7,11 @@ Expo. They never select storage. Owning applications inject memory for
|
|
|
7
7
|
all-local, Expo SQLite for native, or an explicit durable adapter. Firestore
|
|
8
8
|
must not create a Demo-only component or data model.
|
|
9
9
|
|
|
10
|
+
CH all-local portal execution does not start or require Chat, the telephone
|
|
11
|
+
assistant or the optional web assistant. Realtime audio/video is a dedicated
|
|
12
|
+
RTC boundary supplied by the host BFF. Invitations, terminal states and an
|
|
13
|
+
optional unanswered audio attachment are rendered from Communications.
|
|
14
|
+
|
|
10
15
|
Shared portal UI for base components. It provides the portal UI core for
|
|
11
16
|
personal and professional applications across human
|
|
12
17
|
health, animal care, public safety, emergency response and other configured
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type RealtimeCallMedia = 'audio' | 'video';
|
|
2
|
+
export type RealtimeCallSession = Readonly<{
|
|
3
|
+
callId: string;
|
|
4
|
+
localStream: MediaStream;
|
|
5
|
+
remoteStream: MediaStream;
|
|
6
|
+
end(): Promise<void>;
|
|
7
|
+
}>;
|
|
8
|
+
export type LiveKitJoinSession<Conversation> = Readonly<{
|
|
9
|
+
conversation: Conversation;
|
|
10
|
+
callId?: string;
|
|
11
|
+
media: readonly RealtimeCallMedia[];
|
|
12
|
+
}>;
|
|
13
|
+
export type LiveKitSessionGrant = Readonly<{
|
|
14
|
+
callId: string;
|
|
15
|
+
serverUrl: string;
|
|
16
|
+
participantToken: string;
|
|
17
|
+
}>;
|
|
18
|
+
type LiveKitModule = typeof import('livekit-client');
|
|
19
|
+
/** Dedicated RTC adapter. It never receives Chat routes and persists no call history. */
|
|
20
|
+
export declare function createLiveKitRealtimeCallClient<Conversation>(dependencies: Readonly<{
|
|
21
|
+
issueSession(input: LiveKitJoinSession<Conversation>): Promise<LiveKitSessionGrant>;
|
|
22
|
+
endCall(input: Readonly<{
|
|
23
|
+
conversation: Conversation;
|
|
24
|
+
callId: string;
|
|
25
|
+
}>): Promise<void>;
|
|
26
|
+
loadLiveKit?: () => Promise<LiveKitModule>;
|
|
27
|
+
createMediaStream?: () => MediaStream;
|
|
28
|
+
}>): {
|
|
29
|
+
start(input: Readonly<{
|
|
30
|
+
conversation: Conversation;
|
|
31
|
+
media: readonly RealtimeCallMedia[];
|
|
32
|
+
}>): Promise<Readonly<{
|
|
33
|
+
callId: string;
|
|
34
|
+
localStream: MediaStream;
|
|
35
|
+
remoteStream: MediaStream;
|
|
36
|
+
end(): Promise<void>;
|
|
37
|
+
}>>;
|
|
38
|
+
accept(input: Readonly<{
|
|
39
|
+
conversation: Conversation;
|
|
40
|
+
callId: string;
|
|
41
|
+
media: readonly RealtimeCallMedia[];
|
|
42
|
+
}>): Promise<Readonly<{
|
|
43
|
+
callId: string;
|
|
44
|
+
localStream: MediaStream;
|
|
45
|
+
remoteStream: MediaStream;
|
|
46
|
+
end(): Promise<void>;
|
|
47
|
+
}>>;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=LiveKitRealtimeCallClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveKitRealtimeCallClient.d.ts","sourceRoot":"","sources":["../src/LiveKitRealtimeCallClient.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,CAAA;AACjD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,WAAW,CAAC;IAAC,YAAY,EAAE,WAAW,CAAC;IAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAAA;AACzI,MAAM,MAAM,kBAAkB,CAAC,YAAY,IAAI,QAAQ,CAAC;IAAE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icated RTC adapter. It never receives Chat routes and persists no call history. */
|
|
2
|
+
export function createLiveKitRealtimeCallClient(dependencies) {
|
|
3
|
+
const loadLiveKit = dependencies.loadLiveKit ?? (() => import('livekit-client'));
|
|
4
|
+
const createMediaStream = dependencies.createMediaStream ?? (() => new MediaStream());
|
|
5
|
+
async function connect(input) {
|
|
6
|
+
const [liveKit, grant] = await Promise.all([loadLiveKit(), dependencies.issueSession(input)]);
|
|
7
|
+
const room = new liveKit.Room({ adaptiveStream: true, dynacast: true });
|
|
8
|
+
const localStream = createMediaStream();
|
|
9
|
+
const remoteStream = createMediaStream();
|
|
10
|
+
room.on(liveKit.RoomEvent.TrackSubscribed, track => {
|
|
11
|
+
const mediaTrack = track.mediaStreamTrack;
|
|
12
|
+
if (mediaTrack)
|
|
13
|
+
remoteStream.addTrack(mediaTrack);
|
|
14
|
+
});
|
|
15
|
+
await room.connect(grant.serverUrl, grant.participantToken);
|
|
16
|
+
if (input.media.includes('audio'))
|
|
17
|
+
await room.localParticipant.setMicrophoneEnabled(true);
|
|
18
|
+
if (input.media.includes('video'))
|
|
19
|
+
await room.localParticipant.setCameraEnabled(true);
|
|
20
|
+
for (const publication of room.localParticipant.trackPublications.values()) {
|
|
21
|
+
const mediaTrack = publication.track?.mediaStreamTrack;
|
|
22
|
+
if (mediaTrack)
|
|
23
|
+
localStream.addTrack(mediaTrack);
|
|
24
|
+
}
|
|
25
|
+
return Object.freeze({
|
|
26
|
+
callId: grant.callId, localStream, remoteStream,
|
|
27
|
+
async end() {
|
|
28
|
+
room.disconnect();
|
|
29
|
+
for (const track of localStream.getTracks())
|
|
30
|
+
track.stop();
|
|
31
|
+
await dependencies.endCall({ conversation: input.conversation, callId: grant.callId });
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
start(input) { return connect(input); },
|
|
37
|
+
accept(input) { return connect(input); },
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=L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AgB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;QACzF,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;QACrF,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3E,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAA;YACtD,IAAI,UAAU;gBAAE,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;QAClD,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY;YAC/C,KAAK,CAAC,GAAG;gBACP,IAAI,CAAC,UAAU,EAAE,CAAA;gBACjB,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,SAAS,EAAE;oBAAE,KAAK,CAAC,IAAI,EAAE,CAAA;gBACzD,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;YACxF,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,KAAK,CAAC,KAAoF,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC;QACrH,MAAM,CAAC,KAAoG,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC;KACvI,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sos-portal-components-react",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Shared portal UI for base components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@kesha-antonov/react-native-chat": "^6.0.1",
|
|
37
|
+
"livekit-client": ">=2.23.0 <3",
|
|
37
38
|
"react": ">=18.3.0",
|
|
38
39
|
"react-dom": ">=18.3.0",
|
|
39
40
|
"react-native": ">=0.82.0",
|
|
@@ -43,16 +44,31 @@
|
|
|
43
44
|
"react-native-safe-area-context": ">=5.0.0"
|
|
44
45
|
},
|
|
45
46
|
"peerDependenciesMeta": {
|
|
46
|
-
"@kesha-antonov/react-native-chat": {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
"@kesha-antonov/react-native-chat": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"livekit-client": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"react-native": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"react-native-gesture-handler": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"react-native-keyboard-controller": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"react-native-reanimated": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"react-native-safe-area-context": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
52
68
|
},
|
|
53
69
|
"dependencies": {
|
|
54
70
|
"antifraud-portal-components-react": "0.2.2",
|
|
55
|
-
"sos-data-utils-ts": "0.6.
|
|
71
|
+
"sos-data-utils-ts": "0.6.28"
|
|
56
72
|
},
|
|
57
73
|
"devDependencies": {
|
|
58
74
|
"@testing-library/react": "^16.3.2",
|
|
@@ -60,6 +76,7 @@
|
|
|
60
76
|
"@types/react": "19.2.17",
|
|
61
77
|
"@types/react-dom": "19.2.3",
|
|
62
78
|
"jsdom": "26.1.0",
|
|
79
|
+
"livekit-client": "2.23.0",
|
|
63
80
|
"react": "19.2.8",
|
|
64
81
|
"react-dom": "19.2.8",
|
|
65
82
|
"typescript": "5.9.3",
|
|
@@ -73,4 +90,3 @@
|
|
|
73
90
|
"url": "git+https://github.com/soschain/sos-portal-components-react.git"
|
|
74
91
|
}
|
|
75
92
|
}
|
|
76
|
-
|