@hobenakicoffee/libraries 1.18.0 → 1.19.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
|
@@ -4,13 +4,30 @@ import { ServiceTypes } from "./services";
|
|
|
4
4
|
|
|
5
5
|
describe("ServiceTypes", () => {
|
|
6
6
|
test("should contain all expected service type keys", () => {
|
|
7
|
-
const expectedKeys = [
|
|
7
|
+
const expectedKeys = [
|
|
8
|
+
"GIFT",
|
|
9
|
+
"DIGITAL_CONTENT",
|
|
10
|
+
"MY_SHOP",
|
|
11
|
+
"CONSULTANCY_1ON1",
|
|
12
|
+
"HIRE_ME",
|
|
13
|
+
"COURSES",
|
|
14
|
+
"LIVE_STREAMS",
|
|
15
|
+
"NEWSLETTER",
|
|
16
|
+
"WITHDRAWAL",
|
|
17
|
+
"FOLLOW",
|
|
18
|
+
];
|
|
8
19
|
expect(Object.keys(ServiceTypes)).toEqual(expectedKeys);
|
|
9
20
|
});
|
|
10
21
|
|
|
11
22
|
test("should have correct values for each service type", () => {
|
|
12
23
|
expect(ServiceTypes.GIFT).toBe("gift");
|
|
13
|
-
expect(ServiceTypes.
|
|
24
|
+
expect(ServiceTypes.DIGITAL_CONTENT).toBe("digital_content");
|
|
25
|
+
expect(ServiceTypes.MY_SHOP).toBe("my_shop");
|
|
26
|
+
expect(ServiceTypes.CONSULTANCY_1ON1).toBe("consultancy_1on1");
|
|
27
|
+
expect(ServiceTypes.HIRE_ME).toBe("hire_me");
|
|
28
|
+
expect(ServiceTypes.COURSES).toBe("courses");
|
|
29
|
+
expect(ServiceTypes.LIVE_STREAMS).toBe("live_streams");
|
|
30
|
+
expect(ServiceTypes.NEWSLETTER).toBe("newsletter");
|
|
14
31
|
expect(ServiceTypes.WITHDRAWAL).toBe("withdrawal");
|
|
15
32
|
expect(ServiceTypes.FOLLOW).toBe("follow");
|
|
16
33
|
});
|
|
@@ -27,15 +44,15 @@ describe("ServiceTypes", () => {
|
|
|
27
44
|
expect(validType).toBe("gift");
|
|
28
45
|
});
|
|
29
46
|
|
|
30
|
-
test("should have
|
|
31
|
-
expect(Object.keys(ServiceTypes).length).toBe(
|
|
47
|
+
test("should have 10 service types", () => {
|
|
48
|
+
expect(Object.keys(ServiceTypes).length).toBe(10);
|
|
32
49
|
});
|
|
33
50
|
|
|
34
51
|
test("all values should be lowercase or snake_case strings", () => {
|
|
35
|
-
Object.values(ServiceTypes)
|
|
52
|
+
for (const type of Object.values(ServiceTypes)) {
|
|
36
53
|
expect(typeof type).toBe("string");
|
|
37
|
-
// Check that it only contains lowercase letters and underscores
|
|
38
|
-
expect(type).toMatch(/^[a-
|
|
39
|
-
}
|
|
54
|
+
// Check that it only contains lowercase letters, numbers, and underscores
|
|
55
|
+
expect(type).toMatch(/^[a-z0-9_]+$/);
|
|
56
|
+
}
|
|
40
57
|
});
|
|
41
58
|
});
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
export const ServiceTypes = {
|
|
2
2
|
GIFT: "gift",
|
|
3
|
-
|
|
3
|
+
DIGITAL_CONTENT: "digital_content",
|
|
4
|
+
MY_SHOP: "my_shop",
|
|
5
|
+
CONSULTANCY_1ON1: "consultancy_1on1",
|
|
6
|
+
HIRE_ME: "hire_me",
|
|
7
|
+
COURSES: "courses",
|
|
8
|
+
LIVE_STREAMS: "live_streams",
|
|
9
|
+
NEWSLETTER: "newsletter",
|
|
4
10
|
WITHDRAWAL: "withdrawal",
|
|
5
11
|
FOLLOW: "follow",
|
|
6
12
|
} as const;
|
|
7
13
|
|
|
8
14
|
export type ServiceType = (typeof ServiceTypes)[keyof typeof ServiceTypes];
|
|
15
|
+
|
|
16
|
+
export type ServiceCategory =
|
|
17
|
+
| "monetization"
|
|
18
|
+
| "content"
|
|
19
|
+
| "engagement"
|
|
20
|
+
| "service"
|
|
21
|
+
| "community";
|