@k-msg/core 0.5.0 → 0.6.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.
@@ -10,6 +10,28 @@ export interface MessageButton {
10
10
  urlPc?: string;
11
11
  urlMobile?: string;
12
12
  }
13
+ export type MessageBinaryInput = {
14
+ /**
15
+ * URL or file path (provider-dependent).
16
+ */
17
+ ref: string;
18
+ filename?: string;
19
+ contentType?: string;
20
+ } | {
21
+ bytes: Uint8Array;
22
+ filename?: string;
23
+ contentType?: string;
24
+ } | {
25
+ blob: Blob;
26
+ filename?: string;
27
+ contentType?: string;
28
+ };
29
+ export interface MessageMedia {
30
+ /**
31
+ * Image attachment (used by MMS, FriendTalk image, RCS_MMS, ...).
32
+ */
33
+ image?: MessageBinaryInput;
34
+ }
13
35
  export interface CommonSendOptions {
14
36
  /**
15
37
  * Correlation id generated by KMsg (or provided by the caller).
@@ -106,6 +128,11 @@ export interface SmsSendOptions extends CommonSendOptions {
106
128
  * LMS/MMS subject.
107
129
  */
108
130
  subject?: string;
131
+ /**
132
+ * Media attachments. For backwards compatibility, `imageUrl` is treated as a legacy alias
133
+ * for `media.image.ref` by some providers.
134
+ */
135
+ media?: MessageMedia;
109
136
  /**
110
137
  * Optional image URL for MMS (provider-specific).
111
138
  */
@@ -121,6 +148,7 @@ export interface AlimTalkSendOptions extends CommonSendOptions {
121
148
  export interface FriendTalkSendOptions extends CommonSendOptions {
122
149
  type: "FRIENDTALK";
123
150
  text: string;
151
+ media?: MessageMedia;
124
152
  imageUrl?: string;
125
153
  buttons?: MessageButton[];
126
154
  variables?: MessageVariables;
@@ -146,6 +174,7 @@ export interface RcsTextSendOptions extends CommonSendOptions {
146
174
  type: "RCS_SMS" | "RCS_LMS" | "RCS_MMS";
147
175
  text: string;
148
176
  subject?: string;
177
+ media?: MessageMedia;
149
178
  imageUrl?: string;
150
179
  variables?: MessageVariables;
151
180
  rcs?: RcsSendOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-msg/core",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "packageManager": "bun@1.3.8",
5
5
  "description": "Core types and interfaces for K-Message platform",
6
6
  "type": "module",