@upyo/logtape 0.6.0-dev.237 → 0.6.0-dev.243

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
@@ -149,6 +149,9 @@ var LogTapeTransport = class {
149
149
  *
150
150
  * A wrapped transport's `sendMany()` implementation is used directly so
151
151
  * provider-specific batching and streaming behavior are preserved.
152
+ * Completion logs are emitted as receipts are consumed. Stopping iteration
153
+ * early closes the wrapped iterator without draining it, preserving its
154
+ * cancellation behavior.
152
155
  *
153
156
  * @param messages Email messages to send.
154
157
  * @param options Optional transport options, including cancellation.
@@ -175,13 +178,7 @@ var LogTapeTransport = class {
175
178
  yield receipt;
176
179
  }
177
180
  } catch (error) {
178
- const batchProperties = {
179
- consumedCount,
180
- completedCount,
181
- pendingCount: pending.size
182
- };
183
- if (pending.size < 1) this.logThrownError(error, void 0, "sendMany", batchStartedAt, batchProperties);
184
- else for (const pendingMessage of pending) this.logThrownError(error, pendingMessage.message, "sendMany", pendingMessage.startedAt, batchProperties);
181
+ this.logBatchThrownError(error, pending, batchStartedAt, consumedCount, completedCount);
185
182
  throw error;
186
183
  }
187
184
  }
@@ -285,6 +282,18 @@ var LogTapeTransport = class {
285
282
  error
286
283
  });
287
284
  }
285
+ logBatchThrownError(error, pending, batchStartedAt, consumedCount, completedCount) {
286
+ const batchProperties = {
287
+ consumedCount,
288
+ completedCount,
289
+ pendingCount: pending.size
290
+ };
291
+ if (pending.size < 1) {
292
+ this.logThrownError(error, void 0, "sendMany", batchStartedAt, batchProperties);
293
+ return;
294
+ }
295
+ for (const pendingMessage of pending) this.logThrownError(error, pendingMessage.message, "sendMany", pendingMessage.startedAt, batchProperties);
296
+ }
288
297
  getMessageProperties(message) {
289
298
  return {
290
299
  recipientCount: message.recipients.length,
@@ -319,10 +328,10 @@ var LogTapeTransport = class {
319
328
  }
320
329
  };
321
330
  function isAsyncDisposable(value) {
322
- return Symbol.asyncDispose in value && typeof value[Symbol.asyncDispose] === "function";
331
+ return typeof Symbol.asyncDispose !== "undefined" && Symbol.asyncDispose in value && typeof value[Symbol.asyncDispose] === "function";
323
332
  }
324
333
  function isDisposable(value) {
325
- return Symbol.dispose in value && typeof value[Symbol.dispose] === "function";
334
+ return typeof Symbol.dispose !== "undefined" && Symbol.dispose in value && typeof value[Symbol.dispose] === "function";
326
335
  }
327
336
 
328
337
  //#endregion
package/dist/index.d.cts CHANGED
@@ -131,6 +131,9 @@ declare class LogTapeTransport<TProviderId extends string = "logtape"> implement
131
131
  *
132
132
  * A wrapped transport's `sendMany()` implementation is used directly so
133
133
  * provider-specific batching and streaming behavior are preserved.
134
+ * Completion logs are emitted as receipts are consumed. Stopping iteration
135
+ * early closes the wrapped iterator without draining it, preserving its
136
+ * cancellation behavior.
134
137
  *
135
138
  * @param messages Email messages to send.
136
139
  * @param options Optional transport options, including cancellation.
@@ -150,6 +153,7 @@ declare class LogTapeTransport<TProviderId extends string = "logtape"> implement
150
153
  private logSending;
151
154
  private logReceipt;
152
155
  private logThrownError;
156
+ private logBatchThrownError;
153
157
  private getMessageProperties;
154
158
  private log;
155
159
  }
package/dist/index.d.ts CHANGED
@@ -131,6 +131,9 @@ declare class LogTapeTransport<TProviderId extends string = "logtape"> implement
131
131
  *
132
132
  * A wrapped transport's `sendMany()` implementation is used directly so
