@jetthai/cuora 1.1.400-dev-9 → 1.1.400-dev-13

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
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
+ ### [1.1.400-dev-13](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-12...v1.1.400-dev-13) (2025-12-18)
6
+
7
+ ### [1.1.400-dev-12](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-11...v1.1.400-dev-12) (2025-12-18)
8
+
9
+ ### [1.1.400-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-10...v1.1.400-dev-11) (2025-12-18)
10
+
11
+ ### [1.1.400-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-9...v1.1.400-dev-10) (2025-12-18)
12
+
5
13
  ### [1.1.400-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-8...v1.1.400-dev-9) (2025-12-17)
6
14
 
7
15
  ### [1.1.400-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-7...v1.1.400-dev-8) (2025-12-16)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.400-dev-9",
3
+ "version": "1.1.400-dev-13",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -465,9 +465,7 @@ export default function (request) {
465
465
  referralObj.channel = storage.get('channel') || defaultChannel || channel
466
466
  referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
467
467
 
468
- // OZE 先使用 v2 測試 ,等待確認沒問題後,所有站點再統一用 v2
469
- // 但 OZE ZALO 仍維持 v1
470
- const fullURL = ['OZE'].includes(clientId) && provider !== 'zalo' ? request.config.fullURL.replace('/v1/', '/v2/') : request.config.fullURL
468
+ const fullURL = request.config.fullURL
471
469
 
472
470
  const redirectURL = urljoin(
473
471
  fullURL,
@@ -243,13 +243,10 @@ export default class Request {
243
243
  this._checkToken(req)
244
244
 
245
245
  const requestConfig = this._createConfig(req, cancelToken)
246
- // console.log('*請求資料Check', requestConfig)
247
246
  const configUrls = ['getConfig', 'get-config']
248
247
  if (this.isBlocked && !configUrls.includes(requestConfig.url)) {
249
248
  // 狀態是維護中&請求非siteConfig,終止所有的請求,除了維護頁需要的資料(siteConfig)
250
- // console.log('%c*禁止的請求目標', requestConfig)
251
249
  } else {
252
- // console.log('%c*允許的請求目標', requestConfig)
253
250
  const { data } = await this.axios.request(requestConfig)
254
251
  return data
255
252
  }
@@ -282,9 +279,9 @@ export default class Request {
282
279
  const { method, url, params, isPublic, isFormData, headers } = req
283
280
  let fullURL = this.config.fullURL
284
281
  let urlName = url
282
+
285
283
  // 有些API會將參數(/?)直接帶在URL上,所以要將參數排除
286
284
  const cleanUrl = url.split('?')[0]
287
-
288
285
  const isV2Supported = supportVersion2List.some((supportedUrl) => {
289
286
  // 如果包含動態參數(:parameter),則使用模式匹配
290
287
  if (supportedUrl.includes(':')) {
@@ -294,16 +291,9 @@ export default class Request {
294
291
  }
295
292
  return supportedUrl === cleanUrl
296
293
  })
297
-
298
- // 目前全站都支援V2,若有需要限制為V1的站點可以填入,此段等轉換全部完成之後就可以移除了
299
- const supportV2Toggle = [''].includes(this.config?.clientId)
300
-
301
- if (isV2Supported && !supportV2Toggle) {
302
- fullURL = fullURL.replace('/v1/', '/v2/')
294
+ // 符合轉換規則的API進行路徑調整
295
+ if (isV2Supported) {
303
296
  urlName = this._convertUrlToKebabCase(url)
304
- // console.log(`*[DEV_ONLY]V2`, 'url:', urlName)
305
- } else {
306
- // console.log(`*[DEV_ONLY]V2-不支援:`, 'url:', urlName)
307
297
  }
308
298
 
309
299
  if (isFormData) {