@ph-cms/client-sdk 0.1.19 → 0.1.22

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
@@ -1240,6 +1240,19 @@ client.terms // TermsModule
1240
1240
  client.media // MediaModule
1241
1241
  ```
1242
1242
 
1243
+ `apiPrefix`는 생성 시 각 모듈에 직접 주입됩니다. 예를 들어 `apiPrefix: '/v2/api'`로 설정하면 모든 모듈의 요청 URL이 `/v2/api/contents/...`, `/v2/api/auth/...` 형태로 전송됩니다.
1244
+
1245
+ ```ts
1246
+ // 기본값: /api
1247
+ const client = new PHCMSClient({ baseURL: 'https://api.example.com' });
1248
+
1249
+ // 커스텀 prefix
1250
+ const client = new PHCMSClient({
1251
+ baseURL: 'https://api.example.com',
1252
+ apiPrefix: '/v2/api',
1253
+ });
1254
+ ```
1255
+
1243
1256
  ### 커스텀 Axios 인스턴스 사용 (서버 to 서버 등)
1244
1257
 
1245
1258
  인증서(SSL)가 필요하거나 특수한 Agent 설정이 필요한 경우, 직접 생성한 Axios 인스턴스를 주입할 수 있습니다.
@@ -1267,17 +1280,37 @@ const client = new PHCMSClient({
1267
1280
 
1268
1281
  이 경우 React 의존성이 제거된 `/core` 서브패스를 사용하세요.
1269
1282
 
1283
+ **`PHCMSClient`를 통해 사용 (권장)**
1284
+
1270
1285
  ```ts
1271
- import { PHCMSClient, ContentModule } from '@ph-cms/client-sdk/core';
1286
+ import { PHCMSClient } from '@ph-cms/client-sdk/core';
1272
1287
 
1273
1288
  const client = new PHCMSClient({
1274
1289
  baseURL: 'https://api.ph-cms.com',
1290
+ apiPrefix: '/api', // 생략 시 기본값 '/api'
1275
1291
  });
1276
1292
 
1277
- // 모듈을 직접 사용
1293
+ // apiPrefix가 각 모듈에 직접 주입되므로 URL이 올바르게 구성됩니다
1278
1294
  const result = await client.content.list({ channelUid: 'my-channel' });
