File tree 3 files changed +25
-16
lines changed
3 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,28 @@ import retry from 'promise-retry';
4
4
import { checkSignatures } from './check-signature' ;
5
5
import { isNotaryToolAvailable , notarizeAndWaitForNotaryTool } from './notarytool' ;
6
6
import { stapleApp } from './staple' ;
7
- import { NotarizeOptions , NotaryToolStartOptions } from './types' ;
7
+ import {
8
+ NotarizeOptions ,
9
+ NotaryToolStartOptions ,
10
+ NotarizeOptionsLegacy ,
11
+ NotarizeOptionsNotaryTool ,
12
+ } from './types' ;
8
13
9
14
const d = debug ( 'electron-notarize' ) ;
10
15
11
16
export { NotarizeOptions } ;
12
17
13
18
export { validateNotaryToolAuthorizationArgs as validateAuthorizationArgs } from './validate-args' ;
14
19
15
- export async function notarize ( { appPath, ...otherOptions } : NotarizeOptions ) {
20
+ async function notarize ( args : NotarizeOptionsNotaryTool ) : Promise < void > ;
21
+ /** @deprecated */
22
+ async function notarize ( args : NotarizeOptionsLegacy ) : Promise < void > ;
23
+
24
+ async function notarize ( { appPath, ...otherOptions } : NotarizeOptions ) {
16
25
if ( otherOptions . tool === 'legacy' ) {
17
- throw new Error ( 'Notarization with the legacy altool system was decommisioned as of November 2023' ) ;
26
+ throw new Error (
27
+ 'Notarization with the legacy altool system was decommisioned as of November 2023' ,
28
+ ) ;
18
29
}
19
30
20
31
await checkSignatures ( { appPath } ) ;
@@ -33,3 +44,5 @@ export async function notarize({ appPath, ...otherOptions }: NotarizeOptions) {
33
44
retries : 3 ,
34
45
} ) ;
35
46
}
47
+
48
+ export { notarize } ;
Original file line number Diff line number Diff line change 1
1
import debug from 'debug' ;
2
2
3
- import {
4
- LegacyNotarizeStartOptions ,
5
- LegacyNotarizeWaitOptions ,
6
- } from './types' ;
3
+ import { LegacyNotarizeStartOptions , LegacyNotarizeWaitOptions } from './types' ;
7
4
8
5
const d = debug ( 'electron-notarize:legacy' ) ;
9
6
10
7
/** @deprecated */
11
- export async function startLegacyNotarize (
12
- opts : LegacyNotarizeStartOptions ,
13
- ) : Promise < never > {
8
+ export async function startLegacyNotarize ( opts : LegacyNotarizeStartOptions ) : Promise < never > {
14
9
d ( 'starting notarize process for app:' , opts . appPath ) ;
15
- throw new Error ( " Cannot start notarization. Legacy notarization (altool) is no longer available" )
10
+ throw new Error ( ' Cannot start notarization. Legacy notarization (altool) is no longer available' ) ;
16
11
}
17
12
18
13
/** @deprecated */
19
14
export async function waitForLegacyNotarize ( opts : LegacyNotarizeWaitOptions ) : Promise < never > {
20
- throw new Error ( "Cannot wait for notarization. Legacy notarization (altool) is no longer available" )
15
+ throw new Error (
16
+ 'Cannot wait for notarization. Legacy notarization (altool) is no longer available' ,
17
+ ) ;
21
18
}
Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ export type LegacyNotarizeWaitOptions = NotarizeResult & LegacyNotarizeCredentia
65
65
export type NotarizeStapleOptions = Pick < LegacyNotarizeAppOptions , 'appPath' > ;
66
66
67
67
/** @deprecated */
68
- export type LegacyNotarizeOptions = ( { tool ?: 'legacy' } & LegacyNotarizeStartOptions )
69
- export type NotarizeOptions =
70
- | /** @deprecate */ ( { tool ?: 'legacy' /** @deprecated */ } & LegacyNotarizeStartOptions )
71
- | ( { tool ?: 'notarytool' } & NotaryToolStartOptions ) ;
68
+ export type NotarizeOptionsLegacy = { tool : 'legacy' } & LegacyNotarizeStartOptions ;
69
+ export type NotarizeOptionsNotaryTool = { tool ?: 'notarytool' } & NotaryToolStartOptions ;
70
+ export type NotarizeOptions = NotarizeOptionsLegacy | NotarizeOptionsNotaryTool ;
You can’t perform that action at this time.
0 commit comments