@@ -28,7 +28,7 @@ export default class ActorClientHTTP implements IClientActor {
28
28
}
29
29
30
30
async invoke ( actorType : string , actorId : ActorId , methodName : string , body ?: any ) : Promise < object > {
31
- const result = await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /method/${ methodName } ` , {
31
+ const result = await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /method/${ methodName } ` , {
32
32
method : "POST" , // we always use POST calls for Invoking (ref: https://github.com/dapr/js-sdk/pull/137#discussion_r772636068)
33
33
body,
34
34
} ) ;
@@ -37,7 +37,7 @@ export default class ActorClientHTTP implements IClientActor {
37
37
}
38
38
39
39
async stateTransaction ( actorType : string , actorId : ActorId , operations : OperationType [ ] ) : Promise < void > {
40
- await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /state` , {
40
+ await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /state` , {
41
41
method : "POST" ,
42
42
headers : {
43
43
"Content-Type" : "application/json" ,
@@ -47,7 +47,7 @@ export default class ActorClientHTTP implements IClientActor {
47
47
}
48
48
49
49
async stateGet ( actorType : string , actorId : ActorId , key : string ) : Promise < KeyValueType | string > {
50
- const result = await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /state/${ key } ` ) ;
50
+ const result = await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /state/${ key } ` ) ;
51
51
return result as any ;
52
52
}
53
53
@@ -57,7 +57,7 @@ export default class ActorClientHTTP implements IClientActor {
57
57
name : string ,
58
58
reminder : ActorReminderType ,
59
59
) : Promise < void > {
60
- await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /reminders/${ name } ` , {
60
+ await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /reminders/${ name } ` , {
61
61
method : "POST" ,
62
62
headers : {
63
63
"Content-Type" : "application/json" ,
@@ -72,18 +72,18 @@ export default class ActorClientHTTP implements IClientActor {
72
72
}
73
73
74
74
async reminderGet ( actorType : string , actorId : ActorId , name : string ) : Promise < object > {
75
- const result = await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /reminders/${ name } ` ) ;
75
+ const result = await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /reminders/${ name } ` ) ;
76
76
return result as object ;
77
77
}
78
78
79
79
async unregisterActorReminder ( actorType : string , actorId : ActorId , name : string ) : Promise < void > {
80
- await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /reminders/${ name } ` , {
80
+ await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /reminders/${ name } ` , {
81
81
method : "DELETE" ,
82
82
} ) ;
83
83
}
84
84
85
85
async registerActorTimer ( actorType : string , actorId : ActorId , name : string , timer : ActorTimerType ) : Promise < void > {
86
- await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /timers/${ name } ` , {
86
+ await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /timers/${ name } ` , {
87
87
method : "POST" ,
88
88
headers : {
89
89
"Content-Type" : "application/json" ,
@@ -99,13 +99,13 @@ export default class ActorClientHTTP implements IClientActor {
99
99
}
100
100
101
101
async unregisterActorTimer ( actorType : string , actorId : ActorId , name : string ) : Promise < void > {
102
- await this . client . execute ( `/actors/${ actorType } /${ actorId . getId ( ) } /timers/${ name } ` , {
102
+ await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } /timers/${ name } ` , {
103
103
method : "DELETE" ,
104
104
} ) ;
105
105
}
106
106
107
- async deactivate ( actorType : string , actorId : string ) : Promise < void > {
108
- await this . client . execute ( `/actors/${ actorType } /${ actorId } ` , {
107
+ async deactivate ( actorType : string , actorId : ActorId ) : Promise < void > {
108
+ await this . client . execute ( `/actors/${ actorType } /${ actorId . getURLSafeId ( ) } ` , {
109
109
method : "DELETE" ,
110
110
} ) ;
111
111
}
0 commit comments