@meshagent/meshagent 0.5.19 → 0.6.1
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/CHANGELOG.md +6 -0
- package/dist/browser/agent-client.d.ts +15 -7
- package/dist/browser/agent-client.js +52 -14
- package/dist/browser/api_keys.d.ts +13 -0
- package/dist/browser/api_keys.js +185 -0
- package/dist/browser/data-types.d.ts +6 -0
- package/dist/browser/data-types.js +20 -1
- package/dist/browser/entrypoint.d.ts +1423 -1464
- package/dist/browser/helpers.d.ts +9 -7
- package/dist/browser/helpers.js +18 -5
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/lk-client.d.ts +18 -0
- package/dist/browser/lk-client.js +24 -0
- package/dist/browser/lk-protocol.d.ts +22 -0
- package/dist/browser/lk-protocol.js +37 -0
- package/dist/browser/meshagent-client.d.ts +392 -0
- package/dist/browser/meshagent-client.js +1051 -0
- package/dist/browser/participant-token.d.ts +179 -7
- package/dist/browser/participant-token.js +373 -21
- package/dist/browser/stream-controller.js +3 -14
- package/dist/esm/agent-client.d.ts +15 -7
- package/dist/esm/agent-client.js +52 -14
- package/dist/esm/api_keys.d.ts +13 -0
- package/dist/esm/api_keys.js +175 -0
- package/dist/esm/data-types.d.ts +6 -0
- package/dist/esm/data-types.js +18 -0
- package/dist/esm/entrypoint.d.ts +1423 -1464
- package/dist/esm/helpers.d.ts +9 -7
- package/dist/esm/helpers.js +19 -6
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/lk-client.d.ts +18 -0
- package/dist/esm/lk-client.js +19 -0
- package/dist/esm/lk-protocol.d.ts +22 -0
- package/dist/esm/lk-protocol.js +33 -0
- package/dist/esm/meshagent-client.d.ts +392 -0
- package/dist/esm/meshagent-client.js +1047 -0
- package/dist/esm/participant-token.d.ts +179 -7
- package/dist/esm/participant-token.js +357 -20
- package/dist/esm/stream-controller.js +3 -14
- package/dist/node/agent-client.d.ts +15 -7
- package/dist/node/agent-client.js +52 -14
- package/dist/node/api_keys.d.ts +13 -0
- package/dist/node/api_keys.js +185 -0
- package/dist/node/data-types.d.ts +6 -0
- package/dist/node/data-types.js +20 -1
- package/dist/node/entrypoint.d.ts +1423 -1464
- package/dist/node/helpers.d.ts +9 -7
- package/dist/node/helpers.js +18 -5
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.js +3 -0
- package/dist/node/lk-client.d.ts +18 -0
- package/dist/node/lk-client.js +24 -0
- package/dist/node/lk-protocol.d.ts +22 -0
- package/dist/node/lk-protocol.js +37 -0
- package/dist/node/meshagent-client.d.ts +392 -0
- package/dist/node/meshagent-client.js +1051 -0
- package/dist/node/participant-token.d.ts +179 -7
- package/dist/node/participant-token.js +373 -21
- package/dist/node/stream-controller.js +3 -14
- package/package.json +6 -3
package/dist/esm/helpers.d.ts
CHANGED
|
@@ -14,19 +14,21 @@ export declare function websocketRoomUrl({ roomName, apiUrl }: {
|
|
|
14
14
|
roomName: string;
|
|
15
15
|
apiUrl?: string;
|
|
16
16
|
}): string;
|
|
17
|
-
export declare function participantToken({ participantName, roomName, role, projectId, apiKeyId, }: {
|
|
17
|
+
export declare function participantToken({ participantName, roomName, role, projectId, apiKeyId, apiKey, }: {
|
|
18
18
|
participantName: string;
|
|
19
19
|
roomName: string;
|
|
20
20
|
role?: string;
|
|
21
|
-
projectId
|
|
22
|
-
apiKeyId
|
|
21
|
+
projectId?: string;
|
|
22
|
+
apiKeyId?: string;
|
|
23
|
+
apiKey?: string;
|
|
23
24
|
}): ParticipantToken;
|
|
24
|
-
export declare function websocketProtocol({ participantName, roomName, role, projectId, apiKeyId, secret, apiUrl }: {
|
|
25
|
+
export declare function websocketProtocol({ participantName, roomName, role, projectId, apiKeyId, apiKey, secret, apiUrl }: {
|
|
25
26
|
participantName: string;
|
|
26
27
|
roomName: string;
|
|
27
28
|
role?: string;
|
|
28
|
-
projectId
|
|
29
|
-
apiKeyId
|
|
30
|
-
secret
|
|
29
|
+
projectId?: string;
|
|
30
|
+
apiKeyId?: string;
|
|
31
|
+
secret?: string;
|
|
31
32
|
apiUrl?: string;
|
|
33
|
+
apiKey?: string;
|
|
32
34
|
}): Promise<WebSocketClientProtocol>;
|
package/dist/esm/helpers.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MeshSchemaValidationException } from './schema';
|
|
2
|
-
import { ParticipantToken } from './participant-token';
|
|
2
|
+
import { ParticipantToken, ApiScope } from './participant-token';
|
|
3
3
|
import { WebSocketClientProtocol } from './protocol';
|
|
4
|
+
import { parseApiKey } from './api_keys';
|
|
4
5
|
export function validateSchemaName(name) {
|
|
5
6
|
if (name.includes('.')) {
|
|
6
7
|
throw new MeshSchemaValidationException("schema name cannot contain '.'");
|
|
@@ -30,17 +31,29 @@ export function websocketRoomUrl({ roomName, apiUrl }) {
|
|
|
30
31
|
}
|
|
31
32
|
return `${url}/rooms/${roomName}`;
|
|
32
33
|
}
|
|
33
|
-
export function participantToken({ participantName, roomName, role, projectId, apiKeyId, }) {
|
|
34
|
-
|
|
34
|
+
export function participantToken({ participantName, roomName, role, projectId, apiKeyId, apiKey, }) {
|
|
35
|
+
let resolvedProjectId = projectId;
|
|
36
|
+
let resolvedApiKeyId = apiKeyId;
|
|
37
|
+
if (apiKey) {
|
|
38
|
+
const parsed = parseApiKey(apiKey);
|
|
39
|
+
resolvedProjectId ?? (resolvedProjectId = parsed.projectId);
|
|
40
|
+
resolvedApiKeyId ?? (resolvedApiKeyId = parsed.id);
|
|
41
|
+
}
|
|
42
|
+
const token = new ParticipantToken({
|
|
43
|
+
name: participantName,
|
|
44
|
+
projectId: resolvedProjectId,
|
|
45
|
+
apiKeyId: resolvedApiKeyId,
|
|
46
|
+
});
|
|
35
47
|
token.addRoomGrant(roomName);
|
|
36
48
|
if (role) {
|
|
37
49
|
token.addRoleGrant(role);
|
|
38
50
|
}
|
|
51
|
+
token.addApiGrant(ApiScope.agentDefault());
|
|
39
52
|
return token;
|
|
40
53
|
}
|
|
41
|
-
export async function websocketProtocol({ participantName, roomName, role, projectId, apiKeyId, secret, apiUrl }) {
|
|
54
|
+
export async function websocketProtocol({ participantName, roomName, role, projectId, apiKeyId, apiKey, secret, apiUrl }) {
|
|
42
55
|
const url = websocketRoomUrl({ roomName, apiUrl });
|
|
43
|
-
const token = participantToken({ participantName, roomName, role, projectId, apiKeyId });
|
|
44
|
-
const jwt = await token.toJwt({ token: secret });
|
|
56
|
+
const token = participantToken({ participantName, roomName, role, projectId, apiKeyId, apiKey });
|
|
57
|
+
const jwt = await token.toJwt({ token: secret, apiKey });
|
|
45
58
|
return new WebSocketClientProtocol({ url, token: jwt });
|
|
46
59
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './agent';
|
|
2
|
+
export * from './agent-client';
|
|
2
3
|
export * from './event-emitter';
|
|
3
4
|
export * from './client';
|
|
4
5
|
export * from './completer';
|
|
@@ -6,6 +7,7 @@ export * from './data-types';
|
|
|
6
7
|
export * from './database-client';
|
|
7
8
|
export * from './developer-client';
|
|
8
9
|
export * from './document';
|
|
10
|
+
export * from './meshagent-client';
|
|
9
11
|
export * from './messaging-client';
|
|
10
12
|
export * from './participant-token';
|
|
11
13
|
export * from './participant';
|
|
@@ -21,5 +23,6 @@ export * from './schema';
|
|
|
21
23
|
export * from './storage-client';
|
|
22
24
|
export * from './stream-controller';
|
|
23
25
|
export * from './sync-client';
|
|
26
|
+
export * from './api_keys';
|
|
24
27
|
export * from './helpers';
|
|
25
28
|
export * from './utils';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './agent';
|
|
2
|
+
export * from './agent-client';
|
|
2
3
|
export * from './event-emitter';
|
|
3
4
|
export * from './client';
|
|
4
5
|
export * from './completer';
|
|
@@ -6,6 +7,7 @@ export * from './data-types';
|
|
|
6
7
|
export * from './database-client';
|
|
7
8
|
export * from './developer-client';
|
|
8
9
|
export * from './document';
|
|
10
|
+
export * from './meshagent-client';
|
|
9
11
|
export * from './messaging-client';
|
|
10
12
|
export * from './participant-token';
|
|
11
13
|
export * from './participant';
|
|
@@ -21,5 +23,6 @@ export * from './schema';
|
|
|
21
23
|
export * from './storage-client';
|
|
22
24
|
export * from './stream-controller';
|
|
23
25
|
export * from './sync-client';
|
|
26
|
+
export * from './api_keys';
|
|
24
27
|
export * from './helpers';
|
|
25
28
|
export * from './utils';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RoomClient } from './room-client';
|
|
2
|
+
export declare class LivekitConnectionInfo {
|
|
3
|
+
url: string;
|
|
4
|
+
token: string;
|
|
5
|
+
constructor({ url, token }: {
|
|
6
|
+
url: string;
|
|
7
|
+
token: string;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export declare class LivekitClient {
|
|
11
|
+
room: RoomClient;
|
|
12
|
+
constructor({ room }: {
|
|
13
|
+
room: RoomClient;
|
|
14
|
+
});
|
|
15
|
+
getConnectionInfo({ breakoutRoom }: {
|
|
16
|
+
breakoutRoom?: string;
|
|
17
|
+
}): Promise<LivekitConnectionInfo>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class LivekitConnectionInfo {
|
|
2
|
+
constructor({ url, token }) {
|
|
3
|
+
this.url = url;
|
|
4
|
+
this.token = token;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class LivekitClient {
|
|
8
|
+
constructor({ room }) {
|
|
9
|
+
this.room = room;
|
|
10
|
+
}
|
|
11
|
+
async getConnectionInfo({ breakoutRoom }) {
|
|
12
|
+
const response = (await this.room.sendRequest('livekit.connect', { breakout_room: breakoutRoom }));
|
|
13
|
+
if (!response || !response.json) {
|
|
14
|
+
throw new Error('Failed to get connection info');
|
|
15
|
+
}
|
|
16
|
+
const { url, token } = response.json;
|
|
17
|
+
return new LivekitConnectionInfo({ url, token });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ProtocolChannel } from './protocol';
|
|
2
|
+
import type { Room, RemoteParticipant } from 'livekit-client';
|
|
3
|
+
export type DataHandler = (data: Uint8Array) => void;
|
|
4
|
+
export type StartOptions = {
|
|
5
|
+
onDone?: () => void;
|
|
6
|
+
onError?: (error: unknown) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare class LivekitProtocolChannel implements ProtocolChannel {
|
|
9
|
+
private room;
|
|
10
|
+
private remote;
|
|
11
|
+
private topic;
|
|
12
|
+
private onDataReceived?;
|
|
13
|
+
private boundOnData?;
|
|
14
|
+
constructor({ room, remote, topic }: {
|
|
15
|
+
room: Room;
|
|
16
|
+
remote: RemoteParticipant;
|
|
17
|
+
topic: string;
|
|
18
|
+
});
|
|
19
|
+
start(onDataReceived: (data: Uint8Array) => void, _opts?: StartOptions): void;
|
|
20
|
+
sendData(data: Uint8Array): Promise<void>;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RoomEvent } from 'livekit-client';
|
|
2
|
+
export class LivekitProtocolChannel {
|
|
3
|
+
constructor({ room, remote, topic }) {
|
|
4
|
+
this.room = room;
|
|
5
|
+
this.remote = remote;
|
|
6
|
+
this.topic = topic;
|
|
7
|
+
}
|
|
8
|
+
start(onDataReceived, _opts) {
|
|
9
|
+
this.onDataReceived = onDataReceived;
|
|
10
|
+
this.boundOnData = (payload, participant, ...rest) => {
|
|
11
|
+
const identityMatches = participant?.identity === this.remote.identity;
|
|
12
|
+
const topicArg = rest?.[rest.length - 1] ?? undefined;
|
|
13
|
+
if (topicArg === this.topic && identityMatches) {
|
|
14
|
+
this.onDataReceived?.(payload);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
this.room.on(RoomEvent.DataReceived, this.boundOnData);
|
|
18
|
+
}
|
|
19
|
+
async sendData(data) {
|
|
20
|
+
await this.room.localParticipant.publishData(data, {
|
|
21
|
+
reliable: true,
|
|
22
|
+
topic: this.topic,
|
|
23
|
+
destinationIdentities: [this.remote.identity],
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
dispose() {
|
|
27
|
+
if (this.boundOnData) {
|
|
28
|
+
this.room.off(RoomEvent.DataReceived, this.boundOnData);
|
|
29
|
+
}
|
|
30
|
+
this.boundOnData = undefined;
|
|
31
|
+
this.onDataReceived = undefined;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { ApiScope } from "./participant-token";
|
|
2
|
+
export type ProjectRole = "member" | "admin" | "developer";
|
|
3
|
+
export interface RoomShare {
|
|
4
|
+
id: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
settings: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export interface RoomShareConnectionInfo {
|
|
9
|
+
jwt: string;
|
|
10
|
+
roomName: string;
|
|
11
|
+
projectId: string;
|
|
12
|
+
settings: Record<string, unknown>;
|
|
13
|
+
roomUrl: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RoomConnectionInfo {
|
|
16
|
+
jwt: string;
|
|
17
|
+
roomName: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
roomUrl: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RoomSession {
|
|
22
|
+
id: string;
|
|
23
|
+
roomId?: string | null;
|
|
24
|
+
roomName: string;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
isActive: boolean;
|
|
27
|
+
participants?: Record<string, number>;
|
|
28
|
+
}
|
|
29
|
+
export interface RoomInfo {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
metadata: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export interface ProjectRoomGrant {
|
|
35
|
+
room: RoomInfo;
|
|
36
|
+
userId: string;
|
|
37
|
+
permissions: ApiScope;
|
|
38
|
+
}
|
|
39
|
+
export interface ProjectRoomGrantCount {
|
|
40
|
+
room: RoomInfo;
|
|
41
|
+
count: number;
|
|
42
|
+
}
|
|
43
|
+
export interface ProjectUserGrantCount {
|
|
44
|
+
userId: string;
|
|
45
|
+
count: number;
|
|
46
|
+
firstName?: string | null;
|
|
47
|
+
lastName?: string | null;
|
|
48
|
+
email: string;
|
|
49
|
+
}
|
|
50
|
+
export interface EnvironmentVariable {
|
|
51
|
+
name: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
54
|
+
export interface RoomStorageMountSpec {
|
|
55
|
+
path: string;
|
|
56
|
+
subpath?: string | null;
|
|
57
|
+
read_only?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface ProjectStorageMountSpec {
|
|
60
|
+
path: string;
|
|
61
|
+
subpath?: string | null;
|
|
62
|
+
read_only?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface ServiceStorageMountsSpec {
|
|
65
|
+
room?: RoomStorageMountSpec[];
|
|
66
|
+
project?: ProjectStorageMountSpec[];
|
|
67
|
+
}
|
|
68
|
+
export interface ServiceApiKeySpec {
|
|
69
|
+
role: "admin";
|
|
70
|
+
name: string;
|
|
71
|
+
auto_provision?: boolean | null;
|
|
72
|
+
}
|
|
73
|
+
export interface ServiceMetadata {
|
|
74
|
+
name: string;
|
|
75
|
+
description?: string | null;
|
|
76
|
+
repo?: string | null;
|
|
77
|
+
icon?: string | null;
|
|
78
|
+
annotations?: Record<string, string> | null;
|
|
79
|
+
}
|
|
80
|
+
export interface ContainerSpec {
|
|
81
|
+
command?: string | null;
|
|
82
|
+
image: string;
|
|
83
|
+
environment?: EnvironmentVariable[] | null;
|
|
84
|
+
secrets?: string[];
|
|
85
|
+
pull_secret?: string | null;
|
|
86
|
+
storage?: ServiceStorageMountsSpec;
|
|
87
|
+
api_key?: ServiceApiKeySpec;
|
|
88
|
+
}
|
|
89
|
+
export interface ExternalServiceSpec {
|
|
90
|
+
url: string;
|
|
91
|
+
}
|
|
92
|
+
export interface MeshagentEndpointSpec {
|
|
93
|
+
identity: string;
|
|
94
|
+
api?: ApiScope;
|
|
95
|
+
}
|
|
96
|
+
export interface AllowedMcpToolFilter {
|
|
97
|
+
tool_names?: string[] | null;
|
|
98
|
+
read_only?: boolean | null;
|
|
99
|
+
}
|
|
100
|
+
export interface OAuthClientConfig {
|
|
101
|
+
client_id: string;
|
|
102
|
+
client_secret?: string | null;
|
|
103
|
+
authorization_endpoint: string;
|
|
104
|
+
token_endpoint: string;
|
|
105
|
+
no_pkce?: boolean | null;
|
|
106
|
+
scopes?: string[] | null;
|
|
107
|
+
}
|
|
108
|
+
export interface MCPEndpointSpec {
|
|
109
|
+
label: string;
|
|
110
|
+
description?: string | null;
|
|
111
|
+
allowed_tools?: AllowedMcpToolFilter[] | null;
|
|
112
|
+
headers?: Record<string, string> | null;
|
|
113
|
+
require_approval?: "always" | "never" | null;
|
|
114
|
+
oauth?: OAuthClientConfig | null;
|
|
115
|
+
openai_connector_id?: string | null;
|
|
116
|
+
}
|
|
117
|
+
export interface EndpointSpec {
|
|
118
|
+
path: string;
|
|
119
|
+
meshagent?: MeshagentEndpointSpec;
|
|
120
|
+
mcp?: MCPEndpointSpec;
|
|
121
|
+
}
|
|
122
|
+
export interface PortSpec {
|
|
123
|
+
num: "*" | number;
|
|
124
|
+
type?: "http" | "tcp" | null;
|
|
125
|
+
endpoints?: EndpointSpec[];
|
|
126
|
+
liveness?: string | null;
|
|
127
|
+
}
|
|
128
|
+
export interface ServiceSpec {
|
|
129
|
+
version: "v1";
|
|
130
|
+
kind: "Service";
|
|
131
|
+
id?: string | null;
|
|
132
|
+
metadata: ServiceMetadata;
|
|
133
|
+
ports?: PortSpec[];
|
|
134
|
+
container?: ContainerSpec | null;
|
|
135
|
+
external?: ExternalServiceSpec | null;
|
|
136
|
+
}
|
|
137
|
+
export interface Mailbox {
|
|
138
|
+
address: string;
|
|
139
|
+
room: string;
|
|
140
|
+
queue: string;
|
|
141
|
+
}
|
|
142
|
+
export interface Balance {
|
|
143
|
+
balance: number;
|
|
144
|
+
autoRechargeThreshold?: number | null;
|
|
145
|
+
autoRechargeAmount?: number | null;
|
|
146
|
+
lastRecharge?: Date | null;
|
|
147
|
+
}
|
|
148
|
+
export interface Transaction {
|
|
149
|
+
id: string;
|
|
150
|
+
amount: number;
|
|
151
|
+
reference?: string | null;
|
|
152
|
+
referenceType?: string | null;
|
|
153
|
+
description: string;
|
|
154
|
+
createdAt: Date;
|
|
155
|
+
}
|
|
156
|
+
export interface OAuthClient {
|
|
157
|
+
clientId: string;
|
|
158
|
+
clientSecret: string;
|
|
159
|
+
grantTypes: string[];
|
|
160
|
+
responseTypes: string[];
|
|
161
|
+
redirectUris: string[];
|
|
162
|
+
scope: string;
|
|
163
|
+
projectId: string;
|
|
164
|
+
metadata: Record<string, string>;
|
|
165
|
+
}
|
|
166
|
+
export interface BaseSecret {
|
|
167
|
+
id?: string;
|
|
168
|
+
name: string;
|
|
169
|
+
type: "docker" | "keys";
|
|
170
|
+
}
|
|
171
|
+
export interface PullSecret extends BaseSecret {
|
|
172
|
+
type: "docker";
|
|
173
|
+
server: string;
|
|
174
|
+
username: string;
|
|
175
|
+
password: string;
|
|
176
|
+
email?: string;
|
|
177
|
+
}
|
|
178
|
+
export interface KeysSecret extends BaseSecret {
|
|
179
|
+
type: "keys";
|
|
180
|
+
data: Record<string, string>;
|
|
181
|
+
}
|
|
182
|
+
export type SecretLike = PullSecret | KeysSecret;
|
|
183
|
+
export declare class Meshagent {
|
|
184
|
+
private readonly baseUrl;
|
|
185
|
+
private readonly token?;
|
|
186
|
+
constructor({ baseUrl, token }?: {
|
|
187
|
+
baseUrl?: string;
|
|
188
|
+
token?: string;
|
|
189
|
+
});
|
|
190
|
+
private buildUrl;
|
|
191
|
+
private request;
|
|
192
|
+
private parseRoomShare;
|
|
193
|
+
private parseRoomShareConnectionInfo;
|
|
194
|
+
private parseRoomSession;
|
|
195
|
+
private parseRoom;
|
|
196
|
+
private parseProjectRoomGrant;
|
|
197
|
+
private parseProjectRoomGrantCount;
|
|
198
|
+
private parseProjectUserGrantCount;
|
|
199
|
+
private parseBalance;
|
|
200
|
+
private parseTransaction;
|
|
201
|
+
private parseSecret;
|
|
202
|
+
private toSecretPayload;
|
|
203
|
+
private parseOAuthClient;
|
|
204
|
+
private parseRoomConnectionInfo;
|
|
205
|
+
private encodePathComponent;
|
|
206
|
+
upload({ projectId, path, data }: {
|
|
207
|
+
projectId: string;
|
|
208
|
+
path: string;
|
|
209
|
+
data: ArrayBuffer | Uint8Array | Buffer;
|
|
210
|
+
}): Promise<void>;
|
|
211
|
+
download({ projectId, path }: {
|
|
212
|
+
projectId: string;
|
|
213
|
+
path: string;
|
|
214
|
+
}): Promise<Uint8Array>;
|
|
215
|
+
getProjectRole(projectId: string): Promise<ProjectRole>;
|
|
216
|
+
createShare(projectId: string, settings?: Record<string, unknown>): Promise<{
|
|
217
|
+
id: string;
|
|
218
|
+
}>;
|
|
219
|
+
deleteShare(projectId: string, shareId: string): Promise<void>;
|
|
220
|
+
updateShare(projectId: string, shareId: string, settings?: Record<string, unknown>): Promise<void>;
|
|
221
|
+
listShares(projectId: string): Promise<RoomShare[]>;
|
|
222
|
+
connectShare(shareId: string): Promise<RoomShareConnectionInfo>;
|
|
223
|
+
createProject(name: string, settings?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
224
|
+
addUserToProject(projectId: string, userId: string, options?: {
|
|
225
|
+
isAdmin?: boolean;
|
|
226
|
+
isDeveloper?: boolean;
|
|
227
|
+
}): Promise<Record<string, unknown>>;
|
|
228
|
+
removeUserFromProject(projectId: string, userId: string): Promise<Record<string, unknown>>;
|
|
229
|
+
updateProjectSettings(projectId: string, settings: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
230
|
+
getUsersInProject(projectId: string): Promise<Record<string, unknown>>;
|
|
231
|
+
getUserProfile(userId: string): Promise<Record<string, unknown>>;
|
|
232
|
+
updateUserProfile(userId: string, firstName: string, lastName: string): Promise<Record<string, unknown>>;
|
|
233
|
+
listProjects(): Promise<Record<string, unknown>>;
|
|
234
|
+
getProject(projectId: string): Promise<Record<string, unknown>>;
|
|
235
|
+
createApiKey(projectId: string, name: string, description: string): Promise<Record<string, unknown>>;
|
|
236
|
+
deleteApiKey(projectId: string, id: string): Promise<void>;
|
|
237
|
+
listApiKeys(projectId: string): Promise<Record<string, unknown>>;
|
|
238
|
+
getPricing(): Promise<Record<string, unknown>>;
|
|
239
|
+
getStatus(projectId: string): Promise<boolean>;
|
|
240
|
+
getBalance(projectId: string): Promise<Balance>;
|
|
241
|
+
getRecentTransactions(projectId: string): Promise<Transaction[]>;
|
|
242
|
+
setAutoRecharge({ projectId, enabled, amount, threshold }: {
|
|
243
|
+
projectId: string;
|
|
244
|
+
enabled: boolean;
|
|
245
|
+
amount: number;
|
|
246
|
+
threshold: number;
|
|
247
|
+
}): Promise<void>;
|
|
248
|
+
getCheckoutUrl(projectId: string, { successUrl, cancelUrl }: {
|
|
249
|
+
successUrl: string;
|
|
250
|
+
cancelUrl: string;
|
|
251
|
+
}): Promise<string>;
|
|
252
|
+
getCreditsCheckoutUrl(projectId: string, { successUrl, cancelUrl, quantity }: {
|
|
253
|
+
successUrl: string;
|
|
254
|
+
cancelUrl: string;
|
|
255
|
+
quantity: number;
|
|
256
|
+
}): Promise<string>;
|
|
257
|
+
getSubscription(projectId: string): Promise<Record<string, unknown>>;
|
|
258
|
+
getUsage(projectId: string, options?: {
|
|
259
|
+
start?: Date;
|
|
260
|
+
end?: Date;
|
|
261
|
+
interval?: string;
|
|
262
|
+
report?: string;
|
|
263
|
+
}): Promise<Record<string, unknown>[]>;
|
|
264
|
+
getSession(projectId: string, sessionId: string): Promise<Record<string, unknown>>;
|
|
265
|
+
listActiveSessions(projectId: string): Promise<RoomSession[]>;
|
|
266
|
+
listRecentSessions(projectId: string): Promise<RoomSession[]>;
|
|
267
|
+
listSessionEvents(projectId: string, sessionId: string): Promise<Record<string, unknown>[]>;
|
|
268
|
+
terminateSession(projectId: string, sessionId: string): Promise<void>;
|
|
269
|
+
listSessionSpans(projectId: string, sessionId: string): Promise<Record<string, unknown>[]>;
|
|
270
|
+
listSessionMetrics(projectId: string, sessionId: string): Promise<Record<string, unknown>[]>;
|
|
271
|
+
createWebhook(projectId: string, params: {
|
|
272
|
+
name: string;
|
|
273
|
+
url: string;
|
|
274
|
+
events: string[];
|
|
275
|
+
description?: string;
|
|
276
|
+
action?: string;
|
|
277
|
+
payload?: Record<string, unknown> | null;
|
|
278
|
+
}): Promise<Record<string, unknown>>;
|
|
279
|
+
updateWebhook(projectId: string, webhookId: string, params: {
|
|
280
|
+
name: string;
|
|
281
|
+
url: string;
|
|
282
|
+
events: string[];
|
|
283
|
+
description?: string;
|
|
284
|
+
action?: string | null;
|
|
285
|
+
payload?: Record<string, unknown> | null;
|
|
286
|
+
}): Promise<Record<string, unknown>>;
|
|
287
|
+
listWebhooks(projectId: string): Promise<Record<string, unknown>>;
|
|
288
|
+
deleteWebhook(projectId: string, webhookId: string): Promise<void>;
|
|
289
|
+
createMailbox(params: {
|
|
290
|
+
projectId: string;
|
|
291
|
+
address: string;
|
|
292
|
+
room: string;
|
|
293
|
+
queue: string;
|
|
294
|
+
}): Promise<void>;
|
|
295
|
+
updateMailbox(params: {
|
|
296
|
+
projectId: string;
|
|
297
|
+
address: string;
|
|
298
|
+
room: string;
|
|
299
|
+
queue: string;
|
|
300
|
+
}): Promise<void>;
|
|
301
|
+
listMailboxes(projectId: string): Promise<Mailbox[]>;
|
|
302
|
+
deleteMailbox(projectId: string, address: string): Promise<void>;
|
|
303
|
+
createService(projectId: string, service: ServiceSpec): Promise<string>;
|
|
304
|
+
createRoomService(projectId: string, roomName: string, service: ServiceSpec): Promise<string>;
|
|
305
|
+
updateRoomService(projectId: string, roomName: string, serviceId: string, service: ServiceSpec): Promise<void>;
|
|
306
|
+
getRoomService(projectId: string, roomName: string, serviceId: string): Promise<ServiceSpec>;
|
|
307
|
+
listRoomServices(projectId: string, roomName: string): Promise<ServiceSpec[]>;
|
|
308
|
+
deleteRoomService(projectId: string, roomName: string, serviceId: string): Promise<void>;
|
|
309
|
+
updateService(projectId: string, serviceId: string, service: ServiceSpec): Promise<void>;
|
|
310
|
+
getService(projectId: string, serviceId: string): Promise<ServiceSpec>;
|
|
311
|
+
listServices(projectId: string): Promise<ServiceSpec[]>;
|
|
312
|
+
deleteService(projectId: string, serviceId: string): Promise<void>;
|
|
313
|
+
createSecret(projectId: string, secret: SecretLike): Promise<void>;
|
|
314
|
+
updateSecret(projectId: string, secret: SecretLike): Promise<void>;
|
|
315
|
+
deleteSecret(projectId: string, secretId: string): Promise<void>;
|
|
316
|
+
listSecrets(projectId: string): Promise<SecretLike[]>;
|
|
317
|
+
createRoom(params: {
|
|
318
|
+
projectId: string;
|
|
319
|
+
name: string;
|
|
320
|
+
ifNotExists?: boolean;
|
|
321
|
+
metadata?: Record<string, unknown>;
|
|
322
|
+
permissions?: Record<string, ApiScope>;
|
|
323
|
+
}): Promise<RoomInfo>;
|
|
324
|
+
getRoom(projectId: string, name: string): Promise<RoomInfo>;
|
|
325
|
+
updateRoom(projectId: string, roomId: string, name: string): Promise<void>;
|
|
326
|
+
deleteRoom(projectId: string, roomId: string): Promise<void>;
|
|
327
|
+
connectRoom(projectId: string, room: string): Promise<RoomConnectionInfo>;
|
|
328
|
+
createRoomGrant(params: {
|
|
329
|
+
projectId: string;
|
|
330
|
+
roomId: string;
|
|
331
|
+
userId: string;
|
|
332
|
+
permissions: ApiScope;
|
|
333
|
+
}): Promise<void>;
|
|
334
|
+
createRoomGrantByEmail(params: {
|
|
335
|
+
projectId: string;
|
|
336
|
+
roomId: string;
|
|
337
|
+
email: string;
|
|
338
|
+
permissions: ApiScope;
|
|
339
|
+
}): Promise<void>;
|
|
340
|
+
updateRoomGrant(params: {
|
|
341
|
+
projectId: string;
|
|
342
|
+
roomId: string;
|
|
343
|
+
userId: string;
|
|
344
|
+
permissions: ApiScope;
|
|
345
|
+
grantId?: string;
|
|
346
|
+
}): Promise<void>;
|
|
347
|
+
deleteRoomGrant(projectId: string, roomId: string, userId: string): Promise<void>;
|
|
348
|
+
getRoomGrant(projectId: string, roomId: string, userId: string): Promise<ProjectRoomGrant>;
|
|
349
|
+
listRooms(projectId: string, options?: {
|
|
350
|
+
limit?: number;
|
|
351
|
+
offset?: number;
|
|
352
|
+
orderBy?: string;
|
|
353
|
+
}): Promise<RoomInfo[]>;
|
|
354
|
+
listRoomGrants(projectId: string, options?: {
|
|
355
|
+
limit?: number;
|
|
356
|
+
offset?: number;
|
|
357
|
+
orderBy?: string;
|
|
358
|
+
}): Promise<ProjectRoomGrant[]>;
|
|
359
|
+
listRoomGrantsByUser(projectId: string, userId: string, options?: {
|
|
360
|
+
limit?: number;
|
|
361
|
+
offset?: number;
|
|
362
|
+
}): Promise<ProjectRoomGrant[]>;
|
|
363
|
+
listRoomGrantsByRoom(projectId: string, roomId: string, options?: {
|
|
364
|
+
limit?: number;
|
|
365
|
+
offset?: number;
|
|
366
|
+
}): Promise<ProjectRoomGrant[]>;
|
|
367
|
+
listUniqueRoomsWithGrants(projectId: string, options?: {
|
|
368
|
+
limit?: number;
|
|
369
|
+
offset?: number;
|
|
370
|
+
}): Promise<ProjectRoomGrantCount[]>;
|
|
371
|
+
listUniqueUsersWithGrants(projectId: string, options?: {
|
|
372
|
+
limit?: number;
|
|
373
|
+
offset?: number;
|
|
374
|
+
}): Promise<ProjectUserGrantCount[]>;
|
|
375
|
+
createOAuthClient(projectId: string, params: {
|
|
376
|
+
grantTypes: string[];
|
|
377
|
+
responseTypes: string[];
|
|
378
|
+
redirectUris: string[];
|
|
379
|
+
scope: string;
|
|
380
|
+
metadata?: Record<string, any>;
|
|
381
|
+
}): Promise<OAuthClient>;
|
|
382
|
+
updateOAuthClient(projectId: string, clientId: string, params: {
|
|
383
|
+
grantTypes?: string[];
|
|
384
|
+
responseTypes?: string[];
|
|
385
|
+
redirectUris?: string[];
|
|
386
|
+
scope?: string;
|
|
387
|
+
metadata?: Record<string, any>;
|
|
388
|
+
}): Promise<Record<string, unknown>>;
|
|
389
|
+
listOAuthClients(projectId: string): Promise<OAuthClient[]>;
|
|
390
|
+
getOAuthClient(projectId: string, clientId: string): Promise<OAuthClient>;
|
|
391
|
+
deleteOAuthClient(projectId: string, clientId: string): Promise<void>;
|
|
392
|
+
}
|