@shushed/helpers 0.0.198-v2-20251105075102 → 0.0.198-v2-20251105081148
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.
|
@@ -116,13 +116,13 @@ class PubSubHelper extends runtime_1.default {
|
|
|
116
116
|
async createOrUpdate(opts) {
|
|
117
117
|
const [topics] = await this.pubSub.getTopics();
|
|
118
118
|
const topicName = opts.topicName;
|
|
119
|
-
const mainSubscriptionName = opts.subscriptionName ||
|
|
119
|
+
const mainSubscriptionName = opts.subscriptionName || topicName;
|
|
120
|
+
const tableSubscriptionName = `${mainSubscriptionName}.bq`;
|
|
120
121
|
const mainDlqTopicName = `${mainSubscriptionName}.dlq`;
|
|
121
|
-
const tableDlqTopicName = `${mainSubscriptionName}.bq.dlq`;
|
|
122
122
|
const mainDlqSubscriptionName = `${mainSubscriptionName}.dlq`;
|
|
123
|
-
const
|
|
124
|
-
const tableDlqSubscriptionName = `${
|
|
125
|
-
let mainTopic = topics.find(x => this.getNameFromFullyQualifiedName(x.name) ===
|
|
123
|
+
const tableDlqTopicName = `${mainSubscriptionName}.bq.dlq`;
|
|
124
|
+
const tableDlqSubscriptionName = `${mainSubscriptionName}.bq.dlq`;
|
|
125
|
+
let mainTopic = topics.find(x => this.getNameFromFullyQualifiedName(x.name) === topicName);
|
|
126
126
|
let mainDlqTopic = topics.find(x => this.getNameFromFullyQualifiedName(x.name) === mainDlqTopicName);
|
|
127
127
|
let tableDlqTopic = topics.find(x => this.getNameFromFullyQualifiedName(x.name) === tableDlqTopicName);
|
|
128
128
|
let mainTopicSubscriptions = null;
|
|
@@ -291,9 +291,11 @@ class PubSubHelper extends runtime_1.default {
|
|
|
291
291
|
};
|
|
292
292
|
const opts = Object.assign({}, defaultOptions, inputOpts);
|
|
293
293
|
let nextMetadata = null;
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
294
|
+
if (!isSubscriptionBigQuery(opts)) {
|
|
295
|
+
if (subscriptionMetaData?.pushConfig?.pushEndpoint) {
|
|
296
|
+
nextMetadata = nextMetadata || {};
|
|
297
|
+
nextMetadata.pushConfig = null;
|
|
298
|
+
}
|
|
297
299
|
}
|
|
298
300
|
if (opts.dlqTopic) {
|
|
299
301
|
if (opts.dlqTopic.name !== subscriptionMetaData?.deadLetterPolicy?.deadLetterTopic
|
|
@@ -319,9 +321,11 @@ class PubSubHelper extends runtime_1.default {
|
|
|
319
321
|
nextMetadata.enableExactlyOnceDelivery = null;
|
|
320
322
|
}
|
|
321
323
|
}
|
|
322
|
-
if ((opts
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
if (!isSubscriptionBigQuery(opts)) {
|
|
325
|
+
if ((opts.subscriptionFilter && subscriptionMetaData?.filter) && opts.subscriptionFilter !== subscriptionMetaData?.filter) {
|
|
326
|
+
nextMetadata = nextMetadata || {};
|
|
327
|
+
nextMetadata.filter = opts.subscriptionFilter || null;
|
|
328
|
+
}
|
|
325
329
|
}
|
|
326
330
|
if (opts.retryMinDelay != subscriptionMetaData?.retryPolicy?.minimumBackoff?.seconds
|
|
327
331
|
|| opts.retryMaxDelay != subscriptionMetaData?.retryPolicy?.maximumBackoff?.seconds) {
|