@todesktop/shared 7.190.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.
Files changed (75) hide show
  1. package/.prettierignore +0 -2
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +42 -15
  4. package/eslint.config.mjs +8 -55
  5. package/lib/{base.d.ts → cjs/base.d.ts} +82 -75
  6. package/lib/{desktopify.d.ts → cjs/desktopify.d.ts} +74 -74
  7. package/lib/{desktopify.js → cjs/desktopify.js} +12 -11
  8. package/lib/{desktopify2.d.ts → cjs/desktopify2.d.ts} +223 -223
  9. package/lib/{getSiteInfo.d.ts → cjs/getSiteInfo.d.ts} +6 -6
  10. package/lib/{hsm.d.ts → cjs/hsm.d.ts} +1 -1
  11. package/lib/{hsm.js → cjs/hsm.js} +1 -1
  12. package/lib/{index.d.ts → cjs/index.d.ts} +7 -8
  13. package/lib/{index.js → cjs/index.js} +11 -9
  14. package/lib/{invitePermissionLabels.d.ts → cjs/invitePermissionLabels.d.ts} +4 -2
  15. package/lib/{invitePermissionLabels.js → cjs/invitePermissionLabels.js} +11 -3
  16. package/lib/{personalAccessTokens.d.ts → cjs/personalAccessTokens.d.ts} +12 -12
  17. package/lib/{plans.d.ts → cjs/plans.d.ts} +27 -27
  18. package/lib/{plans.js → cjs/plans.js} +165 -163
  19. package/lib/{plugin.d.ts → cjs/plugin.d.ts} +18 -18
  20. package/lib/{toDesktop.d.ts → cjs/toDesktop.d.ts} +66 -66
  21. package/lib/cjs/translation.d.ts +2 -0
  22. package/lib/{validations.d.ts → cjs/validations.d.ts} +66 -66
  23. package/lib/cjs/validations.js +178 -0
  24. package/lib/esm/base.d.ts +326 -0
  25. package/lib/esm/base.js +19 -0
  26. package/lib/esm/desktopify.d.ts +339 -0
  27. package/lib/esm/desktopify.js +71 -0
  28. package/lib/esm/desktopify2.d.ts +506 -0
  29. package/lib/esm/desktopify2.js +77 -0
  30. package/lib/esm/getSiteInfo.d.ts +24 -0
  31. package/lib/esm/getSiteInfo.js +1 -0
  32. package/lib/esm/hsm.d.ts +30 -0
  33. package/lib/esm/hsm.js +35 -0
  34. package/lib/esm/index.d.ts +12 -0
  35. package/lib/esm/index.js +14 -0
  36. package/lib/esm/invitePermissionLabels.d.ts +13 -0
  37. package/lib/esm/invitePermissionLabels.js +24 -0
  38. package/lib/esm/personalAccessTokens.d.ts +24 -0
  39. package/lib/esm/personalAccessTokens.js +1 -0
  40. package/lib/esm/plans.d.ts +130 -0
  41. package/lib/esm/plans.js +626 -0
  42. package/lib/esm/plugin.d.ts +55 -0
  43. package/lib/esm/plugin.js +1 -0
  44. package/lib/esm/toDesktop.d.ts +191 -0
  45. package/lib/esm/toDesktop.js +1 -0
  46. package/lib/esm/translation.d.ts +2 -0
  47. package/lib/esm/translation.js +13 -0
  48. package/lib/esm/validations.d.ts +102 -0
  49. package/lib/{validations.js → esm/validations.js} +54 -56
  50. package/package.json +29 -20
  51. package/src/base.ts +90 -82
  52. package/src/desktopify.ts +82 -80
  53. package/src/desktopify2.ts +240 -240
  54. package/src/getSiteInfo.ts +6 -6
  55. package/src/hsm.ts +7 -7
  56. package/src/index.cjs.ts +19 -0
  57. package/src/index.ts +14 -14
  58. package/src/invitePermissionLabels.ts +20 -6
  59. package/src/personalAccessTokens.ts +12 -12
  60. package/src/plans.ts +191 -191
  61. package/src/plugin.ts +19 -19
  62. package/src/toDesktop.ts +70 -70
  63. package/src/translation.ts +2 -2
  64. package/src/validations.ts +51 -49
  65. package/tsconfig.esm.json +15 -0
  66. package/tsconfig.json +6 -4
  67. package/.prettierrc +0 -5
  68. package/lib/translation.d.ts +0 -2
  69. package/lib/{base.js → cjs/base.js} +3 -3
  70. /package/lib/{desktopify2.js → cjs/desktopify2.js} +0 -0
  71. /package/lib/{getSiteInfo.js → cjs/getSiteInfo.js} +0 -0
  72. /package/lib/{personalAccessTokens.js → cjs/personalAccessTokens.js} +0 -0
  73. /package/lib/{plugin.js → cjs/plugin.js} +0 -0
  74. /package/lib/{toDesktop.js → cjs/toDesktop.js} +0 -0
  75. /package/lib/{translation.js → cjs/translation.js} +0 -0
