musora-content-services 2.162.0 → 2.162.1

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.
@@ -1,12 +1,41 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(rg:*)",
5
- "Bash(npm run lint:*)",
6
- "Bash(ls:*)",
4
+ "Bash(npx jest *)",
5
+ "Bash(npx tsc *)",
6
+ "Skill(counselors)",
7
+ "Bash(counselors ls *)",
8
+ "Bash(counselors groups *)",
9
+ "Bash(counselors run *)",
7
10
  "Bash(npm test *)",
8
- "Bash(npx jest *)"
9
- ],
10
- "deny": []
11
- }
11
+ "Bash(gh pr *)",
12
+ "Bash(gh api *)",
13
+ "Bash(mkdir -p /tmp/pr-review-v2)",
14
+ "Read(//tmp/pr-review-v2/**)",
15
+ "Bash(cat /home/alesevero/railenvironment/applications/musora-content-services/AGENTS.md)",
16
+ "Bash(echo \"no AGENTS.md\")",
17
+ "Bash(echo \"exit=$?\")",
18
+ "Bash(git checkout *)",
19
+ "Skill(pr)",
20
+ "Skill(create-decision)"
21
+ ]
22
+ },
23
+ "model": "sonnet",
24
+ "effortLevel": "medium",
25
+ "enabledMcpjsonServers": [
26
+ "atlassian",
27
+ "figma",
28
+ "google-workspace",
29
+ "snowflake",
30
+ "aws",
31
+ "hex",
32
+ "sanity",
33
+ "mysql",
34
+ "slack",
35
+ "langfuse",
36
+ "chrome-devtools",
37
+ "railway",
38
+ "github",
39
+ "asana"
40
+ ]
12
41
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.162.1](https://github.com/railroadmedia/musora-content-services/compare/v2.162.0...v2.162.1) (2026-06-04)
6
+
5
7
  ## [2.162.0](https://github.com/railroadmedia/musora-content-services/compare/v2.161.4...v2.162.0) (2026-06-03)
6
8
 
7
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.162.0",
3
+ "version": "2.162.1",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.d.ts CHANGED
@@ -177,7 +177,8 @@ import {
177
177
  likePost,
178
178
  search,
179
179
  unlikePost,
180
- updatePost
180
+ updatePost,
181
+ whoLikedPost
181
182
  } from './services/forums/posts.ts';
182
183
 
183
184
  import {
@@ -494,6 +495,11 @@ import {
494
495
  updateUserPractice
495
496
  } from './services/userActivity.js';
496
497
 
498
+ import {
499
+ whoLikedComment,
500
+ whoLikedContent
501
+ } from './services/whoLiked.ts';
502
+
497
503
  import {
498
504
  default as EventsAPI
499
505
  } from './services/eventsAPI';
@@ -847,6 +853,9 @@ declare module 'musora-content-services' {
847
853
  userOnboardingForBrand,
848
854
  verifyImageSRC,
849
855
  verifyLocalDataContext,
856
+ whoLikedComment,
857
+ whoLikedContent,
858
+ whoLikedPost,
850
859
  }
851
860
  }
852
861
 
package/src/index.js CHANGED
@@ -181,7 +181,8 @@ import {
181
181
  likePost,
182
182
  search,
183
183
  unlikePost,
184
- updatePost
184
+ updatePost,
185
+ whoLikedPost
185
186
  } from './services/forums/posts.ts';
186
187
 
187
188
  import {
@@ -498,6 +499,11 @@ import {
498
499
  updateUserPractice
499
500
  } from './services/userActivity.js';
500
501
 
502
+ import {
503
+ whoLikedComment,
504
+ whoLikedContent
505
+ } from './services/whoLiked.ts';
506
+
501
507
  export {
502
508
  PermissionsAdapter,
503
509
  PermissionsV1Adapter,
@@ -846,6 +852,9 @@ export {
846
852
  userOnboardingForBrand,
847
853
  verifyImageSRC,
848
854
  verifyLocalDataContext,
855
+ whoLikedComment,
856
+ whoLikedContent,
857
+ whoLikedPost,
849
858
  };
850
859
 
851
860
  export default EventsAPI
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { HttpClient } from '../../infrastructure/http/HttpClient'
5
5
  import { globalConfig } from '../config.js'
6
- import { ForumPost } from './types'
6
+ import { ForumPost, WhoLikedParams, WhoLikedResponse } from './types'
7
7
  import { PaginatedResponse } from '../api/types'
8
8
  import { markThreadAsRead } from './threads'
9
9
 
@@ -128,6 +128,33 @@ export async function likePost(postId: number, brand: string): Promise<void> {
128
128
  })
129
129
  }
130
130
 
131
+ /**
132
+ * Fetch the list of users who liked a forum post.
133
+ *
134
+ * @param {number} postId - The ID of the post.
135
+ * @param {string} brand - The brand context (e.g., "drumeo", "singeo").
136
+ * @param {WhoLikedParams} [params] - Optional pagination parameters.
137
+ * @returns {Promise<WhoLikedResponse>} - A promise that resolves to the paginated list of likers.
138
+ * @throws {HttpError} - If the request fails.
139
+ */
140
+ export async function whoLikedPost(
141
+ postId: number,
142
+ brand: string,
143
+ params: WhoLikedParams = {}
144
+ ): Promise<WhoLikedResponse> {
145
+ const httpClient = new HttpClient(globalConfig.baseUrl)
146
+ const queryObj: Record<string, string> = {
147
+ brand,
148
+ ...Object.fromEntries(
149
+ Object.entries({ page: 1, limit: 20, ...params })
150
+ .filter(([_, v]) => v !== undefined && v !== null)
151
+ .map(([k, v]) => [k, String(v)])
152
+ ),
153
+ }
154
+ const query = new URLSearchParams(queryObj).toString()
155
+ return httpClient.get<WhoLikedResponse>(`${baseUrl}/v1/posts/${postId}/likes?${query}`)
156
+ }
157
+
131
158
  /**
132
159
  * Unlike a forum post.
133
160
  *
@@ -1,3 +1,26 @@
1
+ export interface WhoLikedParams {
2
+ page?: number
3
+ limit?: number
4
+ }
5
+
6
+ export interface Liker {
7
+ user_id: number
8
+ display_name: string
9
+ profile_picture_url: string | null
10
+ access_level: string
11
+ liked_at: string
12
+ liked_at_diff: string | null
13
+ }
14
+
15
+ export interface WhoLikedResponse {
16
+ data: Liker[]
17
+ meta: {
18
+ total: number
19
+ current_page: number
20
+ last_page: number
21
+ }
22
+ }
23
+
1
24
  export interface ForumUser {
2
25
  id: number
3
26
  display_name: string
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @module WhoLiked
3
+ */
4
+ import { HttpClient } from '../infrastructure/http/HttpClient'
5
+ import { globalConfig } from './config.js'
6
+ import { Liker, WhoLikedParams, WhoLikedResponse } from './forums/types'
7
+
8
+ export type { Liker, WhoLikedParams, WhoLikedResponse }
9
+
10
+ const baseUrl = `/api/content/v1`
11
+
12
+ /**
13
+ * Fetch the list of users who liked a lesson comment.
14
+ *
15
+ * @param {number} commentId - The ID of the comment.
16
+ * @param {WhoLikedParams} [params] - Optional pagination parameters.
17
+ * @returns {Promise<WhoLikedResponse>} - Paginated list of likers.
18
+ * @throws {HttpError} - If the request fails.
19
+ */
20
+ export async function whoLikedComment(
21
+ commentId: number,
22
+ params: WhoLikedParams = {}
23
+ ): Promise<WhoLikedResponse> {
24
+ const httpClient = new HttpClient(globalConfig.baseUrl)
25
+ const query = new URLSearchParams(
26
+ Object.fromEntries(
27
+ Object.entries({ page: 1, limit: 20, ...params }).map(([k, v]) => [k, String(v)])
28
+ )
29
+ ).toString()
30
+ return httpClient.get<WhoLikedResponse>(`${baseUrl}/comments/${commentId}/likes?${query}`)
31
+ }
32
+
33
+ /**
34
+ * Fetch the list of users who liked a content item (lesson, song, etc.).
35
+ *
36
+ * @param {number} contentId - The ID of the content item.
37
+ * @param {WhoLikedParams} [params] - Optional pagination parameters.
38
+ * @returns {Promise<WhoLikedResponse>} - Paginated list of likers.
39
+ * @throws {HttpError} - If the request fails.
40
+ */
41
+ export async function whoLikedContent(
42
+ contentId: number,
43
+ params: WhoLikedParams = {}
44
+ ): Promise<WhoLikedResponse> {
45
+ const httpClient = new HttpClient(globalConfig.baseUrl)
46
+ const query = new URLSearchParams(
47
+ Object.fromEntries(
48
+ Object.entries({ page: 1, limit: 20, ...params }).map(([k, v]) => [k, String(v)])
49
+ )
50
+ ).toString()
51
+ return httpClient.get<WhoLikedResponse>(`${baseUrl}/content/${contentId}/likes?${query}`)
52
+ }