@ariary/notification 2.0.8 → 3.0.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/README.md CHANGED
@@ -33,11 +33,11 @@ const task = await Ariari.send(
33
33
  ## Check Task Status
34
34
 
35
35
  ```typescript
36
-
37
36
  const status = await task.status();
38
- // Returns SMS details: status (PENDING, SENT, FAILED)
37
+ // Returns TaskSummary: { total: 1, sent: 1, failed: 0, pending: 0 }
39
38
 
40
39
  const details = await task.smsDetails();
40
+ // Returns TaskDetails object with notifTaskId, projectId, summary, smsDetails array, and createdAt
41
41
  ```
42
42
 
43
43
  ## List Tasks
package/dist/index.d.mts CHANGED
@@ -11,12 +11,31 @@ type GetTaskParam = {
11
11
  count: number;
12
12
  order: -1 | 1;
13
13
  };
14
+ type TaskSummary = {
15
+ total: number;
16
+ sent: number;
17
+ failed: number;
18
+ pending: number;
19
+ };
20
+ type TaskDetails = {
21
+ notifTaskId: string;
22
+ projectId: string;
23
+ summary: TaskSummary;
24
+ smsDetails: Array<{
25
+ smsId: string;
26
+ phone: string;
27
+ message: string;
28
+ status: 'PENDING' | 'SENT' | 'FAILED';
29
+ retryCount: number;
30
+ }>;
31
+ createdAt: string;
32
+ };
14
33
 
15
34
  declare class Task {
16
35
  id: string;
17
36
  constructor(id: string);
18
- status(): Promise<unknown>;
19
- smsDetails(): Promise<unknown>;
37
+ status(): Promise<TaskSummary>;
38
+ smsDetails(): Promise<TaskDetails>;
20
39
  }
21
40
  declare class Ariari {
22
41
  static config(config: Config): void;
@@ -24,4 +43,4 @@ declare class Ariari {
24
43
  static tasks(param: GetTaskParam): Promise<unknown>;
25
44
  }
26
45
 
27
- export { Ariari, type GetTaskParam, type Message, Task };
46
+ export { Ariari, type GetTaskParam, type Message, Task, type TaskDetails, type TaskSummary };
package/dist/index.d.ts CHANGED
@@ -11,12 +11,31 @@ type GetTaskParam = {
11
11
  count: number;
12
12
  order: -1 | 1;
13
13
  };
14
+ type TaskSummary = {
15
+ total: number;
16
+ sent: number;
17
+ failed: number;
18
+ pending: number;
19
+ };
20
+ type TaskDetails = {
21
+ notifTaskId: string;
22
+ projectId: string;
23
+ summary: TaskSummary;
24
+ smsDetails: Array<{
25
+ smsId: string;
26
+ phone: string;
27
+ message: string;
28
+ status: 'PENDING' | 'SENT' | 'FAILED';
29
+ retryCount: number;
30
+ }>;
31
+ createdAt: string;
32
+ };
14
33
 
15
34
  declare class Task {
16
35
  id: string;
17
36
  constructor(id: string);
18
- status(): Promise<unknown>;
19
- smsDetails(): Promise<unknown>;
37
+ status(): Promise<TaskSummary>;
38
+ smsDetails(): Promise<TaskDetails>;
20
39
  }
21
40
  declare class Ariari {
22
41
  static config(config: Config): void;
@@ -24,4 +43,4 @@ declare class Ariari {
24
43
  static tasks(param: GetTaskParam): Promise<unknown>;
25
44
  }
26
45
 
27
- export { Ariari, type GetTaskParam, type Message, Task };
46
+ export { Ariari, type GetTaskParam, type Message, Task, type TaskDetails, type TaskSummary };
package/dist/index.js CHANGED
@@ -91,7 +91,8 @@ var Task = class {
91
91
  this.id = id;
92
92
  }
93
93
  async status() {
94
- return httpGet(`/api/notif-task/${this.id}/sms-details`);
94
+ const response = await httpGet(`/api/notif-task/${this.id}/sms-details`);
95
+ return response.summary;
95
96
  }
96
97
  async smsDetails() {
97
98
  return httpGet(`/api/notif-task/${this.id}/sms-details`);
package/dist/index.mjs CHANGED
@@ -64,7 +64,8 @@ var Task = class {
64
64
  this.id = id;
65
65
  }
66
66
  async status() {
67
- return httpGet(`/api/notif-task/${this.id}/sms-details`);
67
+ const response = await httpGet(`/api/notif-task/${this.id}/sms-details`);
68
+ return response.summary;
68
69
  }
69
70
  async smsDetails() {
70
71
  return httpGet(`/api/notif-task/${this.id}/sms-details`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariary/notification",
3
- "version": "2.0.8",
3
+ "version": "3.0.0",
4
4
  "description": "SMS et Notification Task SDK pour l'API Ariary",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",