@crewdle/web-sdk-types 1.0.5 → 1.0.7

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.
@@ -0,0 +1,18 @@
1
+ export interface IAgentCapacity {
2
+ cpu: {
3
+ cores: number;
4
+ load: number;
5
+ };
6
+ gpu: {
7
+ cores: number;
8
+ load: number;
9
+ };
10
+ memory: {
11
+ total: number;
12
+ available: number;
13
+ };
14
+ storage: {
15
+ total: number;
16
+ available: number;
17
+ };
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  export { IAgent } from './Agent';
2
+ export { IAgentCapacity } from './AgentCapacity';
2
3
  export { IAgentCredentials } from './AgentCredentials';
3
4
  export { IAgentMetadata } from './AgentMetadata';
4
5
  export { IAuthAgent } from './AuthAgent';
@@ -1,5 +1,5 @@
1
1
  import { ICluster } from '../cluster';
2
- import { IAgentCredentials, IAuthAgent } from '../node/agent';
2
+ import { IAgentCredentials, IAuthAgent, IAgentCapacity } from '../node/agent';
3
3
  import { IAuthUser, IUserCredentials } from '../node/user';
4
4
  /**
5
5
  * The SDK interface.
@@ -19,9 +19,10 @@ 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.
22
23
  * @returns A promise that resolves with the authenticated agent.
23
24
  */
24
- authenticateAgent(credentials: IAgentCredentials): Promise<IAuthAgent>;
25
+ authenticateAgent(credentials: IAgentCredentials, reportCapacity?: () => Promise<IAgentCapacity>): Promise<IAuthAgent>;
25
26
  /**
26
27
  * Join a cluster.
27
28
  * @param clusterId The ID of the cluster to join.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewdle/web-sdk-types",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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",