sst-http 2.0.0-beta.10 → 2.0.0-beta.12
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/infra.cjs +5 -4
- package/dist/infra.js +5 -4
- package/package.json +1 -1
package/dist/infra.cjs
CHANGED
|
@@ -78,6 +78,7 @@ function resolveHandlerInput(handler) {
|
|
|
78
78
|
|
|
79
79
|
// src/bus/infra.ts
|
|
80
80
|
var MAX_SUBSCRIBER_NAME_LENGTH = 60;
|
|
81
|
+
var bus;
|
|
81
82
|
function wireEventsFromManifest(events, opts) {
|
|
82
83
|
if (!events || events.length === 0) {
|
|
83
84
|
return;
|
|
@@ -90,17 +91,17 @@ function wireEventsFromManifest(events, opts) {
|
|
|
90
91
|
if (seen.has(key)) {
|
|
91
92
|
continue;
|
|
92
93
|
}
|
|
94
|
+
if (!bus) bus = aws2.Bus.get("default", "default");
|
|
93
95
|
seen.add(key);
|
|
94
|
-
const bus = aws2.Bus.get("default", "default");
|
|
95
96
|
const subscriberName = buildSubscriberName(event.event);
|
|
96
97
|
subscribeToBus(bus, subscriberName, subscriber, event.event);
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
|
-
function subscribeToBus(
|
|
100
|
-
if (typeof
|
|
100
|
+
function subscribeToBus(bus2, subscriberName, subscriber, eventName) {
|
|
101
|
+
if (typeof bus2.subscribe !== "function") {
|
|
101
102
|
throw new Error("Bus instance does not support subscribe().");
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
+
bus2.subscribe(subscriberName, subscriber, {
|
|
104
105
|
pattern: {
|
|
105
106
|
detailType: [eventName]
|
|
106
107
|
}
|
package/dist/infra.js
CHANGED
|
@@ -54,6 +54,7 @@ function resolveHandlerInput(handler) {
|
|
|
54
54
|
|
|
55
55
|
// src/bus/infra.ts
|
|
56
56
|
var MAX_SUBSCRIBER_NAME_LENGTH = 60;
|
|
57
|
+
var bus;
|
|
57
58
|
function wireEventsFromManifest(events, opts) {
|
|
58
59
|
if (!events || events.length === 0) {
|
|
59
60
|
return;
|
|
@@ -66,17 +67,17 @@ function wireEventsFromManifest(events, opts) {
|
|
|
66
67
|
if (seen.has(key)) {
|
|
67
68
|
continue;
|
|
68
69
|
}
|
|
70
|
+
if (!bus) bus = aws2.Bus.get("default", "default");
|
|
69
71
|
seen.add(key);
|
|
70
|
-
const bus = aws2.Bus.get("default", "default");
|
|
71
72
|
const subscriberName = buildSubscriberName(event.event);
|
|
72
73
|
subscribeToBus(bus, subscriberName, subscriber, event.event);
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
function subscribeToBus(
|
|
76
|
-
if (typeof
|
|
76
|
+
function subscribeToBus(bus2, subscriberName, subscriber, eventName) {
|
|
77
|
+
if (typeof bus2.subscribe !== "function") {
|
|
77
78
|
throw new Error("Bus instance does not support subscribe().");
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
bus2.subscribe(subscriberName, subscriber, {
|
|
80
81
|
pattern: {
|
|
81
82
|
detailType: [eventName]
|
|
82
83
|
}
|