@k-msg/core 0.6.0 → 0.7.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/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -18
- package/dist/index.mjs.map +1 -1
- package/dist/provider.d.ts +2 -1
- package/dist/types/delivery-status.d.ts +20 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/provider.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { KMsgError } from "./errors";
|
|
2
2
|
import type { Result } from "./result";
|
|
3
|
-
import type { MessageType, SendOptions, SendResult } from "./types/index";
|
|
3
|
+
import type { DeliveryStatusQuery, DeliveryStatusResult, MessageType, SendOptions, SendResult } from "./types/index";
|
|
4
4
|
export interface Template {
|
|
5
5
|
id: string;
|
|
6
6
|
code: string;
|
|
@@ -36,4 +36,5 @@ export interface Provider {
|
|
|
36
36
|
readonly supportedTypes: readonly MessageType[];
|
|
37
37
|
healthCheck(): Promise<ProviderHealthStatus>;
|
|
38
38
|
send(params: SendOptions): Promise<Result<SendResult, KMsgError>>;
|
|
39
|
+
getDeliveryStatus?(query: DeliveryStatusQuery): Promise<Result<DeliveryStatusResult | null, KMsgError>>;
|
|
39
40
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MessageType } from "./message";
|
|
2
|
+
export type DeliveryStatus = "PENDING" | "SENT" | "DELIVERED" | "FAILED" | "CANCELLED" | "UNKNOWN";
|
|
3
|
+
export interface DeliveryStatusQuery {
|
|
4
|
+
providerMessageId: string;
|
|
5
|
+
type: MessageType;
|
|
6
|
+
to: string;
|
|
7
|
+
requestedAt: Date;
|
|
8
|
+
scheduledAt?: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface DeliveryStatusResult {
|
|
11
|
+
providerId: string;
|
|
12
|
+
providerMessageId: string;
|
|
13
|
+
status: DeliveryStatus;
|
|
14
|
+
statusCode?: string;
|
|
15
|
+
statusMessage?: string;
|
|
16
|
+
sentAt?: Date;
|
|
17
|
+
deliveredAt?: Date;
|
|
18
|
+
failedAt?: Date;
|
|
19
|
+
raw?: unknown;
|
|
20
|
+
}
|
package/dist/types/index.d.ts
CHANGED