@iblai/iblai-api 4.250.4-core → 4.250.5-core

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.
@@ -2,6 +2,7 @@
2
2
  /* istanbul ignore file */
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
+ import type { AvailableNotificationType } from '../models/AvailableNotificationType';
5
6
  import type { CampaignEnablement } from '../models/CampaignEnablement';
6
7
  import type { CampaignExclusion } from '../models/CampaignExclusion';
7
8
  import type { ContextResponse } from '../models/ContextResponse';
@@ -17,15 +18,19 @@ import type { NotificationTemplateList } from '../models/NotificationTemplateLis
17
18
  import type { NotificationTemplateTest } from '../models/NotificationTemplateTest';
18
19
  import type { NotificationTemplateTestResponse } from '../models/NotificationTemplateTestResponse';
19
20
  import type { NotificationToggle } from '../models/NotificationToggle';
21
+ import type { NotificationTypePreference } from '../models/NotificationTypePreference';
20
22
  import type { PatchedNotification } from '../models/PatchedNotification';
21
23
  import type { PatchedNotificationTemplateDetail } from '../models/PatchedNotificationTemplateDetail';
22
24
  import type { PatchedNotificationToggle } from '../models/PatchedNotificationToggle';
25
+ import type { PatchedNotificationTypePreference } from '../models/PatchedNotificationTypePreference';
26
+ import type { PatchedUserNotificationPreferences } from '../models/PatchedUserNotificationPreferences';
23
27
  import type { PreviewResponse } from '../models/PreviewResponse';
24
28
  import type { Recipient } from '../models/Recipient';
25
29
  import type { SendNotification } from '../models/SendNotification';
26
30
  import type { SendResponse } from '../models/SendResponse';
27
31
  import type { TestSMTPCredentials } from '../models/TestSMTPCredentials';
28
32
  import type { TestSMTPResponse } from '../models/TestSMTPResponse';
33
+ import type { UserNotificationPreferences } from '../models/UserNotificationPreferences';
29
34
  import type { ValidateSourceResponse } from '../models/ValidateSourceResponse';
30
35
  import type { CancelablePromise } from '../core/CancelablePromise';
31
36
  import { OpenAPI } from '../core/OpenAPI';
@@ -549,6 +554,149 @@ export class NotificationsService {
549
554
  mediaType: 'application/json',
550
555
  });
551
556
  }
