@hobenakicoffee/libraries 0.0.7 → 0.0.9

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": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "types": "src/index.ts",
6
6
  "exports": {
@@ -0,0 +1,33 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { Visibility } from "./common";
3
+ import type { Visibility as VisibilityType } from "./common";
4
+
5
+ describe("Visibility", () => {
6
+ test("should contain all expected keys", () => {
7
+ const expectedKeys = ["PUBLIC", "PRIVATE"];
8
+ expect(Object.keys(Visibility)).toEqual(expectedKeys);
9
+ });
10
+
11
+ test("should have correct values for each visibility", () => {
12
+ expect(Visibility.PUBLIC).toBe("public");
13
+ expect(Visibility.PRIVATE).toBe("private");
14
+ });
15
+
16
+ test("should be usable as Visibility type", () => {
17
+ const pub: VisibilityType = "public";
18
+ const priv: VisibilityType = "private";
19
+ expect(pub).toBe("public");
20
+ expect(priv).toBe("private");
21
+ });
22
+
23
+ test("should have 2 visibilities", () => {
24
+ expect(Object.keys(Visibility).length).toBe(2);
25
+ });
26
+
27
+ test("all values should be lowercase strings", () => {
28
+ Object.values(Visibility).forEach((v) => {
29
+ expect(v).toBe(v.toLowerCase() as VisibilityType);
30
+ expect(typeof v).toBe("string");
31
+ });
32
+ });
33
+ });
@@ -0,0 +1,6 @@
1
+ export const Visibility = {
2
+ PUBLIC: "public",
3
+ PRIVATE: "private",
4
+ } as const;
5
+
6
+ export type Visibility = (typeof Visibility)[keyof typeof Visibility];
@@ -1,80 +1,5 @@
1
- export const productInfo = {
2
- name: "হবে নাকি Coffee?",
3
- domain: "https://www.hobenakicoffee.com",
4
- twitterHandle: "@hobenakicoffee",
5
- title: "চিন্তা ছাড়া আয়, শুরু করো তাই — হবে নাকি Coffee, ঝামেলা সব ছাই!",
6
- description:
7
- "‘হবে নাকি Coffee?’ দিয়ে যে কেউ ঝামেলা ছাড়াই নিজের অনলাইন ব্যবসা বা আয় শুরু করতে পারে। লিগ্যাল, কোম্পানি ফরমেশন বা কাগজপত্র নিয়ে ভাবতে হবে না—সবকিছু আমরা দেখি। শুধু একটি লিংক শেয়ার করুন, আর যে কেউ Coffee/Tip দিয়ে আপনাকে সাপোর্ট করতে পারবে। চাইলে এক্সক্লুসিভ কনটেন্ট, ডিজিটাল পণ্য বা মার্চ, গিফট, পার্সোনাল শাউটআউট কিংবা সার্ভিসও অফার করা যায়। কনটেন্ট ক্রিয়েটর, ফ্রিল্যান্সার, ছোট ব্যবসা, কমিউনিটি বা ইভেন্ট অর্গানাইজার, চ্যারিটি উদ্যোগ বা ব্যক্তিগত লক্ষ্য—সবার জন্যই HobeNakiCoffee হলো অনলাইনে আয় ও সাপোর্ট নেওয়ার সহজ, ঝামেলামুক্ত প্ল্যাটফর্ম।",
8
- keywords:
9
- "হবে নাকি Coffee, buy me a coffee, tip jar, support link, support me, donate, online income bangla, extra income, monetization, payment link, audience support, exclusive content, digital product, merch, shoutout, fundraising, charity, small business support, freelancer support, Bangladesh",
10
- };
11
-
12
- export const companyInfo = {
13
- name: "Shamscorner LLC",
14
- contactEmail: "mail@shamscorner.com",
15
- contactPhone: "+1(817) 973-7285",
16
- contactLocation: "7320, 1021 E Lincolnway, Cheyenne, WY, Laramie, US, 82001",
17
- contactWhatsapp: "https://wa.me/13072212615",
18
- contactX: "https://www.x.com/shamscorner_llc",
19
- contactFacebook: "https://www.facebook.com/shamscorner.llc",
20
- contactYoutube: "https://www.youtube.com/@shamscorner",
21
- contactLinkedin: "https://www.linkedin.com/company/shamscorner",
22
- domain: "https://www.shamscorner.com",
23
- postalAddress: {
24
- streetAddress: "1021 E Lincolnway Suite 7320",
25
- addressLocality: "Cheyenne",
26
- addressRegion: "WY",
27
- postalCode: "82001",
28
- addressCountry: "US",
29
- },
30
- };
31
-
32
- export const PaymentTypes = {
33
- SUBSCRIPTION: "subscription",
34
- ONE_TIME: "one-time",
35
- } as const;
36
-
37
- export type PaymentType = (typeof PaymentTypes)[keyof typeof PaymentTypes];
38
-
39
- export const SupporterPlatforms = {
40
- FACEBOOK: "facebook",
41
- X: "x",
42
- INSTAGRAM: "instagram",
43
- YOUTUBE: "youtube",
44
- GITHUB: "github",
45
- LINKEDIN: "linkedin",
46
- TWITCH: "twitch",
47
- TIKTOK: "tiktok",
48
- THREADS: "threads",
49
- WHATSAPP: "whatsapp",
50
- TELEGRAM: "telegram",
51
- DISCORD: "discord",
52
- REDDIT: "reddit",
53
- PINTEREST: "pinterest",
54
- MEDIUM: "medium",
55
- DEVTO: "devto",
56
- BEHANCE: "behance",
57
- DRIBBBLE: "dribbble",
58
- } as const;
59
-
60
- export type SupporterPlatform =
61
- (typeof SupporterPlatforms)[keyof typeof SupporterPlatforms];
62
-
63
- export const PaymentStatuses = {
64
- PENDING: "pending",
65
- COMPLETED: "completed",
66
- FAILED: "failed",
67
- CANCELLED: "cancelled",
68
- REFUNDED: "refunded",
69
- REVIEWING: "reviewing",
70
- } as const;
71
-
72
- export type PaymentStatus =
73
- (typeof PaymentStatuses)[keyof typeof PaymentStatuses];
74
-
75
- export const ServiceTypes = {
76
- GIFT: "gift",
77
- EXCLUSIVE_CONTENT: "exclusive_content",
78
- } as const;
79
-
80
- export type ServiceType = (typeof ServiceTypes)[keyof typeof ServiceTypes];
1
+ export * from "./common";
2
+ export * from "./legal";
3
+ export * from "./payment";
4
+ export * from "./platforms";
5
+ export * from "./services";
@@ -0,0 +1,61 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { productInfo, companyInfo } from "./legal";
3
+
4
+ describe("productInfo", () => {
5
+ test("should have all required fields", () => {
6
+ expect(productInfo).toHaveProperty("name");
7
+ expect(productInfo).toHaveProperty("domain");
8
+ expect(productInfo).toHaveProperty("twitterHandle");
9
+ expect(productInfo).toHaveProperty("title");
10
+ expect(productInfo).toHaveProperty("description");
11
+ expect(productInfo).toHaveProperty("keywords");
12
+ });
13
+
14
+ test("should have correct types for fields", () => {
15
+ expect(typeof productInfo.name).toBe("string");
16
+ expect(typeof productInfo.domain).toBe("string");
17
+ expect(typeof productInfo.twitterHandle).toBe("string");
18
+ expect(typeof productInfo.title).toBe("string");
19
+ expect(typeof productInfo.description).toBe("string");
20
+ expect(typeof productInfo.keywords).toBe("string");
21
+ });
22
+ });
23
+
24
+ describe("companyInfo", () => {
25
+ test("should have all required fields", () => {
26
+ expect(companyInfo).toHaveProperty("name");
27
+ expect(companyInfo).toHaveProperty("contactEmail");
28
+ expect(companyInfo).toHaveProperty("contactPhone");
29
+ expect(companyInfo).toHaveProperty("contactLocation");
30
+ expect(companyInfo).toHaveProperty("contactWhatsapp");
31
+ expect(companyInfo).toHaveProperty("contactX");
32
+ expect(companyInfo).toHaveProperty("contactFacebook");
33
+ expect(companyInfo).toHaveProperty("contactYoutube");
34
+ expect(companyInfo).toHaveProperty("contactLinkedin");
35
+ expect(companyInfo).toHaveProperty("domain");
36
+ expect(companyInfo).toHaveProperty("postalAddress");
37
+ });
38
+
39
+ test("should have correct types for fields", () => {
40
+ expect(typeof companyInfo.name).toBe("string");
41
+ expect(typeof companyInfo.contactEmail).toBe("string");
42
+ expect(typeof companyInfo.contactPhone).toBe("string");
43
+ expect(typeof companyInfo.contactLocation).toBe("string");
44
+ expect(typeof companyInfo.contactWhatsapp).toBe("string");
45
+ expect(typeof companyInfo.contactX).toBe("string");
46
+ expect(typeof companyInfo.contactFacebook).toBe("string");
47
+ expect(typeof companyInfo.contactYoutube).toBe("string");
48
+ expect(typeof companyInfo.contactLinkedin).toBe("string");
49
+ expect(typeof companyInfo.domain).toBe("string");
50
+ expect(typeof companyInfo.postalAddress).toBe("object");
51
+ });
52
+
53
+ test("postalAddress should have all required fields", () => {
54
+ const address = companyInfo.postalAddress;
55
+ expect(address).toHaveProperty("streetAddress");
56
+ expect(address).toHaveProperty("addressLocality");
57
+ expect(address).toHaveProperty("addressRegion");
58
+ expect(address).toHaveProperty("postalCode");
59
+ expect(address).toHaveProperty("addressCountry");
60
+ });
61
+ });
@@ -0,0 +1,30 @@
1
+ export const productInfo = {
2
+ name: "হবে নাকি Coffee?",
3
+ domain: "https://www.hobenakicoffee.com",
4
+ twitterHandle: "@hobenakicoffee",
5
+ title: "চিন্তা ছাড়া আয়, শুরু করো তাই — হবে নাকি Coffee, ঝামেলা সব ছাই!",
6
+ description:
7
+ "‘হবে নাকি Coffee?’ দিয়ে যে কেউ ঝামেলা ছাড়াই নিজের অনলাইন ব্যবসা বা আয় শুরু করতে পারে। লিগ্যাল, কোম্পানি ফরমেশন বা কাগজপত্র নিয়ে ভাবতে হবে না—সবকিছু আমরা দেখি। শুধু একটি লিংক শেয়ার করুন, আর যে কেউ Coffee/Tip দিয়ে আপনাকে সাপোর্ট করতে পারবে। চাইলে এক্সক্লুসিভ কনটেন্ট, ডিজিটাল পণ্য বা মার্চ, গিফট, পার্সোনাল শাউটআউট কিংবা সার্ভিসও অফার করা যায়। কনটেন্ট ক্রিয়েটর, ফ্রিল্যান্সার, ছোট ব্যবসা, কমিউনিটি বা ইভেন্ট অর্গানাইজার, চ্যারিটি উদ্যোগ বা ব্যক্তিগত লক্ষ্য—সবার জন্যই HobeNakiCoffee হলো অনলাইনে আয় ও সাপোর্ট নেওয়ার সহজ, ঝামেলামুক্ত প্ল্যাটফর্ম।",
8
+ keywords:
9
+ "হবে নাকি Coffee, buy me a coffee, tip jar, support link, support me, donate, online income bangla, extra income, monetization, payment link, audience support, exclusive content, digital product, merch, shoutout, fundraising, charity, small business support, freelancer support, Bangladesh",
10
+ };
11
+
12
+ export const companyInfo = {
13
+ name: "Shamscorner LLC",
14
+ contactEmail: "mail@shamscorner.com",
15
+ contactPhone: "+1(817) 973-7285",
16
+ contactLocation: "7320, 1021 E Lincolnway, Cheyenne, WY, Laramie, US, 82001",
17
+ contactWhatsapp: "https://wa.me/13072212615",
18
+ contactX: "https://www.x.com/shamscorner_llc",
19
+ contactFacebook: "https://www.facebook.com/shamscorner.llc",
20
+ contactYoutube: "https://www.youtube.com/@shamscorner",
21
+ contactLinkedin: "https://www.linkedin.com/company/shamscorner",
22
+ domain: "https://www.shamscorner.com",
23
+ postalAddress: {
24
+ streetAddress: "1021 E Lincolnway Suite 7320",
25
+ addressLocality: "Cheyenne",
26
+ addressRegion: "WY",
27
+ postalCode: "82001",
28
+ addressCountry: "US",
29
+ },
30
+ };
@@ -0,0 +1,188 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import {
3
+ PaymentProviders,
4
+ PaymentStatuses,
5
+ PaymentTypes,
6
+ PaymentDirections,
7
+ } from "./payment";
8
+ import type {
9
+ PaymentProvider,
10
+ PaymentStatus,
11
+ PaymentType,
12
+ PaymentDirection,
13
+ } from "./payment";
14
+
15
+ describe("PaymentStatuses", () => {
16
+ test("should contain all expected status keys", () => {
17
+ const expectedKeys = [
18
+ "PENDING",
19
+ "PROCESSING",
20
+ "COMPLETED",
21
+ "FAILED",
22
+ "REVERSED",
23
+ "CANCELLED",
24
+ "REFUNDED",
25
+ "REVIEWING",
26
+ ];
27
+ expect(Object.keys(PaymentStatuses)).toEqual(expectedKeys);
28
+ });
29
+
30
+ test("should have correct values for each status", () => {
31
+ expect(PaymentStatuses.PENDING).toBe("pending");
32
+ expect(PaymentStatuses.PROCESSING).toBe("processing");
33
+ expect(PaymentStatuses.COMPLETED).toBe("completed");
34
+ expect(PaymentStatuses.FAILED).toBe("failed");
35
+ expect(PaymentStatuses.REVERSED).toBe("reversed");
36
+ expect(PaymentStatuses.CANCELLED).toBe("cancelled");
37
+ expect(PaymentStatuses.REFUNDED).toBe("refunded");
38
+ expect(PaymentStatuses.REVIEWING).toBe("reviewing");
39
+ });
40
+
41
+ test("should be read-only at compile time", () => {
42
+ // TypeScript prevents modification at compile time with 'as const'
43
+ // This test verifies the structure is correct
44
+ expect(Object.isFrozen(PaymentStatuses)).toBe(false);
45
+ expect(typeof PaymentStatuses).toBe("object");
46
+ });
47
+
48
+ test("PaymentStatus type should accept valid status values", () => {
49
+ const validStatus: PaymentStatus = "completed";
50
+ expect(validStatus).toBe("completed");
51
+ });
52
+
53
+ test("should have 8 payment statuses", () => {
54
+ expect(Object.keys(PaymentStatuses).length).toBe(8);
55
+ });
56
+
57
+ test("all values should be lowercase strings", () => {
58
+ Object.values(PaymentStatuses).forEach((status) => {
59
+ expect(status).toBe(status.toLowerCase() as PaymentStatus);
60
+ expect(typeof status).toBe("string");
61
+ });
62
+ });
63
+ });
64
+
65
+ describe("PaymentTypes", () => {
66
+ test("should contain all expected keys", () => {
67
+ const expectedKeys = ["SUBSCRIPTION", "ONE_TIME", "PAYOUT"];
68
+ expect(Object.keys(PaymentTypes)).toEqual(expectedKeys);
69
+ });
70
+
71
+ test("should have correct values for each type", () => {
72
+ expect(PaymentTypes.SUBSCRIPTION).toBe("subscription");
73
+ expect(PaymentTypes.ONE_TIME).toBe("one-time");
74
+ expect(PaymentTypes.PAYOUT).toBe("payout");
75
+ });
76
+
77
+ test("should be read-only at compile time", () => {
78
+ // TypeScript prevents modification at compile time with 'as const'
79
+ // This test verifies the structure is correct
80
+ expect(Object.isFrozen(PaymentTypes)).toBe(false);
81
+ expect(typeof PaymentTypes).toBe("object");
82
+ });
83
+
84
+ test("PaymentType type should accept valid type values", () => {
85
+ const validType: PaymentType = "subscription";
86
+ expect(validType).toBe("subscription");
87
+ });
88
+
89
+ test("should have 3 payment types", () => {
90
+ expect(Object.keys(PaymentTypes).length).toBe(3);
91
+ });
92
+
93
+ test("all values should be lowercase or kebab-case strings", () => {
94
+ Object.values(PaymentTypes).forEach((type) => {
95
+ expect(typeof type).toBe("string");
96
+ // Check that it contains lowercase letters, hyphens, or underscores
97
+ expect(type).toMatch(/^[a-z_-]+$/);
98
+ });
99
+ });
100
+ });
101
+
102
+ describe("PaymentProviders", () => {
103
+ test("should contain all expected provider keys", () => {
104
+ const expectedKeys = [
105
+ "HOBENAKICOFFEE",
106
+ "BKASH",
107
+ "NAGAD",
108
+ "ROCKET",
109
+ "UPAY",
110
+ "SSLCOMMERZ",
111
+ "AAMARPAY",
112
+ "PORTWALLET",
113
+ "TAP",
114
+ "OTHER",
115
+ ];
116
+ expect(Object.keys(PaymentProviders)).toEqual(expectedKeys);
117
+ });
118
+
119
+ test("should have correct values for each provider", () => {
120
+ expect(PaymentProviders.HOBENAKICOFFEE).toBe("HobeNakiCoffee");
121
+ expect(PaymentProviders.BKASH).toBe("Bkash");
122
+ expect(PaymentProviders.NAGAD).toBe("Nagad");
123
+ expect(PaymentProviders.ROCKET).toBe("Rocket");
124
+ expect(PaymentProviders.UPAY).toBe("Upay");
125
+ expect(PaymentProviders.SSLCOMMERZ).toBe("SSLCommerz");
126
+ expect(PaymentProviders.AAMARPAY).toBe("Aamarpay");
127
+ expect(PaymentProviders.PORTWALLET).toBe("Portwallet");
128
+ expect(PaymentProviders.TAP).toBe("Tap");
129
+ expect(PaymentProviders.OTHER).toBe("Other");
130
+ });
131
+ test("should allow HOBENAKICOFFEE as PaymentProvider type", () => {
132
+ const provider: PaymentProvider = PaymentProviders.HOBENAKICOFFEE;
133
+ expect(provider).toBe("HobeNakiCoffee");
134
+ });
135
+
136
+ test("should be read-only at compile time", () => {
137
+ // TypeScript prevents modification at compile time with 'as const'
138
+ // This test verifies the structure is correct
139
+ expect(Object.isFrozen(PaymentProviders)).toBe(false);
140
+ expect(typeof PaymentProviders).toBe("object");
141
+ });
142
+
143
+ test("PaymentProvider type should accept valid provider values", () => {
144
+ const validProvider: PaymentProvider = "Bkash";
145
+ expect(validProvider).toBe("Bkash");
146
+ });
147
+
148
+ test("should have 10 payment providers", () => {
149
+ expect(Object.keys(PaymentProviders).length).toBe(10);
150
+ });
151
+
152
+ test("all values should be lowercase strings", () => {
153
+ Object.values(PaymentProviders).forEach((provider) => {
154
+ expect(provider).toBe(provider as PaymentProvider);
155
+ expect(typeof provider).toBe("string");
156
+ });
157
+ });
158
+ });
159
+
160
+ describe("PaymentDirections", () => {
161
+ test("should contain all expected direction keys", () => {
162
+ const expectedKeys = ["DEBIT", "CREDIT"];
163
+ expect(Object.keys(PaymentDirections)).toEqual(expectedKeys);
164
+ });
165
+
166
+ test("should have correct values for each direction", () => {
167
+ expect(PaymentDirections.DEBIT).toBe("debit");
168
+ expect(PaymentDirections.CREDIT).toBe("credit");
169
+ });
170
+
171
+ test("should be usable as PaymentDirection type", () => {
172
+ const debit: PaymentDirection = "debit";
173
+ const credit: PaymentDirection = "credit";
174
+ expect(debit).toBe("debit");
175
+ expect(credit).toBe("credit");
176
+ });
177
+
178
+ test("should have 2 payment directions", () => {
179
+ expect(Object.keys(PaymentDirections).length).toBe(2);
180
+ });
181
+
182
+ test("all values should be lowercase strings", () => {
183
+ Object.values(PaymentDirections).forEach((direction) => {
184
+ expect(direction).toBe(direction.toLowerCase() as PaymentDirection);
185
+ expect(typeof direction).toBe("string");
186
+ });
187
+ });
188
+ });
@@ -0,0 +1,45 @@
1
+ export const PaymentTypes = {
2
+ SUBSCRIPTION: "subscription",
3
+ ONE_TIME: "one-time",
4
+ PAYOUT: "payout",
5
+ } as const;
6
+
7
+ export type PaymentType = (typeof PaymentTypes)[keyof typeof PaymentTypes];
8
+
9
+ export const PaymentStatuses = {
10
+ PENDING: "pending",
11
+ PROCESSING: "processing",
12
+ COMPLETED: "completed",
13
+ FAILED: "failed",
14
+ REVERSED: "reversed",
15
+ CANCELLED: "cancelled",
16
+ REFUNDED: "refunded",
17
+ REVIEWING: "reviewing",
18
+ } as const;
19
+
20
+ export type PaymentStatus =
21
+ (typeof PaymentStatuses)[keyof typeof PaymentStatuses];
22
+
23
+ export const PaymentProviders = {
24
+ HOBENAKICOFFEE: "HobeNakiCoffee",
25
+ BKASH: "Bkash",
26
+ NAGAD: "Nagad",
27
+ ROCKET: "Rocket",
28
+ UPAY: "Upay",
29
+ SSLCOMMERZ: "SSLCommerz",
30
+ AAMARPAY: "Aamarpay",
31
+ PORTWALLET: "Portwallet",
32
+ TAP: "Tap",
33
+ OTHER: "Other",
34
+ } as const;
35
+
36
+ export type PaymentProvider =
37
+ (typeof PaymentProviders)[keyof typeof PaymentProviders];
38
+
39
+ export const PaymentDirections = {
40
+ DEBIT: "debit",
41
+ CREDIT: "credit",
42
+ } as const;
43
+
44
+ export type PaymentDirection =
45
+ (typeof PaymentDirections)[keyof typeof PaymentDirections];
@@ -0,0 +1,66 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { SupporterPlatforms } from "./platforms";
3
+ import type { SupporterPlatform } from "./platforms";
4
+
5
+ describe("SupporterPlatforms", () => {
6
+ test("should contain all expected platform keys", () => {
7
+ const expectedKeys = [
8
+ "FACEBOOK",
9
+ "X",
10
+ "INSTAGRAM",
11
+ "YOUTUBE",
12
+ "GITHUB",
13
+ "LINKEDIN",
14
+ "TWITCH",
15
+ "TIKTOK",
16
+ "THREADS",
17
+ "WHATSAPP",
18
+ "TELEGRAM",
19
+ "DISCORD",
20
+ "REDDIT",
21
+ "PINTEREST",
22
+ "MEDIUM",
23
+ "DEVTO",
24
+ "BEHANCE",
25
+ "DRIBBBLE",
26
+ ];
27
+ expect(Object.keys(SupporterPlatforms)).toEqual(expectedKeys);
28
+ });
29
+
30
+ test("should have correct values for each platform", () => {
31
+ expect(SupporterPlatforms.FACEBOOK).toBe("facebook");
32
+ expect(SupporterPlatforms.X).toBe("x");
33
+ expect(SupporterPlatforms.INSTAGRAM).toBe("instagram");
34
+ expect(SupporterPlatforms.YOUTUBE).toBe("youtube");
35
+ expect(SupporterPlatforms.GITHUB).toBe("github");
36
+ expect(SupporterPlatforms.LINKEDIN).toBe("linkedin");
37
+ expect(SupporterPlatforms.TWITCH).toBe("twitch");
38
+ expect(SupporterPlatforms.TIKTOK).toBe("tiktok");
39
+ expect(SupporterPlatforms.THREADS).toBe("threads");
40
+ expect(SupporterPlatforms.WHATSAPP).toBe("whatsapp");
41
+ expect(SupporterPlatforms.TELEGRAM).toBe("telegram");
42
+ expect(SupporterPlatforms.DISCORD).toBe("discord");
43
+ expect(SupporterPlatforms.REDDIT).toBe("reddit");
44
+ expect(SupporterPlatforms.PINTEREST).toBe("pinterest");
45
+ expect(SupporterPlatforms.MEDIUM).toBe("medium");
46
+ expect(SupporterPlatforms.DEVTO).toBe("devto");
47
+ expect(SupporterPlatforms.BEHANCE).toBe("behance");
48
+ expect(SupporterPlatforms.DRIBBBLE).toBe("dribbble");
49
+ });
50
+
51
+ test("should be read-only at compile time", () => {
52
+ // TypeScript prevents modification at compile time with 'as const'
53
+ // This test verifies the structure is correct
54
+ expect(Object.isFrozen(SupporterPlatforms)).toBe(false);
55
+ expect(typeof SupporterPlatforms).toBe("object");
56
+ });
57
+
58
+ test("SupporterPlatform type should accept valid platform values", () => {
59
+ const validPlatform: SupporterPlatform = "facebook";
60
+ expect(validPlatform).toBe("facebook");
61
+ });
62
+
63
+ test("should have 18 platforms", () => {
64
+ expect(Object.keys(SupporterPlatforms).length).toBe(18);
65
+ });
66
+ });
@@ -0,0 +1,23 @@
1
+ export const SupporterPlatforms = {
2
+ FACEBOOK: "facebook",
3
+ X: "x",
4
+ INSTAGRAM: "instagram",
5
+ YOUTUBE: "youtube",
6
+ GITHUB: "github",
7
+ LINKEDIN: "linkedin",
8
+ TWITCH: "twitch",
9
+ TIKTOK: "tiktok",
10
+ THREADS: "threads",
11
+ WHATSAPP: "whatsapp",
12
+ TELEGRAM: "telegram",
13
+ DISCORD: "discord",
14
+ REDDIT: "reddit",
15
+ PINTEREST: "pinterest",
16
+ MEDIUM: "medium",
17
+ DEVTO: "devto",
18
+ BEHANCE: "behance",
19
+ DRIBBBLE: "dribbble",
20
+ } as const;
21
+
22
+ export type SupporterPlatform =
23
+ (typeof SupporterPlatforms)[keyof typeof SupporterPlatforms];
@@ -0,0 +1,39 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { ServiceTypes } from "./services";
3
+ import type { ServiceType } from "./services";
4
+
5
+ describe("ServiceTypes", () => {
6
+ test("should contain all expected service type keys", () => {
7
+ const expectedKeys = ["GIFT", "EXCLUSIVE_CONTENT"];
8
+ expect(Object.keys(ServiceTypes)).toEqual(expectedKeys);
9
+ });
10
+
11
+ test("should have correct values for each service type", () => {
12
+ expect(ServiceTypes.GIFT).toBe("gift");
13
+ expect(ServiceTypes.EXCLUSIVE_CONTENT).toBe("exclusive_content");
14
+ });
15
+
16
+ test("should be read-only at compile time", () => {
17
+ // TypeScript prevents modification at compile time with 'as const'
18
+ // This test verifies the structure is correct
19
+ expect(Object.isFrozen(ServiceTypes)).toBe(false);
20
+ expect(typeof ServiceTypes).toBe("object");
21
+ });
22
+
23
+ test("ServiceType type should accept valid service type values", () => {
24
+ const validType: ServiceType = "gift";
25
+ expect(validType).toBe("gift");
26
+ });
27
+
28
+ test("should have 2 service types", () => {
29
+ expect(Object.keys(ServiceTypes).length).toBe(2);
30
+ });
31
+
32
+ test("all values should be lowercase or snake_case strings", () => {
33
+ Object.values(ServiceTypes).forEach((type) => {
34
+ expect(typeof type).toBe("string");
35
+ // Check that it only contains lowercase letters and underscores
36
+ expect(type).toMatch(/^[a-z_]+$/);
37
+ });
38
+ });
39
+ });
@@ -0,0 +1,6 @@
1
+ export const ServiceTypes = {
2
+ GIFT: "gift",
3
+ EXCLUSIVE_CONTENT: "exclusive_content",
4
+ } as const;
5
+
6
+ export type ServiceType = (typeof ServiceTypes)[keyof typeof ServiceTypes];
@@ -1,198 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import {
3
- SupporterPlatforms,
4
- PaymentStatuses,
5
- ServiceTypes,
6
- PaymentTypes,
7
- } from "./index";
8
- import type {
9
- SupporterPlatform,
10
- PaymentStatus,
11
- ServiceType,
12
- PaymentType,
13
- } from "./index";
14
-
15
- describe("SupporterPlatforms", () => {
16
- test("should contain all expected platform keys", () => {
17
- const expectedKeys = [
18
- "FACEBOOK",
19
- "X",
20
- "INSTAGRAM",
21
- "YOUTUBE",
22
- "GITHUB",
23
- "LINKEDIN",
24
- "TWITCH",
25
- "TIKTOK",
26
- "THREADS",
27
- "WHATSAPP",
28
- "TELEGRAM",
29
- "DISCORD",
30
- "REDDIT",
31
- "PINTEREST",
32
- "MEDIUM",
33
- "DEVTO",
34
- "BEHANCE",
35
- "DRIBBBLE",
36
- ];
37
-
38
- expect(Object.keys(SupporterPlatforms)).toEqual(expectedKeys);
39
- });
40
-
41
- test("should have correct values for each platform", () => {
42
- expect(SupporterPlatforms.FACEBOOK).toBe("facebook");
43
- expect(SupporterPlatforms.X).toBe("x");
44
- expect(SupporterPlatforms.INSTAGRAM).toBe("instagram");
45
- expect(SupporterPlatforms.YOUTUBE).toBe("youtube");
46
- expect(SupporterPlatforms.GITHUB).toBe("github");
47
- expect(SupporterPlatforms.LINKEDIN).toBe("linkedin");
48
- expect(SupporterPlatforms.TWITCH).toBe("twitch");
49
- expect(SupporterPlatforms.TIKTOK).toBe("tiktok");
50
- expect(SupporterPlatforms.THREADS).toBe("threads");
51
- expect(SupporterPlatforms.WHATSAPP).toBe("whatsapp");
52
- expect(SupporterPlatforms.TELEGRAM).toBe("telegram");
53
- expect(SupporterPlatforms.DISCORD).toBe("discord");
54
- expect(SupporterPlatforms.REDDIT).toBe("reddit");
55
- expect(SupporterPlatforms.PINTEREST).toBe("pinterest");
56
- expect(SupporterPlatforms.MEDIUM).toBe("medium");
57
- expect(SupporterPlatforms.DEVTO).toBe("devto");
58
- expect(SupporterPlatforms.BEHANCE).toBe("behance");
59
- expect(SupporterPlatforms.DRIBBBLE).toBe("dribbble");
60
- });
61
-
62
- test("should be read-only at compile time", () => {
63
- // TypeScript prevents modification at compile time with 'as const'
64
- // This test verifies the structure is correct
65
- expect(Object.isFrozen(SupporterPlatforms)).toBe(false);
66
- expect(typeof SupporterPlatforms).toBe("object");
67
- });
68
-
69
- test("SupporterPlatform type should accept valid platform values", () => {
70
- const validPlatform: SupporterPlatform = "facebook";
71
- expect(validPlatform).toBe("facebook");
72
- });
73
-
74
- test("should have 18 platforms", () => {
75
- expect(Object.keys(SupporterPlatforms).length).toBe(18);
76
- });
77
- });
78
-
79
- describe("PaymentStatuses", () => {
80
- test("should contain all expected status keys", () => {
81
- const expectedKeys = [
82
- "PENDING",
83
- "COMPLETED",
84
- "FAILED",
85
- "CANCELLED",
86
- "REFUNDED",
87
- "REVIEWING",
88
- ];
89
-
90
- expect(Object.keys(PaymentStatuses)).toEqual(expectedKeys);
91
- });
92
-
93
- test("should have correct values for each status", () => {
94
- expect(PaymentStatuses.PENDING).toBe("pending");
95
- expect(PaymentStatuses.COMPLETED).toBe("completed");
96
- expect(PaymentStatuses.FAILED).toBe("failed");
97
- expect(PaymentStatuses.CANCELLED).toBe("cancelled");
98
- expect(PaymentStatuses.REFUNDED).toBe("refunded");
99
- expect(PaymentStatuses.REVIEWING).toBe("reviewing");
100
- });
101
-
102
- test("should be read-only at compile time", () => {
103
- // TypeScript prevents modification at compile time with 'as const'
104
- // This test verifies the structure is correct
105
- expect(Object.isFrozen(PaymentStatuses)).toBe(false);
106
- expect(typeof PaymentStatuses).toBe("object");
107
- });
108
-
109
- test("PaymentStatus type should accept valid status values", () => {
110
- const validStatus: PaymentStatus = "completed";
111
- expect(validStatus).toBe("completed");
112
- });
113
-
114
- test("should have 6 payment statuses", () => {
115
- expect(Object.keys(PaymentStatuses).length).toBe(6);
116
- });
117
-
118
- test("all values should be lowercase strings", () => {
119
- Object.values(PaymentStatuses).forEach((status) => {
120
- expect(status).toBe(status.toLowerCase() as PaymentStatus);
121
- expect(typeof status).toBe("string");
122
- });
123
- });
124
- });
125
-
126
- describe("ServiceTypes", () => {
127
- test("should contain all expected service type keys", () => {
128
- const expectedKeys = ["GIFT", "EXCLUSIVE_CONTENT"];
129
-
130
- expect(Object.keys(ServiceTypes)).toEqual(expectedKeys);
131
- });
132
-
133
- test("should have correct values for each service type", () => {
134
- expect(ServiceTypes.GIFT).toBe("gift");
135
- expect(ServiceTypes.EXCLUSIVE_CONTENT).toBe("exclusive_content");
136
- });
137
-
138
- test("should be read-only at compile time", () => {
139
- // TypeScript prevents modification at compile time with 'as const'
140
- // This test verifies the structure is correct
141
- expect(Object.isFrozen(ServiceTypes)).toBe(false);
142
- expect(typeof ServiceTypes).toBe("object");
143
- });
144
-
145
- test("ServiceType type should accept valid service type values", () => {
146
- const validType: ServiceType = "gift";
147
- expect(validType).toBe("gift");
148
- });
149
-
150
- test("should have 2 service types", () => {
151
- expect(Object.keys(ServiceTypes).length).toBe(2);
152
- });
153
-
154
- test("all values should be lowercase or snake_case strings", () => {
155
- Object.values(ServiceTypes).forEach((type) => {
156
- expect(typeof type).toBe("string");
157
- // Check that it only contains lowercase letters and underscores
158
- expect(type).toMatch(/^[a-z_]+$/);
159
- });
160
- });
161
- });
162
-
163
- describe("PaymentTypes", () => {
164
- test("should contain all expected keys", () => {
165
- const expectedKeys = ["SUBSCRIPTION", "ONE_TIME"];
166
-
167
- expect(Object.keys(PaymentTypes)).toEqual(expectedKeys);
168
- });
169
-
170
- test("should have correct values for each type", () => {
171
- expect(PaymentTypes.SUBSCRIPTION).toBe("subscription");
172
- expect(PaymentTypes.ONE_TIME).toBe("one-time");
173
- });
174
-
175
- test("should be read-only at compile time", () => {
176
- // TypeScript prevents modification at compile time with 'as const'
177
- // This test verifies the structure is correct
178
- expect(Object.isFrozen(PaymentTypes)).toBe(false);
179
- expect(typeof PaymentTypes).toBe("object");
180
- });
181
-
182
- test("PaymentType type should accept valid type values", () => {
183
- const validType: PaymentType = "subscription";
184
- expect(validType).toBe("subscription");
185
- });
186
-
187
- test("should have 2 payment types", () => {
188
- expect(Object.keys(PaymentTypes).length).toBe(2);
189
- });
190
-
191
- test("all values should be lowercase or kebab-case strings", () => {
192
- Object.values(PaymentTypes).forEach((type) => {
193
- expect(typeof type).toBe("string");
194
- // Check that it contains lowercase letters, hyphens, or underscores
195
- expect(type).toMatch(/^[a-z_-]+$/);
196
- });
197
- });
198
- });