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
package/dist/index.d.ts
CHANGED
|
@@ -1,83 +1,22 @@
|
|
|
1
|
-
export { W as
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export { T as TwoStepVerificationApi } from './TwoStepVerificationApi-6jV5pDxS.js';
|
|
17
|
-
export { b as WABAClass, a as WabaAccount, W as WabaApi } from './WabaApi-B8Gv2UNE.js';
|
|
18
|
-
export { MetaError, isMetaError } from './shared/utils/isMetaError.js';
|
|
1
|
+
export { W as WhatsApp, W as WhatsAppLegacy } from './WhatsApp-BIBtT-y9.js';
|
|
2
|
+
export { WabaConfigType, WhatsAppConfig } from './types/config.js';
|
|
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-UAvzhJfV.js';
|
|
5
|
+
export { M as MediaApi } from './MediaApi-BrEKpqi_.js';
|
|
6
|
+
export { M as MessagesApi } from './MessageApi-Circorzz.js';
|
|
7
|
+
export { P as PhoneNumberApi } from './PhoneNumberApi-DKlu9PHl.js';
|
|
8
|
+
export { B as BusinessProfileApi } from './BusinessProfileApi-WXscSgo-.js';
|
|
9
|
+
export { T as TemplateApi } from './TemplateApi-xGgIZt89.js';
|
|
10
|
+
export { T as TwoStepVerificationApi } from './TwoStepVerificationApi-DfNPIz-C.js';
|
|
11
|
+
export { W as WebhookContact, a as WebhookEvent, b as WebhookMessage } from './WebhookProcessor-ByAe7Kf_.js';
|
|
12
|
+
export { webhookHandler as ExpressWebhook } from './core/webhook/frameworks/express.js';
|
|
13
|
+
export { webhookHandler as NextJsWebhook } from './core/webhook/frameworks/nextjs.js';
|
|
14
|
+
import './request-vYMaEfk5.js';
|
|
15
|
+
import './httpsClient-v4gmltzS.js';
|
|
19
16
|
import 'https';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
debug(...data: any[]): void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare function buildFieldsQueryString(fields?: string[] | string): string;
|
|
30
|
-
|
|
31
|
-
declare class Logger implements LoggerInterface {
|
|
32
|
-
private name;
|
|
33
|
-
private debug;
|
|
34
|
-
constructor(name: string, debug?: boolean);
|
|
35
|
-
log(...data: any[]): void;
|
|
36
|
-
error(...data: any[]): void;
|
|
37
|
-
warn(...data: any[]): void;
|
|
38
|
-
info(...data: any[]): void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
declare const objectToQueryString: (params: Record<string, any>) => string;
|
|
42
|
-
|
|
43
|
-
declare const DATA_EXCHANGE_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK];
|
|
44
|
-
declare const ERROR_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT];
|
|
45
|
-
/**
|
|
46
|
-
* Type guard to check if a request is a Data Exchange request
|
|
47
|
-
* Validates the request structure according to the Flow API specifications
|
|
48
|
-
*
|
|
49
|
-
* @param request The Flow endpoint request to check
|
|
50
|
-
* @returns True if the request is a valid Data Exchange request, false otherwise
|
|
51
|
-
*/
|
|
52
|
-
declare function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {
|
|
53
|
-
action: (typeof DATA_EXCHANGE_ACTIONS)[number];
|
|
54
|
-
screen?: string;
|
|
55
|
-
flow_token: string;
|
|
56
|
-
data?: Record<string, any>;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Type guard to check if a request is an Error Notification request
|
|
60
|
-
* Validates the request structure according to the Flow API error specifications
|
|
61
|
-
*
|
|
62
|
-
* @param request The Flow endpoint request to check
|
|
63
|
-
* @returns True if the request is a valid Error Notification request, false otherwise
|
|
64
|
-
*/
|
|
65
|
-
declare function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {
|
|
66
|
-
action: (typeof ERROR_ACTIONS)[number];
|
|
67
|
-
screen: string;
|
|
68
|
-
flow_token: string;
|
|
69
|
-
data: {
|
|
70
|
-
error: string;
|
|
71
|
-
error_message: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Type guard to check if a request is a Ping (health check) request
|
|
76
|
-
* Simple validation for health check endpoints in the Flow API
|
|
77
|
-
*
|
|
78
|
-
* @param request The Flow endpoint request to check
|
|
79
|
-
* @returns True if the request is a Ping request, false otherwise
|
|
80
|
-
*/
|
|
81
|
-
declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
|
|
82
|
-
|
|
83
|
-
export { FlowEndpointRequest, Logger, type LoggerInterface, buildFieldsQueryString, isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest, objectToQueryString };
|
|
17
|
+
import './EncryptionApi-D7pt-OXT.js';
|
|
18
|
+
import './base-CdGDdVEl.js';
|
|
19
|
+
import './QrCodeApi-7vDwIBHR.js';
|
|
20
|
+
import './RegistrationApi-qO_qoti9.js';
|
|
21
|
+
import './WabaApi-DqQi_68m.js';
|
|
22
|
+
import './common-DDXsNyLF.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import'./chunk-
|
|
1
|
+
import'./chunk-RWCVPWRC.js';export{a as ExpressWebhook}from'./chunk-OA2SW4AF.js';export{a as NextJsWebhook}from'./chunk-UCBYECNQ.js';import'./chunk-HJGN3PO4.js';import'./chunk-WGGN32O2.js';export{b as WhatsApp,b as WhatsAppLegacy}from'./chunk-B7DCL6I7.js';import'./chunk-FKXSL2JK.js';import'./chunk-AMHQGG6Z.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';import'./chunk-NLF2JGYY.js';export{b as PhoneNumberApi}from'./chunk-FSKBLPGE.js';export{a as TemplateApi}from'./chunk-VHAODWCN.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
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { H as HttpMethodsEnum } from './enums-DvwSJq9w.js';
|
|
1
|
+
import { H as HttpMethodsEnum } from './enums-BZd9T2ul.js';
|
|
3
2
|
|
|
4
3
|
type GeneralRequestBody = Record<string, unknown>;
|
|
5
4
|
interface GeneralHeaderInterface {
|
|
@@ -48,17 +47,4 @@ declare class RequesterClass {
|
|
|
48
47
|
sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: Record<string, string>, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
constructor(config: WabaConfigType);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare class BaseAPI implements BaseClass {
|
|
56
|
-
protected config: WabaConfigType;
|
|
57
|
-
protected client: RequesterClass;
|
|
58
|
-
constructor(config: WabaConfigType, client: RequesterClass);
|
|
59
|
-
protected sendJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
|
|
60
|
-
protected sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
|
|
61
|
-
protected sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export { BaseAPI as B, type GeneralRequestBody as G, type Paging as P, type ResponseSuccess as R, RequesterClass as a, type ResponsePagination as b, type ResponseData as c, BaseClass as d, type GeneralHeaderInterface as e, type RequesterResponseInterface as f };
|
|
50
|
+
export { type GeneralHeaderInterface as G, type Paging as P, RequesterClass as R, type GeneralRequestBody as a, type RequesterResponseInterface as b, type ResponseData as c, type ResponsePagination as d, type ResponseSuccess as e };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { A as AudioMediaTypesEnum, k as BusinessVerticalEnum, B as ButtonPositionEnum, a as CategoryEnum, C as ComponentTypesEnum, b as ConversationTypesEnum, i as CurrencyCodesEnum, j as DataLocalizationRegionEnum, D as DocumentMediaTypesEnum, H as HttpMethodsEnum, e as ImageMediaTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, R as ReferralSourceTypesEnum, h as RequestCodeMethodsEnum, c as StatusEnum, d as StickerMediaTypesEnum, S as SubTypeEnum, g as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, f as WebhookTypesEnum } from '../enums-BZd9T2ul.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{q as AudioMediaTypesEnum,y as BusinessVerticalEnum,g as ButtonPositionEnum,a as CategoryEnum,i as ComponentTypesEnum,k as ConversationTypesEnum,w as CurrencyCodesEnum,x as DataLocalizationRegionEnum,p as DocumentMediaTypesEnum,c as HttpMethodsEnum,o as ImageMediaTypesEnum,f as InteractiveTypesEnum,v as LanguagesEnum,d as MessageTypesEnum,e as ParametersTypesEnum,t as ReferralSourceTypesEnum,u as RequestCodeMethodsEnum,l as StatusEnum,n as StickerMediaTypesEnum,h as SubTypeEnum,s as SystemChangeTypesEnum,b as TemplateStatusEnum,m as VideoMediaTypesEnum,j as WabaConfigEnum,r as WebhookTypesEnum}from'
|
|
1
|
+
export{q as AudioMediaTypesEnum,y as BusinessVerticalEnum,g as ButtonPositionEnum,a as CategoryEnum,i as ComponentTypesEnum,k as ConversationTypesEnum,w as CurrencyCodesEnum,x as DataLocalizationRegionEnum,p as DocumentMediaTypesEnum,c as HttpMethodsEnum,o as ImageMediaTypesEnum,f as InteractiveTypesEnum,v as LanguagesEnum,d as MessageTypesEnum,e as ParametersTypesEnum,t as ReferralSourceTypesEnum,u as RequestCodeMethodsEnum,l as StatusEnum,n as StickerMediaTypesEnum,h as SubTypeEnum,s as SystemChangeTypesEnum,b as TemplateStatusEnum,m as VideoMediaTypesEnum,j as WabaConfigEnum,r as WebhookTypesEnum}from'../chunk-KMAH6636.js';//# sourceMappingURL=enums.js.map
|
|
2
2
|
//# sourceMappingURL=enums.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { B as BaseAPI, a as BaseClass } from '../base-CdGDdVEl.js';
|
|
2
|
+
export { WabaConfigType, WhatsAppConfig } from './config.js';
|
|
3
|
+
export { L as LoggerInterface } from '../logger-BdE0Vyim.js';
|
|
4
|
+
export { H as HttpsClientClass, a as HttpsClientResponseClass, b as ResponseHeaderValue, R as ResponseHeaders, c as ResponseJSONBody } from '../httpsClient-v4gmltzS.js';
|
|
5
|
+
export { G as GeneralHeaderInterface, a as GeneralRequestBody, P as Paging, R as RequesterClass, b as RequesterResponseInterface, c as ResponseData, d as ResponsePagination, e as ResponseSuccess } from '../request-vYMaEfk5.js';
|
|
6
|
+
export { A as AudioMediaTypesEnum, k as BusinessVerticalEnum, B as ButtonPositionEnum, a as CategoryEnum, C as ComponentTypesEnum, b as ConversationTypesEnum, i as CurrencyCodesEnum, j as DataLocalizationRegionEnum, D as DocumentMediaTypesEnum, H as HttpMethodsEnum, e as ImageMediaTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, R as ReferralSourceTypesEnum, h as RequestCodeMethodsEnum, c as StatusEnum, d as StickerMediaTypesEnum, S as SubTypeEnum, g as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, f as WebhookTypesEnum } from '../enums-BZd9T2ul.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{a as BaseAPI}from'../chunk-RIL6QABY.js';export{q as AudioMediaTypesEnum,y as BusinessVerticalEnum,g as ButtonPositionEnum,a as CategoryEnum,i as ComponentTypesEnum,k as ConversationTypesEnum,w as CurrencyCodesEnum,x as DataLocalizationRegionEnum,p as DocumentMediaTypesEnum,c as HttpMethodsEnum,o as ImageMediaTypesEnum,f as InteractiveTypesEnum,v as LanguagesEnum,d as MessageTypesEnum,e as ParametersTypesEnum,t as ReferralSourceTypesEnum,u as RequestCodeMethodsEnum,l as StatusEnum,n as StickerMediaTypesEnum,h as SubTypeEnum,s as SystemChangeTypesEnum,b as TemplateStatusEnum,m as VideoMediaTypesEnum,j as WabaConfigEnum,r as WebhookTypesEnum}from'../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { WabaConfigType } from '../types/config.js';
|
|
2
|
+
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
|
+
import '../enums-BZd9T2ul.js';
|
|
5
|
+
import '../request-vYMaEfk5.js';
|
|
6
|
+
|
|
7
|
+
declare function buildFieldsQueryString(fields?: string[] | string): string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Formats configuration as a terminal table
|
|
11
|
+
* @param config - The WABA configuration object
|
|
12
|
+
* @param apiName - The name of the API being initialized
|
|
13
|
+
* @returns Formatted table string
|
|
14
|
+
*/
|
|
15
|
+
declare function formatConfigTable(config: WabaConfigType): string;
|
|
16
|
+
|
|
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
|
+
declare class Logger implements LoggerInterface {
|
|
38
|
+
private name;
|
|
39
|
+
private debug;
|
|
40
|
+
constructor(name: string, debug?: boolean);
|
|
41
|
+
log(...data: any[]): void;
|
|
42
|
+
error(...data: any[]): void;
|
|
43
|
+
warn(...data: any[]): void;
|
|
44
|
+
info(...data: any[]): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare const objectToQueryString: (params: Record<string, any>) => string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get SDK version from package.json
|
|
51
|
+
*/
|
|
52
|
+
declare function getVersion(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Generate User-Agent string following official SDK pattern
|
|
55
|
+
*/
|
|
56
|
+
declare function getUserAgent(): string;
|
|
57
|
+
|
|
58
|
+
declare const DATA_EXCHANGE_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK];
|
|
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 };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{a as isFlowDataExchangeRequest,b as isFlowErrorRequest,c as isFlowPingRequest}from'../chunk-WGGN32O2.js';export{a as Logger,b as formatConfigTable,e as getUserAgent,d as getVersion,c as isMetaError}from'../chunk-FKXSL2JK.js';export{a as buildFieldsQueryString}from'../chunk-CRZ7EUYR.js';import'../chunk-NLF2JGYY.js';export{a as objectToQueryString}from'../chunk-MJEG3K4V.js';import'../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meta-cloud-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "TypeScript wrapper for Meta's Cloud API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,59 +29,59 @@
|
|
|
29
29
|
"default": "./dist/index.js"
|
|
30
30
|
},
|
|
31
31
|
"./messages": {
|
|
32
|
-
"types": "./dist/
|
|
33
|
-
"import": "./dist/
|
|
34
|
-
"default": "./dist/
|
|
32
|
+
"types": "./dist/api/messages/index.d.ts",
|
|
33
|
+
"import": "./dist/api/messages/index.js",
|
|
34
|
+
"default": "./dist/api/messages/index.js"
|
|
35
35
|
},
|
|
36
36
|
"./media": {
|
|
37
|
-
"types": "./dist/
|
|
38
|
-
"import": "./dist/
|
|
39
|
-
"default": "./dist/
|
|
37
|
+
"types": "./dist/api/media/index.d.ts",
|
|
38
|
+
"import": "./dist/api/media/index.js",
|
|
39
|
+
"default": "./dist/api/media/index.js"
|
|
40
40
|
},
|
|
41
41
|
"./profile": {
|
|
42
|
-
"types": "./dist/
|
|
43
|
-
"import": "./dist/
|
|
44
|
-
"default": "./dist/
|
|
42
|
+
"types": "./dist/api/profile/index.d.ts",
|
|
43
|
+
"import": "./dist/api/profile/index.js",
|
|
44
|
+
"default": "./dist/api/profile/index.js"
|
|
45
45
|
},
|
|
46
46
|
"./flow": {
|
|
47
|
-
"types": "./dist/
|
|
48
|
-
"import": "./dist/
|
|
49
|
-
"default": "./dist/
|
|
47
|
+
"types": "./dist/api/flow/index.d.ts",
|
|
48
|
+
"import": "./dist/api/flow/index.js",
|
|
49
|
+
"default": "./dist/api/flow/index.js"
|
|
50
50
|
},
|
|
51
51
|
"./phone": {
|
|
52
|
-
"types": "./dist/
|
|
53
|
-
"import": "./dist/
|
|
54
|
-
"default": "./dist/
|
|
52
|
+
"types": "./dist/api/phone/index.d.ts",
|
|
53
|
+
"import": "./dist/api/phone/index.js",
|
|
54
|
+
"default": "./dist/api/phone/index.js"
|
|
55
55
|
},
|
|
56
56
|
"./template": {
|
|
57
|
-
"types": "./dist/
|
|
58
|
-
"import": "./dist/
|
|
59
|
-
"default": "./dist/
|
|
57
|
+
"types": "./dist/api/template/index.d.ts",
|
|
58
|
+
"import": "./dist/api/template/index.js",
|
|
59
|
+
"default": "./dist/api/template/index.js"
|
|
60
60
|
},
|
|
61
61
|
"./waba": {
|
|
62
|
-
"types": "./dist/
|
|
63
|
-
"import": "./dist/
|
|
64
|
-
"default": "./dist/
|
|
62
|
+
"types": "./dist/api/waba/index.d.ts",
|
|
63
|
+
"import": "./dist/api/waba/index.js",
|
|
64
|
+
"default": "./dist/api/waba/index.js"
|
|
65
65
|
},
|
|
66
66
|
"./qrCode": {
|
|
67
|
-
"types": "./dist/
|
|
68
|
-
"import": "./dist/
|
|
69
|
-
"default": "./dist/
|
|
67
|
+
"types": "./dist/api/qrCode/index.d.ts",
|
|
68
|
+
"import": "./dist/api/qrCode/index.js",
|
|
69
|
+
"default": "./dist/api/qrCode/index.js"
|
|
70
70
|
},
|
|
71
71
|
"./twoStepVerification": {
|
|
72
|
-
"types": "./dist/
|
|
73
|
-
"import": "./dist/
|
|
74
|
-
"default": "./dist/
|
|
72
|
+
"types": "./dist/api/twoStepVerification/index.d.ts",
|
|
73
|
+
"import": "./dist/api/twoStepVerification/index.js",
|
|
74
|
+
"default": "./dist/api/twoStepVerification/index.js"
|
|
75
75
|
},
|
|
76
76
|
"./encryption": {
|
|
77
|
-
"types": "./dist/
|
|
78
|
-
"import": "./dist/
|
|
79
|
-
"default": "./dist/
|
|
77
|
+
"types": "./dist/api/encryption/index.d.ts",
|
|
78
|
+
"import": "./dist/api/encryption/index.js",
|
|
79
|
+
"default": "./dist/api/encryption/index.js"
|
|
80
80
|
},
|
|
81
81
|
"./registration": {
|
|
82
|
-
"types": "./dist/
|
|
83
|
-
"import": "./dist/
|
|
84
|
-
"default": "./dist/
|
|
82
|
+
"types": "./dist/api/registration/index.d.ts",
|
|
83
|
+
"import": "./dist/api/registration/index.js",
|
|
84
|
+
"default": "./dist/api/registration/index.js"
|
|
85
85
|
},
|
|
86
86
|
"./shared/types": {
|
|
87
87
|
"types": "./dist/shared/types/index.d.ts",
|
|
@@ -93,6 +93,61 @@
|
|
|
93
93
|
"import": "./dist/shared/utils/index.js",
|
|
94
94
|
"default": "./dist/shared/utils/index.js"
|
|
95
95
|
},
|
|
96
|
+
"./api": {
|
|
97
|
+
"types": "./dist/api/index.d.ts",
|
|
98
|
+
"import": "./dist/api/index.js",
|
|
99
|
+
"default": "./dist/api/index.js"
|
|
100
|
+
},
|
|
101
|
+
"./api/messages": {
|
|
102
|
+
"types": "./dist/api/messages.d.ts",
|
|
103
|
+
"import": "./dist/api/messages.js",
|
|
104
|
+
"default": "./dist/api/messages.js"
|
|
105
|
+
},
|
|
106
|
+
"./api/media": {
|
|
107
|
+
"types": "./dist/api/media.d.ts",
|
|
108
|
+
"import": "./dist/api/media.js",
|
|
109
|
+
"default": "./dist/api/media.js"
|
|
110
|
+
},
|
|
111
|
+
"./api/flows": {
|
|
112
|
+
"types": "./dist/api/flows.d.ts",
|
|
113
|
+
"import": "./dist/api/flows.js",
|
|
114
|
+
"default": "./dist/api/flows.js"
|
|
115
|
+
},
|
|
116
|
+
"./utils": {
|
|
117
|
+
"types": "./dist/utils/index.d.ts",
|
|
118
|
+
"import": "./dist/utils/index.js",
|
|
119
|
+
"default": "./dist/utils/index.js"
|
|
120
|
+
},
|
|
121
|
+
"./webhook": {
|
|
122
|
+
"types": "./dist/core/webhook/index.d.ts",
|
|
123
|
+
"import": "./dist/core/webhook/index.js",
|
|
124
|
+
"default": "./dist/core/webhook/index.js"
|
|
125
|
+
},
|
|
126
|
+
"./webhook/express": {
|
|
127
|
+
"types": "./dist/core/webhook/frameworks/express.d.ts",
|
|
128
|
+
"import": "./dist/core/webhook/frameworks/express.js",
|
|
129
|
+
"default": "./dist/core/webhook/frameworks/express.js"
|
|
130
|
+
},
|
|
131
|
+
"./webhook/nextjs": {
|
|
132
|
+
"types": "./dist/core/webhook/frameworks/nextjs.d.ts",
|
|
133
|
+
"import": "./dist/core/webhook/frameworks/nextjs.js",
|
|
134
|
+
"default": "./dist/core/webhook/frameworks/nextjs.js"
|
|
135
|
+
},
|
|
136
|
+
"./types": {
|
|
137
|
+
"types": "./dist/types/index.d.ts",
|
|
138
|
+
"import": "./dist/types/index.js",
|
|
139
|
+
"default": "./dist/types/index.js"
|
|
140
|
+
},
|
|
141
|
+
"./types/enums": {
|
|
142
|
+
"types": "./dist/types/enums.d.ts",
|
|
143
|
+
"import": "./dist/types/enums.js",
|
|
144
|
+
"default": "./dist/types/enums.js"
|
|
145
|
+
},
|
|
146
|
+
"./types/config": {
|
|
147
|
+
"types": "./dist/types/config.d.ts",
|
|
148
|
+
"import": "./dist/types/config.js",
|
|
149
|
+
"default": "./dist/types/config.js"
|
|
150
|
+
},
|
|
96
151
|
"./core/webhook": {
|
|
97
152
|
"types": "./dist/core/webhook/index.d.ts",
|
|
98
153
|
"import": "./dist/core/webhook/index.js",
|
|
@@ -155,6 +210,7 @@
|
|
|
155
210
|
"@eslint/js": "^9.17.0",
|
|
156
211
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
157
212
|
"@types/eslint__eslintrc": "^2.1.2",
|
|
213
|
+
"@types/express": "^5.0.3",
|
|
158
214
|
"@types/node": "^22.15.29",
|
|
159
215
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
160
216
|
"@typescript-eslint/parser": "^8.15.0",
|
|
@@ -166,6 +222,7 @@
|
|
|
166
222
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
167
223
|
"husky": "^9.1.7",
|
|
168
224
|
"lint-staged": "^15.3.0",
|
|
225
|
+
"next": "^15.3.5",
|
|
169
226
|
"prettier": "^3.5.0",
|
|
170
227
|
"tsup": "^8.3.6",
|
|
171
228
|
"typescript": "^5.7.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/features/messages/MessageApi.ts","../src/features/messages/index.ts"],"names":["MessagesApi","BaseAPI","config","client","type","payload","to","replyMessageId","body","params","previewUrl","textPayload","reactionPayload","messages_default"],"mappings":"oCAwCA,IAAqBA,CAArB,CAAA,cAAyCC,CAAmC,CACvD,YACA,CAAA,MAAA,CAAA,cAAA,CAAiB,UAElC,CAAA,WAAA,CAAYC,CAAwBC,CAAAA,CAAAA,CAAwB,CACxD,KAAA,CAAMD,CAAQC,CAAAA,CAAM,EACxB,CAUA,WACIC,CAAAA,CAAAA,CACAC,CACAC,CAAAA,CAAAA,CACAC,CACF,CAAA,CACE,IAAMC,CAAAA,CAAgC,CAClC,iBAAA,CAAmB,UACnB,CA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AAA,CAAkB,CACpB,UAAA,CAAYH,CAAO,CAAA,SAAA,CACnB,KAAOA,CAAAA,CAAAA,CAAO,KAClB,CAEA,CAAA,OAAO,IAAK,CAAA,IAAA,CAAK,IAAK,CAAA,SAAA,CAAU,IAAK,CAAA,WAAA,CAAA,UAAA,CAAuCG,CAAiBH,CAAAA,CAAAA,CAAO,EAAE,CAAC,CAAC,CAC5G,CACJ,MC3TOI,CAAQb,CAAAA","file":"chunk-2NJVBJUN.js","sourcesContent":["import { BaseAPI } from '@shared/types/base';\nimport type { WabaConfigType } from '@shared/types/config';\nimport {\n type ComponentTypesEnum,\n HttpMethodsEnum,\n type InteractiveTypesEnum,\n MessageTypesEnum,\n WabaConfigEnum,\n} from '@shared/types/enums';\nimport type { RequesterClass } from '@shared/types/request';\n\nimport type * as m from './types';\n\n/**\n * Maps each message type to its appropriate payload type\n */\nexport type MessagePayloadType<T extends MessageTypesEnum> = T extends MessageTypesEnum.Audio\n ? m.AudioMediaObject\n : T extends MessageTypesEnum.Contacts\n ? [m.ContactObject]\n : T extends MessageTypesEnum.Document\n ? m.DocumentMediaObject\n : T extends MessageTypesEnum.Image\n ? m.ImageMediaObject\n : T extends MessageTypesEnum.Interactive\n ? m.InteractiveObject\n : T extends MessageTypesEnum.Location\n ? m.LocationObject\n : T extends MessageTypesEnum.Template\n ? m.MessageTemplateObject<ComponentTypesEnum>\n : T extends MessageTypesEnum.Sticker\n ? m.StickerMediaObject\n : T extends MessageTypesEnum.Text\n ? m.TextObject\n : T extends MessageTypesEnum.Video\n ? m.VideoMediaObject\n : T extends MessageTypesEnum.Reaction\n ? { message_id: string; emoji: string }\n : never;\n\nexport default class MessagesApi extends BaseAPI implements m.MessagesClass {\n private readonly commonMethod = HttpMethodsEnum.Post;\n private readonly commonEndpoint = 'messages';\n\n constructor(config: WabaConfigType, client: RequesterClass) {\n super(config, client);\n }\n\n /**\n * Builds the request body for WhatsApp API messages\n * @param type The type of message to send\n * @param payload The message payload object\n * @param to The recipient's phone number\n * @param replyMessageId Optional message ID to reply to\n * @returns The formatted request body\n */\n bodyBuilder<T extends MessageTypesEnum>(\n type: T,\n payload: MessagePayloadType<T>,\n to: string,\n replyMessageId?: string,\n ) {\n const body: m.MessageRequestBody<T> = {\n messaging_product: 'whatsapp',\n recipient_type: 'individual',\n to,\n type,\n [type]: payload,\n };\n\n if (replyMessageId) body['context'] = { message_id: replyMessageId };\n\n return body;\n }\n\n /**\n * Sends a request to the WhatsApp API\n * @param body The request body to send\n * @returns Promise with the API response\n */\n private send(body: BodyInit | null): Promise<m.MessagesResponse> {\n return this.sendJson(\n this.commonMethod,\n `${this.config[WabaConfigEnum.PhoneNumberId]}/${this.commonEndpoint}`,\n this.config[WabaConfigEnum.RequestTimeout],\n body,\n );\n }\n\n /**\n * Sends an audio message via WhatsApp\n * @param params The audio message parameter object\n * @returns Promise with the message response\n */\n async audio(params: m.MessageRequestParams<m.AudioMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Audio, body, to, replyMessageId)));\n }\n\n /**\n * Sends a contact card via WhatsApp\n * @param params The contact message parameter object\n * @returns Promise with the message response\n */\n async contacts(params: m.MessageRequestParams<[m.ContactObject]>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Contacts, body, to, replyMessageId)));\n }\n\n /**\n * Sends a document via WhatsApp\n * @param params The document message parameter object\n * @returns Promise with the message response\n */\n async document(params: m.MessageRequestParams<m.DocumentMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Document, body, to, replyMessageId)));\n }\n\n /**\n * Sends an image via WhatsApp\n * @param params The image message parameter object\n * @returns Promise with the message response\n */\n async image(params: m.MessageRequestParams<m.ImageMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Image, body, to, replyMessageId)));\n }\n\n /**\n * Sends an interactive message via WhatsApp\n * @param params The interactive message parameter object\n * @returns Promise with the message response\n */\n async interactive(params: m.MessageRequestParams<m.InteractiveObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Interactive, body, to, replyMessageId)));\n }\n\n /**\n * Sends a location via WhatsApp\n * @param params The location message parameter object\n * @returns Promise with the message response\n */\n async location(params: m.MessageRequestParams<m.LocationObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Location, body, to, replyMessageId)));\n }\n\n /**\n * Sends a sticker via WhatsApp\n * @param params The sticker message parameter object\n * @returns Promise with the message response\n */\n async sticker(params: m.MessageRequestParams<m.StickerMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Sticker, body, to, replyMessageId)));\n }\n\n /**\n * Sends a template message via WhatsApp\n * @param params The template message parameter object\n * @returns Promise with the message response\n */\n async template(\n params: m.MessageRequestParams<m.MessageTemplateObject<ComponentTypesEnum>>,\n ): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Template, body, to, replyMessageId)));\n }\n\n /**\n * Sends a text message via WhatsApp\n * @param params The text message parameter object\n * @returns Promise with the message response\n */\n async text(params: m.TextMessageParams): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId, previewUrl } = params;\n\n // Handle both string and TextObject types\n const textPayload: m.TextObject =\n typeof body === 'string'\n ? { body, preview_url: previewUrl }\n : { ...body, preview_url: previewUrl ?? body.preview_url };\n\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Text, textPayload, to, replyMessageId)));\n }\n\n /**\n * Sends a video message via WhatsApp\n * @param params The video message parameter object\n * @returns Promise with the message response\n */\n async video(params: m.MessageRequestParams<m.VideoMediaObject>): Promise<m.MessagesResponse> {\n const { body, to, replyMessageId } = params;\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Video, body, to, replyMessageId)));\n }\n\n /**\n * Updates message status (mark as read, etc.)\n * @param params The status update parameters\n * @returns Promise with the API response\n */\n async status(params: m.StatusParams): Promise<m.MessagesResponse> {\n const body = {\n messaging_product: 'whatsapp',\n status: params.status,\n message_id: params.messageId,\n ...(params.typingIndicator && { typing_indicator: params.typingIndicator }),\n };\n\n return this.send(JSON.stringify(body));\n }\n\n /**\n * Marks a message as read\n * @param params Object containing messageId\n * @returns Promise with the API response\n */\n async markAsRead(params: { messageId: string }): Promise<m.MessagesResponse> {\n return this.status({\n status: 'read',\n messageId: params.messageId,\n });\n }\n\n /**\n * Shows typing indicator\n * @param params Object containing messageId\n * @returns Promise with the API response\n */\n async showTypingIndicator(params: { messageId: string }): Promise<m.MessagesResponse> {\n return this.status({\n status: 'read',\n messageId: params.messageId,\n typingIndicator: { type: 'text' },\n });\n }\n\n /**\n * Sends a list interactive message\n * @param params The list interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveList(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.List }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a CTA URL interactive message\n * @param params The CTA URL interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveCtaUrl(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.CtaUrl }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a location request interactive message\n * @param params The location request interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveLocationRequest(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.LocationRequest }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends an address message interactive message\n * @param params The address message interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveAddressMessage(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.AddressMessage }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a reply buttons interactive message\n * @param params The reply buttons interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveReplyButtons(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.Button }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a flow interactive message\n * @param params The flow interactive message parameters\n * @returns Promise with the message response\n */\n async interactiveFlow(\n params: m.MessageRequestParams<m.InteractiveObject & { type: InteractiveTypesEnum.Flow }>,\n ): Promise<m.MessagesResponse> {\n return this.interactive(params);\n }\n\n /**\n * Sends a reaction to a message\n * @param params The reaction parameters\n * @returns Promise with the message response\n */\n async reaction(params: m.ReactionParams): Promise<m.MessagesResponse> {\n const reactionPayload = {\n message_id: params.messageId,\n emoji: params.emoji,\n };\n\n return this.send(JSON.stringify(this.bodyBuilder(MessageTypesEnum.Reaction, reactionPayload, params.to)));\n }\n}\n","import MessageApi from './MessageApi';\n\n// 기본 export 유지\nexport default MessageApi;\n\n// 명시적 named export\nexport { MessageApi };\n\n// 필요한 타입만 명시적으로 export\nexport type {\n AudioMediaObject,\n ContactObject,\n DocumentMediaObject,\n ImageMediaObject,\n InteractiveObject,\n LocationObject,\n MessageRequestParams,\n MessagesResponse,\n MessageTemplateObject,\n ReactionParams,\n StatusParams,\n StickerMediaObject,\n TextMessageParams,\n TextObject,\n VideoMediaObject,\n} from './types';\n"]}
|
package/dist/chunk-3MO3BTBC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function e(r){return r!=null&&typeof r=="object"&&"error"in r&&typeof r.error=="object"&&r.error!=null&&"message"in r.error&&typeof r.error.message=="string"&&"type"in r.error&&typeof r.error.type=="string"&&"code"in r.error&&typeof r.error.code=="number"&&"fbtrace_id"in r.error&&typeof r.error.fbtrace_id=="string"&&(!("error_data"in r.error)||typeof r.error.error_data=="object"&&r.error.error_data!=null&&"messaging_product"in r.error.error_data&&r.error.error_data.messaging_product==="whatsapp"&&"details"in r.error.error_data&&typeof r.error.error_data.details=="string")&&(!("error_subcode"in r.error)||typeof r.error.error_subcode=="number")}export{e as a};//# sourceMappingURL=chunk-3MO3BTBC.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-3MO3BTBC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/utils/isMetaError.ts"],"names":["isMetaError","error"],"mappings":"AAmBO,SAASA,EAAYC,CAAgC,CAAA,CACxD,OACIA,CAAS,EAAA,IAAA,EACT,OAAOA,CAAU,EAAA,QAAA,EACjB,UAAWA,CACX,EAAA,OAAOA,EAAM,KAAU,EAAA,QAAA,EACvBA,EAAM,KAAS,EAAA,IAAA,EACf,YAAaA,CAAM,CAAA,KAAA,EACnB,OAAOA,CAAM,CAAA,KAAA,CAAM,SAAY,QAC/B,EAAA,MAAA,GAAUA,EAAM,KAChB,EAAA,OAAOA,EAAM,KAAM,CAAA,IAAA,EAAS,UAC5B,MAAUA,GAAAA,CAAAA,CAAM,OAChB,OAAOA,CAAAA,CAAM,MAAM,IAAS,EAAA,QAAA,EAC5B,eAAgBA,CAAM,CAAA,KAAA,EACtB,OAAOA,CAAAA,CAAM,MAAM,UAAe,EAAA,QAAA,GACjC,EAAE,YAAgBA,GAAAA,CAAAA,CAAM,QACpB,OAAOA,CAAAA,CAAM,MAAM,UAAe,EAAA,QAAA,EAC/BA,EAAM,KAAM,CAAA,UAAA,EAAc,MAC1B,mBAAuBA,GAAAA,CAAAA,CAAM,MAAM,UACnCA,EAAAA,CAAAA,CAAM,MAAM,UAAW,CAAA,iBAAA,GAAsB,YAC7C,SAAaA,GAAAA,CAAAA,CAAM,MAAM,UACzB,EAAA,OAAOA,EAAM,KAAM,CAAA,UAAA,CAAW,SAAY,QACjD,CAAA,GAAA,EAAE,kBAAmBA,CAAM,CAAA,KAAA,CAAA,EAAU,OAAOA,CAAM,CAAA,KAAA,CAAM,eAAkB,QAEnF,CAAA","file":"chunk-3MO3BTBC.js","sourcesContent":["export interface MetaError extends Error {\n error: {\n message: string;\n type: string;\n code: number;\n error_data?: {\n messaging_product: 'whatsapp';\n details: string;\n };\n error_subcode?: number;\n fbtrace_id: string;\n };\n}\n\n/**\n * Determines if the error is a Meta API error response\n * @param error Any error object to check\n * @returns Type guard indicating if error is a Meta API error\n */\nexport function isMetaError(error: any): error is MetaError {\n return (\n error != null &&\n typeof error === 'object' &&\n 'error' in error &&\n typeof error.error === 'object' &&\n error.error != null &&\n 'message' in error.error &&\n typeof error.error.message === 'string' &&\n 'type' in error.error &&\n typeof error.error.type === 'string' &&\n 'code' in error.error &&\n typeof error.error.code === 'number' &&\n 'fbtrace_id' in error.error &&\n typeof error.error.fbtrace_id === 'string' &&\n (!('error_data' in error.error) ||\n (typeof error.error.error_data === 'object' &&\n error.error.error_data != null &&\n 'messaging_product' in error.error.error_data &&\n error.error.error_data.messaging_product === 'whatsapp' &&\n 'details' in error.error.error_data &&\n typeof error.error.error_data.details === 'string')) &&\n (!('error_subcode' in error.error) || typeof error.error.error_subcode === 'number')\n );\n}\n"]}
|
package/dist/chunk-4C666HHU.js
DELETED
package/dist/chunk-4O3T25CT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-4C666HHU.js';var a={};a$1(a,{AudioMediaTypesEnum:()=>k,BusinessVerticalEnum:()=>p,ButtonPositionEnum:()=>Z,CategoryEnum:()=>T,ComponentTypesEnum:()=>x,ConversationTypesEnum:()=>V,CurrencyCodesEnum:()=>$,DataLocalizationRegionEnum:()=>z,DocumentMediaTypesEnum:()=>w,HttpMethodsEnum:()=>H,ImageMediaTypesEnum:()=>J,InteractiveTypesEnum:()=>X,LanguagesEnum:()=>q,MessageTypesEnum:()=>Y,ParametersTypesEnum:()=>L,ReferralSourceTypesEnum:()=>f,RequestCodeMethodsEnum:()=>j,StatusEnum:()=>h,StickerMediaTypesEnum:()=>i,SubTypeEnum:()=>t,SystemChangeTypesEnum:()=>Q,TemplateStatusEnum:()=>F,VideoMediaTypesEnum:()=>l,WabaConfigEnum:()=>W,WebhookTypesEnum:()=>v});var T=(U=>(U.Authentication="AUTHENTICATION",U.Marketing="MARKETING",U.Utility="UTILITY",U))(T||{}),F=(U=>(U.Approved="APPROVED",U.Pending="PENDING",U.Rejected="REJECTED",U))(F||{}),H=(_=>(_.Get="GET",_.Post="POST",_.Put="PUT",_.Delete="DELETE",_))(H||{}),Y=(N=>(N.Audio="audio",N.Contacts="contacts",N.Document="document",N.Image="image",N.Interactive="interactive",N.Location="location",N.Reaction="reaction",N.Sticker="sticker",N.Template="template",N.Text="text",N.Video="video",N.Button="button",N.Order="order",N.System="system",N.Unknown="unknown",N.Statuses="statuses",N["*"]="*",N))(Y||{}),L=(P=>(P.Action="ACTION",P.CouponCode="COUPON_CODE",P.Currency="CURRENCY",P.DateTime="DATE_TIME",P.Document="DOCUMENT",P.ExpirationTimeMs="EXPIRATION_TIME_MS",P.Image="IMAGE",P.LimitedTimeOffer="LIMITED_TIME_OFFER",P.Location="LOCATION",P.OrderStatus="ORDER_STATUS",P.Payload="PAYLOAD",P.Product="PRODUCT",P.Text="TEXT",P.TtlMinutes="TTL_MINUTES",P.Video="VIDEO",P.WebviewInteraction="WEBVIEW_INTERACTION",P.WebviewPresentation="WEBVIEW_PRESENTATION",P))(L||{}),X=(S=>(S.Button="button",S.List="list",S.Product="product",S.ProductList="product_list",S.CtaUrl="cta_url",S.LocationRequest="location_request_message",S.AddressMessage="address_message",S.Flow="flow",S))(X||{}),Z=(O=>(O[O.First=1]="First",O[O.Second=2]="Second",O[O.Third=3]="Third",O[O.Fourth=4]="Fourth",O[O.Fifth=5]="Fifth",O))(Z||{}),t=(M=>(M.Catalog="CATALOG",M.CopyCode="COPY_CODE",M.Flow="FLOW",M.Mpm="MPM",M.OrderDetails="ORDER_DETAILS",M.QuickReply="QUICK_REPLY",M.Reminder="REMINDER",M.Url="URL",M.VoiceCall="VOICE_CALL",M))(t||{}),x=(_=>(_.Header="HEADER",_.Body="BODY",_.Button="BUTTON",_.Footer="FOOTER",_))(x||{}),W=(I=>(I.AppId="M4D_APP_ID",I.Port="WA_PORT",I.AppSecret="M4D_APP_SECRET",I.PhoneNumberId="WA_PHONE_NUMBER_ID",I.BusinessAcctId="WA_BUSINESS_ACCOUNT_ID",I.APIVersion="CLOUD_API_VERSION",I.AccessToken="CLOUD_API_ACCESS_TOKEN",I.WebhookEndpoint="WEBHOOK_ENDPOINT",I.WebhookVerificationToken="WEBHOOK_VERIFICATION_TOKEN",I.ListenerPort="LISTENER_PORT",I.MaxRetriesAfterWait="MAX_RETRIES_AFTER_WAIT",I.RequestTimeout="REQUEST_TIMEOUT",I.Debug="DEBUG",I.PrivatePem="FLOW_API_PRIVATE_PEM",I.Passphrase="FLOW_API_PASSPHRASE",I))(W||{}),V=(U=>(U.BusinessInitiated="business_initiated",U.CustomerInitiated="customer_initiated",U.ReferralConversion="referral_conversion",U))(V||{}),h=(U=>(U.Delivered="delivered",U.Read="read",U.Sent="sent",U))(h||{}),l=(G=>(G.Mp4="video/mp4",G.Threegp="video/3gp",G))(l||{}),i=(b=>(b.Webp="image/webp",b))(i||{}),J=(G=>(G.Jpeg="image/jpeg",G.Png="image/png",G))(J||{}),w=(S=>(S.Text="text/plain",S.Pdf="application/pdf",S.Ppt="application/vnd.ms-powerpoint",S.Word="application/msword",S.Excel="application/vnd.ms-excel",S.OpenDoc="application/vnd.openxmlformats-officedocument.wordprocessingml.document",S.OpenPres="application/vnd.openxmlformats-officedocument.presentationml.presentation",S.OpenSheet="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",S))(w||{}),k=(O=>(O.Aac="audio/aac",O.Mp4="audio/mp4",O.Mpeg="audio/mpeg",O.Amr="audio/amr",O.Ogg="audio/ogg",O))(k||{}),v=(K=>(K.Audio="audio",K.Button="button",K.Document="document",K.Text="text",K.Image="image",K.Interactive="interactive",K.Order="order",K.Sticker="sticker",K.System="system",K.Unknown="unknown",K.Video="video",K))(v||{}),Q=(G=>(G.CustomerChangedNumber="customer_changed_number",G.CustomerIdentityChanged="customer_identity_changed",G))(Q||{}),f=(G=>(G.Ad="ad",G.Post="post",G))(f||{}),j=(G=>(G.Sms="SMS",G.Voice="VOICE",G))(j||{}),q=(A=>(A.Afrikaans="af",A.Albanian="sq",A.Arabic="ar",A.Azerbaijani="az",A.Bengali="bn",A.Bulgarian="bg",A.Catalan="ca",A.Chinese_CHN="zh_CN",A.Chinese_HKG="zh_HK",A.Chinese_TAI="zh_TW",A.Croatian="hr",A.Czech="cs",A.Danish="da",A.Dutch="nl",A.English="en",A.English_UK="en_GB",A.English_US="en_US",A.Estonian="et",A.Filipino="fil",A.Finnish="fi",A.French="fr",A.Georgian="ka",A.German="de",A.Greek="el",A.Gujarati="gu",A.Hausa="ha",A.Hebrew="he",A.Hindi="hi",A.Hungarian="hu",A.Indonesian="id",A.Irish="ga",A.Italian="it",A.Japanese="ja",A.Kannada="kn",A.Kazakh="kk",A.Kinyarwanda="rw_RW",A.Korean="ko",A.Kyrgyz_Kyrgyzstan="ky_KG",A.Lao="lo",A.Latvian="lv",A.Lithuanian="lt",A.Macedonian="mk",A.Malay="ms",A.Malayalam="ml",A.Marathi="mr",A.Norwegian="nb",A.Persian="fa",A.Polish="pl",A.Portuguese_BR="pt_BR",A.Portuguese_POR="pt_PT",A.Punjabi="pa",A.Romanian="ro",A.Russian="ru",A.Serbian="sr",A.Slovak="sk",A.Slovenian="sl",A.Spanish="es",A.Spanish_ARG="es_AR",A.Spanish_SPA="es_ES",A.Spanish_MEX="es_MX",A.Swahili="sw",A.Swedish="sv",A.Tamil="ta",A.Telugu="te",A.Thai="th",A.Turkish="tr",A.Ukrainian="uk",A.Urdu="ur",A.Uzbek="uz",A.Vietnamese="vi",A.Zulu="zu",A))(q||{}),$=(R=>(R.AFN="AFN",R.EUR="EUR",R.ALL="ALL",R.DZD="DZD",R.USD="USD",R.AOA="AOA",R.XCD="XCD",R.ARS="ARS",R.AMD="AMD",R.AWG="AWG",R.AUD="AUD",R.AZN="AZN",R.BSD="BSD",R.BHD="BHD",R.BDT="BDT",R.BBD="BBD",R.BYN="BYN",R.BZD="BZD",R.XOF="XOF",R.BMD="BMD",R.INR="INR",R.BTN="BTN",R.BOB="BOB",R.BOV="BOV",R.BAM="BAM",R.BWP="BWP",R.NOK="NOK",R.BRL="BRL",R.BND="BND",R.BGN="BGN",R.BIF="BIF",R.CVE="CVE",R.KHR="KHR",R.XAF="XAF",R.CAD="CAD",R.KYD="KYD",R.CLP="CLP",R.CLF="CLF",R.CNY="CNY",R.COP="COP",R.COU="COU",R.KMF="KMF",R.CDF="CDF",R.NZD="NZD",R.CRC="CRC",R.HRK="HRK",R.CUP="CUP",R.CUC="CUC",R.ANG="ANG",R.CZK="CZK",R.DKK="DKK",R.DJF="DJF",R.DOP="DOP",R.EGP="EGP",R.SVC="SVC",R.ERN="ERN",R.SZL="SZL",R.ETB="ETB",R.FKP="FKP",R.FJD="FJD",R.XPF="XPF",R.GMD="GMD",R.GEL="GEL",R.GHS="GHS",R.GIP="GIP",R.GTQ="GTQ",R.GBP="GBP",R.GNF="GNF",R.GYD="GYD",R.HTG="HTG",R.HNL="HNL",R.HKD="HKD",R.HUF="HUF",R.ISK="ISK",R.IDR="IDR",R.XDR="XDR",R.IRR="IRR",R.IQD="IQD",R.ILS="ILS",R.JMD="JMD",R.JPY="JPY",R.JOD="JOD",R.KZT="KZT",R.KES="KES",R.KPW="KPW",R.KRW="KRW",R.KWD="KWD",R.KGS="KGS",R.LAK="LAK",R.LBP="LBP",R.LSL="LSL",R.ZAR="ZAR",R.LRD="LRD",R.LYD="LYD",R.CHF="CHF",R.MOP="MOP",R.MKD="MKD",R.MGA="MGA",R.MWK="MWK",R.MYR="MYR",R.MVR="MVR",R.MRU="MRU",R.MUR="MUR",R.XUA="XUA",R.MXN="MXN",R.MXV="MXV",R.MDL="MDL",R.MNT="MNT",R.MAD="MAD",R.MZN="MZN",R.MMK="MMK",R.NAD="NAD",R.NPR="NPR",R.NIO="NIO",R.NGN="NGN",R.OMR="OMR",R.PKR="PKR",R.PAB="PAB",R.PGK="PGK",R.PYG="PYG",R.PEN="PEN",R.PHP="PHP",R.PLN="PLN",R.QAR="QAR",R.RON="RON",R.RUB="RUB",R.RWF="RWF",R.SHP="SHP",R.WST="WST",R.STN="STN",R.SAR="SAR",R.RSD="RSD",R.SCR="SCR",R.SLL="SLL",R.SGD="SGD",R.XSU="XSU",R.SBD="SBD",R.SOS="SOS",R.SSP="SSP",R.LKR="LKR",R.SDG="SDG",R.SRD="SRD",R.SEK="SEK",R.CHE="CHE",R.CHW="CHW",R.SYP="SYP",R.TWD="TWD",R.TJS="TJS",R.TZS="TZS",R.THB="THB",R.TOP="TOP",R.TTD="TTD",R.TND="TND",R.TRY="TRY",R.TMT="TMT",R.UGX="UGX",R.UAH="UAH",R.AED="AED",R.USN="USN",R.UYU="UYU",R.UYI="UYI",R.UYW="UYW",R.UZS="UZS",R.VUV="VUV",R.VES="VES",R.VND="VND",R.YER="YER",R.ZMW="ZMW",R.ZWL="ZWL",R.XBA="XBA",R.XBB="XBB",R.XBC="XBC",R.XBD="XBD",R.XTS="XTS",R.XXX="XXX",R.XAU="XAU",R.XPD="XPD",R.XPT="XPT",R.XAG="XAG",R.AFA="AFA",R.FIM="FIM",R.ALK="ALK",R.ADP="ADP",R.ESP="ESP",R.FRF="FRF",R.AOK="AOK",R.AON="AON",R.AOR="AOR",R.ARA="ARA",R.ARP="ARP",R.ARY="ARY",R.RUR="RUR",R.ATS="ATS",R.AYM="AYM",R.AZM="AZM",R.BYB="BYB",R.BYR="BYR",R.BEC="BEC",R.BEF="BEF",R.BEL="BEL",R.BOP="BOP",R.BAD="BAD",R.BRB="BRB",R.BRC="BRC",R.BRE="BRE",R.BRN="BRN",R.BRR="BRR",R.BGJ="BGJ",R.BGK="BGK",R.BGL="BGL",R.BUK="BUK",R.HRD="HRD",R.CYP="CYP",R.CSJ="CSJ",R.CSK="CSK",R.ECS="ECS",R.ECV="ECV",R.GQE="GQE",R.EEK="EEK",R.XEU="XEU",R.GEK="GEK",R.DDM="DDM",R.DEM="DEM",R.GHC="GHC",R.GHP="GHP",R.GRD="GRD",R.GNE="GNE",R.GNS="GNS",R.GWE="GWE",R.GWP="GWP",R.ITL="ITL",R.ISJ="ISJ",R.IEP="IEP",R.ILP="ILP",R.ILR="ILR",R.LAJ="LAJ",R.LVL="LVL",R.LVR="LVR",R.LSM="LSM",R.ZAL="ZAL",R.LTL="LTL",R.LTT="LTT",R.LUC="LUC",R.LUF="LUF",R.LUL="LUL",R.MGF="MGF",R.MVQ="MVQ",R.MLF="MLF",R.MTL="MTL",R.MTP="MTP",R.MRO="MRO",R.MXP="MXP",R.MZE="MZE",R.MZM="MZM",R.NLG="NLG",R.NIC="NIC",R.PEH="PEH",R.PEI="PEI",R.PES="PES",R.PLZ="PLZ",R.PTE="PTE",R.ROK="ROK",R.ROL="ROL",R.STD="STD",R.CSD="CSD",R.SKK="SKK",R.SIT="SIT",R.RHD="RHD",R.ESA="ESA",R.ESB="ESB",R.SDD="SDD",R.SDP="SDP",R.SRG="SRG",R.CHC="CHC",R.TJR="TJR",R.TPE="TPE",R.TRL="TRL",R.TMM="TMM",R.UGS="UGS",R.UGW="UGW",R.UAK="UAK",R.SUR="SUR",R.USS="USS",R.UYN="UYN",R.UYP="UYP",R.VEB="VEB",R.VEF="VEF",R.VNC="VNC",R.YDD="YDD",R.YUD="YUD",R.YUM="YUM",R.YUN="YUN",R.ZRN="ZRN",R.ZRZ="ZRZ",R.ZMK="ZMK",R.ZWC="ZWC",R.ZWD="ZWD",R.ZWN="ZWN",R.ZWR="ZWR",R.XFO="XFO",R.XRE="XRE",R.XFU="XFU",R))($||{}),z=(B=>(B.AU="AU",B.ID="ID",B.IN="IN",B.JP="JP",B.SG="SG",B.KR="KR",B.DE="DE",B.CH="CH",B.GB="GB",B.BR="BR",B.BH="BH",B.ZA="ZA",B.AE="AE",B.CA="CA",B))(z||{}),p=(D=>(D.ALCOHOL="ALCOHOL",D.APPAREL="APPAREL",D.AUTO="AUTO",D.BEAUTY="BEAUTY",D.EDU="EDU",D.ENTERTAIN="ENTERTAIN",D.EVENT_PLAN="EVENT_PLAN",D.FINANCE="FINANCE",D.GOVT="GOVT",D.GROCERY="GROCERY",D.HEALTH="HEALTH",D.HOTEL="HOTEL",D.NONPROFIT="NONPROFIT",D.ONLINE_GAMBLING="ONLINE_GAMBLING",D.OTC_DRUGS="OTC_DRUGS",D.OTHER="OTHER",D.PHYSICAL_GAMBLING="PHYSICAL_GAMBLING",D.PROF_SERVICES="PROF_SERVICES",D.RESTAURANT="RESTAURANT",D.RETAIL="RETAIL",D.TRAVEL="TRAVEL",D))(p||{});export{T as a,F as b,H as c,Y as d,L as e,X as f,Z as g,t as h,x as i,W as j,V as k,h as l,l as m,i as n,J as o,w as p,k as q,v as r,Q as s,f as t,j as u,q as v,$ as w,z as x,p as y,a as z};//# sourceMappingURL=chunk-4O3T25CT.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-4O3T25CT.js.map
|