orgnote-api 0.41.2 → 0.41.4

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.
@@ -159,7 +159,8 @@ export declare enum i18n {
159
159
  TOC_NO_ACTIVE_DOCUMENT = "no active document",
160
160
  TOC_NO_HEADLINES_FOUND = "no headlines found",
161
161
  PICK_NOTE_TO_LINK = "pick note to link",
162
- UNTITLED = "untitled"
162
+ UNTITLED = "untitled",
163
+ NO_SELECTED_NOTE = "no selected note"
163
164
  }
164
165
  export declare const I18N: {
165
166
  REPORT_BUG: DefaultCommands.REPORT_BUG;
@@ -276,6 +277,7 @@ export declare const I18N: {
276
277
  EDITOR_INSERT_DATETIME: DefaultCommands.EDITOR_INSERT_DATETIME;
277
278
  EDITOR_HIDE_KEYBOARD: DefaultCommands.EDITOR_HIDE_KEYBOARD;
278
279
  PREVIEW_NOTE: DefaultCommands.PREVIEW_NOTE;
280
+ SHARE_NOTE_ONETIME: DefaultCommands.SHARE_NOTE_ONETIME;
279
281
  LOADING: i18n.LOADING;
280
282
  LOADING_MESSAGE_1: i18n.LOADING_MESSAGE_1;
281
283
  LOADING_MESSAGE_2: i18n.LOADING_MESSAGE_2;
@@ -428,5 +430,6 @@ export declare const I18N: {
428
430
  TOC_NO_HEADLINES_FOUND: i18n.TOC_NO_HEADLINES_FOUND;
429
431
  PICK_NOTE_TO_LINK: i18n.PICK_NOTE_TO_LINK;
430
432
  UNTITLED: i18n.UNTITLED;
433
+ NO_SELECTED_NOTE: i18n.NO_SELECTED_NOTE;
431
434
  };
432
435
  export type I18N = i18n | DefaultCommands;
@@ -170,6 +170,7 @@ export var i18n;
170
170
  // Editor
171
171
  i18n["PICK_NOTE_TO_LINK"] = "pick note to link";
172
172
  i18n["UNTITLED"] = "untitled";
173
+ i18n["NO_SELECTED_NOTE"] = "no selected note";
173
174
  })(i18n || (i18n = {}));
174
175
  export const I18N = {
175
176
  ...i18n,
@@ -112,5 +112,6 @@ export declare enum DefaultCommands {
112
112
  EDITOR_INSERT_TAG = "insert tag",
113
113
  EDITOR_INSERT_DATETIME = "insert datetime",
114
114
  EDITOR_HIDE_KEYBOARD = "hide keyboard",
115
- PREVIEW_NOTE = "preview note"
115
+ PREVIEW_NOTE = "preview note",
116
+ SHARE_NOTE_ONETIME = "share current note one time"
116
117
  }
@@ -137,4 +137,5 @@ export var DefaultCommands;
137
137
  DefaultCommands["EDITOR_HIDE_KEYBOARD"] = "hide keyboard";
138
138
  // External commands
139
139
  DefaultCommands["PREVIEW_NOTE"] = "preview note";
140
+ DefaultCommands["SHARE_NOTE_ONETIME"] = "share current note one time";
140
141
  })(DefaultCommands || (DefaultCommands = {}));
@@ -0,0 +1,9 @@
1
+ export interface FileIndexMeta {
2
+ id: string;
3
+ indexedAt: string;
4
+ fileModifiedAt: string;
5
+ }
6
+ export interface StoredIndex {
7
+ version: number;
8
+ files: Record<string, FileIndexMeta>;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
package/models/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './file-meta.js';
2
+ export * from './file-index.js';
2
3
  export * from './command.js';
3
4
  export * from './completion.js';
4
5
  export * from './extension.js';
package/models/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./file-meta.js";
2
+ export * from "./file-index.js";
2
3
  export * from "./command.js";
3
4
  export * from "./completion.js";
4
5
  export * from "./extension.js";
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { QueueTask } from './queue-task.js';
2
+ import { QueueTask, DeduplicationStrategy } from './queue-task.js';
3
3
  import { StoreDefinition } from './store.js';
4
4
  export type ProcessCallback = (err?: unknown, result?: unknown) => void;
5
5
  export type ProcessFn = (task: unknown, cb: ProcessCallback) => void;
@@ -17,8 +17,10 @@ export interface QueueCreationOptions {
17
17
  autoResume?: boolean;
18
18
  failTaskOnProcessException?: boolean;
19
19
  process?: ProcessFn;
20
+ deduplicationStrategy?: DeduplicationStrategy;
20
21
  }
21
22
  export interface QueueTaskOptions {
23
+ id?: string;
22
24
  priority?: number;
23
25
  delay?: number;
24
26
  timeout?: number;
@@ -36,9 +38,9 @@ export interface QueueStore {
36
38
  unregister(queueId?: string): void;
37
39
  getQueue(queueId?: string): unknown | undefined;
38
40
  destroy(queueId?: string): void;
39
- add(payload: unknown, options?: QueueTaskOptions, queueId?: string): Promise<string>;
41
+ add(queueId: string, payload: unknown, options?: QueueTaskOptions): Promise<string>;
40
42
  getAll(queueId?: string): Promise<QueueTask[]>;
41
- get(taskId: string, queueId?: string): Promise<QueueTask | undefined>;
43
+ get(queueId: string, taskId: string): Promise<QueueTask | undefined>;
42
44
  remove(taskId: string, queueId?: string): Promise<void>;
43
45
  pause(queueId?: string): void;
44
46
  resume(queueId?: string): void;
@@ -1,4 +1,5 @@
1
1
  export type QueueStatus = 'completed' | 'failed' | 'pending' | 'processing' | 'canceled';
2
+ export type DeduplicationStrategy = 'skip' | 'replace' | 'moveToEnd';
2
3
  export interface QueueTask<T = unknown> {
3
4
  id: string;
4
5
  payload: T;
@@ -1,8 +1,8 @@
1
+ import { QueueTask } from './queue-task.js';
1
2
  import { ExtensionSource } from './extension.js';
2
3
  import { FileMeta } from './file-meta.js';
3
4
  import { LayoutSnapshotRepository } from './layout-snapshot-repository.js';
4
5
  import { LoggerRepository } from './log-repository.js';
5
- import { QueueTask } from './queue-task.js';
6
6
  export interface ExtensionSourceRepository {
7
7
  get(extensionName: string): Promise<ExtensionSource | undefined>;
8
8
  getBySource(source: string): Promise<ExtensionSource | undefined>;
@@ -37,6 +37,7 @@ export interface QueueRepository {
37
37
  get(id: string): Promise<QueueTask | undefined>;
38
38
  getAll(queueId?: string): Promise<QueueTask[]>;
39
39
  delete(id: string, force?: boolean): Promise<void>;
40
+ update(id: string, updates: Partial<QueueTask>): Promise<void>;
40
41
  lock(id: string): Promise<void>;
41
42
  release(id: string): Promise<void>;
42
43
  takeFirstN(n: number, queueId: string): Promise<string>;
@@ -47,7 +48,6 @@ export interface QueueRepository {
47
48
  [id: string]: QueueTask;
48
49
  }>;
49
50
  clear(queueId: string): Promise<void>;
50
- setStatus: (id: string, status: string) => Promise<void>;
51
51
  }
52
52
  export interface KeyValueRepository {
53
53
  get(key: string): Promise<string | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.41.2",
3
+ "version": "0.41.4",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.js",