@inneropen/marvin-sdk 1.5.0 → 1.7.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/platform.js CHANGED
@@ -340,6 +340,304 @@ var WorkspacesModule = class {
340
340
  workspace
341
341
  });
342
342
  }
343
+ // Admin operations (require SUPER_ADMIN or appropriate permissions)
344
+ /**
345
+ * Get a workspace by ID (admin)
346
+ */
347
+ async get(id) {
348
+ return this.http.get(`/api/admin/groups/${id}`);
349
+ }
350
+ /**
351
+ * Create a new workspace (requires SUPER_ADMIN)
352
+ */
353
+ async create(data) {
354
+ return this.http.post("/api/admin/groups", data);
355
+ }
356
+ /**
357
+ * Update workspace settings (requires ADMIN or OWNER)
358
+ */
359
+ async update(id, data) {
360
+ return this.http.put(`/api/admin/groups/${id}`, data);
361
+ }
362
+ /**
363
+ * Delete a workspace (requires SUPER_ADMIN)
364
+ */
365
+ async delete(id, force = false) {
366
+ const url = `/api/admin/groups/${id}${force ? "?force=true" : ""}`;
367
+ await this.http.delete(url);
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
+ }
381
+ };
382
+
383
+ // src/platform/invites.ts
384
+ var InvitesModule = class {
385
+ constructor(http) {
386
+ this.http = http;
387
+ }
388
+ http;
389
+ /**
390
+ * List all invite tokens for the current workspace
391
+ */
392
+ async list() {
393
+ const response = await this.http.get("/api/groups/invitations");
394
+ return response.items || [];
395
+ }
396
+ /**
397
+ * Create a new invite token
398
+ */
399
+ async create(data) {
400
+ return this.http.post("/api/groups/invitations", data);
401
+ }
402
+ /**
403
+ * Send an email invitation
404
+ */
405
+ async sendEmail(data) {
406
+ await this.http.post("/api/groups/invitations/email", data);
407
+ }
408
+ };
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
+ }
343
641
  };
344
642
 
345
643
  // src/platform/client.ts
@@ -352,6 +650,13 @@ var PlatformClient = class extends HttpClient {
352
650
  entryTypes;
353
651
  workspaceMembers;
354
652
  workspaces;
653
+ invites;
654
+ notifications;
655
+ webhooks;
656
+ // Admin modules
657
+ adminUsers;
658
+ adminSystem;
659
+ adminMaintenance;
355
660
  constructor(config) {
356
661
  const httpConfig = {
357
662
  baseUrl: config.apiUrl,
@@ -367,6 +672,12 @@ var PlatformClient = class extends HttpClient {
367
672
  this.entryTypes = new EntryTypesModule(this);
368
673
  this.workspaceMembers = new WorkspaceMembersModule(this);
369
674
  this.workspaces = new WorkspacesModule(this);
675
+ this.invites = new InvitesModule(this);
676
+ this.notifications = new NotificationsModule(this);
677
+ this.webhooks = new WebhooksModule(this);
678
+ this.adminUsers = new AdminUsersModule(this);
679
+ this.adminSystem = new AdminSystemModule(this);
680
+ this.adminMaintenance = new AdminMaintenanceModule(this);
370
681
  }
371
682
  };
372
683
  function createPlatformClient(config) {
@@ -374,12 +685,18 @@ function createPlatformClient(config) {
374
685
  }
375
686
  export {
376
687
  APIClientsModule,
688
+ AdminMaintenanceModule,
689
+ AdminSystemModule,
690
+ AdminUsersModule,
377
691
  AssetsModule,
378
692
  CollectionsModule,
379
693
  EntriesModule,
380
694
  EntryTypesModule,
695
+ InvitesModule,
696
+ NotificationsModule,
381
697
  PlatformClient,
382
698
  ResourcesModule,
699
+ WebhooksModule,
383
700
  WorkspaceMembersModule,
384
701
  WorkspacesModule,
385
702
  createPlatformClient
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",