@hobenakicoffee/libraries 3.1.0 → 3.3.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": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "type": "module",
5
5
  "types": "src/index.ts",
6
6
  "exports": {
@@ -10,3 +10,12 @@ export const parseAsDateRange = parseAsJson(
10
10
  to: z.date().optional(),
11
11
  })
12
12
  );
13
+
14
+ export const parseAsLastTimeRange = parseAsStringLiteral([
15
+ "last_7_days",
16
+ "last_30_days",
17
+ "last_90_days",
18
+ "last_180_days",
19
+ "last_year",
20
+ ]);
21
+ export type LastTimeRange = inferParserType<typeof parseAsLastTimeRange>;
package/src/nuqs/index.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from "./common";
2
- export * from "./transactions";
@@ -1740,6 +1740,34 @@ export type Database = {
1740
1740
  spent_total: number;
1741
1741
  }[];
1742
1742
  };
1743
+ get_transactions_page: {
1744
+ Args: {
1745
+ p_amount_sort?: string;
1746
+ p_cursor_amount?: number;
1747
+ p_cursor_ts?: string;
1748
+ p_date_from?: string;
1749
+ p_date_to?: string;
1750
+ p_limit?: number;
1751
+ p_providers?: string[];
1752
+ p_reference_types?: string[];
1753
+ p_service_types?: string[];
1754
+ p_statuses?: string[];
1755
+ };
1756
+ Returns: {
1757
+ created_at: string;
1758
+ direction: Database["public"]["Enums"]["transaction_direction_enum"];
1759
+ id: string;
1760
+ metadata: Json;
1761
+ net_amount: number;
1762
+ platform_fee: number;
1763
+ provider: Database["public"]["Enums"]["provider_enum"];
1764
+ provider_transaction_id: string;
1765
+ reference_type: Database["public"]["Enums"]["reference_type_enum"];
1766
+ service_type: string;
1767
+ status: Database["public"]["Enums"]["payment_status_enum"];
1768
+ supporter_id: string;
1769
+ }[];
1770
+ };
1743
1771
  gift_newsletter_post: {
1744
1772
  Args: {
1745
1773
  p_expires_at?: string;
@@ -1,31 +0,0 @@
1
- import {
2
- type inferParserType,
3
- parseAsArrayOf,
4
- parseAsStringLiteral,
5
- } from "nuqs";
6
- import {
7
- PaymentProviders,
8
- PaymentStatuses,
9
- PaymentTypes,
10
- ServiceTypes,
11
- } from "../constants";
12
- import { parseAsDateRange, parseAsSortOrder } from "./common";
13
-
14
- export const transactionsFilterParsers = {
15
- statuses: parseAsArrayOf(
16
- parseAsStringLiteral(Object.values(PaymentStatuses))
17
- ),
18
- types: parseAsArrayOf(parseAsStringLiteral(Object.values(PaymentTypes))),
19
- serviceTypes: parseAsArrayOf(
20
- parseAsStringLiteral(Object.values(ServiceTypes))
21
- ),
22
- providers: parseAsArrayOf(
23
- parseAsStringLiteral(Object.values(PaymentProviders))
24
- ),
25
- dateRange: parseAsDateRange,
26
- amountSort: parseAsSortOrder,
27
- };
28
-
29
- export type TransactionFilters = inferParserType<
30
- typeof transactionsFilterParsers
31
- >;