File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed
packages/shortest/src/browser Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -459,12 +459,27 @@ export class BrowserTool extends BaseBrowserTool {
459
459
460
460
case "check_email" : {
461
461
if ( ! this . mailosaurTool ) {
462
- if ( ! this . config . mailosaur ) {
463
- throw new ToolError ( "Mailosaur configuration required" ) ;
462
+ const mailosaurAPIKey =
463
+ this . config . mailosaur ?. apiKey || process . env . MAILOSAUR_API_KEY ;
464
+ const mailosaurServerId =
465
+ this . config . mailosaur ?. serverId ||
466
+ process . env . MAILOSAUR_SERVER_ID ;
467
+
468
+ if ( ! mailosaurAPIKey ) {
469
+ throw new ToolError ( "Mailosaur API key is required" ) ;
464
470
}
471
+
472
+ if ( ! mailosaurServerId ) {
473
+ throw new ToolError ( "Mailosaur server ID is required" ) ;
474
+ }
475
+
476
+ if ( ! input . email ) {
477
+ throw new ToolError ( "Mailosaur email address is required" ) ;
478
+ }
479
+
465
480
this . mailosaurTool = new MailosaurTool ( {
466
- apiKey : this . config . mailosaur . apiKey ,
467
- serverId : this . config . mailosaur . serverId ,
481
+ apiKey : mailosaurAPIKey ,
482
+ serverId : mailosaurServerId ,
468
483
emailAddress : input . email ,
469
484
} ) ;
470
485
}
Original file line number Diff line number Diff line change @@ -9,14 +9,8 @@ export class MailosaurTool {
9
9
constructor ( config : {
10
10
apiKey : string ;
11
11
serverId : string ;
12
- emailAddress ? : string ;
12
+ emailAddress : string ;
13
13
} ) {
14
- if ( ! config . apiKey || ! config . serverId ) {
15
- throw new ToolError ( "Mailosaur configuration missing required fields" ) ;
16
- } else if ( ! config . emailAddress ) {
17
- throw new ToolError ( "Mailosaur email address is required" ) ;
18
- }
19
-
20
14
this . client = new Mailosaur ( config . apiKey ) ;
21
15
this . serverId = config . serverId ;
22
16
this . emailAddress = config . emailAddress ;
You can’t perform that action at this time.
0 commit comments