@formant/realtime-sdk 1.1.0 → 1.3.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.
Files changed (212) hide show
  1. package/README.md +36 -20
  2. package/package.json +28 -10
  3. package/dist/client/AuthClient.d.ts +0 -39
  4. package/dist/client/Credentials.d.ts +0 -10
  5. package/dist/client/LanAgentClient.d.ts +0 -7
  6. package/dist/client/RtcSignalingClient.d.ts +0 -20
  7. package/dist/common/BaseClient.d.ts +0 -43
  8. package/dist/common/ConnectionError.d.ts +0 -6
  9. package/dist/common/FormantBaseClient.d.ts +0 -13
  10. package/dist/common/LogApiTransport.d.ts +0 -11
  11. package/dist/common/LogClient.d.ts +0 -6
  12. package/dist/common/LogReporter.d.ts +0 -6
  13. package/dist/common/LruCache.d.ts +0 -20
  14. package/dist/common/PromiseLruCache.d.ts +0 -11
  15. package/dist/common/ResponseError.d.ts +0 -11
  16. package/dist/common/ResponseHeadersError.d.ts +0 -7
  17. package/dist/common/StatsManager.d.ts +0 -39
  18. package/dist/common/StatsReporter.d.ts +0 -17
  19. package/dist/common/assertUnreachable.d.ts +0 -1
  20. package/dist/common/collectErrors.d.ts +0 -1
  21. package/dist/common/config/index.d.ts +0 -22
  22. package/dist/common/defined.d.ts +0 -6
  23. package/dist/common/delay.d.ts +0 -1
  24. package/dist/common/errorToObject.d.ts +0 -16
  25. package/dist/common/errorToString.d.ts +0 -6
  26. package/dist/common/filterIceServers.d.ts +0 -8
  27. package/dist/common/instanceId.d.ts +0 -1
  28. package/dist/common/isErrorType.d.ts +0 -1
  29. package/dist/common/isObject.d.ts +0 -1
  30. package/dist/common/isValidTagString.d.ts +0 -1
  31. package/dist/common/logger.d.ts +0 -2
  32. package/dist/common/narrowError.d.ts +0 -1
  33. package/dist/common/objectMapValues.d.ts +0 -9
  34. package/dist/common/redact.d.ts +0 -4
  35. package/dist/common/setPromiseInterval.d.ts +0 -16
  36. package/dist/common/stats.d.ts +0 -2
  37. package/dist/common/toStringSafe.d.ts +0 -8
  38. package/dist/date-fns/parseIsoDate.d.ts +0 -1
  39. package/dist/index.js +0 -2
  40. package/dist/index.js.LICENSE.txt +0 -14
  41. package/dist/model/AnnotationAreaType.d.ts +0 -2
  42. package/dist/model/CognitoRegion.d.ts +0 -2
  43. package/dist/model/Feature.d.ts +0 -3
  44. package/dist/model/HealthStatus.d.ts +0 -2
  45. package/dist/model/HexRgbColor.d.ts +0 -1
  46. package/dist/model/IAdminSignupRequest.d.ts +0 -14
  47. package/dist/model/IAnnotationAreaTypeMap.d.ts +0 -4
  48. package/dist/model/IAudioChunk.d.ts +0 -5
  49. package/dist/model/IAuthentication.d.ts +0 -8
  50. package/dist/model/IBaseEntity.d.ts +0 -7
  51. package/dist/model/IBattery.d.ts +0 -6
  52. package/dist/model/IBitset.d.ts +0 -4
  53. package/dist/model/IBoundingBox.d.ts +0 -6
  54. package/dist/model/IChallenge.d.ts +0 -7
  55. package/dist/model/IColorRGBA.d.ts +0 -6
  56. package/dist/model/ICompressedImage.d.ts +0 -3
  57. package/dist/model/ICreateServiceAccountResponse.d.ts +0 -5
  58. package/dist/model/IDeviceCredentials.d.ts +0 -9
  59. package/dist/model/IDictionary.d.ts +0 -3
  60. package/dist/model/IFile.d.ts +0 -6
  61. package/dist/model/IFilter.d.ts +0 -10
  62. package/dist/model/IGetFeaturesResponse.d.ts +0 -4
  63. package/dist/model/IGoal.d.ts +0 -5
  64. package/dist/model/IGoalID.d.ts +0 -3
  65. package/dist/model/IGoogleLoginRequest.d.ts +0 -4
  66. package/dist/model/IH264VideoFrame.d.ts +0 -5
  67. package/dist/model/IHealth.d.ts +0 -5
  68. package/dist/model/IImage.d.ts +0 -6
  69. package/dist/model/IImageAnnotation.d.ts +0 -9
  70. package/dist/model/IJointState.d.ts +0 -8
  71. package/dist/model/IJsonString.d.ts +0 -3
  72. package/dist/model/IListResponse.d.ts +0 -3
  73. package/dist/model/ILocalization.d.ts +0 -14
  74. package/dist/model/ILocation.d.ts +0 -6
  75. package/dist/model/ILogLine.d.ts +0 -9
  76. package/dist/model/ILoginRequest.d.ts +0 -5
  77. package/dist/model/ILoginResult.d.ts +0 -7
  78. package/dist/model/IMap.d.ts +0 -10
  79. package/dist/model/IMarker3D.d.ts +0 -23
  80. package/dist/model/IMarker3DArray.d.ts +0 -4
  81. package/dist/model/IMetric.d.ts +0 -7
  82. package/dist/model/INumericSetEntry.d.ts +0 -5
  83. package/dist/model/IOdometry.d.ts +0 -7
  84. package/dist/model/IPath.d.ts +0 -5
  85. package/dist/model/IPoint.d.ts +0 -2
  86. package/dist/model/IPointCloud.d.ts +0 -6
  87. package/dist/model/IPoseWithCovariance.d.ts +0 -5
  88. package/dist/model/IPostLanRtcOfferRequest.d.ts +0 -3
  89. package/dist/model/IPostLanRtcOfferResponse.d.ts +0 -3
  90. package/dist/model/IQuaternion.d.ts +0 -6
  91. package/dist/model/IRtcAddSignalsRequest.d.ts +0 -4
  92. package/dist/model/IRtcCapabilitySet.d.ts +0 -6
  93. package/dist/model/IRtcCreatePeerRequest.d.ts +0 -6
  94. package/dist/model/IRtcCreateSessionRequest.d.ts +0 -5
  95. package/dist/model/IRtcIceServer.d.ts +0 -5
  96. package/dist/model/IRtcInfo.d.ts +0 -7
  97. package/dist/model/IRtcPeer.d.ts +0 -11
  98. package/dist/model/IRtcPeerDescription.d.ts +0 -6
  99. package/dist/model/IRtcPortForwardingConfiguration.d.ts +0 -3
  100. package/dist/model/IRtcSession.d.ts +0 -12
  101. package/dist/model/IRtcSignal.d.ts +0 -3
  102. package/dist/model/IRtcStream.d.ts +0 -9
  103. package/dist/model/IRtcStreamCapability.d.ts +0 -6
  104. package/dist/model/IRtcStreamingConfiguration.d.ts +0 -4
  105. package/dist/model/IScopeFilter.d.ts +0 -6
  106. package/dist/model/IStat.d.ts +0 -21
  107. package/dist/model/IStreamTypeMap.d.ts +0 -27
  108. package/dist/model/ITagSets.d.ts +0 -3
  109. package/dist/model/ITaggedEntity.d.ts +0 -5
  110. package/dist/model/ITags.d.ts +0 -2
  111. package/dist/model/ITransform.d.ts +0 -6
  112. package/dist/model/ITransformNode.d.ts +0 -8
  113. package/dist/model/ITwist.d.ts +0 -5
  114. package/dist/model/IUser.d.ts +0 -34
  115. package/dist/model/IUserScope.d.ts +0 -16
  116. package/dist/model/IValidation.d.ts +0 -3
  117. package/dist/model/IVector3.d.ts +0 -5
  118. package/dist/model/IVideo.d.ts +0 -7
  119. package/dist/model/IsoDate.d.ts +0 -1
  120. package/dist/model/LanguageType.d.ts +0 -2
  121. package/dist/model/LogLevel.d.ts +0 -2
  122. package/dist/model/Marker3DAction.d.ts +0 -2
  123. package/dist/model/Marker3DType.d.ts +0 -2
  124. package/dist/model/OrganizationPlan.d.ts +0 -2
  125. package/dist/model/RequireKeys.d.ts +0 -3
  126. package/dist/model/RtcConnectionStatus.d.ts +0 -2
  127. package/dist/model/RtcIceServerProtocol.d.ts +0 -2
  128. package/dist/model/RtcIceTransportPolicy.d.ts +0 -2
  129. package/dist/model/RtcSessionType.d.ts +0 -2
  130. package/dist/model/RtcStreamType.d.ts +0 -3
  131. package/dist/model/SmsOptInStatus.d.ts +0 -2
  132. package/dist/model/StreamType.d.ts +0 -2
  133. package/dist/model/Timeout.d.ts +0 -1
  134. package/dist/model/Timestamp.d.ts +0 -1
  135. package/dist/model/Uuid.d.ts +0 -1
  136. package/dist/model/VideoMimeType.d.ts +0 -2
  137. package/dist/model/bytes.d.ts +0 -9
  138. package/dist/model/cognitoRegions.d.ts +0 -1
  139. package/dist/model/duration.d.ts +0 -10
  140. package/dist/model/features.d.ts +0 -2
  141. package/dist/model/healthStatuses.d.ts +0 -5
  142. package/dist/model/languageTypes.d.ts +0 -1
  143. package/dist/model/logLevels.d.ts +0 -1
  144. package/dist/model/marker3DActions.d.ts +0 -1
  145. package/dist/model/marker3DTypes.d.ts +0 -1
  146. package/dist/model/organizationPlans.d.ts +0 -1
  147. package/dist/model/rtcConnectionStatuses.d.ts +0 -1
  148. package/dist/model/rtcIceServerProtocols.d.ts +0 -1
  149. package/dist/model/rtcIceTransportPolicies.d.ts +0 -1
  150. package/dist/model/rtcSessionTypes.d.ts +0 -1
  151. package/dist/model/rtcStreamTypes.d.ts +0 -26
  152. package/dist/model/smsOptInStatuses.d.ts +0 -1
  153. package/dist/model/videoMimeTypes.d.ts +0 -1
  154. package/dist/protos/api/signaling/v1/signaling.proto +0 -114
  155. package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.d.ts +0 -125
  156. package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.js +0 -626
  157. package/dist/protos/api/signaling/v1/signaling_pb.d.ts +0 -458
  158. package/dist/protos/api/signaling/v1/signaling_pb.js +0 -3854
  159. package/dist/realtime-sdk/src/config/index.d.ts +0 -2
  160. package/dist/realtime-sdk/src/index.d.ts +0 -16
  161. package/dist/rtc-client/DeadlineEnforcer.d.ts +0 -4
  162. package/dist/rtc-client/DeadlineReachedError.d.ts +0 -3
  163. package/dist/rtc-client/IHasPeerConnection.d.ts +0 -3
  164. package/dist/rtc-client/IHasRemoteDeviceId.d.ts +0 -4
  165. package/dist/rtc-client/RtcClient.d.ts +0 -71
  166. package/dist/rtc-client/RtcClientV1.d.ts +0 -52
  167. package/dist/rtc-client/RtcConnection.d.ts +0 -95
  168. package/dist/rtc-client/RtcConnectionV1.d.ts +0 -73
  169. package/dist/rtc-client/RtcSessionMetrics.d.ts +0 -17
  170. package/dist/rtc-client/RtcSessionMetricsV1.d.ts +0 -14
  171. package/dist/rtc-client/config/index.d.ts +0 -11
  172. package/dist/rtc-client/gatherPingMetrics.d.ts +0 -17
  173. package/dist/rtc-client/models/IIceMode.d.ts +0 -1
  174. package/dist/rtc-client/models/IPingInfo.d.ts +0 -10
  175. package/dist/rtc-client/models/IPingPayload.d.ts +0 -6
  176. package/dist/rtc-client/models/IRTCStatsIceCandidate.d.ts +0 -9
  177. package/dist/rtc-client/models/IRTCStatsIceCandidatePair.d.ts +0 -7
  178. package/dist/rtc-client/models/IRTCStatsTransport.d.ts +0 -8
  179. package/dist/rtc-client/models/IRtcAgentInfo.d.ts +0 -3
  180. package/dist/rtc-client/models/IRtcClientConfiguration.d.ts +0 -18
  181. package/dist/rtc-client/models/IRtcConnectionBaseConfiguration.d.ts +0 -16
  182. package/dist/rtc-client/models/IRtcConnectionConfiguration.d.ts +0 -6
  183. package/dist/rtc-client/models/IRtcConnectionRemoteConfiguration.d.ts +0 -6
  184. package/dist/rtc-client/models/IRtcConnectionStatsInfo.d.ts +0 -7
  185. package/dist/rtc-client/models/IRtcPointCloud.d.ts +0 -5
  186. package/dist/rtc-client/models/IRtcSendConfiguration.d.ts +0 -4
  187. package/dist/rtc-client/models/IRtcSessionMetricsMessageCounts.d.ts +0 -6
  188. package/dist/rtc-client/models/IRtcStreamCommunication.d.ts +0 -4
  189. package/dist/rtc-client/models/IRtcStreamMessage.d.ts +0 -7
  190. package/dist/rtc-client/models/IRtcStreamMessageChunk.d.ts +0 -7
  191. package/dist/rtc-client/models/IRtcStreamMessageHeader.d.ts +0 -7
  192. package/dist/rtc-client/models/IRtcStreamPayload.d.ts +0 -50
  193. package/dist/rtc-client/models/IRtcStreamsInfo.d.ts +0 -9
  194. package/dist/rtc-client/models/IStreamControl.d.ts +0 -23
  195. package/dist/rtc-client/models/RtcChannelLabel.d.ts +0 -2
  196. package/dist/rtc-client/models/RtcCommunicationType.d.ts +0 -1
  197. package/dist/rtc-client/models/rtcChannelLabels.d.ts +0 -1
  198. package/dist/rtc-client/models-v1/IRtcClientConfigurationV1.d.ts +0 -11
  199. package/dist/rtc-client/models-v1/IRtcConnectionConfigurationV1.d.ts +0 -12
  200. package/dist/rtc-client/utils/assertHasPeerConnection.d.ts +0 -1
  201. package/dist/rtc-client/utils/createRtcStreamMessage.d.ts +0 -4
  202. package/dist/rtc-client/utils/encodeStreamId.d.ts +0 -3
  203. package/dist/rtc-client/utils/garbageCollect.d.ts +0 -1
  204. package/dist/rtc-client/utils/getErrorMessage.d.ts +0 -1
  205. package/dist/rtc-client/utils/iceModeFromRtcConnectionInfo.d.ts +0 -3
  206. package/dist/rtc-client/utils/isInactive.d.ts +0 -1
  207. package/dist/rtc-client/utils/partition.d.ts +0 -1
  208. package/dist/rtc-client/utils/peerToRtcPeer.d.ts +0 -3
  209. package/dist/rtc-client/utils/reassembleMessageChunks.d.ts +0 -3
  210. package/dist/rtc-client/utils/reifyZeroValues.d.ts +0 -2
  211. package/dist/rtc-client/utils/streamIsEqual.d.ts +0 -2
  212. package/dist/ui/utils/browser.d.ts +0 -2
