@ariary/notification 2.0.3 → 2.0.5
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 +28 -3
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,9 @@ const task = await Ariari.send(
|
|
|
32
32
|
|
|
33
33
|
### Check Task Status
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
#### Quick Status (Summary Only)
|
|
36
|
+
|
|
37
|
+
Get a quick overview of the task status without SMS details:
|
|
36
38
|
|
|
37
39
|
```typescript
|
|
38
40
|
const task = await Ariari.send(
|
|
@@ -42,16 +44,39 @@ const task = await Ariari.send(
|
|
|
42
44
|
|
|
43
45
|
const status = await task.status();
|
|
44
46
|
console.log(status);
|
|
45
|
-
// Returns
|
|
47
|
+
// Returns: { notifTaskId, projectId, createdAt, summary: { total, sent, failed, pending } }
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
Or check an existing task by ID:
|
|
49
51
|
|
|
50
52
|
```typescript
|
|
51
|
-
const task = new Ariari.Task(
|
|
53
|
+
const task = new Ariari.Task('id');
|
|
52
54
|
const status = await task.status();
|
|
53
55
|
```
|
|
54
56
|
|
|
57
|
+
#### Detailed Status (SMS Details)
|
|
58
|
+
|
|
59
|
+
Get complete SMS details including individual message status and retry information:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const task = await Ariari.send(
|
|
63
|
+
{ phone: '+261123456789', message: 'Message 1' },
|
|
64
|
+
{ phone: ['+261987654321', '+261555555555'], message: 'Message 2' }
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const details = await task.smsDetails();
|
|
68
|
+
console.log(details);
|
|
69
|
+
// Returns: { notifTaskId, projectId, createdAt, summary, smsDetails: [...] }
|
|
70
|
+
// smsDetails includes: smsId, phone, message, status, retryCount
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Or get details for an existing task:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
const task = new Ariari.Task('id');
|
|
77
|
+
const details = await task.smsDetails();
|
|
78
|
+
```
|
|
79
|
+
|
|
55
80
|
### List Tasks
|
|
56
81
|
|
|
57
82
|
```typescript
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -95,6 +95,9 @@ var Task = class {
|
|
|
95
95
|
async status() {
|
|
96
96
|
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
97
97
|
}
|
|
98
|
+
async smsDetails() {
|
|
99
|
+
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
100
|
+
}
|
|
98
101
|
async detailedStatus() {
|
|
99
102
|
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
100
103
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -67,6 +67,9 @@ var Task = class {
|
|
|
67
67
|
async status() {
|
|
68
68
|
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
69
69
|
}
|
|
70
|
+
async smsDetails() {
|
|
71
|
+
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
72
|
+
}
|
|
70
73
|
async detailedStatus() {
|
|
71
74
|
return httpGet(`/api/notif-task/${this.notifTaskId}/sms-details`);
|
|
72
75
|
}
|