magicbell-js 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/README.md +2 -3
  2. package/dist/commonjs/project-client/http/errors/throwable-error.d.ts +7 -0
  3. package/dist/commonjs/project-client/http/errors/throwable-error.d.ts.map +1 -0
  4. package/dist/commonjs/project-client/http/errors/throwable-error.js +25 -0
  5. package/dist/commonjs/project-client/http/errors/throwable-error.js.map +1 -0
  6. package/dist/commonjs/project-client/http/handlers/hook-handler.d.ts.map +1 -1
  7. package/dist/commonjs/project-client/http/handlers/hook-handler.js +2 -2
  8. package/dist/commonjs/project-client/http/handlers/hook-handler.js.map +1 -1
  9. package/dist/commonjs/project-client/http/transport/types.d.ts +2 -1
  10. package/dist/commonjs/project-client/http/transport/types.d.ts.map +1 -1
  11. package/dist/commonjs/project-client/services/broadcasts/broadcasts-service.d.ts.map +1 -1
  12. package/dist/commonjs/project-client/services/broadcasts/broadcasts-service.js.map +1 -1
  13. package/dist/commonjs/project-client/services/channels/channels-service.d.ts.map +1 -1
  14. package/dist/commonjs/project-client/services/channels/channels-service.js.map +1 -1
  15. package/dist/commonjs/project-client/services/events/events-service.d.ts.map +1 -1
  16. package/dist/commonjs/project-client/services/events/events-service.js.map +1 -1
  17. package/dist/commonjs/project-client/services/integrations/integrations-service.d.ts.map +1 -1
  18. package/dist/commonjs/project-client/services/integrations/integrations-service.js.map +1 -1
  19. package/dist/commonjs/project-client/services/jwt/jwt-service.d.ts +1 -25
  20. package/dist/commonjs/project-client/services/jwt/jwt-service.d.ts.map +1 -1
  21. package/dist/commonjs/project-client/services/jwt/jwt-service.js +0 -103
  22. package/dist/commonjs/project-client/services/jwt/jwt-service.js.map +1 -1
  23. package/dist/commonjs/project-client/services/jwt/models/index.d.ts +0 -1
  24. package/dist/commonjs/project-client/services/jwt/models/index.d.ts.map +1 -1
  25. package/dist/commonjs/project-client/services/jwt/request-params.d.ts +0 -5
  26. package/dist/commonjs/project-client/services/jwt/request-params.d.ts.map +1 -1
  27. package/dist/commonjs/project-client/services/notifications/notifications-service.d.ts.map +1 -1
  28. package/dist/commonjs/project-client/services/notifications/notifications-service.js.map +1 -1
  29. package/dist/commonjs/project-client/services/users/users-service.d.ts.map +1 -1
  30. package/dist/commonjs/project-client/services/users/users-service.js.map +1 -1
  31. package/dist/commonjs/user-client/http/errors/throwable-error.d.ts +7 -0
  32. package/dist/commonjs/user-client/http/errors/throwable-error.d.ts.map +1 -0
  33. package/dist/commonjs/user-client/http/errors/throwable-error.js +25 -0
  34. package/dist/commonjs/user-client/http/errors/throwable-error.js.map +1 -0
  35. package/dist/commonjs/user-client/http/handlers/hook-handler.d.ts.map +1 -1
  36. package/dist/commonjs/user-client/http/handlers/hook-handler.js +2 -2
  37. package/dist/commonjs/user-client/http/handlers/hook-handler.js.map +1 -1
  38. package/dist/commonjs/user-client/http/transport/types.d.ts +2 -1
  39. package/dist/commonjs/user-client/http/transport/types.d.ts.map +1 -1
  40. package/dist/commonjs/user-client/services/channels/channels-service.d.ts.map +1 -1
  41. package/dist/commonjs/user-client/services/channels/channels-service.js.map +1 -1
  42. package/dist/commonjs/user-client/services/integrations/integrations-service.d.ts.map +1 -1
  43. package/dist/commonjs/user-client/services/integrations/integrations-service.js.map +1 -1
  44. package/dist/commonjs/user-client/services/notifications/notifications-service.d.ts +26 -1
  45. package/dist/commonjs/user-client/services/notifications/notifications-service.d.ts.map +1 -1
  46. package/dist/commonjs/user-client/services/notifications/notifications-service.js +106 -0
  47. package/dist/commonjs/user-client/services/notifications/notifications-service.js.map +1 -1
  48. package/dist/commonjs/user-client/services/notifications/request-params.d.ts +9 -0
  49. package/dist/commonjs/user-client/services/notifications/request-params.d.ts.map +1 -1
  50. package/dist/esm/project-client/http/errors/throwable-error.d.ts +7 -0
  51. package/dist/esm/project-client/http/errors/throwable-error.d.ts.map +1 -0
  52. package/dist/esm/project-client/http/errors/throwable-error.js +21 -0
  53. package/dist/esm/project-client/http/errors/throwable-error.js.map +1 -0
  54. package/dist/esm/project-client/http/handlers/hook-handler.d.ts.map +1 -1
  55. package/dist/esm/project-client/http/handlers/hook-handler.js +2 -2
  56. package/dist/esm/project-client/http/handlers/hook-handler.js.map +1 -1
  57. package/dist/esm/project-client/http/transport/types.d.ts +2 -1
  58. package/dist/esm/project-client/http/transport/types.d.ts.map +1 -1
  59. package/dist/esm/project-client/services/broadcasts/broadcasts-service.d.ts.map +1 -1
  60. package/dist/esm/project-client/services/broadcasts/broadcasts-service.js.map +1 -1
  61. package/dist/esm/project-client/services/channels/channels-service.d.ts.map +1 -1
  62. package/dist/esm/project-client/services/channels/channels-service.js.map +1 -1
  63. package/dist/esm/project-client/services/events/events-service.d.ts.map +1 -1
  64. package/dist/esm/project-client/services/events/events-service.js.map +1 -1
  65. package/dist/esm/project-client/services/integrations/integrations-service.d.ts.map +1 -1
  66. package/dist/esm/project-client/services/integrations/integrations-service.js.map +1 -1
  67. package/dist/esm/project-client/services/jwt/jwt-service.d.ts +1 -25
  68. package/dist/esm/project-client/services/jwt/jwt-service.d.ts.map +1 -1
  69. package/dist/esm/project-client/services/jwt/jwt-service.js +0 -103
  70. package/dist/esm/project-client/services/jwt/jwt-service.js.map +1 -1
  71. package/dist/esm/project-client/services/jwt/models/index.d.ts +0 -1
  72. package/dist/esm/project-client/services/jwt/models/index.d.ts.map +1 -1
  73. package/dist/esm/project-client/services/jwt/request-params.d.ts +0 -5
  74. package/dist/esm/project-client/services/jwt/request-params.d.ts.map +1 -1
  75. package/dist/esm/project-client/services/notifications/notifications-service.d.ts.map +1 -1
  76. package/dist/esm/project-client/services/notifications/notifications-service.js.map +1 -1
  77. package/dist/esm/project-client/services/users/users-service.d.ts.map +1 -1
  78. package/dist/esm/project-client/services/users/users-service.js.map +1 -1
  79. package/dist/esm/user-client/http/errors/throwable-error.d.ts +7 -0
  80. package/dist/esm/user-client/http/errors/throwable-error.d.ts.map +1 -0
  81. package/dist/esm/user-client/http/errors/throwable-error.js +21 -0
  82. package/dist/esm/user-client/http/errors/throwable-error.js.map +1 -0
  83. package/dist/esm/user-client/http/handlers/hook-handler.d.ts.map +1 -1
  84. package/dist/esm/user-client/http/handlers/hook-handler.js +2 -2
  85. package/dist/esm/user-client/http/handlers/hook-handler.js.map +1 -1
  86. package/dist/esm/user-client/http/transport/types.d.ts +2 -1
  87. package/dist/esm/user-client/http/transport/types.d.ts.map +1 -1
  88. package/dist/esm/user-client/services/channels/channels-service.d.ts.map +1 -1
  89. package/dist/esm/user-client/services/channels/channels-service.js.map +1 -1
  90. package/dist/esm/user-client/services/integrations/integrations-service.d.ts.map +1 -1
  91. package/dist/esm/user-client/services/integrations/integrations-service.js.map +1 -1
  92. package/dist/esm/user-client/services/notifications/notifications-service.d.ts +26 -1
  93. package/dist/esm/user-client/services/notifications/notifications-service.d.ts.map +1 -1
  94. package/dist/esm/user-client/services/notifications/notifications-service.js +106 -0
  95. package/dist/esm/user-client/services/notifications/notifications-service.js.map +1 -1
  96. package/dist/esm/user-client/services/notifications/request-params.d.ts +9 -0
  97. package/dist/esm/user-client/services/notifications/request-params.d.ts.map +1 -1
  98. package/package.json +3 -1
  99. package/src/project-client/http/client.ts +71 -0
  100. package/src/project-client/http/environment.ts +3 -0
  101. package/src/project-client/http/error.ts +14 -0
  102. package/src/project-client/http/errors/throwable-error.ts +9 -0
  103. package/src/project-client/http/errors/validation-error.ts +25 -0
  104. package/src/project-client/http/handlers/handler-chain.ts +30 -0
  105. package/src/project-client/http/handlers/hook-handler.ts +80 -0
  106. package/src/project-client/http/handlers/request-validation-handler.ts +111 -0
  107. package/src/project-client/http/handlers/response-validation-handler.ts +203 -0
  108. package/src/project-client/http/handlers/retry-handler.ts +60 -0
  109. package/src/project-client/http/handlers/terminating-handler.ts +14 -0
  110. package/src/project-client/http/hooks/custom-hook.ts +25 -0
  111. package/src/project-client/http/hooks/hook.ts +41 -0
  112. package/src/project-client/http/index.ts +11 -0
  113. package/src/project-client/http/serialization/base-serializer.ts +139 -0
  114. package/src/project-client/http/serialization/header-serializer.ts +19 -0
  115. package/src/project-client/http/serialization/path-serializer.ts +12 -0
  116. package/src/project-client/http/serialization/query-serializer.ts +18 -0
  117. package/src/project-client/http/transport/request-builder.ts +242 -0
  118. package/src/project-client/http/transport/request-fetch-adapter.ts +131 -0
  119. package/src/project-client/http/transport/request.ts +222 -0
  120. package/src/project-client/http/transport/transport-hook-adapter.ts +91 -0
  121. package/src/project-client/http/transport/types.ts +51 -0
  122. package/src/project-client/http/types.ts +74 -0
  123. package/src/project-client/http/utils/content-type.ts +33 -0
  124. package/src/project-client/http/utils/line-decoder.ts +35 -0
  125. package/src/project-client/http/utils/response-matcher.ts +25 -0
  126. package/src/project-client/index.ts +94 -0
  127. package/src/project-client/services/base-service.ts +27 -0
  128. package/src/project-client/services/broadcasts/broadcasts-service.ts +116 -0
  129. package/src/project-client/services/broadcasts/index.ts +2 -0
  130. package/src/project-client/services/broadcasts/models/broadcast-collection.ts +54 -0
  131. package/src/project-client/services/broadcasts/models/broadcast-status.ts +60 -0
  132. package/src/project-client/services/broadcasts/models/broadcast.ts +143 -0
  133. package/src/project-client/services/broadcasts/models/email.ts +57 -0
  134. package/src/project-client/services/broadcasts/models/errors.ts +45 -0
  135. package/src/project-client/services/broadcasts/models/in-app.ts +57 -0
  136. package/src/project-client/services/broadcasts/models/index.ts +15 -0
  137. package/src/project-client/services/broadcasts/models/mobile-push.ts +57 -0
  138. package/src/project-client/services/broadcasts/models/overrides-channels.ts +82 -0
  139. package/src/project-client/services/broadcasts/models/overrides.ts +59 -0
  140. package/src/project-client/services/broadcasts/models/providers.ts +81 -0
  141. package/src/project-client/services/broadcasts/models/slack.ts +57 -0
  142. package/src/project-client/services/broadcasts/models/sms.ts +57 -0
  143. package/src/project-client/services/broadcasts/models/status-status.ts +7 -0
  144. package/src/project-client/services/broadcasts/models/summary.ts +51 -0
  145. package/src/project-client/services/broadcasts/models/web-push.ts +57 -0
  146. package/src/project-client/services/broadcasts/request-params.ts +5 -0
  147. package/src/project-client/services/channels/channels-service.ts +1018 -0
  148. package/src/project-client/services/channels/index.ts +2 -0
  149. package/src/project-client/services/channels/models/apns-token-collection.ts +54 -0
  150. package/src/project-client/services/channels/models/apns-token-installation-id.ts +6 -0
  151. package/src/project-client/services/channels/models/apns-token.ts +90 -0
  152. package/src/project-client/services/channels/models/category-delivery-config-channels.ts +57 -0
  153. package/src/project-client/services/channels/models/category-delivery-config.ts +73 -0
  154. package/src/project-client/services/channels/models/channel.ts +11 -0
  155. package/src/project-client/services/channels/models/discard-result.ts +51 -0
  156. package/src/project-client/services/channels/models/expo-token-collection.ts +54 -0
  157. package/src/project-client/services/channels/models/expo-token.ts +69 -0
  158. package/src/project-client/services/channels/models/fcm-token-collection.ts +54 -0
  159. package/src/project-client/services/channels/models/fcm-token-installation-id.ts +6 -0
  160. package/src/project-client/services/channels/models/fcm-token.ts +75 -0
  161. package/src/project-client/services/channels/models/inbox-token-response-collection.ts +59 -0
  162. package/src/project-client/services/channels/models/inbox-token-response.ts +75 -0
  163. package/src/project-client/services/channels/models/index.ts +24 -0
  164. package/src/project-client/services/channels/models/keys.ts +51 -0
  165. package/src/project-client/services/channels/models/oauth.ts +57 -0
  166. package/src/project-client/services/channels/models/slack-token-collection.ts +54 -0
  167. package/src/project-client/services/channels/models/slack-token-webhook.ts +45 -0
  168. package/src/project-client/services/channels/models/slack-token.ts +83 -0
  169. package/src/project-client/services/channels/models/teams-token-collection.ts +54 -0
  170. package/src/project-client/services/channels/models/teams-token-webhook.ts +45 -0
  171. package/src/project-client/services/channels/models/teams-token.ts +76 -0
  172. package/src/project-client/services/channels/models/web-push-token-collection.ts +54 -0
  173. package/src/project-client/services/channels/models/web-push-token.ts +77 -0
  174. package/src/project-client/services/channels/request-params.ts +45 -0
  175. package/src/project-client/services/common/index.ts +1 -0
  176. package/src/project-client/services/common/links.ts +57 -0
  177. package/src/project-client/services/events/events-service.ts +85 -0
  178. package/src/project-client/services/events/index.ts +2 -0
  179. package/src/project-client/services/events/models/event-collection.ts +54 -0
  180. package/src/project-client/services/events/models/event.ts +81 -0
  181. package/src/project-client/services/events/models/index.ts +2 -0
  182. package/src/project-client/services/events/request-params.ts +5 -0
  183. package/src/project-client/services/integrations/index.ts +2 -0
  184. package/src/project-client/services/integrations/integrations-service.ts +1966 -0
  185. package/src/project-client/services/integrations/models/apns-config-collection.ts +54 -0
  186. package/src/project-client/services/integrations/models/apns-config-payload.ts +81 -0
  187. package/src/project-client/services/integrations/models/apns-config.ts +64 -0
  188. package/src/project-client/services/integrations/models/awssns-config-collection.ts +54 -0
  189. package/src/project-client/services/integrations/models/awssns-config-payload.ts +45 -0
  190. package/src/project-client/services/integrations/models/awssns-config.ts +64 -0
  191. package/src/project-client/services/integrations/models/badge.ts +6 -0
  192. package/src/project-client/services/integrations/models/banner.ts +63 -0
  193. package/src/project-client/services/integrations/models/default-hover.ts +45 -0
  194. package/src/project-client/services/integrations/models/default-state.ts +45 -0
  195. package/src/project-client/services/integrations/models/default_.ts +90 -0
  196. package/src/project-client/services/integrations/models/dialog.ts +57 -0
  197. package/src/project-client/services/integrations/models/event-source-config-collection.ts +59 -0
  198. package/src/project-client/services/integrations/models/event-source-config-payload.ts +45 -0
  199. package/src/project-client/services/integrations/models/event-source-config.ts +64 -0
  200. package/src/project-client/services/integrations/models/expo-config-collection.ts +54 -0
  201. package/src/project-client/services/integrations/models/expo-config-payload.ts +45 -0
  202. package/src/project-client/services/integrations/models/expo-config.ts +64 -0
  203. package/src/project-client/services/integrations/models/fcm-config-collection.ts +54 -0
  204. package/src/project-client/services/integrations/models/fcm-config-payload.ts +105 -0
  205. package/src/project-client/services/integrations/models/fcm-config.ts +64 -0
  206. package/src/project-client/services/integrations/models/footer.ts +63 -0
  207. package/src/project-client/services/integrations/models/github-config-collection.ts +54 -0
  208. package/src/project-client/services/integrations/models/github-config-payload.ts +45 -0
  209. package/src/project-client/services/integrations/models/github-config.ts +64 -0
  210. package/src/project-client/services/integrations/models/header.ts +69 -0
  211. package/src/project-client/services/integrations/models/icon.ts +51 -0
  212. package/src/project-client/services/integrations/models/images.ts +45 -0
  213. package/src/project-client/services/integrations/models/inbox-config-collection.ts +54 -0
  214. package/src/project-client/services/integrations/models/inbox-config-payload.ts +60 -0
  215. package/src/project-client/services/integrations/models/inbox-config.ts +64 -0
  216. package/src/project-client/services/integrations/models/index.ts +75 -0
  217. package/src/project-client/services/integrations/models/integration-config-collection.ts +59 -0
  218. package/src/project-client/services/integrations/models/integration-config.ts +57 -0
  219. package/src/project-client/services/integrations/models/mailgun-config-collection.ts +54 -0
  220. package/src/project-client/services/integrations/models/mailgun-config-payload-from.ts +51 -0
  221. package/src/project-client/services/integrations/models/mailgun-config-payload.ts +70 -0
  222. package/src/project-client/services/integrations/models/mailgun-config.ts +64 -0
  223. package/src/project-client/services/integrations/models/notification.ts +61 -0
  224. package/src/project-client/services/integrations/models/payload-version.ts +6 -0
  225. package/src/project-client/services/integrations/models/ping-config-collection.ts +54 -0
  226. package/src/project-client/services/integrations/models/ping-config-payload.ts +45 -0
  227. package/src/project-client/services/integrations/models/ping-config.ts +64 -0
  228. package/src/project-client/services/integrations/models/region.ts +6 -0
  229. package/src/project-client/services/integrations/models/reply-to.ts +51 -0
  230. package/src/project-client/services/integrations/models/sendgrid-config-collection.ts +54 -0
  231. package/src/project-client/services/integrations/models/sendgrid-config-payload-from.ts +51 -0
  232. package/src/project-client/services/integrations/models/sendgrid-config-payload.ts +65 -0
  233. package/src/project-client/services/integrations/models/sendgrid-config.ts +64 -0
  234. package/src/project-client/services/integrations/models/ses-config-collection.ts +54 -0
  235. package/src/project-client/services/integrations/models/ses-config-payload-from.ts +51 -0
  236. package/src/project-client/services/integrations/models/ses-config-payload.ts +70 -0
  237. package/src/project-client/services/integrations/models/ses-config.ts +64 -0
  238. package/src/project-client/services/integrations/models/slack-config-collection.ts +54 -0
  239. package/src/project-client/services/integrations/models/slack-config-payload.ts +63 -0
  240. package/src/project-client/services/integrations/models/slack-config.ts +64 -0
  241. package/src/project-client/services/integrations/models/stripe-config-collection.ts +54 -0
  242. package/src/project-client/services/integrations/models/stripe-config-payload.ts +45 -0
  243. package/src/project-client/services/integrations/models/stripe-config.ts +64 -0
  244. package/src/project-client/services/integrations/models/templates-config-collection.ts +59 -0
  245. package/src/project-client/services/integrations/models/templates-config.ts +57 -0
  246. package/src/project-client/services/integrations/models/theme.ts +89 -0
  247. package/src/project-client/services/integrations/models/twilio-config-collection.ts +54 -0
  248. package/src/project-client/services/integrations/models/twilio-config-payload.ts +75 -0
  249. package/src/project-client/services/integrations/models/twilio-config.ts +64 -0
  250. package/src/project-client/services/integrations/models/type_.ts +5 -0
  251. package/src/project-client/services/integrations/models/unread-hover.ts +45 -0
  252. package/src/project-client/services/integrations/models/unread-state.ts +45 -0
  253. package/src/project-client/services/integrations/models/unread.ts +66 -0
  254. package/src/project-client/services/integrations/models/unseen-badge.ts +45 -0
  255. package/src/project-client/services/integrations/models/unseen-hover.ts +45 -0
  256. package/src/project-client/services/integrations/models/unseen-state.ts +45 -0
  257. package/src/project-client/services/integrations/models/unseen.ts +66 -0
  258. package/src/project-client/services/integrations/models/webpush-config-collection.ts +54 -0
  259. package/src/project-client/services/integrations/models/webpush-config-payload.ts +51 -0
  260. package/src/project-client/services/integrations/models/webpush-config.ts +64 -0
  261. package/src/project-client/services/integrations/request-params.ts +5 -0
  262. package/src/project-client/services/jwt/index.ts +2 -0
  263. package/src/project-client/services/jwt/jwt-service.ts +121 -0
  264. package/src/project-client/services/jwt/models/access-token-collection.ts +54 -0
  265. package/src/project-client/services/jwt/models/access-token.ts +69 -0
  266. package/src/project-client/services/jwt/models/create-project-token-request.ts +51 -0
  267. package/src/project-client/services/jwt/models/create-token-response.ts +63 -0
  268. package/src/project-client/services/jwt/models/discard-token-response.ts +51 -0
  269. package/src/project-client/services/jwt/models/index.ts +5 -0
  270. package/src/project-client/services/jwt/request-params.ts +5 -0
  271. package/src/project-client/services/notifications/index.ts +2 -0
  272. package/src/project-client/services/notifications/models/delivery-plan-collection.ts +54 -0
  273. package/src/project-client/services/notifications/models/delivery-plan.ts +93 -0
  274. package/src/project-client/services/notifications/models/index.ts +2 -0
  275. package/src/project-client/services/notifications/notifications-service.ts +45 -0
  276. package/src/project-client/services/users/index.ts +2 -0
  277. package/src/project-client/services/users/models/index.ts +2 -0
  278. package/src/project-client/services/users/models/user-collection.ts +54 -0
  279. package/src/project-client/services/users/models/user.ts +99 -0
  280. package/src/project-client/services/users/request-params.ts +6 -0
  281. package/src/project-client/services/users/users-service.ts +118 -0
  282. package/src/project-client.ts +1 -0
  283. package/src/user-client/http/client.ts +71 -0
  284. package/src/user-client/http/environment.ts +3 -0
  285. package/src/user-client/http/error.ts +14 -0
  286. package/src/user-client/http/errors/throwable-error.ts +9 -0
  287. package/src/user-client/http/errors/validation-error.ts +25 -0
  288. package/src/user-client/http/handlers/handler-chain.ts +30 -0
  289. package/src/user-client/http/handlers/hook-handler.ts +80 -0
  290. package/src/user-client/http/handlers/request-validation-handler.ts +111 -0
  291. package/src/user-client/http/handlers/response-validation-handler.ts +203 -0
  292. package/src/user-client/http/handlers/retry-handler.ts +60 -0
  293. package/src/user-client/http/handlers/terminating-handler.ts +14 -0
  294. package/src/user-client/http/hooks/custom-hook.ts +25 -0
  295. package/src/user-client/http/hooks/hook.ts +41 -0
  296. package/src/user-client/http/index.ts +11 -0
  297. package/src/user-client/http/serialization/base-serializer.ts +139 -0
  298. package/src/user-client/http/serialization/header-serializer.ts +19 -0
  299. package/src/user-client/http/serialization/path-serializer.ts +12 -0
  300. package/src/user-client/http/serialization/query-serializer.ts +18 -0
  301. package/src/user-client/http/transport/request-builder.ts +242 -0
  302. package/src/user-client/http/transport/request-fetch-adapter.ts +131 -0
  303. package/src/user-client/http/transport/request.ts +222 -0
  304. package/src/user-client/http/transport/transport-hook-adapter.ts +91 -0
  305. package/src/user-client/http/transport/types.ts +51 -0
  306. package/src/user-client/http/types.ts +74 -0
  307. package/src/user-client/http/utils/content-type.ts +33 -0
  308. package/src/user-client/http/utils/line-decoder.ts +35 -0
  309. package/src/user-client/http/utils/response-matcher.ts +25 -0
  310. package/src/user-client/index.ts +54 -0
  311. package/src/user-client/services/base-service.ts +27 -0
  312. package/src/user-client/services/channels/channels-service.ts +1021 -0
  313. package/src/user-client/services/channels/index.ts +2 -0
  314. package/src/user-client/services/channels/models/apns-token-collection.ts +54 -0
  315. package/src/user-client/services/channels/models/apns-token-installation-id.ts +6 -0
  316. package/src/user-client/services/channels/models/apns-token-payload-installation-id.ts +6 -0
  317. package/src/user-client/services/channels/models/apns-token-payload.ts +66 -0
  318. package/src/user-client/services/channels/models/apns-token.ts +90 -0
  319. package/src/user-client/services/channels/models/discard-result.ts +51 -0
  320. package/src/user-client/services/channels/models/expo-token-collection.ts +54 -0
  321. package/src/user-client/services/channels/models/expo-token-payload.ts +45 -0
  322. package/src/user-client/services/channels/models/expo-token.ts +69 -0
  323. package/src/user-client/services/channels/models/fcm-token-collection.ts +54 -0
  324. package/src/user-client/services/channels/models/fcm-token-installation-id.ts +6 -0
  325. package/src/user-client/services/channels/models/fcm-token-payload-installation-id.ts +6 -0
  326. package/src/user-client/services/channels/models/fcm-token-payload.ts +51 -0
  327. package/src/user-client/services/channels/models/fcm-token.ts +75 -0
  328. package/src/user-client/services/channels/models/inbox-token-response-collection.ts +59 -0
  329. package/src/user-client/services/channels/models/inbox-token-response.ts +75 -0
  330. package/src/user-client/services/channels/models/inbox-token.ts +51 -0
  331. package/src/user-client/services/channels/models/index.ts +33 -0
  332. package/src/user-client/services/channels/models/slack-token-collection.ts +54 -0
  333. package/src/user-client/services/channels/models/slack-token-oauth.ts +57 -0
  334. package/src/user-client/services/channels/models/slack-token-payload-oauth.ts +57 -0
  335. package/src/user-client/services/channels/models/slack-token-payload-webhook.ts +45 -0
  336. package/src/user-client/services/channels/models/slack-token-payload.ts +64 -0
  337. package/src/user-client/services/channels/models/slack-token-webhook.ts +45 -0
  338. package/src/user-client/services/channels/models/slack-token.ts +88 -0
  339. package/src/user-client/services/channels/models/teams-token-collection.ts +54 -0
  340. package/src/user-client/services/channels/models/teams-token-payload-webhook.ts +45 -0
  341. package/src/user-client/services/channels/models/teams-token-payload.ts +52 -0
  342. package/src/user-client/services/channels/models/teams-token-webhook.ts +45 -0
  343. package/src/user-client/services/channels/models/teams-token.ts +76 -0
  344. package/src/user-client/services/channels/models/web-push-token-collection.ts +54 -0
  345. package/src/user-client/services/channels/models/web-push-token-keys.ts +51 -0
  346. package/src/user-client/services/channels/models/web-push-token-payload-keys.ts +51 -0
  347. package/src/user-client/services/channels/models/web-push-token.ts +82 -0
  348. package/src/user-client/services/channels/request-params.ts +41 -0
  349. package/src/user-client/services/common/index.ts +2 -0
  350. package/src/user-client/services/common/links.ts +57 -0
  351. package/src/user-client/services/common/web-push-token-payload.ts +58 -0
  352. package/src/user-client/services/integrations/index.ts +2 -0
  353. package/src/user-client/services/integrations/integrations-service.ts +279 -0
  354. package/src/user-client/services/integrations/models/authed-user.ts +75 -0
  355. package/src/user-client/services/integrations/models/banner.ts +63 -0
  356. package/src/user-client/services/integrations/models/default-hover.ts +45 -0
  357. package/src/user-client/services/integrations/models/default-state.ts +45 -0
  358. package/src/user-client/services/integrations/models/default_.ts +90 -0
  359. package/src/user-client/services/integrations/models/dialog.ts +57 -0
  360. package/src/user-client/services/integrations/models/enterprise.ts +51 -0
  361. package/src/user-client/services/integrations/models/footer.ts +63 -0
  362. package/src/user-client/services/integrations/models/header.ts +69 -0
  363. package/src/user-client/services/integrations/models/icon.ts +51 -0
  364. package/src/user-client/services/integrations/models/images.ts +45 -0
  365. package/src/user-client/services/integrations/models/inbox-config-payload.ts +60 -0
  366. package/src/user-client/services/integrations/models/incoming-webhook.ts +57 -0
  367. package/src/user-client/services/integrations/models/index.ts +29 -0
  368. package/src/user-client/services/integrations/models/slack-finish-install-response.ts +57 -0
  369. package/src/user-client/services/integrations/models/slack-installation.ts +136 -0
  370. package/src/user-client/services/integrations/models/slack-start-install-response-content.ts +57 -0
  371. package/src/user-client/services/integrations/models/slack-start-install.ts +63 -0
  372. package/src/user-client/services/integrations/models/team.ts +51 -0
  373. package/src/user-client/services/integrations/models/templates-installation.ts +57 -0
  374. package/src/user-client/services/integrations/models/theme-notification.ts +61 -0
  375. package/src/user-client/services/integrations/models/theme.ts +94 -0
  376. package/src/user-client/services/integrations/models/unread-hover.ts +45 -0
  377. package/src/user-client/services/integrations/models/unread-state.ts +45 -0
  378. package/src/user-client/services/integrations/models/unread.ts +66 -0
  379. package/src/user-client/services/integrations/models/unseen-badge.ts +45 -0
  380. package/src/user-client/services/integrations/models/unseen-hover.ts +45 -0
  381. package/src/user-client/services/integrations/models/unseen-state.ts +45 -0
  382. package/src/user-client/services/integrations/models/unseen.ts +66 -0
  383. package/src/user-client/services/integrations/models/web-push-start-installation-response.ts +51 -0
  384. package/src/user-client/services/notifications/index.ts +2 -0
  385. package/src/user-client/services/notifications/models/index.ts +2 -0
  386. package/src/user-client/services/notifications/models/notification-collection.ts +54 -0
  387. package/src/user-client/services/notifications/models/notification.ts +129 -0
  388. package/src/user-client/services/notifications/notifications-service.ts +305 -0
  389. package/src/user-client/services/notifications/request-params.ts +18 -0
  390. package/src/user-client.ts +1 -0
  391. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.d.ts +0 -90
  392. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.d.ts.map +0 -1
  393. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.js +0 -54
  394. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.js.map +0 -1
  395. package/dist/esm/project-client/services/jwt/models/create-user-token-request.d.ts +0 -90
  396. package/dist/esm/project-client/services/jwt/models/create-user-token-request.d.ts.map +0 -1
  397. package/dist/esm/project-client/services/jwt/models/create-user-token-request.js +0 -51
  398. package/dist/esm/project-client/services/jwt/models/create-user-token-request.js.map +0 -1
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * The shape of the model inside the application code - what the users use
5
+ */
6
+ export const webPushStartInstallationResponse = z.lazy(() => {
7
+ return z.object({
8
+ authToken: z.string().min(8),
9
+ publicKey: z.string().min(8).max(128),
10
+ });
11
+ });
12
+
13
+ /**
14
+ *
15
+ * @typedef {WebPushStartInstallationResponse} webPushStartInstallationResponse
16
+ * @property {string}
17
+ * @property {string}
18
+ */
19
+ export type WebPushStartInstallationResponse = z.infer<typeof webPushStartInstallationResponse>;
20
+
21
+ /**
22
+ * The shape of the model mapping from the api schema into the application shape.
23
+ * Is equal to application shape if all property names match the api schema
24
+ */
25
+ export const webPushStartInstallationResponseResponse = z.lazy(() => {
26
+ return z
27
+ .object({
28
+ auth_token: z.string().min(8),
29
+ public_key: z.string().min(8).max(128),
30
+ })
31
+ .transform((data) => ({
32
+ authToken: data['auth_token'],
33
+ publicKey: data['public_key'],
34
+ }));
35
+ });
36
+
37
+ /**
38
+ * The shape of the model mapping from the application shape into the api schema.
39
+ * Is equal to application shape if all property names match the api schema
40
+ */
41
+ export const webPushStartInstallationResponseRequest = z.lazy(() => {
42
+ return z
43
+ .object({
44
+ authToken: z.string().min(8),
45
+ publicKey: z.string().min(8).max(128),
46
+ })
47
+ .transform((data) => ({
48
+ auth_token: data['authToken'],
49
+ public_key: data['publicKey'],
50
+ }));
51
+ });
@@ -0,0 +1,2 @@
1
+ export * from './models/index.js';
2
+ export { NotificationsService } from './notifications-service.js';
@@ -0,0 +1,2 @@
1
+ export type { Notification } from './notification.js';
2
+ export type { NotificationCollection } from './notification-collection.js';
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+
3
+ import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
4
+ import { Notification, notification, notificationRequest, notificationResponse } from './notification.js';
5
+
6
+ /**
7
+ * The shape of the model inside the application code - what the users use
8
+ */
9
+ export const notificationCollection = z.lazy(() => {
10
+ return z.object({
11
+ data: z.array(notification).optional(),
12
+ links: links.optional(),
13
+ });
14
+ });
15
+
16
+ /**
17
+ *
18
+ * @typedef {NotificationCollection} notificationCollection
19
+ * @property {Notification[]}
20
+ * @property {Links}
21
+ */
22
+ export type NotificationCollection = z.infer<typeof notificationCollection>;
23
+
24
+ /**
25
+ * The shape of the model mapping from the api schema into the application shape.
26
+ * Is equal to application shape if all property names match the api schema
27
+ */
28
+ export const notificationCollectionResponse = z.lazy(() => {
29
+ return z
30
+ .object({
31
+ data: z.array(notificationResponse).optional(),
32
+ links: linksResponse.optional(),
33
+ })
34
+ .transform((data) => ({
35
+ data: data['data'],
36
+ links: data['links'],
37
+ }));
38
+ });
39
+
40
+ /**
41
+ * The shape of the model mapping from the application shape into the api schema.
42
+ * Is equal to application shape if all property names match the api schema
43
+ */
44
+ export const notificationCollectionRequest = z.lazy(() => {
45
+ return z
46
+ .object({
47
+ data: z.array(notificationRequest).optional(),
48
+ links: linksRequest.optional(),
49
+ })
50
+ .transform((data) => ({
51
+ data: data['data'],
52
+ links: data['links'],
53
+ }));
54
+ });
@@ -0,0 +1,129 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * The shape of the model inside the application code - what the users use
5
+ */
6
+ export const notification = z.lazy(() => {
7
+ return z.object({
8
+ actionUrl: z.string().max(2048).optional().nullable(),
9
+ archivedAt: z.string().optional().nullable(),
10
+ category: z.string().max(100).optional().nullable(),
11
+ content: z.string().max(10485760).optional().nullable(),
12
+ createdAt: z.string(),
13
+ customAttributes: z.any().optional().nullable(),
14
+ discardedAt: z.string().optional().nullable(),
15
+ id: z.string(),
16
+ readAt: z.string().optional().nullable(),
17
+ seenAt: z.string().optional().nullable(),
18
+ sentAt: z.string().optional().nullable(),
19
+ title: z.string().min(1).max(255),
20
+ topic: z.string().max(100).optional().nullable(),
21
+ updatedAt: z.string(),
22
+ userId: z.string(),
23
+ });
24
+ });
25
+
26
+ /**
27
+ *
28
+ * @typedef {Notification} notification
29
+ * @property {string}
30
+ * @property {string}
31
+ * @property {string}
32
+ * @property {string}
33
+ * @property {string}
34
+ * @property {any}
35
+ * @property {string}
36
+ * @property {string}
37
+ * @property {string}
38
+ * @property {string}
39
+ * @property {string}
40
+ * @property {string}
41
+ * @property {string}
42
+ * @property {string}
43
+ * @property {string}
44
+ */
45
+ export type Notification = z.infer<typeof notification>;
46
+
47
+ /**
48
+ * The shape of the model mapping from the api schema into the application shape.
49
+ * Is equal to application shape if all property names match the api schema
50
+ */
51
+ export const notificationResponse = z.lazy(() => {
52
+ return z
53
+ .object({
54
+ action_url: z.string().max(2048).optional().nullable(),
55
+ archived_at: z.string().optional().nullable(),
56
+ category: z.string().max(100).optional().nullable(),
57
+ content: z.string().max(10485760).optional().nullable(),
58
+ created_at: z.string(),
59
+ custom_attributes: z.any().optional().nullable(),
60
+ discarded_at: z.string().optional().nullable(),
61
+ id: z.string(),
62
+ read_at: z.string().optional().nullable(),
63
+ seen_at: z.string().optional().nullable(),
64
+ sent_at: z.string().optional().nullable(),
65
+ title: z.string().min(1).max(255),
66
+ topic: z.string().max(100).optional().nullable(),
67
+ updated_at: z.string(),
68
+ user_id: z.string(),
69
+ })
70
+ .transform((data) => ({
71
+ actionUrl: data['action_url'],
72
+ archivedAt: data['archived_at'],
73
+ category: data['category'],
74
+ content: data['content'],
75
+ createdAt: data['created_at'],
76
+ customAttributes: data['custom_attributes'],
77
+ discardedAt: data['discarded_at'],
78
+ id: data['id'],
79
+ readAt: data['read_at'],
80
+ seenAt: data['seen_at'],
81
+ sentAt: data['sent_at'],
82
+ title: data['title'],
83
+ topic: data['topic'],
84
+ updatedAt: data['updated_at'],
85
+ userId: data['user_id'],
86
+ }));
87
+ });
88
+
89
+ /**
90
+ * The shape of the model mapping from the application shape into the api schema.
91
+ * Is equal to application shape if all property names match the api schema
92
+ */
93
+ export const notificationRequest = z.lazy(() => {
94
+ return z
95
+ .object({
96
+ actionUrl: z.string().max(2048).optional().nullable(),
97
+ archivedAt: z.string().optional().nullable(),
98
+ category: z.string().max(100).optional().nullable(),
99
+ content: z.string().max(10485760).optional().nullable(),
100
+ createdAt: z.string(),
101
+ customAttributes: z.any().optional().nullable(),
102
+ discardedAt: z.string().optional().nullable(),
103
+ id: z.string(),
104
+ readAt: z.string().optional().nullable(),
105
+ seenAt: z.string().optional().nullable(),
106
+ sentAt: z.string().optional().nullable(),
107
+ title: z.string().min(1).max(255),
108
+ topic: z.string().max(100).optional().nullable(),
109
+ updatedAt: z.string(),
110
+ userId: z.string(),
111
+ })
112
+ .transform((data) => ({
113
+ action_url: data['actionUrl'],
114
+ archived_at: data['archivedAt'],
115
+ category: data['category'],
116
+ content: data['content'],
117
+ created_at: data['createdAt'],
118
+ custom_attributes: data['customAttributes'],
119
+ discarded_at: data['discardedAt'],
120
+ id: data['id'],
121
+ read_at: data['readAt'],
122
+ seen_at: data['seenAt'],
123
+ sent_at: data['sentAt'],
124
+ title: data['title'],
125
+ topic: data['topic'],
126
+ updated_at: data['updatedAt'],
127
+ user_id: data['userId'],
128
+ }));
129
+ });
@@ -0,0 +1,305 @@
1
+ import { z } from 'zod';
2
+
3
+ import { Environment } from '../../http/environment.js';
4
+ import { ThrowableError } from '../../http/errors/throwable-error.js';
5
+ import { SerializationStyle } from '../../http/serialization/base-serializer.js';
6
+ import { RequestBuilder } from '../../http/transport/request-builder.js';
7
+ import { ContentType, HttpResponse, RequestConfig } from '../../http/types.js';
8
+ import { BaseService } from '../base-service.js';
9
+ import { Notification, notificationResponse } from './models/notification.js';
10
+ import { NotificationCollection, notificationCollectionResponse } from './models/notification-collection.js';
11
+ import { ArchiveNotificationsParams, ListNotificationsParams, MarkNotificationsReadParams } from './request-params.js';
12
+
13
+ export class NotificationsService extends BaseService {
14
+ /**
15
+ * Lists all notifications for a user.
16
+ * @param {number} [params.limit] -
17
+ * @param {string} [params.startingAfter] -
18
+ * @param {string} [params.endingBefore] -
19
+ * @param {string} [params.status] -
20
+ * @param {string} [params.category] -
21
+ * @param {string} [params.topic] -
22
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
23
+ * @returns {Promise<HttpResponse<NotificationCollection>>} OK
24
+ */
25
+ async listNotifications(
26
+ params?: ListNotificationsParams,
27
+ requestConfig?: RequestConfig,
28
+ ): Promise<HttpResponse<NotificationCollection>> {
29
+ const request = new RequestBuilder()
30
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
31
+ .setConfig(this.config)
32
+ .setMethod('GET')
33
+ .setPath('/notifications')
34
+ .setRequestSchema(z.any())
35
+ .addAccessTokenAuth(this.config.token, 'Bearer')
36
+ .setRequestContentType(ContentType.Json)
37
+ .addResponse({
38
+ schema: notificationCollectionResponse,
39
+ contentType: ContentType.Json,
40
+ status: 200,
41
+ })
42
+ .setRetryAttempts(this.config, requestConfig)
43
+ .setRetryDelayMs(this.config, requestConfig)
44
+ .setResponseValidation(this.config, requestConfig)
45
+ .addQueryParam({
46
+ key: 'limit',
47
+ value: params?.limit,
48
+ })
49
+ .addQueryParam({
50
+ key: 'starting_after',
51
+ value: params?.startingAfter,
52
+ })
53
+ .addQueryParam({
54
+ key: 'ending_before',
55
+ value: params?.endingBefore,
56
+ })
57
+ .addQueryParam({
58
+ key: 'status',
59
+ value: params?.status,
60
+ })
61
+ .addQueryParam({
62
+ key: 'category',
63
+ value: params?.category,
64
+ })
65
+ .addQueryParam({
66
+ key: 'topic',
67
+ value: params?.topic,
68
+ })
69
+ .build();
70
+ return this.client.call<NotificationCollection>(request);
71
+ }
72
+
73
+ /**
74
+ * Archives all notifications.
75
+ * @param {string} [params.category] -
76
+ * @param {string} [params.topic] -
77
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
78
+ * @returns {Promise<HttpResponse<any>>} No Content
79
+ */
80
+ async archiveNotifications(
81
+ params?: ArchiveNotificationsParams,
82
+ requestConfig?: RequestConfig,
83
+ ): Promise<HttpResponse<void>> {
84
+ const request = new RequestBuilder()
85
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
86
+ .setConfig(this.config)
87
+ .setMethod('POST')
88
+ .setPath('/notifications/archive')
89
+ .setRequestSchema(z.any())
90
+ .addAccessTokenAuth(this.config.token, 'Bearer')
91
+ .setRequestContentType(ContentType.Json)
92
+ .addResponse({
93
+ schema: z.undefined(),
94
+ contentType: ContentType.NoContent,
95
+ status: 204,
96
+ })
97
+ .setRetryAttempts(this.config, requestConfig)
98
+ .setRetryDelayMs(this.config, requestConfig)
99
+ .setResponseValidation(this.config, requestConfig)
100
+ .addQueryParam({
101
+ key: 'category',
102
+ value: params?.category,
103
+ })
104
+ .addQueryParam({
105
+ key: 'topic',
106
+ value: params?.topic,
107
+ })
108
+ .build();
109
+ return this.client.call<void>(request);
110
+ }
111
+
112
+ /**
113
+ * Marks all notifications as read.
114
+ * @param {string} [params.category] -
115
+ * @param {string} [params.topic] -
116
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
117
+ * @returns {Promise<HttpResponse<any>>} No Content
118
+ */
119
+ async markNotificationsRead(
120
+ params?: MarkNotificationsReadParams,
121
+ requestConfig?: RequestConfig,
122
+ ): Promise<HttpResponse<void>> {
123
+ const request = new RequestBuilder()
124
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
125
+ .setConfig(this.config)
126
+ .setMethod('POST')
127
+ .setPath('/notifications/read')
128
+ .setRequestSchema(z.any())
129
+ .addAccessTokenAuth(this.config.token, 'Bearer')
130
+ .setRequestContentType(ContentType.Json)
131
+ .addResponse({
132
+ schema: z.undefined(),
133
+ contentType: ContentType.NoContent,
134
+ status: 204,
135
+ })
136
+ .setRetryAttempts(this.config, requestConfig)
137
+ .setRetryDelayMs(this.config, requestConfig)
138
+ .setResponseValidation(this.config, requestConfig)
139
+ .addQueryParam({
140
+ key: 'category',
141
+ value: params?.category,
142
+ })
143
+ .addQueryParam({
144
+ key: 'topic',
145
+ value: params?.topic,
146
+ })
147
+ .build();
148
+ return this.client.call<void>(request);
149
+ }
150
+
151
+ /**
152
+ * Gets a notification by ID.
153
+ * @param {string} notificationId -
154
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
155
+ * @returns {Promise<HttpResponse<Notification>>} OK
156
+ */
157
+ async getNotification(notificationId: string, requestConfig?: RequestConfig): Promise<HttpResponse<Notification>> {
158
+ const request = new RequestBuilder()
159
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
160
+ .setConfig(this.config)
161
+ .setMethod('GET')
162
+ .setPath('/notifications/{notification_id}')
163
+ .setRequestSchema(z.any())
164
+ .addAccessTokenAuth(this.config.token, 'Bearer')
165
+ .setRequestContentType(ContentType.Json)
166
+ .addResponse({
167
+ schema: notificationResponse,
168
+ contentType: ContentType.Json,
169
+ status: 200,
170
+ })
171
+ .setRetryAttempts(this.config, requestConfig)
172
+ .setRetryDelayMs(this.config, requestConfig)
173
+ .setResponseValidation(this.config, requestConfig)
174
+ .addPathParam({
175
+ key: 'notification_id',
176
+ value: notificationId,
177
+ })
178
+ .build();
179
+ return this.client.call<Notification>(request);
180
+ }
181
+
182
+ /**
183
+ * Archives a notification.
184
+ * @param {string} notificationId -
185
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
186
+ * @returns {Promise<HttpResponse<any>>} No Content
187
+ */
188
+ async archiveNotification(notificationId: string, requestConfig?: RequestConfig): Promise<HttpResponse<void>> {
189
+ const request = new RequestBuilder()
190
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
191
+ .setConfig(this.config)
192
+ .setMethod('POST')
193
+ .setPath('/notifications/{notification_id}/archive')
194
+ .setRequestSchema(z.any())
195
+ .addAccessTokenAuth(this.config.token, 'Bearer')
196
+ .setRequestContentType(ContentType.Json)
197
+ .addResponse({
198
+ schema: z.undefined(),
199
+ contentType: ContentType.NoContent,
200
+ status: 204,
201
+ })
202
+ .setRetryAttempts(this.config, requestConfig)
203
+ .setRetryDelayMs(this.config, requestConfig)
204
+ .setResponseValidation(this.config, requestConfig)
205
+ .addPathParam({
206
+ key: 'notification_id',
207
+ value: notificationId,
208
+ })
209
+ .build();
210
+ return this.client.call<void>(request);
211
+ }
212
+
213
+ /**
214
+ * Marks a notification as read.
215
+ * @param {string} notificationId -
216
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
217
+ * @returns {Promise<HttpResponse<any>>} No Content
218
+ */
219
+ async markNotificationRead(notificationId: string, requestConfig?: RequestConfig): Promise<HttpResponse<void>> {
220
+ const request = new RequestBuilder()
221
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
222
+ .setConfig(this.config)
223
+ .setMethod('POST')
224
+ .setPath('/notifications/{notification_id}/read')
225
+ .setRequestSchema(z.any())
226
+ .addAccessTokenAuth(this.config.token, 'Bearer')
227
+ .setRequestContentType(ContentType.Json)
228
+ .addResponse({
229
+ schema: z.undefined(),
230
+ contentType: ContentType.NoContent,
231
+ status: 204,
232
+ })
233
+ .setRetryAttempts(this.config, requestConfig)
234
+ .setRetryDelayMs(this.config, requestConfig)
235
+ .setResponseValidation(this.config, requestConfig)
236
+ .addPathParam({
237
+ key: 'notification_id',
238
+ value: notificationId,
239
+ })
240
+ .build();
241
+ return this.client.call<void>(request);
242
+ }
243
+
244
+ /**
245
+ * Unarchives a notification.
246
+ * @param {string} notificationId -
247
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
248
+ * @returns {Promise<HttpResponse<any>>} No Content
249
+ */
250
+ async unarchiveNotification(notificationId: string, requestConfig?: RequestConfig): Promise<HttpResponse<void>> {
251
+ const request = new RequestBuilder()
252
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
253
+ .setConfig(this.config)
254
+ .setMethod('POST')
255
+ .setPath('/notifications/{notification_id}/unarchive')
256
+ .setRequestSchema(z.any())
257
+ .addAccessTokenAuth(this.config.token, 'Bearer')
258
+ .setRequestContentType(ContentType.Json)
259
+ .addResponse({
260
+ schema: z.undefined(),
261
+ contentType: ContentType.NoContent,
262
+ status: 204,
263
+ })
264
+ .setRetryAttempts(this.config, requestConfig)
265
+ .setRetryDelayMs(this.config, requestConfig)
266
+ .setResponseValidation(this.config, requestConfig)
267
+ .addPathParam({
268
+ key: 'notification_id',
269
+ value: notificationId,
270
+ })
271
+ .build();
272
+ return this.client.call<void>(request);
273
+ }
274
+
275
+ /**
276
+ * Marks a notification as unread.
277
+ * @param {string} notificationId -
278
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
279
+ * @returns {Promise<HttpResponse<any>>} No Content
280
+ */
281
+ async markNotificationUnread(notificationId: string, requestConfig?: RequestConfig): Promise<HttpResponse<void>> {
282
+ const request = new RequestBuilder()
283
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
284
+ .setConfig(this.config)
285
+ .setMethod('POST')
286
+ .setPath('/notifications/{notification_id}/unread')
287
+ .setRequestSchema(z.any())
288
+ .addAccessTokenAuth(this.config.token, 'Bearer')
289
+ .setRequestContentType(ContentType.Json)
290
+ .addResponse({
291
+ schema: z.undefined(),
292
+ contentType: ContentType.NoContent,
293
+ status: 204,
294
+ })
295
+ .setRetryAttempts(this.config, requestConfig)
296
+ .setRetryDelayMs(this.config, requestConfig)
297
+ .setResponseValidation(this.config, requestConfig)
298
+ .addPathParam({
299
+ key: 'notification_id',
300
+ value: notificationId,
301
+ })
302
+ .build();
303
+ return this.client.call<void>(request);
304
+ }
305
+ }
@@ -0,0 +1,18 @@
1
+ export interface ListNotificationsParams {
2
+ limit?: number;
3
+ startingAfter?: string;
4
+ endingBefore?: string;
5
+ status?: string;
6
+ category?: string;
7
+ topic?: string;
8
+ }
9
+
10
+ export interface ArchiveNotificationsParams {
11
+ category?: string;
12
+ topic?: string;
13
+ }
14
+
15
+ export interface MarkNotificationsReadParams {
16
+ category?: string;
17
+ topic?: string;
18
+ }
@@ -0,0 +1 @@
1
+ export * from './user-client/index.js';
@@ -1,90 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * The shape of the model inside the application code - what the users use
4
- */
5
- export declare const createUserTokenRequest: z.ZodLazy<z.ZodObject<{
6
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
7
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
8
- externalId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
9
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
- }, "strip", z.ZodTypeAny, {
11
- email?: string | null | undefined;
12
- name?: string | null | undefined;
13
- expiry?: number | null | undefined;
14
- externalId?: string | null | undefined;
15
- }, {
16
- email?: string | null | undefined;
17
- name?: string | null | undefined;
18
- expiry?: number | null | undefined;
19
- externalId?: string | null | undefined;
20
- }>>;
21
- /**
22
- *
23
- * @typedef {CreateUserTokenRequest} createUserTokenRequest
24
- * @property {string} - The user's email.
25
- * @property {number} - The duration for which the token is valid (in seconds)
26
- * @property {string} - A unique string that MagicBell can utilize to identify the user uniquely. We recommend setting this attribute to the ID of the user in your database. Provide the external id if the user's email is unavailable.
27
- * @property {string} - The name of the token.
28
- */
29
- export type CreateUserTokenRequest = z.infer<typeof createUserTokenRequest>;
30
- /**
31
- * The shape of the model mapping from the api schema into the application shape.
32
- * Is equal to application shape if all property names match the api schema
33
- */
34
- export declare const createUserTokenRequestResponse: z.ZodLazy<z.ZodEffects<z.ZodObject<{
35
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
36
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
37
- external_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
38
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
- }, "strip", z.ZodTypeAny, {
40
- email?: string | null | undefined;
41
- name?: string | null | undefined;
42
- expiry?: number | null | undefined;
43
- external_id?: string | null | undefined;
44
- }, {
45
- email?: string | null | undefined;
46
- name?: string | null | undefined;
47
- expiry?: number | null | undefined;
48
- external_id?: string | null | undefined;
49
- }>, {
50
- email: string | null | undefined;
51
- expiry: number | null | undefined;
52
- externalId: string | null | undefined;
53
- name: string | null | undefined;
54
- }, {
55
- email?: string | null | undefined;
56
- name?: string | null | undefined;
57
- expiry?: number | null | undefined;
58
- external_id?: string | null | undefined;
59
- }>>;
60
- /**
61
- * The shape of the model mapping from the application shape into the api schema.
62
- * Is equal to application shape if all property names match the api schema
63
- */
64
- export declare const createUserTokenRequestRequest: z.ZodLazy<z.ZodEffects<z.ZodObject<{
65
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
66
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
67
- externalId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
69
- }, "strip", z.ZodTypeAny, {
70
- email?: string | null | undefined;
71
- name?: string | null | undefined;
72
- expiry?: number | null | undefined;
73
- externalId?: string | null | undefined;
74
- }, {
75
- email?: string | null | undefined;
76
- name?: string | null | undefined;
77
- expiry?: number | null | undefined;
78
- externalId?: string | null | undefined;
79
- }>, {
80
- email: string | null | undefined;
81
- expiry: number | null | undefined;
82
- external_id: string | null | undefined;
83
- name: string | null | undefined;
84
- }, {
85
- email?: string | null | undefined;
86
- name?: string | null | undefined;
87
- expiry?: number | null | undefined;
88
- externalId?: string | null | undefined;
89
- }>>;
90
- //# sourceMappingURL=create-user-token-request.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-user-token-request.d.ts","sourceRoot":"","sources":["../../../../../../src/project-client/services/jwt/models/create-user-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;GAOjC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;GAczC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;GAcxC,CAAC"}