meta-cloud-api 1.0.0 → 1.0.2

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.
Files changed (138) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +405 -0
  3. package/dist/BusinessProfileApi-WXscSgo-.d.ts +353 -0
  4. package/dist/EncryptionApi-D7pt-OXT.d.ts +22 -0
  5. package/dist/FlowApi-B2ffO-HD.d.ts +136 -0
  6. package/dist/MediaApi-BrEKpqi_.d.ts +90 -0
  7. package/dist/MessageApi-BgsSpDno.d.ts +171 -0
  8. package/dist/PhoneNumberApi-DKlu9PHl.d.ts +142 -0
  9. package/dist/QrCodeApi-7vDwIBHR.d.ts +98 -0
  10. package/dist/RegistrationApi-qO_qoti9.d.ts +47 -0
  11. package/dist/TemplateApi-xGgIZt89.d.ts +161 -0
  12. package/dist/TwoStepVerificationApi-DfNPIz-C.d.ts +33 -0
  13. package/dist/WabaApi-DqQi_68m.d.ts +175 -0
  14. package/dist/WebhookProcessor-BXYunz4N.d.ts +707 -0
  15. package/dist/WhatsApp-pTZPQm81.d.ts +82 -0
  16. package/dist/api/encryption/index.d.ts +10 -0
  17. package/dist/api/encryption/index.js +2 -0
  18. package/dist/api/encryption/index.js.map +1 -0
  19. package/dist/api/flow/index.d.ts +10 -0
  20. package/dist/api/flow/index.js +2 -0
  21. package/dist/api/flow/index.js.map +1 -0
  22. package/dist/api/index.d.ts +17 -0
  23. package/dist/api/index.js +2 -0
  24. package/dist/api/index.js.map +1 -0
  25. package/dist/api/media/index.d.ts +10 -0
  26. package/dist/api/media/index.js +2 -0
  27. package/dist/api/media/index.js.map +1 -0
  28. package/dist/api/messages/builders/index.d.ts +536 -0
  29. package/dist/api/messages/builders/index.js +4 -0
  30. package/dist/api/messages/builders/index.js.map +1 -0
  31. package/dist/api/messages/index.d.ts +10 -0
  32. package/dist/api/messages/index.js +2 -0
  33. package/dist/api/messages/index.js.map +1 -0
  34. package/dist/api/phone/index.d.ts +10 -0
  35. package/dist/api/phone/index.js +2 -0
  36. package/dist/api/phone/index.js.map +1 -0
  37. package/dist/api/profile/index.d.ts +10 -0
  38. package/dist/api/profile/index.js +2 -0
  39. package/dist/api/profile/index.js.map +1 -0
  40. package/dist/api/qrCode/index.d.ts +10 -0
  41. package/dist/api/qrCode/index.js +2 -0
  42. package/dist/api/qrCode/index.js.map +1 -0
  43. package/dist/api/registration/index.d.ts +10 -0
  44. package/dist/api/registration/index.js +2 -0
  45. package/dist/api/registration/index.js.map +1 -0
  46. package/dist/api/template/index.d.ts +215 -0
  47. package/dist/api/template/index.js +2 -0
  48. package/dist/api/template/index.js.map +1 -0
  49. package/dist/api/twoStepVerification/index.d.ts +10 -0
  50. package/dist/api/twoStepVerification/index.js +2 -0
  51. package/dist/api/twoStepVerification/index.js.map +1 -0
  52. package/dist/api/waba/index.d.ts +10 -0
  53. package/dist/api/waba/index.js +2 -0
  54. package/dist/api/waba/index.js.map +1 -0
  55. package/dist/base-CdGDdVEl.d.ts +18 -0
  56. package/dist/chunk-7QBIZCJ4.js +2 -0
  57. package/dist/chunk-7QBIZCJ4.js.map +1 -0
  58. package/dist/chunk-AMHQGG6Z.js +2 -0
  59. package/dist/chunk-AMHQGG6Z.js.map +1 -0
  60. package/dist/chunk-BAOZ4U74.js +10 -0
  61. package/dist/chunk-BAOZ4U74.js.map +1 -0
  62. package/dist/chunk-CRZ7EUYR.js +2 -0
  63. package/dist/chunk-CRZ7EUYR.js.map +1 -0
  64. package/dist/chunk-FKXSL2JK.js +3 -0
  65. package/dist/chunk-FKXSL2JK.js.map +1 -0
  66. package/dist/chunk-FSKBLPGE.js +2 -0
  67. package/dist/chunk-FSKBLPGE.js.map +1 -0
  68. package/dist/chunk-IYSR44P6.js +2 -0
  69. package/dist/chunk-IYSR44P6.js.map +1 -0
  70. package/dist/chunk-JC6YMVID.js +2 -0
  71. package/dist/chunk-JC6YMVID.js.map +1 -0
  72. package/dist/chunk-JPAV644F.js +2 -0
  73. package/dist/chunk-JPAV644F.js.map +1 -0
  74. package/dist/chunk-JPGXONBQ.js +3 -0
  75. package/dist/chunk-JPGXONBQ.js.map +1 -0
  76. package/dist/chunk-JXCLRKQ7.js +2 -0
  77. package/dist/chunk-JXCLRKQ7.js.map +1 -0
  78. package/dist/chunk-KMAH6636.js +2 -0
  79. package/dist/chunk-KMAH6636.js.map +1 -0
  80. package/dist/chunk-L4ESAO2S.js +2 -0
  81. package/dist/chunk-L4ESAO2S.js.map +1 -0
  82. package/dist/chunk-LV3TULSI.js +2 -0
  83. package/dist/chunk-LV3TULSI.js.map +1 -0
  84. package/dist/chunk-MJEG3K4V.js +2 -0
  85. package/dist/chunk-MJEG3K4V.js.map +1 -0
  86. package/dist/chunk-NLF2JGYY.js +2 -0
  87. package/dist/chunk-NLF2JGYY.js.map +1 -0
  88. package/dist/chunk-NOJFGTRT.js +2 -0
  89. package/dist/chunk-NOJFGTRT.js.map +1 -0
  90. package/dist/chunk-PHPQ5HP3.js +2 -0
  91. package/dist/chunk-PHPQ5HP3.js.map +1 -0
  92. package/dist/chunk-RIL6QABY.js +2 -0
  93. package/dist/chunk-RIL6QABY.js.map +1 -0
  94. package/dist/chunk-RWCVPWRC.js +2 -0
  95. package/dist/chunk-RWCVPWRC.js.map +1 -0
  96. package/dist/chunk-SNNRWNGZ.js +2 -0
  97. package/dist/chunk-SNNRWNGZ.js.map +1 -0
  98. package/dist/chunk-VHAODWCN.js +2 -0
  99. package/dist/chunk-VHAODWCN.js.map +1 -0
  100. package/dist/chunk-WGGN32O2.js +2 -0
  101. package/dist/chunk-WGGN32O2.js.map +1 -0
  102. package/dist/chunk-YXZ4L2OK.js +2 -0
  103. package/dist/chunk-YXZ4L2OK.js.map +1 -0
  104. package/dist/common-BiRA_uz3.d.ts +425 -0
  105. package/dist/common-lV0NsO7t.d.ts +376 -0
  106. package/dist/core/webhook/frameworks/express.d.ts +49 -0
  107. package/dist/core/webhook/frameworks/express.js +2 -0
  108. package/dist/core/webhook/frameworks/express.js.map +1 -0
  109. package/dist/core/webhook/frameworks/nextjs.d.ts +45 -0
  110. package/dist/core/webhook/frameworks/nextjs.js +2 -0
  111. package/dist/core/webhook/frameworks/nextjs.js.map +1 -0
  112. package/dist/core/webhook/index.d.ts +27 -0
  113. package/dist/core/webhook/index.js +2 -0
  114. package/dist/core/webhook/index.js.map +1 -0
  115. package/dist/core/whatsapp/index.d.ts +41 -0
  116. package/dist/core/whatsapp/index.js +2 -0
  117. package/dist/core/whatsapp/index.js.map +1 -0
  118. package/dist/enums-BZd9T2ul.d.ts +707 -0
  119. package/dist/flowTypeGuards-B5hBzkZ4.d.ts +43 -0
  120. package/dist/httpsClient-v4gmltzS.d.ts +19 -0
  121. package/dist/index.d.ts +24 -0
  122. package/dist/index.js +2 -0
  123. package/dist/index.js.map +1 -0
  124. package/dist/logger-BdE0Vyim.d.ts +9 -0
  125. package/dist/request-vYMaEfk5.d.ts +50 -0
  126. package/dist/types/config.d.ts +78 -0
  127. package/dist/types/config.js +2 -0
  128. package/dist/types/config.js.map +1 -0
  129. package/dist/types/enums.d.ts +1 -0
  130. package/dist/types/enums.js +2 -0
  131. package/dist/types/enums.js.map +1 -0
  132. package/dist/types/index.d.ts +6 -0
  133. package/dist/types/index.js +2 -0
  134. package/dist/types/index.js.map +1 -0
  135. package/dist/utils/index.d.ts +59 -0
  136. package/dist/utils/index.js +2 -0
  137. package/dist/utils/index.js.map +1 -0
  138. package/package.json +247 -8
