@trycourier/courier 6.3.1 → 6.4.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 (390) hide show
  1. package/Client.d.ts +84 -109
  2. package/Client.js +118 -148
  3. package/api/client/requests/SendMessageRequest.d.ts +45 -78
  4. package/api/resources/audiences/client/Client.d.ts +16 -16
  5. package/api/resources/audiences/client/Client.js +63 -86
  6. package/api/resources/audiences/client/requests/AudienceMembersListParams.d.ts +1 -3
  7. package/api/resources/audiences/client/requests/AudienceUpdateParams.d.ts +3 -7
  8. package/api/resources/audiences/client/requests/AudiencesListParams.d.ts +1 -3
  9. package/api/resources/audiences/types/ComparisonOperator.d.ts +1 -1
  10. package/api/resources/audiences/types/Filter.d.ts +1 -1
  11. package/api/resources/audiences/types/FilterConfig.d.ts +1 -1
  12. package/api/resources/audiences/types/LogicalOperator.d.ts +1 -1
  13. package/api/resources/audiences/types/Operator.d.ts +1 -1
  14. package/api/resources/auditEvents/client/Client.d.ts +10 -4
  15. package/api/resources/auditEvents/client/Client.js +35 -37
  16. package/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +1 -3
  17. package/api/resources/authTokens/client/Client.d.ts +11 -3
  18. package/api/resources/authTokens/client/Client.js +28 -25
  19. package/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +2 -2
  20. package/api/resources/automations/client/Client.d.ts +15 -13
  21. package/api/resources/automations/client/Client.js +38 -48
  22. package/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +1 -1
  23. package/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +1 -1
  24. package/api/resources/automations/types/AutomationAddToBatchScope.d.ts +1 -1
  25. package/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +1 -1
  26. package/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
  27. package/api/resources/automations/types/AutomationThrottleScope.d.ts +1 -1
  28. package/api/resources/automations/types/MergeAlgorithm.d.ts +1 -1
  29. package/api/resources/automations/types/Profile.d.ts +1 -1
  30. package/api/resources/brands/client/Client.d.ts +22 -58
  31. package/api/resources/brands/client/Client.js +65 -126
  32. package/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +3 -26
  33. package/api/resources/brands/client/requests/ListBrandsRequest.d.ts +1 -3
  34. package/api/resources/bulk/client/Client.d.ts +30 -121
  35. package/api/resources/bulk/client/Client.js +73 -193
  36. package/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +6 -86
  37. package/api/resources/bulk/client/requests/BulkGetUsersParams.d.ts +1 -3
  38. package/api/resources/bulk/types/BulkJobStatus.d.ts +1 -1
  39. package/api/resources/bulk/types/BulkJobUserStatus.d.ts +1 -1
  40. package/api/resources/bulk/types/InboundBulkMessageV2.d.ts +3 -5
  41. package/api/resources/commons/errors/AlreadyExistsError.js +17 -7
  42. package/api/resources/commons/errors/BadRequestError.js +17 -7
  43. package/api/resources/commons/errors/ConflictError.js +17 -7
  44. package/api/resources/commons/errors/MessageNotFoundError.js +17 -7
  45. package/api/resources/commons/errors/NotFoundError.js +17 -7
  46. package/api/resources/commons/errors/PaymentRequiredError.js +17 -7
  47. package/api/resources/commons/types/ChannelClassification.d.ts +1 -1
  48. package/api/resources/commons/types/NotificationPreferences.d.ts +1 -1
  49. package/api/resources/commons/types/PreferenceStatus.d.ts +1 -1
  50. package/api/resources/inbound/client/Client.d.ts +9 -1
  51. package/api/resources/inbound/client/Client.js +26 -21
  52. package/api/resources/index.js +17 -7
  53. package/api/resources/lists/client/Client.d.ts +31 -34
  54. package/api/resources/lists/client/Client.js +108 -161
  55. package/api/resources/lists/client/requests/AddSubscribersToList.d.ts +5 -5
  56. package/api/resources/lists/client/requests/GetAllListsRequest.d.ts +1 -4
  57. package/api/resources/lists/client/requests/GetSubscriptionForListRequest.d.ts +1 -3
  58. package/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +1 -4
  59. package/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +5 -5
  60. package/api/resources/messages/client/Client.d.ts +15 -24
  61. package/api/resources/messages/client/Client.js +65 -104
  62. package/api/resources/messages/client/requests/GetMessageHistoryRequest.d.ts +1 -3
  63. package/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -16
  64. package/api/resources/messages/types/MessageDetailsExtended.d.ts +7 -0
  65. package/api/resources/messages/types/MessageDetailsExtended.js +5 -0
  66. package/api/resources/messages/types/MessageStatus.d.ts +25 -5
  67. package/api/resources/messages/types/MessageStatus.js +6 -1
  68. package/api/resources/messages/types/Reason.d.ts +1 -1
  69. package/api/resources/messages/types/index.d.ts +1 -0
  70. package/api/resources/messages/types/index.js +1 -0
  71. package/api/resources/notifications/client/Client.d.ts +20 -11
  72. package/api/resources/notifications/client/Client.js +69 -88
  73. package/api/resources/notifications/client/requests/NotificationListParams.d.ts +1 -4
  74. package/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +6 -2
  75. package/api/resources/notifications/types/BlockType.d.ts +1 -1
  76. package/api/resources/notifications/types/CheckStatus.d.ts +1 -1
  77. package/api/resources/notifications/types/MessageRoutingChannel.d.ts +1 -1
  78. package/api/resources/notifications/types/MessageRoutingMethod.d.ts +1 -1
  79. package/api/resources/notifications/types/NotificationContent.d.ts +1 -1
  80. package/api/resources/profiles/client/Client.d.ts +35 -23
  81. package/api/resources/profiles/client/Client.js +95 -125
  82. package/api/resources/profiles/client/requests/GetListSubscriptionsRequest.d.ts +1 -3
  83. package/api/resources/profiles/client/requests/MergeProfileRequest.d.ts +1 -1
  84. package/api/resources/profiles/client/requests/ReplaceProfileRequest.d.ts +1 -1
  85. package/api/resources/profiles/types/DeviceType.d.ts +1 -1
  86. package/api/resources/profiles/types/Discord.d.ts +1 -1
  87. package/api/resources/profiles/types/Expo.d.ts +1 -1
  88. package/api/resources/profiles/types/MsTeams.d.ts +1 -1
  89. package/api/resources/profiles/types/ProfileUpdateRequest.d.ts +8 -0
  90. package/api/resources/profiles/types/ProfileUpdateRequest.js +5 -0
  91. package/api/resources/profiles/types/Slack.d.ts +1 -1
  92. package/api/resources/profiles/types/SnoozeRuleType.d.ts +1 -1
  93. package/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +1 -1
  94. package/api/resources/profiles/types/WebhookAuthMode.d.ts +1 -1
  95. package/api/resources/profiles/types/WebhookMethod.d.ts +1 -1
  96. package/api/resources/profiles/types/WebhookProfileType.d.ts +1 -1
  97. package/api/resources/profiles/types/index.d.ts +1 -0
  98. package/api/resources/profiles/types/index.js +1 -0
  99. package/api/resources/send/types/Attachment.d.ts +1 -1
  100. package/api/resources/send/types/ChannelSource.d.ts +1 -1
  101. package/api/resources/send/types/Content.d.ts +1 -1
  102. package/api/resources/send/types/Criteria.d.ts +1 -1
  103. package/api/resources/send/types/ElementalNode.d.ts +1 -1
  104. package/api/resources/send/types/ExpiresInType.d.ts +1 -1
  105. package/api/resources/send/types/IActionButtonStyle.d.ts +1 -1
  106. package/api/resources/send/types/IAlignment.d.ts +1 -1
  107. package/api/resources/send/types/IPreferences.d.ts +1 -1
  108. package/api/resources/send/types/InAppPlacement.d.ts +1 -1
  109. package/api/resources/send/types/Locales.d.ts +1 -1
  110. package/api/resources/send/types/Message.d.ts +1 -1
  111. package/api/resources/send/types/MessageChannels.d.ts +1 -1
  112. package/api/resources/send/types/MessageData.d.ts +1 -1
  113. package/api/resources/send/types/MessageProviders.d.ts +1 -1
  114. package/api/resources/send/types/MessageRecipient.d.ts +1 -1
  115. package/api/resources/send/types/Recipient.d.ts +1 -1
  116. package/api/resources/send/types/RecipientData.d.ts +1 -1
  117. package/api/resources/send/types/RoutingChannel.d.ts +1 -1
  118. package/api/resources/send/types/RoutingMethod.d.ts +1 -1
  119. package/api/resources/send/types/RuleType.d.ts +1 -1
  120. package/api/resources/send/types/TextAlign.d.ts +1 -1
  121. package/api/resources/send/types/TextStyle.d.ts +1 -1
  122. package/api/resources/templates/client/Client.d.ts +9 -3
  123. package/api/resources/templates/client/Client.js +28 -25
  124. package/api/resources/templates/client/requests/ListTemplatesRequest.d.ts +1 -3
  125. package/api/resources/templates/types/ChannelIdentifier.d.ts +1 -1
  126. package/api/resources/templates/types/RoutingStrategyMethod.d.ts +1 -1
  127. package/api/resources/tenants/client/Client.d.ts +23 -37
  128. package/api/resources/tenants/client/Client.js +80 -127
  129. package/api/resources/tenants/client/requests/ListTenantParams.d.ts +1 -5
  130. package/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +1 -4
  131. package/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -21
  132. package/api/resources/tenants/types/SubscriptionTopicStatus.d.ts +1 -1
  133. package/api/resources/tenants/types/TemplateProperty.d.ts +1 -1
  134. package/api/resources/translations/client/Client.d.ts +10 -2
  135. package/api/resources/translations/client/Client.js +33 -33
  136. package/api/resources/users/client/Client.d.ts +5 -7
  137. package/api/resources/users/resources/index.js +17 -7
  138. package/api/resources/users/resources/preferences/client/Client.d.ts +13 -9
  139. package/api/resources/users/resources/preferences/client/Client.js +46 -55
  140. package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +1 -3
  141. package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +1 -3
  142. package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +2 -2
  143. package/api/resources/users/resources/tenants/client/Client.d.ts +23 -21
  144. package/api/resources/users/resources/tenants/client/Client.js +68 -89
  145. package/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +9 -8
  146. package/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +1 -5
  147. package/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +1 -4
  148. package/api/resources/users/resources/tokens/client/Client.d.ts +27 -29
  149. package/api/resources/users/resources/tokens/client/Client.js +74 -104
  150. package/api/resources/users/resources/tokens/types/ExpiryDate.d.ts +1 -1
  151. package/api/resources/users/resources/tokens/types/GetAllTokensResponse.d.ts +1 -1
  152. package/api/resources/users/resources/tokens/types/PatchOp.d.ts +1 -1
  153. package/api/resources/users/resources/tokens/types/ProviderKey.d.ts +1 -1
  154. package/api/resources/users/resources/tokens/types/TokenStatus.d.ts +1 -1
  155. package/core/auth/BearerToken.d.ts +1 -1
  156. package/core/fetcher/APIResponse.d.ts +1 -1
  157. package/core/fetcher/Fetcher.d.ts +7 -3
  158. package/core/fetcher/Fetcher.js +30 -135
  159. package/core/fetcher/Supplier.d.ts +1 -1
  160. package/core/fetcher/createRequestUrl.d.ts +1 -0
  161. package/core/fetcher/createRequestUrl.js +12 -0
  162. package/core/fetcher/getFetchFn.d.ts +4 -0
  163. package/core/fetcher/getFetchFn.js +68 -0
  164. package/core/fetcher/getHeader.js +1 -2
  165. package/core/fetcher/getRequestBody.d.ts +7 -0
  166. package/core/fetcher/getRequestBody.js +23 -0
  167. package/core/fetcher/getResponseBody.d.ts +1 -0
  168. package/core/fetcher/getResponseBody.js +54 -0
  169. package/core/fetcher/makeRequest.d.ts +1 -0
  170. package/core/fetcher/makeRequest.js +42 -0
  171. package/core/fetcher/requestWithRetries.d.ts +1 -0
  172. package/core/fetcher/requestWithRetries.js +40 -0
  173. package/core/fetcher/signals.d.ts +11 -0
  174. package/core/fetcher/signals.js +36 -0
  175. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  176. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  177. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
  178. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
  179. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  180. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  181. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  182. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
  183. package/core/json.d.ts +15 -0
  184. package/core/json.js +24 -0
  185. package/core/runtime/runtime.d.ts +2 -1
  186. package/core/runtime/runtime.js +57 -36
  187. package/dist/Client.d.ts +84 -109
  188. package/dist/Client.js +118 -148
  189. package/dist/api/client/requests/SendMessageRequest.d.ts +45 -78
  190. package/dist/api/resources/audiences/client/Client.d.ts +16 -16
  191. package/dist/api/resources/audiences/client/Client.js +63 -86
  192. package/dist/api/resources/audiences/client/requests/AudienceMembersListParams.d.ts +1 -3
  193. package/dist/api/resources/audiences/client/requests/AudienceUpdateParams.d.ts +3 -7
  194. package/dist/api/resources/audiences/client/requests/AudiencesListParams.d.ts +1 -3
  195. package/dist/api/resources/audiences/types/ComparisonOperator.d.ts +1 -1
  196. package/dist/api/resources/audiences/types/Filter.d.ts +1 -1
  197. package/dist/api/resources/audiences/types/FilterConfig.d.ts +1 -1
  198. package/dist/api/resources/audiences/types/LogicalOperator.d.ts +1 -1
  199. package/dist/api/resources/audiences/types/Operator.d.ts +1 -1
  200. package/dist/api/resources/auditEvents/client/Client.d.ts +10 -4
  201. package/dist/api/resources/auditEvents/client/Client.js +35 -37
  202. package/dist/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +1 -3
  203. package/dist/api/resources/authTokens/client/Client.d.ts +11 -3
  204. package/dist/api/resources/authTokens/client/Client.js +28 -25
  205. package/dist/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +2 -2
  206. package/dist/api/resources/automations/client/Client.d.ts +15 -13
  207. package/dist/api/resources/automations/client/Client.js +38 -48
  208. package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +1 -1
  209. package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +1 -1
  210. package/dist/api/resources/automations/types/AutomationAddToBatchScope.d.ts +1 -1
  211. package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +1 -1
  212. package/dist/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
  213. package/dist/api/resources/automations/types/AutomationThrottleScope.d.ts +1 -1
  214. package/dist/api/resources/automations/types/MergeAlgorithm.d.ts +1 -1
  215. package/dist/api/resources/automations/types/Profile.d.ts +1 -1
  216. package/dist/api/resources/brands/client/Client.d.ts +22 -58
  217. package/dist/api/resources/brands/client/Client.js +65 -126
  218. package/dist/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +3 -26
  219. package/dist/api/resources/brands/client/requests/ListBrandsRequest.d.ts +1 -3
  220. package/dist/api/resources/bulk/client/Client.d.ts +30 -121
  221. package/dist/api/resources/bulk/client/Client.js +73 -193
  222. package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +6 -86
  223. package/dist/api/resources/bulk/client/requests/BulkGetUsersParams.d.ts +1 -3
  224. package/dist/api/resources/bulk/types/BulkJobStatus.d.ts +1 -1
  225. package/dist/api/resources/bulk/types/BulkJobUserStatus.d.ts +1 -1
  226. package/dist/api/resources/bulk/types/InboundBulkMessageV2.d.ts +3 -5
  227. package/dist/api/resources/commons/errors/AlreadyExistsError.js +17 -7
  228. package/dist/api/resources/commons/errors/BadRequestError.js +17 -7
  229. package/dist/api/resources/commons/errors/ConflictError.js +17 -7
  230. package/dist/api/resources/commons/errors/MessageNotFoundError.js +17 -7
  231. package/dist/api/resources/commons/errors/NotFoundError.js +17 -7
  232. package/dist/api/resources/commons/errors/PaymentRequiredError.js +17 -7
  233. package/dist/api/resources/commons/types/ChannelClassification.d.ts +1 -1
  234. package/dist/api/resources/commons/types/NotificationPreferences.d.ts +1 -1
  235. package/dist/api/resources/commons/types/PreferenceStatus.d.ts +1 -1
  236. package/dist/api/resources/inbound/client/Client.d.ts +9 -1
  237. package/dist/api/resources/inbound/client/Client.js +26 -21
  238. package/dist/api/resources/index.js +17 -7
  239. package/dist/api/resources/lists/client/Client.d.ts +31 -34
  240. package/dist/api/resources/lists/client/Client.js +108 -161
  241. package/dist/api/resources/lists/client/requests/AddSubscribersToList.d.ts +5 -5
  242. package/dist/api/resources/lists/client/requests/GetAllListsRequest.d.ts +1 -4
  243. package/dist/api/resources/lists/client/requests/GetSubscriptionForListRequest.d.ts +1 -3
  244. package/dist/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +1 -4
  245. package/dist/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +5 -5
  246. package/dist/api/resources/messages/client/Client.d.ts +15 -24
  247. package/dist/api/resources/messages/client/Client.js +65 -104
  248. package/dist/api/resources/messages/client/requests/GetMessageHistoryRequest.d.ts +1 -3
  249. package/dist/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -16
  250. package/dist/api/resources/messages/types/MessageDetailsExtended.d.ts +7 -0
  251. package/dist/api/resources/messages/types/MessageDetailsExtended.js +5 -0
  252. package/dist/api/resources/messages/types/MessageStatus.d.ts +25 -5
  253. package/dist/api/resources/messages/types/MessageStatus.js +6 -1
  254. package/dist/api/resources/messages/types/Reason.d.ts +1 -1
  255. package/dist/api/resources/messages/types/index.d.ts +1 -0
  256. package/dist/api/resources/messages/types/index.js +1 -0
  257. package/dist/api/resources/notifications/client/Client.d.ts +20 -11
  258. package/dist/api/resources/notifications/client/Client.js +69 -88
  259. package/dist/api/resources/notifications/client/requests/NotificationListParams.d.ts +1 -4
  260. package/dist/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +6 -2
  261. package/dist/api/resources/notifications/types/BlockType.d.ts +1 -1
  262. package/dist/api/resources/notifications/types/CheckStatus.d.ts +1 -1
  263. package/dist/api/resources/notifications/types/MessageRoutingChannel.d.ts +1 -1
  264. package/dist/api/resources/notifications/types/MessageRoutingMethod.d.ts +1 -1
  265. package/dist/api/resources/notifications/types/NotificationContent.d.ts +1 -1
  266. package/dist/api/resources/profiles/client/Client.d.ts +35 -23
  267. package/dist/api/resources/profiles/client/Client.js +95 -125
  268. package/dist/api/resources/profiles/client/requests/GetListSubscriptionsRequest.d.ts +1 -3
  269. package/dist/api/resources/profiles/client/requests/MergeProfileRequest.d.ts +1 -1
  270. package/dist/api/resources/profiles/client/requests/ReplaceProfileRequest.d.ts +1 -1
  271. package/dist/api/resources/profiles/types/DeviceType.d.ts +1 -1
  272. package/dist/api/resources/profiles/types/Discord.d.ts +1 -1
  273. package/dist/api/resources/profiles/types/Expo.d.ts +1 -1
  274. package/dist/api/resources/profiles/types/MsTeams.d.ts +1 -1
  275. package/dist/api/resources/profiles/types/ProfileUpdateRequest.d.ts +8 -0
  276. package/dist/api/resources/profiles/types/ProfileUpdateRequest.js +5 -0
  277. package/dist/api/resources/profiles/types/Slack.d.ts +1 -1
  278. package/dist/api/resources/profiles/types/SnoozeRuleType.d.ts +1 -1
  279. package/dist/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +1 -1
  280. package/dist/api/resources/profiles/types/WebhookAuthMode.d.ts +1 -1
  281. package/dist/api/resources/profiles/types/WebhookMethod.d.ts +1 -1
  282. package/dist/api/resources/profiles/types/WebhookProfileType.d.ts +1 -1
  283. package/dist/api/resources/profiles/types/index.d.ts +1 -0
  284. package/dist/api/resources/profiles/types/index.js +1 -0
  285. package/dist/api/resources/send/types/Attachment.d.ts +1 -1
  286. package/dist/api/resources/send/types/ChannelSource.d.ts +1 -1
  287. package/dist/api/resources/send/types/Content.d.ts +1 -1
  288. package/dist/api/resources/send/types/Criteria.d.ts +1 -1
  289. package/dist/api/resources/send/types/ElementalNode.d.ts +1 -1
  290. package/dist/api/resources/send/types/ExpiresInType.d.ts +1 -1
  291. package/dist/api/resources/send/types/IActionButtonStyle.d.ts +1 -1
  292. package/dist/api/resources/send/types/IAlignment.d.ts +1 -1
  293. package/dist/api/resources/send/types/IPreferences.d.ts +1 -1
  294. package/dist/api/resources/send/types/InAppPlacement.d.ts +1 -1
  295. package/dist/api/resources/send/types/Locales.d.ts +1 -1
  296. package/dist/api/resources/send/types/Message.d.ts +1 -1
  297. package/dist/api/resources/send/types/MessageChannels.d.ts +1 -1
  298. package/dist/api/resources/send/types/MessageData.d.ts +1 -1
  299. package/dist/api/resources/send/types/MessageProviders.d.ts +1 -1
  300. package/dist/api/resources/send/types/MessageRecipient.d.ts +1 -1
  301. package/dist/api/resources/send/types/Recipient.d.ts +1 -1
  302. package/dist/api/resources/send/types/RecipientData.d.ts +1 -1
  303. package/dist/api/resources/send/types/RoutingChannel.d.ts +1 -1
  304. package/dist/api/resources/send/types/RoutingMethod.d.ts +1 -1
  305. package/dist/api/resources/send/types/RuleType.d.ts +1 -1
  306. package/dist/api/resources/send/types/TextAlign.d.ts +1 -1
  307. package/dist/api/resources/send/types/TextStyle.d.ts +1 -1
  308. package/dist/api/resources/templates/client/Client.d.ts +9 -3
  309. package/dist/api/resources/templates/client/Client.js +28 -25
  310. package/dist/api/resources/templates/client/requests/ListTemplatesRequest.d.ts +1 -3
  311. package/dist/api/resources/templates/types/ChannelIdentifier.d.ts +1 -1
  312. package/dist/api/resources/templates/types/RoutingStrategyMethod.d.ts +1 -1
  313. package/dist/api/resources/tenants/client/Client.d.ts +23 -37
  314. package/dist/api/resources/tenants/client/Client.js +80 -127
  315. package/dist/api/resources/tenants/client/requests/ListTenantParams.d.ts +1 -5
  316. package/dist/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +1 -4
  317. package/dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -21
  318. package/dist/api/resources/tenants/types/SubscriptionTopicStatus.d.ts +1 -1
  319. package/dist/api/resources/tenants/types/TemplateProperty.d.ts +1 -1
  320. package/dist/api/resources/translations/client/Client.d.ts +10 -2
  321. package/dist/api/resources/translations/client/Client.js +33 -33
  322. package/dist/api/resources/users/client/Client.d.ts +5 -7
  323. package/dist/api/resources/users/resources/index.js +17 -7
  324. package/dist/api/resources/users/resources/preferences/client/Client.d.ts +13 -9
  325. package/dist/api/resources/users/resources/preferences/client/Client.js +46 -55
  326. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +1 -3
  327. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +1 -3
  328. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +2 -2
  329. package/dist/api/resources/users/resources/tenants/client/Client.d.ts +23 -21
  330. package/dist/api/resources/users/resources/tenants/client/Client.js +68 -89
  331. package/dist/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +9 -8
  332. package/dist/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +1 -5
  333. package/dist/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +1 -4
  334. package/dist/api/resources/users/resources/tokens/client/Client.d.ts +27 -29
  335. package/dist/api/resources/users/resources/tokens/client/Client.js +74 -104
  336. package/dist/api/resources/users/resources/tokens/types/ExpiryDate.d.ts +1 -1
  337. package/dist/api/resources/users/resources/tokens/types/GetAllTokensResponse.d.ts +1 -1
  338. package/dist/api/resources/users/resources/tokens/types/PatchOp.d.ts +1 -1
  339. package/dist/api/resources/users/resources/tokens/types/ProviderKey.d.ts +1 -1
  340. package/dist/api/resources/users/resources/tokens/types/TokenStatus.d.ts +1 -1
  341. package/dist/core/auth/BearerToken.d.ts +1 -1
  342. package/dist/core/fetcher/APIResponse.d.ts +1 -1
  343. package/dist/core/fetcher/Fetcher.d.ts +7 -3
  344. package/dist/core/fetcher/Fetcher.js +30 -135
  345. package/dist/core/fetcher/Supplier.d.ts +1 -1
  346. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  347. package/dist/core/fetcher/createRequestUrl.js +12 -0
  348. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  349. package/dist/core/fetcher/getFetchFn.js +68 -0
  350. package/dist/core/fetcher/getHeader.js +1 -2
  351. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  352. package/dist/core/fetcher/getRequestBody.js +23 -0
  353. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  354. package/dist/core/fetcher/getResponseBody.js +54 -0
  355. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  356. package/dist/core/fetcher/makeRequest.js +42 -0
  357. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  358. package/dist/core/fetcher/requestWithRetries.js +40 -0
  359. package/dist/core/fetcher/signals.d.ts +11 -0
  360. package/dist/core/fetcher/signals.js +36 -0
  361. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  362. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  363. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
  364. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
  365. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  366. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  367. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  368. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
  369. package/dist/core/json.d.ts +15 -0
  370. package/dist/core/json.js +24 -0
  371. package/dist/core/runtime/runtime.d.ts +2 -1
  372. package/dist/core/runtime/runtime.js +57 -36
  373. package/dist/environments.d.ts +1 -1
  374. package/dist/errors/CourierError.js +2 -1
  375. package/dist/errors/CourierTimeoutError.d.ts +1 -1
  376. package/dist/errors/CourierTimeoutError.js +2 -2
  377. package/dist/index.js +17 -7
  378. package/dist/version.d.ts +1 -0
  379. package/dist/version.js +4 -0
  380. package/environments.d.ts +1 -1
  381. package/errors/CourierError.js +2 -1
  382. package/errors/CourierTimeoutError.d.ts +1 -1
  383. package/errors/CourierTimeoutError.js +2 -2
  384. package/index.js +17 -7
  385. package/{jest.config.js → jest.config.mjs} +4 -1
  386. package/package.json +23 -14
  387. package/reference.md +5180 -0
  388. package/scripts/rename-to-esm-files.js +115 -0
  389. package/version.d.ts +1 -0
  390. package/version.js +4 -0
