@crewdle/web-sdk-types 1.0.8 → 1.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.
@@ -1,19 +1,65 @@
1
+ /**
2
+ * The agent capacity interface used for reporting the agent's capacity.
3
+ */
1
4
  export interface IAgentCapacity {
5
+ /**
6
+ * The agent version.
7
+ */
8
+ version: string;
9
+ /**
10
+ * The agent's MAC address.
11
+ */
2
12
  macAddress: string;
13
+ /**
14
+ * The agent's CPU capacity.
15
+ */
3
16
  cpu: {
17
+ /**
18
+ * The number of CPU cores.
19
+ */
4
20
  cores: number;
21
+ /**
22
+ * The current CPU load.
23
+ */
5
24
  load: number;
6
25
  };
26
+ /**
27
+ * The agent's GPU capacity.
28
+ */
7
29
  gpu: {
30
+ /**
31
+ * The number of GPU cores.
32
+ */
8
33
  cores: number;
34
+ /**
35
+ * The current GPU load.
36
+ */
9
37
  load: number;
10
38
  };
39
+ /**
40
+ * The agent's memory capacity.
41
+ */
11
42
  memory: {
43
+ /**
44
+ * The total memory available.
45
+ */
12
46
  total: number;
47
+ /**
48
+ * The available memory.
49
+ */
13
50
  available: number;
14
51
  };
52
+ /**
53
+ * The agent's storage capacity.
54
+ */
15
55
  storage: {
56
+ /**
57
+ * The total storage available.
58
+ */
16
59
  total: number;
60
+ /**
61
+ * The available storage.
62
+ */
17
63
  available: number;
18
64
  };
19
65
  }
@@ -1,4 +1,6 @@
1
+ import { IAgentCapacity } from '.';
1
2
  import { IAuthNode, NodeType } from '..';
3
+ import { Unsubscribe } from '../..';
2
4
  /**
3
5
  * The authenticated agent interface.
4
6
  * @category Core
@@ -8,4 +10,16 @@ export interface IAuthAgent extends IAuthNode {
8
10
  * The type of the node.
9
11
  */
10
12
  type: NodeType.Agent;
13
+ /**
14
+ * Subscribe to when the agent configuration changes.
15
+ * @param callback The callback to invoke when the agent configuration changes.
16
+ * @returns The unsubscribe function.
17
+ */
18
+ onConfigurationChange(callback: () => Promise<void>): Unsubscribe;
19
+ /**
20
+ * Set the report capacity callback.
21
+ * @param reportCapacity The report capacity callback.
22
+ * @returns The unsubscribe function.
23
+ */
24
+ setReportCapacity(reportCapacity: () => Promise<IAgentCapacity>): Unsubscribe;
11
25
  }
@@ -1,5 +1,5 @@
1
1
  import { ICluster } from '../cluster';
2
- import { IAgentCredentials, IAuthAgent, IAgentCapacity } from '../node/agent';
2
+ import { IAgentCredentials, IAuthAgent } from '../node/agent';
3
3
  import { IAuthUser, IUserCredentials } from '../node/user';
4
4
  /**
5
5
  * The SDK interface.
@@ -19,10 +19,9 @@ export interface ISDK {
19
19
  /**
20
20
  * Authenticate an agent.
21
21
  * @param credentials The credentials to authenticate the agent with.
22
- * @param reportCapacity A callback to report the agent capacity.
23
22
  * @returns A promise that resolves with the authenticated agent.
24
23
  */
25
- authenticateAgent(credentials: IAgentCredentials, reportCapacity?: () => Promise<IAgentCapacity>): Promise<IAuthAgent>;
24
+ authenticateAgent(credentials: IAgentCredentials): Promise<IAuthAgent>;
26
25
  /**
27
26
  * Join a cluster.
28
27
  * @param clusterId The ID of the cluster to join.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The unsubscribe callback.
3
+ * @category Core
4
+ */
5
+ export type Unsubscribe = () => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -2,3 +2,4 @@ export { ILoggingConnector } from './LoggingConnector';
2
2
  export { LoggingConnectorEvent } from './LoggingConnectorEvent';
3
3
  export { ISDK } from './SDK';
4
4
  export { ISDKOptions } from './SDKOptions';
5
+ export { Unsubscribe } from './Unsubscribe';
@@ -1,9 +1,5 @@
1
+ import { Unsubscribe } from '../core';
1
2
  import { IMediaStream, MediaTrackKind, MediaSubscriptionParams } from '.';
2
- /**
3
- * The unsubscribe callback.
4
- * @category Media Stream
5
- */
6
- export type Unsubscribe = () => void;
7
3
  /**
8
4
  * The remote media stream interface.
9
5
  * @category Media Stream
@@ -36,5 +32,5 @@ export interface IRemoteMediaStream extends IMediaStream {
36
32
  * Subscribe to when the provider of the stream changes.
37
33
  * @param callback The callback to invoke when the provider changes.
38
34
  */
39
- onProviderChanged(callback: (providerId: string | undefined) => void): Unsubscribe;
35
+ onProviderChange(callback: (providerId: string | undefined) => void): Unsubscribe;
40
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewdle/web-sdk-types",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "The Crewdle Mist Web SDK public types and interfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",