Browse Source

standardize imports

main
meld-cp 6 months ago
parent
commit
734a153fe4
  1. 4
      package-lock.json
  2. 4
      src/PluginPasswordModal.ts
  3. 4
      src/features/IMeldEncryptPluginFeature.ts
  4. 19
      src/features/feature-convert-note/FeatureConvertNote.ts
  5. 24
      src/features/feature-inplace-encrypt/FeatureInplaceEncrypt.ts
  6. 2
      src/features/feature-inplace-encrypt/PasswordModal.ts
  7. 4
      src/features/feature-inplace-encrypt/featureInplaceTextAnalysis.ts
  8. 8
      src/features/feature-whole-note-encrypt/EncryptedMarkdownView.ts
  9. 14
      src/features/feature-whole-note-encrypt/FeatureWholeNoteEncrypt.ts
  10. 14
      src/main.ts
  11. 2
      src/services/CryptoHelper2304.ts
  12. 12
      src/services/CryptoHelperFactory.ts
  13. 2
      src/services/FileDataHelper.ts
  14. 4
      src/services/SessionPasswordService.ts
  15. 4
      src/settings/MeldEncryptPluginSettings.ts
  16. 8
      src/settings/MeldEncryptSettingsTab.ts
  17. 15
      src/tools/mdenc.ts
  18. 8
      src/tools/offline-decrypt.ts
  19. 2
      tsconfig.json

4
package-lock.json generated

