@hobenakicoffee/libraries 6.8.2 → 6.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hobenakicoffee/libraries",
3
- "version": "6.8.2",
3
+ "version": "6.9.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "types": "src/index.ts",
@@ -1,6 +1,7 @@
1
1
  export * from "./common";
2
2
  export * from "./divisions";
3
3
  export * from "./legal";
4
+ export * from "./notifications";
4
5
  export * from "./payment";
5
6
  export * from "./platforms";
6
7
  export * from "./services";
@@ -0,0 +1,15 @@
1
+ export const NotificationTypes = {
2
+ GIFT_RECEIVED: "gift.received",
3
+ NEW_FOLLOWER: "follow.new_follower",
4
+ NEW_SUPPORTER: "supporter.new_supporter",
5
+ NEW_MEMBER: "membership.new_member",
6
+ MEMBERSHIP_EXPIRING: "membership.expiring",
7
+ WITHDRAWAL_STATUS_CHANGED: "withdrawal.status_changed",
8
+ PLATFORM_SUBSCRIPTION_EXPIRING: "platform_subscription.expiring",
9
+ KYC_STATUS_CHANGED: "kyc.status_changed",
10
+ } as const;
11
+
12
+ export type NotificationType =
13
+ (typeof NotificationTypes)[keyof typeof NotificationTypes];
14
+
15
+ export type NotificationCategory = "earnings" | "engagement" | "account";
@@ -1444,6 +1444,75 @@ export type Database = {
1444
1444
  },
1445
1445
  ];
1446
1446
  };
1447
+ notification_preference_overrides: {
1448
+ Row: {
1449
+ enabled: boolean;
1450
+ notification_type_key: string;
1451
+ updated_at: string;
1452
+ user_id: string;
1453
+ };
1454
+ Insert: {
1455
+ enabled: boolean;
1456
+ notification_type_key: string;
1457
+ updated_at?: string;
1458
+ user_id: string;
1459
+ };
1460
+ Update: {
1461
+ enabled?: boolean;
1462
+ notification_type_key?: string;
1463
+ updated_at?: string;
1464
+ user_id?: string;
1465
+ };
1466
+ Relationships: [
1467
+ {
1468
+ foreignKeyName: "notification_preference_overrides_notification_type_key_fkey";
1469
+ columns: ["notification_type_key"];
1470
+ isOneToOne: false;
1471
+ referencedRelation: "notification_types";
1472
+ referencedColumns: ["key"];
1473
+ },
1474
+ {
1475
+ foreignKeyName: "notification_preference_overrides_user_id_fkey";
1476
+ columns: ["user_id"];
1477
+ isOneToOne: false;
1478
+ referencedRelation: "profiles";
1479
+ referencedColumns: ["id"];
1480
+ },
1481
+ ];
1482
+ };
1483
+ notification_types: {
1484
+ Row: {
1485
+ category: string;
1486
+ created_at: string;
1487
+ default_enabled: boolean;
1488
+ description: string | null;
1489
+ is_active: boolean;
1490
+ key: string;
1491
+ label: string;
1492
+ service: string;
1493
+ };
1494
+ Insert: {
1495
+ category: string;
1496
+ created_at?: string;
1497
+ default_enabled?: boolean;
1498
+ description?: string | null;
1499
+ is_active?: boolean;
1500
+ key: string;
1501
+ label: string;
1502
+ service: string;
1503
+ };
1504
+ Update: {
1505
+ category?: string;
1506
+ created_at?: string;
1507
+ default_enabled?: boolean;
1508
+ description?: string | null;
1509
+ is_active?: boolean;
1510
+ key?: string;
1511
+ label?: string;
1512
+ service?: string;
1513
+ };
1514
+ Relationships: [];
1515
+ };
1447
1516
  payout_methods: {
1448
1517
  Row: {
1449
1518
  created_at: string;
@@ -1715,6 +1784,7 @@ export type Database = {
1715
1784
  categories: string[] | null;
1716
1785
  created_at: string | null;
1717
1786
  display_name: string | null;
1787
+ email_notifications_enabled: boolean;
1718
1788
  first_service_name: string | null;
1719
1789
  follower_count: number | null;
1720
1790
  following_count: number | null;
@@ -1748,6 +1818,7 @@ export type Database = {
1748
1818
  categories?: string[] | null;
1749
1819
  created_at?: string | null;
1750
1820
  display_name?: string | null;
1821
+ email_notifications_enabled?: boolean;
1751
1822
  first_service_name?: string | null;
1752
1823
  follower_count?: number | null;
1753
1824
  following_count?: number | null;
@@ -1781,6 +1852,7 @@ export type Database = {
1781
1852
  categories?: string[] | null;
1782
1853
  created_at?: string | null;
1783
1854
  display_name?: string | null;
1855
+ email_notifications_enabled?: boolean;
1784
1856
  first_service_name?: string | null;
1785
1857
  follower_count?: number | null;
1786
1858
  following_count?: number | null;
@@ -3555,6 +3627,10 @@ export type Database = {
3555
3627
  total_post_views: number;
3556
3628
  }[];
3557
3629
  };
3630
+ get_notification_preferences: {
3631
+ Args: { p_target_user_id?: string };
3632
+ Returns: Json;
3633
+ };
3558
3634
  get_or_create_direct_conversation: {
3559
3635
  Args: { p_recipient_id: string };
3560
3636
  Returns: string;
@@ -3881,6 +3957,10 @@ export type Database = {
3881
3957
  Returns: Json;
3882
3958
  };
3883
3959
  is_admin: { Args: never; Returns: boolean };
3960
+ is_email_notification_enabled: {
3961
+ Args: { p_type_key: string; p_user_id: string };
3962
+ Returns: boolean;
3963
+ };
3884
3964
  is_following: { Args: { target_user_id: string }; Returns: boolean };
3885
3965
  is_manager: { Args: { user_email: string }; Returns: boolean };
3886
3966
  mark_conversation_as_read: {
@@ -4055,6 +4135,14 @@ export type Database = {
4055
4135
  sender_id: string;
4056
4136
  }[];
4057
4137
  };
4138
+ set_notification_preference: {
4139
+ Args: {
4140
+ p_enabled: boolean;
4141
+ p_target_user_id?: string;
4142
+ p_type_key: string;
4143
+ };
4144
+ Returns: Json;
4145
+ };
4058
4146
  set_shop_active_by_manager: {
4059
4147
  Args: { p_is_active: boolean; p_profile_id: string };
4060
4148
  Returns: Json;
@@ -4092,6 +4180,10 @@ export type Database = {
4092
4180
  };
4093
4181
  Returns: Json;
4094
4182
  };
4183
+ update_email_notifications_enabled: {
4184
+ Args: { p_enabled: boolean; p_target_user_id?: string };
4185
+ Returns: Json;
4186
+ };
4095
4187
  update_order_tracking: {
4096
4188
  Args: {
4097
4189
  p_carrier?: string;