package/README.md CHANGED
@@ -18,31 +18,47 @@ Distributed under the MIT License. See LICENSE.txt for more information.
18
18
 
19
19
  ## Changelog
20
20
 
21
+ ### **1.3.0** - 2024-09-09
22
+
23
+ #### Fixed
24
+
25
+ - Redact sensitive ICE credentials.
26
+
27
+ ### **1.2.0** - 2023-08-18
28
+
29
+ #### Added
30
+
31
+ - Exporting `IRtcPeer` and `RtcStreamType`.
32
+
21
33
  ### **1.1.0** - 2023-08-18
22
-
34
+
23
35
  #### Fixed
24
- - Fixed debug logging level output.
36
+
37
+ - Fixed debug logging level output.
25
38
 
26
39
  ### **1.0.0** - 2023-07-19
27
40
 
28
41
  #### Added
29
- - Odometry over teleop
30
- - Add support for eventing on all event trigger types
42
+
43
+ - Odometry over teleop
44
+ - Add support for eventing on all event trigger types
31
45
 
32
46
  #### Changed
33
- - Reduce ICE gathering timeout to 3s
34
-
35
- #### Fixed
36
- - Workaround for lack of getConfiguration method on RTCPeerConnection
37
- - Project de-cycling
38
- - Fix Odom
39
- - Use previously implemented util for detecting STUN vs TURN
40
- - Partition connections in a single step…
41
- - Immediately eject a disconnected connection from the connection set
42
- - More cleanup on rtcClient shutdown
43
- - Record RTC connection type metric (host, relay, etc)
44
- - Make best-effort to *release* the RtcPeerConnection on close
45
- - `isConnectionInitiator` never gets cleared, keeping RtcConnections alive
46
- - Add prettier plugin to deterministically sort import ordering
47
- - Dependency updates
48
- - Resolve realtime-sdk build warnings about re-exporting types
47
+
48
+ - Reduce ICE gathering timeout to 3s
49
+
50
+ #### Fixed
51
+
52
+ - Workaround for lack of getConfiguration method on RTCPeerConnection
53
+ - Project de-cycling
54
+ - Fix Odom
55
+ - Use previously implemented util for detecting STUN vs TURN
56
+ - Partition connections in a single step…
57
+ - Immediately eject a disconnected connection from the connection set
58
+ - More cleanup on rtcClient shutdown
59
+ - Record RTC connection type metric (host, relay, etc)
60
+ - Make best-effort to _release_ the RtcPeerConnection on close
61
+ - `isConnectionInitiator` never gets cleared, keeping RtcConnections alive
62
+ - Add prettier plugin to deterministically sort import ordering
63
+ - Dependency updates
64
+ - Resolve realtime-sdk build warnings about re-exporting types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formant/realtime-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/realtime-sdk/src/index.d.ts",
@@ -8,15 +8,17 @@
8
8
  "dist"
