@todesktop/shared 7.189.25 → 7.191.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 (47) hide show
  1. package/.legacy-sync.json +6 -0
  2. package/.prettierignore +0 -2
  3. package/CHANGELOG.md +13 -0
  4. package/README.md +42 -15
  5. package/eslint.config.mjs +8 -55
  6. package/lib/base.d.ts +81 -75
  7. package/lib/base.js +9 -12
  8. package/lib/desktopify.d.ts +74 -74
  9. package/lib/desktopify.js +28 -35
  10. package/lib/desktopify2.d.ts +224 -220
  11. package/lib/desktopify2.js +2 -5
  12. package/lib/getSiteInfo.d.ts +6 -6
  13. package/lib/getSiteInfo.js +1 -2
  14. package/lib/hsm.d.ts +1 -1
  15. package/lib/hsm.js +5 -12
  16. package/lib/index.d.ts +12 -13
  17. package/lib/index.js +13 -31
  18. package/lib/invitePermissionLabels.d.ts +4 -2
  19. package/lib/invitePermissionLabels.js +14 -11
  20. package/lib/personalAccessTokens.d.ts +12 -12
  21. package/lib/personalAccessTokens.js +1 -2
  22. package/lib/plans.d.ts +27 -27
  23. package/lib/plans.js +181 -185
  24. package/lib/plugin.d.ts +23 -14
  25. package/lib/plugin.js +1 -2
  26. package/lib/toDesktop.d.ts +66 -66
  27. package/lib/toDesktop.js +1 -2
  28. package/lib/translation.d.ts +1 -1
  29. package/lib/translation.js +1 -2
  30. package/lib/validations.d.ts +66 -66
  31. package/lib/validations.js +54 -56
  32. package/package.json +11 -17
  33. package/src/base.ts +89 -82
  34. package/src/desktopify.ts +82 -80
  35. package/src/desktopify2.ts +241 -237
  36. package/src/getSiteInfo.ts +6 -6
  37. package/src/hsm.ts +7 -7
  38. package/src/index.ts +13 -14
  39. package/src/invitePermissionLabels.ts +20 -6
  40. package/src/personalAccessTokens.ts +12 -12
  41. package/src/plans.ts +191 -191
  42. package/src/plugin.ts +24 -14
  43. package/src/toDesktop.ts +70 -70
  44. package/src/translation.ts +2 -2
  45. package/src/validations.ts +51 -49
  46. package/tsconfig.json +6 -3
  47. package/.prettierrc +0 -5
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.189.25",
3
+ "version": "7.191.0",
4
4
  "description": "",
5
+ "type": "module",
5
6
  "main": "./lib/index.js",
6
7
  "types": "./lib/index.d.ts",
7
8
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
9
  "build": "rm -f ./lib/* && tsc",
10
- "lint": "npm run lint:types && npm run lint:styles",
11
- "lint:types": "tsc --noEmit",
12
- "lint:styles": "prettier --check . && eslint src",
13
- "prepublishOnly": "npm run build",
14
10
  "bump": "npm version minor && git push && npm publish",
15
- "dev": "tsc"
11
+ "dev": "tsc",
12
+ "format": "prettier . --write && eslint --fix",
13
+ "lint": "prettier . --check && eslint",
14
+ "prepublishOnly": "npm run build",
15
+ "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "author": "Dave Jeffery <dave@davejeffery.com>",
18
18
  "license": "UNLICENSED",
@@ -25,17 +25,11 @@
25
25
  "yup": "^1.4.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@eslint/eslintrc": "^3.1.0",
29
- "@eslint/js": "^9.9.1",
28
+ "@todesktop/dev-config": "workspace:*",
30
29
  "@types/semver": "^7.3.9",
31
- "@typescript-eslint/eslint-plugin": "^8.4.0",
32
- "@typescript-eslint/parser": "^8.4.0",
33
30
  "app-builder-lib": "^25.1.8",
