@hobenakicoffee/libraries 1.24.0 → 1.26.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
package/src/types/supabase.ts
CHANGED
|
@@ -610,7 +610,6 @@ export type Database = {
|
|
|
610
610
|
};
|
|
611
611
|
newsletter_post_versions: {
|
|
612
612
|
Row: {
|
|
613
|
-
ai_summary: string | null;
|
|
614
613
|
content: string | null;
|
|
615
614
|
created_at: string;
|
|
616
615
|
id: string;
|
|
@@ -620,7 +619,6 @@ export type Database = {
|
|
|
620
619
|
version_number: number;
|
|
621
620
|
};
|
|
622
621
|
Insert: {
|
|
623
|
-
ai_summary?: string | null;
|
|
624
622
|
content?: string | null;
|
|
625
623
|
created_at?: string;
|
|
626
624
|
id?: string;
|
|
@@ -630,7 +628,6 @@ export type Database = {
|
|
|
630
628
|
version_number: number;
|
|
631
629
|
};
|
|
632
630
|
Update: {
|
|
633
|
-
ai_summary?: string | null;
|
|
634
631
|
content?: string | null;
|
|
635
632
|
created_at?: string;
|
|
636
633
|
id?: string;
|
|
@@ -1497,6 +1494,7 @@ export type Database = {
|
|
|
1497
1494
|
has_access: boolean;
|
|
1498
1495
|
}[];
|
|
1499
1496
|
};
|
|
1497
|
+
cleanup_orphaned_post_images: { Args: never; Returns: undefined };
|
|
1500
1498
|
create_manager: {
|
|
1501
1499
|
Args: {
|
|
1502
1500
|
manager_department?: string;
|
|
@@ -1506,6 +1504,14 @@ export type Database = {
|
|
|
1506
1504
|
};
|
|
1507
1505
|
Returns: string;
|
|
1508
1506
|
};
|
|
1507
|
+
create_newsletter_draft: {
|
|
1508
|
+
Args: { p_profile_id: string };
|
|
1509
|
+
Returns: {
|
|
1510
|
+
id: string;
|
|
1511
|
+
slug: string;
|
|
1512
|
+
title: string;
|
|
1513
|
+
}[];
|
|
1514
|
+
};
|
|
1509
1515
|
create_next_month_partition: { Args: never; Returns: undefined };
|
|
1510
1516
|
custom_access_token_hook: { Args: { event: Json }; Returns: Json };
|
|
1511
1517
|
drop_old_partitions: { Args: never; Returns: undefined };
|
|
@@ -1806,7 +1812,7 @@ export type Database = {
|
|
|
1806
1812
|
| "refunded"
|
|
1807
1813
|
| "reviewing";
|
|
1808
1814
|
payout_provider: "bkash" | "nagad" | "rocket" | "bank";
|
|
1809
|
-
post_status_enum: "draft" | "published" | "archived";
|
|
1815
|
+
post_status_enum: "draft" | "published" | "archived" | "review";
|
|
1810
1816
|
post_version_source_enum:
|
|
1811
1817
|
| "autosave"
|
|
1812
1818
|
| "ai_polish"
|
|
@@ -2056,7 +2062,7 @@ export const Constants = {
|
|
|
2056
2062
|
"reviewing",
|
|
2057
2063
|
],
|
|
2058
2064
|
payout_provider: ["bkash", "nagad", "rocket", "bank"],
|
|
2059
|
-
post_status_enum: ["draft", "published", "archived"],
|
|
2065
|
+
post_status_enum: ["draft", "published", "archived", "review"],
|
|
2060
2066
|
post_version_source_enum: [
|
|
2061
2067
|
"autosave",
|
|
2062
2068
|
"ai_polish",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { getNewsletterPostLink } from "./get-newsletter-post-link";
|
|
3
|
+
|
|
4
|
+
describe("getNewsletterPostLink", () => {
|
|
5
|
+
test("builds relative path without baseUrl", () => {
|
|
6
|
+
const result = getNewsletterPostLink("johndoe", "my-post");
|
|
7
|
+
expect(result).toBe("/@johndoe/posts/my-post");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test("builds absolute URL with baseUrl", () => {
|
|
11
|
+
const result = getNewsletterPostLink(
|
|
12
|
+
"johndoe",
|
|
13
|
+
"my-post",
|
|
14
|
+
"https://hobenaki.coffee"
|
|
15
|
+
);
|
|
16
|
+
expect(result).toBe("https://hobenaki.coffee/@johndoe/posts/my-post");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("handles different usernames and slugs", () => {
|
|
20
|
+
expect(getNewsletterPostLink("alice", "welcome-newsletter")).toBe(
|
|
21
|
+
"/@alice/posts/welcome-newsletter"
|
|
22
|
+
);
|
|
23
|
+
expect(getNewsletterPostLink("bob", "updates-2024")).toBe(
|
|
24
|
+
"/@bob/posts/updates-2024"
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/utils/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./format-count";
|
|
|
4
4
|
export * from "./format-date";
|
|
5
5
|
export * from "./format-number";
|
|
6
6
|
export * from "./format-plain-text";
|
|
7
|
+
export * from "./get-newsletter-post-link";
|
|
7
8
|
export * from "./get-social-handle";
|
|
8
9
|
export * from "./get-social-link";
|
|
9
10
|
export * from "./get-user-name-initials";
|