9
9
  ],
10
10
  "scripts": {
11
- "clean": "rm -rf dist",
11
+ "clean": "rimraf dist",
12
12
  "compile": "tsc",
13
- "build": "yarn maybe-make-protos && env $(grep -v '^#' src/config/production.env) webpack",
13
+ "build": "yarn maybe-make-protos && env $(node ../../scripts/webpack4-node-18-support.js && grep -v '^#' src/config/production.env) webpack",
14
14
  "postbuild": "tsc --emitDeclarationOnly --declaration --declarationDir ./dist --skipLibCheck && tsc-alias",
15
- "maybe-make-protos": "if [ -z ${LERNA_PACKAGE_NAME} ]; then cd ../../../ && make protos && cd -; fi"
15
+ "maybe-make-protos": "if [ -z ${LERNA_PACKAGE_NAME} ]; then cd ../../../ && make protos_ts && cd -; fi"
16
16
  },
17
17
  "dependencies": {
18
- "env-var": "^7.3.1",
19
- "@types/google-protobuf": "~3.7.0"
18
+ "@types/generic-pool": "^3.8.1",
19
+ "@types/google-protobuf": "~3.7.0",
20
+ "env-var": "^7.4.0",
21
+ "generic-pool": "^3.9.0"
20
22
  },
