orgnote-api 0.8.3-beta.2 → 0.8.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.
@@ -9,10 +9,14 @@ exports[`Should decrypt note content via password 1`] = `
9
9
  "encrypted": "gpgPassword",
10
10
  "id": "id",
11
11
  "meta": {
12
- "description": "Awesome description",
13
- "images": [],
14
- "published": undefined,
15
- "title": "My note title",
12
+ "headings": [
13
+ {
14
+ "level": 1,
15
+ "title": "Hello?",
16
+ },
17
+ ],
18
+ "id": "qweqwe",
19
+ "title": "Hello worlld",
16
20
  },
17
21
  }
18
22
  `;
@@ -26,10 +30,14 @@ exports[`Should decrypt note via provided keys 1`] = `
26
30
  "encrypted": "gpgKeys",
27
31
  "id": "id",
28
32
  "meta": {
29
- "description": "Awesome description",
30
- "images": [],
31
- "published": undefined,
32
- "title": "My note title for decryption via keys",
33
+ "headings": [
34
+ {
35
+ "level": 1,
36
+ "title": "Hello?",
37
+ },
38
+ ],
39
+ "id": "qweqwe",
40
+ "title": "Hello worlld",
33
41
  },
34
42
  }
35
43
  `;
@@ -259,3 +259,37 @@ test('Should not decrypt note without provided encrypted type', async () => {
259
259
 
260
260
  expect(decryptedNote).toMatchSnapshot();
261
261
  });
262
+
263
+ test('Should decrypt note and note meta', async () => {
264
+ const meta = {
265
+ title: 'My note title',
266
+ images: ['./image1.png'],
267
+ published: false,
268
+ description: 'Awesome description',
269
+ fileTags: ['tag1', 'tag2'],
270
+ };
271
+ const note: Note = {
272
+ id: 'id',
273
+ meta: { ...meta },
274
+ content: `#+TITLE: My note title
275
+ #+DESCRIPTION: Awesome description
276
+ #+PUBLISHED: false
277
+ #+FILETAGS: :tag1:tag2:
278
+
279
+ [[./image1.png]]
280
+
281
+ Hello world`,
282
+ };
283
+
284
+ const encryptedNote = await encryptNote(note, {
285
+ type: 'gpgPassword',
286
+ password: '123',
287
+ });
288
+
289
+ const decryptedNote = await decryptNote(encryptedNote, {
290
+ type: 'gpgPassword',
291
+ password: '123',
292
+ });
293
+
294
+ expect(meta).toEqual(decryptedNote.meta);
295
+ });
@@ -99,7 +99,7 @@ export async function decryptNote<T extends AbstractEncryptedNote>(
99
99
 
100
100
  return {
101
101
  ...decryptedNote,
102
- meta: { ...decryptedNote.meta, published: parsed.meta.published },
102
+ meta: parsed.meta,
103
103
  };
104
104
  }
105
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.8.3-beta.2",
3
+ "version": "0.8.3",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -40,7 +40,7 @@
40
40
  "axios": "1.6.7",
41
41
  "codemirror": "6.0.1",
42
42
  "openpgp": "5.11.1",
43
- "org-mode-ast": "0.11.3-beta.0",
43
+ "org-mode-ast": "0.11.2",
44
44
  "vue": "^3.4.15",
45
45
  "vue-router": "4.2.5"
46
46
  },
@@ -0,0 +1,4 @@
1
+ wwwroot/*.js
2
+ node_modules
3
+ typings
4
+ dist
@@ -0,0 +1 @@
1
+ # empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm