@todesktop/shared 7.191.0 → 7.191.1
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/CHANGELOG.md +6 -0
- package/lib/{base.d.ts → cjs/base.d.ts} +1 -0
- package/lib/cjs/base.js +22 -0
- package/lib/cjs/desktopify.js +79 -0
- package/lib/cjs/desktopify2.js +80 -0
- package/lib/cjs/getSiteInfo.js +2 -0
- package/lib/cjs/hsm.js +42 -0
- package/lib/cjs/index.d.ts +12 -0
- package/lib/cjs/index.js +33 -0
- package/lib/cjs/invitePermissionLabels.js +29 -0
- package/lib/cjs/personalAccessTokens.js +2 -0
- package/lib/cjs/plans.js +632 -0
- package/lib/cjs/plugin.js +2 -0
- package/lib/cjs/toDesktop.js +2 -0
- package/lib/cjs/translation.js +14 -0
- package/lib/cjs/validations.js +178 -0
- package/lib/esm/base.d.ts +326 -0
- package/lib/esm/desktopify.d.ts +339 -0
- package/lib/esm/desktopify2.d.ts +506 -0
- package/lib/esm/getSiteInfo.d.ts +24 -0
- package/lib/esm/hsm.d.ts +30 -0
- package/lib/{index.d.ts → esm/index.d.ts} +1 -1
- package/lib/{index.js → esm/index.js} +2 -1
- package/lib/esm/invitePermissionLabels.d.ts +13 -0
- package/lib/esm/personalAccessTokens.d.ts +24 -0
- package/lib/esm/plans.d.ts +130 -0
- package/lib/esm/plugin.d.ts +55 -0
- package/lib/esm/toDesktop.d.ts +191 -0
- package/lib/esm/translation.d.ts +2 -0
- package/lib/esm/validations.d.ts +102 -0
- package/package.json +20 -5
- package/src/base.ts +1 -0
- package/src/index.cjs.ts +19 -0
- package/src/index.ts +2 -1
- package/tsconfig.esm.json +15 -0
- package/tsconfig.json +3 -4
- /package/lib/{desktopify.d.ts → cjs/desktopify.d.ts} +0 -0
- /package/lib/{desktopify2.d.ts → cjs/desktopify2.d.ts} +0 -0
- /package/lib/{getSiteInfo.d.ts → cjs/getSiteInfo.d.ts} +0 -0
- /package/lib/{hsm.d.ts → cjs/hsm.d.ts} +0 -0
- /package/lib/{invitePermissionLabels.d.ts → cjs/invitePermissionLabels.d.ts} +0 -0
- /package/lib/{personalAccessTokens.d.ts → cjs/personalAccessTokens.d.ts} +0 -0
- /package/lib/{plans.d.ts → cjs/plans.d.ts} +0 -0
- /package/lib/{plugin.d.ts → cjs/plugin.d.ts} +0 -0
- /package/lib/{toDesktop.d.ts → cjs/toDesktop.d.ts} +0 -0
- /package/lib/{translation.d.ts → cjs/translation.d.ts} +0 -0
- /package/lib/{validations.d.ts → cjs/validations.d.ts} +0 -0
- /package/lib/{base.js → esm/base.js} +0 -0
- /package/lib/{desktopify.js → esm/desktopify.js} +0 -0
- /package/lib/{desktopify2.js → esm/desktopify2.js} +0 -0
- /package/lib/{getSiteInfo.js → esm/getSiteInfo.js} +0 -0
- /package/lib/{hsm.js → esm/hsm.js} +0 -0
- /package/lib/{invitePermissionLabels.js → esm/invitePermissionLabels.js} +0 -0
- /package/lib/{personalAccessTokens.js → esm/personalAccessTokens.js} +0 -0
- /package/lib/{plans.js → esm/plans.js} +0 -0
- /package/lib/{plugin.js → esm/plugin.js} +0 -0
- /package/lib/{toDesktop.js → esm/toDesktop.js} +0 -0
- /package/lib/{translation.js → esm/translation.js} +0 -0
- /package/lib/{validations.js → esm/validations.js} +0 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { BrowserWindowConstructorOptions, MenuItemConstructorOptions, MessageBoxOptions, NotificationConstructorOptions, WebPreferences } from '@todesktop/client-electron-types';
|
|
2
|
+
import { BaseApp } from './base';
|
|
3
|
+
import { CustomPlugin, DesktopAppPlugin } from './plugin';
|
|
4
|
+
import { ISwitchableValue } from './toDesktop';
|
|
5
|
+
import { ValidTranslationKeys, ValidTranslationLanguages } from './translation';
|
|
6
|
+
interface BaseAssetDetails {
|
|
7
|
+
/**
|
|
8
|
+
* Local path where the asset is/should be stored. This path is relative to the app directory
|
|
9
|
+
*/
|
|
10
|
+
relativeLocalPath: string;
|
|
11
|
+
/**
|
|
12
|
+
* Remote URL where the asset can be downloaded
|
|
13
|
+
*/
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AppIconAssetDetails extends BaseAssetDetails {
|
|
17
|
+
type: 'appIcon';
|
|
18
|
+
}
|
|
19
|
+
export interface MenuIconAssetDetails extends BaseAssetDetails {
|
|
20
|
+
type: 'menuIcon';
|
|
21
|
+
}
|
|
22
|
+
export interface TrayMenubarIconAssetDetails extends BaseAssetDetails {
|
|
23
|
+
type: 'trayMenubarIcon';
|
|
24
|
+
}
|
|
25
|
+
export interface FileAssetDetails extends BaseAssetDetails {
|
|
26
|
+
md5Hash: string;
|
|
27
|
+
type: 'file';
|
|
28
|
+
}
|
|
29
|
+
export type AssetDetails = AppIconAssetDetails | FileAssetDetails | MenuIconAssetDetails | TrayMenubarIconAssetDetails;
|
|
30
|
+
/**
|
|
31
|
+
* Custom ToDesktop Roles for Application & Tray Menus
|
|
32
|
+
*/
|
|
33
|
+
type todesktopRoles = 'todesktop:check-for-updates' | 'todesktop:check-for-updates' | 'todesktop:hide-window' | 'todesktop:history-back' | 'todesktop:history-forward' | 'todesktop:history-home' | 'todesktop:launch-at-startup' | 'todesktop:new-tab' | 'todesktop:new-window' | 'todesktop:quit-completely' | 'todesktop:quit' | 'todesktop:show-window' | 'todesktop:toggle-window' | 'todesktop:toggle-window0' | 'todesktop:toggle-window1' | 'todesktop:toggle-window2' | 'todesktop:toggle-window3' | 'todesktop:toggle-window4';
|
|
34
|
+
export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConstructorOptions, 'role' | 'submenu'> {
|
|
35
|
+
acceleratorBehaviour?: 'custom' | 'default' | 'explicit-none' | 'none';
|
|
36
|
+
actionType?: 'jsEvent' | 'role';
|
|
37
|
+
bundledIcon?: string;
|
|
38
|
+
event?: string;
|
|
39
|
+
iconAssetDetails?: MenuIconAssetDetails;
|
|
40
|
+
iconUrl?: string;
|
|
41
|
+
platforms?: NodeJS.Platform[];
|
|
42
|
+
role?: MenuItemConstructorOptions['role'] | todesktopRoles;
|
|
43
|
+
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
44
|
+
targetWindowId?: string;
|
|
45
|
+
useSystemLabel?: boolean;
|
|
46
|
+
useTemplateImage?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Toggle Window Tray Action
|
|
50
|
+
*
|
|
51
|
+
* @param windowId - The id of the window to toggle
|
|
52
|
+
*/
|
|
53
|
+
export type DesktopifyAppTrayToggleWindowAction = {
|
|
54
|
+
role: 'toggleWindow';
|
|
55
|
+
windowId: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Toggle Menu Tray Action
|
|
59
|
+
*
|
|
60
|
+
* @param menu - The menu to show when action triggered
|
|
61
|
+
*/
|
|
62
|
+
export type DesktopifyAppTrayToggleMenuAction = {
|
|
63
|
+
menu: DesktopifyMenuItemConstructorOptions[];
|
|
64
|
+
role: 'toggleMenu';
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* JS Event Tray Action
|
|
68
|
+
*
|
|
69
|
+
* @param event - The name of the event
|
|
70
|
+
*/
|
|
71
|
+
export type DesktopifyAppTrayJSEventAction = {
|
|
72
|
+
event: string;
|
|
73
|
+
role: 'jsEvent';
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* No Action Tray Action
|
|
77
|
+
*/
|
|
78
|
+
export type DesktopifyAppTrayNoAction = {
|
|
79
|
+
role: 'noAction';
|
|
80
|
+
};
|
|
81
|
+
export type DesktopifyAppTrayAction = DesktopifyAppTrayJSEventAction | DesktopifyAppTrayNoAction | DesktopifyAppTrayToggleMenuAction | DesktopifyAppTrayToggleWindowAction;
|
|
82
|
+
export interface DesktopifyAppTray {
|
|
83
|
+
bundledIcon?: string;
|
|
84
|
+
icon?: string;
|
|
85
|
+
iconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
86
|
+
id: string;
|
|
87
|
+
leftClick: DesktopifyAppTrayAction;
|
|
88
|
+
linuxIcon?: string;
|
|
89
|
+
linuxIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
90
|
+
macOSIcon?: string;
|
|
91
|
+
macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
92
|
+
objectId?: string;
|
|
93
|
+
rightClick: DesktopifyAppTrayAction;
|
|
94
|
+
swapClickHandlers?: boolean;
|
|
95
|
+
useSeparateIcons?: boolean;
|
|
96
|
+
useTemplateImage?: boolean;
|
|
97
|
+
windowsIcon?: string;
|
|
98
|
+
windowsIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
99
|
+
}
|
|
100
|
+
export type DesktopifyAppMenu = DesktopifyMenuItemConstructorOptions;
|
|
101
|
+
/**
|
|
102
|
+
* Whitelist of allowed DesktopifyWindow Options.
|
|
103
|
+
* These attrs (if set) are passed to the `BrowserWindow` constructor
|
|
104
|
+
* when the window is created
|
|
105
|
+
*/
|
|
106
|
+
export declare const allowedBrowserWindowConstructorOptions: Readonly<(keyof BrowserWindowConstructorOptions)[]>;
|
|
107
|
+
export type whitelistedBrowserWindowConstructorOptions = (typeof allowedBrowserWindowConstructorOptions)[number];
|
|
108
|
+
/**
|
|
109
|
+
* Whitelist of allowed DesktopifyWindow Web Preferences Options.
|
|
110
|
+
* These attrs (if set) are passed to the webPreferences object in the `BrowserWindow` constructor
|
|
111
|
+
* when the window is created
|
|
112
|
+
*/
|
|
113
|
+
export declare const allowedWebPreferencesOptions: Readonly<(keyof WebPreferences)[]>;
|
|
114
|
+
export type whitelistedWebPreferencesOptions = (typeof allowedWebPreferencesOptions)[number];
|
|
115
|
+
/**
|
|
116
|
+
* Interface for ToDesktop App Windows
|
|
117
|
+
*/
|
|
118
|
+
export interface DesktopifyAppWindow {
|
|
119
|
+
/**
|
|
120
|
+
* The window's background type
|
|
121
|
+
*/
|
|
122
|
+
backgroundType?: 'color' | 'normal' | 'transparent' | 'vibrant';
|
|
123
|
+
/**
|
|
124
|
+
* Disables default rightClick menu
|
|
125
|
+
*/
|
|
126
|
+
disableContextMenu: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Disables the menu item for opening a link in a new app window
|
|
129
|
+
*/
|
|
130
|
+
disableContextMenuOpenInWindow: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Don't allow tabs in window (macOS only)
|
|
133
|
+
*/
|
|
134
|
+
disableTabs: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* The path to the file to load if `shouldUseFileInsteadOfUrl` is `true`.
|
|
137
|
+
*/
|
|
138
|
+
file?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Configuration options for find in page
|
|
141
|
+
*/
|
|
142
|
+
findInPageOptions?: {
|
|
143
|
+
horizontalPlacement?: {
|
|
144
|
+
default: FindInPagePlacement;
|
|
145
|
+
left: FindInPagePlacement;
|
|
146
|
+
right: FindInPagePlacement;
|
|
147
|
+
type: 'default' | 'left' | 'right';
|
|
148
|
+
};
|
|
149
|
+
verticalPlacement?: {
|
|
150
|
+
bottom: FindInPagePlacement;
|
|
151
|
+
default: FindInPagePlacement;
|
|
152
|
+
top: FindInPagePlacement;
|
|
153
|
+
type: 'bottom' | 'default' | 'top';
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Does the window have a maximum height. Default is `false`
|
|
158
|
+
*/
|
|
159
|
+
hasMaxHeight: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Does the window have a maximum width. Default is `false`
|
|
162
|
+
*/
|
|
163
|
+
hasMaxWidth: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Does the window have a minimum height. Default is `false`
|
|
166
|
+
*/
|
|
167
|
+
hasMinHeight: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Does the window have a minimum width. Default is `false`
|
|
170
|
+
*/
|
|
171
|
+
hasMinWidth: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* A unique window id
|
|
174
|
+
*/
|
|
175
|
+
id: string;
|
|
176
|
+
/**
|
|
177
|
+
* Allows user to `Cmd+F` or `Edit>Find` to search for text on page
|
|
178
|
+
*/
|
|
179
|
+
isFindInPageEnabled?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Whether this is the main window. The main window handles deeplinks
|
|
182
|
+
*/
|
|
183
|
+
isMain: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* If `true` prevents the native window's title from changing when the document title changes
|
|
186
|
+
*/
|
|
187
|
+
isTitleStatic?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* The window name. Only visible to developer
|
|
190
|
+
*/
|
|
191
|
+
name: string;
|
|
192
|
+
/**
|
|
193
|
+
* A *mutable* window object id
|
|
194
|
+
*/
|
|
195
|
+
objectId?: string;
|
|
196
|
+
/**
|
|
197
|
+
* BrowserWindow Constructor Options
|
|
198
|
+
*/
|
|
199
|
+
options: {
|
|
200
|
+
/**
|
|
201
|
+
* Settings of web page's features.
|
|
202
|
+
*/
|
|
203
|
+
webPreferences?: Pick<WebPreferences, whitelistedWebPreferencesOptions>;
|
|
204
|
+
} & Pick<BrowserWindowConstructorOptions, whitelistedBrowserWindowConstructorOptions>;
|
|
205
|
+
/**
|
|
206
|
+
* By default ToDesktop remembers window width & height between sessions.
|
|
207
|
+
* Setting to `true` disables behaviour
|
|
208
|
+
*/
|
|
209
|
+
shouldResetDimensions?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* The window should load a file instead of a URL.
|
|
212
|
+
* The file property (below) should also be set if the value is `true`.
|
|
213
|
+
*/
|
|
214
|
+
shouldUseFileInsteadOfUrl?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Keyboard shortcut to toggle window visibility
|
|
217
|
+
*/
|
|
218
|
+
toggleVisibilityKeyboardShortcut?: string;
|
|
219
|
+
/**
|
|
220
|
+
* The type of window
|
|
221
|
+
*/
|
|
222
|
+
type: 'app' | 'desktop' | 'menubar' | 'panel';
|
|
223
|
+
/**
|
|
224
|
+
* The window's url
|
|
225
|
+
*/
|
|
226
|
+
url: string;
|
|
227
|
+
/**
|
|
228
|
+
* Inital visibility of window
|
|
229
|
+
*/
|
|
230
|
+
visibility: 'hidden' | 'show-when-contents-loaded' | 'visible';
|
|
231
|
+
/**
|
|
232
|
+
* MacOS option for whether the window should be visible on all workspaces
|
|
233
|
+
*/
|
|
234
|
+
visibleOnAllWorkspaces: boolean;
|
|
235
|
+
}
|
|
236
|
+
export type AutoUpdateConfiguration = {
|
|
237
|
+
autoCheckIntervalMins: number;
|
|
238
|
+
autoUpdater: boolean;
|
|
239
|
+
shouldAutoCheckInterval: boolean;
|
|
240
|
+
shouldAutoCheckOnLaunch: boolean;
|
|
241
|
+
updateReadyAction: {
|
|
242
|
+
showInstallAndRestartPrompt: {
|
|
243
|
+
mode: 'always' | 'never' | 'whenInForeground';
|
|
244
|
+
options: {
|
|
245
|
+
installOnNextLaunchButton: string;
|
|
246
|
+
restartAndInstallButton: string;
|
|
247
|
+
} & Omit<MessageBoxOptions, 'buttons'>;
|
|
248
|
+
};
|
|
249
|
+
showNotification: {
|
|
250
|
+
mode: 'always' | 'never' | 'whenInBackground';
|
|
251
|
+
options: Omit<NotificationConstructorOptions, 'actions'>;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
256
|
+
/**
|
|
257
|
+
* Relaxes our "deny" policy when attempting to open a window with an `"about:blank"` URL.
|
|
258
|
+
*/
|
|
259
|
+
allowAboutBlankWindowOpenHandler?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Used as appUserModelId on windows
|
|
262
|
+
*/
|
|
263
|
+
appModelId?: string;
|
|
264
|
+
/**
|
|
265
|
+
* Registers an app protocol. Format should be `{APP_PROTOCOL}://` e.g. `example://`
|
|
266
|
+
*/
|
|
267
|
+
appProtocol: ISwitchableValue<string>;
|
|
268
|
+
/**
|
|
269
|
+
* Sets strings to be used in the app UI. Currently only supports English
|
|
270
|
+
*/
|
|
271
|
+
appStrings?: {
|
|
272
|
+
[key in ValidTranslationKeys]?: {
|
|
273
|
+
[lang in ValidTranslationLanguages]?: string;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Sets whether the window menu bar should hide itself automatically.
|
|
278
|
+
* Once set the menu bar will only show when users press the single Alt key.
|
|
279
|
+
*/
|
|
280
|
+
autoHideMenuBar?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Configure auto updates
|
|
283
|
+
*/
|
|
284
|
+
autoUpdates: AutoUpdateConfiguration;
|
|
285
|
+
/**
|
|
286
|
+
* The locally-bundled app icon.
|
|
287
|
+
*/
|
|
288
|
+
bundledIcon?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Command line switches
|
|
291
|
+
* Learn more {@link https://www.electronjs.org/docs/api/command-line-switches}
|
|
292
|
+
* @example
|
|
293
|
+
* {
|
|
294
|
+
* 'remote-debugging-port': '8315'
|
|
295
|
+
* }
|
|
296
|
+
*/
|
|
297
|
+
commandLineSwitches?: {
|
|
298
|
+
[key: string]: string;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* The name of the company that the app belongs to
|
|
302
|
+
*/
|
|
303
|
+
companyName?: string;
|
|
304
|
+
/**
|
|
305
|
+
* URL that crash reports will be POSTed to
|
|
306
|
+
*/
|
|
307
|
+
crashReporter?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Metadata about plugins that were manually linked into the app
|
|
310
|
+
*/
|
|
311
|
+
customPlugins?: CustomPlugin[];
|
|
312
|
+
/**
|
|
313
|
+
* Disable devTools on all app windows
|
|
314
|
+
*/
|
|
315
|
+
disableDevTools: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Disable error reporting (Sentry)
|
|
318
|
+
*/
|
|
319
|
+
disableErrorTracking?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* Enables NEW push notifications — uses `@cuj1559/electron-push-receiver`
|
|
322
|
+
*/
|
|
323
|
+
enableNewPushNotifications?: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Enables push notifications — uses `electron-push-receiver`
|
|
326
|
+
*/
|
|
327
|
+
enablePushNotifications?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* File assets that get bundled with the app and are available offline
|
|
330
|
+
*/
|
|
331
|
+
fileAssetDetailsList?: FileAssetDetails[];
|
|
332
|
+
/**
|
|
333
|
+
* Opens `accounts.google.com/o/oauth` in user's default browswer not as internal url
|
|
334
|
+
*/
|
|
335
|
+
googleOAuthIsExternal?: boolean;
|
|
336
|
+
/**
|
|
337
|
+
* The app icon url
|
|
338
|
+
*/
|
|
339
|
+
icon?: string;
|
|
340
|
+
/**
|
|
341
|
+
* Details concerning how the app icon should be handled across ToDesktop services
|
|
342
|
+
*/
|
|
343
|
+
iconAssetDetails?: AppIconAssetDetails;
|
|
344
|
+
/**
|
|
345
|
+
* App identifier
|
|
346
|
+
*/
|
|
347
|
+
id: string;
|
|
348
|
+
/**
|
|
349
|
+
* Disables the same-origin policy
|
|
350
|
+
*/
|
|
351
|
+
insecure?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Regex patterns for internal app urls
|
|
354
|
+
*/
|
|
355
|
+
internalUrls: ISwitchableValue<string>;
|
|
356
|
+
/**
|
|
357
|
+
* By default ToDesktop uses native `window.open` to support Firebase social login.
|
|
358
|
+
* This makes the app use electron's `window.open`.
|
|
359
|
+
*/
|
|
360
|
+
isNativeWindowOpenDisabled?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Whether the app is secure i.e. using valid code signing certificates.
|
|
363
|
+
* Note: This value is not persisted in firestore, and is instead written locally at build time.
|
|
364
|
+
* @default false
|
|
365
|
+
*/
|
|
366
|
+
isSecure?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Last todesktop builder version that was used to update the app
|
|
369
|
+
*/
|
|
370
|
+
lastUsedBuilderVersion?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Last desktopify version that was used to update the app
|
|
373
|
+
*/
|
|
374
|
+
lastUsedDesktopifyVersion?: string;
|
|
375
|
+
linuxIcon?: string;
|
|
376
|
+
linuxIconAssetDetails?: AppIconAssetDetails;
|
|
377
|
+
macOSIcon?: string;
|
|
378
|
+
macOSIconAssetDetails?: AppIconAssetDetails;
|
|
379
|
+
/**
|
|
380
|
+
* The app's menus
|
|
381
|
+
*/
|
|
382
|
+
menus: DesktopifyAppMenu[];
|
|
383
|
+
/**
|
|
384
|
+
* The name of the app
|
|
385
|
+
*/
|
|
386
|
+
name: string;
|
|
387
|
+
/**
|
|
388
|
+
* Sets whether an offline screen will be displayed if the internet is disconnected
|
|
389
|
+
* on initial page load. The color of the re-connect button that is shown is customizable.
|
|
390
|
+
*/
|
|
391
|
+
offlineScreen?: {
|
|
392
|
+
buttonBackgroundColor: string;
|
|
393
|
+
buttonTextColor: string;
|
|
394
|
+
enabled: boolean;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* An array of plugin modules. Can work with semver specificity
|
|
398
|
+
*/
|
|
399
|
+
plugins?: (Plugin | string)[];
|
|
400
|
+
/**
|
|
401
|
+
* Unused currently
|
|
402
|
+
* @unused
|
|
403
|
+
*/
|
|
404
|
+
pollForAppUpdatesEveryXMinutes?: number;
|
|
405
|
+
/**
|
|
406
|
+
* Runtime environment variables
|
|
407
|
+
*/
|
|
408
|
+
runtimeEnvs?: {
|
|
409
|
+
[key: string]: string;
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* This option is only available when `shouldMinimizeToTray` is `true`.
|
|
413
|
+
* Always display the dock icon while the app is open. Even if there are no windows open.
|
|
414
|
+
*/
|
|
415
|
+
shouldAlwaysDisplayDockIcon?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Whether the app should have full access to Electron APIs
|
|
418
|
+
* @default false
|
|
419
|
+
*/
|
|
420
|
+
shouldHaveFullAccessToElectronAPIs?: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Launch App at startup
|
|
423
|
+
*/
|
|
424
|
+
shouldLaunchAtStartupByDefault?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Open same domain links in user's default browser
|
|
427
|
+
*/
|
|
428
|
+
shouldMakeSameDomainAnExternalLink?: boolean;
|
|
429
|
+
/**
|
|
430
|
+
* Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
|
|
431
|
+
*/
|
|
432
|
+
shouldMinimizeToTray?: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* If `true` the app will prevent app from opening any protocols that are not
|
|
435
|
+
* already in a maybeAllowList or allowList (see `protocolLists.ts` in desktopify).
|
|
436
|
+
*/
|
|
437
|
+
shouldOnlyAllowVerifiedProtocols?: boolean;
|
|
438
|
+
/**
|
|
439
|
+
* Disables non-essential logs
|
|
440
|
+
*/
|
|
441
|
+
shouldOnlySendAbsolutelyNecessaryRequests?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Prevents the window contents from being captured by other apps.
|
|
444
|
+
*/
|
|
445
|
+
shouldProtectContent?: boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Disables electron overrides which ensure renderer process are restarted on each navigation.
|
|
448
|
+
* Learn more {@link https://github.com/electron/electron/issues/18397}
|
|
449
|
+
*/
|
|
450
|
+
shouldReuseRendererProcess?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Removes electron from userAgent
|
|
453
|
+
*/
|
|
454
|
+
shouldUseRealUserAgent?: boolean;
|
|
455
|
+
/**
|
|
456
|
+
* Only allow a single instance of this app to run
|
|
457
|
+
*/
|
|
458
|
+
singleInstance: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* Sets theme for Electron UI elements and css.
|
|
461
|
+
*
|
|
462
|
+
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
463
|
+
*/
|
|
464
|
+
themeSource?: 'dark' | 'light' | 'system';
|
|
465
|
+
/**
|
|
466
|
+
* Sets theme source for only mac
|
|
467
|
+
*
|
|
468
|
+
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
469
|
+
*/
|
|
470
|
+
themeSourceMac?: 'dark' | 'light' | 'system';
|
|
471
|
+
/**
|
|
472
|
+
* The app's trays
|
|
473
|
+
*/
|
|
474
|
+
trays: DesktopifyAppTray[];
|
|
475
|
+
/**
|
|
476
|
+
* Specifys the app's user agent
|
|
477
|
+
*/
|
|
478
|
+
userAgent: ISwitchableValue<string>;
|
|
479
|
+
/**
|
|
480
|
+
* Prevents a potential vulnerability in URL matching in Electron
|
|
481
|
+
* https://linear.app/todesktop/issue/TD-1428/html-injection-due-to-regular-expression-bypass
|
|
482
|
+
*/
|
|
483
|
+
useSafeInternalUrlMatcher?: boolean;
|
|
484
|
+
/**
|
|
485
|
+
* Instead of using one icon for every platform, use a separate icon for different platforms
|
|
486
|
+
*/
|
|
487
|
+
useSeparateIcons?: boolean;
|
|
488
|
+
/**
|
|
489
|
+
* The app's windows
|
|
490
|
+
*/
|
|
491
|
+
windows: DesktopifyAppWindow[];
|
|
492
|
+
windowsIcon?: string;
|
|
493
|
+
windowsIconAssetDetails?: AppIconAssetDetails;
|
|
494
|
+
}
|
|
495
|
+
export type FindInPagePlacement = {
|
|
496
|
+
offset: number;
|
|
497
|
+
};
|
|
498
|
+
export interface IApp2<Plugin = DesktopAppPlugin> extends BaseApp {
|
|
499
|
+
desktopApp: DesktopifyApp2<Plugin>;
|
|
500
|
+
desktopAppOverrides?: {
|
|
501
|
+
linux?: Partial<DesktopifyApp2<Plugin>>;
|
|
502
|
+
mac?: Partial<DesktopifyApp2<Plugin>>;
|
|
503
|
+
windows?: Partial<DesktopifyApp2<Plugin>>;
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface IAppFromServerProps {
|
|
2
|
+
appModelId: string;
|
|
3
|
+
appType: 'app' | 'electron' | 'menubar' | 'tabbed';
|
|
4
|
+
html?: string;
|
|
5
|
+
iconUrl?: string;
|
|
6
|
+
id: string;
|
|
7
|
+
meta: IAppFromServerPropsMeta;
|
|
8
|
+
name: string;
|
|
9
|
+
secret: string;
|
|
10
|
+
url: string;
|
|
11
|
+
}
|
|
12
|
+
interface IAppFromServerPropsMeta {
|
|
13
|
+
isFrameBlocked: boolean;
|
|
14
|
+
isHttps?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface IAppFromServerPropsDimension {
|
|
17
|
+
height: number;
|
|
18
|
+
type: string;
|
|
19
|
+
width: number;
|
|
20
|
+
}
|
|
21
|
+
export interface IAppFromServerPropsS3PutsEntity {
|
|
22
|
+
ETag: string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/lib/esm/hsm.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* - mac = Developer ID Application
|
|
3
|
+
* - mac-installer = Developer ID Installer
|
|
4
|
+
* - mas = Apple Distribution or Mac App Distribution (for Mac App Store)
|
|
5
|
+
* - mas-installer = Mac Installer Distribution (for Mac App Store)
|
|
6
|
+
* - mas-dev = Apple Development
|
|
7
|
+
*/
|
|
8
|
+
export type MacTarget = 'mac-installer' | 'mac' | 'mas-dev' | 'mas-installer' | 'mas';
|
|
9
|
+
export type WindowsTarget = 'windows';
|
|
10
|
+
export declare function isMacTarget(type: string): type is MacTarget;
|
|
11
|
+
export declare function isWindowsTarget(type: string): type is MacTarget;
|
|
12
|
+
/**
|
|
13
|
+
* Files that are uploaded to HSM have a unique secretName that depends on the appId and target.
|
|
14
|
+
* This function returns the key name that is used for certificate files that have a `.p12` postfix.
|
|
15
|
+
*
|
|
16
|
+
* @param appId the application id
|
|
17
|
+
* @param target the target type
|
|
18
|
+
* @returns the name of the secret that is required for downloading the cert from HSM.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getCertificateNameFromHSM: (appId: string, target: MacTarget | WindowsTarget) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Files that are uploaded to HSM have a unique secretName that depends on the appId and target.
|
|
23
|
+
* This function returns the key name that is used for key files that have a `.p8` postfix.
|
|
24
|
+
* Currently only used for mac notarization.
|
|
25
|
+
*
|
|
26
|
+
* @param appId the application id
|
|
27
|
+
* @param target the target type
|
|
28
|
+
* @returns the name of the secret that is required for downloading the cert from HSM.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getAPIKeyNameFromHSM: (appId: string, target: MacTarget) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// Path is relative to lib/esm/ output directory
|
|
2
|
+
import packageJson from '../../package.json' with { type: 'json' };
|
|
2
3
|
export * from './base.js';
|
|
3
4
|
export * from './desktopify.js';
|
|
4
5
|
export * from './desktopify2.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UserIHaveSentInviteTo } from './toDesktop';
|
|
2
|
+
export type InvitePermissionKey = 'canBuild' | 'canManageBilling' | 'canManageUsers' | 'canRelease';
|
|
3
|
+
export type InvitePermissionFlags = Record<InvitePermissionKey, boolean>;
|
|
4
|
+
export declare const INVITE_PERMISSION_LABELS: Record<InvitePermissionKey, string>;
|
|
5
|
+
export declare const formatInvitePermissionSummary: (permissions: Partial<InvitePermissionFlags>) => string;
|
|
6
|
+
export type NormalizedInvitePermissions = {
|
|
7
|
+
canBuild: boolean;
|
|
8
|
+
canManageBilling: boolean;
|
|
9
|
+
canManageUsers: boolean;
|
|
10
|
+
canRelease: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const FULL_OWNER_PERMISSIONS: NormalizedInvitePermissions;
|
|
13
|
+
export declare const normalizeInvitePermissions: (permissions?: UserIHaveSentInviteTo["permissions"]) => NormalizedInvitePermissions;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type PatStatus = 'active' | 'expired' | 'revoked';
|
|
2
|
+
export type PatPermissionSource = 'delegate' | 'owner';
|
|
3
|
+
export interface PatAppScope {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
ownerUserId: string;
|
|
6
|
+
permissionSource: PatPermissionSource;
|
|
7
|
+
}
|
|
8
|
+
export interface PatUsageApp {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
ownerUserId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PatSummary {
|
|
13
|
+
appScopes: PatAppScope[];
|
|
14
|
+
createdAt: null | string;
|
|
15
|
+
description: string;
|
|
16
|
+
expiresAt: null | string;
|
|
17
|
+
lastUsedAt: null | string;
|
|
18
|
+
lastUsedByApp: null | PatUsageApp;
|
|
19
|
+
revokedAt: null | string;
|
|
20
|
+
status: PatStatus;
|
|
21
|
+
tokenId: string;
|
|
22
|
+
tokenPrefix: string;
|
|
23
|
+
}
|
|
24
|
+
export type PatListItem = PatSummary;
|