orgnote-api 0.50.2 → 0.50.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.
@@ -124,6 +124,8 @@ export declare enum i18n {
124
124
  ALL_AVAILABLE = "all available",
125
125
  NO_EXTENSIONS_INSTALLED = "no extensions installed",
126
126
  NO_EXTENSIONS_AVAILABLE = "no extensions available",
127
+ NO_EXTENSION_SETTINGS = "no extension settings",
128
+ EXTENSION_SETTINGS = "extension settings",
127
129
  INSTALL_FROM_URL = "install from URL",
128
130
  ENTER_GIT_REPO_URL = "enter git repository URL",
129
131
  DELETE_EXTENSION = "delete extension",
@@ -359,6 +361,7 @@ export declare const I18N: {
359
361
  CLEAR_PERFORMANCE_REPORT: DefaultCommands.CLEAR_PERFORMANCE_REPORT;
360
362
  IMPORT_EXTENSION: DefaultCommands.IMPORT_EXTENSION;
361
363
  OPEN_EXTENSIONS_MANAGER: DefaultCommands.OPEN_EXTENSIONS_MANAGER;
364
+ OPEN_EXTENSION_SETTINGS: DefaultCommands.OPEN_EXTENSION_SETTINGS;
362
365
  OPEN_NOTIFICATIONS: DefaultCommands.OPEN_NOTIFICATIONS;
363
366
  LOGIN: DefaultCommands.LOGIN;
364
367
  LOGOUT: DefaultCommands.LOGOUT;
@@ -506,6 +509,8 @@ export declare const I18N: {
506
509
  ALL_AVAILABLE: i18n.ALL_AVAILABLE;
507
510
  NO_EXTENSIONS_INSTALLED: i18n.NO_EXTENSIONS_INSTALLED;
508
511
  NO_EXTENSIONS_AVAILABLE: i18n.NO_EXTENSIONS_AVAILABLE;
512
+ NO_EXTENSION_SETTINGS: i18n.NO_EXTENSION_SETTINGS;
513
+ EXTENSION_SETTINGS: i18n.EXTENSION_SETTINGS;
509
514
  INSTALL_FROM_URL: i18n.INSTALL_FROM_URL;
510
515
  ENTER_GIT_REPO_URL: i18n.ENTER_GIT_REPO_URL;
511
516
  DELETE_EXTENSION: i18n.DELETE_EXTENSION;
@@ -126,6 +126,8 @@ export var i18n;
126
126
  i18n["ALL_AVAILABLE"] = "all available";
127
127
  i18n["NO_EXTENSIONS_INSTALLED"] = "no extensions installed";
128
128
  i18n["NO_EXTENSIONS_AVAILABLE"] = "no extensions available";
129
+ i18n["NO_EXTENSION_SETTINGS"] = "no extension settings";
130
+ i18n["EXTENSION_SETTINGS"] = "extension settings";
129
131
  i18n["INSTALL_FROM_URL"] = "install from URL";
130
132
  i18n["ENTER_GIT_REPO_URL"] = "enter git repository URL";
131
133
  i18n["DELETE_EXTENSION"] = "delete extension";
@@ -114,6 +114,7 @@ export declare enum DefaultCommands {
114
114
  CLEAR_PERFORMANCE_REPORT = "clear performance report",
115
115
  IMPORT_EXTENSION = "import extension",
116
116
  OPEN_EXTENSIONS_MANAGER = "open extensions manager",
117
+ OPEN_EXTENSION_SETTINGS = "extension settings",
117
118
  OPEN_NOTIFICATIONS = "open notifications",
118
119
  LOGIN = "login",
119
120
  LOGOUT = "logout",
@@ -135,6 +135,7 @@ export var DefaultCommands;
135
135
  // Extensions
136
136
  DefaultCommands["IMPORT_EXTENSION"] = "import extension";
137
137
  DefaultCommands["OPEN_EXTENSIONS_MANAGER"] = "open extensions manager";
138
+ DefaultCommands["OPEN_EXTENSION_SETTINGS"] = "extension settings";
138
139
  // Notifications
139
140
  DefaultCommands["OPEN_NOTIFICATIONS"] = "open notifications";
140
141
  // Auth
@@ -1,5 +1,5 @@
1
- import type { Ref } from 'vue';
2
- import { ExtensionMeta, ExtensionSource, ExtensionSourceInfo } from './extension.js';
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import { Extension, ExtensionMeta, ExtensionSource, ExtensionSourceInfo } from './extension.js';
3
3
  import { StoreDefinition } from './store.js';
4
4
  export interface ExtensionStore {
5
5
  ready: Ref<boolean>;
@@ -14,5 +14,9 @@ export interface ExtensionStore {
14
14
  addExtension: (meta: ExtensionMeta, source: ExtensionSource) => Promise<void>;
15
15
  importExtension: (file: File) => Promise<void>;
16
16
  deleteExtension: (extensionName: string) => Promise<void>;
17
+ getExtensionConfig: (name: string) => ComputedRef<Readonly<Record<string, unknown>>>;
18
+ setExtensionConfig: (name: string, config: Record<string, unknown>) => Promise<void>;
19
+ hasExtensionSettings: (name: string) => boolean;
20
+ getActiveExtensionModule: (name: string) => Extension | undefined;
17
21
  }
18
22
  export type ExtensionStoreDefinition = StoreDefinition<ExtensionStore>;
@@ -1,3 +1,4 @@
1
+ import type { BaseSchema, BaseIssue } from 'valibot';
1
2
  import { OrgNoteApi } from '../api.js';
2
3
  import { type InferOutput } from 'valibot';
3
4
  declare const PLATFORM_SCHEMA: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"mobile", undefined>, import("valibot").LiteralSchema<"desktop", undefined>, import("valibot").LiteralSchema<"capacitor", undefined>, import("valibot").LiteralSchema<"nativeMobile", undefined>, import("valibot").LiteralSchema<"electron", undefined>, import("valibot").LiteralSchema<"linux", undefined>, import("valibot").LiteralSchema<"mac", undefined>, import("valibot").LiteralSchema<"win", undefined>, import("valibot").LiteralSchema<"chrome", undefined>, import("valibot").LiteralSchema<"firefox", undefined>, import("valibot").LiteralSchema<"opera", undefined>, import("valibot").LiteralSchema<"safari", undefined>, import("valibot").LiteralSchema<"webkit", undefined>, import("valibot").LiteralSchema<"ios", undefined>, import("valibot").LiteralSchema<"ipad", undefined>, import("valibot").LiteralSchema<"iphone", undefined>, import("valibot").LiteralSchema<"ipod", undefined>, import("valibot").LiteralSchema<"winphone", undefined>, import("valibot").LiteralSchema<"blackberry", undefined>], undefined>;
@@ -97,6 +98,8 @@ export interface Extension {
97
98
  [key: string]: unknown;
98
99
  onMounted: (api: OrgNoteApi) => Promise<void> | void;
99
100
  onUnmounted?: (api: OrgNoteApi) => Promise<void> | void;
101
+ settingsSchema?: BaseSchema<Record<string, unknown>, Record<string, unknown>, BaseIssue<unknown>>;
102
+ defaultSettings?: Record<string, unknown>;
100
103
  }
101
104
  export interface ExtensionMeta {
102
105
  manifest: ExtensionManifest;
@@ -44,7 +44,11 @@ const LOCAL_SOURCE_SCHEMA = object({
44
44
  const BUILTIN_SOURCE_SCHEMA = object({
45
45
  type: literal('builtin'),
46
46
  });
47
- const SOURCE_SCHEMA = union([GIT_SOURCE_SCHEMA, LOCAL_SOURCE_SCHEMA, BUILTIN_SOURCE_SCHEMA]);
47
+ const SOURCE_SCHEMA = union([
48
+ GIT_SOURCE_SCHEMA,
49
+ LOCAL_SOURCE_SCHEMA,
50
+ BUILTIN_SOURCE_SCHEMA,
51
+ ]);
48
52
  const COMMAND_SCHEMA = object({
49
53
  id: string(),
50
54
  title: string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.50.2",
3
+ "version": "0.50.3",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.js",