@rayondigital/nest-dapr 0.9.37 → 0.9.38

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.
@@ -108,7 +108,20 @@ let DaprPubSubClient = DaprPubSubClient_1 = class DaprPubSubClient {
108
108
  }
109
109
  try {
110
110
  const contentType = (_a = messages[0].contentType) !== null && _a !== void 0 ? _a : 'application/json';
111
- yield this.daprClient.pubsub.publishBulk(name, topic, messages.map((m) => m.payload), producerId ? { metadata: { partitionKey: producerId }, contentType } : undefined);
111
+ const response = yield this.daprClient.pubsub.publishBulk(name, topic, messages.map((m) => m.payload), producerId ? { metadata: { partitionKey: producerId }, contentType } : undefined);
112
+ if (response.failedMessages) {
113
+ const failedMessages = response.failedMessages.map((m, i) => {
114
+ var _a;
115
+ return {
116
+ name,
117
+ topic,
118
+ payload: m.message.event,
119
+ metadata: m.message.metadata,
120
+ contentType: (_a = m.message.contentType) !== null && _a !== void 0 ? _a : contentType,
121
+ };
122
+ });
123
+ yield this.handleError(failedMessages, response.failedMessages[0].error);
124
+ }
112
125
  }
113
126
  catch (error) {
114
127
  yield this.handleError(messages, error);
@@ -135,7 +148,10 @@ let DaprPubSubClient = DaprPubSubClient_1 = class DaprPubSubClient {
135
148
  if (fireAndForget) {
136
149
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
137
150
  try {
138
- yield this.daprClient.pubsub.publish(name, topic, payload, options);
151
+ const response = yield this.daprClient.pubsub.publish(name, topic, payload, options);
152
+ if (response.error) {
153
+ throw response.error;
154
+ }
139
155
  }
140
156
  catch (error) {
141
157
  yield this.handleError([{ producerId, name, topic, payload, metadata }], error);
@@ -143,7 +159,10 @@ let DaprPubSubClient = DaprPubSubClient_1 = class DaprPubSubClient {
143
159
  }));
144
160
  return;
145
161
  }
146
- yield this.daprClient.pubsub.publish(name, topic, payload, options);
162
+ const response = yield this.daprClient.pubsub.publish(name, topic, payload, options);
163
+ if (response.error) {
164
+ throw response.error;
165
+ }
147
166
  }
148
167
  catch (error) {
149
168
  yield this.handleError([{ producerId, name, topic, payload, metadata }], error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayondigital/nest-dapr",
3
- "version": "0.9.37",
3
+ "version": "0.9.38",
4
4
  "description": "Develop NestJs microservices using Dapr pubsub, actors and other bindings",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",