Compare commits

..
Author SHA1 Message Date
Laurent Cozic 051d628250 tsconfig 2023-06-13 11:10:07 +01:00
Laurent Cozic d8f365834b update 2023-06-13 11:01:45 +01:00
Laurent Cozic 6dc6acc644 update 2023-06-13 10:54:44 +01:00
Laurent Cozic 30e1164df9 Merge branch 'dev' into user_data 2023-06-12 17:31:20 +01:00
Laurent Cozic a8821dfcb5 test 2023-06-12 17:29:57 +01:00
Laurent Cozic 54b15a1917 Plugins: Updated types 2023-06-12 17:09:09 +01:00
Laurent Cozic e2d27275db Plugins: Updated types 2023-06-12 17:04:46 +01:00
Laurent Cozic b90cb89e0f fix 2023-06-12 17:02:49 +01:00
Laurent Cozic a6516c5f14 Plugins: Updated types 2023-06-12 16:52:09 +01:00
Laurent Cozic 249a744e9d init 2023-06-12 16:49:54 +01:00
134 changed files with 1208 additions and 1359 deletions

No files matched your search

-2
View File
@@ -225,7 +225,6 @@ packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useScrollHandler.j
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useScrollUtils.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/styles/index.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/joplinCommandToTinyMceCommands.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/openEditDialog.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/setupToolbarButtons.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/types.js
@@ -357,7 +356,6 @@ packages/app-desktop/services/sortOrder/PerFolderSortOrderService.test.js
packages/app-desktop/services/sortOrder/notesSortOrderUtils.js
packages/app-desktop/services/sortOrder/notesSortOrderUtils.test.js
packages/app-desktop/services/spellChecker/SpellCheckerServiceDriverNative.js
packages/app-desktop/tools/notarizeMacApp.js
packages/app-desktop/utils/markupLanguageUtils.js
packages/app-mobile/PluginAssetsLoader.js
packages/app-mobile/components/ActionButton.js
+1 -1
View File
@@ -33,5 +33,5 @@ jobs:
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
lock-pullrequest-aftermerge: false
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
#use-dco-flag: true - If you are using DCO instead of CLA
-32
View File
@@ -176,35 +176,3 @@ jobs:
# Basic test to ensure that the created build is valid. It should exit with
# code 0 if it works.
docker run joplin/server:0.0.0-beta node dist/app.js migrate list
- name: Check HTTP request
run: |
# Need to pass environment variables:
docker run -p 22300:22300 joplin/server:0.0.0-beta node dist/app.js --env dev &
# Wait for server to start
sleep 10
# Check if status code is correct
# if the actual_status DOES NOT include the expected_status
# it exits the process with code 1
expected_status="HTTP/1.1 200 OK"
actual_status=$(curl -I -X GET http://localhost:22300/api/ping | head -n 1)
if [[ ! "$actual_status" =~ "$expected_status" ]]; then
echo 'Failed while checking the status code after request to /api/ping'
echo 'expected: ' $expected_status
echo 'actual: ' $actual_status
exit 1;
fi
# Check if the body response is correct
# if the actual_body is different of expected_body exit with code 1
expected_body='{"status":"ok","message":"Joplin Server is running"}'
actual_body=$(curl http://localhost:22300/api/ping)
if [[ "$actual_body" != "$expected_body" ]]; then
echo 'Failed while checking the body response after request to /api/ping'
exit 1;
fi
-2
View File
@@ -210,7 +210,6 @@ packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useScrollHandler.j
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useScrollUtils.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/styles/index.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/joplinCommandToTinyMceCommands.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/openEditDialog.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/setupToolbarButtons.js
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/types.js
@@ -342,7 +341,6 @@ packages/app-desktop/services/sortOrder/PerFolderSortOrderService.test.js
packages/app-desktop/services/sortOrder/notesSortOrderUtils.js
packages/app-desktop/services/sortOrder/notesSortOrderUtils.test.js
packages/app-desktop/services/spellChecker/SpellCheckerServiceDriverNative.js
packages/app-desktop/tools/notarizeMacApp.js
packages/app-desktop/utils/markupLanguageUtils.js
packages/app-mobile/PluginAssetsLoader.js
packages/app-mobile/components/ActionButton.js
@@ -36,7 +36,7 @@ index 6afcbbf0cc8ca2d69dd78077d61e59a90b2136bb..9f8d72b4ec5b2b3d290975d6a255917c
def kotlin_version = getExtOrDefault('kotlinVersion')
diff --git a/android/src/main/java/com/reactnativevosk/VoskModule.kt b/android/src/main/java/com/reactnativevosk/VoskModule.kt
index 0e2b6595b1b2cf1ee01c6c64239c4b0ea37fce19..5a8539b9cce8951967640dba755e29a4e3ff404a 100644
index 0e2b6595b1b2cf1ee01c6c64239c4b0ea37fce19..f3da440bc2863a59db6d2d1691c54d8d4870cb3f 100644
--- a/android/src/main/java/com/reactnativevosk/VoskModule.kt
+++ b/android/src/main/java/com/reactnativevosk/VoskModule.kt
@@ -19,13 +19,25 @@ class VoskModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
@@ -66,25 +66,7 @@ index 0e2b6595b1b2cf1ee01c6c64239c4b0ea37fce19..5a8539b9cce8951967640dba755e29a4
sendEvent("onResult", text)
}
}
@@ -93,12 +105,11 @@ class VoskModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
@ReactMethod
fun loadModel(path: String, promise: Promise) {
cleanModel();
- StorageService.unpack(context, path, "models",
- { model: Model? ->
- this.model = model
- promise.resolve("Model successfully loaded")
- }
- ) { e: IOException ->
+
+ try {
+ this.model = Model(path);
+ promise.resolve("Model successfully loaded")
+ } catch (e: IOException) {
this.model = null
promise.reject(e)
}
@@ -153,6 +164,25 @@ class VoskModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
@@ -153,6 +165,25 @@ class VoskModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
cleanRecognizer();
}
+4 -4
View File
@@ -22,11 +22,11 @@ Three types of applications are available: for **desktop** (Windows, macOS and L
Operating System | Download
---|---
Windows (32 and 64-bit) | <a href='https://objects.joplinusercontent.com/v2.11.11/Joplin-Setup-2.11.11.exe?source=JoplinWebsite&type=New'><img alt='Get it on Windows' width="134px" src='https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/BadgeWindows.png'/></a>
macOS | <a href='https://objects.joplinusercontent.com/v2.11.11/Joplin-2.11.11.dmg?source=JoplinWebsite&type=New'><img alt='Get it on macOS' width="134px" src='https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/BadgeMacOS.png'/></a>
Linux | <a href='https://objects.joplinusercontent.com/v2.11.11/Joplin-2.11.11.AppImage?source=JoplinWebsite&type=New'><img alt='Get it on Linux' width="134px" src='https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/BadgeLinux.png'/></a>
Windows (32 and 64-bit) | <a href='https://objects.joplinusercontent.com/v2.10.19/Joplin-Setup-2.10.19.exe?source=JoplinWebsite&type=New'><img alt='Get it on Windows' width="134px" src='https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/BadgeWindows.png'/></a>
macOS | <a href='https://objects.joplinusercontent.com/v2.10.19/Joplin-2.10.19.dmg?source=JoplinWebsite&type=New'><img alt='Get it on macOS' width="134px" src='https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/BadgeMacOS.png'/></a>
Linux | <a href='https://objects.joplinusercontent.com/v2.10.19/Joplin-2.10.19.AppImage?source=JoplinWebsite&type=New'><img alt='Get it on Linux' width="134px" src='https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/BadgeLinux.png'/></a>
**On Windows**, you may also use the <a href='https://objects.joplinusercontent.com/v2.11.11/JoplinPortable.exe?source=JoplinWebsite&type=New'>Portable version</a>. The [portable application](https://en.wikipedia.org/wiki/Portable_application) allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file.
**On Windows**, you may also use the <a href='https://objects.joplinusercontent.com/v2.10.19/JoplinPortable.exe?source=JoplinWebsite&type=New'>Portable version</a>. The [portable application](https://en.wikipedia.org/wiki/Portable_application) allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file.
**On Linux**, the recommended way is to use the following installation script as it will handle the desktop icon too:
-38
View File
@@ -353,43 +353,5 @@
"web/bundles/": true,
"web/env.php": true,
}
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "transpile-server",
"type": "shell",
"command": "cd ${workspaceFolder}/packages/server && yarn tsc",
"group": "build",
}
]
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Server",
"type": "node",
"request": "launch",
"preLaunchTask": "transpile-server",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
"program": "${workspaceFolder}/packages/server/src/app.ts",
"args": [
"--env", "dev"
],
"env": {
"JOPLIN_IS_TESTING": "1",
"TERMS_URL": "https://example.com",
"PRIVACY_URL": "https://example.com",
}
}
]
}
}
+2 -1
View File
@@ -16,7 +16,7 @@
"buildSequential": "yarn workspaces foreach --verbose --interlaced --topological run build && yarn run tsc",
"buildApiDoc": "yarn workspace joplin start apidoc ../../readme/api/references/rest_api.md",
"buildCommandIndex": "node packages/tools/gulp/tasks/buildCommandIndexRun.js",
"buildPluginDoc": "cd packages/generate-plugin-doc && yarn run buildPluginDoc_",
"buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out ../joplin-website/docs/api/references/plugin_api packages/lib/services/plugins/api/",
"updateMarkdownDoc": "node ./packages/tools/updateMarkdownDoc",
"updateNews": "node ./packages/tools/website/updateNews",
"buildSettingJsonSchema": "yarn workspace joplin start settingschema ../../../joplin-website/docs/schema/settings.json",
@@ -84,6 +84,7 @@
"lint-staged": "13.2.2",
"madge": "6.0.0",
"npm-package-json-lint": "6.4.0",
"typedoc": "0.17.8",
"typescript": "5.0.2"
},
"dependencies": {
+5 -5
View File
@@ -35,15 +35,15 @@
],
"owner": "Laurent Cozic"
},
"version": "2.12.0",
"version": "2.11.0",
"bin": "./main.js",
"engines": {
"node": ">=10.0.0"
},
"dependencies": {
"@joplin/lib": "~2.12",
"@joplin/renderer": "~2.12",
"@joplin/utils": "~2.12",
"@joplin/lib": "~2.11",
"@joplin/renderer": "~2.11",
"@joplin/utils": "~2.11",
"aws-sdk": "2.1340.0",
"chalk": "4.1.2",
"compare-version": "0.1.2",
@@ -70,7 +70,7 @@
"yargs-parser": "21.1.1"
},
"devDependencies": {
"@joplin/tools": "~2.12",
"@joplin/tools": "~2.11",
"@types/fs-extra": "11.0.1",
"@types/jest": "29.5.1",
"@types/node": "18.15.13",
@@ -1 +0,0 @@
<a data-from-md title='&lt;style&gt;' href='&amp;#x22&amp;#x2c&amp;#x22&amp;#x61&amp;#x22&amp;#x29&amp;#x3b&amp;#x74&amp;#x6f&amp;#x70&amp;#x2e&amp;#x72&amp;#x65&amp;#x71&amp;#x75&amp;#x69&amp;#x72&amp;#x65&amp;#x28&amp;#x27&amp;#x63&amp;#x68&amp;#x69&amp;#x6c&amp;#x64&amp;#x5f&amp;#x70&amp;#x72&amp;#x6f&amp;#x63&amp;#x65&amp;#x73&amp;#x73&amp;#x27&amp;#x29&amp;#x2e&amp;#x65&amp;#x78&amp;#x65&amp;#x63&amp;#x28&amp;#x27&amp;#x6f&amp;#x70&amp;#x65&amp;#x6e&amp;#x20&amp;#x2f&amp;#x53&amp;#x79&amp;#x73&amp;#x74&amp;#x65&amp;#x6d&amp;#x2f&amp;#x41&amp;#x70&amp;#x70&amp;#x6c&amp;#x69&amp;#x63&amp;#x61&amp;#x74&amp;#x69&amp;#x6f&amp;#x6e&amp;#x73&amp;#x2f&amp;#x43&amp;#x61&amp;#x6c&amp;#x63&amp;#x75&amp;#x6c&amp;#x61&amp;#x74&amp;#x6f&amp;#x72&amp;#x2e&amp;#x61&amp;#x70&amp;#x70&amp;#x27&amp;#x29&amp;#x3b&amp;#x2f&amp;#x2f' onclick='postMessage(&quot;&amp;#x22&amp;#x2c&amp;#x22&amp;#x61&amp;#x22&amp;#x29&amp;#x3b&amp;#x74&amp;#x6f&amp;#x70&amp;#x2e&amp;#x72&amp;#x65&amp;#x71&amp;#x75&amp;#x69&amp;#x72&amp;#x65&amp;#x28&amp;#x27&amp;#x63&amp;#x68&amp;#x69&amp;#x6c&amp;#x64&amp;#x5f&amp;#x70&amp;#x72&amp;#x6f&amp;#x63&amp;#x65&amp;#x73&amp;#x73&amp;#x27&amp;#x29&amp;#x2e&amp;#x65&amp;#x78&amp;#x65&amp;#x63&amp;#x28&amp;#x27&amp;#x6f&amp;#x70&amp;#x65&amp;#x6e&amp;#x20&amp;#x2f&amp;#x53&amp;#x79&amp;#x73&amp;#x74&amp;#x65&amp;#x6d&amp;#x2f&amp;#x41&amp;#x70&amp;#x70&amp;#x6c&amp;#x69&amp;#x63&amp;#x61&amp;#x74&amp;#x69&amp;#x6f&amp;#x6e&amp;#x73&amp;#x2f&amp;#x43&amp;#x61&amp;#x6c&amp;#x63&amp;#x75&amp;#x6c&amp;#x61&amp;#x74&amp;#x6f&amp;#x72&amp;#x2e&amp;#x61&amp;#x70&amp;#x70&amp;#x27&amp;#x29&amp;#x3b&amp;#x2f&amp;#x2f&quot;, { resourceId: &quot;&quot; }); return false;'>xxxxx</a>
@@ -1 +0,0 @@
[xxxxx](&#x22&#x2c&#x22&#x61&#x22&#x29&#x3b&#x74&#x6f&#x70&#x2e&#x72&#x65&#x71&#x75&#x69&#x72&#x65&#x28&#x27&#x63&#x68&#x69&#x6c&#x64&#x5f&#x70&#x72&#x6f&#x63&#x65&#x73&#x73&#x27&#x29&#x2e&#x65&#x78&#x65&#x63&#x28&#x27&#x6f&#x70&#x65&#x6e&#x20&#x2f&#x53&#x79&#x73&#x74&#x65&#x6d&#x2f&#x41&#x70&#x70&#x6c&#x69&#x63&#x61&#x74&#x69&#x6f&#x6e&#x73&#x2f&#x43&#x61&#x6c&#x63&#x75&#x6c&#x61&#x74&#x6f&#x72&#x2e&#x61&#x70&#x70&#x27&#x29&#x3b&#x2f&#x2f '<style>')
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Joplin Web Clipper [DEV]",
"version": "2.12.0",
"version": "2.11.2",
"description": "Capture and save web pages and screenshots from your browser to Joplin.",
"homepage_url": "https://joplinapp.org",
"content_security_policy": "script-src 'self'; object-src 'self'",
@@ -34,7 +34,7 @@ import ShareFolderDialog from '../ShareFolderDialog/ShareFolderDialog';
import { ShareInvitation } from '@joplin/lib/services/share/reducer';
import removeKeylessItems from '../ResizableLayout/utils/removeKeylessItems';
import { localSyncInfoFromState } from '@joplin/lib/services/synchronizer/syncInfoUtils';
import { isCallbackUrl, parseCallbackUrl } from '@joplin/lib/callbackUrlUtils';
import { parseCallbackUrl } from '@joplin/lib/callbackUrlUtils';
import ElectronAppWrapper from '../../ElectronAppWrapper';
import { showMissingMasterKeyMessage } from '@joplin/lib/services/e2ee/utils';
import { MasterKeyEntity } from '@joplin/lib/services/e2ee/types';
@@ -173,7 +173,6 @@ class MainScreenComponent extends React.Component<Props, State> {
}
private openCallbackUrl(url: string) {
if (!isCallbackUrl(url)) throw new Error(`Invalid callback URL: ${url}`);
const { command, params } = parseCallbackUrl(url);
void CommandService.instance().execute(command.toString(), params.id);
}
@@ -26,7 +26,6 @@ import { loadScript } from '../../../utils/loadScript';
import bridge from '../../../../services/bridge';
import { TinyMceEditorEvents } from './utils/types';
import type { Editor } from 'tinymce';
import { joplinCommandToTinyMceCommands, TinyMceCommand } from './utils/joplinCommandToTinyMceCommands';
const { clipboard } = require('electron');
const supportedLocales = require('./supportedLocales');
@@ -79,6 +78,23 @@ function stripMarkup(markupLanguage: number, markup: string, options: any = null
return markupToHtml_.stripMarkup(markupLanguage, markup, options);
}
interface TinyMceCommand {
name: string;
value?: any;
ui?: boolean;
}
interface JoplinCommandToTinyMceCommands {
[key: string]: TinyMceCommand;
}
const joplinCommandToTinyMceCommands: JoplinCommandToTinyMceCommands = {
'textBold': { name: 'mceToggleFormat', value: 'bold' },
'textItalic': { name: 'mceToggleFormat', value: 'italic' },
'textLink': { name: 'mceLink' },
'search': { name: 'SearchReplace' },
};
interface LastOnChangeEventInfo {
content: string;
resourceInfos: ResourceInfos;
@@ -258,17 +274,11 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
return false;
}
if (joplinCommandToTinyMceCommands[cmd.name] === true) {
// Already handled in useWindowCommandHandlers.ts
} else if (joplinCommandToTinyMceCommands[cmd.name] === false) {
// Explicitely not supported
} else {
const tinyMceCmd: TinyMceCommand = { ...(joplinCommandToTinyMceCommands[cmd.name] as TinyMceCommand) };
if (!('ui' in tinyMceCmd)) tinyMceCmd.ui = false;
if (!('value' in tinyMceCmd)) tinyMceCmd.value = null;
const tinyMceCmd: TinyMceCommand = { ...joplinCommandToTinyMceCommands[cmd.name] };
if (!('ui' in tinyMceCmd)) tinyMceCmd.ui = false;
if (!('value' in tinyMceCmd)) tinyMceCmd.value = null;
editor.execCommand(tinyMceCmd.name, tinyMceCmd.ui, tinyMceCmd.value);
}
editor.execCommand(tinyMceCmd.name, tinyMceCmd.ui, tinyMceCmd.value);
return true;
},
@@ -593,15 +603,11 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
joplinSup: { inline: 'sup', remove: 'all' },
},
setup: (editor: Editor) => {
editor.addCommand('joplinAttach', () => {
insertResourcesIntoContentRef.current();
});
editor.ui.registry.addButton('joplinAttach', {
tooltip: _('Attach file'),
icon: 'paperclip',
onAction: async function() {
editor.execCommand('joplinAttach');
insertResourcesIntoContentRef.current();
},
});
@@ -1106,12 +1112,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
}
function onPasteAsText() {
// clipboard.readText returns Markdown instead of text when copying content from
// the Rich Text Editor. When the user "Paste as text" he does not expect to see
// anything besides text, that is why we are stripping here before pasting
// https://github.com/laurent22/joplin/pull/8351
const clipboardWithoutMarkdown = stripMarkup(MarkupToHtml.MARKUP_LANGUAGE_MARKDOWN, clipboard.readText());
pasteAsPlainText(clipboardWithoutMarkdown);
pasteAsPlainText(null);
}
editor.on(TinyMceEditorEvents.KeyUp, onKeyUp);
@@ -1,22 +0,0 @@
export interface TinyMceCommand {
name: string;
value?: any;
ui?: boolean;
}
interface JoplinCommandToTinyMceCommands {
[key: string]: TinyMceCommand | boolean;
}
// If the mapping is simply `true` it means that the command is supported via
// useWindowCommandHandlers.ts. We still add it here to have the complete list
// of supported commands.
export const joplinCommandToTinyMceCommands: JoplinCommandToTinyMceCommands = {
'textBold': { name: 'mceToggleFormat', value: 'bold' },
'textItalic': { name: 'mceToggleFormat', value: 'italic' },
'textCode': { name: 'mceToggleFormat', value: 'code' },
'textLink': { name: 'mceLink' },
'search': { name: 'SearchReplace' },
'attachFile': { name: 'joplinAttach' },
'insertDateTime': true,
};
@@ -4,7 +4,6 @@ import editorCommandDeclarations from '../editorCommandDeclarations';
import CommandService, { CommandDeclaration, CommandRuntime, CommandContext } from '@joplin/lib/services/CommandService';
import time from '@joplin/lib/time';
import { reg } from '@joplin/lib/registry';
import { joplinCommandToTinyMceCommands } from '../NoteBody/TinyMCE/utils/joplinCommandToTinyMceCommands';
const commandsWithDependencies = [
require('../commands/showLocalSearch'),
@@ -25,8 +24,6 @@ interface HookDependencies {
}
function editorCommandRuntime(declaration: CommandDeclaration, editorRef: any, setFormNote: Function): CommandRuntime {
const markdownEditorOnly = !Object.keys(joplinCommandToTinyMceCommands).includes(declaration.name);
return {
execute: async (_context: CommandContext, ...args: any[]) => {
if (!editorRef.current) {
@@ -68,7 +65,7 @@ function editorCommandRuntime(declaration: CommandDeclaration, editorRef: any, s
// currently selected text.
//
// https://github.com/laurent22/joplin/issues/5707
enabledCondition: `(!modalDialogVisible || gotoAnythingVisible) ${markdownEditorOnly ? '&& markdownEditorPaneVisible' : ''} && oneNoteSelected && noteIsMarkdown`,
enabledCondition: '(!modalDialogVisible || gotoAnythingVisible) && markdownEditorPaneVisible && oneNoteSelected && noteIsMarkdown',
};
}
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/app-desktop",
"version": "2.12.0",
"version": "2.11.9",
"description": "Joplin for Desktop",
"main": "main.js",
"private": true,
@@ -108,7 +108,7 @@
},
"homepage": "https://github.com/laurent22/joplin#readme",
"devDependencies": {
"@joplin/tools": "~2.12",
"@joplin/tools": "~2.11",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.5.1",
"@types/node": "18.15.13",
@@ -117,6 +117,7 @@
"@types/styled-components": "5.1.26",
"electron": "19.1.4",
"electron-builder": "22.11.7",
"electron-notarize": "1.2.2",
"electron-rebuild": "3.2.9",
"glob": "8.1.0",
"gulp": "4.0.2",
@@ -133,12 +134,11 @@
"7zip-bin-win": "^2.1.1"
},
"dependencies": {
"@electron/notarize": "1.2.4",
"@electron/remote": "2.0.10",
"@electron/remote": "2.0.9",
"@fortawesome/fontawesome-free": "5.15.4",
"@joeattardi/emoji-button": "4.6.4",
"@joplin/lib": "~2.12",
"@joplin/renderer": "~2.12",
"@joplin/lib": "~2.11",
"@joplin/renderer": "~2.11",
"async-mutex": "0.4.0",
"codemirror": "5.65.9",
"color": "3.2.1",
@@ -162,7 +162,7 @@
"react": "18.2.0",
"react-datetime": "3.2.0",
"react-dom": "18.2.0",
"react-redux": "8.0.7",
"react-redux": "8.0.5",
"react-select": "5.7.3",
"react-toggle-button": "2.2.0",
"react-tooltip": "4.5.1",
@@ -171,7 +171,7 @@
"roboto-fontface": "0.10.0",
"smalltalk": "2.5.1",
"sqlite3": "5.1.6",
"styled-components": "5.3.11",
"styled-components": "5.3.10",
"styled-system": "5.1.5",
"taboverride": "4.0.3",
"tinymce": "5.10.6"
@@ -1,23 +1,14 @@
import { existsSync } from 'fs';
import { join } from 'path';
import { notarize } from '@electron/notarize';
const fs = require('fs');
const path = require('path');
const electron_notarize = require('electron-notarize');
const execCommand = require('./execCommand');
function isDesktopAppTag(tagName: string) {
function isDesktopAppTag(tagName) {
if (!tagName) return false;
return tagName[0] === 'v';
}
interface Params {
appOutDir: string;
packager: {
appInfo: {
productFilename: string;
};
};
}
export default async (params: Params) => {
module.exports = async function(params) {
if (process.platform !== 'darwin') return;
console.info('Checking if notarization should be done...');
@@ -35,8 +26,8 @@ export default async (params: Params) => {
// Same appId in electron-builder.
const appId = 'net.cozic.joplin-desktop';
const appPath = join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!existsSync(appPath)) {
const appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}
@@ -49,7 +40,7 @@ export default async (params: Params) => {
}, 60000);
try {
await notarize({
await electron_notarize.notarize({
appBundleId: appId,
appPath: appPath,
@@ -67,12 +58,7 @@ export default async (params: Params) => {
// Use this to get it:
//
// xcrun altool --list-providers -u APPLE_ID -p APPLE_ID_PASSWORD
// ascProvider: process.env.APPLE_ASC_PROVIDER,
// In our case, the team ID is the same as the legacy ASC_PROVIDER
teamId: process.env.APPLE_ASC_PROVIDER,
tool: 'notarytool',
ascProvider: process.env.APPLE_ASC_PROVIDER,
});
} catch (error) {
console.error(error);
+2 -2
View File
@@ -110,8 +110,8 @@ android {
applicationId "net.cozic.joplin"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2097716
versionName "2.12.0"
versionCode 2097712
versionName "2.11.27"
// ndk {
// abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
// }
@@ -0,0 +1,7 @@
French small model for Vosk
WER
%WER 23.95 [ 37203 / 155330, 5373 ins, 4427 del, 27403 sub ] exp/chain_a/tdnn/decode_test_cv/wer_12_0.0
%WER 19.30 [ 2975 / 15412, 683 ins, 672 del, 1620 sub ] exp/chain_a/tdnn/decode_test_mtedx/wer_10_0.0
%WER 27.25 [ 20208 / 74145, 2647 ins, 5852 del, 11709 sub ] exp/chain_a/tdnn/decode_test_podcast_reseg/wer_10_0.0
@@ -0,0 +1,8 @@
--use-energy=false
--sample-frequency=16000
--num-mel-bins=40
--num-ceps=40
--low-freq=40
--high-freq=-200
--allow-upsample=true
--allow-downsample=true
@@ -0,0 +1,10 @@
--min-active=200
--max-active=7000
--beam=13.0
--lattice-beam=4.0
--acoustic-scale=1.0
--frame-subsampling-factor=3
--endpoint.silence-phones=1:2:3:4:5:6:7:8:9:10
--endpoint.rule2.min-trailing-silence=0.5
--endpoint.rule3.min-trailing-silence=1.0
--endpoint.rule4.min-trailing-silence=2.0
@@ -0,0 +1,76 @@
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
@@ -0,0 +1,154 @@
1 nonword
2 begin
3 end
4 internal
5 singleton
6 nonword
7 begin
8 end
9 internal
10 singleton
11 begin
12 end
13 internal
14 singleton
15 begin
16 end
17 internal
18 singleton
19 begin
20 end
21 internal
22 singleton
23 begin
24 end
25 internal
26 singleton
27 begin
28 end
29 internal
30 singleton
31 begin
32 end
33 internal
34 singleton
35 begin
36 end
37 internal
38 singleton
39 begin
40 end
41 internal
42 singleton
43 begin
44 end
45 internal
46 singleton
47 begin
48 end
49 internal
50 singleton
51 begin
52 end
53 internal
54 singleton
55 begin
56 end
57 internal
58 singleton
59 begin
60 end
61 internal
62 singleton
63 begin
64 end
65 internal
66 singleton
67 begin
68 end
69 internal
70 singleton
71 begin
72 end
73 internal
74 singleton
75 begin
76 end
77 internal
78 singleton
79 begin
80 end
81 internal
82 singleton
83 begin
84 end
85 internal
86 singleton
87 begin
88 end
89 internal
90 singleton
91 begin
92 end
93 internal
94 singleton
95 begin
96 end
97 internal
98 singleton
99 begin
100 end
101 internal
102 singleton
103 begin
104 end
105 internal
106 singleton
107 begin
108 end
109 internal
110 singleton
111 begin
112 end
113 internal
114 singleton
115 begin
116 end
117 internal
118 singleton
119 begin
120 end
121 internal
122 singleton
123 begin
124 end
125 internal
126 singleton
127 begin
128 end
129 internal
130 singleton
131 begin
132 end
133 internal
134 singleton
135 begin
136 end
137 internal
138 singleton
139 begin
140 end
141 internal
142 singleton
143 begin
144 end
145 internal
146 singleton
147 begin
148 end
149 internal
150 singleton
151 begin
152 end
153 internal
154 singleton
@@ -0,0 +1,3 @@
[
1.022245e+11 -6.33291e+09 -2.480997e+09 8.290258e+09 -9.084483e+09 -8.092173e+09 -1.4735e+10 -7.041795e+09 -1.171205e+10 -2.976464e+08 -1.009425e+10 -6765179 -7.821326e+09 1.449499e+09 -6.413975e+09 -5.303802e+08 -4.998635e+09 9.521598e+07 -3.073041e+09 1.56756e+08 -1.287956e+09 1.738752e+08 -2.382392e+08 -2.716675e+07 4.404485e+08 -1.913359e+08 7.780919e+08 -4.006922e+08 7.895809e+08 -5.401082e+08 5.17605e+08 -6.227134e+08 6.58271e+08 -6.204593e+07 5.187754e+08 -4.497048e+08 4.219366e+07 -2.78742e+08 -1.797385e+07 -3.604475e+07 1.053647e+09
1.040194e+13 6.245521e+11 4.223293e+11 6.831219e+11 6.078478e+11 6.3425e+11 7.943839e+11 6.013323e+11 6.781652e+11 5.272091e+11 5.810814e+11 4.353831e+11 4.473305e+11 3.42063e+11 3.083377e+11 2.14257e+11 1.892057e+11 1.163827e+11 8.367058e+10 4.203224e+10 2.297476e+10 7.596307e+09 1.099877e+09 2.886651e+08 3.797438e+09 9.372847e+09 1.629059e+10 2.196351e+10 2.747149e+10 3.072878e+10 3.238528e+10 3.330232e+10 3.407238e+10 3.230687e+10 2.676914e+10 2.252055e+10 1.914305e+10 1.565974e+10 1.224627e+10 8.415393e+09 0 ]
@@ -0,0 +1,2 @@
--left-context=3
--right-context=3
@@ -0,0 +1 @@
1b7180e6-e500-4818-adc8-a41fe97a84ce
@@ -46,7 +46,6 @@ import { NoteEntity } from '@joplin/lib/services/database/types';
import Logger from '@joplin/lib/Logger';
import VoiceTypingDialog from '../voiceTyping/VoiceTypingDialog';
import { voskEnabled } from '../../services/voiceTyping/vosk';
import { isSupportedLanguage } from '../../services/voiceTyping/vosk.android';
const urlUtils = require('@joplin/lib/urlUtils');
// import Vosk from 'react-native-vosk';
@@ -1001,7 +1000,7 @@ class NoteScreenComponent extends BaseScreenComponent {
});
// Voice typing is enabled only for French language and on Android for now
if (voskEnabled && shim.mobilePlatform() === 'android' && isSupportedLanguage(currentLocale())) {
if (voskEnabled && shim.mobilePlatform() === 'android' && currentLocale() === 'fr_FR') {
output.push({
title: _('Voice typing...'),
onPress: () => {
@@ -1308,7 +1307,7 @@ class NoteScreenComponent extends BaseScreenComponent {
const renderVoiceTypingDialog = () => {
if (!this.state.voiceTypingDialogShown) return null;
return <VoiceTypingDialog locale={currentLocale()} onText={this.voiceTypingDialog_onText} onDismiss={this.voiceTypingDialog_onDismiss}/>;
return <VoiceTypingDialog onText={this.voiceTypingDialog_onText} onDismiss={this.voiceTypingDialog_onDismiss}/>;
};
return (
@@ -1,14 +1,12 @@
import * as React from 'react';
import { useState, useEffect, useCallback } from 'react';
import { Banner, ActivityIndicator, Modal } from 'react-native-paper';
import { _, languageName } from '@joplin/lib/locale';
import { Banner, ActivityIndicator } from 'react-native-paper';
import { _ } from '@joplin/lib/locale';
import useAsyncEffect, { AsyncEffectEvent } from '@joplin/lib/hooks/useAsyncEffect';
import { getVosk, Recorder, startRecording, Vosk } from '../../services/voiceTyping/vosk';
import { IconSource } from 'react-native-paper/lib/typescript/src/components/Icon';
import { modelIsDownloaded } from '../../services/voiceTyping/vosk.android';
interface Props {
locale: string;
onDismiss: ()=> void;
onText: (text: string)=> void;
}
@@ -18,39 +16,30 @@ enum RecorderState {
Recording = 2,
Processing = 3,
Error = 4,
Downloading = 5,
}
const useVosk = (locale: string): [Error | null, boolean, Vosk|null] => {
const useVosk = (): [Error | null, Vosk|null] => {
const [vosk, setVosk] = useState<Vosk>(null);
const [error, setError] = useState<Error>(null);
const [mustDownloadModel, setMustDownloadModel] = useState<boolean | null>(null);
useAsyncEffect(async (event: AsyncEffectEvent) => {
if (mustDownloadModel === null) return;
try {
const v = await getVosk(locale);
const v = await getVosk();
if (event.cancelled) return;
setVosk(v);
} catch (error) {
setError(error);
} finally {
setMustDownloadModel(false);
}
}, [locale, mustDownloadModel]);
}, []);
useAsyncEffect(async (_event: AsyncEffectEvent) => {
setMustDownloadModel(!(await modelIsDownloaded(locale)));
}, [locale]);
return [error, mustDownloadModel, vosk];
return [error, vosk];
};
export default (props: Props) => {
const [recorder, setRecorder] = useState<Recorder>(null);
const [recorderState, setRecorderState] = useState<RecorderState>(RecorderState.Loading);
const [voskError, mustDownloadModel, vosk] = useVosk(props.locale);
const [voskError, vosk] = useVosk();
useEffect(() => {
if (voskError) {
@@ -60,12 +49,6 @@ export default (props: Props) => {
}
}, [vosk, voskError]);
useEffect(() => {
if (mustDownloadModel) {
setRecorderState(RecorderState.Downloading);
}
}, [mustDownloadModel]);
useEffect(() => {
if (recorderState === RecorderState.Recording) {
setRecorder(startRecording(vosk, {
@@ -77,7 +60,7 @@ export default (props: Props) => {
}, [recorderState, vosk, props.onText]);
const onDismiss = useCallback(() => {
if (recorder) recorder.cleanup();
recorder.cleanup();
props.onDismiss();
}, [recorder, props.onDismiss]);
@@ -86,7 +69,6 @@ export default (props: Props) => {
[RecorderState.Loading]: () => _('Loading...'),
[RecorderState.Recording]: () => _('Please record your voice...'),
[RecorderState.Processing]: () => _('Converting speech to text...'),
[RecorderState.Downloading]: () => _('Downloading %s language files...', languageName(props.locale)),
[RecorderState.Error]: () => _('Error: %s', voskError.message),
};
@@ -98,7 +80,6 @@ export default (props: Props) => {
[RecorderState.Loading]: ({ size }: { size: number }) => <ActivityIndicator animating={true} style={{ width: size, height: size }} />,
[RecorderState.Recording]: 'microphone',
[RecorderState.Processing]: 'microphone',
[RecorderState.Downloading]: ({ size }: { size: number }) => <ActivityIndicator animating={true} style={{ width: size, height: size }} />,
[RecorderState.Error]: 'alert-circle-outline',
};
@@ -106,18 +87,16 @@ export default (props: Props) => {
};
return (
<Modal visible={true} style={{ display: 'flex', flexDirection: 'column', justifyContent: 'flex-end' }}>
<Banner
visible={true}
icon={renderIcon()}
actions={[
{
label: _('Done'),
onPress: onDismiss,
},
]}>
{`${_('Voice typing...')}\n${renderContent()}`}
</Banner>
</Modal>
<Banner
visible={true}
icon={renderIcon()}
actions={[
{
label: _('Done'),
onPress: onDismiss,
},
]}>
{`${_('Voice typing...')}\n${renderContent()}`}
</Banner>
);
};
@@ -517,13 +517,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements;
CURRENT_PROJECT_VERSION = 94;
CURRENT_PROJECT_VERSION = 92;
DEVELOPMENT_TEAM = A9BXAFS6CT;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Joplin/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 12.12.0;
MARKETING_VERSION = 12.11.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -546,12 +546,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements;
CURRENT_PROJECT_VERSION = 94;
CURRENT_PROJECT_VERSION = 92;
DEVELOPMENT_TEAM = A9BXAFS6CT;
INFOPLIST_FILE = Joplin/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 12.12.0;
MARKETING_VERSION = 12.11.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -698,14 +698,14 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 94;
CURRENT_PROJECT_VERSION = 92;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = A9BXAFS6CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ShareExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 12.12.0;
MARKETING_VERSION = 12.11.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.cozic.joplin.ShareExtension;
@@ -729,14 +729,14 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 94;
CURRENT_PROJECT_VERSION = 92;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = A9BXAFS6CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ShareExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 12.12.0;
MARKETING_VERSION = 12.11.3;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.cozic.joplin.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
+10 -24
View File
@@ -333,7 +333,7 @@ PODS:
- React-jsinspector (0.71.10)
- React-logger (0.71.10):
- glog
- react-native-alarm-notification (2.12.0):
- react-native-alarm-notification (2.11.0):
- React
- react-native-camera (4.2.1):
- React-Core
@@ -347,9 +347,9 @@ PODS:
- React-Core
- react-native-fingerprint-scanner (6.0.0):
- React
- react-native-geolocation (3.0.6):
- react-native-geolocation (2.1.0):
- React-Core
- react-native-get-random-values (1.9.0):
- react-native-get-random-values (1.8.0):
- React-Core
- react-native-image-picker (5.3.1):
- React-Core
@@ -359,7 +359,7 @@ PODS:
- React-Core
- react-native-rsa-native (2.0.5):
- React
- react-native-saf-x (2.12.0):
- react-native-saf-x (2.11.0):
- React-Core
- react-native-safe-area-context (4.5.3):
- RCT-Folly
@@ -465,7 +465,7 @@ PODS:
- React-Core
- RNCPushNotificationIOS (1.11.0):
- React-Core
- RNDateTimePicker (7.1.0):
- RNDateTimePicker (7.0.1):
- React-Core
- RNExitApp (1.1.0):
- React
@@ -483,15 +483,7 @@ PODS:
- React-Core
- RNVectorIcons (9.2.0):
- React-Core
- RNZipArchive (6.0.9):
- React-Core
- RNZipArchive/Core (= 6.0.9)
- SSZipArchive (~> 2.2)
- RNZipArchive/Core (6.0.9):
- React-Core
- SSZipArchive (~> 2.2)
- SocketRocket (0.6.0)
- SSZipArchive (2.4.3)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
@@ -585,7 +577,6 @@ DEPENDENCIES:
- RNSecureRandom (from `../node_modules/react-native-securerandom`)
- RNShare (from `../node_modules/react-native-share`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
- RNZipArchive (from `../node_modules/react-native-zip-archive`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
@@ -604,7 +595,6 @@ SPEC REPOS:
- libevent
- OpenSSL-Universal
- SocketRocket
- SSZipArchive
- YogaKit
EXTERNAL SOURCES:
@@ -734,8 +724,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-share"
RNVectorIcons:
:path: "../node_modules/react-native-vector-icons"
RNZipArchive:
:path: "../node_modules/react-native-zip-archive"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
@@ -775,17 +763,17 @@ SPEC CHECKSUMS:
React-jsiexecutor: 4bb480a183a354e4dbfb1012936b1a2bb9357de7
React-jsinspector: cdc854f8b13abd202afa54bc12578e5afb9cfae1
React-logger: ef2269b3afa6ba868da90496c3e17a4ec4f4cee0
react-native-alarm-notification: 0732f97be04975a23ba60e675bdb961a0aaf6aa6
react-native-alarm-notification: 26527410a6162d07a9dc57f4bbc62e94ff48e65d
react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f
react-native-document-picker: 69ca2094d8780cfc1e7e613894d15290fdc54bba
react-native-fingerprint-scanner: ac6656f18c8e45a7459302b84da41a44ad96dbbe
react-native-geolocation: 0f7fe8a4c2de477e278b0365cce27d089a8c5903
react-native-get-random-values: dee677497c6a740b71e5612e8dbd83e7539ed5bb
react-native-geolocation: 69f4fd37650b8e7fee91816d395e62dd16f5ab8d
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
react-native-image-picker: ec9b713e248760bfa0f879f0715391de4651a7cb
react-native-image-resizer: d9fb629a867335bdc13230ac2a58702bb8c8828f
react-native-netinfo: ccbe1085dffd16592791d550189772e13bf479e2
react-native-rsa-native: 12132eb627797529fdb1f0d22fd0f8f9678df64a
react-native-saf-x: 129cd2ddf120a1f6164c724b2846d172666b33de
react-native-saf-x: 9bd5238d3b43d76bbec64aa82c173ac20a4bce9f
react-native-safe-area-context: b8979f5eda6ed5903d4dbc885be3846ea3daa753
react-native-slider: 33b8d190b59d4f67a541061bb91775d53d617d9d
react-native-sqlite-storage: f6d515e1c446d1e6d026aa5352908a25d4de3261
@@ -807,7 +795,7 @@ SPEC CHECKSUMS:
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCPushNotificationIOS: 64218f3c776c03d7408284a819b2abfda1834bc8
RNDateTimePicker: 7ecd54a97fc3749f38c3c89a171f6cbd52f3c142
RNDateTimePicker: e073697ac3e8a378968d68ab0581fef542b8af8a
RNExitApp: c4e052df2568b43bec8a37c7cd61194d4cfee2c3
RNFileViewer: ce7ca3ac370e18554d35d6355cffd7c30437c592
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
@@ -816,9 +804,7 @@ SPEC CHECKSUMS:
RNSecureRandom: 07efbdf2cd99efe13497433668e54acd7df49fef
RNShare: d82e10f6b7677f4b0048c23709bd04098d5aee6c
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
RNZipArchive: 68a0c6db4b1c103f846f1559622050df254a3ade
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
Yoga: e7ea9e590e27460d28911403b894722354d73479
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
+12 -13
View File
@@ -2,7 +2,7 @@
"name": "@joplin/app-mobile",
"description": "Joplin for Mobile",
"license": "AGPL-3.0-or-later",
"version": "2.12.0",
"version": "2.11.0",
"private": true,
"scripts": {
"start": "BROWSERSLIST_IGNORE_OLD_DATA=true react-native start --reset-cache",
@@ -18,13 +18,13 @@
"postinstall": "jetify && yarn run build"
},
"dependencies": {
"@joplin/lib": "~2.12",
"@joplin/react-native-alarm-notification": "~2.12",
"@joplin/react-native-saf-x": "~2.12",
"@joplin/renderer": "~2.12",
"@joplin/lib": "~2.11",
"@joplin/react-native-alarm-notification": "~2.11",
"@joplin/react-native-saf-x": "~2.11",
"@joplin/renderer": "~2.11",
"@react-native-community/clipboard": "1.5.1",
"@react-native-community/datetimepicker": "7.1.0",
"@react-native-community/geolocation": "3.0.6",
"@react-native-community/datetimepicker": "7.0.1",
"@react-native-community/geolocation": "2.1.0",
"@react-native-community/netinfo": "9.3.10",
"@react-native-community/push-notification-ios": "1.11.0",
"@react-native-community/slider": "4.4.2",
@@ -50,11 +50,11 @@
"react-native-file-viewer": "2.1.5",
"react-native-fingerprint-scanner": "6.0.0",
"react-native-fs": "2.20.0",
"react-native-get-random-values": "1.9.0",
"react-native-get-random-values": "1.8.0",
"react-native-image-picker": "5.3.1",
"react-native-image-resizer": "1.4.5",
"react-native-localize": "3.0.0",
"react-native-modal-datetime-picker": "15.0.1",
"react-native-modal-datetime-picker": "14.0.1",
"react-native-paper": "5.8.0",
"react-native-popup-menu": "0.16.1",
"react-native-quick-actions": "0.3.13",
@@ -69,8 +69,7 @@
"react-native-version-info": "1.1.1",
"react-native-vosk": "0.1.12",
"react-native-webview": "12.4.0",
"react-native-zip-archive": "6.0.9",
"react-redux": "8.0.7",
"react-redux": "7.2.9",
"redux": "4.2.1",
"rn-fetch-blob": "0.12.0",
"stream": "0.0.2",
@@ -96,7 +95,7 @@
"@codemirror/search": "6.3.0",
"@codemirror/state": "6.2.0",
"@codemirror/view": "6.9.3",
"@joplin/tools": "~2.12",
"@joplin/tools": "~2.11",
"@lezer/highlight": "1.1.4",
"@tsconfig/react-native": "2.0.2",
"@types/fs-extra": "11.0.1",
@@ -117,7 +116,7 @@
"metro-react-native-babel-preset": "0.73.9",
"nodemon": "2.0.22",
"ts-jest": "29.1.0",
"ts-loader": "9.4.3",
"ts-loader": "9.4.2",
"ts-node": "10.9.1",
"typescript": "5.0.2",
"uglify-js": "3.17.4",
@@ -1,25 +1,17 @@
import { languageCodeOnly } from '@joplin/lib/locale';
import Logger from '@joplin/lib/Logger';
import shim from '@joplin/lib/shim';
import Vosk from 'react-native-vosk';
import { unzip } from 'react-native-zip-archive';
import RNFetchBlob from 'rn-fetch-blob';
const md5 = require('md5');
const logger = Logger.create('voiceTyping/vosk');
enum State {
Idle = 0,
Recording,
Completing,
}
interface StartOptions {
onResult: (text: string)=> void;
}
let vosk_: Record<string, Vosk> = {};
let vosk_: Vosk|null = null;
let state_: State = State.Idle;
export const voskEnabled = true;
@@ -31,113 +23,12 @@ export interface Recorder {
cleanup: ()=> void;
}
const supportedLanguages = {
'en': 'https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip',
'cn': 'https://alphacephei.com/vosk/models/vosk-model-small-cn-0.22.zip',
'ru': 'https://alphacephei.com/vosk/models/vosk-model-small-ru-0.22.zip',
'fr': 'https://alphacephei.com/vosk/models/vosk-model-small-fr-0.22.zip',
'de': 'https://alphacephei.com/vosk/models/vosk-model-small-de-0.15.zip',
'es': 'https://alphacephei.com/vosk/models/vosk-model-small-es-0.42.zip',
'pt': 'https://alphacephei.com/vosk/models/vosk-model-small-pt-0.3.zip',
'tr': 'https://alphacephei.com/vosk/models/vosk-model-small-tr-0.3.zip',
'vn': 'https://alphacephei.com/vosk/models/vosk-model-small-vn-0.4.zip',
'it': 'https://alphacephei.com/vosk/models/vosk-model-small-it-0.22.zip',
'nl': 'https://alphacephei.com/vosk/models/vosk-model-small-nl-0.22.zip',
'uk': 'https://alphacephei.com/vosk/models/vosk-model-small-uk-v3-small.zip',
'ja': 'https://alphacephei.com/vosk/models/vosk-model-small-ja-0.22.zip',
'hi': 'https://alphacephei.com/vosk/models/vosk-model-small-hi-0.22.zip',
'cs': 'https://alphacephei.com/vosk/models/vosk-model-small-cs-0.4-rhasspy.zip',
'pl': 'https://alphacephei.com/vosk/models/vosk-model-small-pl-0.22.zip',
'uz': 'https://alphacephei.com/vosk/models/vosk-model-small-uz-0.22.zip',
'ko': 'https://alphacephei.com/vosk/models/vosk-model-small-ko-0.22.zip',
};
export const isSupportedLanguage = (locale: string) => {
const l = languageCodeOnly(locale).toLowerCase();
return Object.keys(supportedLanguages).includes(l);
};
// Where all the models files for all the languages are
const getModelRootDir = () => {
return `${RNFetchBlob.fs.dirs.DocumentDir}/vosk-models`;
};
// Where we unzip a model after downloading it
const getUnzipDir = (locale: string) => {
return `${getModelRootDir()}/${locale}`;
};
// Where the model for a particular language is
const getModelDir = (locale: string) => {
return `${getUnzipDir(locale)}/model`;
};
const languageModelUrl = (locale: string) => {
const l = languageCodeOnly(locale).toLowerCase();
if (!(l in supportedLanguages)) throw new Error(`No language file for: ${locale}`);
return (supportedLanguages as any)[l];
};
export const modelIsDownloaded = async (locale: string) => {
const uuidFile = `${getModelDir(locale)}/uuid`;
return shim.fsDriver().exists(uuidFile);
};
export const getVosk = async (locale: string) => {
if (vosk_[locale]) return vosk_[locale];
const vosk = new Vosk();
const modelDir = await downloadModel(locale);
logger.info(`Loading model from ${modelDir}`);
await shim.fsDriver().readDirStats(modelDir);
const result = await vosk.loadModel(modelDir);
export const getVosk = async () => {
if (vosk_) return vosk_;
vosk_ = new Vosk();
const result = await vosk_.loadModel('model-fr-fr');
logger.info('getVosk:', result);
vosk_ = { [locale]: vosk };
return vosk;
};
const downloadModel = async (locale: string) => {
const modelUrl = languageModelUrl(locale);
const unzipDir = getUnzipDir(locale);
const zipFilePath = `${unzipDir}.zip`;
const modelDir = getModelDir(locale);
const uuidFile = `${modelDir}/uuid`;
if (await modelIsDownloaded(locale)) {
logger.info(`Model for ${locale} already exists at ${modelDir}`);
return modelDir;
}
await shim.fsDriver().remove(unzipDir);
logger.info(`Downloading model from: ${modelUrl}`);
await shim.fetchBlob(languageModelUrl(locale), {
path: zipFilePath,
});
logger.info(`Unzipping ${zipFilePath} => ${unzipDir}`);
await unzip(zipFilePath, unzipDir);
const dirs = await shim.fsDriver().readDirStats(unzipDir);
if (dirs.length !== 1) {
logger.error('Expected 1 directory but got', dirs);
throw new Error(`Expected 1 directory, but got ${dirs.length}`);
}
const fullUnzipPath = `${unzipDir}/${dirs[0].path}`;
logger.info(`Moving ${fullUnzipPath} => ${modelDir}`);
await shim.fsDriver().rename(fullUnzipPath, modelDir);
await shim.fsDriver().writeFile(uuidFile, md5(modelUrl));
await shim.fsDriver().remove(zipFilePath);
return modelDir;
return vosk_;
};
export const startRecording = (vosk: Vosk, options: StartOptions): Recorder => {
@@ -219,9 +110,8 @@ export const startRecording = (vosk: Vosk, options: StartOptions): Recorder => {
});
},
cleanup: () => {
if (state_ === State.Recording) {
if (state_ !== State.Idle) {
logger.info('Cancelling...');
state_ = State.Completing;
vosk.stopOnly();
completeRecording('', null);
}
@@ -13,15 +13,7 @@ export interface Recorder {
cleanup: ()=> void;
}
export const isSupportedLanguage = (_locale: string) => {
return false;
};
export const modelIsDownloaded = async (_locale: string) => {
return false;
};
export const getVosk = async (_locale: string) => {
export const getVosk = async () => {
return {} as any;
};
@@ -116,13 +116,6 @@ export default class FsDriverRN extends FsDriverBase {
return RNFS.moveFile(source, dest);
}
public async rename(source: string, dest: string) {
if (isScopedUri(source) || isScopedUri(dest)) {
await RNSAF.rename(source, dest);
}
return RNFS.moveFile(source, dest);
}
public async exists(path: string) {
if (isScopedUri(path)) {
return RNSAF.exists(path);
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@joplin/fork-htmlparser2",
"description": "Fast & forgiving HTML/XML/RSS parser",
"version": "4.1.44",
"version": "4.1.43",
"author": "Felix Boehm <me@feedic.com>",
"publishConfig": {
"access": "public"
@@ -40,7 +40,7 @@
},
"dependencies": {
"domelementtype": "2.3.0",
"domhandler": "5.0.3",
"domhandler": "3.3.0",
"domutils": "3.1.0",
"entities": "2.2.0"
},
+2 -2
View File
@@ -2,7 +2,7 @@
"name": "@joplin/fork-sax",
"description": "An evented streaming XML parser in JavaScript",
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"version": "1.2.48",
"version": "1.2.47",
"main": "lib/sax.js",
"publishConfig": {
"access": "public"
@@ -16,7 +16,7 @@
],
"devDependencies": {
"standard": "17.0.0",
"tap": "16.3.6"
"tap": "16.3.4"
},
"gitHead": "eb4b0e64eab40a51b0895d3a40a9d8c3cb7b1b14"
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/fork-uslug",
"version": "1.0.9",
"version": "1.0.8",
"description": "A permissive slug generator that works with unicode.",
"author": "Jeremy Selier <jerem.selier@gmail.com>",
"publishConfig": {
-3
View File
@@ -1,3 +0,0 @@
# generate-plugin-doc
This package is only to run the buildPluginDoc command. The version of typedoc we use needs an old version of typescript, so we cannot put the whole thing at the root, where it used to be.
-11
View File
@@ -1,11 +0,0 @@
{
"name": "generate-plugin-doc",
"packageManager": "yarn@3.3.1",
"scripts": {
"buildPluginDoc_": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme '../../Assets/PluginDocTheme/' --readme '../../Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out ../../../joplin-website/docs/api/references/plugin_api ../lib/services/plugins/api/"
},
"dependencies": {
"typedoc": "0.17.8",
"typescript": "4.7.4"
}
}
+65 -2
View File
@@ -1,8 +1,71 @@
# generator-joplin
This is the Yeoman generator used to create a Joplin plugin.
Scaffolds out a new Joplin plugin
More info in the [Plugin Generator Doc](./generators/app/templates/GENERATOR_DOC.md)
## Installation
First, install [Yeoman](http://yeoman.io) and generator-joplin using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
```bash
npm install -g yo
npm install -g generator-joplin
```
Then generate your new project:
```bash
yo joplin
```
## Development
To test the generator for development purposes, follow the instructions there: https://yeoman.io/authoring/#running-the-generator
This is a template to create a new Joplin plugin.
## Structure
The main two files you will want to look at are:
- `/src/index.ts`, which contains the entry point for the plugin source code.
- `/src/manifest.json`, which is the plugin manifest. It contains information such as the plugin a name, version, etc.
The file `/plugin.config.json` could also be useful if you intend to use [external scripts](#external-script-files), such as content scripts or webview scripts.
## Building the plugin
The plugin is built using Webpack, which creates the compiled code in `/dist`. A JPL archive will also be created at the root, which can use to distribute the plugin.
To build the plugin, simply run `npm run dist`.
The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.
## Publishing the plugin
To publish the plugin, add it to npmjs.com by running `npm publish`. Later on, a script will pick up your plugin and add it automatically to the Joplin plugin repository as long as the package satisfies these conditions:
- In `package.json`, the name starts with "joplin-plugin-". For example, "joplin-plugin-toc".
- In `package.json`, the keywords include "joplin-plugin".
- In the `publish/` directory, there should be a .jpl and .json file (which are built by `npm run dist`)
In general all this is done automatically by the plugin generator, which will set the name and keywords of package.json, and will put the right files in the "publish" directory. But if something doesn't work and your plugin doesn't appear in the repository, double-check the above conditions.
## Updating the plugin framework
To update the plugin framework, run `npm run update`.
In general this command tries to do the right thing - in particular it's going to merge the changes in package.json and .gitignore instead of overwriting. It will also leave "/src" as well as README.md untouched.
The file that may cause problem is "webpack.config.js" because it's going to be overwritten. For that reason, if you want to change it, consider creating a separate JavaScript file and include it in webpack.config.js. That way, when you update, you only have to restore the line that include your file.
## External script files
By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases:
- The script is a TypeScript file - in which case it has to be compiled to JavaScript.
- The script requires modules you've added to package.json. In that case, the script, whether JS or TS, must be compiled so that the dependencies are bundled with the JPL file.
To get such an external script file to compile, you need to add it to the `extraScripts` array in `plugin.config.json`. The path you add should be relative to /src. For example, if you have a file in "/src/webviews/index.ts", the path should be set to "webviews/index.ts". Once compiled, the file will always be named with a .js extension. So you will get "webviews/index.js" in the plugin package, and that's the path you should use to reference the file.
## License
@@ -12,12 +12,7 @@ module.exports = class extends Generator {
this.option('silent');
this.option('update');
// This appears to be deprecated and undocumented
// Maybe need this instead?
// https://github.com/yeoman/generator/issues/1294#issuecomment-841668595
// this.option('nodePackageManager', 'npm');
this.option('nodePackageManager', 'npm');
if (this.options.update) {
// When updating, overwrite files without prompting
@@ -14,7 +14,7 @@ npm install -g generator-joplin
Then generate your new project:
```bash
yo --node-package-manager npm joplin
yo joplin
```
## Development
@@ -39,10 +39,6 @@ To build the plugin, simply run `npm run dist`.
The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.
## Updating the manifest version number
You can run `npm run updateVersion` to bump the patch part of the version number, so for example 1.0.3 will become 1.0.4. This script will update both the package.json and manifest.json version numbers so as to keep them in sync.
## Publishing the plugin
To publish the plugin, add it to npmjs.com by running `npm publish`. Later on, a script will pick up your plugin and add it automatically to the Joplin plugin repository as long as the package satisfies these conditions:
@@ -71,13 +67,6 @@ By default, the compiler (webpack) is going to compile `src/index.ts` only (as w
To get such an external script file to compile, you need to add it to the `extraScripts` array in `plugin.config.json`. The path you add should be relative to /src. For example, if you have a file in "/src/webviews/index.ts", the path should be set to "webviews/index.ts". Once compiled, the file will always be named with a .js extension. So you will get "webviews/index.js" in the plugin package, and that's the path you should use to reference the file.
## More information
- [Joplin Plugin API](https://joplinapp.org/api/references/plugin_api/classes/joplin.html)
- [Joplin Data API](https://joplinapp.org/api/references/rest_api/)
- [Joplin Plugin Manifest](https://joplinapp.org/api/references/plugin_manifest/)
- Ask for help on the [forum](https://discourse.joplinapp.org/) or our [Discord channel](https://discord.gg/VSj7AFHvpq)
## License
MIT © Laurent Cozic
@@ -1,5 +1,24 @@
# Joplin Plugin
This is your new Joplin plugin. It is suggested that you use this README file to document your plugin.
This is a template to create a new Joplin plugin.
For information on how to build or publish the plugin, please see [GENERATOR_DOC.md](./GENERATOR_DOC.md)
The main two files you will want to look at are:
- `/src/index.ts`, which contains the entry point for the plugin source code.
- `/src/manifest.json`, which is the plugin manifest. It contains information such as the plugin a name, version, etc.
## Building the plugin
The plugin is built using Webpack, which creates the compiled code in `/dist`. A JPL archive will also be created at the root, which can use to distribute the plugin.
To build the plugin, simply run `npm run dist`.
The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.
## Updating the plugin framework
To update the plugin framework, run `npm run update`.
In general this command tries to do the right thing - in particular it's going to merge the changes in package.json and .gitignore instead of overwriting. It will also leave "/src" as well as README.md untouched.
The file that may cause problem is "webpack.config.js" because it's going to be overwritten. For that reason, if you want to change it, consider creating a separate JavaScript file and include it in webpack.config.js. That way, when you update, you only have to restore the line that include your file.
@@ -4,8 +4,7 @@
"scripts": {
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
"prepare": "npm run dist",
"updateVersion": "webpack --env joplin-plugin-config=updateVersion",
"update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update"
"update": "npm install -g generator-joplin && yo joplin --update"
},
"license": "MIT",
"keywords": [
@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"id": "<%= pluginId %>",
"app_min_version": "2.12",
"app_min_version": "2.11",
"version": "1.0.0",
"name": "<%= pluginName %>",
"description": "<%= pluginDescription %>",
@@ -44,12 +44,8 @@ for (const moduleName of builtinModules) {
moduleFallback[moduleName] = false;
}
const getPackageJson = () => {
return JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
};
function validatePackageJson() {
const content = getPackageJson();
const content = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
if (!content.name || content.name.indexOf('joplin-plugin-') !== 0) {
console.warn(chalk.yellow(`WARNING: To publish the plugin, the package name should start with "joplin-plugin-" (found "${content.name}") in ${packageJsonPath}`));
}
@@ -106,6 +102,7 @@ function validateScreenshots(screenshots) {
});
}
function readManifest(manifestPath) {
const content = fs.readFileSync(manifestPath, 'utf8');
const output = JSON.parse(content);
@@ -136,16 +133,12 @@ function createPluginArchive(sourceDir, destPath) {
console.info(chalk.cyan(`Plugin archive has been created in ${destPath}`));
}
const writeManifest = (manifestPath, content) => {
fs.writeFileSync(manifestPath, JSON.stringify(content, null, '\t'), 'utf8');
};
function createPluginInfo(manifestPath, destPath, jplFilePath) {
const contentText = fs.readFileSync(manifestPath, 'utf8');
const content = JSON.parse(contentText);
content._publish_hash = `sha256:${fileSha256(jplFilePath)}`;
content._publish_commit = currentGitInfo();
writeManifest(destPath, content);
fs.writeFileSync(destPath, JSON.stringify(content, null, '\t'), 'utf8');
}
function onBuildCompleted() {
@@ -269,32 +262,6 @@ function buildExtraScriptConfigs(userConfig) {
return output;
}
const increaseVersion = version => {
try {
const s = version.split('.');
const d = Number(s[s.length - 1]) + 1;
s[s.length - 1] = `${d}`;
return s.join('.');
} catch (error) {
error.message = `Could not parse version number: ${version}: ${error.message}`;
throw error;
}
};
const updateVersion = () => {
const packageJson = getPackageJson();
packageJson.version = increaseVersion(packageJson.version);
fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, 'utf8');
const manifest = readManifest(manifestPath);
manifest.version = increaseVersion(manifest.version);
writeManifest(manifestPath, manifest);
if (packageJson.version !== manifest.version) {
console.warn(chalk.yellow(`Version numbers have been updated but they do not match: package.json (${packageJson.version}), manifest.json (${manifest.version}). Set them to the required values to get them in sync.`));
}
};
function main(environ) {
const configName = environ['joplin-plugin-config'];
if (!configName) throw new Error('A config file must be specified via the --joplin-plugin-config flag');
@@ -331,11 +298,6 @@ function main(environ) {
fs.mkdirpSync(publishDir);
}
if (configName === 'updateVersion') {
updateVersion();
return [];
}
return configs[configName];
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "generator-joplin",
"version": "2.12.1",
"version": "2.11.0",
"description": "Scaffolds out a new Joplin plugin",
"homepage": "https://github.com/laurent22/joplin/tree/dev/packages/generator-joplin",
"author": {
@@ -34,4 +34,4 @@
"repository": "https://github.com/laurent22/generator-joplin",
"license": "AGPL-3.0-or-later",
"private": true
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/htmlpack",
"version": "2.12.0",
"version": "2.11.0",
"description": "Pack an HTML file and all its linked resources into a single HTML file",
"main": "dist/index.js",
"types": "src/index.ts",
@@ -14,7 +14,7 @@
"author": "Laurent Cozic",
"license": "MIT",
"dependencies": {
"@joplin/fork-htmlparser2": "^4.1.44",
"@joplin/fork-htmlparser2": "^4.1.43",
"css": "3.0.0",
"datauri": "4.1.0",
"fs-extra": "11.1.1",
+1 -2
View File
@@ -3,14 +3,13 @@ import * as callbackUrlUtils from './callbackUrlUtils';
describe('callbackUrlUtils', () => {
it('should identify valid callback urls', () => {
const url = 'joplin://x-callback-url/openFolder?a=b';
const url = 'joplin://x-callback-url/123?a=b';
expect(callbackUrlUtils.isCallbackUrl(url)).toBe(true);
});
it('should identify invalid callback urls', () => {
expect(callbackUrlUtils.isCallbackUrl('not-joplin://x-callback-url/123?a=b')).toBe(false);
expect(callbackUrlUtils.isCallbackUrl('joplin://xcallbackurl/123?a=b')).toBe(false);
expect(callbackUrlUtils.isCallbackUrl('joplin://x-callback-url/invalidCommand?a=b')).toBe(false);
});
it('should build valid note callback urls', () => {
+1 -3
View File
@@ -1,9 +1,7 @@
const URL = require('url-parse');
export function isCallbackUrl(s: string) {
return s.startsWith('joplin://x-callback-url/openNote?') ||
s.startsWith('joplin://x-callback-url/openFolder?') ||
s.startsWith('joplin://x-callback-url/openTag?');
return s.startsWith('joplin://x-callback-url/');
}
export function getNoteCallbackUrl(noteId: string) {
+2 -3
View File
@@ -508,8 +508,7 @@ function languageNameInEnglish(languageCode: string) {
return codeToLanguageE_[languageCode] ? codeToLanguageE_[languageCode] : '';
}
function languageName(canonicalName: string, defaultToEnglish: boolean = true) {
const languageCode = languageCodeOnly(canonicalName);
function languageName(languageCode: string, defaultToEnglish: boolean = true) {
if (codeToLanguage_[languageCode]) return codeToLanguage_[languageCode];
if (defaultToEnglish) return languageNameInEnglish(languageCode);
return '';
@@ -604,4 +603,4 @@ const stringByLocale = (locale: string, s: string, ...args: any[]): string => {
}
};
export { _, _n, supportedLocales, languageName, currentLocale, localesFromLanguageCode, languageCodeOnly, countryDisplayName, localeStrings, setLocale, supportedLocalesToLanguages, defaultLocale, closestSupportedLocale, languageCode, countryCodeOnly };
export { _, _n, supportedLocales, currentLocale, localesFromLanguageCode, languageCodeOnly, countryDisplayName, localeStrings, setLocale, supportedLocalesToLanguages, defaultLocale, closestSupportedLocale, languageCode, countryCodeOnly };
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/lib",
"version": "2.12.0",
"version": "2.11.0",
"description": "Joplin Core library",
"author": "Laurent Cozic",
"homepage": "",
@@ -31,14 +31,14 @@
"dependencies": {
"@aws-sdk/client-s3": "3.296.0",
"@aws-sdk/s3-request-presigner": "3.296.0",
"@joplin/fork-htmlparser2": "^4.1.44",
"@joplin/fork-sax": "^1.2.48",
"@joplin/fork-uslug": "^1.0.9",
"@joplin/htmlpack": "~2.12",
"@joplin/renderer": "~2.12",
"@joplin/turndown": "^4.0.66",
"@joplin/turndown-plugin-gfm": "^1.0.48",
"@joplin/utils": "~2.12",
"@joplin/fork-htmlparser2": "^4.1.43",
"@joplin/fork-sax": "^1.2.47",
"@joplin/fork-uslug": "^1.0.8",
"@joplin/htmlpack": "~2.11",
"@joplin/renderer": "~2.11",
"@joplin/turndown": "^4.0.65",
"@joplin/turndown-plugin-gfm": "^1.0.47",
"@joplin/utils": "~2.11",
"@types/nanoid": "3.0.0",
"async-mutex": "0.4.0",
"base-64": "1.0.0",
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/pdf-viewer",
"version": "2.12.0",
"version": "2.11.0",
"description": "Provides embedded PDF viewers for Joplin",
"main": "dist/main.js",
"types": "src/main.ts",
@@ -30,7 +30,7 @@
"jest-environment-jsdom": "29.5.0",
"style-loader": "3.3.3",
"ts-jest": "29.1.0",
"ts-loader": "9.4.3",
"ts-loader": "9.4.2",
"typescript": "5.0.2",
"webpack": "5.74.0",
"webpack-cli": "4.10.0"
@@ -39,11 +39,11 @@
"@fortawesome/fontawesome-svg-core": "6.1.2",
"@fortawesome/free-solid-svg-icons": "6.1.2",
"@fortawesome/react-fontawesome": "0.2.0",
"@joplin/lib": "~2.12",
"@joplin/lib": "~2.11",
"async-mutex": "0.4.0",
"pdfjs-dist": "2.16.105",
"react": "18.2.0",
"react-dom": "18.2.0",
"styled-components": "5.3.11"
"styled-components": "5.3.10"
}
}
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/plugin-repo-cli",
"version": "2.12.0",
"version": "2.11.0",
"description": "",
"main": "index.js",
"bin": "./dist/index.js",
@@ -18,9 +18,9 @@
"author": "",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@joplin/lib": "~2.12",
"@joplin/tools": "~2.12",
"@joplin/utils": "~2.12",
"@joplin/lib": "~2.11",
"@joplin/tools": "~2.11",
"@joplin/utils": "~2.11",
"fs-extra": "11.1.1",
"gh-release-assets": "2.0.1",
"node-fetch": "2.6.7",
@@ -1,7 +1,7 @@
{
"name": "@joplin/react-native-alarm-notification",
"title": "React Native Alarm Notification for Joplin. Forked from https://github.com/emekalites/react-native-alarm-notification",
"version": "2.12.0",
"version": "2.11.0",
"description": "schedule alarm with notification in react-native",
"main": "index.js",
"private": true,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/react-native-saf-x",
"version": "2.12.0",
"version": "2.11.0",
"description": "a module to help work with scoped storages on android easily",
"main": "src/index",
"react-native": "src/index",
@@ -5,7 +5,7 @@ describe('linkReplacement', () => {
test('should handle non-resource links', () => {
const r = linkReplacement('https://example.com/test').html;
expect(r).toBe('<a data-from-md href=\'https://example.com/test\' onclick=\'postMessage(&quot;https://example.com/test&quot;, { resourceId: &quot;&quot; }); return false;\'>');
expect(r).toBe('<a data-from-md href=\'https://example.com/test\' onclick=\'postMessage("https://example.com/test", { resourceId: "" }); return false;\'>');
});
test('should handle non-resource links - simple rendering', () => {
@@ -17,7 +17,7 @@ describe('linkReplacement', () => {
// Handles a link such as:
// [Google](https://www.goo'onclick=javascript:alert(/1/);f=')
const r = linkReplacement('https://www.goo\'onclick=javascript:alert(/1/);f=\'', { linkRenderingType: 1 }).html;
expect(r).toBe('<a data-from-md href=\'https://www.goo&apos;onclick=javascript:alert(/1/);f=&apos;\' onclick=\'postMessage(&quot;https://www.goo%27onclick=javascript:alert(/1/);f=%27&quot;, { resourceId: &quot;&quot; }); return false;\'>');
expect(r).toBe('<a data-from-md href=\'https://www.goo&apos;onclick=javascript:alert(/1/);f=&apos;\' onclick=\'postMessage("https://www.goo%27onclick=javascript:alert(/1/);f=%27", { resourceId: "" }); return false;\'>');
});
test('should handle resource links - downloaded status', () => {
@@ -35,7 +35,7 @@ describe('linkReplacement', () => {
},
}).html;
expect(r).toBe(`<a data-from-md data-resource-id='${resourceId}' href='#' onclick='postMessage(&quot;joplin://${resourceId}&quot;, { resourceId: &quot;${resourceId}&quot; }); return false;'><span class="resource-icon fa-joplin"></span>`);
expect(r).toBe(`<a data-from-md data-resource-id='${resourceId}' href='#' onclick='postMessage("joplin://${resourceId}", { resourceId: "${resourceId}" }); return false;'><span class="resource-icon fa-joplin"></span>`);
});
test('should handle resource links - idle status', () => {
@@ -99,7 +99,7 @@ export default function(href: string, options: Options = null): LinkReplacementR
postMessageSyntax: options.postMessageSyntax ?? 'void',
}, onClick);
} else {
js = `onclick='${htmlentities(js)}'`;
js = `onclick='${js}'`;
}
if (hrefAttr.indexOf('#') === 0 && href.indexOf('#') === 0) js = ''; // If it's an internal anchor, don't add any JS since the webview is going to handle navigating to the right place
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/renderer",
"version": "2.12.0",
"version": "2.11.0",
"description": "The Joplin note renderer, used the mobile and desktop application",
"repository": "https://github.com/laurent22/joplin/tree/dev/packages/renderer",
"main": "index.js",
@@ -26,8 +26,8 @@
"typescript": "5.0.2"
},
"dependencies": {
"@joplin/fork-htmlparser2": "^4.1.44",
"@joplin/fork-uslug": "^1.0.9",
"@joplin/fork-htmlparser2": "^4.1.43",
"@joplin/fork-uslug": "^1.0.8",
"font-awesome-filetypes": "2.1.0",
"fs-extra": "11.1.1",
"highlight.js": "11.8.0",
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@joplin/server",
"version": "2.12.0",
"version": "2.11.1",
"private": true,
"scripts": {
"start-dev": "yarn run build && JOPLIN_IS_TESTING=1 nodemon --config nodemon.json --ext ts,js,mustache,css,tsx dist/app.js --env dev",
@@ -23,19 +23,19 @@
"dependencies": {
"@aws-sdk/client-s3": "3.296.0",
"@fortawesome/fontawesome-free": "5.15.4",
"@joplin/lib": "~2.12",
"@joplin/renderer": "~2.12",
"@koa/cors": "3.4.3",
"@joplin/lib": "~2.11",
"@joplin/renderer": "~2.11",
"@koa/cors": "3.1.0",
"@types/uuid": "9.0.1",
"bcryptjs": "2.4.3",
"bulma": "0.9.4",
"bulma-prefers-dark": "0.1.0-beta.1",
"compare-versions": "3.6.0",
"dayjs": "1.11.8",
"formidable": "2.1.2",
"dayjs": "1.11.7",
"formidable": "2.1.1",
"fs-extra": "11.1.1",
"html-entities": "1.4.0",
"jquery": "3.7.0",
"jquery": "3.6.4",
"knex": "2.4.2",
"koa": "2.14.2",
"markdown-it": "13.0.1",
@@ -43,9 +43,9 @@
"nanoid": "2.1.11",
"node-cron": "3.0.2",
"node-env-file": "0.1.8",
"nodemailer": "6.9.3",
"nodemailer": "6.9.2",
"nodemon": "2.0.22",
"pg": "8.11.0",
"pg": "8.10.0",
"pretty-bytes": "5.6.0",
"prettycron": "0.10.0",
"query-string": "7.1.3",
@@ -58,7 +58,7 @@
"zxcvbn": "4.4.2"
},
"devDependencies": {
"@joplin/tools": "~2.12",
"@joplin/tools": "~2.11",
"@rmp135/sql-ts": "1.16.0",
"@types/formidable": "2.0.6",
"@types/fs-extra": "11.0.1",
@@ -3,7 +3,7 @@ import { DbConnection, defaultAdminEmail, defaultAdminPassword } from '../db';
import { hashPassword } from '../utils/auth';
import uuidgen from '../utils/uuidgen';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('users', (table: Knex.CreateTableBuilder) => {
table.string('id', 32).unique().primary().notNullable();
table.text('email', 'mediumtext').unique().notNullable();
@@ -123,13 +123,13 @@ export const up = async (db: DbConnection) => {
updated_time: now,
created_time: now,
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('users');
await db.schema.dropTable('sessions');
await db.schema.dropTable('permissions');
await db.schema.dropTable('files');
await db.schema.dropTable('api_clients');
await db.schema.dropTable('changes');
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('notifications', (table: Knex.CreateTableBuilder) => {
table.string('id', 32).unique().primary().notNullable();
table.string('owner_id', 32).notNullable();
@@ -17,8 +17,8 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('notifications', (table: Knex.CreateTableBuilder) => {
table.unique(['owner_id', 'key']);
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('notifications');
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('shares', (table: Knex.CreateTableBuilder) => {
table.string('id', 32).unique().primary().notNullable();
table.string('owner_id', 32).notNullable();
@@ -10,8 +10,8 @@ export const up = async (db: DbConnection) => {
table.bigInteger('updated_time').notNullable();
table.bigInteger('created_time').notNullable();
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('shares');
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('share_users', (table: Knex.CreateTableBuilder) => {
table.string('id', 32).unique().primary().notNullable();
table.string('share_id', 32).notNullable();
@@ -38,8 +38,8 @@ export const up = async (db: DbConnection) => {
table.bigInteger('updated_time').notNullable();
table.bigInteger('created_time').notNullable();
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('share_users');
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('joplin_file_contents', (table: Knex.CreateTableBuilder) => {
table.string('id', 32).unique().primary().notNullable();
table.string('owner_id', 32).notNullable();
@@ -18,8 +18,8 @@ export const up = async (db: DbConnection) => {
table.integer('content_type', 2).defaultTo(1).notNullable();
table.string('content_id', 32).defaultTo('').notNullable();
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('joplin_file_contents');
};
}
@@ -1,13 +1,13 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('shares', (table: Knex.CreateTableBuilder) => {
table.string('folder_id', 32).defaultTo('').notNullable();
table.integer('is_auto', 1).defaultTo(0).notNullable();
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('joplin_items');
};
}
@@ -25,7 +25,7 @@ import { DbConnection } from '../db';
// is_shared: 1
// type_: 1`;
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('items', (table: Knex.CreateTableBuilder) => {
table.string('id', 32).unique().primary().notNullable();
table.text('name').notNullable();
@@ -109,8 +109,8 @@ export const up = async (db: DbConnection) => {
await db.schema.dropTable('permissions');
await db.schema.dropTable('joplin_file_contents');
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('items');
};
}
@@ -1,12 +1,12 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.integer('max_item_size').defaultTo(0).notNullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,12 +1,12 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.integer('can_share').defaultTo(1).notNullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.integer('email_confirmed').defaultTo(0).notNullable();
table.integer('must_set_password').defaultTo(0).notNullable();
@@ -40,8 +40,8 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('tokens', (table: Knex.CreateTableBuilder) => {
table.index(['value', 'user_id']);
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,12 +1,12 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.integer('account_type').defaultTo(0).notNullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,14 +1,14 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.integer('can_upload').defaultTo(1).notNullable();
});
await db('users').update({ can_upload: 1 });
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('subscriptions', (table: Knex.CreateTableBuilder) => {
table.increments('id').unique().primary().notNullable();
table.string('user_id', 32).notNullable();
@@ -12,8 +12,8 @@ export const up = async (db: DbConnection) => {
table.bigInteger('updated_time').notNullable();
table.bigInteger('created_time').notNullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.bigInteger('jop_updated_time').defaultTo(0).notNullable();
});
@@ -22,8 +22,8 @@ export const up = async (db: DbConnection) => {
}
});
}
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,13 +1,13 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.renameColumn('can_share', 'can_share_folder');
table.integer('can_share_note').defaultTo(1).notNullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -5,14 +5,14 @@ import { DbConnection } from '../db';
// recreate it in the same migration. So this is split into two migrations.
// https://github.com/knex/knex/issues/2581
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.dropColumn('max_item_size');
table.dropColumn('can_share_folder');
table.dropColumn('can_share_note');
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.integer('max_item_size').defaultTo(null).nullable();
table.specificType('can_share_folder', 'smallint').defaultTo(null).nullable();
@@ -12,8 +12,8 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.integer('total_item_size').defaultTo(0).notNullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,9 +1,9 @@
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db('users').update({ email: db.raw('LOWER(email)') });
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,12 +1,12 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.dropColumn('total_item_size');
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,12 +1,12 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.bigInteger('total_item_size').defaultTo(0).notNullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', (table: Knex.CreateTableBuilder) => {
table.specificType('enabled', 'smallint').defaultTo(1).nullable();
});
@@ -9,8 +9,8 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('subscriptions', (table: Knex.CreateTableBuilder) => {
table.specificType('is_deleted', 'smallint').defaultTo(0).nullable();
});
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
try {
await db.schema.alterTable('emails', (table: Knex.CreateTableBuilder) => {
table.text('key', 'mediumtext').defaultTo('').notNullable();
@@ -13,8 +13,8 @@ export const up = async (db: DbConnection) => {
// await db.schema.alterTable('emails', function(table: Knex.CreateTableBuilder) {
// table.unique(['recipient_email', 'key']);
// });
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
// import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (_db: DbConnection) => {
export async function up(_db: DbConnection): Promise<any> {
// try {
// await db.schema.alterTable('emails', function(table: Knex.CreateTableBuilder) {
// table.dropUnique(['recipient_email', 'key']);
@@ -9,8 +9,8 @@ export const up = async (_db: DbConnection) => {
// } catch (error) {
// // console.warn('Could not drop unique constraint - this is not an error.', error);
// }
};
}
export const down = async (_db: DbConnection) => {
export async function down(_db: DbConnection): Promise<any> {
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('user_flags', (table: Knex.CreateTableBuilder) => {
table.increments('id').unique().primary().notNullable();
table.string('user_id', 32).notNullable();
@@ -13,8 +13,8 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('user_flags', (table: Knex.CreateTableBuilder) => {
table.unique(['user_id', 'type']);
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('user_flags');
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('share_users', (table: Knex.CreateTableBuilder) => {
table.text('master_key', 'mediumtext').defaultTo('').notNullable();
});
@@ -9,9 +9,9 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('shares', (table: Knex.CreateTableBuilder) => {
table.string('master_key_id', 32).defaultTo('').notNullable();
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.alterTable('share_users', (table: Knex.CreateTableBuilder) => {
table.dropColumn('master_key');
});
@@ -19,4 +19,4 @@ export const down = async (db: DbConnection) => {
await db.schema.alterTable('shares', (table: Knex.CreateTableBuilder) => {
table.dropColumn('master_key_id');
});
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('events', (table: Knex.CreateTableBuilder) => {
table.uuid('id').unique().notNullable();
table.increments('counter').unique().primary().notNullable();
@@ -14,8 +14,8 @@ export const up = async (db: DbConnection) => {
table.index('type');
table.index('name');
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('events');
};
}
@@ -2,7 +2,7 @@ import { Knex } from 'knex';
import { DbConnection } from '../db';
import { msleep } from '../utils/time';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
if (!(await db.schema.hasColumn('items', 'owner_id'))) {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.string('owner_id', 32).defaultTo('').notNullable();
@@ -58,10 +58,10 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.string('owner_id', 32).notNullable().alter();
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.dropColumn('owner_id');
});
};
}
@@ -1,14 +1,14 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.unique(['name', 'owner_id']);
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.dropUnique(['name', 'owner_id']);
});
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('storages', (table: Knex.CreateTableBuilder) => {
table.increments('id').unique().primary().notNullable();
table.text('connection_string').notNullable();
@@ -31,12 +31,12 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('storages', (table: Knex.CreateTableBuilder) => {
table.unique(['connection_string']);
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('storages');
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.dropColumn('content_storage_id');
});
};
}
@@ -1,14 +1,14 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.index('content_storage_id');
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.alterTable('items', (table: Knex.CreateTableBuilder) => {
table.dropIndex('content_storage_id');
});
};
}
@@ -1,7 +1,7 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.createTable('user_deletions', (table: Knex.CreateTableBuilder) => {
table.increments('id').unique().primary().notNullable();
table.string('user_id', 32).notNullable();
@@ -19,8 +19,8 @@ export const up = async (db: DbConnection) => {
await db.schema.alterTable('user_deletions', (table: Knex.CreateTableBuilder) => {
table.unique(['user_id']);
});
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.dropTable('user_deletions');
};
}
@@ -5,16 +5,16 @@ import { DbConnection } from '../db';
// it to an empty string by default, and update all rows that have "0" as
// recipient_id.
export const up = async (db: DbConnection) => {
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('emails', (table: Knex.CreateTableBuilder) => {
table.string('recipient_id', 32).defaultTo('').notNullable().alter();
});
await db('emails').update({ recipient_id: '' }).where('recipient_id', '=', '0');
};
}
export const down = async (db: DbConnection) => {
export async function down(db: DbConnection): Promise<any> {
await db.schema.alterTable('emails', (table: Knex.CreateTableBuilder) => {
table.string('recipient_id', 32).defaultTo(0).notNullable().alter();
});
};
}
Loaded 100 of 134 files, more files were not shown because too many files have changed in this diff. Show more