@shushed/helpers 0.0.55 → 0.0.56

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
@@ -28889,6 +28889,10 @@ declare class PubSubHelper extends Runtime {
28889
28889
  tableDlqSubscription: Subscription | null;
28890
28890
  tableSubscription: Subscription | null;
28891
28891
  }>;
28892
+ isRunning(topicName: string): Promise<{
28893
+ subscriptionId: string | undefined;
28894
+ isRunning: boolean;
28895
+ }>;
28892
28896
  pause(topicName: string): Promise<{
28893
28897
  subscriptionId: string;
28894
28898
  } | {
package/dist/index.js CHANGED
@@ -1099,6 +1099,21 @@ var PubSubHelper = class extends Runtime {
1099
1099
  table: null
1100
1100
  });
1101
1101
  }
1102
+ async isRunning(topicName) {
1103
+ const [topics] = await this.pubSub.getTopics();
1104
+ const mainTopic = topics.find((x) => this.getNameFromFullyQualifiedName(x.name) === topicName);
1105
+ let mainTopicSubscriptions = null;
1106
+ if (mainTopic) {
1107
+ [mainTopicSubscriptions] = await mainTopic.getSubscriptions();
1108
+ }
1109
+ const mainSubscriptionName = `${topicName}--${shortHash(this.triggerId)}`;
1110
+ const mainSubscription = mainTopicSubscriptions?.find((x) => this.getNameFromFullyQualifiedName(x.name) === mainSubscriptionName) || null;
1111
+ const [metadata] = await mainSubscription?.getMetadata() || [null];
1112
+ return {
1113
+ subscriptionId: mainSubscription?.name,
1114
+ isRunning: metadata?.pushConfig?.pushEndpoint !== null
1115
+ };
1116
+ }
1102
1117
  async pause(topicName) {
1103
1118
  const [topics] = await this.pubSub.getTopics();
1104
1119
  const mainTopic = topics.find((x) => this.getNameFromFullyQualifiedName(x.name) === topicName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",