34
- "eslint": "^9.9.1",
35
- "eslint-config-prettier": "^8.8.0",
36
- "eslint-plugin-prettier": "^4.2.1",
37
- "globals": "^15.9.0",
38
- "prettier": "^2.8.8",
39
- "typescript": "^5.5.4"
31
+ "eslint": "catalog:",
32
+ "prettier": "catalog:",
33
+ "typescript": "catalog:"
40
34
  }
41
35
  }
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,24 @@ 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;
170
174
  provisioningProfile?: FilePath;
175
+ type?: 'development' | 'distribution'; // defaults to development
171
176
  x64ArchFiles?: string;
172
177
  };
173
178
  nodeVersion?: string;
174
179
  npmVersion?: string;
175
- packageManager?: 'npm' | 'yarn' | 'pnpm';
180
+ packageManager?: 'npm' | 'pnpm' | 'yarn';
176
181
  pnpmVersion?: string;
177
182
  productName?: string;
178
- rebuildLibrary?: 'app-builder' | '@electron/rebuild';
183
+ rebuildLibrary?: '@electron/rebuild' | 'app-builder';
179
184
  schemaVersion: number;
180
185
  snap?: IAppBuilderLib['config']['snap'];
181
186
  updateUrlBase?: string;
@@ -196,48 +201,48 @@ export interface ToDesktopJson {
196
201
  }
197
202
 
198
203
  export enum WindowsHSMCertType {
204
+ azureTrustedSigning = 'azureTrustedSigning',
199
205
  ev = 'ev',
200
206
  file = 'file',
201
- azureTrustedSigning = 'azureTrustedSigning',
202
207
  }
203
208
 
204
209
  export interface CustomWindowsCodeSignFile {
205
210
  certType: string;
206
- hsmCertType: WindowsHSMCertType.file;
207
211
  hsmCertName: string;
212
+ hsmCertType: WindowsHSMCertType.file;
208
213
  }
209
214
 
210
215
  export interface CustomWindowsCodeSignEV {
211
216
  certType: 'hsm';
212
- hsmCertType: WindowsHSMCertType.ev;
213
217
  hsmCertName: string;
218
+ hsmCertType: WindowsHSMCertType.ev;
214
219
  }
215
220
 
216
221
  export interface CustomWindowsCodeSignAzureTrustedSigning {
217
- certType: 'azureTrustedSigning';
218
- azureCredentialsStored: boolean;
219
222
  azureBaseSettings: {
220
223
  $azureClientSecretRef: string;
221
224
  clientId: string;
222
- tenantId: string;
223
225
  codeSigningAccountName: string;
224
- subscriptionId: string;
225
226
  resourceGroupName: string;
227
+ subscriptionId: string;
228
+ tenantId: string;
226
229
  };
230
+ azureCredentialsStored: boolean;
227
231
  azureSettings?: {
228
232
  accountUri: string;
229
233
  certificateProfileId: string;
230
234
  certificateProfileName: string;
231
235
  publisherName: string;
232
236
  };
237
+ certType: 'azureTrustedSigning';
233
238
  }
234
239
 
235
240
  export type CustomMacCodeSign =
236
241
  | {
237
- type: 'url';
238
242
  certName: string;
239
243
  certPassword: string;
240
244
  certUrl: string;
245
+ type: 'url';
241
246
  }