@@ -0,0 +1,175 @@
1
+ import { B as BaseAPI } from './base-CdGDdVEl.js';
2
+ import { WabaConfigType } from './types/config.js';
3
+ import { e as ResponseSuccess, R as RequesterClass } from './request-vYMaEfk5.js';
4
+
5
+ /**
6
+ * WhatsApp Business Account subscription configuration
7
+ */
8
+ type WabaSubscription = {
9
+ whatsapp_business_api_data: {
10
+ id: string;
11
+ link: string;
12
+ name: string;
13
+ category: string;
14
+ };
15
+ override_callback_uri?: string;
16
+ };
17
+ /**
18
+ * Parameters for updating WABA subscription
19
+ */
20
+ interface UpdateWabaSubscription {
21
+ override_callback_uri: string;
22
+ verify_token: string;
23
+ }
24
+ /**
25
+ * Response containing all WABA subscriptions
26
+ */
27
+ interface WabaSubscriptions {
28
+ data: Array<WabaSubscription>;
29
+ }
30
+ /**
31
+ * WABA account review status enumeration
32
+ */
33
+ declare enum WabaAccountReviewStatus {
34
+ Approved = "APPROVED",
35
+ Active = "ACTIVE",
36
+ Inactive = "INACTIVE",
37
+ Disabled = "DISABLED"
38
+ }
39
+ /**
40
+ * WABA health status for message sending capability
41
+ */
42
+ declare enum WabaHealthStatusCanSendMessage {
43
+ Blocked = "BLOCKED",
44
+ Limited = "LIMITED",
45
+ Available = "AVAILABLE"
46
+ }
47
+ /**
48
+ * WABA account status enumeration
49
+ */
50
+ declare enum WabaAccountStatus {
51
+ Approved = "APPROVED",
52
+ Active = "ACTIVE",
53
+ Inactive = "INACTIVE",
54
+ Disabled = "DISABLED"
55
+ }
56
+ /**
57
+ * Business verification status enumeration
58
+ */
59
+ declare enum WabaBusinessVerificationStatus {
60
+ Verified = "verified",
61
+ PendingSubmission = "pending_submission",
62
+ Unverified = "unverified",
63
+ Rejected = "rejected"
64
+ }
65
+ /**
66
+ * WABA health status error details
67
+ */
68
+ interface WabaHealthStatusError {
69
+ error_code?: number;
70
+ error_description?: string;
71
+ possible_solution?: string;
72
+ }
73
+ /**
74
+ * WABA health status entity information
75
+ */
76
+ interface WabaHealthStatusEntity {
77
+ entity_type?: string;
78
+ id?: string;
79
+ can_send_message?: string;
80
+ errors?: WabaHealthStatusError[];
81
+ }
82
+ /**
83
+ * Overall WABA health status
84
+ */
85
+ interface WabaHealthStatus {
86
+ can_send_message?: WabaHealthStatusCanSendMessage;
87
+ entities?: WabaHealthStatusEntity[];
88
+ }
89
+ /**
90
+ * WhatsApp Business Account information
91
+ */
92
+ interface WabaAccount {
93
+ account_review_status?: WabaAccountReviewStatus;
94
+ id?: string;
95
+ health_status?: WabaHealthStatus;
96
+ status?: WabaAccountStatus;
97
+ business_verification_status?: WabaBusinessVerificationStatus;
98
+ message_template_namespace?: string;
99
+ name?: string;
100
+ ownership_type?: string;
101
+ currency?: string;
102
+ }
103
+ /**
104
+ * Available fields for WABA account queries
105
+ */
106
+ type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
107
+ /**
108
+ * Parameter type for specifying which WABA account fields to retrieve
109
+ */
110
+ type WabaAccountFieldsParam = WabaAccountFields[];
111
+ /**
112
+ * Interface defining all WABA API methods
113
+ */
114
+ interface WABAClass {
115
+ getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
116
+ getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
117
+ updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
118
+ unsubscribeFromWaba(): Promise<ResponseSuccess>;
119
+ }
120
+
121
+ /**
122
+ * API for managing WhatsApp Business Account (WABA).
123
+ *
124
+ * This API allows you to:
125
+ * - Get WABA account information
126
+ * - Manage WABA subscriptions
127
+ * - Subscribe/unsubscribe from WABA webhooks
128
+ * - Update subscription settings
129
+ */
130
+ declare class WabaApi extends BaseAPI implements WABAClass {
131
+ constructor(config: WabaConfigType, client: RequesterClass);
132
+ /**
133
+ * Retrieve WhatsApp Business Account information.
134
+ *
135
+ * @param fields Optional array of specific fields to retrieve
136
+ * @returns WABA account information including status, health, verification status, etc.
137
+ *
138
+ * @example
139
+ * const account = await whatsappClient.waba.getWabaAccount(['id', 'name', 'status']);
140
+ */
141
+ getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
142
+ /**
143
+ * Get all WABA subscriptions for the business account.
144
+ *
145
+ * @returns List of all subscribed apps and their configurations
146
+ *
147
+ * @example
148
+ * const subscriptions = await whatsappClient.waba.getAllWabaSubscriptions();
149
+ */
150
+ getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
151
+ /**
152
+ * Update WABA subscription configuration.
153
+ *
154
+ * @param params Configuration parameters including callback URI and verify token
155
+ * @returns Response indicating success or failure
156
+ *
157
+ * @example
158
+ * await whatsappClient.waba.updateWabaSubscription({
159
+ * override_callback_uri: 'https://example.com/webhook',
160
+ * verify_token: 'your_verify_token'
161
+ * });
162
+ */
163
+ updateWabaSubscription({ override_callback_uri, verify_token, }: UpdateWabaSubscription): Promise<ResponseSuccess>;
164
+ /**
165
+ * Unsubscribe from WABA webhooks.
166
+ *
167
+ * @returns Response indicating success or failure
168
+ *
169
+ * @example
170
+ * await whatsappClient.waba.unsubscribeFromWaba();
171
+ */
172
+ unsubscribeFromWaba(): Promise<ResponseSuccess>;
173
+ }
174
+
175
+ export { type UpdateWabaSubscription as U, WabaApi as W, type WabaAccount as a, type WABAClass as b, type WabaSubscriptions as c };