@goodandready/dsh-messenger-gateway 0.3.21 → 0.3.22

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.
@@ -84,6 +84,8 @@ export class DiscordAdapter {
84
84
  method: 'POST',
85
85
  headers: { 'Content-Type': 'application/json' },
86
86
  body: JSON.stringify(payloadJson),
87
+ keepalive: true,
88
+ signal: AbortSignal.timeout(15000),
87
89
  })
88
90
  if (!res.ok) {
89
91
  const errText = await res.text().catch(() => '')
@@ -122,6 +124,8 @@ export class DiscordAdapter {
122
124
  Authorization: `Bot ${this.botToken}`,
123
125
  },
124
126
  body: form,
127
+ keepalive: true,
128
+ signal: AbortSignal.timeout(30000),
125
129
  })
126
130
  if (!res.ok) {
127
131
  const errText = await res.text().catch(() => '')
@@ -156,6 +160,8 @@ export class DiscordAdapter {
156
160
  'Content-Type': 'application/json',
157
161
  },
158
162
  body: JSON.stringify(body),
163
+ keepalive: true,
164
+ signal: AbortSignal.timeout(15000),
159
165
  })
160
166
  if (!res.ok) {
161
167
  const errText = await res.text().catch(() => '')
@@ -174,6 +180,8 @@ export class DiscordAdapter {
174
180
  'Content-Type': 'application/json',
175
181
  },
176
182
  body: JSON.stringify(body),
183
+ keepalive: true,
184
+ signal: AbortSignal.timeout(15000),
177
185
  })
178
186
  if (!res.ok) {
179
187
  const errText = await res.text().catch(() => '')
@@ -83,6 +83,8 @@ export class SlackAdapter {
83
83
  method: 'POST',
84
84
  headers: { 'Content-Type': 'application/json' },
85
85
  body: JSON.stringify(payloadJson),
86
+ keepalive: true,
87
+ signal: AbortSignal.timeout(15000),
86
88
  })
87
89
  if (!res.ok) {
88
90
  const errText = await res.text().catch(() => '')
@@ -116,6 +118,8 @@ export class SlackAdapter {
116
118
  'Content-Type': 'application/json; charset=utf-8',
117
119
  },
118
120
  body: JSON.stringify(reqBody),
121
+ keepalive: true,
122
+ signal: AbortSignal.timeout(15000),
119
123
  })
120
124
  const json = typeof res.json === 'function' ? await res.json().catch(() => ({})) : {}
121
125
  if (!res.ok || json?.ok === false) {
@@ -141,6 +145,8 @@ export class SlackAdapter {
141
145
  'Content-Type': 'application/json; charset=utf-8',
142
146
  },
143
147
  body: JSON.stringify(body),
148
+ keepalive: true,
149
+ signal: AbortSignal.timeout(15000),
144
150
  })
145
151
  const json = typeof res.json === 'function' ? await res.json().catch(() => ({})) : {}
146
152
  if (!res.ok || json?.ok === false) {