@ariary/notification 2.0.0 → 2.0.2
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 +4 -5
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -4
- package/dist/index.mjs +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,9 +28,6 @@ const task = await Ariari.send(
|
|
|
28
28
|
{ phone: '+261123456789', message: 'Message 1' },
|
|
29
29
|
{ phone: ['+261987654321', '+261555555555'], message: 'Message 2' }
|
|
30
30
|
);
|
|
31
|
-
|
|
32
|
-
// Check task status
|
|
33
|
-
await task.status();
|
|
34
31
|
```
|
|
35
32
|
|
|
36
33
|
### Check Task Status
|
|
@@ -39,10 +36,12 @@ You can also check the status of a task by ID:
|
|
|
39
36
|
|
|
40
37
|
```typescript
|
|
41
38
|
const task = new Ariari.Task('task-id-123');
|
|
42
|
-
await task.status();
|
|
43
|
-
await task.detailedStatus();
|
|
39
|
+
const status = await task.status();
|
|
40
|
+
const detailedStatus = await task.detailedStatus();
|
|
44
41
|
```
|
|
45
42
|
|
|
43
|
+
The status endpoint returns SMS details including status (SENT, PENDING, FAILED), retry count, and summary information.
|
|
44
|
+
|
|
46
45
|
### List Tasks
|
|
47
46
|
|
|
48
47
|
```typescript
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -88,14 +88,15 @@ function normalizePhoneNumber(phone) {
|
|
|
88
88
|
return normalized;
|
|
89
89
|
}
|
|
90
90
|
var Task = class {
|
|
91
|
-
constructor(id) {
|
|
91
|
+
constructor(id, notifTaskId) {
|
|
92
92
|
this.id = id;
|
|
93
|
+
this.notifTaskId = notifTaskId;
|
|
93
94
|
}
|
|
94
95
|
async status() {
|
|
95
|
-
return httpGet(`/api/
|
|
96
|
+
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
96
97
|
}
|
|
97
98
|
async detailedStatus() {
|
|
98
|
-
return httpGet(`/api/
|
|
99
|
+
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
var Notification = class {
|
|
@@ -108,7 +109,10 @@ var Notification = class {
|
|
|
108
109
|
if (!response.data || !Array.isArray(response.data) || response.data.length === 0) {
|
|
109
110
|
throw new Error("Invalid response: no SMS IDs returned");
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
+
if (!response.notifTaskId) {
|
|
113
|
+
throw new Error("Invalid response: no notifTaskId returned");
|
|
114
|
+
}
|
|
115
|
+
return new Task(response.data[0], response.notifTaskId);
|
|
112
116
|
}
|
|
113
117
|
async sendMessage(data) {
|
|
114
118
|
return this.send(data);
|
package/dist/index.mjs
CHANGED
|
@@ -60,14 +60,15 @@ function normalizePhoneNumber(phone) {
|
|
|
60
60
|
return normalized;
|
|
61
61
|
}
|
|
62
62
|
var Task = class {
|
|
63
|
-
constructor(id) {
|
|
63
|
+
constructor(id, notifTaskId) {
|
|
64
64
|
this.id = id;
|
|
65
|
+
this.notifTaskId = notifTaskId;
|
|
65
66
|
}
|
|
66
67
|
async status() {
|
|
67
|
-
return httpGet(`/api/
|
|
68
|
+
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
68
69
|
}
|
|
69
70
|
async detailedStatus() {
|
|
70
|
-
return httpGet(`/api/
|
|
71
|
+
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
var Notification = class {
|
|
@@ -80,7 +81,10 @@ var Notification = class {
|
|
|
80
81
|
if (!response.data || !Array.isArray(response.data) || response.data.length === 0) {
|
|
81
82
|
throw new Error("Invalid response: no SMS IDs returned");
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
if (!response.notifTaskId) {
|
|
85
|
+
throw new Error("Invalid response: no notifTaskId returned");
|
|
86
|
+
}
|
|
87
|
+
return new Task(response.data[0], response.notifTaskId);
|
|
84
88
|
}
|
|
85
89
|
async sendMessage(data) {
|
|
86
90
|
return this.send(data);
|