@ariary/notification 2.0.9 → 3.0.1
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 +6 -4
- package/dist/index.d.mts +22 -3
- package/dist/index.d.ts +22 -3
- package/package.json +1 -1
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
|
|
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
|
|
@@ -49,6 +49,8 @@ const result = await Ariari.tasks({
|
|
|
49
49
|
order: -1
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
const
|
|
53
|
-
|
|
52
|
+
const fetchTasks = (from) => Ariari.tasks({ from, count: 20, order: -1 });
|
|
53
|
+
|
|
54
|
+
const nextResult = await fetchTasks(result.next);
|
|
55
|
+
const prevResult = await fetchTasks(result.prev);
|
|
54
56
|
```
|
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<
|
|
19
|
-
smsDetails(): Promise<
|
|
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<
|
|
19
|
-
smsDetails(): Promise<
|
|
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 };
|