@shushed/helpers 0.0.55 → 0.0.57
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 +4 -0
- package/dist/index.js +15 -1
- package/package.json +1 -1
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
|
@@ -1037,7 +1037,6 @@ var PubSubHelper = class extends Runtime {
|
|
|
1037
1037
|
serviceAccountEmail: this.serviceAccountEmail,
|
|
1038
1038
|
useTableSchema: false
|
|
1039
1039
|
};
|
|
1040
|
-
nextMetadata.filter = `attributes:bigquery`;
|
|
1041
1040
|
} else {
|
|
1042
1041
|
nextMetadata = nextMetadata || {};
|
|
1043
1042
|
nextMetadata.bigqueryConfig = null;
|
|
@@ -1099,6 +1098,21 @@ var PubSubHelper = class extends Runtime {
|
|
|
1099
1098
|
table: null
|
|
1100
1099
|
});
|
|
1101
1100
|
}
|
|
1101
|
+
async isRunning(topicName) {
|
|
1102
|
+
const [topics] = await this.pubSub.getTopics();
|
|
1103
|
+
const mainTopic = topics.find((x) => this.getNameFromFullyQualifiedName(x.name) === topicName);
|
|
1104
|
+
let mainTopicSubscriptions = null;
|
|
1105
|
+
if (mainTopic) {
|
|
1106
|
+
[mainTopicSubscriptions] = await mainTopic.getSubscriptions();
|
|
1107
|
+
}
|
|
1108
|
+
const mainSubscriptionName = `${topicName}--${shortHash(this.triggerId)}`;
|
|
1109
|
+
const mainSubscription = mainTopicSubscriptions?.find((x) => this.getNameFromFullyQualifiedName(x.name) === mainSubscriptionName) || null;
|
|
1110
|
+
const [metadata] = await mainSubscription?.getMetadata() || [null];
|
|
1111
|
+
return {
|
|
1112
|
+
subscriptionId: mainSubscription?.name,
|
|
1113
|
+
isRunning: metadata?.pushConfig?.pushEndpoint !== null
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1102
1116
|
async pause(topicName) {
|
|
1103
1117
|
const [topics] = await this.pubSub.getTopics();
|
|
1104
1118
|
const mainTopic = topics.find((x) => this.getNameFromFullyQualifiedName(x.name) === topicName);
|