rcs-js 0.0.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (672) hide show
  1. package/Client.d.ts +90 -0
  2. package/Client.js +381 -0
  3. package/README.md +137 -0
  4. package/api/client/index.d.ts +1 -0
  5. package/api/client/index.js +17 -0
  6. package/api/client/requests/CheckRcsCapabilityRequest.d.ts +21 -0
  7. package/api/client/requests/CheckRcsCapabilityRequest.js +5 -0
  8. package/api/client/requests/UpdateSettingsRequest.d.ts +13 -0
  9. package/api/client/requests/UpdateSettingsRequest.js +5 -0
  10. package/api/client/requests/index.d.ts +2 -0
  11. package/api/client/requests/index.js +2 -0
  12. package/api/errors/BadRequestError.d.ts +8 -0
  13. package/api/errors/BadRequestError.js +41 -0
  14. package/api/errors/InternalServerError.d.ts +8 -0
  15. package/api/errors/InternalServerError.js +41 -0
  16. package/api/errors/UnauthorizedError.d.ts +8 -0
  17. package/api/errors/UnauthorizedError.js +41 -0
  18. package/api/errors/index.d.ts +3 -0
  19. package/api/errors/index.js +19 -0
  20. package/api/index.d.ts +3 -0
  21. package/api/index.js +19 -0
  22. package/api/types/Action.d.ts +5 -0
  23. package/api/types/Action.js +5 -0
  24. package/api/types/BadRequestErrorBody.d.ts +6 -0
  25. package/api/types/BadRequestErrorBody.js +5 -0
  26. package/api/types/BasicRcs.d.ts +13 -0
  27. package/api/types/BasicRcs.js +5 -0
  28. package/api/types/BasicRcsMessage.d.ts +10 -0
  29. package/api/types/BasicRcsMessage.js +5 -0
  30. package/api/types/Call.d.ts +9 -0
  31. package/api/types/Call.js +5 -0
  32. package/api/types/Card.d.ts +16 -0
  33. package/api/types/Card.js +5 -0
  34. package/api/types/CardRcs.d.ts +12 -0
  35. package/api/types/CardRcs.js +5 -0
  36. package/api/types/CardRcsMessage.d.ts +13 -0
  37. package/api/types/CardRcsMessage.js +5 -0
  38. package/api/types/CardStyle.d.ts +16 -0
  39. package/api/types/CardStyle.js +5 -0
  40. package/api/types/CardStyleImageAlignment.d.ts +11 -0
  41. package/api/types/CardStyleImageAlignment.js +10 -0
  42. package/api/types/CardStyleMediaHeight.d.ts +12 -0
  43. package/api/types/CardStyleMediaHeight.js +11 -0
  44. package/api/types/CardStyleOrientation.d.ts +11 -0
  45. package/api/types/CardStyleOrientation.js +10 -0
  46. package/api/types/CardStyleWidth.d.ts +11 -0
  47. package/api/types/CardStyleWidth.js +10 -0
  48. package/api/types/CarouselRcs.d.ts +12 -0
  49. package/api/types/CarouselRcs.js +5 -0
  50. package/api/types/CarouselRcsMessage.d.ts +13 -0
  51. package/api/types/CarouselRcsMessage.js +5 -0
  52. package/api/types/CheckRcsCapabilityResponse.d.ts +7 -0
  53. package/api/types/CheckRcsCapabilityResponse.js +5 -0
  54. package/api/types/Event.d.ts +15 -0
  55. package/api/types/Event.js +5 -0
  56. package/api/types/GetAccountNumberResponse.d.ts +7 -0
  57. package/api/types/GetAccountNumberResponse.js +5 -0
  58. package/api/types/InternalServerErrorBody.d.ts +6 -0
  59. package/api/types/InternalServerErrorBody.js +5 -0
  60. package/api/types/LatLng.d.ts +12 -0
  61. package/api/types/LatLng.js +5 -0
  62. package/api/types/MediaRcs.d.ts +12 -0
  63. package/api/types/MediaRcs.js +5 -0
  64. package/api/types/MediaRcsMessage.d.ts +14 -0
  65. package/api/types/MediaRcsMessage.js +5 -0
  66. package/api/types/MediaType.d.ts +14 -0
  67. package/api/types/MediaType.js +13 -0
  68. package/api/types/PhoneNumber.d.ts +7 -0
  69. package/api/types/PhoneNumber.js +5 -0
  70. package/api/types/Postback.d.ts +11 -0
  71. package/api/types/Postback.js +5 -0
  72. package/api/types/SendRequest.d.ts +5 -0
  73. package/api/types/SendRequest.js +5 -0
  74. package/api/types/SendResponse.d.ts +7 -0
  75. package/api/types/SendResponse.js +5 -0
  76. package/api/types/ShareLocation.d.ts +7 -0
  77. package/api/types/ShareLocation.js +5 -0
  78. package/api/types/Sms.d.ts +12 -0
  79. package/api/types/Sms.js +5 -0
  80. package/api/types/SmsMessage.d.ts +12 -0
  81. package/api/types/SmsMessage.js +5 -0
  82. package/api/types/UnauthorizedErrorBody.d.ts +6 -0
  83. package/api/types/UnauthorizedErrorBody.js +5 -0
  84. package/api/types/UpdateSettingsResponse.d.ts +6 -0
  85. package/api/types/UpdateSettingsResponse.js +5 -0
  86. package/api/types/Url.d.ts +9 -0
  87. package/api/types/Url.js +5 -0
  88. package/api/types/ViewLocation.d.ts +11 -0
  89. package/api/types/ViewLocation.js +5 -0
  90. package/api/types/index.d.ts +34 -0
  91. package/api/types/index.js +50 -0
  92. package/core/fetcher/APIResponse.d.ts +10 -0
  93. package/core/fetcher/APIResponse.js +2 -0
  94. package/core/fetcher/Fetcher.d.ts +39 -0
  95. package/core/fetcher/Fetcher.js +99 -0
  96. package/core/fetcher/Supplier.d.ts +4 -0
  97. package/core/fetcher/Supplier.js +22 -0
  98. package/core/fetcher/createRequestUrl.d.ts +1 -0
  99. package/core/fetcher/createRequestUrl.js +13 -0
  100. package/core/fetcher/getFetchFn.d.ts +4 -0
  101. package/core/fetcher/getFetchFn.js +59 -0
  102. package/core/fetcher/getHeader.d.ts +1 -0
  103. package/core/fetcher/getHeader.js +12 -0
  104. package/core/fetcher/getRequestBody.d.ts +7 -0
  105. package/core/fetcher/getRequestBody.js +23 -0
  106. package/core/fetcher/getResponseBody.d.ts +1 -0
  107. package/core/fetcher/getResponseBody.js +52 -0
  108. package/core/fetcher/index.d.ts +5 -0
  109. package/core/fetcher/index.js +9 -0
  110. package/core/fetcher/makeRequest.d.ts +1 -0
  111. package/core/fetcher/makeRequest.js +42 -0
  112. package/core/fetcher/requestWithRetries.d.ts +1 -0
  113. package/core/fetcher/requestWithRetries.js +32 -0
  114. package/core/fetcher/signals.d.ts +12 -0
  115. package/core/fetcher/signals.js +37 -0
  116. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  117. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  118. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  119. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  120. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  121. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  122. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  123. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  124. package/core/index.d.ts +3 -0
  125. package/core/index.js +32 -0
  126. package/core/runtime/index.d.ts +1 -0
  127. package/core/runtime/index.js +5 -0
  128. package/core/runtime/runtime.d.ts +9 -0
  129. package/core/runtime/runtime.js +93 -0
  130. package/core/schemas/Schema.d.ts +85 -0
  131. package/core/schemas/Schema.js +22 -0
  132. package/core/schemas/builders/bigint/bigint.d.ts +2 -0
  133. package/core/schemas/builders/bigint/bigint.js +50 -0
  134. package/core/schemas/builders/bigint/index.d.ts +1 -0
  135. package/core/schemas/builders/bigint/index.js +5 -0
  136. package/core/schemas/builders/date/date.d.ts +2 -0
  137. package/core/schemas/builders/date/date.js +63 -0
  138. package/core/schemas/builders/date/index.d.ts +1 -0
  139. package/core/schemas/builders/date/index.js +5 -0
  140. package/core/schemas/builders/enum/enum.d.ts +2 -0
  141. package/core/schemas/builders/enum/enum.js +39 -0
  142. package/core/schemas/builders/enum/index.d.ts +1 -0
  143. package/core/schemas/builders/enum/index.js +5 -0
  144. package/core/schemas/builders/index.d.ts +14 -0
  145. package/core/schemas/builders/index.js +30 -0
  146. package/core/schemas/builders/lazy/index.d.ts +3 -0
  147. package/core/schemas/builders/lazy/index.js +7 -0
  148. package/core/schemas/builders/lazy/lazy.d.ts +5 -0
  149. package/core/schemas/builders/lazy/lazy.js +25 -0
  150. package/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
  151. package/core/schemas/builders/lazy/lazyObject.js +12 -0
  152. package/core/schemas/builders/list/index.d.ts +1 -0
  153. package/core/schemas/builders/list/index.js +5 -0
  154. package/core/schemas/builders/list/list.d.ts +2 -0
  155. package/core/schemas/builders/list/list.js +55 -0
  156. package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  157. package/core/schemas/builders/literals/booleanLiteral.js +29 -0
  158. package/core/schemas/builders/literals/index.d.ts +2 -0
  159. package/core/schemas/builders/literals/index.js +7 -0
  160. package/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
  161. package/core/schemas/builders/literals/stringLiteral.js +29 -0
  162. package/core/schemas/builders/object/index.d.ts +6 -0
  163. package/core/schemas/builders/object/index.js +11 -0
  164. package/core/schemas/builders/object/object.d.ts +3 -0
  165. package/core/schemas/builders/object/object.js +233 -0
  166. package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  167. package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
  168. package/core/schemas/builders/object/property.d.ts +8 -0
  169. package/core/schemas/builders/object/property.js +16 -0
  170. package/core/schemas/builders/object/types.d.ts +26 -0
  171. package/core/schemas/builders/object/types.js +2 -0
  172. package/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
  173. package/core/schemas/builders/object-like/getObjectLikeUtils.js +54 -0
  174. package/core/schemas/builders/object-like/index.d.ts +2 -0
  175. package/core/schemas/builders/object-like/index.js +6 -0
  176. package/core/schemas/builders/object-like/types.d.ts +7 -0
  177. package/core/schemas/builders/object-like/types.js +2 -0
  178. package/core/schemas/builders/primitives/any.d.ts +1 -0
  179. package/core/schemas/builders/primitives/any.js +6 -0
  180. package/core/schemas/builders/primitives/boolean.d.ts +1 -0
  181. package/core/schemas/builders/primitives/boolean.js +25 -0
  182. package/core/schemas/builders/primitives/index.d.ts +5 -0
  183. package/core/schemas/builders/primitives/index.js +13 -0
  184. package/core/schemas/builders/primitives/number.d.ts +1 -0
  185. package/core/schemas/builders/primitives/number.js +25 -0
  186. package/core/schemas/builders/primitives/string.d.ts +1 -0
  187. package/core/schemas/builders/primitives/string.js +25 -0
  188. package/core/schemas/builders/primitives/unknown.d.ts +1 -0
  189. package/core/schemas/builders/primitives/unknown.js +6 -0
  190. package/core/schemas/builders/record/index.d.ts +2 -0
  191. package/core/schemas/builders/record/index.js +5 -0
  192. package/core/schemas/builders/record/record.d.ts +3 -0
  193. package/core/schemas/builders/record/record.js +95 -0
  194. package/core/schemas/builders/record/types.d.ts +4 -0
  195. package/core/schemas/builders/record/types.js +2 -0
  196. package/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
  197. package/core/schemas/builders/schema-utils/JsonError.js +12 -0
  198. package/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
  199. package/core/schemas/builders/schema-utils/ParseError.js +12 -0
  200. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
  201. package/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -0
  202. package/core/schemas/builders/schema-utils/index.d.ts +4 -0
  203. package/core/schemas/builders/schema-utils/index.js +11 -0
  204. package/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
  205. package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +10 -0
  206. package/core/schemas/builders/set/index.d.ts +1 -0
  207. package/core/schemas/builders/set/index.js +5 -0
  208. package/core/schemas/builders/set/set.d.ts +2 -0
  209. package/core/schemas/builders/set/set.js +44 -0
  210. package/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
  211. package/core/schemas/builders/undiscriminated-union/index.js +5 -0
  212. package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
  213. package/core/schemas/builders/undiscriminated-union/types.js +2 -0
  214. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
  215. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +40 -0
  216. package/core/schemas/builders/union/discriminant.d.ts +5 -0
  217. package/core/schemas/builders/union/discriminant.js +10 -0
  218. package/core/schemas/builders/union/index.d.ts +4 -0
  219. package/core/schemas/builders/union/index.js +7 -0
  220. package/core/schemas/builders/union/types.d.ts +13 -0
  221. package/core/schemas/builders/union/types.js +2 -0
  222. package/core/schemas/builders/union/union.d.ts +4 -0
  223. package/core/schemas/builders/union/union.js +130 -0
  224. package/core/schemas/index.d.ts +2 -0
  225. package/core/schemas/index.js +17 -0
  226. package/core/schemas/utils/MaybePromise.d.ts +1 -0
  227. package/core/schemas/utils/MaybePromise.js +2 -0
  228. package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
  229. package/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
  230. package/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
  231. package/core/schemas/utils/createIdentitySchemaCreator.js +16 -0
  232. package/core/schemas/utils/entries.d.ts +1 -0
  233. package/core/schemas/utils/entries.js +7 -0
  234. package/core/schemas/utils/filterObject.d.ts +1 -0
  235. package/core/schemas/utils/filterObject.js +14 -0
  236. package/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
  237. package/core/schemas/utils/getErrorMessageForIncorrectType.js +28 -0
  238. package/core/schemas/utils/isPlainObject.d.ts +1 -0
  239. package/core/schemas/utils/isPlainObject.js +18 -0
  240. package/core/schemas/utils/keys.d.ts +1 -0
  241. package/core/schemas/utils/keys.js +7 -0
  242. package/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
  243. package/core/schemas/utils/maybeSkipValidation.js +28 -0
  244. package/core/schemas/utils/partition.d.ts +1 -0
  245. package/core/schemas/utils/partition.js +16 -0
  246. package/dist/Client.d.ts +90 -0
  247. package/dist/Client.js +381 -0
  248. package/dist/api/client/index.d.ts +1 -0
  249. package/dist/api/client/index.js +17 -0
  250. package/dist/api/client/requests/CheckRcsCapabilityRequest.d.ts +21 -0
  251. package/dist/api/client/requests/CheckRcsCapabilityRequest.js +5 -0
  252. package/dist/api/client/requests/UpdateSettingsRequest.d.ts +13 -0
  253. package/dist/api/client/requests/UpdateSettingsRequest.js +5 -0
  254. package/dist/api/client/requests/index.d.ts +2 -0
  255. package/dist/api/client/requests/index.js +2 -0
  256. package/dist/api/errors/BadRequestError.d.ts +8 -0
  257. package/dist/api/errors/BadRequestError.js +41 -0
  258. package/dist/api/errors/InternalServerError.d.ts +8 -0
  259. package/dist/api/errors/InternalServerError.js +41 -0
  260. package/dist/api/errors/UnauthorizedError.d.ts +8 -0
  261. package/dist/api/errors/UnauthorizedError.js +41 -0
  262. package/dist/api/errors/index.d.ts +3 -0
  263. package/dist/api/errors/index.js +19 -0
  264. package/dist/api/index.d.ts +3 -0
  265. package/dist/api/index.js +19 -0
  266. package/dist/api/types/Action.d.ts +5 -0
  267. package/dist/api/types/Action.js +5 -0
  268. package/dist/api/types/BadRequestErrorBody.d.ts +6 -0
  269. package/dist/api/types/BadRequestErrorBody.js +5 -0
  270. package/dist/api/types/BasicRcs.d.ts +13 -0
  271. package/dist/api/types/BasicRcs.js +5 -0
  272. package/dist/api/types/BasicRcsMessage.d.ts +10 -0
  273. package/dist/api/types/BasicRcsMessage.js +5 -0
  274. package/dist/api/types/Call.d.ts +9 -0
  275. package/dist/api/types/Call.js +5 -0
  276. package/dist/api/types/Card.d.ts +16 -0
  277. package/dist/api/types/Card.js +5 -0
  278. package/dist/api/types/CardRcs.d.ts +12 -0
  279. package/dist/api/types/CardRcs.js +5 -0
  280. package/dist/api/types/CardRcsMessage.d.ts +13 -0
  281. package/dist/api/types/CardRcsMessage.js +5 -0
  282. package/dist/api/types/CardStyle.d.ts +16 -0
  283. package/dist/api/types/CardStyle.js +5 -0
  284. package/dist/api/types/CardStyleImageAlignment.d.ts +11 -0
  285. package/dist/api/types/CardStyleImageAlignment.js +10 -0
  286. package/dist/api/types/CardStyleMediaHeight.d.ts +12 -0
  287. package/dist/api/types/CardStyleMediaHeight.js +11 -0
  288. package/dist/api/types/CardStyleOrientation.d.ts +11 -0
  289. package/dist/api/types/CardStyleOrientation.js +10 -0
  290. package/dist/api/types/CardStyleWidth.d.ts +11 -0
  291. package/dist/api/types/CardStyleWidth.js +10 -0
  292. package/dist/api/types/CarouselRcs.d.ts +12 -0
  293. package/dist/api/types/CarouselRcs.js +5 -0
  294. package/dist/api/types/CarouselRcsMessage.d.ts +13 -0
  295. package/dist/api/types/CarouselRcsMessage.js +5 -0
  296. package/dist/api/types/CheckRcsCapabilityResponse.d.ts +7 -0
  297. package/dist/api/types/CheckRcsCapabilityResponse.js +5 -0
  298. package/dist/api/types/Event.d.ts +15 -0
  299. package/dist/api/types/Event.js +5 -0
  300. package/dist/api/types/GetAccountNumberResponse.d.ts +7 -0
  301. package/dist/api/types/GetAccountNumberResponse.js +5 -0
  302. package/dist/api/types/InternalServerErrorBody.d.ts +6 -0
  303. package/dist/api/types/InternalServerErrorBody.js +5 -0
  304. package/dist/api/types/LatLng.d.ts +12 -0
  305. package/dist/api/types/LatLng.js +5 -0
  306. package/dist/api/types/MediaRcs.d.ts +12 -0
  307. package/dist/api/types/MediaRcs.js +5 -0
  308. package/dist/api/types/MediaRcsMessage.d.ts +14 -0
  309. package/dist/api/types/MediaRcsMessage.js +5 -0
  310. package/dist/api/types/MediaType.d.ts +14 -0
  311. package/dist/api/types/MediaType.js +13 -0
  312. package/dist/api/types/PhoneNumber.d.ts +7 -0
  313. package/dist/api/types/PhoneNumber.js +5 -0
  314. package/dist/api/types/Postback.d.ts +11 -0
  315. package/dist/api/types/Postback.js +5 -0
  316. package/dist/api/types/SendRequest.d.ts +5 -0
  317. package/dist/api/types/SendRequest.js +5 -0
  318. package/dist/api/types/SendResponse.d.ts +7 -0
  319. package/dist/api/types/SendResponse.js +5 -0
  320. package/dist/api/types/ShareLocation.d.ts +7 -0
  321. package/dist/api/types/ShareLocation.js +5 -0
  322. package/dist/api/types/Sms.d.ts +12 -0
  323. package/dist/api/types/Sms.js +5 -0
  324. package/dist/api/types/SmsMessage.d.ts +12 -0
  325. package/dist/api/types/SmsMessage.js +5 -0
  326. package/dist/api/types/UnauthorizedErrorBody.d.ts +6 -0
  327. package/dist/api/types/UnauthorizedErrorBody.js +5 -0
  328. package/dist/api/types/UpdateSettingsResponse.d.ts +6 -0
  329. package/dist/api/types/UpdateSettingsResponse.js +5 -0
  330. package/dist/api/types/Url.d.ts +9 -0
  331. package/dist/api/types/Url.js +5 -0
  332. package/dist/api/types/ViewLocation.d.ts +11 -0
  333. package/dist/api/types/ViewLocation.js +5 -0
  334. package/dist/api/types/index.d.ts +34 -0
  335. package/dist/api/types/index.js +50 -0
  336. package/dist/core/fetcher/APIResponse.d.ts +10 -0
  337. package/dist/core/fetcher/APIResponse.js +2 -0
  338. package/dist/core/fetcher/Fetcher.d.ts +39 -0
  339. package/dist/core/fetcher/Fetcher.js +99 -0
  340. package/dist/core/fetcher/Supplier.d.ts +4 -0
  341. package/dist/core/fetcher/Supplier.js +22 -0
  342. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  343. package/dist/core/fetcher/createRequestUrl.js +13 -0
  344. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  345. package/dist/core/fetcher/getFetchFn.js +59 -0
  346. package/dist/core/fetcher/getHeader.d.ts +1 -0
  347. package/dist/core/fetcher/getHeader.js +12 -0
  348. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  349. package/dist/core/fetcher/getRequestBody.js +23 -0
  350. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  351. package/dist/core/fetcher/getResponseBody.js +52 -0
  352. package/dist/core/fetcher/index.d.ts +5 -0
  353. package/dist/core/fetcher/index.js +9 -0
  354. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  355. package/dist/core/fetcher/makeRequest.js +42 -0
  356. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  357. package/dist/core/fetcher/requestWithRetries.js +32 -0
  358. package/dist/core/fetcher/signals.d.ts +12 -0
  359. package/dist/core/fetcher/signals.js +37 -0
  360. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  361. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  362. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  363. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  364. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  365. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  366. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  367. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  368. package/dist/core/index.d.ts +3 -0
  369. package/dist/core/index.js +32 -0
  370. package/dist/core/runtime/index.d.ts +1 -0
  371. package/dist/core/runtime/index.js +5 -0
  372. package/dist/core/runtime/runtime.d.ts +9 -0
  373. package/dist/core/runtime/runtime.js +93 -0
  374. package/dist/core/schemas/Schema.d.ts +85 -0
  375. package/dist/core/schemas/Schema.js +22 -0
  376. package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
  377. package/dist/core/schemas/builders/bigint/bigint.js +50 -0
  378. package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
  379. package/dist/core/schemas/builders/bigint/index.js +5 -0
  380. package/dist/core/schemas/builders/date/date.d.ts +2 -0
  381. package/dist/core/schemas/builders/date/date.js +63 -0
  382. package/dist/core/schemas/builders/date/index.d.ts +1 -0
  383. package/dist/core/schemas/builders/date/index.js +5 -0
  384. package/dist/core/schemas/builders/enum/enum.d.ts +2 -0
  385. package/dist/core/schemas/builders/enum/enum.js +39 -0
  386. package/dist/core/schemas/builders/enum/index.d.ts +1 -0
  387. package/dist/core/schemas/builders/enum/index.js +5 -0
  388. package/dist/core/schemas/builders/index.d.ts +14 -0
  389. package/dist/core/schemas/builders/index.js +30 -0
  390. package/dist/core/schemas/builders/lazy/index.d.ts +3 -0
  391. package/dist/core/schemas/builders/lazy/index.js +7 -0
  392. package/dist/core/schemas/builders/lazy/lazy.d.ts +5 -0
  393. package/dist/core/schemas/builders/lazy/lazy.js +25 -0
  394. package/dist/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
  395. package/dist/core/schemas/builders/lazy/lazyObject.js +12 -0
  396. package/dist/core/schemas/builders/list/index.d.ts +1 -0
  397. package/dist/core/schemas/builders/list/index.js +5 -0
  398. package/dist/core/schemas/builders/list/list.d.ts +2 -0
  399. package/dist/core/schemas/builders/list/list.js +55 -0
  400. package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  401. package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -0
  402. package/dist/core/schemas/builders/literals/index.d.ts +2 -0
  403. package/dist/core/schemas/builders/literals/index.js +7 -0
  404. package/dist/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
  405. package/dist/core/schemas/builders/literals/stringLiteral.js +29 -0
  406. package/dist/core/schemas/builders/object/index.d.ts +6 -0
  407. package/dist/core/schemas/builders/object/index.js +11 -0
  408. package/dist/core/schemas/builders/object/object.d.ts +3 -0
  409. package/dist/core/schemas/builders/object/object.js +233 -0
  410. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  411. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
  412. package/dist/core/schemas/builders/object/property.d.ts +8 -0
  413. package/dist/core/schemas/builders/object/property.js +16 -0
  414. package/dist/core/schemas/builders/object/types.d.ts +26 -0
  415. package/dist/core/schemas/builders/object/types.js +2 -0
  416. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
  417. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +54 -0
  418. package/dist/core/schemas/builders/object-like/index.d.ts +2 -0
  419. package/dist/core/schemas/builders/object-like/index.js +6 -0
  420. package/dist/core/schemas/builders/object-like/types.d.ts +7 -0
  421. package/dist/core/schemas/builders/object-like/types.js +2 -0
  422. package/dist/core/schemas/builders/primitives/any.d.ts +1 -0
  423. package/dist/core/schemas/builders/primitives/any.js +6 -0
  424. package/dist/core/schemas/builders/primitives/boolean.d.ts +1 -0
  425. package/dist/core/schemas/builders/primitives/boolean.js +25 -0
  426. package/dist/core/schemas/builders/primitives/index.d.ts +5 -0
  427. package/dist/core/schemas/builders/primitives/index.js +13 -0
  428. package/dist/core/schemas/builders/primitives/number.d.ts +1 -0
  429. package/dist/core/schemas/builders/primitives/number.js +25 -0
  430. package/dist/core/schemas/builders/primitives/string.d.ts +1 -0
  431. package/dist/core/schemas/builders/primitives/string.js +25 -0
  432. package/dist/core/schemas/builders/primitives/unknown.d.ts +1 -0
  433. package/dist/core/schemas/builders/primitives/unknown.js +6 -0
  434. package/dist/core/schemas/builders/record/index.d.ts +2 -0
  435. package/dist/core/schemas/builders/record/index.js +5 -0
  436. package/dist/core/schemas/builders/record/record.d.ts +3 -0
  437. package/dist/core/schemas/builders/record/record.js +95 -0
  438. package/dist/core/schemas/builders/record/types.d.ts +4 -0
  439. package/dist/core/schemas/builders/record/types.js +2 -0
  440. package/dist/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
  441. package/dist/core/schemas/builders/schema-utils/JsonError.js +12 -0
  442. package/dist/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
  443. package/dist/core/schemas/builders/schema-utils/ParseError.js +12 -0
  444. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
  445. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -0
  446. package/dist/core/schemas/builders/schema-utils/index.d.ts +4 -0
  447. package/dist/core/schemas/builders/schema-utils/index.js +11 -0
  448. package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
  449. package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +10 -0
  450. package/dist/core/schemas/builders/set/index.d.ts +1 -0
  451. package/dist/core/schemas/builders/set/index.js +5 -0
  452. package/dist/core/schemas/builders/set/set.d.ts +2 -0
  453. package/dist/core/schemas/builders/set/set.js +44 -0
  454. package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
  455. package/dist/core/schemas/builders/undiscriminated-union/index.js +5 -0
  456. package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
  457. package/dist/core/schemas/builders/undiscriminated-union/types.js +2 -0
  458. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
  459. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +40 -0
  460. package/dist/core/schemas/builders/union/discriminant.d.ts +5 -0
  461. package/dist/core/schemas/builders/union/discriminant.js +10 -0
  462. package/dist/core/schemas/builders/union/index.d.ts +4 -0
  463. package/dist/core/schemas/builders/union/index.js +7 -0
  464. package/dist/core/schemas/builders/union/types.d.ts +13 -0
  465. package/dist/core/schemas/builders/union/types.js +2 -0
  466. package/dist/core/schemas/builders/union/union.d.ts +4 -0
  467. package/dist/core/schemas/builders/union/union.js +130 -0
  468. package/dist/core/schemas/index.d.ts +2 -0
  469. package/dist/core/schemas/index.js +17 -0
  470. package/dist/core/schemas/utils/MaybePromise.d.ts +1 -0
  471. package/dist/core/schemas/utils/MaybePromise.js +2 -0
  472. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
  473. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
  474. package/dist/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
  475. package/dist/core/schemas/utils/createIdentitySchemaCreator.js +16 -0
  476. package/dist/core/schemas/utils/entries.d.ts +1 -0
  477. package/dist/core/schemas/utils/entries.js +7 -0
  478. package/dist/core/schemas/utils/filterObject.d.ts +1 -0
  479. package/dist/core/schemas/utils/filterObject.js +14 -0
  480. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
  481. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +28 -0
  482. package/dist/core/schemas/utils/isPlainObject.d.ts +1 -0
  483. package/dist/core/schemas/utils/isPlainObject.js +18 -0
  484. package/dist/core/schemas/utils/keys.d.ts +1 -0
  485. package/dist/core/schemas/utils/keys.js +7 -0
  486. package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
  487. package/dist/core/schemas/utils/maybeSkipValidation.js +28 -0
  488. package/dist/core/schemas/utils/partition.d.ts +1 -0
  489. package/dist/core/schemas/utils/partition.js +16 -0
  490. package/dist/environments.d.ts +7 -0
  491. package/dist/environments.js +9 -0
  492. package/dist/errors/PinnacleError.d.ts +12 -0
  493. package/dist/errors/PinnacleError.js +32 -0
  494. package/dist/errors/PinnacleTimeoutError.d.ts +6 -0
  495. package/dist/errors/PinnacleTimeoutError.js +13 -0
  496. package/dist/errors/index.d.ts +2 -0
  497. package/dist/errors/index.js +7 -0
  498. package/dist/index.d.ts +4 -0
  499. package/dist/index.js +32 -5
  500. package/dist/serialization/client/index.d.ts +1 -0
  501. package/dist/serialization/client/index.js +17 -0
  502. package/dist/serialization/client/requests/UpdateSettingsRequest.d.ts +12 -0
  503. package/dist/serialization/client/requests/UpdateSettingsRequest.js +33 -0
  504. package/dist/serialization/client/requests/index.d.ts +1 -0
  505. package/dist/serialization/client/requests/index.js +5 -0
  506. package/dist/serialization/index.d.ts +2 -0
  507. package/dist/serialization/index.js +18 -0
  508. package/dist/serialization/types/Action.d.ts +15 -0
  509. package/dist/serialization/types/Action.js +36 -0
  510. package/dist/serialization/types/BadRequestErrorBody.d.ts +12 -0
  511. package/dist/serialization/types/BadRequestErrorBody.js +33 -0
  512. package/dist/serialization/types/BasicRcs.d.ts +18 -0
  513. package/dist/serialization/types/BasicRcs.js +39 -0
  514. package/dist/serialization/types/BasicRcsMessage.d.ts +12 -0
  515. package/dist/serialization/types/BasicRcsMessage.js +33 -0
  516. package/dist/serialization/types/Call.d.ts +13 -0
  517. package/dist/serialization/types/Call.js +34 -0
  518. package/dist/serialization/types/Card.d.ts +18 -0
  519. package/dist/serialization/types/Card.js +39 -0
  520. package/dist/serialization/types/CardRcs.d.ts +16 -0
  521. package/dist/serialization/types/CardRcs.js +37 -0
  522. package/dist/serialization/types/CardRcsMessage.d.ts +15 -0
  523. package/dist/serialization/types/CardRcsMessage.js +36 -0
  524. package/dist/serialization/types/CardStyle.d.ts +20 -0
  525. package/dist/serialization/types/CardStyle.js +41 -0
  526. package/dist/serialization/types/CardStyleImageAlignment.d.ts +10 -0
  527. package/dist/serialization/types/CardStyleImageAlignment.js +31 -0
  528. package/dist/serialization/types/CardStyleMediaHeight.d.ts +10 -0
  529. package/dist/serialization/types/CardStyleMediaHeight.js +31 -0
  530. package/dist/serialization/types/CardStyleOrientation.d.ts +10 -0
  531. package/dist/serialization/types/CardStyleOrientation.js +31 -0
  532. package/dist/serialization/types/CardStyleWidth.d.ts +10 -0
  533. package/dist/serialization/types/CardStyleWidth.js +31 -0
  534. package/dist/serialization/types/CarouselRcs.d.ts +16 -0
  535. package/dist/serialization/types/CarouselRcs.js +37 -0
  536. package/dist/serialization/types/CarouselRcsMessage.d.ts +15 -0
  537. package/dist/serialization/types/CarouselRcsMessage.js +36 -0
  538. package/dist/serialization/types/CheckRcsCapabilityResponse.d.ts +13 -0
  539. package/dist/serialization/types/CheckRcsCapabilityResponse.js +34 -0
  540. package/dist/serialization/types/Event.d.ts +16 -0
  541. package/dist/serialization/types/Event.js +37 -0
  542. package/dist/serialization/types/GetAccountNumberResponse.d.ts +12 -0
  543. package/dist/serialization/types/GetAccountNumberResponse.js +33 -0
  544. package/dist/serialization/types/InternalServerErrorBody.d.ts +12 -0
  545. package/dist/serialization/types/InternalServerErrorBody.js +33 -0
  546. package/dist/serialization/types/LatLng.d.ts +13 -0
  547. package/dist/serialization/types/LatLng.js +34 -0
  548. package/dist/serialization/types/MediaRcs.d.ts +16 -0
  549. package/dist/serialization/types/MediaRcs.js +37 -0
  550. package/dist/serialization/types/MediaRcsMessage.d.ts +16 -0
  551. package/dist/serialization/types/MediaRcsMessage.js +37 -0
  552. package/dist/serialization/types/MediaType.d.ts +10 -0
  553. package/dist/serialization/types/MediaType.js +31 -0
  554. package/dist/serialization/types/PhoneNumber.d.ts +10 -0
  555. package/dist/serialization/types/PhoneNumber.js +31 -0
  556. package/dist/serialization/types/Postback.d.ts +14 -0
  557. package/dist/serialization/types/Postback.js +35 -0
  558. package/dist/serialization/types/SendRequest.d.ts +15 -0
  559. package/dist/serialization/types/SendRequest.js +36 -0
  560. package/dist/serialization/types/SendResponse.d.ts +12 -0
  561. package/dist/serialization/types/SendResponse.js +33 -0
  562. package/dist/serialization/types/ShareLocation.d.ts +12 -0
  563. package/dist/serialization/types/ShareLocation.js +33 -0
  564. package/dist/serialization/types/Sms.d.ts +16 -0
  565. package/dist/serialization/types/Sms.js +37 -0
  566. package/dist/serialization/types/SmsMessage.d.ts +13 -0
  567. package/dist/serialization/types/SmsMessage.js +34 -0
  568. package/dist/serialization/types/UnauthorizedErrorBody.d.ts +12 -0
  569. package/dist/serialization/types/UnauthorizedErrorBody.js +33 -0
  570. package/dist/serialization/types/UpdateSettingsResponse.d.ts +12 -0
  571. package/dist/serialization/types/UpdateSettingsResponse.js +33 -0
  572. package/dist/serialization/types/Url.d.ts +13 -0
  573. package/dist/serialization/types/Url.js +34 -0
  574. package/dist/serialization/types/ViewLocation.d.ts +15 -0
  575. package/dist/serialization/types/ViewLocation.js +36 -0
  576. package/dist/serialization/types/index.d.ts +34 -0
  577. package/dist/serialization/types/index.js +50 -0
  578. package/dist/version.d.ts +1 -0
  579. package/dist/version.js +4 -0
  580. package/environments.d.ts +7 -0
  581. package/environments.js +9 -0
  582. package/errors/PinnacleError.d.ts +12 -0
  583. package/errors/PinnacleError.js +32 -0
  584. package/errors/PinnacleTimeoutError.d.ts +6 -0
  585. package/errors/PinnacleTimeoutError.js +13 -0
  586. package/errors/index.d.ts +2 -0
  587. package/errors/index.js +7 -0
  588. package/index.d.ts +4 -0
  589. package/index.js +34 -0
  590. package/jest.config.js +5 -0
  591. package/package.json +42 -24
  592. package/reference.md +71 -0
  593. package/serialization/client/index.d.ts +1 -0
  594. package/serialization/client/index.js +17 -0
  595. package/serialization/client/requests/UpdateSettingsRequest.d.ts +12 -0
  596. package/serialization/client/requests/UpdateSettingsRequest.js +33 -0
  597. package/serialization/client/requests/index.d.ts +1 -0
  598. package/serialization/client/requests/index.js +5 -0
  599. package/serialization/index.d.ts +2 -0
  600. package/serialization/index.js +18 -0
  601. package/serialization/types/Action.d.ts +15 -0
  602. package/serialization/types/Action.js +36 -0
  603. package/serialization/types/BadRequestErrorBody.d.ts +12 -0
  604. package/serialization/types/BadRequestErrorBody.js +33 -0
  605. package/serialization/types/BasicRcs.d.ts +18 -0
  606. package/serialization/types/BasicRcs.js +39 -0
  607. package/serialization/types/BasicRcsMessage.d.ts +12 -0
  608. package/serialization/types/BasicRcsMessage.js +33 -0
  609. package/serialization/types/Call.d.ts +13 -0
  610. package/serialization/types/Call.js +34 -0
  611. package/serialization/types/Card.d.ts +18 -0
  612. package/serialization/types/Card.js +39 -0
  613. package/serialization/types/CardRcs.d.ts +16 -0
  614. package/serialization/types/CardRcs.js +37 -0
  615. package/serialization/types/CardRcsMessage.d.ts +15 -0
  616. package/serialization/types/CardRcsMessage.js +36 -0
  617. package/serialization/types/CardStyle.d.ts +20 -0
  618. package/serialization/types/CardStyle.js +41 -0
  619. package/serialization/types/CardStyleImageAlignment.d.ts +10 -0
  620. package/serialization/types/CardStyleImageAlignment.js +31 -0
  621. package/serialization/types/CardStyleMediaHeight.d.ts +10 -0
  622. package/serialization/types/CardStyleMediaHeight.js +31 -0
  623. package/serialization/types/CardStyleOrientation.d.ts +10 -0
  624. package/serialization/types/CardStyleOrientation.js +31 -0
  625. package/serialization/types/CardStyleWidth.d.ts +10 -0
  626. package/serialization/types/CardStyleWidth.js +31 -0
  627. package/serialization/types/CarouselRcs.d.ts +16 -0
  628. package/serialization/types/CarouselRcs.js +37 -0
  629. package/serialization/types/CarouselRcsMessage.d.ts +15 -0
  630. package/serialization/types/CarouselRcsMessage.js +36 -0
  631. package/serialization/types/CheckRcsCapabilityResponse.d.ts +13 -0
  632. package/serialization/types/CheckRcsCapabilityResponse.js +34 -0
  633. package/serialization/types/Event.d.ts +16 -0
  634. package/serialization/types/Event.js +37 -0
  635. package/serialization/types/GetAccountNumberResponse.d.ts +12 -0
  636. package/serialization/types/GetAccountNumberResponse.js +33 -0
  637. package/serialization/types/InternalServerErrorBody.d.ts +12 -0
  638. package/serialization/types/InternalServerErrorBody.js +33 -0
  639. package/serialization/types/LatLng.d.ts +13 -0
  640. package/serialization/types/LatLng.js +34 -0
  641. package/serialization/types/MediaRcs.d.ts +16 -0
  642. package/serialization/types/MediaRcs.js +37 -0
  643. package/serialization/types/MediaRcsMessage.d.ts +16 -0
  644. package/serialization/types/MediaRcsMessage.js +37 -0
  645. package/serialization/types/MediaType.d.ts +10 -0
  646. package/serialization/types/MediaType.js +31 -0
  647. package/serialization/types/PhoneNumber.d.ts +10 -0
  648. package/serialization/types/PhoneNumber.js +31 -0
  649. package/serialization/types/Postback.d.ts +14 -0
  650. package/serialization/types/Postback.js +35 -0
  651. package/serialization/types/SendRequest.d.ts +15 -0
  652. package/serialization/types/SendRequest.js +36 -0
  653. package/serialization/types/SendResponse.d.ts +12 -0
  654. package/serialization/types/SendResponse.js +33 -0
  655. package/serialization/types/ShareLocation.d.ts +12 -0
  656. package/serialization/types/ShareLocation.js +33 -0
  657. package/serialization/types/Sms.d.ts +16 -0
  658. package/serialization/types/Sms.js +37 -0
  659. package/serialization/types/SmsMessage.d.ts +13 -0
  660. package/serialization/types/SmsMessage.js +34 -0
  661. package/serialization/types/UnauthorizedErrorBody.d.ts +12 -0
  662. package/serialization/types/UnauthorizedErrorBody.js +33 -0
  663. package/serialization/types/UpdateSettingsResponse.d.ts +12 -0
  664. package/serialization/types/UpdateSettingsResponse.js +33 -0
  665. package/serialization/types/Url.d.ts +13 -0
  666. package/serialization/types/Url.js +34 -0
  667. package/serialization/types/ViewLocation.d.ts +15 -0
  668. package/serialization/types/ViewLocation.js +36 -0
  669. package/serialization/types/index.d.ts +34 -0
  670. package/serialization/types/index.js +50 -0
  671. package/version.d.ts +1 -0
  672. package/version.js +4 -0
