1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

re-organise code

This commit is contained in:
Laurent Cozic 2017-06-24 19:06:28 +01:00
parent f5e8fac90d
commit 58791b1963
66 changed files with 202 additions and 248 deletions

View File

@ -1,8 +1,8 @@
import { FileApi } from 'src/file-api.js';
import { FileApiDriverLocal } from 'src/file-api-driver-local.js';
import { Database } from 'src/database.js';
import { DatabaseDriverNode } from 'src/database-driver-node.js';
import { Log } from 'src/log.js';
import { FileApi } from 'lib/file-api.js';
import { FileApiDriverLocal } from 'lib/file-api-driver-local.js';
import { Database } from 'lib/database.js';
import { DatabaseDriverNode } from 'lib/database-driver-node.js';
import { Log } from 'lib/log.js';
const fs = require('fs');

View File

@ -1,12 +1,12 @@
require('app-module-path').addPath(__dirname);
import { uuid } from 'src/uuid.js';
import { uuid } from 'lib/uuid.js';
import moment from 'moment';
import { promiseChain } from 'src/promise-utils.js';
import { folderItemFilename } from 'src/string-utils.js'
import { BaseModel } from 'src/base-model.js';
import { Note } from 'src/models/note.js';
import { Folder } from 'src/models/folder.js';
import { promiseChain } from 'lib/promise-utils.js';
import { folderItemFilename } from 'lib/string-utils.js'
import { BaseModel } from 'lib/base-model.js';
import { Note } from 'lib/models/note.js';
import { Folder } from 'lib/models/folder.js';
import jsSHA from "jssha";
const Promise = require('promise');

1
CliClient/app/lib Symbolic link
View File

@ -0,0 +1 @@
/var/www/joplin/CliClient/../lib

View File

@ -1,20 +1,20 @@
require('source-map-support').install();
require('babel-plugin-transform-runtime');
import { FileApi } from 'src/file-api.js';
import { FileApiDriverOneDrive } from 'src/file-api-driver-onedrive.js';
import { Database } from 'src/database.js';
import { DatabaseDriverNode } from 'src/database-driver-node.js';
import { BaseModel } from 'src/base-model.js';
import { Folder } from 'src/models/folder.js';
import { Note } from 'src/models/note.js';
import { Setting } from 'src/models/setting.js';
import { Synchronizer } from 'src/synchronizer.js';
import { Logger } from 'src/logger.js';
import { uuid } from 'src/uuid.js';
import { FileApi } from 'lib/file-api.js';
import { FileApiDriverOneDrive } from 'lib/file-api-driver-onedrive.js';
import { Database } from 'lib/database.js';
import { DatabaseDriverNode } from 'lib/database-driver-node.js';
import { BaseModel } from 'lib/base-model.js';
import { Folder } from 'lib/models/folder.js';
import { Note } from 'lib/models/note.js';
import { Setting } from 'lib/models/setting.js';
import { Synchronizer } from 'lib/synchronizer.js';
import { Logger } from 'lib/logger.js';
import { uuid } from 'lib/uuid.js';
import { sprintf } from 'sprintf-js';
import { importEnex } from 'import-enex';
import { _ } from 'src/locale.js';
import { _ } from 'lib/locale.js';
import os from 'os';
import fs from 'fs-extra';

View File

@ -1,7 +1,7 @@
require('source-map-support').install();
require('babel-plugin-transform-runtime');
import { OneDriveApi } from 'src/onedrive-api.js';
import { OneDriveApi } from 'lib/onedrive-api.js';
const fetch = require('node-fetch');
const tcpPortUsed = require('tcp-port-used');

View File

@ -1,14 +1,14 @@
require('source-map-support').install();
require('babel-plugin-transform-runtime');
import { OneDriveApi } from 'src/onedrive-api.js';
import { OneDriveApi } from 'lib/onedrive-api.js';
const MicrosoftGraph = require("@microsoft/microsoft-graph-client");
const fs = require('fs-extra');
const path = require('path');
import { FileApiDriverOneDrive } from 'src/file-api-driver-onedrive.js';
import { FileApi } from 'src/file-api.js';
import { FileApiDriverOneDrive } from 'lib/file-api-driver-onedrive.js';
import { FileApi } from 'lib/file-api.js';
function configContent() {
const configFilePath = path.dirname(__dirname) + '/config.json';

View File

@ -39,7 +39,7 @@
},
"scripts": {
"babelbuild": "babel app -d build",
"build": "babel-changed app -d build --source-maps && babel-changed app/src/models -d build/src/models --source-maps && babel-changed app/src/services -d build/src/services --source-maps",
"build": "babel-changed app -d build --source-maps && babel-changed app/lib/models -d build/lib/models --source-maps && babel-changed app/lib/services -d build/lib/services --source-maps",
"clean": "babel-changed --reset",
"test": "babel-changed tests -d tests-build --source-maps && jasmine"
}

