@jetthai/cuora 1.1.270-dev-4 → 1.1.270-dev-5

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,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
+ ### [1.1.270-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.270-dev-4...v1.1.270-dev-5) (2024-06-12)
6
+
5
7
  ### [1.1.270-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.279-dev-3...v1.1.270-dev-4) (2024-06-12)
6
8
 
7
9
  ### [1.1.279-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.279-dev-2...v1.1.279-dev-3) (2024-06-12)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.270-dev-4",
3
+ "version": "1.1.270-dev-5",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -286,7 +286,18 @@ export default function (request) {
286
286
  services: {
287
287
  fetchConfig: async (context, event) => {
288
288
  const [site, layout] = await Promise.all([request.send(api.getConfig({ appSecret })), request.send(api.getLayoutConfig({ appSecret }))])
289
- return { siteConfig: JSON.parse(window.atob(site.config)), layoutConfig: layout.config }
289
+ const base64Url = site.config.split('.')[0]
290
+ const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
291
+ const decodeResult = decodeURIComponent(
292
+ window
293
+ .atob(base64)
294
+ .split('')
295
+ .map((c) => {
296
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
297
+ })
298
+ .join('')
299
+ )
300
+ return { siteConfig: JSON.parse(decodeResult), layoutConfig: layout.config }
290
301
  },
291
302
  fetchFeeds: async (context, event) => {
292
303
  return await request.send(api.feeds({ appSecret }))