@visulima/notification 2.0.2 → 2.0.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## @visulima/notification [2.0.3](https://github.com/visulima/visulima/compare/@visulima/notification@2.0.2...@visulima/notification@2.0.3) (2026-11-11)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/email:** upgraded to 4.2.1
7
+ * **@visulima/error:** upgraded to 6.1.1
8
+
1
9
  ## @visulima/notification [2.0.2](https://github.com/visulima/visulima/compare/@visulima/notification@2.0.1...@visulima/notification@2.0.2) (2026-10-23)
2
10
 
3
11
 
@@ -1,7 +1,7 @@
1
1
  import { M as Middleware, S as SendContext } from "../packem_shared/types.d-YJ8U7pag.js";
2
2
  export { type a as SendFunction, c as composeMiddleware } from "../packem_shared/types.d-YJ8U7pag.js";
3
3
  import { C as ChannelType, B as BaseNotificationPayload } from "../packem_shared/types.d-COwyORBZ.js";
4
- import { A as Attributes, C as Context, T as Tracer } from "../packem_shared/tracer.d-BPznIQx9.js";
4
+ import { A as Attributes, C as Context, T as Tracer } from "../packem_shared/tracer.d-BklP4tun.js";
5
5
  interface CircuitBreakerMiddlewareOptions {
6
6
  /** Time in ms the circuit stays open before a trial request (default 30000). */
7
7
  resetTimeout?: number;
@@ -83,6 +83,7 @@ interface SuppressionMiddlewareOptions {
83
83
  * @returns A middleware.
84
84
  */
85
85
  declare const suppressionMiddleware: (options: SuppressionMiddlewareOptions) => Middleware;
86
+ //#region src/metrics/Metric.d.ts
86
87
  /**
87
88
  * Advisory options influencing aggregation configuration parameters.
88
89
  *
@@ -206,6 +207,8 @@ interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttr
206
207
  }
207
208
  /**
208
209
  * Interface that is being used in batch observable callback function.
210
+ *
211
+ * @since 1.3.0
209
212
  */
210
213
  interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
211
214
  /**
@@ -272,6 +275,8 @@ interface Meter {
272
275
  * Creates and returns a new `Gauge`.
273
276
  * @param name the name of the metric.
274
277
  * @param [options] the metric options.
278
+ *
279
+ * @since 1.9.0
275
280
  */
276
281
  createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): Gauge<AttributesTypes>;
277
282
  /**
@@ -1,3 +1,4 @@
1
+ //#region src/context/types.d.ts
1
2
  /**
2
3
  * @since 1.0.0
3
4
  */
@@ -24,24 +25,76 @@ interface Context {
24
25
  */
25
26
  deleteValue(key: symbol): Context;
26
27
  }
28
+ //#region src/common/AnyValue.d.ts
27
29
  /**
28
- * Attributes is a map from string to attribute values.
30
+ * AnyValue can be:
31
+ * - a string, number, boolean value
32
+ * - a byte array (Uint8Array)
33
+ * - array of any value
34
+ * - map from string to any value (a plain Object)
35
+ * - null (an empty value)
29
36
  *
30
- * Note: only the own enumerable keys are counted as valid attribute keys.
37
+ * https://opentelemetry.io/docs/specs/otel/common/#anyvalue
31
38
  *
32
- * @since 1.3.0
39
+ * Notable JavaScript types that are excluded:
40
+ * - `undefined` - Excluding this means the common practice in instrumentations,
41
+ * using `undefined` to mean "no value for this optional attribute", can
42
+ * remain supported.
43
+ * - `BigInt`
44
+ * - TypedArrays other than `Uint8Array`
45
+ * - subclasses of Object, e.g. Date, Error
46
+ *
47
+ * The TypeScript type `unknown` is used for `AnyValue`. This has some
48
+ * implications:
49
+ * - Callers of `@opentelemetry/api` APIs using `AnyValue` can pass in
50
+ * whatever type. This was always the case for (untyped) JavaScript usage.
51
+ * - SDK implementations of `@opentelemetry/api` need to document if/when they
52
+ * support a subset of AnyValue types.
53
+ * - Using `unknown` allows future changes to support more types (e.g. BigInt).
54
+ *
55
+ * @since 1.10.0
56
+ */
57
+ type AnyValue = unknown;
58
+ //#region src/common/Attributes.d.ts
59
+ /**
60
+ * Attributes is a mapping from string to attribute values.
61
+ * https://opentelemetry.io/docs/specs/otel/common/#attribute-collections
62
+ *
63
+ * @since 1.1.0
33
64
  */
34
65
  interface Attributes {
35
- [attributeKey: string]: AttributeValue | undefined;
66
+ [attributeKey: string]: AnyValue;
36
67
  }
37
68
  /**
38
- * Attribute values may be any non-nullish primitive value except an object.
69
+ * @since 1.1.0
70
+ * @deprecated use AnyValue
71
+ */
72
+ type AttributeValue = AnyValue;
73
+ //#region src/common/Time.d.ts
74
+ /**
75
+ * Defines High-Resolution Time.
76
+ *
77
+ * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
78
+ * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
79
+ * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
80
+ * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
81
+ * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
82
+ * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
83
+ * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
84
+ * This is represented in HrTime format as [1609504210, 150000000].
85
+ *
86
+ * @since 1.0.0
87
+ */
88
+ type HrTime = [number, number];
89
+ /**
90
+ * Defines TimeInput.
39
91
  *
40
- * null or undefined attribute values are invalid and will result in undefined behavior.
92
+ * hrtime, epoch milliseconds, performance.now() or Date
41
93
  *
42
- * @since 1.3.0
94
+ * @since 1.0.0
43
95
  */
44
- type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
96
+ type TimeInput = HrTime | number | Date;
97
+ //#region src/common/Exception.d.ts
45
98
  interface ExceptionWithCode {
46
99
  code: string | number;
47
100
  name?: string;
@@ -68,29 +121,7 @@ interface ExceptionWithName {
68
121
  * @since 1.0.0
69
122
  */
70
123
  type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
71
- /**
72
- * Defines High-Resolution Time.
73
- *
74
- * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
75
- * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
76
- * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
77
- * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
78
- * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
79
- * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
80
- * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
81
- * This is represented in HrTime format as [1609504210, 150000000].
82
- *
83
- * @since 1.0.0
84
- */
85
- type HrTime = [number, number];
86
- /**
87
- * Defines TimeInput.
88
- *
89
- * hrtime, epoch milliseconds, performance.now() or Date
90
- *
91
- * @since 1.0.0
92
- */
93
- type TimeInput = HrTime | number | Date;
124
+ //#region src/trace/attributes.d.ts
94
125
  /**
95
126
  * @deprecated please use {@link Attributes}
96
127
  * @since 1.0.0
@@ -101,6 +132,7 @@ type SpanAttributes = Attributes;
101
132
  * @since 1.0.0
102
133
  */
103
134
  type SpanAttributeValue = AttributeValue;
135
+ //#region src/trace/trace_state.d.ts
104
136
  /**
105
137
  * @since 1.0.0
106
138
  */
@@ -141,6 +173,7 @@ interface TraceState {
141
173
  */
142
174
  serialize(): string;
143
175
  }
176
+ //#region src/trace/span_context.d.ts
144
177
  /**
145
178
  * A SpanContext represents the portion of a {@link Span} which must be
146
179
  * serialized and propagated along side of a {@link Baggage}.
@@ -194,6 +227,7 @@ interface SpanContext {
194
227
  */
195
228
  traceState?: TraceState;
196
229
  }
230
+ //#region src/trace/status.d.ts
197
231
  /**
198
232
  * @since 1.0.0
199
233
  */
@@ -223,6 +257,7 @@ declare enum SpanStatusCode {
223
257
  */
224
258
  ERROR = 2
225
259
  }
260
+ //#region src/trace/link.d.ts
226
261
  /**
227
262
  * A pointer from the current {@link Span} to another span in the same trace or
228
263
  * in a different trace.
@@ -245,9 +280,14 @@ interface Link {
245
280
  context: SpanContext;
246
281
  /** A set of {@link SpanAttributes} on the link. */
247
282
  attributes?: SpanAttributes;
248
- /** Count of attributes of the link that were dropped due to collection limits */
283
+ /**
284
+ * Count of attributes of the link that were dropped due to collection limits
285
+ *
286
+ * @since 1.4.1
287
+ */
249
288
  droppedAttributesCount?: number;
250
289
  }
290
+ //#region src/trace/span.d.ts
251
291
  /**
252
292
  * An interface that represents a span. A span represents a single operation
253
293
  * within a trace. Examples of span might include remote procedure calls or a
@@ -305,6 +345,8 @@ interface Span {
305
345
  * It is preferred span links be added at span creation.
306
346
  *
307
347
  * @param link the link to add.
348
+ *
349
+ * @since 1.9.0
308
350
  */
309
351
  addLink(link: Link): this;
310
352
  /**
@@ -314,6 +356,8 @@ interface Span {
314
356
  * It is preferred span links be added at span creation.
315
357
  *
316
358
  * @param links the links to add.
359
+ *
360
+ * @since 1.9.0
317
361
  */
318
362
  addLinks(links: Link[]): this;
319
363
  /**
@@ -373,6 +417,7 @@ interface Span {
373
417
  */
374
418
  recordException(exception: Exception, time?: TimeInput): void;
375
419
  }