View File

@ -1,8 +1,8 @@
#!/bin/bash
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
rm -f "$CLIENT_DIR/app/src"
ln -s "$CLIENT_DIR/../ReactNativeClient/src" "$CLIENT_DIR/app"
rm -f "$CLIENT_DIR/app/lib"
ln -s "$CLIENT_DIR/../lib" "$CLIENT_DIR/app"
npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/main.js
#npm run build && NODE_PATH="$CLIENT_DIR/build/" node build/test-onedrive.js

View File

@ -1,9 +1,9 @@
#!/bin/bash
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
rm -f "$CLIENT_DIR/tests-build/src"
rm -f "$CLIENT_DIR/tests-build/lib"
mkdir -p "$CLIENT_DIR/tests-build/data"
ln -s "$CLIENT_DIR/build/src" "$CLIENT_DIR/tests-build"
ln -s "$CLIENT_DIR/build/lib" "$CLIENT_DIR/tests-build"
#npm run build && NODE_PATH="$CLIENT_DIR/tests-build/" npm test tests-build/base-model.js
npm run build && NODE_PATH="$CLIENT_DIR/tests-build/" npm test tests-build/synchronizer.js

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
<en-export export-date="20130730T205637Z" application="Evernote" version="Evernote Mac">
<note>
<title>Test Note for Export</title>
<content>
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hello, World.
<div>
<br/>
</div>
<div>
<en-media alt="" type="image/jpeg" hash="dd7b6d285d09ec054e8cd6a3814ce093"/>
</div>
<div>
<br/>
</div>
</en-note>
]]>
</content>
<created>20130730T205204Z</created>
<updated>20130730T205624Z</updated>
<tag>fake-tag</tag>
<note-attributes>
<latitude>33.88394692352314</latitude>
<longitude>-117.9191355110099</longitude>
<altitude>96</altitude>
<author>Brett Kelly</author>
</note-attributes>
<resource>
<data encoding="base64">/9j/4AAQSkZJRgABAQAAAQABAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZ
WiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQ
<!-- ... -->
kfeIGT/+uufk8DpM0gyVjGfmzkgetesnUoTHJ+5Cxn86zmv4/wB75EW+QHAPUH/P9Ky+s1rtrr/wfvOm
dBSamnq/xPKp/hpLKmS7x4OBjgn6elee6v4OuLJirRSHb/FtyG9s9u1fR0+oTiIRvGq7W4bpisfUGk1C
GVWtkIyM57n1rfDY+uqigtU76ffZkUsA6iajHZ6v/P8A4B//2Q==</data>
<mime>image/jpeg</mime>
<width>1280</width>
<height>720</height>
<resource-attributes>
<file-name>snapshot-DAE9FC15-88E3-46CF-B744-DA9B1B56EB57.jpg</file-name>
</resource-attributes>
</resource>
</note>
</en-export>

View File