557
+ /**
558
+ * Get user notification preferences
559
+ * Retrieve notification preferences for the authenticated user (or another user via ?username= for admins). Auto-creates preferences with defaults on first access. RBAC: Ibl.Notifications/Notification/read
560
+ * @returns UserNotificationPreferences
561
+ * @throws ApiError
562
+ */
563
+ public static notificationV1PlatformsNotificationPreferencesRetrieve({
564
+ platformKey,
565
+ tags,
566
+ username,
567
+ }: {
568
+ platformKey: string,
569
+ /**
570
+ * Comma-separated tags to filter by (e.g. 'learning,activity'). Returns types matching ANY tag.
571
+ */
572
+ tags?: string,
573
+ /**
574
+ * Username to manage preferences for (admin only). Defaults to authenticated user.
575
+ */
576
+ username?: string,
577
+ }): CancelablePromise<UserNotificationPreferences> {
578
+ return __request(OpenAPI, {
579
+ method: 'GET',
580
+ url: '/api/notification/v1/platforms/{platform_key}/notification-preferences/',
581
+ path: {
582
+ 'platform_key': platformKey,
583
+ },
584
+ query: {
585
+ 'tags': tags,
586
+ 'username': username,
587
+ },
588
+ });
589
+ }
590
+ /**
591
+ * Update user notification preferences
592
+ * Partially update global notification preferences. Per-type overrides use the /types/{notification_type}/ endpoint. RBAC: Ibl.Notifications/Notification/write
593
+ * @returns UserNotificationPreferences
594
+ * @throws ApiError
595
+ */
596
+ public static notificationV1PlatformsNotificationPreferencesPartialUpdate({
597
+ platformKey,
598
+ tags,
599
+ username,
600
+ requestBody,
601
+ }: {
602
+ platformKey: string,
603
+ /**
604
+ * Comma-separated tags to filter by (e.g. 'learning,activity'). Returns types matching ANY tag.
605
+ */
606
+ tags?: string,
607
+ /**
608
+ * Username to manage preferences for (admin only). Defaults to authenticated user.
609
+ */
610
+ username?: string,
611
+ requestBody?: PatchedUserNotificationPreferences,
612
+ }): CancelablePromise<UserNotificationPreferences> {
613
+ return __request(OpenAPI, {
614
+ method: 'PATCH',
615
+ url: '/api/notification/v1/platforms/{platform_key}/notification-preferences/',
616
+ path: {
617
+ 'platform_key': platformKey,
618
+ },
619
+ query: {
620
+ 'tags': tags,
621
+ 'username': username,
622
+ },
623
+ body: requestBody,
624
+ mediaType: 'application/json',
625
+ });
626
+ }
627
+ /**
628
+ * List available notification types
629
+ * Returns notification types enabled for this platform, annotated with the user's per-type preferences. RBAC: Ibl.Notifications/Notification/read
630
+ * @returns AvailableNotificationType
631
+ * @throws ApiError
632
+ */
633
+ public static notificationV1PlatformsNotificationPreferencesAvailableTypesList({
634
+ platformKey,
635
+ tags,
636
+ username,
637
+ }: {
638
+ platformKey: string,
639
+ /**
640
+ * Comma-separated tags to filter by (e.g. 'learning,activity'). Returns types matching ANY tag.
641
+ */
642
+ tags?: string,
643
+ /**
644
+ * Username to manage preferences for (admin only). Defaults to authenticated user.
645
+ */
646
+ username?: string,
647
+ }): CancelablePromise<Array<AvailableNotificationType>> {
648
+ return __request(OpenAPI, {
649
+ method: 'GET',
650
+ url: '/api/notification/v1/platforms/{platform_key}/notification-preferences/available-types/',
651
+ path: {
652
+ 'platform_key': platformKey,
653
+ },
654
+ query: {
655
+ 'tags': tags,
656
+ 'username': username,
657
+ },
658
+ });
659
+ }
660
+ /**
661
+ * Update per-type notification preference
662
+ * Set enabled/frequency for a single notification type. RBAC: Ibl.Notifications/Notification/write
663
+ * @returns NotificationTypePreference
664
+ * @throws ApiError
665
+ */
666
+ public static notificationV1PlatformsNotificationPreferencesTypesPartialUpdate({
667
+ notificationType,
668
+ platformKey,
669
+ tags,
670
+ username,
671
+ requestBody,
672
+ }: {
673
+ notificationType: string,
674
+ platformKey: string,
675
+ /**
676
+ * Comma-separated tags to filter by (e.g. 'learning,activity'). Returns types matching ANY tag.
677
+ */
678
+ tags?: string,
679
+ /**
680
+ * Username to manage preferences for (admin only). Defaults to authenticated user.
681
+ */
682
+ username?: string,
683
+ requestBody?: PatchedNotificationTypePreference,
684
+ }): CancelablePromise<NotificationTypePreference> {
685
+ return __request(OpenAPI, {
686
+ method: 'PATCH',
687
+ url: '/api/notification/v1/platforms/{platform_key}/notification-preferences/types/{notification_type}/',
688
+ path: {
689
+ 'notification_type': notificationType,
690
+ 'platform_key': platformKey,
691
+ },
692
+ query: {
693
+ 'tags': tags,
694
+ 'username': username,
695
+ },
696
+ body: requestBody,
697
+ mediaType: 'application/json',
698
+ });
699
+ }
552
700
  /**
553
701
  * List notification templates
554
702
  * Get all notification templates for the platform. Includes both platform-specific and inherited templates from main. Filter by tags with ?tags=learning,activity (comma-separated, OR logic). Requires permission: Ibl.Notifications/NotificationTemplate/list