@@ -1,6 +1,6 @@
1
+ import { Configuration, PackagerOptions, PublishOptions } from 'app-builder-lib';
1
2
  import { IApp2 } from './desktopify2';
2
3
  import { IApp } from './toDesktop';
3
- import { Configuration, PackagerOptions, PublishOptions } from 'app-builder-lib';
4
4
  type appBuilderLib = PackagerOptions & PublishOptions;
5
5
  export interface IAppBuilderLib extends appBuilderLib {
6
6
  config: Configuration;
@@ -20,43 +20,43 @@ export type SemanticVersion = string;
20
20
  export type URL = string;
21
21
  export declare enum PackageManager {
22
22
  npm = "npm",
23
- yarn = "yarn",
24
- pnpm = "pnpm"
23
+ pnpm = "pnpm",
24
+ yarn = "yarn"
25
25
  }
26
26
  export declare enum BuildStatus {
27
- queued = "queued",
28
- failed = "failed",
29
27
  building = "building",
28
+ cancelled = "cancelled",
29
+ failed = "failed",
30
30
  preparation = "preparation",
31
- succeeded = "succeeded",
32
- cancelled = "cancelled"
31
+ queued = "queued",
32
+ succeeded = "succeeded"
33
33
  }
34
34
  export declare enum AnalysisStatus {
35
- notStarted = "notStarted",
36
- initializing = "initializing",
37
- downloading = "downloading",
38
- extracting = "extracting",
39
35
  analyzing = "analyzing",
40
36
  done = "done",
41
- error = "error"
37
+ downloading = "downloading",
38
+ error = "error",
39
+ extracting = "extracting",
40
+ initializing = "initializing",
41
+ notStarted = "notStarted"
42
42
  }
43
- export type Arch = 'ia32' | 'x64' | 'arm64' | 'universal';
44
- export type MacArch = 'x64' | 'arm64' | 'universal';
45
- export type LinuxArch = 'x64' | 'arm64';
46
- export type WindowsArch = 'ia32' | 'x64' | 'arm64' | 'universal';
43
+ export type Arch = 'arm64' | 'ia32' | 'universal' | 'x64';
44
+ export type MacArch = 'arm64' | 'universal' | 'x64';
45
+ export type LinuxArch = 'arm64' | 'x64';
46
+ export type WindowsArch = 'arm64' | 'ia32' | 'universal' | 'x64';
47
47
  export type LinuxArtifactName = 'appImage' | 'deb' | 'rpm' | 'snap';
48
- export type MacArtifactName = 'dmg' | 'zip' | 'installer' | 'mas' | 'pkg';
49
- export type WindowsArtifactName = 'msi' | 'nsis' | 'nsis-web' | 'nsis-web-7z' | 'appx';
48
+ export type MacArtifactName = 'dmg' | 'installer' | 'mas' | 'pkg' | 'zip';
49
+ export type WindowsArtifactName = 'appx' | 'msi' | 'nsis-web-7z' | 'nsis-web' | 'nsis';
50
50
  type ArtifactObject = {
51
51
  size: number;
52
52
  standardUrl: URL;
53
53
  url: URL;
54
54
  };
55
- type ArtifactDownload = Record<Arch, ArtifactObject | null> | null;
55
+ type ArtifactDownload = null | Record<Arch, ArtifactObject | null>;
56
56
  type InstallerArtifact = {
57
- [K in Arch]: (ArtifactObject & {
57
+ [K in Arch]: ({
58
58
  isPinnedToVersion?: boolean;
59
- }) | null;
59
+ } & ArtifactObject) | null;
60
60
  };
61
61
  export type LinuxArtifactDownloads = Record<LinuxArtifactName, ArtifactDownload>;
62
62
  export type MacArtifactDownloads = {
@@ -77,8 +77,8 @@ export interface PlatformBuild {
77
77
  errorMessage?: string;
78
78
  isBeingCancelled?: boolean;
79
79
  logs?: {
80
- label: string;
81
80
  content: string;
81
+ label: string;
82
82
  }[];
83
83
  numberOfAttemptedBuilds: number;
84
84
  platform: PlatformName;
@@ -91,7 +91,7 @@ export interface PlatformBuild {
91
91
  startedAt: ISODate;
92
92
  status: BuildStatus;
93
93
  }
94
- export type CIRunner = 'circle' | 'azure';
94
+ export type CIRunner = 'azure' | 'circle';
95
95
  export interface Build {
96
96
  appCustomDomain?: string;
97
97
  appName: string;
@@ -101,14 +101,18 @@ export interface Build {
101
101
  bundlePhobiaData?: Record<string, BundlePhobiaItem>;
102
102
  ciRunner?: CIRunner;
103
103
  cliConfigSchemaVersion: number;
104
- continuousIntegrationServiceName?: string;
105
104
  commitId?: string;
106
105
  commitMessage?: string;
106
+ continuousIntegrationServiceName?: string;
107
107
  createdAt: ISODate;
108
+ dependencyAnalysis?: {
109
+ result?: string;
110
+ status: AnalysisStatus;
111
+ };
108
112
  desktopifyVersion?: SemanticVersion;
109
- endedAt?: ISODate;
110
113
  electronVersionSpecified?: SemanticVersion;
111
114
  electronVersionUsed?: SemanticVersion;
115
+ endedAt?: ISODate;
112
116
  environmentVariables?: IApp['environmentVariables'];
113
117
  errorMessage?: string;
114
118
  hash?: string;
@@ -132,18 +136,14 @@ export interface Build {
132
136
  mac?: SmokeTestProgress;
133
137
  windows?: SmokeTestProgress;
134
138
  };
139
+ sourcePackageManager?: PackageManager;
140
+ standardUniversalDownloadUrl?: URL;
141
+ startedAt: ISODate;
135
142
  staticAnalysis?: {
136
- status: AnalysisStatus;
137
- result?: string;
138
143
  error?: string;
139
- };
140
- dependencyAnalysis?: {
141
- status: AnalysisStatus;
142
144
  result?: string;
145
+ status: AnalysisStatus;
143
146
  };
144
- sourcePackageManager?: PackageManager;
145
- standardUniversalDownloadUrl?: URL;
146
- startedAt: ISODate;
147
147
  status: BuildStatus;
148
148
  todesktopRuntimeVersionSpecified?: SemanticVersion;
149
149
  todesktopRuntimeVersionUsed?: SemanticVersion;
@@ -162,18 +162,18 @@ export interface Build {
162
162
  windows?: PlatformBuild;
163
163
  }
164
164
  export type BundlePhobiaItem = {
165
+ error: null | string;
165
166
  result: {
166
167
  description: string;
167
168
  gzip: string;
168
169
  name: string;
169
170
  size: number;
170
171
  } | null;
171
- error: string | null;
172
172
  };
173
173
  export type ComputedBuildProperties = Pick<Build, 'desktopifyVersion' | 'electronVersionUsed' | 'endedAt' | 'errorMessage' | 'releasedAt' | 'standardUniversalDownloadUrl' | 'startedAt' | 'status' | 'universalDownloadUrl'>;
174
174
  export declare enum ManifestCategory {
175
- primary = "primary",
176
175
  buildStamped = "build-stamped",
176
+ primary = "primary",
177
177
  versioned = "versioned"
178
178
  }
179
179
  export interface CustomManifestArtifactDetails {
@@ -182,23 +182,23 @@ export interface CustomManifestArtifactDetails {
182
182
  }
183
183
  export interface CustomManifest {
184
184
  artifacts: {
185
- [propertyName: string]: Record<string, CustomManifestArtifactDetails | null> | null;
185
+ [propertyName: string]: null | Record<string, CustomManifestArtifactDetails | null>;
186
186
  };
187
187
  createdAt: ISODate;
188
188
  version: SemanticVersion;
189
189
  }
190
190
  export interface LinuxCustomManifest extends CustomManifest {
191
- artifacts: Record<LinuxArtifactName, Record<LinuxArch, CustomManifestArtifactDetails | null> | null>;
191
+ artifacts: Record<LinuxArtifactName, null | Record<LinuxArch, CustomManifestArtifactDetails | null>>;
192
192
  }
193
193
  export interface MacCustomManifest extends CustomManifest {
194
- artifacts: Record<MacArtifactName, Record<MacArch, CustomManifestArtifactDetails | null> | null>;
194
+ artifacts: Record<MacArtifactName, null | Record<MacArch, CustomManifestArtifactDetails | null>>;
195
195
  }
196
196
  export interface WindowsCustomManifest extends CustomManifest {
197
- artifacts: Record<WindowsArtifactName, Record<WindowsArch, CustomManifestArtifactDetails | null> | null>;
197
+ artifacts: Record<WindowsArtifactName, null | Record<WindowsArch, CustomManifestArtifactDetails | null>>;
198
198
  }
199
199
  export interface SmokeTestProgress {
200
- abState?: SmokeTestState;
201
200
  abSkipReason?: string;
201
+ abState?: SmokeTestState;
202
202
  appLaunched?: boolean;
203
203
  appUpdated?: boolean;
204
204
  bcState?: SmokeTestState;
@@ -278,62 +278,62 @@ export interface SmokeTestPerformance {
278
278
  */
279
279
  webContentsFinishLoadMs?: number;
280
280
  }
281
- export type SmokeTestState = 'progress' | 'done' | 'error' | 'skipped';
281
+ export type SmokeTestState = 'done' | 'error' | 'progress' | 'skipped';
282
282
  export declare const hasBuildKickedOff: (build: Build) => boolean;
283
283
  export declare const isPlatformBuildRunning: (platformBuild: PlatformBuild) => boolean;
284
284
  export declare const isCiBuildRunning: (build: Build) => boolean;
285
285
  export declare const isBuildRunning: (build: Build) => boolean;
286
286
  export declare const isBuildCancellable: (build: Build) => boolean;
287
287
  export interface DesktopifyApp {
288
- name: string;
289
- targetUrl: string;
288
+ alwaysOnTop: boolean;
290
289
  appId: string;
290
+ appProtocol?: string;
291
+ appType?: string;
291
292
  autoHideMenuBar?: boolean;
292
- height: number;
293
- width: number;
293
+ companyName?: string;
294
+ crashReporter?: string;
295
+ disableContextMenu: boolean;
296
+ disableDevTools: boolean;
297
+ enablePushNotifications?: boolean;
298
+ extraBrowserWindowOptions?: any;
294
299
  fullScreen: boolean;
300
+ googleOAuthIsExternal?: boolean;
301
+ height: number;
302
+ insecure?: boolean;
303
+ internalUrls?: string;
304
+ isFindInPageEnabled?: boolean;
305
+ isNativeWindowOpenDisabled?: boolean;
295
306
  isResizable: boolean;
296
307
  isTitleStatic?: boolean;
297
- minHeight?: number;
298
- minWidth?: number;
299
308
  maxHeight?: number;
300
309
  maxWidth?: number;
301
- singleInstance: boolean;
302
- disableContextMenu: boolean;
303
- titleBarStyle?: 'hidden' | 'hiddenInset' | 'customButtonsOnHover';
304
- alwaysOnTop: boolean;
305
- internalUrls?: string;
306
- isNativeWindowOpenDisabled?: boolean;
307
- isFindInPageEnabled?: boolean;
308
- userAgent?: string;
309
- disableDevTools: boolean;
310
- appProtocol?: string;
311
- insecure?: boolean;
312
- preventBackgroundThrottling?: boolean;
313
- googleOAuthIsExternal?: boolean;
314
- shouldUseRealUserAgent?: boolean;
315
- extraBrowserWindowOptions?: any;
316
310
  menubarIcon?: string;
317
- trayIcon?: string;
318
- toggleVisibilityKeyboardShortcut?: string;
319
- appType?: string;
311
+ minHeight?: number;
312
+ minWidth?: number;
313
+ name: string;
314
+ pollForAppUpdatesEveryXMinutes?: number;
315
+ preventBackgroundThrottling?: boolean;
320
316
  runtimeEnvs?: string;
321
317
  shouldLaunchAtStartupByDefault?: boolean;
318
+ shouldMakeSameDomainAnExternalLink?: boolean;
322
319
  shouldOnlySendAbsolutelyNecessaryRequests?: boolean;
323
320
  shouldReuseRendererProcess?: boolean;
324
- shouldMakeSameDomainAnExternalLink?: boolean;
325
- enablePushNotifications?: boolean;
326
- themeSource?: 'system' | 'light' | 'dark';
327
- themeSourceMac?: 'system' | 'light' | 'dark';
328
- crashReporter?: string;
329
- companyName?: string;
330
- pollForAppUpdatesEveryXMinutes?: number;
321
+ shouldUseRealUserAgent?: boolean;
322
+ singleInstance: boolean;
323
+ targetUrl: string;
324
+ themeSource?: 'dark' | 'light' | 'system';
325
+ themeSourceMac?: 'dark' | 'light' | 'system';
326
+ titleBarStyle?: 'customButtonsOnHover' | 'hidden' | 'hiddenInset';
327
+ toggleVisibilityKeyboardShortcut?: string;
328
+ trayIcon?: string;
329
+ userAgent?: string;
331
330
  useSafeInternalUrlMatcher?: boolean;
331
+ width: number;
332
332
  }
333
333
  export interface Release {
334
- id: string;
335
334
  appReleaseSnapshot?: IApp2;
336
- startedAt?: string;
335
+ id: string;
337
336
  releasedAt?: string;
337
+ startedAt?: string;
338
338
  }
339
339
  export {};
@@ -10,32 +10,32 @@ var PlatformName;
10
10
  var PackageManager;
11
11
  (function (PackageManager) {
12
12
  PackageManager["npm"] = "npm";
13
- PackageManager["yarn"] = "yarn";
14
13
  PackageManager["pnpm"] = "pnpm";
14
+ PackageManager["yarn"] = "yarn";
15
15
  })(PackageManager || (exports.PackageManager = PackageManager = {}));
16
16
  var BuildStatus;
17
17
  (function (BuildStatus) {
18
- BuildStatus["queued"] = "queued";
19
- BuildStatus["failed"] = "failed";
20
18
  BuildStatus["building"] = "building";
19
+ BuildStatus["cancelled"] = "cancelled";
20
+ BuildStatus["failed"] = "failed";
21
21
  BuildStatus["preparation"] = "preparation";
22
+ BuildStatus["queued"] = "queued";
22
23
  BuildStatus["succeeded"] = "succeeded";
23
- BuildStatus["cancelled"] = "cancelled";
24
24
  })(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
25
25
  var AnalysisStatus;
26
26
  (function (AnalysisStatus) {
27
- AnalysisStatus["notStarted"] = "notStarted";
28
- AnalysisStatus["initializing"] = "initializing";
29
- AnalysisStatus["downloading"] = "downloading";
30
- AnalysisStatus["extracting"] = "extracting";
31
27
  AnalysisStatus["analyzing"] = "analyzing";
32
28
  AnalysisStatus["done"] = "done";
29
+ AnalysisStatus["downloading"] = "downloading";
33
30
  AnalysisStatus["error"] = "error";
31
+ AnalysisStatus["extracting"] = "extracting";
32
+ AnalysisStatus["initializing"] = "initializing";
33
+ AnalysisStatus["notStarted"] = "notStarted";
34
34
  })(AnalysisStatus || (exports.AnalysisStatus = AnalysisStatus = {}));
35
35
  var ManifestCategory;
36
36
  (function (ManifestCategory) {
37
- ManifestCategory["primary"] = "primary";
38
37
  ManifestCategory["buildStamped"] = "build-stamped";
38
+ ManifestCategory["primary"] = "primary";
39
39
  ManifestCategory["versioned"] = "versioned";
40
40
  })(ManifestCategory || (exports.ManifestCategory = ManifestCategory = {}));
41
41
  const hasBuildKickedOff = (build) => {
@@ -51,7 +51,7 @@ const isPlatformBuildRunning = (platformBuild) => {
51
51
  }
52
52
  return (!platformBuild.shouldSkip && // <-- Noteworthy
53
53
  !['cancelled', 'succeeded'].includes(platformBuild.status) &&
54
- ('failed' !== platformBuild.status ||
54
+ (platformBuild.status !== 'failed' ||
55
55
  platformBuild.numberOfAttemptedBuilds < 2));
56
56
  };
57
57
  exports.isPlatformBuildRunning = isPlatformBuildRunning;
@@ -63,7 +63,8 @@ const isCiBuildRunning = (build) => {
63
63
  return (build.status === 'building' ||
64
64
  (build.status === 'failed' &&
65
65
  ['linux', 'mac', 'windows'].some((platform) => build.status === 'building' ||
66
- (build.status === 'failed' && (0, exports.isPlatformBuildRunning)(build[platform])))));
66
+ (build.status === 'failed' &&
67
+ (0, exports.isPlatformBuildRunning)(build[platform])))));
67
68
  };
68
69
  exports.isCiBuildRunning = isCiBuildRunning;
69
70
  const isBuildRunning = (build) => {