@ph-cms/client-sdk 0.1.46 → 0.1.49

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @ph-cms/client-sdk 0.1.45
1
+ # @ph-cms/client-sdk 0.1.49
2
2
 
3
3
  PH-CMS 클라이언트 SDK — 브라우저 및 React 애플리케이션을 위한 통합 클라이언트.
4
4
 
@@ -68,6 +68,9 @@ import type {
68
68
 
69
69
  // Channel
70
70
  ChannelDto,
71
+ ChannelContentCountsQuery,
72
+ ChannelContentCountsResponse,
73
+ ChannelPublicContentSummaryResponse,
71
74
  CheckHierarchyQuery,
72
75
 
73
76
  // Content
@@ -1011,6 +1014,17 @@ const detail = await client.content.get('content-uid');
1011
1014
 
1012
1015
  // 채널 정보 조회
1013
1016
  const channel = await client.channel.getBySlug('my-channel-slug');
1017
+
1018
+ // 채널 관리용 콘텐츠 요약 조회
1019
+ // includeDeleted는 true만 허용됩니다.
1020
+ const counts = await client.channel.getManageContentCounts('my-channel-uid', {
1021
+ includeDeleted: true,
1022
+ });
1023
+
1024
+ // 채널 요약 조회
1025
+ const summary = await client.channel.getContentSummary('my-channel-uid');
1026
+ console.log(summary.totalPublishedCount);
1027
+ console.log(summary.counts);
1014
1028
  ```
1015
1029
 
1016
1030
  ### 4. 약관 동의
@@ -1853,6 +1867,8 @@ await client.content.get('cnt_123', { withParent: true, withDetail: true });
1853
1867
  | `getBySlug(slug: string)` | 슬러그로 채널 상세 조회 |
1854
1868
  | `update(uid: string, data: any)` | 채널 정보 수정 |
1855
1869
  | `checkHierarchy(params: CheckHierarchyQuery)` | 하이어라키 규칙 체크 |
1870
+ | `getManageContentCounts(uid: string, params?: ChannelContentCountsQuery)` | 채널 관리자용 콘텐츠 요약 조회 → `ChannelContentCountsResponse` (`includeDeleted`는 `true`만 허용) |
1871
+ | `getContentSummary(uid: string)` | 채널 공개 콘텐츠 요약 조회 → `ChannelPublicContentSummaryResponse` |
1856
1872
 
1857
1873
  ### `TermsModule` (`client.terms`)
1858
1874
 
@@ -1,4 +1,4 @@
1
- import { ChannelDto, CheckHierarchyQuery } from "@ph-cms/api-contract";
1
+ import { ChannelContentCountsQuery, ChannelContentCountsResponse, ChannelDto, ChannelPublicContentSummaryResponse, CheckHierarchyQuery } from "@ph-cms/api-contract";
2
2
  import { AxiosInstance } from "axios";
3
3
  export declare class ChannelModule {
4
4
  private client;
@@ -11,4 +11,6 @@ export declare class ChannelModule {
11
11
  allowed: boolean;
12
12
  message?: string;
13
13
  }>;
14
+ getManageContentCounts(uid: string, params?: ChannelContentCountsQuery): Promise<ChannelContentCountsResponse>;
15
+ getContentSummary(uid: string): Promise<ChannelPublicContentSummaryResponse>;
14
16
  }
@@ -31,5 +31,21 @@ class ChannelModule {
31
31
  }
32
32
  return this.client.get(`${this.prefix}/contents/check-hierarchy`, { params });
33
33
  }
34
+ async getManageContentCounts(uid, params = {}) {
35
+ if (!uid)
36
+ throw new errors_1.ValidationError("UID is required", []);
37
+ const validation = api_contract_1.ChannelContentCountsQuerySchema.safeParse(params);
38
+ if (!validation.success) {
39
+ throw new errors_1.ValidationError("Invalid channel content counts params", validation.error.errors);
40
+ }
41
+ return this.client.get(`${this.prefix}/channels/${uid}/manage/content-counts`, {
42
+ params: validation.data,
43
+ });
44
+ }
45
+ async getContentSummary(uid) {
46
+ if (!uid)
47
+ throw new errors_1.ValidationError("UID is required", []);
48
+ return this.client.get(`${this.prefix}/channels/${uid}/content-summary`);
49
+ }
34
50
  }
35
51
  exports.ChannelModule = ChannelModule;
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export type { FirebaseAuthSyncProps, UseFirebaseAuthSyncOptions, UseFirebaseAuth
6
6
  export type { StampAvailability, CheckStampAvailabilityParams } from './hooks/useStampTour';
7
7
  export type { AnonymousLoginRequest, AuthResponse, FirebaseExchangeRequest, FirebaseRegisterRequest, LoginRequest, RefreshTokenRequest, RegisterRequest, } from '@ph-cms/api-contract';
8
8
  export type { UserDto, UserProfileDto, FollowStatusResponse, FollowUserResponse, ListUserFollowQuery, PagedUserProfileListResponse, } from '@ph-cms/api-contract';
9
- export type { ChannelDto, CheckHierarchyQuery } from '@ph-cms/api-contract';
9
+ export type { ChannelContentCountDto, ChannelContentCountsQuery, ChannelContentCountsResponse, ChannelDto, ChannelPublicContentSummaryResponse, CheckHierarchyQuery, } from '@ph-cms/api-contract';
10
10
  export type { ContentDto, ContentStatDto, ContentMediaDto, ContentStatus, CreateContentRequest, ListContentQuery, PagedContentListResponse, UpdateContentRequest, } from '@ph-cms/api-contract';
11
11
  export type { HierarchySetDto } from '@ph-cms/api-contract';
12
12
  export type { PermissionPolicySetDto } from '@ph-cms/api-contract';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ph-cms/client-sdk",
3
- "version": "0.1.46",
3
+ "version": "0.1.49",
4
4
  "description": "Unified PH-CMS Client SDK (React + Core)",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "LICENSE"
31
31
  ],
32
32
  "dependencies": {
33
- "@ph-cms/api-contract": "^0.1.23",
33
+ "@ph-cms/api-contract": "^0.1.25",
34
34
  "@tanstack/react-query": "^5.0.0",
35
35
  "axios": "^1.6.0",
36
36
  "zod": "^3.22.4"