@meshagent/meshagent 0.38.4 → 0.39.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 (44) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/dist/browser/datasets-client.d.ts +415 -0
  3. package/dist/{node/database-client.js → browser/datasets-client.js} +480 -234
  4. package/dist/browser/entrypoint.js +9 -17
  5. package/dist/browser/index.d.ts +1 -2
  6. package/dist/browser/index.js +1 -2
  7. package/dist/browser/meshagent-client.d.ts +179 -3
  8. package/dist/browser/meshagent-client.js +333 -25
  9. package/dist/browser/participant-token.d.ts +5 -5
  10. package/dist/browser/participant-token.js +14 -13
  11. package/dist/browser/room-client.d.ts +5 -3
  12. package/dist/browser/room-client.js +70 -4
  13. package/dist/esm/datasets-client.d.ts +415 -0
  14. package/dist/esm/{database-client.js → datasets-client.js} +473 -227
  15. package/dist/esm/entrypoint.js +6 -12
  16. package/dist/esm/index.d.ts +1 -2
  17. package/dist/esm/index.js +1 -2
  18. package/dist/esm/meshagent-client.d.ts +179 -3
  19. package/dist/esm/meshagent-client.js +333 -25
  20. package/dist/esm/participant-token.d.ts +5 -5
  21. package/dist/esm/participant-token.js +12 -11
  22. package/dist/esm/room-client.d.ts +5 -3
  23. package/dist/esm/room-client.js +70 -4
  24. package/dist/node/datasets-client.d.ts +415 -0
  25. package/dist/{browser/database-client.js → node/datasets-client.js} +480 -234
  26. package/dist/node/entrypoint.js +6 -12
  27. package/dist/node/index.d.ts +1 -2
  28. package/dist/node/index.js +1 -2
  29. package/dist/node/meshagent-client.d.ts +179 -3
  30. package/dist/node/meshagent-client.js +333 -25
  31. package/dist/node/participant-token.d.ts +5 -5
  32. package/dist/node/participant-token.js +14 -13
  33. package/dist/node/room-client.d.ts +5 -3
  34. package/dist/node/room-client.js +70 -4
  35. package/package.json +3 -2
  36. package/dist/browser/data-types.d.ts +0 -67
  37. package/dist/browser/data-types.js +0 -192
  38. package/dist/browser/database-client.d.ts +0 -281
  39. package/dist/esm/data-types.d.ts +0 -67
  40. package/dist/esm/data-types.js +0 -179
  41. package/dist/esm/database-client.d.ts +0 -281
  42. package/dist/node/data-types.d.ts +0 -67
  43. package/dist/node/data-types.js +0 -192
  44. package/dist/node/database-client.d.ts +0 -281
