@formant/realtime-sdk 0.0.7 → 0.0.10
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 +2 -1
- package/dist/common/BaseClient.d.ts +5 -1
- package/dist/common/LruCache.d.ts +7 -9
- package/dist/common/PromiseLruCache.d.ts +5 -5
- package/dist/common/toStringSafe.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/model/IJsonString.d.ts +3 -0
- package/dist/model/ITaggedEntity.d.ts +5 -0
- package/dist/model/IUser.d.ts +2 -4
- package/dist/model/features.d.ts +1 -1
- package/dist/model/rtcIceTransportPolicies.d.ts +1 -1
- package/dist/model/rtcStreamTypes.d.ts +2 -1
- package/dist/protos/api/signaling/v1/signaling.proto +1 -0
- package/dist/protos/api/signaling/v1/signaling_pb.d.ts +1 -0
- package/dist/protos/api/signaling/v1/signaling_pb.js +3 -2
- package/dist/rtc-client/models/IRtcConnectConfiguration.d.ts +1 -1
- package/dist/rtc-client/models/IRtcStreamPayload.d.ts +2 -0
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import { IDeviceCredentials } from "../model/IDeviceCredentials";
|
|
|
6
6
|
import { IGoogleLoginRequest } from "../model/IGoogleLoginRequest";
|
|
7
7
|
import { ILoginRequest } from "../model/ILoginRequest";
|
|
8
8
|
import { ILoginResult } from "../model/ILoginResult";
|
|
9
|
+
import { ITags } from "../model/ITags";
|
|
9
10
|
import { IUser } from "../model/IUser";
|
|
10
11
|
import { Uuid } from "../model/Uuid";
|
|
11
12
|
export declare class AuthClient extends FormantBaseClient {
|
|
@@ -33,6 +34,6 @@ export declare class AuthClient extends FormantBaseClient {
|
|
|
33
34
|
}): Promise<void>;
|
|
34
35
|
getDeviceCredentials(token: string): Promise<IDeviceCredentials>;
|
|
35
36
|
impersonate(token: string, userId: Uuid): Promise<ILoginResult>;
|
|
36
|
-
createServiceAccount(token: string, name: string, roleId: Uuid): Promise<ICreateServiceAccountResponse>;
|
|
37
|
+
createServiceAccount(token: string, name: string, roleId: Uuid, tags: ITags): Promise<ICreateServiceAccountResponse>;
|
|
37
38
|
getFeatures(token: string): Promise<Feature[]>;
|
|
38
39
|
}
|
|
@@ -16,14 +16,16 @@ export interface IResponse<T> {
|
|
|
16
16
|
}
|
|
17
17
|
export declare abstract class BaseClient {
|
|
18
18
|
protected endpoint: string | undefined;
|
|
19
|
+
["constructor"]: typeof BaseClient;
|
|
19
20
|
static retries: number;
|
|
20
21
|
static waitForConnectivity: () => Promise<void>;
|
|
21
22
|
static onResponseError: (error: ResponseError) => Promise<void>;
|
|
22
23
|
private validateHeaders;
|
|
23
24
|
private headers;
|
|
24
25
|
private verbose;
|
|
25
|
-
private
|
|
26
|
+
private configuredRetries;
|
|
26
27
|
private timeoutMs?;
|
|
28
|
+
private maxBackoffDelayMs;
|
|
27
29
|
constructor(endpoint: string | undefined, options?: {
|
|
28
30
|
validateHeaders?: (headers: Headers) => IValidation;
|
|
29
31
|
headers?: {
|
|
@@ -32,7 +34,9 @@ export declare abstract class BaseClient {
|
|
|
32
34
|
verbose?: boolean;
|
|
33
35
|
retries?: number;
|
|
34
36
|
timeoutMs?: number;
|
|
37
|
+
maxBackoffDelayMs?: number;
|
|
35
38
|
});
|
|
39
|
+
protected getRetries(): number;
|
|
36
40
|
protected fetch<T>(path: string, extendedInit?: IRequestInit): Promise<T>;
|
|
37
41
|
protected fetchVerbose<T>(path: string, extendedInit?: IRequestInit): Promise<IResponse<T>>;
|
|
38
42
|
private doFetch;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import * as BaseLruCache from "lru-cache";
|
|
2
|
-
|
|
3
|
-
export interface ICacheOptions<V> extends Options<string, V> {
|
|
2
|
+
export declare type CacheOptions<V> = BaseLruCache.Options<string, V> & {
|
|
4
3
|
fastStringify?: boolean;
|
|
5
|
-
}
|
|
4
|
+
};
|
|
6
5
|
export declare class LruCache<K, V> {
|
|
7
6
|
protected cache: BaseLruCache<string, V>;
|
|
8
7
|
protected stringify: (_: K) => string;
|
|
9
|
-
constructor(options
|
|
10
|
-
set(key: K, value: V,
|
|
8
|
+
constructor(options: CacheOptions<V>);
|
|
9
|
+
set(key: K, value: V, ttl?: number): void;
|
|
11
10
|
get(key: K): V | undefined;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
prune(): void;
|
|
11
|
+
delete(key: K): void;
|
|
12
|
+
size(): number;
|
|
13
|
+
clear(): void;
|
|
16
14
|
forEach(callback: (value: V) => void): void;
|
|
17
15
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { CacheOptions, LruCache } from "./LruCache";
|
|
2
|
+
export declare type PromiseCacheOptions<V> = CacheOptions<Promise<V>> & {
|
|
3
3
|
expireRejectedPromiseValues?: boolean;
|
|
4
4
|
rejectedPromiseValueTtl?: number;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
export declare class PromiseLruCache<K, V> extends LruCache<K, Promise<V>> {
|
|
7
7
|
protected expireRejectedPromiseValues: boolean;
|
|
8
8
|
protected rejectedPromiseValueTtl: number;
|
|
9
|
-
constructor(options
|
|
10
|
-
set(key: K, value: Promise<V>,
|
|
9
|
+
constructor(options: PromiseCacheOptions<V>);
|
|
10
|
+
set(key: K, value: Promise<V>, ttl?: number): void;
|
|
11
11
|
}
|
|
@@ -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;
|