@@ -26,24 +26,20 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
2626 private readonly client : HTTPClient ;
2727 private readonly logger : Logger ;
2828
29- private static readonly DEFAULT_WORKFLOW_COMPONENT = "dapr" ;
30-
3129 constructor ( client : HTTPClient ) {
3230 this . client = client ;
3331 this . logger = new Logger ( "HTTPClient" , "Workflow" , client . options . logger ) ;
3432 }
3533
36- async get ( instanceID : string , workflowComponent ?: string ) : Promise < WorkflowGetResponseType > {
34+ async get ( instanceID : string ) : Promise < WorkflowGetResponseType > {
3735 if ( ! instanceID ) {
3836 throw new PropertyRequiredError ( "instanceID" ) ;
3937 }
4038
41- workflowComponent = workflowComponent ?? HTTPClientWorkflow . DEFAULT_WORKFLOW_COMPONENT ;
42-
4339 try {
4440 const result = await this . client . executeWithApiVersion (
4541 "v1.0-beta1" ,
46- `/workflows/${ workflowComponent } /${ instanceID } ` ,
42+ `/workflows/dapr /${ instanceID } ` ,
4743 { method : "GET" } ,
4844 ) ;
4945
@@ -73,7 +69,6 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
7369 workflowName : string ,
7470 input ?: any ,
7571 instanceId ?: string | undefined ,
76- workflowComponent ?: string | undefined ,
7772 options : WorkflowStartOptions = { } ,
7873 ) : Promise < string > {
7974 if ( ! workflowName ) {
@@ -84,8 +79,6 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
8479 instanceId = randomUUID ( ) ;
8580 }
8681
87- workflowComponent = workflowComponent ?? HTTPClientWorkflow . DEFAULT_WORKFLOW_COMPONENT ;
88-
8982 const queryParams = createHTTPQueryParam ( { data : { instanceID : instanceId } } ) ;
9083
9184 // Set content type if provided.
@@ -98,7 +91,7 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
9891 try {
9992 await this . client . executeWithApiVersion (
10093 "v1.0-beta1" ,
101- `/workflows/${ workflowComponent } /${ workflowName } /start?${ queryParams } ` ,
94+ `/workflows/dapr /${ workflowName } /start?${ queryParams } ` ,
10295 {
10396 method : "POST" ,
10497 body : input ,
@@ -117,7 +110,6 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
117110 instanceId : string ,
118111 eventName : string ,
119112 eventData ?: any ,
120- workflowComponent ?: string | undefined ,
121113 options : WorkflowRaiseOptions = { } ,
122114 ) : Promise < void > {
123115 if ( ! instanceId ) {
@@ -128,8 +120,6 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
128120 throw new PropertyRequiredError ( "eventName" ) ;
129121 }
130122
131- workflowComponent = workflowComponent ?? HTTPClientWorkflow . DEFAULT_WORKFLOW_COMPONENT ;
132-
133123 // Set content type if provided.
134124 // If not, HTTPClient will infer it from the data.
135125 const headers : KeyValueType = { } ;
@@ -140,7 +130,7 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
140130 try {
141131 await this . client . executeWithApiVersion (
142132 "v1.0-beta1" ,
143- `/workflows/${ workflowComponent } /${ instanceId } /raiseEvent/${ eventName } ` ,
133+ `/workflows/dapr /${ instanceId } /raiseEvent/${ eventName } ` ,
144134 {
145135 method : "POST" ,
146136 body : eventData ,
@@ -153,23 +143,23 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
153143 }
154144 }
155145
156- async terminate ( instanceId : string , workflowComponent ?: string | undefined ) : Promise < void > {
157- await this . _invokeMethod ( instanceId , "terminate" , workflowComponent ) ;
146+ async terminate ( instanceId : string ) : Promise < void > {
147+ await this . _invokeMethod ( instanceId , "terminate" ) ;
158148 }
159149
160- async pause ( instanceId : string , workflowComponent ?: string | undefined ) : Promise < void > {
161- await this . _invokeMethod ( instanceId , "pause" , workflowComponent ) ;
150+ async pause ( instanceId : string ) : Promise < void > {
151+ await this . _invokeMethod ( instanceId , "pause" ) ;
162152 }
163153
164- async resume ( instanceId : string , workflowComponent ?: string | undefined ) : Promise < void > {
165- await this . _invokeMethod ( instanceId , "resume" , workflowComponent ) ;
154+ async resume ( instanceId : string ) : Promise < void > {
155+ await this . _invokeMethod ( instanceId , "resume" ) ;
166156 }
167157
168- async purge ( instanceId : string , workflowComponent ?: string | undefined ) : Promise < void > {
169- await this . _invokeMethod ( instanceId , "purge" , workflowComponent ) ;
158+ async purge ( instanceId : string ) : Promise < void > {
159+ await this . _invokeMethod ( instanceId , "purge" ) ;
170160 }
171161
172- async _invokeMethod ( instanceId : string , method : string , workflowComponent ?: string | undefined ) : Promise < any > {
162+ async _invokeMethod ( instanceId : string , method : string ) : Promise < any > {
173163 if ( ! instanceId ) {
174164 throw new PropertyRequiredError ( "instanceID" ) ;
175165 }
@@ -178,10 +168,8 @@ export default class HTTPClientWorkflow implements IClientWorkflow {
178168 throw new PropertyRequiredError ( "method" ) ;
179169 }
180170
181- workflowComponent = workflowComponent ?? HTTPClientWorkflow . DEFAULT_WORKFLOW_COMPONENT ;
182-
183171 try {
184- await this . client . executeWithApiVersion ( "v1.0-beta1" , `/workflows/${ workflowComponent } /${ instanceId } /${ method } ` , {
172+ await this . client . executeWithApiVersion ( "v1.0-beta1" , `/workflows/dapr /${ instanceId } /${ method } ` , {
185173 method : "POST" ,
186174 } ) ;
187175 } catch ( e : any ) {
0 commit comments