@crewdle/web-sdk-types 1.0.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/README.md +39 -0
- package/dist/core/cluster/Cluster.d.ts +92 -0
- package/dist/core/cluster/Cluster.js +1 -0
- package/dist/core/cluster/ClusterEventEmitter.d.ts +31 -0
- package/dist/core/cluster/ClusterEventEmitter.js +1 -0
- package/dist/core/cluster/ClusterEventKeys.d.ts +6 -0
- package/dist/core/cluster/ClusterEventKeys.js +1 -0
- package/dist/core/cluster/ClusterEvents.d.ts +60 -0
- package/dist/core/cluster/ClusterEvents.js +1 -0
- package/dist/core/cluster/ClusterOnFunction.d.ts +14 -0
- package/dist/core/cluster/ClusterOnFunction.js +1 -0
- package/dist/core/cluster/event/AgentInfoEventPayload.d.ts +16 -0
- package/dist/core/cluster/event/AgentInfoEventPayload.js +1 -0
- package/dist/core/cluster/event/LocalMediaStreamTrackFailEventPayload.d.ts +15 -0
- package/dist/core/cluster/event/LocalMediaStreamTrackFailEventPayload.js +1 -0
- package/dist/core/cluster/event/NodeEventPayload.d.ts +10 -0
- package/dist/core/cluster/event/NodeEventPayload.js +1 -0
- package/dist/core/cluster/event/PublishMediaStreamEventPayload.d.ts +15 -0
- package/dist/core/cluster/event/PublishMediaStreamEventPayload.js +1 -0
- package/dist/core/cluster/event/UnpublishMediaStreamEventPayload.d.ts +14 -0
- package/dist/core/cluster/event/UnpublishMediaStreamEventPayload.js +1 -0
- package/dist/core/cluster/event/UserInfoEventPayload.d.ts +16 -0
- package/dist/core/cluster/event/UserInfoEventPayload.js +1 -0
- package/dist/core/cluster/event/index.d.ts +6 -0
- package/dist/core/cluster/event/index.js +1 -0
- package/dist/core/cluster/index.d.ts +6 -0
- package/dist/core/cluster/index.js +1 -0
- package/dist/core/connection/PeerConnectionConfiguration.d.ts +11 -0
- package/dist/core/connection/PeerConnectionConfiguration.js +1 -0
- package/dist/core/connection/PeerConnectionConnector.d.ts +136 -0
- package/dist/core/connection/PeerConnectionConnector.js +1 -0
- package/dist/core/connection/PeerConnectionConnectorConstructor.d.ts +6 -0
- package/dist/core/connection/PeerConnectionConnectorConstructor.js +1 -0
- package/dist/core/connection/PeerConnectionDataChannelConnector.d.ts +46 -0
- package/dist/core/connection/PeerConnectionDataChannelConnector.js +1 -0
- package/dist/core/connection/PeerConnectionDataChannelEvent.d.ts +11 -0
- package/dist/core/connection/PeerConnectionDataChannelEvent.js +1 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidate.d.ts +10 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidate.js +1 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidateEvent.d.ts +11 -0
- package/dist/core/connection/PeerConnectionHandshakeCandidateEvent.js +1 -0
- package/dist/core/connection/PeerConnectionHandshakeServer.d.ts +18 -0
- package/dist/core/connection/PeerConnectionHandshakeServer.js +1 -0
- package/dist/core/connection/PeerConnectionOfferOptions.d.ts +10 -0
- package/dist/core/connection/PeerConnectionOfferOptions.js +1 -0
- package/dist/core/connection/PeerConnectionSender.d.ts +11 -0
- package/dist/core/connection/PeerConnectionSender.js +1 -0
- package/dist/core/connection/PeerConnectionSenderMap.d.ts +24 -0
- package/dist/core/connection/PeerConnectionSenderMap.js +1 -0
- package/dist/core/connection/PeerConnectionSessionDescription.d.ts +14 -0
- package/dist/core/connection/PeerConnectionSessionDescription.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReport.d.ts +6 -0
- package/dist/core/connection/PeerConnectionStatsReport.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportInbound.d.ts +38 -0
- package/dist/core/connection/PeerConnectionStatsReportInbound.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportOutbound.d.ts +26 -0
- package/dist/core/connection/PeerConnectionStatsReportOutbound.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportRemoteInbound.d.ts +22 -0
- package/dist/core/connection/PeerConnectionStatsReportRemoteInbound.js +1 -0
- package/dist/core/connection/PeerConnectionStatsReportUnused.d.ts +14 -0
- package/dist/core/connection/PeerConnectionStatsReportUnused.js +1 -0
- package/dist/core/connection/PeerConnectionTrackEvent.d.ts +14 -0
- package/dist/core/connection/PeerConnectionTrackEvent.js +1 -0
- package/dist/core/connection/index.d.ts +18 -0
- package/dist/core/connection/index.js +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +5 -0
- package/dist/core/node/AuthNode.d.ts +18 -0
- package/dist/core/node/AuthNode.js +1 -0
- package/dist/core/node/LocalNode.d.ts +7 -0
- package/dist/core/node/LocalNode.js +1 -0
- package/dist/core/node/Node.d.ts +23 -0
- package/dist/core/node/Node.js +1 -0
- package/dist/core/node/NodeMetadata.d.ts +7 -0
- package/dist/core/node/NodeMetadata.js +1 -0
- package/dist/core/node/NodeType.d.ts +14 -0
- package/dist/core/node/NodeType.js +15 -0
- package/dist/core/node/agent/Agent.d.ts +11 -0
- package/dist/core/node/agent/Agent.js +1 -0
- package/dist/core/node/agent/AgentCredentials.d.ts +10 -0
- package/dist/core/node/agent/AgentCredentials.js +1 -0
- package/dist/core/node/agent/AgentMetadata.d.ts +11 -0
- package/dist/core/node/agent/AgentMetadata.js +1 -0
- package/dist/core/node/agent/AuthAgent.d.ts +11 -0
- package/dist/core/node/agent/AuthAgent.js +1 -0
- package/dist/core/node/agent/LocalAgent.d.ts +7 -0
- package/dist/core/node/agent/LocalAgent.js +1 -0
- package/dist/core/node/agent/index.d.ts +5 -0
- package/dist/core/node/agent/index.js +1 -0
- package/dist/core/node/index.d.ts +7 -0
- package/dist/core/node/index.js +3 -0
- package/dist/core/node/user/AuthUser.d.ts +31 -0
- package/dist/core/node/user/AuthUser.js +1 -0
- package/dist/core/node/user/LocalUser.d.ts +17 -0
- package/dist/core/node/user/LocalUser.js +1 -0
- package/dist/core/node/user/User.d.ts +21 -0
- package/dist/core/node/user/User.js +1 -0
- package/dist/core/node/user/UserCredentials.d.ts +18 -0
- package/dist/core/node/user/UserCredentials.js +1 -0
- package/dist/core/node/user/UserMetadata.d.ts +19 -0
- package/dist/core/node/user/UserMetadata.js +1 -0
- package/dist/core/node/user/index.d.ts +5 -0
- package/dist/core/node/user/index.js +1 -0
- package/dist/core/sdk/LoggingConnector.d.ts +25 -0
- package/dist/core/sdk/LoggingConnector.js +1 -0
- package/dist/core/sdk/LoggingConnectorEvent.d.ts +12 -0
- package/dist/core/sdk/LoggingConnectorEvent.js +1 -0
- package/dist/core/sdk/SDK.d.ts +28 -0
- package/dist/core/sdk/SDK.js +1 -0
- package/dist/core/sdk/SDKOptions.d.ts +61 -0
- package/dist/core/sdk/SDKOptions.js +1 -0
- package/dist/core/sdk/index.d.ts +4 -0
- package/dist/core/sdk/index.js +1 -0
- package/dist/core/stream/ContentType.d.ts +30 -0
- package/dist/core/stream/ContentType.js +32 -0
- package/dist/core/stream/DataStream.d.ts +12 -0
- package/dist/core/stream/DataStream.js +1 -0
- package/dist/core/stream/Stream.d.ts +18 -0
- package/dist/core/stream/Stream.js +1 -0
- package/dist/core/stream/index.d.ts +3 -0
- package/dist/core/stream/index.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/key-value-database/DatabaseEvent.d.ts +20 -0
- package/dist/key-value-database/DatabaseEvent.js +11 -0
- package/dist/key-value-database/DatabaseLayout.d.ts +27 -0
- package/dist/key-value-database/DatabaseLayout.js +1 -0
- package/dist/key-value-database/DatabaseTable.d.ts +62 -0
- package/dist/key-value-database/DatabaseTable.js +1 -0
- package/dist/key-value-database/DatabaseTableAction.d.ts +5 -0
- package/dist/key-value-database/DatabaseTableAction.js +1 -0
- package/dist/key-value-database/DatabaseTableEvent.d.ts +15 -0
- package/dist/key-value-database/DatabaseTableEvent.js +1 -0
- package/dist/key-value-database/DatabaseTableIndex.d.ts +10 -0
- package/dist/key-value-database/DatabaseTableIndex.js +1 -0
- package/dist/key-value-database/DatabaseTableLayout.d.ts +11 -0
- package/dist/key-value-database/DatabaseTableLayout.js +1 -0
- package/dist/key-value-database/DatabaseTableQuery.d.ts +27 -0
- package/dist/key-value-database/DatabaseTableQuery.js +1 -0
- package/dist/key-value-database/DatabaseTableQueryWhereBetween.d.ts +20 -0
- package/dist/key-value-database/DatabaseTableQueryWhereBetween.js +1 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValue.d.ts +19 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValue.js +1 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValues.d.ts +19 -0
- package/dist/key-value-database/DatabaseTableQueryWhereValues.js +1 -0
- package/dist/key-value-database/KeyValueDatabase.d.ts +35 -0
- package/dist/key-value-database/KeyValueDatabase.js +1 -0
- package/dist/key-value-database/KeyValueDatabaseConnector.d.ts +30 -0
- package/dist/key-value-database/KeyValueDatabaseConnector.js +1 -0
- package/dist/key-value-database/KeyValueDatabaseConnectorConstructor.d.ts +6 -0
- package/dist/key-value-database/KeyValueDatabaseConnectorConstructor.js +1 -0
- package/dist/key-value-database/KeyValueDatabaseTableConnector.d.ts +56 -0
- package/dist/key-value-database/KeyValueDatabaseTableConnector.js +1 -0
- package/dist/key-value-database/LayoutBuilder.d.ts +18 -0
- package/dist/key-value-database/LayoutBuilder.js +1 -0
- package/dist/key-value-database/QueryBuilder.d.ts +54 -0
- package/dist/key-value-database/QueryBuilder.js +1 -0
- package/dist/key-value-database/SupportedIndexType.d.ts +5 -0
- package/dist/key-value-database/SupportedIndexType.js +1 -0
- package/dist/key-value-database/TableBuilder.d.ts +12 -0
- package/dist/key-value-database/TableBuilder.js +1 -0
- package/dist/key-value-database/ValueType.d.ts +11 -0
- package/dist/key-value-database/ValueType.js +1 -0
- package/dist/key-value-database/ValueTypeOmitId.d.ts +6 -0
- package/dist/key-value-database/ValueTypeOmitId.js +1 -0
- package/dist/key-value-database/index.d.ts +21 -0
- package/dist/key-value-database/index.js +1 -0
- package/dist/media-stream/AudioSubscriptionParams.d.ts +5 -0
- package/dist/media-stream/AudioSubscriptionParams.js +1 -0
- package/dist/media-stream/DynamicMediaStream.d.ts +12 -0
- package/dist/media-stream/DynamicMediaStream.js +1 -0
- package/dist/media-stream/LocalDynamicMediaStream.d.ts +23 -0
- package/dist/media-stream/LocalDynamicMediaStream.js +1 -0
- package/dist/media-stream/LocalMediaStream.d.ts +16 -0
- package/dist/media-stream/LocalMediaStream.js +1 -0
- package/dist/media-stream/MediaStream.d.ts +17 -0
- package/dist/media-stream/MediaStream.js +1 -0
- package/dist/media-stream/MediaStreamPriority.d.ts +18 -0
- package/dist/media-stream/MediaStreamPriority.js +19 -0
- package/dist/media-stream/MediaStreamSource.d.ts +5 -0
- package/dist/media-stream/MediaStreamSource.js +1 -0
- package/dist/media-stream/MediaStreamTransformer.d.ts +7 -0
- package/dist/media-stream/MediaStreamTransformer.js +1 -0
- package/dist/media-stream/MediaSubscriptionParams.d.ts +15 -0
- package/dist/media-stream/MediaSubscriptionParams.js +1 -0
- package/dist/media-stream/MediaTrackKind.d.ts +5 -0
- package/dist/media-stream/MediaTrackKind.js +1 -0
- package/dist/media-stream/RemoteMediaStream.d.ts +40 -0
- package/dist/media-stream/RemoteMediaStream.js +1 -0
- package/dist/media-stream/Resolution.d.ts +14 -0
- package/dist/media-stream/Resolution.js +1 -0
- package/dist/media-stream/TrackSubscriptionParams.d.ts +6 -0
- package/dist/media-stream/TrackSubscriptionParams.js +1 -0
- package/dist/media-stream/VideoSubscriptionParams.d.ts +15 -0
- package/dist/media-stream/VideoSubscriptionParams.js +1 -0
- package/dist/media-stream/index.d.ts +15 -0
- package/dist/media-stream/index.js +2 -0
- package/dist/media-stream/isValidMediaSubscriptionParams.d.ts +8 -0
- package/dist/media-stream/isValidMediaSubscriptionParams.js +28 -0
- package/dist/object-storage/FileDescriptor.d.ts +31 -0
- package/dist/object-storage/FileDescriptor.js +1 -0
- package/dist/object-storage/FilePayload.d.ts +19 -0
- package/dist/object-storage/FilePayload.js +1 -0
- package/dist/object-storage/FolderDescriptor.d.ts +27 -0
- package/dist/object-storage/FolderDescriptor.js +1 -0
- package/dist/object-storage/FolderPayload.d.ts +15 -0
- package/dist/object-storage/FolderPayload.js +1 -0
- package/dist/object-storage/MovePayload.d.ts +19 -0
- package/dist/object-storage/MovePayload.js +1 -0
- package/dist/object-storage/ObjectDescriptor.d.ts +6 -0
- package/dist/object-storage/ObjectDescriptor.js +1 -0
- package/dist/object-storage/ObjectKind.d.ts +14 -0
- package/dist/object-storage/ObjectKind.js +15 -0
- package/dist/object-storage/ObjectStoreBucket.d.ts +55 -0
- package/dist/object-storage/ObjectStoreBucket.js +1 -0
- package/dist/object-storage/ObjectStoreConnector.d.ts +49 -0
- package/dist/object-storage/ObjectStoreConnector.js +1 -0
- package/dist/object-storage/ObjectStoreConnectorConstructor.d.ts +6 -0
- package/dist/object-storage/ObjectStoreConnectorConstructor.js +1 -0
- package/dist/object-storage/Payload.d.ts +6 -0
- package/dist/object-storage/Payload.js +1 -0
- package/dist/object-storage/PayloadAction.d.ts +18 -0
- package/dist/object-storage/PayloadAction.js +19 -0
- package/dist/object-storage/event/FileDeleteEvent.d.ts +15 -0
- package/dist/object-storage/event/FileDeleteEvent.js +1 -0
- package/dist/object-storage/event/FileMoveEvent.d.ts +15 -0
- package/dist/object-storage/event/FileMoveEvent.js +1 -0
- package/dist/object-storage/event/FileWriteEvent.d.ts +15 -0
- package/dist/object-storage/event/FileWriteEvent.js +1 -0
- package/dist/object-storage/event/FileWriteEventPayload.d.ts +11 -0
- package/dist/object-storage/event/FileWriteEventPayload.js +1 -0
- package/dist/object-storage/event/FolderCreateEvent.d.ts +15 -0
- package/dist/object-storage/event/FolderCreateEvent.js +1 -0
- package/dist/object-storage/event/FolderCreateEventPayload.d.ts +11 -0
- package/dist/object-storage/event/FolderCreateEventPayload.js +1 -0
- package/dist/object-storage/event/FolderDeleteEvent.d.ts +15 -0
- package/dist/object-storage/event/FolderDeleteEvent.js +1 -0
- package/dist/object-storage/event/FolderMoveEvent.d.ts +15 -0
- package/dist/object-storage/event/FolderMoveEvent.js +1 -0
- package/dist/object-storage/event/ObjectDeleteEventPayload.d.ts +18 -0
- package/dist/object-storage/event/ObjectDeleteEventPayload.js +1 -0
- package/dist/object-storage/event/ObjectMoveEventPayload.d.ts +30 -0
- package/dist/object-storage/event/ObjectMoveEventPayload.js +1 -0
- package/dist/object-storage/event/StorageEvent.d.ts +6 -0
- package/dist/object-storage/event/StorageEvent.js +1 -0
- package/dist/object-storage/event/StorageEventType.d.ts +30 -0
- package/dist/object-storage/event/StorageEventType.js +31 -0
- package/dist/object-storage/event/index.d.ts +12 -0
- package/dist/object-storage/event/index.js +1 -0
- package/dist/object-storage/index.d.ts +13 -0
- package/dist/object-storage/index.js +3 -0
- package/dist/pubsub/PubSubTopic.d.ts +37 -0
- package/dist/pubsub/PubSubTopic.js +1 -0
- package/dist/pubsub/SubscribeFunction.d.ts +14 -0
- package/dist/pubsub/SubscribeFunction.js +1 -0
- package/dist/pubsub/SubscriptionKeys.d.ts +6 -0
- package/dist/pubsub/SubscriptionKeys.js +1 -0
- package/dist/pubsub/Subscriptions.d.ts +18 -0
- package/dist/pubsub/Subscriptions.js +1 -0
- package/dist/pubsub/index.d.ts +4 -0
- package/dist/pubsub/index.js +1 -0
- package/package.json +26 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LoggingConnectorEvent } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The logging connector interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface ILoggingConnector {
|
|
7
|
+
/**
|
|
8
|
+
* Logs a message with the specified data. Used to connect a custom logging system to log events from the SDK.
|
|
9
|
+
* @param message The message to log.
|
|
10
|
+
* @param event The event to log.
|
|
11
|
+
*/
|
|
12
|
+
log(message: string, event: LoggingConnectorEvent): void;
|
|
13
|
+
/**
|
|
14
|
+
* Logs a warning with the specified data. Used to connect a custom logging system to log events from the SDK.
|
|
15
|
+
* @param message The message to log.
|
|
16
|
+
* @param event The event to log.
|
|
17
|
+
*/
|
|
18
|
+
warn(message: string, event: LoggingConnectorEvent): void;
|
|
19
|
+
/**
|
|
20
|
+
* Logs an error with the specified data. Used to connect a custom logging system to log events from the SDK.
|
|
21
|
+
* @param message The message to log.
|
|
22
|
+
* @param event The event to log.
|
|
23
|
+
*/
|
|
24
|
+
error(message: string, event: LoggingConnectorEvent): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ICluster } from '../cluster';
|
|
2
|
+
import { IAgentCredentials, IAuthAgent } from '../node/agent';
|
|
3
|
+
import { IAuthUser, IUserCredentials } from '../node/user';
|
|
4
|
+
/**
|
|
5
|
+
* The SDK interface.
|
|
6
|
+
* @category Core
|
|
7
|
+
*/
|
|
8
|
+
export interface ISDK {
|
|
9
|
+
/**
|
|
10
|
+
* Authenticate a user.
|
|
11
|
+
* @param credentials The credentials to authenticate the user with.
|
|
12
|
+
* @returns A promise that resolves with the authenticated user.
|
|
13
|
+
*/
|
|
14
|
+
authenticateUser(credentials: IUserCredentials): Promise<IAuthUser>;
|
|
15
|
+
/**
|
|
16
|
+
* Authenticate an agent.
|
|
17
|
+
* @param agentGroupId The ID of the agent group to authenticate the agent with.
|
|
18
|
+
* @returns A promise that resolves with the authenticated agent.
|
|
19
|
+
*/
|
|
20
|
+
authenticateAgent(credentials: IAgentCredentials): Promise<IAuthAgent>;
|
|
21
|
+
/**
|
|
22
|
+
* Join a cluster.
|
|
23
|
+
* @param clusterId The ID of the cluster to join.
|
|
24
|
+
* @returns A promise that resolves with the cluster.
|
|
25
|
+
* @throws {@link SDKClientErrorCodes.NodeNotAuthenticated} if the node is not authenticated.
|
|
26
|
+
*/
|
|
27
|
+
joinCluster(clusterId: string): Promise<ICluster>;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { KeyValueDatabaseConnectorConstructor } from 'key-value-database';
|
|
2
|
+
import { ILoggingConnector } from '.';
|
|
3
|
+
import { ObjectStoreConnectorConstructor } from 'object-storage';
|
|
4
|
+
import { PeerConnectionConnectorConstructor } from '../connection';
|
|
5
|
+
/**
|
|
6
|
+
* Options to configure the SDK.
|
|
7
|
+
* @category Core
|
|
8
|
+
*/
|
|
9
|
+
export interface ISDKOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The audio context to use for audio processing.
|
|
12
|
+
*/
|
|
13
|
+
audioContext?: AudioContext;
|
|
14
|
+
/**
|
|
15
|
+
* The flag to disable the interval hack that ensures the intervals run at the correct time.
|
|
16
|
+
*/
|
|
17
|
+
disableIntervalHack?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The custom logging connector to use for logging events.
|
|
20
|
+
*/
|
|
21
|
+
loggingConnectors?: ILoggingConnector[];
|
|
22
|
+
/**
|
|
23
|
+
* The custom object store connector to use for storing objects.
|
|
24
|
+
* If not provided, the default object store connector is OPFS.
|
|
25
|
+
*/
|
|
26
|
+
objectStoreConnector?: ObjectStoreConnectorConstructor;
|
|
27
|
+
/**
|
|
28
|
+
* The custom key-value database connector to use for storing key-value pairs.
|
|
29
|
+
* If not provided, the default key-value database connector is IndexedDB.
|
|
30
|
+
*/
|
|
31
|
+
keyValueDatabaseConnector?: KeyValueDatabaseConnectorConstructor;
|
|
32
|
+
/**
|
|
33
|
+
* The custom peer connection connector to use for creating peer connections.
|
|
34
|
+
* If not provided, the default peer connection connector is WebRTC in browser.
|
|
35
|
+
*/
|
|
36
|
+
peerConnectionConnector?: PeerConnectionConnectorConstructor;
|
|
37
|
+
/**
|
|
38
|
+
* The maximum number of outgoing subscriptions.
|
|
39
|
+
*/
|
|
40
|
+
maxOutgoingSubscriptions?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The minimum number of initial connections.
|
|
43
|
+
*/
|
|
44
|
+
minConnections?: number;
|
|
45
|
+
/**
|
|
46
|
+
* The maximum number of connections a node can have.
|
|
47
|
+
*/
|
|
48
|
+
maxConnections?: number;
|
|
49
|
+
/**
|
|
50
|
+
* The maximum distance allowed between two nodes in the network.
|
|
51
|
+
*/
|
|
52
|
+
maxDistance?: number;
|
|
53
|
+
/**
|
|
54
|
+
* The maximum frame rate to use for video.
|
|
55
|
+
*/
|
|
56
|
+
maxFps?: number;
|
|
57
|
+
/**
|
|
58
|
+
* The maximum bits per pixel to use for video.
|
|
59
|
+
*/
|
|
60
|
+
maxBpp?: number;
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of content of a stream.
|
|
3
|
+
* @category Core
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ContentType {
|
|
6
|
+
/**
|
|
7
|
+
* The content is data.
|
|
8
|
+
*/
|
|
9
|
+
Data = "data",
|
|
10
|
+
/**
|
|
11
|
+
* The content is media.
|
|
12
|
+
*/
|
|
13
|
+
Media = "media",
|
|
14
|
+
/**
|
|
15
|
+
* The content is a file.
|
|
16
|
+
*/
|
|
17
|
+
File = "file",
|
|
18
|
+
/**
|
|
19
|
+
* @ignore
|
|
20
|
+
*/
|
|
21
|
+
PubSub = "pubsub",
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
ObjectStore = "objectstore",
|
|
26
|
+
/**
|
|
27
|
+
* @ignore
|
|
28
|
+
*/
|
|
29
|
+
KeyValueDatabase = "keyvaluedatabase"
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of content of a stream.
|
|
3
|
+
* @category Core
|
|
4
|
+
*/
|
|
5
|
+
export var ContentType;
|
|
6
|
+
(function (ContentType) {
|
|
7
|
+
/**
|
|
8
|
+
* The content is data.
|
|
9
|
+
*/
|
|
10
|
+
ContentType["Data"] = "data";
|
|
11
|
+
/**
|
|
12
|
+
* The content is media.
|
|
13
|
+
*/
|
|
14
|
+
ContentType["Media"] = "media";
|
|
15
|
+
/**
|
|
16
|
+
* The content is a file.
|
|
17
|
+
*/
|
|
18
|
+
ContentType["File"] = "file";
|
|
19
|
+
// TODO - move this to an internal type
|
|
20
|
+
/**
|
|
21
|
+
* @ignore
|
|
22
|
+
*/
|
|
23
|
+
ContentType["PubSub"] = "pubsub";
|
|
24
|
+
/**
|
|
25
|
+
* @ignore
|
|
26
|
+
*/
|
|
27
|
+
ContentType["ObjectStore"] = "objectstore";
|
|
28
|
+
/**
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
ContentType["KeyValueDatabase"] = "keyvaluedatabase";
|
|
32
|
+
})(ContentType || (ContentType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ContentType } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The stream interface.
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
6
|
+
export interface IStream {
|
|
7
|
+
/**
|
|
8
|
+
* Get the owner ID of the stream.
|
|
9
|
+
* @returns The owner ID of the stream.
|
|
10
|
+
*/
|
|
11
|
+
getOwnerId(): string;
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* Get the content type of the stream.
|
|
15
|
+
* @returns The content type of the stream.
|
|
16
|
+
*/
|
|
17
|
+
getContentType(): ContentType;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContentType } from './ContentType';
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The supported key-value database events.
|
|
3
|
+
* @category Key-Value Database
|
|
4
|
+
*/
|
|
5
|
+
export declare enum DatabaseEvent {
|
|
6
|
+
/**
|
|
7
|
+
* The database synchronization is complete.
|
|
8
|
+
*/
|
|
9
|
+
SyncComplete = "sync-complete"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Interface for key-value database events.
|
|
13
|
+
* @category Key-Value Database
|
|
14
|
+
*/
|
|
15
|
+
export interface IDatabaseEvent {
|
|
16
|
+
/**
|
|
17
|
+
* The event type.
|
|
18
|
+
*/
|
|
19
|
+
event: DatabaseEvent;
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The supported key-value database events.
|
|
3
|
+
* @category Key-Value Database
|
|
4
|
+
*/
|
|
5
|
+
export var DatabaseEvent;
|
|
6
|
+
(function (DatabaseEvent) {
|
|
7
|
+
/**
|
|
8
|
+
* The database synchronization is complete.
|
|
9
|
+
*/
|
|
10
|
+
DatabaseEvent["SyncComplete"] = "sync-complete";
|
|
11
|
+
})(DatabaseEvent || (DatabaseEvent = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IDatabaseTableLayout } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a key-value database layout.
|
|
4
|
+
* Example:
|
|
5
|
+
* {
|
|
6
|
+
* 'table1': {
|
|
7
|
+
* indexes: [
|
|
8
|
+
* { keyPath: 'key1' },
|
|
9
|
+
* { keyPath: 'key2' },
|
|
10
|
+
* ],
|
|
11
|
+
* },
|
|
12
|
+
* }
|
|
13
|
+
* @category Key-Value Database
|
|
14
|
+
*/
|
|
15
|
+
export interface IDatabaseLayout {
|
|
16
|
+
/**
|
|
17
|
+
* The tables in the database.
|
|
18
|
+
* The primary key of each table is automatically generated by the database.
|
|
19
|
+
*/
|
|
20
|
+
tables: {
|
|
21
|
+
[tableName: string]: IDatabaseTableLayout;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The version of the layout.
|
|
25
|
+
*/
|
|
26
|
+
version: number;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { IDatabaseTableQuery, ValueTypeOmitId, IValueType, IDatabaseTableEvent, IQueryBuilder } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a key-value database table.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export interface IDatabaseTable<T extends IValueType> {
|
|
7
|
+
/**
|
|
8
|
+
* Get the value for a key.
|
|
9
|
+
* @param key The key to get the value for.
|
|
10
|
+
* @returns A promise that resolves with the value for the key.
|
|
11
|
+
*/
|
|
12
|
+
get(key: string): Promise<T | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Set the value for a key.
|
|
15
|
+
* @param key The key to set the value for.
|
|
16
|
+
* @param value The value to set for the key. It must be {@link https://html.spec.whatwg.org/multipage/structured-data.html#serializable-objects | serializable }.
|
|
17
|
+
* @returns A promise that resolves with the value set.
|
|
18
|
+
*/
|
|
19
|
+
set(key: string, value: ValueTypeOmitId<T>): Promise<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Add a value to the database.
|
|
22
|
+
* @param value The value to add.
|
|
23
|
+
* @returns A promise that resolves with the value added.
|
|
24
|
+
*/
|
|
25
|
+
add(value: ValueTypeOmitId<T>): Promise<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Delete a key.
|
|
28
|
+
* @param key The key to delete.
|
|
29
|
+
* @returns A promise that resolves when the key has been deleted.
|
|
30
|
+
*/
|
|
31
|
+
delete(key: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Clear the database.
|
|
34
|
+
* @returns A promise that resolves when the database has been cleared.
|
|
35
|
+
*/
|
|
36
|
+
clear(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get all the values in the database.
|
|
39
|
+
* @param query The query to use to filter the values.
|
|
40
|
+
* If no query is provided, all the values in the database are returned.
|
|
41
|
+
* The query can either be a {@link IDatabaseTableQuery} or a {@link QueryBuilder}.
|
|
42
|
+
* @returns A promise that resolves with all the values in the database.
|
|
43
|
+
*/
|
|
44
|
+
list(query?: IDatabaseTableQuery | IQueryBuilder): Promise<T[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Count the number of keys in the database.
|
|
47
|
+
* @param query The query to use to filter the keys.
|
|
48
|
+
* If no query is provided, all the keys in the database are counted.
|
|
49
|
+
* The query can either be a {@link IDatabaseTableQuery} or a {@link QueryBuilder}.
|
|
50
|
+
* @returns A promise that resolves with the number of keys in the database.
|
|
51
|
+
*/
|
|
52
|
+
count(query?: IDatabaseTableQuery | IQueryBuilder): Promise<number>;
|
|
53
|
+
/**
|
|
54
|
+
* Subscribe to changes in the database table.
|
|
55
|
+
* @params callback The callback to call when the database table changes.
|
|
56
|
+
*/
|
|
57
|
+
subscribe(callback: (event: IDatabaseTableEvent<T>) => void): void;
|
|
58
|
+
/**
|
|
59
|
+
* Unsubscribe from changes in the database table.
|
|
60
|
+
*/
|
|
61
|
+
unsubscribe(): void;
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IDatabaseTableAction, IValueType } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for key-value database table events.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export interface IDatabaseTableEvent<T extends IValueType> {
|
|
7
|
+
/**
|
|
8
|
+
* The action performed on the table.
|
|
9
|
+
*/
|
|
10
|
+
action: IDatabaseTableAction;
|
|
11
|
+
/**
|
|
12
|
+
* The value of the object.
|
|
13
|
+
*/
|
|
14
|
+
value: T;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDatabaseTableIndex } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a key-value database table layout.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export interface IDatabaseTableLayout {
|
|
7
|
+
/**
|
|
8
|
+
* The secondary indexes for the table.
|
|
9
|
+
*/
|
|
10
|
+
indexes?: IDatabaseTableIndex[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IDatabaseTableQueryWhereBetween, IDatabaseTableQueryWhereValue, IDatabaseTableQueryWhereValues } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a key-value database table query.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export interface IDatabaseTableQuery {
|
|
7
|
+
/**
|
|
8
|
+
* The where clause for the query.
|
|
9
|
+
*/
|
|
10
|
+
where?: IDatabaseTableQueryWhereValue | IDatabaseTableQueryWhereValues | IDatabaseTableQueryWhereBetween;
|
|
11
|
+
/**
|
|
12
|
+
* The order by clause for the query.
|
|
13
|
+
* The key must be a valid indexed key path for the table and match the where clause key, if provided.
|
|
14
|
+
*/
|
|
15
|
+
orderBy?: {
|
|
16
|
+
key: string;
|
|
17
|
+
direction: 'asc' | 'desc';
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The limit for the query, allowing pagination.
|
|
21
|
+
*/
|
|
22
|
+
limit?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The offset for the query, allowing pagination.
|
|
25
|
+
*/
|
|
26
|
+
offset?: number;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SupportedIndexType } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a where values are 'between' the lower and upper bounds.
|
|
4
|
+
* Between is always inclusive.
|
|
5
|
+
* @category Key-Value Database
|
|
6
|
+
*/
|
|
7
|
+
export interface IDatabaseTableQueryWhereBetween {
|
|
8
|
+
/**
|
|
9
|
+
* The key must be a valid indexed key path for the table.
|
|
10
|
+
*/
|
|
11
|
+
key: string;
|
|
12
|
+
/**
|
|
13
|
+
* The operator must be 'between'.
|
|
14
|
+
*/
|
|
15
|
+
operator: 'between';
|
|
16
|
+
/**
|
|
17
|
+
* The value must be an array of two elements. The first element is the lower bound and the second element is the upper bound.
|
|
18
|
+
*/
|
|
19
|
+
value: [SupportedIndexType, SupportedIndexType];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SupportedIndexType } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a where clause with basic operators and a single value.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export interface IDatabaseTableQueryWhereValue {
|
|
7
|
+
/**
|
|
8
|
+
* The key must be a valid indexed key path for the table.
|
|
9
|
+
*/
|
|
10
|
+
key: string;
|
|
11
|
+
/**
|
|
12
|
+
* The operator must be a valid operator for the key type.
|
|
13
|
+
*/
|
|
14
|
+
operator: '==' | '!=' | '>' | '<' | '<=' | '>=';
|
|
15
|
+
/**
|
|
16
|
+
* The value must be a single valid value for the key type.
|
|
17
|
+
*/
|
|
18
|
+
value: SupportedIndexType;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SupportedIndexType } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a where values are 'in' or 'not-in' the given values.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export interface IDatabaseTableQueryWhereValues {
|
|
7
|
+
/**
|
|
8
|
+
* The key must be a valid indexed key path for the table.
|
|
9
|
+
*/
|
|
10
|
+
key: string;
|
|
11
|
+
/**
|
|
12
|
+
* The operator must be 'in' or 'not-in'.
|
|
13
|
+
*/
|
|
14
|
+
operator: 'in' | 'not-in';
|
|
15
|
+
/**
|
|
16
|
+
* The value must be an array of values.
|
|
17
|
+
*/
|
|
18
|
+
value: SupportedIndexType[];
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IDataStream } from '../core/stream';
|
|
2
|
+
import { IDatabaseEvent, IDatabaseTable, IValueType } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for a key-value database.
|
|
5
|
+
* @category Key-Value Database
|
|
6
|
+
*/
|
|
7
|
+
export interface IKeyValueDatabase extends IDataStream {
|
|
8
|
+
/**
|
|
9
|
+
* Get the name of the database.
|
|
10
|
+
*/
|
|
11
|
+
getName(): string;
|
|
12
|
+
/**
|
|
13
|
+
* Get the owner ID of the database.
|
|
14
|
+
*/
|
|
15
|
+
getOwnerId(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Close the database.
|
|
18
|
+
*/
|
|
19
|
+
close(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Gets the table with the given name.
|
|
22
|
+
* @param tableName The name of the table to get.
|
|
23
|
+
* @returns The table.
|
|
24
|
+
*/
|
|
25
|
+
getTable<T extends IValueType>(tableName: string): IDatabaseTable<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Subscribe to datase events.
|
|
28
|
+
* @param callback The callback to call when a database event is published.
|
|
29
|
+
*/
|
|
30
|
+
subscribe(callback: (event: IDatabaseEvent) => void): void;
|
|
31
|
+
/**
|
|
32
|
+
* Unsubscribe from database events.
|
|
33
|
+
*/
|
|
34
|
+
unsubscribe(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IValueType, IKeyValueDatabaseTableConnector } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The key-value database connector interface.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export interface IKeyValueDatabaseConnector {
|
|
7
|
+
/**
|
|
8
|
+
* Open the database and run a migration on it if necessary.
|
|
9
|
+
*/
|
|
10
|
+
open(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Close the database.
|
|
13
|
+
*/
|
|
14
|
+
close(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a table exists in the database.
|
|
17
|
+
* @returns True if the table exists, false otherwise.
|
|
18
|
+
*/
|
|
19
|
+
hasTable(tableName: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Create a table in the database.
|
|
22
|
+
* @param tableName The name of the table to create.
|
|
23
|
+
*/
|
|
24
|
+
createTable(tableName: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the table connector for a table in the database.
|
|
27
|
+
* @param tableName The name of the table to get the connector for.
|
|
28
|
+
*/
|
|
29
|
+
getTableConnector<T extends IValueType>(tableName: string): IKeyValueDatabaseTableConnector<T>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IDatabaseLayout, IKeyValueDatabaseConnector } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The key-value database connector constructor type.
|
|
4
|
+
* @category Key-Value Database
|
|
5
|
+
*/
|
|
6
|
+
export type KeyValueDatabaseConnectorConstructor = new (dbKey: string, layout: IDatabaseLayout) => IKeyValueDatabaseConnector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|