@relayapi/sdk 0.2.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 (242) hide show
  1. package/dist/api-promise.d.ts +2 -0
  2. package/dist/api-promise.js +18 -0
  3. package/dist/client.d.ts +225 -0
  4. package/dist/client.js +552 -0
  5. package/dist/core/api-promise.d.ts +45 -0
  6. package/dist/core/api-promise.js +83 -0
  7. package/dist/core/error.d.ts +45 -0
  8. package/dist/core/error.js +112 -0
  9. package/dist/core/resource.d.ts +5 -0
  10. package/dist/core/resource.js +10 -0
  11. package/dist/core/uploads.d.ts +2 -0
  12. package/dist/core/uploads.js +5 -0
  13. package/dist/error.d.ts +2 -0
  14. package/dist/error.js +18 -0
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.js +26 -0
  17. package/dist/internal/builtin-types.d.ts +72 -0
  18. package/dist/internal/builtin-types.js +3 -0
  19. package/dist/internal/detect-platform.d.ts +14 -0
  20. package/dist/internal/detect-platform.js +161 -0
  21. package/dist/internal/errors.d.ts +2 -0
  22. package/dist/internal/errors.js +40 -0
  23. package/dist/internal/headers.d.ts +19 -0
  24. package/dist/internal/headers.js +78 -0
  25. package/dist/internal/parse.d.ts +11 -0
  26. package/dist/internal/parse.js +39 -0
  27. package/dist/internal/request-options.d.ts +74 -0
  28. package/dist/internal/request-options.js +13 -0
  29. package/dist/internal/shim-types.d.ts +16 -0
  30. package/dist/internal/shim-types.js +3 -0
  31. package/dist/internal/shims.d.ts +23 -0
  32. package/dist/internal/shims.js +90 -0
  33. package/dist/internal/to-file.d.ts +44 -0
  34. package/dist/internal/to-file.js +90 -0
  35. package/dist/internal/types.d.ts +68 -0
  36. package/dist/internal/types.js +3 -0
  37. package/dist/internal/uploads.d.ts +41 -0
  38. package/dist/internal/uploads.js +140 -0
  39. package/dist/internal/utils/base64.d.ts +2 -0
  40. package/dist/internal/utils/base64.js +37 -0
  41. package/dist/internal/utils/bytes.d.ts +3 -0
  42. package/dist/internal/utils/bytes.js +30 -0
  43. package/dist/internal/utils/env.d.ts +8 -0
  44. package/dist/internal/utils/env.js +21 -0
  45. package/dist/internal/utils/log.d.ts +36 -0
  46. package/dist/internal/utils/log.js +84 -0
  47. package/dist/internal/utils/path.d.ts +14 -0
  48. package/dist/internal/utils/path.js +78 -0
  49. package/dist/internal/utils/query.d.ts +4 -0
  50. package/dist/internal/utils/query.js +22 -0
  51. package/dist/internal/utils/sleep.d.ts +1 -0
  52. package/dist/internal/utils/sleep.js +6 -0
  53. package/dist/internal/utils/uuid.d.ts +4 -0
  54. package/dist/internal/utils/uuid.js +18 -0
  55. package/dist/internal/utils/values.d.ts +17 -0
  56. package/dist/internal/utils/values.js +111 -0
  57. package/dist/internal/utils.d.ts +7 -0
  58. package/dist/internal/utils.js +24 -0
  59. package/dist/resource.d.ts +2 -0
  60. package/dist/resource.js +18 -0
  61. package/dist/resources/account-groups.d.ts +52 -0
  62. package/dist/resources/account-groups.js +37 -0
  63. package/dist/resources/accounts/accounts.d.ts +148 -0
  64. package/dist/resources/accounts/accounts.js +101 -0
  65. package/dist/resources/accounts/facebook-pages.d.ts +48 -0
  66. package/dist/resources/accounts/facebook-pages.js +21 -0
  67. package/dist/resources/accounts/gmb-locations.d.ts +48 -0
  68. package/dist/resources/accounts/gmb-locations.js +21 -0
  69. package/dist/resources/accounts/health.d.ts +49 -0
  70. package/dist/resources/accounts/health.js +21 -0
  71. package/dist/resources/accounts/index.d.ts +8 -0
  72. package/dist/resources/accounts/index.js +20 -0
  73. package/dist/resources/accounts/linkedin-organizations.d.ts +52 -0
  74. package/dist/resources/accounts/linkedin-organizations.js +21 -0
  75. package/dist/resources/accounts/pinterest-boards.d.ts +48 -0
  76. package/dist/resources/accounts/pinterest-boards.js +21 -0
  77. package/dist/resources/accounts/reddit-flairs.d.ts +27 -0
  78. package/dist/resources/accounts/reddit-flairs.js +15 -0
  79. package/dist/resources/accounts/reddit-subreddits.d.ts +48 -0
  80. package/dist/resources/accounts/reddit-subreddits.js +21 -0
  81. package/dist/resources/accounts.d.ts +1 -0
  82. package/dist/resources/accounts.js +18 -0
  83. package/dist/resources/analytics/analytics.d.ts +369 -0
  84. package/dist/resources/analytics/analytics.js +84 -0
  85. package/dist/resources/analytics/index.d.ts +2 -0
  86. package/dist/resources/analytics/index.js +8 -0
  87. package/dist/resources/analytics/youtube.d.ts +49 -0
  88. package/dist/resources/analytics/youtube.js +14 -0
  89. package/dist/resources/analytics.d.ts +1 -0
  90. package/dist/resources/analytics.js +18 -0
  91. package/dist/resources/api-keys.d.ts +110 -0
  92. package/dist/resources/api-keys.js +32 -0
  93. package/dist/resources/connect/connect.d.ts +188 -0
  94. package/dist/resources/connect/connect.js +97 -0
  95. package/dist/resources/connect/facebook/facebook.d.ts +9 -0
  96. package/dist/resources/connect/facebook/facebook.js +48 -0
  97. package/dist/resources/connect/facebook/index.d.ts +2 -0
  98. package/dist/resources/connect/facebook/index.js +8 -0
  99. package/dist/resources/connect/facebook/pages.d.ts +70 -0
  100. package/dist/resources/connect/facebook/pages.js +20 -0
  101. package/dist/resources/connect/facebook.d.ts +1 -0
  102. package/dist/resources/connect/facebook.js +18 -0
  103. package/dist/resources/connect/googlebusiness/googlebusiness.d.ts +9 -0
  104. package/dist/resources/connect/googlebusiness/googlebusiness.js +48 -0
  105. package/dist/resources/connect/googlebusiness/index.d.ts +2 -0
  106. package/dist/resources/connect/googlebusiness/index.js +8 -0
  107. package/dist/resources/connect/googlebusiness/locations.d.ts +70 -0
  108. package/dist/resources/connect/googlebusiness/locations.js +20 -0
  109. package/dist/resources/connect/googlebusiness.d.ts +1 -0
  110. package/dist/resources/connect/googlebusiness.js +18 -0
  111. package/dist/resources/connect/index.d.ts +8 -0
  112. package/dist/resources/connect/index.js +20 -0
  113. package/dist/resources/connect/linkedin/index.d.ts +2 -0
  114. package/dist/resources/connect/linkedin/index.js +8 -0
  115. package/dist/resources/connect/linkedin/linkedin.d.ts +9 -0
  116. package/dist/resources/connect/linkedin/linkedin.js +48 -0
  117. package/dist/resources/connect/linkedin/organizations.d.ts +85 -0
  118. package/dist/resources/connect/linkedin/organizations.js +20 -0
  119. package/dist/resources/connect/linkedin.d.ts +1 -0
  120. package/dist/resources/connect/linkedin.js +18 -0
  121. package/dist/resources/connect/pinterest/boards.d.ts +70 -0
  122. package/dist/resources/connect/pinterest/boards.js +20 -0
  123. package/dist/resources/connect/pinterest/index.d.ts +2 -0
  124. package/dist/resources/connect/pinterest/index.js +8 -0
  125. package/dist/resources/connect/pinterest/pinterest.d.ts +9 -0
  126. package/dist/resources/connect/pinterest/pinterest.js +48 -0
  127. package/dist/resources/connect/pinterest.d.ts +1 -0
  128. package/dist/resources/connect/pinterest.js +18 -0
  129. package/dist/resources/connect/snapchat/index.d.ts +2 -0
  130. package/dist/resources/connect/snapchat/index.js +8 -0
  131. package/dist/resources/connect/snapchat/profiles.d.ts +74 -0
  132. package/dist/resources/connect/snapchat/profiles.js +20 -0
  133. package/dist/resources/connect/snapchat/snapchat.d.ts +9 -0
  134. package/dist/resources/connect/snapchat/snapchat.js +48 -0
  135. package/dist/resources/connect/snapchat.d.ts +1 -0
  136. package/dist/resources/connect/snapchat.js +18 -0
  137. package/dist/resources/connect/telegram.d.ts +122 -0
  138. package/dist/resources/connect/telegram.js +26 -0
  139. package/dist/resources/connect/whatsapp.d.ts +92 -0
  140. package/dist/resources/connect/whatsapp.js +26 -0
  141. package/dist/resources/connect.d.ts +1 -0
  142. package/dist/resources/connect.js +18 -0
  143. package/dist/resources/connections.d.ts +55 -0
  144. package/dist/resources/connections.js +14 -0
  145. package/dist/resources/inbox/comments/comments.d.ts +220 -0
  146. package/dist/resources/inbox/comments/comments.js +83 -0
  147. package/dist/resources/inbox/comments/hide.d.ts +36 -0
  148. package/dist/resources/inbox/comments/hide.js +21 -0
  149. package/dist/resources/inbox/comments/index.d.ts +3 -0
  150. package/dist/resources/inbox/comments/index.js +10 -0
  151. package/dist/resources/inbox/comments/like.d.ts +36 -0
  152. package/dist/resources/inbox/comments/like.js +21 -0
  153. package/dist/resources/inbox/comments.d.ts +1 -0
  154. package/dist/resources/inbox/comments.js +18 -0
  155. package/dist/resources/inbox/inbox.d.ts +17 -0
  156. package/dist/resources/inbox/inbox.js +56 -0
  157. package/dist/resources/inbox/index.d.ts +4 -0
  158. package/dist/resources/inbox/index.js +12 -0
  159. package/dist/resources/inbox/messages.d.ts +205 -0
  160. package/dist/resources/inbox/messages.js +40 -0
  161. package/dist/resources/inbox/reviews/index.d.ts +2 -0
  162. package/dist/resources/inbox/reviews/index.js +8 -0
  163. package/dist/resources/inbox/reviews/reply.d.ts +38 -0
  164. package/dist/resources/inbox/reviews/reply.js +21 -0
  165. package/dist/resources/inbox/reviews/reviews.d.ts +76 -0
  166. package/dist/resources/inbox/reviews/reviews.js +54 -0
  167. package/dist/resources/inbox/reviews.d.ts +1 -0
  168. package/dist/resources/inbox/reviews.js +18 -0
  169. package/dist/resources/inbox.d.ts +1 -0
  170. package/dist/resources/inbox.js +18 -0
  171. package/dist/resources/index.d.ts +16 -0
  172. package/dist/resources/index.js +36 -0
  173. package/dist/resources/media.d.ts +177 -0
  174. package/dist/resources/media.js +51 -0
  175. package/dist/resources/posts/index.d.ts +2 -0
  176. package/dist/resources/posts/index.js +8 -0
  177. package/dist/resources/posts/logs.d.ts +134 -0
  178. package/dist/resources/posts/logs.js +31 -0
  179. package/dist/resources/posts/posts.d.ts +607 -0
  180. package/dist/resources/posts/posts.js +149 -0
  181. package/dist/resources/posts.d.ts +1 -0
  182. package/dist/resources/posts.js +18 -0
  183. package/dist/resources/queue/index.d.ts +2 -0
  184. package/dist/resources/queue/index.js +8 -0
  185. package/dist/resources/queue/queue.d.ts +42 -0
  186. package/dist/resources/queue/queue.js +60 -0
  187. package/dist/resources/queue/slots.d.ts +215 -0
  188. package/dist/resources/queue/slots.js +36 -0
  189. package/dist/resources/queue.d.ts +1 -0
  190. package/dist/resources/queue.js +18 -0
  191. package/dist/resources/reddit.d.ts +186 -0
  192. package/dist/resources/reddit.js +20 -0
  193. package/dist/resources/tools/index.d.ts +3 -0
  194. package/dist/resources/tools/index.js +10 -0
  195. package/dist/resources/tools/instagram.d.ts +41 -0
  196. package/dist/resources/tools/instagram.js +22 -0
  197. package/dist/resources/tools/tools.d.ts +13 -0
  198. package/dist/resources/tools/tools.js +52 -0
  199. package/dist/resources/tools/validate.d.ts +689 -0
  200. package/dist/resources/tools/validate.js +63 -0
  201. package/dist/resources/tools.d.ts +1 -0
  202. package/dist/resources/tools.js +18 -0
  203. package/dist/resources/twitter/bookmark.d.ts +48 -0
  204. package/dist/resources/twitter/bookmark.js +20 -0
  205. package/dist/resources/twitter/follow.d.ts +48 -0
  206. package/dist/resources/twitter/follow.js +20 -0
  207. package/dist/resources/twitter/index.d.ts +4 -0
  208. package/dist/resources/twitter/index.js +12 -0
  209. package/dist/resources/twitter/retweet.d.ts +48 -0
  210. package/dist/resources/twitter/retweet.js +20 -0
  211. package/dist/resources/twitter/twitter.d.ts +17 -0
  212. package/dist/resources/twitter/twitter.js +56 -0
  213. package/dist/resources/twitter.d.ts +1 -0
  214. package/dist/resources/twitter.js +18 -0
  215. package/dist/resources/usage.d.ts +97 -0
  216. package/dist/resources/usage.js +14 -0
  217. package/dist/resources/webhooks.d.ts +205 -0
  218. package/dist/resources/webhooks.js +50 -0
  219. package/dist/resources/whatsapp/broadcasts.d.ts +291 -0
  220. package/dist/resources/whatsapp/broadcasts.js +49 -0
  221. package/dist/resources/whatsapp/business-profile.d.ts +85 -0
  222. package/dist/resources/whatsapp/business-profile.js +20 -0
  223. package/dist/resources/whatsapp/contacts.d.ts +250 -0
  224. package/dist/resources/whatsapp/contacts.js +49 -0
  225. package/dist/resources/whatsapp/groups.d.ts +87 -0
  226. package/dist/resources/whatsapp/groups.js +31 -0
  227. package/dist/resources/whatsapp/index.d.ts +6 -0
  228. package/dist/resources/whatsapp/index.js +16 -0
  229. package/dist/resources/whatsapp/templates.d.ts +250 -0
  230. package/dist/resources/whatsapp/templates.js +39 -0
  231. package/dist/resources/whatsapp/whatsapp.d.ts +148 -0
  232. package/dist/resources/whatsapp/whatsapp.js +76 -0
  233. package/dist/resources/whatsapp.d.ts +1 -0
  234. package/dist/resources/whatsapp.js +18 -0
  235. package/dist/resources.d.ts +1 -0
  236. package/dist/resources.js +17 -0
  237. package/dist/uploads.d.ts +2 -0
  238. package/dist/uploads.js +18 -0
  239. package/dist/version.d.ts +1 -0
  240. package/dist/version.js +5 -0
  241. package/package.json +28 -0
  242. package/src/index.ts +22 -0
