@whereby.com/browser-sdk 2.0.0-alpha → 2.0.0-alpha2

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 (72) hide show
  1. package/dist/lib.cjs.js +5467 -0
  2. package/dist/lib.esm.js +5451 -0
  3. package/dist/types.d.ts +104 -0
  4. package/dist/v2-alpha2.js +105 -0
  5. package/package.json +6 -1
  6. package/.eslintrc +0 -23
  7. package/.github/actions/build/action.yml +0 -17
  8. package/.github/workflows/deploy.yml +0 -102
  9. package/.github/workflows/test.yml +0 -24
  10. package/.prettierignore +0 -7
  11. package/.prettierrc +0 -4
  12. package/.storybook/main.cjs +0 -16
  13. package/.storybook/preview.js +0 -9
  14. package/jest.config.js +0 -6
  15. package/rollup.config.js +0 -70
  16. package/src/lib/RoomConnection.ts +0 -516
  17. package/src/lib/RoomParticipant.ts +0 -77
  18. package/src/lib/__tests__/embed.unit.ts +0 -77
  19. package/src/lib/api/ApiClient.ts +0 -111
  20. package/src/lib/api/Credentials.ts +0 -45
  21. package/src/lib/api/HttpClient.ts +0 -95
  22. package/src/lib/api/MultipartHttpClient.ts +0 -53
  23. package/src/lib/api/OrganizationApiClient.ts +0 -64
  24. package/src/lib/api/Response.ts +0 -34
  25. package/src/lib/api/credentialsService/index.ts +0 -159
  26. package/src/lib/api/credentialsService/test/index.spec.ts +0 -181
  27. package/src/lib/api/deviceService/index.ts +0 -42
  28. package/src/lib/api/deviceService/tests/index.spec.ts +0 -74
  29. package/src/lib/api/extractUtils.ts +0 -160
  30. package/src/lib/api/index.ts +0 -8
  31. package/src/lib/api/localStorageWrapper/index.ts +0 -15
  32. package/src/lib/api/models/Account.ts +0 -48
  33. package/src/lib/api/models/Meeting.ts +0 -42
  34. package/src/lib/api/models/Organization.ts +0 -186
  35. package/src/lib/api/models/Room.ts +0 -44
  36. package/src/lib/api/models/account/EmbeddedFreeTierStatus.ts +0 -34
  37. package/src/lib/api/models/tests/Account.spec.ts +0 -128
  38. package/src/lib/api/models/tests/Organization.spec.ts +0 -161
  39. package/src/lib/api/models/tests/Room.spec.ts +0 -74
  40. package/src/lib/api/modules/AbstractStore.ts +0 -18
  41. package/src/lib/api/modules/ChromeStorageStore.ts +0 -44
  42. package/src/lib/api/modules/LocalStorageStore.ts +0 -57
  43. package/src/lib/api/modules/tests/ChromeStorageStore.spec.ts +0 -67
  44. package/src/lib/api/modules/tests/LocalStorageStore.spec.ts +0 -79
  45. package/src/lib/api/modules/tests/__mocks__/storage.ts +0 -24
  46. package/src/lib/api/organizationService/index.ts +0 -284
  47. package/src/lib/api/organizationService/tests/index.spec.ts +0 -781
  48. package/src/lib/api/organizationServiceCache/index.ts +0 -28
  49. package/src/lib/api/organizationServiceCache/tests/index.spec.ts +0 -101
  50. package/src/lib/api/parameterAssertUtils.ts +0 -166
  51. package/src/lib/api/roomService/index.ts +0 -310
  52. package/src/lib/api/roomService/tests/index.spec.ts +0 -668
  53. package/src/lib/api/test/ApiClient.spec.ts +0 -139
  54. package/src/lib/api/test/HttpClient.spec.ts +0 -120
  55. package/src/lib/api/test/MultipartHttpClient.spec.ts +0 -145
  56. package/src/lib/api/test/OrganizationApiClient.spec.ts +0 -132
  57. package/src/lib/api/test/extractUtils.spec.ts +0 -357
  58. package/src/lib/api/test/helpers.ts +0 -41
  59. package/src/lib/api/test/parameterAssertUtils.spec.ts +0 -265
  60. package/src/lib/api/types.ts +0 -6
  61. package/src/lib/embed.ts +0 -172
  62. package/src/lib/index.ts +0 -3
  63. package/src/lib/react/VideoElement.tsx +0 -16
  64. package/src/lib/react/index.ts +0 -3
  65. package/src/lib/react/useLocalMedia.ts +0 -25
  66. package/src/lib/react/useRoomConnection.ts +0 -92
  67. package/src/lib/reducer.ts +0 -142
  68. package/src/stories/custom-ui.stories.tsx +0 -133
  69. package/src/stories/prebuilt-ui.stories.tsx +0 -131
  70. package/src/stories/styles.css +0 -74
  71. package/src/types.d.ts +0 -175
  72. package/tsconfig.json +0 -30