21
23
  "devDependencies": {
22
24
  "@formant/client": "*",
@@ -24,16 +26,32 @@
24
26
  "@formant/model": "*",
25
27
  "@formant/protos": "*",
26
28
  "@formant/rtc-client": "*",
29
+ "assert": "^2.1.0",
30
+ "browserify-zlib": "^0.2.0",
31
+ "buffer": "^6.0.3",
27
32
  "circular-dependency-plugin": "^5.2.2",
28
33
  "copy-webpack-plugin": "^6.4.1",
34
+ "crypto-browserify": "^3.12.0",
29
35
  "file-loader": "^5.1.0",
30
36
  "fork-ts-checker-webpack-plugin": "^6.5.3",
37
+ "https-browserify": "^1.0.0",
38
+ "os-browserify": "^0.3.0",
39
+ "path-browserify": "^1.0.1",
40
+ "process": "^0.11.10",
41
+ "rimraf": "^5.0.1",
42
+ "stream-browserify": "^3.0.0",
43
+ "stream-http": "^3.2.0",
31
44
  "terser-webpack-plugin": "^2.3.5",
32
- "ts-loader": "^6.2.1",
45
+ "ts-loader": "^9.5.0",
33
46
  "tsc-alias": "^1.4.1",
34
- "webpack": "^4.42.0",
35
- "webpack-bundle-analyzer": "^3.6.1"
47
+ "url": "^0.11.3",
48
+ "webpack": "^5.88.2",
49
+ "webpack-bundle-analyzer": "^4.9.0",
50
+ "webpack-filter-warnings-plugin": "^1.2.1"
36
51
  },
