@todesktop/shared 7.191.0 → 7.192.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/{base.d.ts → cjs/base.d.ts} +1 -0
  3. package/lib/cjs/base.js +22 -0
  4. package/lib/{desktopify.d.ts → cjs/desktopify.d.ts} +26 -0
  5. package/lib/cjs/desktopify.js +79 -0
  6. package/lib/cjs/desktopify2.js +80 -0
  7. package/lib/cjs/getSiteInfo.js +2 -0
  8. package/lib/cjs/hsm.js +42 -0
  9. package/lib/cjs/index.d.ts +12 -0
  10. package/lib/cjs/index.js +33 -0
  11. package/lib/cjs/introspection/__tests__/breakpoints.test.js +59 -0
  12. package/lib/cjs/introspection/breakpoints.d.ts +45 -0
  13. package/lib/cjs/introspection/breakpoints.js +48 -0
  14. package/lib/cjs/invitePermissionLabels.js +29 -0
  15. package/lib/cjs/personalAccessTokens.js +2 -0
  16. package/lib/cjs/plans.js +632 -0
  17. package/lib/cjs/plugin.js +2 -0
  18. package/lib/cjs/toDesktop.js +2 -0
  19. package/lib/cjs/translation.js +14 -0
  20. package/lib/cjs/validations.js +178 -0
  21. package/lib/esm/base.d.ts +326 -0
  22. package/lib/esm/desktopify.d.ts +365 -0
  23. package/lib/esm/desktopify2.d.ts +506 -0
  24. package/lib/esm/getSiteInfo.d.ts +24 -0
  25. package/lib/esm/hsm.d.ts +30 -0
  26. package/lib/{index.d.ts → esm/index.d.ts} +2 -1
  27. package/lib/{index.js → esm/index.js} +3 -1
  28. package/lib/esm/introspection/__tests__/breakpoints.test.js +57 -0
  29. package/lib/esm/introspection/breakpoints.d.ts +45 -0
  30. package/lib/esm/introspection/breakpoints.js +42 -0
  31. package/lib/esm/invitePermissionLabels.d.ts +13 -0
  32. package/lib/esm/personalAccessTokens.d.ts +24 -0
  33. package/lib/esm/plans.d.ts +130 -0
  34. package/lib/esm/plugin.d.ts +55 -0
  35. package/lib/esm/plugin.js +1 -0
  36. package/lib/esm/toDesktop.d.ts +191 -0
  37. package/lib/esm/toDesktop.js +1 -0
  38. package/lib/esm/translation.d.ts +2 -0
  39. package/lib/esm/validations.d.ts +102 -0
  40. package/package.json +23 -6
  41. package/src/base.ts +1 -0
  42. package/src/desktopify.ts +46 -4
  43. package/src/index.cjs.ts +19 -0
  44. package/src/index.ts +3 -1
  45. package/src/introspection/__tests__/breakpoints.test.ts +92 -0
  46. package/src/introspection/breakpoints.ts +137 -0
  47. package/tsconfig.esm.json +15 -0
  48. package/tsconfig.json +3 -4
  49. /package/lib/{desktopify2.d.ts → cjs/desktopify2.d.ts} +0 -0
  50. /package/lib/{getSiteInfo.d.ts → cjs/getSiteInfo.d.ts} +0 -0
  51. /package/lib/{hsm.d.ts → cjs/hsm.d.ts} +0 -0
  52. /package/lib/{getSiteInfo.js → cjs/introspection/__tests__/breakpoints.test.d.ts} +0 -0
  53. /package/lib/{invitePermissionLabels.d.ts → cjs/invitePermissionLabels.d.ts} +0 -0
  54. /package/lib/{personalAccessTokens.d.ts → cjs/personalAccessTokens.d.ts} +0 -0
  55. /package/lib/{plans.d.ts → cjs/plans.d.ts} +0 -0
  56. /package/lib/{plugin.d.ts → cjs/plugin.d.ts} +0 -0
  57. /package/lib/{toDesktop.d.ts → cjs/toDesktop.d.ts} +0 -0
  58. /package/lib/{translation.d.ts → cjs/translation.d.ts} +0 -0
  59. /package/lib/{validations.d.ts → cjs/validations.d.ts} +0 -0
  60. /package/lib/{base.js → esm/base.js} +0 -0
  61. /package/lib/{desktopify.js → esm/desktopify.js} +0 -0
  62. /package/lib/{desktopify2.js → esm/desktopify2.js} +0 -0
  63. /package/lib/{personalAccessTokens.js → esm/getSiteInfo.js} +0 -0
  64. /package/lib/{hsm.js → esm/hsm.js} +0 -0
  65. /package/lib/{plugin.js → esm/introspection/__tests__/breakpoints.test.d.ts} +0 -0
  66. /package/lib/{invitePermissionLabels.js → esm/invitePermissionLabels.js} +0 -0
  67. /package/lib/{toDesktop.js → esm/personalAccessTokens.js} +0 -0
  68. /package/lib/{plans.js → esm/plans.js} +0 -0
  69. /package/lib/{translation.js → esm/translation.js} +0 -0
  70. /package/lib/{validations.js → esm/validations.js} +0 -0
