@ariary/notification 2.0.2 → 2.0.4

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.
Files changed (2) hide show
  1. package/README.md +39 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -32,15 +32,50 @@ const task = await Ariari.send(
32
32
 
33
33
  ### Check Task Status
34
34
 
35
- You can also check the status of a task by ID:
35
+ #### Quick Status (Summary Only)
36
+
37
+ Get a quick overview of the task status without SMS details:
38
+
39
+ ```typescript
40
+ const task = await Ariari.send(
41
+ { phone: '+261123456789', message: 'Message 1' },
42
+ { phone: ['+261987654321', '+261555555555'], message: 'Message 2' }
43
+ );
44
+
45
+ const status = await task.status();
46
+ console.log(status);
47
+ // Returns: { notifTaskId, projectId, createdAt, summary: { total, sent, failed, pending } }
48
+ ```
49
+
50
+ Or check an existing task by ID:
36
51
 
37
52
  ```typescript
38
- const task = new Ariari.Task('task-id-123');
53
+ const task = new Ariari.Task('id');
39
54
  const status = await task.status();
40
- const detailedStatus = await task.detailedStatus();
41
55
  ```
42
56
 
43
- The status endpoint returns SMS details including status (SENT, PENDING, FAILED), retry count, and summary information.
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
+ ```
44
79
 
45
80
  ### List Tasks
46
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariary/notification",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "SMS et Notification Task SDK pour l'API Ariary",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",