tienjs-chartbrew-plugin-strapi 0.1.0 → 0.1.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.
@@ -6,8 +6,8 @@ const reactRouterDom = require("react-router-dom");
6
6
  const admin = require("@strapi/strapi/admin");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
- const index = require("./index-Bk9ujIXz.js");
10
- const store = require("./store-B-zkLoDr.js");
9
+ const index = require("./index-BvWsZ7SN.js");
10
+ const store = require("./store-DXuh7EAW.js");
11
11
  async function login() {
12
12
  const { host, token } = await store.getSettings();
13
13
  return fetch(`${host}/user/relog`, {
@@ -4,8 +4,8 @@ import { Link, Routes, Route } from "react-router-dom";
4
4
  import { Layouts, Page } from "@strapi/strapi/admin";
5
5
  import { LinkButton, Loader, Box, Flex, Typography, SingleSelect, SingleSelectOption, EmptyStateLayout, Alert, Link as Link$1, Checkbox, Grid, Button, Divider, Combobox, ComboboxOption } from "@strapi/design-system";
6
6
  import { ChartCircle, Plus, ExternalLink, ArrowLeft } from "@strapi/icons";
7
- import { P as PLUGIN_ID } from "./index-CXvgiYYO.mjs";
8
- import { g as getSettings, s as setSettings, i as instance } from "./store-CES_iNgI.mjs";
7
+ import { P as PLUGIN_ID } from "./index-CTamZXwK.mjs";
8
+ import { g as getSettings, s as setSettings, i as instance } from "./store-Hck9X7RU.mjs";
9
9
  async function login() {
10
10
  const { host, token } = await getSettings();
11
11
  return fetch(`${host}/user/relog`, {
@@ -6,8 +6,8 @@ const designSystem = require("@strapi/design-system");
6
6
  const admin = require("@strapi/strapi/admin");
7
7
  const icons = require("@strapi/icons");
8
8
  const reactRouterDom = require("react-router-dom");
9
- const index = require("./index-Bk9ujIXz.js");
10
- const store = require("./store-B-zkLoDr.js");
9
+ const index = require("./index-BvWsZ7SN.js");
10
+ const store = require("./store-DXuh7EAW.js");
11
11
  const defaultHost = "https://api.chartbrew.com";
12
12
  const defaultClientHost = "https://app.chartbrew.com";
13
13
  const strapiHostEnv = process.env.STRAPI_ADMIN_BACKEND_URL;
@@ -4,8 +4,8 @@ import { LinkButton, Box, Typography, Tabs, Field, Button, Link, Flex, Alert } f
4
4
  import { useNotification, Layouts } from "@strapi/strapi/admin";
5
5
  import { ExternalLink, Magic, Check, Cross, ChevronRight } from "@strapi/icons";
6
6
  import { Link as Link$1 } from "react-router-dom";
7
- import { P as PLUGIN_ID } from "./index-CXvgiYYO.mjs";
8
- import { g as getSettings, s as setSettings } from "./store-CES_iNgI.mjs";
7
+ import { P as PLUGIN_ID } from "./index-CTamZXwK.mjs";
8
+ import { g as getSettings, s as setSettings } from "./store-Hck9X7RU.mjs";
9
9
  const defaultHost = "https://api.chartbrew.com";
10
10
  const defaultClientHost = "https://app.chartbrew.com";
11
11
  const strapiHostEnv = process.env.STRAPI_ADMIN_BACKEND_URL;
@@ -38,7 +38,7 @@ const index = {
38
38
  defaultMessage: "Chartbrew"
39
39
  },
40
40
  Component: async () => {
41
- const { App } = await Promise.resolve().then(() => require("./App-ngsyON1R.js"));
41
+ const { App } = await Promise.resolve().then(() => require("./App-ZXE7p32A.js"));
42
42
  return App;
43
43
  }
44
44
  });
@@ -59,7 +59,7 @@ const index = {
59
59
  id: "settings",
60
60
  to: `/settings/${PLUGIN_ID}`,
61
61
  Component: async () => {
62
- const { Setup } = await Promise.resolve().then(() => require("./Setup-CL3F4zOi.js"));
62
+ const { Setup } = await Promise.resolve().then(() => require("./Setup-BgBqk03y.js"));
63
63
  return Setup;
64
64
  }
65
65
  }
@@ -37,7 +37,7 @@ const index = {
37
37
  defaultMessage: "Chartbrew"
38
38
  },
39
39
  Component: async () => {
40
- const { App } = await import("./App-Be1FtvNK.mjs");
40
+ const { App } = await import("./App-o4BQubDg.mjs");
41
41
  return App;
42
42
  }
43
43
  });
@@ -58,7 +58,7 @@ const index = {
58
58
  id: "settings",
59
59
  to: `/settings/${PLUGIN_ID}`,
60
60
  Component: async () => {
61
- const { Setup } = await import("./Setup-C_xPro4U.mjs");
61
+ const { Setup } = await import("./Setup-CDscG6im.mjs");
62
62
  return Setup;
63
63
  }
64
64
  }
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
- const index = require("./index-Bk9ujIXz.js");
2
+ const Cookies = require("js-cookie");
3
+ const index = require("./index-BvWsZ7SN.js");
4
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
5
+ const Cookies__default = /* @__PURE__ */ _interopDefault(Cookies);
3
6
  function bind(fn, thisArg) {
4
7
  return function wrap() {
5
8
  return fn.apply(thisArg, arguments);
@@ -2463,7 +2466,9 @@ const {
2463
2466
  getAdapter,
2464
2467
  mergeConfig
2465
2468
  } = axios;
2466
- let token = localStorage.getItem("jwtToken");
2469
+ let tokenCookie = Cookies__default.default.get("jwtToken");
2470
+ let tokenLocalStorage = localStorage.getItem("jwtToken");
2471
+ let token = tokenLocalStorage || tokenCookie;
2467
2472
  if (token) {
2468
2473
  token = token.replaceAll('"', "");
2469
2474
  }
@@ -1,4 +1,5 @@
1
- import { P as PLUGIN_ID } from "./index-CXvgiYYO.mjs";
1
+ import Cookies from "js-cookie";
2
+ import { P as PLUGIN_ID } from "./index-CTamZXwK.mjs";
2
3
  function bind(fn, thisArg) {
3
4
  return function wrap() {
4
5
  return fn.apply(thisArg, arguments);
@@ -2462,7 +2463,9 @@ const {
2462
2463
  getAdapter,
2463
2464
  mergeConfig
2464
2465
  } = axios;
2465
- let token = localStorage.getItem("jwtToken");
2466
+ let tokenCookie = Cookies.get("jwtToken");
2467
+ let tokenLocalStorage = localStorage.getItem("jwtToken");
2468
+ let token = tokenLocalStorage || tokenCookie;
2466
2469
  if (token) {
2467
2470
  token = token.replaceAll('"', "");
2468
2471
  }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-Bk9ujIXz.js");
2
+ const index = require("../_chunks/index-BvWsZ7SN.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-CXvgiYYO.mjs";
1
+ import { i } from "../_chunks/index-CTamZXwK.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tienjs-chartbrew-plugin-strapi",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Chartbrew brings data visualization to your Strapi dashboard",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/chartbrew/strapi-plugin-chartbrew#readme",