File tree Expand file tree Collapse file tree 9 files changed +373
-109
lines changed Expand file tree Collapse file tree 9 files changed +373
-109
lines changed Original file line number Diff line number Diff line change 11import  os  from  'os' ; 
2- import  {  ServerErrorResponse  }  from  '@grpc/grpc-js' ; 
32import  {  Status  }  from  '@grpc/grpc-js/build/src/constants' ; 
43import  { 
54  DataConverter , 
98  filterNullAndUndefined , 
109}  from  '@temporalio/common' ; 
1110import  {  Connection ,  WorkflowService  }  from  './connection' ; 
11+ import  {  isServerErrorResponse  }  from  './errors' ; 
1212
1313/** 
1414 * Thrown by {@link  AsyncCompletionClient} when trying to complete or heartbeat 
@@ -34,14 +34,6 @@ export class ActivityCancelledError extends Error {
3434  public  readonly  name  =  'ActivityCancelledError' ; 
3535} 
3636
37- /** 
38-  * Type assertion helper, assertion is mostly empty because any additional 
39-  * properties are optional. 
40-  */ 
41- function  isServerErrorResponse ( err : unknown ) : err  is ServerErrorResponse  { 
42-   return  err  instanceof  Error ; 
43- } 
44- 
4537/** 
4638 * Options used to configure {@link  AsyncCompletionClient} 
4739 */ 
Original file line number Diff line number Diff line change 1+ import  {  ServerErrorResponse  }  from  '@grpc/grpc-js' ; 
12import  {  RetryState ,  TemporalFailure  }  from  '@temporalio/common' ; 
3+ export  {  WorkflowExecutionAlreadyStartedError  }  from  '@temporalio/common' ; 
4+ 
5+ /** 
6+  * Generic Error class for errors coming from the service 
7+  */ 
8+ export  class  ServiceError  extends  Error  { 
9+   public  readonly  name : string  =  'ServiceError' ; 
10+   public  readonly  cause ?: Error ; 
11+ 
12+   constructor ( message : string ,  opts ?: {  cause : Error  } )  { 
13+     super ( message ) ; 
14+     this . cause  =  opts ?. cause ; 
15+   } 
16+ } 
217
318/** 
419 * Thrown by the client while waiting on Workflow execution result if execution 
@@ -32,3 +47,11 @@ export class WorkflowContinuedAsNewError extends Error {
3247    super ( message ) ; 
3348  } 
3449} 
50+ 
51+ /** 
52+  * Type assertion helper, assertion is mostly empty because any additional 
53+  * properties are optional. 
54+  */ 
55+ export  function  isServerErrorResponse ( err : unknown ) : err  is ServerErrorResponse  { 
56+   return  err  instanceof  Error ; 
57+ } 
Original file line number Diff line number Diff line change @@ -48,11 +48,13 @@ export interface WorkflowTerminateInput {
4848  readonly  workflowExecution : WorkflowExecution ; 
4949  readonly  reason ?: string ; 
5050  readonly  details ?: unknown [ ] ; 
51+   readonly  firstExecutionRunId ?: string ; 
5152} 
5253
5354/** Input for WorkflowClientCallsInterceptor.cancel */ 
5455export  interface  WorkflowCancelInput  { 
5556  readonly  workflowExecution : WorkflowExecution ; 
57+   readonly  firstExecutionRunId ?: string ; 
5658} 
5759
5860/** 
Original file line number Diff line number Diff line change 11import  {  temporal  }  from  '@temporalio/proto' ; 
22
3- export  type  WorkflowExecution  =  temporal . api . common . v1 . IWorkflowExecution ; 
3+ export  interface  WorkflowExecution  { 
4+   workflowId : string ; 
5+   runId ?: string ; 
6+ } 
47export  type  StartWorkflowExecutionRequest  =  temporal . api . workflowservice . v1 . IStartWorkflowExecutionRequest ; 
58export  type  GetWorkflowExecutionHistoryRequest  =  temporal . api . workflowservice . v1 . IGetWorkflowExecutionHistoryRequest ; 
69export  type  DescribeWorkflowExecutionResponse  =  temporal . api . workflowservice . v1 . IDescribeWorkflowExecutionResponse ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments