orgnote-api 0.41.6 → 0.41.8
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/constants/i18n-keys.d.ts
CHANGED
|
@@ -149,6 +149,7 @@ export declare enum i18n {
|
|
|
149
149
|
AUTH_LOGIN_REQUIRED = "login required",
|
|
150
150
|
AUTH_ACTIVATING = "activating",
|
|
151
151
|
AUTH_ENTER_ACTIVATION_KEY = "enter activation key",
|
|
152
|
+
ACTIVATION_FAILED = "activation failed, please check your key and try again",
|
|
152
153
|
AUTH_LOGOUT = "logout",
|
|
153
154
|
AUTH_LOGOUT_DESCRIPTION = "sign out from your account",
|
|
154
155
|
AUTH_LOGIN = "login",
|
|
@@ -420,6 +421,7 @@ export declare const I18N: {
|
|
|
420
421
|
AUTH_LOGIN_REQUIRED: i18n.AUTH_LOGIN_REQUIRED;
|
|
421
422
|
AUTH_ACTIVATING: i18n.AUTH_ACTIVATING;
|
|
422
423
|
AUTH_ENTER_ACTIVATION_KEY: i18n.AUTH_ENTER_ACTIVATION_KEY;
|
|
424
|
+
ACTIVATION_FAILED: i18n.ACTIVATION_FAILED;
|
|
423
425
|
AUTH_LOGOUT: i18n.AUTH_LOGOUT;
|
|
424
426
|
AUTH_LOGOUT_DESCRIPTION: i18n.AUTH_LOGOUT_DESCRIPTION;
|
|
425
427
|
AUTH_LOGIN: i18n.AUTH_LOGIN;
|
package/constants/i18n-keys.js
CHANGED
|
@@ -156,6 +156,7 @@ export var i18n;
|
|
|
156
156
|
i18n["AUTH_LOGIN_REQUIRED"] = "login required";
|
|
157
157
|
i18n["AUTH_ACTIVATING"] = "activating";
|
|
158
158
|
i18n["AUTH_ENTER_ACTIVATION_KEY"] = "enter activation key";
|
|
159
|
+
i18n["ACTIVATION_FAILED"] = "activation failed, please check your key and try again";
|
|
159
160
|
i18n["AUTH_LOGOUT"] = "logout";
|
|
160
161
|
i18n["AUTH_LOGOUT_DESCRIPTION"] = "sign out from your account";
|
|
161
162
|
i18n["AUTH_LOGIN"] = "login";
|
package/models/auth-store.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface AuthStore {
|
|
|
15
15
|
logout: () => Promise<void>;
|
|
16
16
|
verifyUser: () => Promise<void>;
|
|
17
17
|
authUser: (u: PersonalInfo, token: string) => Promise<void>;
|
|
18
|
-
subscribe: (token: string, email?: string) => Promise<
|
|
18
|
+
subscribe: (token: string, email?: string) => Promise<boolean>;
|
|
19
19
|
removeUserAccount: () => Promise<void>;
|
|
20
20
|
}
|
|
21
21
|
export type AuthStoreDefinition = StoreDefinition<AuthStore>;
|
package/models/command.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { COMMAND_GROUPS } from "../constants/index.js";
|
|
|
3
3
|
import { DefaultCommands } from './default-commands.js';
|
|
4
4
|
import { OrgNoteApi } from "../api.js";
|
|
5
5
|
import { VueComponent } from './vue-component.js';
|
|
6
|
+
import type { ExecuteCommandOptions } from './commands-store.js';
|
|
6
7
|
export type CommandGroup = (typeof COMMAND_GROUPS)[number] | (string & Record<never, never>);
|
|
7
8
|
export type CommandName = DefaultCommands | (string & {});
|
|
8
9
|
export type CommandIcon = string | VueComponent;
|
|
@@ -33,4 +34,4 @@ export interface CommandMeta<T = any> extends Partial<CommandPreview> {
|
|
|
33
34
|
export interface Command<T = any, R = unknown> extends CommandMeta<T> {
|
|
34
35
|
handler: (api: OrgNoteApi, params: CommandHandlerParams<T>) => R | Promise<R>;
|
|
35
36
|
}
|
|
36
|
-
export type CommandCallback = <T = any>(meta: Command, data: T) => void;
|
|
37
|
+
export type CommandCallback = <T = any>(meta: Command, data: T, options?: ExecuteCommandOptions) => void;
|
|
@@ -2,12 +2,15 @@ import { Ref } from 'vue';
|
|
|
2
2
|
import { Command, CommandCallback } from './command.js';
|
|
3
3
|
import { StoreDefinition } from './store.js';
|
|
4
4
|
export type CommandUnsubscribFn = () => void;
|
|
5
|
+
export interface ExecuteCommandOptions {
|
|
6
|
+
interactive?: boolean;
|
|
7
|
+
}
|
|
5
8
|
export interface CommandsStore {
|
|
6
9
|
add: (...newCommands: Command[]) => void;
|
|
7
10
|
remove: (...commandsToUnregister: Command[]) => void;
|
|
8
11
|
get: (name: string) => Command | undefined;
|
|
9
12
|
commands: Ref<Command[]>;
|
|
10
|
-
execute: (name: string, data?: unknown) => Promise<void>;
|
|
13
|
+
execute: (name: string, data?: unknown, options?: ExecuteCommandOptions) => Promise<void>;
|
|
11
14
|
afterExecute: (commandNames: string | string[], callback: CommandCallback) => CommandUnsubscribFn;
|
|
12
15
|
}
|
|
13
16
|
export type CommandsStoreDefinition = StoreDefinition<CommandsStore>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
|
-
import { Completion, CompletionConfig } from './completion.js';
|
|
2
|
+
import { Completion, CompletionConfig, CompletionInterceptor } from './completion.js';
|
|
3
3
|
import { StoreDefinition } from './store.js';
|
|
4
4
|
export interface CompletionStore {
|
|
5
5
|
restore: () => void;
|
|
@@ -10,5 +10,6 @@ export interface CompletionStore {
|
|
|
10
10
|
nextCandidate: () => void;
|
|
11
11
|
previousCandidate: () => void;
|
|
12
12
|
search: (limit?: number, offset?: number) => void;
|
|
13
|
+
registerInterceptor: <T = unknown>(interceptor: CompletionInterceptor<T>) => () => void;
|
|
13
14
|
}
|
|
14
15
|
export type CompletionStoreDefinition = StoreDefinition<CompletionStore>;
|
package/models/completion.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface CompletionSearchResult<T = unknown> {
|
|
|
14
14
|
}
|
|
15
15
|
export type CandidateGetterFn<T = unknown> = (filter: string, limit?: number, offset?: number) => CompletionSearchResult<T> | Promise<CompletionSearchResult<T>>;
|
|
16
16
|
export interface CompletionConfig<T = unknown> {
|
|
17
|
+
name?: string;
|
|
17
18
|
searchAutocompletions?: string[];
|
|
18
19
|
itemsGetter: CandidateGetterFn<T>;
|
|
19
20
|
type?: 'input' | 'choice' | 'input-choice';
|
|
@@ -30,3 +31,14 @@ export interface Completion<T = any, TResult = any> extends CompletionConfig<T>
|
|
|
30
31
|
searchQuery: string;
|
|
31
32
|
result: Promise<TResult>;
|
|
32
33
|
}
|
|
34
|
+
export interface CompletionInterceptorContext {
|
|
35
|
+
completionName: string;
|
|
36
|
+
searchQuery: string;
|
|
37
|
+
}
|
|
38
|
+
export type CompletionInterceptorTarget = string | string[] | '*';
|
|
39
|
+
export interface CompletionInterceptor<T = unknown> {
|
|
40
|
+
name: string;
|
|
41
|
+
target: CompletionInterceptorTarget;
|
|
42
|
+
priority?: number;
|
|
43
|
+
handler: (candidates: CompletionCandidate<T>[], context: CompletionInterceptorContext) => CompletionCandidate<T>[] | Promise<CompletionCandidate<T>[]>;
|
|
44
|
+
}
|