@shushed/helpers 0.0.182 → 0.0.183

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.
package/dist/index.d.ts CHANGED
@@ -33636,7 +33636,7 @@ declare class EnvEngine extends Runtime {
33636
33636
  }
33637
33637
 
33638
33638
  declare global {
33639
- var pubSubPublishTopics: Record<string, Topic>;
33639
+ var HUSH_PUBSUB_PUBLISH_TOPICS: Record<string, Topic>;
33640
33640
  }
33641
33641
  type Message = {
33642
33642
  buildshipId: string;
package/dist/index.js CHANGED
@@ -107126,8 +107126,8 @@ var import_lodash2 = __toESM(require("lodash.omit"));
107126
107126
  function isPubSubMessage(req) {
107127
107127
  return req && typeof req.ack === "function" && typeof req.data !== "undefined" && typeof req.ackId !== "undefined";
107128
107128
  }
107129
- var pubSubPublishTopics = global.pubSubPublishTopics || {};
107130
- global.pubSubPublishTopics = pubSubPublishTopics;
107129
+ var pubSubPublishTopics = global.HUSH_PUBSUB_PUBLISH_TOPICS || {};
107130
+ global.HUSH_PUBSUB_PUBLISH_TOPICS = pubSubPublishTopics;
107131
107131
  function isSubscriptionOptionsPull(opts) {
107132
107132
  return "endpointUrl" in opts && opts.endpointUrl === null;
107133
107133
  }
@@ -107307,11 +107307,12 @@ var PubSubHelper = class extends Runtime {
107307
107307
  mainSubscription = await this.ensureSubscribtionExists(mainSubscriptionName, {
107308
107308
  topic,
107309
107309
  dlqTopic: mainDlqTopic || null,
107310
+ exactlyOnceDelivery: opts.push ? false : true,
107310
107311
  endpointUrl: opts.push ? this.runtimeUrl + `/executeWorkflow/${this.workflowId}/${this.triggerId}?topic_name=${opts.topicName}` : null,
107311
107312
  retryMinDelay: pullPushSubscription.retryMinDelay,
107312
107313
  retryMaxDelay: pullPushSubscription.retryMaxDelay,
107313
107314
  retryLimit: pullPushSubscription.retryLimit,
107314
- ackDeadline: pullPushSubscription.ackDeadline
107315
+ ackDeadline: Math.max(pullPushSubscription.ackDeadline, opts.push ? 10 : 60)
107315
107316
  });
107316
107317
  }
107317
107318
  if (!opts.createDeadLetterQueues) {
@@ -107396,7 +107397,8 @@ var PubSubHelper = class extends Runtime {
107396
107397
  retryLimit: 5,
107397
107398
  retryMinDelay: 10,
107398
107399
  retryMaxDelay: 360,
107399
- ackDeadline: 90
107400
+ ackDeadline: 90,
107401
+ exactlyOnceDelivery: false
107400
107402
  };
107401
107403
  const opts = Object.assign({}, defaultOptions, inputOpts);
107402
107404
  let nextMetadata = null;
@@ -107444,6 +107446,15 @@ var PubSubHelper = class extends Runtime {
107444
107446
  nextMetadata = nextMetadata || {};
107445
107447
  nextMetadata.deadLetterPolicy = null;
107446
107448
  }
107449
+ if (opts.exactlyOnceDelivery !== subscriptionMetaData?.enableExactlyOnceDelivery) {
107450
+ if (typeof opts.exactlyOnceDelivery === "boolean" && isSubscriptionOptionsPull(opts)) {
107451
+ nextMetadata = nextMetadata || {};
107452
+ nextMetadata.enableExactlyOnceDelivery = opts.exactlyOnceDelivery;
107453
+ } else {
107454
+ nextMetadata = nextMetadata || {};
107455
+ nextMetadata.enableExactlyOnceDelivery = null;
107456
+ }
107457
+ }
107447
107458
  if (opts.retryMinDelay != subscriptionMetaData?.retryPolicy?.minimumBackoff?.seconds || opts.retryMaxDelay != subscriptionMetaData?.retryPolicy?.maximumBackoff?.seconds) {
107448
107459
  nextMetadata = nextMetadata || {};
107449
107460
  nextMetadata.retryPolicy = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.182",
3
+ "version": "0.0.183",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",