From 30f0650b389d813891514d619180922bee5aa303 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Wed, 9 Sep 2020 10:25:27 -0500 Subject: [PATCH] chore: upgrade snjs and sncrypto deps --- .../assets/javascripts/services/bridge.d.ts | 13 ++++++++++++ .../javascripts/services/desktopManager.d.ts | 21 ++++++------------- .../app/assets/javascripts/strings.d.ts | 1 + .../javascripts/ui_models/application.d.ts | 2 +- .../ui_models/application_group.d.ts | 3 ++- .../javascripts/web_device_interface.d.ts | 10 +++++---- package-lock.json | 8 +++---- package.json | 4 ++-- 8 files changed, 35 insertions(+), 27 deletions(-) diff --git a/dist/@types/app/assets/javascripts/services/bridge.d.ts b/dist/@types/app/assets/javascripts/services/bridge.d.ts index bfd143fff..785d06418 100644 --- a/dist/@types/app/assets/javascripts/services/bridge.d.ts +++ b/dist/@types/app/assets/javascripts/services/bridge.d.ts @@ -1,11 +1,24 @@ +import { PurePayload, Environment } from "snjs"; /** Platform-specific (i-e Electron/browser) behavior is handled by a Bridge object. */ export interface Bridge { + environment: Environment; getKeychainValue(): Promise; setKeychainValue(value: any): Promise; clearKeychainValue(): Promise; + extensionsServerHost?: string; + syncComponents(payloads: PurePayload[]): void; + onMajorDataChange(): void; + onInitialDataLoad(): void; + onSearch(text?: string): void; } export declare class BrowserBridge implements Bridge { + environment: Environment; getKeychainValue(): Promise; setKeychainValue(value: any): Promise; clearKeychainValue(): Promise; + /** No-ops */ + syncComponents(): void; + onMajorDataChange(): void; + onInitialDataLoad(): void; + onSearch(): void; } diff --git a/dist/@types/app/assets/javascripts/services/desktopManager.d.ts b/dist/@types/app/assets/javascripts/services/desktopManager.d.ts index 4d6c33bd4..d7bcfd3c4 100644 --- a/dist/@types/app/assets/javascripts/services/desktopManager.d.ts +++ b/dist/@types/app/assets/javascripts/services/desktopManager.d.ts @@ -2,6 +2,7 @@ import { SNComponent, PurePayload } from 'snjs'; import { WebApplication } from '@/ui_models/application'; import { ApplicationService, ApplicationEvent } from 'snjs'; +import { Bridge } from './bridge'; declare type UpdateObserverCallback = (component: SNComponent) => void; declare type ComponentActivationCallback = (payload: PurePayload) => void; declare type ComponentActivationObserver = { @@ -9,6 +10,7 @@ declare type ComponentActivationObserver = { callback: ComponentActivationCallback; }; export declare class DesktopManager extends ApplicationService { + private bridge; $rootScope: ng.IRootScopeService; $timeout: ng.ITimeoutService; componentActivationObservers: ComponentActivationObserver[]; @@ -17,14 +19,9 @@ export declare class DesktopManager extends ApplicationService { }[]; isDesktop: any; dataLoaded: boolean; - dataLoadHandler?: () => void; - majorDataChangeHandler?: () => void; - extServerHost?: string; - installationSyncHandler?: (payloads: PurePayload[]) => void; - installComponentHandler?: (payload: PurePayload) => void; lastSearchedText?: string; - searchHandler?: (text?: string) => void; - constructor($rootScope: ng.IRootScopeService, $timeout: ng.ITimeoutService, application: WebApplication); + private removeComponentObserver?; + constructor($rootScope: ng.IRootScopeService, $timeout: ng.ITimeoutService, application: WebApplication, bridge: Bridge); get webApplication(): WebApplication; deinit(): void; onAppEvent(eventName: ApplicationEvent): Promise; @@ -36,11 +33,9 @@ export declare class DesktopManager extends ApplicationService { */ convertComponentForTransmission(component: SNComponent): Promise; syncComponentsInstallation(components: SNComponent[]): void; - installComponent(component: SNComponent): Promise; registerUpdateObserver(callback: UpdateObserverCallback): () => void; searchText(text?: string): void; redoSearch(): void; - desktop_setSearchHandler(handler: (text?: string) => void): void; desktop_windowGainedFocus(): void; desktop_windowLostFocus(): void; desktop_onComponentInstallationComplete(componentData: any, error: any): Promise; @@ -50,12 +45,8 @@ export declare class DesktopManager extends ApplicationService { }; desktop_deregisterComponentActivationObserver(observer: ComponentActivationObserver): void; notifyComponentActivation(component: SNComponent): Promise; - desktop_setExtServerHost(host: string): void; - desktop_setComponentInstallationSyncHandler(handler: (payloads: PurePayload[]) => void): void; - desktop_setInstallComponentHandler(handler: (payload: PurePayload) => void): void; - desktop_setInitialDataLoadHandler(handler: () => void): void; - desktop_requestBackupFile(callback: (data: any) => void): Promise; - desktop_setMajorDataChangeHandler(handler: () => void): void; + onExtensionsReady(): void; + desktop_requestBackupFile(): Promise; desktop_didBeginBackup(): void; desktop_didFinishBackup(success: boolean): void; } diff --git a/dist/@types/app/assets/javascripts/strings.d.ts b/dist/@types/app/assets/javascripts/strings.d.ts index 191711b64..f36f46c02 100644 --- a/dist/@types/app/assets/javascripts/strings.d.ts +++ b/dist/@types/app/assets/javascripts/strings.d.ts @@ -37,6 +37,7 @@ export declare const STRING_ENTER_ACCOUNT_PASSWORD = "Enter your account passwor export declare const STRING_ENTER_PASSCODE_FOR_MIGRATION = "Your application passcode is required to perform an upgrade of your local data storage structure."; export declare const STRING_STORAGE_UPDATE = "Storage Update"; export declare const STRING_AUTHENTICATION_REQUIRED = "Authentication Required"; +export declare const STRING_UNSUPPORTED_BACKUP_FILE_VERSION = "This backup file was created using an unsupported version of the application and cannot be imported here. Please update your application and try again."; /** @password_change */ export declare const STRING_FAILED_PASSWORD_CHANGE = "There was an error re-encrypting your items. Your password was changed, but not all your items were properly re-encrypted and synced. You should try syncing again. If all else fails, you should restore your notes from backup."; export declare const STRING_CONFIRM_APP_QUIT_DURING_UPGRADE: string; diff --git a/dist/@types/app/assets/javascripts/ui_models/application.d.ts b/dist/@types/app/assets/javascripts/ui_models/application.d.ts index 088c3eaba..87a609894 100644 --- a/dist/@types/app/assets/javascripts/ui_models/application.d.ts +++ b/dist/@types/app/assets/javascripts/ui_models/application.d.ts @@ -25,7 +25,7 @@ export declare class WebApplication extends SNApplication { private currentAuthenticationElement?; editorGroup: EditorGroup; componentGroup: ComponentGroup; - constructor($compile: ng.ICompileService, $timeout: ng.ITimeoutService, scope: ng.IScope, onDeinit: (app: WebApplication) => void, bridge: Bridge); + constructor($compile: ng.ICompileService, $timeout: ng.ITimeoutService, scope: ng.IScope, onDeinit: (app: WebApplication) => void, defaultSyncServerHost: string, bridge: Bridge); /** @override */ deinit(): void; setWebServices(services: WebServices): void; diff --git a/dist/@types/app/assets/javascripts/ui_models/application_group.d.ts b/dist/@types/app/assets/javascripts/ui_models/application_group.d.ts index 8c534c259..01558e1bc 100644 --- a/dist/@types/app/assets/javascripts/ui_models/application_group.d.ts +++ b/dist/@types/app/assets/javascripts/ui_models/application_group.d.ts @@ -3,6 +3,7 @@ import { WebApplication } from './application'; import { Bridge } from '@/services/bridge'; declare type AppManagerChangeCallback = () => void; export declare class ApplicationGroup { + private defaultSyncServerHost; private bridge; $compile: ng.ICompileService; $rootScope: ng.IRootScopeService; @@ -10,7 +11,7 @@ export declare class ApplicationGroup { applications: WebApplication[]; changeObservers: AppManagerChangeCallback[]; activeApplication?: WebApplication; - constructor($compile: ng.ICompileService, $rootScope: ng.IRootScopeService, $timeout: ng.ITimeoutService, bridge: Bridge); + constructor($compile: ng.ICompileService, $rootScope: ng.IRootScopeService, $timeout: ng.ITimeoutService, defaultSyncServerHost: string, bridge: Bridge); private createDefaultApplication; /** @callback */ onApplicationDeinit(application: WebApplication): void; diff --git a/dist/@types/app/assets/javascripts/web_device_interface.d.ts b/dist/@types/app/assets/javascripts/web_device_interface.d.ts index 33188970e..3e2e61b18 100644 --- a/dist/@types/app/assets/javascripts/web_device_interface.d.ts +++ b/dist/@types/app/assets/javascripts/web_device_interface.d.ts @@ -3,7 +3,7 @@ import { Bridge } from './services/bridge'; export declare class WebDeviceInterface extends DeviceInterface { private bridge; private database; - constructor(namespace: string, timeout: any, bridge: Bridge); + constructor(timeout: any, bridge: Bridge); setApplication(application: SNApplication): void; deinit(): void; getRawStorageValue(key: string): Promise; @@ -24,8 +24,10 @@ export declare class WebDeviceInterface extends DeviceInterface { saveRawDatabasePayloads(payloads: any[]): Promise; removeRawDatabasePayloadWithId(id: string): Promise; removeAllRawDatabasePayloads(): Promise; - getKeychainValue(): Promise; - setKeychainValue(value: any): Promise; - clearKeychainValue(): Promise; + getNamespacedKeychainValue(): Promise; + setNamespacedKeychainValue(value: any): Promise; + clearNamespacedKeychainValue(): Promise; + getRawKeychainValue(): Promise; + clearRawKeychainValue(): Promise; openUrl(url: string): void; } diff --git a/package-lock.json b/package-lock.json index 52f025f2c..51d1b5f5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10952,12 +10952,12 @@ } }, "sncrypto": { - "version": "github:standardnotes/sncrypto#49732d8215312a08a71b833b79e94ba7c1872e11", - "from": "github:standardnotes/sncrypto#49732d8215312a08a71b833b79e94ba7c1872e11" + "version": "github:standardnotes/sncrypto#0b12b9748fde7c82e48609836838953b03c9200a", + "from": "github:standardnotes/sncrypto#0b12b9748fde7c82e48609836838953b03c9200a" }, "snjs": { - "version": "github:standardnotes/snjs#ee696470fa0d5e762a39ce179f215052327acbc3", - "from": "github:standardnotes/snjs#ee696470fa0d5e762a39ce179f215052327acbc3" + "version": "github:standardnotes/snjs#bb04a94a9b91f2ce95ecb55f823d4a98a6654291", + "from": "github:standardnotes/snjs#bb04a94a9b91f2ce95ecb55f823d4a98a6654291" }, "sockjs": { "version": "0.3.20", diff --git a/package.json b/package.json index 07095c2ef..05120d994 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "webpack-merge": "^4.2.2" }, "dependencies": { - "sncrypto": "github:standardnotes/sncrypto#49732d8215312a08a71b833b79e94ba7c1872e11", - "snjs": "github:standardnotes/snjs#ee696470fa0d5e762a39ce179f215052327acbc3" + "sncrypto": "github:standardnotes/sncrypto#0b12b9748fde7c82e48609836838953b03c9200a", + "snjs": "github:standardnotes/snjs#bb04a94a9b91f2ce95ecb55f823d4a98a6654291" } }