package/Client.d.ts ADDED
@@ -0,0 +1,90 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "./environments";
5
+ import * as core from "./core";
6
+ import * as Pinnacle from "./api/index";
7
+ export declare namespace PinnacleClient {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.PinnacleEnvironment | string>;
10
+ apiKey: core.Supplier<string>;
11
+ }
12
+ interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
14
+ timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
16
+ maxRetries?: number;
17
+ /** A hook to abort the request. */
18
+ abortSignal?: AbortSignal;
19
+ }
20
+ }
21
+ export declare class PinnacleClient {
22
+ protected readonly _options: PinnacleClient.Options;
23
+ constructor(_options: PinnacleClient.Options);
24
+ /**
25
+ * Checks if a phone number is able to receive RCS
26
+ *
27
+ * @param {Pinnacle.CheckRcsCapabilityRequest} request
28
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
29
+ *
30
+ * @throws {@link Pinnacle.BadRequestError}
31
+ * @throws {@link Pinnacle.UnauthorizedError}
32
+ * @throws {@link Pinnacle.InternalServerError}
33
+ *
34
+ * @example
35
+ * await client.checkRcsCapability({
36
+ * phoneNumber: "phone_number"
37
+ * })
38
+ */
39
+ checkRcsCapability(request: Pinnacle.CheckRcsCapabilityRequest, requestOptions?: PinnacleClient.RequestOptions): Promise<Pinnacle.CheckRcsCapabilityResponse>;
40
+ /**
41
+ * Initializes settings related to RCS messaging, including webhook registration.
42
+ *
43
+ * @param {Pinnacle.UpdateSettingsRequest} request
44
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
45
+ *
46
+ * @throws {@link Pinnacle.BadRequestError}
47
+ * @throws {@link Pinnacle.UnauthorizedError}
48
+ * @throws {@link Pinnacle.InternalServerError}
49
+ *
50
+ * @example
51
+ * await client.updateSettings({
52
+ * webhookUrl: "webhook_url"
53
+ * })
54
+ */
55
+ updateSettings(request: Pinnacle.UpdateSettingsRequest, requestOptions?: PinnacleClient.RequestOptions): Promise<Pinnacle.UpdateSettingsResponse>;
56
+ /**
57
+ * Retrieve the phone number associated with the account.
58
+ *
59
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
60
+ *
61
+ * @throws {@link Pinnacle.UnauthorizedError}
62
+ * @throws {@link Pinnacle.InternalServerError}
63
+ *
64
+ * @example
65
+ * await client.getAccountNumber()
66
+ */
67
+ getAccountNumber(requestOptions?: PinnacleClient.RequestOptions): Promise<Pinnacle.GetAccountNumberResponse>;
68
+ /**
69
+ * Send a SMS or RCS message to a phone number
70
+ *
71
+ * @param {Pinnacle.SendRequest} request
72
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
73
+ *
74
+ * @throws {@link Pinnacle.BadRequestError}
75
+ * @throws {@link Pinnacle.UnauthorizedError}
76
+ * @throws {@link Pinnacle.InternalServerError}
77
+ *
78
+ * @example
79
+ * await client.send({
80
+ * messageType: "sms",
81
+ * message: {
82
+ * body: "body"
83
+ * }
84
+ * })
85
+ */
86
+ send(request: Pinnacle.SendRequest, requestOptions?: PinnacleClient.RequestOptions): Promise<Pinnacle.SendResponse>;
87
+ protected _getCustomAuthorizationHeaders(): Promise<{
88
+ "PINNACLE-API-Key": string;
89
+ }>;
90
+ }
package/Client.js ADDED
@@ -0,0 +1,381 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __importDefault = (this && this.__importDefault) || function (mod) {
38
+ return (mod && mod.__esModule) ? mod : { "default": mod };
39
+ };
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.PinnacleClient = void 0;
42
+ const environments = __importStar(require("./environments"));
43
+ const core = __importStar(require("./core"));
44
+ const Pinnacle = __importStar(require("./api/index"));
45
+ const url_join_1 = __importDefault(require("url-join"));
46
+ const serializers = __importStar(require("./serialization/index"));
47
+ const errors = __importStar(require("./errors/index"));
48
+ class PinnacleClient {
49
+ constructor(_options) {
50
+ this._options = _options;
51
+ }
52
+ /**
53
+ * Checks if a phone number is able to receive RCS
54
+ *
55
+ * @param {Pinnacle.CheckRcsCapabilityRequest} request
56
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link Pinnacle.BadRequestError}
59
+ * @throws {@link Pinnacle.UnauthorizedError}
60
+ * @throws {@link Pinnacle.InternalServerError}
61
+ *
62
+ * @example
63
+ * await client.checkRcsCapability({
64
+ * phoneNumber: "phone_number"
65
+ * })
66
+ */
67
+ checkRcsCapability(request, requestOptions) {
68
+ var _a;
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const { phoneNumber } = request;
71
+ const _queryParams = {};
72
+ _queryParams["phone_number"] = phoneNumber;
73
+ const _response = yield core.fetcher({
74
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "check_rcs"),
75
+ method: "GET",
76
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.1", "User-Agent": "rcs-js/1.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
77
+ contentType: "application/json",
78
+ queryParameters: _queryParams,
79
+ requestType: "json",
80
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
81
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
82
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
83
+ });
84
+ if (_response.ok) {
85
+ return serializers.CheckRcsCapabilityResponse.parseOrThrow(_response.body, {
86
+ unrecognizedObjectKeys: "passthrough",
87
+ allowUnrecognizedUnionMembers: true,
88
+ allowUnrecognizedEnumValues: true,
89
+ breadcrumbsPrefix: ["response"],
90
+ });
91
+ }
92
+ if (_response.error.reason === "status-code") {
93
+ switch (_response.error.statusCode) {
94
+ case 400:
95
+ throw new Pinnacle.BadRequestError(serializers.BadRequestErrorBody.parseOrThrow(_response.error.body, {
96
+ unrecognizedObjectKeys: "passthrough",
97
+ allowUnrecognizedUnionMembers: true,
98
+ allowUnrecognizedEnumValues: true,
99
+ breadcrumbsPrefix: ["response"],
100
+ }));
101
+ case 401:
102
+ throw new Pinnacle.UnauthorizedError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
103
+ unrecognizedObjectKeys: "passthrough",
104
+ allowUnrecognizedUnionMembers: true,
105
+ allowUnrecognizedEnumValues: true,
106
+ breadcrumbsPrefix: ["response"],
107
+ }));
108
+ case 500:
109
+ throw new Pinnacle.InternalServerError(serializers.InternalServerErrorBody.parseOrThrow(_response.error.body, {
110
+ unrecognizedObjectKeys: "passthrough",
111
+ allowUnrecognizedUnionMembers: true,
112
+ allowUnrecognizedEnumValues: true,
113
+ breadcrumbsPrefix: ["response"],
114
+ }));
115
+ default:
116
+ throw new errors.PinnacleError({
117
+ statusCode: _response.error.statusCode,
118
+ body: _response.error.body,
119
+ });
120
+ }
121
+ }
122
+ switch (_response.error.reason) {
123
+ case "non-json":
124
+ throw new errors.PinnacleError({
125
+ statusCode: _response.error.statusCode,
126
+ body: _response.error.rawBody,
127
+ });
128
+ case "timeout":
129
+ throw new errors.PinnacleTimeoutError();
130
+ case "unknown":
131
+ throw new errors.PinnacleError({
132
+ message: _response.error.errorMessage,
133
+ });
134
+ }
135
+ });
136
+ }
137
+ /**
138
+ * Initializes settings related to RCS messaging, including webhook registration.
139
+ *
140
+ * @param {Pinnacle.UpdateSettingsRequest} request
141
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @throws {@link Pinnacle.BadRequestError}
144
+ * @throws {@link Pinnacle.UnauthorizedError}
145
+ * @throws {@link Pinnacle.InternalServerError}
146
+ *
147
+ * @example
148
+ * await client.updateSettings({
149
+ * webhookUrl: "webhook_url"
150
+ * })
151
+ */
152
+ updateSettings(request, requestOptions) {
153
+ var _a;
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ const _response = yield core.fetcher({
156
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "update_settings"),
157
+ method: "POST",
158
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.1", "User-Agent": "rcs-js/1.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
159
+ contentType: "application/json",
160
+ requestType: "json",
161
+ body: serializers.UpdateSettingsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
162
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
163
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
164
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
165
+ });
166
+ if (_response.ok) {
167
+ return serializers.UpdateSettingsResponse.parseOrThrow(_response.body, {
168
+ unrecognizedObjectKeys: "passthrough",
169
+ allowUnrecognizedUnionMembers: true,
170
+ allowUnrecognizedEnumValues: true,
171
+ breadcrumbsPrefix: ["response"],
172
+ });
173
+ }
174
+ if (_response.error.reason === "status-code") {
175
+ switch (_response.error.statusCode) {
176
+ case 400:
177
+ throw new Pinnacle.BadRequestError(serializers.BadRequestErrorBody.parseOrThrow(_response.error.body, {
178
+ unrecognizedObjectKeys: "passthrough",
179
+ allowUnrecognizedUnionMembers: true,
180
+ allowUnrecognizedEnumValues: true,
181
+ breadcrumbsPrefix: ["response"],
182
+ }));
183
+ case 401:
184
+ throw new Pinnacle.UnauthorizedError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
185
+ unrecognizedObjectKeys: "passthrough",
186
+ allowUnrecognizedUnionMembers: true,
187
+ allowUnrecognizedEnumValues: true,
188
+ breadcrumbsPrefix: ["response"],
189
+ }));
190
+ case 500:
191
+ throw new Pinnacle.InternalServerError(serializers.InternalServerErrorBody.parseOrThrow(_response.error.body, {
192
+ unrecognizedObjectKeys: "passthrough",
193
+ allowUnrecognizedUnionMembers: true,
194
+ allowUnrecognizedEnumValues: true,
195
+ breadcrumbsPrefix: ["response"],
196
+ }));
197
+ default:
198
+ throw new errors.PinnacleError({
199
+ statusCode: _response.error.statusCode,
200
+ body: _response.error.body,
201
+ });
202
+ }
203
+ }
204
+ switch (_response.error.reason) {
205
+ case "non-json":
206
+ throw new errors.PinnacleError({
207
+ statusCode: _response.error.statusCode,
208
+ body: _response.error.rawBody,
209
+ });
210
+ case "timeout":
211
+ throw new errors.PinnacleTimeoutError();
212
+ case "unknown":
213
+ throw new errors.PinnacleError({
214
+ message: _response.error.errorMessage,
215
+ });
216
+ }
217
+ });
218
+ }
219
+ /**
220
+ * Retrieve the phone number associated with the account.
221
+ *
222
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
223
+ *
224
+ * @throws {@link Pinnacle.UnauthorizedError}
225
+ * @throws {@link Pinnacle.InternalServerError}
226
+ *
227
+ * @example
228
+ * await client.getAccountNumber()
229
+ */
230
+ getAccountNumber(requestOptions) {
231
+ var _a;
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ const _response = yield core.fetcher({
234
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "get_account_number"),
235
+ method: "GET",
236
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.1", "User-Agent": "rcs-js/1.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
237
+ contentType: "application/json",
238
+ requestType: "json",
239
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
240
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
241
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
242
+ });
243
+ if (_response.ok) {
244
+ return serializers.GetAccountNumberResponse.parseOrThrow(_response.body, {
245
+ unrecognizedObjectKeys: "passthrough",
246
+ allowUnrecognizedUnionMembers: true,
247
+ allowUnrecognizedEnumValues: true,
248
+ breadcrumbsPrefix: ["response"],
249
+ });
250
+ }
251
+ if (_response.error.reason === "status-code") {
252
+ switch (_response.error.statusCode) {
253
+ case 401:
254
+ throw new Pinnacle.UnauthorizedError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
255
+ unrecognizedObjectKeys: "passthrough",
256
+ allowUnrecognizedUnionMembers: true,
257
+ allowUnrecognizedEnumValues: true,
258
+ breadcrumbsPrefix: ["response"],
259
+ }));
260
+ case 500:
261
+ throw new Pinnacle.InternalServerError(serializers.InternalServerErrorBody.parseOrThrow(_response.error.body, {
262
+ unrecognizedObjectKeys: "passthrough",
263
+ allowUnrecognizedUnionMembers: true,
264
+ allowUnrecognizedEnumValues: true,
265
+ breadcrumbsPrefix: ["response"],
266
+ }));
267
+ default:
268
+ throw new errors.PinnacleError({
269
+ statusCode: _response.error.statusCode,
270
+ body: _response.error.body,
271
+ });
272
+ }
273
+ }
274
+ switch (_response.error.reason) {
275
+ case "non-json":
276
+ throw new errors.PinnacleError({
277
+ statusCode: _response.error.statusCode,
278
+ body: _response.error.rawBody,
279
+ });
280
+ case "timeout":
281
+ throw new errors.PinnacleTimeoutError();
282
+ case "unknown":
283
+ throw new errors.PinnacleError({
284
+ message: _response.error.errorMessage,
285
+ });
286
+ }
287
+ });
288
+ }
289
+ /**
290
+ * Send a SMS or RCS message to a phone number
291
+ *
292
+ * @param {Pinnacle.SendRequest} request
293
+ * @param {PinnacleClient.RequestOptions} requestOptions - Request-specific configuration.
294
+ *
295
+ * @throws {@link Pinnacle.BadRequestError}
296
+ * @throws {@link Pinnacle.UnauthorizedError}
297
+ * @throws {@link Pinnacle.InternalServerError}
298
+ *
299
+ * @example
300
+ * await client.send({
301
+ * messageType: "sms",
302
+ * message: {
303
+ * body: "body"
304
+ * }
305
+ * })
306
+ */
307
+ send(request, requestOptions) {
308
+ var _a;
309
+ return __awaiter(this, void 0, void 0, function* () {
310
+ const _response = yield core.fetcher({
311
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send"),
312
+ method: "POST",
313
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.1", "User-Agent": "rcs-js/1.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
314
+ contentType: "application/json",
315
+ requestType: "json",
316
+ body: serializers.SendRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
317
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
318
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
319
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
320
+ });
321
+ if (_response.ok) {
322
+ return serializers.SendResponse.parseOrThrow(_response.body, {
323
+ unrecognizedObjectKeys: "passthrough",
324
+ allowUnrecognizedUnionMembers: true,
325
+ allowUnrecognizedEnumValues: true,
326
+ breadcrumbsPrefix: ["response"],
327
+ });
328
+ }
329
+ if (_response.error.reason === "status-code") {
330
+ switch (_response.error.statusCode) {
331
+ case 400:
332
+ throw new Pinnacle.BadRequestError(serializers.BadRequestErrorBody.parseOrThrow(_response.error.body, {
333
+ unrecognizedObjectKeys: "passthrough",
334
+ allowUnrecognizedUnionMembers: true,
335
+ allowUnrecognizedEnumValues: true,
336
+ breadcrumbsPrefix: ["response"],
337
+ }));
338
+ case 401:
339
+ throw new Pinnacle.UnauthorizedError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
340
+ unrecognizedObjectKeys: "passthrough",
341
+ allowUnrecognizedUnionMembers: true,
342
+ allowUnrecognizedEnumValues: true,
343
+ breadcrumbsPrefix: ["response"],
344
+ }));
345
+ case 500:
346
+ throw new Pinnacle.InternalServerError(serializers.InternalServerErrorBody.parseOrThrow(_response.error.body, {
347
+ unrecognizedObjectKeys: "passthrough",
348
+ allowUnrecognizedUnionMembers: true,
349
+ allowUnrecognizedEnumValues: true,
350
+ breadcrumbsPrefix: ["response"],
351
+ }));
352
+ default:
353
+ throw new errors.PinnacleError({
354
+ statusCode: _response.error.statusCode,
355
+ body: _response.error.body,
356
+ });
357
+ }
358
+ }
359
+ switch (_response.error.reason) {
360
+ case "non-json":
361
+ throw new errors.PinnacleError({
362
+ statusCode: _response.error.statusCode,
363
+ body: _response.error.rawBody,
364
+ });
365
+ case "timeout":
366
+ throw new errors.PinnacleTimeoutError();
367
+ case "unknown":
368
+ throw new errors.PinnacleError({
369
+ message: _response.error.errorMessage,
370
+ });
371
+ }
372
+ });
373
+ }
374
+ _getCustomAuthorizationHeaders() {
375
+ return __awaiter(this, void 0, void 0, function* () {
376
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
377
+ return { "PINNACLE-API-Key": apiKeyValue };
378
+ });
379
+ }
380
+ }
381
+ exports.PinnacleClient = PinnacleClient;
package/README.md ADDED
@@ -0,0 +1,137 @@
1
+ # Pinnacle TypeScript Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)
4
+ [![npm shield](https://img.shields.io/npm/v/rcs-js)](https://www.npmjs.com/package/rcs-js)
5
+
6
+ The Pinnacle TypeScript library provides convenient access to the Pinnacle API from TypeScript.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ npm i -s rcs-js
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ Instantiate and use the client with the following:
17
+
18
+ ```typescript
19
+ import { PinnacleClient } from "rcs-js";
20
+
21
+ const client = new PinnacleClient({ apiKey: "YOUR_API_KEY" });
22
+ await client.updateSettings({
23
+ webhookUrl: "webhook_url",
24
+ });
25
+ ```
26
+
27
+ ## Request And Response Types
28
+
29
+ The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
30
+ following namespace:
31
+
32
+ ```typescript
33
+ import { Pinnacle } from "rcs-js";
34
+
35
+ const request: Pinnacle.CheckRcsCapabilityRequest = {
36
+ ...
37
+ };
38
+ ```
39
+
40
+ ## Exception Handling
41
+
42
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
43
+ will be thrown.
44
+
45
+ ```typescript
46
+ import { PinnacleError } from "rcs-js";
47
+
48
+ try {
49
+ await client.updateSettings(...);
50
+ } catch (err) {
51
+ if (err instanceof PinnacleError) {
52
+ console.log(err.statusCode);
53
+ console.log(err.message);
54
+ console.log(err.body);
55
+ }
56
+ }
57
+ ```
58
+
59
+ ## Advanced
60
+
61
+ ### Retries
62
+
63
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
64
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
65
+ retry limit (default: 2).
66
+
67
+ A request is deemed retriable when any of the following HTTP status codes is returned:
68
+
69
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
70
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
71
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
72
+
73
+ Use the `maxRetries` request option to configure this behavior.
74
+
75
+ ```typescript
76
+ const response = await client.updateSettings(..., {
77
+ maxRetries: 0 // override maxRetries at the request level
78
+ });
79
+ ```
80
+
81
+ ### Timeouts
82
+
83
+ The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
84
+
85
+ ```typescript
86
+ const response = await client.updateSettings(..., {
87
+ timeoutInSeconds: 30 // override timeout to 30s
88
+ });
89
+ ```
90
+
91
+ ### Aborting Requests
92
+
93
+ The SDK allows users to abort requests at any point by passing in an abort signal.
94
+
95
+ ```typescript
96
+ const controller = new AbortController();
97
+ const response = await client.updateSettings(..., {
98
+ abortSignal: controller.signal
99
+ });
100
+ controller.abort(); // aborts the request
101
+ ```
102
+
103
+ ### Runtime Compatibility
104
+
105
+ The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
106
+ runtimes:
107
+
108
+ - Node.js 18+
109
+ - Vercel
110
+ - Cloudflare Workers
111
+ - Deno v1.25+
112
+ - Bun 1.0+
113
+ - React Native
114
+
115
+ ### Customizing Fetch Client
116
+
117
+ The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
118
+ unsupported environment, this provides a way for you to break glass and ensure the SDK works.
119
+
120
+ ```typescript
121
+ import { PinnacleClient } from "rcs-js";
122
+
123
+ const client = new PinnacleClient({
124
+ ...
125
+ fetcher: // provide your implementation here
126
+ });
127
+ ```
128
+
129
+ ## Contributing
130
+
131
+ While we value open-source contributions to this SDK, this library is generated programmatically.
132
+ Additions made directly to this library would have to be moved over to our generation code,
133
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
134
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
135
+ an issue first to discuss with us!
136
+
137
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
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("./requests"), exports);
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * phoneNumber: "phone_number"
9
+ * }
10
+ *
11
+ * @example
12
+ * {
13
+ * phoneNumber: "phone_number"
14
+ * }
15
+ */
16
+ export interface CheckRcsCapabilityRequest {
17
+ /**
18
+ * Phone number (E.164 format: [+][country code][subscriber number including area code]) to check for RCS capability. Example: +1234567890
19
+ */
20
+ phoneNumber: Pinnacle.PhoneNumber;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * webhookUrl: "webhook_url"
8
+ * }
9
+ */
10
+ export interface UpdateSettingsRequest {
11
+ /** Webhook URL to receive inbound messages */
12
+ webhookUrl: string;
13
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });