@hobenakicoffee/libraries 2.0.0 → 3.0.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": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "type": "module",
5
5
  "types": "src/index.ts",
6
6
  "exports": {
@@ -1 +1,58 @@
1
+ import type { ServiceType } from "../constants";
2
+
3
+ export type TransactionMetadata = {
4
+ supporter_name?: string;
5
+ supporter_platform?: string;
6
+ is_monthly?: boolean;
7
+ message?: string;
8
+ count?: number;
9
+ };
10
+
11
+ export type ActivityMetadata = {
12
+ type?: string;
13
+ amount?: number;
14
+ net_amount?: number;
15
+ platform_fee?: number;
16
+ price_at_purchase?: number;
17
+ message?: string;
18
+ item_name?: string;
19
+ buyer_name?: string;
20
+ buyer_platform?: string;
21
+ commission_type?: string;
22
+ requester_name?: string;
23
+ coffee_count?: number;
24
+ is_monthly?: boolean;
25
+ supporter_id?: string;
26
+ supporter_name?: string;
27
+ supporter_platform?: string;
28
+ supporter_anonymous?: boolean;
29
+ identity_hash?: string;
30
+ follower_name?: string;
31
+ follower_username?: string;
32
+ source?: string;
33
+ post_id?: string;
34
+ post_slug?: string;
35
+ post_title?: string;
36
+ plan_id?: string;
37
+ plan_name?: string;
38
+ service_type?: string;
39
+ billing_cycle?: string;
40
+ period_end?: string;
41
+ action?: "follow" | "unfollow";
42
+ };
43
+
44
+ export type SupportersMetadata = {
45
+ type?: ServiceType;
46
+ amount?: number;
47
+ message?: string;
48
+ coffee_count?: number;
49
+ is_monthly?: boolean;
50
+ supporter_name?: string;
51
+ supporter_platform?: string;
52
+ supporter_anonymous?: boolean;
53
+ follower_name?: string;
54
+ follower_username?: string;
55
+ action?: "follow" | "unfollow";
56
+ };
57
+
1
58
  export * from "./supabase";
@@ -337,6 +337,38 @@ export type Database = {
337
337
  };
338
338
  Relationships: [];
339
339
  };
340
+ membership_notifications: {
341
+ Row: {
342
+ created_at: string;
343
+ id: string;
344
+ notification_type: Database["public"]["Enums"]["membership_notification_type_enum"];
345
+ profile_membership_id: string;
346
+ sent_at: string;
347
+ };
348
+ Insert: {
349
+ created_at?: string;
350
+ id?: string;
351
+ notification_type: Database["public"]["Enums"]["membership_notification_type_enum"];
352
+ profile_membership_id: string;
353
+ sent_at?: string;
354
+ };
355
+ Update: {
356
+ created_at?: string;
357
+ id?: string;
358
+ notification_type?: Database["public"]["Enums"]["membership_notification_type_enum"];
359
+ profile_membership_id?: string;
360
+ sent_at?: string;
361
+ };
362
+ Relationships: [
363
+ {
364
+ foreignKeyName: "membership_notifications_profile_membership_id_fkey";
365
+ columns: ["profile_membership_id"];
366
+ isOneToOne: false;
367
+ referencedRelation: "profile_memberships";
368
+ referencedColumns: ["id"];
369
+ },
370
+ ];
371
+ };
340
372
  membership_plans: {
341
373
  Row: {
342
374
  access_config: Json;
@@ -1748,6 +1780,58 @@ export type Database = {
1748
1780
  Args: { p_conversation_id: string };
1749
1781
  Returns: undefined;
1750
1782
  };
1783
+ process_membership_expiry_notifications: {
1784
+ Args: never;
1785
+ Returns: undefined;
1786
+ };
1787
+ process_service_payment: {
1788
+ Args: {
1789
+ p_amount: number;
1790
+ p_creator_profile_id: string;
1791
+ p_identity_hash: string;
1792
+ p_metadata?: Json;
1793
+ p_platform_fee: number;
1794
+ p_provider: Database["public"]["Enums"]["provider_enum"];
1795
+ p_provider_transaction_id: string;
1796
+ p_reference_type: Database["public"]["Enums"]["reference_type_enum"];
1797
+ p_service_type: string;
1798
+ p_supporter_name: string;
1799
+ p_supporter_platform?: Database["public"]["Enums"]["supporter_platform_enum"];
1800
+ p_supporter_profile_id: string;
1801
+ };
1802
+ Returns: Json;
1803
+ };
1804
+ purchase_newsletter_membership: {
1805
+ Args: {
1806
+ p_buyer_name: string;
1807
+ p_buyer_platform?: Database["public"]["Enums"]["supporter_platform_enum"];
1808
+ p_buyer_profile_id: string;
1809
+ p_identity_hash: string;
1810
+ p_message?: string;
1811
+ p_plan_id: string;
1812
+ p_platform_fee: number;
1813
+ p_provider: Database["public"]["Enums"]["provider_enum"];
1814
+ p_provider_transaction_id: string;
1815
+ p_source?: string;
1816
+ };
1817
+ Returns: Json;
1818
+ };
1819
+ purchase_newsletter_post: {
1820
+ Args: {
1821
+ p_amount: number;
1822
+ p_buyer_name: string;
1823
+ p_buyer_platform?: Database["public"]["Enums"]["supporter_platform_enum"];
1824
+ p_buyer_profile_id: string;
1825
+ p_identity_hash: string;
1826
+ p_message?: string;
1827
+ p_platform_fee: number;
1828
+ p_post_id: string;
1829
+ p_provider: Database["public"]["Enums"]["provider_enum"];
1830
+ p_provider_transaction_id: string;
1831
+ p_source?: string;
1832
+ };
1833
+ Returns: Json;
1834
+ };
1751
1835
  record_newsletter_post_click: {
1752
1836
  Args: { p_post_id: string };
1753
1837
  Returns: undefined;
@@ -1830,6 +1914,13 @@ export type Database = {
1830
1914
  | "developer_manager";
1831
1915
  manager_status: "ACTIVE" | "INACTIVE" | "SUSPENDED";
1832
1916
  membership_billing_cycle_enum: "monthly" | "annual" | "lifetime";
1917
+ membership_notification_type_enum:
1918
+ | "5_days"
1919
+ | "3_days"
1920
+ | "1_day"
1921
+ | "expired"
1922
+ | "3_days_post"
1923
+ | "7_days_post";
1833
1924
  membership_status_enum:
1834
1925
  | "active"
1835
1926
  | "cancelled"
@@ -2078,6 +2169,14 @@ export const Constants = {
2078
2169
  ],
2079
2170
  manager_status: ["ACTIVE", "INACTIVE", "SUSPENDED"],
2080
2171
  membership_billing_cycle_enum: ["monthly", "annual", "lifetime"],
2172
+ membership_notification_type_enum: [
2173
+ "5_days",
2174
+ "3_days",
2175
+ "1_day",
2176
+ "expired",
2177
+ "3_days_post",
2178
+ "7_days_post",
2179
+ ],
2081
2180
  membership_status_enum: [
2082
2181
  "active",
2083
2182
  "cancelled",