@geekapps/post-fastify 0.1.5 → 0.1.7

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.d.ts CHANGED
@@ -202,6 +202,20 @@ interface AreaCode {
202
202
  state: string;
203
203
  available: boolean;
204
204
  }
205
+ interface TemplateVariable {
206
+ name: string;
207
+ value: string;
208
+ }
209
+ interface ButtonVariables {
210
+ index: number;
211
+ variables: TemplateVariable[];
212
+ }
213
+ interface TemplateVariables {
214
+ header?: TemplateVariable[];
215
+ body?: TemplateVariable[];
216
+ footer?: TemplateVariable[];
217
+ buttons?: ButtonVariables[];
218
+ }
205
219
  interface SendMessageInput {
206
220
  type: MessageType;
207
221
  to: string;
@@ -211,10 +225,7 @@ interface SendMessageInput {
211
225
  template?: string;
212
226
  subject?: string;
213
227
  body?: string;
214
- variables?: Array<{
215
- name: string;
216
- value: string;
217
- }>;
228
+ variables?: TemplateVariable[] | TemplateVariables;
218
229
  }
219
230
  interface CreateTemplateInput {
220
231
  name: string;
@@ -545,4 +556,4 @@ declare module "fastify" {
545
556
  }
546
557
  declare const _default: FastifyPluginAsync<PostPluginOptions>;
547
558
 
548
- export { type AreaCode, type AvailablePlan, type ConnectWabaInput, type ConnectWhatsappNumberInput, type CreateDomainInput, type CreateDomainResult, type CreateTemplateInput, type CreateWebhookInput, type CreateWhatsappTemplateInput, type DnsRecord, type DomainStatus, type DomainType, DomainsResource, HistoryResource, type ListHistoryParams, type ManagedNumber, type ManagedNumberStatus, ManagedNumbersResource, type MessageLog, type MessageLogDetail, type MessageStatus, type MessageTemplate, type MessageType, MessagesResource, type OrgDomain, type OrgPlan, type OrgUsage, type OrgWaba, type OrgWebhook, type OrgWebhookWithSecret, type PaginatedResult, type PhoneNumberStatusResult, type PlanTier, PlansResource, type PlansResult, PostApiError, PostClient, type PostPluginOptions, type RegisterWhatsappNumberInput, type RotateSecretResult, type SaveDraftInput, type SendMessageInput, type SendMessageResult, type SmtpConfig, SmtpResource, type StatisticsParams, StatisticsResource, type StatisticsResult, type SyncWhatsappTemplatesResult, TemplatesResource, type UpdatePlanInput, type UpdateTemplateInput, type UpdateWebhookInput, type UpdateWhatsappProfileInput, type UpdateWhatsappTemplateInput, type UpsertSmtpConfigInput, type WabaStatus, type WebhookDelivery, type WebhookEvent, WebhooksResource, type WhatsappNumber, type WhatsappNumberProfile, type WhatsappNumberStatus, WhatsappNumbersResource, type WhatsappTemplate, type WhatsappTemplateCategory, type WhatsappTemplateStatus, WhatsappTemplatesResource, _default as postPlugin };
559
+ export { type AreaCode, type AvailablePlan, type ButtonVariables, type ConnectWabaInput, type ConnectWhatsappNumberInput, type CreateDomainInput, type CreateDomainResult, type CreateTemplateInput, type CreateWebhookInput, type CreateWhatsappTemplateInput, type DnsRecord, type DomainStatus, type DomainType, DomainsResource, HistoryResource, type ListHistoryParams, type ManagedNumber, type ManagedNumberStatus, ManagedNumbersResource, type MessageLog, type MessageLogDetail, type MessageStatus, type MessageTemplate, type MessageType, MessagesResource, type OrgDomain, type OrgPlan, type OrgUsage, type OrgWaba, type OrgWebhook, type OrgWebhookWithSecret, type PaginatedResult, type PhoneNumberStatusResult, type PlanTier, PlansResource, type PlansResult, PostApiError, PostClient, type PostPluginOptions, type RegisterWhatsappNumberInput, type RotateSecretResult, type SaveDraftInput, type SendMessageInput, type SendMessageResult, type SmtpConfig, SmtpResource, type StatisticsParams, StatisticsResource, type StatisticsResult, type SyncWhatsappTemplatesResult, type TemplateVariable, type TemplateVariables, TemplatesResource, type UpdatePlanInput, type UpdateTemplateInput, type UpdateWebhookInput, type UpdateWhatsappProfileInput, type UpdateWhatsappTemplateInput, type UpsertSmtpConfigInput, type WabaStatus, type WebhookDelivery, type WebhookEvent, WebhooksResource, type WhatsappNumber, type WhatsappNumberProfile, type WhatsappNumberStatus, WhatsappNumbersResource, type WhatsappTemplate, type WhatsappTemplateCategory, type WhatsappTemplateStatus, WhatsappTemplatesResource, _default as postPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekapps/post-fastify",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Geekapps Post SDK for Fastify",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -52,6 +52,9 @@ export type {
52
52
  SaveDraftInput,
53
53
  SendMessageInput,
54
54
  SendMessageResult,
55
+ ButtonVariables,
56
+ TemplateVariable,
57
+ TemplateVariables,
55
58
  SmtpConfig,
56
59
  StatisticsParams,
57
60
  StatisticsResult,
package/src/types.ts CHANGED
@@ -239,6 +239,23 @@ export interface AreaCode {
239
239
 
240
240
  // ─── Request types ────────────────────────────────────────────────────────────
241
241
 
242
+ export interface TemplateVariable {
243
+ name: string;
244
+ value: string;
245
+ }
246
+
247
+ export interface ButtonVariables {
248
+ index: number;
249
+ variables: TemplateVariable[];
250
+ }
251
+
252
+ export interface TemplateVariables {
253
+ header?: TemplateVariable[];
254
+ body?: TemplateVariable[];
255
+ footer?: TemplateVariable[];
256
+ buttons?: ButtonVariables[];
257
+ }
258
+
242
259
  export interface SendMessageInput {
243
260
  type: MessageType;
244
261
  to: string;
@@ -248,7 +265,7 @@ export interface SendMessageInput {
248
265
  template?: string;
249
266
  subject?: string;
250
267
  body?: string;
251
- variables?: Array<{ name: string; value: string }>;
268
+ variables?: TemplateVariable[] | TemplateVariables;
252
269
  }
253
270
 
254
271
  export interface CreateTemplateInput {