@manuscripts/article-editor 3.8.91 → 3.9.0

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.
Files changed (62) hide show
  1. package/dist/cjs/EditorApp.js +2 -7
  2. package/dist/cjs/EditorApp.js.map +1 -1
  3. package/dist/cjs/Main.js +2 -2
  4. package/dist/cjs/Main.js.map +1 -1
  5. package/dist/cjs/api/Api.js +9 -3
  6. package/dist/cjs/api/Api.js.map +1 -1
  7. package/dist/cjs/components/Page.js +0 -7
  8. package/dist/cjs/components/Page.js.map +1 -1
  9. package/dist/cjs/index.js +2 -20
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/cjs/lib/attrs-change-filter.js +3 -3
  12. package/dist/cjs/lib/attrs-change-filter.js.map +1 -1
  13. package/dist/cjs/lib/node-content-retriever.js.map +1 -1
  14. package/dist/cjs/store/Store.js.map +1 -1
  15. package/dist/es/EditorApp.js +2 -7
  16. package/dist/es/EditorApp.js.map +1 -1
  17. package/dist/es/Main.js +2 -2
  18. package/dist/es/Main.js.map +1 -1
  19. package/dist/es/api/Api.js +9 -3
  20. package/dist/es/api/Api.js.map +1 -1
  21. package/dist/es/components/Page.js +0 -7
  22. package/dist/es/components/Page.js.map +1 -1
  23. package/dist/es/index.js +3 -21
  24. package/dist/es/index.js.map +1 -1
  25. package/dist/es/lib/attrs-change-filter.js +3 -3
  26. package/dist/es/lib/attrs-change-filter.js.map +1 -1
  27. package/dist/es/lib/node-content-retriever.js.map +1 -1
  28. package/dist/es/store/Store.js.map +1 -1
  29. package/dist/types/EditorApp.d.ts +1 -1
  30. package/dist/types/api/Api.d.ts +3 -2
  31. package/dist/types/store/Store.d.ts +0 -2
  32. package/package.json +3 -5
  33. package/dist/cjs/lib/authorization.js +0 -31
  34. package/dist/cjs/lib/authorization.js.map +0 -1
  35. package/dist/cjs/lib/client.js +0 -31
  36. package/dist/cjs/lib/client.js.map +0 -1
  37. package/dist/cjs/lib/token.js +0 -25
  38. package/dist/cjs/lib/token.js.map +0 -1
  39. package/dist/cjs/lib/user-id.js +0 -25
  40. package/dist/cjs/lib/user-id.js.map +0 -1
  41. package/dist/cjs/lib/user.js +0 -29
  42. package/dist/cjs/lib/user.js.map +0 -1
  43. package/dist/cjs/store/TokenData.js +0 -68
  44. package/dist/cjs/store/TokenData.js.map +0 -1
  45. package/dist/es/lib/authorization.js +0 -24
  46. package/dist/es/lib/authorization.js.map +0 -1
  47. package/dist/es/lib/client.js +0 -26
  48. package/dist/es/lib/client.js.map +0 -1
  49. package/dist/es/lib/token.js +0 -22
  50. package/dist/es/lib/token.js.map +0 -1
  51. package/dist/es/lib/user-id.js +0 -22
  52. package/dist/es/lib/user-id.js.map +0 -1
  53. package/dist/es/lib/user.js +0 -22
  54. package/dist/es/lib/user.js.map +0 -1
  55. package/dist/es/store/TokenData.js +0 -61
  56. package/dist/es/store/TokenData.js.map +0 -1
  57. package/dist/types/lib/authorization.d.ts +0 -13
  58. package/dist/types/lib/client.d.ts +0 -13
  59. package/dist/types/lib/token.d.ts +0 -18
  60. package/dist/types/lib/user-id.d.ts +0 -18
  61. package/dist/types/lib/user.d.ts +0 -20
  62. package/dist/types/store/TokenData.d.ts +0 -30
@@ -1 +1 @@
1
- {"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH,OAAO,EAAE,qBAAqB,EAA2B,MAAM,GAAG,CAAA;AA8DlE,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,MAAM,OAAO,YAAY;IAWvB,YACE,OAAO,GAAG,cAAc,EACxB,cAAuC,EACvC,KAAK,GAAG,EAAE;QAiBZ,UAAK,GAA6C,I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O,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
- authToken: string;
30
+ getAuthToken: () => Promise<string | undefined>;
31
31
  observer?: AppStateObserver;
32
32
  }
33
33
  declare const EditorApp: React.FC<EditorAppProps>;
@@ -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(authToken: string);
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.91",
3
+ "version": "3.9.0",
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",
@@ -35,19 +35,18 @@
35
35
  "@fontsource/lato": "^4.5.10",
36
36
  "@fontsource/pt-sans": "^4.5.11",
37
37
  "@fontsource/pt-serif": "^4.5.11",
38
- "@manuscripts/body-editor": "2.8.86",
38
+ "@manuscripts/body-editor": "2.9.0",
39
39
  "@manuscripts/json-schema": "2.2.11",
40
40
  "@manuscripts/library": "1.3.14",
41
41
  "@manuscripts/style-guide": "2.1.13",
42
42
  "@manuscripts/track-changes-plugin": "1.10.8",
43
- "@manuscripts/transform": "3.0.69",
43
+ "@manuscripts/transform": "3.1.0",
44
44
  "@popperjs/core": "^2.11.8",
45
45
  "@types/use-sync-external-store": "^0.0.6",
46
46
  "autotrack": "^2.4.1",
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",
@@ -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"}
@@ -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"}
@@ -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"}
@@ -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"}
@@ -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
@@ -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,CA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AAA;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"}
@@ -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"}
@@ -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
@@ -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"}
@@ -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"}
@@ -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
@@ -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;