@@ -645,28 +645,29 @@ export function proxyLocalActivities<A = UntypedActivities>(
645645 // Validate as early as possible for immediate user feedback
646646 validateLocalActivityOptions ( options ) ;
647647
648- function createLocalActivityProxy ( summaries : Record < string , string > = { } ) : ActivityInterfaceWithOptions < A > {
648+ function createActivityProxy ( options : ActivityOptions ) : ActivityInterfaceWithOptions < A > {
649649 return new Proxy ( { } as ActivityInterfaceWithOptions < A > , {
650- get ( _ , prop ) {
651- if ( prop === 'withSummaries' ) {
652- return function withSummaries ( newSummaries : Record < string , string > ) : ActivityInterfaceWithOptions < A > {
653- return createLocalActivityProxy ( newSummaries ) ;
654- } ;
650+ get ( _ , activityType ) {
651+ if ( typeof activityType !== 'string' ) {
652+ throw new TypeError ( `Only strings are supported for Activity types, got: ${ String ( activityType ) } ` ) ;
655653 }
656654
657- if ( typeof prop !== 'string' ) {
658- throw new TypeError ( `Only strings are supported for Activity types, got: ${ String ( prop ) } ` ) ;
655+ function activityProxyFunction ( ... args : unknown [ ] ) : Promise < unknown > {
656+ return scheduleLocalActivity ( activityType as string , args , options ) ;
659657 }
660658
661- return function localActivityProxyFunction ( ...args : unknown [ ] ) : Promise < unknown > {
662- const summary = summaries [ prop ] ;
663- return scheduleLocalActivity ( prop , args , options , summary ) ;
659+ activityProxyFunction . runWithOptions = function (
660+ overrideOptions : ActivityOptions ,
661+ args : any [ ]
662+ ) : Promise < unknown > {
663+ return scheduleLocalActivity ( activityType , args , { ...options , ...overrideOptions } ) ;
664664 } ;
665+
666+ return activityProxyFunction ;
665667 } ,
666668 } ) ;
667669 }
668-
669- return createLocalActivityProxy ( ) ;
670+ return createActivityProxy ( options ) ;
670671}
671672
672673// TODO: deprecate this patch after "enough" time has passed
0 commit comments