orgnote-api 0.41.3 → 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.
@@ -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.3",
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",