@shushed/helpers 0.0.61 → 0.0.63
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 +21 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -365,6 +365,18 @@ var import_jose = require("jose");
|
|
|
365
365
|
// src-public/runtime.ts
|
|
366
366
|
var import_logging = require("@google-cloud/logging");
|
|
367
367
|
var DEFAULT_BRANCH = "migratedprod";
|
|
368
|
+
var getCircularReplacer = () => {
|
|
369
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
370
|
+
return (key, value) => {
|
|
371
|
+
if (typeof value === "object" && value !== null) {
|
|
372
|
+
if (seen.has(value)) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
seen.add(value);
|
|
376
|
+
}
|
|
377
|
+
return value;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
368
380
|
var Logging = class {
|
|
369
381
|
constructor(workflowId, triggerId, systemEnvName) {
|
|
370
382
|
this.workflowId = workflowId;
|
|
@@ -387,8 +399,8 @@ var Logging = class {
|
|
|
387
399
|
this.errorFn = (...args) => log.entry(Object.assign({
|
|
388
400
|
severity: import_logging.Severity.error
|
|
389
401
|
}, this.metadata), ...args);
|
|
390
|
-
this.logFn = (...args) => console.log(JSON.stringify(args));
|
|
391
|
-
this.errorFn = (...args) => console.error(JSON.stringify(args));
|
|
402
|
+
this.logFn = (...args) => console.log(JSON.stringify(args, getCircularReplacer()));
|
|
403
|
+
this.errorFn = (...args) => console.error(JSON.stringify(args, getCircularReplacer()));
|
|
392
404
|
} else {
|
|
393
405
|
this.logFn = console.log;
|
|
394
406
|
this.errorFn = console.error;
|
|
@@ -1092,8 +1104,10 @@ var PubSubHelper = class extends Runtime {
|
|
|
1092
1104
|
}
|
|
1093
1105
|
}
|
|
1094
1106
|
} else {
|
|
1095
|
-
|
|
1096
|
-
|
|
1107
|
+
if (subscriptionMetaData?.pushConfig?.pushEndpoint) {
|
|
1108
|
+
nextMetadata = nextMetadata || {};
|
|
1109
|
+
nextMetadata.pushConfig = null;
|
|
1110
|
+
}
|
|
1097
1111
|
}
|
|
1098
1112
|
if (opts.dlqTopic) {
|
|
1099
1113
|
if (opts.dlqTopic.name !== subscriptionMetaData?.deadLetterPolicy?.deadLetterTopic || opts.retryLimit !== subscriptionMetaData?.deadLetterPolicy.maxDeliveryAttempts) {
|
|
@@ -1104,11 +1118,10 @@ var PubSubHelper = class extends Runtime {
|
|
|
1104
1118
|
};
|
|
1105
1119
|
}
|
|
1106
1120
|
} else if (subscriptionMetaData?.deadLetterPolicy?.deadLetterTopic) {
|
|
1107
|
-
nextMetadata = nextMetadata || {
|
|
1108
|
-
|
|
1109
|
-
};
|
|
1121
|
+
nextMetadata = nextMetadata || {};
|
|
1122
|
+
nextMetadata.deadLetterPolicy = null;
|
|
1110
1123
|
}
|
|
1111
|
-
if (opts.retryMinDelay
|
|
1124
|
+
if (opts.retryMinDelay != subscriptionMetaData?.retryPolicy?.minimumBackoff?.seconds || opts.retryMaxDelay != subscriptionMetaData?.retryPolicy?.maximumBackoff?.seconds) {
|
|
1112
1125
|
nextMetadata = nextMetadata || {};
|
|
1113
1126
|
nextMetadata.retryPolicy = {
|
|
1114
1127
|
minimumBackoff: { seconds: opts.retryMinDelay },
|