meta-cloud-api 1.1.4 → 1.1.5

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.
Files changed (152) hide show
  1. package/dist/base.d.ts +19 -0
  2. package/dist/base.d.ts.map +1 -0
  3. package/dist/chunk-PECeCxCb.js +15 -0
  4. package/dist/config.d.ts +80 -0
  5. package/dist/config.d.ts.map +1 -0
  6. package/dist/{base-CfDkvT1x.d.ts → enums.d.ts} +3 -142
  7. package/dist/enums.d.ts.map +1 -0
  8. package/dist/enums.js +681 -0
  9. package/dist/enums.js.map +1 -0
  10. package/dist/{index-DQkgkiB6.d.ts → httpsClient.d.ts} +3 -12
  11. package/dist/httpsClient.d.ts.map +1 -0
  12. package/dist/index.d.ts +4386 -21
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3436 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/logger.d.ts +11 -0
  17. package/dist/logger.d.ts.map +1 -0
  18. package/dist/request.d.ts +52 -0
  19. package/dist/request.d.ts.map +1 -0
  20. package/package.json +13 -22
  21. package/dist/WebhookProcessor-BUZFeZD_.js +0 -3
  22. package/dist/WebhookProcessor-BUZFeZD_.js.map +0 -1
  23. package/dist/WebhookProcessor-Dq2Pa2cY.d.ts +0 -718
  24. package/dist/WebhookProcessor-Dq2Pa2cY.d.ts.map +0 -1
  25. package/dist/api/encryption/index.d.ts +0 -3
  26. package/dist/api/encryption/index.js +0 -1
  27. package/dist/api/flow/index.d.ts +0 -5
  28. package/dist/api/flow/index.js +0 -1
  29. package/dist/api/index.d.ts +0 -17
  30. package/dist/api/index.js +0 -1
  31. package/dist/api/media/index.d.ts +0 -3
  32. package/dist/api/media/index.js +0 -1
  33. package/dist/api/messages/builders/index.d.ts +0 -539
  34. package/dist/api/messages/builders/index.d.ts.map +0 -1
  35. package/dist/api/messages/builders/index.js +0 -2
  36. package/dist/api/messages/builders/index.js.map +0 -1
  37. package/dist/api/messages/index.d.ts +0 -4
  38. package/dist/api/messages/index.js +0 -1
  39. package/dist/api/phone/index.d.ts +0 -3
  40. package/dist/api/phone/index.js +0 -1
  41. package/dist/api/profile/index.d.ts +0 -3
  42. package/dist/api/profile/index.js +0 -1
  43. package/dist/api/qrCode/index.d.ts +0 -3
  44. package/dist/api/qrCode/index.js +0 -1
  45. package/dist/api/registration/index.d.ts +0 -3
  46. package/dist/api/registration/index.js +0 -1
  47. package/dist/api/template/index.d.ts +0 -3
  48. package/dist/api/template/index.js +0 -1
  49. package/dist/api/twoStepVerification/index.d.ts +0 -3
  50. package/dist/api/twoStepVerification/index.js +0 -1
  51. package/dist/api/waba/index.d.ts +0 -3
  52. package/dist/api/waba/index.js +0 -1
  53. package/dist/api-8hRAOyaL.js +0 -1
  54. package/dist/base-CfDkvT1x.d.ts.map +0 -1
  55. package/dist/base-D-cXu_lA.js +0 -2
  56. package/dist/base-D-cXu_lA.js.map +0 -1
  57. package/dist/buildFieldsQueryString-Cr-jz3p0.js +0 -2
  58. package/dist/buildFieldsQueryString-Cr-jz3p0.js.map +0 -1
  59. package/dist/chunk-CTAAG5j7.js +0 -1
  60. package/dist/common-C6FXBDm7.js +0 -2
  61. package/dist/common-C6FXBDm7.js.map +0 -1
  62. package/dist/common-CVbsmD26.d.ts +0 -426
  63. package/dist/common-CVbsmD26.d.ts.map +0 -1
  64. package/dist/common-CvPVD1o6.d.ts +0 -406
  65. package/dist/common-CvPVD1o6.d.ts.map +0 -1
  66. package/dist/core/webhook/frameworks/express.d.ts +0 -20
  67. package/dist/core/webhook/frameworks/express.js +0 -1
  68. package/dist/core/webhook/frameworks/nextjs-app.d.ts +0 -45
  69. package/dist/core/webhook/frameworks/nextjs-app.d.ts.map +0 -1
  70. package/dist/core/webhook/frameworks/nextjs-app.js +0 -2
  71. package/dist/core/webhook/frameworks/nextjs-app.js.map +0 -1
  72. package/dist/core/webhook/frameworks/nextjs.d.ts +0 -20
  73. package/dist/core/webhook/frameworks/nextjs.js +0 -1
  74. package/dist/core/webhook/index.d.ts +0 -20
  75. package/dist/core/webhook/index.js +0 -1
  76. package/dist/core/whatsapp/index.d.ts +0 -18
  77. package/dist/core/whatsapp/index.js +0 -1
  78. package/dist/encryption-Cwc0xcVL.js +0 -2
  79. package/dist/encryption-Cwc0xcVL.js.map +0 -1
  80. package/dist/enums-CSUpFXb8.js +0 -2
  81. package/dist/enums-CSUpFXb8.js.map +0 -1
  82. package/dist/express-B6fQdflY.d.ts +0 -78
  83. package/dist/express-B6fQdflY.d.ts.map +0 -1
  84. package/dist/express-CrfNLYMM.js +0 -2
  85. package/dist/express-CrfNLYMM.js.map +0 -1
  86. package/dist/flow-CVes0Qus.js +0 -2
  87. package/dist/flow-CVes0Qus.js.map +0 -1
  88. package/dist/flowTypeGuards-Gn3-slCW.js +0 -2
  89. package/dist/flowTypeGuards-Gn3-slCW.js.map +0 -1
  90. package/dist/handler-BGqjZ0xg.js +0 -2
  91. package/dist/handler-BGqjZ0xg.js.map +0 -1
  92. package/dist/index-3KglHVAg.d.ts +0 -354
  93. package/dist/index-3KglHVAg.d.ts.map +0 -1
  94. package/dist/index-BNeg6hHx.d.ts +0 -99
  95. package/dist/index-BNeg6hHx.d.ts.map +0 -1
  96. package/dist/index-BiTq23oi.d.ts +0 -34
  97. package/dist/index-BiTq23oi.d.ts.map +0 -1
  98. package/dist/index-BmfnREgM.d.ts +0 -47
  99. package/dist/index-BmfnREgM.d.ts.map +0 -1
  100. package/dist/index-CaGffSja.d.ts +0 -24
  101. package/dist/index-CaGffSja.d.ts.map +0 -1
  102. package/dist/index-CeTmbIXi.d.ts +0 -180
  103. package/dist/index-CeTmbIXi.d.ts.map +0 -1
  104. package/dist/index-CoyByMuM.d.ts +0 -137
  105. package/dist/index-CoyByMuM.d.ts.map +0 -1
  106. package/dist/index-CwujtcvH.d.ts +0 -370
  107. package/dist/index-CwujtcvH.d.ts.map +0 -1
  108. package/dist/index-DQ7z58xp.d.ts +0 -104
  109. package/dist/index-DQ7z58xp.d.ts.map +0 -1
  110. package/dist/index-DQkgkiB6.d.ts.map +0 -1
  111. package/dist/index-LKrIp3Oo.d.ts +0 -1
  112. package/dist/index-_-06JPan.d.ts +0 -143
  113. package/dist/index-_-06JPan.d.ts.map +0 -1
  114. package/dist/index-a_YS40Iv.d.ts +0 -91
  115. package/dist/index-a_YS40Iv.d.ts.map +0 -1
  116. package/dist/index-d7TLqtYh.d.ts +0 -171
  117. package/dist/index-d7TLqtYh.d.ts.map +0 -1
  118. package/dist/isMetaError-B3AglYeY.d.ts +0 -66
  119. package/dist/isMetaError-B3AglYeY.d.ts.map +0 -1
  120. package/dist/media-Dw5OGzDD.js +0 -2
  121. package/dist/media-Dw5OGzDD.js.map +0 -1
  122. package/dist/messages-h5-NW8QO.js +0 -2
  123. package/dist/messages-h5-NW8QO.js.map +0 -1
  124. package/dist/nextjs-DxRCL4t3.js +0 -2
  125. package/dist/nextjs-DxRCL4t3.js.map +0 -1
  126. package/dist/objectToQueryString-CAHI0qTs.js +0 -2
  127. package/dist/objectToQueryString-CAHI0qTs.js.map +0 -1
  128. package/dist/phone-CZyWLyWB.js +0 -2
  129. package/dist/phone-CZyWLyWB.js.map +0 -1
  130. package/dist/profile-Bb7GDP0n.js +0 -2
  131. package/dist/profile-Bb7GDP0n.js.map +0 -1
  132. package/dist/qrCode-CeZEtX9J.js +0 -2
  133. package/dist/qrCode-CeZEtX9J.js.map +0 -1
  134. package/dist/registration-BkjhC3xw.js +0 -2
  135. package/dist/registration-BkjhC3xw.js.map +0 -1
  136. package/dist/template-Bgy-BCXJ.js +0 -2
  137. package/dist/template-Bgy-BCXJ.js.map +0 -1
  138. package/dist/twoStepVerification-DYlYF_P5.js +0 -2
  139. package/dist/twoStepVerification-DYlYF_P5.js.map +0 -1
  140. package/dist/types/index.d.ts +0 -3
  141. package/dist/types/index.js +0 -1
  142. package/dist/utils/index.d.ts +0 -43
  143. package/dist/utils/index.d.ts.map +0 -1
  144. package/dist/utils/index.js +0 -1
  145. package/dist/version-BUuqrHc6.js +0 -3
  146. package/dist/version-BUuqrHc6.js.map +0 -1
  147. package/dist/waba-SF2W3z2U.js +0 -2
  148. package/dist/waba-SF2W3z2U.js.map +0 -1
  149. package/dist/webhook-D4DQ01Xq.js +0 -2
  150. package/dist/webhook-D4DQ01Xq.js.map +0 -1
  151. package/dist/whatsapp-B85mxH5f.js +0 -10
  152. package/dist/whatsapp-B85mxH5f.js.map +0 -1
@@ -1,3 +0,0 @@
1
- import "../../base-CfDkvT1x.js";
2
- import { EncryptionApi, EncryptionClass, EncryptionPublicKeyResponse } from "../../index-CaGffSja.js";
3
- export { EncryptionApi, EncryptionApi as default, EncryptionClass, EncryptionPublicKeyResponse };
@@ -1 +0,0 @@
1
- import"../../enums-CSUpFXb8.js";import"../../base-D-cXu_lA.js";import{EncryptionApi as e,encryption_default as t}from"../../encryption-Cwc0xcVL.js";export{e as EncryptionApi,t as default};
@@ -1,5 +0,0 @@
1
- import "../../base-CfDkvT1x.js";
2
- import "../../index-DQkgkiB6.js";
3
- import { CreateFlowResponse, Flow, FlowActionEnum, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowEndpointRequest, FlowEndpointResponse, FlowMigrationResponse, FlowPreviewResponse, FlowStatusEnum, FlowType, FlowTypeEnum, FlowValidationError, FlowsListResponse, UpdateFlowResponse, ValidateFlowJsonResponse } from "../../common-CvPVD1o6.js";
4
- import { FlowApi } from "../../index-CoyByMuM.js";
5
- export { CreateFlowResponse, Flow, FlowActionEnum, FlowApi, FlowApi as default, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowEndpointRequest, FlowEndpointResponse, FlowMigrationResponse, FlowPreviewResponse, FlowStatusEnum, FlowType, FlowTypeEnum, FlowValidationError, FlowsListResponse, UpdateFlowResponse, ValidateFlowJsonResponse };
@@ -1 +0,0 @@
1
- import"../../enums-CSUpFXb8.js";import"../../base-D-cXu_lA.js";import{FlowApi as e,flow_default as t}from"../../flow-CVes0Qus.js";import{FlowTypeEnum as n}from"../../common-C6FXBDm7.js";export{e as FlowApi,n as FlowTypeEnum,t as default};
@@ -1,17 +0,0 @@
1
- import "../base-CfDkvT1x.js";
2
- import { EncryptionApi, EncryptionClass, EncryptionPublicKeyResponse } from "../index-CaGffSja.js";
3
- import "../index-DQkgkiB6.js";
4
- import { CreateFlowResponse, Flow, FlowActionEnum, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowEndpointRequest, FlowEndpointResponse, FlowMigrationResponse, FlowPreviewResponse, FlowStatusEnum, FlowType, FlowTypeEnum, FlowValidationError, FlowsListResponse, UpdateFlowResponse, ValidateFlowJsonResponse } from "../common-CvPVD1o6.js";
5
- import { FlowApi } from "../index-CoyByMuM.js";
6
- import { MediaApi, MediaClass, MediaResponse, MediasResponse, UploadMediaResponse } from "../index-a_YS40Iv.js";
7
- import { AudioMediaObject, ContactObject, DocumentMediaObject, ImageMediaObject, InteractiveObject, LocationObject, MessageRequestParams, MessageTemplateObject, MessagesResponse, ReactionParams, StatusParams, StickerMediaObject, TextMessageParams, TextObject, VideoMediaObject } from "../common-CVbsmD26.js";
8
- import { MessagesApi } from "../index-d7TLqtYh.js";
9
- import { AccountMode, CodeVerificationStatus, Cursors, HealthStatus, HealthStatusEntity, MessagingLimitTier, PhoneNumberApi, PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, PlatformType, QualityRating, QualityScore, RequestVerificationCodeRequest, Throughput, ThroughputLevel, TwoStepVerificationParams, VerifyCodeRequest } from "../index-_-06JPan.js";
10
- import { BusinessProfileApi, BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, CreateUploadSessionParams, GetUploadHandleParams, UpdateBusinessProfileRequest, UploadBusinessProfileResponse, UploadHandle, UploadMediaParams, UploadSession, UploadSessionResponse } from "../index-3KglHVAg.js";
11
- import { CreateQrCodeRequest, QrCodeApi, QrCodeClass, QrCodeResponse, QrCodesResponse, UpdateQrCodeRequest } from "../index-BNeg6hHx.js";
12
- import { RegistrationApi, RegistrationClass, RegistrationRequest } from "../index-BmfnREgM.js";
13
- import { TemplateApi, TemplateClass, TemplateDeleteParams, TemplateGetParams, TemplateRequestBody, TemplateResponse } from "../index-CwujtcvH.js";
14
- import { TwoStepVerificationApi, TwoStepVerificationClass, TwoStepVerificationRequest } from "../index-BiTq23oi.js";
15
- import { UpdateWabaSubscription, WABAClass, WabaAccount, WabaApi, WabaSubscriptions } from "../index-CeTmbIXi.js";
16
- import "../index-LKrIp3Oo.js";
17
- export { AccountMode, AudioMediaObject, BusinessProfileApi, BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, CodeVerificationStatus, ContactObject, CreateFlowResponse, CreateQrCodeRequest, CreateUploadSessionParams, Cursors, DocumentMediaObject, EncryptionApi, EncryptionClass, EncryptionPublicKeyResponse, Flow, FlowActionEnum, FlowApi, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowEndpointRequest, FlowEndpointResponse, FlowMigrationResponse, FlowPreviewResponse, FlowStatusEnum, FlowType, FlowTypeEnum, FlowValidationError, FlowsListResponse, GetUploadHandleParams, HealthStatus, HealthStatusEntity, ImageMediaObject, InteractiveObject, LocationObject, MediaApi, MediaClass, MediaResponse, MediasResponse, MessageRequestParams, MessageTemplateObject, MessagesApi, MessagesResponse, MessagingLimitTier, PhoneNumberApi, PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, PlatformType, QrCodeApi, QrCodeClass, QrCodeResponse, QrCodesResponse, QualityRating, QualityScore, ReactionParams, RegistrationApi, RegistrationClass, RegistrationRequest, RequestVerificationCodeRequest, StatusParams, StickerMediaObject, TemplateApi, TemplateClass, TemplateDeleteParams, TemplateGetParams, TemplateRequestBody, TemplateResponse, TextMessageParams, TextObject, Throughput, ThroughputLevel, TwoStepVerificationApi, TwoStepVerificationClass, TwoStepVerificationParams, TwoStepVerificationRequest, UpdateBusinessProfileRequest, UpdateFlowResponse, UpdateQrCodeRequest, UpdateWabaSubscription, UploadBusinessProfileResponse, UploadHandle, UploadMediaParams, UploadMediaResponse, UploadSession, UploadSessionResponse, ValidateFlowJsonResponse, VerifyCodeRequest, VideoMediaObject, WABAClass, WabaAccount, WabaApi, WabaSubscriptions };
package/dist/api/index.js DELETED
@@ -1 +0,0 @@
1
- import"../enums-CSUpFXb8.js";import"../base-D-cXu_lA.js";import{encryption_default as e}from"../encryption-Cwc0xcVL.js";import{flow_default as t}from"../flow-CVes0Qus.js";import"../common-C6FXBDm7.js";import{media_default as n}from"../media-Dw5OGzDD.js";import{messages_default as r}from"../messages-h5-NW8QO.js";import"../objectToQueryString-CAHI0qTs.js";import{phone_default as i}from"../phone-CZyWLyWB.js";import"../buildFieldsQueryString-Cr-jz3p0.js";import{profile_default as a}from"../profile-Bb7GDP0n.js";import{qrCode_default as o}from"../qrCode-CeZEtX9J.js";import{registration_default as s}from"../registration-BkjhC3xw.js";import{TemplateApi as c}from"../template-Bgy-BCXJ.js";import{twoStepVerification_default as l}from"../twoStepVerification-DYlYF_P5.js";import{waba_default as u}from"../waba-SF2W3z2U.js";import"../api-8hRAOyaL.js";export{a as BusinessProfileApi,e as EncryptionApi,t as FlowApi,n as MediaApi,r as MessagesApi,i as PhoneNumberApi,o as QrCodeApi,s as RegistrationApi,c as TemplateApi,l as TwoStepVerificationApi,u as WabaApi};
@@ -1,3 +0,0 @@
1
- import "../../base-CfDkvT1x.js";
2
- import { MediaApi, MediaClass, MediaResponse, MediasResponse, UploadMediaResponse } from "../../index-a_YS40Iv.js";
3
- export { MediaApi, MediaApi as default, MediaClass, MediaResponse, MediasResponse, UploadMediaResponse };
@@ -1 +0,0 @@
1
- import"../../enums-CSUpFXb8.js";import"../../base-D-cXu_lA.js";import{MediaApi as e,media_default as t}from"../../media-Dw5OGzDD.js";export{e as MediaApi,t as default};
@@ -1,539 +0,0 @@
1
- import { ComponentTypesEnum, CurrencyCodesEnum, InteractiveTypesEnum, ParametersTypesEnum } from "../../../base-CfDkvT1x.js";
2
- import { AddressesObject, AudioMediaObject, ContactObject, DocumentMediaObject, ImageMediaObject, InteractiveObject, LocationObject, MessageTemplateObject, NameObject, StickerMediaObject, TextObject, VideoMediaObject } from "../../../common-CVbsmD26.js";
3
-
4
- //#region src/api/messages/builders/ContactMessageBuilder.d.ts
5
- /**
6
- * Builder class for creating contact messages with a fluent API
7
- */
8
- declare class ContactMessageBuilder {
9
- private contact;
10
- /**
11
- * Set the contact name (required)
12
- */
13
- setName(name: NameObject): this;
14
- /**
15
- * Set simple name with first name only
16
- */
17
- setSimpleName(firstName: string, lastName?: string): this;
18
- /**
19
- * Set full name details
20
- */
21
- setFullName(firstName: string, lastName?: string, middleName?: string, suffix?: string, prefix?: string): this;
22
- /**
23
- * Add phone numbers
24
- */
25
- addPhone(phone: string, type?: string, waId?: string): this;
26
- /**
27
- * Add email addresses
28
- */
29
- addEmail(email: string, type?: string): this;
30
- /**
31
- * Add address
32
- */
33
- addAddress(address: AddressesObject): this;
34
- /**
35
- * Add simple address
36
- */
37
- addSimpleAddress(street: string, city: string, country: string, type?: string): this;
38
- /**
39
- * Set organization details
40
- */
41
- setOrganization(company: string, department?: string, title?: string): this;
42
- /**
43
- * Add URL
44
- */
45
- addUrl(url: string, type?: string): this;
46
- /**
47
- * Set birthday (format: YYYY-MM-DD)
48
- */
49
- setBirthday(year: number, month: number, day: number): this;
50
- /**
51
- * Build the final contact object
52
- */
53
- build(): ContactObject;
54
- /**
55
- * Reset the builder for reuse
56
- */
57
- reset(): this;
58
- }
59
- /**
60
- * Factory class for common contact patterns
61
- */
62
- declare class ContactMessageFactory {
63
- /**
64
- * Create a simple contact with name and phone
65
- */
66
- static createSimpleContact(firstName: string, phone: string): ContactObject;
67
- /**
68
- * Create a business contact
69
- */
70
- static createBusinessContact(firstName: string, lastName: string, company: string, title: string, phone: string, email: string): ContactObject;
71
- /**
72
- * Create a personal contact with full details
73
- */
74
- static createPersonalContact(firstName: string, lastName: string, mobilePhone: string, email?: string, birthday?: {
75
- year: number;
76
- month: number;
77
- day: number;
78
- }): ContactObject;
79
- }
80
- //#endregion
81
- //#region src/api/messages/builders/InteractiveMessageBuilder.d.ts
82
- /**
83
- * Builder class for creating interactive messages with a fluent API
84
- */
85
- declare class InteractiveMessageBuilder {
86
- private message;
87
- /**
88
- * Set the interactive message type
89
- */
90
- setType(type: InteractiveTypesEnum): this;
91
- /**
92
- * Set the body text of the message
93
- */
94
- setBody(text: string): this;
95
- /**
96
- * Set the footer text of the message
97
- */
98
- setFooter(text: string): this;
99
- /**
100
- * Set a text header
101
- */
102
- setTextHeader(text: string): this;
103
- /**
104
- * Set an image header
105
- */
106
- setImageHeader(imageUrl: string): this;
107
- /**
108
- * Add reply buttons (for button type messages)
109
- */
110
- addReplyButtons(buttons: Array<{
111
- id: string;
112
- title: string;
113
- }>): this;
114
- /**
115
- * Add list sections (for list type messages)
116
- * Note: This creates a single section with multiple rows
117
- */
118
- addListSections(sections: Array<{
119
- title?: string;
120
- rows: Array<{
121
- id: string;
122
- title: string;
123
- description?: string;
124
- }>;
125
- }>): this;
126
- /**
127
- * Set the button text for list messages
128
- */
129
- setListButtonText(buttonText: string): this;
130
- /**
131
- * Set CTA URL action
132
- */
133
- setCTAUrl(displayText: string, url: string): this;
134
- /**
135
- * Build the final interactive object
136
- */
137
- build(): InteractiveObject;
138
- /**
139
- * Reset the builder for reuse
140
- */
141
- reset(): this;
142
- }
143
- /**
144
- * Convenience factory functions for common interactive message types
145
- */
146
- declare class InteractiveMessageFactory {
147
- /**
148
- * Create a button message with reply buttons
149
- */
150
- static createButtonMessage(bodyText: string, buttons: Array<{
151
- id: string;
152
- title: string;
153
- }>, options?: {
154
- headerText?: string;
155
- footerText?: string;
156
- }): InteractiveObject;
157
- /**
158
- * Create a list message with sections
159
- */
160
- static createListMessage(bodyText: string, buttonText: string, sections: Array<{
161
- title?: string;
162
- rows: Array<{
163
- id: string;
164
- title: string;
165
- description?: string;
166
- }>;
167
- }>, options?: {
168
- headerText?: string;
169
- footerText?: string;
170
- }): InteractiveObject;
171
- /**
172
- * Create a CTA URL message
173
- */
174
- static createCTAUrlMessage(bodyText: string, displayText: string, url: string, options?: {
175
- headerText?: string;
176
- footerText?: string;
177
- }): InteractiveObject;
178
- }
179
- //#endregion
180
- //#region src/api/messages/builders/LocationMessageBuilder.d.ts
181
- /**
182
- * Builder class for creating location messages with a fluent API
183
- */
184
- declare class LocationMessageBuilder {
185
- private location;
186
- /**
187
- * Set the latitude coordinate
188
- */
189
- setLatitude(latitude: number): this;
190
- /**
191
- * Set the longitude coordinate
192
- */
193
- setLongitude(longitude: number): this;
194
- /**
195
- * Set coordinates using latitude and longitude
196
- */
197
- setCoordinates(latitude: number, longitude: number): this;
198
- /**
199
- * Set the location name
200
- */
201
- setName(name: string): this;
202
- /**
203
- * Set the location address
204
- */
205
- setAddress(address: string): this;
206
- /**
207
- * Build the final location object
208
- */
209
- build(): LocationObject;
210
- /**
211
- * Reset the builder for reuse
212
- */
213
- reset(): this;
214
- }
215
- /**
216
- * Factory class for common location patterns
217
- */
218
- declare class LocationMessageFactory {
219
- /**
220
- * Create a simple location with just coordinates
221
- */
222
- static createSimpleLocation(latitude: number, longitude: number): LocationObject;
223
- /**
224
- * Create a location with name and address
225
- */
226
- static createNamedLocation(latitude: number, longitude: number, name: string, address: string): LocationObject;
227
- /**
228
- * Create a business location
229
- */
230
- static createBusinessLocation(latitude: number, longitude: number, businessName: string, fullAddress: string): LocationObject;
231
- }
232
- //#endregion
233
- //#region src/api/messages/builders/MediaMessageBuilder.d.ts
234
- /**
235
- * Base builder for media messages
236
- */
237
- declare abstract class BaseMediaBuilder<T> {
238
- protected media: Partial<T>;
239
- /**
240
- * Set media ID (for uploaded media)
241
- */
242
- setId(id: string): this;
243
- /**
244
- * Set media URL
245
- */
246
- setLink(url: string): this;
247
- /**
248
- * Set media caption
249
- */
250
- setCaption(caption: string): this;
251
- /**
252
- * Build the media object
253
- */
254
- build(): T;
255
- /**
256
- * Reset the builder
257
- */
258
- reset(): this;
259
- }
260
- /**
261
- * Builder for image messages
262
- */
263
- declare class ImageMessageBuilder extends BaseMediaBuilder<ImageMediaObject> {}
264
- /**
265
- * Builder for video messages
266
- */
267
- declare class VideoMessageBuilder extends BaseMediaBuilder<VideoMediaObject> {}
268
- /**
269
- * Builder for audio messages
270
- */
271
- declare class AudioMessageBuilder extends BaseMediaBuilder<AudioMediaObject> {
272
- setCaption(caption: string): this;
273
- }
274
- /**
275
- * Builder for document messages
276
- */
277
- declare class DocumentMessageBuilder extends BaseMediaBuilder<DocumentMediaObject> {
278
- /**
279
- * Set document filename
280
- */
281
- setFilename(filename: string): this;
282
- }
283
- /**
284
- * Builder for sticker messages
285
- */
286
- declare class StickerMessageBuilder extends BaseMediaBuilder<StickerMediaObject> {
287
- setCaption(caption: string): this;
288
- }
289
- /**
290
- * Factory class for common media patterns
291
- */
292
- declare class MediaMessageFactory {
293
- /**
294
- * Create an image with caption
295
- */
296
- static createImageWithCaption(linkOrId: string, caption: string, isId?: boolean): ImageMediaObject;
297
- /**
298
- * Create a video with caption
299
- */
300
- static createVideoWithCaption(linkOrId: string, caption: string, isId?: boolean): VideoMediaObject;
301
- /**
302
- * Create a document with filename
303
- */
304
- static createDocument(linkOrId: string, filename: string, caption?: string, isId?: boolean): DocumentMediaObject;
305
- /**
306
- * Create an audio message
307
- */
308
- static createAudio(linkOrId: string, isId?: boolean): AudioMediaObject;
309
- /**
310
- * Create a sticker message
311
- */
312
- static createSticker(linkOrId: string, isId?: boolean): StickerMediaObject;
313
- }
314
- //#endregion
315
- //#region src/api/messages/builders/ReactionMessageBuilder.d.ts
316
- /**
317
- * Builder class for creating reaction messages with a fluent API
318
- */
319
- declare class ReactionMessageBuilder {
320
- private reaction;
321
- /**
322
- * Set the message ID to react to
323
- */
324
- setMessageId(messageId: string): this;
325
- /**
326
- * Set the emoji for the reaction
327
- */
328
- setEmoji(emoji: string): this;
329
- /**
330
- * Remove a reaction (by sending empty emoji)
331
- */
332
- removeReaction(): this;
333
- /**
334
- * Build the final reaction object
335
- */
336
- build(): {
337
- message_id: string;
338
- emoji: string;
339
- };
340
- /**
341
- * Reset the builder for reuse
342
- */
343
- reset(): this;
344
- }
345
- /**
346
- * Factory class for common reaction patterns
347
- */
348
- declare class ReactionMessageFactory {
349
- /**
350
- * Create a like reaction
351
- */
352
- static createLike(messageId: string): {
353
- message_id: string;
354
- emoji: string;
355
- };
356
- /**
357
- * Create a heart reaction
358
- */
359
- static createHeart(messageId: string): {
360
- message_id: string;
361
- emoji: string;
362
- };
363
- /**
364
- * Create a laughing reaction
365
- */
366
- static createLaugh(messageId: string): {
367
- message_id: string;
368
- emoji: string;
369
- };
370
- /**
371
- * Create a wow reaction
372
- */
373
- static createWow(messageId: string): {
374
- message_id: string;
375
- emoji: string;
376
- };
377
- /**
378
- * Create a sad reaction
379
- */
380
- static createSad(messageId: string): {
381
- message_id: string;
382
- emoji: string;
383
- };
384
- /**
385
- * Create an angry reaction
386
- */
387
- static createAngry(messageId: string): {
388
- message_id: string;
389
- emoji: string;
390
- };
391
- /**
392
- * Remove a reaction
393
- */
394
- static removeReaction(messageId: string): {
395
- message_id: string;
396
- emoji: string;
397
- };
398
- }
399
- //#endregion
400
- //#region src/api/messages/builders/TemplateMessageBuilder.d.ts
401
- type CurrencyParameterHelper = {
402
- type: ParametersTypesEnum.Currency;
403
- currency: {
404
- fallback_value: string;
405
- code: CurrencyCodesEnum;
406
- amount_1000: number;
407
- };
408
- };
409
- type DateTimeParameterHelper = {
410
- type: ParametersTypesEnum.DateTime;
411
- date_time: {
412
- fallback_value: string;
413
- timestamp: number;
414
- };
415
- };
416
- /**
417
- * Builder class for creating template messages with a fluent API
418
- */
419
- declare class TemplateMessageBuilder {
420
- private template;
421
- /**
422
- * Set the template name
423
- */
424
- setName(name: string): this;
425
- /**
426
- * Set the template language
427
- */
428
- setLanguage(code: string): this;
429
- /**
430
- * Add a header component with text parameters
431
- */
432
- addTextHeader(parameters: string[]): this;
433
- /**
434
- * Add a header component with image
435
- */
436
- addImageHeader(imageUrl: string): this;
437
- /**
438
- * Add a body component with text parameters
439
- */
440
- addBody(parameters: string[]): this;
441
- /**
442
- * Add a footer component (usually no parameters needed)
443
- */
444
- addFooter(): this;
445
- /**
446
- * Add button components (for quick replies, URLs, etc.)
447
- */
448
- addButtons(buttons: Array<{
449
- index: number;
450
- type: 'quick_reply' | 'url';
451
- parameters?: string[];
452
- }>): this;
453
- /**
454
- * Add a currency parameter for header/body
455
- */
456
- addCurrencyParameter(fallbackValue: string, currencyCode: string, amount: number): CurrencyParameterHelper;
457
- /**
458
- * Add a date time parameter
459
- */
460
- addDateTimeParameter(fallbackValue: string, timestamp: number): DateTimeParameterHelper;
461
- /**
462
- * Build the final template object
463
- */
464
- build(): MessageTemplateObject<ComponentTypesEnum>;
465
- /**
466
- * Reset the builder for reuse
467
- */
468
- reset(): this;
469
- }
470
- /**
471
- * Factory class for common template patterns
472
- */
473
- declare class TemplateMessageFactory {
474
- /**
475
- * Create a simple text-only template
476
- */
477
- static createSimpleTextTemplate(name: string, language: string, bodyParameters: string[]): MessageTemplateObject<ComponentTypesEnum>;
478
- /**
479
- * Create a template with header, body and buttons
480
- */
481
- static createCompleteTemplate(name: string, language: string, options: {
482
- headerParameters?: string[];
483
- headerImage?: string;
484
- bodyParameters: string[];
485
- buttons?: Array<{
486
- index: number;
487
- type: 'quick_reply' | 'url';
488
- parameters?: string[];
489
- }>;
490
- }): MessageTemplateObject<ComponentTypesEnum>;
491
- /**
492
- * Create an order confirmation template
493
- */
494
- static createOrderConfirmationTemplate(language: string, customerName: string, orderNumber: string, amount: number, currencyCode: string): MessageTemplateObject<ComponentTypesEnum>;
495
- }
496
- //#endregion
497
- //#region src/api/messages/builders/TextMessageBuilder.d.ts
498
- /**
499
- * Builder class for creating text messages with a fluent API
500
- */
501
- declare class TextMessageBuilder {
502
- private textMessage;
503
- /**
504
- * Set the message body text
505
- */
506
- setBody(text: string): this;
507
- /**
508
- * Enable or disable URL preview
509
- */
510
- setPreviewUrl(enable?: boolean): this;
511
- /**
512
- * Build the final text object
513
- */
514
- build(): TextObject;
515
- /**
516
- * Reset the builder for reuse
517
- */
518
- reset(): this;
519
- }
520
- /**
521
- * Factory class for common text message patterns
522
- */
523
- declare class TextMessageFactory {
524
- /**
525
- * Create a simple text message
526
- */
527
- static createSimpleText(body: string): TextObject;
528
- /**
529
- * Create a text message with URL preview
530
- */
531
- static createTextWithPreview(body: string): TextObject;
532
- /**
533
- * Create a notification message
534
- */
535
- static createNotification(title: string, message: string): TextObject;
536
- }
537
- //#endregion
538
- export { AudioMessageBuilder, ContactMessageBuilder, ContactMessageFactory, DocumentMessageBuilder, ImageMessageBuilder, InteractiveMessageBuilder, InteractiveMessageFactory, LocationMessageBuilder, LocationMessageFactory, MediaMessageFactory, ReactionMessageBuilder, ReactionMessageFactory, StickerMessageBuilder, TemplateMessageBuilder, TemplateMessageFactory, TextMessageBuilder, TextMessageFactory, VideoMessageBuilder };
539
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/api/messages/builders/ContactMessageBuilder.ts","../../../../src/api/messages/builders/InteractiveMessageBuilder.ts","../../../../src/api/messages/builders/LocationMessageBuilder.ts","../../../../src/api/messages/builders/MediaMessageBuilder.ts","../../../../src/api/messages/builders/ReactionMessageBuilder.ts","../../../../src/api/messages/builders/TemplateMessageBuilder.ts","../../../../src/api/messages/builders/TextMessageBuilder.ts"],"sourcesContent":[],"mappings":";;;;;;;AAaa,cAAA,qBAAA,CAAqB;EAAA,QAAA,OAAA;;;;EAqKR,OAAA,CAAA,IAAA,EA/JR,UA+JQ,CAAA,EAAA,IAAA;EAoBb;;;eAkBN,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;;;;;AC1KP;;UAMkB,CAAA,KAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;;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AAA,EAAA;IAkBtF,gBAAA,CAAA,EAAA,MAAA,EAAA;IAiB0D,WAAA,CAAA,EAAA,MAAA;IAaE,cAAA,EAAA,MAAA,EAAA;IAAkB,OAAA,CAAA,EEoI/D,KFpI+D,CAAA;;;;ICxLxE,CAAA,CAAA;EA+DA,CAAA,CAAA,ECmQN,qBDnQ4B,CCmQN,kBDnQM,CAAA;;;;ECvDvB,OAAA,+BAAuB,CAAA,QAAA,EAAA,MAAA,EAAA,YAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,YAAA,EAAA,MAAA,CAAA,EA0V5B,qBA1V4B,CA0VN,kBA1VM,CAAA;;;;;;;ALEtB,cMRA,kBAAA,CNQqB;EAAA,QAAA,WAAA;;;;EAqKR,OAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,IAAA;EAoBb;;;eAkBN,CAAA,MAAA,CAAA,EAAA,OAAA,CAAA,EAAA,IAAA;;;;WM1LM;;ALgBb;;OAMkB,CAAA,CAAA,EAAA,IAAA;;;;;AA0HY,cK5HjB,kBAAA,CL4HiB;EA0BjB;;;SAQN,gBAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EK1JoC,UL0JpC;;;;SA2DA,qBAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EK9MyC,UL8MzC;EAAiB;;;6DKvMuC;AJ/D/D"}
@@ -1,2 +0,0 @@
1
- import{ButtonPositionEnum as e,ComponentTypesEnum as t,InteractiveTypesEnum as n,LanguagesEnum as r,ParametersTypesEnum as i,SubTypeEnum as a}from"../../../enums-CSUpFXb8.js";var o=class{contact={};setName(e){if(!e||typeof e!=`object`)throw Error(`Name must be an object`);return this.contact.name=e,this}setSimpleName(e,t){if(!e||typeof e!=`string`)throw Error(`First name must be a non-empty string`);let n={formatted_name:t?`${e} ${t}`:e,first_name:e};return t&&(n.last_name=t),this.setName(n)}setFullName(e,t,n,r,i){if(!e||typeof e!=`string`)throw Error(`First name must be a non-empty string`);let a={formatted_name:[i,e,n,t,r].filter(Boolean).join(` `),first_name:e};return t&&(a.last_name=t),n&&(a.middle_name=n),r&&(a.suffix=r),i&&(a.prefix=i),this.setName(a)}addPhone(e,t,n){if(!e||typeof e!=`string`)throw Error(`Phone number must be a non-empty string`);let r={phone:`PHONE_NUMBER`};return t&&(r.type=t),n&&(r.wa_id=n),this.contact.phones||(this.contact.phones=[]),this.contact.phones.push(r),this}addEmail(e,t){if(!e||typeof e!=`string`)throw Error(`Email must be a non-empty string`);if(!e.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/))throw Error(`Invalid email format`);let n={email:e};return t&&(n.type=t),this.contact.emails||(this.contact.emails=[]),this.contact.emails.push(n),this}addAddress(e){if(!e||typeof e!=`object`)throw Error(`Address must be an object`);return this.contact.addresses||(this.contact.addresses=[]),this.contact.addresses.push(e),this}addSimpleAddress(e,t,n,r){let i={street:e,city:t,country:n};return r&&(i.type=r),this.addAddress(i)}setOrganization(e,t,n){let r={};return e&&(r.company=e),t&&(r.department=t),n&&(r.title=n),this.contact.org=r,this}addUrl(e,t){if(!e||typeof e!=`string`)throw Error(`URL must be a non-empty string`);let n={url:e};return t&&(n.type=t),this.contact.urls||(this.contact.urls=[]),this.contact.urls.push(n),this}setBirthday(e,t,n){let r=t.toString().padStart(2,`0`),i=n.toString().padStart(2,`0`);return this.contact.birthday=`${e}-${r}-${i}`,this}build(){if(!this.contact.name)throw Error(`Contact name is required`);return this.contact}reset(){return this.contact={},this}},s=class{static createSimpleContact(e,t){return new o().setSimpleName(e).addPhone(t).build()}static createBusinessContact(e,t,n,r,i,a){return new o().setSimpleName(e,t).setOrganization(n,void 0,r).addPhone(i,`WORK`).addEmail(a,`WORK`).build()}static createPersonalContact(e,t,n,r,i){let a=new o().setSimpleName(e,t).addPhone(n,`MOBILE`);return r&&a.addEmail(r,`HOME`),i&&a.setBirthday(i.year,i.month,i.day),a.build()}};function c(e){return!(`name`in e)}var l=class{message={};setType(e){return this.message.type=e,this}setBody(e){return this.message.body={text:e},this}setFooter(e){return this.message.footer={text:e},this}setTextHeader(e){return this.message.header={type:`text`,text:e},this}setImageHeader(e){return this.message.header={type:`image`,image:{link:e}},this}addReplyButtons(e){this.message.action||(this.message.action={});let t=this.message.action;return c(t)&&(t.buttons=e.map(e=>({type:`reply`,reply:{id:e.id,title:e.title}}))),this}addListSections(e){this.message.action||(this.message.action={});let t=this.message.action;return c(t)&&(t.sections=e.map(e=>({title:e.title,rows:e.rows}))),this}setListButtonText(e){this.message.action||(this.message.action={});let t=this.message.action;return c(t)&&(t.button=e),this}setCTAUrl(e,t){return this.message.action={name:`cta_url`,parameters:{display_text:e,url:t}},this}build(){if(!this.message.type)throw Error(`Interactive message type is required`);if(!this.message.body)throw Error(`Interactive message body is required`);if(!this.message.action)throw Error(`Interactive message action is required`);return this.message}reset(){return this.message={},this}},u=class{static createButtonMessage(e,t,r){let i=new l().setType(n.Button).setBody(e).addReplyButtons(t);return r?.headerText&&i.setTextHeader(r.headerText),r?.footerText&&i.setFooter(r.footerText),i.build()}static createListMessage(e,t,r,i){let a=new l().setType(n.List).setBody(e).addListSections(r);i?.headerText&&a.setTextHeader(i.headerText),i?.footerText&&a.setFooter(i.footerText);let o=a.build(),s=o.action;return c(s)&&(s.button=t),o}static createCTAUrlMessage(e,t,r,i){let a=new l().setType(n.CtaUrl).setBody(e).setCTAUrl(t,r);return i?.headerText&&a.setTextHeader(i.headerText),i?.footerText&&a.setFooter(i.footerText),a.build()}},d=class{location={};setLatitude(e){if(typeof e!=`number`||e<-90||e>90)throw Error(`Latitude must be a number between -90 and 90`);return this.location.latitude=e,this}setLongitude(e){if(typeof e!=`number`||e<-180||e>180)throw Error(`Longitude must be a number between -180 and 180`);return this.location.longitude=e,this}setCoordinates(e,t){return this.setLatitude(e).setLongitude(t)}setName(e){if(e&&typeof e!=`string`)throw Error(`Location name must be a string`);return this.location.name=e,this}setAddress(e){if(e&&typeof e!=`string`)throw Error(`Location address must be a string`);return this.location.address=e,this}build(){if(this.location.latitude===void 0)throw Error(`Latitude is required`);if(this.location.longitude===void 0)throw Error(`Longitude is required`);return this.location}reset(){return this.location={},this}},f=class{static createSimpleLocation(e,t){return new d().setCoordinates(e,t).build()}static createNamedLocation(e,t,n,r){return new d().setCoordinates(e,t).setName(n).setAddress(r).build()}static createBusinessLocation(e,t,n,r){return new d().setCoordinates(e,t).setName(n).setAddress(r).build()}},p=class{media={};setId(e){if(!e||typeof e!=`string`)throw Error(`Media ID must be a non-empty string`);return this.media.id=e,this}setLink(e){if(!e||typeof e!=`string`)throw Error(`Media URL must be a non-empty string`);if(!e.match(/^https?:\/\//))throw Error(`Media URL must be a valid HTTP/HTTPS URL`);return this.media.link=e,this}setCaption(e){if(e&&typeof e!=`string`)throw Error(`Caption must be a string`);return this.media.caption=e,this}build(){if(!this.media.id&&!this.media.link)throw Error(`Either media ID or link is required`);return this.media}reset(){return this.media={},this}},m=class extends p{},h=class extends p{},g=class extends p{setCaption(e){throw Error(`Audio messages do not support captions`)}},_=class extends p{setFilename(e){if(!e||typeof e!=`string`)throw Error(`Filename must be a non-empty string`);return this.media.filename=e,this}},v=class extends p{setCaption(e){throw Error(`Sticker messages do not support captions`)}},y=class{static createImageWithCaption(e,t,n=!1){let r=new m;return n?r.setId(e):r.setLink(e),r.setCaption(t).build()}static createVideoWithCaption(e,t,n=!1){let r=new h;return n?r.setId(e):r.setLink(e),r.setCaption(t).build()}static createDocument(e,t,n,r=!1){let i=new _;return r?i.setId(e):i.setLink(e),i.setFilename(t),n&&i.setCaption(n),i.build()}static createAudio(e,t=!1){let n=new g;return t?n.setId(e):n.setLink(e),n.build()}static createSticker(e,t=!1){let n=new v;return t?n.setId(e):n.setLink(e),n.build()}},b=class{reaction={};setMessageId(e){if(!e||typeof e!=`string`)throw Error(`Message ID must be a non-empty string`);return this.reaction.message_id=e,this}setEmoji(e){if(!e||typeof e!=`string`)throw Error(`Emoji must be a non-empty string`);if(e.length>4)throw Error(`Please provide a single emoji character`);return this.reaction.emoji=e,this}removeReaction(){return this.reaction.emoji=``,this}build(){if(!this.reaction.message_id)throw Error(`Message ID is required`);if(this.reaction.emoji===void 0)throw Error(`Emoji is required (use empty string to remove reaction)`);return this.reaction}reset(){return this.reaction={},this}},x=class{static createLike(e){return new b().setMessageId(e).setEmoji(`👍`).build()}static createHeart(e){return new b().setMessageId(e).setEmoji(`❤️`).build()}static createLaugh(e){return new b().setMessageId(e).setEmoji(`😂`).build()}static createWow(e){return new b().setMessageId(e).setEmoji(`😮`).build()}static createSad(e){return new b().setMessageId(e).setEmoji(`😢`).build()}static createAngry(e){return new b().setMessageId(e).setEmoji(`😠`).build()}static removeReaction(e){return new b().setMessageId(e).removeReaction().build()}};function S(e){return Object.values(r).includes(e)}function C(t){return Object.values(e).includes(t)}var w=class{template={components:[]};setName(e){if(!e||e.trim().length===0)throw Error(`Template name cannot be empty`);return this.template.name=e,this}setLanguage(e){if(!S(e))throw Error(`Invalid language code: ${e}. Must be a valid LanguagesEnum value.`);return this.template.language={policy:`deterministic`,code:e},this}addTextHeader(e){if(!Array.isArray(e))throw Error(`Parameters must be an array`);let n={type:t.Header,parameters:e.map(e=>{if(typeof e!=`string`)throw Error(`All parameters must be strings`);return{type:i.Text,text:e}})};return this.template.components||(this.template.components=[]),this.template.components.push(n),this}addImageHeader(e){if(!e||typeof e!=`string`)throw Error(`Image URL must be a non-empty string`);let n={type:t.Header,parameters:[{type:i.Image,image:{link:e}}]};return this.template.components||(this.template.components=[]),this.template.components.push(n),this}addBody(e){if(!Array.isArray(e))throw Error(`Parameters must be an array`);let n={type:t.Body,parameters:e.map(e=>{if(typeof e!=`string`)throw Error(`All parameters must be strings`);return{type:i.Text,text:e}})};return this.template.components||(this.template.components=[]),this.template.components.push(n),this}addFooter(){let e={type:t.Footer};return this.template.components||(this.template.components=[]),this.template.components.push(e),this}addButtons(e){if(!Array.isArray(e))throw Error(`Buttons must be an array`);return e.forEach(e=>{if(typeof e.index!=`number`||!C(e.index))throw Error(`Button index must be a valid ButtonPositionEnum value: ${e.index}`);let n=e.type===`quick_reply`?a.QuickReply:a.Url,r={type:t.Button,sub_type:n,index:e.index};if(e.parameters&&e.parameters.length>0){if(!Array.isArray(e.parameters))throw Error(`Button parameters must be an array`);e.type===`quick_reply`?r.parameters=e.parameters.map(e=>{if(typeof e!=`string`)throw Error(`All button parameters must be strings`);return{type:i.Payload,payload:e}}):e.type===`url`&&(r.parameters=e.parameters.map(e=>{if(typeof e!=`string`)throw Error(`All button parameters must be strings`);return{type:i.Text,text:e}}))}this.template.components||(this.template.components=[]),this.template.components.push(r)}),this}addCurrencyParameter(e,t,n){if(!e||typeof e!=`string`)throw Error(`Fallback value must be a non-empty string`);if(!t||typeof t!=`string`)throw Error(`Currency code must be a non-empty string`);if(typeof n!=`number`||n<0)throw Error(`Amount must be a non-negative number`);return{type:i.Currency,currency:{fallback_value:e,code:t,amount_1000:n*1e3}}}addDateTimeParameter(e,t){if(!e||typeof e!=`string`)throw Error(`Fallback value must be a non-empty string`);if(typeof t!=`number`||t<=0)throw Error(`Timestamp must be a positive number`);return{type:i.DateTime,date_time:{fallback_value:e,timestamp:t}}}build(){if(!this.template.name)throw Error(`Template name is required`);if(!this.template.language)throw Error(`Template language is required`);return this.template}reset(){return this.template={components:[]},this}},T=class{static createSimpleTextTemplate(e,t,n){if(!e||!t||!Array.isArray(n))throw Error(`Invalid parameters for simple text template`);return new w().setName(e).setLanguage(t).addBody(n).build()}static createCompleteTemplate(e,t,n){if(!e||!t||!n.bodyParameters)throw Error(`Invalid parameters for complete template`);let r=new w().setName(e).setLanguage(t).addBody(n.bodyParameters);return n.headerParameters?r.addTextHeader(n.headerParameters):n.headerImage&&r.addImageHeader(n.headerImage),n.buttons&&r.addButtons(n.buttons),r.build()}static createOrderConfirmationTemplate(e,t,n,r,i){if(!e||!t||!n||typeof r!=`number`||!i)throw Error(`Invalid parameters for order confirmation template`);return new w().setName(`order_confirmation`).setLanguage(e).addBody([t,n,r.toString(),i]).addButtons([{index:0,type:`quick_reply`},{index:1,type:`url`,parameters:[n]}]).build()}},E=class{textMessage={};setBody(e){if(!e||typeof e!=`string`)throw Error(`Message body must be a non-empty string`);return this.textMessage.body=e,this}setPreviewUrl(e=!0){return this.textMessage.preview_url=e,this}build(){if(!this.textMessage.body)throw Error(`Message body is required`);return this.textMessage}reset(){return this.textMessage={},this}},D=class{static createSimpleText(e){return new E().setBody(e).build()}static createTextWithPreview(e){return new E().setBody(e).setPreviewUrl(!0).build()}static createNotification(e,t){return new E().setBody(`*${e}*\n\n${t}`).build()}};export{g as AudioMessageBuilder,o as ContactMessageBuilder,s as ContactMessageFactory,_ as DocumentMessageBuilder,m as ImageMessageBuilder,l as InteractiveMessageBuilder,u as InteractiveMessageFactory,d as LocationMessageBuilder,f as LocationMessageFactory,y as MediaMessageFactory,b as ReactionMessageBuilder,x as ReactionMessageFactory,v as StickerMessageBuilder,w as TemplateMessageBuilder,T as TemplateMessageFactory,E as TextMessageBuilder,D as TextMessageFactory,h as VideoMessageBuilder};
2
- //# sourceMappingURL=index.js.map