@manuscripts/article-editor 3.8.91 → 3.8.92
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/cjs/EditorApp.js +2 -7
- package/dist/cjs/EditorApp.js.map +1 -1
- package/dist/cjs/Main.js +2 -2
- package/dist/cjs/Main.js.map +1 -1
- package/dist/cjs/api/Api.js +8 -2
- package/dist/cjs/api/Api.js.map +1 -1
- package/dist/cjs/components/Page.js +0 -7
- package/dist/cjs/components/Page.js.map +1 -1
- package/dist/cjs/index.js +2 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/es/EditorApp.js +2 -7
- package/dist/es/EditorApp.js.map +1 -1
- package/dist/es/Main.js +2 -2
- package/dist/es/Main.js.map +1 -1
- package/dist/es/api/Api.js +8 -2
- package/dist/es/api/Api.js.map +1 -1
- package/dist/es/components/Page.js +0 -7
- package/dist/es/components/Page.js.map +1 -1
- package/dist/es/index.js +3 -21
- package/dist/es/index.js.map +1 -1
- package/dist/es/store/Store.js.map +1 -1
- package/dist/types/EditorApp.d.ts +1 -1
- package/dist/types/api/Api.d.ts +3 -2
- package/dist/types/store/Store.d.ts +0 -2
- package/package.json +2 -4
- package/dist/cjs/lib/authorization.js +0 -31
- package/dist/cjs/lib/authorization.js.map +0 -1
- package/dist/cjs/lib/client.js +0 -31
- package/dist/cjs/lib/client.js.map +0 -1
- package/dist/cjs/lib/token.js +0 -25
- package/dist/cjs/lib/token.js.map +0 -1
- package/dist/cjs/lib/user-id.js +0 -25
- package/dist/cjs/lib/user-id.js.map +0 -1
- package/dist/cjs/lib/user.js +0 -29
- package/dist/cjs/lib/user.js.map +0 -1
- package/dist/cjs/store/TokenData.js +0 -68
- package/dist/cjs/store/TokenData.js.map +0 -1
- package/dist/es/lib/authorization.js +0 -24
- package/dist/es/lib/authorization.js.map +0 -1
- package/dist/es/lib/client.js +0 -26
- package/dist/es/lib/client.js.map +0 -1
- package/dist/es/lib/token.js +0 -22
- package/dist/es/lib/token.js.map +0 -1
- package/dist/es/lib/user-id.js +0 -22
- package/dist/es/lib/user-id.js.map +0 -1
- package/dist/es/lib/user.js +0 -22
- package/dist/es/lib/user.js.map +0 -1
- package/dist/es/store/TokenData.js +0 -61
- package/dist/es/store/TokenData.js.map +0 -1
- package/dist/types/lib/authorization.d.ts +0 -13
- package/dist/types/lib/client.d.ts +0 -13
- package/dist/types/lib/token.d.ts +0 -18
- package/dist/types/lib/user-id.d.ts +0 -18
- package/dist/types/lib/user.d.ts +0 -20
- package/dist/types/store/TokenData.d.ts +0 -30
package/dist/cjs/EditorApp.js
CHANGED
@@ -33,9 +33,7 @@ const ApiSource_1 = require("./api/ApiSource");
|
|
33
33
|
const Page_1 = require("./components/Page");
|
34
34
|
const ManuscriptPageContainer_1 = __importDefault(require("./components/projects/ManuscriptPageContainer"));
|
35
35
|
const ManuscriptPlaceholder_1 = require("./components/projects/ManuscriptPlaceholder");
|
36
|
-
const user_1 = require("./lib/user");
|
37
36
|
const store_1 = require("./store");
|
38
|
-
const TokenData_1 = require("./store/TokenData");
|
39
37
|
const PlaceholderWrapper = styled_components_1.default.div `
|
40
38
|
height: 100%;
|
41
39
|
flex: 1;
|
@@ -44,12 +42,11 @@ const PlaceholderWrapper = styled_components_1.default.div `
|
|
44
42
|
justify-content: center;
|
45
43
|
align-items: center;
|
46
44
|
`;
|
47
|
-
const EditorApp = ({ manuscriptID, projectID, permittedActions, fileManagement, files,
|
48
|
-
const userID = (0, user_1.getCurrentUserId)();
|
45
|
+
const EditorApp = ({ manuscriptID, projectID, permittedActions, fileManagement, files, getAuthToken, observer, }) => {
|
49
46
|
const [store, setStore] = (0, react_1.useState)();
|
50
47
|
const loadedRef = (0, react_1.useRef)(false);
|
51
48
|
const observerSubscribed = (0, react_1.useRef)(false);
|
52
|
-
const api = (0, react_1.useMemo)(() => new Api_1.Api(
|
49
|
+
const api = (0, react_1.useMemo)(() => new Api_1.Api(getAuthToken), [getAuthToken]);
|
53
50
|
(0, react_1.useEffect)(() => {
|
54
51
|
// implement remount for the store if component is retriggered
|
55
52
|
if (loadedRef.current) {
|
@@ -62,8 +59,6 @@ const EditorApp = ({ manuscriptID, projectID, permittedActions, fileManagement,
|
|
62
59
|
manuscriptID,
|
63
60
|
files,
|
64
61
|
permittedActions,
|
65
|
-
userID: userID || '',
|
66
|
-
tokenData: new TokenData_1.TokenData(),
|
67
62
|
});
|
68
63
|
const apiSource = new ApiSource_1.ApiSource(api);
|
69
64
|
(0, store_1.createStore)([props, apiSource])
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,+CAMc;AACd,0EAAsC;AAEtC,mCAA2C;AAC3C,+CAA2C;AAC3C,4CAAwC;AACxC,4GAAmF;AACnF,uFAAmF;AACnF,
|
1
|
+
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,+CAMc;AACd,0EAAsC;AAEtC,mCAA2C;AAC3C,+CAA2C;AAC3C,4CAAwC;AACxC,4GAAmF;AACnF,uFAAmF;AACnF,mCAMgB;AAuBhB,MAAM,kBAAkB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;CAOpC,CAAA;AAED,MAAM,SAAS,GAA6B,CAAC,EAC3C,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,GAAgB,CAAA;IAClD,MAAM,SAAS,GAAG,IAAA,cAAM,EAAU,KAAK,CAAC,CAAA;IACxC,MAAM,kBAAkB,GAAG,IAAA,cAAM,EAAU,KAAK,CAAC,CAAA;IAEjD,MA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AAK,EAAE,QAAQ,EAAE;YAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAc,CAAC;SACnD,CAAA;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;IAErB,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,8BAAC,gBAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG;QAC7B,8BAAC,4BAAoB,IAAC,KAAK,EAAE,KAAK;YAChC,8BAAC,WAAI;gBACH,8BAAC,iCAAuB,OAAG,CACtB,CACc,CACH,CACvB,CAAC,CAAC,CAAC,CACF,8BAAC,kBAAkB;QACjB,8BAAC,6CAAqB,OAAG,CACN,CACtB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
|
package/dist/cjs/Main.js
CHANGED
@@ -19,8 +19,8 @@ const react_dnd_1 = require("react-dnd");
|
|
19
19
|
const react_dnd_html5_backend_1 = require("react-dnd-html5-backend");
|
20
20
|
const EditorApp_1 = __importDefault(require("./EditorApp"));
|
21
21
|
const theme_1 = require("./theme/theme");
|
22
|
-
const Main = ({ fileManagement, files, manuscriptID, projectID,
|
22
|
+
const Main = ({ fileManagement, files, manuscriptID, projectID, permittedActions, getAuthToken, observer, }) => (react_1.default.createElement(react_dnd_1.DndProvider, { backend: react_dnd_html5_backend_1.HTML5Backend },
|
23
23
|
react_1.default.createElement(theme_1.GlobalStyle, null),
|
24
|
-
react_1.default.createElement(EditorApp_1.default, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions,
|
24
|
+
react_1.default.createElement(EditorApp_1.default, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, getAuthToken: getAuthToken, observer: observer })));
|
25
25
|
exports.default = Main;
|
26
26
|
//# sourceMappingURL=Main.js.map
|
package/dist/cjs/Main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAEH,kDAAyB;AACzB,yCAAuC;AACvC,qEAAsD;AAEtD,4DAAuD;AACvD,yCAA2C;AAE3C,MAAM,IAAI,GAA6B,CAAC,EACtC,cAAc,EACd,KAAK,EACL,YAAY,EACZ,SAAS,EACT,
|
1
|
+
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAEH,kDAAyB;AACzB,yCAAuC;AACvC,qEAAsD;AAEtD,4DAAuD;AACvD,yCAA2C;AAE3C,MAAM,IAAI,GAA6B,CAAC,EACtC,cAAc,EACd,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,QAAQ,GACT,EAAE,EAAE,CAAC,CACJ,8BAAC,uBAAW,IAAC,OAAO,EAAE,sCAAY;IAChC,8BAAC,mBAAW,OAAG;IACf,8BAAC,mBAAS,IACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,GAClB,CACU,CACf,CAAA;AAED,kBAAe,IAAI,CAAA"}
|
package/dist/cjs/api/Api.js
CHANGED
@@ -20,7 +20,12 @@ const axios_1 = __importDefault(require("axios"));
|
|
20
20
|
const react_1 = require("react");
|
21
21
|
const config_1 = require("../config");
|
22
22
|
class Api {
|
23
|
-
constructor(
|
23
|
+
constructor(getAuthToken) {
|
24
|
+
this.authInterceptor = async (config, getToken) => {
|
25
|
+
const token = await getToken();
|
26
|
+
config.headers.Authorization = 'Bearer ' + token;
|
27
|
+
return config;
|
28
|
+
};
|
24
29
|
this.get = async (url) => {
|
25
30
|
try {
|
26
31
|
const result = await this.instance.get(url, {
|
@@ -151,8 +156,9 @@ class Api {
|
|
151
156
|
const config = (0, config_1.getConfig)();
|
152
157
|
this.instance = axios_1.default.create({
|
153
158
|
baseURL: config.api.url,
|
154
|
-
headers: { ...config.api.headers
|
159
|
+
headers: { ...config.api.headers },
|
155
160
|
});
|
161
|
+
this.instance.interceptors.request.use((config) => this.authInterceptor(config, getAuthToken));
|
156
162
|
}
|
157
163
|
}
|
158
164
|
exports.Api = Api;
|
package/dist/cjs/api/Api.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../../src/api/Api.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAMiC;AAEjC,
|
1
|
+
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../../src/api/Api.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAMiC;AAEjC,kDAIc;AACd,iCAAiD;AAEjD,sCAAqC;AAWrC,MAAa,GAAG;IAGd,YAAY,YAA+C;QAW3D,oBAAe,GAAG,KAAK,EACrB,MAAkC,EAClC,QAA2C,EAC3C,EAAE;YACF,MAAM,KAAK,GAAG,MAAM,QAAQ,EAAE,CAAA;YAC9B,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG,SAAS,GAAG,KAAK,CAAA;YAChD,OAAO,MAAM,CAAA;QACf,CAAC,CAAA;QAED,QAAG,GAAG,KAAK,EAAK,GAAW,EAAE,EAAE;YAC7B,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAI,GAAG,EAAE;oBAC7C,OAAO,EAAE;wBACP,cAAc,EAAE,gCAAgC;qBACjD;iBACF,CAAC,CAAA;gBACF,OAAO,MAAM,CAAC,IAAI,CAAA;aACnB;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACd,OAAO,SAAS,CAAA;aACj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,GAAG;YACvB,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE;SACnC,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAChD,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,YAAY,CAAC,CAC3C,CAAA;IACH,CAAC;CAwMF;AApND,kBAoNC;AAEY,QAAA,UAAU,GAAG,IAAA,qBAAa,EAAkB,SAAS,CAAC,CAAA;AAE5D,MAAM,MAAM,GAAG,GAAQ,EAAE;IAC9B,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,kBAAU,CAAC,CAAA;IAClC,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;KACvC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AANY,QAAA,MAAM,UAMlB"}
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Page = exports.Centered = exports.Main = void 0;
|
18
18
|
const react_1 = __importDefault(require("react"));
|
19
19
|
const styled_components_1 = __importDefault(require("styled-components"));
|
20
|
-
const store_1 = require("../store");
|
21
20
|
exports.Main = styled_components_1.default.main `
|
22
21
|
height: 100%;
|
23
22
|
flex: 1;
|
@@ -48,12 +47,6 @@ const PageContainer = styled_components_1.default.div `
|
|
48
47
|
font-family: ${(props) => props.theme.font.family.sans};
|
49
48
|
`;
|
50
49
|
const Page = ({ children }) => {
|
51
|
-
const [{ tokenData }] = (0, store_1.useStore)((store) => ({
|
52
|
-
tokenData: store.tokenData,
|
53
|
-
}));
|
54
|
-
if (!tokenData) {
|
55
|
-
throw new Error('TokenData not found. User is not loggged in!');
|
56
|
-
}
|
57
50
|
return react_1.default.createElement(PageContainer, null, children);
|
58
51
|
};
|
59
52
|
exports.Page = Page;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,kDAAyB;AACzB,0EAAsC;
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,kDAAyB;AACzB,0EAAsC;AAEzB,QAAA,IAAI,GAAG,2BAAM,CAAC,IAAI,CAAA;;;;;sBAKT,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;;;;;;;;CAQrE,CAAA;AAEY,QAAA,QAAQ,GAAG,IAAA,2BAAM,EAAC,YAAI,CAAC,CAAA;;;;;CAKnC,CAAA;AAED,MAAM,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;WAMrB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;iBACpC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;CACvD,CAAA;AAEM,MAAM,IAAI,GAEZ,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpB,OAAO,8BAAC,aAAa,QAAE,QAAQ,CAAiB,CAAA;AAClD,CAAC,CAAA;AAJY,QAAA,IAAI,QAIhB"}
|
package/dist/cjs/index.js
CHANGED
@@ -39,39 +39,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
40
40
|
exports.ManuscriptEditorApp = exports.getUserRole = exports.ProjectRole = void 0;
|
41
41
|
require("./lib/fonts");
|
42
|
-
const jwt_decode_1 = __importDefault(require("jwt-decode"));
|
43
42
|
const react_1 = __importStar(require("react"));
|
44
43
|
const Loading_1 = require("./components/Loading");
|
45
44
|
const config_1 = require("./config");
|
46
|
-
const token_1 = __importDefault(require("./lib/token"));
|
47
|
-
const user_id_1 = __importDefault(require("./lib/user-id"));
|
48
45
|
const Main_1 = __importDefault(require("./Main"));
|
49
46
|
const ThemeProvider_1 = require("./theme/ThemeProvider");
|
50
47
|
var roles_1 = require("./lib/roles");
|
51
48
|
Object.defineProperty(exports, "ProjectRole", { enumerable: true, get: function () { return roles_1.ProjectRole; } });
|
52
49
|
var roles_2 = require("./lib/roles");
|
53
50
|
Object.defineProperty(exports, "getUserRole", { enumerable: true, get: function () { return roles_2.getUserRole; } });
|
54
|
-
const ManuscriptEditor = ({ fileManagement, files, manuscriptID, projectID, permittedActions,
|
55
|
-
(0, react_1.useMemo)(() => {
|
56
|
-
if (authToken) {
|
57
|
-
token_1.default.remove();
|
58
|
-
token_1.default.set(authToken); // @TODO actually relogin whe the token changes
|
59
|
-
const { userID } = (0, jwt_decode_1.default)(authToken);
|
60
|
-
if (!userID) {
|
61
|
-
throw new Error('Invalid token');
|
62
|
-
}
|
63
|
-
user_id_1.default.set(userID);
|
64
|
-
}
|
65
|
-
return () => {
|
66
|
-
token_1.default.remove();
|
67
|
-
user_id_1.default.remove();
|
68
|
-
};
|
69
|
-
}, [authToken]);
|
51
|
+
const ManuscriptEditor = ({ fileManagement, files, manuscriptID, projectID, permittedActions, getAuthToken, config, observer, }) => {
|
70
52
|
(0, config_1.setConfig)(config);
|
71
53
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
72
54
|
react_1.default.createElement(ThemeProvider_1.ThemeProvider, null,
|
73
55
|
react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(Loading_1.LoadingPage, { className: 'loader' }, "Loading...") },
|
74
|
-
react_1.default.createElement(Main_1.default, { fileManagement: fileManagement, files: files,
|
56
|
+
react_1.default.createElement(Main_1.default, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, getAuthToken: getAuthToken, observer: observer }))),
|
75
57
|
react_1.default.createElement("div", { id: "menu" }),
|
76
58
|
react_1.default.createElement("div", { id: "notifications" }),
|
77
59
|
react_1.default.createElement("div", { id: "size" })));
|
package/dist/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAoB;AAEpB
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAoB;AAEpB,+CAAuC;AAEvC,kDAAkD;AAClD,qCAA6D;AAE7D,kDAAyB;AACzB,yDAAqD;AACrD,qCAAyC;AAAhC,oGAAA,WAAW,OAAA;AAEpB,qCAAyC;AAAhC,oGAAA,WAAW,OAAA;AASpB,MAAM,gBAAgB,GAElB,CAAC,EACH,cAAc,EACd,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,QAAQ,GACT,EAAE,EAAE;IACH,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAA;IACjB,OAAO,CACL;QACE,8BAAC,6BAAa;YACZ,8BAAC,gBAAQ,IACP,QAAQ,EAAE,8BAAC,qBAAW,IAAC,SAAS,EAAE,QAAQ,iBAA0B;gBAEpE,8BAAC,cAAI,IACH,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,GAClB,CACO,CACG;QAChB,uCAAK,EAAE,EAAC,MAAM,GAAO;QACrB,uCAAK,EAAE,EAAC,eAAe,GAAO;QAC9B,uCAAK,EAAE,EAAC,MAAM,GAAO,CACpB,CACJ,CAAA;AACH,CAAC,CAAA;AAEY,QAAA,mBAAmB,GAAG,eAAK,CAAC,IAAI,CAC3C,gBAAgB,EAChB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IACb,mHAAmH;IACnH,mIAAmI;IACnI,OAAO,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAA,CAAC,sCAAsC;AACtF,CAAC,CACF,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAkBH,wBAAkE;
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAkBH,wBAAkE;AAyDlE,MAAM,cAAc,GAAG,GAAG,CAAA,CAAC,0BAA0B;AAErD,MAAM,cAAc,GAAG,CAAC,OAAY,EAAE,KAAY,EAAE,MAAe,EAAE,EAAE;IACrE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAA;AACjC,CAAC,CAAA;AAqBD,MAAa,YAAY;IAWvB,YACE,OAAO,GAAG,cAAc,EACxB,cAAuC,EACvC,KAAK,GAAG,EAAE;QAiBZ,UAAK,GAA6C,IAAI,GAAG,EAAE,CAAA;QAa3D,SAAI,GAAG,KAAK,EAAE,OAAkC,EAAE,EAAE;YAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;YAEtB,MAAM,KAAK,GAAG,MAAM,IAAA,wBAAqB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACjE,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAI,KAAe,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAA;YAC3E,4CAA4C;YAC5C,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,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CACd,CAAA;QACD,IAAI,kBAAkB,EAAE;YACtB,IAAI,CAAC,QAAQ,CACX,IAAI,CAAC,OAAO,CACV,kBAAkB,CAAC,OAAO,EAC1B,IAAI,CAAC,KAAM,EACX,kBAAkB,CAAC,MAAM,IAAI,EAAE,CAChC,CACF,CAAA;SACF;IACH,CAAC;IACD,OAAO;QACL,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAM,CAAC,CAAA;SACjC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;SACrE;QACD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,EAAW,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;IACxB,CAAC;CACF;AAlHD,oCAkHC"}
|
package/dist/es/EditorApp.js
CHANGED
@@ -5,9 +5,7 @@ import { ApiSource } from './api/ApiSource';
|
|
5
5
|
import { Page } from './components/Page';
|
6
6
|
import ManuscriptPageContainer from './components/projects/ManuscriptPageContainer';
|
7
7
|
import { ManuscriptPlaceholder } from './components/projects/ManuscriptPlaceholder';
|
8
|
-
import { getCurrentUserId } from './lib/user';
|
9
8
|
import { BasicSource, createStore, GenericStoreProvider, } from './store';
|
10
|
-
import { TokenData } from './store/TokenData';
|
11
9
|
const PlaceholderWrapper = styled.div `
|
12
10
|
height: 100%;
|
13
11
|
flex: 1;
|
@@ -16,12 +14,11 @@ const PlaceholderWrapper = styled.div `
|
|
16
14
|
justify-content: center;
|
17
15
|
align-items: center;
|
18
16
|
`;
|
19
|
-
const EditorApp = ({ manuscriptID, projectID, permittedActions, fileManagement, files,
|
20
|
-
const userID = getCurrentUserId();
|
17
|
+
const EditorApp = ({ manuscriptID, projectID, permittedActions, fileManagement, files, getAuthToken, observer, }) => {
|
21
18
|
const [store, setStore] = useState();
|
22
19
|
const loadedRef = useRef(false);
|
23
20
|
const observerSubscribed = useRef(false);
|
24
|
-
const api = useMemo(() => new Api(
|
21
|
+
const api = useMemo(() => new Api(getAuthToken), [getAuthToken]);
|
25
22
|
useEffect(() => {
|
26
23
|
// implement remount for the store if component is retriggered
|
27
24
|
if (loadedRef.current) {
|
@@ -34,8 +31,6 @@ const EditorApp = ({ manuscriptID, projectID, permittedActions, fileManagement,
|
|
34
31
|
manuscriptID,
|
35
32
|
files,
|
36
33
|
permittedActions,
|
37
|
-
userID: userID || '',
|
38
|
-
tokenData: new TokenData(),
|
39
34
|
});
|
40
35
|
const apiSource = new ApiSource(api);
|
41
36
|
createStore([props, apiSource])
|
package/dist/es/EditorApp.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAEZ,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,uBAAuB,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,
|
1
|
+
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAEZ,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,MAAM,MAAM,mBAAmB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js
CHANGED
@@ -14,8 +14,8 @@ import { DndProvider } from 'react-dnd';
|
|
14
14
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
15
15
|
import EditorApp from './EditorApp';
|
16
16
|
import { GlobalStyle } from './theme/theme';
|
17
|
-
const Main = ({ fileManagement, files, manuscriptID, projectID,
|
17
|
+
const Main = ({ fileManagement, files, manuscriptID, projectID, permittedActions, getAuthToken, observer, }) => (React.createElement(DndProvider, { backend: HTML5Backend },
|
18
18
|
React.createElement(GlobalStyle, null),
|
19
|
-
React.createElement(EditorApp, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions,
|
19
|
+
React.createElement(EditorApp, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, getAuthToken: getAuthToken, observer: observer })));
|
20
20
|
export default Main;
|
21
21
|
//# sourceMappingURL=Main.js.map
|
package/dist/es/Main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,SAA6B,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,IAAI,GAA6B,CAAC,EACtC,cAAc,EACd,KAAK,EACL,YAAY,EACZ,SAAS,EACT,
|
1
|
+
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,SAA6B,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,IAAI,GAA6B,CAAC,EACtC,cAAc,EACd,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,QAAQ,GACT,EAAE,EAAE,CAAC,CACJ,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;IAChC,oBAAC,WAAW,OAAG;IACf,oBAAC,SAAS,IACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,GAClB,CACU,CACf,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/dist/es/api/Api.js
CHANGED
@@ -14,7 +14,12 @@ import axios from 'axios';
|
|
14
14
|
import { createContext, useContext } from 'react';
|
15
15
|
import { getConfig } from '../config';
|
16
16
|
export class Api {
|
17
|
-
constructor(
|
17
|
+
constructor(getAuthToken) {
|
18
|
+
this.authInterceptor = async (config, getToken) => {
|
19
|
+
const token = await getToken();
|
20
|
+
config.headers.Authorization = 'Bearer ' + token;
|
21
|
+
return config;
|
22
|
+
};
|
18
23
|
this.get = async (url) => {
|
19
24
|
try {
|
20
25
|
const result = await this.instance.get(url, {
|
@@ -145,8 +150,9 @@ export class Api {
|
|
145
150
|
const config = getConfig();
|
146
151
|
this.instance = axios.create({
|
147
152
|
baseURL: config.api.url,
|
148
|
-
headers: { ...config.api.headers
|
153
|
+
headers: { ...config.api.headers },
|
149
154
|
});
|
155
|
+
this.instance.interceptors.request.use((config) => this.authInterceptor(config, getAuthToken));
|
150
156
|
}
|
151
157
|
}
|
152
158
|
export const ApiContext = createContext(undefined);
|
package/dist/es/api/Api.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../../src/api/Api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAGL,WAAW,GAGZ,MAAM,0BAA0B,CAAA;AAEjC,OAAO,
|
1
|
+
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../../src/api/Api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAGL,WAAW,GAGZ,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAIN,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAWrC,MAAM,OAAO,GAAG;IAGd,YAAY,YAA+C;QAW3D,oBAAe,GAAG,KAAK,EACrB,MAAkC,EAClC,QAA2C,EAC3C,EAAE;YACF,MAAM,KAAK,GAAG,MAAM,QAAQ,EAAE,CAAA;YAC9B,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG,SAAS,GAAG,KAAK,CAAA;YAChD,OAAO,MAAM,CAAA;QACf,CAAC,CAAA;QAED,QAAG,GAAG,KAAK,EAAK,GAAW,EAAE,EAAE;YAC7B,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAI,GAAG,EAAE;oBAC7C,OAAO,EAAE;wBACP,cAAc,EAAE,gCAAgC;qBACjD;iBACF,CAAC,CAAA;gBACF,OAAO,MAAM,CAAC,IAAI,CAAA;aACnB;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACd,OAAO,SAAS,CAAA;aACjB;QACH,CAAC,CAAA;QAED,SAAI,GAAG,KAAK,EAAK,IAAY,EAAE,IAAa,EAAE,EAAE;YAC9C,OAAO,IAAI,CAAC,QAAQ;iBACjB,IAAI,CAAI,IAAI,EAAE,IAAI,CAAC;iBACnB,IAAI,CAAC,CAA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,CAAC,eAAe,CAAC,MAAM,EAAE,YAAY,CAAC,CAC3C,CAAA;IACH,CAAC;CAwMF;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAkB,SAAS,CAAC,CAAA;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAQ,EAAE;IAC9B,MAAM,GAAG,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;IAClC,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;KACvC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
|
@@ -11,7 +11,6 @@
|
|
11
11
|
*/
|
12
12
|
import React from 'react';
|
13
13
|
import styled from 'styled-components';
|
14
|
-
import { useStore } from '../store';
|
15
14
|
export const Main = styled.main `
|
16
15
|
height: 100%;
|
17
16
|
flex: 1;
|
@@ -42,12 +41,6 @@ const PageContainer = styled.div `
|
|
42
41
|
font-family: ${(props) => props.theme.font.family.sans};
|
43
42
|
`;
|
44
43
|
export const Page = ({ children }) => {
|
45
|
-
const [{ tokenData }] = useStore((store) => ({
|
46
|
-
tokenData: store.tokenData,
|
47
|
-
}));
|
48
|
-
if (!tokenData) {
|
49
|
-
throw new Error('TokenData not found. User is not loggged in!');
|
50
|
-
}
|
51
44
|
return React.createElement(PageContainer, null, children);
|
52
45
|
};
|
53
46
|
//# sourceMappingURL=Page.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;sBAKT,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;;;;;;;;CAQrE,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;CAKnC,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;WAMrB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;iBACpC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;CACvD,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAEZ,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpB,OAAO,oBAAC,aAAa,QAAE,QAAQ,CAAiB,CAAA;AAClD,CAAC,CAAA"}
|
package/dist/es/index.js
CHANGED
@@ -10,37 +10,19 @@
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
12
|
import './lib/fonts';
|
13
|
-
import
|
14
|
-
import React, { Suspense, useMemo } from 'react';
|
13
|
+
import React, { Suspense } from 'react';
|
15
14
|
import { LoadingPage } from './components/Loading';
|
16
15
|
import { setConfig } from './config';
|
17
|
-
import tokenHandler from './lib/token';
|
18
|
-
import store from './lib/user-id';
|
19
16
|
import Main from './Main';
|
20
17
|
import { ThemeProvider } from './theme/ThemeProvider';
|
21
18
|
export { ProjectRole } from './lib/roles';
|
22
19
|
export { getUserRole } from './lib/roles';
|
23
|
-
const ManuscriptEditor = ({ fileManagement, files, manuscriptID, projectID, permittedActions,
|
24
|
-
useMemo(() => {
|
25
|
-
if (authToken) {
|
26
|
-
tokenHandler.remove();
|
27
|
-
tokenHandler.set(authToken); // @TODO actually relogin whe the token changes
|
28
|
-
const { userID } = decode(authToken);
|
29
|
-
if (!userID) {
|
30
|
-
throw new Error('Invalid token');
|
31
|
-
}
|
32
|
-
store.set(userID);
|
33
|
-
}
|
34
|
-
return () => {
|
35
|
-
tokenHandler.remove();
|
36
|
-
store.remove();
|
37
|
-
};
|
38
|
-
}, [authToken]);
|
20
|
+
const ManuscriptEditor = ({ fileManagement, files, manuscriptID, projectID, permittedActions, getAuthToken, config, observer, }) => {
|
39
21
|
setConfig(config);
|
40
22
|
return (React.createElement(React.Fragment, null,
|
41
23
|
React.createElement(ThemeProvider, null,
|
42
24
|
React.createElement(Suspense, { fallback: React.createElement(LoadingPage, { className: 'loader' }, "Loading...") },
|
43
|
-
React.createElement(Main, { fileManagement: fileManagement, files: files,
|
25
|
+
React.createElement(Main, { fileManagement: fileManagement, files: files, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, getAuthToken: getAuthToken, observer: observer }))),
|
44
26
|
React.createElement("div", { id: "menu" }),
|
45
27
|
React.createElement("div", { id: "notifications" }),
|
46
28
|
React.createElement("div", { id: "size" })));
|
package/dist/es/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,aAAa,CAAA;AAEpB,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAA2B,SAAS,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,E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C,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;SACrE;QACD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,EAAW,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;IACxB,CAAC;CACF"}
|
@@ -27,7 +27,7 @@ export interface EditorAppProps {
|
|
27
27
|
manuscriptID: string;
|
28
28
|
projectID: string;
|
29
29
|
permittedActions: string[];
|
30
|
-
|
30
|
+
getAuthToken: () => Promise<string | undefined>;
|
31
31
|
observer?: AppStateObserver;
|
32
32
|
}
|
33
33
|
declare const EditorApp: React.FC<EditorAppProps>;
|
package/dist/types/api/Api.d.ts
CHANGED
@@ -12,12 +12,13 @@
|
|
12
12
|
*/
|
13
13
|
import { Bundle, Model, Project, UserProfile } from '@manuscripts/json-schema';
|
14
14
|
import { ManuscriptTemplate } from '@manuscripts/transform';
|
15
|
-
import { AxiosInstance } from 'axios';
|
15
|
+
import { AxiosInstance, InternalAxiosRequestConfig } from 'axios';
|
16
16
|
import { ManuscriptDoc, ManuscriptSnapshot } from '../lib/doc';
|
17
17
|
import { CreateSnapshotResponse, SendStepsPayload, SendStepsResponse, StepsListener, StepsSinceResponse } from './types';
|
18
18
|
export declare class Api {
|
19
19
|
instance: AxiosInstance;
|
20
|
-
constructor(
|
20
|
+
constructor(getAuthToken: () => Promise<string | undefined>);
|
21
|
+
authInterceptor: (config: InternalAxiosRequestConfig, getToken: () => Promise<string | undefined>) => Promise<InternalAxiosRequestConfig<any>>;
|
21
22
|
get: <T>(url: string) => Promise<T | undefined>;
|
22
23
|
post: <T>(path: string, data: unknown) => Promise<T>;
|
23
24
|
delete: <T>(url: string) => Promise<import("axios").AxiosResponse<T, any>>;
|
@@ -17,7 +17,6 @@ import { useCreateEditor } from '../hooks/use-create-editor';
|
|
17
17
|
import { ManuscriptSnapshot, SnapshotLabel } from '../lib/doc';
|
18
18
|
import { ProjectRole } from '../lib/roles';
|
19
19
|
import { StoreDataSourceStrategy } from '.';
|
20
|
-
import { TokenData } from './TokenData';
|
21
20
|
export type action = {
|
22
21
|
action?: string;
|
23
22
|
[key: string]: any;
|
@@ -39,7 +38,6 @@ export type state = {
|
|
39
38
|
titleText: string;
|
40
39
|
fileManagement: FileManagement;
|
41
40
|
files: FileAttachment[];
|
42
|
-
tokenData: TokenData;
|
43
41
|
collaborators: Map<string, UserProfile>;
|
44
42
|
collaboratorsById: Map<string, UserProfile>;
|
45
43
|
snapshots: SnapshotLabel[];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@manuscripts/article-editor",
|
3
|
-
"version": "3.8.
|
3
|
+
"version": "3.8.92",
|
4
4
|
"license": "CPAL-1.0",
|
5
5
|
"description": "React components for editing and viewing manuscripts",
|
6
6
|
"repository": "github:Atypon-OpenSource/manuscripts-article-editor",
|
@@ -47,7 +47,6 @@
|
|
47
47
|
"axios": "^1.6.7",
|
48
48
|
"html-react-parser": "^5.1.16",
|
49
49
|
"http-status-codes": "^2.2.0",
|
50
|
-
"jwt-decode": "^3.1.2",
|
51
50
|
"lodash": "^4.17.21",
|
52
51
|
"prosemirror-utils": "^0.9.6",
|
53
52
|
"react": "^18.3.1",
|
@@ -72,7 +71,6 @@
|
|
72
71
|
"@types/dompurify": "^2.0.4",
|
73
72
|
"@types/google.analytics": "^0.0.45",
|
74
73
|
"@types/jest": "^29.2.4",
|
75
|
-
"@types/jwt-decode": "^2.2.1",
|
76
74
|
"@types/lodash": "^4.14.202",
|
77
75
|
"@types/react": "^18.3.1",
|
78
76
|
"@types/react-dom": "^18.3.0",
|
@@ -107,4 +105,4 @@
|
|
107
105
|
"resolutions": {
|
108
106
|
"@types/react": "^18.3.1"
|
109
107
|
}
|
110
|
-
}
|
108
|
+
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.authorizationInterceptor = void 0;
|
18
|
-
const token_1 = __importDefault(require("./token"));
|
19
|
-
const anonymousRoutes = ['/auth/login', '/registration/signup'];
|
20
|
-
const isAuthenticatedRoute = (url) => url ? !anonymousRoutes.includes(url) : true;
|
21
|
-
const authorizationInterceptor = (config) => {
|
22
|
-
if (isAuthenticatedRoute(config.url)) {
|
23
|
-
const token = token_1.default.get();
|
24
|
-
if (token) {
|
25
|
-
config.headers?.common.setAuthorization('Bearer ' + token);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
return config;
|
29
|
-
};
|
30
|
-
exports.authorizationInterceptor = authorizationInterceptor;
|
31
|
-
//# sourceMappingURL=authorization.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../../src/lib/authorization.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAIH,oDAAkC;AAElC,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAA;AAE/D,MAAM,oBAAoB,GAAG,CAAC,GAAY,EAAE,EAAE,CAC5C,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAEtC,MAAM,wBAAwB,GAAG,CACtC,MAAkC,EAClC,EAAE;IACF,IAAI,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;QACpC,MAAM,KAAK,GAAG,eAAY,CAAC,GAAG,EAAE,CAAA;QAEhC,IAAI,KAAK,EAAE;YACT,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,SAAS,GAAG,KAAK,CAAC,CAAA;SAC3D;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAZY,QAAA,wBAAwB,4BAYpC"}
|
package/dist/cjs/lib/client.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
const axios_1 = __importDefault(require("axios"));
|
18
|
-
const config_1 = require("../config");
|
19
|
-
const authorization_1 = require("./authorization");
|
20
|
-
const config = (0, config_1.getConfig)();
|
21
|
-
const client = axios_1.default.create({
|
22
|
-
baseURL: config.api.url,
|
23
|
-
});
|
24
|
-
client.interceptors.request.use((config) => {
|
25
|
-
config.headers.Accept = 'application/json';
|
26
|
-
config.headers['Content-Type'] = 'application/json';
|
27
|
-
return config;
|
28
|
-
});
|
29
|
-
client.interceptors.request.use(authorization_1.authorizationInterceptor);
|
30
|
-
exports.default = client;
|
31
|
-
//# sourceMappingURL=client.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAEH,kDAAyB;AAEzB,sCAAqC;AACrC,mDAA0D;AAE1D,MAAM,MAAM,GAAG,IAAA,kBAAS,GAAE,CAAA;AAE1B,MAAM,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG;CACxB,CAAC,CAAA;AAEF,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IACzC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,kBAAkB,CAAA;IAC1C,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAA;IAEnD,OAAO,MAAM,CAAA;AACf,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,wCAAwB,CAAC,CAAA;AAEzD,kBAAe,MAAM,CAAA"}
|
package/dist/cjs/lib/token.js
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.TOKEN_KEY = void 0;
|
15
|
-
const storage = window.localStorage;
|
16
|
-
exports.TOKEN_KEY = 'token';
|
17
|
-
exports.default = {
|
18
|
-
get: () => storage.getItem(exports.TOKEN_KEY),
|
19
|
-
set: (token) => {
|
20
|
-
storage.setItem(exports.TOKEN_KEY, token);
|
21
|
-
return token;
|
22
|
-
},
|
23
|
-
remove: () => storage.removeItem(exports.TOKEN_KEY),
|
24
|
-
};
|
25
|
-
//# sourceMappingURL=token.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/lib/token.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;AAEtB,QAAA,SAAS,GAAG,OAAO,CAAA;AAEhC,kBAAe;IACb,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAS,CAAC;IACrC,GAAG,EAAE,CAAC,KAAa,EAAE,EAAE;QACrB,OAAO,CAAC,OAAO,CAAC,iBAAS,EAAE,KAAK,CAAC,CAAA;QAEjC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAS,CAAC;CAC5C,CAAA"}
|
package/dist/cjs/lib/user-id.js
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.USER_ID_KEY = void 0;
|
15
|
-
const storage = window.localStorage;
|
16
|
-
exports.USER_ID_KEY = 'userID';
|
17
|
-
exports.default = {
|
18
|
-
get: () => storage.getItem(exports.USER_ID_KEY),
|
19
|
-
set: (userID) => {
|
20
|
-
storage.setItem(exports.USER_ID_KEY, userID);
|
21
|
-
return userID;
|
22
|
-
},
|
23
|
-
remove: () => storage.removeItem(exports.USER_ID_KEY),
|
24
|
-
};
|
25
|
-
//# sourceMappingURL=user-id.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user-id.js","sourceRoot":"","sources":["../../../src/lib/user-id.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;AAEtB,QAAA,WAAW,GAAG,QAAQ,CAAA;AAEnC,kBAAe;IACb,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAW,CAAC;IACvC,GAAG,EAAE,CAAC,MAAc,EAAE,EAAE;QACtB,OAAO,CAAC,OAAO,CAAC,mBAAW,EAAE,MAAM,CAAC,CAAA;QAEpC,OAAO,MAAM,CAAA;IACf,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAW,CAAC;CAC9C,CAAA"}
|
package/dist/cjs/lib/user.js
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.getCurrentUserId = void 0;
|
18
|
-
const jwt_decode_1 = __importDefault(require("jwt-decode"));
|
19
|
-
const token_1 = __importDefault(require("./token"));
|
20
|
-
const getCurrentUserId = () => {
|
21
|
-
const token = token_1.default.get();
|
22
|
-
if (!token) {
|
23
|
-
return null;
|
24
|
-
}
|
25
|
-
const { userID } = (0, jwt_decode_1.default)(token);
|
26
|
-
return userID;
|
27
|
-
};
|
28
|
-
exports.getCurrentUserId = getCurrentUserId;
|
29
|
-
//# sourceMappingURL=user.js.map
|
package/dist/cjs/lib/user.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/lib/user.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,4DAA+B;AAE/B,oDAAkC;AAW3B,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,KAAK,GAAG,eAAY,CAAC,GAAG,EAAE,CAAA;IAEhC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,oBAAM,EAAe,KAAK,CAAC,CAAA;IAC9C,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AATY,QAAA,gBAAgB,oBAS5B"}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.TokenData = void 0;
|
18
|
-
const jwt_decode_1 = __importDefault(require("jwt-decode"));
|
19
|
-
const storage = window.localStorage;
|
20
|
-
// TODO: handle token expiry
|
21
|
-
// TODO: provide profile id using context?
|
22
|
-
class TokenData {
|
23
|
-
constructor() {
|
24
|
-
this.parseToken = (token) => {
|
25
|
-
const { userID } = (0, jwt_decode_1.default)(token);
|
26
|
-
if (userID) {
|
27
|
-
this.data = {
|
28
|
-
userID,
|
29
|
-
};
|
30
|
-
}
|
31
|
-
else {
|
32
|
-
this.deleteToken();
|
33
|
-
}
|
34
|
-
this.loaded = true;
|
35
|
-
};
|
36
|
-
this.deleteToken = () => {
|
37
|
-
storage.removeItem('token');
|
38
|
-
this.token = null;
|
39
|
-
this.data = {
|
40
|
-
userID: undefined,
|
41
|
-
};
|
42
|
-
};
|
43
|
-
this.updateToken = (token) => {
|
44
|
-
storage.setItem('token', token);
|
45
|
-
this.token = token;
|
46
|
-
this.parseToken(token);
|
47
|
-
};
|
48
|
-
this.token = storage.getItem('token');
|
49
|
-
if (this.token) {
|
50
|
-
this.parseToken(this.token);
|
51
|
-
}
|
52
|
-
else {
|
53
|
-
this.loaded = true;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
getTokenActions() {
|
57
|
-
if (!this.loaded) {
|
58
|
-
return null;
|
59
|
-
}
|
60
|
-
return {
|
61
|
-
...this.data,
|
62
|
-
delete: this.deleteToken,
|
63
|
-
update: this.updateToken,
|
64
|
-
};
|
65
|
-
}
|
66
|
-
}
|
67
|
-
exports.TokenData = TokenData;
|
68
|
-
//# sourceMappingURL=TokenData.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TokenData.js","sourceRoot":"","sources":["../../../src/store/TokenData.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,4DAA+B;AAG/B,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;AAOnC,4BAA4B;AAC5B,0CAA0C;AAE1C,MAAa,SAAS;IASpB;QAsBQ,eAAU,GAAG,CAAC,KAAa,EAAE,EAAE;YACrC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,oBAAM,EAAe,KAAK,CAAC,CAAA;YAE9C,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,IAAI,GAAG;oBACV,MAAM;iBACP,CAAA;aACF;iBAAM;gBACL,IAAI,CAAC,WAAW,EAAE,CAAA;aACnB;YAED,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QACpB,CAAC,CAAA;QAEO,gBAAW,GAAG,GAAG,EAAE;YACzB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;YACjB,IAAI,CAAC,IAAI,GAAG;gBACV,MAAM,EAAE,SAAS;aAClB,CAAA;QACH,CAAC,CAAA;QAEO,gBAAW,GAAG,CAAC,KAAa,EAAE,EAAE;YACtC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;YAClB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QACxB,CAAC,CAAA;QA/CC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAErC,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC5B;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;SACnB;IACH,CAAC;IAEM,eAAe;QACpB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO,IAAI,CAAA;SACZ;QAED,OAAO;YACL,GAAG,IAAI,CAAC,IAAI;YACZ,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,MAAM,EAAE,IAAI,CAAC,WAAW;SACzB,CAAA;IACH,CAAC;CA6BF;AA1DD,8BA0DC"}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import tokenHandler from './token';
|
13
|
-
const anonymousRoutes = ['/auth/login', '/registration/signup'];
|
14
|
-
const isAuthenticatedRoute = (url) => url ? !anonymousRoutes.includes(url) : true;
|
15
|
-
export const authorizationInterceptor = (config) => {
|
16
|
-
if (isAuthenticatedRoute(config.url)) {
|
17
|
-
const token = tokenHandler.get();
|
18
|
-
if (token) {
|
19
|
-
config.headers?.common.setAuthorization('Bearer ' + token);
|
20
|
-
}
|
21
|
-
}
|
22
|
-
return config;
|
23
|
-
};
|
24
|
-
//# sourceMappingURL=authorization.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../../src/lib/authorization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,YAAY,MAAM,SAAS,CAAA;AAElC,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAA;AAE/D,MAAM,oBAAoB,GAAG,CAAC,GAAY,EAAE,EAAE,CAC5C,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAE7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,MAAkC,EAClC,EAAE;IACF,IAAI,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;QACpC,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,EAAE,CAAA;QAEhC,IAAI,KAAK,EAAE;YACT,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,SAAS,GAAG,KAAK,CAAC,CAAA;SAC3D;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
package/dist/es/lib/client.js
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import axios from 'axios';
|
13
|
-
import { getConfig } from '../config';
|
14
|
-
import { authorizationInterceptor } from './authorization';
|
15
|
-
const config = getConfig();
|
16
|
-
const client = axios.create({
|
17
|
-
baseURL: config.api.url,
|
18
|
-
});
|
19
|
-
client.interceptors.request.use((config) => {
|
20
|
-
config.headers.Accept = 'application/json';
|
21
|
-
config.headers['Content-Type'] = 'application/json';
|
22
|
-
return config;
|
23
|
-
});
|
24
|
-
client.interceptors.request.use(authorizationInterceptor);
|
25
|
-
export default client;
|
26
|
-
//# sourceMappingURL=client.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;AAE1B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG;CACxB,CAAC,CAAA;AAEF,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IACzC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,kBAAkB,CAAA;IAC1C,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAA;IAEnD,OAAO,MAAM,CAAA;AACf,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;AAEzD,eAAe,MAAM,CAAA"}
|
package/dist/es/lib/token.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
const storage = window.localStorage;
|
13
|
-
export const TOKEN_KEY = 'token';
|
14
|
-
export default {
|
15
|
-
get: () => storage.getItem(TOKEN_KEY),
|
16
|
-
set: (token) => {
|
17
|
-
storage.setItem(TOKEN_KEY, token);
|
18
|
-
return token;
|
19
|
-
},
|
20
|
-
remove: () => storage.removeItem(TOKEN_KEY),
|
21
|
-
};
|
22
|
-
//# sourceMappingURL=token.js.map
|
package/dist/es/lib/token.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/lib/token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;AAEnC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAA;AAEhC,eAAe;IACb,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IACrC,GAAG,EAAE,CAAC,KAAa,EAAE,EAAE;QACrB,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAEjC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;CAC5C,CAAA"}
|
package/dist/es/lib/user-id.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
const storage = window.localStorage;
|
13
|
-
export const USER_ID_KEY = 'userID';
|
14
|
-
export default {
|
15
|
-
get: () => storage.getItem(USER_ID_KEY),
|
16
|
-
set: (userID) => {
|
17
|
-
storage.setItem(USER_ID_KEY, userID);
|
18
|
-
return userID;
|
19
|
-
},
|
20
|
-
remove: () => storage.removeItem(USER_ID_KEY),
|
21
|
-
};
|
22
|
-
//# sourceMappingURL=user-id.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user-id.js","sourceRoot":"","sources":["../../../src/lib/user-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;AAEnC,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAA;AAEnC,eAAe;IACb,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;IACvC,GAAG,EAAE,CAAC,MAAc,EAAE,EAAE;QACtB,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;QAEpC,OAAO,MAAM,CAAA;IACf,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;CAC9C,CAAA"}
|
package/dist/es/lib/user.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import decode from 'jwt-decode';
|
13
|
-
import tokenHandler from './token';
|
14
|
-
export const getCurrentUserId = () => {
|
15
|
-
const token = tokenHandler.get();
|
16
|
-
if (!token) {
|
17
|
-
return null;
|
18
|
-
}
|
19
|
-
const { userID } = decode(token);
|
20
|
-
return userID;
|
21
|
-
};
|
22
|
-
//# sourceMappingURL=user.js.map
|
package/dist/es/lib/user.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/lib/user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,YAAY,CAAA;AAE/B,OAAO,YAAY,MAAM,SAAS,CAAA;AAWlC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,EAAE,CAAA;IAEhC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAe,KAAK,CAAC,CAAA;IAC9C,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import decode from 'jwt-decode';
|
13
|
-
const storage = window.localStorage;
|
14
|
-
// TODO: handle token expiry
|
15
|
-
// TODO: provide profile id using context?
|
16
|
-
export class TokenData {
|
17
|
-
constructor() {
|
18
|
-
this.parseToken = (token) => {
|
19
|
-
const { userID } = decode(token);
|
20
|
-
if (userID) {
|
21
|
-
this.data = {
|
22
|
-
userID,
|
23
|
-
};
|
24
|
-
}
|
25
|
-
else {
|
26
|
-
this.deleteToken();
|
27
|
-
}
|
28
|
-
this.loaded = true;
|
29
|
-
};
|
30
|
-
this.deleteToken = () => {
|
31
|
-
storage.removeItem('token');
|
32
|
-
this.token = null;
|
33
|
-
this.data = {
|
34
|
-
userID: undefined,
|
35
|
-
};
|
36
|
-
};
|
37
|
-
this.updateToken = (token) => {
|
38
|
-
storage.setItem('token', token);
|
39
|
-
this.token = token;
|
40
|
-
this.parseToken(token);
|
41
|
-
};
|
42
|
-
this.token = storage.getItem('token');
|
43
|
-
if (this.token) {
|
44
|
-
this.parseToken(this.token);
|
45
|
-
}
|
46
|
-
else {
|
47
|
-
this.loaded = true;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
getTokenActions() {
|
51
|
-
if (!this.loaded) {
|
52
|
-
return null;
|
53
|
-
}
|
54
|
-
return {
|
55
|
-
...this.data,
|
56
|
-
delete: this.deleteToken,
|
57
|
-
update: this.updateToken,
|
58
|
-
};
|
59
|
-
}
|
60
|
-
}
|
61
|
-
//# sourceMappingURL=TokenData.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TokenData.js","sourceRoot":"","sources":["../../../src/store/TokenData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,YAAY,CAAA;AAG/B,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;AAOnC,4BAA4B;AAC5B,0CAA0C;AAE1C,MAAM,OAAO,SAAS;IASpB;QAsBQ,eAAU,GAAG,CAAC,KAAa,EAAE,EAAE;YACrC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAe,KAAK,CAAC,CAAA;YAE9C,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,IAAI,GAAG;oBACV,MAAM;iBACP,CAAA;aACF;iBAAM;gBACL,IAAI,CAAC,WAAW,EAAE,CAAA;aACnB;YAED,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QACpB,CAAC,CAAA;QAEO,gBAAW,GAAG,GAAG,EAAE;YACzB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;YACjB,IAAI,CAAC,IAAI,GAAG;gBACV,MAAM,EAAE,SAAS;aAClB,CAAA;QACH,CAAC,CAAA;QAEO,gBAAW,GAAG,CAAC,KAAa,EAAE,EAAE;YACtC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;YAClB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QACxB,CAAC,CAAA;QA/CC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAErC,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC5B;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;SACnB;IACH,CAAC;IAEM,eAAe;QACpB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO,IAAI,CAAA;SACZ;QAED,OAAO;YACL,GAAG,IAAI,CAAC,IAAI;YACZ,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,MAAM,EAAE,IAAI,CAAC,WAAW;SACzB,CAAA;IACH,CAAC;CA6BF"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import { InternalAxiosRequestConfig } from 'axios';
|
13
|
-
export declare const authorizationInterceptor: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig<any>;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
declare const client: import("axios").AxiosInstance;
|
13
|
-
export default client;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
export declare const TOKEN_KEY = "token";
|
13
|
-
declare const _default: {
|
14
|
-
get: () => string | null;
|
15
|
-
set: (token: string) => string;
|
16
|
-
remove: () => void;
|
17
|
-
};
|
18
|
-
export default _default;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
export declare const USER_ID_KEY = "userID";
|
13
|
-
declare const _default: {
|
14
|
-
get: () => string | null;
|
15
|
-
set: (userID: string) => string;
|
16
|
-
remove: () => void;
|
17
|
-
};
|
18
|
-
export default _default;
|
package/dist/types/lib/user.d.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
export interface TokenPayload {
|
13
|
-
userID: string;
|
14
|
-
email: string;
|
15
|
-
deviceID: string;
|
16
|
-
aud: string;
|
17
|
-
iss: string;
|
18
|
-
iat: number;
|
19
|
-
}
|
20
|
-
export declare const getCurrentUserId: () => string | null;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
export interface TokenActions {
|
13
|
-
delete: () => void;
|
14
|
-
update: (token: string) => void;
|
15
|
-
}
|
16
|
-
export declare class TokenData {
|
17
|
-
private token;
|
18
|
-
private loaded;
|
19
|
-
private data;
|
20
|
-
constructor();
|
21
|
-
getTokenActions(): {
|
22
|
-
delete: () => void;
|
23
|
-
update: (token: string) => void;
|
24
|
-
userID?: string | undefined;
|
25
|
-
userProfileID?: string | undefined;
|
26
|
-
} | null;
|
27
|
-
private parseToken;
|
28
|
-
private deleteToken;
|
29
|
-
private updateToken;
|
30
|
-
}
|