@@ -6397,23 +6397,17 @@ for (let i = 0; i < 256; ++i) {
6397
6397
  function unsafeStringify(arr, offset = 0) {
6398
6398
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
6399
6399
  }
6400
- var getRandomValues2;
6401
6400
  var rnds8 = new Uint8Array(16);
6402
6401
  function rng() {
6403
- if (!getRandomValues2) {
6404
- if (typeof crypto === "undefined" || !crypto.getRandomValues) {
6405
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6406
- }
6407
- getRandomValues2 = crypto.getRandomValues.bind(crypto);
6408
- }
6409
- return getRandomValues2(rnds8);
6402
+ return crypto.getRandomValues(rnds8);
6410
6403
  }
6411
- var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
6412
- var native_default = { randomUUID };
6413
6404
  function v4(options, buf, offset) {
6414
- if (native_default.randomUUID && !buf && !options) {
6415
- return native_default.randomUUID();
6405
+ if (!buf && !options && crypto.randomUUID) {
6406
+ return crypto.randomUUID();
6416
6407
  }
6408
+ return _v4(options, buf, offset);
6409
+ }
6410
+ function _v4(options, buf, offset) {
6417
6411
  options = options || {};
6418
6412
  const rnds = options.random ?? options.rng?.() ?? rng();
6419
6413
  if (rnds.length < 16) {
@@ -4,8 +4,7 @@ export * from './event-emitter';
4
4
  export * from './client';
5
5
  export * from './completer';
6
6
  export * from './containers-client';
7
- export * from './data-types';
8
- export * from './database-client';
7
+ export * from './datasets-client';
9
8
  export * from './developer-client';
10
9
  export * from './document';
11
10
  export * from './meshagent-client';
@@ -20,8 +20,7 @@ __exportStar(require("./event-emitter"), exports);
20
20
  __exportStar(require("./client"), exports);
21
21
  __exportStar(require("./completer"), exports);
22
22
  __exportStar(require("./containers-client"), exports);
23
- __exportStar(require("./data-types"), exports);
24
- __exportStar(require("./database-client"), exports);
23
+ __exportStar(require("./datasets-client"), exports);
25
24
  __exportStar(require("./developer-client"), exports);
26
25
  __exportStar(require("./document"), exports);
27
26
  __exportStar(require("./meshagent-client"), exports);
@@ -41,6 +41,14 @@ export interface ProjectUserGrantCount {
41
41
  lastName?: string | null;
42
42
  email: string;
43
43
  }
44
+ export interface ProjectMembersPage {
45
+ users: Record<string, unknown>[];
46
+ total: number;
47
+ }
48
+ export interface ProjectUserGrantCountsPage {
49
+ users: ProjectUserGrantCount[];
50
+ total: number;
51
+ }
44
52
  export interface EnvironmentVariable {
45
53
  name: string;
46
54
  value: string;
@@ -202,6 +210,45 @@ export interface Mailbox {
202
210
  roomId?: string;
203
211
  queue: string;
204
212
  }
213
+ export interface MailboxesPage {
214
+ mailboxes: Mailbox[];
215
+ total: number;
216
+ }
217
+ export type FeedVisibility = "public" | "project" | "private";
218
+ export interface Feed {
219
+ id: string;
220
+ projectId: string;
221
+ createdAt: Date;
222
+ name: string;
223
+ description: string;
224
+ visibility: FeedVisibility;
225
+ paused: boolean;
226
+ annotations: Record<string, string>;
227
+ messageSchema?: Record<string, unknown> | boolean | null;
228
+ }
229
+ export interface FeedsPage {
230
+ feeds: Feed[];
231
+ total: number;
232
+ }
233
+ export interface FeedSubscription {
234
+ id: string;
235
+ feedId: string;
236
+ projectId: string;
237
+ room: string;
238
+ roomId?: string | null;
239
+ path: string;
240
+ createdAt: Date;
241
+ annotations: Record<string, string>;
242
+ }
243
+ export interface LLMLogger {
244
+ id: string;
245
+ projectId: string;
246
+ destinationFeedId: string;
247
+ filterExpression: string;
248
+ paused: boolean;
249
+ createdAt: Date;
250
+ annotations: Record<string, string>;
251
+ }
205
252
  export interface ProjectRepository {
206
253
  id: string;
207
254
  projectId: string;
@@ -215,6 +262,9 @@ export interface Balance {
215
262
  autoRechargeThreshold?: number | null;
216
263
  autoRechargeAmount?: number | null;
217
264
  lastRecharge?: Date | null;
265
+ monthlyBudget?: number | null;
266
+ autoRechargePaused?: boolean;
267
+ autoRechargedThisMonth?: number | null;
218
268
  }
219
269
  export interface Transaction {
220
270
  id: string;
@@ -234,6 +284,10 @@ export interface OAuthClient {
234
284
  projectId: string;
235
285
  metadata: Record<string, string>;
236
286
  }
287
+ export interface OAuthClientsPage {
288
+ clients: OAuthClient[];
289
+ total: number;
290
+ }
237
291
  export interface BaseSecret {
238
292
  id?: string;
239
293
  name: string;
@@ -274,6 +328,7 @@ export interface ExternalOAuthClientRegistration {
274
328
  clientId: string;
275
329
  clientSecret?: string | null;
276
330
  }
331
+ type JsonRequest = Record<string, unknown> | Array<unknown> | string | number | boolean | null;
277
332
  export declare class Meshagent {
278
333
  private readonly baseUrl;
279
334
  private readonly token?;
@@ -286,6 +341,9 @@ export declare class Meshagent {
286
341
  private parseRoomShare;
287
342
  private parseRoomSession;
288
343
  private parseRoom;
344
+ private parseFeed;
345
+ private parseFeedSubscription;
346
+ private parseLLMLogger;
289
347
  private parseProjectRepository;
290
348
  private parseProjectRoomGrant;
291
349
  private parseProjectRoomGrantCount;
@@ -327,6 +385,11 @@ export declare class Meshagent {
327
385
  }): Promise<Record<string, unknown>>;
328
386
  removeUserFromProject(projectId: string, userId: string): Promise<Record<string, unknown>>;
329
387
  updateProjectSettings(projectId: string, settings: Record<string, unknown>): Promise<Record<string, unknown>>;
388
+ getUsersInProjectPage(projectId: string, options?: {
389
+ count?: number;
390
+ offset?: number;
391
+ filter?: string;
392
+ }): Promise<ProjectMembersPage>;
330
393
  getUsersInProject(projectId: string): Promise<Record<string, unknown>>;
331
394
  getUserProfile(userId: string): Promise<Record<string, unknown>>;
332
395
  updateUserProfile(userId: string, firstName: string, lastName: string): Promise<Record<string, unknown>>;
@@ -339,11 +402,12 @@ export declare class Meshagent {
339
402
  getStatus(projectId: string): Promise<boolean>;
340
403
  getBalance(projectId: string): Promise<Balance>;
341
404
  getRecentTransactions(projectId: string): Promise<Transaction[]>;
342
- setAutoRecharge({ projectId, enabled, amount, threshold }: {
405
+ setAutoRecharge({ projectId, enabled, amount, threshold, monthlyBudget, }: {
343
406
  projectId: string;
344
407
  enabled: boolean;
345
408
  amount: number;
346
409
  threshold: number;
410
+ monthlyBudget?: number | null;
347
411
  }): Promise<void>;
348
412
  getCheckoutUrl(projectId: string, { successUrl, cancelUrl }: {
349
413
  successUrl: string;
@@ -365,6 +429,8 @@ export declare class Meshagent {
365
429
  provider?: string;
366
430
  model?: string;
367
431
  usageType?: string;
432
+ client?: string;
433
+ annotations?: Record<string, string>;
368
434
  }): Promise<Record<string, unknown>[]>;
369
435
  getSession(projectId: string, sessionId: string): Promise<Record<string, unknown>>;
370
436
  listActiveSessions(projectId: string): Promise<RoomSession[]>;
@@ -405,8 +471,102 @@ export declare class Meshagent {
405
471
  queue: string;
406
472
  isPublic: boolean;
407
473
  }): Promise<void>;
408
- listMailboxes(projectId: string): Promise<Mailbox[]>;
474
+ private parseMailbox;
475
+ listMailboxesPage(projectId: string, options?: {
476
+ count?: number;
477
+ offset?: number;
478
+ filter?: string;
479
+ }): Promise<MailboxesPage>;
480
+ listMailboxes(projectId: string, options?: {
481
+ count?: number;
482
+ offset?: number;
483
+ filter?: string;
484
+ }): Promise<Mailbox[]>;
409
485
  deleteMailbox(projectId: string, address: string): Promise<void>;
486
+ createFeed(params: {
487
+ projectId: string;
488
+ name: string;
489
+ description?: string;
490
+ visibility?: FeedVisibility;
491
+ paused?: boolean;
492
+ annotations?: Record<string, string>;
493
+ messageSchema?: Record<string, unknown> | boolean | null;
494
+ }): Promise<Feed>;
495
+ updateFeed(params: {
496
+ projectId: string;
497
+ feedId: string;
498
+ name: string;
499
+ description?: string;
500
+ paused?: boolean;
501
+ annotations?: Record<string, string>;
502
+ messageSchema?: Record<string, unknown> | boolean | null;
503
+ }): Promise<void>;
504
+ getFeed(projectId: string, feedId: string): Promise<Feed>;
505
+ listFeedsPage(projectId: string, options?: {
506
+ count?: number;
507
+ offset?: number;
508
+ filter?: string;
509
+ }): Promise<FeedsPage>;
510
+ listFeeds(projectId: string, options?: {
511
+ count?: number;
512
+ offset?: number;
513
+ filter?: string;
514
+ }): Promise<Feed[]>;
515
+ listRoomFeedsPage(projectId: string, roomName: string, options?: {
516
+ count?: number;
517
+ offset?: number;
518
+ filter?: string;
519
+ }): Promise<FeedsPage>;
520
+ listRoomFeeds(projectId: string, roomName: string, options?: {
521
+ count?: number;
522
+ offset?: number;
523
+ filter?: string;
524
+ }): Promise<Feed[]>;
525
+ deleteFeed(projectId: string, feedId: string): Promise<void>;
526
+ publishFeedMessage(params: {
527
+ projectId: string;
528
+ feedId: string;
529
+ message: JsonRequest;
530
+ }): Promise<void>;
531
+ publishFeedBatch(params: {
532
+ projectId: string;
533
+ feedId: string;
534
+ messages: JsonRequest[];
535
+ }): Promise<void>;
536
+ createFeedSubscription(params: {
537
+ projectId: string;
538
+ feedId: string;
539
+ room: string;
540
+ path: string;
541
+ annotations?: Record<string, string>;
542
+ }): Promise<FeedSubscription>;
543
+ updateFeedSubscription(params: {
544
+ projectId: string;
545
+ feedId: string;
546
+ subscriptionId: string;
547
+ annotations?: Record<string, string>;
548
+ }): Promise<void>;
549
+ getFeedSubscription(projectId: string, feedId: string, subscriptionId: string): Promise<FeedSubscription>;
550
+ listFeedSubscriptions(projectId: string, feedId: string): Promise<FeedSubscription[]>;
551
+ deleteFeedSubscription(projectId: string, feedId: string, subscriptionId: string): Promise<void>;
552
+ createLLMLogger(params: {
553
+ projectId: string;
554
+ destinationFeedId: string;
555
+ filterExpression: string;
556
+ paused?: boolean;
557
+ annotations?: Record<string, string>;
558
+ }): Promise<LLMLogger>;
559
+ updateLLMLogger(params: {
560
+ projectId: string;
561
+ loggerId: string;
562
+ destinationFeedId: string;
563
+ filterExpression: string;
564
+ paused?: boolean;
565
+ annotations?: Record<string, string>;
566
+ }): Promise<void>;
567
+ getLLMLogger(projectId: string, loggerId: string): Promise<LLMLogger>;
568
+ listLLMLoggers(projectId: string): Promise<LLMLogger[]>;
569
+ deleteLLMLogger(projectId: string, loggerId: string): Promise<void>;
410
570
  createRepository(params: {
411
571
  projectId: string;
412
572
  name: string;
@@ -606,9 +766,15 @@ export declare class Meshagent {
606
766
  limit?: number;
607
767
  offset?: number;
608
768
  }): Promise<ProjectRoomGrantCount[]>;
769
+ listUniqueUsersWithGrantsPage(projectId: string, options?: {
770
+ limit?: number;
771
+ offset?: number;
772
+ filter?: string;
773
+ }): Promise<ProjectUserGrantCountsPage>;
609
774
  listUniqueUsersWithGrants(projectId: string, options?: {
610
775
  limit?: number;
611
776
  offset?: number;
777
+ filter?: string;
612
778
  }): Promise<ProjectUserGrantCount[]>;
613
779
  createOAuthClient(projectId: string, params: {
614
780
  grantTypes: string[];
@@ -624,7 +790,17 @@ export declare class Meshagent {
624
790
  scope?: string;
625
791
  metadata?: Record<string, any>;
626
792
  }): Promise<Record<string, unknown>>;
627
- listOAuthClients(projectId: string): Promise<OAuthClient[]>;
793
+ listOAuthClientsPage(projectId: string, options?: {
794
+ count?: number;
795
+ offset?: number;
796
+ filter?: string;
797
+ }): Promise<OAuthClientsPage>;
798
+ listOAuthClients(projectId: string, options?: {
799
+ count?: number;
800
+ offset?: number;
801
+ filter?: string;
802
+ }): Promise<OAuthClient[]>;
628
803
  getOAuthClient(projectId: string, clientId: string): Promise<OAuthClient>;
629
804
  deleteOAuthClient(projectId: string, clientId: string): Promise<void>;
630
805
  }
806
+ export {};