133
133
  * provider-specific batching and streaming behavior are preserved.
134
+ * Completion logs are emitted as receipts are consumed. Stopping iteration
135
+ * early closes the wrapped iterator without draining it, preserving its
136
+ * cancellation behavior.
134
137
  *
135
138
  * @param messages Email messages to send.
136
139
  * @param options Optional transport options, including cancellation.
@@ -150,6 +153,7 @@ declare class LogTapeTransport<TProviderId extends string = "logtape"> implement
150
153
  private logSending;
151
154
  private logReceipt;
152
155
  private logThrownError;
156
+ private logBatchThrownError;
153
157
  private getMessageProperties;
154
158
  private log;
155
159
  }
package/dist/index.js CHANGED
@@ -126,6 +126,9 @@ var LogTapeTransport = class {
126
126
  *
127
127
  * A wrapped transport's `sendMany()` implementation is used directly so
128
128
  * provider-specific batching and streaming behavior are preserved.
129
+ * Completion logs are emitted as receipts are consumed. Stopping iteration
130
+ * early closes the wrapped iterator without draining it, preserving its
131
+ * cancellation behavior.
129
132
  *
130
133
  * @param messages Email messages to send.
131
134
  * @param options Optional transport options, including cancellation.
@@ -152,13 +155,7 @@ var LogTapeTransport = class {
152
155
  yield receipt;
153
156
  }
154
157
  } catch (error) {
155
- const batchProperties = {
156
- consumedCount,
157
- completedCount,
158
- pendingCount: pending.size
159
- };
160
- if (pending.size < 1) this.logThrownError(error, void 0, "sendMany", batchStartedAt, batchProperties);
161
- else for (const pendingMessage of pending) this.logThrownError(error, pendingMessage.message, "sendMany", pendingMessage.startedAt, batchProperties);
158
+ this.logBatchThrownError(error, pending, batchStartedAt, consumedCount, completedCount);
162
159
  throw error;
163
160
  }
164
161
  }
@@ -262,6 +259,18 @@ var LogTapeTransport = class {
262
259
  error
263
260
  });
264
261
  }
262
+ logBatchThrownError(error, pending, batchStartedAt, consumedCount, completedCount) {
263
+ const batchProperties = {
264
+ consumedCount,
265
+ completedCount,
266
+ pendingCount: pending.size
267
+ };
268
+ if (pending.size < 1) {
269
+ this.logThrownError(error, void 0, "sendMany", batchStartedAt, batchProperties);
270
+ return;
271
+ }
272
+ for (const pendingMessage of pending) this.logThrownError(error, pendingMessage.message, "sendMany", pendingMessage.startedAt, batchProperties);
273
+ }
265
274
  getMessageProperties(message) {
266
275
  return {
267
276
  recipientCount: message.recipients.length,
@@ -296,10 +305,10 @@ var LogTapeTransport = class {
296
305
  }
297
306
  };
298
307
  function isAsyncDisposable(value) {
299
- return Symbol.asyncDispose in value && typeof value[Symbol.asyncDispose] === "function";
308
+ return typeof Symbol.asyncDispose !== "undefined" && Symbol.asyncDispose in value && typeof value[Symbol.asyncDispose] === "function";
300
309
  }
301
310
  function isDisposable(value) {
302
- return Symbol.dispose in value && typeof value[Symbol.dispose] === "function";
311
+ return typeof Symbol.dispose !== "undefined" && Symbol.dispose in value && typeof value[Symbol.dispose] === "function";
303
312
  }
304
313
 
305
314
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upyo/logtape",
3
- "version": "0.6.0-dev.237",
3
+ "version": "0.6.0-dev.243",
4
4
  "description": "LogTape observability transport for Upyo email library",
5
5
  "keywords": [
6
6
  "email",
@@ -55,7 +55,7 @@
55
55
  "sideEffects": false,
56
56
  "peerDependencies": {
57
57
  "@logtape/logtape": "^2.2.4",
58
- "@upyo/core": "0.6.0-dev.237+c3b73b1a"
58
+ "@upyo/core": "0.6.0-dev.243+14ec518f"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@logtape/logtape": "^2.2.4",