@edenapp/client 0.0.0-stage → 0.15.0
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/LICENSE +21 -0
- package/README.md +115 -2
- package/dist/commands.generated.d.ts +447 -0
- package/dist/commands.generated.d.ts.map +1 -0
- package/dist/commands.generated.js +407 -0
- package/dist/commands.generated.js.map +1 -0
- package/dist/index.cjs +470 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.cts +447 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/invoke.d.ts +3 -0
- package/dist/invoke.d.ts.map +1 -0
- package/dist/invoke.js +5 -0
- package/dist/invoke.js.map +1 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +10 -0
- package/dist/runtime.js.map +1 -0
- package/dist/streams.d.ts +5 -0
- package/dist/streams.d.ts.map +1 -0
- package/dist/streams.js +22 -0
- package/dist/streams.js.map +1 -0
- package/dist/subscriptions.d.ts +4 -0
- package/dist/subscriptions.d.ts.map +1 -0
- package/dist/subscriptions.js +8 -0
- package/dist/subscriptions.js.map +1 -0
- package/package.json +43 -3
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
appbus: () => appbusCommands,
|
|
24
|
+
appearance: () => appearanceCommands,
|
|
25
|
+
associations: () => associationsCommands,
|
|
26
|
+
contextMenu: () => contextMenuCommands,
|
|
27
|
+
daemon: () => daemonCommands,
|
|
28
|
+
db: () => dbCommands,
|
|
29
|
+
event: () => eventCommands,
|
|
30
|
+
file: () => fileCommands,
|
|
31
|
+
filePicker: () => filePickerCommands,
|
|
32
|
+
fs: () => fsCommands,
|
|
33
|
+
i18n: () => i18nCommands,
|
|
34
|
+
notification: () => notificationCommands,
|
|
35
|
+
operation: () => operationCommands,
|
|
36
|
+
package: () => packageCommands,
|
|
37
|
+
process: () => processCommands,
|
|
38
|
+
session: () => sessionCommands,
|
|
39
|
+
settings: () => settingsCommands,
|
|
40
|
+
stream: () => streamCommands,
|
|
41
|
+
system: () => systemCommands,
|
|
42
|
+
toCommandStream: () => toCommandStream,
|
|
43
|
+
user: () => userCommands,
|
|
44
|
+
view: () => viewCommands,
|
|
45
|
+
volume: () => volumeCommands
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(index_exports);
|
|
48
|
+
|
|
49
|
+
// src/runtime.ts
|
|
50
|
+
function getEdenAPI() {
|
|
51
|
+
const runtime = globalThis;
|
|
52
|
+
const api = runtime.window?.edenAPI ?? runtime.worker?.edenAPI;
|
|
53
|
+
if (!api) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
"@edenapp/client requires an Eden frontend or backend runtime"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return api;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/invoke.ts
|
|
62
|
+
async function invoke(command, args, submission) {
|
|
63
|
+
return getEdenAPI().shellCommand(command, args, submission);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/streams.ts
|
|
67
|
+
function toCommandStream(reader) {
|
|
68
|
+
const next = () => reader.next();
|
|
69
|
+
const cancel = () => reader.cancel();
|
|
70
|
+
return {
|
|
71
|
+
handle: reader.handle,
|
|
72
|
+
next,
|
|
73
|
+
cancel,
|
|
74
|
+
[Symbol.asyncIterator]: () => ({
|
|
75
|
+
next,
|
|
76
|
+
return: async () => {
|
|
77
|
+
await cancel();
|
|
78
|
+
return { done: true, value: void 0 };
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async function openStream(command, args) {
|
|
84
|
+
return toCommandStream(await invoke(command, args));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// src/subscriptions.ts
|
|
88
|
+
async function subscribe(event, callback) {
|
|
89
|
+
return getEdenAPI().subscribe(event, callback);
|
|
90
|
+
}
|
|
91
|
+
function unsubscribe(event, callback) {
|
|
92
|
+
getEdenAPI().unsubscribe(event, callback);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// src/commands.generated.ts
|
|
96
|
+
var appbusCommands = {
|
|
97
|
+
/**
|
|
98
|
+
* Connect to another app's service
|
|
99
|
+
* Creates MessageChannel and transfers ports directly to both apps
|
|
100
|
+
* Requires "appbus/connect" permission
|
|
101
|
+
*/
|
|
102
|
+
["connect"]: (targetAppId, serviceName) => invoke("appbus/connect", { ["targetAppId"]: targetAppId, ["serviceName"]: serviceName }),
|
|
103
|
+
/**
|
|
104
|
+
* List all available services
|
|
105
|
+
* No permission required
|
|
106
|
+
*/
|
|
107
|
+
["list"]: () => invoke("appbus/list", {}),
|
|
108
|
+
/**
|
|
109
|
+
* List services by app ID
|
|
110
|
+
* No permission required
|
|
111
|
+
*/
|
|
112
|
+
["listByApp"]: (appId) => invoke("appbus/list-by-app", { ["appId"]: appId }),
|
|
113
|
+
/**
|
|
114
|
+
* Register a service that this app exposes
|
|
115
|
+
* Requires "appbus/expose" permission
|
|
116
|
+
*/
|
|
117
|
+
["register"]: (serviceName, options) => invoke("appbus/register", { ["serviceName"]: serviceName, ["description"]: options?.["description"], ["allowedClients"]: options?.["allowedClients"] }),
|
|
118
|
+
/**
|
|
119
|
+
* Unregister a service
|
|
120
|
+
* Requires "appbus/expose" permission
|
|
121
|
+
*/
|
|
122
|
+
["unregister"]: (serviceName) => invoke("appbus/unregister", { ["serviceName"]: serviceName })
|
|
123
|
+
};
|
|
124
|
+
var appearanceCommands = {
|
|
125
|
+
["getPresets"]: () => invoke("appearance/get-presets", {}),
|
|
126
|
+
["getWallpaper"]: () => invoke("appearance/get-wallpaper", {}),
|
|
127
|
+
["setWallpaper"]: (wallpaper) => invoke("appearance/set-wallpaper", { ["wallpaper"]: wallpaper }),
|
|
128
|
+
["subscribe"]: (event, callback) => subscribe(`appearance/${event}`, callback),
|
|
129
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`appearance/${event}`, callback)
|
|
130
|
+
};
|
|
131
|
+
var associationsCommands = {
|
|
132
|
+
["get"]: (key) => invoke("associations/get", { ["key"]: key }),
|
|
133
|
+
["list"]: (options) => invoke("associations/list", { ["kindPrefix"]: options?.["kindPrefix"] }),
|
|
134
|
+
["remove"]: (key) => invoke("associations/remove", { ["key"]: key }),
|
|
135
|
+
["set"]: (key, appId, kind, options) => invoke("associations/set", { ["key"]: key, ["appId"]: appId, ["kind"]: kind, ["label"]: options?.["label"] })
|
|
136
|
+
};
|
|
137
|
+
var contextMenuCommands = {
|
|
138
|
+
["close"]: (options) => invoke("context-menu/close", { ["requestId"]: options?.["requestId"] }),
|
|
139
|
+
["open"]: (position, items, options) => invoke("context-menu/open", { ["position"]: position, ["items"]: items, ["title"]: options?.["title"] }),
|
|
140
|
+
["registerDisplay"]: () => invoke("context-menu/register-display", {}),
|
|
141
|
+
["resolve"]: (requestId, reason, options) => invoke("context-menu/resolve", { ["requestId"]: requestId, ["reason"]: reason, ["itemId"]: options?.["itemId"] }),
|
|
142
|
+
["subscribe"]: (event, callback) => subscribe(`context-menu/${event}`, callback),
|
|
143
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`context-menu/${event}`, callback)
|
|
144
|
+
};
|
|
145
|
+
var daemonCommands = {
|
|
146
|
+
["disable"]: (appId) => invoke("daemon/disable", { ["appId"]: appId }),
|
|
147
|
+
["enable"]: (appId) => invoke("daemon/enable", { ["appId"]: appId }),
|
|
148
|
+
["list"]: () => invoke("daemon/list", {}),
|
|
149
|
+
["restart"]: (appId, options) => invoke("daemon/restart", { ["appId"]: appId }, options?.submission),
|
|
150
|
+
["start"]: (appId, options) => invoke("daemon/start", { ["appId"]: appId }, options?.submission),
|
|
151
|
+
["stop"]: (appId, options) => invoke("daemon/stop", { ["appId"]: appId }, options?.submission),
|
|
152
|
+
["updateDefinition"]: (definition) => invoke("daemon/update-definition", { ["definition"]: definition }),
|
|
153
|
+
["subscribe"]: (event, callback) => subscribe(`daemon/${event}`, callback),
|
|
154
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`daemon/${event}`, callback)
|
|
155
|
+
};
|
|
156
|
+
var dbCommands = {
|
|
157
|
+
/**
|
|
158
|
+
* Clear all keys (scoped to caller's app)
|
|
159
|
+
*/
|
|
160
|
+
["clear"]: () => invoke("db/clear", {}),
|
|
161
|
+
/**
|
|
162
|
+
* Clear all keys in any app's namespace (superuser only)
|
|
163
|
+
*/
|
|
164
|
+
["clearSu"]: (appId) => invoke("db/clear/su", { ["appId"]: appId }),
|
|
165
|
+
/**
|
|
166
|
+
* Delete a key from database (scoped to caller's app)
|
|
167
|
+
*/
|
|
168
|
+
["delete"]: (key) => invoke("db/delete", { ["key"]: key }),
|
|
169
|
+
/**
|
|
170
|
+
* Delete a key from any app's namespace (superuser only)
|
|
171
|
+
*/
|
|
172
|
+
["deleteSu"]: (appId, key) => invoke("db/delete/su", { ["appId"]: appId, ["key"]: key }),
|
|
173
|
+
/**
|
|
174
|
+
* Get a value from database (scoped to caller's app)
|
|
175
|
+
*/
|
|
176
|
+
["get"]: (key) => invoke("db/get", { ["key"]: key }),
|
|
177
|
+
/**
|
|
178
|
+
* Get a value from any app's namespace (superuser only)
|
|
179
|
+
*/
|
|
180
|
+
["getSu"]: (appId, key) => invoke("db/get/su", { ["appId"]: appId, ["key"]: key }),
|
|
181
|
+
/**
|
|
182
|
+
* Check if a key exists (scoped to caller's app)
|
|
183
|
+
*/
|
|
184
|
+
["has"]: (key) => invoke("db/has", { ["key"]: key }),
|
|
185
|
+
/**
|
|
186
|
+
* Check if a key exists in any app's namespace (superuser only)
|
|
187
|
+
*/
|
|
188
|
+
["hasSu"]: (appId, key) => invoke("db/has/su", { ["appId"]: appId, ["key"]: key }),
|
|
189
|
+
/**
|
|
190
|
+
* List all keys (scoped to caller's app)
|
|
191
|
+
*/
|
|
192
|
+
["list"]: () => invoke("db/list", {}),
|
|
193
|
+
/**
|
|
194
|
+
* List all keys in any app's namespace (superuser only)
|
|
195
|
+
*/
|
|
196
|
+
["listSu"]: (appId) => invoke("db/list/su", { ["appId"]: appId }),
|
|
197
|
+
/**
|
|
198
|
+
* Set a value in database (scoped to caller's app)
|
|
199
|
+
*/
|
|
200
|
+
["set"]: (key, value) => invoke("db/set", { ["key"]: key, ["value"]: value }),
|
|
201
|
+
/**
|
|
202
|
+
* Set a value in any app's namespace (superuser only)
|
|
203
|
+
*/
|
|
204
|
+
["setSu"]: (appId, key, value) => invoke("db/set/su", { ["appId"]: appId, ["key"]: key, ["value"]: value })
|
|
205
|
+
};
|
|
206
|
+
var eventCommands = {
|
|
207
|
+
["exists"]: (eventName) => invoke("event/exists", { ["eventName"]: eventName }),
|
|
208
|
+
["subscribe"]: (eventName, options) => invoke("event/subscribe", { ["eventName"]: eventName, ["operation"]: options?.["operation"] }),
|
|
209
|
+
["unsubscribe"]: (eventName, options) => invoke("event/unsubscribe", { ["eventName"]: eventName, ["operation"]: options?.["operation"] })
|
|
210
|
+
};
|
|
211
|
+
var fileCommands = {
|
|
212
|
+
/**
|
|
213
|
+
* Get all file type associations
|
|
214
|
+
*/
|
|
215
|
+
["getAssociations"]: () => invoke("file/get-associations", {}),
|
|
216
|
+
/**
|
|
217
|
+
* Get the default handler app for a file path
|
|
218
|
+
*/
|
|
219
|
+
["getHandler"]: (location) => invoke("file/get-handler", { ["location"]: location }),
|
|
220
|
+
/**
|
|
221
|
+
* Get all apps that can handle a specific file path
|
|
222
|
+
*/
|
|
223
|
+
["getSupportedHandlers"]: (location) => invoke("file/get-supported-handlers", { ["location"]: location }),
|
|
224
|
+
/**
|
|
225
|
+
* Open a file with its default handler
|
|
226
|
+
*/
|
|
227
|
+
["open"]: (location, options) => invoke("file/open", { ["location"]: location }, options?.submission),
|
|
228
|
+
/**
|
|
229
|
+
* Open a file with a specific app
|
|
230
|
+
*/
|
|
231
|
+
["openWith"]: (location, appId, options) => invoke("file/open-with", { ["location"]: location, ["appId"]: appId }, options?.submission),
|
|
232
|
+
/**
|
|
233
|
+
* Remove user preference for a file path (revert to default)
|
|
234
|
+
*/
|
|
235
|
+
["removeDefaultHandler"]: (location) => invoke("file/remove-default-handler", { ["location"]: location }),
|
|
236
|
+
/**
|
|
237
|
+
* Set user preference for a file path's default handler
|
|
238
|
+
*/
|
|
239
|
+
["setDefaultHandler"]: (location, appId) => invoke("file/set-default-handler", { ["location"]: location, ["appId"]: appId }),
|
|
240
|
+
["subscribe"]: (event, callback) => subscribe(`file/${event}`, callback),
|
|
241
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`file/${event}`, callback)
|
|
242
|
+
};
|
|
243
|
+
var filePickerCommands = {
|
|
244
|
+
["close"]: (options) => invoke("file-picker/close", { ["requestId"]: options?.["requestId"] }),
|
|
245
|
+
["open"]: (mode, options) => invoke("file-picker/open", { ["mode"]: mode, ["selection"]: options?.["selection"], ["multiple"]: options?.["multiple"], ["title"]: options?.["title"], ["initialLocation"]: options?.["initialLocation"], ["allowedVolumes"]: options?.["allowedVolumes"], ["suggestedName"]: options?.["suggestedName"], ["filters"]: options?.["filters"], ["confirmLabel"]: options?.["confirmLabel"], ["canCreateDirectories"]: options?.["canCreateDirectories"], ["overwritePrompt"]: options?.["overwritePrompt"] }),
|
|
246
|
+
["registerDisplay"]: () => invoke("file-picker/register-display", {}),
|
|
247
|
+
["resolve"]: (requestId, reason, options) => invoke("file-picker/resolve", { ["requestId"]: requestId, ["reason"]: reason, ["locations"]: options?.["locations"] }),
|
|
248
|
+
["subscribe"]: (event, callback) => subscribe(`file-picker/${event}`, callback),
|
|
249
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`file-picker/${event}`, callback)
|
|
250
|
+
};
|
|
251
|
+
var fsCommands = {
|
|
252
|
+
["accessScope"]: (volume) => invoke("fs/access-scope", { ["volume"]: volume }),
|
|
253
|
+
["close"]: (handle) => invoke("fs/close", { ["handle"]: handle }),
|
|
254
|
+
["cp"]: (from, to, options) => invoke("fs/cp", { ["from"]: from, ["to"]: to, ["overwrite"]: options?.["overwrite"] }, options?.submission),
|
|
255
|
+
["delete"]: (location, options) => invoke("fs/delete", { ["location"]: location }, options?.submission),
|
|
256
|
+
["exists"]: (location) => invoke("fs/exists", { ["location"]: location }),
|
|
257
|
+
["lstat"]: (location) => invoke("fs/lstat", { ["location"]: location }),
|
|
258
|
+
["mkdir"]: (location) => invoke("fs/mkdir", { ["location"]: location }),
|
|
259
|
+
["mv"]: (from, to, options) => invoke("fs/mv", { ["from"]: from, ["to"]: to, ["overwrite"]: options?.["overwrite"] }, options?.submission),
|
|
260
|
+
["open"]: (location, options) => invoke("fs/open", { ["location"]: location, ["mode"]: options?.["mode"] }),
|
|
261
|
+
["read"]: (location, options) => invoke("fs/read", { ["location"]: location, ["encoding"]: options?.["encoding"] }),
|
|
262
|
+
["readBinary"]: (location) => invoke("fs/read-binary", { ["location"]: location }),
|
|
263
|
+
["readdir"]: (location) => invoke("fs/readdir", { ["location"]: location }),
|
|
264
|
+
["resolve"]: (location) => invoke("fs/resolve", { ["location"]: location }),
|
|
265
|
+
["search"]: (location, pattern, options) => openStream("fs/search", { ["location"]: location, ["pattern"]: pattern, ["limit"]: options?.["limit"] }),
|
|
266
|
+
["stat"]: (location) => invoke("fs/stat", { ["location"]: location }),
|
|
267
|
+
/**
|
|
268
|
+
* Move a Home item to Trash.
|
|
269
|
+
*/
|
|
270
|
+
["trash"]: (location, options) => invoke("fs/trash", { ["location"]: location }, options?.submission),
|
|
271
|
+
/**
|
|
272
|
+
* Permanently delete one Trash item.
|
|
273
|
+
*/
|
|
274
|
+
["trashDelete"]: (id, options) => invoke("fs/trash-delete", { ["id"]: id }, options?.submission),
|
|
275
|
+
/**
|
|
276
|
+
* Permanently delete every Trash item visible to the caller.
|
|
277
|
+
*/
|
|
278
|
+
["trashEmpty"]: (options) => invoke("fs/trash-empty", {}, options?.submission),
|
|
279
|
+
/**
|
|
280
|
+
* List Trash items from folders the caller can access, newest first.
|
|
281
|
+
*/
|
|
282
|
+
["trashEntries"]: () => invoke("fs/trash-entries", {}),
|
|
283
|
+
/**
|
|
284
|
+
* Restore a Trash item to its original location or another destination.
|
|
285
|
+
*/
|
|
286
|
+
["trashRestore"]: (id, options) => invoke("fs/trash-restore", { ["id"]: id, ["location"]: options?.["location"] }, options?.submission),
|
|
287
|
+
["unwatch"]: (watchId) => invoke("fs/unwatch", { ["watchId"]: watchId }),
|
|
288
|
+
["watch"]: (location) => invoke("fs/watch", { ["location"]: location }),
|
|
289
|
+
["write"]: (location, content, options) => invoke("fs/write", { ["location"]: location, ["content"]: content, ["encoding"]: options?.["encoding"] }),
|
|
290
|
+
["writeBinary"]: (location, content) => invoke("fs/write-binary", { ["location"]: location, ["content"]: content }),
|
|
291
|
+
["subscribe"]: (event, callback) => subscribe(`fs/${event}`, callback),
|
|
292
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`fs/${event}`, callback)
|
|
293
|
+
};
|
|
294
|
+
var i18nCommands = {
|
|
295
|
+
["getCommon"]: (locale) => invoke("i18n/get-common", { ["locale"]: locale }),
|
|
296
|
+
["getLocale"]: () => invoke("i18n/get-locale", {}),
|
|
297
|
+
["subscribe"]: (event, callback) => subscribe(`i18n/${event}`, callback),
|
|
298
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`i18n/${event}`, callback)
|
|
299
|
+
};
|
|
300
|
+
var notificationCommands = {
|
|
301
|
+
/**
|
|
302
|
+
* Report a notification action click from the toaster.
|
|
303
|
+
*/
|
|
304
|
+
["actionClicked"]: (notificationId, actionId) => invoke("notification/action-clicked", { ["notificationId"]: notificationId, ["actionId"]: actionId }),
|
|
305
|
+
/**
|
|
306
|
+
* Report a notification dismissal from the toaster.
|
|
307
|
+
*/
|
|
308
|
+
["dismissed"]: (notificationId) => invoke("notification/dismissed", { ["notificationId"]: notificationId }),
|
|
309
|
+
/**
|
|
310
|
+
* Push a new notification to subscribers.
|
|
311
|
+
*/
|
|
312
|
+
["push"]: (title, message, options) => invoke("notification/push", { ["title"]: title, ["message"]: message, ["timeout"]: options?.["timeout"], ["type"]: options?.["type"], ["actions"]: options?.["actions"] }),
|
|
313
|
+
/**
|
|
314
|
+
* Register the notification display provider.
|
|
315
|
+
*/
|
|
316
|
+
["registerDisplay"]: () => invoke("notification/register-display", {}),
|
|
317
|
+
["subscribe"]: (event, callback) => subscribe(`notification/${event}`, callback),
|
|
318
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`notification/${event}`, callback)
|
|
319
|
+
};
|
|
320
|
+
var operationCommands = {
|
|
321
|
+
["cancel"]: (handle) => invoke("operation/cancel", { ["handle"]: handle }),
|
|
322
|
+
["get"]: (handle) => invoke("operation/get", { ["handle"]: handle }),
|
|
323
|
+
["list"]: () => invoke("operation/list", {}),
|
|
324
|
+
["subscribe"]: (event, callback) => subscribe(`operation/${event}`, callback),
|
|
325
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`operation/${event}`, callback)
|
|
326
|
+
};
|
|
327
|
+
var packageCommands = {
|
|
328
|
+
["get"]: (packageId) => invoke("package/get", { ["packageId"]: packageId }),
|
|
329
|
+
["getIcon"]: (packageId) => invoke("package/get-icon", { ["packageId"]: packageId }),
|
|
330
|
+
["getInfo"]: (location) => invoke("package/get-info", { ["location"]: location }),
|
|
331
|
+
["getSize"]: (packageId) => invoke("package/get-size", { ["packageId"]: packageId }),
|
|
332
|
+
["install"]: (source, options) => invoke("package/install", { ["source"]: source, ["replace"]: options?.["replace"] }, options?.submission),
|
|
333
|
+
["isHotReloadEnabled"]: (packageId) => invoke("package/is-hot-reload-enabled", { ["packageId"]: packageId }),
|
|
334
|
+
["list"]: (options) => invoke("package/list", { ["showHidden"]: options?.["showHidden"], ["showRestricted"]: options?.["showRestricted"] }),
|
|
335
|
+
["self"]: () => invoke("package/self", {}),
|
|
336
|
+
["toggleHotReload"]: (packageId) => invoke("package/toggle-hot-reload", { ["packageId"]: packageId }),
|
|
337
|
+
["uninstall"]: (packageId, options) => invoke("package/uninstall", { ["packageId"]: packageId }, options?.submission),
|
|
338
|
+
["subscribe"]: (event, callback) => subscribe(`package/${event}`, callback),
|
|
339
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`package/${event}`, callback)
|
|
340
|
+
};
|
|
341
|
+
var processCommands = {
|
|
342
|
+
["exit"]: (options) => invoke("process/exit", {}, options?.submission),
|
|
343
|
+
["launch"]: (appId, options) => invoke("process/launch", { ["appId"]: appId, ["bounds"]: options?.["bounds"] }, options?.submission),
|
|
344
|
+
["list"]: (options) => invoke("process/list", { ["showHidden"]: options?.["showHidden"] }),
|
|
345
|
+
["metrics"]: (options) => invoke("process/metrics", { ["showHidden"]: options?.["showHidden"], ["pollingTimeoutMs"]: options?.["pollingTimeoutMs"], ["waitForAccurateCpu"]: options?.["waitForAccurateCpu"] }),
|
|
346
|
+
["stop"]: (appId, options) => invoke("process/stop", { ["appId"]: appId }, options?.submission),
|
|
347
|
+
["subscribe"]: (event, callback) => subscribe(`process/${event}`, callback),
|
|
348
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`process/${event}`, callback)
|
|
349
|
+
};
|
|
350
|
+
var sessionCommands = {
|
|
351
|
+
["getCurrent"]: () => invoke("session/get-current", {}),
|
|
352
|
+
["login"]: (username, password, options) => invoke("session/login", { ["username"]: username, ["password"]: password }, options?.submission),
|
|
353
|
+
["logout"]: (options) => invoke("session/logout", {}, options?.submission),
|
|
354
|
+
["subscribe"]: (event, callback) => subscribe(`session/${event}`, callback),
|
|
355
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`session/${event}`, callback)
|
|
356
|
+
};
|
|
357
|
+
var settingsCommands = {
|
|
358
|
+
["action"]: (panelId, actionId, options) => invoke("settings/action", { ["panelId"]: panelId, ["actionId"]: actionId, ["invocation"]: options?.["invocation"] }),
|
|
359
|
+
/**
|
|
360
|
+
* Get a setting value (scoped to caller's app)
|
|
361
|
+
*/
|
|
362
|
+
["get"]: (key, options) => invoke("settings/get", { ["key"]: key, ["appId"]: options?.["appId"] }),
|
|
363
|
+
/**
|
|
364
|
+
* Get all settings with values (scoped to caller's app)
|
|
365
|
+
*/
|
|
366
|
+
["getAll"]: () => invoke("settings/get-all", {}),
|
|
367
|
+
/**
|
|
368
|
+
* Get all settings with values for any app (superuser only)
|
|
369
|
+
* @param showRestricted - If true, includes settings the current user cannot access (hidden by default)
|
|
370
|
+
*/
|
|
371
|
+
["getAllSu"]: (appId, options) => invoke("settings/get-all/su", { ["appId"]: appId, ["showRestricted"]: options?.["showRestricted"] }),
|
|
372
|
+
/**
|
|
373
|
+
* Get a setting from any app's namespace (superuser only)
|
|
374
|
+
*/
|
|
375
|
+
["getSu"]: (appId, key) => invoke("settings/get/su", { ["appId"]: appId, ["key"]: key }),
|
|
376
|
+
/**
|
|
377
|
+
* List all settings keys (scoped to caller's app)
|
|
378
|
+
*/
|
|
379
|
+
["list"]: () => invoke("settings/list", {}),
|
|
380
|
+
/**
|
|
381
|
+
* List all settings in any app's namespace (superuser only)
|
|
382
|
+
* @param showRestricted - If true, includes settings the current user cannot access (hidden by default)
|
|
383
|
+
*/
|
|
384
|
+
["listSu"]: (appId, options) => invoke("settings/list/su", { ["appId"]: appId, ["showRestricted"]: options?.["showRestricted"] }),
|
|
385
|
+
["panel"]: (panelId) => invoke("settings/panel", { ["panelId"]: panelId }),
|
|
386
|
+
["panels"]: () => invoke("settings/panels", {}),
|
|
387
|
+
/**
|
|
388
|
+
* Reset a setting to default (scoped to caller's app)
|
|
389
|
+
*/
|
|
390
|
+
["reset"]: (key, options) => invoke("settings/reset", { ["key"]: key, ["schema"]: options?.["schema"] }),
|
|
391
|
+
/**
|
|
392
|
+
* Reset a setting for any app (superuser only)
|
|
393
|
+
*/
|
|
394
|
+
["resetSu"]: (appId, key, options) => invoke("settings/reset/su", { ["appId"]: appId, ["key"]: key, ["schema"]: options?.["schema"] }),
|
|
395
|
+
/**
|
|
396
|
+
* Set a setting value (scoped to caller's app)
|
|
397
|
+
*/
|
|
398
|
+
["set"]: (key, value) => invoke("settings/set", { ["key"]: key, ["value"]: value }),
|
|
399
|
+
/**
|
|
400
|
+
* Set a setting in any app's namespace (superuser only)
|
|
401
|
+
*/
|
|
402
|
+
["setSu"]: (appId, key, value) => invoke("settings/set/su", { ["appId"]: appId, ["key"]: key, ["value"]: value }),
|
|
403
|
+
["subscribe"]: (event, callback) => subscribe(`settings/${event}`, callback),
|
|
404
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`settings/${event}`, callback)
|
|
405
|
+
};
|
|
406
|
+
var streamCommands = {
|
|
407
|
+
/**
|
|
408
|
+
* Return credit for chunks that the caller consumed from its stream.
|
|
409
|
+
* Stream readers send this automatically.
|
|
410
|
+
*/
|
|
411
|
+
["ack"]: (handle, count) => invoke("stream/ack", { ["handle"]: handle, ["count"]: count }),
|
|
412
|
+
/**
|
|
413
|
+
* Stop a stream that the caller opened.
|
|
414
|
+
*/
|
|
415
|
+
["cancel"]: (handle) => invoke("stream/cancel", { ["handle"]: handle })
|
|
416
|
+
};
|
|
417
|
+
var systemCommands = {
|
|
418
|
+
/**
|
|
419
|
+
* Get consumer-controlled product branding for SDK-owned interfaces.
|
|
420
|
+
*/
|
|
421
|
+
["branding"]: () => invoke("system/branding", {}),
|
|
422
|
+
["info"]: () => invoke("system/info", {}),
|
|
423
|
+
["power"]: (action, options) => invoke("system/power", { ["action"]: action }, options?.submission),
|
|
424
|
+
["powerCapabilities"]: () => invoke("system/power-capabilities", {})
|
|
425
|
+
};
|
|
426
|
+
var userCommands = {
|
|
427
|
+
["changePassword"]: (currentPassword, newPassword) => invoke("user/change-password", { ["currentPassword"]: currentPassword, ["newPassword"]: newPassword }),
|
|
428
|
+
["create"]: (name, password, options) => invoke("user/create", { ["name"]: name, ["password"]: password, ["username"]: options?.["username"], ["role"]: options?.["role"], ["grants"]: options?.["grants"], ["directoryRestriction"]: options?.["directoryRestriction"] }),
|
|
429
|
+
["delete"]: (username) => invoke("user/delete", { ["username"]: username }),
|
|
430
|
+
["getDefault"]: () => invoke("user/get-default", {}),
|
|
431
|
+
["grantOptions"]: () => invoke("user/grant-options", {}),
|
|
432
|
+
["hasGrant"]: (grant) => invoke("user/has-grant", { ["grant"]: grant }),
|
|
433
|
+
["list"]: () => invoke("user/list", {}),
|
|
434
|
+
["setDefault"]: (username) => invoke("user/set-default", { ["username"]: username }),
|
|
435
|
+
["setPassword"]: (username, password) => invoke("user/set-password", { ["username"]: username, ["password"]: password }),
|
|
436
|
+
["update"]: (username, options) => invoke("user/update", { ["username"]: username, ["name"]: options?.["name"], ["role"]: options?.["role"], ["grants"]: options?.["grants"], ["directoryRestriction"]: options?.["directoryRestriction"] }),
|
|
437
|
+
["subscribe"]: (event, callback) => subscribe(`user/${event}`, callback),
|
|
438
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`user/${event}`, callback)
|
|
439
|
+
};
|
|
440
|
+
var viewCommands = {
|
|
441
|
+
["endDrag"]: () => invoke("view/end-drag", {}),
|
|
442
|
+
["endResize"]: () => invoke("view/end-resize", {}),
|
|
443
|
+
["expandTile"]: (direction) => invoke("view/expand-tile", { ["direction"]: direction }),
|
|
444
|
+
["focus"]: () => invoke("view/focus", {}),
|
|
445
|
+
["focusView"]: (appId) => invoke("view/focus-view", { ["appId"]: appId }),
|
|
446
|
+
["getInterfaceScale"]: () => invoke("view/get-interface-scale", {}),
|
|
447
|
+
["globalMouseup"]: () => invoke("view/global-mouseup", {}),
|
|
448
|
+
["setInterfaceScale"]: (scale) => invoke("view/set-interface-scale", { ["scale"]: scale }),
|
|
449
|
+
["setViewVisibility"]: (appId, visible) => invoke("view/set-view-visibility", { ["appId"]: appId, ["visible"]: visible }),
|
|
450
|
+
["setVisibility"]: (visible) => invoke("view/set-visibility", { ["visible"]: visible }),
|
|
451
|
+
["startDrag"]: (startX, startY) => invoke("view/start-drag", { ["startX"]: startX, ["startY"]: startY }),
|
|
452
|
+
["startResize"]: (startX, startY, options) => invoke("view/start-resize", { ["startX"]: startX, ["startY"]: startY, ["direction"]: options?.["direction"] }),
|
|
453
|
+
["swapTile"]: (direction) => invoke("view/swap-tile", { ["direction"]: direction }),
|
|
454
|
+
["tileLayoutState"]: () => invoke("view/tile-layout-state", {}),
|
|
455
|
+
["toggleMode"]: (options) => invoke("view/toggle-mode", { ["mode"]: options?.["mode"] }),
|
|
456
|
+
["toggleViewMode"]: (appId, options) => invoke("view/toggle-view-mode", { ["appId"]: appId, ["mode"]: options?.["mode"] }),
|
|
457
|
+
["updateBounds"]: (bounds) => invoke("view/update-bounds", { ["bounds"]: bounds }),
|
|
458
|
+
["updateGlobalBounds"]: (bounds, windowSize) => invoke("view/update-global-bounds", { ["bounds"]: bounds, ["windowSize"]: windowSize }),
|
|
459
|
+
["updateViewBounds"]: (appId, bounds) => invoke("view/update-view-bounds", { ["appId"]: appId, ["bounds"]: bounds }),
|
|
460
|
+
["windowSize"]: () => invoke("view/window-size", {}),
|
|
461
|
+
["subscribe"]: (event, callback) => subscribe(`view/${event}`, callback),
|
|
462
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`view/${event}`, callback)
|
|
463
|
+
};
|
|
464
|
+
var volumeCommands = {
|
|
465
|
+
["eject"]: (volume, options) => invoke("volume/eject", { ["volume"]: volume }, options?.submission),
|
|
466
|
+
["list"]: () => invoke("volume/list", {}),
|
|
467
|
+
["subscribe"]: (event, callback) => subscribe(`volume/${event}`, callback),
|
|
468
|
+
["unsubscribe"]: (event, callback) => unsubscribe(`volume/${event}`, callback)
|
|
469
|
+
};
|
|
470
|
+
//# sourceMappingURL=index.cjs.map
|