@formant/realtime-sdk 1.3.0 → 1.4.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/dist/client/AuthClient.d.ts +42 -0
- package/dist/client/Credentials.d.ts +10 -0
- package/dist/client/LanAgentClient.d.ts +7 -0
- package/dist/client/RtcSignalingClient.d.ts +20 -0
- package/dist/common/BaseClient.d.ts +43 -0
- package/dist/common/ConnectionError.d.ts +6 -0
- package/dist/common/FormantBaseClient.d.ts +13 -0
- package/dist/common/LogApiTransport.d.ts +11 -0
- package/dist/common/LogClient.d.ts +6 -0
- package/dist/common/LogReporter.d.ts +6 -0
- package/dist/common/LruCache.d.ts +20 -0
- package/dist/common/PromiseLruCache.d.ts +11 -0
- package/dist/common/ResponseError.d.ts +11 -0
- package/dist/common/ResponseHeadersError.d.ts +7 -0
- package/dist/common/StatsManager.d.ts +39 -0
- package/dist/common/StatsReporter.d.ts +17 -0
- package/dist/common/assertUnreachable.d.ts +1 -0
- package/dist/common/browser.d.ts +2 -0
- package/dist/common/collectErrors.d.ts +1 -0
- package/dist/common/config/index.d.ts +23 -0
- package/dist/common/defined.d.ts +6 -0
- package/dist/common/delay.d.ts +1 -0
- package/dist/common/errorToObject.d.ts +16 -0
- package/dist/common/errorToString.d.ts +6 -0
- package/dist/common/filterIceServers.d.ts +8 -0
- package/dist/common/instanceId.d.ts +1 -0
- package/dist/common/isErrorType.d.ts +1 -0
- package/dist/common/isObject.d.ts +1 -0
- package/dist/common/isValidTagString.d.ts +1 -0
- package/dist/common/logger.d.ts +4 -0
- package/dist/common/narrowError.d.ts +1 -0
- package/dist/common/objectMapValues.d.ts +9 -0
- package/dist/common/redact.d.ts +5 -0
- package/dist/common/setPromiseInterval.d.ts +16 -0
- package/dist/common/stats.d.ts +2 -0
- package/dist/common/toStringSafe.d.ts +8 -0
- package/dist/date-fns/parseIsoDate.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +19 -0
- package/dist/model/AnnotationAreaType.d.ts +2 -0
- package/dist/model/AuditLogActionType.d.ts +5 -0
- package/dist/model/CognitoRegion.d.ts +2 -0
- package/dist/model/Feature.d.ts +3 -0
- package/dist/model/HealthStatus.d.ts +2 -0
- package/dist/model/HexRgbColor.d.ts +1 -0
- package/dist/model/IAdminSignupRequest.d.ts +14 -0
- package/dist/model/IAnnotationAreaTypeMap.d.ts +4 -0
- package/dist/model/IAudioChunk.d.ts +5 -0
- package/dist/model/IAuditLog.d.ts +14 -0
- package/dist/model/IAuthentication.d.ts +8 -0
- package/dist/model/IBaseEntity.d.ts +7 -0
- package/dist/model/IBattery.d.ts +6 -0
- package/dist/model/IBitset.d.ts +4 -0
- package/dist/model/IBoundingBox.d.ts +6 -0
- package/dist/model/IChallenge.d.ts +7 -0
- package/dist/model/ICheckSsoResult.d.ts +5 -0
- package/dist/model/IColorRGBA.d.ts +6 -0
- package/dist/model/ICompressedImage.d.ts +3 -0
- package/dist/model/ICreateServiceAccountResponse.d.ts +5 -0
- package/dist/model/IDeviceCredentials.d.ts +9 -0
- package/dist/model/IDictionary.d.ts +3 -0
- package/dist/model/IFile.d.ts +6 -0
- package/dist/model/IFilter.d.ts +11 -0
- package/dist/model/IGetFeaturesResponse.d.ts +4 -0
- package/dist/model/IGoal.d.ts +5 -0
- package/dist/model/IGoalID.d.ts +3 -0
- package/dist/model/IGoogleLoginRequest.d.ts +4 -0
- package/dist/model/IH264VideoFrame.d.ts +5 -0
- package/dist/model/IHealth.d.ts +5 -0
- package/dist/model/IImage.d.ts +6 -0
- package/dist/model/IImageAnnotation.d.ts +9 -0
- package/dist/model/IJointState.d.ts +8 -0
- package/dist/model/IJoy.d.ts +4 -0
- package/dist/model/IJsonString.d.ts +3 -0
- package/dist/model/IListResponse.d.ts +3 -0
- package/dist/model/ILocalization.d.ts +14 -0
- package/dist/model/ILocation.d.ts +6 -0
- package/dist/model/ILogLine.d.ts +9 -0
- package/dist/model/ILoginRequest.d.ts +7 -0
- package/dist/model/ILoginResult.d.ts +7 -0
- package/dist/model/IMap.d.ts +10 -0
- package/dist/model/IMarker3D.d.ts +23 -0
- package/dist/model/IMarker3DArray.d.ts +4 -0
- package/dist/model/IMetric.d.ts +7 -0
- package/dist/model/INumericSetEntry.d.ts +5 -0
- package/dist/model/IOdometry.d.ts +7 -0
- package/dist/model/IPath.d.ts +5 -0
- package/dist/model/IPoint.d.ts +2 -0
- package/dist/model/IPointCloud.d.ts +6 -0
- package/dist/model/IPoseWithCovariance.d.ts +5 -0
- package/dist/model/IPostLanRtcOfferRequest.d.ts +3 -0
- package/dist/model/IPostLanRtcOfferResponse.d.ts +3 -0
- package/dist/model/IQuaternion.d.ts +6 -0
- package/dist/model/IRtcAddSignalsRequest.d.ts +4 -0
- package/dist/model/IRtcCapabilitySet.d.ts +6 -0
- package/dist/model/IRtcCreatePeerRequest.d.ts +6 -0
- package/dist/model/IRtcCreateSessionRequest.d.ts +5 -0
- package/dist/model/IRtcIceServer.d.ts +5 -0
- package/dist/model/IRtcInfo.d.ts +7 -0
- package/dist/model/IRtcPeer.d.ts +11 -0
- package/dist/model/IRtcPeerDescription.d.ts +6 -0
- package/dist/model/IRtcPortForwardingConfiguration.d.ts +3 -0
- package/dist/model/IRtcSession.d.ts +12 -0
- package/dist/model/IRtcSignal.d.ts +3 -0
- package/dist/model/IRtcStream.d.ts +9 -0
- package/dist/model/IRtcStreamCapability.d.ts +6 -0
- package/dist/model/IRtcStreamingConfiguration.d.ts +4 -0
- package/dist/model/IScopeFilter.d.ts +6 -0
- package/dist/model/IStat.d.ts +21 -0
- package/dist/model/IStreamTypeMap.d.ts +27 -0
- package/dist/model/ITagFilter.d.ts +4 -0
- package/dist/model/ITagSets.d.ts +3 -0
- package/dist/model/ITaggedEntity.d.ts +5 -0
- package/dist/model/ITags.d.ts +2 -0
- package/dist/model/ITransform.d.ts +6 -0
- package/dist/model/ITransformNode.d.ts +8 -0
- package/dist/model/ITwist.d.ts +5 -0
- package/dist/model/IUser.d.ts +36 -0
- package/dist/model/IUserScope.d.ts +16 -0
- package/dist/model/IValidation.d.ts +3 -0
- package/dist/model/IVector3.d.ts +5 -0
- package/dist/model/IVideo.d.ts +7 -0
- package/dist/model/IsoDate.d.ts +1 -0
- package/dist/model/LanguageType.d.ts +2 -0
- package/dist/model/LogLevel.d.ts +2 -0
- package/dist/model/Marker3DAction.d.ts +2 -0
- package/dist/model/Marker3DType.d.ts +2 -0
- package/dist/model/OrganizationPlan.d.ts +2 -0
- package/dist/model/RequireKeys.d.ts +3 -0
- package/dist/model/RtcConnectionStatus.d.ts +2 -0
- package/dist/model/RtcIceServerProtocol.d.ts +2 -0
- package/dist/model/RtcIceTransportPolicy.d.ts +2 -0
- package/dist/model/RtcSessionType.d.ts +2 -0
- package/dist/model/RtcStreamType.d.ts +3 -0
- package/dist/model/SmsOptInStatus.d.ts +2 -0
- package/dist/model/StreamType.d.ts +2 -0
- package/dist/model/Timeout.d.ts +1 -0
- package/dist/model/Timestamp.d.ts +1 -0
- package/dist/model/Uuid.d.ts +1 -0
- package/dist/model/VideoMimeType.d.ts +2 -0
- package/dist/model/auditLogActionTypes.d.ts +1 -0
- package/dist/model/bytes.d.ts +9 -0
- package/dist/model/cognitoRegions.d.ts +1 -0
- package/dist/model/duration.d.ts +10 -0
- package/dist/model/features.d.ts +2 -0
- package/dist/model/healthStatuses.d.ts +5 -0
- package/dist/model/languageTypes.d.ts +1 -0
- package/dist/model/logLevels.d.ts +1 -0
- package/dist/model/marker3DActions.d.ts +1 -0
- package/dist/model/marker3DTypes.d.ts +1 -0
- package/dist/model/organizationPlans.d.ts +1 -0
- package/dist/model/rtcConnectionStatuses.d.ts +1 -0
- package/dist/model/rtcIceServerProtocols.d.ts +1 -0
- package/dist/model/rtcIceTransportPolicies.d.ts +1 -0
- package/dist/model/rtcSessionTypes.d.ts +1 -0
- package/dist/model/rtcStreamTypes.d.ts +28 -0
- package/dist/model/smsOptInStatuses.d.ts +1 -0
- package/dist/model/videoMimeTypes.d.ts +1 -0
- package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.d.ts +125 -0
- package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.js +626 -0
- package/dist/protos/api/signaling/v1/signaling_pb.d.ts +458 -0
- package/dist/protos/api/signaling/v1/signaling_pb.js +3854 -0
- package/dist/realtime-sdk/src/config/index.d.ts +2 -0
- package/dist/realtime-sdk/src/index.d.ts +18 -0
- package/dist/rtc-client/DeadlineEnforcer.d.ts +4 -0
- package/dist/rtc-client/DeadlineReachedError.d.ts +3 -0
- package/dist/rtc-client/IHasPeerConnection.d.ts +3 -0
- package/dist/rtc-client/IHasRemoteDeviceId.d.ts +4 -0
- package/dist/rtc-client/RtcClient.d.ts +71 -0
- package/dist/rtc-client/RtcClientV1.d.ts +52 -0
- package/dist/rtc-client/RtcConnection.d.ts +95 -0
- package/dist/rtc-client/RtcConnectionV1.d.ts +73 -0
- package/dist/rtc-client/RtcSessionMetrics.d.ts +17 -0
- package/dist/rtc-client/RtcSessionMetricsV1.d.ts +14 -0
- package/dist/rtc-client/config/index.d.ts +11 -0
- package/dist/rtc-client/gatherPingMetrics.d.ts +17 -0
- package/dist/rtc-client/models/IIceMode.d.ts +1 -0
- package/dist/rtc-client/models/IPingInfo.d.ts +10 -0
- package/dist/rtc-client/models/IPingPayload.d.ts +6 -0
- package/dist/rtc-client/models/IRTCStatsIceCandidate.d.ts +9 -0
- package/dist/rtc-client/models/IRTCStatsIceCandidatePair.d.ts +9 -0
- package/dist/rtc-client/models/IRTCStatsTransport.d.ts +8 -0
- package/dist/rtc-client/models/IRtcAgentInfo.d.ts +3 -0
- package/dist/rtc-client/models/IRtcClientConfiguration.d.ts +18 -0
- package/dist/rtc-client/models/IRtcConnectionBaseConfiguration.d.ts +16 -0
- package/dist/rtc-client/models/IRtcConnectionConfiguration.d.ts +6 -0
- package/dist/rtc-client/models/IRtcConnectionRemoteConfiguration.d.ts +6 -0
- package/dist/rtc-client/models/IRtcConnectionStatsInfo.d.ts +9 -0
- package/dist/rtc-client/models/IRtcPointCloud.d.ts +5 -0
- package/dist/rtc-client/models/IRtcSendConfiguration.d.ts +4 -0
- package/dist/rtc-client/models/IRtcSessionMetricsMessageCounts.d.ts +6 -0
- package/dist/rtc-client/models/IRtcStreamCommunication.d.ts +4 -0
- package/dist/rtc-client/models/IRtcStreamMessage.d.ts +7 -0
- package/dist/rtc-client/models/IRtcStreamMessageChunk.d.ts +7 -0
- package/dist/rtc-client/models/IRtcStreamMessageHeader.d.ts +7 -0
- package/dist/rtc-client/models/IRtcStreamPayload.d.ts +55 -0
- package/dist/rtc-client/models/IRtcStreamsInfo.d.ts +9 -0
- package/dist/rtc-client/models/IStreamControl.d.ts +23 -0
- package/dist/rtc-client/models/RtcChannelLabel.d.ts +2 -0
- package/dist/rtc-client/models/RtcCommunicationType.d.ts +1 -0
- package/dist/rtc-client/models/rtcChannelLabels.d.ts +1 -0
- package/dist/rtc-client/models-v1/IRtcClientConfigurationV1.d.ts +11 -0
- package/dist/rtc-client/models-v1/IRtcConnectionConfigurationV1.d.ts +12 -0
- package/dist/rtc-client/utils/assertHasPeerConnection.d.ts +1 -0
- package/dist/rtc-client/utils/createRtcStreamMessage.d.ts +4 -0
- package/dist/rtc-client/utils/encodeStreamId.d.ts +3 -0
- package/dist/rtc-client/utils/garbageCollect.d.ts +1 -0
- package/dist/rtc-client/utils/getErrorMessage.d.ts +1 -0
- package/dist/rtc-client/utils/iceModeFromRtcConnectionInfo.d.ts +3 -0
- package/dist/rtc-client/utils/isInactive.d.ts +1 -0
- package/dist/rtc-client/utils/partition.d.ts +1 -0
- package/dist/rtc-client/utils/peerToRtcPeer.d.ts +3 -0
- package/dist/rtc-client/utils/reassembleMessageChunks.d.ts +3 -0
- package/dist/rtc-client/utils/reifyZeroValues.d.ts +2 -0
- package/dist/rtc-client/utils/streamIsEqual.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FormantBaseClient } from "../common/FormantBaseClient";
|
|
2
|
+
import { Feature } from "../model/Feature";
|
|
3
|
+
import { IAdminSignupRequest } from "../model/IAdminSignupRequest";
|
|
4
|
+
import { ICheckSsoResult } from "../model/ICheckSsoResult";
|
|
5
|
+
import { ICreateServiceAccountResponse } from "../model/ICreateServiceAccountResponse";
|
|
6
|
+
import { IDeviceCredentials } from "../model/IDeviceCredentials";
|
|
7
|
+
import { IGoogleLoginRequest } from "../model/IGoogleLoginRequest";
|
|
8
|
+
import { ILoginRequest } from "../model/ILoginRequest";
|
|
9
|
+
import { ILoginResult } from "../model/ILoginResult";
|
|
10
|
+
import { ITags } from "../model/ITags";
|
|
11
|
+
import { IUser } from "../model/IUser";
|
|
12
|
+
import { Uuid } from "../model/Uuid";
|
|
13
|
+
export declare class AuthClient extends FormantBaseClient {
|
|
14
|
+
adminSignup(props: IAdminSignupRequest, token?: string): Promise<IUser>;
|
|
15
|
+
login(credentials: ILoginRequest): Promise<ILoginResult>;
|
|
16
|
+
loginWithGoogleToken(credentials: IGoogleLoginRequest): Promise<ILoginResult>;
|
|
17
|
+
refresh(refreshToken: string, tokenExpirationSeconds?: number): Promise<ILoginResult>;
|
|
18
|
+
respondToNewPasswordRequiredChallenge(props: {
|
|
19
|
+
userId: Uuid;
|
|
20
|
+
session: string;
|
|
21
|
+
newPassword: string;
|
|
22
|
+
}): Promise<ILoginResult>;
|
|
23
|
+
forgotPassword(email: string): Promise<void>;
|
|
24
|
+
confirmForgotPassword(props: {
|
|
25
|
+
email: string;
|
|
26
|
+
confirmationCode: string;
|
|
27
|
+
newPassword: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
resendInvitation(email: string): Promise<void>;
|
|
30
|
+
changePassword({ token, refreshToken, currentPassword, newPassword, }: {
|
|
31
|
+
token: string;
|
|
32
|
+
refreshToken: string;
|
|
33
|
+
currentPassword: string;
|
|
34
|
+
newPassword: string;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
getDeviceCredentials(token: string): Promise<IDeviceCredentials>;
|
|
37
|
+
impersonate(token: string, userId: Uuid): Promise<ILoginResult>;
|
|
38
|
+
createServiceAccount(token: string, name: string, roleId: Uuid, tags: ITags, description?: string): Promise<ICreateServiceAccountResponse>;
|
|
39
|
+
getFeatures(token: string): Promise<Feature[]>;
|
|
40
|
+
checkSso(email: string, allowUserAutoCreation?: boolean): Promise<ICheckSsoResult>;
|
|
41
|
+
loginWithSso(token: string, refreshToken?: string): Promise<ILoginResult>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertUnreachable(_: never): never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function collectErrors<T>(promises: Promise<T>[]): Promise<Error[]>;
|
|
@@ -0,0 +1,23 @@
|
|
|
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;
|
|
23
|
+
export declare const auditLogsEnabled: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const delay: (time?: number) => Promise<unknown>;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const instanceId: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isErrorType<T extends Error>(error: unknown, constructor: new (...x: any[]) => T, predicate?: (t: T) => boolean): error is T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isObject(value: any): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isValidTagString(keyOrValue: string, allowStar?: boolean): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function narrowError<T extends Error>(error: unknown, constructor: new (...x: any[]) => T, predicate?: (t: T) => boolean): T;
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseIsoDate(timestamp: string): Date;
|