@textbee/sdk 0.3.1 → 0.4.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/dist/index.cjs CHANGED
@@ -48,7 +48,7 @@ var TextbeeError = class extends Error {
48
48
 
49
49
  // src/client.ts
50
50
  var DEFAULT_BASE_URL = "https://api.textbee.dev/api/v1";
51
- var CLIENT_ID = `textbee-js/${"0.3.1"}`;
51
+ var CLIENT_ID = `textbee-js/${"0.4.0"}`;
52
52
  var Textbee = class {
53
53
  #apiKey;
54
54
  #baseUrl;
package/dist/index.d.cts CHANGED
@@ -136,6 +136,20 @@ interface MessageDevice {
136
136
  buildId?: string;
137
137
  enabled?: boolean;
138
138
  }
139
+ /** Where a failure was reported from. */
140
+ type MessageIssueSource = 'push' | 'device' | 'server';
141
+ /** One failure a message had. Kept after the message later succeeds. */
142
+ interface MessageIssueEntry {
143
+ code: string;
144
+ message?: string;
145
+ /** When the failure happened. ISO date. */
146
+ at: string;
147
+ source: MessageIssueSource;
148
+ /** Set on entries rebuilt from old message fields. */
149
+ backfilled?: boolean;
150
+ /** True when the entry is a delivery report that did not confirm delivery. The message was sent; this is not a send failure. */
151
+ deliveryReport?: boolean;
152
+ }
139
153
  interface Message {
140
154
  _id: string;
141
155
  message: string;
@@ -160,10 +174,15 @@ interface Message {
160
174
  dispatchedAt?: string;
161
175
  sentAt?: string;
162
176
  deliveredAt?: string;
177
+ /** When the message failed. Present only while status is `failed`. */
163
178
  failedAt?: string;
164
179
  receivedAt?: string;
180
+ /** Current failure code. Present only while status is `failed` (test accounts can keep `FCM_SEND_SKIPPED`). */
165
181
  errorCode?: string;
182
+ /** Current failure text. Present only while status is `failed`, or as a timeout note on `unknown`. */
166
183
  errorMessage?: string;
184
+ /** Every failure the message had, plus delivery reports that did not confirm delivery (`deliveryReport: true`, not failures). Oldest first. At most 15: the first 5 and the newest 10. */
185
+ issueHistory?: MessageIssueEntry[];
167
186
  simSubscriptionId?: number;
168
187
  smsBatch?: string;
169
188
  createdAt?: string;
@@ -400,4 +419,4 @@ interface VerifyWebhookSignatureOptions {
400
419
  */
401
420
  declare function verifyWebhookSignature(options: VerifyWebhookSignatureOptions): Promise<boolean>;
402
421
 
403
- export { type Device, type IterateMessagesOptions, type ListMessagesOptions, type Message, type MessageDevice, type MessageList, type MessageListMeta, type NormalizePhoneNumberOptions, type SanitizeForGsm7Options, type SendSmsImmediateResponse, type SendSmsQueuedResponse, type SendSmsRequest, type SendSmsResponse, type SendSmsWarning, type Sms, type SmsBatch, type SmsBatchResult, type SmsEncoding, type SmsSegmentInfo, Textbee, TextbeeError, type TextbeeOptions, type VerifyWebhookSignatureOptions, type WebhookEvent, countSmsSegments, findNonGsm7Characters, getSmsEncoding, isValidE164, normalizePhoneNumber, sanitizeForGsm7, verifyWebhookSignature };
422
+ export { type Device, type IterateMessagesOptions, type ListMessagesOptions, type Message, type MessageDevice, type MessageIssueEntry, type MessageIssueSource, type MessageList, type MessageListMeta, type NormalizePhoneNumberOptions, type SanitizeForGsm7Options, type SendSmsImmediateResponse, type SendSmsQueuedResponse, type SendSmsRequest, type SendSmsResponse, type SendSmsWarning, type Sms, type SmsBatch, type SmsBatchResult, type SmsEncoding, type SmsSegmentInfo, Textbee, TextbeeError, type TextbeeOptions, type VerifyWebhookSignatureOptions, type WebhookEvent, countSmsSegments, findNonGsm7Characters, getSmsEncoding, isValidE164, normalizePhoneNumber, sanitizeForGsm7, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -136,6 +136,20 @@ interface MessageDevice {
136
136
  buildId?: string;
137
137
  enabled?: boolean;
138
138
  }
139
+ /** Where a failure was reported from. */
140
+ type MessageIssueSource = 'push' | 'device' | 'server';
141
+ /** One failure a message had. Kept after the message later succeeds. */
142
+ interface MessageIssueEntry {
143
+ code: string;
144
+ message?: string;
145
+ /** When the failure happened. ISO date. */
146
+ at: string;
147
+ source: MessageIssueSource;
148
+ /** Set on entries rebuilt from old message fields. */
149
+ backfilled?: boolean;
150
+ /** True when the entry is a delivery report that did not confirm delivery. The message was sent; this is not a send failure. */
151
+ deliveryReport?: boolean;
152
+ }
139
153
  interface Message {
140
154
  _id: string;
141
155
  message: string;
@@ -160,10 +174,15 @@ interface Message {
160
174
  dispatchedAt?: string;
161
175
  sentAt?: string;
162
176
  deliveredAt?: string;
177
+ /** When the message failed. Present only while status is `failed`. */
163
178
  failedAt?: string;
164
179
  receivedAt?: string;
180
+ /** Current failure code. Present only while status is `failed` (test accounts can keep `FCM_SEND_SKIPPED`). */
165
181
  errorCode?: string;
182
+ /** Current failure text. Present only while status is `failed`, or as a timeout note on `unknown`. */
166
183
  errorMessage?: string;
184
+ /** Every failure the message had, plus delivery reports that did not confirm delivery (`deliveryReport: true`, not failures). Oldest first. At most 15: the first 5 and the newest 10. */
185
+ issueHistory?: MessageIssueEntry[];
167
186
  simSubscriptionId?: number;
168
187
  smsBatch?: string;
169
188
  createdAt?: string;
@@ -400,4 +419,4 @@ interface VerifyWebhookSignatureOptions {
400
419
  */
401
420
  declare function verifyWebhookSignature(options: VerifyWebhookSignatureOptions): Promise<boolean>;
402
421
 
403
- export { type Device, type IterateMessagesOptions, type ListMessagesOptions, type Message, type MessageDevice, type MessageList, type MessageListMeta, type NormalizePhoneNumberOptions, type SanitizeForGsm7Options, type SendSmsImmediateResponse, type SendSmsQueuedResponse, type SendSmsRequest, type SendSmsResponse, type SendSmsWarning, type Sms, type SmsBatch, type SmsBatchResult, type SmsEncoding, type SmsSegmentInfo, Textbee, TextbeeError, type TextbeeOptions, type VerifyWebhookSignatureOptions, type WebhookEvent, countSmsSegments, findNonGsm7Characters, getSmsEncoding, isValidE164, normalizePhoneNumber, sanitizeForGsm7, verifyWebhookSignature };
422
+ export { type Device, type IterateMessagesOptions, type ListMessagesOptions, type Message, type MessageDevice, type MessageIssueEntry, type MessageIssueSource, type MessageList, type MessageListMeta, type NormalizePhoneNumberOptions, type SanitizeForGsm7Options, type SendSmsImmediateResponse, type SendSmsQueuedResponse, type SendSmsRequest, type SendSmsResponse, type SendSmsWarning, type Sms, type SmsBatch, type SmsBatchResult, type SmsEncoding, type SmsSegmentInfo, Textbee, TextbeeError, type TextbeeOptions, type VerifyWebhookSignatureOptions, type WebhookEvent, countSmsSegments, findNonGsm7Characters, getSmsEncoding, isValidE164, normalizePhoneNumber, sanitizeForGsm7, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var TextbeeError = class extends Error {
14
14
 
15
15
  // src/client.ts
16
16
  var DEFAULT_BASE_URL = "https://api.textbee.dev/api/v1";
17
- var CLIENT_ID = `textbee-js/${"0.3.1"}`;
17
+ var CLIENT_ID = `textbee-js/${"0.4.0"}`;
18
18
  var Textbee = class {
19
19
  #apiKey;
20
20
  #baseUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbee/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Official JavaScript SDK for textbee.dev, the open source SMS gateway",
5
5
  "license": "MIT",
6
6
  "packageManager": "pnpm@9.14.2",