@@ -7,12 +7,20 @@ import * as Courier from "../../../index";
7
7
  export declare namespace Notifications {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.CourierEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
10
12
  authorizationToken?: core.Supplier<core.BearerToken | undefined>;
11
13
  fetcher?: core.FetchFunction;
12
14
  }
13
15
  interface RequestOptions {
16
+ /** The maximum time to wait for a response in seconds. */
14
17
  timeoutInSeconds?: number;
18
+ /** The number of times to retry the request. Defaults to 2. */
15
19
  maxRetries?: number;
20
+ /** A hook to abort the request. */
21
+ abortSignal?: AbortSignal;
22
+ /** Additional headers to include in the request. */
23
+ headers?: Record<string, string>;
16
24
  }
17
25
  }
18
26
  export declare class Notifications {
@@ -23,10 +31,7 @@ export declare class Notifications {
23
31
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
24
32
  *
25
33
  * @example
26
- * await courier.notifications.list({
27
- * cursor: "string",
28
- * notes: true
29
- * })
34
+ * await client.notifications.list()
30
35
  */
31
36
  list(request?: Courier.NotificationListParams, requestOptions?: Notifications.RequestOptions): Promise<Courier.NotificationListResponse>;
32
37
  /**
@@ -34,7 +39,7 @@ export declare class Notifications {
34
39
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
35
40
  *
36
41
  * @example
37
- * await courier.notifications.getContent("string")
42
+ * await client.notifications.getContent("id")
38
43
  */
39
44
  getContent(id: string, requestOptions?: Notifications.RequestOptions): Promise<Courier.NotificationGetContentResponse>;
40
45
  /**
@@ -42,7 +47,7 @@ export declare class Notifications {
42
47
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
43
48
  *
44
49
  * @example
45
- * await courier.notifications.getDraftContent("string")
50
+ * await client.notifications.getDraftContent("id")
46
51
  */
47
52
  getDraftContent(id: string, requestOptions?: Notifications.RequestOptions): Promise<Courier.NotificationGetContentResponse>;
48
53
  /**
@@ -51,7 +56,7 @@ export declare class Notifications {
51
56
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
52
57
  *
53
58
  * @example
54
- * await courier.notifications.getSubmissionChecks("string", "string")
59
+ * await client.notifications.getSubmissionChecks("id", "submissionId")
55
60
  */
56
61
  getSubmissionChecks(id: string, submissionId: string, requestOptions?: Notifications.RequestOptions): Promise<Courier.SubmissionChecksGetResponse>;
57
62
  /**
@@ -61,10 +66,14 @@ export declare class Notifications {
61
66
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
62
67
  *
63
68
  * @example
64
- * await courier.notifications.replaceSubmissionChecks("string", "string", {
69
+ * await client.notifications.replaceSubmissionChecks("id", "submissionId", {
65
70
  * checks: [{
66
- * id: "string",
67
- * status: Courier.CheckStatus.Resolved,
71
+ * id: "id",
72
+ * status: "RESOLVED",
73
+ * type: "custom"
74
+ * }, {
75
+ * id: "id",
76
+ * status: "RESOLVED",
68
77
  * type: "custom"
69
78
  * }]
70
79
  * })
@@ -76,7 +85,7 @@ export declare class Notifications {
76
85
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
77
86
  *
78
87
  * @example
79
- * await courier.notifications.cancelSubmission("string", "string")
88
+ * await client.notifications.cancelSubmission("id", "submissionId")
80
89
  */
81
90
  cancelSubmission(id: string, submissionId: string, requestOptions?: Notifications.RequestOptions): Promise<void>;
82
91
  protected _getAuthorizationHeader(): Promise<string>;
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
18
18
  }) : function(o, v) {
19
19
  o["default"] = v;
20
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
- };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
28
38
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
39
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
40
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -52,14 +62,11 @@ class Notifications {
52
62
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
53
63
  *
54
64
  * @example
55
- * await courier.notifications.list({
56
- * cursor: "string",
57
- * notes: true
58
- * })
65
+ * await client.notifications.list()
59
66
  */
60
- list(request = {}, requestOptions) {
61
- var _a, _b;
62
- return __awaiter(this, void 0, void 0, function* () {
67
+ list() {
68
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
69
+ var _a, _b, _c;
63
70
  const { cursor, notes } = request;
64
71
  const _queryParams = {};
65
72
  if (cursor != null) {
@@ -69,20 +76,15 @@ class Notifications {
69
76
  _queryParams["notes"] = notes.toString();
70
77
  }
71
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
72
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/notifications"),
79
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, "/notifications"),
73
80
  method: "GET",
74
- headers: {
75
- Authorization: yield this._getAuthorizationHeader(),
76
- "X-Fern-Language": "JavaScript",
77
- "X-Fern-SDK-Name": "@trycourier/courier",
78
- "X-Fern-SDK-Version": "v6.3.1",
79
- "X-Fern-Runtime": core.RUNTIME.type,
80
- "X-Fern-Runtime-Version": core.RUNTIME.version,
81
- },
81
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
82
  contentType: "application/json",
83
83
  queryParameters: _queryParams,
84
+ requestType: "json",
84
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
85
86
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
87
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
86
88
  });
87
89
  if (_response.ok) {
88
90
  return _response.body;
@@ -100,7 +102,7 @@ class Notifications {
100
102
  body: _response.error.rawBody,
101
103
  });
102
104
  case "timeout":
103
- throw new errors.CourierTimeoutError();
105
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications.");
104
106
  case "unknown":
105
107
  throw new errors.CourierError({
106
108
  message: _response.error.errorMessage,
@@ -113,25 +115,20 @@ class Notifications {
113
115
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
114
116
  *
115
117
  * @example
116
- * await courier.notifications.getContent("string")
118
+ * await client.notifications.getContent("id")
117
119
  */
118
120
  getContent(id, requestOptions) {
119
- var _a, _b;
120
121
  return __awaiter(this, void 0, void 0, function* () {
122
+ var _a, _b, _c;
121
123
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
122
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/content`),
124
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/content`),
123
125
  method: "GET",
124
- headers: {
125
- Authorization: yield this._getAuthorizationHeader(),
126
- "X-Fern-Language": "JavaScript",
127
- "X-Fern-SDK-Name": "@trycourier/courier",
128
- "X-Fern-SDK-Version": "v6.3.1",
129
- "X-Fern-Runtime": core.RUNTIME.type,
130
- "X-Fern-Runtime-Version": core.RUNTIME.version,
131
- },
126
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
132
127
  contentType: "application/json",
128
+ requestType: "json",
133
129
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
134
130
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
131
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
135
132
  });
136
133
  if (_response.ok) {
137
134
  return _response.body;
@@ -149,7 +146,7 @@ class Notifications {
149
146
  body: _response.error.rawBody,
150
147
  });
151
148
  case "timeout":
152
- throw new errors.CourierTimeoutError();
149
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications/{id}/content.");
153
150
  case "unknown":
154
151
  throw new errors.CourierError({
155
152
  message: _response.error.errorMessage,
@@ -162,25 +159,20 @@ class Notifications {
162
159
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
163
160
  *
164
161
  * @example
165
- * await courier.notifications.getDraftContent("string")
162
+ * await client.notifications.getDraftContent("id")
166
163
  */
167
164
  getDraftContent(id, requestOptions) {
168
- var _a, _b;
169
165
  return __awaiter(this, void 0, void 0, function* () {
166
+ var _a, _b, _c;
170
167
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
171
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/draft/content`),
168
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/draft/content`),
172
169
  method: "GET",
173
- headers: {
174
- Authorization: yield this._getAuthorizationHeader(),
175
- "X-Fern-Language": "JavaScript",
176
- "X-Fern-SDK-Name": "@trycourier/courier",
177
- "X-Fern-SDK-Version": "v6.3.1",
178
- "X-Fern-Runtime": core.RUNTIME.type,
179
- "X-Fern-Runtime-Version": core.RUNTIME.version,
180
- },
170
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
181
171
  contentType: "application/json",
172
+ requestType: "json",
182
173
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
183
174
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
175
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
184
176
  });
185
177
  if (_response.ok) {
186
178
  return _response.body;
@@ -198,7 +190,7 @@ class Notifications {
198
190
  body: _response.error.rawBody,
199
191
  });
200
192
  case "timeout":
201
- throw new errors.CourierTimeoutError();
193
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications/{id}/draft/content.");
202
194
  case "unknown":
203
195
  throw new errors.CourierError({
204
196
  message: _response.error.errorMessage,
@@ -212,25 +204,20 @@ class Notifications {
212
204
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
213
205
  *
214
206
  * @example
215
- * await courier.notifications.getSubmissionChecks("string", "string")
207
+ * await client.notifications.getSubmissionChecks("id", "submissionId")
216
208
  */
217
209
  getSubmissionChecks(id, submissionId, requestOptions) {
218
- var _a, _b;
219
210
  return __awaiter(this, void 0, void 0, function* () {
211
+ var _a, _b, _c;
220
212
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
221
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
213
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
222
214
  method: "GET",
223
- headers: {
224
- Authorization: yield this._getAuthorizationHeader(),
225
- "X-Fern-Language": "JavaScript",
226
- "X-Fern-SDK-Name": "@trycourier/courier",
227
- "X-Fern-SDK-Version": "v6.3.1",
228
- "X-Fern-Runtime": core.RUNTIME.type,
229
- "X-Fern-Runtime-Version": core.RUNTIME.version,
230
- },
215
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
231
216
  contentType: "application/json",
217
+ requestType: "json",
232
218
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
233
219
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
220
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
234
221
  });
235
222
  if (_response.ok) {
236
223
  return _response.body;
@@ -248,7 +235,7 @@ class Notifications {
248
235
  body: _response.error.rawBody,
249
236
  });
250
237
  case "timeout":
251
- throw new errors.CourierTimeoutError();
238
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications/{id}/{submissionId}/checks.");
252
239
  case "unknown":
253
240
  throw new errors.CourierError({
254
241
  message: _response.error.errorMessage,
@@ -263,32 +250,31 @@ class Notifications {
263
250
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
264
251
  *
265
252
  * @example
266
- * await courier.notifications.replaceSubmissionChecks("string", "string", {
253
+ * await client.notifications.replaceSubmissionChecks("id", "submissionId", {
267
254
  * checks: [{
268
- * id: "string",
269
- * status: Courier.CheckStatus.Resolved,
255
+ * id: "id",
256
+ * status: "RESOLVED",
257
+ * type: "custom"
258
+ * }, {
259
+ * id: "id",
260
+ * status: "RESOLVED",
270
261
  * type: "custom"
271
262
  * }]
272
263
  * })
273
264
  */
274
265
  replaceSubmissionChecks(id, submissionId, request, requestOptions) {
275
- var _a, _b;
276
266
  return __awaiter(this, void 0, void 0, function* () {
267
+ var _a, _b, _c;
277
268
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
278
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
269
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
279
270
  method: "PUT",
280
- headers: {
281
- Authorization: yield this._getAuthorizationHeader(),
282
- "X-Fern-Language": "JavaScript",
283
- "X-Fern-SDK-Name": "@trycourier/courier",
284
- "X-Fern-SDK-Version": "v6.3.1",
285
- "X-Fern-Runtime": core.RUNTIME.type,
286
- "X-Fern-Runtime-Version": core.RUNTIME.version,
287
- },
271
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
288
272
  contentType: "application/json",
273
+ requestType: "json",
289
274
  body: request,
290
275
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
291
276
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
277
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
292
278
  });
293
279
  if (_response.ok) {
294
280
  return _response.body;
@@ -306,7 +292,7 @@ class Notifications {
306
292
  body: _response.error.rawBody,
307
293
  });
308
294
  case "timeout":
309
- throw new errors.CourierTimeoutError();
295
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling PUT /notifications/{id}/{submissionId}/checks.");
310
296
  case "unknown":
311
297
  throw new errors.CourierError({
312
298
  message: _response.error.errorMessage,
@@ -320,25 +306,20 @@ class Notifications {
320
306
  * @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
321
307
  *
322
308
  * @example
323
- * await courier.notifications.cancelSubmission("string", "string")
309
+ * await client.notifications.cancelSubmission("id", "submissionId")
324
310
  */
325
311
  cancelSubmission(id, submissionId, requestOptions) {
326
- var _a, _b;
327
312
  return __awaiter(this, void 0, void 0, function* () {
313
+ var _a, _b, _c;
328
314
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
329
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
315
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
330
316
  method: "DELETE",
331
- headers: {
332
- Authorization: yield this._getAuthorizationHeader(),
333
- "X-Fern-Language": "JavaScript",
334
- "X-Fern-SDK-Name": "@trycourier/courier",
335
- "X-Fern-SDK-Version": "v6.3.1",
336
- "X-Fern-Runtime": core.RUNTIME.type,
337
- "X-Fern-Runtime-Version": core.RUNTIME.version,
338
- },
317
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
339
318
  contentType: "application/json",
319
+ requestType: "json",
340
320
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
341
321
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
322
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
342
323
  });
343
324
  if (_response.ok) {
344
325
  return;
@@ -356,7 +337,7 @@ class Notifications {
356
337
  body: _response.error.rawBody,
357
338
  });
358
339
  case "timeout":
359
- throw new errors.CourierTimeoutError();
340
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling DELETE /notifications/{id}/{submissionId}/checks.");
360
341
  case "unknown":
361
342
  throw new errors.CourierError({
362
343
  message: _response.error.errorMessage,
@@ -365,12 +346,12 @@ class Notifications {
365
346
  });
366
347
  }
367
348
  _getAuthorizationHeader() {
368
- var _a;
369
349
  return __awaiter(this, void 0, void 0, function* () {
350
+ var _a;
370
351
  const bearer = (_a = (yield core.Supplier.get(this._options.authorizationToken))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["COURIER_AUTH_TOKEN"];
371
352
  if (bearer == null) {
372
353
  throw new errors.CourierError({
373
- message: "Please specify COURIER_AUTH_TOKEN when instantiating the client.",
354
+ message: "Please specify a bearer by either passing it in to the constructor or initializing a COURIER_AUTH_TOKEN environment variable",
374
355
  });
375
356
  }
376
357
  return `Bearer ${bearer}`;
@@ -3,10 +3,7 @@
3
3
  */
4
4
  /**
5
5
  * @example
6
- * {
7
- * cursor: "string",
8
- * notes: true
9
- * }
6
+ * {}
10
7
  */
11
8
  export interface NotificationListParams {
12
9
  cursor?: string;
@@ -6,8 +6,12 @@ import * as Courier from "../../../../index";
6
6
  * @example
7
7
  * {
8
8
  * checks: [{
9
- * id: "string",
10
- * status: Courier.CheckStatus.Resolved,
9
+ * id: "id",
10
+ * status: "RESOLVED",
11
+ * type: "custom"
12
+ * }, {
13
+ * id: "id",
14
+ * status: "RESOLVED",
11
15
  * type: "custom"
12
16
  * }]
13
17
  * }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type BlockType = "action" | "divider" | "image" | "jsonnet" | "list" | "markdown" | "quote" | "template" | "text";
4
+ export type BlockType = "action" | "divider" | "image" | "jsonnet" | "list" | "markdown" | "quote" | "template" | "text";
5
5
  export declare const BlockType: {
6
6
  readonly Action: "action";
7
7
  readonly Divider: "divider";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type CheckStatus = "RESOLVED" | "FAILED" | "PENDING";
4
+ export type CheckStatus = "RESOLVED" | "FAILED" | "PENDING";
5
5
  export declare const CheckStatus: {
6
6
  readonly Resolved: "RESOLVED";
7
7
  readonly Failed: "FAILED";
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Courier from "../../../index";
5
- export declare type MessageRoutingChannel = string | Courier.MessageRouting;
5
+ export type MessageRoutingChannel = string | Courier.MessageRouting;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type MessageRoutingMethod = "all" | "single";
4
+ export type MessageRoutingMethod = "all" | "single";
5
5
  export declare const MessageRoutingMethod: {
6
6
  readonly All: "all";
7
7
  readonly Single: "single";
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Courier from "../../../index";
5
- export declare type NotificationContent = string | Courier.NotificationContentHierarchy;
5
+ export type NotificationContent = string | Courier.NotificationContentHierarchy;
@@ -7,12 +7,20 @@ import * as Courier from "../../../index";
7
7
  export declare namespace Profiles {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.CourierEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
10
12
  authorizationToken?: core.Supplier<core.BearerToken | undefined>;
11
13
  fetcher?: core.FetchFunction;
12
14
  }
13
15
  interface RequestOptions {
16
+ /** The maximum time to wait for a response in seconds. */
14
17
  timeoutInSeconds?: number;
18
+ /** The number of times to retry the request. Defaults to 2. */
15
19
  maxRetries?: number;
20
+ /** A hook to abort the request. */
21
+ abortSignal?: AbortSignal;
22
+ /** Additional headers to include in the request. */
23
+ headers?: Record<string, string>;
16
24
  }
17
25
  interface IdempotentRequestOptions extends RequestOptions {
18
26
  idempotencyKey?: string | undefined;
@@ -31,7 +39,7 @@ export declare class Profiles {
31
39
  * @throws {@link Courier.BadRequestError}
32
40
  *
33
41
  * @example
34
- * await courier.profiles.get("string")
42
+ * await client.profiles.get("user_id")
35
43
  */
36
44
  get(userId: string, requestOptions?: Profiles.RequestOptions): Promise<Courier.ProfileGetResponse>;
37
45
  /**
@@ -44,9 +52,9 @@ export declare class Profiles {
44
52
  * @throws {@link Courier.BadRequestError}
45
53
  *
46
54
  * @example
47
- * await courier.profiles.create("string", {
55
+ * await client.profiles.create("user_id", {
48
56
  * profile: {
49
- * "string": {
57
+ * "profile": {
50
58
  * "key": "value"
51
59
  * }
52
60
  * }
@@ -66,9 +74,9 @@ export declare class Profiles {
66
74
  * @throws {@link Courier.BadRequestError}
67
75
  *
68
76
  * @example
69
- * await courier.profiles.replace("string", {
77
+ * await client.profiles.replace("user_id", {
70
78
  * profile: {
71
- * "string": {
79
+ * "profile": {
72
80
  * "key": "value"
73
81
  * }
74
82
  * }
@@ -77,17 +85,23 @@ export declare class Profiles {
77
85
  replace(userId: string, request: Courier.ReplaceProfileRequest, requestOptions?: Profiles.RequestOptions): Promise<Courier.ReplaceProfileResponse>;
78
86
  /**
79
87
  * @param {string} userId - A unique identifier representing the user associated with the requested profile.
80
- * @param {Courier.UserProfilePatch[]} request
88
+ * @param {Courier.ProfileUpdateRequest} request
81
89
  * @param {Profiles.RequestOptions} requestOptions - Request-specific configuration.
82
90
  *
83
91
  * @example
84
- * await courier.profiles.mergeProfile("string", [{
85
- * op: "string",
86
- * path: "string",
87
- * value: "string"
88
- * }])
92
+ * await client.profiles.mergeProfile("user_id", {
93
+ * patch: [{
94
+ * op: "op",
95
+ * path: "path",
96
+ * value: "value"
97
+ * }, {
98
+ * op: "op",
99
+ * path: "path",
100
+ * value: "value"
101
+ * }]
102
+ * })
89
103
  */
90
- mergeProfile(userId: string, request: Courier.UserProfilePatch[], requestOptions?: Profiles.RequestOptions): Promise<void>;
104
+ mergeProfile(userId: string, request: Courier.ProfileUpdateRequest, requestOptions?: Profiles.RequestOptions): Promise<void>;
91
105
  /**
92
106
  * Deletes the specified user profile.
93
107
  *
@@ -97,7 +111,7 @@ export declare class Profiles {
97
111
  * @throws {@link Courier.BadRequestError}
98
112
  *
99
113
  * @example
100
- * await courier.profiles.delete("string")
114
+ * await client.profiles.delete("user_id")
101
115
  */
102
116
  delete(userId: string, requestOptions?: Profiles.RequestOptions): Promise<void>;
103
117
  /**
@@ -110,9 +124,7 @@ export declare class Profiles {
110
124
  * @throws {@link Courier.BadRequestError}
111
125
  *
112
126
  * @example
113
- * await courier.profiles.getListSubscriptions("string", {
114
- * cursor: "string"
115
- * })
127
+ * await client.profiles.getListSubscriptions("user_id")
116
128
  */
117
129
  getListSubscriptions(userId: string, request?: Courier.GetListSubscriptionsRequest, requestOptions?: Profiles.RequestOptions): Promise<Courier.GetListSubscriptionsResponse>;
118
130
  /**
@@ -125,13 +137,13 @@ export declare class Profiles {
125
137
  * @throws {@link Courier.BadRequestError}
126
138
  *
127
139
  * @example
128
- * await courier.profiles.subscribeToLists("string", {
140
+ * await client.profiles.subscribeToLists("user_id", {
129
141
  * lists: [{
130
- * listId: "string",
131
- * preferences: {
132
- * categories: {},
133
- * notifications: {}
134
- * }
142
+ * listId: "listId",
143
+ * preferences: undefined
144
+ * }, {
145
+ * listId: "listId",
146
+ * preferences: undefined
135
147
  * }]
136
148
  * })
137
149
  */
@@ -145,7 +157,7 @@ export declare class Profiles {
145
157
  * @throws {@link Courier.BadRequestError}
146
158
  *
147
159
  * @example
148
- * await courier.profiles.deleteListSubscription("string")
160
+ * await client.profiles.deleteListSubscription("user_id")
149
161
  */
150
162
  deleteListSubscription(userId: string, requestOptions?: Profiles.RequestOptions): Promise<Courier.DeleteListSubscriptionResponse>;
151
163
  protected _getAuthorizationHeader(): Promise<string>;