@shushed/helpers 0.0.133 → 0.0.134

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -171159,6 +171159,7 @@ var ActionHelper = class _ActionHelper {
171159
171159
  fromPubSub,
171160
171160
  matchByPartialQueryString
171161
171161
  } = routingConditions || {};
171162
+ const reqIsPubSub = isPubSubRequest(optionsEnchanced.request.headers);
171162
171163
  const routingRequired = havingApiKey || fromScheduler || fromPubSub || matchByPartialQueryString || matchByPubSubSubscriptionName;
171163
171164
  if (!routingRequired) {
171164
171165
  return true;
@@ -171176,26 +171177,29 @@ var ActionHelper = class _ActionHelper {
171176
171177
  routingMatched = true;
171177
171178
  }
171178
171179
  }
171179
- if (matchByPartialQueryString) {
171180
+ if (matchByPartialQueryString && !reqIsPubSub) {
171181
+ let queryStringMatched = false;
171180
171182
  const querystring = optionsEnchanced.request.querystring || "";
171181
171183
  if (typeof matchByPartialQueryString === "string") {
171182
171184
  if (querystring.indexOf(matchByPartialQueryString) !== -1) {
171183
- routingMatched = true;
171185
+ queryStringMatched = true;
171184
171186
  }
171185
171187
  } else {
171186
171188
  const match = querystring.match(matchByPartialQueryString);
171187
171189
  if (match) {
171188
- routingMatched = true;
171190
+ queryStringMatched = true;
171189
171191
  }
171190
171192
  }
171193
+ routingMatched = queryStringMatched;
171191
171194
  }
171192
- if (matchByPubSubSubscriptionName && message?.subscriptionName) {
171195
+ if (matchByPubSubSubscriptionName && reqIsPubSub) {
171196
+ routingMatched = false;
171193
171197
  if (typeof matchByPubSubSubscriptionName === "string") {
171194
171198
  if (message.subscriptionName === matchByPubSubSubscriptionName) {
171195
171199
  routingMatched = true;
171196
171200
  }
171197
171201
  } else {
171198
- const match = message.subscriptionName.match(matchByPubSubSubscriptionName);
171202
+ const match = (message?.subscriptionName || "").match(matchByPubSubSubscriptionName);
171199
171203
  if (match) {
171200
171204
  routingMatched = true;
171201
171205
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.133",
3
+ "version": "0.0.134",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",