@@ -0,0 +1,365 @@
1
+ import { Configuration, PackagerOptions, PublishOptions } from 'app-builder-lib';
2
+ import { IApp2 } from './desktopify2';
3
+ import { BreakpointPauseLease, BreakpointQueueEntry, CurrentBreakpointState } from './introspection/breakpoints';
4
+ import { IApp } from './toDesktop';
5
+ type appBuilderLib = PackagerOptions & PublishOptions;
6
+ export interface IAppBuilderLib extends appBuilderLib {
7
+ config: Configuration;
8
+ }
9
+ export interface ExtraFileReference {
10
+ from: FilePath;
11
+ to?: FilePath;
12
+ }
13
+ export type ISODate = string;
14
+ export declare enum PlatformName {
15
+ linux = "linux",
16
+ mac = "mac",
17
+ windows = "windows"
18
+ }
19
+ export type FilePath = string;
20
+ export type SemanticVersion = string;
21
+ export type URL = string;
22
+ export declare enum PackageManager {
23
+ npm = "npm",
24
+ pnpm = "pnpm",
25
+ yarn = "yarn"
26
+ }
27
+ export declare enum BuildStatus {
28
+ building = "building",
29
+ cancelled = "cancelled",
30
+ failed = "failed",
31
+ preparation = "preparation",
32
+ queued = "queued",
33
+ succeeded = "succeeded"
34
+ }
35
+ export declare enum AnalysisStatus {
36
+ analyzing = "analyzing",
37
+ done = "done",
38
+ downloading = "downloading",
39
+ error = "error",
40
+ extracting = "extracting",
41
+ initializing = "initializing",
42
+ notStarted = "notStarted"
43
+ }
44
+ export type Arch = 'arm64' | 'ia32' | 'universal' | 'x64';
45
+ export type MacArch = 'arm64' | 'universal' | 'x64';
46
+ export type LinuxArch = 'arm64' | 'x64';
47
+ export type WindowsArch = 'arm64' | 'ia32' | 'universal' | 'x64';
48
+ export type LinuxArtifactName = 'appImage' | 'deb' | 'rpm' | 'snap';
49
+ export type MacArtifactName = 'dmg' | 'installer' | 'mas' | 'pkg' | 'zip';
50
+ export type WindowsArtifactName = 'appx' | 'msi' | 'nsis-web-7z' | 'nsis-web' | 'nsis';
51
+ type ArtifactObject = {
52
+ size: number;
53
+ standardUrl: URL;
54
+ url: URL;
55
+ };
56
+ type ArtifactDownload = null | Record<Arch, ArtifactObject | null>;
57
+ type InstallerArtifact = {
58
+ [K in Arch]: ({
59
+ isPinnedToVersion?: boolean;
60
+ } & ArtifactObject) | null;
61
+ };
62
+ export type LinuxArtifactDownloads = Record<LinuxArtifactName, ArtifactDownload>;
63
+ export type MacArtifactDownloads = {
64
+ [K in MacArtifactName]: K extends 'installer' ? InstallerArtifact : ArtifactDownload;
65
+ };
66
+ export type WindowsArtifactDownloads = Record<WindowsArtifactName, ArtifactDownload>;
67
+ export type CodeSignSkipReason = 'no-cert' | 'user-disabled';
68
+ export interface PlatformBuild {
69
+ appBuilderLibConfig?: IAppBuilderLib;
70
+ artifactDownloads?: LinuxArtifactDownloads | MacArtifactDownloads | WindowsArtifactDownloads;
71
+ codeSignSkipReason?: CodeSignSkipReason;
72
+ desktopifyVersion?: SemanticVersion;
73
+ didCodeSign: boolean;
74
+ didUseCachedDependencies?: boolean;
75
+ downloadUrl?: URL;
76
+ electronVersionUsed?: SemanticVersion;
77
+ endedAt: ISODate;
78
+ errorMessage?: string;
79
+ isBeingCancelled?: boolean;
80
+ logs?: {
81
+ content: string;
82
+ label: string;
83
+ }[];
84
+ numberOfAttemptedBuilds: number;
85
+ platform: PlatformName;
86
+ progressActivityName: string;
87
+ progressActivityType: string;
88
+ progressPercentage: number;
89
+ screenshotUrl?: URL;
90
+ shouldSkip: boolean;
91
+ standardDownloadUrl?: URL;
92
+ startedAt: ISODate;
93
+ status: BuildStatus;
94
+ }
95
+ export type CIRunner = 'azure' | 'circle';
96
+ export type IntrospectBreakpointStatus = 'error' | 'finished' | 'initializing' | 'paused' | 'ready' | 'resuming';
97
+ export type IntrospectShellStatus = 'connected' | 'connecting' | 'disconnected' | 'error' | 'initializing' | 'ready';
98
+ export interface IntrospectPlatformData {
99
+ breakpointQueue?: BreakpointQueueEntry[];
100
+ breakpointStatus: IntrospectBreakpointStatus;
101
+ connectedAt?: Date;
102
+ connectedUserId?: string;
103
+ createdAt: ISODate;
104
+ currentBreakpoint?: CurrentBreakpointState;
105
+ disconnectedAt?: Date;
106
+ enabled: boolean;
107
+ error?: string;
108
+ jtiExpiresAt?: Date;
109
+ pauseLease?: BreakpointPauseLease;
110
+ sessionJti?: string;
111
+ shellStatus: IntrospectShellStatus;
112
+ tunnelUrl?: string;
113
+ usedJti?: string;
114
+ }
115
+ export interface IntrospectData {
116
+ linux: IntrospectPlatformData;
117
+ mac: IntrospectPlatformData;
118
+ windows: IntrospectPlatformData;
119
+ }
120
+ export interface Build {
121
+ appCustomDomain?: string;
122
+ appName: string;
123
+ appNotarizaionBundleId: string;
124
+ appVersion?: SemanticVersion;
125
+ buildServerExecutionId?: number;
126
+ bundlePhobiaData?: Record<string, BundlePhobiaItem>;
127
+ ciRunner?: CIRunner;
128
+ cliConfigSchemaVersion: number;
129
+ commitId?: string;
130
+ commitMessage?: string;
131
+ continuousIntegrationServiceName?: string;
132
+ createdAt: ISODate;
133
+ dependencyAnalysis?: {
134
+ result?: string;
135
+ status: AnalysisStatus;
136
+ };
137
+ desktopifyVersion?: SemanticVersion;
138
+ electronVersionSpecified?: SemanticVersion;
139
+ electronVersionUsed?: SemanticVersion;
140
+ endedAt?: ISODate;
141
+ environmentVariables?: IApp['environmentVariables'];
142
+ errorMessage?: string;
143
+ hash?: string;
144
+ icon?: string;
145
+ id: string;
146
+ introspect?: IntrospectData;
147
+ isArtifactsPruned?: boolean;
148
+ isBeingCancelled?: boolean;
149
+ linux?: PlatformBuild;
150
+ mac?: PlatformBuild;
151
+ onBuildFinishedWebhook?: string;
152
+ partiallyReleasedAt?: ISODate;
153
+ projectConfig?: string;
154
+ releasedAt?: ISODate;
155
+ shouldCodeSign: boolean;
156
+ shouldRelease: boolean;
157
+ shouldRetainForever?: boolean;
158
+ smokeTest?: {
159
+ buildServerExecutionId?: string;
160
+ isCanceled?: boolean;
161
+ linux?: SmokeTestProgress;
162
+ mac?: SmokeTestProgress;
163
+ windows?: SmokeTestProgress;
164
+ };
165
+ sourcePackageManager?: PackageManager;
166
+ standardUniversalDownloadUrl?: URL;
167
+ startedAt: ISODate;
168
+ staticAnalysis?: {
169
+ error?: string;
170
+ result?: string;
171
+ status: AnalysisStatus;
172
+ };
173
+ status: BuildStatus;
174
+ todesktopRuntimeVersionSpecified?: SemanticVersion;
175
+ todesktopRuntimeVersionUsed?: SemanticVersion;
176
+ universalDownloadUrl?: URL;
177
+ url?: URL;
178
+ useCachedDependencies?: boolean;
179
+ versionControlInfo?: {
180
+ branchName: string;
181
+ commitDate: string;
182
+ commitId: string;
183
+ commitMessage: string;
184
+ hasUncommittedChanges: boolean;
185
+ repositoryRemoteUrl: string;
186
+ versionControlSystemName: string;
187
+ };
188
+ windows?: PlatformBuild;
189
+ }
190
+ export type BundlePhobiaItem = {
191
+ error: null | string;
192
+ result: {
193
+ description: string;
194
+ gzip: string;
195
+ name: string;
196
+ size: number;
197
+ } | null;
198
+ };
199
+ export type ComputedBuildProperties = Pick<Build, 'desktopifyVersion' | 'electronVersionUsed' | 'endedAt' | 'errorMessage' | 'releasedAt' | 'standardUniversalDownloadUrl' | 'startedAt' | 'status' | 'universalDownloadUrl'>;
200
+ export declare enum ManifestCategory {
201
+ buildStamped = "build-stamped",
202
+ primary = "primary",
203
+ versioned = "versioned"
204
+ }
205
+ export interface CustomManifestArtifactDetails {
206
+ path: FilePath;
207
+ url: URL;
208
+ }
209
+ export interface CustomManifest {
210
+ artifacts: {
211
+ [propertyName: string]: null | Record<string, CustomManifestArtifactDetails | null>;
212
+ };
213
+ createdAt: ISODate;
214
+ version: SemanticVersion;
215
+ }
216
+ export interface LinuxCustomManifest extends CustomManifest {
217
+ artifacts: Record<LinuxArtifactName, null | Record<LinuxArch, CustomManifestArtifactDetails | null>>;
218
+ }
219
+ export interface MacCustomManifest extends CustomManifest {
220
+ artifacts: Record<MacArtifactName, null | Record<MacArch, CustomManifestArtifactDetails | null>>;
221
+ }
222
+ export interface WindowsCustomManifest extends CustomManifest {
223
+ artifacts: Record<WindowsArtifactName, null | Record<WindowsArch, CustomManifestArtifactDetails | null>>;
224
+ }
225
+ export interface SmokeTestProgress {
226
+ abSkipReason?: string;
227
+ abState?: SmokeTestState;
228
+ appLaunched?: boolean;
229
+ appUpdated?: boolean;
230
+ bcState?: SmokeTestState;
231
+ buildAId?: string;
232
+ code?: string;
233
+ message?: string;
234
+ performance?: {
235
+ ab?: SmokeTestPerformance;
236
+ bc: SmokeTestPerformance;
237
+ };
238
+ progress: number;
239
+ screenshot?: string;
240
+ state: SmokeTestState;
241
+ updatedAppHasNoMainErrors?: boolean;
242
+ vm: {
243
+ agentVersion: string;
244
+ cpu?: string;
245
+ image: string;
246
+ imageVersion: string;
247
+ };
248
+ }
249
+ export interface SmokeTestPerformance {
250
+ /**
251
+ * Time between `process.getCreationTime()` and `App#redy event`
252
+ */
253
+ appReadyMs: number;
254
+ /**
255
+ * Time between `process.getCreationTime()` and app is closed for update
256
+ */
257
+ appReadyToRestartForUpdateMs: number;
258
+ /**
259
+ * Time between `process.getCreationTime()` and connect event received from
260
+ * the restarted app. It can be up to 4 minutes on Windows.
261
+ */
262
+ appRestartedAfterUpdateMs: number;
263
+ /**
264
+ * From `process.cpuUsage()` user + system.
265
+ * This value measures time spent in user and system code, and may end up
266
+ * being greater than actual elapsed time if multiple CPU cores are
267
+ * performing work for this process.
268
+ * Under the hood, low-level calls like `getrusage` are used, so this value
269
+ * is calculated from the process start.
270
+ * It measures for the first 10-12 seconds of the app execution.
271
+ */
272
+ cpuUsageMainProcessMs: number;
273
+ /**
274
+ * Maximum memory consumption by the main + renders + any other helper
275
+ * processes
276
+ */
277
+ memoryUsageAllProcessesMb: number;
278
+ /**
279
+ * Maximum memory consumption by the main process
280
+ */
281
+ memoryUsageMainProcessMb: number;
282
+ /**
283
+ * Maximum memory consumption by a renderer process (if started)
284
+ */
285
+ memoryUsageRendererProcessMb?: number;
286
+ /**
287
+ * Time between `process.getCreationTime()` and `initSmokeTest()` of
288
+ * runtime execution
289
+ */
290
+ runtimeLoadedMs: number;
291
+ /**
292
+ * Time between `process.getCreationTime()` and the update file downloaded
293
+ * from the server.
294
+ */
295
+ updateDownloadedMs: number;
296
+ /**
297
+ * Time between `process.getCreationTime()` and the first firing of
298
+ * WebContents#dom-ready if any window is created
299
+ */
300
+ webContentsDomReadyMs?: number;
301
+ /**
302
+ * Time between `process.getCreationTime()` and the first firing of
303
+ * WebContents#did-finish-load if any window is created
304
+ */
305
+ webContentsFinishLoadMs?: number;
306
+ }
307
+ export type SmokeTestState = 'done' | 'error' | 'progress' | 'skipped';
308
+ export declare const hasBuildKickedOff: (build: Build) => boolean;
309
+ export declare const isPlatformBuildRunning: (platformBuild: PlatformBuild) => boolean;
310
+ export declare const isCiBuildRunning: (build: Build) => boolean;
311
+ export declare const isBuildRunning: (build: Build) => boolean;
312
+ export declare const isBuildCancellable: (build: Build) => boolean;
313
+ export interface DesktopifyApp {
314
+ alwaysOnTop: boolean;
315
+ appId: string;
316
+ appProtocol?: string;
317
+ appType?: string;
318
+ autoHideMenuBar?: boolean;
319
+ companyName?: string;
320
+ crashReporter?: string;
321
+ disableContextMenu: boolean;
322
+ disableDevTools: boolean;
323
+ enablePushNotifications?: boolean;
324
+ extraBrowserWindowOptions?: any;
325
+ fullScreen: boolean;
326
+ googleOAuthIsExternal?: boolean;
327
+ height: number;
328
+ insecure?: boolean;
329
+ internalUrls?: string;
330
+ isFindInPageEnabled?: boolean;
331
+ isNativeWindowOpenDisabled?: boolean;
332
+ isResizable: boolean;
333
+ isTitleStatic?: boolean;
334
+ maxHeight?: number;
335
+ maxWidth?: number;
336
+ menubarIcon?: string;
337
+ minHeight?: number;
338
+ minWidth?: number;
339
+ name: string;
340
+ pollForAppUpdatesEveryXMinutes?: number;
341
+ preventBackgroundThrottling?: boolean;
342
+ runtimeEnvs?: string;
343
+ shouldLaunchAtStartupByDefault?: boolean;
344
+ shouldMakeSameDomainAnExternalLink?: boolean;
345
+ shouldOnlySendAbsolutelyNecessaryRequests?: boolean;
346
+ shouldReuseRendererProcess?: boolean;
347
+ shouldUseRealUserAgent?: boolean;
348
+ singleInstance: boolean;
349
+ targetUrl: string;
350
+ themeSource?: 'dark' | 'light' | 'system';
351
+ themeSourceMac?: 'dark' | 'light' | 'system';
352
+ titleBarStyle?: 'customButtonsOnHover' | 'hidden' | 'hiddenInset';
353
+ toggleVisibilityKeyboardShortcut?: string;
354
+ trayIcon?: string;
355
+ userAgent?: string;
356
+ useSafeInternalUrlMatcher?: boolean;
357
+ width: number;
358
+ }
359
+ export interface Release {
360
+ appReleaseSnapshot?: IApp2;
361
+ id: string;
362
+ releasedAt?: string;
363
+ startedAt?: string;
364
+ }
365
+ export {};