@ -1,11 +1,11 @@
import { time } from 'src/time-utils.js';
import { time } from 'lib/time-utils.js';
import { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient } from 'test-utils.js';
import { createFoldersAndNotes } from 'test-data.js';
import { Folder } from 'src/models/folder.js';
import { Note } from 'src/models/note.js';
import { Setting } from 'src/models/setting.js';
import { BaseItem } from 'src/models/base-item.js';
import { BaseModel } from 'src/base-model.js';
import { Folder } from 'lib/models/folder.js';
import { Note } from 'lib/models/note.js';
import { Setting } from 'lib/models/setting.js';
import { BaseItem } from 'lib/models/base-item.js';
import { BaseModel } from 'lib/base-model.js';
process.on('unhandledRejection', (reason, p) => {
console.error('Unhandled promise rejection at: Promise', p, 'reason:', reason);

View File

@ -1,5 +1,5 @@
import { promiseChain } from 'src/promise-utils.js';
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { promiseChain } from 'lib/promise-utils.js';
import { NoteFolderService } from 'lib/services/note-folder-service.js';
import { setupDatabaseAndSynchronizer } from 'test-utils.js';
import { createFoldersAndNotes } from 'test-data.js';

View File

@ -1,11 +1,11 @@
import { time } from 'src/time-utils.js';
import { time } from 'lib/time-utils.js';
import { setupDatabase, setupDatabaseAndSynchronizer, db, synchronizer, fileApi, sleep, clearDatabase, switchClient } from 'test-utils.js';
import { createFoldersAndNotes } from 'test-data.js';
import { Folder } from 'src/models/folder.js';
import { Note } from 'src/models/note.js';
import { Setting } from 'src/models/setting.js';
import { BaseItem } from 'src/models/base-item.js';
import { BaseModel } from 'src/base-model.js';
import { Folder } from 'lib/models/folder.js';
import { Note } from 'lib/models/note.js';
import { Setting } from 'lib/models/setting.js';
import { BaseItem } from 'lib/models/base-item.js';
import { BaseModel } from 'lib/base-model.js';
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);

View File

@ -1,6 +1,6 @@
import { Note } from 'src/models/note.js';
import { Folder } from 'src/models/folder.js';
import { promiseChain } from 'src/promise-utils.js';
import { Note } from 'lib/models/note.js';
import { Folder } from 'lib/models/folder.js';
import { promiseChain } from 'lib/promise-utils.js';
function createNotes(id = 1, parentId) {
let notes = [];

View File

@ -1,14 +1,14 @@
import fs from 'fs-extra';
import { Database } from 'src/database.js';
import { DatabaseDriverNode } from 'src/database-driver-node.js';
import { BaseModel } from 'src/base-model.js';
import { Folder } from 'src/models/folder.js';
import { Note } from 'src/models/note.js';
import { Setting } from 'src/models/setting.js';
import { BaseItem } from 'src/models/base-item.js';
import { Synchronizer } from 'src/synchronizer.js';
import { FileApi } from 'src/file-api.js';
import { FileApiDriverMemory } from 'src/file-api-driver-memory.js';
import { Database } from 'lib/database.js';
import { DatabaseDriverNode } from 'lib/database-driver-node.js';
import { BaseModel } from 'lib/base-model.js';
import { Folder } from 'lib/models/folder.js';
import { Note } from 'lib/models/note.js';
import { Setting } from 'lib/models/setting.js';
import { BaseItem } from 'lib/models/base-item.js';
import { Synchronizer } from 'lib/synchronizer.js';
import { FileApi } from 'lib/file-api.js';
import { FileApiDriverMemory } from 'lib/file-api-driver-memory.js';
let databases_ = [];
let synchronizers_ = [];

View File

@ -1,3 +1,3 @@
import { main } from 'src/main.js';
import { main } from 'lib/main.js';
main();

View File

@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import ReactNativeActionButton from 'react-native-action-button';
import { connect } from 'react-redux'
import { Log } from 'src/log.js'
import { Log } from 'lib/log.js'
const styles = StyleSheet.create({
actionButtonIcon: {

View File

@ -1,12 +1,12 @@
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { ListView, Text, TouchableHighlight } from 'react-native';
import { Log } from 'src/log.js';
import { ItemListComponent } from 'src/components/item-list.js';
import { Note } from 'src/models/note.js';
import { Folder } from 'src/models/folder.js';
import { _ } from 'src/locale.js';
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { Log } from 'lib/log.js';
import { ItemListComponent } from 'lib/components/item-list.js';
import { Note } from 'lib/models/note.js';
import { Folder } from 'lib/models/folder.js';
import { _ } from 'lib/locale.js';
import { NoteFolderService } from 'lib/services/note-folder-service.js';
class FolderListComponent extends ItemListComponent {

View File

@ -1,11 +1,11 @@
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { ListView, Text, TouchableHighlight, Switch, View } from 'react-native';
import { Log } from 'src/log.js';
import { _ } from 'src/locale.js';
import { Checkbox } from 'src/components/checkbox.js';
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { Note } from 'src/models/note.js';
import { Log } from 'lib/log.js';
import { _ } from 'lib/locale.js';
import { Checkbox } from 'lib/components/checkbox.js';
import { NoteFolderService } from 'lib/services/note-folder-service.js';
import { Note } from 'lib/models/note.js';
class ItemListComponent extends Component {

View File

@ -1,9 +1,9 @@
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { ListView, Text, TouchableHighlight } from 'react-native';
import { Log } from 'src/log.js';
import { ItemListComponent } from 'src/components/item-list.js';
import { _ } from 'src/locale.js';
import { Log } from 'lib/log.js';
import { ItemListComponent } from 'lib/components/item-list.js';
import { _ } from 'lib/locale.js';
class NoteListComponent extends ItemListComponent {

View File

@ -1,10 +1,10 @@
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { View, Text, Button, StyleSheet } from 'react-native';
import { Log } from 'src/log.js';
import { Log } from 'lib/log.js';
import { Menu, MenuOptions, MenuOption, MenuTrigger } from 'react-native-popup-menu';
import { _ } from 'src/locale.js';
import { Setting } from 'src/models/setting.js';
import { _ } from 'lib/locale.js';
import { Setting } from 'lib/models/setting.js';
const styles = StyleSheet.create({
divider: {

View File

@ -1,10 +1,10 @@
import React, { Component } from 'react';
import { View, Button, TextInput } from 'react-native';
import { connect } from 'react-redux'
import { Log } from 'src/log.js'
import { Folder } from 'src/models/folder.js'
import { ScreenHeader } from 'src/components/screen-header.js';
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { Log } from 'lib/log.js'
import { Folder } from 'lib/models/folder.js'
import { ScreenHeader } from 'lib/components/screen-header.js';
import { NoteFolderService } from 'lib/services/note-folder-service.js';
class FolderScreenComponent extends React.Component {

View File

@ -1,11 +1,11 @@
import React, { Component } from 'react';
import { View, Button, Picker, Text, StyleSheet } from 'react-native';
import { connect } from 'react-redux'
import { Log } from 'src/log.js'
import { FolderList } from 'src/components/folder-list.js'
import { ScreenHeader } from 'src/components/screen-header.js';
import { _ } from 'src/locale.js';
import { ActionButton } from 'src/components/action-button.js';
import { Log } from 'lib/log.js'
import { FolderList } from 'lib/components/folder-list.js'
import { ScreenHeader } from 'lib/components/screen-header.js';
import { _ } from 'lib/locale.js';
import { ActionButton } from 'lib/components/action-button.js';
class FoldersScreenComponent extends React.Component {

View File

@ -1,10 +1,10 @@
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { connect } from 'react-redux'
import { Log } from 'src/log.js'
import { Folder } from 'src/models/folder.js'
import { ScreenHeader } from 'src/components/screen-header.js';
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { Log } from 'lib/log.js'
import { Folder } from 'lib/models/folder.js'
import { ScreenHeader } from 'lib/components/screen-header.js';
import { NoteFolderService } from 'lib/services/note-folder-service.js';
class LoadingScreenComponent extends React.Component {

View File

@ -1,11 +1,11 @@
import React, { Component } from 'react';
import { View, Button, TextInput, Text } from 'react-native';
import { connect } from 'react-redux'
import { Log } from 'src/log.js'
import { Registry } from 'src/registry.js';
import { Setting } from 'src/models/setting.js';
import { ScreenHeader } from 'src/components/screen-header.js';
import { _ } from 'src/locale.js';
import { Log } from 'lib/log.js'
import { Registry } from 'lib/registry.js';
import { Setting } from 'lib/models/setting.js';
import { ScreenHeader } from 'lib/components/screen-header.js';
import { _ } from 'lib/locale.js';
class LoginScreenComponent extends React.Component {

View File

@ -1,13 +1,13 @@
import React, { Component } from 'react';
import { View, Button, TextInput } from 'react-native';
import { connect } from 'react-redux'
import { Log } from 'src/log.js'
import { Note } from 'src/models/note.js'
import { Registry } from 'src/registry.js'
import { ScreenHeader } from 'src/components/screen-header.js';
import { Checkbox } from 'src/components/checkbox.js'
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { _ } from 'src/locale.js';
import { Log } from 'lib/log.js'
import { Note } from 'lib/models/note.js'
import { Registry } from 'lib/registry.js'
import { ScreenHeader } from 'lib/components/screen-header.js';
import { Checkbox } from 'lib/components/checkbox.js'
import { NoteFolderService } from 'lib/services/note-folder-service.js';
import { _ } from 'lib/locale.js';
class NoteScreenComponent extends React.Component {

View File

@ -1,13 +1,13 @@
import React, { Component } from 'react';
import { View, Button, Picker } from 'react-native';
import { connect } from 'react-redux'
import { Log } from 'src/log.js'
import { NoteList } from 'src/components/note-list.js'
import { Folder } from 'src/models/folder.js'
import { ScreenHeader } from 'src/components/screen-header.js';
import { Log } from 'lib/log.js'
import { NoteList } from 'lib/components/note-list.js'
import { Folder } from 'lib/models/folder.js'
import { ScreenHeader } from 'lib/components/screen-header.js';
import { MenuOption, Text } from 'react-native-popup-menu';
import { _ } from 'src/locale.js';
import { ActionButton } from 'src/components/action-button.js';
import { _ } from 'lib/locale.js';
import { ActionButton } from 'lib/components/action-button.js';
class NotesScreenComponent extends React.Component {

View File

@ -1,8 +1,8 @@
import { connect } from 'react-redux'
import { Button } from 'react-native';
import { Log } from 'src/log.js';
import { Note } from 'src/models/note.js';
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { Log } from 'lib/log.js';
import { Note } from 'lib/models/note.js';
import { NoteFolderService } from 'lib/services/note-folder-service.js';
const React = require('react');
const {

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { Log } from 'src/log.js';
import { Log } from 'lib/log.js';
import SideMenu_ from 'react-native-side-menu';
class SideMenuComponent extends SideMenu_ {};

View File

@ -7,9 +7,9 @@
// So there's basically still a one way flux: React => SQLite => Redux => React
import { AppRegistry } from 'react-native';
import { Log } from 'src/log.js'
import { Root } from 'src/root.js';
import { Registry } from 'src/registry.js';
import { Log } from 'lib/log.js'
import { Root } from 'lib/root.js';
import { Registry } from 'lib/registry.js';
function main() {
Registry.setDebugMode(true);

View File

@ -1 +0,0 @@
{ "name": "src" }

View File

@ -4,8 +4,8 @@
// registry should be designed in such a way that they can be converted to use
// dependency injection later on (eg. `BaseModel.db()`, `Synchroniser.api()`)
import { Database } from 'src/database.js'
import { WebApi } from 'src/web-api.js'
import { Database } from 'lib/database.js'
import { WebApi } from 'lib/web-api.js'
class Registry {

View File

@ -6,26 +6,26 @@ import { createStore } from 'redux';
import { combineReducers } from 'redux';
import { StackNavigator } from 'react-navigation';
import { addNavigationHelpers } from 'react-navigation';
import { Log } from 'src/log.js'
import { Note } from 'src/models/note.js'
import { Folder } from 'src/models/folder.js'
import { BaseModel } from 'src/base-model.js'
import { Database } from 'src/database.js'
import { Registry } from 'src/registry.js'
import { ItemList } from 'src/components/item-list.js'
import { NotesScreen } from 'src/components/screens/notes.js'
import { NoteScreen } from 'src/components/screens/note.js'
import { FolderScreen } from 'src/components/screens/folder.js'
import { FoldersScreen } from 'src/components/screens/folders.js'
import { LoginScreen } from 'src/components/screens/login.js'
import { LoadingScreen } from 'src/components/screens/loading.js'
import { Setting } from 'src/models/setting.js'
import { Synchronizer } from 'src/synchronizer.js'
import { Log } from 'lib/log.js'
import { Note } from 'lib/models/note.js'
import { Folder } from 'lib/models/folder.js'
import { BaseModel } from 'lib/base-model.js'
import { Database } from 'lib/database.js'
import { Registry } from 'lib/registry.js'
import { ItemList } from 'lib/components/item-list.js'
import { NotesScreen } from 'lib/components/screens/notes.js'
import { NoteScreen } from 'lib/components/screens/note.js'
import { FolderScreen } from 'lib/components/screens/folder.js'
import { FoldersScreen } from 'lib/components/screens/folders.js'
import { LoginScreen } from 'lib/components/screens/login.js'
import { LoadingScreen } from 'lib/components/screens/loading.js'
import { Setting } from 'lib/models/setting.js'
import { Synchronizer } from 'lib/synchronizer.js'
import { MenuContext } from 'react-native-popup-menu';
import { SideMenu } from 'src/components/side-menu.js';
import { SideMenuContent } from 'src/components/side-menu-content.js';
import { NoteFolderService } from 'src/services/note-folder-service.js';
import { DatabaseDriverReactNative } from 'src/database-driver-react-native';
import { SideMenu } from 'lib/components/side-menu.js';
import { SideMenuContent } from 'lib/components/side-menu-content.js';
import { NoteFolderService } from 'lib/services/note-folder-service.js';
import { DatabaseDriverReactNative } from 'lib/database-driver-react-native';
let defaultState = {
notes: [],

View File

@ -5,14 +5,14 @@
// - Move setting of geo-location to GUI side (only for note explicitely created on client
// - Don't do diffing - make caller explicitely set model properties that need to be saved
import { BaseService } from 'src/base-service.js';
import { BaseModel } from 'src/base-model.js';
import { BaseItem } from 'src/models/base-item.js';
import { Note } from 'src/models/note.js';
import { Folder } from 'src/models/folder.js';
import { Log } from 'src/log.js';
import { time } from 'src/time-utils.js';
import { Registry } from 'src/registry.js';
import { BaseService } from 'lib/base-service.js';
import { BaseModel } from 'lib/base-model.js';
import { BaseItem } from 'lib/models/base-item.js';
import { Note } from 'lib/models/note.js';
import { Folder } from 'lib/models/folder.js';
import { Log } from 'lib/log.js';
import { time } from 'lib/time-utils.js';
import { Registry } from 'lib/registry.js';
class NoteFolderService extends BaseService {

View File

@ -1,4 +1,4 @@
import { BaseService } from 'src/base-service.js';
import { BaseService } from 'lib/base-service.js';
class SessionService extends BaseService {

View File

@ -1,4 +1,4 @@
import { isNode } from 'src/env.js';
import { isNode } from 'lib/env.js';
const FormData = require('form-data');
const fetch = require('node-fetch');

View File

@ -29,6 +29,7 @@
"*.iml",
"*.map",
"CliClient/app/src",
"CliClient/app/lib",
"*.jar",
]
}

View File

@ -1,7 +1,7 @@
import { Log } from 'src/log.js';
import { Database } from 'src/database.js';
import { uuid } from 'src/uuid.js';
import { time } from 'src/time-utils.js';
import { Log } from 'lib/log.js';
import { Database } from 'lib/database.js';
import { uuid } from 'lib/uuid.js';
import { time } from 'lib/time-utils.js';
class BaseModel {

View File

@ -1,4 +1,4 @@
import { Registry } from 'src/registry.js';
import { Registry } from 'lib/registry.js';
class BaseService {

View File

@ -1,7 +1,7 @@
import { uuid } from 'src/uuid.js';
import { promiseChain } from 'src/promise-utils.js';
import { Logger } from 'src/logger.js'
import { _ } from 'src/locale.js'
import { uuid } from 'lib/uuid.js';
import { promiseChain } from 'lib/promise-utils.js';
import { Logger } from 'lib/logger.js'
import { _ } from 'lib/locale.js'
const structureSql = `
CREATE TABLE folders (

View File

@ -1,6 +1,6 @@
import fs from 'fs';
import fse from 'fs-extra';
import { promiseChain } from 'src/promise-utils.js';
import { promiseChain } from 'lib/promise-utils.js';
import moment from 'moment';
class FileApiDriverLocal {

View File

@ -1,4 +1,4 @@
import { time } from 'src/time-utils.js';
import { time } from 'lib/time-utils.js';
class FileApiDriverMemory {

View File

@ -1,7 +1,7 @@
import moment from 'moment';
import { time } from 'src/time-utils.js';
import { dirname, basename } from 'src/path-utils.js';
import { OneDriveApi } from 'src/onedrive-api.js';
import { time } from 'lib/time-utils.js';
import { dirname, basename } from 'lib/path-utils.js';
import { OneDriveApi } from 'lib/onedrive-api.js';
class FileApiDriverOneDrive {

View File

@ -1,5 +1,5 @@
import { isHidden } from 'src/path-utils.js';
import { Logger } from 'src/logger.js';
import { isHidden } from 'lib/path-utils.js';
import { Logger } from 'lib/logger.js';
class FileApi {

View File

@ -1,4 +1,4 @@
class Geolocation {
class GeolocationReact {
static currentPosition_testResponse() {
return {
@ -36,4 +36,4 @@ class Geolocation {
}
export { Geolocation };
export { GeolocationReact };

View File

@ -1,9 +1,9 @@
import { BaseModel } from 'src/base-model.js';
import { Note } from 'src/models/note.js';
import { Folder } from 'src/models/folder.js';
import { Setting } from 'src/models/setting.js';
import { Database } from 'src/database.js';
import { time } from 'src/time-utils.js';
import { BaseModel } from 'lib/base-model.js';
import { Note } from 'lib/models/note.js';
import { Folder } from 'lib/models/folder.js';
import { Setting } from 'lib/models/setting.js';
import { Database } from 'lib/database.js';
import { time } from 'lib/time-utils.js';
import moment from 'moment';
class BaseItem extends BaseModel {

View File

@ -1,5 +1,5 @@
import { BaseModel } from 'src/base-model.js';
import { Log } from 'src/log.js';
import { BaseModel } from 'lib/base-model.js';
import { Log } from 'lib/log.js';
class Change extends BaseModel {

View File

@ -1,11 +1,11 @@
import { BaseModel } from 'src/base-model.js';
import { Log } from 'src/log.js';
import { promiseChain } from 'src/promise-utils.js';
import { Note } from 'src/models/note.js';
import { Setting } from 'src/models/setting.js';
import { _ } from 'src/locale.js';
import { BaseModel } from 'lib/base-model.js';
import { Log } from 'lib/log.js';
import { promiseChain } from 'lib/promise-utils.js';
import { Note } from 'lib/models/note.js';
import { Setting } from 'lib/models/setting.js';
import { _ } from 'lib/locale.js';
import moment from 'moment';
import { BaseItem } from 'src/models/base-item.js';
import { BaseItem } from 'lib/models/base-item.js';
class Folder extends BaseItem {

View File

@ -1,4 +1,4 @@
import { BaseModel } from 'src/base-model.js';
import { BaseModel } from 'lib/base-model.js';
class ItemSyncTime extends BaseModel {

View File

@ -1,8 +1,8 @@
import { BaseModel } from 'src/base-model.js';
import { Log } from 'src/log.js';
import { Folder } from 'src/models/folder.js';
import { Geolocation } from 'src/geolocation.js';
import { BaseItem } from 'src/models/base-item.js';
import { BaseModel } from 'lib/base-model.js';
import { Log } from 'lib/log.js';
import { Folder } from 'lib/models/folder.js';
import { GeolocationReact } from 'lib/geolocation-react.js';
import { BaseItem } from 'lib/models/base-item.js';
import moment from 'moment';
class Note extends BaseItem {
@ -59,7 +59,7 @@ class Note extends BaseItem {
Log.info('Updating lat/long of note ' + noteId);
let geoData = null;
return Geolocation.currentPosition().then((data) => {
return GeolocationReact.currentPosition().then((data) => {
Log.info('Got lat/long');
geoData = data;
return Note.load(noteId);

View File

@ -1,4 +1,4 @@
import { BaseModel } from 'src/base-model.js';
import { BaseModel } from 'lib/base-model.js';
class Session extends BaseModel {

View File

@ -1,6 +1,6 @@
import { BaseModel } from 'src/base-model.js';
import { Log } from 'src/log.js';
import { Database } from 'src/database.js';
import { BaseModel } from 'lib/base-model.js';
import { Log } from 'lib/log.js';
import { Database } from 'lib/database.js';
class Setting extends BaseModel {

1
lib/package.json Normal file
View File

@ -0,0 +1 @@
{ "name": "lib" }

View File

@ -1,12 +1,12 @@
require('babel-plugin-transform-runtime');
import { BaseItem } from 'src/models/base-item.js';
import { Folder } from 'src/models/folder.js';
import { Note } from 'src/models/note.js';
import { BaseModel } from 'src/base-model.js';
import { BaseItem } from 'lib/models/base-item.js';
import { Folder } from 'lib/models/folder.js';
import { Note } from 'lib/models/note.js';
import { BaseModel } from 'lib/base-model.js';
import { sprintf } from 'sprintf-js';
import { time } from 'src/time-utils.js';
import { Logger } from 'src/logger.js'
import { time } from 'lib/time-utils.js';
import { Logger } from 'lib/logger.js'
import moment from 'moment';
class Synchronizer {

View File

@ -1,5 +1,5 @@
import { Log } from 'src/log.js';
import { isNode } from 'src/env.js';
import { Log } from 'lib/log.js';
import { isNode } from 'lib/env.js';
import { stringify } from 'query-string';
if (isNode()) {