@@ -0,0 +1,104 @@
1
+ import React from 'react';
2
+
3
+ interface WherebyEmbedAttributes {
4
+ audio: string;
5
+ avatarUrl: string;
6
+ background: string;
7
+ cameraAccess: string;
8
+ chat: string;
9
+ displayName: string;
10
+ emptyRoomInvitation: string;
11
+ floatSelf: string;
12
+ help: string;
13
+ leaveButton: string;
14
+ logo: string;
15
+ people: string;
16
+ precallReview: string;
17
+ recording: string;
18
+ screenshare: string;
19
+ video: string;
20
+ virtualBackgroundUrl: string;
21
+ room: string;
22
+ style: {
23
+ [key: string]: string;
24
+ };
25
+ }
26
+ declare global {
27
+ namespace JSX {
28
+ interface IntrinsicElements {
29
+ ["whereby-embed"]: Partial<WherebyEmbedAttributes>;
30
+ }
31
+ }
32
+ }
33
+
34
+ interface VideoElProps {
35
+ stream: MediaStream;
36
+ style?: React.CSSProperties;
37
+ }
38
+ declare const _default: ({ stream, style }: VideoElProps) => JSX.Element;
39
+
40
+ interface RoomParticipantData {
41
+ displayName: string;
42
+ id: string;
43
+ stream?: MediaStream;
44
+ isAudioEnabled: boolean;
45
+ isVideoEnabled: boolean;
46
+ }
47
+ declare class RoomParticipant {
48
+ readonly displayName: string;
49
+ readonly id: string;
50
+ readonly stream?: MediaStream;
51
+ readonly isAudioEnabled: boolean;
52
+ readonly isLocalParticipant: boolean;
53
+ readonly isVideoEnabled: boolean;
54
+ constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
55
+ }
56
+ interface RemoteParticipantData {
57
+ newJoiner: boolean;
58
+ streams: string[];
59
+ }
60
+ type StreamState = "new_accept" | "to_accept" | "old_accept" | "done_accept" | "to_unaccept" | "done_unaccept" | "auto";
61
+ interface Stream {
62
+ id: string;
63
+ state: StreamState;
64
+ }
65
+ declare class RemoteParticipant extends RoomParticipant {
66
+ readonly newJoiner: boolean;
67
+ readonly streams: Stream[];
68
+ constructor({ displayName, id, newJoiner, streams, isAudioEnabled, isVideoEnabled, }: RoomParticipantData & RemoteParticipantData);
69
+ updateStreamState(streamId: string, state: StreamState): void;
70
+ }
71
+ declare class LocalParticipant extends RoomParticipant {
72
+ readonly isLocalParticipant = true;
73
+ constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
74
+ }
75
+
76
+ type Logger = Pick<Console, "debug" | "error" | "log" | "warn">;
77
+ interface RoomConnectionOptions {
78
+ displayName?: string;
79
+ localStream?: MediaStream;
80
+ localMediaConstraints?: MediaStreamConstraints;
81
+ roomKey?: string;
82
+ logger?: Logger;
83
+ }
84
+
85
+ type RemoteParticipantState = Omit<RemoteParticipant, "updateStreamState">;
86
+ interface RoomState {
87
+ localParticipant?: LocalParticipant;
88
+ roomConnectionStatus?: "connecting" | "connected" | "disconnected";
89
+ remoteParticipants: RemoteParticipantState[];
90
+ }
91
+
92
+ interface RoomConnectionActions {
93
+ toggleCamera(enabled?: boolean): void;
94
+ toggleMicrophone(enabled?: boolean): void;
95
+ setDisplayName(displayName: string): void;
96
+ }
97
+ interface RoomConnectionComponents {
98
+ VideoView: typeof _default;
99
+ }
100
+ declare function useRoomConnection(roomUrl: string, roomConnectionOptions: RoomConnectionOptions): [state: RoomState, actions: RoomConnectionActions, components: RoomConnectionComponents];
101
+
102
+ declare const sdkVersion = "2.0.0-alpha2";
103
+
104
+ export { sdkVersion, useRoomConnection };