@ariary/notification 2.0.4 → 2.0.6

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
@@ -21,60 +21,25 @@ Ariari.config({
21
21
  });
22
22
  ```
23
23
 
24
- ### Send Messages
25
-
26
24
  ```typescript
27
25
  const task = await Ariari.send(
28
26
  { phone: '+261123456789', message: 'Message 1' },
29
27
  { phone: ['+261987654321', '+261555555555'], message: 'Message 2' }
30
28
  );
31
- ```
32
-
33
- ### Check Task Status
34
-
35
- #### Quick Status (Summary Only)
36
29
 
37
- Get a quick overview of the task status without SMS details:
38
30
 
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
31
  ```
49
32
 
50
33
  Or check an existing task by ID:
51
34
 
52
35
  ```typescript
53
- const task = new Ariari.Task('id');
54
- const status = await task.status();
55
- ```
36
+ const task = new Ariari.Task( 'id');
56
37
 
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
- );
38
+ const status = await task.status();
39
+ // Returns SMS details: status (PENDING, SENT, FAILED),
66
40
 
67
41
  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
42
 
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
43
  ```
79
44
 
80
45
  ### List Tasks
package/dist/index.d.mts CHANGED
@@ -13,9 +13,11 @@ declare class Task {
13
13
  notifTaskId: string;
14
14
  constructor(id: string, notifTaskId: string);
15
15
  status(): Promise<unknown>;
16
+ smsDetails(): Promise<unknown>;
16
17
  detailedStatus(): Promise<unknown>;
17
18
  }
18
19
  declare class Notification {
20
+ tasks(param: GetTaskParam): void;
19
21
  send(...data: Message[]): Promise<Task>;
20
22
  sendMessage(data: Message): Promise<Task>;
21
23
  getMessages(param: GetTaskParam): Promise<unknown>;
@@ -25,7 +27,7 @@ declare class Ariari {
25
27
  static config(config: any): void;
26
28
  static sendMessage(data: Message): Promise<Task>;
27
29
  static send(...data: Message[]): Promise<Task>;
28
- static getMessages(param: GetTaskParam): Promise<unknown>;
30
+ static tasks(param: GetTaskParam): Promise<void>;
29
31
  }
30
32
 
31
33
  export { Ariari, type GetTaskParam, type Message, Notification, Task };
package/dist/index.d.ts CHANGED
@@ -13,9 +13,11 @@ declare class Task {
13
13
  notifTaskId: string;
14
14
  constructor(id: string, notifTaskId: string);
15
15
  status(): Promise<unknown>;
16
+ smsDetails(): Promise<unknown>;
16
17
  detailedStatus(): Promise<unknown>;
17
18
  }
18
19
  declare class Notification {
20
+ tasks(param: GetTaskParam): void;
19
21
  send(...data: Message[]): Promise<Task>;
20
22
  sendMessage(data: Message): Promise<Task>;
21
23
  getMessages(param: GetTaskParam): Promise<unknown>;
@@ -25,7 +27,7 @@ declare class Ariari {
25
27
  static config(config: any): void;
26
28
  static sendMessage(data: Message): Promise<Task>;
27
29
  static send(...data: Message[]): Promise<Task>;
28
- static getMessages(param: GetTaskParam): Promise<unknown>;
30
+ static tasks(param: GetTaskParam): Promise<void>;
29
31
  }
30
32
 
31
33
  export { Ariari, type GetTaskParam, type Message, Notification, Task };
package/dist/index.js CHANGED
@@ -95,11 +95,17 @@ 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
  }
101
104
  };
102
105
  var Notification = class {
106
+ tasks(param) {
107
+ throw new Error("Method not implemented.");
108
+ }
103
109
  async send(...data) {
104
110
  const messages = data.map((item) => ({
105
111
  phones: (Array.isArray(item.phone) ? item.phone : [item.phone]).map(normalizePhoneNumber),
@@ -131,8 +137,8 @@ var Ariari = class {
131
137
  static async send(...data) {
132
138
  return this.notification.send(...data);
133
139
  }
134
- static async getMessages(param) {
135
- return this.notification.getMessages(param);
140
+ static async tasks(param) {
141
+ return this.notification.tasks(param);
136
142
  }
137
143
  };
138
144
  Ariari.notification = new Notification();
package/dist/index.mjs CHANGED
@@ -67,11 +67,17 @@ 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
  }
73
76
  };
74
77
  var Notification = class {
78
+ tasks(param) {
79
+ throw new Error("Method not implemented.");
80
+ }
75
81
  async send(...data) {
76
82
  const messages = data.map((item) => ({
77
83
  phones: (Array.isArray(item.phone) ? item.phone : [item.phone]).map(normalizePhoneNumber),
@@ -103,8 +109,8 @@ var Ariari = class {
103
109
  static async send(...data) {
104
110
  return this.notification.send(...data);
105
111
  }
106
- static async getMessages(param) {
107
- return this.notification.getMessages(param);
112
+ static async tasks(param) {
113
+ return this.notification.tasks(param);
108
114
  }
109
115
  };
110
116
  Ariari.notification = new Notification();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariary/notification",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "SMS et Notification Task SDK pour l'API Ariary",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",