tienjs-chartbrew-plugin-strapi 0.1.1 → 0.1.2
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/dist/_chunks/{App-o4BQubDg.mjs → App-BCYezLLX.mjs} +2 -2
- package/dist/_chunks/{App-ZXE7p32A.js → App-Dqp66kas.js} +2 -2
- package/dist/_chunks/{Setup-CDscG6im.mjs → Setup-CFHScO45.mjs} +2 -2
- package/dist/_chunks/{Setup-BgBqk03y.js → Setup-D_mIow3G.js} +2 -2
- package/dist/_chunks/{index-CTamZXwK.mjs → index-Cjgwr2aI.mjs} +2 -2
- package/dist/_chunks/{index-BvWsZ7SN.js → index-D2poyYLZ.js} +2 -2
- package/dist/_chunks/{store-Hck9X7RU.mjs → store-CDGc86NS.mjs} +27 -25
- package/dist/_chunks/{store-DXuh7EAW.js → store-DrVugT1Q.js} +27 -25
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
8
|
-
import { g as getSettings, s as setSettings, i as instance } from "./store-
|
|
7
|
+
import { P as PLUGIN_ID } from "./index-Cjgwr2aI.mjs";
|
|
8
|
+
import { g as getSettings, s as setSettings, i as instance } from "./store-CDGc86NS.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 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-
|
|
10
|
-
const store = require("./store-
|
|
9
|
+
const index = require("./index-D2poyYLZ.js");
|
|
10
|
+
const store = require("./store-DrVugT1Q.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 { 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-
|
|
8
|
-
import { g as getSettings, s as setSettings } from "./store-
|
|
7
|
+
import { P as PLUGIN_ID } from "./index-Cjgwr2aI.mjs";
|
|
8
|
+
import { g as getSettings, s as setSettings } from "./store-CDGc86NS.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;
|
|
@@ -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-
|
|
10
|
-
const store = require("./store-
|
|
9
|
+
const index = require("./index-D2poyYLZ.js");
|
|
10
|
+
const store = require("./store-DrVugT1Q.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;
|
|
@@ -37,7 +37,7 @@ const index = {
|
|
|
37
37
|
defaultMessage: "Chartbrew"
|
|
38
38
|
},
|
|
39
39
|
Component: async () => {
|
|
40
|
-
const { App } = await import("./App-
|
|
40
|
+
const { App } = await import("./App-BCYezLLX.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-
|
|
61
|
+
const { Setup } = await import("./Setup-CFHScO45.mjs");
|
|
62
62
|
return Setup;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -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-
|
|
41
|
+
const { App } = await Promise.resolve().then(() => require("./App-Dqp66kas.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-
|
|
62
|
+
const { Setup } = await Promise.resolve().then(() => require("./Setup-D_mIow3G.js"));
|
|
63
63
|
return Setup;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Cookies from "js-cookie";
|
|
2
|
-
import { P as PLUGIN_ID } from "./index-
|
|
2
|
+
import { P as PLUGIN_ID } from "./index-Cjgwr2aI.mjs";
|
|
3
3
|
function bind(fn, thisArg) {
|
|
4
4
|
return function wrap() {
|
|
5
5
|
return fn.apply(thisArg, arguments);
|
|
@@ -311,15 +311,15 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
311
311
|
if (setImmediateSupported) {
|
|
312
312
|
return setImmediate;
|
|
313
313
|
}
|
|
314
|
-
return postMessageSupported ? ((
|
|
314
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
315
315
|
_global.addEventListener("message", ({ source, data }) => {
|
|
316
|
-
if (source === _global && data ===
|
|
316
|
+
if (source === _global && data === token) {
|
|
317
317
|
callbacks.length && callbacks.shift()();
|
|
318
318
|
}
|
|
319
319
|
}, false);
|
|
320
320
|
return (cb) => {
|
|
321
321
|
callbacks.push(cb);
|
|
322
|
-
_global.postMessage(
|
|
322
|
+
_global.postMessage(token, "*");
|
|
323
323
|
};
|
|
324
324
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
325
325
|
})(
|
|
@@ -473,9 +473,9 @@ function removeBrackets(key) {
|
|
|
473
473
|
}
|
|
474
474
|
function renderKey(path, key, dots) {
|
|
475
475
|
if (!path) return key;
|
|
476
|
-
return path.concat(key).map(function each(
|
|
477
|
-
|
|
478
|
-
return !dots && i ? "[" +
|
|
476
|
+
return path.concat(key).map(function each(token, i) {
|
|
477
|
+
token = removeBrackets(token);
|
|
478
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
479
479
|
}).join(dots ? "." : "");
|
|
480
480
|
}
|
|
481
481
|
function isFlatArray(arr) {
|
|
@@ -2253,32 +2253,32 @@ let CancelToken$1 = class CancelToken {
|
|
|
2253
2253
|
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
2254
2254
|
resolvePromise = resolve;
|
|
2255
2255
|
});
|
|
2256
|
-
const
|
|
2256
|
+
const token = this;
|
|
2257
2257
|
this.promise.then((cancel) => {
|
|
2258
|
-
if (!
|
|
2259
|
-
let i =
|
|
2258
|
+
if (!token._listeners) return;
|
|
2259
|
+
let i = token._listeners.length;
|
|
2260
2260
|
while (i-- > 0) {
|
|
2261
|
-
|
|
2261
|
+
token._listeners[i](cancel);
|
|
2262
2262
|
}
|
|
2263
|
-
|
|
2263
|
+
token._listeners = null;
|
|
2264
2264
|
});
|
|
2265
2265
|
this.promise.then = (onfulfilled) => {
|
|
2266
2266
|
let _resolve;
|
|
2267
2267
|
const promise = new Promise((resolve) => {
|
|
2268
|
-
|
|
2268
|
+
token.subscribe(resolve);
|
|
2269
2269
|
_resolve = resolve;
|
|
2270
2270
|
}).then(onfulfilled);
|
|
2271
2271
|
promise.cancel = function reject() {
|
|
2272
|
-
|
|
2272
|
+
token.unsubscribe(_resolve);
|
|
2273
2273
|
};
|
|
2274
2274
|
return promise;
|
|
2275
2275
|
};
|
|
2276
2276
|
executor(function cancel(message, config, request) {
|
|
2277
|
-
if (
|
|
2277
|
+
if (token.reason) {
|
|
2278
2278
|
return;
|
|
2279
2279
|
}
|
|
2280
|
-
|
|
2281
|
-
resolvePromise(
|
|
2280
|
+
token.reason = new CanceledError$1(message, config, request);
|
|
2281
|
+
resolvePromise(token.reason);
|
|
2282
2282
|
});
|
|
2283
2283
|
}
|
|
2284
2284
|
/**
|
|
@@ -2330,11 +2330,11 @@ let CancelToken$1 = class CancelToken {
|
|
|
2330
2330
|
*/
|
|
2331
2331
|
static source() {
|
|
2332
2332
|
let cancel;
|
|
2333
|
-
const
|
|
2333
|
+
const token = new CancelToken(function executor(c) {
|
|
2334
2334
|
cancel = c;
|
|
2335
2335
|
});
|
|
2336
2336
|
return {
|
|
2337
|
-
token
|
|
2337
|
+
token,
|
|
2338
2338
|
cancel
|
|
2339
2339
|
};
|
|
2340
2340
|
}
|
|
@@ -2463,17 +2463,19 @@ const {
|
|
|
2463
2463
|
getAdapter,
|
|
2464
2464
|
mergeConfig
|
|
2465
2465
|
} = axios;
|
|
2466
|
-
let tokenCookie = Cookies.get("jwtToken");
|
|
2467
|
-
let tokenLocalStorage = localStorage.getItem("jwtToken");
|
|
2468
|
-
let token = tokenLocalStorage || tokenCookie;
|
|
2469
|
-
if (token) {
|
|
2470
|
-
token = token.replaceAll('"', "");
|
|
2471
|
-
}
|
|
2472
2466
|
const instance = axios.create({
|
|
2473
2467
|
baseURL: process.env.STRAPI_ADMIN_BACKEND_URL
|
|
2474
2468
|
});
|
|
2475
2469
|
instance.interceptors.request.use(
|
|
2476
2470
|
async (config) => {
|
|
2471
|
+
let tokenCookie = Cookies.get("jwtToken");
|
|
2472
|
+
let tokenLocalStorage = localStorage.getItem("jwtToken");
|
|
2473
|
+
let token = tokenLocalStorage || tokenCookie;
|
|
2474
|
+
if (token) {
|
|
2475
|
+
token = token.replaceAll('"', "");
|
|
2476
|
+
} else {
|
|
2477
|
+
token = "token-undefined";
|
|
2478
|
+
}
|
|
2477
2479
|
config.headers = {
|
|
2478
2480
|
Authorization: `Bearer ${token}`,
|
|
2479
2481
|
Accept: "application/json",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const Cookies = require("js-cookie");
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-D2poyYLZ.js");
|
|
4
4
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
5
5
|
const Cookies__default = /* @__PURE__ */ _interopDefault(Cookies);
|
|
6
6
|
function bind(fn, thisArg) {
|
|
@@ -314,15 +314,15 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
314
314
|
if (setImmediateSupported) {
|
|
315
315
|
return setImmediate;
|
|
316
316
|
}
|
|
317
|
-
return postMessageSupported ? ((
|
|
317
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
318
318
|
_global.addEventListener("message", ({ source, data }) => {
|
|
319
|
-
if (source === _global && data ===
|
|
319
|
+
if (source === _global && data === token) {
|
|
320
320
|
callbacks.length && callbacks.shift()();
|
|
321
321
|
}
|
|
322
322
|
}, false);
|
|
323
323
|
return (cb) => {
|
|
324
324
|
callbacks.push(cb);
|
|
325
|
-
_global.postMessage(
|
|
325
|
+
_global.postMessage(token, "*");
|
|
326
326
|
};
|
|
327
327
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
328
328
|
})(
|
|
@@ -476,9 +476,9 @@ function removeBrackets(key) {
|
|
|
476
476
|
}
|
|
477
477
|
function renderKey(path, key, dots) {
|
|
478
478
|
if (!path) return key;
|
|
479
|
-
return path.concat(key).map(function each(
|
|
480
|
-
|
|
481
|
-
return !dots && i ? "[" +
|
|
479
|
+
return path.concat(key).map(function each(token, i) {
|
|
480
|
+
token = removeBrackets(token);
|
|
481
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
482
482
|
}).join(dots ? "." : "");
|
|
483
483
|
}
|
|
484
484
|
function isFlatArray(arr) {
|
|
@@ -2256,32 +2256,32 @@ let CancelToken$1 = class CancelToken {
|
|
|
2256
2256
|
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
2257
2257
|
resolvePromise = resolve;
|
|
2258
2258
|
});
|
|
2259
|
-
const
|
|
2259
|
+
const token = this;
|
|
2260
2260
|
this.promise.then((cancel) => {
|
|
2261
|
-
if (!
|
|
2262
|
-
let i =
|
|
2261
|
+
if (!token._listeners) return;
|
|
2262
|
+
let i = token._listeners.length;
|
|
2263
2263
|
while (i-- > 0) {
|
|
2264
|
-
|
|
2264
|
+
token._listeners[i](cancel);
|
|
2265
2265
|
}
|
|
2266
|
-
|
|
2266
|
+
token._listeners = null;
|
|
2267
2267
|
});
|
|
2268
2268
|
this.promise.then = (onfulfilled) => {
|
|
2269
2269
|
let _resolve;
|
|
2270
2270
|
const promise = new Promise((resolve) => {
|
|
2271
|
-
|
|
2271
|
+
token.subscribe(resolve);
|
|
2272
2272
|
_resolve = resolve;
|
|
2273
2273
|
}).then(onfulfilled);
|
|
2274
2274
|
promise.cancel = function reject() {
|
|
2275
|
-
|
|
2275
|
+
token.unsubscribe(_resolve);
|
|
2276
2276
|
};
|
|
2277
2277
|
return promise;
|
|
2278
2278
|
};
|
|
2279
2279
|
executor(function cancel(message, config, request) {
|
|
2280
|
-
if (
|
|
2280
|
+
if (token.reason) {
|
|
2281
2281
|
return;
|
|
2282
2282
|
}
|
|
2283
|
-
|
|
2284
|
-
resolvePromise(
|
|
2283
|
+
token.reason = new CanceledError$1(message, config, request);
|
|
2284
|
+
resolvePromise(token.reason);
|
|
2285
2285
|
});
|
|
2286
2286
|
}
|
|
2287
2287
|
/**
|
|
@@ -2333,11 +2333,11 @@ let CancelToken$1 = class CancelToken {
|
|
|
2333
2333
|
*/
|
|
2334
2334
|
static source() {
|
|
2335
2335
|
let cancel;
|
|
2336
|
-
const
|
|
2336
|
+
const token = new CancelToken(function executor(c) {
|
|
2337
2337
|
cancel = c;
|
|
2338
2338
|
});
|
|
2339
2339
|
return {
|
|
2340
|
-
token
|
|
2340
|
+
token,
|
|
2341
2341
|
cancel
|
|
2342
2342
|
};
|
|
2343
2343
|
}
|
|
@@ -2466,17 +2466,19 @@ const {
|
|
|
2466
2466
|
getAdapter,
|
|
2467
2467
|
mergeConfig
|
|
2468
2468
|
} = axios;
|
|
2469
|
-
let tokenCookie = Cookies__default.default.get("jwtToken");
|
|
2470
|
-
let tokenLocalStorage = localStorage.getItem("jwtToken");
|
|
2471
|
-
let token = tokenLocalStorage || tokenCookie;
|
|
2472
|
-
if (token) {
|
|
2473
|
-
token = token.replaceAll('"', "");
|
|
2474
|
-
}
|
|
2475
2469
|
const instance = axios.create({
|
|
2476
2470
|
baseURL: process.env.STRAPI_ADMIN_BACKEND_URL
|
|
2477
2471
|
});
|
|
2478
2472
|
instance.interceptors.request.use(
|
|
2479
2473
|
async (config) => {
|
|
2474
|
+
let tokenCookie = Cookies__default.default.get("jwtToken");
|
|
2475
|
+
let tokenLocalStorage = localStorage.getItem("jwtToken");
|
|
2476
|
+
let token = tokenLocalStorage || tokenCookie;
|
|
2477
|
+
if (token) {
|
|
2478
|
+
token = token.replaceAll('"', "");
|
|
2479
|
+
} else {
|
|
2480
|
+
token = "token-undefined";
|
|
2481
|
+
}
|
|
2480
2482
|
config.headers = {
|
|
2481
2483
|
Authorization: `Bearer ${token}`,
|
|
2482
2484
|
Accept: "application/json",
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
package/package.json
CHANGED