@@ -0,0 +1,250 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import { APIPromise } from '../../core/api-promise';
3
+ import { RequestOptions } from '../../internal/request-options';
4
+ export declare class Contacts extends APIResource {
5
+ /**
6
+ * Create a contact
7
+ */
8
+ create(body: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse>;
9
+ /**
10
+ * Get contact details
11
+ */
12
+ retrieve(contactID: string, options?: RequestOptions): APIPromise<ContactRetrieveResponse>;
13
+ /**
14
+ * List contacts
15
+ */
16
+ list(query: ContactListParams, options?: RequestOptions): APIPromise<ContactListResponse>;
17
+ /**
18
+ * Delete a contact
19
+ */
20
+ delete(contactID: string, options?: RequestOptions): APIPromise<void>;
21
+ /**
22
+ * Bulk contact operations (add/remove tags, delete)
23
+ */
24
+ bulkOperations(body: ContactBulkOperationsParams, options?: RequestOptions): APIPromise<ContactBulkOperationsResponse>;
25
+ /**
26
+ * Bulk import contacts
27
+ */
28
+ import(body: ContactImportParams, options?: RequestOptions): APIPromise<ContactImportResponse>;
29
+ }
30
+ export interface ContactCreateResponse {
31
+ /**
32
+ * Contact ID
33
+ */
34
+ id: string;
35
+ /**
36
+ * Created timestamp
37
+ */
38
+ created_at: string;
39
+ /**
40
+ * Whether contact has opted in
41
+ */
42
+ opted_in: boolean;
43
+ /**
44
+ * Phone number
45
+ */
46
+ phone: string;
47
+ /**
48
+ * Email address
49
+ */
50
+ email?: string | null;
51
+ /**
52
+ * Group IDs
53
+ */
54
+ groups?: Array<string>;
55
+ /**
56
+ * Contact name
57
+ */
58
+ name?: string | null;
59
+ /**
60
+ * Tags
61
+ */
62
+ tags?: Array<string>;
63
+ }
64
+ export interface ContactRetrieveResponse {
65
+ /**
66
+ * Contact ID
67
+ */
68
+ id: string;
69
+ /**
70
+ * Created timestamp
71
+ */
72
+ created_at: string;
73
+ /**
74
+ * Whether contact has opted in
75
+ */
76
+ opted_in: boolean;
77
+ /**
78
+ * Phone number
79
+ */
80
+ phone: string;
81
+ /**
82
+ * Email address
83
+ */
84
+ email?: string | null;
85
+ /**
86
+ * Group IDs
87
+ */
88
+ groups?: Array<string>;
89
+ /**
90
+ * Contact name
91
+ */
92
+ name?: string | null;
93
+ /**
94
+ * Tags
95
+ */
96
+ tags?: Array<string>;
97
+ }
98
+ export interface ContactListResponse {
99
+ data: Array<ContactListResponse.Data>;
100
+ /**
101
+ * Whether more items exist
102
+ */
103
+ has_more: boolean;
104
+ /**
105
+ * Cursor for next page
106
+ */
107
+ next_cursor: string | null;
108
+ }
109
+ export declare namespace ContactListResponse {
110
+ interface Data {
111
+ /**
112
+ * Contact ID
113
+ */
114
+ id: string;
115
+ /**
116
+ * Created timestamp
117
+ */
118
+ created_at: string;
119
+ /**
120
+ * Whether contact has opted in
121
+ */
122
+ opted_in: boolean;
123
+ /**
124
+ * Phone number
125
+ */
126
+ phone: string;
127
+ /**
128
+ * Email address
129
+ */
130
+ email?: string | null;
131
+ /**
132
+ * Group IDs
133
+ */
134
+ groups?: Array<string>;
135
+ /**
136
+ * Contact name
137
+ */
138
+ name?: string | null;
139
+ /**
140
+ * Tags
141
+ */
142
+ tags?: Array<string>;
143
+ }
144
+ }
145
+ export interface ContactBulkOperationsResponse {
146
+ /**
147
+ * Number of contacts affected
148
+ */
149
+ affected: number;
150
+ }
151
+ export interface ContactImportResponse {
152
+ /**
153
+ * Failed count
154
+ */
155
+ failed: number;
156
+ /**
157
+ * Successfully imported count
158
+ */
159
+ imported: number;
160
+ /**
161
+ * Skipped (duplicate) count
162
+ */
163
+ skipped: number;
164
+ }
165
+ export interface ContactCreateParams {
166
+ /**
167
+ * WhatsApp account ID
168
+ */
169
+ account_id: string;
170
+ /**
171
+ * Phone number in E.164 format
172
+ */
173
+ phone: string;
174
+ /**
175
+ * Email address
176
+ */
177
+ email?: string;
178
+ /**
179
+ * Contact name
180
+ */
181
+ name?: string;
182
+ /**
183
+ * Tags
184
+ */
185
+ tags?: Array<string>;
186
+ }
187
+ export interface ContactListParams {
188
+ /**
189
+ * WhatsApp account ID
190
+ */
191
+ account_id: string;
192
+ /**
193
+ * Pagination cursor
194
+ */
195
+ cursor?: string;
196
+ /**
197
+ * Number of items
198
+ */
199
+ limit?: number;
200
+ /**
201
+ * Search by name or phone
202
+ */
203
+ search?: string;
204
+ /**
205
+ * Filter by tag
206
+ */
207
+ tag?: string;
208
+ }
209
+ export interface ContactBulkOperationsParams {
210
+ /**
211
+ * WhatsApp account ID
212
+ */
213
+ account_id: string;
214
+ /**
215
+ * Action
216
+ */
217
+ action: 'add_tags' | 'remove_tags' | 'delete';
218
+ /**
219
+ * Contact IDs
220
+ */
221
+ contact_ids: Array<string>;
222
+ /**
223
+ * Tags (for tag actions)
224
+ */
225
+ tags?: Array<string>;
226
+ }
227
+ export interface ContactImportParams {
228
+ /**
229
+ * WhatsApp account ID
230
+ */
231
+ account_id: string;
232
+ /**
233
+ * Contacts to import
234
+ */
235
+ contacts: Array<ContactImportParams.Contact>;
236
+ }
237
+ export declare namespace ContactImportParams {
238
+ interface Contact {
239
+ /**
240
+ * Phone number
241
+ */
242
+ phone: string;
243
+ email?: string;
244
+ name?: string;
245
+ tags?: Array<string>;
246
+ }
247
+ }
248
+ export declare namespace Contacts {
249
+ export { type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactListResponse as ContactListResponse, type ContactBulkOperationsResponse as ContactBulkOperationsResponse, type ContactImportResponse as ContactImportResponse, type ContactCreateParams as ContactCreateParams, type ContactListParams as ContactListParams, type ContactBulkOperationsParams as ContactBulkOperationsParams, type ContactImportParams as ContactImportParams, };
250
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Contacts = void 0;
5
+ const resource_1 = require("../../core/resource");
6
+ const headers_1 = require("../../internal/headers");
7
+ const path_1 = require("../../internal/utils/path");
8
+ class Contacts extends resource_1.APIResource {
9
+ /**
10
+ * Create a contact
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/v1/whatsapp/contacts', { body, ...options });
14
+ }
15
+ /**
16
+ * Get contact details
17
+ */
18
+ retrieve(contactID, options) {
19
+ return this._client.get((0, path_1.path) `/v1/whatsapp/contacts/${contactID}`, options);
20
+ }
21
+ /**
22
+ * List contacts
23
+ */
24
+ list(query, options) {
25
+ return this._client.get('/v1/whatsapp/contacts', { query, ...options });
26
+ }
27
+ /**
28
+ * Delete a contact
29
+ */
30
+ delete(contactID, options) {
31
+ return this._client.delete((0, path_1.path) `/v1/whatsapp/contacts/${contactID}`, {
32
+ ...options,
33
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
34
+ });
35
+ }
36
+ /**
37
+ * Bulk contact operations (add/remove tags, delete)
38
+ */
39
+ bulkOperations(body, options) {
40
+ return this._client.post('/v1/whatsapp/contacts/bulk', { body, ...options });
41
+ }
42
+ /**
43
+ * Bulk import contacts
44
+ */
45
+ import(body, options) {
46
+ return this._client.post('/v1/whatsapp/contacts/import', { body, ...options });
47
+ }
48
+ }
49
+ exports.Contacts = Contacts;
@@ -0,0 +1,87 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import { APIPromise } from '../../core/api-promise';
3
+ import { RequestOptions } from '../../internal/request-options';
4
+ export declare class Groups extends APIResource {
5
+ /**
6
+ * Create a contact group
7
+ */
8
+ create(body: GroupCreateParams, options?: RequestOptions): APIPromise<GroupCreateResponse>;
9
+ /**
10
+ * List contact groups
11
+ */
12
+ list(query: GroupListParams, options?: RequestOptions): APIPromise<GroupListResponse>;
13
+ /**
14
+ * Delete a contact group
15
+ */
16
+ delete(groupID: string, options?: RequestOptions): APIPromise<void>;
17
+ }
18
+ export interface GroupCreateResponse {
19
+ /**
20
+ * Group ID
21
+ */
22
+ id: string;
23
+ /**
24
+ * Number of contacts
25
+ */
26
+ contact_count: number;
27
+ /**
28
+ * Created timestamp
29
+ */
30
+ created_at: string;
31
+ /**
32
+ * Group name
33
+ */
34
+ name: string;
35
+ description?: string | null;
36
+ }
37
+ export interface GroupListResponse {
38
+ data: Array<GroupListResponse.Data>;
39
+ }
40
+ export declare namespace GroupListResponse {
41
+ interface Data {
42
+ /**
43
+ * Group ID
44
+ */
45
+ id: string;
46
+ /**
47
+ * Number of contacts
48
+ */
49
+ contact_count: number;
50
+ /**
51
+ * Created timestamp
52
+ */
53
+ created_at: string;
54
+ /**
55
+ * Group name
56
+ */
57
+ name: string;
58
+ description?: string | null;
59
+ }
60
+ }
61
+ export interface GroupCreateParams {
62
+ /**
63
+ * WhatsApp account ID
64
+ */
65
+ account_id: string;
66
+ /**
67
+ * Group name
68
+ */
69
+ name: string;
70
+ /**
71
+ * Initial contact IDs
72
+ */
73
+ contact_ids?: Array<string>;
74
+ /**
75
+ * Group description
76
+ */
77
+ description?: string;
78
+ }
79
+ export interface GroupListParams {
80
+ /**
81
+ * WhatsApp account ID
82
+ */
83
+ account_id: string;
84
+ }
85
+ export declare namespace Groups {
86
+ export { type GroupCreateResponse as GroupCreateResponse, type GroupListResponse as GroupListResponse, type GroupCreateParams as GroupCreateParams, type GroupListParams as GroupListParams, };
87
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Groups = void 0;
5
+ const resource_1 = require("../../core/resource");
6
+ const headers_1 = require("../../internal/headers");
7
+ const path_1 = require("../../internal/utils/path");
8
+ class Groups extends resource_1.APIResource {
9
+ /**
10
+ * Create a contact group
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/v1/whatsapp/groups', { body, ...options });
14
+ }
15
+ /**
16
+ * List contact groups
17
+ */
18
+ list(query, options) {
19
+ return this._client.get('/v1/whatsapp/groups', { query, ...options });
20
+ }
21
+ /**
22
+ * Delete a contact group
23
+ */
24
+ delete(groupID, options) {
25
+ return this._client.delete((0, path_1.path) `/v1/whatsapp/groups/${groupID}`, {
26
+ ...options,
27
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
28
+ });
29
+ }
30
+ }
31
+ exports.Groups = Groups;
@@ -0,0 +1,6 @@
1
+ export { Broadcasts, type BroadcastCreateResponse, type BroadcastRetrieveResponse, type BroadcastListResponse, type BroadcastScheduleResponse, type BroadcastSendResponse, type BroadcastCreateParams, type BroadcastListParams, } from './broadcasts';
2
+ export { BusinessProfile, type BusinessProfileRetrieveResponse, type BusinessProfileUpdateResponse, type BusinessProfileRetrieveParams, type BusinessProfileUpdateParams, } from './business-profile';
3
+ export { Contacts, type ContactCreateResponse, type ContactRetrieveResponse, type ContactListResponse, type ContactBulkOperationsResponse, type ContactImportResponse, type ContactCreateParams, type ContactListParams, type ContactBulkOperationsParams, type ContactImportParams, } from './contacts';
4
+ export { Groups, type GroupCreateResponse, type GroupListResponse, type GroupCreateParams, type GroupListParams, } from './groups';
5
+ export { Templates, type TemplateCreateResponse, type TemplateRetrieveResponse, type TemplateListResponse, type TemplateCreateParams, type TemplateRetrieveParams, type TemplateListParams, type TemplateDeleteParams, } from './templates';
6
+ export { Whatsapp, type WhatsappBulkSendResponse, type WhatsappListPhoneNumbersResponse, type WhatsappBulkSendParams, type WhatsappListPhoneNumbersParams, } from './whatsapp';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Whatsapp = exports.Templates = exports.Groups = exports.Contacts = exports.BusinessProfile = exports.Broadcasts = void 0;
5
+ var broadcasts_1 = require("./broadcasts");
6
+ Object.defineProperty(exports, "Broadcasts", { enumerable: true, get: function () { return broadcasts_1.Broadcasts; } });
7
+ var business_profile_1 = require("./business-profile");
8
+ Object.defineProperty(exports, "BusinessProfile", { enumerable: true, get: function () { return business_profile_1.BusinessProfile; } });
9
+ var contacts_1 = require("./contacts");
10
+ Object.defineProperty(exports, "Contacts", { enumerable: true, get: function () { return contacts_1.Contacts; } });
11
+ var groups_1 = require("./groups");
12
+ Object.defineProperty(exports, "Groups", { enumerable: true, get: function () { return groups_1.Groups; } });
13
+ var templates_1 = require("./templates");
14
+ Object.defineProperty(exports, "Templates", { enumerable: true, get: function () { return templates_1.Templates; } });
15
+ var whatsapp_1 = require("./whatsapp");
16
+ Object.defineProperty(exports, "Whatsapp", { enumerable: true, get: function () { return whatsapp_1.Whatsapp; } });
@@ -0,0 +1,250 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import { APIPromise } from '../../core/api-promise';
3
+ import { RequestOptions } from '../../internal/request-options';
4
+ export declare class Templates extends APIResource {
5
+ /**
6
+ * Create a message template
7
+ */
8
+ create(body: TemplateCreateParams, options?: RequestOptions): APIPromise<TemplateCreateResponse>;
9
+ /**
10
+ * Get template details
11
+ */
12
+ retrieve(templateName: string, query: TemplateRetrieveParams, options?: RequestOptions): APIPromise<TemplateRetrieveResponse>;
13
+ /**
14
+ * List message templates
15
+ */
16
+ list(query: TemplateListParams, options?: RequestOptions): APIPromise<TemplateListResponse>;
17
+ /**
18
+ * Delete a message template
19
+ */
20
+ delete(templateName: string, params: TemplateDeleteParams, options?: RequestOptions): APIPromise<void>;
21
+ }
22
+ export interface TemplateCreateResponse {
23
+ /**
24
+ * Template category
25
+ */
26
+ category: 'MARKETING' | 'UTILITY' | 'AUTHENTICATION';
27
+ components: Array<TemplateCreateResponse.Component>;
28
+ /**
29
+ * Template language code
30
+ */
31
+ language: string;
32
+ /**
33
+ * Template name
34
+ */
35
+ name: string;
36
+ /**
37
+ * Approval status
38
+ */
39
+ status: 'APPROVED' | 'PENDING' | 'REJECTED';
40
+ }
41
+ export declare namespace TemplateCreateResponse {
42
+ interface Component {
43
+ /**
44
+ * Component type
45
+ */
46
+ type: 'HEADER' | 'BODY' | 'FOOTER' | 'BUTTONS';
47
+ buttons?: Array<Component.Button>;
48
+ /**
49
+ * Header format (TEXT, IMAGE, etc.)
50
+ */
51
+ format?: string;
52
+ /**
53
+ * Component text
54
+ */
55
+ text?: string;
56
+ }
57
+ namespace Component {
58
+ interface Button {
59
+ /**
60
+ * Button text
61
+ */
62
+ text: string;
63
+ /**
64
+ * Button type
65
+ */
66
+ type: string;
67
+ phone_number?: string;
68
+ url?: string;
69
+ }
70
+ }
71
+ }
72
+ export interface TemplateRetrieveResponse {
73
+ /**
74
+ * Template category
75
+ */
76
+ category: 'MARKETING' | 'UTILITY' | 'AUTHENTICATION';
77
+ components: Array<TemplateRetrieveResponse.Component>;
78
+ /**
79
+ * Template language code
80
+ */
81
+ language: string;
82
+ /**
83
+ * Template name
84
+ */
85
+ name: string;
86
+ /**
87
+ * Approval status
88
+ */
89
+ status: 'APPROVED' | 'PENDING' | 'REJECTED';
90
+ }
91
+ export declare namespace TemplateRetrieveResponse {
92
+ interface Component {
93
+ /**
94
+ * Component type
95
+ */
96
+ type: 'HEADER' | 'BODY' | 'FOOTER' | 'BUTTONS';
97
+ buttons?: Array<Component.Button>;
98
+ /**
99
+ * Header format (TEXT, IMAGE, etc.)
100
+ */
101
+ format?: string;
102
+ /**
103
+ * Component text
104
+ */
105
+ text?: string;
106
+ }
107
+ namespace Component {
108
+ interface Button {
109
+ /**
110
+ * Button text
111
+ */
112
+ text: string;
113
+ /**
114
+ * Button type
115
+ */
116
+ type: string;
117
+ phone_number?: string;
118
+ url?: string;
119
+ }
120
+ }
121
+ }
122
+ export interface TemplateListResponse {
123
+ data: Array<TemplateListResponse.Data>;
124
+ }
125
+ export declare namespace TemplateListResponse {
126
+ interface Data {
127
+ /**
128
+ * Template category
129
+ */
130
+ category: 'MARKETING' | 'UTILITY' | 'AUTHENTICATION';
131
+ components: Array<Data.Component>;
132
+ /**
133
+ * Template language code
134
+ */
135
+ language: string;
136
+ /**
137
+ * Template name
138
+ */
139
+ name: string;
140
+ /**
141
+ * Approval status
142
+ */
143
+ status: 'APPROVED' | 'PENDING' | 'REJECTED';
144
+ }
145
+ namespace Data {
146
+ interface Component {
147
+ /**
148
+ * Component type
149
+ */
150
+ type: 'HEADER' | 'BODY' | 'FOOTER' | 'BUTTONS';
151
+ buttons?: Array<Component.Button>;
152
+ /**
153
+ * Header format (TEXT, IMAGE, etc.)
154
+ */
155
+ format?: string;
156
+ /**
157
+ * Component text
158
+ */
159
+ text?: string;
160
+ }
161
+ namespace Component {
162
+ interface Button {
163
+ /**
164
+ * Button text
165
+ */
166
+ text: string;
167
+ /**
168
+ * Button type
169
+ */
170
+ type: string;
171
+ phone_number?: string;
172
+ url?: string;
173
+ }
174
+ }
175
+ }
176
+ }
177
+ export interface TemplateCreateParams {
178
+ /**
179
+ * WhatsApp account ID
180
+ */
181
+ account_id: string;
182
+ /**
183
+ * Template category
184
+ */
185
+ category: 'MARKETING' | 'UTILITY' | 'AUTHENTICATION';
186
+ /**
187
+ * Template components
188
+ */
189
+ components: Array<TemplateCreateParams.Component>;
190
+ /**
191
+ * Template language code
192
+ */
193
+ language: string;
194
+ /**
195
+ * Template name
196
+ */
197
+ name: string;
198
+ }
199
+ export declare namespace TemplateCreateParams {
200
+ interface Component {
201
+ /**
202
+ * Component type
203
+ */
204
+ type: 'HEADER' | 'BODY' | 'FOOTER' | 'BUTTONS';
205
+ buttons?: Array<Component.Button>;
206
+ /**
207
+ * Header format (TEXT, IMAGE, etc.)
208
+ */
209
+ format?: string;
210
+ /**
211
+ * Component text
212
+ */
213
+ text?: string;
214
+ }
215
+ namespace Component {
216
+ interface Button {
217
+ /**
218
+ * Button text
219
+ */
220
+ text: string;
221
+ /**
222
+ * Button type
223
+ */
224
+ type: string;
225
+ phone_number?: string;
226
+ url?: string;
227
+ }
228
+ }
229
+ }
230
+ export interface TemplateRetrieveParams {
231
+ /**
232
+ * WhatsApp account ID
233
+ */
234
+ account_id: string;
235
+ }
236
+ export interface TemplateListParams {
237
+ /**
238
+ * WhatsApp account ID
239
+ */
240
+ account_id: string;
241
+ }
242
+ export interface TemplateDeleteParams {
243
+ /**
244
+ * WhatsApp account ID
245
+ */
246
+ account_id: string;
247
+ }
248
+ export declare namespace Templates {
249
+ export { type TemplateCreateResponse as TemplateCreateResponse, type TemplateRetrieveResponse as TemplateRetrieveResponse, type TemplateListResponse as TemplateListResponse, type TemplateCreateParams as TemplateCreateParams, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateListParams as TemplateListParams, type TemplateDeleteParams as TemplateDeleteParams, };
250
+ }