242
247
  | {
243
248
  type: 'hsm';
@@ -253,37 +258,28 @@ export type CustomMacNotarization =
253
258
  | CustomNotarizationPasswordHsmAuth;
254
259
 
255
260
  export interface CustomNotarizationApiKeyAuth {
256
- type: 'hsm-api';
257
- appleApiKeyId: string;
258
- appleApiIssuer: string;
259
261
  $appleApiKey: string;
262
+ appleApiIssuer: string;
263
+ appleApiKeyId: string;
264
+ type: 'hsm-api';
260
265
  }
261
266
 
262
267
  export interface CustomNotarizationPasswordHsmAuth {
263
- type: 'hsm';
268
+ $appSpecificPassword: string;
264
269
  appleId: string;
265
270
  teamId: string;
266
- $appSpecificPassword: string;
271
+ type: 'hsm';
267
272
  }
268
273
 
269
274
  export type ReleaseRedirectionRule =
270
- | {
271
- appId: string;
272
- rule: 'app';
273
- }
274
- | {
275
- feedUrl: string;
276
- rule: 'app';
277
- }
278
275
  | {
279
276
  appId: string;
280
277
  ipList: string[];
281
278
  rule: 'appByIp';
282
279
  }
283
280
  | {
284
- feedUrl: string;
285
- ipList: string[];
286
- rule: 'appByIp';
281
+ appId: string;
282
+ rule: 'app';
287
283
  }
288
284
  | {
289
285
  buildId: string;
@@ -294,33 +290,49 @@ export type ReleaseRedirectionRule =
294
290
  buildId: string;
295
291
  platforms: PlatformName[];
296
292
  rule: 'buildByPlatform';
293
+ }
294
+ | {
295
+ feedUrl: string;
296
+ ipList: string[];
297
+ rule: 'appByIp';
298
+ }
299
+ | {
300
+ feedUrl: string;
301
+ rule: 'app';
297
302
  };
298
303
 
299
304
  export interface BaseApp extends Schemable {
300
- id: string;
301
305
  appModelId?: string;
306
+ // artifact configs
307
+ appxConfig?: Partial<IAppBuilderLib['config']['appx']>;
308
+ // artifact configs
302
309
  customDomain?: string;
303
- domainVerificationCode?: string;
310
+ customLinuxPgpKey?: CustomLinuxPGPKey;
304
311
  customMacCodeSign?: CustomMacCodeSign;
305
312
  customNotarization?: CustomMacNotarization;
306
- customLinuxPgpKey?: CustomLinuxPGPKey;
307
313
  customWindowsCodeSign?:
308
- | CustomWindowsCodeSignFile
314
+ | CustomWindowsCodeSignAzureTrustedSigning
309
315
  | CustomWindowsCodeSignEV
310
- | CustomWindowsCodeSignAzureTrustedSigning;
311
- macHsmCertNames?: Record<MacTarget, string>;
312
- windowsHsmCertNames?: Record<WindowsTarget, string>;
316
+ | CustomWindowsCodeSignFile;
317
+ domainVerificationCode?: string;
318
+ id: string;
313
319
 
320
+ macHsmCertNames?: Record<MacTarget, string>;
321
+ macUniversalInstallerConfig?: {
322
+ shouldPinToVersion?: boolean;
323
+ };
324
+ masConfig?: {
325
+ arch?: 'arm64' | 'universal';
326
+ } & Partial<IAppBuilderLib['config']['mas']>;
314
327
  meta?: IAppMeta;
328
+
329
+ nsisConfig?: Partial<IAppBuilderLib['config']['nsis']>;
330
+ parent?: { id: string; relationshipToParent: string } | null;
315
331
  // this property is dynamically resolved at queueBuild in cloud functions
316
332
  parentApp?: BaseApp;
317
- parent?: { id: string; relationshipToParent: string } | null;
318
- subscription?: Subscription;
319
-
320
333
  // artifacts
321
334
  shouldCreate32BitWindowsArtifacts?: boolean;
322
335
  shouldCreateAppImages?: boolean;
323
-
324
336
  shouldCreateAppleIntelArtifacts?: boolean;
325
337
  shouldCreateAppleSiliconAssets?: boolean;
326
338
  shouldCreateAppXFiles?: boolean;
@@ -337,23 +349,18 @@ export interface BaseApp extends Schemable {
337
349
  shouldCreateNSISWebInstaller?: boolean;
338
350
  shouldCreateRPMPackages?: boolean;
339
351
  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
- };
352
+ snapStore?: { description?: string; login?: string };
353
+ subscription?: Subscription;
354
+ windowsHsmCertNames?: Record<WindowsTarget, string>;
348
355
  }
349
356
 
350
357
  export type Subscription = {
351
- status: string;
352
- subscriptionId: string;
353
358
  itemId: string;
354
359
  planId: string;
355
-
360
+ priceId?: string;
356
361
  // todo: remove optional qualifier once we complete migration
357
362
  productId?: string;
358
- priceId?: string;
363
+
364
+ status: string;
365
+ subscriptionId: string;
359
366
  };