orgnote-api 0.20.2 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.ts +93 -98
- package/constants/{command-groups.contant.d.ts → command-groups.d.ts} +2 -1
- package/constants/{command-groups.contant.js → command-groups.js} +2 -0
- package/constants/extension-errors.d.ts +9 -0
- package/constants/extension-errors.js +18 -0
- package/constants/file-guard-errors.d.ts +8 -0
- package/constants/file-guard-errors.js +18 -0
- package/constants/git-errors.d.ts +9 -0
- package/constants/git-errors.js +18 -0
- package/constants/i18n-keys.d.ts +371 -0
- package/constants/i18n-keys.js +158 -0
- package/constants/index.d.ts +9 -1
- package/constants/index.js +9 -1
- package/constants/oauth-providers.d.ts +1 -0
- package/constants/oauth-providers.js +1 -0
- package/constants/route-names.d.ts +36 -0
- package/constants/route-names.js +37 -0
- package/constants/route-paths.d.ts +5 -0
- package/constants/route-paths.js +4 -0
- package/constants/style-sizes.d.ts +1 -0
- package/constants/style-sizes.js +1 -0
- package/encryption/__tests__/encryption.spec.js +4 -5
- package/encryption/__tests__/note-encryption.spec.js +46 -348
- package/encryption/encryption.d.ts +9 -4
- package/encryption/encryption.js +25 -5
- package/encryption/note-encryption.d.ts +1 -1
- package/encryption/note-encryption.js +6 -6
- package/files-api.d.ts +0 -1
- package/index.d.ts +4 -1
- package/index.js +4 -1
- package/mappers/orgnode-to-note.d.ts +2 -2
- package/mappers/orgnode-to-note.js +3 -2
- package/models/auth-store.d.ts +3 -3
- package/models/buffer-store.d.ts +14 -0
- package/models/buffer.d.ts +24 -0
- package/models/colors.d.ts +1 -0
- package/models/command.d.ts +13 -8
- package/models/commands-group-store.d.ts +11 -0
- package/models/commands-store.d.ts +13 -0
- package/models/completion-store.d.ts +14 -0
- package/models/completion.d.ts +16 -7
- package/models/config-store.d.ts +9 -0
- package/models/confirmation-modal.d.ts +11 -0
- package/models/context-menu-store.d.ts +10 -0
- package/models/cron-store.d.ts +21 -0
- package/models/cron-task.d.ts +30 -0
- package/models/css-utils.d.ts +17 -0
- package/models/default-commands.d.ts +52 -3
- package/models/default-commands.js +59 -2
- package/models/encryption-store.d.ts +10 -0
- package/models/encryption-store.js +1 -0
- package/models/encryption.d.ts +54 -11
- package/models/encryption.js +28 -1
- package/models/extension-registry-store.d.ts +9 -0
- package/models/extension-registry-store.js +1 -0
- package/models/extension-store.d.ts +18 -0
- package/models/extension-store.js +1 -0
- package/models/extension.d.ts +96 -24
- package/models/extension.js +88 -1
- package/models/file-guard-store.d.ts +14 -0
- package/models/file-guard-store.js +1 -0
- package/models/file-guard.d.ts +27 -0
- package/models/file-guard.js +1 -0
- package/models/{file-cache.d.ts → file-info.d.ts} +1 -1
- package/models/file-info.js +1 -0
- package/models/file-manager-store.d.ts +10 -12
- package/models/file-opener-store.d.ts +6 -4
- package/models/file-system-manager-store.d.ts +13 -0
- package/models/file-system-manager-store.js +1 -0
- package/models/file-system-store.d.ts +19 -0
- package/models/file-system-store.js +1 -0
- package/models/file-system.d.ts +32 -5
- package/models/file-system.js +2 -0
- package/models/file-upload.d.ts +6 -0
- package/models/file-upload.js +1 -0
- package/models/file-watcher-store.d.ts +18 -0
- package/models/file-watcher-store.js +1 -0
- package/models/files-store.d.ts +2 -2
- package/models/git-store.d.ts +12 -0
- package/models/git-store.js +1 -0
- package/models/git.d.ts +47 -0
- package/models/git.js +1 -0
- package/models/i18n-keys.d.ts +2 -0
- package/models/i18n-keys.js +1 -0
- package/models/index.d.ts +56 -2
- package/models/index.js +59 -2
- package/models/layout-snapshot-repository.d.ts +14 -0
- package/models/layout-snapshot-repository.js +1 -0
- package/models/layout-store.d.ts +17 -0
- package/models/layout-store.js +1 -0
- package/models/layout.d.ts +16 -0
- package/models/layout.js +1 -0
- package/models/log-repository.d.ts +17 -0
- package/models/log-repository.js +1 -0
- package/models/log-store.d.ts +15 -0
- package/models/log-store.js +1 -0
- package/models/log.d.ts +12 -0
- package/models/log.js +1 -0
- package/models/logger.d.ts +8 -0
- package/models/logger.js +1 -0
- package/models/menu-action.d.ts +18 -0
- package/models/menu-action.js +1 -0
- package/models/modal-store.d.ts +16 -0
- package/models/modal-store.js +1 -0
- package/models/modal.d.ts +10 -2
- package/models/note.d.ts +30 -13
- package/models/notification-config.d.ts +14 -0
- package/models/notification-config.js +1 -0
- package/models/notifications-store.d.ts +20 -0
- package/models/notifications-store.js +1 -0
- package/models/oauth-provider.d.ts +2 -1
- package/models/orgnote-config.d.ts +80 -0
- package/models/orgnote-config.js +42 -0
- package/models/orgnote-url.d.ts +6 -0
- package/models/orgnote-url.js +1 -0
- package/models/pane-snapshot-repository.d.ts +0 -0
- package/models/pane-snapshot-repository.js +0 -0
- package/models/pane.d.ts +38 -0
- package/models/pane.js +1 -0
- package/models/panes-store.d.ts +30 -0
- package/models/panes-store.js +1 -0
- package/models/platform-detection.d.ts +11 -0
- package/models/platform-detection.js +1 -0
- package/models/platform-specific.d.ts +1 -0
- package/models/platform-specific.js +1 -0
- package/models/platform.d.ts +2 -0
- package/models/platform.js +1 -0
- package/models/queue-store.d.ts +49 -0
- package/models/queue-store.js +1 -0
- package/models/queue-task.d.ts +15 -0
- package/models/queue-task.js +1 -0
- package/models/repositories.d.ts +58 -38
- package/models/screen-detection.d.ts +10 -0
- package/models/screen-detection.js +1 -0
- package/models/settings-store.d.ts +12 -0
- package/models/settings-store.js +1 -0
- package/models/settings-ui-store.d.ts +7 -0
- package/models/settings-ui-store.js +1 -0
- package/models/sidebar-store.d.ts +22 -0
- package/models/sidebar-store.js +1 -0
- package/models/splash-screen.d.ts +13 -0
- package/models/splash-screen.js +1 -0
- package/models/store.d.ts +1 -1
- package/models/style-size.d.ts +2 -0
- package/models/style-size.js +1 -0
- package/models/style-variant.d.ts +1 -0
- package/models/style-variant.js +1 -0
- package/models/sync-store.d.ts +8 -6
- package/models/sync.d.ts +0 -5
- package/models/system-info.d.ts +47 -0
- package/models/system-info.js +1 -0
- package/models/theme-store.d.ts +16 -0
- package/models/theme-store.js +1 -0
- package/models/theme-variables.d.ts +4 -189
- package/models/theme-variables.js +2 -191
- package/models/toolbar-store.d.ts +9 -0
- package/models/toolbar-store.js +1 -0
- package/models/ui-store.d.ts +6 -0
- package/models/ui-store.js +1 -0
- package/models/user.d.ts +3 -4
- package/models/vue-component.d.ts +4 -2
- package/package-lock.json +5553 -0
- package/package.json +37 -26
- package/remote-api/api.d.ts +288 -669
- package/remote-api/api.js +199 -485
- package/remote-api/base.js +1 -1
- package/remote-api/common.d.ts +1 -1
- package/sync/__tests__/memory-state.spec.d.ts +1 -0
- package/sync/__tests__/memory-state.spec.js +49 -0
- package/sync/__tests__/plan.spec.d.ts +1 -0
- package/sync/__tests__/plan.spec.js +116 -0
- package/sync/create-sync-plan.d.ts +2 -0
- package/sync/create-sync-plan.js +13 -0
- package/sync/fetch.d.ts +8 -0
- package/sync/fetch.js +32 -0
- package/sync/index.d.ts +10 -0
- package/sync/index.js +9 -0
- package/sync/memory-state.d.ts +2 -0
- package/sync/memory-state.js +22 -0
- package/sync/operations/conflict.d.ts +10 -0
- package/sync/operations/conflict.js +56 -0
- package/sync/operations/delete-local.d.ts +2 -0
- package/sync/operations/delete-local.js +17 -0
- package/sync/operations/delete-remote.d.ts +2 -0
- package/sync/operations/delete-remote.js +26 -0
- package/sync/operations/download.d.ts +2 -0
- package/sync/operations/download.js +20 -0
- package/sync/operations/index.d.ts +5 -0
- package/sync/operations/index.js +5 -0
- package/sync/operations/synced-file.d.ts +14 -0
- package/sync/operations/synced-file.js +5 -0
- package/sync/operations/upload.d.ts +2 -0
- package/sync/operations/upload.js +30 -0
- package/sync/plan.d.ts +9 -0
- package/sync/plan.js +57 -0
- package/sync/recovery.d.ts +2 -0
- package/sync/recovery.js +6 -0
- package/sync/scan.d.ts +4 -0
- package/sync/scan.js +40 -0
- package/sync/types.d.ts +74 -0
- package/sync/types.js +7 -0
- package/sync/utils/__tests__/oldest-synced-at.spec.d.ts +1 -0
- package/sync/utils/__tests__/oldest-synced-at.spec.js +38 -0
- package/sync/utils/oldest-synced-at.d.ts +2 -0
- package/sync/utils/oldest-synced-at.js +9 -0
- package/types/index.d.ts +0 -0
- package/types/index.js +0 -0
- package/utils/__tests__/find-files-diff.spec.d.ts +1 -0
- package/{tools → utils}/__tests__/find-files-diff.spec.js +3 -3
- package/utils/__tests__/find-note-files-diff.spec.d.ts +1 -0
- package/{tools → utils}/__tests__/find-note-files-diff.spec.js +5 -5
- package/utils/__tests__/get-file-name.spec.d.ts +1 -0
- package/utils/__tests__/get-string-path.spec.d.ts +1 -0
- package/utils/__tests__/is-gpg-encrypted.spec.d.ts +1 -0
- package/utils/__tests__/is-org-file.spec.d.ts +1 -0
- package/utils/__tests__/join.spec.d.ts +1 -0
- package/utils/__tests__/join.spec.js +32 -0
- package/utils/__tests__/nullable-guards.spec.d.ts +1 -0
- package/utils/__tests__/nullable-guards.spec.js +44 -0
- package/utils/__tests__/parent-folder.spec.d.ts +1 -0
- package/utils/__tests__/read-org-files-recursively.spec.d.ts +1 -0
- package/utils/__tests__/split-path.spec.d.ts +1 -0
- package/utils/__tests__/to-absolute-path.spec.d.ts +1 -0
- package/utils/__tests__/to-absolute-path.spec.js +26 -0
- package/utils/__tests__/to-error.spec.d.ts +1 -0
- package/utils/__tests__/to-error.spec.js +112 -0
- package/utils/__tests__/with-root.spec.d.ts +1 -0
- package/utils/__tests__/with-root.spec.js +20 -0
- package/{tools → utils}/find-notes-files-diff.js +6 -3
- package/{tools → utils}/index.d.ts +4 -1
- package/{tools → utils}/index.js +4 -1
- package/utils/join-path.d.ts +1 -0
- package/utils/join-path.js +13 -0
- package/utils/nullable-guards.d.ts +2 -0
- package/utils/nullable-guards.js +6 -0
- package/utils/to-absolute-path.d.ts +2 -0
- package/utils/to-absolute-path.js +2 -0
- package/utils/to-error.d.ts +6 -0
- package/utils/to-error.js +33 -0
- package/utils/toml.d.ts +3 -0
- package/utils/toml.js +31 -0
- package/utils/with-root.d.ts +1 -0
- package/utils/with-root.js +6 -0
- package/websocket/client.d.ts +24 -0
- package/websocket/client.js +83 -0
- package/models/file-tree.d.ts +0 -12
- package/tools/__tests__/join.spec.js +0 -24
- package/tools/join-path.d.ts +0 -1
- package/tools/join-path.js +0 -7
- package/tools/mock-server.d.ts +0 -1
- package/tools/mock-server.js +0 -12
- /package/models/{file-cache.js → buffer-store.js} +0 -0
- /package/models/{file-tree.js → buffer.js} +0 -0
- /package/{tools/__tests__/find-files-diff.spec.d.ts → models/colors.js} +0 -0
- /package/{tools/__tests__/find-note-files-diff.spec.d.ts → models/commands-group-store.js} +0 -0
- /package/{tools/__tests__/get-file-name.spec.d.ts → models/commands-store.js} +0 -0
- /package/{tools/__tests__/get-string-path.spec.d.ts → models/completion-store.js} +0 -0
- /package/{tools/__tests__/is-gpg-encrypted.spec.d.ts → models/config-store.js} +0 -0
- /package/{tools/__tests__/is-org-file.spec.d.ts → models/confirmation-modal.js} +0 -0
- /package/{tools/__tests__/join.spec.d.ts → models/context-menu-store.js} +0 -0
- /package/{tools/__tests__/parent-folder.spec.d.ts → models/cron-store.js} +0 -0
- /package/{tools/__tests__/read-org-files-recursively.spec.d.ts → models/cron-task.js} +0 -0
- /package/{tools/__tests__/split-path.spec.d.ts → models/css-utils.js} +0 -0
- /package/{tools → utils}/__tests__/get-file-name.spec.js +0 -0
- /package/{tools → utils}/__tests__/get-string-path.spec.js +0 -0
- /package/{tools → utils}/__tests__/is-gpg-encrypted.spec.js +0 -0
- /package/{tools → utils}/__tests__/is-org-file.spec.js +0 -0
- /package/{tools → utils}/__tests__/parent-folder.spec.js +0 -0
- /package/{tools → utils}/__tests__/read-org-files-recursively.spec.js +0 -0
- /package/{tools → utils}/__tests__/split-path.spec.js +0 -0
- /package/{tools → utils}/find-notes-files-diff.d.ts +0 -0
- /package/{tools → utils}/get-file-name.d.ts +0 -0
- /package/{tools → utils}/get-file-name.js +0 -0
- /package/{tools → utils}/get-parent-dir.d.ts +0 -0
- /package/{tools → utils}/get-parent-dir.js +0 -0
- /package/{tools → utils}/get-string-path.d.ts +0 -0
- /package/{tools → utils}/get-string-path.js +0 -0
- /package/{tools → utils}/is-gpg-encrypted.d.ts +0 -0
- /package/{tools → utils}/is-gpg-encrypted.js +0 -0
- /package/{tools → utils}/is-org-file.d.ts +0 -0
- /package/{tools → utils}/is-org-file.js +0 -0
- /package/{tools → utils}/split-path.d.ts +0 -0
- /package/{tools → utils}/split-path.js +0 -0
package/models/extension.d.ts
CHANGED
|
@@ -1,34 +1,106 @@
|
|
|
1
1
|
import { OrgNoteApi } from '../api.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
import { type InferOutput } from 'valibot';
|
|
3
|
+
declare const PLATFORM_SCHEMA: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"mobile", undefined>, import("valibot").LiteralSchema<"desktop", undefined>, import("valibot").LiteralSchema<"capacitor", undefined>, import("valibot").LiteralSchema<"nativeMobile", undefined>, import("valibot").LiteralSchema<"electron", undefined>, import("valibot").LiteralSchema<"linux", undefined>, import("valibot").LiteralSchema<"mac", undefined>, import("valibot").LiteralSchema<"win", undefined>, import("valibot").LiteralSchema<"chrome", undefined>, import("valibot").LiteralSchema<"firefox", undefined>, import("valibot").LiteralSchema<"opera", undefined>, import("valibot").LiteralSchema<"safari", undefined>, import("valibot").LiteralSchema<"webkit", undefined>, import("valibot").LiteralSchema<"ios", undefined>, import("valibot").LiteralSchema<"ipad", undefined>, import("valibot").LiteralSchema<"iphone", undefined>, import("valibot").LiteralSchema<"ipod", undefined>, import("valibot").LiteralSchema<"winphone", undefined>, import("valibot").LiteralSchema<"blackberry", undefined>], undefined>;
|
|
4
|
+
declare const PERMISSION_SCHEMA: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"files", undefined>, import("valibot").LiteralSchema<"personal info", undefined>, import("valibot").LiteralSchema<"*", undefined>, import("valibot").LiteralSchema<"third party", undefined>], undefined>;
|
|
5
|
+
declare const CATEGORY_SCHEMA: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"theme", undefined>, import("valibot").LiteralSchema<"extension", undefined>, import("valibot").LiteralSchema<"language pack", undefined>, import("valibot").LiteralSchema<"other", undefined>], undefined>;
|
|
6
|
+
declare const GIT_SOURCE_SCHEMA: import("valibot").ObjectSchema<{
|
|
7
|
+
readonly type: import("valibot").LiteralSchema<"git", undefined>;
|
|
8
|
+
readonly repo: import("valibot").StringSchema<undefined>;
|
|
9
|
+
readonly branch: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
10
|
+
readonly tag: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
11
|
+
}, undefined>;
|
|
12
|
+
declare const LOCAL_SOURCE_SCHEMA: import("valibot").ObjectSchema<{
|
|
13
|
+
readonly type: import("valibot").LiteralSchema<"local", undefined>;
|
|
14
|
+
}, undefined>;
|
|
15
|
+
declare const SOURCE_SCHEMA: import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
|
|
16
|
+
readonly type: import("valibot").LiteralSchema<"git", undefined>;
|
|
17
|
+
readonly repo: import("valibot").StringSchema<undefined>;
|
|
18
|
+
readonly branch: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
19
|
+
readonly tag: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
20
|
+
}, undefined>, import("valibot").ObjectSchema<{
|
|
21
|
+
readonly type: import("valibot").LiteralSchema<"local", undefined>;
|
|
22
|
+
}, undefined>], undefined>;
|
|
23
|
+
declare const COMMAND_SCHEMA: import("valibot").ObjectSchema<{
|
|
24
|
+
readonly id: import("valibot").StringSchema<undefined>;
|
|
25
|
+
readonly title: import("valibot").StringSchema<undefined>;
|
|
26
|
+
readonly category: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
27
|
+
}, undefined>;
|
|
28
|
+
declare const KEYBINDING_SCHEMA: import("valibot").ObjectSchema<{
|
|
29
|
+
readonly key: import("valibot").StringSchema<undefined>;
|
|
30
|
+
readonly command: import("valibot").StringSchema<undefined>;
|
|
31
|
+
readonly when: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
32
|
+
}, undefined>;
|
|
33
|
+
export declare const EXTENSION_MANIFEST_SCHEMA: import("valibot").ObjectSchema<{
|
|
34
|
+
readonly name: import("valibot").StringSchema<undefined>;
|
|
35
|
+
readonly version: import("valibot").StringSchema<undefined>;
|
|
36
|
+
readonly category: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"theme", undefined>, import("valibot").LiteralSchema<"extension", undefined>, import("valibot").LiteralSchema<"language pack", undefined>, import("valibot").LiteralSchema<"other", undefined>], undefined>;
|
|
37
|
+
readonly source: import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
|
|
38
|
+
readonly type: import("valibot").LiteralSchema<"git", undefined>;
|
|
39
|
+
readonly repo: import("valibot").StringSchema<undefined>;
|
|
40
|
+
readonly branch: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
41
|
+
readonly tag: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
42
|
+
}, undefined>, import("valibot").ObjectSchema<{
|
|
43
|
+
readonly type: import("valibot").LiteralSchema<"local", undefined>;
|
|
44
|
+
}, undefined>], undefined>;
|
|
45
|
+
readonly author: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
46
|
+
readonly description: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
47
|
+
readonly keywords: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
|
|
48
|
+
readonly icon: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
49
|
+
readonly platforms: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").UnionSchema<[import("valibot").LiteralSchema<"mobile", undefined>, import("valibot").LiteralSchema<"desktop", undefined>, import("valibot").LiteralSchema<"capacitor", undefined>, import("valibot").LiteralSchema<"nativeMobile", undefined>, import("valibot").LiteralSchema<"electron", undefined>, import("valibot").LiteralSchema<"linux", undefined>, import("valibot").LiteralSchema<"mac", undefined>, import("valibot").LiteralSchema<"win", undefined>, import("valibot").LiteralSchema<"chrome", undefined>, import("valibot").LiteralSchema<"firefox", undefined>, import("valibot").LiteralSchema<"opera", undefined>, import("valibot").LiteralSchema<"safari", undefined>, import("valibot").LiteralSchema<"webkit", undefined>, import("valibot").LiteralSchema<"ios", undefined>, import("valibot").LiteralSchema<"ipad", undefined>, import("valibot").LiteralSchema<"iphone", undefined>, import("valibot").LiteralSchema<"ipod", undefined>, import("valibot").LiteralSchema<"winphone", undefined>, import("valibot").LiteralSchema<"blackberry", undefined>], undefined>, undefined>, undefined>;
|
|
50
|
+
readonly permissions: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").UnionSchema<[import("valibot").LiteralSchema<"files", undefined>, import("valibot").LiteralSchema<"personal info", undefined>, import("valibot").LiteralSchema<"*", undefined>, import("valibot").LiteralSchema<"third party", undefined>], undefined>, undefined>, undefined>;
|
|
51
|
+
readonly apiVersion: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
52
|
+
readonly minOrgNoteVersion: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
53
|
+
readonly license: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
54
|
+
readonly sponsor: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
|
|
55
|
+
readonly readmeFilePath: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
56
|
+
readonly reloadRequired: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
57
|
+
readonly development: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
58
|
+
readonly commands: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
59
|
+
readonly id: import("valibot").StringSchema<undefined>;
|
|
60
|
+
readonly title: import("valibot").StringSchema<undefined>;
|
|
61
|
+
readonly category: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
62
|
+
}, undefined>, undefined>, undefined>;
|
|
63
|
+
readonly keybindings: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
64
|
+
readonly key: import("valibot").StringSchema<undefined>;
|
|
65
|
+
readonly command: import("valibot").StringSchema<undefined>;
|
|
66
|
+
readonly when: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
67
|
+
}, undefined>, undefined>, undefined>;
|
|
68
|
+
readonly activationEvents: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").UnionSchema<[import("valibot").LiteralSchema<"onStartup", undefined>, import("valibot").LiteralSchema<"*", undefined>], undefined>, undefined>, undefined>;
|
|
69
|
+
readonly dependencies: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").StringSchema<undefined>, undefined>, undefined>;
|
|
70
|
+
readonly configSchema: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
|
|
71
|
+
readonly type: import("valibot").LiteralSchema<"object", undefined>;
|
|
72
|
+
readonly properties: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").ObjectSchema<{
|
|
73
|
+
readonly type: import("valibot").StringSchema<undefined>;
|
|
74
|
+
readonly description: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
75
|
+
readonly default: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
76
|
+
}, undefined>, undefined>;
|
|
77
|
+
}, undefined>, undefined>;
|
|
78
|
+
}, undefined>;
|
|
79
|
+
export type ExtensionManifest = InferOutput<typeof EXTENSION_MANIFEST_SCHEMA>;
|
|
80
|
+
export type ExtensionCategory = InferOutput<typeof CATEGORY_SCHEMA>;
|
|
81
|
+
export type ExtensionSourceInfo = InferOutput<typeof SOURCE_SCHEMA>;
|
|
82
|
+
export type GitSource = InferOutput<typeof GIT_SOURCE_SCHEMA>;
|
|
83
|
+
export type LocalSource = InferOutput<typeof LOCAL_SOURCE_SCHEMA>;
|
|
84
|
+
export type ExtensionCommand = InferOutput<typeof COMMAND_SCHEMA>;
|
|
85
|
+
export type ExtensionKeybinding = InferOutput<typeof KEYBINDING_SCHEMA>;
|
|
86
|
+
export type ExtensionPlatform = InferOutput<typeof PLATFORM_SCHEMA>;
|
|
87
|
+
export type ExtensionPermission = InferOutput<typeof PERMISSION_SCHEMA>;
|
|
19
88
|
export interface Extension {
|
|
20
89
|
[key: string]: unknown;
|
|
21
|
-
onMounted: (api: OrgNoteApi) => Promise<void
|
|
22
|
-
onUnmounted?: (api: OrgNoteApi) => Promise<void
|
|
90
|
+
onMounted: (api: OrgNoteApi) => Promise<void> | void;
|
|
91
|
+
onUnmounted?: (api: OrgNoteApi) => Promise<void> | void;
|
|
23
92
|
}
|
|
24
93
|
export interface ExtensionMeta {
|
|
25
94
|
manifest: ExtensionManifest;
|
|
26
95
|
uploaded?: boolean;
|
|
27
96
|
active?: boolean;
|
|
97
|
+
config?: Record<string, unknown>;
|
|
28
98
|
}
|
|
29
|
-
export interface
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
module:
|
|
99
|
+
export interface ExtensionSource {
|
|
100
|
+
name: string;
|
|
101
|
+
version: string;
|
|
102
|
+
source: string;
|
|
103
|
+
module: string;
|
|
104
|
+
docFiles: string[];
|
|
34
105
|
}
|
|
106
|
+
export {};
|
package/models/extension.js
CHANGED
|
@@ -1 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
import { object, string, union, optional, array, boolean, record, unknown, literal, } from 'valibot';
|
|
2
|
+
const PLATFORM_SCHEMA = union([
|
|
3
|
+
literal('mobile'),
|
|
4
|
+
literal('desktop'),
|
|
5
|
+
literal('capacitor'),
|
|
6
|
+
literal('nativeMobile'),
|
|
7
|
+
literal('electron'),
|
|
8
|
+
literal('linux'),
|
|
9
|
+
literal('mac'),
|
|
10
|
+
literal('win'),
|
|
11
|
+
literal('chrome'),
|
|
12
|
+
literal('firefox'),
|
|
13
|
+
literal('opera'),
|
|
14
|
+
literal('safari'),
|
|
15
|
+
literal('webkit'),
|
|
16
|
+
literal('ios'),
|
|
17
|
+
literal('ipad'),
|
|
18
|
+
literal('iphone'),
|
|
19
|
+
literal('ipod'),
|
|
20
|
+
literal('winphone'),
|
|
21
|
+
literal('blackberry'),
|
|
22
|
+
]);
|
|
23
|
+
const PERMISSION_SCHEMA = union([
|
|
24
|
+
literal('files'),
|
|
25
|
+
literal('personal info'),
|
|
26
|
+
literal('*'),
|
|
27
|
+
literal('third party'),
|
|
28
|
+
]);
|
|
29
|
+
const CATEGORY_SCHEMA = union([
|
|
30
|
+
literal('theme'),
|
|
31
|
+
literal('extension'),
|
|
32
|
+
literal('language pack'),
|
|
33
|
+
literal('other'),
|
|
34
|
+
]);
|
|
35
|
+
const GIT_SOURCE_SCHEMA = object({
|
|
36
|
+
type: literal('git'),
|
|
37
|
+
repo: string(),
|
|
38
|
+
branch: optional(string()),
|
|
39
|
+
tag: optional(string()),
|
|
40
|
+
});
|
|
41
|
+
const LOCAL_SOURCE_SCHEMA = object({
|
|
42
|
+
type: literal('local'),
|
|
43
|
+
});
|
|
44
|
+
const SOURCE_SCHEMA = union([GIT_SOURCE_SCHEMA, LOCAL_SOURCE_SCHEMA]);
|
|
45
|
+
const COMMAND_SCHEMA = object({
|
|
46
|
+
id: string(),
|
|
47
|
+
title: string(),
|
|
48
|
+
category: optional(string()),
|
|
49
|
+
});
|
|
50
|
+
const KEYBINDING_SCHEMA = object({
|
|
51
|
+
key: string(),
|
|
52
|
+
command: string(),
|
|
53
|
+
when: optional(string()),
|
|
54
|
+
});
|
|
55
|
+
const ACTIVATION_EVENT_SCHEMA = union([literal('onStartup'), literal('*')]);
|
|
56
|
+
const JSON_SCHEMA_PROPERTY_SCHEMA = object({
|
|
57
|
+
type: string(),
|
|
58
|
+
description: optional(string()),
|
|
59
|
+
default: optional(unknown()),
|
|
60
|
+
});
|
|
61
|
+
const CONFIG_SCHEMA_SCHEMA = object({
|
|
62
|
+
type: literal('object'),
|
|
63
|
+
properties: record(string(), JSON_SCHEMA_PROPERTY_SCHEMA),
|
|
64
|
+
});
|
|
65
|
+
export const EXTENSION_MANIFEST_SCHEMA = object({
|
|
66
|
+
name: string(),
|
|
67
|
+
version: string(),
|
|
68
|
+
category: CATEGORY_SCHEMA,
|
|
69
|
+
source: SOURCE_SCHEMA,
|
|
70
|
+
author: optional(string()),
|
|
71
|
+
description: optional(string()),
|
|
72
|
+
keywords: optional(array(string())),
|
|
73
|
+
icon: optional(string()),
|
|
74
|
+
platforms: optional(array(PLATFORM_SCHEMA)),
|
|
75
|
+
permissions: optional(array(PERMISSION_SCHEMA)),
|
|
76
|
+
apiVersion: optional(string()),
|
|
77
|
+
minOrgNoteVersion: optional(string()),
|
|
78
|
+
license: optional(string()),
|
|
79
|
+
sponsor: optional(array(string())),
|
|
80
|
+
readmeFilePath: optional(string()),
|
|
81
|
+
reloadRequired: optional(boolean()),
|
|
82
|
+
development: optional(boolean()),
|
|
83
|
+
commands: optional(array(COMMAND_SCHEMA)),
|
|
84
|
+
keybindings: optional(array(KEYBINDING_SCHEMA)),
|
|
85
|
+
activationEvents: optional(array(ACTIVATION_EVENT_SCHEMA)),
|
|
86
|
+
dependencies: optional(record(string(), string())),
|
|
87
|
+
configSchema: optional(CONFIG_SCHEMA_SCHEMA),
|
|
88
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { DiskFile } from './file-system.js';
|
|
3
|
+
import type { FileGuard, ValidationError } from './file-guard.js';
|
|
4
|
+
import type { StoreDefinition } from './store.js';
|
|
5
|
+
export interface FileGuardStore {
|
|
6
|
+
guards: Ref<FileGuard[]>;
|
|
7
|
+
register(guard: FileGuard): void;
|
|
8
|
+
unregister(id: string): void;
|
|
9
|
+
getGuard(path: string, file?: DiskFile): FileGuard | undefined;
|
|
10
|
+
isReadOnly(path: string, file?: DiskFile): boolean;
|
|
11
|
+
getReadOnlyReason(path: string, file?: DiskFile): string | undefined;
|
|
12
|
+
validate(path: string, content: string | Uint8Array, file?: DiskFile): Promise<ValidationError[]>;
|
|
13
|
+
}
|
|
14
|
+
export type FileGuardStoreDefinition = StoreDefinition<FileGuardStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DiskFile } from './file-system.js';
|
|
2
|
+
export type ValidationSeverity = 'error' | 'warning';
|
|
3
|
+
export interface ValidationError {
|
|
4
|
+
message: string;
|
|
5
|
+
severity: ValidationSeverity;
|
|
6
|
+
line?: number;
|
|
7
|
+
column?: number;
|
|
8
|
+
endLine?: number;
|
|
9
|
+
endColumn?: number;
|
|
10
|
+
}
|
|
11
|
+
export type FileValidatorFn = (content: string | Uint8Array) => Promise<ValidationError[]>;
|
|
12
|
+
export type FileMatcherFn = (path: string, file?: DiskFile) => boolean;
|
|
13
|
+
export type FilePolicySource = 'system' | 'user' | 'extension';
|
|
14
|
+
export interface FileGuard {
|
|
15
|
+
id: string;
|
|
16
|
+
matcher: FileMatcherFn;
|
|
17
|
+
validator?: FileValidatorFn;
|
|
18
|
+
readonly?: boolean;
|
|
19
|
+
reason?: string;
|
|
20
|
+
source?: FilePolicySource;
|
|
21
|
+
}
|
|
22
|
+
export type ValidationStatus = 'idle' | 'validating' | 'valid' | 'invalid';
|
|
23
|
+
export interface ValidationState {
|
|
24
|
+
status: ValidationStatus;
|
|
25
|
+
errors: ValidationError[];
|
|
26
|
+
lastValidContent?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { StoreDefinition } from './store.js';
|
|
2
|
+
import { Ref, ShallowRef } from 'vue';
|
|
3
|
+
import { DiskFile } from './file-system.js';
|
|
4
4
|
export interface FileManagerStore {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
createFolder: (
|
|
10
|
-
|
|
11
|
-
stopEdit: () => void;
|
|
12
|
-
expandedNodes: Ref<string[]>;
|
|
5
|
+
path: Ref<string>;
|
|
6
|
+
focusFile: ShallowRef<DiskFile | undefined>;
|
|
7
|
+
focusDirPath: Ref<string>;
|
|
8
|
+
deleteFile: (path?: string) => Promise<void>;
|
|
9
|
+
createFolder: (path?: string) => Promise<void>;
|
|
10
|
+
createFile: (path?: string) => Promise<void>;
|
|
13
11
|
}
|
|
14
|
-
export type
|
|
12
|
+
export type FileManagerStoreDefinition = StoreDefinition<FileManagerStore>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
3
|
-
|
|
1
|
+
import { StoreDefinition } from './store.js';
|
|
2
|
+
export interface FileReaderStore {
|
|
3
|
+
addReader: (readerMatch: string, reader: (path: string) => Promise<void>) => void;
|
|
4
|
+
addReaders: (readers: Record<string, (path: string) => Promise<void>>) => void;
|
|
5
|
+
openFile: (path: string) => Promise<void>;
|
|
4
6
|
}
|
|
5
|
-
export type
|
|
7
|
+
export type FileReaderStoreDefinition = StoreDefinition<FileReaderStore>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { FileSystemInfo, FileSystem } from './file-system.js';
|
|
3
|
+
import { StoreDefinition } from './store.js';
|
|
4
|
+
import { ComputedRef } from 'vue';
|
|
5
|
+
export interface FileSystemManagerStore {
|
|
6
|
+
register(fs: FileSystemInfo): void;
|
|
7
|
+
currentFsInfo: ComputedRef<FileSystemInfo | undefined>;
|
|
8
|
+
currentFs: ComputedRef<FileSystem | undefined>;
|
|
9
|
+
fileSystems: ComputedRef<FileSystemInfo[]>;
|
|
10
|
+
currentFsName: Ref<string>;
|
|
11
|
+
useFs: (fsName: string) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export type FileSystemManagerStoreDefinition = StoreDefinition<FileSystemManagerStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OrgNoteEncryption } from './encryption.js';
|
|
2
|
+
import { StoreDefinition } from './store.js';
|
|
3
|
+
import { DiskFile } from './file-system.js';
|
|
4
|
+
import { Ref } from 'vue';
|
|
5
|
+
export interface FileSystemStore {
|
|
6
|
+
readFile: <T extends 'utf8' | 'binary'>(path: string | string[], encoding?: T) => Promise<(T extends 'utf8' ? string : Uint8Array) | undefined>;
|
|
7
|
+
writeFile(path: string | string[], content: string | Uint8Array, encryptionConfig?: OrgNoteEncryption): Promise<void>;
|
|
8
|
+
syncFile<T extends string | Uint8Array>(path: string | string[], content: T, time: number, encryptionConfig?: OrgNoteEncryption): Promise<T | undefined>;
|
|
9
|
+
rename(path: string | string[], newPath: string | string[]): Promise<void>;
|
|
10
|
+
deleteFile(path: string | string[]): Promise<void>;
|
|
11
|
+
removeAllFiles: () => Promise<void>;
|
|
12
|
+
mkdir(path: string | string[]): Promise<void>;
|
|
13
|
+
rmdir(path: string | string[]): Promise<void>;
|
|
14
|
+
fileInfo(path: string | string[]): Promise<DiskFile | undefined>;
|
|
15
|
+
readDir(path?: string | string[]): Promise<DiskFile[]>;
|
|
16
|
+
dropFileSystem: () => Promise<void>;
|
|
17
|
+
prettyVault: Ref<string>;
|
|
18
|
+
}
|
|
19
|
+
export type FileSystemStoreDefinition = StoreDefinition<FileSystemStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/file-system.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { OrgNoteApi } from "../api.js";
|
|
2
|
+
export type FileSystemChangeType = 'create' | 'modify' | 'delete' | 'rename';
|
|
3
|
+
export interface FileSystemChange {
|
|
4
|
+
path: string;
|
|
5
|
+
type: FileSystemChangeType;
|
|
6
|
+
mtime?: number;
|
|
7
|
+
previousPath?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface WatcherHandle {
|
|
10
|
+
stop: () => Promise<void> | void;
|
|
11
|
+
}
|
|
12
|
+
export interface DiskFile {
|
|
3
13
|
name: string;
|
|
4
14
|
path: string;
|
|
5
15
|
type: 'directory' | 'file';
|
|
@@ -15,11 +25,22 @@ export declare class ErrorDirectoryNotFound extends Error {
|
|
|
15
25
|
export declare class ErrorFileNotFound extends Error {
|
|
16
26
|
constructor(path: string);
|
|
17
27
|
}
|
|
28
|
+
export type FileSystemPlatform = 'android' | 'ios' | 'mobile' | 'desktop' | 'web' | 'all';
|
|
29
|
+
export interface FileSystemInfo {
|
|
30
|
+
name: string;
|
|
31
|
+
fs: (api?: OrgNoteApi) => FileSystem;
|
|
32
|
+
type?: FileSystemPlatform;
|
|
33
|
+
description?: string;
|
|
34
|
+
initialVault?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface FileSystemParams {
|
|
37
|
+
root?: string;
|
|
38
|
+
}
|
|
18
39
|
export interface FileSystem {
|
|
19
40
|
readFile: <T extends 'utf8' | 'binary' = 'utf8', R = T extends 'utf8' ? string : Uint8Array>(path: string, encoding?: T) => Promise<R>;
|
|
20
41
|
writeFile: (path: string, content: string | Uint8Array, encoding?: BufferEncoding) => Promise<void>;
|
|
21
|
-
readDir: (path: string) => Promise<
|
|
22
|
-
fileInfo: (path: string) => Promise<
|
|
42
|
+
readDir: (path: string) => Promise<DiskFile[]>;
|
|
43
|
+
fileInfo: (path: string) => Promise<DiskFile | undefined>;
|
|
23
44
|
rename: (path: string, newPath: string) => Promise<void>;
|
|
24
45
|
deleteFile: (path: string) => Promise<void>;
|
|
25
46
|
rmdir: (path: string) => Promise<void>;
|
|
@@ -27,5 +48,11 @@ export interface FileSystem {
|
|
|
27
48
|
isDirExist: (path: string) => Promise<boolean>;
|
|
28
49
|
isFileExist: (path: string) => Promise<boolean>;
|
|
29
50
|
utimeSync: (path: string, atime?: string | number | Date, mtime?: string | number | Date) => Promise<void>;
|
|
30
|
-
init?:
|
|
51
|
+
init?: (params?: FileSystemParams) => Promise<FileSystemParams | void>;
|
|
52
|
+
mount?: (params?: FileSystemParams) => Promise<boolean>;
|
|
53
|
+
pickFolder?: () => Promise<string>;
|
|
54
|
+
prettifyPath?: (path: string) => string;
|
|
55
|
+
wipe?: () => Promise<void>;
|
|
56
|
+
watch?: (listener: (change: FileSystemChange) => void, params?: FileSystemParams) => WatcherHandle | Promise<WatcherHandle>;
|
|
57
|
+
copyFile?: (src: string, dest: string) => Promise<void>;
|
|
31
58
|
}
|
package/models/file-system.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export class ErrorDirectoryNotFound extends Error {
|
|
2
2
|
constructor(path) {
|
|
3
3
|
super(`Directory not found: ${path}`);
|
|
4
|
+
this.name = 'ErrorDirectoryNotFound';
|
|
4
5
|
}
|
|
5
6
|
}
|
|
6
7
|
export class ErrorFileNotFound extends Error {
|
|
7
8
|
constructor(path) {
|
|
8
9
|
super(`File not found: ${path}`);
|
|
10
|
+
this.name = 'ErrorFileNotFound';
|
|
9
11
|
}
|
|
10
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { StoreDefinition } from './store.js';
|
|
3
|
+
import { FileSystemChange } from './file-system.js';
|
|
4
|
+
export interface FileWatcherStartOptions {
|
|
5
|
+
interval?: number;
|
|
6
|
+
fileFilter?: (path: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FileWatcherWatchOptions {
|
|
9
|
+
recursive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type FileWatcherListener = (change: FileSystemChange) => void;
|
|
12
|
+
export interface FileWatcherStore {
|
|
13
|
+
isWatching: Ref<boolean>;
|
|
14
|
+
start: (options?: FileWatcherStartOptions) => Promise<void>;
|
|
15
|
+
stop: () => Promise<void>;
|
|
16
|
+
watch: (path: string, listener: FileWatcherListener, options?: FileWatcherWatchOptions) => () => void;
|
|
17
|
+
}
|
|
18
|
+
export type FileWatcherStoreDefinition = StoreDefinition<FileWatcherStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/files-store.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoreDefinition } from './store.js';
|
|
2
2
|
export interface FilesStore {
|
|
3
3
|
getBlobUrl: (filePath: string) => Promise<string>;
|
|
4
4
|
uploadMediaFile: (path?: string) => Promise<string>;
|
|
5
5
|
saveFile: (file: File, path?: string) => Promise<string>;
|
|
6
6
|
}
|
|
7
|
-
export type FilesStoreDefinition =
|
|
7
|
+
export type FilesStoreDefinition = StoreDefinition<FilesStore>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref, ShallowRef } from 'vue';
|
|
2
|
+
import { StoreDefinition } from './store.js';
|
|
3
|
+
import { GitProviderInfo, GitRepoConfig, GitRepoHandle } from './git.js';
|
|
4
|
+
export interface GitStore {
|
|
5
|
+
providers: ShallowRef<Record<string, GitProviderInfo>>;
|
|
6
|
+
currentProviderId: Ref<string>;
|
|
7
|
+
registerProvider: (info: GitProviderInfo) => void;
|
|
8
|
+
unregisterProvider: (id: string) => void;
|
|
9
|
+
setProvider: (id: string) => void;
|
|
10
|
+
openRepo: (config: GitRepoConfig) => Promise<GitRepoHandle>;
|
|
11
|
+
}
|
|
12
|
+
export type GitStoreDefinition = StoreDefinition<GitStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/git.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface GitFile {
|
|
2
|
+
path: string;
|
|
3
|
+
hash: string;
|
|
4
|
+
type: 'file' | 'directory';
|
|
5
|
+
}
|
|
6
|
+
export interface GitCommit {
|
|
7
|
+
hash: string;
|
|
8
|
+
message: string;
|
|
9
|
+
tree?: string;
|
|
10
|
+
author: GitPerson;
|
|
11
|
+
timestamp: number;
|
|
12
|
+
}
|
|
13
|
+
export interface GitPerson {
|
|
14
|
+
name: string;
|
|
15
|
+
email: string;
|
|
16
|
+
timezoneOffset?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GitRepoConfig {
|
|
19
|
+
url: string;
|
|
20
|
+
branch?: string;
|
|
21
|
+
corsProxy?: string;
|
|
22
|
+
auth?: {
|
|
23
|
+
username?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface GitProviderOptions {
|
|
28
|
+
corsProxy: string;
|
|
29
|
+
}
|
|
30
|
+
export interface GitRepoHandle {
|
|
31
|
+
readonly config: GitRepoConfig;
|
|
32
|
+
readFile: <T extends 'utf8' | 'binary' = 'utf8', R = T extends 'utf8' ? string : Uint8Array>(path: string, encoding?: T) => Promise<R>;
|
|
33
|
+
listDirectory: (dirPath: string) => Promise<GitFile[]>;
|
|
34
|
+
iterateFiles: (dirPath: string, filter?: (file: GitFile) => boolean) => AsyncGenerator<{
|
|
35
|
+
file: GitFile;
|
|
36
|
+
content: string;
|
|
37
|
+
}>;
|
|
38
|
+
fileExists: (path: string) => Promise<boolean>;
|
|
39
|
+
getLatestCommit: () => Promise<GitCommit>;
|
|
40
|
+
refresh: () => Promise<void>;
|
|
41
|
+
close: () => void;
|
|
42
|
+
}
|
|
43
|
+
export interface GitProviderInfo {
|
|
44
|
+
id: string;
|
|
45
|
+
openRepo: (config: GitRepoConfig, options?: GitProviderOptions) => Promise<GitRepoHandle>;
|
|
46
|
+
description?: string;
|
|
47
|
+
}
|
package/models/git.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/index.d.ts
CHANGED
|
@@ -11,14 +11,68 @@ export * from './default-commands.js';
|
|
|
11
11
|
export * from './encryption.js';
|
|
12
12
|
export * from './file-system.js';
|
|
13
13
|
export * from './sync.js';
|
|
14
|
-
export * from './file-
|
|
14
|
+
export * from './file-info.js';
|
|
15
15
|
export * from './file-path.js';
|
|
16
|
-
export * from './file-tree.js';
|
|
17
16
|
export * from './user.js';
|
|
18
17
|
export * from './oauth-provider.js';
|
|
18
|
+
export * from './orgnote-config.js';
|
|
19
|
+
export * from './platform-specific.js';
|
|
20
|
+
export * from './css-utils.js';
|
|
21
|
+
export * from './i18n-keys.js';
|
|
22
|
+
export * from './vue-component.js';
|
|
23
|
+
export * from './file-upload.js';
|
|
24
|
+
export * from './confirmation-modal.js';
|
|
25
|
+
export * from './pane.js';
|
|
26
|
+
export * from './buffer.js';
|
|
27
|
+
export * from './log.js';
|
|
28
|
+
export * from './logger.js';
|
|
29
|
+
export * from './layout.js';
|
|
30
|
+
export * from './menu-action.js';
|
|
31
|
+
export * from './queue-task.js';
|
|
32
|
+
export * from './cron-task.js';
|
|
33
|
+
export * from './platform.js';
|
|
34
|
+
export * from './platform-detection.js';
|
|
35
|
+
export * from './git.js';
|
|
36
|
+
export * from './file-guard.js';
|
|
37
|
+
export * from './file-guard-store.js';
|
|
38
|
+
export * from './splash-screen.js';
|
|
39
|
+
export * from './screen-detection.js';
|
|
40
|
+
export * from './system-info.js';
|
|
19
41
|
export * from './sync-store.js';
|
|
20
42
|
export * from './files-store.js';
|
|
21
43
|
export * from './file-opener-store.js';
|
|
22
44
|
export * from './file-manager-store.js';
|
|
23
45
|
export * from './auth-store.js';
|
|
46
|
+
export * from './commands-store.js';
|
|
47
|
+
export * from './commands-group-store.js';
|
|
48
|
+
export * from './extension-store.js';
|
|
49
|
+
export * from './file-system-store.js';
|
|
50
|
+
export * from './file-watcher-store.js';
|
|
51
|
+
export * from './settings-store.js';
|
|
52
|
+
export * from './encryption-store.js';
|
|
53
|
+
export * from './ui-store.js';
|
|
54
|
+
export * from './sidebar-store.js';
|
|
55
|
+
export * from './toolbar-store.js';
|
|
56
|
+
export * from './modal-store.js';
|
|
57
|
+
export * from './settings-ui-store.js';
|
|
58
|
+
export * from './completion-store.js';
|
|
59
|
+
export * from './panes-store.js';
|
|
60
|
+
export * from './layout-store.js';
|
|
61
|
+
export * from './file-system-manager-store.js';
|
|
62
|
+
export * from './config-store.js';
|
|
63
|
+
export * from './notifications-store.js';
|
|
64
|
+
export * from './notification-config.js';
|
|
65
|
+
export * from './buffer-store.js';
|
|
66
|
+
export * from './log-store.js';
|
|
67
|
+
export * from './context-menu-store.js';
|
|
68
|
+
export * from './queue-store.js';
|
|
69
|
+
export * from './cron-store.js';
|
|
70
|
+
export * from './git-store.js';
|
|
71
|
+
export * from './extension-registry-store.js';
|
|
72
|
+
export * from './theme-store.js';
|
|
73
|
+
export * from './style-variant.js';
|
|
74
|
+
export * from './style-size.js';
|
|
24
75
|
export * from './repositories.js';
|
|
76
|
+
export * from './log-repository.js';
|
|
77
|
+
export * from './layout-snapshot-repository.js';
|
|
78
|
+
export * from './orgnote-url.js';
|