meta-cloud-api 1.0.0 → 1.0.2
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/LICENSE +21 -0
- package/README.md +405 -0
- package/dist/BusinessProfileApi-WXscSgo-.d.ts +353 -0
- package/dist/EncryptionApi-D7pt-OXT.d.ts +22 -0
- package/dist/FlowApi-B2ffO-HD.d.ts +136 -0
- package/dist/MediaApi-BrEKpqi_.d.ts +90 -0
- package/dist/MessageApi-BgsSpDno.d.ts +171 -0
- package/dist/PhoneNumberApi-DKlu9PHl.d.ts +142 -0
- package/dist/QrCodeApi-7vDwIBHR.d.ts +98 -0
- package/dist/RegistrationApi-qO_qoti9.d.ts +47 -0
- package/dist/TemplateApi-xGgIZt89.d.ts +161 -0
- package/dist/TwoStepVerificationApi-DfNPIz-C.d.ts +33 -0
- package/dist/WabaApi-DqQi_68m.d.ts +175 -0
- package/dist/WebhookProcessor-BXYunz4N.d.ts +707 -0
- package/dist/WhatsApp-pTZPQm81.d.ts +82 -0
- package/dist/api/encryption/index.d.ts +10 -0
- package/dist/api/encryption/index.js +2 -0
- package/dist/api/encryption/index.js.map +1 -0
- package/dist/api/flow/index.d.ts +10 -0
- package/dist/api/flow/index.js +2 -0
- package/dist/api/flow/index.js.map +1 -0
- package/dist/api/index.d.ts +17 -0
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/media/index.d.ts +10 -0
- package/dist/api/media/index.js +2 -0
- package/dist/api/media/index.js.map +1 -0
- package/dist/api/messages/builders/index.d.ts +536 -0
- package/dist/api/messages/builders/index.js +4 -0
- package/dist/api/messages/builders/index.js.map +1 -0
- package/dist/api/messages/index.d.ts +10 -0
- package/dist/api/messages/index.js +2 -0
- package/dist/api/messages/index.js.map +1 -0
- package/dist/api/phone/index.d.ts +10 -0
- package/dist/api/phone/index.js +2 -0
- package/dist/api/phone/index.js.map +1 -0
- package/dist/api/profile/index.d.ts +10 -0
- package/dist/api/profile/index.js +2 -0
- package/dist/api/profile/index.js.map +1 -0
- package/dist/api/qrCode/index.d.ts +10 -0
- package/dist/api/qrCode/index.js +2 -0
- package/dist/api/qrCode/index.js.map +1 -0
- package/dist/api/registration/index.d.ts +10 -0
- package/dist/api/registration/index.js +2 -0
- package/dist/api/registration/index.js.map +1 -0
- package/dist/api/template/index.d.ts +215 -0
- package/dist/api/template/index.js +2 -0
- package/dist/api/template/index.js.map +1 -0
- package/dist/api/twoStepVerification/index.d.ts +10 -0
- package/dist/api/twoStepVerification/index.js +2 -0
- package/dist/api/twoStepVerification/index.js.map +1 -0
- package/dist/api/waba/index.d.ts +10 -0
- package/dist/api/waba/index.js +2 -0
- package/dist/api/waba/index.js.map +1 -0
- package/dist/base-CdGDdVEl.d.ts +18 -0
- package/dist/chunk-7QBIZCJ4.js +2 -0
- package/dist/chunk-7QBIZCJ4.js.map +1 -0
- package/dist/chunk-AMHQGG6Z.js +2 -0
- package/dist/chunk-AMHQGG6Z.js.map +1 -0
- package/dist/chunk-BAOZ4U74.js +10 -0
- package/dist/chunk-BAOZ4U74.js.map +1 -0
- package/dist/chunk-CRZ7EUYR.js +2 -0
- package/dist/chunk-CRZ7EUYR.js.map +1 -0
- package/dist/chunk-FKXSL2JK.js +3 -0
- package/dist/chunk-FKXSL2JK.js.map +1 -0
- package/dist/chunk-FSKBLPGE.js +2 -0
- package/dist/chunk-FSKBLPGE.js.map +1 -0
- package/dist/chunk-IYSR44P6.js +2 -0
- package/dist/chunk-IYSR44P6.js.map +1 -0
- package/dist/chunk-JC6YMVID.js +2 -0
- package/dist/chunk-JC6YMVID.js.map +1 -0
- package/dist/chunk-JPAV644F.js +2 -0
- package/dist/chunk-JPAV644F.js.map +1 -0
- package/dist/chunk-JPGXONBQ.js +3 -0
- package/dist/chunk-JPGXONBQ.js.map +1 -0
- package/dist/chunk-JXCLRKQ7.js +2 -0
- package/dist/chunk-JXCLRKQ7.js.map +1 -0
- package/dist/chunk-KMAH6636.js +2 -0
- package/dist/chunk-KMAH6636.js.map +1 -0
- package/dist/chunk-L4ESAO2S.js +2 -0
- package/dist/chunk-L4ESAO2S.js.map +1 -0
- package/dist/chunk-LV3TULSI.js +2 -0
- package/dist/chunk-LV3TULSI.js.map +1 -0
- package/dist/chunk-MJEG3K4V.js +2 -0
- package/dist/chunk-MJEG3K4V.js.map +1 -0
- package/dist/chunk-NLF2JGYY.js +2 -0
- package/dist/chunk-NLF2JGYY.js.map +1 -0
- package/dist/chunk-NOJFGTRT.js +2 -0
- package/dist/chunk-NOJFGTRT.js.map +1 -0
- package/dist/chunk-PHPQ5HP3.js +2 -0
- package/dist/chunk-PHPQ5HP3.js.map +1 -0
- package/dist/chunk-RIL6QABY.js +2 -0
- package/dist/chunk-RIL6QABY.js.map +1 -0
- package/dist/chunk-RWCVPWRC.js +2 -0
- package/dist/chunk-RWCVPWRC.js.map +1 -0
- package/dist/chunk-SNNRWNGZ.js +2 -0
- package/dist/chunk-SNNRWNGZ.js.map +1 -0
- package/dist/chunk-VHAODWCN.js +2 -0
- package/dist/chunk-VHAODWCN.js.map +1 -0
- package/dist/chunk-WGGN32O2.js +2 -0
- package/dist/chunk-WGGN32O2.js.map +1 -0
- package/dist/chunk-YXZ4L2OK.js +2 -0
- package/dist/chunk-YXZ4L2OK.js.map +1 -0
- package/dist/common-BiRA_uz3.d.ts +425 -0
- package/dist/common-lV0NsO7t.d.ts +376 -0
- package/dist/core/webhook/frameworks/express.d.ts +49 -0
- package/dist/core/webhook/frameworks/express.js +2 -0
- package/dist/core/webhook/frameworks/express.js.map +1 -0
- package/dist/core/webhook/frameworks/nextjs.d.ts +45 -0
- package/dist/core/webhook/frameworks/nextjs.js +2 -0
- package/dist/core/webhook/frameworks/nextjs.js.map +1 -0
- package/dist/core/webhook/index.d.ts +27 -0
- package/dist/core/webhook/index.js +2 -0
- package/dist/core/webhook/index.js.map +1 -0
- package/dist/core/whatsapp/index.d.ts +41 -0
- package/dist/core/whatsapp/index.js +2 -0
- package/dist/core/whatsapp/index.js.map +1 -0
- package/dist/enums-BZd9T2ul.d.ts +707 -0
- package/dist/flowTypeGuards-B5hBzkZ4.d.ts +43 -0
- package/dist/httpsClient-v4gmltzS.d.ts +19 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/logger-BdE0Vyim.d.ts +9 -0
- package/dist/request-vYMaEfk5.d.ts +50 -0
- package/dist/types/config.d.ts +78 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/enums.d.ts +1 -0
- package/dist/types/enums.js +2 -0
- package/dist/types/enums.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +59 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +247 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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"],"names":["ContactMessageBuilder","name","firstName","lastName","middleName","suffix","prefix","phone","type","waId","phoneObj","email","emailObj","address","street","city","country","company","department","title","org","url","urlObj","year","month","day","monthStr","dayStr","ContactMessageFactory","mobilePhone","birthday","builder","isBaseActionObject","action","InteractiveMessageBuilder","text","imageUrl","buttons","btn","sections","section","buttonText","displayText","InteractiveMessageFactory","bodyText","options","message","LocationMessageBuilder","latitude","longitude","LocationMessageFactory","businessName","fullAddress","BaseMediaBuilder","id","caption","ImageMessageBuilder","VideoMessageBuilder","AudioMessageBuilder","DocumentMessageBuilder","filename","StickerMessageBuilder","MediaMessageFactory","linkOrId","isId","ReactionMessageBuilder","messageId","emoji","ReactionMessageFactory","isValidLanguageCode","code","LanguagesEnum","isValidButtonPosition","index","ButtonPositionEnum","TemplateMessageBuilder","parameters","headerComponent","param","bodyComponent","footerComponent","button","subType","buttonComponent","fallbackValue","currencyCode","amount","timestamp","TemplateMessageFactory","language","bodyParameters","customerName","orderNumber","TextMessageBuilder","enable","TextMessageFactory","body"],"mappings":"oDAaO,IAAMA,CAAAA,CAAN,KAA4B,CACvB,OAAA,CAAkC,EAAC,CAK3C,OAAA,CAAQC,CAAAA,CAAwB,CAC5B,GAAI,CAACA,CAAAA,EAAQ,OAAOA,CAAAA,EAAS,SACzB,MAAM,IAAI,KAAA,CAAM,wBAAwB,CAAA,CAE5C,OAAA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAOA,EACb,IACX,CAKA,aAAA,CAAcC,CAAAA,CAAmBC,EAAyB,CACtD,GAAI,CAACD,CAAAA,EAAa,OAAOA,CAAAA,EAAc,QAAA,CACnC,MAAM,IAAI,KAAA,CAAM,uCAAuC,CAAA,CAE3D,IAAMD,EAAmB,CACrB,cAAA,CAAgBE,CAAAA,CAAW,CAAA,EAAGD,CAAS,CAAA,CAAA,EAAIC,CAAQ,CAAA,CAAA,CAAKD,CAAAA,CACxD,WAAYA,CAChB,CAAA,CACA,OAAIC,CAAAA,GACAF,CAAAA,CAAK,SAAA,CAAYE,CAAAA,CAAAA,CAEd,IAAA,CAAK,QAAQF,CAAI,CAC5B,CAKA,WAAA,CAAYC,EAAmBC,CAAAA,CAAmBC,CAAAA,CAAqBC,CAAAA,CAAiBC,CAAAA,CAAuB,CAC3G,GAAI,CAACJ,CAAAA,EAAa,OAAOA,CAAAA,EAAc,QAAA,CACnC,MAAM,IAAI,MAAM,uCAAuC,CAAA,CAI3D,IAAMD,CAAAA,CAAmB,CACrB,cAAA,CAFc,CAACK,CAAAA,CAAQJ,CAAAA,CAAWE,EAAYD,CAAAA,CAAUE,CAAM,CAAA,CAAE,MAAA,CAAO,OAA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Y,WAAA,CAAcA,CAAAA,CACxB,IACX,CAKA,KAAA,EAAoB,CAChB,GAAI,CAAC,IAAA,CAAK,WAAA,CAAY,KAClB,MAAM,IAAI,KAAA,CAAM,0BAA0B,EAG9C,OAAO,IAAA,CAAK,WAChB,CAKA,KAAA,EAAc,CACV,OAAA,IAAA,CAAK,WAAA,CAAc,EAAC,CACb,IACX,CACJ,CAAA,CAKaC,EAAN,KAAyB,CAI5B,OAAO,gBAAA,CAAiBC,EAA0B,CAC9C,OAAO,IAAIH,CAAAA,EAAmB,CAAE,OAAA,CAAQG,CAAI,CAAA,CAAE,OAClD,CAKA,OAAO,qBAAA,CAAsBA,EAA0B,CACnD,OAAO,IAAIH,CAAAA,GAAqB,OAAA,CAAQG,CAAI,CAAA,CAAE,aAAA,CAAc,IAAI,CAAA,CAAE,KAAA,EACtE,CAKA,OAAO,kBAAA,CAAmB7E,CAAAA,CAAe2B,CAAAA,CAA6B,CAClE,OAAO,IAAI+C,CAAAA,EAAmB,CAAE,OAAA,CAAQ,IAAI1E,CAAK,CAAA;;AAAA,EAAQ2B,CAAO,CAAA,CAAE,CAAA,CAAE,KAAA,EACxE,CACJ","file":"index.js","sourcesContent":["import type {\n AddressesObject,\n ContactObject,\n EmailObject,\n NameObject,\n OrgObject,\n PhoneObject,\n URLObject,\n} from '../types/contact';\n\n/**\n * Builder class for creating contact messages with a fluent API\n */\nexport class ContactMessageBuilder {\n private contact: Partial<ContactObject> = {};\n\n /**\n * Set the contact name (required)\n */\n setName(name: NameObject): this {\n if (!name || typeof name !== 'object') {\n throw new Error('Name must be an object');\n }\n this.contact.name = name;\n return this;\n }\n\n /**\n * Set simple name with first name only\n */\n setSimpleName(firstName: string, lastName?: string): this {\n if (!firstName || typeof firstName !== 'string') {\n throw new Error('First name must be a non-empty string');\n }\n const name: NameObject = {\n formatted_name: lastName ? `${firstName} ${lastName}` : firstName,\n first_name: firstName,\n };\n if (lastName) {\n name.last_name = lastName;\n }\n return this.setName(name);\n }\n\n /**\n * Set full name details\n */\n setFullName(firstName: string, lastName?: string, middleName?: string, suffix?: string, prefix?: string): this {\n if (!firstName || typeof firstName !== 'string') {\n throw new Error('First name must be a non-empty string');\n }\n\n const nameParts = [prefix, firstName, middleName, lastName, suffix].filter(Boolean);\n const name: NameObject = {\n formatted_name: nameParts.join(' '),\n first_name: firstName,\n };\n\n if (lastName) name.last_name = lastName;\n if (middleName) name.middle_name = middleName;\n if (suffix) name.suffix = suffix;\n if (prefix) name.prefix = prefix;\n\n return this.setName(name);\n }\n\n /**\n * Add phone numbers\n */\n addPhone(phone: string, type?: string, waId?: string): this {\n if (!phone || typeof phone !== 'string') {\n throw new Error('Phone number must be a non-empty string');\n }\n\n const phoneObj: PhoneObject = { phone: 'PHONE_NUMBER' };\n if (type) phoneObj.type = type;\n if (waId) phoneObj.wa_id = waId;\n\n if (!this.contact.phones) {\n this.contact.phones = [];\n }\n this.contact.phones.push(phoneObj);\n return this;\n }\n\n /**\n * Add email addresses\n */\n addEmail(email: string, type?: string): this {\n if (!email || typeof email !== 'string') {\n throw new Error('Email must be a non-empty string');\n }\n if (!email.match(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/)) {\n throw new Error('Invalid email format');\n }\n\n const emailObj: EmailObject = { email };\n if (type) emailObj.type = type;\n\n if (!this.contact.emails) {\n this.contact.emails = [];\n }\n this.contact.emails.push(emailObj);\n return this;\n }\n\n /**\n * Add address\n */\n addAddress(address: AddressesObject): this {\n if (!address || typeof address !== 'object') {\n throw new Error('Address must be an object');\n }\n\n if (!this.contact.addresses) {\n this.contact.addresses = [];\n }\n this.contact.addresses.push(address);\n return this;\n }\n\n /**\n * Add simple address\n */\n addSimpleAddress(street: string, city: string, country: string, type?: string): this {\n const address: AddressesObject = {\n street,\n city,\n country,\n };\n if (type) address.type = type;\n return this.addAddress(address);\n }\n\n /**\n * Set organization details\n */\n setOrganization(company: string, department?: string, title?: string): this {\n const org: OrgObject = {};\n if (company) org.company = company;\n if (department) org.department = department;\n if (title) org.title = title;\n\n this.contact.org = org;\n return this;\n }\n\n /**\n * Add URL\n */\n addUrl(url: string, type?: string): this {\n if (!url || typeof url !== 'string') {\n throw new Error('URL must be a non-empty string');\n }\n\n const urlObj: URLObject = { url };\n if (type) urlObj.type = type;\n\n if (!this.contact.urls) {\n this.contact.urls = [];\n }\n this.contact.urls.push(urlObj);\n return this;\n }\n\n /**\n * Set birthday (format: YYYY-MM-DD)\n */\n setBirthday(year: number, month: number, day: number): this {\n const monthStr = month.toString().padStart(2, '0');\n const dayStr = day.toString().padStart(2, '0');\n this.contact.birthday = `${year}-${monthStr}-${dayStr}` as ContactObject['birthday'];\n return this;\n }\n\n /**\n * Build the final contact object\n */\n build(): ContactObject {\n if (!this.contact.name) {\n throw new Error('Contact name is required');\n }\n\n return this.contact as ContactObject;\n }\n\n /**\n * Reset the builder for reuse\n */\n reset(): this {\n this.contact = {};\n return this;\n }\n}\n\n/**\n * Factory class for common contact patterns\n */\nexport class ContactMessageFactory {\n /**\n * Create a simple contact with name and phone\n */\n static createSimpleContact(firstName: string, phone: string): ContactObject {\n return new ContactMessageBuilder().setSimpleName(firstName).addPhone(phone).build();\n }\n\n /**\n * Create a business contact\n */\n static createBusinessContact(\n firstName: string,\n lastName: string,\n company: string,\n title: string,\n phone: string,\n email: string,\n ): ContactObject {\n return new ContactMessageBuilder()\n .setSimpleName(firstName, lastName)\n .setOrganization(company, undefined, title)\n .addPhone(phone, 'WORK')\n .addEmail(email, 'WORK')\n .build();\n }\n\n /**\n * Create a personal contact with full details\n */\n static createPersonalContact(\n firstName: string,\n lastName: string,\n mobilePhone: string,\n email?: string,\n birthday?: { year: number; month: number; day: number },\n ): ContactObject {\n const builder = new ContactMessageBuilder().setSimpleName(firstName, lastName).addPhone(mobilePhone, 'MOBILE');\n\n if (email) {\n builder.addEmail(email, 'HOME');\n }\n\n if (birthday) {\n builder.setBirthday(birthday.year, birthday.month, birthday.day);\n }\n\n return builder.build();\n }\n}\n","import { InteractiveTypesEnum } from '../../../types/enums';\nimport type { InteractiveObject } from '../types/interactive';\n\n/**\n * Type guards for different action object types\n */\ntype RowObject = {\n id: string;\n title: string;\n description?: string;\n};\n\ntype SectionObject = {\n title?: string;\n rows: RowObject[];\n};\n\ntype BaseActionObject = {\n buttons?: Array<{ type: 'reply'; reply: { id: string; title: string } }>;\n sections?: SectionObject[];\n button?: string;\n catalog_id?: string;\n product_retailer_id?: string;\n};\n\ntype CtaUrlActionObject = {\n name: 'cta_url';\n parameters: {\n display_text: string;\n url: string;\n };\n};\n\ntype ActionObjectUnion = BaseActionObject | CtaUrlActionObject;\n\nfunction isBaseActionObject(action: ActionObjectUnion): action is BaseActionObject {\n return !('name' in action);\n}\n\nfunction isCtaUrlActionObject(action: ActionObjectUnion): action is CtaUrlActionObject {\n return 'name' in action && action.name === 'cta_url';\n}\n\n/**\n * Builder class for creating interactive messages with a fluent API\n */\nexport class InteractiveMessageBuilder {\n private message: Partial<InteractiveObject> = {};\n\n /**\n * Set the interactive message type\n */\n setType(type: InteractiveTypesEnum): this {\n this.message.type = type;\n return this;\n }\n\n /**\n * Set the body text of the message\n */\n setBody(text: string): this {\n this.message.body = { text };\n return this;\n }\n\n /**\n * Set the footer text of the message\n */\n setFooter(text: string): this {\n this.message.footer = { text };\n return this;\n }\n\n /**\n * Set a text header\n */\n setTextHeader(text: string): this {\n this.message.header = { type: 'text', text };\n return this;\n }\n\n /**\n * Set an image header\n */\n setImageHeader(imageUrl: string): this {\n this.message.header = {\n type: 'image',\n image: { link: imageUrl },\n };\n return this;\n }\n\n /**\n * Add reply buttons (for button type messages)\n */\n addReplyButtons(buttons: Array<{ id: string; title: string }>): this {\n if (!this.message.action) {\n this.message.action = {} as ActionObjectUnion;\n }\n\n const action = this.message.action as ActionObjectUnion;\n if (isBaseActionObject(action)) {\n action.buttons = buttons.map((btn) => ({\n type: 'reply',\n reply: {\n id: btn.id,\n title: btn.title,\n },\n }));\n }\n\n return this;\n }\n\n /**\n * Add list sections (for list type messages)\n * Note: This creates a single section with multiple rows\n */\n addListSections(\n sections: Array<{\n title?: string;\n rows: Array<{ id: string; title: string; description?: string }>;\n }>,\n ): this {\n if (!this.message.action) {\n this.message.action = {} as ActionObjectUnion;\n }\n\n const action = this.message.action as ActionObjectUnion;\n if (isBaseActionObject(action)) {\n // Convert sections to the proper format expected by WhatsApp API\n action.sections = sections.map((section) => ({\n title: section.title,\n rows: section.rows,\n }));\n }\n\n return this;\n }\n\n /**\n * Set the button text for list messages\n */\n setListButtonText(buttonText: string): this {\n if (!this.message.action) {\n this.message.action = {} as ActionObjectUnion;\n }\n\n const action = this.message.action as ActionObjectUnion;\n if (isBaseActionObject(action)) {\n action.button = buttonText;\n }\n\n return this;\n }\n\n /**\n * Set CTA URL action\n */\n setCTAUrl(displayText: string, url: string): this {\n this.message.action = {\n name: 'cta_url',\n parameters: {\n display_text: displayText,\n url: url,\n },\n } as CtaUrlActionObject;\n\n return this;\n }\n\n /**\n * Build the final interactive object\n */\n build(): InteractiveObject {\n if (!this.message.type) {\n throw new Error('Interactive message type is required');\n }\n if (!this.message.body) {\n throw new Error('Interactive message body is required');\n }\n if (!this.message.action) {\n throw new Error('Interactive message action is required');\n }\n\n return this.message as InteractiveObject;\n }\n\n /**\n * Reset the builder for reuse\n */\n reset(): this {\n this.message = {};\n return this;\n }\n}\n\n/**\n * Convenience factory functions for common interactive message types\n */\nexport class InteractiveMessageFactory {\n /**\n * Create a button message with reply buttons\n */\n static createButtonMessage(\n bodyText: string,\n buttons: Array<{ id: string; title: string }>,\n options?: { headerText?: string; footerText?: string },\n ): InteractiveObject {\n const builder = new InteractiveMessageBuilder()\n .setType(InteractiveTypesEnum.Button)\n .setBody(bodyText)\n .addReplyButtons(buttons);\n\n if (options?.headerText) {\n builder.setTextHeader(options.headerText);\n }\n if (options?.footerText) {\n builder.setFooter(options.footerText);\n }\n\n return builder.build();\n }\n\n /**\n * Create a list message with sections\n */\n static createListMessage(\n bodyText: string,\n buttonText: string,\n sections: Array<{\n title?: string;\n rows: Array<{ id: string; title: string; description?: string }>;\n }>,\n options?: { headerText?: string; footerText?: string },\n ): InteractiveObject {\n const builder = new InteractiveMessageBuilder()\n .setType(InteractiveTypesEnum.List)\n .setBody(bodyText)\n .addListSections(sections);\n\n if (options?.headerText) {\n builder.setTextHeader(options.headerText);\n }\n if (options?.footerText) {\n builder.setFooter(options.footerText);\n }\n\n const message = builder.build();\n\n // Add button text for list messages\n const action = message.action as ActionObjectUnion;\n if (isBaseActionObject(action)) {\n action.button = buttonText;\n }\n\n return message;\n }\n\n /**\n * Create a CTA URL message\n */\n static createCTAUrlMessage(\n bodyText: string,\n displayText: string,\n url: string,\n options?: { headerText?: string; footerText?: string },\n ): InteractiveObject {\n const builder = new InteractiveMessageBuilder()\n .setType(InteractiveTypesEnum.CtaUrl)\n .setBody(bodyText)\n .setCTAUrl(displayText, url);\n\n if (options?.headerText) {\n builder.setTextHeader(options.headerText);\n }\n if (options?.footerText) {\n builder.setFooter(options.footerText);\n }\n\n return builder.build();\n }\n}\n","import type { LocationObject } from '../types/location';\n\n/**\n * Builder class for creating location messages with a fluent API\n */\nexport class LocationMessageBuilder {\n private location: Partial<LocationObject> = {};\n\n /**\n * Set the latitude coordinate\n */\n setLatitude(latitude: number): this {\n if (typeof latitude !== 'number' || latitude < -90 || latitude > 90) {\n throw new Error('Latitude must be a number between -90 and 90');\n }\n this.location.latitude = latitude;\n return this;\n }\n\n /**\n * Set the longitude coordinate\n */\n setLongitude(longitude: number): this {\n if (typeof longitude !== 'number' || longitude < -180 || longitude > 180) {\n throw new Error('Longitude must be a number between -180 and 180');\n }\n this.location.longitude = longitude;\n return this;\n }\n\n /**\n * Set coordinates using latitude and longitude\n */\n setCoordinates(latitude: number, longitude: number): this {\n return this.setLatitude(latitude).setLongitude(longitude);\n }\n\n /**\n * Set the location name\n */\n setName(name: string): this {\n if (name && typeof name !== 'string') {\n throw new Error('Location name must be a string');\n }\n this.location.name = name;\n return this;\n }\n\n /**\n * Set the location address\n */\n setAddress(address: string): this {\n if (address && typeof address !== 'string') {\n throw new Error('Location address must be a string');\n }\n this.location.address = address;\n return this;\n }\n\n /**\n * Build the final location object\n */\n build(): LocationObject {\n if (this.location.latitude === undefined) {\n throw new Error('Latitude is required');\n }\n if (this.location.longitude === undefined) {\n throw new Error('Longitude is required');\n }\n\n return this.location as LocationObject;\n }\n\n /**\n * Reset the builder for reuse\n */\n reset(): this {\n this.location = {};\n return this;\n }\n}\n\n/**\n * Factory class for common location patterns\n */\nexport class LocationMessageFactory {\n /**\n * Create a simple location with just coordinates\n */\n static createSimpleLocation(latitude: number, longitude: number): LocationObject {\n return new LocationMessageBuilder().setCoordinates(latitude, longitude).build();\n }\n\n /**\n * Create a location with name and address\n */\n static createNamedLocation(latitude: number, longitude: number, name: string, address: string): LocationObject {\n return new LocationMessageBuilder()\n .setCoordinates(latitude, longitude)\n .setName(name)\n .setAddress(address)\n .build();\n }\n\n /**\n * Create a business location\n */\n static createBusinessLocation(\n latitude: number,\n longitude: number,\n businessName: string,\n fullAddress: string,\n ): LocationObject {\n return new LocationMessageBuilder()\n .setCoordinates(latitude, longitude)\n .setName(businessName)\n .setAddress(fullAddress)\n .build();\n }\n}\n","import type {\n AudioMediaObject,\n DocumentMediaObject,\n ImageMediaObject,\n StickerMediaObject,\n VideoMediaObject,\n} from '../types/media';\n\n/**\n * Base builder for media messages\n */\nabstract class BaseMediaBuilder<T> {\n protected media: Partial<T> = {};\n\n /**\n * Set media ID (for uploaded media)\n */\n setId(id: string): this {\n if (!id || typeof id !== 'string') {\n throw new Error('Media ID must be a non-empty string');\n }\n (this.media as any).id = id;\n return this;\n }\n\n /**\n * Set media URL\n */\n setLink(url: string): this {\n if (!url || typeof url !== 'string') {\n throw new Error('Media URL must be a non-empty string');\n }\n if (!url.match(/^https?:\\/\\//)) {\n throw new Error('Media URL must be a valid HTTP/HTTPS URL');\n }\n (this.media as any).link = url;\n return this;\n }\n\n /**\n * Set media caption\n */\n setCaption(caption: string): this {\n if (caption && typeof caption !== 'string') {\n throw new Error('Caption must be a string');\n }\n (this.media as any).caption = caption;\n return this;\n }\n\n /**\n * Build the media object\n */\n build(): T {\n if (!(this.media as any).id && !(this.media as any).link) {\n throw new Error('Either media ID or link is required');\n }\n return this.media as T;\n }\n\n /**\n * Reset the builder\n */\n reset(): this {\n this.media = {};\n return this;\n }\n}\n\n/**\n * Builder for image messages\n */\nexport class ImageMessageBuilder extends BaseMediaBuilder<ImageMediaObject> {\n // Image inherits all methods from BaseMediaBuilder\n}\n\n/**\n * Builder for video messages\n */\nexport class VideoMessageBuilder extends BaseMediaBuilder<VideoMediaObject> {\n // Video inherits all methods from BaseMediaBuilder\n}\n\n/**\n * Builder for audio messages\n */\nexport class AudioMessageBuilder extends BaseMediaBuilder<AudioMediaObject> {\n // Audio doesn't support caption\n setCaption(caption: string): this {\n throw new Error('Audio messages do not support captions');\n }\n}\n\n/**\n * Builder for document messages\n */\nexport class DocumentMessageBuilder extends BaseMediaBuilder<DocumentMediaObject> {\n /**\n * Set document filename\n */\n setFilename(filename: string): this {\n if (!filename || typeof filename !== 'string') {\n throw new Error('Filename must be a non-empty string');\n }\n this.media.filename = filename;\n return this;\n }\n}\n\n/**\n * Builder for sticker messages\n */\nexport class StickerMessageBuilder extends BaseMediaBuilder<StickerMediaObject> {\n // Sticker doesn't support caption\n setCaption(caption: string): this {\n throw new Error('Sticker messages do not support captions');\n }\n}\n\n/**\n * Factory class for common media patterns\n */\nexport class MediaMessageFactory {\n /**\n * Create an image with caption\n */\n static createImageWithCaption(linkOrId: string, caption: string, isId: boolean = false): ImageMediaObject {\n const builder = new ImageMessageBuilder();\n if (isId) {\n builder.setId(linkOrId);\n } else {\n builder.setLink(linkOrId);\n }\n return builder.setCaption(caption).build();\n }\n\n /**\n * Create a video with caption\n */\n static createVideoWithCaption(linkOrId: string, caption: string, isId: boolean = false): VideoMediaObject {\n const builder = new VideoMessageBuilder();\n if (isId) {\n builder.setId(linkOrId);\n } else {\n builder.setLink(linkOrId);\n }\n return builder.setCaption(caption).build();\n }\n\n /**\n * Create a document with filename\n */\n static createDocument(\n linkOrId: string,\n filename: string,\n caption?: string,\n isId: boolean = false,\n ): DocumentMediaObject {\n const builder = new DocumentMessageBuilder();\n if (isId) {\n builder.setId(linkOrId);\n } else {\n builder.setLink(linkOrId);\n }\n builder.setFilename(filename);\n if (caption) {\n builder.setCaption(caption);\n }\n return builder.build();\n }\n\n /**\n * Create an audio message\n */\n static createAudio(linkOrId: string, isId: boolean = false): AudioMediaObject {\n const builder = new AudioMessageBuilder();\n if (isId) {\n builder.setId(linkOrId);\n } else {\n builder.setLink(linkOrId);\n }\n return builder.build();\n }\n\n /**\n * Create a sticker message\n */\n static createSticker(linkOrId: string, isId: boolean = false): StickerMediaObject {\n const builder = new StickerMessageBuilder();\n if (isId) {\n builder.setId(linkOrId);\n } else {\n builder.setLink(linkOrId);\n }\n return builder.build();\n }\n}\n","/**\n * Builder class for creating reaction messages with a fluent API\n */\nexport class ReactionMessageBuilder {\n private reaction: { message_id?: string; emoji?: string } = {};\n\n /**\n * Set the message ID to react to\n */\n setMessageId(messageId: string): this {\n if (!messageId || typeof messageId !== 'string') {\n throw new Error('Message ID must be a non-empty string');\n }\n this.reaction.message_id = messageId;\n return this;\n }\n\n /**\n * Set the emoji for the reaction\n */\n setEmoji(emoji: string): this {\n if (!emoji || typeof emoji !== 'string') {\n throw new Error('Emoji must be a non-empty string');\n }\n // Validate that it's a single emoji (basic check)\n if (emoji.length > 4) {\n throw new Error('Please provide a single emoji character');\n }\n this.reaction.emoji = emoji;\n return this;\n }\n\n /**\n * Remove a reaction (by sending empty emoji)\n */\n removeReaction(): this {\n this.reaction.emoji = '';\n return this;\n }\n\n /**\n * Build the final reaction object\n */\n build(): { message_id: string; emoji: string } {\n if (!this.reaction.message_id) {\n throw new Error('Message ID is required');\n }\n if (this.reaction.emoji === undefined) {\n throw new Error('Emoji is required (use empty string to remove reaction)');\n }\n\n return this.reaction as { message_id: string; emoji: string };\n }\n\n /**\n * Reset the builder for reuse\n */\n reset(): this {\n this.reaction = {};\n return this;\n }\n}\n\n/**\n * Factory class for common reaction patterns\n */\nexport class ReactionMessageFactory {\n /**\n * Create a like reaction\n */\n static createLike(messageId: string): { message_id: string; emoji: string } {\n return new ReactionMessageBuilder().setMessageId(messageId).setEmoji('👍').build();\n }\n\n /**\n * Create a heart reaction\n */\n static createHeart(messageId: string): { message_id: string; emoji: string } {\n return new ReactionMessageBuilder().setMessageId(messageId).setEmoji('❤️').build();\n }\n\n /**\n * Create a laughing reaction\n */\n static createLaugh(messageId: string): { message_id: string; emoji: string } {\n return new ReactionMessageBuilder().setMessageId(messageId).setEmoji('😂').build();\n }\n\n /**\n * Create a wow reaction\n */\n static createWow(messageId: string): { message_id: string; emoji: string } {\n return new ReactionMessageBuilder().setMessageId(messageId).setEmoji('😮').build();\n }\n\n /**\n * Create a sad reaction\n */\n static createSad(messageId: string): { message_id: string; emoji: string } {\n return new ReactionMessageBuilder().setMessageId(messageId).setEmoji('😢').build();\n }\n\n /**\n * Create an angry reaction\n */\n static createAngry(messageId: string): { message_id: string; emoji: string } {\n return new ReactionMessageBuilder().setMessageId(messageId).setEmoji('😠').build();\n }\n\n /**\n * Remove a reaction\n */\n static removeReaction(messageId: string): { message_id: string; emoji: string } {\n return new ReactionMessageBuilder().setMessageId(messageId).removeReaction().build();\n }\n}\n","import {\n ButtonPositionEnum,\n ComponentTypesEnum,\n CurrencyCodesEnum,\n LanguagesEnum,\n ParametersTypesEnum,\n SubTypeEnum,\n} from '../../../types/enums';\nimport type { MessageTemplateObject } from '../types/template';\n\n// Helper type for currency parameter\nexport type CurrencyParameterHelper = {\n type: ParametersTypesEnum.Currency;\n currency: {\n fallback_value: string;\n code: CurrencyCodesEnum;\n amount_1000: number;\n };\n};\n\n// Helper type for date time parameter\nexport type DateTimeParameterHelper = {\n type: ParametersTypesEnum.DateTime;\n date_time: {\n fallback_value: string;\n timestamp: number;\n };\n};\n\n// Union type for all parameter helpers\nexport type ParameterObject = CurrencyParameterHelper | DateTimeParameterHelper;\n\n// Type guards for validation\nfunction isValidLanguageCode(code: string): code is LanguagesEnum {\n return Object.values(LanguagesEnum).includes(code as LanguagesEnum);\n}\n\nfunction isValidButtonPosition(index: number): index is ButtonPositionEnum {\n return Object.values(ButtonPositionEnum).includes(index as ButtonPositionEnum);\n}\n\n/**\n * Builder class for creating template messages with a fluent API\n */\nexport class TemplateMessageBuilder {\n private template: Partial<MessageTemplateObject<ComponentTypesEnum>> = {\n components: [],\n };\n\n /**\n * Set the template name\n */\n setName(name: string): this {\n if (!name || name.trim().length === 0) {\n throw new Error('Template name cannot be empty');\n }\n this.template.name = name;\n return this;\n }\n\n /**\n * Set the template language\n */\n setLanguage(code: string): this {\n if (!isValidLanguageCode(code)) {\n throw new Error(`Invalid language code: ${code}. Must be a valid LanguagesEnum value.`);\n }\n this.template.language = { policy: 'deterministic', code };\n return this;\n }\n\n /**\n * Add a header component with text parameters\n */\n addTextHeader(parameters: string[]): this {\n if (!Array.isArray(parameters)) {\n throw new Error('Parameters must be an array');\n }\n\n const headerComponent = {\n type: ComponentTypesEnum.Header,\n parameters: parameters.map((param) => {\n if (typeof param !== 'string') {\n throw new Error('All parameters must be strings');\n }\n return { type: ParametersTypesEnum.Text, text: param };\n }),\n };\n\n if (!this.template.components) {\n this.template.components = [];\n }\n this.template.components.push(headerComponent as any);\n return this;\n }\n\n /**\n * Add a header component with image\n */\n addImageHeader(imageUrl: string): this {\n if (!imageUrl || typeof imageUrl !== 'string') {\n throw new Error('Image URL must be a non-empty string');\n }\n\n const headerComponent = {\n type: ComponentTypesEnum.Header,\n parameters: [\n {\n type: ParametersTypesEnum.Image,\n image: { link: imageUrl },\n },\n ],\n };\n\n if (!this.template.components) {\n this.template.components = [];\n }\n this.template.components.push(headerComponent as any);\n return this;\n }\n\n /**\n * Add a body component with text parameters\n */\n addBody(parameters: string[]): this {\n if (!Array.isArray(parameters)) {\n throw new Error('Parameters must be an array');\n }\n\n const bodyComponent = {\n type: ComponentTypesEnum.Body,\n parameters: parameters.map((param) => {\n if (typeof param !== 'string') {\n throw new Error('All parameters must be strings');\n }\n return { type: ParametersTypesEnum.Text, text: param };\n }),\n };\n\n if (!this.template.components) {\n this.template.components = [];\n }\n this.template.components.push(bodyComponent as any);\n return this;\n }\n\n /**\n * Add a footer component (usually no parameters needed)\n */\n addFooter(): this {\n const footerComponent = {\n type: ComponentTypesEnum.Footer,\n };\n\n if (!this.template.components) {\n this.template.components = [];\n }\n this.template.components.push(footerComponent as any);\n return this;\n }\n\n /**\n * Add button components (for quick replies, URLs, etc.)\n */\n addButtons(\n buttons: Array<{\n index: number;\n type: 'quick_reply' | 'url';\n parameters?: string[];\n }>,\n ): this {\n if (!Array.isArray(buttons)) {\n throw new Error('Buttons must be an array');\n }\n\n buttons.forEach((button) => {\n if (typeof button.index !== 'number' || !isValidButtonPosition(button.index)) {\n throw new Error(`Button index must be a valid ButtonPositionEnum value: ${button.index}`);\n }\n\n // Map string types to SubTypeEnum values\n const subType = button.type === 'quick_reply' ? SubTypeEnum.QuickReply : SubTypeEnum.Url;\n\n const buttonComponent = {\n type: ComponentTypesEnum.Button,\n sub_type: subType,\n index: button.index,\n } as any;\n\n if (button.parameters && button.parameters.length > 0) {\n if (!Array.isArray(button.parameters)) {\n throw new Error('Button parameters must be an array');\n }\n\n // Handle different parameter types based on button type\n if (button.type === 'quick_reply') {\n // Quick reply buttons use payload parameters\n buttonComponent.parameters = button.parameters.map((param) => {\n if (typeof param !== 'string') {\n throw new Error('All button parameters must be strings');\n }\n return { type: ParametersTypesEnum.Payload, payload: param };\n });\n } else if (button.type === 'url') {\n // URL buttons use text parameters\n buttonComponent.parameters = button.parameters.map((param) => {\n if (typeof param !== 'string') {\n throw new Error('All button parameters must be strings');\n }\n return { type: ParametersTypesEnum.Text, text: param };\n });\n }\n }\n\n if (!this.template.components) {\n this.template.components = [];\n }\n this.template.components.push(buttonComponent);\n });\n\n return this;\n }\n\n /**\n * Add a currency parameter for header/body\n */\n addCurrencyParameter(fallbackValue: string, currencyCode: string, amount: number): CurrencyParameterHelper {\n if (!fallbackValue || typeof fallbackValue !== 'string') {\n throw new Error('Fallback value must be a non-empty string');\n }\n if (!currencyCode || typeof currencyCode !== 'string') {\n throw new Error('Currency code must be a non-empty string');\n }\n if (typeof amount !== 'number' || amount < 0) {\n throw new Error('Amount must be a non-negative number');\n }\n\n return {\n type: ParametersTypesEnum.Currency,\n currency: {\n fallback_value: fallbackValue,\n code: currencyCode as CurrencyCodesEnum,\n amount_1000: amount * 1000, // WhatsApp expects amount in smallest unit\n },\n };\n }\n\n /**\n * Add a date time parameter\n */\n addDateTimeParameter(fallbackValue: string, timestamp: number): DateTimeParameterHelper {\n if (!fallbackValue || typeof fallbackValue !== 'string') {\n throw new Error('Fallback value must be a non-empty string');\n }\n if (typeof timestamp !== 'number' || timestamp <= 0) {\n throw new Error('Timestamp must be a positive number');\n }\n\n return {\n type: ParametersTypesEnum.DateTime,\n date_time: {\n fallback_value: fallbackValue,\n timestamp: timestamp,\n },\n };\n }\n\n /**\n * Build the final template object\n */\n build(): MessageTemplateObject<ComponentTypesEnum> {\n if (!this.template.name) {\n throw new Error('Template name is required');\n }\n if (!this.template.language) {\n throw new Error('Template language is required');\n }\n\n return this.template as MessageTemplateObject<ComponentTypesEnum>;\n }\n\n /**\n * Reset the builder for reuse\n */\n reset(): this {\n this.template = { components: [] };\n return this;\n }\n}\n\n/**\n * Factory class for common template patterns\n */\nexport class TemplateMessageFactory {\n /**\n * Create a simple text-only template\n */\n static createSimpleTextTemplate(\n name: string,\n language: string,\n bodyParameters: string[],\n ): MessageTemplateObject<ComponentTypesEnum> {\n if (!name || !language || !Array.isArray(bodyParameters)) {\n throw new Error('Invalid parameters for simple text template');\n }\n\n return new TemplateMessageBuilder().setName(name).setLanguage(language).addBody(bodyParameters).build();\n }\n\n /**\n * Create a template with header, body and buttons\n */\n static createCompleteTemplate(\n name: string,\n language: string,\n options: {\n headerParameters?: string[];\n headerImage?: string;\n bodyParameters: string[];\n buttons?: Array<{\n index: number;\n type: 'quick_reply' | 'url';\n parameters?: string[];\n }>;\n },\n ): MessageTemplateObject<ComponentTypesEnum> {\n if (!name || !language || !options.bodyParameters) {\n throw new Error('Invalid parameters for complete template');\n }\n\n const builder = new TemplateMessageBuilder()\n .setName(name)\n .setLanguage(language)\n .addBody(options.bodyParameters);\n\n if (options.headerParameters) {\n builder.addTextHeader(options.headerParameters);\n } else if (options.headerImage) {\n builder.addImageHeader(options.headerImage);\n }\n\n if (options.buttons) {\n builder.addButtons(options.buttons);\n }\n\n return builder.build();\n }\n\n /**\n * Create an order confirmation template\n */\n static createOrderConfirmationTemplate(\n language: string,\n customerName: string,\n orderNumber: string,\n amount: number,\n currencyCode: string,\n ): MessageTemplateObject<ComponentTypesEnum> {\n if (!language || !customerName || !orderNumber || typeof amount !== 'number' || !currencyCode) {\n throw new Error('Invalid parameters for order confirmation template');\n }\n\n return new TemplateMessageBuilder()\n .setName('order_confirmation')\n .setLanguage(language)\n .addBody([customerName, orderNumber, amount.toString(), currencyCode])\n .addButtons([\n { index: 0, type: 'quick_reply' },\n { index: 1, type: 'url', parameters: [orderNumber] },\n ])\n .build();\n }\n}\n","import type { TextObject } from '../types/text';\n\n/**\n * Builder class for creating text messages with a fluent API\n */\nexport class TextMessageBuilder {\n private textMessage: Partial<TextObject> = {};\n\n /**\n * Set the message body text\n */\n setBody(text: string): this {\n if (!text || typeof text !== 'string') {\n throw new Error('Message body must be a non-empty string');\n }\n this.textMessage.body = text;\n return this;\n }\n\n /**\n * Enable or disable URL preview\n */\n setPreviewUrl(enable: boolean = true): this {\n this.textMessage.preview_url = enable;\n return this;\n }\n\n /**\n * Build the final text object\n */\n build(): TextObject {\n if (!this.textMessage.body) {\n throw new Error('Message body is required');\n }\n\n return this.textMessage as TextObject;\n }\n\n /**\n * Reset the builder for reuse\n */\n reset(): this {\n this.textMessage = {};\n return this;\n }\n}\n\n/**\n * Factory class for common text message patterns\n */\nexport class TextMessageFactory {\n /**\n * Create a simple text message\n */\n static createSimpleText(body: string): TextObject {\n return new TextMessageBuilder().setBody(body).build();\n }\n\n /**\n * Create a text message with URL preview\n */\n static createTextWithPreview(body: string): TextObject {\n return new TextMessageBuilder().setBody(body).setPreviewUrl(true).build();\n }\n\n /**\n * Create a notification message\n */\n static createNotification(title: string, message: string): TextObject {\n return new TextMessageBuilder().setBody(`*${title}*\\n\\n${message}`).build();\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { M as MessagesApi } from '../../MessageApi-BgsSpDno.js';
|
|
2
|
+
export { A as AudioMediaObject, C as ContactObject, D as DocumentMediaObject, I as ImageMediaObject, a as InteractiveObject, L as LocationObject, M as MessageRequestParams, c as MessageTemplateObject, b as MessagesResponse, R as ReactionParams, S as StatusParams, d as StickerMediaObject, T as TextMessageParams, e as TextObject, V as VideoMediaObject } from '../../common-BiRA_uz3.js';
|
|
3
|
+
import '../../base-CdGDdVEl.js';
|
|
4
|
+
import '../../types/config.js';
|
|
5
|
+
import '../../enums-BZd9T2ul.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { MessagesApi as MessageApi, MessagesApi as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { P as PhoneNumberApi } from '../../PhoneNumberApi-DKlu9PHl.js';
|
|
2
|
+
export { A as AccountMode, C as CodeVerificationStatus, a as Cursors, H as HealthStatus, b as HealthStatusEntity, M as MessagingLimitTier, c as PhoneNumberClass, d as PhoneNumberResponse, e as PhoneNumbersResponse, f as PlatformType, Q as QualityRating, g as QualityScore, R as RequestVerificationCodeRequest, T as Throughput, h as ThroughputLevel, i as TwoStepVerificationParams, V as VerifyCodeRequest } from '../../PhoneNumberApi-DKlu9PHl.js';
|
|
3
|
+
import '../../base-CdGDdVEl.js';
|
|
4
|
+
import '../../types/config.js';
|
|
5
|
+
import '../../enums-BZd9T2ul.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { PhoneNumberApi, PhoneNumberApi as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { B as BusinessProfileApi } from '../../BusinessProfileApi-WXscSgo-.js';
|
|
2
|
+
export { a as BusinessProfileClass, b as BusinessProfileData, c as BusinessProfileField, d as BusinessProfileFieldsParam, e as BusinessProfileResponse, C as CreateUploadSessionParams, G as GetUploadHandleParams, U as UpdateBusinessProfileRequest, f as UploadBusinessProfileResponse, g as UploadHandle, h as UploadMediaParams, i as UploadSession, j as UploadSessionResponse } from '../../BusinessProfileApi-WXscSgo-.js';
|
|
3
|
+
import '../../base-CdGDdVEl.js';
|
|
4
|
+
import '../../types/config.js';
|
|
5
|
+
import '../../enums-BZd9T2ul.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { BusinessProfileApi, BusinessProfileApi as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Q as QrCodeApi } from '../../QrCodeApi-7vDwIBHR.js';
|
|
2
|
+
export { C as CreateQrCodeRequest, a as QrCodeClass, b as QrCodeResponse, c as QrCodesResponse, U as UpdateQrCodeRequest } from '../../QrCodeApi-7vDwIBHR.js';
|
|
3
|
+
import '../../base-CdGDdVEl.js';
|
|
4
|
+
import '../../types/config.js';
|
|
5
|
+
import '../../enums-BZd9T2ul.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { QrCodeApi, QrCodeApi as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { R as RegistrationApi } from '../../RegistrationApi-qO_qoti9.js';
|
|
2
|
+
export { a as RegistrationClass, b as RegistrationRequest } from '../../RegistrationApi-qO_qoti9.js';
|
|
3
|
+
import '../../base-CdGDdVEl.js';
|
|
4
|
+
import '../../types/config.js';
|
|
5
|
+
import '../../enums-BZd9T2ul.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { RegistrationApi, RegistrationApi as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { f as TemplateFormat, d as TemplateRequestBody } from '../../TemplateApi-xGgIZt89.js';
|
|
2
|
+
export { C as CatalogButton, g as ComponentTypes, h as CopyCodeButton, F as FlowButton, M as MPMButton, q as MediaCarouselCard, O as OTPButton, P as PhoneNumberButton, r as ProductCarouselCard, Q as QuickReplyButton, S as SPMButton, T as TemplateApi, i as TemplateBody, j as TemplateButton, k as TemplateButtons, l as TemplateCarousel, a as TemplateClass, b as TemplateDeleteParams, m as TemplateFooter, c as TemplateGetParams, n as TemplateHeader, o as TemplateHeaderExample, p as TemplateLimitedTimeOffer, e as TemplateResponse, U as URLButton, T as default } from '../../TemplateApi-xGgIZt89.js';
|
|
3
|
+
import { L as LanguagesEnum, i as CurrencyCodesEnum, a as CategoryEnum } from '../../enums-BZd9T2ul.js';
|
|
4
|
+
import '../../base-CdGDdVEl.js';
|
|
5
|
+
import '../../types/config.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
interface TextParameter {
|
|
9
|
+
type: 'text';
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
interface CurrencyParameter {
|
|
13
|
+
type: 'currency';
|
|
14
|
+
amount_1000: number;
|
|
15
|
+
code: CurrencyCodesEnum;
|
|
16
|
+
fallback_value: string;
|
|
17
|
+
}
|
|
18
|
+
interface DateTimeParameter {
|
|
19
|
+
type: 'date_time';
|
|
20
|
+
fallback_value: string;
|
|
21
|
+
}
|
|
22
|
+
interface MediaParameter {
|
|
23
|
+
type: 'image' | 'video' | 'document';
|
|
24
|
+
handle?: string;
|
|
25
|
+
link?: string;
|
|
26
|
+
}
|
|
27
|
+
interface LocationParameter {
|
|
28
|
+
type: 'location';
|
|
29
|
+
latitude?: number;
|
|
30
|
+
longitude?: number;
|
|
31
|
+
name?: string;
|
|
32
|
+
address?: string;
|
|
33
|
+
}
|
|
34
|
+
interface ProductParameter {
|
|
35
|
+
type: 'product';
|
|
36
|
+
product_retailer_id: string;
|
|
37
|
+
}
|
|
38
|
+
type TemplateParameter = TextParameter | CurrencyParameter | DateTimeParameter | MediaParameter | LocationParameter | ProductParameter;
|
|
39
|
+
interface HeaderOptions {
|
|
40
|
+
format: TemplateFormat;
|
|
41
|
+
text?: string;
|
|
42
|
+
parameters?: TemplateParameter[];
|
|
43
|
+
example?: {
|
|
44
|
+
header_text?: string[];
|
|
45
|
+
header_text_named_params?: Array<{
|
|
46
|
+
param_name: string;
|
|
47
|
+
example: string;
|
|
48
|
+
}>;
|
|
49
|
+
header_handle?: string[];
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
interface BodyOptions {
|
|
53
|
+
text: string;
|
|
54
|
+
parameters?: TemplateParameter[];
|
|
55
|
+
example?: {
|
|
56
|
+
body_text?: string[][];
|
|
57
|
+
body_text_named_params?: Array<{
|
|
58
|
+
param_name: string;
|
|
59
|
+
example: string;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
interface FooterOptions {
|
|
64
|
+
text: string;
|
|
65
|
+
}
|
|
66
|
+
interface ButtonOptions {
|
|
67
|
+
phone_number?: {
|
|
68
|
+
text: string;
|
|
69
|
+
phone_number: string;
|
|
70
|
+
};
|
|
71
|
+
url?: {
|
|
72
|
+
text: string;
|
|
73
|
+
url: string;
|
|
74
|
+
example?: string;
|
|
75
|
+
};
|
|
76
|
+
quick_reply?: {
|
|
77
|
+
text: string;
|
|
78
|
+
}[];
|
|
79
|
+
copy_code?: {
|
|
80
|
+
example: string;
|
|
81
|
+
};
|
|
82
|
+
flow?: {
|
|
83
|
+
text: string;
|
|
84
|
+
flow_id?: string;
|
|
85
|
+
flow_name?: string;
|
|
86
|
+
flow_json?: string;
|
|
87
|
+
flow_action?: 'navigate' | 'data_exchange';
|
|
88
|
+
navigate_screen?: string;
|
|
89
|
+
};
|
|
90
|
+
mpm?: boolean;
|
|
91
|
+
otp?: boolean;
|
|
92
|
+
spm?: boolean;
|
|
93
|
+
}
|
|
94
|
+
interface CarouselCard {
|
|
95
|
+
image?: string;
|
|
96
|
+
video?: string;
|
|
97
|
+
product?: string;
|
|
98
|
+
body?: string;
|
|
99
|
+
bodyParameters?: TemplateParameter[];
|
|
100
|
+
buttons?: ButtonOptions;
|
|
101
|
+
}
|
|
102
|
+
interface CarouselOptions {
|
|
103
|
+
cards: CarouselCard[];
|
|
104
|
+
}
|
|
105
|
+
interface LimitedTimeOfferOptions {
|
|
106
|
+
expiration_time_ms: number;
|
|
107
|
+
}
|
|
108
|
+
interface ProductSection {
|
|
109
|
+
title?: string;
|
|
110
|
+
product_items: Array<{
|
|
111
|
+
product_retailer_id: string;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
interface TemplateOptions {
|
|
115
|
+
name: string;
|
|
116
|
+
language: LanguagesEnum;
|
|
117
|
+
category: CategoryEnum;
|
|
118
|
+
header?: HeaderOptions;
|
|
119
|
+
body?: BodyOptions;
|
|
120
|
+
footer?: FooterOptions;
|
|
121
|
+
buttons?: ButtonOptions;
|
|
122
|
+
carousel?: CarouselOptions;
|
|
123
|
+
limitedTimeOffer?: LimitedTimeOfferOptions;
|
|
124
|
+
}
|
|
125
|
+
interface OTPTemplateOptions {
|
|
126
|
+
name: string;
|
|
127
|
+
language: LanguagesEnum;
|
|
128
|
+
code_expiration_minutes?: number;
|
|
129
|
+
add_security_recommendation?: boolean;
|
|
130
|
+
}
|
|
131
|
+
interface AuthenticationTemplateOptions {
|
|
132
|
+
name: string;
|
|
133
|
+
language: LanguagesEnum;
|
|
134
|
+
code_expiration_minutes?: number;
|
|
135
|
+
add_security_recommendation?: boolean;
|
|
136
|
+
copy_code_button?: boolean;
|
|
137
|
+
}
|
|
138
|
+
interface CatalogTemplateOptions {
|
|
139
|
+
name: string;
|
|
140
|
+
language: LanguagesEnum;
|
|
141
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
142
|
+
body: BodyOptions;
|
|
143
|
+
footer?: FooterOptions;
|
|
144
|
+
thumbnail_product_retailer_id: string;
|
|
145
|
+
}
|
|
146
|
+
interface CouponTemplateOptions {
|
|
147
|
+
name: string;
|
|
148
|
+
language: LanguagesEnum;
|
|
149
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
150
|
+
body: BodyOptions;
|
|
151
|
+
footer?: FooterOptions;
|
|
152
|
+
coupon_code: string;
|
|
153
|
+
}
|
|
154
|
+
interface LimitedTimeOfferTemplateOptions {
|
|
155
|
+
name: string;
|
|
156
|
+
language: LanguagesEnum;
|
|
157
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
158
|
+
body: BodyOptions;
|
|
159
|
+
footer?: FooterOptions;
|
|
160
|
+
expiration_time_ms: number;
|
|
161
|
+
}
|
|
162
|
+
interface MediaCardCarouselTemplateOptions {
|
|
163
|
+
name: string;
|
|
164
|
+
language: LanguagesEnum;
|
|
165
|
+
cards: Array<{
|
|
166
|
+
header: {
|
|
167
|
+
format: 'IMAGE' | 'VIDEO';
|
|
168
|
+
example: {
|
|
169
|
+
header_handle: string[];
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
body: BodyOptions;
|
|
173
|
+
buttons?: ButtonOptions;
|
|
174
|
+
}>;
|
|
175
|
+
}
|
|
176
|
+
interface MPMTemplateOptions {
|
|
177
|
+
name: string;
|
|
178
|
+
language: LanguagesEnum;
|
|
179
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
180
|
+
body: BodyOptions;
|
|
181
|
+
footer?: FooterOptions;
|
|
182
|
+
thumbnail_product_retailer_id: string;
|
|
183
|
+
sections: ProductSection[];
|
|
184
|
+
}
|
|
185
|
+
interface ProductCardCarouselTemplateOptions {
|
|
186
|
+
name: string;
|
|
187
|
+
language: LanguagesEnum;
|
|
188
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
189
|
+
body: BodyOptions;
|
|
190
|
+
footer?: FooterOptions;
|
|
191
|
+
cards: Array<{
|
|
192
|
+
product_retailer_id: string;
|
|
193
|
+
}>;
|
|
194
|
+
}
|
|
195
|
+
interface SPMTemplateOptions {
|
|
196
|
+
name: string;
|
|
197
|
+
language: LanguagesEnum;
|
|
198
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
199
|
+
body: BodyOptions;
|
|
200
|
+
footer?: FooterOptions;
|
|
201
|
+
product_retailer_id: string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
declare function createTemplate(options: TemplateOptions): TemplateRequestBody;
|
|
205
|
+
declare function createOTPTemplate(options: OTPTemplateOptions): TemplateRequestBody;
|
|
206
|
+
declare function createAuthenticationTemplate(options: AuthenticationTemplateOptions): TemplateRequestBody;
|
|
207
|
+
declare function createCatalogTemplate(options: CatalogTemplateOptions): TemplateRequestBody;
|
|
208
|
+
declare function createCouponTemplate(options: CouponTemplateOptions): TemplateRequestBody;
|
|
209
|
+
declare function createLimitedTimeOfferTemplate(options: LimitedTimeOfferTemplateOptions): TemplateRequestBody;
|
|
210
|
+
declare function createMediaCardCarouselTemplate(options: MediaCardCarouselTemplateOptions): TemplateRequestBody;
|
|
211
|
+
declare function createMPMTemplate(options: MPMTemplateOptions): TemplateRequestBody;
|
|
212
|
+
declare function createProductCardCarouselTemplate(options: ProductCardCarouselTemplateOptions): TemplateRequestBody;
|
|
213
|
+
declare function createSPMTemplate(options: SPMTemplateOptions): TemplateRequestBody;
|
|
214
|
+
|
|
215
|
+
export { type AuthenticationTemplateOptions, type BodyOptions, type ButtonOptions, type CarouselCard, type CarouselOptions, type CatalogTemplateOptions, type CouponTemplateOptions, type CurrencyParameter, type DateTimeParameter, type FooterOptions, type HeaderOptions, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type LocationParameter, type MPMTemplateOptions, type MediaCardCarouselTemplateOptions, type MediaParameter, type OTPTemplateOptions, type ProductCardCarouselTemplateOptions, type ProductParameter, type ProductSection, type SPMTemplateOptions, TemplateFormat, type TemplateOptions, type TemplateParameter, TemplateRequestBody, type TextParameter, createAuthenticationTemplate, createCatalogTemplate, createCouponTemplate, createLimitedTimeOfferTemplate, createMPMTemplate, createMediaCardCarouselTemplate, createOTPTemplate, createProductCardCarouselTemplate, createSPMTemplate, createTemplate };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{a as TemplateApi,d as createAuthenticationTemplate,e as createCatalogTemplate,f as createCouponTemplate,g as createLimitedTimeOfferTemplate,i as createMPMTemplate,h as createMediaCardCarouselTemplate,c as createOTPTemplate,j as createProductCardCarouselTemplate,k as createSPMTemplate,b as createTemplate,a as default}from'../../chunk-VHAODWCN.js';import'../../chunk-MJEG3K4V.js';import'../../chunk-RIL6QABY.js';import'../../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { T as TwoStepVerificationApi } from '../../TwoStepVerificationApi-DfNPIz-C.js';
|
|
2
|
+
export { a as TwoStepVerificationClass, b as TwoStepVerificationRequest } from '../../TwoStepVerificationApi-DfNPIz-C.js';
|
|
3
|
+
import '../../base-CdGDdVEl.js';
|
|
4
|
+
import '../../types/config.js';
|
|
5
|
+
import '../../enums-BZd9T2ul.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { TwoStepVerificationApi, TwoStepVerificationApi as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { W as WabaApi } from '../../WabaApi-DqQi_68m.js';
|
|
2
|
+
export { U as UpdateWabaSubscription, b as WABAClass, a as WabaAccount, c as WabaSubscriptions } from '../../WabaApi-DqQi_68m.js';
|
|
3
|
+
import '../../base-CdGDdVEl.js';
|
|
4
|
+
import '../../types/config.js';
|
|
5
|
+
import '../../enums-BZd9T2ul.js';
|
|
6
|
+
import '../../request-vYMaEfk5.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { WabaApi, WabaApi as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WabaConfigType } from './types/config.js';
|
|
2
|
+
import { H as HttpMethodsEnum } from './enums-BZd9T2ul.js';
|
|
3
|
+
import { R as RequesterClass } from './request-vYMaEfk5.js';
|
|
4
|
+
|
|
5
|
+
declare class BaseClass {
|
|
6
|
+
constructor(config: WabaConfigType);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare class BaseAPI implements BaseClass {
|
|
10
|
+
protected config: WabaConfigType;
|
|
11
|
+
protected client: RequesterClass;
|
|
12
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
13
|
+
protected sendJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
|
|
14
|
+
protected sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
|
|
15
|
+
protected sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { BaseAPI as B, BaseClass as a };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-RIL6QABY.js';var i=class extends a{commonMethod="POST";commonEndpoint="messages";constructor(e,s){super(e,s);}bodyBuilder(e,s,a,t){let n={messaging_product:"whatsapp",recipient_type:"individual",to:a,type:e,[e]:s};return t&&(n.context={message_id:t}),n}send(e){return this.sendJson(this.commonMethod,`${this.config.WA_PHONE_NUMBER_ID}/${this.commonEndpoint}`,this.config.REQUEST_TIMEOUT,e)}async audio(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("audio",s,a,t)))}async contacts(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("contacts",s,a,t)))}async document(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("document",s,a,t)))}async image(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("image",s,a,t)))}async interactive(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("interactive",s,a,t)))}async location(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("location",s,a,t)))}async sticker(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("sticker",s,a,t)))}async template(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("template",s,a,t)))}async text(e){let{body:s,to:a,replyMessageId:t,previewUrl:n}=e,o=typeof s=="string"?{body:s,preview_url:n}:{...s,preview_url:n??s.preview_url};return this.send(JSON.stringify(this.bodyBuilder("text",o,a,t)))}async video(e){let{body:s,to:a,replyMessageId:t}=e;return this.send(JSON.stringify(this.bodyBuilder("video",s,a,t)))}async status(e){let s={messaging_product:"whatsapp",status:e.status,message_id:e.messageId,...e.typingIndicator&&{typing_indicator:e.typingIndicator}};return this.send(JSON.stringify(s))}async markAsRead(e){return this.status({status:"read",messageId:e.messageId})}async showTypingIndicator(e){return this.status({status:"read",messageId:e.messageId,typingIndicator:{type:"text"}})}async interactiveList(e){return this.interactive(e)}async interactiveCtaUrl(e){return this.interactive(e)}async interactiveLocationRequest(e){return this.interactive(e)}async interactiveAddressMessage(e){return this.interactive(e)}async interactiveReplyButtons(e){return this.interactive(e)}async interactiveFlow(e){return this.interactive(e)}async reaction(e){let s={message_id:e.messageId,emoji:e.emoji};return this.send(JSON.stringify(this.bodyBuilder("reaction",s,e.to)))}};var g=i;export{i as a,g as b};//# sourceMappingURL=chunk-7QBIZCJ4.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-7QBIZCJ4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/api/messages/MessageApi.ts","../src/api/messages/index.ts"],"names":["MessagesApi","BaseAPI","config","client","type","payload","to","replyMessageId","body","params","previewUrl","textPayload","reactionPayload","messages_default"],"mappings":"oCAwCA,IAAqBA,CAAAA,CAArB,cAAyCC,CAAmC,CACvD,YAAA,CAAA,MAAA,CACA,cAAA,CAAiB,UAAA,CAElC,WAAA,CAAYC,CAAAA,CAAwBC,CAAAA,CAAwB,CACxD,KAAA,CAAMD,CAAAA,CAAQC,CAAM,EACxB,CAUA,WAAA,CACIC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACF,CACE,IAAMC,CAAAA,CAAgC,CAClC,iBAAA,CAAmB,UAAA,CACnB,cAAA,CAAgB,aAChB,EAAA,CAAAF,CAAAA,CACA,IAAA,CAAAF,CAAAA,CACA,CAACA,CAAI,EAAGC,CACZ,CAAA,CAEA,OAAIE,CAAAA,GAAgBC,CAAAA,CAAK,OAAA,CAAa,CAAE,UAAA,CAAYD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O,EAAE,CAAC,CAAC,CAC5G,CACJ,MC5TOI,CAAAA,CAAQb","file":"chunk-7QBIZCJ4.js","sourcesContent":["import { BaseAPI } from '../../types/base';\nimport type { WabaConfigType } from '../../types/config';\nimport {\n type ComponentTypesEnum,\n HttpMethodsEnum,\n type InteractiveTypesEnum,\n MessageTypesEnum,\n WabaConfigEnum,\n} from '../../types/enums';\nimport type { RequesterClass } from '../../types/request';\n\nimport type * as m from './types';\n\n/**\n * Maps each message type to its appropriate payload type\n */\nexport type MessagePayloadType<T extends MessageTypesEnum> = T extends MessageTypesEnum.Audio\n ? m.AudioMediaObject\n : T extends MessageTypesEnum.Contacts\n ? [m.ContactObject]\n : T extends MessageTypesEnum.Document\n ? m.DocumentMediaObject\n : T extends MessageTypesEnum.Image\n ? m.ImageMediaObject\n : T extends MessageTypesEnum.Interactive\n ? m.InteractiveObject\n : T extends MessageTypesEnum.Location\n ? m.LocationObject\n : T extends MessageTypesEnum.Template\n ? m.MessageTemplateObject<ComponentTypesEnum>\n : T extends MessageTypesEnum.Sticker\n ? m.StickerMediaObject\n : T extends MessageTypesEnum.Text\n ? m.TextObject\n : T extends MessageTypesEnum.Video\n ? m.VideoMediaObject\n : T extends MessageTypesEnum.Reaction\n ? { message_id: string; emoji: string }\n : never;\n\nexport default class MessagesApi extends BaseAPI implements m.MessagesClass {\n private readonly commonMethod = HttpMethodsEnum.Post;\n private readonly commonEndpoint = 'messages';\n\n constructor(config: WabaConfigType, client: RequesterClass) {\n super(config, client);\n }\n\n /**\n * Builds the request body for WhatsApp API messages\n * @param type The type of message to send\n * @param payload The message payload object\n * @param to The recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns The formatted request body\n */\n bodyBuilder<T extends MessageTypesEnum>(\n type: T,\n payload: MessagePayloadType<T>,\n to: string,\n replyMessageId?: string,\n ) {\n const body: m.MessageRequestBody<T> = {\n messaging_product: 'whatsapp',\n recipient_type: 'individual',\n to,\n type,\n [type]: payload,\n };\n\n if (replyMessageId) body['context'] = { message_id: replyMessageId };\n\n return body;\n }\n\n /**\n * Sends a request to the WhatsApp API\n * @param body The request body to send\n * @returns Promise with the API response\n */\n private send(body: BodyInit | null): Promise<m.MessagesResponse> {\n return this.sendJson(\n this.commonMethod,\n `${this.config[WabaConfigEnum.PhoneNumberId]}/${this.commonEndpoint}`,\n this.config[WabaConfigEnum.RequestTimeout],\n body,\n );\n }\n\n /**\n * Sends an audio message via WhatsApp\n * @param params The audio message parameter object\n * @returns Promise with the message response\n */\n async audio(params: m.MessageRequestParams<m.AudioMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Audio, body, to, replyMessageId)));\n }\n\n /**\n * Sends a contact card via WhatsApp\n * @param params The contact message parameter object\n * @returns Promise with the message response\n */\n async contacts(params: m.MessageRequestParams<[m.ContactObject]>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Contacts, body, to, replyMessageId)));\n }\n\n /**\n * Sends a document via WhatsApp\n * @param params The document message parameter object\n * @returns Promise with the message response\n */\n async document(params: m.MessageRequestParams<m.DocumentMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Document, body, to, replyMessageId)));\n }\n\n /**\n * Sends an image via WhatsApp\n * @param params The image message parameter object\n * @returns Promise with the message response\n */\n async image(params: m.MessageRequestParams<m.ImageMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Image, body, to, replyMessageId)));\n }\n\n /**\n * Sends an interactive message via WhatsApp\n * @param params The interactive message parameter object\n * @returns Promise with the message response\n */\n async interactive(params: m.MessageRequestParams<m.InteractiveObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Interactive, body, to, replyMessageId)));\n }\n\n /**\n * Sends a location via WhatsApp\n * @param params The location message parameter object\n * @returns Promise with the message response\n */\n async location(params: m.MessageRequestParams<m.LocationObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Location, body, to, replyMessageId)));\n }\n\n /**\n * Sends a sticker via WhatsApp\n * @param params The sticker message parameter object\n * @returns Promise with the message response\n */\n async sticker(params: m.MessageRequestParams<m.StickerMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Sticker, body, to, replyMessageId)));\n }\n\n /**\n * Sends a template message via WhatsApp\n * @param params The template message parameter object\n * @returns Promise with the message response\n */\n async template(\n params: m.MessageRequestParams<m.MessageTemplateObject<ComponentTypesEnum>>,\n ): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Template, body, to, replyMessageId)));\n }\n\n /**\n * Sends a text message via WhatsApp\n * @param params The text message parameter object\n * @returns Promise with the message response\n */\n async text(params: m.TextMessageParams): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId, previewUrl } = params;\n\n // Handle both string and TextObject types\n const textPayload: m.TextObject =\n typeof body === 'string'\n ? { body, preview_url: previewUrl }\n : { ...body, preview_url: previewUrl ?? body.preview_url };\n\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Text, textPayload, to, replyMessageId)));\n }\n\n /**\n * Sends a video message via WhatsApp\n * @param params The video message parameter object\n * @returns Promise with the message response\n */\n async video(params: m.MessageRequestParams<m.VideoMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Video, body, to, replyMessageId)));\n }\n\n /**\n * Updates message status (mark as read, etc.)\n * @param params The status update parameters\n * @returns Promise with the API response\n */\n async status(params: m.StatusParams): Promise<m.MessagesResponse> {\n const body = {\n messaging_product: 'whatsapp',\n status: params.status,\n message_id: params.messageId,\n ...(params.typingIndicator && { typing_indicator: params.typingIndicator }),\n };\n\n return this.send(JSON.stringify(body));\n }\n\n /**\n * Marks a message as read\n * @param params Object containing messageId\n * @returns Promise with the API response\n */\n async markAsRead(params: { messageId: string }): Promise<m.MessagesResponse> {\n return this.status({\n status: 'read',\n messageId: params.messageId,\n });\n }\n\n /**\n * Shows typing indicator\n * @param params Object containing messageId\n * @returns Promise with the API response\n */\n async showTypingIndicator(params: { messageId: string }): Promise<m.MessagesResponse> {\n return this.status({\n status: 'read',\n messageId: params.messageId,\n typingIndicator: { type: 'text' },\n });\n }\n\n /**\n * Sends a list interactive message\n * @param params The list interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveList(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.List }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a CTA URL interactive message\n * @param params The CTA URL interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveCtaUrl(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.CtaUrl }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a location request interactive message\n * @param params The location request interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveLocationRequest(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.LocationRequest }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends an address message interactive message\n * @param params The address message interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveAddressMessage(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.AddressMessage }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a reply buttons interactive message\n * @param params The reply buttons interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveReplyButtons(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.Button }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a flow interactive message\n * @param params The flow interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveFlow(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.Flow }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a reaction to a message\n * @param params The reaction parameters\n * @returns Promise with the message response\n */\n async reaction(params: m.ReactionParams): Promise<m.MessagesResponse> {\n const reactionPayload = {\n message_id: params.messageId,\n emoji: params.emoji,\n };\n\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Reaction, reactionPayload, params.to)));\n }\n}\n","import MessageApi from './MessageApi';\n\nexport default MessageApi;\n\nexport { MessageApi };\n\nexport type {\n AudioMediaObject,\n ContactObject,\n DocumentMediaObject,\n ImageMediaObject,\n InteractiveObject,\n LocationObject,\n MessageRequestParams,\n MessageTemplateObject,\n MessagesResponse,\n ReactionParams,\n StatusParams,\n StickerMediaObject,\n TextMessageParams,\n TextObject,\n VideoMediaObject,\n} from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-AMHQGG6Z.js"}
|