|
3 | 3 | <head>
|
4 | 4 | </head>
|
5 | 5 | <body>
|
6 |
| -<project-model></project-model> |
7 |
| -<url-history-model></url-history-model> |
8 |
| -<websocket-url-history-model></websocket-url-history-model> |
9 |
| -<history-data-model></history-data-model> |
10 |
| -<client-certificate-model></client-certificate-model> |
11 |
| -<variables-model></variables-model> |
12 |
| -<auth-data-model></auth-data-model> |
13 |
| -<request-model></request-model> |
14 |
| -<host-rules-model></host-rules-model> |
15 |
| -<rest-api-model></rest-api-model> |
16 |
| -<url-indexer></url-indexer> |
17 | 6 | <script type="module">
|
18 |
| -/* eslint-disable import/no-extraneous-dependencies */ |
19 |
| -/* eslint-disable no-await-in-loop */ |
20 |
| -/* eslint-disable import/no-unresolved */ |
21 |
| - |
22 | 7 | /**
|
23 | 8 | * This import the entire data export logic for ARC and dumps all the user data
|
24 | 9 | * into a temporary folder (in the system's TMP path).
|
25 | 10 | *
|
26 | 11 | * Then it reports the operation finished to the IO process so it can run the import window
|
27 | 12 | * and import the data into the application.
|
28 | 13 | */
|
29 |
| - |
30 |
| -import PouchDB from 'web-module:../web_modules/pouchdb/dist/pouchdb.js'; |
31 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/project-model.js'; |
32 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/url-history-model.js'; |
33 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/websocket-url-history-model.js'; |
34 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/history-data-model.js'; |
35 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/client-certificate-model.js'; |
36 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/variables-model.js'; |
37 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/auth-data-model.js'; |
38 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/request-model.js'; |
39 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/host-rules-model.js'; |
40 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/rest-api-model.js'; |
41 |
| -import 'web-module:../web_modules/@advanced-rest-client/arc-models/url-indexer.js'; |
42 |
| -import { ExportProcessor, ExportFactory } from 'web-module:../web_modules/@advanced-rest-client/arc-models/index.js'; |
| 14 | + import { PouchDB, ExportProcessor, ExportFactory } from 'web-module:../web_modules/index.js'; |
43 | 15 |
|
44 | 16 | window.PouchDB = PouchDB;
|
45 | 17 | const { ipcRenderer } = require('electron');
|
|
53 | 25 | * @return Promise<void>
|
54 | 26 | */
|
55 | 27 | async function start(e, storeLocation) {
|
| 28 | + console.info('Starting data migration'); |
56 | 29 | try {
|
57 | 30 | const factory = new ExportFactory();
|
58 | 31 | const data = /** @type any[] */ (await factory.getExportData({
|
|
85 | 58 | await fs.outputJson(storeLocation, exportObject);
|
86 | 59 | ipcRenderer.send('server-db-finished');
|
87 | 60 | } catch (e) {
|
| 61 | + console.error(e); |
88 | 62 | ipcRenderer.send('db-error', e.message, e.stack);
|
89 | 63 | }
|
90 | 64 | }
|
91 |
| - |
92 | 65 | ipcRenderer.once('server-start', start);
|
93 | 66 | </script>
|
94 | 67 | </body>
|
|
0 commit comments