37
52
  "author": "",
38
- "description": ""
53
+ "description": "",
54
+ "engines": {
55
+ "node": "^16.13.0 || ^18.12.0"
56
+ }
39
57
  }
@@ -1,39 +0,0 @@
1
- import { FormantBaseClient } from "../common/FormantBaseClient";
2
- import { Feature } from "../model/Feature";
3
- import { IAdminSignupRequest } from "../model/IAdminSignupRequest";
4
- import { ICreateServiceAccountResponse } from "../model/ICreateServiceAccountResponse";
5
- import { IDeviceCredentials } from "../model/IDeviceCredentials";
6
- import { IGoogleLoginRequest } from "../model/IGoogleLoginRequest";
7
- import { ILoginRequest } from "../model/ILoginRequest";
8
- import { ILoginResult } from "../model/ILoginResult";
9
- import { ITags } from "../model/ITags";
10
- import { IUser } from "../model/IUser";
11
- import { Uuid } from "../model/Uuid";
12
- export declare class AuthClient extends FormantBaseClient {
13
- adminSignup(props: IAdminSignupRequest, token?: string): Promise<IUser>;
14
- login(credentials: ILoginRequest): Promise<ILoginResult>;
15
- loginWithGoogleToken(credentials: IGoogleLoginRequest): Promise<ILoginResult>;
16
- refresh(refreshToken: string, tokenExpirationSeconds?: number): Promise<ILoginResult>;
17
- respondToNewPasswordRequiredChallenge(props: {
18
- userId: Uuid;
19
- session: string;
20
- newPassword: string;
21
- }): Promise<ILoginResult>;
22
- forgotPassword(email: string): Promise<void>;
23
- confirmForgotPassword(props: {
24
- email: string;
25
- confirmationCode: string;
26
- newPassword: string;
27
- }): Promise<void>;
28
- resendInvitation(email: string): Promise<void>;
29
- changePassword({ token, refreshToken, currentPassword, newPassword, }: {
30
- token: string;
31
- refreshToken: string;
32
- currentPassword: string;
33
- newPassword: string;
34
- }): Promise<void>;
35
- getDeviceCredentials(token: string): Promise<IDeviceCredentials>;
36
- impersonate(token: string, userId: Uuid): Promise<ILoginResult>;
37
- createServiceAccount(token: string, name: string, roleId: Uuid, tags: ITags): Promise<ICreateServiceAccountResponse>;
38
- getFeatures(token: string): Promise<Feature[]>;
39
- }
@@ -1,10 +0,0 @@
1
- import { AuthClient } from "./AuthClient";
2
- export declare class Credentials {
3
- private authClient;
4
- private email;
5
- private password;
6
- private tokenTtlMs;
7
- private tokenCache;
8
- constructor(authClient: AuthClient, email: string, password: string);
9
- getToken(): Promise<string>;
10
- }
@@ -1,7 +0,0 @@
1
- import { BaseClient } from "../common/BaseClient";
2
- import { IPostLanRtcOfferRequest } from "../model/IPostLanRtcOfferRequest";
3
- import { IPostLanRtcOfferResponse } from "../model/IPostLanRtcOfferResponse";
4
- export declare class LanAgentClient extends BaseClient {
5
- constructor(endpoint: string);
6
- postLanRtcOffer(request: IPostLanRtcOfferRequest): Promise<IPostLanRtcOfferResponse>;
7
- }
@@ -1,20 +0,0 @@
1
- import { FormantBaseClient } from "../common/FormantBaseClient";
2
- import { IRtcAddSignalsRequest } from "../model/IRtcAddSignalsRequest";
3
- import { IRtcCreatePeerRequest } from "../model/IRtcCreatePeerRequest";
4
- import { IRtcCreateSessionRequest } from "../model/IRtcCreateSessionRequest";
5
- import { IRtcPeer } from "../model/IRtcPeer";
6
- import { IRtcSession } from "../model/IRtcSession";
7
- import { IRtcSignal } from "../model/IRtcSignal";
8
- import { Uuid } from "../model/Uuid";
9
- export declare class RtcSignalingClient extends FormantBaseClient {
10
- createPeer(token: string, request: IRtcCreatePeerRequest): Promise<IRtcPeer>;
11
- getPeers(token: string): Promise<IRtcPeer[]>;
12
- refreshPeer(token: string, id: Uuid): Promise<void>;
13
- createSession(token: string, request: IRtcCreateSessionRequest): Promise<IRtcSession>;
14
- refreshSession(token: string, id: Uuid): Promise<void>;
15
- deleteSession(token: string, id: Uuid): Promise<void>;
16
- getSessions(token: string): Promise<IRtcSession[]>;
17
- getIceServers(token: string): Promise<RTCIceServer[]>;
18
- addSignals(token: string, sessionId: Uuid, request: IRtcAddSignalsRequest): Promise<void>;
19
- takeSignals(token: string, sessionId: Uuid): Promise<IRtcSignal[]>;
20
- }
@@ -1,43 +0,0 @@
1
- import { IDictionary } from "../model/IDictionary";
2
- import { IValidation } from "../model/IValidation";
3
- import { ResponseError } from "./ResponseError";
4
- export interface IRequestInit {
5
- method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
6
- headers?: IDictionary;
7
- body?: any;
8
- token?: string;
9
- allowUnsafeRetries?: boolean;
10
- json?: boolean;
11
- }
12
- export interface IResponse<T> {
13
- body: T;
14
- headers: Headers;
15
- }
16
- export declare abstract class BaseClient {
17
- protected endpoint: string | undefined;
18
- static retries: number;
19
- static waitForConnectivity: () => Promise<void>;
20
- static onResponseError: (error: ResponseError) => Promise<void>;
21
- private validateHeaders;
22
- private verbose;
23
- private configuredRetries;
24
- private timeoutMs?;
25
- private maxBackoffDelayMs;
26
- private json;
27
- constructor(endpoint: string | undefined, options?: {
28
- validateHeaders?: (headers: Headers) => IValidation;
29
- verbose?: boolean;
30
- retries?: number;
31
- timeoutMs?: number;
32
- maxBackoffDelayMs?: number;
33
- json?: boolean;
34
- });
35
- protected getRetries(): number;
36
- protected getHeaders(): {
37
- [_: string]: string;
38
- };
39
- protected fetch<T>(path: string, extendedInit?: IRequestInit): Promise<T>;
40
- protected fetchVerbose<T>(path: string, extendedInit?: IRequestInit): Promise<IResponse<T>>;
41
- private doFetch;
42
- private getConstructor;
43
- }
@@ -1,6 +0,0 @@
1
- export declare class ConnectionError extends Error {
2
- cause: Error;
3
- url: string;
4
- retryable: boolean;
5
- constructor(cause: Error, url: string, retryable: boolean);
6
- }
@@ -1,13 +0,0 @@
1
- import { BaseClient } from "./BaseClient";
2
- export declare abstract class FormantBaseClient extends BaseClient {
3
- protected endpoint: string;
4
- static headers: {
5
- [_: string]: string;
6
- };
7
- constructor(endpoint: string, options?: {
8
- timeoutMs?: number;
9
- });
10
- protected getHeaders(): {
11
- [_: string]: string;
12
- };
13
- }
@@ -1,11 +0,0 @@
1
- import Transport from "winston-transport";
2
- export declare class LogApiTransport extends Transport {
3
- private endpoint;
4
- private metadata;
5
- private logClient;
6
- constructor(endpoint: string, metadata: {
7
- [_: string]: string;
8
- });
9
- private getLogClient;
10
- log(info: any, callback: () => void): Promise<void>;
11
- }
@@ -1,6 +0,0 @@
1
- import { ILogLine } from "../model/ILogLine";
2
- import { FormantBaseClient } from "./FormantBaseClient";
3
- export declare class LogClient extends FormantBaseClient {
4
- static token?: string;
5
- log(lines: ILogLine[]): Promise<void>;
6
- }
@@ -1,6 +0,0 @@
1
- import { IStatEntry, StatsReporter } from "./StatsReporter";
2
- export declare class LogReporter extends StatsReporter<"simple"> {
3
- private message;
4
- constructor(message: string);
5
- send(values: IStatEntry[]): Promise<void>;
6
- }
@@ -1,20 +0,0 @@
1
- import BaseLruCache from "lru-cache";
2
- export type CacheOptions<V> = BaseLruCache.Options<string, V> & {
3
- name: string;
4
- fastStringify?: boolean;
5
- };
6
- export declare class LruCache<K, V> {
7
- private options;
8
- private cache;
9
- private stringify;
10
- constructor(options: CacheOptions<V>);
11
- set(key: K, value: V, ttl?: number): void;
12
- get(key: K): V | undefined;
13
- delete(key: K): void;
14
- peek(key: K): V | undefined;
15
- size(): number;
16
- clear(): void;
17
- forEach(callback: (value: V) => void): void;
18
- purgeStale(): boolean;
19
- private updateStats;
20
- }
@@ -1,11 +0,0 @@
1
- import { CacheOptions, LruCache } from "./LruCache";
2
- export type PromiseCacheOptions<V> = CacheOptions<Promise<V>> & {
3
- expireRejectedPromiseValues?: boolean;
4
- rejectedPromiseValueTtl?: number;
5
- };
6
- export declare class PromiseLruCache<K, V> extends LruCache<K, Promise<V>> {
7
- protected expireRejectedPromiseValues: boolean;
8
- protected rejectedPromiseValueTtl: number;
9
- constructor(options: PromiseCacheOptions<V>);
10
- set(key: K, value: Promise<V>, ttl?: number): void;
11
- }
@@ -1,11 +0,0 @@
1
- import { IValidation } from "../model/IValidation";
2
- export declare class ResponseError extends Error {
3
- method: string;
4
- url: string;
5
- requestBody: any;
6
- statusCode: number;
7
- headers: any;
8
- body: any;
9
- validationErrors: IValidation;
10
- constructor(method: string, url: string, requestBody: any, statusCode: number, headers: any, body: any, validationErrors?: IValidation);
11
- }
@@ -1,7 +0,0 @@
1
- import { IValidation } from "../model/IValidation";
2
- import { ResponseError } from "./ResponseError";
3
- export declare class ResponseHeadersError extends Error {
4
- validationErrors: IValidation;
5
- responseError: ResponseError;
6
- constructor(validationErrors: IValidation, responseError: ResponseError);
7
- }
@@ -1,39 +0,0 @@
1
- import { IStat } from "../model/IStat";
2
- import { ITags } from "../model/ITags";
3
- import { StatsReporter } from "./StatsReporter";
4
- export declare class StatsManager {
5
- static readonly samplePeriodMs: number;
6
- private buffer;
7
- private reporters;
8
- private flushInterval;
9
- private tags;
10
- constructor(config?: {
11
- tags?: ITags;
12
- });
13
- shutdown(): Promise<void>;
14
- /**
15
- * Aggregates a value into the IStat record at key.
16
- */
17
- aggregate(metric: string, value: number | IStat, tags?: ITags): void;
18
- /**
19
- * Aggregates 1 into the IStat record at key.
20
- */
21
- increment(metric: string, tags?: ITags): void;
22
- /**
23
- * Times a function call and the promise it produces.
24
- * The timing statistic is only recorded if the function
25
- * returns without an exception.
26
- */
27
- timer<T>(metric: string, f: () => Promise<T>, tags?: ITags): Promise<T>;
28
- /**
29
- * Register a reporter.
30
- */
31
- registerStatsReporter(statsReporter: StatsReporter): void;
32
- setTag(key: string, value: string): void;
33
- private addToBuffer;
34
- private write;
35
- private flushStats;
36
- private encodeKey;
37
- private decodeKey;
38
- private filterTags;
39
- }
@@ -1,17 +0,0 @@
1
- import { IMetric } from "../model/IMetric";
2
- import { ITags } from "../model/ITags";
3
- export interface IEntryTypeMap {
4
- simple: IStatEntry;
5
- tagged: ITaggedStatEntry;
6
- }
7
- export type StatsReporterType = keyof IEntryTypeMap;
8
- export type IStatEntry = Omit<IMetric, "tags">;
9
- export type ITaggedStatEntry = IStatEntry & {
10
- tags: ITags;
11
- };
12
- export declare abstract class StatsReporter<T extends StatsReporterType = StatsReporterType> {
13
- readonly type: T;
14
- readonly name: string;
15
- constructor(type: T, name: string);
16
- abstract send(values: IEntryTypeMap[T][], intervalMs: number): Promise<void>;
17
- }
@@ -1 +0,0 @@
1
- export declare function assertUnreachable(_: never): never;
@@ -1 +0,0 @@
1
- export declare function collectErrors<T>(promises: Promise<T>[]): Promise<Error[]>;
@@ -1,22 +0,0 @@
1
- export declare const environment: string;
2
- export declare const app: string;
3
- export declare const appPath: string;
4
- export declare const apiEndpoint: string;
5
- export declare const namespace: string;
6
- export declare const version: string;
7
- export declare const buildTag: string;
8
- export declare const gitCommit: string;
9
- export declare const enableSentry: boolean;
10
- export declare const enableSentryProfiling: boolean;
11
- export declare const sentryDsn: string;
12
- export declare const logLevel: string;
13
- export declare const logJson: boolean;
14
- export declare const logToConsole: boolean;
15
- export declare const stableAgentVersion: string;
16
- export declare const logApiEndpoint: string | undefined;
17
- export declare const jestWorkerId: string | undefined;
18
- export declare const sheetExportMaxRowCount: number;
19
- export declare const logToFile: boolean;
20
- export declare const enableSelfServe: boolean;
21
- export type UsageMetricsAggregateLevel = "day" | "hour" | "minute";
22
- export declare const aggregateLevel: UsageMetricsAggregateLevel;
@@ -1,6 +0,0 @@
1
- export declare function assertsDefined<T>(value: T | undefined, message?: string): asserts value is T;
2
- export declare function assertsNotNull<T>(value: T | null, message?: string): asserts value is T;
3
- export declare function assertsDefinedAndNotNull<T>(value: T | undefined | null, message?: string): asserts value is T;
4
- export declare function defined<T>(value: T | undefined): T;
5
- export declare function notNull<T>(value: T | null): T;
6
- export declare function definedAndNotNull<T>(value: T | undefined | null): T;
@@ -1 +0,0 @@
1
- export declare const delay: (time?: number) => Promise<unknown>;
@@ -1,16 +0,0 @@
1
- /**
2
- * Convert an error object to plain javascript object, including any custom properties.
3
- */
4
- export declare function errorToObject(error: any, options?: {
5
- redacted?: boolean;
6
- }): {
7
- message: string;
8
- name?: undefined;
9
- stack?: undefined;
10
- meta?: undefined;
11
- } | {
12
- name: any;
13
- message: any;
14
- stack: any;
15
- meta: any;
16
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Serialize an error object to a string, including any custom properties.
3
- */
4
- export declare function errorToString(error: any, options?: {
5
- redacted?: boolean;
6
- }): string;
@@ -1,8 +0,0 @@
1
- import { IRtcIceServer } from "../model/IRtcIceServer";
2
- import { IRtcInfo } from "../model/IRtcInfo";
3
- import { RtcIceServerProtocol } from "../model/RtcIceServerProtocol";
4
- import { RtcIceTransportPolicy } from "../model/RtcIceTransportPolicy";
5
- import { Uuid } from "../model/Uuid";
6
- export declare function filterIceServers(iceServers: IRtcIceServer[], rtcInfo: IRtcInfo | undefined, organizationId?: Uuid): IRtcIceServer[];
7
- export declare function isPolicy(url: string, policy: RtcIceTransportPolicy): boolean;
8
- export declare function isProtocol(url: string, protocol: RtcIceServerProtocol): boolean;
@@ -1 +0,0 @@
1
- export declare const instanceId: string;
@@ -1 +0,0 @@
1
- export declare function isErrorType<T extends Error>(error: unknown, constructor: new (...x: any[]) => T, predicate?: (t: T) => boolean): error is T;
@@ -1 +0,0 @@
1
- export declare function isObject(value: any): boolean;
@@ -1 +0,0 @@
1
- export declare function isValidTagString(keyOrValue: string): boolean;
@@ -1,2 +0,0 @@
1
- export declare function setLogMetadata(key: string, value: string): void;
2
- export declare const logger: import("winston").Logger;
@@ -1 +0,0 @@
1
- export declare function narrowError<T extends Error>(error: unknown, constructor: new (...x: any[]) => T, predicate?: (t: T) => boolean): T;
@@ -1,9 +0,0 @@
1
- /**
2
- * Creates an object with the same keys as obj and values
3
- * produced by mapping each keyed property with mapF.
4
- */
5
- export declare function objectMapValues<T1, T2>(obj: {
6
- [key: string]: T1;
7
- }, mapF: (value: T1) => T2): {
8
- [key: string]: T2;
9
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * Returns a copy of an object with sensitive information redacted.
3
- */
4
- export declare function redact(object: unknown, visited?: WeakSet<any>): any;
@@ -1,16 +0,0 @@
1
- export interface IPromiseIntervalOptions {
2
- func: () => Promise<void>;
3
- delay: number;
4
- immediate?: boolean;
5
- }
6
- export interface IShutdownPromiseInterval {
7
- stop(): Promise<void>;
8
- }
9
- /**
10
- * Runs callback function f periodically.
11
- * The next call is queued only after the
12
- * promise returned by f is resolved.
13
- *
14
- * Returns a function that stops execution if invoked.
15
- */
16
- export declare function setPromiseInterval({ func, delay, immediate, }: IPromiseIntervalOptions): IShutdownPromiseInterval;
@@ -1,2 +0,0 @@
1
- import { StatsManager } from "./StatsManager";
2
- export declare const stats: StatsManager;
@@ -1,8 +0,0 @@
1
- /**
2
- * Safely stringify input.
3
- * Similar to `JSON.stringify` but
4
- * doesn't throw an error if input includes circular properties.
5
- *
6
- * Warning: output is not guaranteed to be a valid JSON string.
7
- */
8
- export declare function toStringSafe(input: any): string;
@@ -1 +0,0 @@
1
- export declare function parseIsoDate(timestamp: string): Date;