1279
1295
  ```
1280
1296
 
1297
+ **모듈 클래스를 직접 인스턴스화하는 경우**
1298
+
1299
+ 모듈 생성자의 두 번째 인자로 prefix를 전달합니다.
1300
+
1301
+ ```ts
1302
+ import axios from 'axios';
1303
+ import { ContentModule } from '@ph-cms/client-sdk/core';
1304
+
1305
+ const axiosInstance = axios.create({ baseURL: 'https://api.ph-cms.com' });
1306
+
1307
+ // 두 번째 인자로 prefix 전달 (기본값: '/api')
1308
+ const content = new ContentModule(axiosInstance, '/v2/api');
1309
+
1310
+ const result = await content.list({ channelUid: 'my-channel' });
1311
+ // → GET https://api.ph-cms.com/v2/api/contents
1312
+ ```
1313
+
1281
1314
  `/core`에서 export되는 항목은 다음과 같습니다 (React 관련 항목 제외):
1282
1315
 
1283
1316
  | 카테고리 | export 항목 |
package/dist/client.d.ts CHANGED
@@ -35,6 +35,7 @@ export declare class PHCMSClient {
35
35
  private refreshQueue;
36
36
  /** Exposes the auth provider so UI layers can check token state synchronously. */
37
37
  get authProvider(): AuthProvider | undefined;
38
+ private readonly normalizedApiPrefix;
38
39
  constructor(config: PHCMSClientConfig);
39
40
  /**
40
41
  * If a refresh is already in flight, queue the caller. Otherwise kick
package/dist/client.js CHANGED
@@ -30,7 +30,8 @@ class PHCMSClient {
30
30
  * refresh call finishes.
31
31
  */
32
32
  this.refreshQueue = [];
33
- const normalizedApiPrefix = `/${(config.apiPrefix || '/api').replace(/^\/+|\/+$/g, '')}`;
33
+ this.normalizedApiPrefix = `/${(config.apiPrefix || '/api').replace(/^\/+|\/+$/g, '')}`;
34
+ const normalizedApiPrefix = this.normalizedApiPrefix;
34
35
  this.axiosInstance = config.axiosInstance || axios_1.default.create({
35
36
  baseURL: config.baseURL,
36
37
  timeout: config.timeout || 10000,
@@ -44,12 +45,12 @@ class PHCMSClient {
44
45
  }
45
46
  // Initialize Modules (before interceptors so the refresh wiring
46
47
  // can reference `this.auth`).
47
- this.auth = new auth_1.AuthModule(this.axiosInstance, config.auth);
48
- this.content = new content_1.ContentModule(this.axiosInstance);
49
- this.channel = new channel_1.ChannelModule(this.axiosInstance);
50
- this.terms = new terms_1.TermsModule(this.axiosInstance);
51
- this.media = new media_1.MediaModule(this.axiosInstance);
52
- this.user = new user_1.UserModule(this.axiosInstance);
48
+ this.auth = new auth_1.AuthModule(this.axiosInstance, config.auth, normalizedApiPrefix);
49
+ this.content = new content_1.ContentModule(this.axiosInstance, normalizedApiPrefix);
50
+ this.channel = new channel_1.ChannelModule(this.axiosInstance, normalizedApiPrefix);
51
+ this.terms = new terms_1.TermsModule(this.axiosInstance, normalizedApiPrefix);
52
+ this.media = new media_1.MediaModule(this.axiosInstance, normalizedApiPrefix);
53
+ this.user = new user_1.UserModule(this.axiosInstance, normalizedApiPrefix);
53
54
  // Wire the refresh function into the auth provider so it can
54
55
  // proactively refresh tokens inside `getToken()` without needing
55
56
  // a direct reference to the AuthModule / axios instance.
@@ -59,26 +60,16 @@ class PHCMSClient {
59
60
  // interceptor, avoiding a recursive `getToken()` call.
60
61
  if (config.auth) {
61
62
  config.auth.setRefreshFn(async (refreshToken) => {
62
- const response = await this.axiosInstance.post('/api/auth/refresh', { refreshToken }, { _skipAuth: true });
63
+ const response = await this.axiosInstance.post(`${normalizedApiPrefix}/auth/refresh`, { refreshToken }, { _skipAuth: true });
63
64
  // The response interceptor unwraps `response.data`, so at
64
65
  // this point `response` is already the data payload.
65
66
  return response;
66
67
  });
67
68
  }
68
69
  // ---------------------------------------------------------------
69
- // Request Interceptor: Rewrite API prefix & attach auth token
70
+ // Request Interceptor: Attach auth token
70
71
  // ---------------------------------------------------------------
71
72
  this.axiosInstance.interceptors.request.use(async (reqConfig) => {
72
- // --- URL rewriting ---
73
- if (typeof reqConfig.url === 'string') {
74
- if (reqConfig.url === '/api') {
75
- reqConfig.url = normalizedApiPrefix;
76
- }
77
- else if (reqConfig.url.startsWith('/api/')) {
78
- reqConfig.url = `${normalizedApiPrefix}${reqConfig.url.slice('/api'.length)}`;
79
- }
80
- }
81
- // --- Auth header ---
82
73
  // Skip auth for requests explicitly flagged (e.g. refresh calls)
83
74
  if (!reqConfig._skipAuth && this.config.auth) {
84
75
  const token = await this.config.auth.getToken();
@@ -154,7 +145,7 @@ class PHCMSClient {
154
145
  }
155
146
  this.isRefreshing = true;
156
147
  try {
157
- const result = await this.axiosInstance.post('/api/auth/refresh', { refreshToken }, { _skipAuth: true });
148
+ const result = await this.axiosInstance.post(`${this.normalizedApiPrefix}/auth/refresh`, { refreshToken }, { _skipAuth: true });
158
149
  // Store the new tokens in the provider.
159
150
  this.config.auth.setTokens(result.accessToken, result.refreshToken);
160
151
  // Resolve all queued callers.
@@ -4,7 +4,8 @@ import { AuthProvider } from "../auth/interfaces";
4
4
  export declare class AuthModule {
5
5
  private client;
6
6
  private provider?;
7
- constructor(client: AxiosInstance, provider?: AuthProvider | undefined);
7
+ private prefix;
8
+ constructor(client: AxiosInstance, provider?: AuthProvider | undefined, prefix?: string);
8
9
  /**
9
10
  * Logs in the user and updates the AuthProvider tokens automatically.
10
11
  */
@@ -4,9 +4,10 @@ exports.AuthModule = void 0;
4
4
  const api_contract_1 = require("@ph-cms/api-contract");
5
5
  const errors_1 = require("../errors");
6
6
  class AuthModule {
7
- constructor(client, provider) {
7
+ constructor(client, provider, prefix = '/api') {
8
8
  this.client = client;
9
9
  this.provider = provider;
10
+ this.prefix = prefix;
10
11
  }
11
12
  /**
12
13
  * Logs in the user and updates the AuthProvider tokens automatically.
@@ -16,7 +17,7 @@ class AuthModule {
16
17
  if (!validation.success) {
17
18
  throw new errors_1.ValidationError("Invalid login data", validation.error.errors);
18
19
  }
19
- const response = await this.client.post('/api/auth/login', data);
20
+ const response = await this.client.post(`${this.prefix}/auth/login`, data);
20
21
  if (this.provider) {
21
22
  this.provider.setTokens(response.accessToken, response.refreshToken);
22
23
  }
@@ -30,7 +31,7 @@ class AuthModule {
30
31
  if (!validation.success) {
31
32
  throw new errors_1.ValidationError("Invalid Firebase token data", validation.error.errors);
32
33
  }
33
- const response = await this.client.post('/api/auth/firebase/exchange', data);
34
+ const response = await this.client.post(`${this.prefix}/auth/firebase/exchange`, data);
34
35
  if (this.provider) {
35
36
  this.provider.setTokens(response.accessToken, response.refreshToken);
36
37
  }
@@ -41,31 +42,31 @@ class AuthModule {
41
42
  if (!validation.success) {
42
43
  throw new errors_1.ValidationError("Invalid register data", validation.error.errors);
43
44
  }
44
- const response = await this.client.post('/api/auth/register', data);
45
+ const response = await this.client.post(`${this.prefix}/auth/register`, data);
45
46
  if (this.provider) {
46
47
  this.provider.setTokens(response.accessToken, response.refreshToken);
47
48
  }
48
49
  return response;
49
50
  }
50
51
  async me(params) {
51
- return this.client.get('/api/auth/me', { params });
52
+ return this.client.get(`${this.prefix}/auth/me`, { params });
52
53
  }
53
54
  async refresh(refreshToken) {
54
- return this.client.post('/api/auth/refresh', { refreshToken });
55
+ return this.client.post(`${this.prefix}/auth/refresh`, { refreshToken });
55
56
  }
56
57
  async loginAnonymous(data) {
57
58
  const validation = api_contract_1.AnonymousLoginSchema.safeParse(data);
58
59
  if (!validation.success) {
59
60
  throw new errors_1.ValidationError("Invalid anonymous login data", validation.error.errors);
60
61
  }
61
- const response = await this.client.post('/api/auth/anonymous', data);
62
+ const response = await this.client.post(`${this.prefix}/auth/anonymous`, data);
62
63
  if (this.provider) {
63
64
  this.provider.setTokens(response.accessToken, response.refreshToken);
64
65
  }
65
66
  return response;
66
67
  }
67
68
  async upgradeAnonymous(data) {
68
- return this.client.post('/api/auth/anonymous/upgrade', data);
69
+ return this.client.post(`${this.prefix}/auth/anonymous/upgrade`, data);
69
70
  }
70
71
  async logout() {
71
72
  if (this.provider) {
@@ -73,7 +74,7 @@ class AuthModule {
73
74
  }
74
75
  // Call the server endpoint to invalidate the session if applicable.
75
76
  // JWT-based auth is stateless, but the server may implement a blacklist.
76
- await this.client.post('/api/auth/logout').catch(() => { }); // Ignore error on logout
77
+ await this.client.post(`${this.prefix}/auth/logout`).catch(() => { }); // Ignore error on logout
77
78
  }
78
79
  }
79
80
  exports.AuthModule = AuthModule;
@@ -2,7 +2,8 @@ import { ChannelDto, CheckHierarchyQuery } from "@ph-cms/api-contract";
2
2
  import { AxiosInstance } from "axios";
3
3
  export declare class ChannelModule {
4
4
  private client;
5
- constructor(client: AxiosInstance);
5
+ private prefix;
6
+ constructor(client: AxiosInstance, prefix?: string);
6
7
  getByUid(uid: string): Promise<ChannelDto>;
7
8
  getBySlug(slug: string): Promise<ChannelDto>;
8
9
  update(uid: string, data: any): Promise<ChannelDto>;
@@ -4,31 +4,32 @@ exports.ChannelModule = void 0;
4
4
  const api_contract_1 = require("@ph-cms/api-contract");
5
5
  const errors_1 = require("../errors");
6
6
  class ChannelModule {
7
- constructor(client) {
7
+ constructor(client, prefix = '/api') {
8
8
  this.client = client;
9
+ this.prefix = prefix;
9
10
  }
10
11
  async getByUid(uid) {
11
12
  if (!uid)
12
13
  throw new errors_1.ValidationError("UID is required", []);
13
- return this.client.get(`/api/channels/u/${uid}`);
14
+ return this.client.get(`${this.prefix}/channels/u/${uid}`);
14
15
  }
15
16
  async getBySlug(slug) {
16
17
  if (!slug)
17
18
  throw new errors_1.ValidationError("Slug is required", []);
18
- return this.client.get(`/api/channels/s/${slug}`);
19
+ return this.client.get(`${this.prefix}/channels/s/${slug}`);
19
20
  }
20
21
  async update(uid, data) {
21
22
  // TODO: Add schema validation for update channel
22
23
  if (!uid)
23
24
  throw new errors_1.ValidationError("UID is required", []);
24
- return this.client.patch(`/api/channels/u/${uid}`, data);
25
+ return this.client.patch(`${this.prefix}/channels/u/${uid}`, data);
25
26
  }
26
27
  async checkHierarchy(params) {
27
28
  const validation = api_contract_1.CheckHierarchyQuerySchema.safeParse(params);
28
29
  if (!validation.success) {
29
30
  throw new errors_1.ValidationError("Invalid check hierarchy params", validation.error.errors);
30
31
  }
31
- return this.client.get('/api/contents/check-hierarchy', { params });
32
+ return this.client.get(`${this.prefix}/contents/check-hierarchy`, { params });
32
33
  }
33
34
  }
34
35
  exports.ChannelModule = ChannelModule;
@@ -2,7 +2,8 @@ import { CollectStampRequest, ContentDto, CreateContentRequest, CreateStampTourR
2
2
  import { AxiosInstance } from "axios";
3
3
  export declare class ContentModule {
4
4
  private client;
5
- constructor(client: AxiosInstance);
5
+ private prefix;
6
+ constructor(client: AxiosInstance, prefix?: string);
6
7
  list(params: ListContentQuery): Promise<PagedContentListResponse>;
7
8
  get(uid: string): Promise<ContentDto>;
8
9
  incrementView(uid: string): Promise<void>;
@@ -4,32 +4,33 @@ exports.ContentModule = void 0;
4
4
  const api_contract_1 = require("@ph-cms/api-contract");
5
5
  const errors_1 = require("../errors");
6
6
  class ContentModule {
7
- constructor(client) {
7
+ constructor(client, prefix = '/api') {
8
8
  this.client = client;
9
+ this.prefix = prefix;
9
10
  }
10
11
  async list(params) {
11
12
  const validation = api_contract_1.ListContentQuerySchema.safeParse(params);
12
13
  if (!validation.success) {
13
14
  throw new errors_1.ValidationError("Invalid list params", validation.error.errors);
14
15
  }
15
- return this.client.get('/api/contents', { params });
16
+ return this.client.get(`${this.prefix}/contents`, { params });
16
17
  }
17
18
  async get(uid) {
18
19
  if (!uid)
19
20
  throw new errors_1.ValidationError("UID is required", []);
20
- return this.client.get(`/api/contents/${uid}`);
21
+ return this.client.get(`${this.prefix}/contents/${uid}`);
21
22
  }
22
23
  async incrementView(uid) {
23
24
  if (!uid)
24
25
  throw new errors_1.ValidationError("UID is required", []);
25
- await this.client.post(`/api/contents/${uid}/view`);
26
+ await this.client.patch(`${this.prefix}/contents/${uid}/view`);
26
27
  }
27
28
  async create(data) {
28
29
  const validation = api_contract_1.CreateContentSchema.safeParse(data);
29
30
  if (!validation.success) {
30
31
  throw new errors_1.ValidationError("Invalid create content data", validation.error.errors);
31
32
  }
32
- return this.client.post('/api/contents', data);
33
+ return this.client.post(`${this.prefix}/contents`, data);
33
34
  }
34
35
  async update(uid, data) {
35
36
  if (!uid)
@@ -38,19 +39,19 @@ class ContentModule {
38
39
  if (!validation.success) {
39
40
  throw new errors_1.ValidationError("Invalid update content data", validation.error.errors);
40
41
  }
41
- return this.client.put(`/api/contents/${uid}`, data);
42
+ return this.client.put(`${this.prefix}/contents/${uid}`, data);
42
43
  }
43
44
  async delete(uid) {
44
45
  if (!uid)
45
46
  throw new errors_1.ValidationError("UID is required", []);
46
- return this.client.delete(`/api/contents/${uid}`);
47
+ return this.client.delete(`${this.prefix}/contents/${uid}`);
47
48
  }
48
49
  async createStampTour(data) {
49
50
  const validation = api_contract_1.CreateStampTourSchema.safeParse(data);
50
51
  if (!validation.success) {
51
52
  throw new errors_1.ValidationError("Invalid create stamp tour data", validation.error.errors);
52
53
  }
53
- return this.client.post('/api/contents/stamp-tours', data);
54
+ return this.client.post(`${this.prefix}/contents/stamp-tours`, data);
54
55
  }
55
56
  async updateStampTour(uid, data) {
56
57
  if (!uid)
@@ -59,7 +60,7 @@ class ContentModule {
59
60
  if (!validation.success) {
60
61
  throw new errors_1.ValidationError("Invalid update stamp tour data", validation.error.errors);
61
62
  }
62
- return this.client.put(`/api/contents/stamp-tours/${uid}`, data);
63
+ return this.client.put(`${this.prefix}/contents/stamp-tours/${uid}`, data);
63
64
  }
64
65
  async stamp(tourUid, markerUid, data) {
65
66
  if (!tourUid || !markerUid)
@@ -68,27 +69,27 @@ class ContentModule {
68
69
  if (!validation.success) {
69
70
  throw new errors_1.ValidationError("Invalid stamp data", validation.error.errors);
70
71
  }
71
- return this.client.post(`/api/contents/${tourUid}/stamp/${markerUid}`, data);
72
+ return this.client.post(`${this.prefix}/contents/${tourUid}/stamp/${markerUid}`, data);
72
73
  }
73
74
  async getStampStatus(tourUid) {
74
75
  if (!tourUid)
75
76
  throw new errors_1.ValidationError("tourUid is required", []);
76
- return this.client.get(`/api/contents/${tourUid}/stamp-status`);
77
+ return this.client.get(`${this.prefix}/contents/${tourUid}/stamp-status`);
77
78
  }
78
79
  async getTourStats(tourUid) {
79
80
  if (!tourUid)
80
81
  throw new errors_1.ValidationError("tourUid is required", []);
81
- return this.client.get(`/api/contents/${tourUid}/stamp-stats`);
82
+ return this.client.get(`${this.prefix}/contents/${tourUid}/stamp-stats`);
82
83
  }
83
84
  async toggleLike(uid) {
84
85
  if (!uid)
85
86
  throw new errors_1.ValidationError("UID is required", []);
86
- return this.client.post(`/api/contents/${uid}/like`);
87
+ return this.client.post(`${this.prefix}/contents/${uid}/like`, {});
87
88
  }
88
89
  async getLikeStatus(uid) {
89
90
  if (!uid)
90
91
  throw new errors_1.ValidationError("UID is required", []);
91
- return this.client.get(`/api/contents/${uid}/like`);
92
+ return this.client.get(`${this.prefix}/contents/${uid}/like`);
92
93
  }
93
94
  }
94
95
  exports.ContentModule = ContentModule;
@@ -2,7 +2,8 @@ import { AxiosInstance } from "axios";
2
2
  import { MediaUploadTicketBatchRequest, MediaUploadTicketBatchResponse, ContentMediaDto } from "@ph-cms/api-contract";
3
3
  export declare class MediaModule {
4
4
  private client;
5
- constructor(client: AxiosInstance);
5
+ private prefix;
6
+ constructor(client: AxiosInstance, prefix?: string);
6
7
  /**
7
8
  * 미디어 업로드 티켓(Presigned URL) 발급 요청
8
9
  */
@@ -8,8 +8,9 @@ const axios_1 = __importDefault(require("axios"));
8
8
  const api_contract_1 = require("@ph-cms/api-contract");
9
9
  const errors_1 = require("../errors");
10
10
  class MediaModule {
11
- constructor(client) {
11
+ constructor(client, prefix = '/api') {
12
12
  this.client = client;
13
+ this.prefix = prefix;
13
14
  }
14
15
  /**
15
16
  * 미디어 업로드 티켓(Presigned URL) 발급 요청
@@ -19,7 +20,7 @@ class MediaModule {
19
20
  if (!validation.success) {
20
21
  throw new errors_1.ValidationError("Invalid upload ticket request", validation.error.errors);
21
22
  }
22
- return this.client.post('/api/media/upload-tickets', data);
23
+ return this.client.post(`${this.prefix}/media/upload-tickets`, data);
23
24
  }
24
25
  /**
25
26
  * 미디어 상세 정보 조회
@@ -27,7 +28,7 @@ class MediaModule {
27
28
  async getMedia(uid) {
28
29
  if (!uid)
29
30
  throw new errors_1.ValidationError("Media UID is required", []);
30
- return this.client.get(`/api/media/${uid}`);
31
+ return this.client.get(`${this.prefix}/media/${uid}`);
31
32
  }
32
33
  /**
33
34
  * S3 Presigned URL을 사용하여 파일 직접 업로드
@@ -2,7 +2,8 @@ import { AxiosInstance } from "axios";
2
2
  import { TermDto } from "@ph-cms/api-contract";
3
3
  export declare class TermsModule {
4
4
  private client;
5
- constructor(client: AxiosInstance);
5
+ private prefix;
6
+ constructor(client: AxiosInstance, prefix?: string);
6
7
  get(id: number): Promise<TermDto>;
7
8
  agree(data: {
8
9
  termCodes: string[];
@@ -2,17 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TermsModule = void 0;
4
4
  class TermsModule {
5
- constructor(client) {
5
+ constructor(client, prefix = '/api') {
6
6
  this.client = client;
7
+ this.prefix = prefix;
7
8
  }
8
9
  async get(id) {
9
- return this.client.get(`/api/terms/${id}`);
10
+ return this.client.get(`${this.prefix}/terms/${id}`);
10
11
  }
11
12
  async agree(data) {
12
- await this.client.post('/api/terms/agree', data);
13
+ await this.client.post(`${this.prefix}/terms/agree`, data);
13
14
  }
14
15
  async listByChannel(channelUid) {
15
- return this.client.get(`/api/terms/channels/${channelUid}`);
16
+ return this.client.get(`${this.prefix}/terms/channels/${channelUid}`);
16
17
  }
17
18
  }
18
19
  exports.TermsModule = TermsModule;
@@ -2,7 +2,8 @@ import { UpdateUserProfileRequest, UserDto } from "@ph-cms/api-contract";
2
2
  import { AxiosInstance } from "axios";
3
3
  export declare class UserModule {
4
4
  private client;
5
- constructor(client: AxiosInstance);
5
+ private prefix;
6
+ constructor(client: AxiosInstance, prefix?: string);
6
7
  /**
7
8
  * Updates a user's profile.
8
9
  *
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UserModule = void 0;
4
4
  class UserModule {
5
- constructor(client) {
5
+ constructor(client, prefix = '/api') {
6
6
  this.client = client;
7
+ this.prefix = prefix;
7
8
  }
8
9
  /**
9
10
  * Updates a user's profile.
@@ -16,7 +17,7 @@ class UserModule {
16
17
  * @param data - The update payload.
17
18
  */
18
19
  async updateProfile(uid, data) {
19
- return this.client.patch(`/api/users/${uid}`, data);
20
+ return this.client.patch(`${this.prefix}/users/${uid}`, data);
20
21
  }
21
22
  }
22
23
  exports.UserModule = UserModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ph-cms/client-sdk",
3
- "version": "0.1.19",
3
+ "version": "0.1.22",
4
4
  "description": "Unified PH-CMS Client SDK (React + Core)",
5
5
  "keywords": [],
6
6
  "license": "MIT",