meta-cloud-api 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.d.ts +19 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/chunk-PECeCxCb.js +15 -0
- package/dist/config.d.ts +80 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/enums.d.ts +668 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +681 -0
- package/dist/enums.js.map +1 -0
- package/dist/httpsClient.d.ts +21 -0
- package/dist/httpsClient.d.ts.map +1 -0
- package/dist/index.d.ts +4386 -27
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3436 -1
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +11 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/request.d.ts +52 -0
- package/dist/request.d.ts.map +1 -0
- package/package.json +11 -118
- package/dist/BusinessProfileApi-C_sEOrWM.d.ts +0 -353
- package/dist/EncryptionApi-CcCfeK2b.d.ts +0 -22
- package/dist/FlowApi-DDHrFT_Q.d.ts +0 -136
- package/dist/MediaApi-CY9RVo7u.d.ts +0 -90
- package/dist/MessageApi-CX_jN8da.d.ts +0 -171
- package/dist/PhoneNumberApi-B-hY7g1M.d.ts +0 -142
- package/dist/QrCodeApi-DRICKN04.d.ts +0 -98
- package/dist/RegistrationApi-CFPzU1Vw.d.ts +0 -47
- package/dist/TemplateApi-fCIlzBtK.d.ts +0 -161
- package/dist/TwoStepVerificationApi-C0jpAKfu.d.ts +0 -33
- package/dist/WabaApi-x5PhsLT3.d.ts +0 -175
- package/dist/WebhookProcessor-DEIZ2PRU.d.ts +0 -707
- package/dist/WhatsApp-BFsBgjJO.d.ts +0 -82
- package/dist/api/encryption/index.d.ts +0 -10
- package/dist/api/encryption/index.js +0 -2
- package/dist/api/encryption/index.js.map +0 -1
- package/dist/api/flow/index.d.ts +0 -11
- package/dist/api/flow/index.js +0 -2
- package/dist/api/flow/index.js.map +0 -1
- package/dist/api/index.d.ts +0 -18
- package/dist/api/index.js +0 -2
- package/dist/api/index.js.map +0 -1
- package/dist/api/media/index.d.ts +0 -10
- package/dist/api/media/index.js +0 -2
- package/dist/api/media/index.js.map +0 -1
- package/dist/api/messages/builders/index.d.ts +0 -536
- package/dist/api/messages/builders/index.js +0 -4
- package/dist/api/messages/builders/index.js.map +0 -1
- package/dist/api/messages/index.d.ts +0 -10
- package/dist/api/messages/index.js +0 -2
- package/dist/api/messages/index.js.map +0 -1
- package/dist/api/phone/index.d.ts +0 -10
- package/dist/api/phone/index.js +0 -2
- package/dist/api/phone/index.js.map +0 -1
- package/dist/api/profile/index.d.ts +0 -10
- package/dist/api/profile/index.js +0 -2
- package/dist/api/profile/index.js.map +0 -1
- package/dist/api/qrCode/index.d.ts +0 -10
- package/dist/api/qrCode/index.js +0 -2
- package/dist/api/qrCode/index.js.map +0 -1
- package/dist/api/registration/index.d.ts +0 -10
- package/dist/api/registration/index.js +0 -2
- package/dist/api/registration/index.js.map +0 -1
- package/dist/api/template/index.d.ts +0 -21
- package/dist/api/template/index.js +0 -2
- package/dist/api/template/index.js.map +0 -1
- package/dist/api/twoStepVerification/index.d.ts +0 -10
- package/dist/api/twoStepVerification/index.js +0 -2
- package/dist/api/twoStepVerification/index.js.map +0 -1
- package/dist/api/waba/index.d.ts +0 -10
- package/dist/api/waba/index.js +0 -2
- package/dist/api/waba/index.js.map +0 -1
- package/dist/base-BV6DyzGS.d.ts +0 -18
- package/dist/chunk-5577QQ7V.js +0 -2
- package/dist/chunk-5577QQ7V.js.map +0 -1
- package/dist/chunk-6DFC5L3X.js +0 -2
- package/dist/chunk-6DFC5L3X.js.map +0 -1
- package/dist/chunk-7QBIZCJ4.js +0 -2
- package/dist/chunk-7QBIZCJ4.js.map +0 -1
- package/dist/chunk-AMHQGG6Z.js +0 -2
- package/dist/chunk-AMHQGG6Z.js.map +0 -1
- package/dist/chunk-BAOZ4U74.js +0 -10
- package/dist/chunk-BAOZ4U74.js.map +0 -1
- package/dist/chunk-CRZ7EUYR.js +0 -2
- package/dist/chunk-CRZ7EUYR.js.map +0 -1
- package/dist/chunk-FKXSL2JK.js +0 -3
- package/dist/chunk-FKXSL2JK.js.map +0 -1
- package/dist/chunk-FSKBLPGE.js +0 -2
- package/dist/chunk-FSKBLPGE.js.map +0 -1
- package/dist/chunk-GM63NGNV.js +0 -2
- package/dist/chunk-GM63NGNV.js.map +0 -1
- package/dist/chunk-IYSR44P6.js +0 -2
- package/dist/chunk-IYSR44P6.js.map +0 -1
- package/dist/chunk-J2JPTKU6.js +0 -2
- package/dist/chunk-J2JPTKU6.js.map +0 -1
- package/dist/chunk-JC6YMVID.js +0 -2
- package/dist/chunk-JC6YMVID.js.map +0 -1
- package/dist/chunk-JPAV644F.js +0 -2
- package/dist/chunk-JPAV644F.js.map +0 -1
- package/dist/chunk-JXCLRKQ7.js +0 -2
- package/dist/chunk-JXCLRKQ7.js.map +0 -1
- package/dist/chunk-KMAH6636.js +0 -2
- package/dist/chunk-KMAH6636.js.map +0 -1
- package/dist/chunk-L4ESAO2S.js +0 -2
- package/dist/chunk-L4ESAO2S.js.map +0 -1
- package/dist/chunk-LV3TULSI.js +0 -2
- package/dist/chunk-LV3TULSI.js.map +0 -1
- package/dist/chunk-MJEG3K4V.js +0 -2
- package/dist/chunk-MJEG3K4V.js.map +0 -1
- package/dist/chunk-PHPQ5HP3.js +0 -2
- package/dist/chunk-PHPQ5HP3.js.map +0 -1
- package/dist/chunk-RIL6QABY.js +0 -2
- package/dist/chunk-RIL6QABY.js.map +0 -1
- package/dist/chunk-RWCVPWRC.js +0 -2
- package/dist/chunk-RWCVPWRC.js.map +0 -1
- package/dist/chunk-SNNRWNGZ.js +0 -2
- package/dist/chunk-SNNRWNGZ.js.map +0 -1
- package/dist/chunk-U5FBZ6UB.js +0 -3
- package/dist/chunk-U5FBZ6UB.js.map +0 -1
- package/dist/chunk-VHAODWCN.js +0 -2
- package/dist/chunk-VHAODWCN.js.map +0 -1
- package/dist/chunk-ZMNXRMWK.js +0 -2
- package/dist/chunk-ZMNXRMWK.js.map +0 -1
- package/dist/common-B8kp4RdL.d.ts +0 -403
- package/dist/common-CGbls9Y8.d.ts +0 -425
- package/dist/core/webhook/frameworks/express.d.ts +0 -53
- package/dist/core/webhook/frameworks/express.js +0 -2
- package/dist/core/webhook/frameworks/express.js.map +0 -1
- package/dist/core/webhook/frameworks/nextjs-app.d.ts +0 -48
- package/dist/core/webhook/frameworks/nextjs-app.js +0 -2
- package/dist/core/webhook/frameworks/nextjs-app.js.map +0 -1
- package/dist/core/webhook/frameworks/nextjs.d.ts +0 -49
- package/dist/core/webhook/frameworks/nextjs.js +0 -2
- package/dist/core/webhook/frameworks/nextjs.js.map +0 -1
- package/dist/core/webhook/index.d.ts +0 -29
- package/dist/core/webhook/index.js +0 -2
- package/dist/core/webhook/index.js.map +0 -1
- package/dist/core/whatsapp/index.d.ts +0 -42
- package/dist/core/whatsapp/index.js +0 -2
- package/dist/core/whatsapp/index.js.map +0 -1
- package/dist/enums-DIimUG6s.d.ts +0 -707
- package/dist/factory-kNha6WaY.d.ts +0 -200
- package/dist/handler-DbySwF0E.d.ts +0 -20
- package/dist/httpsClient-Cbd2Y6mg.d.ts +0 -19
- package/dist/isMetaError-CQLXyEL4.d.ts +0 -63
- package/dist/logger-BdE0Vyim.d.ts +0 -9
- package/dist/request-CUjrMn8R.d.ts +0 -50
- package/dist/types/config.d.ts +0 -78
- package/dist/types/config.js +0 -2
- package/dist/types/config.js.map +0 -1
- package/dist/types/enums.d.ts +0 -1
- package/dist/types/enums.js +0 -2
- package/dist/types/enums.js.map +0 -1
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/utils/index.d.ts +0 -40
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +0 -1
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { L as LanguagesEnum, d as CurrencyCodesEnum, C as CategoryEnum } from './enums-DIimUG6s.js';
|
|
2
|
-
import { l as TemplateFormat } from './TemplateApi-fCIlzBtK.js';
|
|
3
|
-
|
|
4
|
-
interface TextParameter {
|
|
5
|
-
type: 'text';
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
8
|
-
interface CurrencyParameter {
|
|
9
|
-
type: 'currency';
|
|
10
|
-
amount_1000: number;
|
|
11
|
-
code: CurrencyCodesEnum;
|
|
12
|
-
fallback_value: string;
|
|
13
|
-
}
|
|
14
|
-
interface DateTimeParameter {
|
|
15
|
-
type: 'date_time';
|
|
16
|
-
fallback_value: string;
|
|
17
|
-
}
|
|
18
|
-
interface MediaParameter {
|
|
19
|
-
type: 'image' | 'video' | 'document';
|
|
20
|
-
handle?: string;
|
|
21
|
-
link?: string;
|
|
22
|
-
}
|
|
23
|
-
interface LocationParameter {
|
|
24
|
-
type: 'location';
|
|
25
|
-
latitude?: number;
|
|
26
|
-
longitude?: number;
|
|
27
|
-
name?: string;
|
|
28
|
-
address?: string;
|
|
29
|
-
}
|
|
30
|
-
interface ProductParameter {
|
|
31
|
-
type: 'product';
|
|
32
|
-
product_retailer_id: string;
|
|
33
|
-
}
|
|
34
|
-
type TemplateParameter = TextParameter | CurrencyParameter | DateTimeParameter | MediaParameter | LocationParameter | ProductParameter;
|
|
35
|
-
interface HeaderOptions {
|
|
36
|
-
format: TemplateFormat;
|
|
37
|
-
text?: string;
|
|
38
|
-
parameters?: TemplateParameter[];
|
|
39
|
-
example?: {
|
|
40
|
-
header_text?: string[];
|
|
41
|
-
header_text_named_params?: Array<{
|
|
42
|
-
param_name: string;
|
|
43
|
-
example: string;
|
|
44
|
-
}>;
|
|
45
|
-
header_handle?: string[];
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
interface BodyOptions {
|
|
49
|
-
text: string;
|
|
50
|
-
parameters?: TemplateParameter[];
|
|
51
|
-
example?: {
|
|
52
|
-
body_text?: string[][];
|
|
53
|
-
body_text_named_params?: Array<{
|
|
54
|
-
param_name: string;
|
|
55
|
-
example: string;
|
|
56
|
-
}>;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
interface FooterOptions {
|
|
60
|
-
text: string;
|
|
61
|
-
}
|
|
62
|
-
interface ButtonOptions {
|
|
63
|
-
phone_number?: {
|
|
64
|
-
text: string;
|
|
65
|
-
phone_number: string;
|
|
66
|
-
};
|
|
67
|
-
url?: {
|
|
68
|
-
text: string;
|
|
69
|
-
url: string;
|
|
70
|
-
example?: string;
|
|
71
|
-
};
|
|
72
|
-
quick_reply?: {
|
|
73
|
-
text: string;
|
|
74
|
-
}[];
|
|
75
|
-
copy_code?: {
|
|
76
|
-
example: string;
|
|
77
|
-
};
|
|
78
|
-
flow?: {
|
|
79
|
-
text: string;
|
|
80
|
-
flow_id?: string;
|
|
81
|
-
flow_name?: string;
|
|
82
|
-
flow_json?: string;
|
|
83
|
-
flow_action?: 'navigate' | 'data_exchange';
|
|
84
|
-
navigate_screen?: string;
|
|
85
|
-
};
|
|
86
|
-
mpm?: boolean;
|
|
87
|
-
otp?: boolean;
|
|
88
|
-
spm?: boolean;
|
|
89
|
-
}
|
|
90
|
-
interface CarouselCard {
|
|
91
|
-
image?: string;
|
|
92
|
-
video?: string;
|
|
93
|
-
product?: string;
|
|
94
|
-
body?: string;
|
|
95
|
-
bodyParameters?: TemplateParameter[];
|
|
96
|
-
buttons?: ButtonOptions;
|
|
97
|
-
}
|
|
98
|
-
interface CarouselOptions {
|
|
99
|
-
cards: CarouselCard[];
|
|
100
|
-
}
|
|
101
|
-
interface LimitedTimeOfferOptions {
|
|
102
|
-
expiration_time_ms: number;
|
|
103
|
-
}
|
|
104
|
-
interface ProductSection {
|
|
105
|
-
title?: string;
|
|
106
|
-
product_items: Array<{
|
|
107
|
-
product_retailer_id: string;
|
|
108
|
-
}>;
|
|
109
|
-
}
|
|
110
|
-
interface TemplateOptions {
|
|
111
|
-
name: string;
|
|
112
|
-
language: LanguagesEnum;
|
|
113
|
-
category: CategoryEnum;
|
|
114
|
-
header?: HeaderOptions;
|
|
115
|
-
body?: BodyOptions;
|
|
116
|
-
footer?: FooterOptions;
|
|
117
|
-
buttons?: ButtonOptions;
|
|
118
|
-
carousel?: CarouselOptions;
|
|
119
|
-
limitedTimeOffer?: LimitedTimeOfferOptions;
|
|
120
|
-
}
|
|
121
|
-
interface OTPTemplateOptions {
|
|
122
|
-
name: string;
|
|
123
|
-
language: LanguagesEnum;
|
|
124
|
-
code_expiration_minutes?: number;
|
|
125
|
-
add_security_recommendation?: boolean;
|
|
126
|
-
}
|
|
127
|
-
interface AuthenticationTemplateOptions {
|
|
128
|
-
name: string;
|
|
129
|
-
language: LanguagesEnum;
|
|
130
|
-
code_expiration_minutes?: number;
|
|
131
|
-
add_security_recommendation?: boolean;
|
|
132
|
-
copy_code_button?: boolean;
|
|
133
|
-
}
|
|
134
|
-
interface CatalogTemplateOptions {
|
|
135
|
-
name: string;
|
|
136
|
-
language: LanguagesEnum;
|
|
137
|
-
header?: Omit<HeaderOptions, 'format'>;
|
|
138
|
-
body: BodyOptions;
|
|
139
|
-
footer?: FooterOptions;
|
|
140
|
-
thumbnail_product_retailer_id: string;
|
|
141
|
-
}
|
|
142
|
-
interface CouponTemplateOptions {
|
|
143
|
-
name: string;
|
|
144
|
-
language: LanguagesEnum;
|
|
145
|
-
header?: Omit<HeaderOptions, 'format'>;
|
|
146
|
-
body: BodyOptions;
|
|
147
|
-
footer?: FooterOptions;
|
|
148
|
-
coupon_code: string;
|
|
149
|
-
}
|
|
150
|
-
interface LimitedTimeOfferTemplateOptions {
|
|
151
|
-
name: string;
|
|
152
|
-
language: LanguagesEnum;
|
|
153
|
-
header?: Omit<HeaderOptions, 'format'>;
|
|
154
|
-
body: BodyOptions;
|
|
155
|
-
footer?: FooterOptions;
|
|
156
|
-
expiration_time_ms: number;
|
|
157
|
-
}
|
|
158
|
-
interface MediaCardCarouselTemplateOptions {
|
|
159
|
-
name: string;
|
|
160
|
-
language: LanguagesEnum;
|
|
161
|
-
cards: Array<{
|
|
162
|
-
header: {
|
|
163
|
-
format: 'IMAGE' | 'VIDEO';
|
|
164
|
-
example: {
|
|
165
|
-
header_handle: string[];
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
body: BodyOptions;
|
|
169
|
-
buttons?: ButtonOptions;
|
|
170
|
-
}>;
|
|
171
|
-
}
|
|
172
|
-
interface MPMTemplateOptions {
|
|
173
|
-
name: string;
|
|
174
|
-
language: LanguagesEnum;
|
|
175
|
-
header?: Omit<HeaderOptions, 'format'>;
|
|
176
|
-
body: BodyOptions;
|
|
177
|
-
footer?: FooterOptions;
|
|
178
|
-
thumbnail_product_retailer_id: string;
|
|
179
|
-
sections: ProductSection[];
|
|
180
|
-
}
|
|
181
|
-
interface ProductCardCarouselTemplateOptions {
|
|
182
|
-
name: string;
|
|
183
|
-
language: LanguagesEnum;
|
|
184
|
-
header?: Omit<HeaderOptions, 'format'>;
|
|
185
|
-
body: BodyOptions;
|
|
186
|
-
footer?: FooterOptions;
|
|
187
|
-
cards: Array<{
|
|
188
|
-
product_retailer_id: string;
|
|
189
|
-
}>;
|
|
190
|
-
}
|
|
191
|
-
interface SPMTemplateOptions {
|
|
192
|
-
name: string;
|
|
193
|
-
language: LanguagesEnum;
|
|
194
|
-
header?: Omit<HeaderOptions, 'format'>;
|
|
195
|
-
body: BodyOptions;
|
|
196
|
-
footer?: FooterOptions;
|
|
197
|
-
product_retailer_id: string;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export type { AuthenticationTemplateOptions as A, BodyOptions as B, CarouselCard as C, DateTimeParameter as D, FooterOptions as F, HeaderOptions as H, LimitedTimeOfferOptions as L, MediaCardCarouselTemplateOptions as M, OTPTemplateOptions as O, ProductCardCarouselTemplateOptions as P, SPMTemplateOptions as S, TemplateOptions as T, ButtonOptions as a, CarouselOptions as b, CatalogTemplateOptions as c, CouponTemplateOptions as d, CurrencyParameter as e, LimitedTimeOfferTemplateOptions as f, LocationParameter as g, MediaParameter as h, MPMTemplateOptions as i, ProductParameter as j, ProductSection as k, TemplateParameter as l, TextParameter as m };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { WhatsAppConfig } from './types/config.js';
|
|
2
|
-
|
|
3
|
-
interface BaseRequest {
|
|
4
|
-
method?: string;
|
|
5
|
-
url?: string;
|
|
6
|
-
headers: Record<string, string | string[] | undefined>;
|
|
7
|
-
body?: any;
|
|
8
|
-
query?: Record<string, any> | URLSearchParams;
|
|
9
|
-
rawBody?: any;
|
|
10
|
-
}
|
|
11
|
-
interface BaseResponse<T = any> {
|
|
12
|
-
status(code: number): T;
|
|
13
|
-
json?(data: any): T | void;
|
|
14
|
-
send?(data?: any): T | void;
|
|
15
|
-
setHeader?(name: string, value: string): void;
|
|
16
|
-
}
|
|
17
|
-
interface BaseWebhookConfig extends WhatsAppConfig {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type { BaseWebhookConfig as B, BaseRequest as a, BaseResponse as b };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { H as HttpMethodsEnum } from './enums-DIimUG6s.js';
|
|
2
|
-
|
|
3
|
-
type ResponseHeaderValue = string | string[] | undefined;
|
|
4
|
-
type ResponseHeaders = Record<string, ResponseHeaderValue>;
|
|
5
|
-
type ResponseJSONBody = Record<string, unknown>;
|
|
6
|
-
declare class HttpsClientResponseClass {
|
|
7
|
-
constructor(resp: Response);
|
|
8
|
-
statusCode: () => number;
|
|
9
|
-
headers: () => ResponseHeaders;
|
|
10
|
-
rawResponse: () => Response;
|
|
11
|
-
json: () => Promise<ResponseJSONBody>;
|
|
12
|
-
}
|
|
13
|
-
declare class HttpsClientClass {
|
|
14
|
-
constructor();
|
|
15
|
-
clearSockets: () => boolean;
|
|
16
|
-
sendRequest: (host: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null) => Promise<HttpsClientResponseClass>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { HttpsClientClass as H, type ResponseHeaders as R, HttpsClientResponseClass as a, type ResponseHeaderValue as b, type ResponseJSONBody as c };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { l as FlowEndpointRequest, h as FlowDataExchangeRequest, a as FlowActionEnum, n as FlowErrorNotificationRequest, p as FlowHealthCheckRequest } from './common-B8kp4RdL.js';
|
|
2
|
-
|
|
3
|
-
declare const DATA_EXCHANGE_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK];
|
|
4
|
-
declare const ERROR_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT];
|
|
5
|
-
/**
|
|
6
|
-
* Type guard to check if a request is a Data Exchange request
|
|
7
|
-
* Validates the request structure according to the Flow API specifications
|
|
8
|
-
*
|
|
9
|
-
* @param request The Flow endpoint request to check
|
|
10
|
-
* @returns True if the request is a valid Data Exchange request, false otherwise
|
|
11
|
-
*/
|
|
12
|
-
declare function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {
|
|
13
|
-
action: (typeof DATA_EXCHANGE_ACTIONS)[number];
|
|
14
|
-
screen?: string;
|
|
15
|
-
flow_token: string;
|
|
16
|
-
data?: Record<string, any>;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Type guard to check if a request is an Error Notification request
|
|
20
|
-
* Validates the request structure according to the Flow API error specifications
|
|
21
|
-
*
|
|
22
|
-
* @param request The Flow endpoint request to check
|
|
23
|
-
* @returns True if the request is a valid Error Notification request, false otherwise
|
|
24
|
-
*/
|
|
25
|
-
declare function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {
|
|
26
|
-
action: (typeof ERROR_ACTIONS)[number];
|
|
27
|
-
screen: string;
|
|
28
|
-
flow_token: string;
|
|
29
|
-
data: {
|
|
30
|
-
error: string;
|
|
31
|
-
error_message: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Type guard to check if a request is a Ping (health check) request
|
|
36
|
-
* Simple validation for health check endpoints in the Flow API
|
|
37
|
-
*
|
|
38
|
-
* @param request The Flow endpoint request to check
|
|
39
|
-
* @returns True if the request is a Ping request, false otherwise
|
|
40
|
-
*/
|
|
41
|
-
declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
|
|
42
|
-
|
|
43
|
-
interface MetaError extends Error {
|
|
44
|
-
error: {
|
|
45
|
-
message: string;
|
|
46
|
-
type: string;
|
|
47
|
-
code: number;
|
|
48
|
-
error_data?: {
|
|
49
|
-
messaging_product: 'whatsapp';
|
|
50
|
-
details: string;
|
|
51
|
-
};
|
|
52
|
-
error_subcode?: number;
|
|
53
|
-
fbtrace_id: string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Determines if the error is a Meta API error response
|
|
58
|
-
* @param error Any error object to check
|
|
59
|
-
* @returns Type guard indicating if error is a Meta API error
|
|
60
|
-
*/
|
|
61
|
-
declare function isMetaError(error: any): error is MetaError;
|
|
62
|
-
|
|
63
|
-
export { type MetaError as M, isFlowErrorRequest as a, isFlowPingRequest as b, isMetaError as c, isFlowDataExchangeRequest as i };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { H as HttpMethodsEnum } from './enums-DIimUG6s.js';
|
|
2
|
-
|
|
3
|
-
type GeneralRequestBody = Record<string, unknown>;
|
|
4
|
-
interface GeneralHeaderInterface {
|
|
5
|
-
/**
|
|
6
|
-
* Authorization token. This is required for all HTTP requests made to the graph API.
|
|
7
|
-
* @default 'Bearer '
|
|
8
|
-
*/
|
|
9
|
-
Authorization: string;
|
|
10
|
-
/**
|
|
11
|
-
* Content type of the message being sent. This is required for all HTTP requests made to the graph API.
|
|
12
|
-
* @default 'application/json'
|
|
13
|
-
*/
|
|
14
|
-
'Content-Type': string;
|
|
15
|
-
/**
|
|
16
|
-
* User agent field sent in all requests. This is used to gather SDK usage metrics and help
|
|
17
|
-
* better triage support requests.
|
|
18
|
-
* @default `WA_SDK/${ SDK_version } (Node.js ${ process.version })`
|
|
19
|
-
*/
|
|
20
|
-
'User-Agent': string;
|
|
21
|
-
}
|
|
22
|
-
interface RequesterResponseInterface<T> {
|
|
23
|
-
json: () => Promise<T>;
|
|
24
|
-
}
|
|
25
|
-
interface ResponseSuccess {
|
|
26
|
-
success: boolean;
|
|
27
|
-
}
|
|
28
|
-
interface ResponseData<T> {
|
|
29
|
-
data: T;
|
|
30
|
-
}
|
|
31
|
-
interface ResponsePagination<T> {
|
|
32
|
-
data: T[];
|
|
33
|
-
paging: Paging;
|
|
34
|
-
}
|
|
35
|
-
interface Paging {
|
|
36
|
-
cursors: {
|
|
37
|
-
before: string;
|
|
38
|
-
after: string;
|
|
39
|
-
};
|
|
40
|
-
next: string;
|
|
41
|
-
}
|
|
42
|
-
declare class RequesterClass {
|
|
43
|
-
constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string);
|
|
44
|
-
sendRequest: (method: HttpMethodsEnum, path: string, timeout: number, body?: GeneralRequestBody, contentType?: string, additionalHeaders?: Record<string, string>) => Promise<RequesterResponseInterface<unknown>>;
|
|
45
|
-
getJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: GeneralRequestBody, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
46
|
-
sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: FormData, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
47
|
-
sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, formData: Record<string, string>, additionalHeaders?: Record<string, string>): Promise<T>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { type GeneralHeaderInterface as G, type Paging as P, type RequesterResponseInterface as R, type GeneralRequestBody as a, type ResponseData as b, type ResponsePagination as c, type ResponseSuccess as d, RequesterClass as e };
|
package/dist/types/config.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { W as WabaConfigEnum } from '../enums-DIimUG6s.js';
|
|
2
|
-
|
|
3
|
-
type WhatsAppConfig = {
|
|
4
|
-
accessToken: string;
|
|
5
|
-
appId?: string;
|
|
6
|
-
appSecret?: string;
|
|
7
|
-
phoneNumberId?: number;
|
|
8
|
-
businessAcctId?: string;
|
|
9
|
-
apiVersion?: string;
|
|
10
|
-
webhookEndpoint?: string;
|
|
11
|
-
webhookVerificationToken?: string;
|
|
12
|
-
listenerPort?: number;
|
|
13
|
-
debug?: boolean;
|
|
14
|
-
maxRetriesAfterWait?: number;
|
|
15
|
-
requestTimeout?: number;
|
|
16
|
-
privatePem?: string;
|
|
17
|
-
passphrase?: string;
|
|
18
|
-
};
|
|
19
|
-
type WabaConfigType = {
|
|
20
|
-
/**
|
|
21
|
-
* The Meta for Developers business application Id for this registered application.
|
|
22
|
-
*/
|
|
23
|
-
[WabaConfigEnum.AppId]: string;
|
|
24
|
-
/**
|
|
25
|
-
* The Meta for Developers business application secret for this registered application.
|
|
26
|
-
*/
|
|
27
|
-
[WabaConfigEnum.AppSecret]: string;
|
|
28
|
-
/**
|
|
29
|
-
* The Meta for Developers phone number id used by the registered business.
|
|
30
|
-
*/
|
|
31
|
-
[WabaConfigEnum.PhoneNumberId]: number;
|
|
32
|
-
/**
|
|
33
|
-
* The Meta for Developers business id for the registered business.
|
|
34
|
-
*/
|
|
35
|
-
[WabaConfigEnum.BusinessAcctId]: string;
|
|
36
|
-
/**
|
|
37
|
-
* The version of the Cloud API being used. Starts with a "v" and follows the major number.
|
|
38
|
-
*/
|
|
39
|
-
[WabaConfigEnum.APIVersion]: string;
|
|
40
|
-
/**
|
|
41
|
-
* The access token to make calls on behalf of the signed in Meta for Developers account or business.
|
|
42
|
-
*/
|
|
43
|
-
[WabaConfigEnum.AccessToken]: string;
|
|
44
|
-
/**
|
|
45
|
-
* The endpoint path (e.g. if the value here is webhook, the webhook URL would look like http/https://{host}/webhook).
|
|
46
|
-
*/
|
|
47
|
-
[WabaConfigEnum.WebhookEndpoint]: string;
|
|
48
|
-
/**
|
|
49
|
-
* The verification token that needs to match what is sent by the Cloud API webhook in order to subscribe.
|
|
50
|
-
*/
|
|
51
|
-
[WabaConfigEnum.WebhookVerificationToken]: string;
|
|
52
|
-
/**
|
|
53
|
-
* The listener port for the webhook web server.
|
|
54
|
-
*/
|
|
55
|
-
[WabaConfigEnum.ListenerPort]: number;
|
|
56
|
-
/**
|
|
57
|
-
* To turn on global debugging of the logger to print verbose output across the APIs.
|
|
58
|
-
*/
|
|
59
|
-
[WabaConfigEnum.Debug]: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* The total number of times a request should be retried after the wait period if it fails.
|
|
62
|
-
*/
|
|
63
|
-
[WabaConfigEnum.MaxRetriesAfterWait]: number;
|
|
64
|
-
/**
|
|
65
|
-
* The timeout period for a request to quit and destroy the attempt in ms.
|
|
66
|
-
*/
|
|
67
|
-
[WabaConfigEnum.RequestTimeout]: number;
|
|
68
|
-
/**
|
|
69
|
-
* The private key for the Meta for Developers business.
|
|
70
|
-
*/
|
|
71
|
-
[WabaConfigEnum.PrivatePem]: string;
|
|
72
|
-
/**
|
|
73
|
-
* The passphrase for the Meta for Developers business.
|
|
74
|
-
*/
|
|
75
|
-
[WabaConfigEnum.Passphrase]: string;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export type { WabaConfigType, WhatsAppConfig };
|
package/dist/types/config.js
DELETED
package/dist/types/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"config.js"}
|
package/dist/types/enums.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { A as AudioMediaTypesEnum, B as BusinessVerticalEnum, a as ButtonPositionEnum, C as CategoryEnum, b as ComponentTypesEnum, c as ConversationTypesEnum, d as CurrencyCodesEnum, D as DataLocalizationRegionEnum, e as DocumentMediaTypesEnum, H as HttpMethodsEnum, I as ImageMediaTypesEnum, f as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, k as ReferralSourceTypesEnum, R as RequestCodeMethodsEnum, S as StatusEnum, g as StickerMediaTypesEnum, h as SubTypeEnum, i as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, j as WebhookTypesEnum } from '../enums-DIimUG6s.js';
|
package/dist/types/enums.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=enums.js.map
|
package/dist/types/enums.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"enums.js"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { B as BaseAPI, a as BaseClass } from '../base-BV6DyzGS.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-Cbd2Y6mg.js';
|
|
5
|
-
export { G as GeneralHeaderInterface, a as GeneralRequestBody, P as Paging, e as RequesterClass, R as RequesterResponseInterface, b as ResponseData, c as ResponsePagination, d as ResponseSuccess } from '../request-CUjrMn8R.js';
|
|
6
|
-
export { A as AudioMediaTypesEnum, B as BusinessVerticalEnum, a as ButtonPositionEnum, C as CategoryEnum, b as ComponentTypesEnum, c as ConversationTypesEnum, d as CurrencyCodesEnum, D as DataLocalizationRegionEnum, e as DocumentMediaTypesEnum, H as HttpMethodsEnum, I as ImageMediaTypesEnum, f as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, k as ReferralSourceTypesEnum, R as RequestCodeMethodsEnum, S as StatusEnum, g as StickerMediaTypesEnum, h as SubTypeEnum, i as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, j as WebhookTypesEnum } from '../enums-DIimUG6s.js';
|
package/dist/types/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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
|
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { WabaConfigType } from '../types/config.js';
|
|
2
|
-
export { M as MetaError, i as isFlowDataExchangeRequest, a as isFlowErrorRequest, b as isFlowPingRequest, c as isMetaError } from '../isMetaError-CQLXyEL4.js';
|
|
3
|
-
import { L as LoggerInterface } from '../logger-BdE0Vyim.js';
|
|
4
|
-
import '../enums-DIimUG6s.js';
|
|
5
|
-
import '../common-B8kp4RdL.js';
|
|
6
|
-
import '../request-CUjrMn8R.js';
|
|
7
|
-
import 'http';
|
|
8
|
-
|
|
9
|
-
declare function buildFieldsQueryString(fields?: string[] | string): string;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Formats configuration as a terminal table
|
|
13
|
-
* @param config - The WABA configuration object
|
|
14
|
-
* @param apiName - The name of the API being initialized
|
|
15
|
-
* @returns Formatted table string
|
|
16
|
-
*/
|
|
17
|
-
declare function formatConfigTable(config: WabaConfigType): string;
|
|
18
|
-
|
|
19
|
-
declare class Logger implements LoggerInterface {
|
|
20
|
-
private name;
|
|
21
|
-
private debug;
|
|
22
|
-
constructor(name: string, debug?: boolean);
|
|
23
|
-
log(...data: any[]): void;
|
|
24
|
-
error(...data: any[]): void;
|
|
25
|
-
warn(...data: any[]): void;
|
|
26
|
-
info(...data: any[]): void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare const objectToQueryString: (params: Record<string, any>) => string;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Get SDK version from package.json
|
|
33
|
-
*/
|
|
34
|
-
declare function getVersion(): string;
|
|
35
|
-
/**
|
|
36
|
-
* Generate User-Agent string following official SDK pattern
|
|
37
|
-
*/
|
|
38
|
-
declare function getUserAgent(): string;
|
|
39
|
-
|
|
40
|
-
export { Logger, buildFieldsQueryString, formatConfigTable, getUserAgent, getVersion, objectToQueryString };
|
package/dist/utils/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{a as isFlowDataExchangeRequest,b as isFlowErrorRequest,c as isFlowPingRequest}from'../chunk-6DFC5L3X.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-J2JPTKU6.js';export{a as objectToQueryString}from'../chunk-MJEG3K4V.js';import'../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|