contiguity 0.0.9 → 0.1.0

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 (401) hide show
  1. package/LICENSE.md +8 -0
  2. package/dist/.DS_Store +0 -0
  3. package/dist/client/fetch.d.ts +25 -0
  4. package/dist/client/fetch.d.ts.map +1 -0
  5. package/dist/client/fetch.js +85 -0
  6. package/dist/contiguity.d.ts +81 -0
  7. package/dist/contiguity.d.ts.map +1 -0
  8. package/dist/contiguity.js +106 -0
  9. package/dist/index.d.ts +29 -14
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +12482 -4
  12. package/dist/services/domains/delete.d.ts +28 -0
  13. package/dist/services/domains/delete.d.ts.map +1 -0
  14. package/dist/services/domains/delete.js +37 -0
  15. package/dist/services/domains/get.d.ts +98 -0
  16. package/dist/services/domains/get.d.ts.map +1 -0
  17. package/dist/services/domains/get.js +89 -0
  18. package/dist/services/domains/index.d.ts +34 -0
  19. package/dist/services/domains/index.d.ts.map +1 -0
  20. package/dist/services/domains/index.js +37 -0
  21. package/dist/services/domains/list.d.ts +36 -0
  22. package/dist/services/domains/list.d.ts.map +1 -0
  23. package/dist/services/domains/list.js +42 -0
  24. package/dist/services/domains/register.d.ts +67 -0
  25. package/dist/services/domains/register.d.ts.map +1 -0
  26. package/dist/services/domains/register.js +67 -0
  27. package/dist/services/email/index.d.ts +17 -0
  28. package/dist/services/email/index.d.ts.map +1 -0
  29. package/dist/services/email/index.js +16 -0
  30. package/dist/services/email/send.d.ts +66 -0
  31. package/dist/services/email/send.d.ts.map +1 -0
  32. package/dist/services/email/send.js +78 -0
  33. package/dist/services/imessage/available.d.ts +14 -0
  34. package/dist/services/imessage/available.d.ts.map +1 -0
  35. package/dist/services/imessage/available.js +23 -0
  36. package/dist/services/imessage/index.d.ts +31 -0
  37. package/dist/services/imessage/index.d.ts.map +1 -0
  38. package/dist/services/imessage/index.js +30 -0
  39. package/dist/services/imessage/send.d.ts +57 -0
  40. package/dist/services/imessage/send.d.ts.map +1 -0
  41. package/dist/services/imessage/send.js +60 -0
  42. package/dist/services/imessage/typing.d.ts +40 -0
  43. package/dist/services/imessage/typing.d.ts.map +1 -0
  44. package/dist/services/imessage/typing.js +49 -0
  45. package/dist/services/lease/available.d.ts +193 -0
  46. package/dist/services/lease/available.d.ts.map +1 -0
  47. package/dist/services/lease/available.js +103 -0
  48. package/dist/services/lease/configure.d.ts +38 -0
  49. package/dist/services/lease/configure.d.ts.map +1 -0
  50. package/dist/services/lease/configure.js +40 -0
  51. package/dist/services/lease/create.d.ts +108 -0
  52. package/dist/services/lease/create.d.ts.map +1 -0
  53. package/dist/services/lease/create.js +78 -0
  54. package/dist/services/lease/details.d.ts +133 -0
  55. package/dist/services/lease/details.d.ts.map +1 -0
  56. package/dist/services/lease/details.js +65 -0
  57. package/dist/services/lease/get.d.ts +96 -0
  58. package/dist/services/lease/get.d.ts.map +1 -0
  59. package/dist/services/lease/get.js +68 -0
  60. package/dist/services/lease/index.d.ts +57 -0
  61. package/dist/services/lease/index.d.ts.map +1 -0
  62. package/dist/services/lease/index.js +58 -0
  63. package/dist/services/lease/leased.d.ts +228 -0
  64. package/dist/services/lease/leased.d.ts.map +1 -0
  65. package/dist/services/lease/leased.js +108 -0
  66. package/dist/services/lease/terminate.d.ts +71 -0
  67. package/dist/services/lease/terminate.d.ts.map +1 -0
  68. package/dist/services/lease/terminate.js +78 -0
  69. package/dist/services/otp/index.d.ts +33 -0
  70. package/dist/services/otp/index.d.ts.map +1 -0
  71. package/dist/services/otp/index.js +37 -0
  72. package/dist/services/otp/new.d.ts +29 -0
  73. package/dist/services/otp/new.d.ts.map +1 -0
  74. package/dist/services/otp/new.js +44 -0
  75. package/dist/services/otp/resend.d.ts +22 -0
  76. package/dist/services/otp/resend.d.ts.map +1 -0
  77. package/dist/services/otp/resend.js +31 -0
  78. package/dist/services/otp/send.d.ts +26 -0
  79. package/dist/services/otp/send.d.ts.map +1 -0
  80. package/dist/services/otp/send.js +38 -0
  81. package/dist/services/otp/verify.d.ts +24 -0
  82. package/dist/services/otp/verify.d.ts.map +1 -0
  83. package/dist/services/otp/verify.js +34 -0
  84. package/dist/services/text/index.d.ts +17 -0
  85. package/dist/services/text/index.d.ts.map +1 -0
  86. package/dist/services/text/index.js +16 -0
  87. package/dist/services/text/send.d.ts +25 -0
  88. package/dist/services/text/send.d.ts.map +1 -0
  89. package/dist/services/text/send.js +37 -0
  90. package/dist/services/whatsapp/index.d.ts +24 -0
  91. package/dist/services/whatsapp/index.d.ts.map +1 -0
  92. package/dist/services/whatsapp/index.js +23 -0
  93. package/dist/services/whatsapp/send.d.ts +57 -0
  94. package/dist/services/whatsapp/send.d.ts.map +1 -0
  95. package/dist/services/whatsapp/send.js +60 -0
  96. package/dist/services/whatsapp/typing.d.ts +40 -0
  97. package/dist/services/whatsapp/typing.d.ts.map +1 -0
  98. package/dist/services/whatsapp/typing.js +49 -0
  99. package/dist/types/base.d.ts +17 -0
  100. package/dist/types/base.d.ts.map +1 -0
  101. package/dist/types/base.js +20 -0
  102. package/dist/types/common.d.ts +56 -0
  103. package/dist/types/common.d.ts.map +1 -0
  104. package/dist/types/common.js +48 -0
  105. package/dist/types/error.d.ts +37 -0
  106. package/dist/types/error.d.ts.map +1 -0
  107. package/dist/types/error.js +54 -0
  108. package/dist/types/metadata.d.ts +10 -0
  109. package/dist/types/metadata.d.ts.map +1 -0
  110. package/dist/types/response.d.ts +10 -0
  111. package/dist/types/response.d.ts.map +1 -0
  112. package/dist/types/response.js +10 -0
  113. package/dist/utils/parse.d.ts +8 -0
  114. package/dist/utils/parse.d.ts.map +1 -0
  115. package/dist/utils/parse.js +36 -0
  116. package/dist/utils/request.d.ts +5 -27
  117. package/dist/utils/request.d.ts.map +1 -1
  118. package/dist/utils/request.js +45 -39
  119. package/package.json +33 -30
  120. package/dist/cjs/client.d.ts +0 -27
  121. package/dist/cjs/client.d.ts.map +0 -1
  122. package/dist/cjs/client.js +0 -43
  123. package/dist/cjs/index.d.ts +0 -13
  124. package/dist/cjs/index.d.ts.map +0 -1
  125. package/dist/cjs/index.js +0 -11
  126. package/dist/cjs/resources/conversations.d.ts +0 -30
  127. package/dist/cjs/resources/conversations.d.ts.map +0 -1
  128. package/dist/cjs/resources/conversations.js +0 -24
  129. package/dist/cjs/resources/domains.d.ts +0 -39
  130. package/dist/cjs/resources/domains.d.ts.map +0 -1
  131. package/dist/cjs/resources/domains.js +0 -28
  132. package/dist/cjs/resources/email.d.ts +0 -17
  133. package/dist/cjs/resources/email.d.ts.map +0 -1
  134. package/dist/cjs/resources/email.js +0 -19
  135. package/dist/cjs/resources/imessage.d.ts +0 -49
  136. package/dist/cjs/resources/imessage.d.ts.map +0 -1
  137. package/dist/cjs/resources/imessage.js +0 -42
  138. package/dist/cjs/resources/lease.d.ts +0 -55
  139. package/dist/cjs/resources/lease.d.ts.map +0 -1
  140. package/dist/cjs/resources/lease.js +0 -34
  141. package/dist/cjs/resources/otp.d.ts +0 -63
  142. package/dist/cjs/resources/otp.d.ts.map +0 -1
  143. package/dist/cjs/resources/otp.js +0 -48
  144. package/dist/cjs/resources/text.d.ts +0 -17
  145. package/dist/cjs/resources/text.d.ts.map +0 -1
  146. package/dist/cjs/resources/text.js +0 -19
  147. package/dist/cjs/resources/voice.d.ts +0 -129
  148. package/dist/cjs/resources/voice.d.ts.map +0 -1
  149. package/dist/cjs/resources/voice.js +0 -95
  150. package/dist/cjs/resources/webhook.d.ts +0 -21
  151. package/dist/cjs/resources/webhook.d.ts.map +0 -1
  152. package/dist/cjs/resources/webhook.js +0 -47
  153. package/dist/cjs/resources/whatsapp.d.ts +0 -33
  154. package/dist/cjs/resources/whatsapp.d.ts.map +0 -1
  155. package/dist/cjs/resources/whatsapp.js +0 -32
  156. package/dist/cjs/schemas/conversations.d.ts +0 -5
  157. package/dist/cjs/schemas/conversations.d.ts.map +0 -1
  158. package/dist/cjs/schemas/conversations.js +0 -5
  159. package/dist/cjs/schemas/domains.d.ts +0 -7
  160. package/dist/cjs/schemas/domains.d.ts.map +0 -1
  161. package/dist/cjs/schemas/domains.js +0 -10
  162. package/dist/cjs/schemas/email.d.ts +0 -16
  163. package/dist/cjs/schemas/email.d.ts.map +0 -1
  164. package/dist/cjs/schemas/email.js +0 -16
  165. package/dist/cjs/schemas/imessage.d.ts +0 -25
  166. package/dist/cjs/schemas/imessage.d.ts.map +0 -1
  167. package/dist/cjs/schemas/imessage.js +0 -25
  168. package/dist/cjs/schemas/index.d.ts +0 -10
  169. package/dist/cjs/schemas/index.d.ts.map +0 -1
  170. package/dist/cjs/schemas/index.js +0 -25
  171. package/dist/cjs/schemas/leases.d.ts +0 -9
  172. package/dist/cjs/schemas/leases.d.ts.map +0 -1
  173. package/dist/cjs/schemas/leases.js +0 -9
  174. package/dist/cjs/schemas/otp.d.ts +0 -25
  175. package/dist/cjs/schemas/otp.d.ts.map +0 -1
  176. package/dist/cjs/schemas/otp.js +0 -16
  177. package/dist/cjs/schemas/text.d.ts +0 -9
  178. package/dist/cjs/schemas/text.d.ts.map +0 -1
  179. package/dist/cjs/schemas/text.js +0 -12
  180. package/dist/cjs/schemas/voice.d.ts +0 -5
  181. package/dist/cjs/schemas/voice.d.ts.map +0 -1
  182. package/dist/cjs/schemas/voice.js +0 -5
  183. package/dist/cjs/schemas/whatsapp.d.ts +0 -25
  184. package/dist/cjs/schemas/whatsapp.d.ts.map +0 -1
  185. package/dist/cjs/schemas/whatsapp.js +0 -25
  186. package/dist/cjs/types/index.d.ts +0 -3
  187. package/dist/cjs/types/index.d.ts.map +0 -1
  188. package/dist/cjs/types/index.js +0 -18
  189. package/dist/cjs/types/responses.d.ts +0 -8
  190. package/dist/cjs/types/responses.d.ts.map +0 -1
  191. package/dist/cjs/types/responses.js +0 -2
  192. package/dist/cjs/types/webhooks.d.ts +0 -10
  193. package/dist/cjs/types/webhooks.d.ts.map +0 -1
  194. package/dist/cjs/types/webhooks.js +0 -2
  195. package/dist/cjs/utils/errors.d.ts +0 -6
  196. package/dist/cjs/utils/errors.d.ts.map +0 -1
  197. package/dist/cjs/utils/errors.js +0 -15
  198. package/dist/cjs/utils/request.d.ts +0 -27
  199. package/dist/cjs/utils/request.d.ts.map +0 -1
  200. package/dist/cjs/utils/request.js +0 -36
  201. package/dist/cjs/utils/response.d.ts +0 -12
  202. package/dist/cjs/utils/response.d.ts.map +0 -1
  203. package/dist/cjs/utils/response.js +0 -12
  204. package/dist/cjs/webhook/parse.d.ts +0 -6
  205. package/dist/cjs/webhook/parse.d.ts.map +0 -1
  206. package/dist/cjs/webhook/parse.js +0 -14
  207. package/dist/cjs/webhook/verify.d.ts +0 -6
  208. package/dist/cjs/webhook/verify.d.ts.map +0 -1
  209. package/dist/cjs/webhook/verify.js +0 -39
  210. package/dist/client.d.ts +0 -27
  211. package/dist/client.d.ts.map +0 -1
  212. package/dist/client.js +0 -50
  213. package/dist/esm/client.d.ts +0 -27
  214. package/dist/esm/client.d.ts.map +0 -1
  215. package/dist/esm/client.js +0 -39
  216. package/dist/esm/index.d.ts +0 -13
  217. package/dist/esm/index.d.ts.map +0 -1
  218. package/dist/esm/index.js +0 -4
  219. package/dist/esm/resources/conversations.d.ts +0 -30
  220. package/dist/esm/resources/conversations.d.ts.map +0 -1
  221. package/dist/esm/resources/conversations.js +0 -20
  222. package/dist/esm/resources/domains.d.ts +0 -39
  223. package/dist/esm/resources/domains.d.ts.map +0 -1
  224. package/dist/esm/resources/domains.js +0 -24
  225. package/dist/esm/resources/email.d.ts +0 -17
  226. package/dist/esm/resources/email.d.ts.map +0 -1
  227. package/dist/esm/resources/email.js +0 -15
  228. package/dist/esm/resources/imessage.d.ts +0 -49
  229. package/dist/esm/resources/imessage.d.ts.map +0 -1
  230. package/dist/esm/resources/imessage.js +0 -38
  231. package/dist/esm/resources/lease.d.ts +0 -55
  232. package/dist/esm/resources/lease.d.ts.map +0 -1
  233. package/dist/esm/resources/lease.js +0 -30
  234. package/dist/esm/resources/otp.d.ts +0 -63
  235. package/dist/esm/resources/otp.d.ts.map +0 -1
  236. package/dist/esm/resources/otp.js +0 -44
  237. package/dist/esm/resources/text.d.ts +0 -17
  238. package/dist/esm/resources/text.d.ts.map +0 -1
  239. package/dist/esm/resources/text.js +0 -15
  240. package/dist/esm/resources/voice.d.ts +0 -129
  241. package/dist/esm/resources/voice.d.ts.map +0 -1
  242. package/dist/esm/resources/voice.js +0 -91
  243. package/dist/esm/resources/webhook.d.ts +0 -21
  244. package/dist/esm/resources/webhook.d.ts.map +0 -1
  245. package/dist/esm/resources/webhook.js +0 -43
  246. package/dist/esm/resources/whatsapp.d.ts +0 -33
  247. package/dist/esm/resources/whatsapp.d.ts.map +0 -1
  248. package/dist/esm/resources/whatsapp.js +0 -28
  249. package/dist/esm/schemas/conversations.d.ts +0 -5
  250. package/dist/esm/schemas/conversations.d.ts.map +0 -1
  251. package/dist/esm/schemas/conversations.js +0 -2
  252. package/dist/esm/schemas/domains.d.ts +0 -7
  253. package/dist/esm/schemas/domains.d.ts.map +0 -1
  254. package/dist/esm/schemas/domains.js +0 -7
  255. package/dist/esm/schemas/email.d.ts +0 -16
  256. package/dist/esm/schemas/email.d.ts.map +0 -1
  257. package/dist/esm/schemas/email.js +0 -13
  258. package/dist/esm/schemas/imessage.d.ts +0 -25
  259. package/dist/esm/schemas/imessage.d.ts.map +0 -1
  260. package/dist/esm/schemas/imessage.js +0 -22
  261. package/dist/esm/schemas/index.d.ts +0 -10
  262. package/dist/esm/schemas/index.d.ts.map +0 -1
  263. package/dist/esm/schemas/index.js +0 -9
  264. package/dist/esm/schemas/leases.d.ts +0 -9
  265. package/dist/esm/schemas/leases.d.ts.map +0 -1
  266. package/dist/esm/schemas/leases.js +0 -6
  267. package/dist/esm/schemas/otp.d.ts +0 -25
  268. package/dist/esm/schemas/otp.d.ts.map +0 -1
  269. package/dist/esm/schemas/otp.js +0 -13
  270. package/dist/esm/schemas/text.d.ts +0 -9
  271. package/dist/esm/schemas/text.d.ts.map +0 -1
  272. package/dist/esm/schemas/text.js +0 -9
  273. package/dist/esm/schemas/voice.d.ts +0 -5
  274. package/dist/esm/schemas/voice.d.ts.map +0 -1
  275. package/dist/esm/schemas/voice.js +0 -2
  276. package/dist/esm/schemas/whatsapp.d.ts +0 -25
  277. package/dist/esm/schemas/whatsapp.d.ts.map +0 -1
  278. package/dist/esm/schemas/whatsapp.js +0 -22
  279. package/dist/esm/types/index.d.ts +0 -3
  280. package/dist/esm/types/index.d.ts.map +0 -1
  281. package/dist/esm/types/index.js +0 -2
  282. package/dist/esm/types/responses.d.ts +0 -8
  283. package/dist/esm/types/responses.d.ts.map +0 -1
  284. package/dist/esm/types/webhooks.d.ts +0 -10
  285. package/dist/esm/types/webhooks.d.ts.map +0 -1
  286. package/dist/esm/types/webhooks.js +0 -1
  287. package/dist/esm/utils/errors.d.ts +0 -6
  288. package/dist/esm/utils/errors.d.ts.map +0 -1
  289. package/dist/esm/utils/errors.js +0 -11
  290. package/dist/esm/utils/request.d.ts +0 -27
  291. package/dist/esm/utils/request.d.ts.map +0 -1
  292. package/dist/esm/utils/request.js +0 -33
  293. package/dist/esm/utils/response.d.ts +0 -12
  294. package/dist/esm/utils/response.d.ts.map +0 -1
  295. package/dist/esm/utils/response.js +0 -9
  296. package/dist/esm/webhook/parse.d.ts +0 -6
  297. package/dist/esm/webhook/parse.d.ts.map +0 -1
  298. package/dist/esm/webhook/parse.js +0 -11
  299. package/dist/esm/webhook/verify.d.ts +0 -6
  300. package/dist/esm/webhook/verify.d.ts.map +0 -1
  301. package/dist/esm/webhook/verify.js +0 -36
  302. package/dist/resources/agreements.d.ts +0 -14
  303. package/dist/resources/agreements.d.ts.map +0 -1
  304. package/dist/resources/agreements.js +0 -10
  305. package/dist/resources/conversations.d.ts +0 -31
  306. package/dist/resources/conversations.d.ts.map +0 -1
  307. package/dist/resources/conversations.js +0 -21
  308. package/dist/resources/domains.d.ts +0 -39
  309. package/dist/resources/domains.d.ts.map +0 -1
  310. package/dist/resources/domains.js +0 -24
  311. package/dist/resources/email.d.ts +0 -17
  312. package/dist/resources/email.d.ts.map +0 -1
  313. package/dist/resources/email.js +0 -15
  314. package/dist/resources/entitlements.d.ts +0 -38
  315. package/dist/resources/entitlements.d.ts.map +0 -1
  316. package/dist/resources/entitlements.js +0 -19
  317. package/dist/resources/identity.d.ts +0 -56
  318. package/dist/resources/identity.d.ts.map +0 -1
  319. package/dist/resources/identity.js +0 -43
  320. package/dist/resources/imessage.d.ts +0 -70
  321. package/dist/resources/imessage.d.ts.map +0 -1
  322. package/dist/resources/imessage.js +0 -55
  323. package/dist/resources/lease.d.ts +0 -55
  324. package/dist/resources/lease.d.ts.map +0 -1
  325. package/dist/resources/lease.js +0 -30
  326. package/dist/resources/otp.d.ts +0 -63
  327. package/dist/resources/otp.d.ts.map +0 -1
  328. package/dist/resources/otp.js +0 -44
  329. package/dist/resources/product.d.ts +0 -23
  330. package/dist/resources/product.d.ts.map +0 -1
  331. package/dist/resources/product.js +0 -19
  332. package/dist/resources/text.d.ts +0 -56
  333. package/dist/resources/text.d.ts.map +0 -1
  334. package/dist/resources/text.js +0 -41
  335. package/dist/resources/voice.d.ts +0 -129
  336. package/dist/resources/voice.d.ts.map +0 -1
  337. package/dist/resources/voice.js +0 -91
  338. package/dist/resources/webhook.d.ts +0 -21
  339. package/dist/resources/webhook.d.ts.map +0 -1
  340. package/dist/resources/webhook.js +0 -43
  341. package/dist/resources/whatsapp.d.ts +0 -45
  342. package/dist/resources/whatsapp.d.ts.map +0 -1
  343. package/dist/resources/whatsapp.js +0 -39
  344. package/dist/schemas/conversations.d.ts +0 -8
  345. package/dist/schemas/conversations.d.ts.map +0 -1
  346. package/dist/schemas/conversations.js +0 -8
  347. package/dist/schemas/domains.d.ts +0 -7
  348. package/dist/schemas/domains.d.ts.map +0 -1
  349. package/dist/schemas/domains.js +0 -7
  350. package/dist/schemas/email.d.ts +0 -16
  351. package/dist/schemas/email.d.ts.map +0 -1
  352. package/dist/schemas/email.js +0 -22
  353. package/dist/schemas/imessage.d.ts +0 -45
  354. package/dist/schemas/imessage.d.ts.map +0 -1
  355. package/dist/schemas/imessage.js +0 -37
  356. package/dist/schemas/index.d.ts +0 -10
  357. package/dist/schemas/index.d.ts.map +0 -1
  358. package/dist/schemas/index.js +0 -9
  359. package/dist/schemas/leases.d.ts +0 -9
  360. package/dist/schemas/leases.d.ts.map +0 -1
  361. package/dist/schemas/leases.js +0 -6
  362. package/dist/schemas/otp.d.ts +0 -25
  363. package/dist/schemas/otp.d.ts.map +0 -1
  364. package/dist/schemas/otp.js +0 -13
  365. package/dist/schemas/product.d.ts +0 -12
  366. package/dist/schemas/product.d.ts.map +0 -1
  367. package/dist/schemas/product.js +0 -9
  368. package/dist/schemas/text.d.ts +0 -25
  369. package/dist/schemas/text.d.ts.map +0 -1
  370. package/dist/schemas/text.js +0 -19
  371. package/dist/schemas/voice.d.ts +0 -5
  372. package/dist/schemas/voice.d.ts.map +0 -1
  373. package/dist/schemas/voice.js +0 -2
  374. package/dist/schemas/whatsapp.d.ts +0 -32
  375. package/dist/schemas/whatsapp.d.ts.map +0 -1
  376. package/dist/schemas/whatsapp.js +0 -30
  377. package/dist/types/index.d.ts +0 -3
  378. package/dist/types/index.d.ts.map +0 -1
  379. package/dist/types/index.js +0 -2
  380. package/dist/types/responses.d.ts +0 -8
  381. package/dist/types/responses.d.ts.map +0 -1
  382. package/dist/types/responses.js +0 -1
  383. package/dist/types/webhooks.d.ts +0 -48
  384. package/dist/types/webhooks.d.ts.map +0 -1
  385. package/dist/types/webhooks.js +0 -1
  386. package/dist/utils/errors.d.ts +0 -10
  387. package/dist/utils/errors.d.ts.map +0 -1
  388. package/dist/utils/errors.js +0 -13
  389. package/dist/utils/normalize.d.ts +0 -13
  390. package/dist/utils/normalize.d.ts.map +0 -1
  391. package/dist/utils/normalize.js +0 -25
  392. package/dist/utils/response.d.ts +0 -12
  393. package/dist/utils/response.d.ts.map +0 -1
  394. package/dist/utils/response.js +0 -9
  395. package/dist/webhook/parse.d.ts +0 -6
  396. package/dist/webhook/parse.d.ts.map +0 -1
  397. package/dist/webhook/parse.js +0 -11
  398. package/dist/webhook/verify.d.ts +0 -6
  399. package/dist/webhook/verify.d.ts.map +0 -1
  400. package/dist/webhook/verify.js +0 -36
  401. /package/dist/{esm/types/responses.js → types/metadata.js} +0 -0
@@ -1,5 +0,0 @@
1
- import { z } from "zod";
2
- export declare const voicePlaySchema: z.ZodObject<{
3
- audio_url: z.ZodString;
4
- }, z.core.$loose>;
5
- //# sourceMappingURL=voice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../../src/schemas/voice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;iBAAoD,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.voicePlaySchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.voicePlaySchema = zod_1.z.object({ audio_url: zod_1.z.string() }).passthrough();
@@ -1,25 +0,0 @@
1
- import { z } from "zod";
2
- export declare const whatsappSendSchema: z.ZodObject<{
3
- to: z.ZodString;
4
- message: z.ZodString;
5
- from: z.ZodOptional<z.ZodString>;
6
- fallback: z.ZodOptional<z.ZodObject<{
7
- when: z.ZodArray<z.ZodEnum<{
8
- whatsapp_unsupported: "whatsapp_unsupported";
9
- whatsapp_fails: "whatsapp_fails";
10
- }>>;
11
- from: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strip>>;
13
- attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
- }, z.core.$loose>;
15
- export declare const whatsappTypingSchema: z.ZodObject<{
16
- to: z.ZodString;
17
- action: z.ZodEnum<{
18
- start: "start";
19
- stop: "stop";
20
- }>;
21
- from: z.ZodOptional<z.ZodString>;
22
- }, z.core.$loose>;
23
- export type WhatsappSendParams = z.infer<typeof whatsappSendSchema>;
24
- export type WhatsappTypingParams = z.infer<typeof whatsappTypingSchema>;
25
- //# sourceMappingURL=whatsapp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../../src/schemas/whatsapp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAaf,CAAC;AAEjB,eAAO,MAAM,oBAAoB;;;;;;;iBAMjB,CAAC;AAEjB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.whatsappTypingSchema = exports.whatsappSendSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.whatsappSendSchema = zod_1.z
6
- .object({
7
- to: zod_1.z.string(),
8
- message: zod_1.z.string(),
9
- from: zod_1.z.string().optional(),
10
- fallback: zod_1.z
11
- .object({
12
- when: zod_1.z.array(zod_1.z.enum(["whatsapp_unsupported", "whatsapp_fails"])),
13
- from: zod_1.z.string().optional(),
14
- })
15
- .optional(),
16
- attachments: zod_1.z.array(zod_1.z.string()).optional(),
17
- })
18
- .passthrough();
19
- exports.whatsappTypingSchema = zod_1.z
20
- .object({
21
- to: zod_1.z.string(),
22
- action: zod_1.z.enum(["start", "stop"]),
23
- from: zod_1.z.string().optional(),
24
- })
25
- .passthrough();
@@ -1,3 +0,0 @@
1
- export * from "./responses.js";
2
- export * from "./webhooks.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./responses.js"), exports);
18
- __exportStar(require("./webhooks.js"), exports);
@@ -1,8 +0,0 @@
1
- /** Metadata included with every API response */
2
- export interface ResponseMetadata {
3
- id: string;
4
- timestamp: string;
5
- api_version: string;
6
- object: string;
7
- }
8
- //# sourceMappingURL=responses.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/types/responses.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- /** Webhook event types (v2 format) */
2
- export type WebhookEventType = "text.incoming.sms" | "text.incoming.mms" | "text.delivery.confirmed" | "text.delivery.failed" | "imessage.incoming" | "numbers.substitution" | "otp.reverse.verified" | "email.incoming" | "identity.verification_session.started" | "identity.verification_session.processing" | "identity.verification_session.verified" | "identity.verification_session.failed" | "identity.verification_session.requires_input" | "identity.verification_session.manually_approved" | "identity.verification_session.manually_denied" | "identity.verification_report.generated";
3
- export interface WebhookEventBase {
4
- id: string;
5
- type: WebhookEventType;
6
- timestamp: number;
7
- api_version: string;
8
- data: Record<string, unknown>;
9
- }
10
- //# sourceMappingURL=webhooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/types/webhooks.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,MAAM,gBAAgB,GACxB,mBAAmB,GACnB,mBAAmB,GACnB,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,sBAAsB,GACtB,sBAAsB,GACtB,gBAAgB,GAChB,uCAAuC,GACvC,0CAA0C,GAC1C,wCAAwC,GACxC,sCAAsC,GACtC,8CAA8C,GAC9C,iDAAiD,GACjD,+CAA+C,GAC/C,wCAAwC,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export declare class ContiguityError extends Error {
2
- readonly status?: number | undefined;
3
- readonly code?: string | undefined;
4
- constructor(message: string, status?: number | undefined, code?: string | undefined);
5
- }
6
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAgB,SAAQ,KAAK;aAGtB,MAAM,CAAC,EAAE,MAAM;aACf,IAAI,CAAC,EAAE,MAAM;gBAF7B,OAAO,EAAE,MAAM,EACC,MAAM,CAAC,EAAE,MAAM,YAAA,EACf,IAAI,CAAC,EAAE,MAAM,YAAA;CAMhC"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContiguityError = void 0;
4
- class ContiguityError extends Error {
5
- status;
6
- code;
7
- constructor(message, status, code) {
8
- super(message);
9
- this.status = status;
10
- this.code = code;
11
- this.name = "ContiguityError";
12
- Object.setPrototypeOf(this, ContiguityError.prototype);
13
- }
14
- }
15
- exports.ContiguityError = ContiguityError;
@@ -1,27 +0,0 @@
1
- declare const BASE_URLS: {
2
- readonly send: "https://api.contiguity.com/send";
3
- readonly otp: "https://api.contiguity.com/otp";
4
- readonly domains: "https://api.contiguity.com/domains";
5
- readonly numbers: "https://api.contiguity.com/numbers";
6
- readonly conversations: "https://api.contiguity.com/conversations";
7
- readonly voice: "https://api.contiguity.com/voice";
8
- };
9
- export type ApiBase = keyof typeof BASE_URLS;
10
- export interface RequestConfig {
11
- token: string;
12
- base: ApiBase;
13
- debug?: boolean;
14
- }
15
- export declare function request<T = Record<string, unknown>>(config: RequestConfig, path: string, options?: {
16
- method?: "GET" | "POST" | "DELETE";
17
- body?: Record<string, unknown>;
18
- }): Promise<T & {
19
- metadata: {
20
- id: string;
21
- timestamp: string;
22
- api_version: string;
23
- object: string;
24
- };
25
- }>;
26
- export {};
27
- //# sourceMappingURL=request.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/utils/request.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,SAAS;;;;;;;CAOL,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,SAAS,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvD,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3B,GACL,OAAO,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,CAwBnG"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.request = request;
4
- const response_js_1 = require("./response.js");
5
- const errors_js_1 = require("./errors.js");
6
- const BASE_URLS = {
7
- send: "https://api.contiguity.com/send",
8
- otp: "https://api.contiguity.com/otp",
9
- domains: "https://api.contiguity.com/domains",
10
- numbers: "https://api.contiguity.com/numbers",
11
- conversations: "https://api.contiguity.com/conversations",
12
- voice: "https://api.contiguity.com/voice",
13
- };
14
- async function request(config, path, options = {}) {
15
- const { token, base, debug } = config;
16
- const url = `${BASE_URLS[base]}${path}`;
17
- const headers = {
18
- "Content-Type": "application/json",
19
- Authorization: `Token ${token}`,
20
- };
21
- if (debug) {
22
- console.debug("[contiguity]", options.method ?? "GET", url, options.body ?? "");
23
- }
24
- const res = await fetch(url, {
25
- method: options.method ?? "GET",
26
- headers,
27
- body: options.body ? JSON.stringify(options.body) : undefined,
28
- });
29
- const json = (await res.json());
30
- if (!res.ok) {
31
- const errMsg = json.data?.error ?? json.object ?? "Unknown error";
32
- const status = json.data?.status ?? res.status;
33
- throw new errors_js_1.ContiguityError(errMsg, status);
34
- }
35
- return (0, response_js_1.transformResponse)(json);
36
- }
@@ -1,12 +0,0 @@
1
- import type { ResponseMetadata } from "../types/responses.js";
2
- export interface RawApiResponse {
3
- id: string;
4
- timestamp: number;
5
- api_version: string;
6
- object: string;
7
- data: Record<string, unknown>;
8
- }
9
- export declare function transformResponse(res: RawApiResponse): Record<string, unknown> & {
10
- metadata: ResponseMetadata;
11
- };
12
- //# sourceMappingURL=response.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/utils/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,EAAE,gBAAgB,CAAA;CAAE,CAQ/G"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformResponse = transformResponse;
4
- function transformResponse(res) {
5
- const metadata = {
6
- id: res.id,
7
- timestamp: String(res.timestamp),
8
- api_version: res.api_version,
9
- object: res.object,
10
- };
11
- return { ...res.data, metadata };
12
- }
@@ -1,6 +0,0 @@
1
- import type { WebhookEventBase } from "../types/webhooks.js";
2
- /**
3
- * Parse raw webhook body (v2 format) into a typed event.
4
- */
5
- export declare function parseWebhookPayload(raw_body: string | Buffer): WebhookEventBase;
6
- //# sourceMappingURL=parse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/webhook/parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,sBAAsB,CAAC;AAE/E;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAO/E"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseWebhookPayload = parseWebhookPayload;
4
- /**
5
- * Parse raw webhook body (v2 format) into a typed event.
6
- */
7
- function parseWebhookPayload(raw_body) {
8
- const str = typeof raw_body === "string" ? raw_body : raw_body.toString("utf-8");
9
- const event = JSON.parse(str);
10
- if (typeof event.id !== "string" || typeof event.type !== "string" || typeof event.timestamp !== "number") {
11
- throw new Error("Invalid webhook payload: missing id, type, or timestamp");
12
- }
13
- return event;
14
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Verify webhook signature (HMAC-SHA256, format t=timestamp,v1=hex).
3
- * Use raw body as received — do not re-serialize JSON.
4
- */
5
- export declare function verifyWebhookSignature(raw_body: string | Buffer, signature_header: string | null | undefined, secret: string | null | undefined, tolerance_seconds?: number): boolean;
6
- //# sourceMappingURL=verify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/webhook/verify.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC3C,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,iBAAiB,CAAC,EAAE,MAAM,GAC3B,OAAO,CAsBT"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyWebhookSignature = verifyWebhookSignature;
4
- const node_crypto_1 = require("node:crypto");
5
- /**
6
- * Verify webhook signature (HMAC-SHA256, format t=timestamp,v1=hex).
7
- * Use raw body as received — do not re-serialize JSON.
8
- */
9
- function verifyWebhookSignature(raw_body, signature_header, secret, tolerance_seconds) {
10
- if (!secret || !signature_header || raw_body == null)
11
- return false;
12
- const match = signature_header.match(/t=(\d+),v1=([a-f0-9]+)/);
13
- if (!match)
14
- return false;
15
- const [, t, v1] = match;
16
- if (!t || !v1)
17
- return false;
18
- const body_str = typeof raw_body === "string" ? raw_body : raw_body.toString("utf-8");
19
- const signed_payload = `${t}.${body_str}`;
20
- const expected = (0, node_crypto_1.createHmac)("sha256", secret).update(signed_payload).digest("hex");
21
- if (v1.length !== expected.length)
22
- return false;
23
- try {
24
- if (!(0, node_crypto_1.timingSafeEqual)(Buffer.from(v1, "hex"), Buffer.from(expected, "hex")))
25
- return false;
26
- }
27
- catch {
28
- return false;
29
- }
30
- if (tolerance_seconds != null) {
31
- const ts = parseInt(t, 10);
32
- if (Number.isNaN(ts))
33
- return false;
34
- const now = Math.floor(Date.now() / 1000);
35
- if (Math.abs(now - ts) > tolerance_seconds)
36
- return false;
37
- }
38
- return true;
39
- }
package/dist/client.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import { TextResource } from "./resources/text.js";
2
- import { EmailResource } from "./resources/email.js";
3
- import { OtpResource } from "./resources/otp.js";
4
- import { DomainsResource } from "./resources/domains.js";
5
- import { LeaseResource } from "./resources/lease.js";
6
- import { EntitlementsResource } from "./resources/entitlements.js";
7
- import { AgreementsResource } from "./resources/agreements.js";
8
- import { ImessageResource } from "./resources/imessage.js";
9
- import { WhatsappResource } from "./resources/whatsapp.js";
10
- import { WebhookResource } from "./resources/webhook.js";
11
- export interface ContiguityConfig {
12
- debug?: boolean;
13
- }
14
- export declare class Contiguity {
15
- readonly text: TextResource;
16
- readonly email: EmailResource;
17
- readonly otp: OtpResource;
18
- readonly domains: DomainsResource;
19
- readonly lease: LeaseResource;
20
- readonly entitlements: EntitlementsResource;
21
- readonly agreements: AgreementsResource;
22
- readonly imessage: ImessageResource;
23
- readonly whatsapp: WhatsappResource;
24
- readonly webhook: WebhookResource;
25
- constructor(token?: string, config?: ContiguityConfig);
26
- }
27
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,UAAU;IACnB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAEpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;gBAEtB,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,gBAAqB;CA4B5D"}
package/dist/client.js DELETED
@@ -1,50 +0,0 @@
1
- import { TextResource } from "./resources/text.js";
2
- import { EmailResource } from "./resources/email.js";
3
- import { OtpResource } from "./resources/otp.js";
4
- import { DomainsResource } from "./resources/domains.js";
5
- import { LeaseResource } from "./resources/lease.js";
6
- import { EntitlementsResource } from "./resources/entitlements.js";
7
- import { AgreementsResource } from "./resources/agreements.js";
8
- import { ImessageResource } from "./resources/imessage.js";
9
- import { WhatsappResource } from "./resources/whatsapp.js";
10
- // import { VoiceResource } from "./resources/voice.js";
11
- import { WebhookResource } from "./resources/webhook.js";
12
- export class Contiguity {
13
- text;
14
- email;
15
- otp;
16
- domains;
17
- lease;
18
- entitlements;
19
- agreements;
20
- imessage;
21
- whatsapp;
22
- // readonly voice: VoiceResource;
23
- webhook;
24
- constructor(token, config = {}) {
25
- const env = typeof process !== "undefined" ? process.env : undefined;
26
- const resolved = token ?? env?.CONTIGUITY_API_KEY ?? env?.CONTIGUITY_TOKEN;
27
- if (!resolved) {
28
- throw new Error("Contiguity token required. Pass it to the constructor or set an environment variable (CONTIGUITY_API_KEY or CONTIGUITY_TOKEN)");
29
- }
30
- if (!resolved.includes("contiguity_sk_")) {
31
- throw new Error("Invalid Contiguity token: key must start with contiguity_sk_.");
32
- }
33
- const request_config = {
34
- token: resolved,
35
- base: "send",
36
- debug: config.debug ?? false,
37
- };
38
- this.text = new TextResource(request_config);
39
- this.email = new EmailResource(request_config);
40
- this.otp = new OtpResource({ ...request_config, base: "otp" });
41
- this.domains = new DomainsResource({ ...request_config, base: "domains" });
42
- this.lease = new LeaseResource({ ...request_config, base: "numbers" });
43
- this.entitlements = new EntitlementsResource({ ...request_config, base: "entitlements" });
44
- this.agreements = new AgreementsResource(this.entitlements);
45
- this.imessage = new ImessageResource(request_config);
46
- this.whatsapp = new WhatsappResource(request_config);
47
- // this.voice = new VoiceResource({ ...request_config, base: "voice" });
48
- this.webhook = new WebhookResource();
49
- }
50
- }
@@ -1,27 +0,0 @@
1
- import { TextResource } from "./resources/text.js";
2
- import { EmailResource } from "./resources/email.js";
3
- import { OtpResource } from "./resources/otp.js";
4
- import { DomainsResource } from "./resources/domains.js";
5
- import { LeaseResource } from "./resources/lease.js";
6
- import { ImessageResource } from "./resources/imessage.js";
7
- import { WhatsappResource } from "./resources/whatsapp.js";
8
- import { ConversationsResource } from "./resources/conversations.js";
9
- import { VoiceResource } from "./resources/voice.js";
10
- import { WebhookResource } from "./resources/webhook.js";
11
- export interface ContiguityConfig {
12
- debug?: boolean;
13
- }
14
- export declare class Contiguity {
15
- readonly text: TextResource;
16
- readonly email: EmailResource;
17
- readonly otp: OtpResource;
18
- readonly domains: DomainsResource;
19
- readonly lease: LeaseResource;
20
- readonly imessage: ImessageResource;
21
- readonly whatsapp: WhatsappResource;
22
- readonly conversations: ConversationsResource;
23
- readonly voice: VoiceResource;
24
- readonly webhook: WebhookResource;
25
- constructor(token: string, config?: ContiguityConfig);
26
- }
27
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;gBAEtB,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,gBAAqB;CAiBzD"}
@@ -1,39 +0,0 @@
1
- import { TextResource } from "./resources/text.js";
2
- import { EmailResource } from "./resources/email.js";
3
- import { OtpResource } from "./resources/otp.js";
4
- import { DomainsResource } from "./resources/domains.js";
5
- import { LeaseResource } from "./resources/lease.js";
6
- import { ImessageResource } from "./resources/imessage.js";
7
- import { WhatsappResource } from "./resources/whatsapp.js";
8
- import { ConversationsResource } from "./resources/conversations.js";
9
- import { VoiceResource } from "./resources/voice.js";
10
- import { WebhookResource } from "./resources/webhook.js";
11
- export class Contiguity {
12
- text;
13
- email;
14
- otp;
15
- domains;
16
- lease;
17
- imessage;
18
- whatsapp;
19
- conversations;
20
- voice;
21
- webhook;
22
- constructor(token, config = {}) {
23
- const request_config = {
24
- token,
25
- base: "send",
26
- debug: config.debug ?? false,
27
- };
28
- this.text = new TextResource(request_config);
29
- this.email = new EmailResource(request_config);
30
- this.otp = new OtpResource({ ...request_config, base: "otp" });
31
- this.domains = new DomainsResource({ ...request_config, base: "domains" });
32
- this.lease = new LeaseResource({ ...request_config, base: "numbers" });
33
- this.imessage = new ImessageResource(request_config);
34
- this.whatsapp = new WhatsappResource(request_config);
35
- this.conversations = new ConversationsResource({ ...request_config, base: "conversations" });
36
- this.voice = new VoiceResource({ ...request_config, base: "voice" });
37
- this.webhook = new WebhookResource();
38
- }
39
- }
@@ -1,13 +0,0 @@
1
- export { Contiguity } from "./client.js";
2
- export type { ContiguityConfig } from "./client.js";
3
- export { ContiguityError } from "./utils/errors.js";
4
- export { verifyWebhookSignature } from "./webhook/verify.js";
5
- export { parseWebhookPayload } from "./webhook/parse.js";
6
- export type { ResponseMetadata } from "./types/responses.js";
7
- export type { WebhookEventBase, WebhookEventType } from "./types/webhooks.js";
8
- export type { TextSendParams } from "./schemas/text.js";
9
- export type { EmailSendParams } from "./schemas/email.js";
10
- export type { OtpNewParams, OtpVerifyParams, OtpResendParams, OtpReverseInitiateParams } from "./schemas/otp.js";
11
- export type { ImessageSendParams, ImessageTypingParams } from "./schemas/imessage.js";
12
- export type { WhatsappSendParams, WhatsappTypingParams } from "./schemas/whatsapp.js";
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjH,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACtF,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/esm/index.js DELETED
@@ -1,4 +0,0 @@
1
- export { Contiguity } from "./client.js";
2
- export { ContiguityError } from "./utils/errors.js";
3
- export { verifyWebhookSignature } from "./webhook/verify.js";
4
- export { parseWebhookPayload } from "./webhook/parse.js";
@@ -1,30 +0,0 @@
1
- import type { RequestConfig } from "../utils/request.js";
2
- export declare class ConversationsResource {
3
- private readonly config;
4
- constructor(config: RequestConfig);
5
- getMessage(id: string): Promise<Record<string, unknown> & {
6
- metadata: {
7
- id: string;
8
- timestamp: string;
9
- api_version: string;
10
- object: string;
11
- };
12
- }>;
13
- textHistory(to: string, from: string, limit?: number): Promise<Record<string, unknown> & {
14
- metadata: {
15
- id: string;
16
- timestamp: string;
17
- api_version: string;
18
- object: string;
19
- };
20
- }>;
21
- imessageHistory(to: string, from: string, limit?: number): Promise<Record<string, unknown> & {
22
- metadata: {
23
- id: string;
24
- timestamp: string;
25
- api_version: string;
26
- object: string;
27
- };
28
- }>;
29
- }
30
- //# sourceMappingURL=conversations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/resources/conversations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,UAAU,CAAC,EAAE,EAAE,MAAM;;;;;;;;IAIrB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW;;;;;;;;IAMxD,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW;;;;;;;;CAKnE"}
@@ -1,20 +0,0 @@
1
- import { request } from "../utils/request.js";
2
- export class ConversationsResource {
3
- config;
4
- constructor(config) {
5
- this.config = config;
6
- }
7
- async getMessage(id) {
8
- return request(this.config, `/history/message/${encodeURIComponent(id)}`, { method: "GET" });
9
- }
10
- async textHistory(to, from, limit = 20) {
11
- return request(this.config, `/history/text/${encodeURIComponent(to)}/${encodeURIComponent(from)}/${limit}`, {
12
- method: "GET",
13
- });
14
- }
15
- async imessageHistory(to, from, limit = 20) {
16
- return request(this.config, `/history/imessage/${encodeURIComponent(to)}/${encodeURIComponent(from)}/${limit}`, {
17
- method: "GET",
18
- });
19
- }
20
- }
@@ -1,39 +0,0 @@
1
- import { type DomainsRegisterOptions } from "../schemas/domains.js";
2
- import type { RequestConfig } from "../utils/request.js";
3
- export declare class DomainsResource {
4
- private readonly config;
5
- constructor(config: RequestConfig);
6
- list(): Promise<Record<string, unknown> & {
7
- metadata: {
8
- id: string;
9
- timestamp: string;
10
- api_version: string;
11
- object: string;
12
- };
13
- }>;
14
- get(domain: string): Promise<Record<string, unknown> & {
15
- metadata: {
16
- id: string;
17
- timestamp: string;
18
- api_version: string;
19
- object: string;
20
- };
21
- }>;
22
- register(domain: string, options?: DomainsRegisterOptions): Promise<Record<string, unknown> & {
23
- metadata: {
24
- id: string;
25
- timestamp: string;
26
- api_version: string;
27
- object: string;
28
- };
29
- }>;
30
- delete(domain: string): Promise<Record<string, unknown> & {
31
- metadata: {
32
- id: string;
33
- timestamp: string;
34
- api_version: string;
35
- object: string;
36
- };
37
- }>;
38
- }
39
- //# sourceMappingURL=domains.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/resources/domains.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,IAAI;;;;;;;;IAIJ,GAAG,CAAC,MAAM,EAAE,MAAM;;;;;;;;IAIlB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB;;;;;;;;IAQzD,MAAM,CAAC,MAAM,EAAE,MAAM;;;;;;;;CAG5B"}