@twilio/mcs-client 0.6.1 → 1.0.0-rc.3
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/builds/browser.js +251 -898
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +3 -41
- package/builds/lib.js +251 -873
- package/builds/lib.js.map +1 -1
- package/builds/twilio-mcs-client.js +2106 -10654
- package/builds/twilio-mcs-client.min.js +37 -24
- package/dist/client.js +7 -7
- package/dist/client.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/media.js +2 -2
- package/dist/media.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/packages/mcs-client/package.json.js +1 -1
- package/dist/services/network.js +4 -4
- package/dist/services/network.js.map +1 -1
- package/dist/services/transport.js +4 -3
- package/dist/services/transport.js.map +1 -1
- package/package.json +21 -8
- package/CHANGELOG.md +0 -315
- package/dist/_virtual/rng-browser.js +0 -34
- package/dist/_virtual/rng-browser.js.map +0 -1
- package/dist/cancellable-promise.js +0 -98
- package/dist/cancellable-promise.js.map +0 -1
- package/dist/node_modules/uuid/index.js +0 -44
- package/dist/node_modules/uuid/index.js.map +0 -1
- package/dist/node_modules/uuid/lib/bytesToUuid.js +0 -60
- package/dist/node_modules/uuid/lib/bytesToUuid.js.map +0 -1
- package/dist/node_modules/uuid/lib/rng-browser.js +0 -65
- package/dist/node_modules/uuid/lib/rng-browser.js.map +0 -1
- package/dist/node_modules/uuid/v1.js +0 -146
- package/dist/node_modules/uuid/v1.js.map +0 -1
- package/dist/node_modules/uuid/v4.js +0 -66
- package/dist/node_modules/uuid/v4.js.map +0 -1
package/builds/lib.d.ts
CHANGED
|
@@ -1,46 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as log from "loglevel";
|
|
3
3
|
import * as loglevel from "loglevel";
|
|
4
|
-
|
|
5
|
-
* Cancellable promise. Extends the functionality of the native Promise to include the cancel method.
|
|
6
|
-
*
|
|
7
|
-
* Example:
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
*
|
|
11
|
-
* const cancellableFetchPromise = new CancellablePromise(async (resolve, reject, onCancel) => {
|
|
12
|
-
* const request = fetch("https://example.com/");
|
|
13
|
-
*
|
|
14
|
-
* onCancel(() => request.cancel());
|
|
15
|
-
*
|
|
16
|
-
* try {
|
|
17
|
-
* const response = await request;
|
|
18
|
-
* resolve(response);
|
|
19
|
-
* } catch (err) {
|
|
20
|
-
* reject(err);
|
|
21
|
-
* }
|
|
22
|
-
* });
|
|
23
|
-
*
|
|
24
|
-
* cancellableFetchPromise.cancel();
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
declare class CancellablePromise<T> extends Promise<T> {
|
|
28
|
-
private readonly id;
|
|
29
|
-
private rejectPromise?;
|
|
30
|
-
private static readonly cancellationMap;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a new CancellablePromise.
|
|
33
|
-
* @param executor A callback used to initialize the promise. This callback is passed three arguments:
|
|
34
|
-
* a resolve callback used to resolve the promise with a value or the result of another promise,
|
|
35
|
-
* a reject callback used to reject the promise with a provided reason or error,
|
|
36
|
-
* and an onCancel callback used to define behavior of cancellation.
|
|
37
|
-
*/
|
|
38
|
-
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: string | Error) => void, onCancel: (cancellationFunction: () => void) => void) => void);
|
|
39
|
-
/**
|
|
40
|
-
* Cancels the promise and invokes the cancellation callback if it was defined during instantiation. Cancellation will result in the promise being rejected.
|
|
41
|
-
*/
|
|
42
|
-
cancel(): this;
|
|
43
|
-
}
|
|
4
|
+
import { CancellablePromise } from "@twilio/shared";
|
|
44
5
|
type Headers = {
|
|
45
6
|
[id: string]: string;
|
|
46
7
|
};
|
|
@@ -230,4 +191,5 @@ declare class Client {
|
|
|
230
191
|
*/
|
|
231
192
|
mediaSetGetContentUrls(mediaSids: string[]): CancellablePromise<Map<string, string>>;
|
|
232
193
|
}
|
|
233
|
-
export { CancellablePromise
|
|
194
|
+
export { CancellablePromise } from "@twilio/shared";
|
|
195
|
+
export { Client, Client as McsClient, Client as default, Media, Media as McsMedia, MediaCategory, MediaCategory as McsMediaCategory };
|