@rayondigital/nest-dapr 0.9.44 → 0.9.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,7 +35,7 @@ class ActorProxyBuilder {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
build(actorId, actorTypeName) {
|
|
38
|
-
if (
|
|
38
|
+
if (actorId === undefined) {
|
|
39
39
|
throw new Error('Actor id must be provided');
|
|
40
40
|
}
|
|
41
41
|
const actorTypeClassName = actorTypeName !== null && actorTypeName !== void 0 ? actorTypeName : this.actorTypeClass.name;
|
|
@@ -68,7 +68,7 @@ class ActorProxyBuilder {
|
|
|
68
68
|
}
|
|
69
69
|
callExternalActorMethod(actorTypeClassName, actorId, methodName, args) {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (
|
|
71
|
+
if (actorId === undefined) {
|
|
72
72
|
throw new Error('Actor id must be provided');
|
|
73
73
|
}
|
|
74
74
|
const originalBody = args.length > 0 ? args : null;
|
|
@@ -77,7 +77,7 @@ class StatefulActor extends abstract_actor_1.AbstractActor {
|
|
|
77
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
78
|
for (const property of this.stateProperties) {
|
|
79
79
|
let value = this[property.key];
|
|
80
|
-
if (property.serializable) {
|
|
80
|
+
if (value !== undefined && property.serializable) {
|
|
81
81
|
const instance = value;
|
|
82
82
|
value = instance.toJSON();
|
|
83
83
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface DaprActorOnEventMetadata<T> {
|
|
2
2
|
event: DaprActorEventType;
|
|
3
|
-
actorId: (payload: T) => string;
|
|
3
|
+
actorId: (payload: T) => string | string[];
|
|
4
4
|
ignoreErrors?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export type DaprActorEventType = string | symbol | string[] | symbol[];
|
|
7
|
-
export declare function DaprActorOnEvent<T>(event: DaprActorEventType, actorId: (payload: T) => string, ignoreErrors?: boolean): MethodDecorator;
|
|
7
|
+
export declare function DaprActorOnEvent<T>(event: DaprActorEventType, actorId: (payload: T) => string | string[], ignoreErrors?: boolean): MethodDecorator;
|
|
@@ -69,10 +69,15 @@ let DaprEventSubscriberLoader = class DaprEventSubscriberLoader {
|
|
|
69
69
|
this.eventEmitter.on(eventMetadata.event, (data) => __awaiter(this, void 0, void 0, function* () {
|
|
70
70
|
var _a;
|
|
71
71
|
try {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
let actorIds = eventMetadata.actorId(data);
|
|
73
|
+
if (!Array.isArray(actorIds)) {
|
|
74
|
+
actorIds = [actorIds];
|
|
75
|
+
}
|
|
76
|
+
for (const id of actorIds) {
|
|
77
|
+
const actorType = (_a = actorMetadata.interfaceType.name) !== null && _a !== void 0 ? _a : actorMetadata.interfaceType.constructor.name;
|
|
78
|
+
const actor = this.actorClient.getActorByTypeName(actorType, id);
|
|
79
|
+
yield actor[methodKey].call(actor, data);
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
catch (e) {
|
|
78
83
|
this.logger.error(e);
|
package/package.json
CHANGED