bridgex 2.0.0 → 2.1.0

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/src/main.ts CHANGED
@@ -12,7 +12,13 @@ export type { SMSServiceOptions } from "./SMSService.js";
12
12
 
13
13
  // Queue & Scheduler
14
14
  export { default as SMSQueue } from "./SMSQueue.js";
15
- export type { QueueOptions, QueueStats, QueueJob } from "./SMSQueue.js";
15
+ export type {
16
+ QueueOptions,
17
+ QueueStats,
18
+ QueueJob,
19
+ FailedJob,
20
+ AttemptRecord,
21
+ } from "./SMSQueue.js";
16
22
 
17
23
  export { default as SMSScheduler } from "./SMSScheduler.js";
18
24
  export type { ScheduledJob } from "./SMSScheduler.js";
@@ -30,7 +36,7 @@ export {
30
36
  default as CredentialProvisioner,
31
37
  type ProvisionOptions,
32
38
  type Credentials,
33
- } from "./Credentialprovisioner.js";
39
+ } from "./CredentialProvisioner.js";
34
40
 
35
41
  // Lower-level building blocks (advanced use)
36
42
  export { default as CircuitBreaker } from "./CircuitBreaker.js";
@@ -41,7 +47,7 @@ export type { RetryOptions } from "./RetryHandler.js";
41
47
 
42
48
  export { default as MessageFormatter } from "./MessageFormatter.js";
43
49
 
44
- // Errors
50
+ //errors
45
51
  export {
46
52
  ServerError,
47
53
  ValidationError,
@@ -49,13 +55,16 @@ export {
49
55
  NetworkError,
50
56
  RateLimitError,
51
57
  CircuitOpenError,
58
+ MaxLimitError,
52
59
  } from "./errors.js";
53
60
 
54
- // Types
61
+ //types
55
62
  export type {
56
63
  Result,
57
64
  ErrorLog,
58
65
  SendParams,
59
66
  SendObjectParams,
60
67
  BatchResult,
68
+ FailedItem,
69
+ SucceededItem,
61
70
  } from "./types.js";
package/src/types.ts CHANGED
@@ -21,13 +21,30 @@ export interface SendParams {
21
21
  export interface SendObjectParams<T extends Record<string, unknown>> {
22
22
  to: string;
23
23
  object: T;
24
+ /** Optional template; if omitted the object's message/body/text field is used */
24
25
  template?: string;
25
26
  }
26
27
 
28
+ export interface SucceededItem<T> {
29
+ index: number;
30
+ to: string;
31
+ data: T;
32
+ }
33
+
34
+ export interface FailedItem {
35
+ index: number;
36
+ to: string;
37
+ error: ErrorLog;
38
+ /** The original params — preserved so you can re-enqueue or log without data loss */
39
+ originalParams: SendParams;
40
+ }
41
+
27
42
  export interface BatchResult<T> {
28
- succeeded: Array<{ index: number; to: string; data: T }>;
29
- failed: Array<{ index: number; to: string; error: ErrorLog }>;
43
+ succeeded: SucceededItem<T>[];
44
+ failed: FailedItem[];
30
45
  total: number;
31
46
  successCount: number;
32
47
  failureCount: number;
48
+ /** True if the server hit a quota/max-limit and stopped sending */
49
+ hitMaxLimit: boolean;
33
50
  }