orgnote-api 0.7.2 → 0.7.3

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.
@@ -13,7 +13,7 @@ import { parse, withMetaInfo } from 'org-mode-ast';
13
13
 
14
14
  export interface AbstractEncryptedNote {
15
15
  content: string;
16
- encrypted: ModelsPublicNote['encrypted'];
16
+ encrypted?: ModelsPublicNote['encrypted'];
17
17
  meta: {
18
18
  [key: string]: any;
19
19
  published: boolean;
@@ -25,6 +25,7 @@ export async function encryptNote<T extends AbstractEncryptedNote>(
25
25
  encryptionParams: OrgNoteEncryption
26
26
  ): Promise<T> {
27
27
  if (
28
+ !encryptionParams.type ||
28
29
  encryptionParams.type === ModelsPublicNoteEncryptedEnum.Disabled ||
29
30
  note.meta.published
30
31
  ) {
@@ -79,7 +80,10 @@ export async function decryptNote<T extends AbstractEncryptedNote>(
79
80
  note: T,
80
81
  encryptionParams: OrgNoteEncryption
81
82
  ): Promise<T> {
82
- if (encryptionParams.type === ModelsPublicNoteEncryptedEnum.Disabled) {
83
+ if (
84
+ !encryptionParams.type ||
85
+ encryptionParams.type === ModelsPublicNoteEncryptedEnum.Disabled
86
+ ) {
83
87
  return note;
84
88
  }
85
89
  const decryptedNote =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.ts",