@shushed/helpers 0.0.40 → 0.0.41
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.js +17 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -817,20 +817,20 @@ var PubSubHelper = class extends Runtime {
|
|
|
817
817
|
let topic = await this.findTopic(topicName);
|
|
818
818
|
const metadata = {
|
|
819
819
|
labels: {
|
|
820
|
-
"created-at": (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-"),
|
|
821
|
-
"last-modified-at": (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-"),
|
|
822
|
-
"created-by-bs-triggerid": this.triggerId,
|
|
823
|
-
"created-by-bs-workflowid": this.workflowId,
|
|
824
|
-
"bs-envname": this.systemEnvName,
|
|
825
|
-
"env": this.envName,
|
|
826
|
-
[`${this.workflowId}-${this.triggerId}
|
|
820
|
+
"created-at": (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").toLowerCase(),
|
|
821
|
+
"last-modified-at": (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").toLowerCase(),
|
|
822
|
+
"created-by-bs-triggerid": this.triggerId.toLowerCase(),
|
|
823
|
+
"created-by-bs-workflowid": this.workflowId.toLowerCase(),
|
|
824
|
+
"bs-envname": this.systemEnvName.toLowerCase(),
|
|
825
|
+
"env": this.envName.toLowerCase(),
|
|
826
|
+
[`${this.workflowId}-${this.triggerId}`.toLowerCase()]: "true"
|
|
827
827
|
}
|
|
828
828
|
};
|
|
829
829
|
const [topicMetadata] = await topic?.getMetadata() || [null];
|
|
830
830
|
if (topic) {
|
|
831
831
|
const simMetadata = Object.assign({}, topicMetadata?.labels || {}, metadata.labels);
|
|
832
832
|
if (!(0, import_lodash.default)(topicMetadata?.labels, simMetadata)) {
|
|
833
|
-
simMetadata["last-modified-at"] = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-");
|
|
833
|
+
simMetadata["last-modified-at"] = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").toLowerCase();
|
|
834
834
|
await topic.setMetadata({
|
|
835
835
|
labels: simMetadata
|
|
836
836
|
});
|
|
@@ -906,21 +906,21 @@ var PubSubHelper = class extends Runtime {
|
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
908
|
const proposedLabels = {
|
|
909
|
-
"created-at": subscriptionMetaData?.labels?.["created-at"] || (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-"),
|
|
910
|
-
"last-modified-at": subscriptionMetaData?.labels?.["created-at"] || (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-"),
|
|
911
|
-
"env": this.envName,
|
|
912
|
-
"bs-triggerid": this.triggerId,
|
|
913
|
-
"bs-workflowid": this.workflowId,
|
|
914
|
-
"bs-envname": this.systemEnvName,
|
|
915
|
-
"bs-runtimeurl": this.runtimeUrl,
|
|
909
|
+
"created-at": subscriptionMetaData?.labels?.["created-at"] || (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").toLowerCase(),
|
|
910
|
+
"last-modified-at": subscriptionMetaData?.labels?.["created-at"] || (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").toLowerCase(),
|
|
911
|
+
"env": this.envName.toLowerCase(),
|
|
912
|
+
"bs-triggerid": this.triggerId.toLowerCase(),
|
|
913
|
+
"bs-workflowid": this.workflowId.toLowerCase(),
|
|
914
|
+
"bs-envname": this.systemEnvName.toLowerCase(),
|
|
915
|
+
"bs-runtimeurl": this.runtimeUrl.toLowerCase(),
|
|
916
916
|
"bs-is-deadletter": subscriptionName.indexOf("-dlq") > -1 ? "true" : "false",
|
|
917
917
|
"bs-is-push-enabled": isSubscriptionOptionsPush(opts) && opts.endpointUrl ? "true" : "false",
|
|
918
|
-
"bs-bigquery-tableid": !(isSubscriptionOptionsPush(opts) || isSubscriptionOptionsPull(opts)) && opts.tableId ? opts.tableId : "",
|
|
918
|
+
"bs-bigquery-tableid": !(isSubscriptionOptionsPush(opts) || isSubscriptionOptionsPull(opts)) && opts.tableId ? opts.tableId.toLowerCase() : "",
|
|
919
919
|
"bs-is-bigquery": !(isSubscriptionOptionsPush(opts) || isSubscriptionOptionsPull(opts)) && opts.tableId ? "true" : "false"
|
|
920
920
|
};
|
|
921
921
|
const simLabels = Object.assign({}, subscriptionMetaData?.labels || {}, proposedLabels);
|
|
922
922
|
if (!(0, import_lodash.default)(simLabels, subscriptionMetaData?.labels)) {
|
|
923
|
-
simLabels["last-modified-at"] = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-");
|
|
923
|
+
simLabels["last-modified-at"] = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").toLowerCase();
|
|
924
924
|
nextMetadata = nextMetadata || {};
|
|
925
925
|
nextMetadata.labels = simLabels;
|
|
926
926
|
}
|