diff --git a/CliClient/app/test-onedrive.js b/CliClient/app/test-onedrive.js deleted file mode 100644 index 3847aa1e3..000000000 --- a/CliClient/app/test-onedrive.js +++ /dev/null @@ -1,138 +0,0 @@ -require('source-map-support').install(); -require('babel-plugin-transform-runtime'); - -import { OneDriveApi } from 'lib/onedrive-api.js'; - -const fs = require('fs-extra'); -const path = require('path'); - -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'; - return fs.readFile(configFilePath, 'utf8').then((content) => { - return JSON.parse(content); - }); -} - - -async function main() { - let config = await configContent(); - - const fetch = require('node-fetch'); - - let options = { - headers: { 'Authorization': 'bearer ' + config.oneDriveToken }, - }; - - // let api = new OneDriveApi('a'); - // api.setToken(config.oneDriveToken); - // let r = await api.execText('GET', '/drive/root:/joplin/aaaaaaaaaaaaaaaaa.txt:/content'); - // console.info(r); - - - - - //console.info(options); - - // let response = await fetch('https://graph.microsoft.com/v1.0/drive/root:/joplin/aaaaaaaaaaaaaaaaa.txt:/content', options); - - // console.info(response.ok); - // console.info(response.status); - // console.info(response.statusText); - // console.info(response.headers.get('Location')); - - // let responseText = await response.text(); - // console.info(responseText); - - - - - let driver = new FileApiDriverOneDrive('e09fc0de-c958-424f-83a2-e56a721d331b', 'JA3cwsqSGHFtjMwd5XoF5L5'); - driver.api().setToken(config.oneDriveToken); - - //config.oneDriveToken); - let api = new FileApi('/joplin', driver); - - let appDir = await driver.api().execJson('GET', '/drive/special/approot'); - - console.info(appDir); - - // /drive/special/approot - - // await api.delete('eraseme.txt'); - - // let result = await api.list(); - // console.info(result); - - //await api.put('aaaaaaaaaaaaaaaaa.txt', 'AAAAAAAAAAAA MOD'); - //onsole.info(content); - - - - // let content = await api.get('aaaaaaaaaaaaaaaaa.txt'); - // console.info(content); - - - - // let r = await api.setTimestamp('aaaaaaaaaaaaaaaaa.txt', 1498061000000); - // console.info(r); - - - // console.info('=============='); - - // let stat = await api.stat('aaaaaaaaaaaaaaaaa.txt'); - // console.info(stat); - - // console.info(content); - - -// // const fetch = require('node-fetch'); -// let content = await api.get('aaaaaaaaaaaaaaaaa.txt'); -// console.info('CONTENT', content); - - // var token = ''; - // var client = MicrosoftGraph.Client.init({ - // authProvider: (done) => { - // done(null, config.oneDriveToken); - // } - // }); - - // LIST ITEMS - - //client.api('/drive/items/9ADA0EADFA073D0A%21109/children').get((err, res) => { - //client.api('/drive/items/9ADA0EADFA073D0A%21109/children').get((err, res) => { - //client.api('/drive/root:/joplin:/children').get((err, res) => { - // client.api('/drive/root:/.:/children').get((err, res) => { - // console.log(err, res); - // }); - - // SET ITEM CONTENT - - // client.api('/drive/items/9ADA0EADFA073D0A%21109:/test.txt:/content').put('testing', (err, res) => { - // console.log(err, res); - // }); - - // SET ITEM CONTENT - - // client.api('/drive/items/9ADA0EADFA073D0A%21109:/test2.txt:/content').put('testing deux', (err, res) => { - // console.log(err, res); - // }); - - // DELETE ITEM - - // client.api('/drive/items/9ADA0EADFA073D0A%21111').delete((err, res) => { - // console.log(err, res); - // }); - - // GET ITEM METADATA - - // client.api('/drive/items/9ADA0EADFA073D0A%21110?select=name,lastModifiedDateTime').get((err, res) => { - // console.log(err, res); - // }); -} - -main().catch((error) => { - console.error(error); -}); \ No newline at end of file diff --git a/CliClient/build.sh b/CliClient/build.sh index f83d6c53c..f7c5732eb 100755 --- a/CliClient/build.sh +++ b/CliClient/build.sh @@ -3,7 +3,7 @@ CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" mkdir -p "$CLIENT_DIR/build" rm -f "$CLIENT_DIR/app/lib" -ln -s "$CLIENT_DIR/../lib" "$CLIENT_DIR/app" +ln -s "$CLIENT_DIR/../ReactNativeClient/lib" "$CLIENT_DIR/app" cp "$CLIENT_DIR/package.json" "$CLIENT_DIR/build" # Always keep this as the last line so that the exit diff --git a/ReactNativeClient/index.android.js b/ReactNativeClient/index.android.js index 2d47a8da1..755795182 100644 --- a/ReactNativeClient/index.android.js +++ b/ReactNativeClient/index.android.js @@ -1,3 +1,3 @@ -import { main } from 'app/main.js'; +import { main } from './main.js'; main(); \ No newline at end of file diff --git a/ReactNativeClient/lib b/ReactNativeClient/lib deleted file mode 120000 index dc598c56d..000000000 --- a/ReactNativeClient/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/lib/base-model.js b/ReactNativeClient/lib/base-model.js similarity index 100% rename from lib/base-model.js rename to ReactNativeClient/lib/base-model.js diff --git a/ReactNativeClient/app/components/action-button.js b/ReactNativeClient/lib/components/action-button.js similarity index 100% rename from ReactNativeClient/app/components/action-button.js rename to ReactNativeClient/lib/components/action-button.js diff --git a/ReactNativeClient/app/components/checkbox.js b/ReactNativeClient/lib/components/checkbox.js similarity index 100% rename from ReactNativeClient/app/components/checkbox.js rename to ReactNativeClient/lib/components/checkbox.js diff --git a/ReactNativeClient/app/components/folder-list.js b/ReactNativeClient/lib/components/folder-list.js similarity index 100% rename from ReactNativeClient/app/components/folder-list.js rename to ReactNativeClient/lib/components/folder-list.js diff --git a/ReactNativeClient/app/components/item-list.js b/ReactNativeClient/lib/components/item-list.js similarity index 100% rename from ReactNativeClient/app/components/item-list.js rename to ReactNativeClient/lib/components/item-list.js diff --git a/ReactNativeClient/app/components/note-list.js b/ReactNativeClient/lib/components/note-list.js similarity index 100% rename from ReactNativeClient/app/components/note-list.js rename to ReactNativeClient/lib/components/note-list.js diff --git a/ReactNativeClient/app/components/screen-header.js b/ReactNativeClient/lib/components/screen-header.js similarity index 100% rename from ReactNativeClient/app/components/screen-header.js rename to ReactNativeClient/lib/components/screen-header.js diff --git a/ReactNativeClient/app/components/screens/folder.js b/ReactNativeClient/lib/components/screens/folder.js similarity index 100% rename from ReactNativeClient/app/components/screens/folder.js rename to ReactNativeClient/lib/components/screens/folder.js diff --git a/ReactNativeClient/app/components/screens/folders.js b/ReactNativeClient/lib/components/screens/folders.js similarity index 100% rename from ReactNativeClient/app/components/screens/folders.js rename to ReactNativeClient/lib/components/screens/folders.js diff --git a/ReactNativeClient/app/components/screens/loading.js b/ReactNativeClient/lib/components/screens/loading.js similarity index 100% rename from ReactNativeClient/app/components/screens/loading.js rename to ReactNativeClient/lib/components/screens/loading.js diff --git a/ReactNativeClient/app/components/screens/login.js b/ReactNativeClient/lib/components/screens/login.js similarity index 100% rename from ReactNativeClient/app/components/screens/login.js rename to ReactNativeClient/lib/components/screens/login.js diff --git a/ReactNativeClient/app/components/screens/note.js b/ReactNativeClient/lib/components/screens/note.js similarity index 100% rename from ReactNativeClient/app/components/screens/note.js rename to ReactNativeClient/lib/components/screens/note.js diff --git a/ReactNativeClient/app/components/screens/notes.js b/ReactNativeClient/lib/components/screens/notes.js similarity index 100% rename from ReactNativeClient/app/components/screens/notes.js rename to ReactNativeClient/lib/components/screens/notes.js diff --git a/ReactNativeClient/app/components/side-menu-content.js b/ReactNativeClient/lib/components/side-menu-content.js similarity index 100% rename from ReactNativeClient/app/components/side-menu-content.js rename to ReactNativeClient/lib/components/side-menu-content.js diff --git a/ReactNativeClient/app/components/side-menu.js b/ReactNativeClient/lib/components/side-menu.js similarity index 100% rename from ReactNativeClient/app/components/side-menu.js rename to ReactNativeClient/lib/components/side-menu.js diff --git a/lib/database-driver-node.js b/ReactNativeClient/lib/database-driver-node.js similarity index 100% rename from lib/database-driver-node.js rename to ReactNativeClient/lib/database-driver-node.js diff --git a/lib/database-driver-react-native.js b/ReactNativeClient/lib/database-driver-react-native.js similarity index 100% rename from lib/database-driver-react-native.js rename to ReactNativeClient/lib/database-driver-react-native.js diff --git a/lib/database.js b/ReactNativeClient/lib/database.js similarity index 100% rename from lib/database.js rename to ReactNativeClient/lib/database.js diff --git a/lib/file-api-driver-local.js b/ReactNativeClient/lib/file-api-driver-local.js similarity index 100% rename from lib/file-api-driver-local.js rename to ReactNativeClient/lib/file-api-driver-local.js diff --git a/lib/file-api-driver-memory.js b/ReactNativeClient/lib/file-api-driver-memory.js similarity index 100% rename from lib/file-api-driver-memory.js rename to ReactNativeClient/lib/file-api-driver-memory.js diff --git a/lib/file-api-driver-onedrive.js b/ReactNativeClient/lib/file-api-driver-onedrive.js similarity index 100% rename from lib/file-api-driver-onedrive.js rename to ReactNativeClient/lib/file-api-driver-onedrive.js diff --git a/lib/file-api.js b/ReactNativeClient/lib/file-api.js similarity index 100% rename from lib/file-api.js rename to ReactNativeClient/lib/file-api.js diff --git a/lib/geolocation-react.js b/ReactNativeClient/lib/geolocation-react.js similarity index 100% rename from lib/geolocation-react.js rename to ReactNativeClient/lib/geolocation-react.js diff --git a/lib/locale.js b/ReactNativeClient/lib/locale.js similarity index 100% rename from lib/locale.js rename to ReactNativeClient/lib/locale.js diff --git a/lib/log.js b/ReactNativeClient/lib/log.js similarity index 100% rename from lib/log.js rename to ReactNativeClient/lib/log.js diff --git a/lib/logger.js b/ReactNativeClient/lib/logger.js similarity index 100% rename from lib/logger.js rename to ReactNativeClient/lib/logger.js diff --git a/lib/mime-utils.js b/ReactNativeClient/lib/mime-utils.js similarity index 100% rename from lib/mime-utils.js rename to ReactNativeClient/lib/mime-utils.js diff --git a/lib/models/base-item.js b/ReactNativeClient/lib/models/base-item.js similarity index 100% rename from lib/models/base-item.js rename to ReactNativeClient/lib/models/base-item.js diff --git a/lib/models/folder.js b/ReactNativeClient/lib/models/folder.js similarity index 100% rename from lib/models/folder.js rename to ReactNativeClient/lib/models/folder.js diff --git a/lib/models/note-tag.js b/ReactNativeClient/lib/models/note-tag.js similarity index 100% rename from lib/models/note-tag.js rename to ReactNativeClient/lib/models/note-tag.js diff --git a/lib/models/note.js b/ReactNativeClient/lib/models/note.js similarity index 100% rename from lib/models/note.js rename to ReactNativeClient/lib/models/note.js diff --git a/lib/models/resource.js b/ReactNativeClient/lib/models/resource.js similarity index 100% rename from lib/models/resource.js rename to ReactNativeClient/lib/models/resource.js diff --git a/lib/models/session.js b/ReactNativeClient/lib/models/session.js similarity index 100% rename from lib/models/session.js rename to ReactNativeClient/lib/models/session.js diff --git a/lib/models/setting.js b/ReactNativeClient/lib/models/setting.js similarity index 100% rename from lib/models/setting.js rename to ReactNativeClient/lib/models/setting.js diff --git a/lib/models/tag.js b/ReactNativeClient/lib/models/tag.js similarity index 100% rename from lib/models/tag.js rename to ReactNativeClient/lib/models/tag.js diff --git a/lib/onedrive-api.js b/ReactNativeClient/lib/onedrive-api.js similarity index 100% rename from lib/onedrive-api.js rename to ReactNativeClient/lib/onedrive-api.js diff --git a/lib/package.json b/ReactNativeClient/lib/package.json similarity index 100% rename from lib/package.json rename to ReactNativeClient/lib/package.json diff --git a/lib/path-utils.js b/ReactNativeClient/lib/path-utils.js similarity index 100% rename from lib/path-utils.js rename to ReactNativeClient/lib/path-utils.js diff --git a/lib/promise-utils.js b/ReactNativeClient/lib/promise-utils.js similarity index 100% rename from lib/promise-utils.js rename to ReactNativeClient/lib/promise-utils.js diff --git a/ReactNativeClient/app/services/note-folder-service.js b/ReactNativeClient/lib/services/note-folder-service.js similarity index 100% rename from ReactNativeClient/app/services/note-folder-service.js rename to ReactNativeClient/lib/services/note-folder-service.js diff --git a/lib/string-utils.js b/ReactNativeClient/lib/string-utils.js similarity index 100% rename from lib/string-utils.js rename to ReactNativeClient/lib/string-utils.js diff --git a/lib/synchronizer.js b/ReactNativeClient/lib/synchronizer.js similarity index 99% rename from lib/synchronizer.js rename to ReactNativeClient/lib/synchronizer.js index 15207fc72..3875fd16a 100644 --- a/lib/synchronizer.js +++ b/ReactNativeClient/lib/synchronizer.js @@ -1,5 +1,3 @@ -require('babel-plugin-transform-runtime'); - import { BaseItem } from 'lib/models/base-item.js'; import { Folder } from 'lib/models/folder.js'; import { Note } from 'lib/models/note.js'; diff --git a/lib/time-utils.js b/ReactNativeClient/lib/time-utils.js similarity index 100% rename from lib/time-utils.js rename to ReactNativeClient/lib/time-utils.js diff --git a/lib/uuid.js b/ReactNativeClient/lib/uuid.js similarity index 100% rename from lib/uuid.js rename to ReactNativeClient/lib/uuid.js diff --git a/ReactNativeClient/app/main.js b/ReactNativeClient/main.js similarity index 96% rename from ReactNativeClient/app/main.js rename to ReactNativeClient/main.js index 271f8b835..552ebc916 100644 --- a/ReactNativeClient/app/main.js +++ b/ReactNativeClient/main.js @@ -8,7 +8,7 @@ import { AppRegistry } from 'react-native'; import { Log } from 'lib/log.js' -import { Root } from 'app/root.js'; +import { Root } from './root.js'; function main() { AppRegistry.registerComponent('AwesomeProject', () => Root); diff --git a/ReactNativeClient/app/root.js b/ReactNativeClient/root.js similarity index 93% rename from ReactNativeClient/app/root.js rename to ReactNativeClient/root.js index 576a2c0bf..a67959499 100644 --- a/ReactNativeClient/app/root.js +++ b/ReactNativeClient/root.js @@ -11,18 +11,18 @@ 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 { ItemList } from 'app/components/item-list.js' -import { NotesScreen } from 'app/components/screens/notes.js' -import { NoteScreen } from 'app/components/screens/note.js' -import { FolderScreen } from 'app/components/screens/folder.js' -import { FoldersScreen } from 'app/components/screens/folders.js' -import { LoginScreen } from 'app/components/screens/login.js' -import { LoadingScreen } from 'app/components/screens/loading.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 'app/components/side-menu.js'; -import { SideMenuContent } from 'app/components/side-menu-content.js'; +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';