meta-cloud-api 0.2.44 → 1.0.1
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/README.md +180 -64
- package/dist/{BusinessProfileApi-DE7Nnuy_.d.ts → BusinessProfileApi-WXscSgo-.d.ts} +4 -3
- package/dist/{EncryptionApi-PHxeI2G_.d.ts → EncryptionApi-D7pt-OXT.d.ts} +3 -2
- package/dist/FlowApi-UAvzhJfV.d.ts +136 -0
- package/dist/{MediaApi-B2vtjiCm.d.ts → MediaApi-BrEKpqi_.d.ts} +3 -2
- package/dist/{MessageApi-ptFlWg3O.d.ts → MessageApi-Circorzz.d.ts} +4 -3
- package/dist/{PhoneNumberApi-DMb_G3uw.d.ts → PhoneNumberApi-DKlu9PHl.d.ts} +4 -3
- package/dist/{QrCodeApi-D3rVKuxV.d.ts → QrCodeApi-7vDwIBHR.d.ts} +3 -2
- package/dist/{RegistrationApi-DZBJWAZS.d.ts → RegistrationApi-qO_qoti9.d.ts} +4 -3
- package/dist/{TemplateApi-BFeM9qJS.d.ts → TemplateApi-xGgIZt89.d.ts} +5 -4
- package/dist/{TwoStepVerificationApi-6jV5pDxS.d.ts → TwoStepVerificationApi-DfNPIz-C.d.ts} +3 -2
- package/dist/{WabaApi-B8Gv2UNE.d.ts → WabaApi-DqQi_68m.d.ts} +3 -2
- package/dist/{WebhookHandler-Bxxi6SdT.d.ts → WebhookProcessor-ByAe7Kf_.d.ts} +22 -32
- package/dist/WhatsApp-BIBtT-y9.d.ts +82 -0
- package/dist/api/encryption/index.d.ts +10 -0
- package/dist/api/encryption/index.js +2 -0
- package/dist/api/flow/index.d.ts +10 -0
- package/dist/api/flow/index.js +2 -0
- package/dist/api/index.d.ts +16 -0
- package/dist/api/index.js +2 -0
- package/dist/api/media/index.d.ts +10 -0
- package/dist/api/media/index.js +2 -0
- package/dist/{features → api}/messages/index.d.ts +6 -5
- package/dist/api/messages/index.js +2 -0
- package/dist/{features → api}/phone/index.d.ts +6 -5
- package/dist/api/phone/index.js +2 -0
- package/dist/{features → api}/profile/index.d.ts +6 -5
- package/dist/api/profile/index.js +2 -0
- package/dist/api/qrCode/index.d.ts +10 -0
- package/dist/api/qrCode/index.js +2 -0
- package/dist/api/registration/index.d.ts +10 -0
- package/dist/api/registration/index.js +2 -0
- package/dist/{features → api}/template/index.d.ts +6 -5
- package/dist/api/template/index.js +2 -0
- package/dist/api/twoStepVerification/index.d.ts +10 -0
- package/dist/api/twoStepVerification/index.js +2 -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-2NJVBJUN.js → chunk-7QBIZCJ4.js} +2 -2
- package/dist/chunk-7QBIZCJ4.js.map +1 -0
- package/dist/chunk-AMHQGG6Z.js +2 -0
- package/dist/{chunk-4C666HHU.js.map → chunk-AMHQGG6Z.js.map} +1 -1
- package/dist/chunk-B7DCL6I7.js +10 -0
- package/dist/chunk-B7DCL6I7.js.map +1 -0
- package/dist/{chunk-7GL74SXM.js → chunk-CRZ7EUYR.js} +2 -2
- 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-HJGN3PO4.js +3 -0
- package/dist/chunk-HJGN3PO4.js.map +1 -0
- package/dist/{chunk-7NQLQPLH.js → chunk-IYSR44P6.js} +2 -2
- 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-GT3XQN7Y.js → chunk-JPAV644F.js} +2 -2
- package/dist/chunk-JPAV644F.js.map +1 -0
- package/dist/{chunk-XPPDOFBN.js → chunk-JXCLRKQ7.js} +2 -2
- 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-5JGM556C.js → chunk-L4ESAO2S.js} +2 -2
- 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-BZ5QDXNR.js → chunk-MJEG3K4V.js} +2 -2
- 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-OA2SW4AF.js +2 -0
- package/dist/chunk-OA2SW4AF.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-UCBYECNQ.js +2 -0
- package/dist/chunk-UCBYECNQ.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/{FlowApi-CASVC-Al.d.ts → common-DDXsNyLF.d.ts} +2 -133
- package/dist/core/webhook/frameworks/express.d.ts +48 -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 +44 -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 +21 -16
- package/dist/core/webhook/index.js +1 -1
- package/dist/core/whatsapp/index.d.ts +39 -15
- package/dist/core/whatsapp/index.js +1 -1
- package/dist/{enums-DvwSJq9w.d.ts → enums-BZd9T2ul.d.ts} +1 -1
- package/dist/httpsClient-v4gmltzS.d.ts +19 -0
- package/dist/index.d.ts +21 -82
- package/dist/index.js +1 -1
- package/dist/logger-BdE0Vyim.d.ts +9 -0
- package/dist/{base-BhCbbsxB.d.ts → request-vYMaEfk5.d.ts} +2 -16
- package/dist/{shared/types → types}/config.d.ts +1 -1
- package/dist/types/enums.d.ts +1 -0
- package/dist/{shared/types → types}/enums.js +1 -1
- 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 +98 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +91 -34
- package/dist/chunk-2NJVBJUN.js.map +0 -1
- package/dist/chunk-3MO3BTBC.js +0 -2
- package/dist/chunk-3MO3BTBC.js.map +0 -1
- package/dist/chunk-4C666HHU.js +0 -2
- package/dist/chunk-4O3T25CT.js +0 -2
- package/dist/chunk-4O3T25CT.js.map +0 -1
- package/dist/chunk-5JGM556C.js.map +0 -1
- package/dist/chunk-5O5GLWIE.js +0 -3
- package/dist/chunk-5O5GLWIE.js.map +0 -1
- package/dist/chunk-7GL74SXM.js.map +0 -1
- package/dist/chunk-7NQLQPLH.js.map +0 -1
- package/dist/chunk-BZ5QDXNR.js.map +0 -1
- package/dist/chunk-CNGQISKS.js +0 -2
- package/dist/chunk-CNGQISKS.js.map +0 -1
- package/dist/chunk-GIQLIMOD.js +0 -2
- package/dist/chunk-GIQLIMOD.js.map +0 -1
- package/dist/chunk-GT3XQN7Y.js.map +0 -1
- package/dist/chunk-I222VSWK.js +0 -2
- package/dist/chunk-I222VSWK.js.map +0 -1
- package/dist/chunk-JGX3AVD7.js +0 -3
- package/dist/chunk-JGX3AVD7.js.map +0 -1
- package/dist/chunk-KFPOVYEJ.js +0 -2
- package/dist/chunk-KFPOVYEJ.js.map +0 -1
- package/dist/chunk-LGLRGXCE.js +0 -2
- package/dist/chunk-LGLRGXCE.js.map +0 -1
- package/dist/chunk-O2OTHNWM.js +0 -2
- package/dist/chunk-O2OTHNWM.js.map +0 -1
- package/dist/chunk-R36L2XYO.js +0 -2
- package/dist/chunk-R36L2XYO.js.map +0 -1
- package/dist/chunk-UQPD6GIF.js +0 -2
- package/dist/chunk-UQPD6GIF.js.map +0 -1
- package/dist/chunk-VW3LGHTJ.js +0 -2
- package/dist/chunk-VW3LGHTJ.js.map +0 -1
- package/dist/chunk-XPPDOFBN.js.map +0 -1
- package/dist/features/encryption/index.d.ts +0 -9
- package/dist/features/encryption/index.js +0 -2
- package/dist/features/flow/index.d.ts +0 -9
- package/dist/features/flow/index.js +0 -2
- package/dist/features/media/index.d.ts +0 -9
- package/dist/features/media/index.js +0 -2
- package/dist/features/messages/index.js +0 -2
- package/dist/features/phone/index.js +0 -2
- package/dist/features/profile/index.js +0 -2
- package/dist/features/qrCode/index.d.ts +0 -9
- package/dist/features/qrCode/index.js +0 -2
- package/dist/features/registration/index.d.ts +0 -9
- package/dist/features/registration/index.js +0 -2
- package/dist/features/template/index.js +0 -2
- package/dist/features/twoStepVerification/index.d.ts +0 -9
- package/dist/features/twoStepVerification/index.js +0 -2
- package/dist/features/waba/index.d.ts +0 -9
- package/dist/features/waba/index.js +0 -2
- package/dist/index-DiCI1vEz.d.ts +0 -100
- package/dist/shared/types/enums.d.ts +0 -1
- package/dist/shared/utils/isMetaError.d.ts +0 -21
- package/dist/shared/utils/isMetaError.js +0 -2
- package/dist/shared/utils/isMetaError.js.map +0 -1
- /package/dist/{features → api}/encryption/index.js.map +0 -0
- /package/dist/{features → api}/flow/index.js.map +0 -0
- /package/dist/{features/media → api}/index.js.map +0 -0
- /package/dist/{features/messages → api/media}/index.js.map +0 -0
- /package/dist/{features/phone → api/messages}/index.js.map +0 -0
- /package/dist/{features/profile → api/phone}/index.js.map +0 -0
- /package/dist/{features/qrCode → api/profile}/index.js.map +0 -0
- /package/dist/{features/registration → api/qrCode}/index.js.map +0 -0
- /package/dist/{features/template → api/registration}/index.js.map +0 -0
- /package/dist/{features/twoStepVerification → api/template}/index.js.map +0 -0
- /package/dist/{features/waba → api/twoStepVerification}/index.js.map +0 -0
- /package/dist/{shared/types → types}/config.js +0 -0
- /package/dist/{shared/types → types}/config.js.map +0 -0
- /package/dist/{shared/types → types}/enums.js.map +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/features/flow/FlowApi.ts","../src/features/flow/types/common.ts","../src/features/flow/index.ts"],"names":["LIB_NAME","LOG_LOCAL","LOGGER","Logger","FlowApi","BaseAPI","config","client","wabaId","data","payload","flowId","fields","dateFormat","params","queryString","invalidate","formData","fileContent","flowJsonData","result","isValid","error","destinationWabaId","FlowTypeEnum","flow_default"],"mappings":"6CAQA,IAAMA,CAAW,CAAA,SAAA,CACXC,CAAY,CAAA,KAAA,CACZC,CAAS,CAAA,IAAIC,CAAOH,CAAAA,CAAAA,CAAU,OAAQ,CAAA,GAAA,CAAI,KAAU,GAAA,MAAA,EAAUC,CAAS,CAAA,CAexDG,CAArB,CAAA,cAAqCC,GAAkC,CACnE,WAAYC,CAAAA,CAAAA,CAAwBC,CAAwB,CAAA,CACxD,KAAMD,CAAAA,CAAAA,CAAQC,CAAM,CAAA,CACpBL,CAAO,CAAA,GAAA,CAAI,qBAAqB,EACpC,CAQA,MAAM,SAAUM,CAAAA,CAAAA,CAAiD,CAC7D,OAAO,IAAK,CAAA,QAAA,CAAA,KAAA,CAA8B,CAAIA,CAAAA,EAAAA,CAAM,CAAU,MAAA,CAAA,CAAA,IAAA,CAAK,MAAO,CAAA,eAAA,CAAgC,IAAI,CAClH,CASA,MAAM,UACFA,CAAAA,CAAAA,CACAC,CAQgC,CAAA,CAGhC,IAAMC,CAAAA,CAAU,CACZ,IAAA,CAAMD,CAAK,CAAA,IAAA,CACX,UAAYA,CAAAA,CAAAA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AREA,CAAA,CAAA,EAAA,CAAA,EAAA,EAAA,MCnCLC,CAAQrB,CAAAA","file":"chunk-LGLRGXCE.js","sourcesContent":["import { BaseAPI } from '@shared/types/base';\nimport type { WabaConfigType } from '@shared/types/config';\nimport { HttpMethodsEnum, WabaConfigEnum } from '@shared/types/enums';\nimport type { RequesterClass, ResponseSuccess } from '@shared/types/request';\nimport Logger from '@shared/utils/logger';\n\nimport type * as flow from './types';\n\nconst LIB_NAME = 'FlowAPI';\nconst LOG_LOCAL = false;\nconst LOGGER = new Logger(LIB_NAME, process.env.DEBUG === 'true' || LOG_LOCAL);\n\n/**\n * API for managing WhatsApp Flows.\n *\n * This API allows you to:\n * - List flows\n * - Create flows\n * - Get flow details and previews\n * - Update flow metadata and JSON\n * - Delete flows\n * - Publish and deprecate flows\n * - Migrate flows between WABAs\n * - Validate flow JSON\n */\nexport default class FlowApi extends BaseAPI implements flow.FlowClass {\n constructor(config: WabaConfigType, client: RequesterClass) {\n super(config, client);\n LOGGER.log('FlowAPI initialized');\n }\n\n /**\n * List Flows\n *\n * @param wabaId - The WABA ID\n * @returns Promise with the list of flows\n */\n async listFlows(wabaId: string): Promise<flow.FlowsListResponse> {\n return this.sendJson(HttpMethodsEnum.Get, `/${wabaId}/flows`, this.config[WabaConfigEnum.RequestTimeout], null);\n }\n\n /**\n * Create Flow\n *\n * @param wabaId - The WABA ID\n * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id\n * @returns Promise with the created flow ID and validation errors if any\n */\n async createFlow(\n wabaId: string,\n data: {\n name: string;\n categories?: flow.FlowCategoryEnum[];\n endpoint_uri?: string;\n clone_flow_id?: string;\n flow_json?: string; // Flow JSON as a string\n publish?: boolean;\n },\n ): Promise<flow.CreateFlowResponse> {\n // The API expects application/json for this endpoint based on documentation examples\n // Let's ensure we send JSON, not FormData, unless specifically required by an endpoint variation.\n const payload = {\n name: data.name,\n categories: data.categories,\n ...(data.endpoint_uri && { endpoint_uri: data.endpoint_uri }),\n ...(data.clone_flow_id && { clone_flow_id: data.clone_flow_id }),\n ...(data.flow_json && { flow_json: data.flow_json }),\n ...(data.publish !== undefined && { publish: data.publish }),\n };\n\n return this.sendJson(\n HttpMethodsEnum.Post,\n `/${wabaId}/flows`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify(payload), // Send as JSON\n );\n }\n\n /**\n * Get Flow details\n *\n * @param flowId - The flow ID\n * @param fields - Optional fields to return (e.g., 'name,status,preview.invalidate(false)')\n * @param dateFormat - Optional date format\n * @returns Promise with the flow details or preview response\n */\n async getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<flow.Flow | flow.FlowPreviewResponse> {\n const params = new URLSearchParams();\n if (fields) params.append('fields', fields);\n if (dateFormat) params.append('date_format', dateFormat);\n\n const queryString = params.toString() ? `?${params.toString()}` : '';\n return this.sendJson(\n HttpMethodsEnum.Get,\n `/${flowId}${queryString}`,\n this.config[WabaConfigEnum.RequestTimeout],\n null,\n );\n }\n\n /**\n * Get Flow Preview URL\n *\n * @param flowId - The flow ID\n * @param invalidate - Optional. If true, invalidates existing preview and generates a new one. Defaults to false.\n * @returns Promise with the flow preview details\n */\n async getFlowPreview(flowId: string, invalidate: boolean = false): Promise<flow.FlowPreviewResponse> {\n const fields = `preview.invalidate(${invalidate})`;\n // Type assertion needed as getFlow can return Flow or FlowPreviewResponse\n return this.getFlow(flowId, fields) as Promise<flow.FlowPreviewResponse>;\n }\n\n /**\n * Update Flow Metadata\n *\n * @param flowId - The flow ID\n * @param data - The flow metadata to update (name, categories, endpoint_uri, application_id)\n * @returns Promise with the success status\n */\n async updateFlowMetadata(\n flowId: string,\n data: {\n name?: string;\n categories?: flow.FlowCategoryEnum[];\n endpoint_uri?: string;\n application_id?: string;\n },\n ): Promise<ResponseSuccess> {\n // The API expects application/json for this endpoint based on documentation examples\n const payload = {\n ...(data.name && { name: data.name }),\n ...(data.categories && { categories: data.categories }),\n ...(data.endpoint_uri && { endpoint_uri: data.endpoint_uri }),\n ...(data.application_id && { application_id: data.application_id }),\n };\n\n return this.sendJson(\n HttpMethodsEnum.Post,\n `/${flowId}`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify(payload), // Send as JSON\n );\n }\n\n /**\n * Delete Flow (only works if the Flow is in DRAFT status)\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n async deleteFlow(flowId: string): Promise<ResponseSuccess> {\n return this.sendJson(HttpMethodsEnum.Delete, `/${flowId}`, this.config[WabaConfigEnum.RequestTimeout], null);\n }\n\n /**\n * List Assets (e.g., get Flow JSON download URL)\n *\n * @param flowId - The flow ID\n * @returns Promise with the list of assets\n */\n async listAssets(flowId: string): Promise<flow.FlowAssetsResponse> {\n return this.sendJson(\n HttpMethodsEnum.Get,\n `/${flowId}/assets`,\n this.config[WabaConfigEnum.RequestTimeout],\n null,\n );\n }\n\n /**\n * Update Flow JSON by uploading a file, buffer, JSON object, or Blob.\n *\n * @param flowId - The flow ID\n * @param data - Object containing the file data and optional name.\n * @param data.file - The Flow JSON content as a Buffer, JSON object, or Blob.\n * @param data.name - Optional name for the asset, defaults to 'flow.json'.\n * @returns Promise with the success status and validation errors, if any.\n */\n async updateFlowJson(\n flowId: string,\n data: {\n file: Blob | Buffer | object; // JSON object, Buffer, or Blob\n name?: string; // Default to \"flow.json\"\n },\n ): Promise<flow.UpdateFlowResponse> {\n const formData = new FormData();\n let fileContent: Blob;\n\n // Handle different input types for the file\n if (data.file instanceof Buffer) {\n // Buffer\n // Create a Blob from the Buffer and cast it to the global Blob type\n fileContent = new globalThis.Blob([data.file]);\n formData.append('file', fileContent as unknown as Blob);\n } else if (typeof data.file === 'object' && !(data.file instanceof Blob)) {\n // JSON object - stringify and create Blob\n try {\n // Create a Blob from the JSON string and cast it to the global Blob type\n fileContent = new globalThis.Blob([JSON.stringify(data.file, null, 2)], { type: 'application/json' });\n formData.append('file', fileContent as unknown as Blob);\n } catch (e) {\n throw new Error('Failed to stringify JSON object for Flow JSON update.');\n }\n } else if (data.file instanceof Blob) {\n // Blob (already in correct format)\n fileContent = data.file;\n formData.append('file', fileContent as unknown as Blob);\n } else {\n throw new Error('Invalid file type provided for Flow JSON update. Must be a Buffer, JSON object, or Blob.');\n }\n\n formData.append('asset_type', 'FLOW_JSON'); // Required by API\n formData.append('name', data.name || 'flow.json'); // Required by API\n\n return this.sendFormData(\n HttpMethodsEnum.Post,\n `/${flowId}/assets`,\n this.config[WabaConfigEnum.RequestTimeout],\n formData,\n );\n }\n\n /**\n * Validate Flow JSON by attempting an update without publishing.\n * This is a convenience method; the API doesn't have a dedicated validation endpoint.\n *\n * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).\n * @param flowJsonData - The Flow JSON content as a file path (string), Buffer, JSON object, or Blob.\n * @returns Promise indicating if the JSON is valid and includes validation errors if any.\n */\n async validateFlowJson(\n flowId: string,\n flowJsonData: Blob | Buffer | object,\n ): Promise<flow.ValidateFlowJsonResponse> {\n try {\n const result = await this.updateFlowJson(flowId, {\n file: flowJsonData,\n });\n\n const isValid = !result.validation_errors || result.validation_errors.length === 0;\n\n const enhancedResponse = {\n ...result,\n valid: isValid,\n };\n\n return enhancedResponse;\n } catch (error) {\n LOGGER.error('Error during Flow JSON validation attempt:', error);\n throw error;\n }\n }\n\n /**\n * Publish Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n async publishFlow(flowId: string): Promise<ResponseSuccess> {\n // This endpoint expects an empty JSON body or no body\n return this.sendJson(\n HttpMethodsEnum.Post,\n `/${flowId}/publish`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify({}), // Send empty JSON object\n );\n }\n\n /**\n * Deprecate Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n async deprecateFlow(flowId: string): Promise<ResponseSuccess> {\n // This endpoint expects an empty JSON body or no body\n return this.sendJson(\n HttpMethodsEnum.Post,\n `/${flowId}/deprecate`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify({}), // Send empty JSON object\n );\n }\n\n /**\n * Migrate Flows between WABAs\n *\n * @param destinationWabaId - The destination WABA ID\n * @param data - The migration data including source_waba_id and optional source_flow_names\n * @returns Promise with migration results (successes and failures)\n */\n async migrateFlows(\n destinationWabaId: string,\n data: {\n source_waba_id: string;\n source_flow_names?: string[];\n },\n ): Promise<flow.FlowMigrationResponse> {\n // API documentation suggests this endpoint might expect application/json\n // Let's double-check or assume JSON based on typical Graph API patterns unless FormData is confirmed.\n // Assuming JSON for now:\n const payload = {\n source_waba_id: data.source_waba_id,\n ...(data.source_flow_names && { source_flow_names: data.source_flow_names }),\n };\n\n return this.sendJson(\n HttpMethodsEnum.Post,\n `/${destinationWabaId}/migrate_flows`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify(payload),\n );\n }\n}\n","import { ResponseSuccess } from '@shared/types';\nimport { IncomingHttpHeaders, IncomingMessage } from 'http';\n\n/**\n * Enum for Flow Status\n */\nexport enum FlowStatusEnum {\n Draft = 'DRAFT',\n Published = 'PUBLISHED',\n Throttled = 'THROTTLED',\n Blocked = 'BLOCKED',\n Deprecated = 'DEPRECATED',\n}\n\n/**\n * Enum for Flow Categories\n */\nexport enum FlowCategoryEnum {\n SignUp = 'SIGN_UP',\n SignIn = 'SIGN_IN',\n AppointmentBooking = 'APPOINTMENT_BOOKING',\n LeadGeneration = 'LEAD_GENERATION',\n ContactUs = 'CONTACT_US',\n CustomerSupport = 'CUSTOMER_SUPPORT',\n Survey = 'SURVEY',\n Other = 'OTHER',\n}\n\nexport enum FlowActionEnum {\n INIT = 'INIT',\n BACK = 'BACK',\n DATA_EXCHANGE = 'data_exchange',\n}\n\n/**\n * Enum for Flow Types in webhook handlers\n * Used to register handlers for specific flow events\n */\nexport enum FlowTypeEnum {\n /** Health check/ping requests */\n Ping = 'ping',\n /** Data exchange requests */\n Change = 'data_exchange',\n /** Error notification requests */\n Error = 'error',\n /** Match all flow action types */\n All = '*',\n}\n\nexport type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];\n\n/**\n * Flow Validation Error Pointer\n */\nexport interface FlowValidationErrorPointer {\n line_start: number;\n line_end: number;\n column_start: number;\n column_end: number;\n path: string;\n}\n\n/**\n * Flow Validation Error\n */\nexport interface FlowValidationError {\n error: string;\n error_type: string;\n message: string;\n line_start: number;\n line_end: number;\n column_start: number;\n column_end: number;\n pointers: FlowValidationErrorPointer[];\n}\n\n/**\n * Flow Item\n */\nexport interface Flow {\n id: string;\n name: string;\n status: FlowStatusEnum;\n categories: FlowCategoryEnum[];\n validation_errors: FlowValidationError[];\n}\n\n/**\n * Pagination Cursors\n */\nexport interface PaginationCursors {\n before: string;\n after: string;\n}\n\n/**\n * Pagination Object\n */\nexport interface Pagination {\n cursors: PaginationCursors;\n}\n\n/**\n * Flows List Response\n */\nexport interface FlowsListResponse {\n data: Flow[];\n paging: Pagination;\n}\n\n/**\n * Flow Asset\n */\nexport interface FlowAsset {\n name: string;\n asset_type: string;\n download_url: string;\n}\n\n/**\n * Flow Assets Response\n */\nexport interface FlowAssetsResponse {\n data: FlowAsset[];\n paging: Pagination;\n}\n\n/**\n * Flow Preview\n */\nexport interface FlowPreview {\n preview_url: string;\n expires_at: string;\n}\n\n/**\n * Flow Preview Response\n */\nexport interface FlowPreviewResponse {\n preview: FlowPreview;\n id: string;\n}\n\n/**\n * Flow Migration Result\n */\nexport interface FlowMigrationResult {\n source_name: string;\n source_id: string;\n migrated_id: string;\n}\n\n/**\n * Flow Migration Failure\n */\nexport interface FlowMigrationFailure {\n source_name: string;\n error_code: string;\n error_message: string;\n}\n\n/**\n * Create Flow Response\n */\nexport interface CreateFlowResponse {\n id: string;\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * Update Flow Response\n */\nexport interface UpdateFlowResponse {\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * Flow Migration Response\n */\nexport interface FlowMigrationResponse {\n migrated_flows: FlowMigrationResult[];\n failed_flows: FlowMigrationFailure[];\n}\n\n/**\n * Validate Flow JSON Response\n */\nexport interface ValidateFlowJsonResponse {\n valid: boolean;\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * WhatsApp Flow Endpoint - Encrypted Request Payload\n * Represents the raw encrypted data received from WhatsApp\n */\nexport interface FlowEncryptedRequestPayload {\n encrypted_aes_key: string;\n encrypted_flow_data: string;\n initial_vector: string;\n}\n\n/**\n * WhatsApp Flow Endpoint - Decrypted Request Response\n * Represents the successfully decrypted data and encryption keys\n */\nexport interface FlowDecryptedRequestResponse {\n decryptedBody: any;\n aesKeyBuffer: Buffer;\n initialVectorBuffer: Buffer;\n}\n\n/**\n * WhatsApp Flow Endpoint - HTTP Request with Body\n * Represents an HTTP request with the encrypted payload\n */\nexport interface FlowHttpRequest extends IncomingMessage {\n body: FlowEncryptedRequestPayload;\n headers: IncomingHttpHeaders;\n}\n\n/**\n * WhatsApp Flow Endpoint - Health Check Request\n * Represents the structure of a health check request\n */\nexport interface FlowHealthCheckRequest {\n action: 'ping';\n version: '3.0';\n}\n\n/**\n * WhatsApp Flow Endpoint - Health Check Response\n * The expected response structure for health check requests\n */\nexport interface FlowHealthCheckResponse {\n data: {\n status: 'active';\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Data Exchange Request\n * Represents the structure of a data exchange request\n */\nexport interface FlowDataExchangeRequest {\n version: '3.0';\n action: FlowActionEnum;\n screen: string;\n flow_token: string;\n data?: Record<string, any> & { error_message?: string };\n}\n\n/**\n * WhatsApp Flow Endpoint - Data Exchange Response\n * The expected response structure for data exchange requests\n */\nexport interface FlowDataExchangeResponse {\n screen?: string;\n data?: Record<string, any | { error_message?: string }>;\n}\n\n/**\n * WhatsApp Flow Endpoint - Success Screen Response\n * The expected response structure for success screen requests\n */\nexport interface FlowSuccessScreenResponse {\n screen: 'SUCCESS';\n data: {\n extension_message_response?: {\n params?: {\n flow_token: string;\n [key: string]: string;\n };\n };\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Error Notification Request\n * Represents the structure of an error notification request\n */\nexport interface FlowErrorNotificationRequest {\n version: '3.0';\n action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;\n screen: string;\n flow_token: string;\n data: {\n error: string;\n error_message: string;\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Error Notification Response\n * The expected response structure for error notification requests\n */\nexport interface FlowErrorNotificationResponse {\n acknowledged: boolean;\n}\n\n/**\n * WhatsApp Flow Endpoint - Comprehensive Request Object\n * A combined type that includes all possible fields from different request types\n * with all fields being optional for flexibility\n */\nexport interface FlowEndpointRequest {\n // Common fields\n version?: '3.0';\n action?: 'ping' | FlowActionEnum;\n\n screen?: string;\n flow_token?: string;\n\n data?: Record<string, any> & {\n error_key?: string;\n error_message?: string;\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Response\n * Union type for all possible response types from a Flow endpoint\n */\nexport type FlowEndpointResponse =\n | FlowHealthCheckResponse\n | FlowDataExchangeResponse\n | FlowErrorNotificationResponse\n | FlowSuccessScreenResponse;\n\nexport interface FlowClass {\n /**\n * List Flows\n *\n * @param wabaId - The WABA ID\n * @returns Promise with the list of flows\n */\n listFlows(wabaId: string): Promise<FlowsListResponse>;\n\n /**\n * Create Flow\n *\n * @param wabaId - The WABA ID\n * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id\n * @returns Promise with the created flow ID\n */\n createFlow(\n wabaId: string,\n data: {\n name: string;\n categories?: FlowCategoryEnum[];\n endpoint_uri?: string;\n clone_flow_id?: string;\n flow_json?: string;\n publish?: boolean;\n },\n ): Promise<CreateFlowResponse>;\n\n /**\n * Get Flow\n *\n * @param flowId - The flow ID\n * @param fields - Optional fields to return\n * @param dateFormat - Optional date format\n * @returns Promise with the flow details\n */\n getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;\n\n /**\n * Update Flow Metadata\n *\n * @param flowId - The flow ID\n * @param data - The flow metadata to update\n * @returns Promise with the success status\n */\n updateFlowMetadata(\n flowId: string,\n data: {\n name?: string;\n categories?: FlowCategoryEnum[];\n endpoint_uri?: string;\n application_id?: string;\n },\n ): Promise<ResponseSuccess>;\n\n /**\n * Delete Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n deleteFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * List Assets (Get Flow JSON URL)\n *\n * @param flowId - The flow ID\n * @returns Promise with the list of assets\n */\n listAssets(flowId: string): Promise<FlowAssetsResponse>;\n\n /**\n * Update Flow JSON\n *\n * @param flowId - The flow ID\n * @param data - The asset data including asset_type, file, and name\n * @returns Promise with the success status and validation errors\n */\n updateFlowJson(\n flowId: string,\n data: {\n file: Blob | Buffer | object;\n name?: string;\n },\n ): Promise<UpdateFlowResponse>;\n\n /**\n * Validate Flow JSON by attempting an update without publishing.\n * This is a convenience method; the API doesn't have a dedicated validation endpoint.\n *\n * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).\n * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.\n * @returns Promise indicating if the JSON is valid and includes validation errors if any.\n */\n validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;\n\n /**\n * Publish Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n publishFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * Deprecate Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n deprecateFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * Migrate Flows\n *\n * @param wabaId - The destination WABA ID\n * @param data - The migration data including source_waba_id and optional source_flow_names\n * @returns Promise with migration results\n */\n migrateFlows(\n wabaId: string,\n data: {\n source_waba_id: string;\n source_flow_names?: string[];\n },\n ): Promise<FlowMigrationResponse>;\n}\n","import FlowApi from './FlowApi';\n\n// 기본 export 유지\nexport default FlowApi;\n\n// 명시적 named export\nexport { FlowApi };\n\n// 필요한 타입만 명시적으로 export\nexport type {\n CreateFlowResponse,\n Flow,\n FlowType,\n FlowActionEnum,\n FlowAssetsResponse,\n FlowCategoryEnum,\n FlowClass,\n FlowEndpointRequest,\n FlowEndpointResponse,\n FlowMigrationResponse,\n FlowPreviewResponse,\n FlowsListResponse,\n FlowStatusEnum,\n FlowValidationError,\n UpdateFlowResponse,\n ValidateFlowJsonResponse,\n} from './types';\n\nexport { FlowTypeEnum } from './types';\n"]}
|
package/dist/chunk-O2OTHNWM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-VW3LGHTJ.js';var e=class extends b{constructor(t,s){super(t,s);}async register(t,s){let r={messaging_product:"whatsapp",pin:t,...s&&{data_localization_region:s}};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/register`,this.config.REQUEST_TIMEOUT,JSON.stringify(r))}async deregister(){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/deregister`,this.config.REQUEST_TIMEOUT,null)}};var m=e;export{e as a,m as b};//# sourceMappingURL=chunk-O2OTHNWM.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-O2OTHNWM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/features/registration/RegistrationApi.ts","../src/features/registration/index.ts"],"names":["RegistrationApi","BaseAPI","config","client","pin","dataLocalizationRegion","body","registration_default"],"mappings":"oCAcA,IAAqBA,CAArB,CAAA,cAA6CC,CAAkD,CAC3F,YAAYC,CAAwBC,CAAAA,CAAAA,CAAwB,CACxD,KAAA,CAAMD,CAAQC,CAAAA,CAAM,EACxB,CAYA,MAAM,QAASC,CAAAA,CAAAA,CAAaC,CAA+E,CAAA,CACvG,IAAMC,CAAAA,CAAyC,CAC3C,iBAAA,CAAmB,WACnB,GAAAF,CAAAA,CAAAA,CACA,GAAIC,CAAAA,EAA0B,CAAE,wBAAA,CAA0BA,CAAuB,CACrF,EAEA,OAAO,IAAA,CAAK,QAER,CAAA,MAAA,CAAA,CAAA,EAAG,IAAK,CAAA,MAAA,CAAO,kBAA6B,CAAA,SAAA,CAAA,CAC5C,KAAK,MAAO,CAAA,eAAA,CACZ,IAAK,CAAA,SAAA,CAAUC,CAAI,CACvB,CACJ,CAUA,MAAM,UAAuC,EAAA,CACzC,OAAO,IAAA,CAAK,QAER,CAAA,MAAA,CAAA,CAAA,EAAG,IAAK,CAAA,MAAA,CAAO,kBAA6B,CAC5C,WAAA,CAAA,CAAA,IAAA,CAAK,MAAO,CAAA,eAAA,CACZ,IACJ,CACJ,CACJ,MCzDOC,CAAQP,CAAAA","file":"chunk-O2OTHNWM.js","sourcesContent":["import { BaseAPI } from '@shared/types/base';\nimport type { WabaConfigType } from '@shared/types/config';\nimport { DataLocalizationRegionEnum, HttpMethodsEnum, WabaConfigEnum } from '@shared/types/enums';\nimport type { RequesterClass, ResponseSuccess } from '@shared/types/request';\n\nimport type * as registration from './types';\n\n/**\n * API for managing WhatsApp Business Account registration.\n *\n * This API allows you to:\n * - Register a WhatsApp Business Account with a PIN\n * - Deregister a WhatsApp Business Account\n */\nexport default class RegistrationApi extends BaseAPI implements registration.RegistrationClass {\n constructor(config: WabaConfigType, client: RequesterClass) {\n super(config, client);\n }\n\n /**\n * Register a WhatsApp Business Account using a PIN.\n *\n * @param pin The registration PIN received via SMS or voice call\n * @param dataLocalizationRegion Optional data localization region\n * @returns Response indicating success or failure\n *\n * @example\n * await whatsappClient.registration.register('123456', DataLocalizationRegionEnum.Asia);\n */\n async register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess> {\n const body: registration.RegistrationRequest = {\n messaging_product: 'whatsapp',\n pin,\n ...(dataLocalizationRegion && { data_localization_region: dataLocalizationRegion }),\n };\n\n return this.sendJson(\n HttpMethodsEnum.Post,\n `${this.config[WabaConfigEnum.PhoneNumberId]}/register`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify(body),\n );\n }\n\n /**\n * Deregister a WhatsApp Business Account.\n *\n * @returns Response indicating success or failure\n *\n * @example\n * await whatsappClient.registration.deregister();\n */\n async deregister(): Promise<ResponseSuccess> {\n return this.sendJson(\n HttpMethodsEnum.Post,\n `${this.config[WabaConfigEnum.PhoneNumberId]}/deregister`,\n this.config[WabaConfigEnum.RequestTimeout],\n null,\n );\n }\n}\n","import RegistrationApi from './RegistrationApi';\n\n// 기본 export 유지\nexport default RegistrationApi;\n\n// 명시적 named export\nexport { RegistrationApi };\n\n// 필요한 타입만 명시적으로 export\nexport type { RegistrationClass, RegistrationRequest } from './types';\n"]}
|
package/dist/chunk-R36L2XYO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-BZ5QDXNR.js';import {b}from'./chunk-VW3LGHTJ.js';var n=class extends b{endpoint="message_templates";constructor(e,s){super(e,s);}async getTemplate(e){return this.sendJson("GET",`${e}`,this.config.REQUEST_TIMEOUT,null)}async updateTemplate(e,s){return this.sendJson("POST",`${e}`,this.config.REQUEST_TIMEOUT,JSON.stringify(s))}async getTemplates(e){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${a(e??{})}`,this.config.REQUEST_TIMEOUT,null)}async createTemplate(e){return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(e))}async deleteTemplate(e){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${a(e)}`,this.config.REQUEST_TIMEOUT,null)}};export{n as a};//# sourceMappingURL=chunk-R36L2XYO.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-R36L2XYO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/features/template/TemplateApi.ts"],"names":["TemplateApi","BaseAPI","config","client","templateId","template","params","objectToQueryString"],"mappings":"wEAaA,IAAqBA,CAArB,CAAA,cAAyCC,CAAiC,CACrD,QAAW,CAAA,mBAAA,CAE5B,WAAYC,CAAAA,CAAAA,CAAwBC,CAAwB,CAAA,CACxD,KAAMD,CAAAA,C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,CAAO,eACZ,CAAA,IACJ,CACJ,CACJ","file":"chunk-R36L2XYO.js","sourcesContent":["import { BaseAPI } from '@shared/types/base';\nimport type { WabaConfigType } from '@shared/types/config';\nimport { HttpMethodsEnum, WabaConfigEnum } from '@shared/types/enums';\nimport type { RequesterClass, ResponsePagination, ResponseSuccess } from '@shared/types/request';\nimport { objectToQueryString } from '@shared/utils/objectToQueryString';\nimport type {\n TemplateClass,\n TemplateDeleteParams,\n TemplateGetParams,\n TemplateRequestBody,\n TemplateResponse,\n} from './types';\n\nexport default class TemplateApi extends BaseAPI implements TemplateClass {\n private readonly endpoint = 'message_templates';\n\n constructor(config: WabaConfigType, client: RequesterClass) {\n super(config, client);\n }\n\n async getTemplate(templateId: string): Promise<TemplateResponse> {\n return this.sendJson(HttpMethodsEnum.Get, `${templateId}`, this.config[WabaConfigEnum.RequestTimeout], null);\n }\n\n async updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess> {\n return this.sendJson(\n HttpMethodsEnum.Post,\n `${templateId}`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify(template),\n );\n }\n\n async getTemplates(params?: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>> {\n return this.sendJson(\n HttpMethodsEnum.Get,\n `${this.config[WabaConfigEnum.BusinessAcctId]}/${this.endpoint}${objectToQueryString(params ?? {})}`,\n this.config[WabaConfigEnum.RequestTimeout],\n null,\n );\n }\n\n async createTemplate(template: TemplateRequestBody): Promise<TemplateResponse> {\n return this.sendJson(\n HttpMethodsEnum.Post,\n `${this.config[WabaConfigEnum.BusinessAcctId]}/${this.endpoint}`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify(template),\n );\n }\n\n async deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess> {\n return this.sendJson(\n HttpMethodsEnum.Delete,\n `${this.config[WabaConfigEnum.BusinessAcctId]}/${this.endpoint}${objectToQueryString(params)}`,\n this.config[WabaConfigEnum.RequestTimeout],\n null,\n );\n }\n}\n"]}
|
package/dist/chunk-UQPD6GIF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-VW3LGHTJ.js';var e=class extends b{constructor(t,o){super(t,o);}async setTwoStepVerificationCode(t){let o={pin:t};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}`,this.config.REQUEST_TIMEOUT,JSON.stringify(o))}};var a=e;export{e as a,a as b};//# sourceMappingURL=chunk-UQPD6GIF.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-UQPD6GIF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/features/twoStepVerification/TwoStepVerificationApi.ts","../src/features/twoStepVerification/index.ts"],"names":["TwoStepVerificationApi","BaseAPI","config","client","pin","body","twoStepVerification_default"],"mappings":"oCAcA,IAAqBA,EAArB,cAAoDC,CAAgE,CAChH,WAAYC,CAAAA,CAAAA,CAAwBC,EAAwB,CACxD,KAAA,CAAMD,EAAQC,CAAM,EACxB,CAWA,MAAM,0BAAA,CAA2BC,EAAuC,CACpE,IAAMC,EAAO,CACT,GAAA,CAAAD,CACJ,CAAA,CAEA,OAAO,IAAK,CAAA,QAAA,CAAA,MAAA,CAER,GAAG,IAAK,CAAA,MAAA,CAAO,kBAA6B,CAC5C,CAAA,CAAA,IAAA,CAAK,OAAO,eACZ,CAAA,IAAA,CAAK,UAAUC,CAAI,CACvB,CACJ,CACJ,MCrCOC,CAAQN,CAAAA","file":"chunk-UQPD6GIF.js","sourcesContent":["import { BaseAPI } from '@shared/types/base';\nimport type { WabaConfigType } from '@shared/types/config';\nimport { HttpMethodsEnum, WabaConfigEnum } from '@shared/types/enums';\nimport type { RequesterClass, ResponseSuccess } from '@shared/types/request';\n\nimport type * as twoStepVerification from './types';\n\n/**\n * API for managing WhatsApp Two-Step Verification.\n *\n * This API allows you to:\n * - Set a two-step verification PIN code\n * - Manage two-step verification settings\n */\nexport default class TwoStepVerificationApi extends BaseAPI implements twoStepVerification.TwoStepVerificationClass {\n constructor(config: WabaConfigType, client: RequesterClass) {\n super(config, client);\n }\n\n /**\n * Set a two-step verification PIN code.\n *\n * @param pin The PIN code to set for two-step verification (6-digit numeric string)\n * @returns Response indicating success or failure\n *\n * @example\n * await whatsappClient.twoStepVerification.setTwoStepVerificationCode('123456');\n */\n async setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess> {\n const body = {\n pin,\n };\n\n return this.sendJson(\n HttpMethodsEnum.Post,\n `${this.config[WabaConfigEnum.PhoneNumberId]}`,\n this.config[WabaConfigEnum.RequestTimeout],\n JSON.stringify(body),\n );\n }\n}\n","import TwoStepVerificationApi from './TwoStepVerificationApi';\n\n// 기본 export 유지\nexport default TwoStepVerificationApi;\n\n// 명시적 named export\nexport { TwoStepVerificationApi };\n\n// 필요한 타입만 명시적으로 export\nexport type { TwoStepVerificationClass, TwoStepVerificationRequest } from './types';\n"]}
|
package/dist/chunk-VW3LGHTJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var s=class{name;debug;constructor(t,e=false){this.name=t,this.debug=e;}log(...t){if(this.debug){let e=`[ ${Date.now()} ]`;this.name&&(e+=` - ${this.name}`),console.log.apply(console,[e,": ",...t]);}}error(...t){let e=`[ ${Date.now()} ] - ERROR`;this.name&&(e+=` - ${this.name}`),console.error.apply(console,[e,": ",...t]);}warn(...t){let e=`[ ${Date.now()} ] - WARN`;this.name&&(e+=` - ${this.name}`),console.warn.apply(console,[e,": ",...t]);}info(...t){let e=`[ ${Date.now()} ] - INFO`;this.name&&(e+=` - ${this.name}`),console.info.apply(console,[e,": ",...t]);}};var a="BaseAPI",l=false,p=new s(a,process.env.DEBUG==="true"||l),r=class{config;client;constructor(t,e){this.config=t,this.client=e,p.log("Initialized with HTTPSClient");}sendJson(t,e,n,o){return this.client.getJson(t,e,n,o)}sendFormData(t,e,n,o){return this.client.sendFormData(t,e,n,o)}sendUrlEncodedForm(t,e,n,o){return this.client.sendUrlEncodedForm(t,e,n,o)}};export{s as a,r as b};//# sourceMappingURL=chunk-VW3LGHTJ.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-VW3LGHTJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/utils/logger.ts","../src/shared/types/base.ts"],"names":["Logger","name","debug","data","prefix","LIB_NAME","LOG_LOCAL","LOGGER","BaseAPI","config","client","method","endpoint","timeout","body"],"mappings":"AAGqBA,IAAAA,CAAAA,CAArB,KAAuD,CAC3C,IACA,CAAA,KAAA,CAER,YAAYC,CAAcC,CAAAA,CAAAA,CAAiB,KAAO,CAAA,CAC9C,IAAK,CAAA,IAAA,CAAOD,EACZ,IAAK,CAAA,KAAA,CAAQC,EACjB,CAEA,GAAOC,CAAAA,GAAAA,CAAAA,CAAa,CAChB,GAAI,IAAA,CAAK,KAAO,CAAA,CACZ,IAAIC,CAAAA,CAAS,KAAK,IAAK,CAAA,GAAA,EAAK,CAAA,EAAA,CAAA,CACxB,IAAK,CAAA,IAAA,GACLA,GAAU,CAAM,GAAA,EAAA,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA,CAE7B,OAAQ,CAAA,GAAA,CAAI,MAAM,OAAS,CAAA,CAACA,CAAQ,CAAA,IAAA,CAAM,GAAGD,CAAI,CAAC,EACtD,CACJ,CAEA,KAAA,CAAA,GAASA,CAAa,CAAA,CAClB,IAAIC,CAAS,CAAA,CAAA,EAAA,EAAK,IAAK,CAAA,GAAA,EAAK,CAAA,UAAA,CAAA,CACxB,KAAK,IACLA,GAAAA,CAAAA,EAAU,CAAM,GAAA,EAAA,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA,CAE7B,QAAQ,KAAM,CAAA,KAAA,CAAM,OAAS,CAAA,CAACA,CAAQ,CAAA,IAAA,CAAM,GAAGD,CAAI,CAAC,EACxD,CAEA,IAAQA,CAAAA,GAAAA,CAAAA,CAAa,CACjB,IAAIC,CAAAA,CAAS,CAAK,EAAA,EAAA,IAAA,CA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AA,CAAAA,CAAQC,EAAUC,CAASC,CAAAA,CAAI,CACtE,CAEU,kBACNH,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACU,CACV,OAAO,IAAK,CAAA,MAAA,CAAO,kBAAsBH,CAAAA,CAAAA,CAAQC,CAAUC,CAAAA,CAAAA,CAASC,CAAI,CAC5E,CACJ","file":"chunk-VW3LGHTJ.js","sourcesContent":["// @ts-nocheck\nimport type { LoggerInterface } from '../types/logger';\n\nexport default class Logger implements LoggerInterface {\n private name: string;\n private debug: boolean;\n\n constructor(name: string, debug: boolean = false) {\n this.name = name;\n this.debug = debug;\n }\n\n log(...data: any[]) {\n if (this.debug) {\n let prefix = `[ ${Date.now()} ]`;\n if (this.name) {\n prefix += ` - ${this.name}`;\n }\n console.log.apply(console, [prefix, ': ', ...data]);\n }\n }\n\n error(...data: any[]) {\n let prefix = `[ ${Date.now()} ] - ERROR`;\n if (this.name) {\n prefix += ` - ${this.name}`;\n }\n console.error.apply(console, [prefix, ': ', ...data]);\n }\n\n warn(...data: any[]) {\n let prefix = `[ ${Date.now()} ] - WARN`;\n if (this.name) {\n prefix += ` - ${this.name}`;\n }\n console.warn.apply(console, [prefix, ': ', ...data]);\n }\n\n info(...data: any[]) {\n let prefix = `[ ${Date.now()} ] - INFO`;\n if (this.name) {\n prefix += ` - ${this.name}`;\n }\n console.info.apply(console, [prefix, ': ', ...data]);\n }\n}\n","import type { WabaConfigType } from './config';\n\nexport declare class BaseClass {\n constructor(config: WabaConfigType);\n}\n\nimport Logger from '../utils/logger';\nimport { HttpMethodsEnum } from './enums';\nimport type { RequesterClass } from './request';\n\nconst LIB_NAME = 'BaseAPI';\nconst LOG_LOCAL = false;\nconst LOGGER = new Logger(LIB_NAME, process.env.DEBUG === 'true' || LOG_LOCAL);\n\nexport class BaseAPI implements BaseClass {\n protected config: WabaConfigType;\n protected client: RequesterClass;\n\n constructor(config: WabaConfigType, client: RequesterClass) {\n this.config = config;\n this.client = client;\n LOGGER.log('Initialized with HTTPSClient');\n }\n\n protected sendJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T> {\n return this.client.getJson<T>(method, endpoint, timeout, body);\n }\n\n protected sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T> {\n return this.client.sendFormData<T>(method, endpoint, timeout, body);\n }\n\n protected sendUrlEncodedForm<T>(\n method: HttpMethodsEnum,\n endpoint: string,\n timeout: number,\n body?: any,\n ): Promise<T> {\n return this.client.sendUrlEncodedForm<T>(method, endpoint, timeout, body);\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/features/media/MediaApi.ts","../src/features/media/index.ts"],"names":["MediaApi","BaseAPI","config","client","mediaId","phone_number_id","file","messagingProduct","formData","mediaUrl","media_default"],"mappings":"oCAgBqBA,IAAAA,CAAAA,CAArB,cAAsCC,CAAoC,CACrD,QAAA,CAAW,QAE5B,WAAYC,CAAAA,CAAAA,CAAwBC,CAAwB,CAAA,CACxD,KAAMD,CAAAA,CAAAA,CAAQC,CAAM,EACxB,CAYA,MAAM,YAAA,CAAaC,CAAiBC,CAAAA,CAAAA,CAAwD,CACxF,OAAO,IAAA,CAAK,QAA8B,CAAA,KAAA,CAAA,CAAA,EAAGD,CAAO,CAAA,CAAA,CAAI,KAAK,MAAO,CAAA,eAAA,CAAgC,IAAI,CAC5G,CAaA,MAAM,YAAYE,CAAYC,CAAAA,CAAAA,CAA2B,UAAgD,CAAA,CACrG,IAAMC,CAAAA,CAAW,IAAI,QACrB,CAAA,OAAAA,CAAS,CAAA,MAAA,CAAO,MAAQF,CAAAA,CAAI,EAC5BE,CAAS,CAAA,MAAA,CAAO,mBAAqBD,CAAAA,CAAgB,CACrDC,CAAAA,CAAAA,CAAS,OAAO,MAAQF,CAAAA,CAAAA,CAAK,IAAI,CAAA,CAE1B,IAAK,CAAA,QAAA,CAAA,MAAA,CAER,GAAG,IAAK,CAAA,MAAA,CAAO,kBAA6B,CAAA,CAAA,EAAI,IAAK,CAAA,QAAQ,GAC7D,IAAK,CAAA,MAAA,CAAO,eACZE,CAAAA,CACJ,CACJ,CAYA,MAAM,WAAYJ,CAAAA,CAAAA,CAAiBC,CAAoD,CAAA,CACnF,OAAO,IAAA,CAAK,kBAAiC,CAAGD,EAAAA,CAAO,CAAI,CAAA,CAAA,IAAA,CAAK,MAAO,CAAA,eAAA,CAAgC,IAAI,CAC/G,CAWA,MAAM,aAAA,CAAcK,CAAiC,CAAA,CACjD,OAAO,IAAK,CAAA,QAAA,CAAA,KAAA,CAA8BA,CAAU,CAAA,IAAA,CAAK,MAAO,CAAA,eAAA,CAAgC,IAAI,CACxG,CACJ,ECrFA,IAAOC,CAAQV,CAAAA","file":"chunk-XPPDOFBN.js","sourcesContent":["import { BaseAPI } from '@shared/types/base';\nimport type { WabaConfigType } from '@shared/types/config';\nimport { HttpMethodsEnum, WabaConfigEnum } from '@shared/types/enums';\nimport type { RequesterClass, ResponseSuccess } from '@shared/types/request';\n\nimport type * as media from './types';\n\n/**\n * API for managing WhatsApp Media.\n *\n * This API allows you to:\n * - Get media information by ID\n * - Upload media files\n * - Delete media files\n * - Download media files from URLs\n */\nexport default class MediaApi extends BaseAPI implements media.MediaClass {\n private readonly endpoint = 'media';\n\n constructor(config: WabaConfigType, client: RequesterClass) {\n super(config, client);\n }\n\n /**\n * Retrieve media information by media ID.\n *\n * @param mediaId The media ID to retrieve information for\n * @param phone_number_id Optional phone number ID (defaults to configured one)\n * @returns Media information including URL, mime type, file size, etc.\n *\n * @example\n * const mediaInfo = await whatsappClient.media.getMediaById('media_id_123');\n */\n async getMediaById(mediaId: string, phone_number_id?: string): Promise<media.MediaResponse> {\n return this.sendJson(HttpMethodsEnum.Get, `${mediaId}`, this.config[WabaConfigEnum.RequestTimeout], null);\n }\n\n /**\n * Upload a media file to WhatsApp.\n *\n * @param file The file to upload\n * @param messagingProduct The messaging product (default: 'whatsapp')\n * @returns Upload response containing the media ID\n *\n * @example\n * const file = new File([buffer], 'image.jpg', { type: 'image/jpeg' });\n * const result = await whatsappClient.media.uploadMedia(file);\n */\n async uploadMedia(file: File, messagingProduct: string = 'whatsapp'): Promise<media.UploadMediaResponse> {\n const formData = new FormData();\n formData.append('file', file);\n formData.append('messaging_product', messagingProduct);\n formData.append('type', file.type);\n\n return this.sendJson(\n HttpMethodsEnum.Post,\n `${this.config[WabaConfigEnum.PhoneNumberId]}/${this.endpoint}`,\n this.config[WabaConfigEnum.RequestTimeout],\n formData,\n );\n }\n\n /**\n * Delete a media file.\n *\n * @param mediaId The media ID to delete\n * @param phone_number_id Optional phone number ID (defaults to configured one)\n * @returns Response indicating success or failure\n *\n * @example\n * await whatsappClient.media.deleteMedia('media_id_123');\n */\n async deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess> {\n return this.sendJson(HttpMethodsEnum.Delete, `${mediaId}`, this.config[WabaConfigEnum.RequestTimeout], null);\n }\n\n /**\n * Download media from a URL.\n *\n * @param mediaUrl The URL to download media from\n * @returns Blob containing the media data\n *\n * @example\n * const blob = await whatsappClient.media.downloadMedia('https://...');\n */\n async downloadMedia(mediaUrl: string): Promise<Blob> {\n return this.sendJson(HttpMethodsEnum.Get, mediaUrl, this.config[WabaConfigEnum.RequestTimeout], null);\n }\n}\n","import MediaApi from './MediaApi';\n\n// 기본 export 유지\nexport default MediaApi;\n\n// 명시적 named export\nexport { MediaApi };\n\n// 필요한 타입만 명시적으로 export\nexport type { MediaClass, MediaResponse, MediasResponse, UploadMediaResponse } from './types';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { E as EncryptionApi } from '../../EncryptionApi-PHxeI2G_.js';
|
|
2
|
-
export { a as EncryptionClass, b as EncryptionPublicKeyResponse } from '../../EncryptionApi-PHxeI2G_.js';
|
|
3
|
-
import '../../base-BhCbbsxB.js';
|
|
4
|
-
import '../../shared/types/config.js';
|
|
5
|
-
import '../../enums-DvwSJq9w.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { EncryptionApi, EncryptionApi as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { F as FlowApi } from '../../FlowApi-CASVC-Al.js';
|
|
2
|
-
export { C as CreateFlowResponse, a as Flow, c as FlowActionEnum, d as FlowAssetsResponse, e as FlowCategoryEnum, f as FlowClass, g as FlowEndpointRequest, h as FlowEndpointResponse, i as FlowMigrationResponse, j as FlowPreviewResponse, l as FlowStatusEnum, b as FlowType, n as FlowTypeEnum, m as FlowValidationError, k as FlowsListResponse, U as UpdateFlowResponse, V as ValidateFlowJsonResponse } from '../../FlowApi-CASVC-Al.js';
|
|
3
|
-
import '../../base-BhCbbsxB.js';
|
|
4
|
-
import '../../shared/types/config.js';
|
|
5
|
-
import '../../enums-DvwSJq9w.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { FlowApi, FlowApi as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { M as MediaApi } from '../../MediaApi-B2vtjiCm.js';
|
|
2
|
-
export { a as MediaClass, b as MediaResponse, c as MediasResponse, U as UploadMediaResponse } from '../../MediaApi-B2vtjiCm.js';
|
|
3
|
-
import '../../base-BhCbbsxB.js';
|
|
4
|
-
import '../../shared/types/config.js';
|
|
5
|
-
import '../../enums-DvwSJq9w.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { MediaApi, MediaApi as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{a as BusinessProfileApi,b as default}from'../../chunk-KFPOVYEJ.js';import'../../chunk-7GL74SXM.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Q as QrCodeApi } from '../../QrCodeApi-D3rVKuxV.js';
|
|
2
|
-
export { C as CreateQrCodeRequest, a as QrCodeClass, b as QrCodeResponse, c as QrCodesResponse, U as UpdateQrCodeRequest } from '../../QrCodeApi-D3rVKuxV.js';
|
|
3
|
-
import '../../base-BhCbbsxB.js';
|
|
4
|
-
import '../../shared/types/config.js';
|
|
5
|
-
import '../../enums-DvwSJq9w.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { QrCodeApi, QrCodeApi as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { R as RegistrationApi } from '../../RegistrationApi-DZBJWAZS.js';
|
|
2
|
-
export { a as RegistrationClass, b as RegistrationRequest } from '../../RegistrationApi-DZBJWAZS.js';
|
|
3
|
-
import '../../base-BhCbbsxB.js';
|
|
4
|
-
import '../../shared/types/config.js';
|
|
5
|
-
import '../../enums-DvwSJq9w.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { RegistrationApi, RegistrationApi as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{c as createAuthenticationTemplate,d as createCatalogTemplate,e as createCouponTemplate,f as createLimitedTimeOfferTemplate,h as createMPMTemplate,g as createMediaCardCarouselTemplate,b as createOTPTemplate,i as createProductCardCarouselTemplate,j as createSPMTemplate,a as createTemplate}from'../../chunk-CNGQISKS.js';export{a as TemplateApi,a as default}from'../../chunk-R36L2XYO.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { T as TwoStepVerificationApi } from '../../TwoStepVerificationApi-6jV5pDxS.js';
|
|
2
|
-
export { a as TwoStepVerificationClass, b as TwoStepVerificationRequest } from '../../TwoStepVerificationApi-6jV5pDxS.js';
|
|
3
|
-
import '../../base-BhCbbsxB.js';
|
|
4
|
-
import '../../shared/types/config.js';
|
|
5
|
-
import '../../enums-DvwSJq9w.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { TwoStepVerificationApi, TwoStepVerificationApi as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { W as WabaApi } from '../../WabaApi-B8Gv2UNE.js';
|
|
2
|
-
export { U as UpdateWabaSubscription, b as WABAClass, a as WabaAccount, c as WabaSubscriptions } from '../../WabaApi-B8Gv2UNE.js';
|
|
3
|
-
import '../../base-BhCbbsxB.js';
|
|
4
|
-
import '../../shared/types/config.js';
|
|
5
|
-
import '../../enums-DvwSJq9w.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { WabaApi, WabaApi as default };
|
package/dist/index-DiCI1vEz.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { E as EncryptionApi } from './EncryptionApi-PHxeI2G_.js';
|
|
2
|
-
import { F as FlowApi } from './FlowApi-CASVC-Al.js';
|
|
3
|
-
import { WhatsAppConfig, WabaConfigType } from './shared/types/config.js';
|
|
4
|
-
import { M as MediaApi } from './MediaApi-B2vtjiCm.js';
|
|
5
|
-
import { M as MessagesApi } from './MessageApi-ptFlWg3O.js';
|
|
6
|
-
import { P as PhoneNumberApi } from './PhoneNumberApi-DMb_G3uw.js';
|
|
7
|
-
import { B as BusinessProfileApi } from './BusinessProfileApi-DE7Nnuy_.js';
|
|
8
|
-
import { Q as QrCodeApi } from './QrCodeApi-D3rVKuxV.js';
|
|
9
|
-
import { R as RegistrationApi } from './RegistrationApi-DZBJWAZS.js';
|
|
10
|
-
import { f as TemplateApi } from './TemplateApi-BFeM9qJS.js';
|
|
11
|
-
import { T as TwoStepVerificationApi } from './TwoStepVerificationApi-6jV5pDxS.js';
|
|
12
|
-
import { W as WabaApi } from './WabaApi-B8Gv2UNE.js';
|
|
13
|
-
import { H as HttpMethodsEnum, l as SDKEnums } from './enums-DvwSJq9w.js';
|
|
14
|
-
import { a as RequesterClass } from './base-BhCbbsxB.js';
|
|
15
|
-
import { Agent } from 'https';
|
|
16
|
-
|
|
17
|
-
type ResponseHeaderValue = string | string[] | undefined;
|
|
18
|
-
type ResponseHeaders = Record<string, ResponseHeaderValue>;
|
|
19
|
-
type ResponseJSONBody = Record<string, unknown>;
|
|
20
|
-
declare class HttpsClientResponseClass {
|
|
21
|
-
constructor(resp: Response);
|
|
22
|
-
statusCode: () => number;
|
|
23
|
-
headers: () => ResponseHeaders;
|
|
24
|
-
rawResponse: () => Response;
|
|
25
|
-
json: () => Promise<ResponseJSONBody>;
|
|
26
|
-
}
|
|
27
|
-
declare class HttpsClientClass {
|
|
28
|
-
constructor();
|
|
29
|
-
clearSockets: () => boolean;
|
|
30
|
-
sendRequest: (host: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null) => Promise<HttpsClientResponseClass>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare class WhatsAppClass {
|
|
34
|
-
constructor(config?: WhatsAppConfig);
|
|
35
|
-
readonly messages: MessagesApi;
|
|
36
|
-
readonly templates: TemplateApi;
|
|
37
|
-
readonly phoneNumber: PhoneNumberApi;
|
|
38
|
-
readonly qrCode: QrCodeApi;
|
|
39
|
-
readonly encryption: EncryptionApi;
|
|
40
|
-
readonly twoStepVerification: TwoStepVerificationApi;
|
|
41
|
-
readonly registration: RegistrationApi;
|
|
42
|
-
readonly media: MediaApi;
|
|
43
|
-
readonly waba: WabaApi;
|
|
44
|
-
readonly flow: FlowApi;
|
|
45
|
-
readonly businessProfile: BusinessProfileApi;
|
|
46
|
-
updateTimeout(ms: number): boolean;
|
|
47
|
-
updatePhoneNumberId(phoneNumberId: number): boolean;
|
|
48
|
-
updateAccessToken(accessToken: string): boolean;
|
|
49
|
-
updateWabaId(wabaId: string): boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare class HttpsClient implements HttpsClientClass {
|
|
53
|
-
agent: Agent;
|
|
54
|
-
constructor();
|
|
55
|
-
clearSockets(): boolean;
|
|
56
|
-
sendRequest(hostname: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null): Promise<HttpsClientResponseClass>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
declare class Requester implements RequesterClass {
|
|
60
|
-
client: Readonly<HttpsClient>;
|
|
61
|
-
accessToken: Readonly<string>;
|
|
62
|
-
phoneNumberId: Readonly<number>;
|
|
63
|
-
businessAcctId: Readonly<string>;
|
|
64
|
-
apiVersion: Readonly<string>;
|
|
65
|
-
userAgent: Readonly<string>;
|
|
66
|
-
host: Readonly<string>;
|
|
67
|
-
protocol: Readonly<string>;
|
|
68
|
-
constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string);
|
|
69
|
-
buildHeader(contentType: string, additionalHeaders?: Record<string, string>): HeadersInit;
|
|
70
|
-
buildCAPIPath(endpoint: string): string;
|
|
71
|
-
sendRequest(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any, contentType?: string, additionalHeaders?: Record<string, string>): Promise<HttpsClientResponseClass>;
|
|
72
|
-
getJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
73
|
-
sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: FormData, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
74
|
-
sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: Record<string, string>, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
declare class WhatsApp implements WhatsAppClass {
|
|
78
|
-
config: WabaConfigType;
|
|
79
|
-
requester: Readonly<Requester>;
|
|
80
|
-
readonly messages: MessagesApi;
|
|
81
|
-
readonly templates: TemplateApi;
|
|
82
|
-
readonly phoneNumber: PhoneNumberApi;
|
|
83
|
-
readonly qrCode: QrCodeApi;
|
|
84
|
-
readonly encryption: EncryptionApi;
|
|
85
|
-
readonly twoStepVerification: TwoStepVerificationApi;
|
|
86
|
-
readonly registration: RegistrationApi;
|
|
87
|
-
readonly media: MediaApi;
|
|
88
|
-
readonly waba: WabaApi;
|
|
89
|
-
readonly flow: FlowApi;
|
|
90
|
-
readonly businessProfile: BusinessProfileApi;
|
|
91
|
-
static readonly Enums: typeof SDKEnums;
|
|
92
|
-
constructor(config?: WhatsAppConfig);
|
|
93
|
-
private userAgent;
|
|
94
|
-
updateTimeout(ms: number): boolean;
|
|
95
|
-
updatePhoneNumberId(phoneNumberId: number): boolean;
|
|
96
|
-
updateAccessToken(accessToken: string): boolean;
|
|
97
|
-
updateWabaId(wabaId: string): boolean;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export { HttpsClientClass as H, type ResponseHeaders as R, WhatsApp as W, HttpsClientResponseClass as a, type ResponseHeaderValue as b, type ResponseJSONBody as c, WhatsAppClass as d };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { A as AudioMediaTypesEnum, B as BusinessVerticalEnum, b as ButtonPositionEnum, a as CategoryEnum, c as ComponentTypesEnum, d as ConversationTypesEnum, C as CurrencyCodesEnum, D as DataLocalizationRegionEnum, h as DocumentMediaTypesEnum, H as HttpMethodsEnum, g as ImageMediaTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, R as ReferralSourceTypesEnum, k as RequestCodeMethodsEnum, e as StatusEnum, f as StickerMediaTypesEnum, S as SubTypeEnum, j as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, i as WebhookTypesEnum } from '../../enums-DvwSJq9w.js';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
interface MetaError extends Error {
|
|
2
|
-
error: {
|
|
3
|
-
message: string;
|
|
4
|
-
type: string;
|
|
5
|
-
code: number;
|
|
6
|
-
error_data?: {
|
|
7
|
-
messaging_product: 'whatsapp';
|
|
8
|
-
details: string;
|
|
9
|
-
};
|
|
10
|
-
error_subcode?: number;
|
|
11
|
-
fbtrace_id: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Determines if the error is a Meta API error response
|
|
16
|
-
* @param error Any error object to check
|
|
17
|
-
* @returns Type guard indicating if error is a Meta API error
|
|
18
|
-
*/
|
|
19
|
-
declare function isMetaError(error: any): error is MetaError;
|
|
20
|
-
|
|
21
|
-
export { type MetaError, isMetaError };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"isMetaError.js"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|