@textbee/sdk 0.0.2 → 0.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/README.md CHANGED
@@ -74,12 +74,15 @@ await textbee.setDefaultDevice(deviceId)
74
74
  ```js
75
75
  // Paginated history, filterable and searchable
76
76
  const { data, meta } = await textbee.getMessages(deviceId, {
77
- type: 'received', // 'all' | 'sent' | 'received'
77
+ type: 'received', // filter is lowercase: 'all' | 'sent' | 'received'
78
78
  page: 1,
79
79
  limit: 50,
80
80
  search: 'invoice',
81
81
  })
82
82
 
83
+ // Each message reports its direction uppercase, so compare accordingly
84
+ data.filter((m) => m.type === 'RECEIVED')
85
+
83
86
  // A single message and its current status
84
87
  const sms = await textbee.getSms(deviceId, smsId)
85
88
 
@@ -137,7 +140,7 @@ new Textbee({
137
140
 
138
141
  ## What is not covered yet
139
142
 
140
- v0.0.1 focuses on sending and reading messages. Bulk send and a few device operations are still REST only, documented at [textbee.dev/docs](https://textbee.dev/docs).
143
+ The SDK focuses on sending and reading messages. Bulk send and a few device operations are still REST only, documented at [textbee.dev/docs](https://textbee.dev/docs).
141
144
 
142
145
  ## License
143
146
 
package/dist/index.cjs CHANGED
@@ -42,7 +42,7 @@ var TextbeeError = class extends Error {
42
42
 
43
43
  // src/client.ts
44
44
  var DEFAULT_BASE_URL = "https://api.textbee.dev/api/v1";
45
- var CLIENT_ID = `textbee-js/${"0.0.2"}`;
45
+ var CLIENT_ID = `textbee-js/${"0.0.3"}`;
46
46
  var Textbee = class {
47
47
  #apiKey;
48
48
  #baseUrl;
package/dist/index.d.cts CHANGED
@@ -85,8 +85,13 @@ interface Device {
85
85
  interface Message {
86
86
  _id: string;
87
87
  message: string;
88
- type: 'sent' | 'received';
89
- status: 'pending' | 'dispatched' | 'sent' | 'delivered' | 'failed' | 'unknown' | 'received';
88
+ /**
89
+ * Direction, uppercase. Note the asymmetry with the `type` filter accepted by
90
+ * getMessages, which is lowercase.
91
+ */
92
+ type: 'SENT' | 'RECEIVED';
93
+ /** Lowercase, and absent on messages stored before status tracking. */
94
+ status?: 'pending' | 'dispatched' | 'sent' | 'delivered' | 'failed' | 'unknown' | 'received';
90
95
  sender?: string;
91
96
  recipient?: string;
92
97
  requestedAt?: string;
package/dist/index.d.ts CHANGED
@@ -85,8 +85,13 @@ interface Device {
85
85
  interface Message {
86
86
  _id: string;
87
87
  message: string;
88
- type: 'sent' | 'received';
89
- status: 'pending' | 'dispatched' | 'sent' | 'delivered' | 'failed' | 'unknown' | 'received';
88
+ /**
89
+ * Direction, uppercase. Note the asymmetry with the `type` filter accepted by
90
+ * getMessages, which is lowercase.
91
+ */
92
+ type: 'SENT' | 'RECEIVED';
93
+ /** Lowercase, and absent on messages stored before status tracking. */
94
+ status?: 'pending' | 'dispatched' | 'sent' | 'delivered' | 'failed' | 'unknown' | 'received';
90
95
  sender?: string;
91
96
  recipient?: string;
92
97
  requestedAt?: string;
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.0.2"}`;
17
+ var CLIENT_ID = `textbee-js/${"0.0.3"}`;
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.0.2",
3
+ "version": "0.0.3",
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",