@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.
Files changed (62) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/browser/agent-client.d.ts +15 -7
  3. package/dist/browser/agent-client.js +52 -14
  4. package/dist/browser/api_keys.d.ts +13 -0
  5. package/dist/browser/api_keys.js +185 -0
  6. package/dist/browser/data-types.d.ts +6 -0
  7. package/dist/browser/data-types.js +20 -1
  8. package/dist/browser/entrypoint.d.ts +1423 -1464
  9. package/dist/browser/helpers.d.ts +9 -7
  10. package/dist/browser/helpers.js +18 -5
  11. package/dist/browser/index.d.ts +3 -0
  12. package/dist/browser/index.js +3 -0
  13. package/dist/browser/lk-client.d.ts +18 -0
  14. package/dist/browser/lk-client.js +24 -0
  15. package/dist/browser/lk-protocol.d.ts +22 -0
  16. package/dist/browser/lk-protocol.js +37 -0
  17. package/dist/browser/meshagent-client.d.ts +392 -0
  18. package/dist/browser/meshagent-client.js +1051 -0
  19. package/dist/browser/participant-token.d.ts +179 -7
  20. package/dist/browser/participant-token.js +373 -21
  21. package/dist/browser/stream-controller.js +3 -14
  22. package/dist/esm/agent-client.d.ts +15 -7
  23. package/dist/esm/agent-client.js +52 -14
  24. package/dist/esm/api_keys.d.ts +13 -0
  25. package/dist/esm/api_keys.js +175 -0
  26. package/dist/esm/data-types.d.ts +6 -0
  27. package/dist/esm/data-types.js +18 -0
  28. package/dist/esm/entrypoint.d.ts +1423 -1464
  29. package/dist/esm/helpers.d.ts +9 -7
  30. package/dist/esm/helpers.js +19 -6
  31. package/dist/esm/index.d.ts +3 -0
  32. package/dist/esm/index.js +3 -0
  33. package/dist/esm/lk-client.d.ts +18 -0
  34. package/dist/esm/lk-client.js +19 -0
  35. package/dist/esm/lk-protocol.d.ts +22 -0
  36. package/dist/esm/lk-protocol.js +33 -0
  37. package/dist/esm/meshagent-client.d.ts +392 -0
  38. package/dist/esm/meshagent-client.js +1047 -0
  39. package/dist/esm/participant-token.d.ts +179 -7
  40. package/dist/esm/participant-token.js +357 -20
  41. package/dist/esm/stream-controller.js +3 -14
  42. package/dist/node/agent-client.d.ts +15 -7
  43. package/dist/node/agent-client.js +52 -14
  44. package/dist/node/api_keys.d.ts +13 -0
  45. package/dist/node/api_keys.js +185 -0
  46. package/dist/node/data-types.d.ts +6 -0
  47. package/dist/node/data-types.js +20 -1
  48. package/dist/node/entrypoint.d.ts +1423 -1464
  49. package/dist/node/helpers.d.ts +9 -7
  50. package/dist/node/helpers.js +18 -5
  51. package/dist/node/index.d.ts +3 -0
  52. package/dist/node/index.js +3 -0
  53. package/dist/node/lk-client.d.ts +18 -0
  54. package/dist/node/lk-client.js +24 -0
  55. package/dist/node/lk-protocol.d.ts +22 -0
  56. package/dist/node/lk-protocol.js +37 -0
  57. package/dist/node/meshagent-client.d.ts +392 -0
  58. package/dist/node/meshagent-client.js +1051 -0
  59. package/dist/node/participant-token.d.ts +179 -7
  60. package/dist/node/participant-token.js +373 -21
  61. package/dist/node/stream-controller.js +3 -14
  62. package/package.json +6 -3
@@ -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: string;
22
- apiKeyId: string;
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: string;
29
- apiKeyId: string;
30
- secret: string;
29
+ projectId?: string;
30
+ apiKeyId?: string;
31
+ secret?: string;
31
32
  apiUrl?: string;
33
+ apiKey?: string;
32
34
  }): Promise<WebSocketClientProtocol>;
@@ -9,6 +9,7 @@ exports.websocketProtocol = websocketProtocol;
9
9
  const schema_1 = require("./schema");
10
10
  const participant_token_1 = require("./participant-token");
11
11
  const protocol_1 = require("./protocol");
