meta-cloud-api 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FlowApi-UAvzhJfV.d.ts → FlowApi-B2ffO-HD.d.ts} +1 -1
- package/dist/MessageApi-BgsSpDno.d.ts +171 -0
- package/dist/{WebhookProcessor-ByAe7Kf_.d.ts → WebhookProcessor-BXYunz4N.d.ts} +2 -2
- package/dist/{WhatsApp-BIBtT-y9.d.ts → WhatsApp-pTZPQm81.d.ts} +2 -2
- package/dist/api/flow/index.d.ts +2 -2
- package/dist/api/index.d.ts +4 -3
- package/dist/api/index.js +1 -1
- 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 +2 -2
- package/dist/{chunk-B7DCL6I7.js → chunk-BAOZ4U74.js} +3 -3
- package/dist/{chunk-B7DCL6I7.js.map → chunk-BAOZ4U74.js.map} +1 -1
- package/dist/{chunk-HJGN3PO4.js → chunk-JPGXONBQ.js} +3 -3
- package/dist/{chunk-HJGN3PO4.js.map → chunk-JPGXONBQ.js.map} +1 -1
- package/dist/{chunk-OA2SW4AF.js → chunk-NOJFGTRT.js} +2 -2
- package/dist/{chunk-OA2SW4AF.js.map → chunk-NOJFGTRT.js.map} +1 -1
- package/dist/{chunk-UCBYECNQ.js → chunk-YXZ4L2OK.js} +2 -2
- package/dist/{chunk-UCBYECNQ.js.map → chunk-YXZ4L2OK.js.map} +1 -1
- package/dist/{MessageApi-Circorzz.d.ts → common-BiRA_uz3.d.ts} +8 -170
- package/dist/{common-DDXsNyLF.d.ts → common-lV0NsO7t.d.ts} +1 -1
- package/dist/core/webhook/frameworks/express.d.ts +6 -5
- package/dist/core/webhook/frameworks/express.js +1 -1
- package/dist/core/webhook/frameworks/nextjs.d.ts +6 -5
- package/dist/core/webhook/frameworks/nextjs.js +1 -1
- package/dist/core/webhook/index.d.ts +6 -5
- package/dist/core/webhook/index.js +1 -1
- package/dist/core/whatsapp/index.d.ts +5 -4
- package/dist/core/whatsapp/index.js +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -1
- package/dist/isMetaError-CXWJwW58.d.ts +63 -0
- package/dist/utils/index.d.ts +3 -62
- package/package.json +24 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/webhook/frameworks/express.ts"],"names":["webhookHandler","config","processor","WebhookProcessor","req","res","next","mode","token","challenge","result","key","value","fullUrl","constructFullUrl","webRequest","error"],"mappings":"sCA6BO,SAASA,CAAAA,CAAeC,CAAAA,CAA8B,CACzD,IAAMC,GAAAA,CAAY,IAAIC,CAAAA,CAAiBF,CAAM,CAAA,CAE7C,OAAO,CAEH,OAAA,CAAS,MAAOG,CAAAA,CAAqBC,CAAAA,CAAsBC,CAAAA,GAAuB,CAC9E,GAAI,CACA,GAAIF,CAAAA,CAAI,MAAA,GAAW,KAAA,CAAO,CACtB,GAAM,CAAE,UAAA,CAAYG,CAAAA,CAAM,kBAAA,CAAoBC,CAAAA,CAAO,eAAA,CAAiBC,CAAU,CAAA,CAAIL,CAAAA,CAAI,KAAA,CAElFM,CAAAA,CAAS,MAAMR,GAAAA,CAAU,mBAAA,CAC1BK,CAAAA,EAAmB,IAAA,CACnBC,CAAAA,EAAoB,IAAA,CACpBC,CAAAA,EAAwB,IAC7B,CAAA,CAEA,OAAA,MAAA,CAAO,OAAA,CAAQC,CAAAA,CAAO,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAACC,CAAAA,CAAKC,CAAK,CAAA,GAAM,CACrDP,CAAAA,CAAI,SAAA,CAAUM,CAAAA,CAAKC,CAAK,EAC5B,CAAC,CAAA,CAEMP,CAAAA,CAAI,MAAA,CAAOK,CAAAA,CAAO,MAAM,CAAA,CAAE,IAAA,CAAKA,CAAAA,CAAO,IAAI,CACrD,CAEA,GAAIN,CAAAA,CAAI,MAAA,GAAW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AAA,GAAW,MAAA,CAAS,IAAA,CAAK,SAAA,CAAUA,CAAAA,CAAI,IAAI,CAAA,CAAI,KAAA,CAC7D,CAAC,CAAA,CAEKM,CAAAA,CAAS,MAAMR,GAAAA,CAAU,WAAA,CAAYa,CAAU,CAAA,CAErD,OAAA,MAAA,CAAO,OAAA,CAAQL,CAAAA,CAAO,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAACC,CAAAA,CAAKC,CAAK,CAAA,GAAM,CACrDP,CAAAA,CAAI,SAAA,CAAUM,CAAAA,CAAKC,CAAK,EAC5B,CAAC,CAAA,CAEMP,CAAAA,CAAI,MAAA,CAAOK,CAAAA,CAAO,MAAM,CAAA,CAAE,IAAA,CAAKA,CAAAA,CAAO,IAAI,CACrD,CAAA,MAASM,CAAAA,CAAO,CACZV,CAAAA,CAAKU,CAAK,CAAA,CACV,MACJ,CACJ,CAAA,CAGA,SAAA,CAAAd,GACJ,CACJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/core/webhook/frameworks/express.ts"],"names":["webhookHandler","config","processor","WebhookProcessor","req","res","next","mode","token","challenge","result","key","value","fullUrl","constructFullUrl","webRequest","error"],"mappings":"sCA6BO,SAASA,CAAAA,CAAeC,CAAAA,CAA8B,CACzD,IAAMC,GAAAA,CAAY,IAAIC,CAAAA,CAAiBF,CAAM,CAAA,CAE7C,OAAO,CAEH,OAAA,CAAS,MAAOG,CAAAA,CAAqBC,CAAAA,CAAsBC,CAAAA,GAAuB,CAC9E,GAAI,CACA,GAAIF,CAAAA,CAAI,MAAA,GAAW,KAAA,CAAO,CACtB,GAAM,CAAE,UAAA,CAAYG,CAAAA,CAAM,kBAAA,CAAoBC,CAAAA,CAAO,eAAA,CAAiBC,CAAU,CAAA,CAAIL,CAAAA,CAAI,KAAA,CAElFM,CAAAA,CAAS,MAAMR,GAAAA,CAAU,mBAAA,CAC1BK,CAAAA,EAAmB,IAAA,CACnBC,CAAAA,EAAoB,IAAA,CACpBC,CAAAA,E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ACJ,CAAA,CAGA,IAAA,CAAM,MAAOZ,CAAAA,CAAqBC,CAAAA,CAAsBC,CAAAA,GAAuB,CAC3E,GAAI,CAEA,IAAMO,CAAAA,CAAUC,CAAAA,CAAiBV,CAAAA,CAAI,OAAA,CAASA,CAAAA,CAAI,GAAG,CAAA,CAC/CW,CAAAA,CAAa,IAAI,UAAA,CAAW,OAAA,CAAQF,CAAAA,CAAS,CAC/C,MAAA,CAAQT,CAAAA,CAAI,OACZ,OAAA,CAASA,CAAAA,CAAI,OAAA,CACb,IAAA,CAAMA,CAAAA,CAAI,MAAA,GAAW,MAAA,CAAS,IAAA,CAAK,SAAA,CAAUA,CAAAA,CAAI,IAAI,CAAA,CAAI,KAAA,CAC7D,CAAC,CAAA,CAEKM,CAAAA,CAAS,MAAMR,GAAAA,CAAU,WAAA,CAAYa,CAAU,CAAA,CAErD,OAAA,MAAA,CAAO,OAAA,CAAQL,CAAAA,CAAO,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAACC,CAAAA,CAAKC,CAAK,CAAA,GAAM,CACrDP,CAAAA,CAAI,SAAA,CAAUM,CAAAA,CAAKC,CAAK,EAC5B,CAAC,CAAA,CAEMP,CAAAA,CAAI,MAAA,CAAOK,CAAAA,CAAO,MAAM,CAAA,CAAE,IAAA,CAAKA,CAAAA,CAAO,IAAI,CACrD,CAAA,MAASM,CAAAA,CAAO,CACZV,CAAAA,CAAKU,CAAK,CAAA,CACV,MACJ,CACJ,CAAA,CAGA,SAAA,CAAAd,GACJ,CACJ","file":"chunk-NOJFGTRT.js","sourcesContent":["import { WhatsAppConfig } from '../../../types/config';\nimport { WebhookProcessor } from '../WebhookProcessor';\nimport { constructFullUrl } from '../utils/webhookUtils';\n\n// Express-like interfaces to avoid direct Express dependency\nexport interface ExpressRequest {\n method: string;\n url: string;\n headers: Record<string, string | string[] | undefined>;\n body?: any;\n query: Record<string, any>;\n rawBody?: any;\n}\n\nexport interface ExpressResponse {\n status(code: number): ExpressResponse;\n json(data: any): ExpressResponse;\n send(data?: any): ExpressResponse;\n setHeader(name: string, value: string): void;\n}\n\nexport interface NextFunction {\n (error?: any): void;\n}\n\nexport interface ExpressWebhookConfig extends WhatsAppConfig {\n path?: string;\n}\n\nexport function webhookHandler(config: ExpressWebhookConfig) {\n const processor = new WebhookProcessor(config);\n\n return {\n // Main webhook handler\n webhook: async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {\n try {\n if (req.method === 'GET') {\n const { 'hub.mode': mode, 'hub.verify_token': token, 'hub.challenge': challenge } = req.query;\n\n const result = await processor.processVerification(\n (mode as string) || null,\n (token as string) || null,\n (challenge as string) || null,\n );\n\n Object.entries(result.headers).forEach(([key, value]) => {\n res.setHeader(key, value);\n });\n\n return res.status(result.status).send(result.body);\n }\n\n if (req.method === 'POST') {\n // Create Web Standard Request from Express request with proper full URL\n const fullUrl = constructFullUrl(req.headers, req.url);\n const webRequest = new globalThis.Request(fullUrl, {\n method: req.method,\n headers: req.headers as HeadersInit,\n body: JSON.stringify(req.body),\n });\n\n const result = await processor.processWebhook(webRequest);\n\n Object.entries(result.headers).forEach(([key, value]) => {\n res.setHeader(key, value);\n });\n\n return res.status(result.status).send(result.body);\n }\n\n return res.status(405).json({ error: 'Method Not Allowed' });\n } catch (error) {\n next(error);\n return;\n }\n },\n\n // Flow handler\n flow: async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {\n try {\n // Create Web Standard Request from Express request with proper full URL\n const fullUrl = constructFullUrl(req.headers, req.url);\n const webRequest = new globalThis.Request(fullUrl, {\n method: req.method,\n headers: req.headers as HeadersInit,\n body: req.method === 'POST' ? JSON.stringify(req.body) : undefined,\n });\n\n const result = await processor.processFlow(webRequest);\n\n Object.entries(result.headers).forEach(([key, value]) => {\n res.setHeader(key, value);\n });\n\n return res.status(result.status).send(result.body);\n } catch (error) {\n next(error);\n return;\n }\n },\n\n // Expose processor for handler registration\n processor,\n };\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {d,c}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {d,c}from'./chunk-JPGXONBQ.js';function y(c$1){let d$1=new d(c$1);return {webhook:async(e,t)=>{try{if(e.method==="GET"){let{"hub.mode":s,"hub.verify_token":n,"hub.challenge":r}=e.query,o=await d$1.processVerification(s||null,n||null,r||null);return Object.entries(o.headers).forEach(([a,h])=>{t.setHeader(a,h);}),t.status(o.status).send(o.body)}if(e.method==="POST"){let s=c(e.headers,e.url),n=new Request(s,{method:e.method,headers:e.headers,body:JSON.stringify(e.body)}),r=await d$1.processWebhook(n);return Object.entries(r.headers).forEach(([o,a])=>{t.setHeader(o,a);}),t.status(r.status).send(r.body)}return t.status(405).json({error:"Method Not Allowed"})}catch(s){return console.error("Webhook error:",s),t.status(500).json({error:"Internal Server Error"})}},flow:async(e,t)=>{try{let s=c(e.headers,e.url),n=new Request(s,{method:e.method,headers:e.headers,body:e.method==="POST"?JSON.stringify(e.body):void 0}),r=await d$1.processFlow(n);return Object.entries(r.headers).forEach(([o,a])=>{t.setHeader(o,a);}),t.status(r.status).send(r.body)}catch(s){return console.error("Flow error:",s),t.status(500).json({error:"Internal Server Error"})}},processor:d$1}}export{y as a};//# sourceMappingURL=chunk-YXZ4L2OK.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-YXZ4L2OK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/webhook/frameworks/nextjs.ts"],"names":["webhookHandler","config","processor","WebhookProcessor","req","res","mode","token","challenge","result","key","value","fullUrl","constructFullUrl","webRequest","error"],"mappings":"sCA0BO,SAASA,CAAAA,CACZC,GAAAA,CACF,CACE,IAAMC,GAAAA,CAAY,IAAIC,CAAAA,CAAiBF,GAAM,CAAA,CAE7C,OAAO,CAEH,OAAA,CAAS,MAAOG,CAAAA,CAAeC,CAAAA,GAAmB,CAC9C,GAAI,CACA,GAAID,CAAAA,CAAI,MAAA,GAAW,KAAA,CAAO,CACt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AG,CAAA,CAAE,IAAA,CAAK,CAAE,KAAA,CAAO,uBAAwB,CAAC,CAClE,CACJ,CAAA,CAGA,SAAA,CAAAH,GACJ,CACJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/core/webhook/frameworks/nextjs.ts"],"names":["webhookHandler","config","processor","WebhookProcessor","req","res","mode","token","challenge","result","key","value","fullUrl","constructFullUrl","webRequest","error"],"mappings":"sCA0BO,SAASA,CAAAA,CACZC,GAAAA,CACF,CACE,IAAMC,GAAAA,CAAY,IAAIC,CAAAA,CAAiBF,GAAM,CAAA,CAE7C,OAAO,CAEH,OAAA,CAAS,MAAOG,CAAAA,CAAeC,CAAAA,GAAmB,CAC9C,GAAI,CACA,GAAID,CAAAA,CAAI,MAAA,GAAW,KAAA,CAAO,CACtB,GAAM,CAAE,UAAA,CAAYE,CAAAA,CAAM,kBAAA,CAAoBC,EAAO,eAAA,CAAiBC,CAAU,CAAA,CAAIJ,CAAAA,CAAI,KAAA,CAElFK,CAAAA,CAAS,MAAMP,GAAAA,CAAU,mBAAA,CAC1BI,CAAAA,EAAmB,IAAA,CACnBC,CAAAA,EAAoB,IAAA,CACpBC,CAAAA,EAAwB,IAC7B,CAAA,CAEA,cAAO,OAAA,CAAQC,CAAAA,CAAO,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAACC,CAAAA,CAAKC,CAAK,CAAA,GAAM,CACrDN,CAAAA,CAAI,SAAA,CAAUK,CAAAA,CAAKC,CAAK,EAC5B,CAAC,CAAA,CAEMN,CAAAA,CAAI,MAAA,CAAOI,CAAAA,CAAO,MAAM,CAAA,CAAE,IAAA,CAAKA,CAAAA,CAAO,IAAI,CACrD,CAEA,GAAIL,CAAAA,CAAI,MAAA,GAAW,MAAA,CAAQ,CAEvB,IAAMQ,CAAAA,CAAUC,CAAAA,CAAiBT,CAAAA,CAAI,OAAA,CAASA,CAAAA,CAAI,GAAG,CAAA,CAE/CU,CAAAA,CAAa,IAAI,OAAA,CAAQF,CAAA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AA,CAEKK,CAAAA,CAAS,MAAMP,GAAAA,CAAU,WAAA,CAAYY,CAAU,CAAA,CAErD,OAAA,MAAA,CAAO,OAAA,CAAQL,CAAAA,CAAO,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAACC,CAAAA,CAAKC,CAAK,CAAA,GAAM,CACrDN,CAAAA,CAAI,SAAA,CAAUK,CAAAA,CAAKC,CAAK,EAC5B,CAAC,CAAA,CAEMN,CAAAA,CAAI,MAAA,CAAOI,CAAAA,CAAO,MAAM,CAAA,CAAE,IAAA,CAAKA,CAAAA,CAAO,IAAI,CACrD,CAAA,MAASM,CAAAA,CAAO,CACZ,OAAA,OAAA,CAAQ,MAAM,aAAA,CAAeA,CAAK,CAAA,CAC3BV,CAAAA,CAAI,MAAA,CAAO,GAAG,CAAA,CAAE,IAAA,CAAK,CAAE,KAAA,CAAO,uBAAwB,CAAC,CAClE,CACJ,CAAA,CAGA,SAAA,CAAAH,GACJ,CACJ","file":"chunk-YXZ4L2OK.js","sourcesContent":["import { WhatsAppConfig } from '../../../types/config';\nimport { WebhookProcessor } from '../WebhookProcessor';\nimport { constructFullUrl } from '../utils/webhookUtils';\n\n// Generic interfaces for better type compatibility\nexport interface BaseApiRequest {\n method?: string;\n url?: string;\n headers: Record<string, string | string[] | undefined>;\n body?: any;\n query: Partial<Record<string, string | string[]>>;\n rawBody?: any;\n}\n\nexport interface BaseApiResponse {\n status(code: number): any;\n json(data: any): void | any;\n send(data?: any): void | any;\n setHeader(name: string, value: string): void;\n}\n\nexport interface NextJsWebhookConfig extends WhatsAppConfig {\n // Next.js specific config can be added here\n}\n\n// Generic webhook handler that accepts any compatible request/response types\nexport function webhookHandler<TRequest extends BaseApiRequest, TResponse extends BaseApiResponse>(\n config: NextJsWebhookConfig,\n) {\n const processor = new WebhookProcessor(config);\n\n return {\n // Main webhook handler\n webhook: async (req: TRequest, res: TResponse) => {\n try {\n if (req.method === 'GET') {\n const { 'hub.mode': mode, 'hub.verify_token': token, 'hub.challenge': challenge } = req.query;\n\n const result = await processor.processVerification(\n (mode as string) || null,\n (token as string) || null,\n (challenge as string) || null,\n );\n\n Object.entries(result.headers).forEach(([key, value]) => {\n res.setHeader(key, value);\n });\n\n return res.status(result.status).send(result.body);\n }\n\n if (req.method === 'POST') {\n // Create Web Standard Request from Next.js request\n const fullUrl = constructFullUrl(req.headers, req.url);\n\n const webRequest = new Request(fullUrl, {\n method: req.method,\n headers: req.headers as HeadersInit,\n body: JSON.stringify(req.body),\n });\n\n const result = await processor.processWebhook(webRequest);\n\n Object.entries(result.headers).forEach(([key, value]) => {\n res.setHeader(key, value);\n });\n\n return res.status(result.status).send(result.body);\n }\n\n return res.status(405).json({ error: 'Method Not Allowed' });\n } catch (error) {\n console.error('Webhook error:', error);\n return res.status(500).json({ error: 'Internal Server Error' });\n }\n },\n\n // Flow handler\n flow: async (req: TRequest, res: TResponse) => {\n try {\n const fullUrl = constructFullUrl(req.headers, req.url);\n\n const webRequest = new Request(fullUrl, {\n method: req.method,\n headers: req.headers as HeadersInit,\n body: req.method === 'POST' ? JSON.stringify(req.body) : undefined,\n });\n\n const result = await processor.processFlow(webRequest);\n\n Object.entries(result.headers).forEach(([key, value]) => {\n res.setHeader(key, value);\n });\n\n return res.status(result.status).send(result.body);\n } catch (error) {\n console.error('Flow error:', error);\n return res.status(500).json({ error: 'Internal Server Error' });\n }\n },\n\n // Expose processor for handler registration\n processor,\n };\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as BaseClass, B as BaseAPI } from './base-CdGDdVEl.js';
|
|
2
|
-
import { WabaConfigType } from './types/config.js';
|
|
3
1
|
import { I as InteractiveTypesEnum, C as ComponentTypesEnum, L as LanguagesEnum, P as ParametersTypesEnum, i as CurrencyCodesEnum, S as SubTypeEnum, B as ButtonPositionEnum, M as MessageTypesEnum } from './enums-BZd9T2ul.js';
|
|
4
|
-
import { a as
|
|
2
|
+
import { a as BaseClass } from './base-CdGDdVEl.js';
|
|
3
|
+
import { a as GeneralRequestBody } from './request-vYMaEfk5.js';
|
|
5
4
|
|
|
6
5
|
interface ReactionParams {
|
|
7
6
|
messageId: string;
|
|
@@ -59,7 +58,7 @@ type ActionObject = {
|
|
|
59
58
|
buttons?: ReplyButtonObject[];
|
|
60
59
|
catalog_id?: string;
|
|
61
60
|
product_retailer_id?: string;
|
|
62
|
-
sections?: SectionObject;
|
|
61
|
+
sections?: SectionObject[];
|
|
63
62
|
};
|
|
64
63
|
type HeaderObject = {
|
|
65
64
|
type: 'document' | 'image' | 'text' | 'video';
|
|
@@ -322,10 +321,13 @@ type ComponentObject<T extends ComponentTypesEnum> = {
|
|
|
322
321
|
parameters: (CurrencyParametersObject | DateTimeParametersObject | DocumentParametersObject | ImageParametersObject | TextParametersObject | VideoParametersObject | CouponCodeParametersObject)[];
|
|
323
322
|
};
|
|
324
323
|
type ButtonComponentObject = ComponentObject<ComponentTypesEnum.Button> & {
|
|
325
|
-
parameters
|
|
324
|
+
parameters?: (TextParametersObject | PayloadParametersObject)[];
|
|
326
325
|
sub_type: SubTypeEnum;
|
|
327
326
|
index: ButtonPositionEnum;
|
|
328
327
|
};
|
|
328
|
+
type PayloadParametersObject = ParametersObject<ParametersTypesEnum.Payload> & {
|
|
329
|
+
payload: string;
|
|
330
|
+
};
|
|
329
331
|
type MessageTemplateObject<T extends ComponentTypesEnum> = {
|
|
330
332
|
name: string;
|
|
331
333
|
language: LanguageObject;
|
|
@@ -420,168 +422,4 @@ declare class MessagesClass extends BaseClass {
|
|
|
420
422
|
status(params: StatusParams): Promise<MessagesResponse>;
|
|
421
423
|
}
|
|
422
424
|
|
|
423
|
-
|
|
424
|
-
* Maps each message type to its appropriate payload type
|
|
425
|
-
*/
|
|
426
|
-
type MessagePayloadType<T extends MessageTypesEnum> = T extends MessageTypesEnum.Audio ? AudioMediaObject : T extends MessageTypesEnum.Contacts ? [ContactObject] : T extends MessageTypesEnum.Document ? DocumentMediaObject$1 : T extends MessageTypesEnum.Image ? ImageMediaObject$1 : T extends MessageTypesEnum.Interactive ? InteractiveObject : T extends MessageTypesEnum.Location ? LocationObject : T extends MessageTypesEnum.Template ? MessageTemplateObject<ComponentTypesEnum> : T extends MessageTypesEnum.Sticker ? StickerMediaObject : T extends MessageTypesEnum.Text ? TextObject : T extends MessageTypesEnum.Video ? VideoMediaObject$1 : T extends MessageTypesEnum.Reaction ? {
|
|
427
|
-
message_id: string;
|
|
428
|
-
emoji: string;
|
|
429
|
-
} : never;
|
|
430
|
-
declare class MessagesApi extends BaseAPI implements MessagesClass {
|
|
431
|
-
private readonly commonMethod;
|
|
432
|
-
private readonly commonEndpoint;
|
|
433
|
-
constructor(config: WabaConfigType, client: RequesterClass);
|
|
434
|
-
/**
|
|
435
|
-
* Builds the request body for WhatsApp API messages
|
|
436
|
-
* @param type The type of message to send
|
|
437
|
-
* @param payload The message payload object
|
|
438
|
-
* @param to The recipient's phone number
|
|
439
|
-
* @param replyMessageId Optional message ID to reply to
|
|
440
|
-
* @returns The formatted request body
|
|
441
|
-
*/
|
|
442
|
-
bodyBuilder<T extends MessageTypesEnum>(type: T, payload: MessagePayloadType<T>, to: string, replyMessageId?: string): MessageRequestBody<T>;
|
|
443
|
-
/**
|
|
444
|
-
* Sends a request to the WhatsApp API
|
|
445
|
-
* @param body The request body to send
|
|
446
|
-
* @returns Promise with the API response
|
|
447
|
-
*/
|
|
448
|
-
private send;
|
|
449
|
-
/**
|
|
450
|
-
* Sends an audio message via WhatsApp
|
|
451
|
-
* @param params The audio message parameter object
|
|
452
|
-
* @returns Promise with the message response
|
|
453
|
-
*/
|
|
454
|
-
audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
|
|
455
|
-
/**
|
|
456
|
-
* Sends a contact card via WhatsApp
|
|
457
|
-
* @param params The contact message parameter object
|
|
458
|
-
* @returns Promise with the message response
|
|
459
|
-
*/
|
|
460
|
-
contacts(params: MessageRequestParams<[ContactObject]>): Promise<MessagesResponse>;
|
|
461
|
-
/**
|
|
462
|
-
* Sends a document via WhatsApp
|
|
463
|
-
* @param params The document message parameter object
|
|
464
|
-
* @returns Promise with the message response
|
|
465
|
-
*/
|
|
466
|
-
document(params: MessageRequestParams<DocumentMediaObject$1>): Promise<MessagesResponse>;
|
|
467
|
-
/**
|
|
468
|
-
* Sends an image via WhatsApp
|
|
469
|
-
* @param params The image message parameter object
|
|
470
|
-
* @returns Promise with the message response
|
|
471
|
-
*/
|
|
472
|
-
image(params: MessageRequestParams<ImageMediaObject$1>): Promise<MessagesResponse>;
|
|
473
|
-
/**
|
|
474
|
-
* Sends an interactive message via WhatsApp
|
|
475
|
-
* @param params The interactive message parameter object
|
|
476
|
-
* @returns Promise with the message response
|
|
477
|
-
*/
|
|
478
|
-
interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
|
|
479
|
-
/**
|
|
480
|
-
* Sends a location via WhatsApp
|
|
481
|
-
* @param params The location message parameter object
|
|
482
|
-
* @returns Promise with the message response
|
|
483
|
-
*/
|
|
484
|
-
location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
|
|
485
|
-
/**
|
|
486
|
-
* Sends a sticker via WhatsApp
|
|
487
|
-
* @param params The sticker message parameter object
|
|
488
|
-
* @returns Promise with the message response
|
|
489
|
-
*/
|
|
490
|
-
sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
|
|
491
|
-
/**
|
|
492
|
-
* Sends a template message via WhatsApp
|
|
493
|
-
* @param params The template message parameter object
|
|
494
|
-
* @returns Promise with the message response
|
|
495
|
-
*/
|
|
496
|
-
template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
|
|
497
|
-
/**
|
|
498
|
-
* Sends a text message via WhatsApp
|
|
499
|
-
* @param params The text message parameter object
|
|
500
|
-
* @returns Promise with the message response
|
|
501
|
-
*/
|
|
502
|
-
text(params: TextMessageParams): Promise<MessagesResponse>;
|
|
503
|
-
/**
|
|
504
|
-
* Sends a video message via WhatsApp
|
|
505
|
-
* @param params The video message parameter object
|
|
506
|
-
* @returns Promise with the message response
|
|
507
|
-
*/
|
|
508
|
-
video(params: MessageRequestParams<VideoMediaObject$1>): Promise<MessagesResponse>;
|
|
509
|
-
/**
|
|
510
|
-
* Updates message status (mark as read, etc.)
|
|
511
|
-
* @param params The status update parameters
|
|
512
|
-
* @returns Promise with the API response
|
|
513
|
-
*/
|
|
514
|
-
status(params: StatusParams): Promise<MessagesResponse>;
|
|
515
|
-
/**
|
|
516
|
-
* Marks a message as read
|
|
517
|
-
* @param params Object containing messageId
|
|
518
|
-
* @returns Promise with the API response
|
|
519
|
-
*/
|
|
520
|
-
markAsRead(params: {
|
|
521
|
-
messageId: string;
|
|
522
|
-
}): Promise<MessagesResponse>;
|
|
523
|
-
/**
|
|
524
|
-
* Shows typing indicator
|
|
525
|
-
* @param params Object containing messageId
|
|
526
|
-
* @returns Promise with the API response
|
|
527
|
-
*/
|
|
528
|
-
showTypingIndicator(params: {
|
|
529
|
-
messageId: string;
|
|
530
|
-
}): Promise<MessagesResponse>;
|
|
531
|
-
/**
|
|
532
|
-
* Sends a list interactive message
|
|
533
|
-
* @param params The list interactive message parameters
|
|
534
|
-
* @returns Promise with the message response
|
|
535
|
-
*/
|
|
536
|
-
interactiveList(params: MessageRequestParams<InteractiveObject & {
|
|
537
|
-
type: InteractiveTypesEnum.List;
|
|
538
|
-
}>): Promise<MessagesResponse>;
|
|
539
|
-
/**
|
|
540
|
-
* Sends a CTA URL interactive message
|
|
541
|
-
* @param params The CTA URL interactive message parameters
|
|
542
|
-
* @returns Promise with the message response
|
|
543
|
-
*/
|
|
544
|
-
interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
|
|
545
|
-
type: InteractiveTypesEnum.CtaUrl;
|
|
546
|
-
}>): Promise<MessagesResponse>;
|
|
547
|
-
/**
|
|
548
|
-
* Sends a location request interactive message
|
|
549
|
-
* @param params The location request interactive message parameters
|
|
550
|
-
* @returns Promise with the message response
|
|
551
|
-
*/
|
|
552
|
-
interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
|
|
553
|
-
type: InteractiveTypesEnum.LocationRequest;
|
|
554
|
-
}>): Promise<MessagesResponse>;
|
|
555
|
-
/**
|
|
556
|
-
* Sends an address message interactive message
|
|
557
|
-
* @param params The address message interactive message parameters
|
|
558
|
-
* @returns Promise with the message response
|
|
559
|
-
*/
|
|
560
|
-
interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
|
|
561
|
-
type: InteractiveTypesEnum.AddressMessage;
|
|
562
|
-
}>): Promise<MessagesResponse>;
|
|
563
|
-
/**
|
|
564
|
-
* Sends a reply buttons interactive message
|
|
565
|
-
* @param params The reply buttons interactive message parameters
|
|
566
|
-
* @returns Promise with the message response
|
|
567
|
-
*/
|
|
568
|
-
interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
|
|
569
|
-
type: InteractiveTypesEnum.Button;
|
|
570
|
-
}>): Promise<MessagesResponse>;
|
|
571
|
-
/**
|
|
572
|
-
* Sends a flow interactive message
|
|
573
|
-
* @param params The flow interactive message parameters
|
|
574
|
-
* @returns Promise with the message response
|
|
575
|
-
*/
|
|
576
|
-
interactiveFlow(params: MessageRequestParams<InteractiveObject & {
|
|
577
|
-
type: InteractiveTypesEnum.Flow;
|
|
578
|
-
}>): Promise<MessagesResponse>;
|
|
579
|
-
/**
|
|
580
|
-
* Sends a reaction to a message
|
|
581
|
-
* @param params The reaction parameters
|
|
582
|
-
* @returns Promise with the message response
|
|
583
|
-
*/
|
|
584
|
-
reaction(params: ReactionParams): Promise<MessagesResponse>;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
export { type AudioMediaObject as A, type ContactObject as C, type DocumentMediaObject$1 as D, type ImageMediaObject$1 as I, type LocationObject as L, MessagesApi as M, type ReactionParams as R, type StatusParams as S, type TextMessageParams as T, type VideoMediaObject$1 as V, type InteractiveObject as a, type MessageRequestParams as b, type MessagesResponse as c, type MessageTemplateObject as d, type StickerMediaObject as e, type TextObject as f };
|
|
425
|
+
export { type AudioMediaObject as A, type ContactObject as C, type DocumentMediaObject$1 as D, type ImageMediaObject$1 as I, type LocationObject as L, type MessageRequestParams as M, type NameObject as N, type ReactionParams as R, type StatusParams as S, type TextMessageParams as T, type VideoMediaObject$1 as V, type InteractiveObject as a, type MessagesResponse as b, type MessageTemplateObject as c, type StickerMediaObject as d, type TextObject as e, MessagesClass as f, type MessageRequestBody as g, type AddressesObject as h };
|
|
@@ -373,4 +373,4 @@ interface FlowClass {
|
|
|
373
373
|
}): Promise<FlowMigrationResponse>;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
export { type CreateFlowResponse as C,
|
|
376
|
+
export { type CreateFlowResponse as C, FlowTypeEnum as F, type UpdateFlowResponse as U, type ValidateFlowJsonResponse as V, type FlowEndpointRequest as a, type FlowEndpointResponse as b, type Flow as c, type FlowType as d, FlowActionEnum as e, type FlowAssetsResponse as f, FlowCategoryEnum as g, type FlowClass as h, type FlowMigrationResponse as i, type FlowPreviewResponse as j, type FlowsListResponse as k, FlowStatusEnum as l, type FlowValidationError as m, type FlowDataExchangeRequest as n, type FlowErrorNotificationRequest as o, type FlowHealthCheckRequest as p };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { WhatsAppConfig } from '../../../types/config.js';
|
|
2
|
-
import { c as WebhookProcessor } from '../../../WebhookProcessor-
|
|
2
|
+
import { c as WebhookProcessor } from '../../../WebhookProcessor-BXYunz4N.js';
|
|
3
3
|
import '../../../enums-BZd9T2ul.js';
|
|
4
|
-
import '../../../common-
|
|
4
|
+
import '../../../common-lV0NsO7t.js';
|
|
5
5
|
import '../../../request-vYMaEfk5.js';
|
|
6
|
-
import '../../../WhatsApp-
|
|
6
|
+
import '../../../WhatsApp-pTZPQm81.js';
|
|
7
7
|
import '../../../httpsClient-v4gmltzS.js';
|
|
8
8
|
import 'https';
|
|
9
9
|
import '../../../EncryptionApi-D7pt-OXT.js';
|
|
10
10
|
import '../../../base-CdGDdVEl.js';
|
|
11
|
-
import '../../../FlowApi-
|
|
11
|
+
import '../../../FlowApi-B2ffO-HD.js';
|
|
12
12
|
import '../../../MediaApi-BrEKpqi_.js';
|
|
13
|
-
import '../../../MessageApi-
|
|
13
|
+
import '../../../MessageApi-BgsSpDno.js';
|
|
14
|
+
import '../../../common-BiRA_uz3.js';
|
|
14
15
|
import '../../../PhoneNumberApi-DKlu9PHl.js';
|
|
15
16
|
import '../../../BusinessProfileApi-WXscSgo-.js';
|
|
16
17
|
import '../../../QrCodeApi-7vDwIBHR.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as webhookHandler}from'../../../chunk-
|
|
1
|
+
export{a as webhookHandler}from'../../../chunk-NOJFGTRT.js';import'../../../chunk-JPGXONBQ.js';import'../../../chunk-WGGN32O2.js';import'../../../chunk-BAOZ4U74.js';import'../../../chunk-FKXSL2JK.js';import'../../../chunk-AMHQGG6Z.js';import'../../../chunk-VHAODWCN.js';import'../../../chunk-JPAV644F.js';import'../../../chunk-PHPQ5HP3.js';import'../../../chunk-IYSR44P6.js';import'../../../chunk-SNNRWNGZ.js';import'../../../chunk-L4ESAO2S.js';import'../../../chunk-7QBIZCJ4.js';import'../../../chunk-JXCLRKQ7.js';import'../../../chunk-LV3TULSI.js';import'../../../chunk-CRZ7EUYR.js';import'../../../chunk-JC6YMVID.js';import'../../../chunk-NLF2JGYY.js';import'../../../chunk-FSKBLPGE.js';import'../../../chunk-MJEG3K4V.js';import'../../../chunk-RIL6QABY.js';import'../../../chunk-KMAH6636.js';//# sourceMappingURL=express.js.map
|
|
2
2
|
//# sourceMappingURL=express.js.map
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { WhatsAppConfig } from '../../../types/config.js';
|
|
2
|
-
import { c as WebhookProcessor } from '../../../WebhookProcessor-
|
|
2
|
+
import { c as WebhookProcessor } from '../../../WebhookProcessor-BXYunz4N.js';
|
|
3
3
|
import '../../../enums-BZd9T2ul.js';
|
|
4
|
-
import '../../../common-
|
|
4
|
+
import '../../../common-lV0NsO7t.js';
|
|
5
5
|
import '../../../request-vYMaEfk5.js';
|
|
6
|
-
import '../../../WhatsApp-
|
|
6
|
+
import '../../../WhatsApp-pTZPQm81.js';
|
|
7
7
|
import '../../../httpsClient-v4gmltzS.js';
|
|
8
8
|
import 'https';
|
|
9
9
|
import '../../../EncryptionApi-D7pt-OXT.js';
|
|
10
10
|
import '../../../base-CdGDdVEl.js';
|
|
11
|
-
import '../../../FlowApi-
|
|
11
|
+
import '../../../FlowApi-B2ffO-HD.js';
|
|
12
12
|
import '../../../MediaApi-BrEKpqi_.js';
|
|
13
|
-
import '../../../MessageApi-
|
|
13
|
+
import '../../../MessageApi-BgsSpDno.js';
|
|
14
|
+
import '../../../common-BiRA_uz3.js';
|
|
14
15
|
import '../../../PhoneNumberApi-DKlu9PHl.js';
|
|
15
16
|
import '../../../BusinessProfileApi-WXscSgo-.js';
|
|
16
17
|
import '../../../QrCodeApi-7vDwIBHR.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as webhookHandler}from'../../../chunk-
|
|
1
|
+
export{a as webhookHandler}from'../../../chunk-YXZ4L2OK.js';import'../../../chunk-JPGXONBQ.js';import'../../../chunk-WGGN32O2.js';import'../../../chunk-BAOZ4U74.js';import'../../../chunk-FKXSL2JK.js';import'../../../chunk-AMHQGG6Z.js';import'../../../chunk-VHAODWCN.js';import'../../../chunk-JPAV644F.js';import'../../../chunk-PHPQ5HP3.js';import'../../../chunk-IYSR44P6.js';import'../../../chunk-SNNRWNGZ.js';import'../../../chunk-L4ESAO2S.js';import'../../../chunk-7QBIZCJ4.js';import'../../../chunk-JXCLRKQ7.js';import'../../../chunk-LV3TULSI.js';import'../../../chunk-CRZ7EUYR.js';import'../../../chunk-JC6YMVID.js';import'../../../chunk-NLF2JGYY.js';import'../../../chunk-FSKBLPGE.js';import'../../../chunk-MJEG3K4V.js';import'../../../chunk-RIL6QABY.js';import'../../../chunk-KMAH6636.js';//# sourceMappingURL=nextjs.js.map
|
|
2
2
|
//# sourceMappingURL=nextjs.js.map
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export { ExpressRequest, ExpressResponse, webhookHandler as ExpressWebhook, ExpressWebhookConfig, NextFunction } from './frameworks/express.js';
|
|
2
2
|
export { webhookHandler as NextJsWebhook, NextJsWebhookConfig } from './frameworks/nextjs.js';
|
|
3
|
-
export { F as FlowHandler, e as MessageHandler, M as MessageStatus, W as WebhookContact, a as WebhookEvent, b as WebhookMessage, c as WebhookProcessor, d as WebhookResponse, g as constructFullUrl, f as processFlowRequest, p as processWebhookMessages } from '../../WebhookProcessor-
|
|
3
|
+
export { F as FlowHandler, e as MessageHandler, M as MessageStatus, W as WebhookContact, a as WebhookEvent, b as WebhookMessage, c as WebhookProcessor, d as WebhookResponse, g as constructFullUrl, f as processFlowRequest, p as processWebhookMessages } from '../../WebhookProcessor-BXYunz4N.js';
|
|
4
4
|
import '../../types/config.js';
|
|
5
5
|
import '../../enums-BZd9T2ul.js';
|
|
6
|
-
import '../../common-
|
|
6
|
+
import '../../common-lV0NsO7t.js';
|
|
7
7
|
import '../../request-vYMaEfk5.js';
|
|
8
|
-
import '../../WhatsApp-
|
|
8
|
+
import '../../WhatsApp-pTZPQm81.js';
|
|
9
9
|
import '../../httpsClient-v4gmltzS.js';
|
|
10
10
|
import 'https';
|
|
11
11
|
import '../../EncryptionApi-D7pt-OXT.js';
|
|
12
12
|
import '../../base-CdGDdVEl.js';
|
|
13
|
-
import '../../FlowApi-
|
|
13
|
+
import '../../FlowApi-B2ffO-HD.js';
|
|
14
14
|
import '../../MediaApi-BrEKpqi_.js';
|
|
15
|
-
import '../../MessageApi-
|
|
15
|
+
import '../../MessageApi-BgsSpDno.js';
|
|
16
|
+
import '../../common-BiRA_uz3.js';
|
|
16
17
|
import '../../PhoneNumberApi-DKlu9PHl.js';
|
|
17
18
|
import '../../BusinessProfileApi-WXscSgo-.js';
|
|
18
19
|
import '../../QrCodeApi-7vDwIBHR.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as generateXHub256Sig}from'../../chunk-RWCVPWRC.js';export{a as ExpressWebhook}from'../../chunk-
|
|
1
|
+
export{a as generateXHub256Sig}from'../../chunk-RWCVPWRC.js';export{a as ExpressWebhook}from'../../chunk-NOJFGTRT.js';export{a as NextJsWebhook}from'../../chunk-YXZ4L2OK.js';export{d as WebhookProcessor,c as constructFullUrl,b as processFlowRequest,a as processWebhookMessages}from'../../chunk-JPGXONBQ.js';import'../../chunk-WGGN32O2.js';import'../../chunk-BAOZ4U74.js';import'../../chunk-FKXSL2JK.js';import'../../chunk-AMHQGG6Z.js';import'../../chunk-VHAODWCN.js';import'../../chunk-JPAV644F.js';import'../../chunk-PHPQ5HP3.js';import'../../chunk-IYSR44P6.js';import'../../chunk-SNNRWNGZ.js';import'../../chunk-L4ESAO2S.js';import'../../chunk-7QBIZCJ4.js';import'../../chunk-JXCLRKQ7.js';import'../../chunk-LV3TULSI.js';import'../../chunk-CRZ7EUYR.js';import'../../chunk-JC6YMVID.js';import'../../chunk-NLF2JGYY.js';import'../../chunk-FSKBLPGE.js';import'../../chunk-MJEG3K4V.js';import'../../chunk-RIL6QABY.js';import'../../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E as EncryptionApi } from '../../EncryptionApi-D7pt-OXT.js';
|
|
2
|
-
import { F as FlowApi } from '../../FlowApi-
|
|
2
|
+
import { F as FlowApi } from '../../FlowApi-B2ffO-HD.js';
|
|
3
3
|
import { WhatsAppConfig } from '../../types/config.js';
|
|
4
4
|
import { M as MediaApi } from '../../MediaApi-BrEKpqi_.js';
|
|
5
|
-
import { M as MessagesApi } from '../../MessageApi-
|
|
5
|
+
import { M as MessagesApi } from '../../MessageApi-BgsSpDno.js';
|
|
6
6
|
import { P as PhoneNumberApi } from '../../PhoneNumberApi-DKlu9PHl.js';
|
|
7
7
|
import { B as BusinessProfileApi } from '../../BusinessProfileApi-WXscSgo-.js';
|
|
8
8
|
import { Q as QrCodeApi } from '../../QrCodeApi-7vDwIBHR.js';
|
|
@@ -10,11 +10,12 @@ import { R as RegistrationApi } from '../../RegistrationApi-qO_qoti9.js';
|
|
|
10
10
|
import { T as TemplateApi } from '../../TemplateApi-xGgIZt89.js';
|
|
11
11
|
import { T as TwoStepVerificationApi } from '../../TwoStepVerificationApi-DfNPIz-C.js';
|
|
12
12
|
import { W as WabaApi } from '../../WabaApi-DqQi_68m.js';
|
|
13
|
-
export { W as WhatsApp } from '../../WhatsApp-
|
|
13
|
+
export { W as WhatsApp } from '../../WhatsApp-pTZPQm81.js';
|
|
14
14
|
import '../../base-CdGDdVEl.js';
|
|
15
15
|
import '../../enums-BZd9T2ul.js';
|
|
16
16
|
import '../../request-vYMaEfk5.js';
|
|
17
|
-
import '../../common-
|
|
17
|
+
import '../../common-lV0NsO7t.js';
|
|
18
|
+
import '../../common-BiRA_uz3.js';
|
|
18
19
|
import '../../httpsClient-v4gmltzS.js';
|
|
19
20
|
import 'https';
|
|
20
21
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{b as WhatsApp}from'../../chunk-
|
|
1
|
+
export{b as WhatsApp}from'../../chunk-BAOZ4U74.js';import'../../chunk-FKXSL2JK.js';import'../../chunk-AMHQGG6Z.js';import'../../chunk-VHAODWCN.js';import'../../chunk-JPAV644F.js';import'../../chunk-PHPQ5HP3.js';import'../../chunk-IYSR44P6.js';import'../../chunk-SNNRWNGZ.js';import'../../chunk-L4ESAO2S.js';import'../../chunk-7QBIZCJ4.js';import'../../chunk-JXCLRKQ7.js';import'../../chunk-LV3TULSI.js';import'../../chunk-CRZ7EUYR.js';import'../../chunk-JC6YMVID.js';import'../../chunk-NLF2JGYY.js';import'../../chunk-FSKBLPGE.js';import'../../chunk-MJEG3K4V.js';import'../../chunk-RIL6QABY.js';import'../../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export { W as WhatsApp, W as WhatsAppLegacy } from './WhatsApp-
|
|
1
|
+
export { W as WhatsApp, W as WhatsAppLegacy } from './WhatsApp-pTZPQm81.js';
|
|
2
2
|
export { WabaConfigType, WhatsAppConfig } from './types/config.js';
|
|
3
3
|
export { C as ComponentTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum } from './enums-BZd9T2ul.js';
|
|
4
|
-
export { F as FlowApi } from './FlowApi-
|
|
4
|
+
export { F as FlowApi } from './FlowApi-B2ffO-HD.js';
|
|
5
|
+
export { a as FlowEndpointRequest, b as FlowEndpointResponse, F as FlowTypeEnum } from './common-lV0NsO7t.js';
|
|
5
6
|
export { M as MediaApi } from './MediaApi-BrEKpqi_.js';
|
|
6
|
-
export { M as MessagesApi } from './MessageApi-
|
|
7
|
+
export { M as MessagesApi } from './MessageApi-BgsSpDno.js';
|
|
7
8
|
export { P as PhoneNumberApi } from './PhoneNumberApi-DKlu9PHl.js';
|
|
8
9
|
export { B as BusinessProfileApi } from './BusinessProfileApi-WXscSgo-.js';
|
|
9
10
|
export { T as TemplateApi } from './TemplateApi-xGgIZt89.js';
|
|
10
11
|
export { T as TwoStepVerificationApi } from './TwoStepVerificationApi-DfNPIz-C.js';
|
|
11
|
-
export { W as WebhookContact, a as WebhookEvent, b as WebhookMessage } from './WebhookProcessor-
|
|
12
|
+
export { W as WebhookContact, a as WebhookEvent, b as WebhookMessage } from './WebhookProcessor-BXYunz4N.js';
|
|
13
|
+
export { M as MetaError, i as isFlowDataExchangeRequest, a as isFlowErrorRequest, b as isFlowPingRequest, c as isMetaError } from './isMetaError-CXWJwW58.js';
|
|
12
14
|
export { webhookHandler as ExpressWebhook } from './core/webhook/frameworks/express.js';
|
|
13
15
|
export { webhookHandler as NextJsWebhook } from './core/webhook/frameworks/nextjs.js';
|
|
14
16
|
import './request-vYMaEfk5.js';
|
|
@@ -19,4 +21,4 @@ import './base-CdGDdVEl.js';
|
|
|
19
21
|
import './QrCodeApi-7vDwIBHR.js';
|
|
20
22
|
import './RegistrationApi-qO_qoti9.js';
|
|
21
23
|
import './WabaApi-DqQi_68m.js';
|
|
22
|
-
import './common-
|
|
24
|
+
import './common-BiRA_uz3.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import'./chunk-RWCVPWRC.js';export{a as ExpressWebhook}from'./chunk-
|
|
1
|
+
import'./chunk-RWCVPWRC.js';export{a as ExpressWebhook}from'./chunk-NOJFGTRT.js';export{a as NextJsWebhook}from'./chunk-YXZ4L2OK.js';import'./chunk-JPGXONBQ.js';export{a as isFlowDataExchangeRequest,b as isFlowErrorRequest,c as isFlowPingRequest}from'./chunk-WGGN32O2.js';export{b as WhatsApp,b as WhatsAppLegacy}from'./chunk-BAOZ4U74.js';export{c as isMetaError}from'./chunk-FKXSL2JK.js';import'./chunk-AMHQGG6Z.js';export{a as TemplateApi}from'./chunk-VHAODWCN.js';import'./chunk-JPAV644F.js';import'./chunk-PHPQ5HP3.js';import'./chunk-IYSR44P6.js';export{b as TwoStepVerificationApi}from'./chunk-SNNRWNGZ.js';import'./chunk-L4ESAO2S.js';export{b as MessagesApi}from'./chunk-7QBIZCJ4.js';export{b as MediaApi}from'./chunk-JXCLRKQ7.js';export{b as BusinessProfileApi}from'./chunk-LV3TULSI.js';import'./chunk-CRZ7EUYR.js';export{b as FlowApi}from'./chunk-JC6YMVID.js';export{a as FlowTypeEnum}from'./chunk-NLF2JGYY.js';export{b as PhoneNumberApi}from'./chunk-FSKBLPGE.js';import'./chunk-MJEG3K4V.js';import'./chunk-RIL6QABY.js';export{i as ComponentTypesEnum,f as InteractiveTypesEnum,v as LanguagesEnum,d as MessageTypesEnum,e as ParametersTypesEnum}from'./chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { a as FlowEndpointRequest, n as FlowDataExchangeRequest, e as FlowActionEnum, o as FlowErrorNotificationRequest, p as FlowHealthCheckRequest } from './common-lV0NsO7t.js';
|
|
2
|
+
|
|
3
|
+
declare const DATA_EXCHANGE_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK];
|
|
4
|
+
declare const ERROR_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT];
|
|
5
|
+
/**
|
|
6
|
+
* Type guard to check if a request is a Data Exchange request
|
|
7
|
+
* Validates the request structure according to the Flow API specifications
|
|
8
|
+
*
|
|
9
|
+
* @param request The Flow endpoint request to check
|
|
10
|
+
* @returns True if the request is a valid Data Exchange request, false otherwise
|
|
11
|
+
*/
|
|
12
|
+
declare function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {
|
|
13
|
+
action: (typeof DATA_EXCHANGE_ACTIONS)[number];
|
|
14
|
+
screen?: string;
|
|
15
|
+
flow_token: string;
|
|
16
|
+
data?: Record<string, any>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Type guard to check if a request is an Error Notification request
|
|
20
|
+
* Validates the request structure according to the Flow API error specifications
|
|
21
|
+
*
|
|
22
|
+
* @param request The Flow endpoint request to check
|
|
23
|
+
* @returns True if the request is a valid Error Notification request, false otherwise
|
|
24
|
+
*/
|
|
25
|
+
declare function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {
|
|
26
|
+
action: (typeof ERROR_ACTIONS)[number];
|
|
27
|
+
screen: string;
|
|
28
|
+
flow_token: string;
|
|
29
|
+
data: {
|
|
30
|
+
error: string;
|
|
31
|
+
error_message: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Type guard to check if a request is a Ping (health check) request
|
|
36
|
+
* Simple validation for health check endpoints in the Flow API
|
|
37
|
+
*
|
|
38
|
+
* @param request The Flow endpoint request to check
|
|
39
|
+
* @returns True if the request is a Ping request, false otherwise
|
|
40
|
+
*/
|
|
41
|
+
declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
|
|
42
|
+
|
|
43
|
+
interface MetaError extends Error {
|
|
44
|
+
error: {
|
|
45
|
+
message: string;
|
|
46
|
+
type: string;
|
|
47
|
+
code: number;
|
|
48
|
+
error_data?: {
|
|
49
|
+
messaging_product: 'whatsapp';
|
|
50
|
+
details: string;
|
|
51
|
+
};
|
|
52
|
+
error_subcode?: number;
|
|
53
|
+
fbtrace_id: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Determines if the error is a Meta API error response
|
|
58
|
+
* @param error Any error object to check
|
|
59
|
+
* @returns Type guard indicating if error is a Meta API error
|
|
60
|
+
*/
|
|
61
|
+
declare function isMetaError(error: any): error is MetaError;
|
|
62
|
+
|
|
63
|
+
export { type MetaError as M, isFlowErrorRequest as a, isFlowPingRequest as b, isMetaError as c, isFlowDataExchangeRequest as i };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WabaConfigType } from '../types/config.js';
|
|
2
|
+
export { M as MetaError, i as isFlowDataExchangeRequest, a as isFlowErrorRequest, b as isFlowPingRequest, c as isMetaError } from '../isMetaError-CXWJwW58.js';
|
|
2
3
|
import { L as LoggerInterface } from '../logger-BdE0Vyim.js';
|
|
3
|
-
import { f as FlowEndpointRequest, n as FlowDataExchangeRequest, b as FlowActionEnum, o as FlowErrorNotificationRequest, p as FlowHealthCheckRequest } from '../common-DDXsNyLF.js';
|
|
4
4
|
import '../enums-BZd9T2ul.js';
|
|
5
|
+
import '../common-lV0NsO7t.js';
|
|
5
6
|
import '../request-vYMaEfk5.js';
|
|
6
7
|
|
|
7
8
|
declare function buildFieldsQueryString(fields?: string[] | string): string;
|
|
@@ -14,26 +15,6 @@ declare function buildFieldsQueryString(fields?: string[] | string): string;
|
|
|
14
15
|
*/
|
|
15
16
|
declare function formatConfigTable(config: WabaConfigType): string;
|
|
16
17
|
|
|
17
|
-
interface MetaError extends Error {
|
|
18
|
-
error: {
|
|
19
|
-
message: string;
|
|
20
|
-
type: string;
|
|
21
|
-
code: number;
|
|
22
|
-
error_data?: {
|
|
23
|
-
messaging_product: 'whatsapp';
|
|
24
|
-
details: string;
|
|
25
|
-
};
|
|
26
|
-
error_subcode?: number;
|
|
27
|
-
fbtrace_id: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Determines if the error is a Meta API error response
|
|
32
|
-
* @param error Any error object to check
|
|
33
|
-
* @returns Type guard indicating if error is a Meta API error
|
|
34
|
-
*/
|
|
35
|
-
declare function isMetaError(error: any): error is MetaError;
|
|
36
|
-
|
|
37
18
|
declare class Logger implements LoggerInterface {
|
|
38
19
|
private name;
|
|
39
20
|
private debug;
|
|
@@ -55,44 +36,4 @@ declare function getVersion(): string;
|
|
|
55
36
|
*/
|
|
56
37
|
declare function getUserAgent(): string;
|
|
57
38
|
|
|
58
|
-
|
|
59
|
-
declare const ERROR_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT];
|
|
60
|
-
/**
|
|
61
|
-
* Type guard to check if a request is a Data Exchange request
|
|
62
|
-
* Validates the request structure according to the Flow API specifications
|
|
63
|
-
*
|
|
64
|
-
* @param request The Flow endpoint request to check
|
|
65
|
-
* @returns True if the request is a valid Data Exchange request, false otherwise
|
|
66
|
-
*/
|
|
67
|
-
declare function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {
|
|
68
|
-
action: (typeof DATA_EXCHANGE_ACTIONS)[number];
|
|
69
|
-
screen?: string;
|
|
70
|
-
flow_token: string;
|
|
71
|
-
data?: Record<string, any>;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Type guard to check if a request is an Error Notification request
|
|
75
|
-
* Validates the request structure according to the Flow API error specifications
|
|
76
|
-
*
|
|
77
|
-
* @param request The Flow endpoint request to check
|
|
78
|
-
* @returns True if the request is a valid Error Notification request, false otherwise
|
|
79
|
-
*/
|
|
80
|
-
declare function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {
|
|
81
|
-
action: (typeof ERROR_ACTIONS)[number];
|
|
82
|
-
screen: string;
|
|
83
|
-
flow_token: string;
|
|
84
|
-
data: {
|
|
85
|
-
error: string;
|
|
86
|
-
error_message: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* Type guard to check if a request is a Ping (health check) request
|
|
91
|
-
* Simple validation for health check endpoints in the Flow API
|
|
92
|
-
*
|
|
93
|
-
* @param request The Flow endpoint request to check
|
|
94
|
-
* @returns True if the request is a Ping request, false otherwise
|
|
95
|
-
*/
|
|
96
|
-
declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
|
|
97
|
-
|
|
98
|
-
export { Logger, type MetaError, buildFieldsQueryString, formatConfigTable, getUserAgent, getVersion, isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest, isMetaError, objectToQueryString };
|
|
39
|
+
export { Logger, buildFieldsQueryString, formatConfigTable, getUserAgent, getVersion, objectToQueryString };
|