@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
package/src/base.ts CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  Release,
8
8
  } from './desktopify';
9
9
  import { MacTarget, WindowsTarget } from './hsm';
10
+
10
11
  export interface Schemable {
11
12
  schemaVersion?: number;
12
13
  }
@@ -14,34 +15,34 @@ export interface Schemable {
14
15
  type CompositeIdFileLocationKey = string;
15
16
  export type StaticAnalysisItem = { hidden: boolean };
16
17
 
17
- export type ProgressTypes = 'queued' | 'progress' | 'done' | 'error';
18
+ export type ProgressTypes = 'done' | 'error' | 'progress' | 'queued';
18
19
 
19
20
  export interface IChecklistItem {
20
21
  [id: string]: boolean;
21
22
  }
22
23
 
23
24
  export interface IDownloadButtonOptions {
24
- buttonSize: 'small' | 'medium' | 'large';
25
- fontFamily: 'serif' | 'sans-serif';
26
25
  bgColor: string;
27
- fgColor: string;
28
26
  borderRadius: number;
27
+ btnText: string;
28
+ buttonSize: 'large' | 'medium' | 'small';
29
+ fgColor: string;
30
+ fontFamily: 'sans-serif' | 'serif';
29
31
  showAppIcon: {
32
+ alignment: 'left' | 'right';
30
33
  enabled: boolean;
31
- alignment: 'right' | 'left';
32
34
  };
33
35
  showDownloadIcon: {
36
+ alignment: 'left' | 'right';
34
37
  enabled: boolean;
35
- alignment: 'right' | 'left';
36
38
  };
37
- btnText: string;
38
39
  }
39
40
 
40
41
  export enum WindowsEVOnboardingSteps {
41
- 'hasChosenProvider' = 'hasChosenProvider',
42
- 'hasOrderedCert' = 'hasOrderedCert',
43
42
  'hasBeenVerified' = 'hasBeenVerified',
43
+ 'hasChosenProvider' = 'hasChosenProvider',
44
44
  'hasGeneratedCert' = 'hasGeneratedCert',
45
+ 'hasOrderedCert' = 'hasOrderedCert',
45
46
  'hasUploadedCert' = 'hasUploadedCert',
46
47
  }
47
48
 
@@ -54,8 +55,8 @@ export interface IAppBuildProgress {
54
55
  isBuilding: boolean;
55
56
  message: string;
56
57
  percent: number;
57
- type: ProgressTypes;
58
58
  shouldSkip: boolean;
59
+ type: ProgressTypes;
59
60
  }
60
61
 
61
62
  export interface IAppMeta {
@@ -66,80 +67,84 @@ export interface IAppMeta {
66
67
  currentBuildProgress?: {
67
68
  channel?: string;
68
69
  id?: string;
69
- releaseId?: Release['id'];
70
70
  linux?: IAppBuildProgress;
71
71
  mac?: IAppBuildProgress;
72
72
  projectConfig?: ToDesktopJson;
73
+ releaseId?: Release['id'];
73
74
  shouldCodeSign?: boolean;
74
75
  shouldRelease?: boolean;
75
76
  shouldSendCompletionEmail?: boolean;
76
77
  sourceArchiveDetails?: {
77
78
  bucket: string;
79
+ hash?: string;
78
80
  key: string;
79
81
  url: string;
80
- hash?: string;
81
82
  };
82
83
  windows?: IAppBuildProgress;
83
84
  };
84
85
  downloadButtons?: {
85
- universal: IDownloadButtonOptions;
86
+ linux: IDownloadButtonOptions;
86
87
  mac: IDownloadButtonOptions;
88
+ universal: IDownloadButtonOptions;
87
89
  windows: IDownloadButtonOptions;
88
- linux: IDownloadButtonOptions;
89
90
  };
90
91
  firstSuccessfulBuildEndedAt?: string;
91
- staticAnalysis?: Record<CompositeIdFileLocationKey, StaticAnalysisItem>;
92
+ forceVersionNumber?: string;
92
93
  isAppChanged?: boolean;
93
94
  isFrameBlocked?: boolean;
94
95
  isHttps?: boolean;
95
96
  latestReleaseBuildId?: string;
97
+ previousInstallLockSha?: string;
96
98
  publishedVersions: {
97
99
  desktopify?: string;
98
100
  electron?: string;
99
101
  version?: string;
100
102
  };
101
- previousInstallLockSha?: string;
102
103
  releaseRedirections?: ReleaseRedirectionRule[];
104
+ staticAnalysis?: Record<CompositeIdFileLocationKey, StaticAnalysisItem>;
105
+ webhookHMACKey?: string;
106
+ webhooks?: {
107
+ release?: string;
108
+ };
103
109
  windowsEVOnboarding?: {
104
- provider: WindowsEVOnboardingProvider;
105
- tempHSMCertName: string;
106
- [WindowsEVOnboardingSteps.hasChosenProvider]: boolean;
107
- [WindowsEVOnboardingSteps.hasOrderedCert]: boolean;
108
110
  [WindowsEVOnboardingSteps.hasBeenVerified]: boolean;
111
+ [WindowsEVOnboardingSteps.hasChosenProvider]: boolean;
109
112
  [WindowsEVOnboardingSteps.hasGeneratedCert]: boolean;
113
+ [WindowsEVOnboardingSteps.hasOrderedCert]: boolean;
110
114
  [WindowsEVOnboardingSteps.hasUploadedCert]: boolean;
115
+ provider: WindowsEVOnboardingProvider;
116
+ tempHSMCertName: string;
111
117
  };
112
- forceVersionNumber?: string;
113
- webhooks?: {
114
- release?: string;
115
- };
116
- webhookHMACKey?: string;
117
118
  }
118
119
 
119
120
  export interface ToDesktopJson {
120
121
  appBuilderLibVersion?: string;
121
- appId?: string;
122
122
  appFiles?: string[];
123
+ appId?: string;
123
124
  appPath?: FilePath;
124
125
  appProtocolScheme?: string | string[];
125
126
  asar?: boolean;
126
127
  asarUnpack?: boolean | string[];
127
128
  bucket?: string;
128
129
  buildVersion?: string;
130
+ bytenode?: {
131
+ enabled?: boolean;
132
+ files?: string[];
133
+ };
129
134
  copyright?: string;
130
135
  dmg?: {
131
- background?: FilePath;
132
136
  artifactName?: string;
137
+ background?: FilePath;
133
138
  backgroundColor?: string;
139
+ contents?: NonNullable<IAppBuilderLib['config']['dmg']>['contents'];
134
140
  iconSize?: number;
135
141
  iconTextSize?: number;
136
142
  title?: string;
137
- contents?: IAppBuilderLib['config']['dmg']['contents'];
138
- window?: IAppBuilderLib['config']['dmg']['window'];
143
+ window?: NonNullable<IAppBuilderLib['config']['dmg']>['window'];
139
144
  };
140
- extraContentFiles?: ExtraFileReference[];
141
145
  electronMirror?: string;
142
146
  electronVersion?: string;
147
+ extraContentFiles?: ExtraFileReference[];
143
148
  extraResources?: ExtraFileReference[];
144
149
  fileAssociations?: IAppBuilderLib['config']['fileAssociations'];
145
150
  filesForDistribution?: string[];
@@ -158,24 +163,25 @@ export interface ToDesktopJson {
158
163
  dmgBackground?: FilePath;
159
164
  entitlements?: FilePath;
160
165
  entitlementsInherit?: FilePath;
161
- provisioningProfile?: FilePath;
162
- extendInfo?: IAppBuilderLib['config']['mac']['extendInfo'];
166
+ extendInfo?: NonNullable<IAppBuilderLib['config']['mac']>['extendInfo'];
163
167
  icon?: FilePath;
168
+ provisioningProfile?: FilePath;
164
169
  requirements?: FilePath;
165
170
  };
166
171
  mas?: {
167
- type?: 'development' | 'distribution'; // defaults to development
168
172
  entitlements?: FilePath;
169
173
  entitlementsInherit?: FilePath;
174
+ minimumSystemVersion?: string;
170
175
  provisioningProfile?: FilePath;
176
+ type?: 'development' | 'distribution'; // defaults to development
171
177
  x64ArchFiles?: string;
172
178
  };
173
179
  nodeVersion?: string;
174
180
  npmVersion?: string;
175
- packageManager?: 'npm' | 'yarn' | 'pnpm';
181
+ packageManager?: 'npm' | 'pnpm' | 'yarn';
176
182
  pnpmVersion?: string;
177
183
  productName?: string;
178
- rebuildLibrary?: 'app-builder' | '@electron/rebuild';
184
+ rebuildLibrary?: '@electron/rebuild' | 'app-builder';
179
185
  schemaVersion: number;
180
186
  snap?: IAppBuilderLib['config']['snap'];
181
187
  updateUrlBase?: string;
@@ -196,48 +202,48 @@ export interface ToDesktopJson {
196
202
  }
197
203
 
198
204
  export enum WindowsHSMCertType {
205
+ azureTrustedSigning = 'azureTrustedSigning',
199
206
  ev = 'ev',
200
207
  file = 'file',
201
- azureTrustedSigning = 'azureTrustedSigning',
202
208
  }
203
209
 
204
210
  export interface CustomWindowsCodeSignFile {
205
211
  certType: string;
206
- hsmCertType: WindowsHSMCertType.file;
207
212
  hsmCertName: string;
213
+ hsmCertType: WindowsHSMCertType.file;
208
214
  }
209
215
 
210
216
  export interface CustomWindowsCodeSignEV {
211
217
  certType: 'hsm';
212
- hsmCertType: WindowsHSMCertType.ev;
213
218
  hsmCertName: string;
219
+ hsmCertType: WindowsHSMCertType.ev;
214
220
  }
215
221
 
216
222
  export interface CustomWindowsCodeSignAzureTrustedSigning {
217
- certType: 'azureTrustedSigning';
218
- azureCredentialsStored: boolean;
219
223
  azureBaseSettings: {
220
224
  $azureClientSecretRef: string;
221
225
  clientId: string;
222
- tenantId: string;
223
226
  codeSigningAccountName: string;
224
- subscriptionId: string;
225
227
  resourceGroupName: string;
228
+ subscriptionId: string;
229
+ tenantId: string;
226
230
  };
231
+ azureCredentialsStored: boolean;
227
232
  azureSettings?: {
228
233
  accountUri: string;
229
234
  certificateProfileId: string;
230
235
  certificateProfileName: string;
231
236
  publisherName: string;
232
237
  };
238
+ certType: 'azureTrustedSigning';
233
239
  }
234
240
 
235
241
  export type CustomMacCodeSign =
236
242
  | {
237
- type: 'url';
238
243
  certName: string;
239
244
  certPassword: string;
240
245
  certUrl: string;
246
+ type: 'url';
241
247
  }
242
248
  | {
243
249
  type: 'hsm';
@@ -253,37 +259,28 @@ export type CustomMacNotarization =
253
259
  | CustomNotarizationPasswordHsmAuth;
254
260
 
255
261
  export interface CustomNotarizationApiKeyAuth {
256
- type: 'hsm-api';
257
- appleApiKeyId: string;
258
- appleApiIssuer: string;
259
262
  $appleApiKey: string;
263
+ appleApiIssuer: string;
264
+ appleApiKeyId: string;
265
+ type: 'hsm-api';
260
266
  }
261
267
 
262
268
  export interface CustomNotarizationPasswordHsmAuth {
263
- type: 'hsm';
269
+ $appSpecificPassword: string;
264
270
  appleId: string;
265
271
  teamId: string;
266
- $appSpecificPassword: string;
272
+ type: 'hsm';
267
273
  }
268
274
 
269
275
  export type ReleaseRedirectionRule =
270
- | {
271
- appId: string;
272
- rule: 'app';
273
- }
274
- | {
275
- feedUrl: string;
276
- rule: 'app';
277
- }
278
276
  | {
279
277
  appId: string;
280
278
  ipList: string[];
281
279
  rule: 'appByIp';
282
280
  }
283
281
  | {
284
- feedUrl: string;
285
- ipList: string[];
286
- rule: 'appByIp';
282
+ appId: string;
283
+ rule: 'app';
287
284
  }
288
285
  | {
289
286
  buildId: string;
@@ -294,33 +291,49 @@ export type ReleaseRedirectionRule =
294
291
  buildId: string;
295
292
  platforms: PlatformName[];
296
293
  rule: 'buildByPlatform';
294
+ }
295
+ | {
296
+ feedUrl: string;
297
+ ipList: string[];
298
+ rule: 'appByIp';
299
+ }
300
+ | {
301
+ feedUrl: string;
302
+ rule: 'app';
297
303
  };
298
304
 
299
305
  export interface BaseApp extends Schemable {
300
- id: string;
301
306
  appModelId?: string;
307
+ // artifact configs
308
+ appxConfig?: Partial<IAppBuilderLib['config']['appx']>;
309
+ // artifact configs
302
310
  customDomain?: string;
303
- domainVerificationCode?: string;
311
+ customLinuxPgpKey?: CustomLinuxPGPKey;
304
312
  customMacCodeSign?: CustomMacCodeSign;
305
313
  customNotarization?: CustomMacNotarization;
306
- customLinuxPgpKey?: CustomLinuxPGPKey;
307
314
  customWindowsCodeSign?:
308
- | CustomWindowsCodeSignFile
315
+ | CustomWindowsCodeSignAzureTrustedSigning
309
316
  | CustomWindowsCodeSignEV
310
- | CustomWindowsCodeSignAzureTrustedSigning;
311
- macHsmCertNames?: Record<MacTarget, string>;
312
- windowsHsmCertNames?: Record<WindowsTarget, string>;
317
+ | CustomWindowsCodeSignFile;
318
+ domainVerificationCode?: string;
319
+ id: string;
313
320
 
321
+ macHsmCertNames?: Record<MacTarget, string>;
322
+ macUniversalInstallerConfig?: {
323
+ shouldPinToVersion?: boolean;
324
+ };
325
+ masConfig?: {
326
+ arch?: 'arm64' | 'universal';
327
+ } & Partial<IAppBuilderLib['config']['mas']>;
314
328
  meta?: IAppMeta;
329
+
330
+ nsisConfig?: Partial<IAppBuilderLib['config']['nsis']>;
331
+ parent?: { id: string; relationshipToParent: string } | null;
315
332
  // this property is dynamically resolved at queueBuild in cloud functions
316
333
  parentApp?: BaseApp;
317
- parent?: { id: string; relationshipToParent: string } | null;
318
- subscription?: Subscription;
319
-
320
334
  // artifacts
321
335
  shouldCreate32BitWindowsArtifacts?: boolean;
322
336
  shouldCreateAppImages?: boolean;
323
-
324
337
  shouldCreateAppleIntelArtifacts?: boolean;
325
338
  shouldCreateAppleSiliconAssets?: boolean;
326
339
  shouldCreateAppXFiles?: boolean;
@@ -337,23 +350,18 @@ export interface BaseApp extends Schemable {
337
350
  shouldCreateNSISWebInstaller?: boolean;
338
351
  shouldCreateRPMPackages?: boolean;
339
352
  shouldCreateSnapFiles?: boolean;
340
- // artifact configs
341
- appxConfig?: Partial<IAppBuilderLib['config']['appx']>;
342
- masConfig?: Partial<IAppBuilderLib['config']['mas']>;
343
- nsisConfig?: Partial<IAppBuilderLib['config']['nsis']>;
344
- snapStore?: { login?: string; description?: string };
345
- macUniversalInstallerConfig?: {
346
- shouldPinToVersion?: boolean;
347
- };
353
+ snapStore?: { description?: string; login?: string };
354
+ subscription?: Subscription;
355
+ windowsHsmCertNames?: Record<WindowsTarget, string>;
348
356
  }
349
357
 
350
358
  export type Subscription = {
351
- status: string;
352
- subscriptionId: string;
353
359
  itemId: string;
354
360
  planId: string;
355
-
361
+ priceId?: string;
356
362
  // todo: remove optional qualifier once we complete migration
357
363
  productId?: string;
358
- priceId?: string;
364
+
365
+ status: string;
366
+ subscriptionId: string;
359
367
  };