12
+ const api_keys_1 = require("./api_keys");
12
13
  function validateSchemaName(name) {
13
14
  if (name.includes('.')) {
14
15
  throw new schema_1.MeshSchemaValidationException("schema name cannot contain '.'");
@@ -38,17 +39,29 @@ function websocketRoomUrl({ roomName, apiUrl }) {
38
39
  }
39
40
  return `${url}/rooms/${roomName}`;
40
41
  }
41
- function participantToken({ participantName, roomName, role, projectId, apiKeyId, }) {
42
- const token = new participant_token_1.ParticipantToken({ name: participantName, projectId, apiKeyId });
42
+ function participantToken({ participantName, roomName, role, projectId, apiKeyId, apiKey, }) {
43
+ let resolvedProjectId = projectId;
44
+ let resolvedApiKeyId = apiKeyId;
45
+ if (apiKey) {
46
+ const parsed = (0, api_keys_1.parseApiKey)(apiKey);
47
+ resolvedProjectId ?? (resolvedProjectId = parsed.projectId);
48
+ resolvedApiKeyId ?? (resolvedApiKeyId = parsed.id);
49
+ }
50
+ const token = new participant_token_1.ParticipantToken({
51
+ name: participantName,
52
+ projectId: resolvedProjectId,
53
+ apiKeyId: resolvedApiKeyId,
54
+ });
43
55
  token.addRoomGrant(roomName);
44
56
  if (role) {
45
57
  token.addRoleGrant(role);
46
58
  }
59
+ token.addApiGrant(participant_token_1.ApiScope.agentDefault());
47
60
  return token;
48
61
  }
49
- async function websocketProtocol({ participantName, roomName, role, projectId, apiKeyId, secret, apiUrl }) {
62
+ async function websocketProtocol({ participantName, roomName, role, projectId, apiKeyId, apiKey, secret, apiUrl }) {
50
63
  const url = websocketRoomUrl({ roomName, apiUrl });
51
- const token = participantToken({ participantName, roomName, role, projectId, apiKeyId });
52
- const jwt = await token.toJwt({ token: secret });
64
+ const token = participantToken({ participantName, roomName, role, projectId, apiKeyId, apiKey });
65
+ const jwt = await token.toJwt({ token: secret, apiKey });
53
66
  return new protocol_1.WebSocketClientProtocol({ url, token: jwt });
54
67
  }
@@ -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';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./agent"), exports);
18
+ __exportStar(require("./agent-client"), exports);
18
19
  __exportStar(require("./event-emitter"), exports);
19
20
  __exportStar(require("./client"), exports);
20
21
  __exportStar(require("./completer"), exports);
@@ -22,6 +23,7 @@ __exportStar(require("./data-types"), exports);
22
23
  __exportStar(require("./database-client"), exports);
23
24
  __exportStar(require("./developer-client"), exports);
24
25
  __exportStar(require("./document"), exports);
26
+ __exportStar(require("./meshagent-client"), exports);
25
27
  __exportStar(require("./messaging-client"), exports);
26
28
  __exportStar(require("./participant-token"), exports);
27
29
  __exportStar(require("./participant"), exports);
@@ -37,5 +39,6 @@ __exportStar(require("./schema"), exports);
37
39
  __exportStar(require("./storage-client"), exports);
38
40
  __exportStar(require("./stream-controller"), exports);
39
41
  __exportStar(require("./sync-client"), exports);
42
+ __exportStar(require("./api_keys"), exports);
40
43
  __exportStar(require("./helpers"), exports);
41
44
  __exportStar(require("./utils"), exports);
@@ -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,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LivekitClient = exports.LivekitConnectionInfo = void 0;
4
+ class LivekitConnectionInfo {
5
+ constructor({ url, token }) {
6
+ this.url = url;
7
+ this.token = token;
8
+ }
9
+ }
10
+ exports.LivekitConnectionInfo = LivekitConnectionInfo;
11
+ class LivekitClient {
12
+ constructor({ room }) {
13
+ this.room = room;
14
+ }
15
+ async getConnectionInfo({ breakoutRoom }) {
16
+ const response = (await this.room.sendRequest('livekit.connect', { breakout_room: breakoutRoom }));
17
+ if (!response || !response.json) {
18
+ throw new Error('Failed to get connection info');
19
+ }
20
+ const { url, token } = response.json;
21
+ return new LivekitConnectionInfo({ url, token });
22
+ }
23
+ }
24
+ exports.LivekitClient = LivekitClient;
@@ -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,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LivekitProtocolChannel = void 0;
4
+ const livekit_client_1 = require("livekit-client");
5
+ class LivekitProtocolChannel {
6
+ constructor({ room, remote, topic }) {
7
+ this.room = room;
8
+ this.remote = remote;
9
+ this.topic = topic;
10
+ }
11
+ start(onDataReceived, _opts) {
12
+ this.onDataReceived = onDataReceived;
13
+ this.boundOnData = (payload, participant, ...rest) => {
14
+ const identityMatches = participant?.identity === this.remote.identity;
15
+ const topicArg = rest?.[rest.length - 1] ?? undefined;
16
+ if (topicArg === this.topic && identityMatches) {
17
+ this.onDataReceived?.(payload);
18
+ }
19
+ };
20
+ this.room.on(livekit_client_1.RoomEvent.DataReceived, this.boundOnData);
21
+ }
22
+ async sendData(data) {
23
+ await this.room.localParticipant.publishData(data, {
24
+ reliable: true,
25
+ topic: this.topic,
26
+ destinationIdentities: [this.remote.identity],
27
+ });
28
+ }
29
+ dispose() {
30
+ if (this.boundOnData) {
31
+ this.room.off(livekit_client_1.RoomEvent.DataReceived, this.boundOnData);
32
+ }
33
+ this.boundOnData = undefined;
34
+ this.onDataReceived = undefined;
35
+ }
36
+ }
37
+ exports.LivekitProtocolChannel = LivekitProtocolChannel;
@@ -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
+ }