orgnote-api 0.6.0 → 0.7.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.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  OrgLineClass,
9
9
  WidgetBuilder,
10
10
  CommandPreview,
11
+ OrgNoteEncryption,
11
12
  } from './models';
12
13
  import type { NavigationFailure } from 'vue-router';
13
14
  import { WidgetType } from './models/widget-type';
@@ -77,27 +78,6 @@ export interface OrgNoteApi {
77
78
  configuration: () => OrgNoteConfig;
78
79
  }
79
80
 
80
- export interface OrgNoteGpgEncryption {
81
- type: 'gpg';
82
- privateKey: string;
83
- publicKey: string;
84
- privateKeyPassphrase?: string;
85
- }
86
-
87
- export interface OrgNotePasswordEncryption {
88
- type: 'password';
89
- password: string;
90
- }
91
-
92
- export interface OrgNoteDisabledEncryption {
93
- type: 'disabled';
94
- }
95
-
96
- export type OrgNoteEncryption =
97
- | OrgNoteGpgEncryption
98
- | OrgNotePasswordEncryption
99
- | OrgNoteDisabledEncryption;
100
-
101
81
  export interface OrgNoteConfig {
102
82
  editor: {
103
83
  showSpecialSymbols: boolean;
package/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './api';
2
2
  export * from './models';
3
3
  import type * as ast from 'org-mode-ast';
4
+ export * from './encryption';
4
5
  export { ast };
@@ -0,0 +1,22 @@
1
+ import type { ModelsPublicNoteEncryptedEnum } from 'src/remote-api';
2
+
3
+ export interface OrgNoteGpgEncryption {
4
+ type: typeof ModelsPublicNoteEncryptedEnum.GpgKeys;
5
+ privateKey: string;
6
+ publicKey: string;
7
+ privateKeyPassphrase?: string;
8
+ }
9
+
10
+ export interface OrgNotePasswordEncryption {
11
+ type: typeof ModelsPublicNoteEncryptedEnum.GpgPassword;
12
+ password: string;
13
+ }
14
+
15
+ export interface OrgNoteDisabledEncryption {
16
+ type: typeof ModelsPublicNoteEncryptedEnum.Disabled;
17
+ }
18
+
19
+ export type OrgNoteEncryption =
20
+ | OrgNoteGpgEncryption
21
+ | OrgNotePasswordEncryption
22
+ | OrgNoteDisabledEncryption;
package/models/index.ts CHANGED
@@ -8,3 +8,4 @@ export * from './modal';
8
8
  export * from './widget-type';
9
9
  export * from './editor';
10
10
  export * from './default-commands';
11
+ export * from './encryption';
package/models/modal.ts CHANGED
@@ -1,4 +1,5 @@
1
- export interface ModalConfig {
1
+ export interface ModalConfig<T = any> {
2
2
  closable?: boolean;
3
3
  title?: string;
4
+ modalProps?: T;
4
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -32,6 +32,7 @@
32
32
  "dependencies": {
33
33
  "axios": "1.6.7",
34
34
  "codemirror": "6.0.1",
35
+ "openpgp": "5.11.1",
35
36
  "org-mode-ast": "0.11.2",
36
37
  "vue": "^3.4.15",
37
38
  "vue-router": "4.2.5"
package/remote-api/api.ts CHANGED
@@ -54,6 +54,12 @@ export interface HandlersCreatingNote {
54
54
  * @memberof HandlersCreatingNote
55
55
  */
56
56
  'createdAt'?: string;
57
+ /**
58
+ *
59
+ * @type {string}
60
+ * @memberof HandlersCreatingNote
61
+ */
62
+ 'encrypted'?: HandlersCreatingNoteEncryptedEnum;
57
63
  /**
58
64
  *
59
65
  * @type {Array<string>}
@@ -85,6 +91,14 @@ export interface HandlersCreatingNote {
85
91
  */
86
92
  'updatedAt'?: string;
87
93
  }
94
+
95
+ export const HandlersCreatingNoteEncryptedEnum = {
96
+ Gpg: 'gpg',
97
+ Password: 'password'
98
+ } as const;
99
+
100
+ export type HandlersCreatingNoteEncryptedEnum = typeof HandlersCreatingNoteEncryptedEnum[keyof typeof HandlersCreatingNoteEncryptedEnum];
101
+
88
102
  /**
89
103
  *
90
104
  * @export
@@ -623,7 +637,9 @@ export interface ModelsPublicNote {
623
637
  }
624
638
 
625
639
  export const ModelsPublicNoteEncryptedEnum = {
626
- Gpg: 'gpg'
640
+ GpgKeys: 'gpgKeys',
641
+ GpgPassword: 'gpgPassword',
642
+ Disabled: 'disabled'
627
643
  } as const;
628
644
 
629
645
  export type ModelsPublicNoteEncryptedEnum = typeof ModelsPublicNoteEncryptedEnum[keyof typeof ModelsPublicNoteEncryptedEnum];
@@ -19,7 +19,7 @@ import type { Configuration } from './configuration';
19
19
  import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
20
20
  import globalAxios from 'axios';
21
21
 
22
- export const BASE_PATH = "http://org-note.com/api/v1".replace(/\/+$/, "");
22
+ export const BASE_PATH = "http://localhost:8000/v1".replace(/\/+$/, "");
23
23
 
24
24
  /**
25
25
  *