@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
{
"name": "meld-encrypt",
"version": "2.4.2",
"version": "2.4.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "meld-encrypt",
"version": "2.4.2",
"version": "2.4.3",
"license": "MIT",
"devDependencies": {
"@types/node": "24.0.4",

4
src/PluginPasswordModal.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import { App, Modal, Setting, TextComponent } from 'obsidian';
import { UiHelper } from 'src/services/UiHelper';
import { PasswordAndHint } from './services/SessionPasswordService';
import { UiHelper } from './services/UiHelper.ts';
import { PasswordAndHint } from './services/SessionPasswordService.ts';
export default class PluginPasswordModal extends Modal {

4
src/features/IMeldEncryptPluginFeature.ts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import MeldEncrypt from "../main";
import { IMeldEncryptPluginSettings } from "../settings/MeldEncryptPluginSettings";
import MeldEncrypt from "../main.ts";
import { IMeldEncryptPluginSettings } from "../settings/MeldEncryptPluginSettings.ts";
export interface IMeldEncryptPluginFeature {
onload(plugin: MeldEncrypt, settings: IMeldEncryptPluginSettings): Promise<void>;

19
src/features/feature-convert-note/FeatureConvertNote.ts

@ -1,14 +1,13 @@ @@ -1,14 +1,13 @@
import MeldEncrypt from "src/main";
import { IMeldEncryptPluginSettings } from "src/settings/MeldEncryptPluginSettings";
import { IMeldEncryptPluginFeature } from "../IMeldEncryptPluginFeature";
import MeldEncrypt from "../../main.ts";
import { IMeldEncryptPluginSettings } from "../../settings/MeldEncryptPluginSettings.ts";
import { IMeldEncryptPluginFeature } from "../IMeldEncryptPluginFeature.ts";
import { Notice, TFile, TextFileView } from "obsidian";
import PluginPasswordModal from "src/PluginPasswordModal";
import { PasswordAndHint, SessionPasswordService } from "src/services/SessionPasswordService";
import { FileDataHelper, JsonFileEncoding } from "src/services/FileDataHelper";
import { Utils } from "src/services/Utils";
import "src/services/Constants";
import { ENCRYPTED_FILE_EXTENSIONS, ENCRYPTED_FILE_EXTENSION_DEFAULT } from "src/services/Constants";
import { EncryptedMarkdownView } from "../feature-whole-note-encrypt/EncryptedMarkdownView";
import PluginPasswordModal from "../../PluginPasswordModal.ts";
import { PasswordAndHint, SessionPasswordService } from "../../services/SessionPasswordService.ts";
import { FileDataHelper, JsonFileEncoding } from "../../services/FileDataHelper.ts";
import { Utils } from "../../services/Utils.ts";
import { ENCRYPTED_FILE_EXTENSIONS, ENCRYPTED_FILE_EXTENSION_DEFAULT } from "../../services/Constants.ts";
import { EncryptedMarkdownView } from "../feature-whole-note-encrypt/EncryptedMarkdownView.ts";
export default class FeatureConvertNote implements IMeldEncryptPluginFeature {

24
src/features/feature-inplace-encrypt/FeatureInplaceEncrypt.ts

@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
import { Editor, EditorPosition, Notice, Setting, MarkdownPostProcessorContext, MarkdownView } from "obsidian";
import DecryptModal from "./DecryptModal";
import { IMeldEncryptPluginFeature } from "../IMeldEncryptPluginFeature";
import MeldEncrypt from "../../main";
import { IMeldEncryptPluginSettings } from "../../settings/MeldEncryptPluginSettings";
import { IFeatureInplaceEncryptSettings } from "./IFeatureInplaceEncryptSettings";
import PasswordModal from "./PasswordModal";
import { UiHelper } from "../../services/UiHelper";
import { SessionPasswordService } from "src/services/SessionPasswordService";
import { CryptoHelperFactory } from "src/services/CryptoHelperFactory";
import { Decryptable } from "./Decryptable";
import { FeatureInplaceTextAnalysis } from "./featureInplaceTextAnalysis";
import { _HINT, _PREFIXES, _PREFIX_ENCODE_DEFAULT, _PREFIX_ENCODE_DEFAULT_VISIBLE, _SUFFIXES, _SUFFIX_NO_COMMENT, _SUFFIX_WITH_COMMENT } from "./FeatureInplaceConstants";
import DecryptModal from "./DecryptModal.ts";
import { IMeldEncryptPluginFeature } from "../IMeldEncryptPluginFeature.ts";
import MeldEncrypt from "../../main.ts";
import { IMeldEncryptPluginSettings } from "../../settings/MeldEncryptPluginSettings.ts";
import { IFeatureInplaceEncryptSettings } from "./IFeatureInplaceEncryptSettings.ts";
import PasswordModal from "./PasswordModal.ts";
import { UiHelper } from "../../services/UiHelper.ts";
import { SessionPasswordService } from "../../services/SessionPasswordService.ts";
import { CryptoHelperFactory } from "../../services/CryptoHelperFactory.ts";
import { Decryptable } from "./Decryptable.ts";
import { FeatureInplaceTextAnalysis } from "./featureInplaceTextAnalysis.ts";
import { _HINT, _PREFIXES, _PREFIX_ENCODE_DEFAULT, _PREFIX_ENCODE_DEFAULT_VISIBLE, _SUFFIXES, _SUFFIX_NO_COMMENT, _SUFFIX_WITH_COMMENT } from "./FeatureInplaceConstants.ts";
export default class FeatureInplaceEncrypt implements IMeldEncryptPluginFeature{
plugin:MeldEncrypt;

2
src/features/feature-inplace-encrypt/PasswordModal.ts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import { App, Modal, Setting, TextComponent } from 'obsidian';
import { UiHelper } from 'src/services/UiHelper';
import { UiHelper } from '../../services/UiHelper.ts';
export default class PasswordModal extends Modal {

4
src/features/feature-inplace-encrypt/featureInplaceTextAnalysis.ts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import { Decryptable } from "./Decryptable";
import { _HINT, _PREFIXES, _PREFIX_A, _PREFIX_A_VISIBLE, _PREFIX_B, _PREFIX_B_VISIBLE, _PREFIX_OBSOLETE, _PREFIX_OBSOLETE_VISIBLE, _SUFFIXES } from "./FeatureInplaceConstants";
import { Decryptable } from "./Decryptable.ts";
import { _HINT, _PREFIXES, _PREFIX_A, _PREFIX_A_VISIBLE, _PREFIX_B, _PREFIX_B_VISIBLE, _PREFIX_OBSOLETE, _PREFIX_OBSOLETE_VISIBLE, _SUFFIXES } from "./FeatureInplaceConstants.ts";
export class FeatureInplaceTextAnalysis{
processedText:string;

8
src/features/feature-whole-note-encrypt/EncryptedMarkdownView.ts

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
import { MarkdownView, Notice, TFile, ViewStateResult } from "obsidian";
import { FileData, FileDataHelper, JsonFileEncoding } from "../../services/FileDataHelper";
import { PasswordAndHint, SessionPasswordService } from "../../services/SessionPasswordService";
import PluginPasswordModal from "../../PluginPasswordModal";
import { ENCRYPTED_FILE_EXTENSIONS } from "src/services/Constants";
import { FileData, FileDataHelper, JsonFileEncoding } from "../../services/FileDataHelper.ts";
import { PasswordAndHint, SessionPasswordService } from "../../services/SessionPasswordService.ts";
import PluginPasswordModal from "../../PluginPasswordModal.ts";
import { ENCRYPTED_FILE_EXTENSIONS } from "../../services/Constants.ts";
export class EncryptedMarkdownView extends MarkdownView {

14
src/features/feature-whole-note-encrypt/FeatureWholeNoteEncrypt.ts

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
import MeldEncrypt from "src/main";
import { IMeldEncryptPluginFeature } from "../IMeldEncryptPluginFeature";
import { EncryptedMarkdownView } from "./EncryptedMarkdownView";
import MeldEncrypt from "../../main.ts";
import { IMeldEncryptPluginFeature } from "../IMeldEncryptPluginFeature.ts";
import { EncryptedMarkdownView } from "./EncryptedMarkdownView.ts";
import { MarkdownView, TFolder, normalizePath, moment, TFile } from "obsidian";
import PluginPasswordModal from "src/PluginPasswordModal";
import { PasswordAndHint, SessionPasswordService } from "src/services/SessionPasswordService";
import { FileDataHelper, JsonFileEncoding } from "src/services/FileDataHelper";
import { ENCRYPTED_FILE_EXTENSIONS, ENCRYPTED_FILE_EXTENSION_DEFAULT } from "src/services/Constants";
import PluginPasswordModal from "../../PluginPasswordModal.ts";
import { PasswordAndHint, SessionPasswordService } from "../../services/SessionPasswordService.ts";
import { FileDataHelper, JsonFileEncoding } from "../../services/FileDataHelper.ts";
import { ENCRYPTED_FILE_EXTENSIONS, ENCRYPTED_FILE_EXTENSION_DEFAULT } from "../../services/Constants.ts";
export default class FeatureWholeNoteEncryptV2 implements IMeldEncryptPluginFeature {

14
src/main.ts

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
import { Notice, Plugin } from 'obsidian';
import MeldEncryptSettingsTab from './settings/MeldEncryptSettingsTab';
import { IMeldEncryptPluginSettings } from './settings/MeldEncryptPluginSettings';
import { IMeldEncryptPluginFeature } from './features/IMeldEncryptPluginFeature';
import { SessionPasswordService } from './services/SessionPasswordService';
import FeatureInplaceEncrypt from './features/feature-inplace-encrypt/FeatureInplaceEncrypt';
import FeatureConvertNote from './features/feature-convert-note/FeatureConvertNote';
import FeatureWholeNoteEncryptV2 from './features/feature-whole-note-encrypt/FeatureWholeNoteEncrypt';
import MeldEncryptSettingsTab from './settings/MeldEncryptSettingsTab.ts';
import { IMeldEncryptPluginSettings } from './settings/MeldEncryptPluginSettings.ts';
import { IMeldEncryptPluginFeature } from './features/IMeldEncryptPluginFeature.ts';
import { SessionPasswordService } from './services/SessionPasswordService.ts';
import FeatureInplaceEncrypt from './features/feature-inplace-encrypt/FeatureInplaceEncrypt.ts';
import FeatureConvertNote from './features/feature-convert-note/FeatureConvertNote.ts';
import FeatureWholeNoteEncryptV2 from './features/feature-whole-note-encrypt/FeatureWholeNoteEncrypt.ts';
export default class MeldEncrypt extends Plugin {

2
src/services/CryptoHelper2304.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { ICryptoHelper } from "./ICryptoHelper";
import { ICryptoHelper } from "./ICryptoHelper.ts";
export class CryptoHelper2304 implements ICryptoHelper {
public vectorSize: number;

12
src/services/CryptoHelperFactory.ts

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
import { FileData } from "./FileDataHelper";
import { Decryptable } from "src/features/feature-inplace-encrypt/Decryptable";
import { CryptoHelper } from "./CryptoHelper";
import { ICryptoHelper } from "./ICryptoHelper";
import { CryptoHelper2304 } from "./CryptoHelper2304";
import { CryptoHelperObsolete } from "./CryptoHelperObsolete";
import { FileData } from "./FileDataHelper.ts";
import { Decryptable } from "../features/feature-inplace-encrypt/Decryptable.ts";
import { CryptoHelper } from "./CryptoHelper.ts";
import { ICryptoHelper } from "./ICryptoHelper.ts";
import { CryptoHelper2304 } from "./CryptoHelper2304.ts";
import { CryptoHelperObsolete } from "./CryptoHelperObsolete.ts";
export class CryptoHelperFactory{

2
src/services/FileDataHelper.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { CryptoHelperFactory } from "./CryptoHelperFactory";
import { CryptoHelperFactory } from "./CryptoHelperFactory.ts";
export class FileData {

4
src/services/SessionPasswordService.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import { DataAdapter, Notice, TFile } from "obsidian";
import { MemoryCache } from "./MemoryCache";
import { Utils } from "./Utils";
import { MemoryCache } from "./MemoryCache.ts";
import { Utils } from "./Utils.ts";
export type PasswordAndHint = {
password: string;

4
src/settings/MeldEncryptPluginSettings.ts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import { IFeatureInplaceEncryptSettings } from "src/features/feature-inplace-encrypt/IFeatureInplaceEncryptSettings";
import { IFeatureWholeNoteEncryptSettings } from "src/features/feature-whole-note-encrypt/IFeatureWholeNoteEncryptSettings";
import { IFeatureInplaceEncryptSettings } from "../features/feature-inplace-encrypt/IFeatureInplaceEncryptSettings.ts";
import { IFeatureWholeNoteEncryptSettings } from "../features/feature-whole-note-encrypt/IFeatureWholeNoteEncryptSettings.ts";
export interface IMeldEncryptPluginSettings {
confirmPassword: boolean;

8
src/settings/MeldEncryptSettingsTab.ts

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
import { App, Notice, PluginSettingTab, Setting } from "obsidian";
import { IMeldEncryptPluginFeature } from "src/features/IMeldEncryptPluginFeature";
import { SessionPasswordService } from "src/services/SessionPasswordService";
import MeldEncrypt from "../main";
import { IMeldEncryptPluginSettings } from "./MeldEncryptPluginSettings";
import { IMeldEncryptPluginFeature } from "../features/IMeldEncryptPluginFeature.ts";
import { SessionPasswordService } from "../services/SessionPasswordService.ts";
import MeldEncrypt from "../main.ts";
import { IMeldEncryptPluginSettings } from "./MeldEncryptPluginSettings.ts";
export default class MeldEncryptSettingsTab extends PluginSettingTab {
plugin: MeldEncrypt;

15
src/tools/mdenc.ts

@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
import * as yargs from 'yargs'
import { hideBin } from 'yargs/helpers'
import * as fs from 'fs';
import * as path from 'path';
import { CryptoHelperFactory } from 'src/services/CryptoHelperFactory';
import { JsonFileEncoding } from "src/services/FileDataHelper";
import * as Constants from 'src/services/Constants';
import * as InPlaceConstants from 'src/features/feature-inplace-encrypt/FeatureInplaceConstants';
import { FeatureInplaceTextAnalysis } from 'src/features/feature-inplace-encrypt/featureInplaceTextAnalysis';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { CryptoHelperFactory } from '../services/CryptoHelperFactory.ts';
import { JsonFileEncoding } from "../services/FileDataHelper.ts";
import * as Constants from '../services/Constants.ts';
import * as InPlaceConstants from '../features/feature-inplace-encrypt/FeatureInplaceConstants.ts';
import { FeatureInplaceTextAnalysis } from '../features/feature-inplace-encrypt/featureInplaceTextAnalysis.ts';
interface Listing {
featureType: 'InPlace' | 'WholeNote';
@ -518,6 +518,7 @@ const optListingFormat : yargs.Options = { @@ -518,6 +518,7 @@ const optListingFormat : yargs.Options = {
yargs.default(hideBin(process.argv))
.scriptName('mdenc')
.usage( 'Usage: $0 [command] [options]' )
.command( 'list', 'list all encrypted artifacts within the current directory', (yargs) => yargs.option( {

8
src/tools/offline-decrypt.ts

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import { Decryptable } from "src/features/feature-inplace-encrypt/Decryptable";
import { FeatureInplaceTextAnalysis } from "src/features/feature-inplace-encrypt/featureInplaceTextAnalysis";
import { CryptoHelperFactory } from "src/services/CryptoHelperFactory";
import { JsonFileEncoding } from "src/services/FileDataHelper";
import { Decryptable } from "../features/feature-inplace-encrypt/Decryptable.ts";
import { FeatureInplaceTextAnalysis } from "../features/feature-inplace-encrypt/featureInplaceTextAnalysis.ts";
import { CryptoHelperFactory } from "../services/CryptoHelperFactory.ts";
import { JsonFileEncoding } from "../services/FileDataHelper.ts";
export class OfflineDecrypt {

2
tsconfig.json

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
{
"compilerOptions": {
"allowImportingTsExtensions": true,
"noEmit": true, // Required when using allowImportingTsExtensions
"baseUrl": ".",
"inlineSourceMap": true,
"inlineSources": true,

Loading…
Cancel
Save