@manuscripts/article-editor 3.1.48-LEAN-3956.0 → 3.1.48-datasource-cleanup.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.
- package/dist/cjs/EditorApp.js +15 -7
- package/dist/cjs/EditorApp.js.map +1 -1
- package/dist/cjs/api/Api.js +137 -0
- package/dist/cjs/api/Api.js.map +1 -0
- package/dist/cjs/{postgres-data/PsSource.js → api/ApiSource.js} +17 -32
- package/dist/cjs/api/ApiSource.js.map +1 -0
- package/dist/cjs/api/StepsExchanger.js +95 -0
- package/dist/cjs/api/StepsExchanger.js.map +1 -0
- package/dist/cjs/{postgres-data → api}/buildData.js +29 -7
- package/dist/cjs/api/buildData.js.map +1 -0
- package/dist/cjs/{postgres-data → api}/buildUtilities.js +5 -6
- package/dist/cjs/api/buildUtilities.js.map +1 -0
- package/dist/cjs/api/savingUtilities.js.map +1 -0
- package/dist/{es/lib/api/index.js → cjs/api/types.js} +4 -3
- package/dist/cjs/api/types.js.map +1 -0
- package/dist/cjs/components/FileManager/InlineFilesSection.js +1 -4
- package/dist/cjs/components/FileManager/InlineFilesSection.js.map +1 -1
- package/dist/cjs/components/FileManager/OtherFilesSection.js +0 -3
- package/dist/cjs/components/FileManager/OtherFilesSection.js.map +1 -1
- package/dist/cjs/components/FileManager/SupplementsSection.js +0 -3
- package/dist/cjs/components/FileManager/SupplementsSection.js.map +1 -1
- package/dist/cjs/components/comments/CommentsPanel.js +2 -2
- package/dist/cjs/components/comments/CommentsPanel.js.map +1 -1
- package/dist/cjs/components/inspector/SnapshotsDropdown.js +57 -61
- package/dist/cjs/components/inspector/SnapshotsDropdown.js.map +1 -1
- package/dist/cjs/components/projects/ManuscriptPageContainer.js +0 -1
- package/dist/cjs/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionSnippet.js +4 -4
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionSnippet.js.map +1 -1
- package/dist/cjs/hooks/use-connect-editor.js +1 -1
- package/dist/cjs/hooks/use-connect-editor.js.map +1 -1
- package/dist/cjs/hooks/use-create-editor.js +3 -14
- package/dist/cjs/hooks/use-create-editor.js.map +1 -1
- package/dist/cjs/hooks/use-handle-snapshot.js +2 -2
- package/dist/cjs/hooks/use-handle-snapshot.js.map +1 -1
- package/dist/cjs/{quarterback/getDocWithoutTrackContent.js → lib/doc.js} +7 -8
- package/dist/cjs/lib/doc.js.map +1 -0
- package/dist/cjs/store/DataSourceStrategy.js +3 -11
- package/dist/cjs/store/DataSourceStrategy.js.map +1 -1
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/es/EditorApp.js +15 -7
- package/dist/es/EditorApp.js.map +1 -1
- package/dist/es/api/Api.js +131 -0
- package/dist/es/api/Api.js.map +1 -0
- package/dist/es/{postgres-data/PsSource.js → api/ApiSource.js} +15 -31
- package/dist/es/api/ApiSource.js.map +1 -0
- package/dist/es/api/StepsExchanger.js +90 -0
- package/dist/es/api/StepsExchanger.js.map +1 -0
- package/dist/es/{postgres-data → api}/buildData.js +29 -7
- package/dist/es/api/buildData.js.map +1 -0
- package/dist/es/{postgres-data → api}/buildUtilities.js +5 -6
- package/dist/es/api/buildUtilities.js.map +1 -0
- package/dist/es/api/savingUtilities.js.map +1 -0
- package/dist/{types/lib/api/index.d.ts → es/api/types.js} +3 -2
- package/dist/es/api/types.js.map +1 -0
- package/dist/es/components/FileManager/InlineFilesSection.js +1 -4
- package/dist/es/components/FileManager/InlineFilesSection.js.map +1 -1
- package/dist/es/components/FileManager/OtherFilesSection.js +0 -3
- package/dist/es/components/FileManager/OtherFilesSection.js.map +1 -1
- package/dist/es/components/FileManager/SupplementsSection.js +0 -3
- package/dist/es/components/FileManager/SupplementsSection.js.map +1 -1
- package/dist/es/components/comments/CommentsPanel.js +2 -2
- package/dist/es/components/comments/CommentsPanel.js.map +1 -1
- package/dist/es/components/inspector/SnapshotsDropdown.js +35 -62
- package/dist/es/components/inspector/SnapshotsDropdown.js.map +1 -1
- package/dist/es/components/projects/ManuscriptPageContainer.js +0 -1
- package/dist/es/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/es/components/track-changes/suggestion-list/SuggestionSnippet.js +4 -4
- package/dist/es/components/track-changes/suggestion-list/SuggestionSnippet.js.map +1 -1
- package/dist/es/hooks/use-connect-editor.js +1 -1
- package/dist/es/hooks/use-connect-editor.js.map +1 -1
- package/dist/es/hooks/use-create-editor.js +3 -14
- package/dist/es/hooks/use-create-editor.js.map +1 -1
- package/dist/es/hooks/use-handle-snapshot.js +1 -1
- package/dist/es/hooks/use-handle-snapshot.js.map +1 -1
- package/dist/es/{quarterback/getDocWithoutTrackContent.js → lib/doc.js} +6 -6
- package/dist/es/lib/doc.js.map +1 -0
- package/dist/es/store/DataSourceStrategy.js +3 -11
- package/dist/es/store/DataSourceStrategy.js.map +1 -1
- package/dist/es/store/Store.js.map +1 -1
- package/dist/types/{postgres-data → api}/Api.d.ts +13 -5
- package/dist/types/{postgres-data/PsSource.d.ts → api/ApiSource.d.ts} +3 -4
- package/dist/types/{quarterback/QuarterbackStepsExchanger.d.ts → api/StepsExchanger.d.ts} +18 -21
- package/dist/types/api/buildData.d.ts +3 -0
- package/dist/types/{postgres-data → api}/buildUtilities.d.ts +1 -1
- package/dist/types/{quarterback/api/loadDoc.d.ts → api/types.d.ts} +23 -6
- package/dist/types/lib/doc.d.ts +17 -0
- package/dist/types/store/DataSourceStrategy.d.ts +2 -5
- package/dist/types/store/Store.d.ts +5 -6
- package/package.json +1 -2
- package/dist/cjs/lib/api/collaboration.js +0 -25
- package/dist/cjs/lib/api/collaboration.js.map +0 -1
- package/dist/cjs/lib/api/index.js +0 -29
- package/dist/cjs/lib/api/index.js.map +0 -1
- package/dist/cjs/postgres-data/Api.js +0 -83
- package/dist/cjs/postgres-data/Api.js.map +0 -1
- package/dist/cjs/postgres-data/PsSource.js.map +0 -1
- package/dist/cjs/postgres-data/buildData.js.map +0 -1
- package/dist/cjs/postgres-data/buildUtilities.js.map +0 -1
- package/dist/cjs/postgres-data/savingUtilities.js.map +0 -1
- package/dist/cjs/quarterback/QuarterbackStepsExchanger.js +0 -145
- package/dist/cjs/quarterback/QuarterbackStepsExchanger.js.map +0 -1
- package/dist/cjs/quarterback/api/document.js +0 -43
- package/dist/cjs/quarterback/api/document.js.map +0 -1
- package/dist/cjs/quarterback/api/loadDoc.js +0 -108
- package/dist/cjs/quarterback/api/loadDoc.js.map +0 -1
- package/dist/cjs/quarterback/api/methods.js +0 -147
- package/dist/cjs/quarterback/api/methods.js.map +0 -1
- package/dist/cjs/quarterback/getDocWithoutTrackContent.js.map +0 -1
- package/dist/cjs/quarterback/types.js +0 -3
- package/dist/cjs/quarterback/types.js.map +0 -1
- package/dist/es/lib/api/collaboration.js +0 -18
- package/dist/es/lib/api/collaboration.js.map +0 -1
- package/dist/es/lib/api/index.js.map +0 -1
- package/dist/es/postgres-data/Api.js +0 -77
- package/dist/es/postgres-data/Api.js.map +0 -1
- package/dist/es/postgres-data/PsSource.js.map +0 -1
- package/dist/es/postgres-data/buildData.js.map +0 -1
- package/dist/es/postgres-data/buildUtilities.js.map +0 -1
- package/dist/es/postgres-data/savingUtilities.js.map +0 -1
- package/dist/es/quarterback/QuarterbackStepsExchanger.js +0 -118
- package/dist/es/quarterback/QuarterbackStepsExchanger.js.map +0 -1
- package/dist/es/quarterback/api/document.js +0 -32
- package/dist/es/quarterback/api/document.js.map +0 -1
- package/dist/es/quarterback/api/loadDoc.js +0 -81
- package/dist/es/quarterback/api/loadDoc.js.map +0 -1
- package/dist/es/quarterback/api/methods.js +0 -137
- package/dist/es/quarterback/api/methods.js.map +0 -1
- package/dist/es/quarterback/getDocWithoutTrackContent.js.map +0 -1
- package/dist/es/quarterback/types.js +0 -2
- package/dist/es/quarterback/types.js.map +0 -1
- package/dist/types/lib/api/collaboration.d.ts +0 -17
- package/dist/types/postgres-data/buildData.d.ts +0 -3
- package/dist/types/quarterback/api/document.d.ts +0 -20
- package/dist/types/quarterback/api/methods.d.ts +0 -38
- package/dist/types/quarterback/getDocWithoutTrackContent.d.ts +0 -3
- package/dist/types/quarterback/types.d.ts +0 -74
- /package/dist/cjs/{postgres-data → api}/savingUtilities.js +0 -0
- /package/dist/es/{postgres-data → api}/savingUtilities.js +0 -0
- /package/dist/types/{postgres-data → api}/savingUtilities.d.ts +0 -0
@@ -1,137 +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) 2022 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import { getConfig } from '../../config';
|
13
|
-
export const DEFAULT_HEADERS = {
|
14
|
-
Accept: 'application/json',
|
15
|
-
'Content-Type': 'application/json',
|
16
|
-
};
|
17
|
-
export function getAuthHeader(authToken) {
|
18
|
-
return authToken && { Authorization: `Bearer ${authToken}` };
|
19
|
-
}
|
20
|
-
export async function wrappedFetch(path, options, defaultError = 'Request failed') {
|
21
|
-
let resp;
|
22
|
-
const config = getConfig();
|
23
|
-
try {
|
24
|
-
resp = await fetch(`${config.api.url}/${path}`, options);
|
25
|
-
}
|
26
|
-
catch (err) {
|
27
|
-
// Must be a connection error (?)
|
28
|
-
console.error(err);
|
29
|
-
return { err: 'Connection error', code: 550 };
|
30
|
-
}
|
31
|
-
let data;
|
32
|
-
const contentType = resp.headers.get('Content-Type');
|
33
|
-
if (!contentType || contentType.includes('application/json')) {
|
34
|
-
data = await resp.json();
|
35
|
-
}
|
36
|
-
else if (contentType.includes('application/octet-stream')) {
|
37
|
-
data = await resp.arrayBuffer();
|
38
|
-
}
|
39
|
-
if (!resp.ok) {
|
40
|
-
console.error(data?.message || defaultError);
|
41
|
-
return {
|
42
|
-
err: data?.message || defaultError,
|
43
|
-
code: resp.status,
|
44
|
-
};
|
45
|
-
}
|
46
|
-
return { data };
|
47
|
-
}
|
48
|
-
export function get(path, authToken, defaultError, headers = {
|
49
|
-
...DEFAULT_HEADERS,
|
50
|
-
...getAuthHeader(authToken),
|
51
|
-
}) {
|
52
|
-
return wrappedFetch(path, {
|
53
|
-
method: 'GET',
|
54
|
-
headers,
|
55
|
-
}, defaultError);
|
56
|
-
}
|
57
|
-
export function post(path, authToken, payload, defaultError, headers = {
|
58
|
-
...DEFAULT_HEADERS,
|
59
|
-
...getAuthHeader(authToken),
|
60
|
-
}) {
|
61
|
-
return wrappedFetch(path, {
|
62
|
-
method: 'POST',
|
63
|
-
headers,
|
64
|
-
body: JSON.stringify(payload),
|
65
|
-
}, defaultError);
|
66
|
-
}
|
67
|
-
export function put(path, authToken, payload, defaultError, headers = {
|
68
|
-
...DEFAULT_HEADERS,
|
69
|
-
...getAuthHeader(authToken),
|
70
|
-
}) {
|
71
|
-
return wrappedFetch(path, {
|
72
|
-
method: 'PUT',
|
73
|
-
headers,
|
74
|
-
body: JSON.stringify(payload),
|
75
|
-
}, defaultError);
|
76
|
-
}
|
77
|
-
export function del(path, authToken, defaultError, headers = {
|
78
|
-
...DEFAULT_HEADERS,
|
79
|
-
...getAuthHeader(authToken),
|
80
|
-
}) {
|
81
|
-
return wrappedFetch(path, {
|
82
|
-
method: 'DELETE',
|
83
|
-
headers,
|
84
|
-
}, defaultError);
|
85
|
-
}
|
86
|
-
export async function listen(path, listener) {
|
87
|
-
const config = getConfig();
|
88
|
-
let ws;
|
89
|
-
const reconnectDelay = 1500;
|
90
|
-
const onOpen = async () => {
|
91
|
-
console.log('WebSocket Connection Opened Ok');
|
92
|
-
};
|
93
|
-
const onClose = (event) => {
|
94
|
-
console.warn('WebSocket closed, reconnecting:', event.code, event.reason);
|
95
|
-
closeWebSocket();
|
96
|
-
rejoin();
|
97
|
-
};
|
98
|
-
const onError = (event) => {
|
99
|
-
console.error('WebSocket error, reconnecting:', event);
|
100
|
-
closeWebSocket();
|
101
|
-
rejoin();
|
102
|
-
};
|
103
|
-
const closeWebSocket = () => {
|
104
|
-
try {
|
105
|
-
ws.removeEventListener('open', onOpen);
|
106
|
-
ws.removeEventListener('message', listener);
|
107
|
-
ws.removeEventListener('close', onClose);
|
108
|
-
ws.removeEventListener('error', onError);
|
109
|
-
ws.close();
|
110
|
-
}
|
111
|
-
catch (error) {
|
112
|
-
console.error('Error closing websocket', error);
|
113
|
-
}
|
114
|
-
};
|
115
|
-
const rejoin = () => {
|
116
|
-
if (ws) {
|
117
|
-
closeWebSocket();
|
118
|
-
}
|
119
|
-
setTimeout(join, reconnectDelay);
|
120
|
-
};
|
121
|
-
const join = () => {
|
122
|
-
const wsUrl = `${config.api.url.replace('http', 'ws')}/${path}`;
|
123
|
-
try {
|
124
|
-
ws = new WebSocket(wsUrl);
|
125
|
-
ws.addEventListener('open', onOpen);
|
126
|
-
ws.addEventListener('message', listener);
|
127
|
-
ws.addEventListener('close', onClose);
|
128
|
-
ws.addEventListener('error', onError);
|
129
|
-
}
|
130
|
-
catch (error) {
|
131
|
-
rejoin();
|
132
|
-
}
|
133
|
-
};
|
134
|
-
window.addEventListener('beforeunload', closeWebSocket);
|
135
|
-
join();
|
136
|
-
}
|
137
|
-
//# sourceMappingURL=methods.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../src/quarterback/api/methods.ts"],"names":[],"mappings":"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,SAAS,EACvE;YACA,CAAC,CAAC,IAAI,CACJ,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CACpB,KAAK,CAAC,IAAI,IAAI,EAAE,EAChB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAC5D,CACF,CAAA;SACF;aAAM,IAAI,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YAC3C,CAAC,CAAC,IAAI,CACJ,KAAK,CAAC,IAAI,CAAC,MAAM,CACf,EAAE,GAAG,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAC/B,sBAAsB,CAAC,KAAK,CAAC,EAC7B,KAAK,CAAC,KAAK,CACZ,CACF,CAAA;SACF;IACH,CAAC,CAAC,CAAA;IACF,OAAO,CAAC,CAAA;AACV,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAA4B;IACpE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAA;IACrB,OAAO,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,sBAAsB,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;AAC3E,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/quarterback/types.ts"],"names":[],"mappings":""}
|
@@ -1,17 +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
|
-
interface InvitedUser {
|
13
|
-
email: string;
|
14
|
-
name?: string;
|
15
|
-
}
|
16
|
-
export declare const projectInvite: (projectID: string, invitedUsers: InvitedUser[], role: string, message?: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
17
|
-
export {};
|
@@ -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) 2022 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import { AppliedStepsResponse, ICreateDocRequest, IUpdateDocumentRequest, ManuscriptDocWithSnapshots, StepsPayload, StepsSinceResponse, TransformerVersion } from '../types';
|
13
|
-
export declare const getDocument: (projectID: string, manuscriptID: string, authToken: string) => Promise<import("./methods").Maybe<ManuscriptDocWithSnapshots>>;
|
14
|
-
export declare const createDocument: (payload: ICreateDocRequest, authToken: string) => Promise<import("./methods").Maybe<ManuscriptDocWithSnapshots>>;
|
15
|
-
export declare const getTransformVersion: (authToken: string) => Promise<import("./methods").Maybe<TransformerVersion>>;
|
16
|
-
export declare const updateDocument: (projectID: string, manuscriptID: string, authToken: string, payload: IUpdateDocumentRequest) => Promise<import("./methods").Maybe<boolean>>;
|
17
|
-
export declare const deleteDocument: (projectID: string, manuscriptID: string, authToken: string) => Promise<import("./methods").Maybe<boolean>>;
|
18
|
-
export declare const applySteps: (projectId: string, docId: string, authToken: string, payload: StepsPayload) => Promise<import("./methods").Maybe<AppliedStepsResponse>>;
|
19
|
-
export declare const stepsSince: (projectId: string, docId: string, version: number, authToken: string) => Promise<import("./methods").Maybe<StepsSinceResponse>>;
|
20
|
-
export declare const listenStepUpdates: (projectID: string, manuscriptID: string, dataListener: (version: number, steps: unknown[], clientIDs: number[]) => void) => void;
|
@@ -1,38 +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) 2022 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
type Ok<T> = {
|
13
|
-
data: T;
|
14
|
-
};
|
15
|
-
type Error = {
|
16
|
-
err: string;
|
17
|
-
code: number;
|
18
|
-
};
|
19
|
-
export type Maybe<T> = Ok<T> | Error;
|
20
|
-
type FetchOptions = {
|
21
|
-
method: string;
|
22
|
-
headers: Record<string, string>;
|
23
|
-
body?: string;
|
24
|
-
};
|
25
|
-
export declare const DEFAULT_HEADERS: {
|
26
|
-
Accept: string;
|
27
|
-
'Content-Type': string;
|
28
|
-
};
|
29
|
-
export declare function getAuthHeader(authToken: string): "" | {
|
30
|
-
Authorization: string;
|
31
|
-
};
|
32
|
-
export declare function wrappedFetch<T>(path: string, options: FetchOptions, defaultError?: string): Promise<Maybe<T>>;
|
33
|
-
export declare function get<T>(path: string, authToken: string, defaultError?: string, headers?: Record<string, string>): Promise<Maybe<T>>;
|
34
|
-
export declare function post<T>(path: string, authToken: string, payload: any, defaultError?: string, headers?: Record<string, string>): Promise<Maybe<T>>;
|
35
|
-
export declare function put<T>(path: string, authToken: string, payload: any, defaultError?: string, headers?: Record<string, string>): Promise<Maybe<T>>;
|
36
|
-
export declare function del<T>(path: string, authToken: string, defaultError?: string, headers?: Record<string, string>): Promise<Maybe<T>>;
|
37
|
-
export declare function listen<T>(path: string, listener: (event: MessageEvent) => void): Promise<void>;
|
38
|
-
export {};
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { ManuscriptEditorState, ManuscriptNode } from '@manuscripts/transform';
|
2
|
-
export declare function filterUnchangedContent(node: ManuscriptNode): import("prosemirror-model").Node[];
|
3
|
-
export declare function getDocWithoutTrackContent(state: ManuscriptEditorState): import("prosemirror-model").Node;
|
@@ -1,74 +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) 2022 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
|
-
import { JsonValue } from 'type-fest';
|
13
|
-
export type ManuscriptSnapshot = {
|
14
|
-
id: string;
|
15
|
-
name: string;
|
16
|
-
snapshot: JsonValue;
|
17
|
-
createdAt: Date;
|
18
|
-
doc_id: string;
|
19
|
-
};
|
20
|
-
export type ManuscriptDoc = {
|
21
|
-
manuscript_model_id: string;
|
22
|
-
user_model_id: string;
|
23
|
-
project_model_id: string;
|
24
|
-
doc: JsonValue;
|
25
|
-
createdAt: Date;
|
26
|
-
updatedAt: Date;
|
27
|
-
version: number;
|
28
|
-
};
|
29
|
-
export type SnapshotLabel = Pick<ManuscriptSnapshot, 'id' | 'name' | 'createdAt'>;
|
30
|
-
export type ManuscriptDocWithSnapshots = ManuscriptDoc & {
|
31
|
-
snapshots: SnapshotLabel[];
|
32
|
-
};
|
33
|
-
export type TransformerVersion = {
|
34
|
-
transformVersion: string;
|
35
|
-
};
|
36
|
-
export type UpdateDocumentRequest = {
|
37
|
-
doc: Record<string, any>;
|
38
|
-
};
|
39
|
-
export interface CreateDocRequest {
|
40
|
-
manuscript_model_id: string;
|
41
|
-
project_model_id: string;
|
42
|
-
doc: Record<string, any>;
|
43
|
-
}
|
44
|
-
export type StepsPayload = {
|
45
|
-
steps: unknown[];
|
46
|
-
version: number;
|
47
|
-
clientID: number | string;
|
48
|
-
};
|
49
|
-
export type AppliedStepsResponse = {
|
50
|
-
lastVersion?: number;
|
51
|
-
steps?: number;
|
52
|
-
error?: string;
|
53
|
-
};
|
54
|
-
export type StepsSinceResponse = {
|
55
|
-
steps: unknown[];
|
56
|
-
version: number;
|
57
|
-
clientIDs: number[];
|
58
|
-
};
|
59
|
-
export type IGetSnapshotResponse = ManuscriptSnapshot;
|
60
|
-
export interface ISaveSnapshotResponse {
|
61
|
-
snapshot: ManuscriptSnapshot;
|
62
|
-
}
|
63
|
-
export interface ICreateDocRequest {
|
64
|
-
manuscript_model_id: string;
|
65
|
-
project_model_id: string;
|
66
|
-
doc: Record<string, any>;
|
67
|
-
schema_version: string;
|
68
|
-
}
|
69
|
-
export type ICreateDocResponse = ManuscriptDocWithSnapshots;
|
70
|
-
export type IUpdateDocumentRequest = {
|
71
|
-
doc: Record<string, any>;
|
72
|
-
version?: number;
|
73
|
-
schema_version: string;
|
74
|
-
};
|
File without changes
|
File without changes
|
File without changes
|