@inneropen/marvin-sdk 1.6.0 → 1.8.0
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/dist/index.cjs +35 -0
- package/dist/index.d.cts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +33 -0
- package/dist/platform.cjs +338 -0
- package/dist/platform.d.cts +382 -1
- package/dist/platform.d.ts +382 -1
- package/dist/platform.js +331 -0
- package/package.json +1 -1
package/dist/platform.js
CHANGED
|
@@ -366,6 +366,18 @@ var WorkspacesModule = class {
|
|
|
366
366
|
const url = `/api/admin/groups/${id}${force ? "?force=true" : ""}`;
|
|
367
367
|
await this.http.delete(url);
|
|
368
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Get workspace preferences
|
|
371
|
+
*/
|
|
372
|
+
async getPreferences(workspaceId) {
|
|
373
|
+
return this.http.get(`/api/groups/${workspaceId}/preferences`);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Update workspace preferences
|
|
377
|
+
*/
|
|
378
|
+
async updatePreferences(workspaceId, data) {
|
|
379
|
+
return this.http.put(`/api/groups/${workspaceId}/preferences`, data);
|
|
380
|
+
}
|
|
369
381
|
};
|
|
370
382
|
|
|
371
383
|
// src/platform/invites.ts
|
|
@@ -395,6 +407,303 @@ var InvitesModule = class {
|
|
|
395
407
|
}
|
|
396
408
|
};
|
|
397
409
|
|
|
410
|
+
// src/platform/notifications.ts
|
|
411
|
+
var NotificationsModule = class {
|
|
412
|
+
constructor(http) {
|
|
413
|
+
this.http = http;
|
|
414
|
+
}
|
|
415
|
+
http;
|
|
416
|
+
/**
|
|
417
|
+
* List all notifications for the current workspace
|
|
418
|
+
*/
|
|
419
|
+
async list() {
|
|
420
|
+
return this.http.get("/api/group/notifications");
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Get a notification by ID
|
|
424
|
+
*/
|
|
425
|
+
async get(id) {
|
|
426
|
+
return this.http.get(`/api/group/notifications/${id}`);
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Create a new notification
|
|
430
|
+
*/
|
|
431
|
+
async create(data) {
|
|
432
|
+
return this.http.post("/api/group/notifications", data);
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Update a notification
|
|
436
|
+
*/
|
|
437
|
+
async update(id, data) {
|
|
438
|
+
return this.http.put(`/api/group/notifications/${id}`, data);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Delete a notification
|
|
442
|
+
*/
|
|
443
|
+
async delete(id) {
|
|
444
|
+
await this.http.delete(`/api/group/notifications/${id}`);
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Test a notification
|
|
448
|
+
*/
|
|
449
|
+
async test(id) {
|
|
450
|
+
return this.http.post(`/api/group/notifications/${id}/test`, {});
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
// src/platform/webhooks.ts
|
|
455
|
+
var WebhooksModule = class {
|
|
456
|
+
constructor(http) {
|
|
457
|
+
this.http = http;
|
|
458
|
+
}
|
|
459
|
+
http;
|
|
460
|
+
/**
|
|
461
|
+
* List all webhooks for the current workspace
|
|
462
|
+
*/
|
|
463
|
+
async list() {
|
|
464
|
+
const response = await this.http.get("/api/groups/webhooks");
|
|
465
|
+
return response.items || [];
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Get a webhook by ID
|
|
469
|
+
*/
|
|
470
|
+
async get(id) {
|
|
471
|
+
return this.http.get(`/api/groups/webhooks/${id}`);
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Create a new webhook
|
|
475
|
+
*/
|
|
476
|
+
async create(data) {
|
|
477
|
+
return this.http.post("/api/groups/webhooks", data);
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Update a webhook
|
|
481
|
+
*/
|
|
482
|
+
async update(id, data) {
|
|
483
|
+
return this.http.put(`/api/groups/webhooks/${id}`, data);
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Delete a webhook
|
|
487
|
+
*/
|
|
488
|
+
async delete(id) {
|
|
489
|
+
await this.http.delete(`/api/groups/webhooks/${id}`);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Test a webhook
|
|
493
|
+
*/
|
|
494
|
+
async test(id) {
|
|
495
|
+
return this.http.post(`/api/groups/webhooks/${id}/test`, {});
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Rerun failed webhooks
|
|
499
|
+
*/
|
|
500
|
+
async rerun() {
|
|
501
|
+
return this.http.post("/api/groups/webhooks/rerun", {});
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
// src/platform/admin/users.ts
|
|
506
|
+
var AdminUsersModule = class {
|
|
507
|
+
constructor(http) {
|
|
508
|
+
this.http = http;
|
|
509
|
+
}
|
|
510
|
+
http;
|
|
511
|
+
/**
|
|
512
|
+
* List all users (paginated)
|
|
513
|
+
*/
|
|
514
|
+
async list(page = 1, perPage = 50) {
|
|
515
|
+
return this.http.get(`/api/admin/users?page=${page}&per_page=${perPage}`);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Get a user by ID
|
|
519
|
+
*/
|
|
520
|
+
async get(id) {
|
|
521
|
+
return this.http.get(`/api/admin/users/${id}`);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Update a user
|
|
525
|
+
*/
|
|
526
|
+
async update(id, data) {
|
|
527
|
+
return this.http.put(`/api/admin/users/${id}`, data);
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Delete a user
|
|
531
|
+
*/
|
|
532
|
+
async delete(id) {
|
|
533
|
+
await this.http.delete(`/api/admin/users/${id}`);
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Generate a password reset token for a user
|
|
537
|
+
*/
|
|
538
|
+
async generatePasswordResetToken(userId) {
|
|
539
|
+
return this.http.post("/api/admin/users/password-reset-token", { userId });
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Unlock a locked user account
|
|
543
|
+
*/
|
|
544
|
+
async unlock(userId) {
|
|
545
|
+
await this.http.post("/api/admin/users/unlock", { userId });
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
// src/platform/admin/system.ts
|
|
550
|
+
var AdminSystemModule = class {
|
|
551
|
+
constructor(http) {
|
|
552
|
+
this.http = http;
|
|
553
|
+
}
|
|
554
|
+
http;
|
|
555
|
+
/**
|
|
556
|
+
* Get system information
|
|
557
|
+
*/
|
|
558
|
+
async getAbout() {
|
|
559
|
+
return this.http.get("/api/admin/about");
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Check system health
|
|
563
|
+
*/
|
|
564
|
+
async check() {
|
|
565
|
+
return this.http.get("/api/admin/about/check");
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Get startup information
|
|
569
|
+
*/
|
|
570
|
+
async getStartupInfo() {
|
|
571
|
+
return this.http.get("/api/admin/about/startup-info");
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Get system statistics
|
|
575
|
+
*/
|
|
576
|
+
async getStatistics() {
|
|
577
|
+
return this.http.get("/api/admin/about/statistics");
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Get email settings
|
|
581
|
+
*/
|
|
582
|
+
async getEmailSettings() {
|
|
583
|
+
return this.http.get("/api/admin/email");
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Update email settings
|
|
587
|
+
*/
|
|
588
|
+
async updateEmailSettings(data) {
|
|
589
|
+
return this.http.put("/api/admin/email", data);
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
// src/platform/admin/maintenance.ts
|
|
594
|
+
var AdminMaintenanceModule = class {
|
|
595
|
+
constructor(http) {
|
|
596
|
+
this.http = http;
|
|
597
|
+
}
|
|
598
|
+
http;
|
|
599
|
+
/**
|
|
600
|
+
* Clean temporary files
|
|
601
|
+
*/
|
|
602
|
+
async cleanTemp() {
|
|
603
|
+
return this.http.post("/api/admin/maintenance/clean/temp", {});
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Clean up old events
|
|
607
|
+
*/
|
|
608
|
+
async cleanupEvents() {
|
|
609
|
+
return this.http.post("/api/admin/maintenance/cleanup-events", {});
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Clean up expired tokens
|
|
613
|
+
*/
|
|
614
|
+
async cleanupTokens() {
|
|
615
|
+
return this.http.post("/api/admin/maintenance/cleanup-tokens", {});
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Clear application cache
|
|
619
|
+
*/
|
|
620
|
+
async clearCache() {
|
|
621
|
+
return this.http.post("/api/admin/maintenance/clear-cache", {});
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Optimize database
|
|
625
|
+
*/
|
|
626
|
+
async optimizeDatabase() {
|
|
627
|
+
return this.http.post("/api/admin/maintenance/optimize-db", {});
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Get maintenance statistics
|
|
631
|
+
*/
|
|
632
|
+
async getStats() {
|
|
633
|
+
return this.http.get("/api/admin/maintenance/stats");
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Get storage information
|
|
637
|
+
*/
|
|
638
|
+
async getStorage() {
|
|
639
|
+
return this.http.get("/api/admin/maintenance/storage");
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
// src/platform/user.ts
|
|
644
|
+
var UserModule = class {
|
|
645
|
+
constructor(http) {
|
|
646
|
+
this.http = http;
|
|
647
|
+
}
|
|
648
|
+
http;
|
|
649
|
+
/**
|
|
650
|
+
* Get current user profile
|
|
651
|
+
*/
|
|
652
|
+
async getProfile() {
|
|
653
|
+
return this.http.get("/api/self");
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* List personal API tokens
|
|
657
|
+
*/
|
|
658
|
+
async listApiTokens() {
|
|
659
|
+
return this.http.get("/api/self/api-tokens");
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Create a new personal API token
|
|
663
|
+
*/
|
|
664
|
+
async createApiToken(data) {
|
|
665
|
+
return this.http.post("/api/self/api-tokens", data);
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Revoke an API token
|
|
669
|
+
*/
|
|
670
|
+
async revokeApiToken(tokenId) {
|
|
671
|
+
await this.http.post(`/api/self/api-tokens/${tokenId}/revoke`, {});
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Rotate an API token (revoke old, create new)
|
|
675
|
+
*/
|
|
676
|
+
async rotateApiToken(tokenId) {
|
|
677
|
+
return this.http.post(`/api/self/api-tokens/${tokenId}/rotate`, {});
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Delete an API token
|
|
681
|
+
*/
|
|
682
|
+
async deleteApiToken(tokenId) {
|
|
683
|
+
await this.http.delete(`/api/self/api-tokens/${tokenId}`);
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Change password
|
|
687
|
+
*/
|
|
688
|
+
async changePassword(data) {
|
|
689
|
+
await this.http.put("/api/self/password", data);
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
// src/platform/events.ts
|
|
694
|
+
var EventsModule = class {
|
|
695
|
+
constructor(http) {
|
|
696
|
+
this.http = http;
|
|
697
|
+
}
|
|
698
|
+
http;
|
|
699
|
+
/**
|
|
700
|
+
* Get available event types for webhooks and notifications
|
|
701
|
+
*/
|
|
702
|
+
async getOptions() {
|
|
703
|
+
return this.http.get("/api/event/options");
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
|
|
398
707
|
// src/platform/client.ts
|
|
399
708
|
var PlatformClient = class extends HttpClient {
|
|
400
709
|
entries;
|
|
@@ -406,6 +715,14 @@ var PlatformClient = class extends HttpClient {
|
|
|
406
715
|
workspaceMembers;
|
|
407
716
|
workspaces;
|
|
408
717
|
invites;
|
|
718
|
+
notifications;
|
|
719
|
+
webhooks;
|
|
720
|
+
user;
|
|
721
|
+
events;
|
|
722
|
+
// Admin modules
|
|
723
|
+
adminUsers;
|
|
724
|
+
adminSystem;
|
|
725
|
+
adminMaintenance;
|
|
409
726
|
constructor(config) {
|
|
410
727
|
const httpConfig = {
|
|
411
728
|
baseUrl: config.apiUrl,
|
|
@@ -422,6 +739,13 @@ var PlatformClient = class extends HttpClient {
|
|
|
422
739
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
423
740
|
this.workspaces = new WorkspacesModule(this);
|
|
424
741
|
this.invites = new InvitesModule(this);
|
|
742
|
+
this.notifications = new NotificationsModule(this);
|
|
743
|
+
this.webhooks = new WebhooksModule(this);
|
|
744
|
+
this.user = new UserModule(this);
|
|
745
|
+
this.events = new EventsModule(this);
|
|
746
|
+
this.adminUsers = new AdminUsersModule(this);
|
|
747
|
+
this.adminSystem = new AdminSystemModule(this);
|
|
748
|
+
this.adminMaintenance = new AdminMaintenanceModule(this);
|
|
425
749
|
}
|
|
426
750
|
};
|
|
427
751
|
function createPlatformClient(config) {
|
|
@@ -429,13 +753,20 @@ function createPlatformClient(config) {
|
|
|
429
753
|
}
|
|
430
754
|
export {
|
|
431
755
|
APIClientsModule,
|
|
756
|
+
AdminMaintenanceModule,
|
|
757
|
+
AdminSystemModule,
|
|
758
|
+
AdminUsersModule,
|
|
432
759
|
AssetsModule,
|
|
433
760
|
CollectionsModule,
|
|
434
761
|
EntriesModule,
|
|
435
762
|
EntryTypesModule,
|
|
763
|
+
EventsModule,
|
|
436
764
|
InvitesModule,
|
|
765
|
+
NotificationsModule,
|
|
437
766
|
PlatformClient,
|
|
438
767
|
ResourcesModule,
|
|
768
|
+
UserModule,
|
|
769
|
+
WebhooksModule,
|
|
439
770
|
WorkspaceMembersModule,
|
|
440
771
|
WorkspacesModule,
|
|
441
772
|
createPlatformClient
|