meta-cloud-api 0.0.1-beta.0 → 0.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/dist/api/base.d.mts +12 -0
- package/dist/api/base.d.ts +12 -0
- package/dist/api/base.js +2 -0
- package/dist/api/base.js.map +1 -0
- package/dist/api/base.mjs +2 -0
- package/dist/api/base.mjs.map +1 -0
- package/dist/api/encryption.d.mts +15 -0
- package/dist/api/encryption.d.ts +15 -0
- package/dist/api/encryption.js +2 -0
- package/dist/api/encryption.js.map +1 -0
- package/dist/api/encryption.mjs +2 -0
- package/dist/api/encryption.mjs.map +1 -0
- package/dist/api/flow.d.mts +114 -0
- package/dist/api/flow.d.ts +114 -0
- package/dist/api/flow.js +2 -0
- package/dist/api/flow.js.map +1 -0
- package/dist/api/flow.mjs +2 -0
- package/dist/api/flow.mjs.map +1 -0
- package/dist/api/index.d.mts +25 -0
- package/dist/api/index.d.ts +25 -0
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/index.mjs +2 -0
- package/dist/api/index.mjs.map +1 -0
- package/dist/api/media.d.mts +17 -0
- package/dist/api/media.d.ts +17 -0
- package/dist/api/media.js +2 -0
- package/dist/api/media.js.map +1 -0
- package/dist/api/media.mjs +2 -0
- package/dist/api/media.mjs.map +1 -0
- package/dist/api/messages.d.mts +27 -0
- package/dist/api/messages.d.ts +27 -0
- package/dist/api/messages.js +2 -0
- package/dist/api/messages.js.map +1 -0
- package/dist/api/messages.mjs +2 -0
- package/dist/api/messages.mjs.map +1 -0
- package/dist/api/phoneNumber.d.mts +17 -0
- package/dist/api/phoneNumber.d.ts +17 -0
- package/dist/api/phoneNumber.js +2 -0
- package/dist/api/phoneNumber.js.map +1 -0
- package/dist/api/phoneNumber.mjs +2 -0
- package/dist/api/phoneNumber.mjs.map +1 -0
- package/dist/api/qrCode.d.mts +18 -0
- package/dist/api/qrCode.d.ts +18 -0
- package/dist/api/qrCode.js +2 -0
- package/dist/api/qrCode.js.map +1 -0
- package/dist/api/qrCode.mjs +2 -0
- package/dist/api/qrCode.mjs.map +1 -0
- package/dist/api/registration.d.mts +14 -0
- package/dist/api/registration.d.ts +14 -0
- package/dist/api/registration.js +2 -0
- package/dist/api/registration.js.map +1 -0
- package/dist/api/registration.mjs +2 -0
- package/dist/api/registration.mjs.map +1 -0
- package/dist/api/template.d.mts +18 -0
- package/dist/api/template.d.ts +18 -0
- package/dist/api/template.js +2 -0
- package/dist/api/template.js.map +1 -0
- package/dist/api/template.mjs +2 -0
- package/dist/api/template.mjs.map +1 -0
- package/dist/api/twoStepVerification.d.mts +13 -0
- package/dist/api/twoStepVerification.d.ts +13 -0
- package/dist/api/twoStepVerification.js +2 -0
- package/dist/api/twoStepVerification.js.map +1 -0
- package/dist/api/twoStepVerification.mjs +2 -0
- package/dist/api/twoStepVerification.mjs.map +1 -0
- package/dist/api/waba.d.mts +16 -0
- package/dist/api/waba.d.ts +16 -0
- package/dist/api/waba.js +2 -0
- package/dist/api/waba.js.map +1 -0
- package/dist/api/waba.mjs +2 -0
- package/dist/api/waba.mjs.map +1 -0
- package/dist/enums-D6WRUWH9.d.mts +585 -0
- package/dist/enums-D6WRUWH9.d.ts +585 -0
- package/dist/httpsClient.d.mts +22 -0
- package/dist/httpsClient.d.ts +22 -0
- package/dist/httpsClient.js +2 -0
- package/dist/httpsClient.js.map +1 -0
- package/dist/httpsClient.mjs +2 -0
- package/dist/httpsClient.mjs.map +1 -0
- package/dist/index.d.mts +35 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/request.d.mts +22 -0
- package/dist/request.d.ts +22 -0
- package/dist/request.js +2 -0
- package/dist/request.js.map +1 -0
- package/dist/request.mjs +2 -0
- package/dist/request.mjs.map +1 -0
- package/dist/types/base.d.mts +8 -0
- package/dist/types/base.d.ts +8 -0
- package/dist/types/base.js +2 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/base.mjs +1 -0
- package/dist/types/base.mjs.map +1 -0
- package/dist/types/config.d.mts +59 -0
- package/dist/types/config.d.ts +59 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/config.mjs +1 -0
- package/dist/types/config.mjs.map +1 -0
- package/dist/types/encryption.d.mts +13 -0
- package/dist/types/encryption.d.ts +13 -0
- package/dist/types/encryption.js +2 -0
- package/dist/types/encryption.js.map +1 -0
- package/dist/types/encryption.mjs +1 -0
- package/dist/types/encryption.mjs.map +1 -0
- package/dist/types/enums.d.mts +1 -0
- package/dist/types/enums.d.ts +1 -0
- package/dist/types/enums.js +2 -0
- package/dist/types/enums.js.map +1 -0
- package/dist/types/enums.mjs +2 -0
- package/dist/types/enums.mjs.map +1 -0
- package/dist/types/flow.d.mts +245 -0
- package/dist/types/flow.d.ts +245 -0
- package/dist/types/flow.js +2 -0
- package/dist/types/flow.js.map +1 -0
- package/dist/types/flow.mjs +2 -0
- package/dist/types/flow.mjs.map +1 -0
- package/dist/types/httpsClient.d.mts +19 -0
- package/dist/types/httpsClient.d.ts +19 -0
- package/dist/types/httpsClient.js +2 -0
- package/dist/types/httpsClient.js.map +1 -0
- package/dist/types/httpsClient.mjs +1 -0
- package/dist/types/httpsClient.mjs.map +1 -0
- package/dist/types/index.d.mts +16 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/logger.d.mts +9 -0
- package/dist/types/logger.d.ts +9 -0
- package/dist/types/logger.js +2 -0
- package/dist/types/logger.js.map +1 -0
- package/dist/types/logger.mjs +1 -0
- package/dist/types/logger.mjs.map +1 -0
- package/dist/types/media.d.mts +31 -0
- package/dist/types/media.d.ts +31 -0
- package/dist/types/media.js +2 -0
- package/dist/types/media.js.map +1 -0
- package/dist/types/media.mjs +1 -0
- package/dist/types/media.mjs.map +1 -0
- package/dist/types/messages.d.mts +322 -0
- package/dist/types/messages.d.ts +322 -0
- package/dist/types/messages.js +2 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/messages.mjs +1 -0
- package/dist/types/messages.mjs.map +1 -0
- package/dist/types/phoneNumber.d.mts +82 -0
- package/dist/types/phoneNumber.d.ts +82 -0
- package/dist/types/phoneNumber.js +2 -0
- package/dist/types/phoneNumber.js.map +1 -0
- package/dist/types/phoneNumber.mjs +1 -0
- package/dist/types/phoneNumber.mjs.map +1 -0
- package/dist/types/qrCode.d.mts +27 -0
- package/dist/types/qrCode.d.ts +27 -0
- package/dist/types/qrCode.js +2 -0
- package/dist/types/qrCode.js.map +1 -0
- package/dist/types/qrCode.mjs +1 -0
- package/dist/types/qrCode.mjs.map +1 -0
- package/dist/types/registration.d.mts +14 -0
- package/dist/types/registration.d.ts +14 -0
- package/dist/types/registration.js +2 -0
- package/dist/types/registration.js.map +1 -0
- package/dist/types/registration.mjs +1 -0
- package/dist/types/registration.mjs.map +1 -0
- package/dist/types/request.d.mts +47 -0
- package/dist/types/request.d.ts +47 -0
- package/dist/types/request.js +2 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/request.mjs +1 -0
- package/dist/types/request.mjs.map +1 -0
- package/dist/types/template.d.mts +106 -0
- package/dist/types/template.d.ts +106 -0
- package/dist/types/template.js +2 -0
- package/dist/types/template.js.map +1 -0
- package/dist/types/template.mjs +1 -0
- package/dist/types/template.mjs.map +1 -0
- package/dist/types/twoStepVerification.d.mts +11 -0
- package/dist/types/twoStepVerification.d.ts +11 -0
- package/dist/types/twoStepVerification.js +2 -0
- package/dist/types/twoStepVerification.js.map +1 -0
- package/dist/types/twoStepVerification.mjs +1 -0
- package/dist/types/twoStepVerification.mjs.map +1 -0
- package/dist/types/waba.d.mts +19 -0
- package/dist/types/waba.d.ts +19 -0
- package/dist/types/waba.js +2 -0
- package/dist/types/waba.js.map +1 -0
- package/dist/types/waba.mjs +1 -0
- package/dist/types/waba.mjs.map +1 -0
- package/dist/types/whatsapp.d.mts +31 -0
- package/dist/types/whatsapp.d.ts +31 -0
- package/dist/types/whatsapp.js +2 -0
- package/dist/types/whatsapp.js.map +1 -0
- package/dist/types/whatsapp.mjs +1 -0
- package/dist/types/whatsapp.mjs.map +1 -0
- package/dist/utils/generateXHub256Sig.d.mts +3 -0
- package/dist/utils/generateXHub256Sig.d.ts +3 -0
- package/dist/utils/generateXHub256Sig.js +2 -0
- package/dist/utils/generateXHub256Sig.js.map +1 -0
- package/dist/utils/generateXHub256Sig.mjs +2 -0
- package/dist/utils/generateXHub256Sig.mjs.map +1 -0
- package/dist/utils/importConfig.d.mts +7 -0
- package/dist/utils/importConfig.d.ts +7 -0
- package/dist/utils/importConfig.js +2 -0
- package/dist/utils/importConfig.js.map +1 -0
- package/dist/utils/importConfig.mjs +2 -0
- package/dist/utils/importConfig.mjs.map +1 -0
- package/dist/utils/index.d.mts +5 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +2 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/isMetaError.d.mts +21 -0
- package/dist/utils/isMetaError.d.ts +21 -0
- package/dist/utils/isMetaError.js +2 -0
- package/dist/utils/isMetaError.js.map +1 -0
- package/dist/utils/isMetaError.mjs +2 -0
- package/dist/utils/isMetaError.mjs.map +1 -0
- package/dist/utils/logger.d.mts +13 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.js +2 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/logger.mjs +2 -0
- package/dist/utils/logger.mjs.map +1 -0
- package/dist/utils/objectToQueryString.d.mts +3 -0
- package/dist/utils/objectToQueryString.d.ts +3 -0
- package/dist/utils/objectToQueryString.js +2 -0
- package/dist/utils/objectToQueryString.js.map +1 -0
- package/dist/utils/objectToQueryString.mjs +2 -0
- package/dist/utils/objectToQueryString.mjs.map +1 -0
- package/dist/whatsapp.d.mts +54 -0
- package/dist/whatsapp.d.ts +54 -0
- package/dist/whatsapp.js +2 -0
- package/dist/whatsapp.js.map +1 -0
- package/dist/whatsapp.mjs +2 -0
- package/dist/whatsapp.mjs.map +1 -0
- package/package.json +51 -7
- package/src/api/base.ts +19 -0
- package/src/api/encryption.ts +34 -0
- package/src/api/flow.ts +253 -0
- package/src/api/index.ts +24 -0
- package/src/api/media.ts +52 -0
- package/src/api/messages.ts +160 -0
- package/src/api/phoneNumber.ts +59 -0
- package/src/api/qrCode.ts +64 -0
- package/src/api/registration.ts +38 -0
- package/src/api/template.ts +70 -0
- package/src/api/twoStepVerification.ts +24 -0
- package/src/api/waba.ts +55 -0
- package/src/httpsClient.ts +83 -0
- package/src/index.ts +3 -0
- package/src/request.ts +104 -0
- package/src/types/base.ts +5 -0
- package/src/types/config.ts +68 -0
- package/src/types/encryption.ts +11 -0
- package/src/types/enums.ts +563 -0
- package/src/types/flow.ts +274 -0
- package/src/types/httpsClient.ts +28 -0
- package/src/types/index.ts +16 -0
- package/src/types/logger.ts +7 -0
- package/src/types/media.ts +31 -0
- package/src/types/messages.ts +453 -0
- package/src/types/phoneNumber.ts +111 -0
- package/src/types/qrCode.ts +30 -0
- package/src/types/registration.ts +17 -0
- package/src/types/request.ts +66 -0
- package/src/types/template.ts +134 -0
- package/src/types/twoStepVerification.ts +9 -0
- package/src/types/waba.ts +18 -0
- package/src/types/whatsapp.ts +31 -0
- package/src/utils/.gitkeep +0 -0
- package/src/utils/generateXHub256Sig.ts +5 -0
- package/src/utils/importConfig.ts +55 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/isMetaError.ts +44 -0
- package/src/utils/logger.ts +46 -0
- package/src/utils/objectToQueryString.ts +16 -0
- package/src/whatsapp.ts +96 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { RequesterResponseInterface, ResponseSuccess } from './request';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Enum for Flow Status
|
|
12
|
+
*/
|
|
13
|
+
export enum FlowStatusEnum {
|
|
14
|
+
Draft = 'DRAFT',
|
|
15
|
+
Published = 'PUBLISHED',
|
|
16
|
+
Throttled = 'THROTTLED',
|
|
17
|
+
Blocked = 'BLOCKED',
|
|
18
|
+
Deprecated = 'DEPRECATED',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Enum for Flow Categories
|
|
23
|
+
*/
|
|
24
|
+
export enum FlowCategoryEnum {
|
|
25
|
+
SignUp = 'SIGN_UP',
|
|
26
|
+
SignIn = 'SIGN_IN',
|
|
27
|
+
AppointmentBooking = 'APPOINTMENT_BOOKING',
|
|
28
|
+
LeadGeneration = 'LEAD_GENERATION',
|
|
29
|
+
ContactUs = 'CONTACT_US',
|
|
30
|
+
CustomerSupport = 'CUSTOMER_SUPPORT',
|
|
31
|
+
Survey = 'SURVEY',
|
|
32
|
+
Other = 'OTHER',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Flow Validation Error Pointer
|
|
37
|
+
*/
|
|
38
|
+
export interface FlowValidationErrorPointer {
|
|
39
|
+
line_start: number;
|
|
40
|
+
line_end: number;
|
|
41
|
+
column_start: number;
|
|
42
|
+
column_end: number;
|
|
43
|
+
path: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Flow Validation Error
|
|
48
|
+
*/
|
|
49
|
+
export interface FlowValidationError {
|
|
50
|
+
error: string;
|
|
51
|
+
error_type: string;
|
|
52
|
+
message: string;
|
|
53
|
+
line_start: number;
|
|
54
|
+
line_end: number;
|
|
55
|
+
column_start: number;
|
|
56
|
+
column_end: number;
|
|
57
|
+
pointers: FlowValidationErrorPointer[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Flow Item
|
|
62
|
+
*/
|
|
63
|
+
export interface Flow {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
status: FlowStatusEnum;
|
|
67
|
+
categories: FlowCategoryEnum[];
|
|
68
|
+
validation_errors: FlowValidationError[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Pagination Cursors
|
|
73
|
+
*/
|
|
74
|
+
export interface PaginationCursors {
|
|
75
|
+
before: string;
|
|
76
|
+
after: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Pagination Object
|
|
81
|
+
*/
|
|
82
|
+
export interface Pagination {
|
|
83
|
+
cursors: PaginationCursors;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Flows List Response
|
|
88
|
+
*/
|
|
89
|
+
export interface FlowsListResponse {
|
|
90
|
+
data: Flow[];
|
|
91
|
+
paging: Pagination;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Flow Asset
|
|
96
|
+
*/
|
|
97
|
+
export interface FlowAsset {
|
|
98
|
+
name: string;
|
|
99
|
+
asset_type: string;
|
|
100
|
+
download_url: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Flow Assets Response
|
|
105
|
+
*/
|
|
106
|
+
export interface FlowAssetsResponse {
|
|
107
|
+
data: FlowAsset[];
|
|
108
|
+
paging: Pagination;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Flow Preview
|
|
113
|
+
*/
|
|
114
|
+
export interface FlowPreview {
|
|
115
|
+
preview_url: string;
|
|
116
|
+
expires_at: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Flow Preview Response
|
|
121
|
+
*/
|
|
122
|
+
export interface FlowPreviewResponse {
|
|
123
|
+
preview: FlowPreview;
|
|
124
|
+
id: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Flow Migration Result
|
|
129
|
+
*/
|
|
130
|
+
export interface FlowMigrationResult {
|
|
131
|
+
source_name: string;
|
|
132
|
+
source_id: string;
|
|
133
|
+
migrated_id: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Flow Migration Failure
|
|
138
|
+
*/
|
|
139
|
+
export interface FlowMigrationFailure {
|
|
140
|
+
source_name: string;
|
|
141
|
+
error_code: string;
|
|
142
|
+
error_message: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Flow Migration Response
|
|
147
|
+
*/
|
|
148
|
+
export interface FlowMigrationResponse {
|
|
149
|
+
migrated_flows: FlowMigrationResult[];
|
|
150
|
+
failed_flows: FlowMigrationFailure[];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface FlowClass {
|
|
154
|
+
/**
|
|
155
|
+
* List Flows
|
|
156
|
+
*
|
|
157
|
+
* @param wabaId - The WABA ID
|
|
158
|
+
* @returns Promise with the list of flows
|
|
159
|
+
*/
|
|
160
|
+
listFlows(wabaId: string): Promise<RequesterResponseInterface<FlowsListResponse>>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Create Flow
|
|
164
|
+
*
|
|
165
|
+
* @param wabaId - The WABA ID
|
|
166
|
+
* @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
|
|
167
|
+
* @returns Promise with the created flow ID
|
|
168
|
+
*/
|
|
169
|
+
createFlow(
|
|
170
|
+
wabaId: string,
|
|
171
|
+
data: {
|
|
172
|
+
name: string;
|
|
173
|
+
categories?: FlowCategoryEnum[];
|
|
174
|
+
endpoint_uri?: string;
|
|
175
|
+
clone_flow_id?: string;
|
|
176
|
+
flow_json?: string;
|
|
177
|
+
publish?: boolean;
|
|
178
|
+
},
|
|
179
|
+
): Promise<RequesterResponseInterface<{ id: string; success: boolean; validation_errors?: FlowValidationError[] }>>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Get Flow
|
|
183
|
+
*
|
|
184
|
+
* @param flowId - The flow ID
|
|
185
|
+
* @param fields - Optional fields to return
|
|
186
|
+
* @param dateFormat - Optional date format
|
|
187
|
+
* @returns Promise with the flow details
|
|
188
|
+
*/
|
|
189
|
+
getFlow(
|
|
190
|
+
flowId: string,
|
|
191
|
+
fields?: string,
|
|
192
|
+
dateFormat?: string,
|
|
193
|
+
): Promise<RequesterResponseInterface<Flow | FlowPreviewResponse>>;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Update Flow Metadata
|
|
197
|
+
*
|
|
198
|
+
* @param flowId - The flow ID
|
|
199
|
+
* @param data - The flow metadata to update
|
|
200
|
+
* @returns Promise with the success status
|
|
201
|
+
*/
|
|
202
|
+
updateFlowMetadata(
|
|
203
|
+
flowId: string,
|
|
204
|
+
data: {
|
|
205
|
+
name?: string;
|
|
206
|
+
categories?: FlowCategoryEnum[];
|
|
207
|
+
endpoint_uri?: string;
|
|
208
|
+
application_id?: string;
|
|
209
|
+
},
|
|
210
|
+
): Promise<RequesterResponseInterface<ResponseSuccess>>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Delete Flow
|
|
214
|
+
*
|
|
215
|
+
* @param flowId - The flow ID
|
|
216
|
+
* @returns Promise with the success status
|
|
217
|
+
*/
|
|
218
|
+
deleteFlow(flowId: string): Promise<RequesterResponseInterface<ResponseSuccess>>;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* List Assets (Get Flow JSON URL)
|
|
222
|
+
*
|
|
223
|
+
* @param flowId - The flow ID
|
|
224
|
+
* @returns Promise with the list of assets
|
|
225
|
+
*/
|
|
226
|
+
listAssets(flowId: string): Promise<RequesterResponseInterface<FlowAssetsResponse>>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Update Flow JSON
|
|
230
|
+
*
|
|
231
|
+
* @param flowId - The flow ID
|
|
232
|
+
* @param data - The asset data including asset_type, file, and name
|
|
233
|
+
* @returns Promise with the success status and validation errors
|
|
234
|
+
*/
|
|
235
|
+
updateFlowJson(
|
|
236
|
+
flowId: string,
|
|
237
|
+
data: {
|
|
238
|
+
asset_type: 'FLOW_JSON';
|
|
239
|
+
file: Blob;
|
|
240
|
+
name: string;
|
|
241
|
+
},
|
|
242
|
+
): Promise<RequesterResponseInterface<{ success: boolean; validation_errors?: FlowValidationError[] }>>;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Publish Flow
|
|
246
|
+
*
|
|
247
|
+
* @param flowId - The flow ID
|
|
248
|
+
* @returns Promise with the success status
|
|
249
|
+
*/
|
|
250
|
+
publishFlow(flowId: string): Promise<RequesterResponseInterface<ResponseSuccess>>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Deprecate Flow
|
|
254
|
+
*
|
|
255
|
+
* @param flowId - The flow ID
|
|
256
|
+
* @returns Promise with the success status
|
|
257
|
+
*/
|
|
258
|
+
deprecateFlow(flowId: string): Promise<RequesterResponseInterface<ResponseSuccess>>;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Migrate Flows
|
|
262
|
+
*
|
|
263
|
+
* @param wabaId - The destination WABA ID
|
|
264
|
+
* @param data - The migration data including source_waba_id and optional source_flow_names
|
|
265
|
+
* @returns Promise with migration results
|
|
266
|
+
*/
|
|
267
|
+
migrateFlows(
|
|
268
|
+
wabaId: string,
|
|
269
|
+
data: {
|
|
270
|
+
source_waba_id: string;
|
|
271
|
+
source_flow_names?: string[];
|
|
272
|
+
},
|
|
273
|
+
): Promise<RequesterResponseInterface<FlowMigrationResponse>>;
|
|
274
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HttpMethodsEnum } from './enums';
|
|
2
|
+
|
|
3
|
+
export type ResponseHeaderValue = string | string[] | undefined;
|
|
4
|
+
|
|
5
|
+
export type ResponseHeaders = Record<string, ResponseHeaderValue>;
|
|
6
|
+
|
|
7
|
+
export type ResponseJSONBody = Record<string, unknown>;
|
|
8
|
+
|
|
9
|
+
export declare class HttpsClientResponseClass {
|
|
10
|
+
constructor(resp: Response);
|
|
11
|
+
statusCode: () => number;
|
|
12
|
+
headers: () => ResponseHeaders;
|
|
13
|
+
rawResponse: () => Response;
|
|
14
|
+
json: () => Promise<ResponseJSONBody>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare class HttpsClientClass {
|
|
18
|
+
constructor();
|
|
19
|
+
clearSockets: () => boolean;
|
|
20
|
+
sendRequest: (
|
|
21
|
+
host: string,
|
|
22
|
+
path: string,
|
|
23
|
+
method: HttpMethodsEnum,
|
|
24
|
+
headers: HeadersInit,
|
|
25
|
+
timeout: number,
|
|
26
|
+
body?: BodyInit | null,
|
|
27
|
+
) => Promise<HttpsClientResponseClass>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './config';
|
|
2
|
+
export * from './enums';
|
|
3
|
+
export * from './request';
|
|
4
|
+
export * from './base';
|
|
5
|
+
export * from './httpsClient';
|
|
6
|
+
export * from './logger';
|
|
7
|
+
export * from './messages';
|
|
8
|
+
export * from './whatsapp';
|
|
9
|
+
export * from './template';
|
|
10
|
+
export * from './phoneNumber';
|
|
11
|
+
export * from './registration';
|
|
12
|
+
export * from './twoStepVerification';
|
|
13
|
+
export * from './qrCode';
|
|
14
|
+
export * from './encryption';
|
|
15
|
+
export * from './waba';
|
|
16
|
+
export * from './media';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RequesterResponseInterface, ResponseSuccess } from './request';
|
|
2
|
+
|
|
3
|
+
export type MediaResponse = {
|
|
4
|
+
id: string;
|
|
5
|
+
url: string;
|
|
6
|
+
mime_type: string;
|
|
7
|
+
sha256: string;
|
|
8
|
+
file_size: number;
|
|
9
|
+
messaging_product: 'whatsapp';
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type MediasResponse = {
|
|
13
|
+
data: MediaResponse[];
|
|
14
|
+
paging: {
|
|
15
|
+
cursors: {
|
|
16
|
+
before: string;
|
|
17
|
+
after: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type UploadMediaResponse = {
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export interface MediaClass {
|
|
27
|
+
getMediaById(mediaId: string, phone_number_id?: string): Promise<RequesterResponseInterface<MediaResponse>>;
|
|
28
|
+
uploadMedia(file: File, messagingProduct?: string): Promise<RequesterResponseInterface<UploadMediaResponse>>;
|
|
29
|
+
deleteMedia(mediaId: string, phone_number_id?: string): Promise<RequesterResponseInterface<ResponseSuccess>>;
|
|
30
|
+
downloadMedia(mediaUrl: string): Promise<RequesterResponseInterface<Blob>>;
|
|
31
|
+
}
|