@upyo/plunk 0.5.0-dev.168 → 0.5.0-dev.170

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.cjs CHANGED
@@ -147,7 +147,7 @@ var PlunkHttpClient = class {
147
147
  };
148
148
  const timeoutController = new AbortController();
149
149
  const timeoutId = this.config.timeout > 0 ? setTimeout(() => timeoutController.abort(), this.config.timeout) : void 0;
150
- const combinedSignal = combineSignals(timeoutController.signal, signal);
150
+ const combinedSignal = (0, __upyo_core.combineSignals)(timeoutController.signal, signal);
151
151
  let response;
152
152
  try {
153
153
  response = await fetch(url, {
@@ -208,36 +208,6 @@ function isAbortError$1(error) {
208
208
  function isCallerAbort$1(error, signal) {
209
209
  return signal?.aborted === true && (isAbortError$1(error) || error === signal.reason);
210
210
  }
211
- function combineSignals(timeoutSignal, externalSignal) {
212
- if (externalSignal == null) return {
213
- signal: timeoutSignal,
214
- cleanup: () => {}
215
- };
216
- if (typeof AbortSignal.any === "function") return {
217
- signal: AbortSignal.any([timeoutSignal, externalSignal]),
218
- cleanup: () => {}
219
- };
220
- const controller = new AbortController();
221
- const abort = (signal) => {
222
- controller.abort(getAbortReason(signal));
223
- };
224
- const abortTimeout = () => abort(timeoutSignal);
225
- const abortExternal = () => abort(externalSignal);
226
- timeoutSignal.addEventListener("abort", abortTimeout, { once: true });
227
- externalSignal.addEventListener("abort", abortExternal, { once: true });
228
- if (timeoutSignal.aborted) abortTimeout();
229
- else if (externalSignal.aborted) abortExternal();
230
- return {
231
- signal: controller.signal,
232
- cleanup: () => {
233
- timeoutSignal.removeEventListener("abort", abortTimeout);
234
- externalSignal.removeEventListener("abort", abortExternal);
235
- }
236
- };
237
- }
238
- function getAbortReason(signal) {
239
- return signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
240
- }
241
211
  function truncateErrorBody(text) {
242
212
  return text.length > 500 ? `${text.slice(0, 500)}...` : text;
243
213
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createFailedReceipt, parseRetryAfter } from "@upyo/core";
1
+ import { combineSignals, createFailedReceipt, parseRetryAfter } from "@upyo/core";
2
2
 
3
3
  //#region src/config.ts
4
4
  /**
@@ -185,36 +185,6 @@ function isAbortError$1(error) {
185
185
  function isCallerAbort$1(error, signal) {
186
186
  return signal?.aborted === true && (isAbortError$1(error) || error === signal.reason);
187
187
  }
188
- function combineSignals(timeoutSignal, externalSignal) {
189
- if (externalSignal == null) return {
190
- signal: timeoutSignal,
191
- cleanup: () => {}
192
- };
193
- if (typeof AbortSignal.any === "function") return {
194
- signal: AbortSignal.any([timeoutSignal, externalSignal]),
195
- cleanup: () => {}
196
- };
197
- const controller = new AbortController();
198
- const abort = (signal) => {
199
- controller.abort(getAbortReason(signal));
200
- };
201
- const abortTimeout = () => abort(timeoutSignal);
202
- const abortExternal = () => abort(externalSignal);
203
- timeoutSignal.addEventListener("abort", abortTimeout, { once: true });
204
- externalSignal.addEventListener("abort", abortExternal, { once: true });
205
- if (timeoutSignal.aborted) abortTimeout();
206
- else if (externalSignal.aborted) abortExternal();
207
- return {
208
- signal: controller.signal,
209
- cleanup: () => {
210
- timeoutSignal.removeEventListener("abort", abortTimeout);
211
- externalSignal.removeEventListener("abort", abortExternal);
212
- }
213
- };
214
- }
215
- function getAbortReason(signal) {
216
- return signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
217
- }
218
188
  function truncateErrorBody(text) {
219
189
  return text.length > 500 ? `${text.slice(0, 500)}...` : text;
220
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upyo/plunk",
3
- "version": "0.5.0-dev.168",
3
+ "version": "0.5.0-dev.170",
4
4
  "description": "Plunk transport for Upyo email library",
5
5
  "keywords": [
6
6
  "email",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "sideEffects": false,
55
55
  "peerDependencies": {
56
- "@upyo/core": "0.5.0-dev.168+1e808a3a"
56
+ "@upyo/core": "0.5.0-dev.170+643994fd"
57
57
  },
58
58
  "devDependencies": {
59
59
  "tsdown": "^0.12.7",