420
+ //#region src/trace/span_kind.d.ts
376
421
  /**
377
422
  * @since 1.0.0
378
423
  */
@@ -402,6 +447,7 @@ declare enum SpanKind {
402
447
  */
403
448
  CONSUMER = 4
404
449
  }
450
+ //#region src/trace/SpanOptions.d.ts
405
451
  /**
406
452
  * Options needed for span creation
407
453
  *
@@ -422,6 +468,7 @@ interface SpanOptions {
422
468
  /** The new span should be a root span. (Ignore parent from context). */
423
469
  root?: boolean;
424
470
  }
471
+ //#region src/trace/tracer.d.ts
425
472
  /**
426
473
  * Tracer provides an interface for creating {@link Span}s.
427
474
  *
@@ -449,6 +496,11 @@ interface Tracer {
449
496
  * Additionally the new span gets set in context and this context is activated
450
497
  * for the duration of the function call.
451
498
  *
499
+ * **Important**: The callback function is responsible for calling `span.end()`
500
+ * to finish the span. Unlike some other OpenTelemetry implementations, the span
501
+ * is NOT automatically ended when the callback returns. If `span.end()` is not
502
+ * called, the span will never be exported and will be silently lost.
503
+ *
452
504
  * @param name The name of the span
453
505
  * @param [options] SpanOptions used for span creation
454
506
  * @param [context] Context to use to extract parent
@@ -1,6 +1,6 @@
1
+ import { T as Tracer } from "../../packem_shared/tracer.d-BklP4tun.js";
1
2
  import { B as BaseNotificationPayload } from "../../packem_shared/types.d-COwyORBZ.js";
2
3
  import { P as Provider } from "../../packem_shared/provider.d-D5HGHu5g.js";
3
- import { T as Tracer } from "../../packem_shared/tracer.d-BPznIQx9.js";
4
4
  interface OtelProviderConfig {
5
5
  /**
6
6
  * The OpenTelemetry {@link Tracer} used to create spans. When omitted, a no-op tracer is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/notification",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "A reusable, ESM-only, edge-ready multi-channel notification library with SMS, push, chat, in-app and webhook providers",
5
5
  "keywords": [
6
6
  "agent",
@@ -238,7 +238,7 @@
238
238
  "peerDependencies": {
239
239
  "@aws-sdk/client-sqs": "^3.0.0",
240
240
  "@opentelemetry/api": "^1.0.0 || ^2.0.0",
241
- "@visulima/email": "4.2.0",
241
+ "@visulima/email": "4.2.1",
242
242
  "@visulima/workflow": "4.0.0",
243
243
  "bullmq": "^5.0.0",
244
244
  "croner": "^10.0.1",