@shibacore/apis
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -152,3 +152,3 @@ "use strict"; | ||
const _components = []; | ||
const { bodyParameter, headerParameter } = components; | ||
const { bodyParameter, headerParameter, quickReply } = components; | ||
if (headerParameter) { | ||
@@ -168,2 +168,13 @@ const header = { | ||
} | ||
if (quickReply && Array.isArray(quickReply)) { | ||
quickReply.forEach((ele) => { | ||
const value = { | ||
type: "button", | ||
sub_type: "quick_reply", | ||
index: ele.index, | ||
parameters: ele.parameters, | ||
}; | ||
_components.push(value); | ||
}); | ||
} | ||
return _components; | ||
@@ -170,0 +181,0 @@ } |
@@ -33,5 +33,8 @@ export type LanguageCode = "en_us"; | ||
export type Message_Header = TextParameter | ImageParameter | VideoParameter | DocumentParameter; | ||
export type TemplateComponents = { | ||
bodyParameter?: TextParameter[]; | ||
headerParameter?: Message_Header; | ||
export type QuickReply = { | ||
index: "0" | "1" | "2"; | ||
parameters: { | ||
type: "payload"; | ||
payload: string; | ||
}[]; | ||
}; | ||
@@ -111,2 +114,7 @@ type MessageResponse = { | ||
export type UploadMIMEType = "image/jpeg" | "image/jpg" | "image/png" | "video/mp4" | "application/pdf"; | ||
export type TemplateComponents = { | ||
bodyParameter?: TextParameter[]; | ||
headerParameter?: Message_Header; | ||
quickReply?: Buttons<QuickReply>; | ||
}; | ||
export declare function isResponseSuccess(data: MessageResponse): data is MessageResponse; | ||
@@ -113,0 +121,0 @@ export declare function isMediaWithId(media: Media): media is MediaId; |
{ | ||
"name": "@shibacore/apis", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
17982
462