magicbell-js 0.0.2 → 0.0.4

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 (308) hide show
  1. package/dist/commonjs/project-client/http/environment.d.ts +1 -1
  2. package/dist/commonjs/project-client/http/environment.d.ts.map +1 -1
  3. package/dist/commonjs/project-client/http/environment.js +1 -1
  4. package/dist/commonjs/project-client/http/environment.js.map +1 -1
  5. package/dist/commonjs/user-client/http/environment.d.ts +1 -1
  6. package/dist/commonjs/user-client/http/environment.d.ts.map +1 -1
  7. package/dist/commonjs/user-client/http/environment.js +1 -1
  8. package/dist/commonjs/user-client/http/environment.js.map +1 -1
  9. package/dist/esm/project-client/http/environment.d.ts +1 -1
  10. package/dist/esm/project-client/http/environment.d.ts.map +1 -1
  11. package/dist/esm/project-client/http/environment.js +1 -1
  12. package/dist/esm/project-client/http/environment.js.map +1 -1
  13. package/dist/esm/user-client/http/environment.d.ts +1 -1
  14. package/dist/esm/user-client/http/environment.d.ts.map +1 -1
  15. package/dist/esm/user-client/http/environment.js +1 -1
  16. package/dist/esm/user-client/http/environment.js.map +1 -1
  17. package/package.json +3 -2
  18. package/src/project-client/http/client.ts +71 -0
  19. package/src/project-client/http/environment.ts +3 -0
  20. package/src/project-client/http/error.ts +14 -0
  21. package/src/project-client/http/errors/validation-error.ts +25 -0
  22. package/src/project-client/http/handlers/handler-chain.ts +30 -0
  23. package/src/project-client/http/handlers/hook-handler.ts +78 -0
  24. package/src/project-client/http/handlers/request-validation-handler.ts +111 -0
  25. package/src/project-client/http/handlers/response-validation-handler.ts +203 -0
  26. package/src/project-client/http/handlers/retry-handler.ts +60 -0
  27. package/src/project-client/http/handlers/terminating-handler.ts +14 -0
  28. package/src/project-client/http/hooks/custom-hook.ts +25 -0
  29. package/src/project-client/http/hooks/hook.ts +41 -0
  30. package/src/project-client/http/index.ts +11 -0
  31. package/src/project-client/http/serialization/base-serializer.ts +139 -0
  32. package/src/project-client/http/serialization/header-serializer.ts +19 -0
  33. package/src/project-client/http/serialization/path-serializer.ts +12 -0
  34. package/src/project-client/http/serialization/query-serializer.ts +18 -0
  35. package/src/project-client/http/transport/request-builder.ts +242 -0
  36. package/src/project-client/http/transport/request-fetch-adapter.ts +131 -0
  37. package/src/project-client/http/transport/request.ts +222 -0
  38. package/src/project-client/http/transport/transport-hook-adapter.ts +91 -0
  39. package/src/project-client/http/transport/types.ts +50 -0
  40. package/src/project-client/http/types.ts +74 -0
  41. package/src/project-client/http/utils/content-type.ts +33 -0
  42. package/src/project-client/http/utils/line-decoder.ts +35 -0
  43. package/src/project-client/http/utils/response-matcher.ts +25 -0
  44. package/src/project-client/index.ts +94 -0
  45. package/src/project-client/services/base-service.ts +27 -0
  46. package/src/project-client/services/broadcasts/broadcasts-service.ts +115 -0
  47. package/src/project-client/services/broadcasts/index.ts +2 -0
  48. package/src/project-client/services/broadcasts/models/broadcast-collection.ts +54 -0
  49. package/src/project-client/services/broadcasts/models/broadcast-status.ts +60 -0
  50. package/src/project-client/services/broadcasts/models/broadcast.ts +143 -0
  51. package/src/project-client/services/broadcasts/models/email.ts +57 -0
  52. package/src/project-client/services/broadcasts/models/errors.ts +45 -0
  53. package/src/project-client/services/broadcasts/models/in-app.ts +57 -0
  54. package/src/project-client/services/broadcasts/models/index.ts +15 -0
  55. package/src/project-client/services/broadcasts/models/mobile-push.ts +57 -0
  56. package/src/project-client/services/broadcasts/models/overrides-channels.ts +82 -0
  57. package/src/project-client/services/broadcasts/models/overrides.ts +59 -0
  58. package/src/project-client/services/broadcasts/models/providers.ts +81 -0
  59. package/src/project-client/services/broadcasts/models/slack.ts +57 -0
  60. package/src/project-client/services/broadcasts/models/sms.ts +57 -0
  61. package/src/project-client/services/broadcasts/models/status-status.ts +7 -0
  62. package/src/project-client/services/broadcasts/models/summary.ts +51 -0
  63. package/src/project-client/services/broadcasts/models/web-push.ts +57 -0
  64. package/src/project-client/services/broadcasts/request-params.ts +5 -0
  65. package/src/project-client/services/channels/channels-service.ts +1017 -0
  66. package/src/project-client/services/channels/index.ts +2 -0
  67. package/src/project-client/services/channels/models/apns-token-collection.ts +54 -0
  68. package/src/project-client/services/channels/models/apns-token-installation-id.ts +6 -0
  69. package/src/project-client/services/channels/models/apns-token.ts +90 -0
  70. package/src/project-client/services/channels/models/category-delivery-config-channels.ts +57 -0
  71. package/src/project-client/services/channels/models/category-delivery-config.ts +73 -0
  72. package/src/project-client/services/channels/models/channel.ts +11 -0
  73. package/src/project-client/services/channels/models/discard-result.ts +51 -0
  74. package/src/project-client/services/channels/models/expo-token-collection.ts +54 -0
  75. package/src/project-client/services/channels/models/expo-token.ts +69 -0
  76. package/src/project-client/services/channels/models/fcm-token-collection.ts +54 -0
  77. package/src/project-client/services/channels/models/fcm-token-installation-id.ts +6 -0
  78. package/src/project-client/services/channels/models/fcm-token.ts +75 -0
  79. package/src/project-client/services/channels/models/inbox-token-response-collection.ts +59 -0
  80. package/src/project-client/services/channels/models/inbox-token-response.ts +75 -0
  81. package/src/project-client/services/channels/models/index.ts +24 -0
  82. package/src/project-client/services/channels/models/keys.ts +51 -0
  83. package/src/project-client/services/channels/models/oauth.ts +57 -0
  84. package/src/project-client/services/channels/models/slack-token-collection.ts +54 -0
  85. package/src/project-client/services/channels/models/slack-token-webhook.ts +45 -0
  86. package/src/project-client/services/channels/models/slack-token.ts +83 -0
  87. package/src/project-client/services/channels/models/teams-token-collection.ts +54 -0
  88. package/src/project-client/services/channels/models/teams-token-webhook.ts +45 -0
  89. package/src/project-client/services/channels/models/teams-token.ts +76 -0
  90. package/src/project-client/services/channels/models/web-push-token-collection.ts +54 -0
  91. package/src/project-client/services/channels/models/web-push-token.ts +77 -0
  92. package/src/project-client/services/channels/request-params.ts +45 -0
  93. package/src/project-client/services/common/index.ts +1 -0
  94. package/src/project-client/services/common/links.ts +57 -0
  95. package/src/project-client/services/events/events-service.ts +84 -0
  96. package/src/project-client/services/events/index.ts +2 -0
  97. package/src/project-client/services/events/models/event-collection.ts +54 -0
  98. package/src/project-client/services/events/models/event.ts +81 -0
  99. package/src/project-client/services/events/models/index.ts +2 -0
  100. package/src/project-client/services/events/request-params.ts +5 -0
  101. package/src/project-client/services/integrations/index.ts +2 -0
  102. package/src/project-client/services/integrations/integrations-service.ts +1965 -0
  103. package/src/project-client/services/integrations/models/apns-config-collection.ts +54 -0
  104. package/src/project-client/services/integrations/models/apns-config-payload.ts +81 -0
  105. package/src/project-client/services/integrations/models/apns-config.ts +64 -0
  106. package/src/project-client/services/integrations/models/awssns-config-collection.ts +54 -0
  107. package/src/project-client/services/integrations/models/awssns-config-payload.ts +45 -0
  108. package/src/project-client/services/integrations/models/awssns-config.ts +64 -0
  109. package/src/project-client/services/integrations/models/badge.ts +6 -0
  110. package/src/project-client/services/integrations/models/banner.ts +63 -0
  111. package/src/project-client/services/integrations/models/default-hover.ts +45 -0
  112. package/src/project-client/services/integrations/models/default-state.ts +45 -0
  113. package/src/project-client/services/integrations/models/default_.ts +90 -0
  114. package/src/project-client/services/integrations/models/dialog.ts +57 -0
  115. package/src/project-client/services/integrations/models/event-source-config-collection.ts +59 -0
  116. package/src/project-client/services/integrations/models/event-source-config-payload.ts +45 -0
  117. package/src/project-client/services/integrations/models/event-source-config.ts +64 -0
  118. package/src/project-client/services/integrations/models/expo-config-collection.ts +54 -0
  119. package/src/project-client/services/integrations/models/expo-config-payload.ts +45 -0
  120. package/src/project-client/services/integrations/models/expo-config.ts +64 -0
  121. package/src/project-client/services/integrations/models/fcm-config-collection.ts +54 -0
  122. package/src/project-client/services/integrations/models/fcm-config-payload.ts +105 -0
  123. package/src/project-client/services/integrations/models/fcm-config.ts +64 -0
  124. package/src/project-client/services/integrations/models/footer.ts +63 -0
  125. package/src/project-client/services/integrations/models/github-config-collection.ts +54 -0
  126. package/src/project-client/services/integrations/models/github-config-payload.ts +45 -0
  127. package/src/project-client/services/integrations/models/github-config.ts +64 -0
  128. package/src/project-client/services/integrations/models/header.ts +69 -0
  129. package/src/project-client/services/integrations/models/icon.ts +51 -0
  130. package/src/project-client/services/integrations/models/images.ts +45 -0
  131. package/src/project-client/services/integrations/models/inbox-config-collection.ts +54 -0
  132. package/src/project-client/services/integrations/models/inbox-config-payload.ts +60 -0
  133. package/src/project-client/services/integrations/models/inbox-config.ts +64 -0
  134. package/src/project-client/services/integrations/models/index.ts +75 -0
  135. package/src/project-client/services/integrations/models/integration-config-collection.ts +59 -0
  136. package/src/project-client/services/integrations/models/integration-config.ts +57 -0
  137. package/src/project-client/services/integrations/models/mailgun-config-collection.ts +54 -0
  138. package/src/project-client/services/integrations/models/mailgun-config-payload-from.ts +51 -0
  139. package/src/project-client/services/integrations/models/mailgun-config-payload.ts +70 -0
  140. package/src/project-client/services/integrations/models/mailgun-config.ts +64 -0
  141. package/src/project-client/services/integrations/models/notification.ts +61 -0
  142. package/src/project-client/services/integrations/models/payload-version.ts +6 -0
  143. package/src/project-client/services/integrations/models/ping-config-collection.ts +54 -0
  144. package/src/project-client/services/integrations/models/ping-config-payload.ts +45 -0
  145. package/src/project-client/services/integrations/models/ping-config.ts +64 -0
  146. package/src/project-client/services/integrations/models/region.ts +6 -0
  147. package/src/project-client/services/integrations/models/reply-to.ts +51 -0
  148. package/src/project-client/services/integrations/models/sendgrid-config-collection.ts +54 -0
  149. package/src/project-client/services/integrations/models/sendgrid-config-payload-from.ts +51 -0
  150. package/src/project-client/services/integrations/models/sendgrid-config-payload.ts +65 -0
  151. package/src/project-client/services/integrations/models/sendgrid-config.ts +64 -0
  152. package/src/project-client/services/integrations/models/ses-config-collection.ts +54 -0
  153. package/src/project-client/services/integrations/models/ses-config-payload-from.ts +51 -0
  154. package/src/project-client/services/integrations/models/ses-config-payload.ts +70 -0
  155. package/src/project-client/services/integrations/models/ses-config.ts +64 -0
  156. package/src/project-client/services/integrations/models/slack-config-collection.ts +54 -0
  157. package/src/project-client/services/integrations/models/slack-config-payload.ts +63 -0
  158. package/src/project-client/services/integrations/models/slack-config.ts +64 -0
  159. package/src/project-client/services/integrations/models/stripe-config-collection.ts +54 -0
  160. package/src/project-client/services/integrations/models/stripe-config-payload.ts +45 -0
  161. package/src/project-client/services/integrations/models/stripe-config.ts +64 -0
  162. package/src/project-client/services/integrations/models/templates-config-collection.ts +59 -0
  163. package/src/project-client/services/integrations/models/templates-config.ts +57 -0
  164. package/src/project-client/services/integrations/models/theme.ts +89 -0
  165. package/src/project-client/services/integrations/models/twilio-config-collection.ts +54 -0
  166. package/src/project-client/services/integrations/models/twilio-config-payload.ts +75 -0
  167. package/src/project-client/services/integrations/models/twilio-config.ts +64 -0
  168. package/src/project-client/services/integrations/models/type_.ts +5 -0
  169. package/src/project-client/services/integrations/models/unread-hover.ts +45 -0
  170. package/src/project-client/services/integrations/models/unread-state.ts +45 -0
  171. package/src/project-client/services/integrations/models/unread.ts +66 -0
  172. package/src/project-client/services/integrations/models/unseen-badge.ts +45 -0
  173. package/src/project-client/services/integrations/models/unseen-hover.ts +45 -0
  174. package/src/project-client/services/integrations/models/unseen-state.ts +45 -0
  175. package/src/project-client/services/integrations/models/unseen.ts +66 -0
  176. package/src/project-client/services/integrations/models/webpush-config-collection.ts +54 -0
  177. package/src/project-client/services/integrations/models/webpush-config-payload.ts +51 -0
  178. package/src/project-client/services/integrations/models/webpush-config.ts +64 -0
  179. package/src/project-client/services/integrations/request-params.ts +5 -0
  180. package/src/project-client/services/jwt/index.ts +2 -0
  181. package/src/project-client/services/jwt/jwt-service.ts +233 -0
  182. package/src/project-client/services/jwt/models/access-token-collection.ts +54 -0
  183. package/src/project-client/services/jwt/models/access-token.ts +69 -0
  184. package/src/project-client/services/jwt/models/create-project-token-request.ts +51 -0
  185. package/src/project-client/services/jwt/models/create-token-response.ts +63 -0
  186. package/src/project-client/services/jwt/models/create-user-token-request.ts +63 -0
  187. package/src/project-client/services/jwt/models/discard-token-response.ts +51 -0
  188. package/src/project-client/services/jwt/models/index.ts +6 -0
  189. package/src/project-client/services/jwt/request-params.ts +11 -0
  190. package/src/project-client/services/notifications/index.ts +2 -0
  191. package/src/project-client/services/notifications/models/delivery-plan-collection.ts +54 -0
  192. package/src/project-client/services/notifications/models/delivery-plan.ts +93 -0
  193. package/src/project-client/services/notifications/models/index.ts +2 -0
  194. package/src/project-client/services/notifications/notifications-service.ts +44 -0
  195. package/src/project-client/services/users/index.ts +2 -0
  196. package/src/project-client/services/users/models/index.ts +2 -0
  197. package/src/project-client/services/users/models/user-collection.ts +54 -0
  198. package/src/project-client/services/users/models/user.ts +99 -0
  199. package/src/project-client/services/users/request-params.ts +6 -0
  200. package/src/project-client/services/users/users-service.ts +117 -0
  201. package/src/project-client.ts +1 -0
  202. package/src/user-client/http/client.ts +71 -0
  203. package/src/user-client/http/environment.ts +3 -0
  204. package/src/user-client/http/error.ts +14 -0
  205. package/src/user-client/http/errors/validation-error.ts +25 -0
  206. package/src/user-client/http/handlers/handler-chain.ts +30 -0
  207. package/src/user-client/http/handlers/hook-handler.ts +78 -0
  208. package/src/user-client/http/handlers/request-validation-handler.ts +111 -0
  209. package/src/user-client/http/handlers/response-validation-handler.ts +203 -0
  210. package/src/user-client/http/handlers/retry-handler.ts +60 -0
  211. package/src/user-client/http/handlers/terminating-handler.ts +14 -0
  212. package/src/user-client/http/hooks/custom-hook.ts +25 -0
  213. package/src/user-client/http/hooks/hook.ts +41 -0
  214. package/src/user-client/http/index.ts +11 -0
  215. package/src/user-client/http/serialization/base-serializer.ts +139 -0
  216. package/src/user-client/http/serialization/header-serializer.ts +19 -0
  217. package/src/user-client/http/serialization/path-serializer.ts +12 -0
  218. package/src/user-client/http/serialization/query-serializer.ts +18 -0
  219. package/src/user-client/http/transport/request-builder.ts +242 -0
  220. package/src/user-client/http/transport/request-fetch-adapter.ts +131 -0
  221. package/src/user-client/http/transport/request.ts +222 -0
  222. package/src/user-client/http/transport/transport-hook-adapter.ts +91 -0
  223. package/src/user-client/http/transport/types.ts +50 -0
  224. package/src/user-client/http/types.ts +74 -0
  225. package/src/user-client/http/utils/content-type.ts +33 -0
  226. package/src/user-client/http/utils/line-decoder.ts +35 -0
  227. package/src/user-client/http/utils/response-matcher.ts +25 -0
  228. package/src/user-client/index.ts +54 -0
  229. package/src/user-client/services/base-service.ts +27 -0
  230. package/src/user-client/services/channels/channels-service.ts +1020 -0
  231. package/src/user-client/services/channels/index.ts +2 -0
  232. package/src/user-client/services/channels/models/apns-token-collection.ts +54 -0
  233. package/src/user-client/services/channels/models/apns-token-installation-id.ts +6 -0
  234. package/src/user-client/services/channels/models/apns-token-payload-installation-id.ts +6 -0
  235. package/src/user-client/services/channels/models/apns-token-payload.ts +66 -0
  236. package/src/user-client/services/channels/models/apns-token.ts +90 -0
  237. package/src/user-client/services/channels/models/discard-result.ts +51 -0
  238. package/src/user-client/services/channels/models/expo-token-collection.ts +54 -0
  239. package/src/user-client/services/channels/models/expo-token-payload.ts +45 -0
  240. package/src/user-client/services/channels/models/expo-token.ts +69 -0
  241. package/src/user-client/services/channels/models/fcm-token-collection.ts +54 -0
  242. package/src/user-client/services/channels/models/fcm-token-installation-id.ts +6 -0
  243. package/src/user-client/services/channels/models/fcm-token-payload-installation-id.ts +6 -0
  244. package/src/user-client/services/channels/models/fcm-token-payload.ts +51 -0
  245. package/src/user-client/services/channels/models/fcm-token.ts +75 -0
  246. package/src/user-client/services/channels/models/inbox-token-response-collection.ts +59 -0
  247. package/src/user-client/services/channels/models/inbox-token-response.ts +75 -0
  248. package/src/user-client/services/channels/models/inbox-token.ts +51 -0
  249. package/src/user-client/services/channels/models/index.ts +33 -0
  250. package/src/user-client/services/channels/models/slack-token-collection.ts +54 -0
  251. package/src/user-client/services/channels/models/slack-token-oauth.ts +57 -0
  252. package/src/user-client/services/channels/models/slack-token-payload-oauth.ts +57 -0
  253. package/src/user-client/services/channels/models/slack-token-payload-webhook.ts +45 -0
  254. package/src/user-client/services/channels/models/slack-token-payload.ts +64 -0
  255. package/src/user-client/services/channels/models/slack-token-webhook.ts +45 -0
  256. package/src/user-client/services/channels/models/slack-token.ts +88 -0
  257. package/src/user-client/services/channels/models/teams-token-collection.ts +54 -0
  258. package/src/user-client/services/channels/models/teams-token-payload-webhook.ts +45 -0
  259. package/src/user-client/services/channels/models/teams-token-payload.ts +52 -0
  260. package/src/user-client/services/channels/models/teams-token-webhook.ts +45 -0
  261. package/src/user-client/services/channels/models/teams-token.ts +76 -0
  262. package/src/user-client/services/channels/models/web-push-token-collection.ts +54 -0
  263. package/src/user-client/services/channels/models/web-push-token-keys.ts +51 -0
  264. package/src/user-client/services/channels/models/web-push-token-payload-keys.ts +51 -0
  265. package/src/user-client/services/channels/models/web-push-token.ts +82 -0
  266. package/src/user-client/services/channels/request-params.ts +41 -0
  267. package/src/user-client/services/common/index.ts +2 -0
  268. package/src/user-client/services/common/links.ts +57 -0
  269. package/src/user-client/services/common/web-push-token-payload.ts +58 -0
  270. package/src/user-client/services/integrations/index.ts +2 -0
  271. package/src/user-client/services/integrations/integrations-service.ts +278 -0
  272. package/src/user-client/services/integrations/models/authed-user.ts +75 -0
  273. package/src/user-client/services/integrations/models/banner.ts +63 -0
  274. package/src/user-client/services/integrations/models/default-hover.ts +45 -0
  275. package/src/user-client/services/integrations/models/default-state.ts +45 -0
  276. package/src/user-client/services/integrations/models/default_.ts +90 -0
  277. package/src/user-client/services/integrations/models/dialog.ts +57 -0
  278. package/src/user-client/services/integrations/models/enterprise.ts +51 -0
  279. package/src/user-client/services/integrations/models/footer.ts +63 -0
  280. package/src/user-client/services/integrations/models/header.ts +69 -0
  281. package/src/user-client/services/integrations/models/icon.ts +51 -0
  282. package/src/user-client/services/integrations/models/images.ts +45 -0
  283. package/src/user-client/services/integrations/models/inbox-config-payload.ts +60 -0
  284. package/src/user-client/services/integrations/models/incoming-webhook.ts +57 -0
  285. package/src/user-client/services/integrations/models/index.ts +29 -0
  286. package/src/user-client/services/integrations/models/slack-finish-install-response.ts +57 -0
  287. package/src/user-client/services/integrations/models/slack-installation.ts +136 -0
  288. package/src/user-client/services/integrations/models/slack-start-install-response-content.ts +57 -0
  289. package/src/user-client/services/integrations/models/slack-start-install.ts +63 -0
  290. package/src/user-client/services/integrations/models/team.ts +51 -0
  291. package/src/user-client/services/integrations/models/templates-installation.ts +57 -0
  292. package/src/user-client/services/integrations/models/theme-notification.ts +61 -0
  293. package/src/user-client/services/integrations/models/theme.ts +94 -0
  294. package/src/user-client/services/integrations/models/unread-hover.ts +45 -0
  295. package/src/user-client/services/integrations/models/unread-state.ts +45 -0
  296. package/src/user-client/services/integrations/models/unread.ts +66 -0
  297. package/src/user-client/services/integrations/models/unseen-badge.ts +45 -0
  298. package/src/user-client/services/integrations/models/unseen-hover.ts +45 -0
  299. package/src/user-client/services/integrations/models/unseen-state.ts +45 -0
  300. package/src/user-client/services/integrations/models/unseen.ts +66 -0
  301. package/src/user-client/services/integrations/models/web-push-start-installation-response.ts +51 -0
  302. package/src/user-client/services/notifications/index.ts +2 -0
  303. package/src/user-client/services/notifications/models/index.ts +2 -0
  304. package/src/user-client/services/notifications/models/notification-collection.ts +54 -0
  305. package/src/user-client/services/notifications/models/notification.ts +129 -0
  306. package/src/user-client/services/notifications/notifications-service.ts +189 -0
  307. package/src/user-client/services/notifications/request-params.ts +7 -0
  308. package/src/user-client.ts +1 -0
@@ -0,0 +1,2 @@
1
+ export { ChannelsService } from './channels-service.js';
2
+ export * from './models/index.js';
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+
3
+ import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
4
+ import { ApnsToken, apnsToken, apnsTokenRequest, apnsTokenResponse } from './apns-token.js';
5
+
6
+ /**
7
+ * The shape of the model inside the application code - what the users use
8
+ */
9
+ export const apnsTokenCollection = z.lazy(() => {
10
+ return z.object({
11
+ data: z.array(apnsToken).optional(),
12
+ links: links.optional(),
13
+ });
14
+ });
15
+
16
+ /**
17
+ *
18
+ * @typedef {ApnsTokenCollection} apnsTokenCollection
19
+ * @property {ApnsToken[]}
20
+ * @property {Links}
21
+ */
22
+ export type ApnsTokenCollection = z.infer<typeof apnsTokenCollection>;
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 apnsTokenCollectionResponse = z.lazy(() => {
29
+ return z
30
+ .object({
31
+ data: z.array(apnsTokenResponse).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 apnsTokenCollectionRequest = z.lazy(() => {
45
+ return z
46
+ .object({
47
+ data: z.array(apnsTokenRequest).optional(),
48
+ links: linksRequest.optional(),
49
+ })
50
+ .transform((data) => ({
51
+ data: data['data'],
52
+ links: data['links'],
53
+ }));
54
+ });
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export enum ApnsTokenInstallationId {
4
+ DEVELOPMENT = 'development',
5
+ PRODUCTION = 'production',
6
+ }
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export enum ApnsTokenPayloadInstallationId {
4
+ DEVELOPMENT = 'development',
5
+ PRODUCTION = 'production',
6
+ }
@@ -0,0 +1,66 @@
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 apnsTokenPayload = z.lazy(() => {
7
+ return z.object({
8
+ appId: z
9
+ .string()
10
+ .regex(/^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$/)
11
+ .optional(),
12
+ deviceToken: z.string().min(64),
13
+ installationId: z.string().optional(),
14
+ });
15
+ });
16
+
17
+ /**
18
+ *
19
+ * @typedef {ApnsTokenPayload} apnsTokenPayload
20
+ * @property {string} - (Optional) The bundle identifier of the application that is registering this token. Use this field to override the default identifier specified in the projects APNs integration.
21
+ * @property {string}
22
+ * @property {ApnsTokenPayloadInstallationId} - (Optional) The APNs environment the token is registered for. If none is provided we assume the token is used in `production`.
23
+ */
24
+ export type ApnsTokenPayload = z.infer<typeof apnsTokenPayload>;
25
+
26
+ /**
27
+ * The shape of the model mapping from the api schema into the application shape.
28
+ * Is equal to application shape if all property names match the api schema
29
+ */
30
+ export const apnsTokenPayloadResponse = z.lazy(() => {
31
+ return z
32
+ .object({
33
+ app_id: z
34
+ .string()
35
+ .regex(/^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$/)
36
+ .optional(),
37
+ device_token: z.string().min(64),
38
+ installation_id: z.string().optional(),
39
+ })
40
+ .transform((data) => ({
41
+ appId: data['app_id'],
42
+ deviceToken: data['device_token'],
43
+ installationId: data['installation_id'],
44
+ }));
45
+ });
46
+
47
+ /**
48
+ * The shape of the model mapping from the application shape into the api schema.
49
+ * Is equal to application shape if all property names match the api schema
50
+ */
51
+ export const apnsTokenPayloadRequest = z.lazy(() => {
52
+ return z
53
+ .object({
54
+ appId: z
55
+ .string()
56
+ .regex(/^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$/)
57
+ .optional(),
58
+ deviceToken: z.string().min(64),
59
+ installationId: z.string().optional(),
60
+ })
61
+ .transform((data) => ({
62
+ app_id: data['appId'],
63
+ device_token: data['deviceToken'],
64
+ installation_id: data['installationId'],
65
+ }));
66
+ });
@@ -0,0 +1,90 @@
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 apnsToken = z.lazy(() => {
7
+ return z.object({
8
+ appId: z
9
+ .string()
10
+ .regex(/^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$/)
11
+ .optional(),
12
+ createdAt: z.string(),
13
+ deviceToken: z.string().min(64),
14
+ discardedAt: z.string().optional().nullable(),
15
+ id: z.string(),
16
+ installationId: z.string().optional(),
17
+ updatedAt: z.string().optional().nullable(),
18
+ });
19
+ });
20
+
21
+ /**
22
+ *
23
+ * @typedef {ApnsToken} apnsToken
24
+ * @property {string} - (Optional) The bundle identifier of the application that is registering this token. Use this field to override the default identifier specified in the projects APNs integration.
25
+ * @property {string}
26
+ * @property {string}
27
+ * @property {string}
28
+ * @property {string}
29
+ * @property {ApnsTokenInstallationId} - (Optional) The APNs environment the token is registered for. If none is provided we assume the token is used in `production`.
30
+ * @property {string}
31
+ */
32
+ export type ApnsToken = z.infer<typeof apnsToken>;
33
+
34
+ /**
35
+ * The shape of the model mapping from the api schema into the application shape.
36
+ * Is equal to application shape if all property names match the api schema
37
+ */
38
+ export const apnsTokenResponse = z.lazy(() => {
39
+ return z
40
+ .object({
41
+ app_id: z
42
+ .string()
43
+ .regex(/^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$/)
44
+ .optional(),
45
+ created_at: z.string(),
46
+ device_token: z.string().min(64),
47
+ discarded_at: z.string().optional().nullable(),
48
+ id: z.string(),
49
+ installation_id: z.string().optional(),
50
+ updated_at: z.string().optional().nullable(),
51
+ })
52
+ .transform((data) => ({
53
+ appId: data['app_id'],
54
+ createdAt: data['created_at'],
55
+ deviceToken: data['device_token'],
56
+ discardedAt: data['discarded_at'],
57
+ id: data['id'],
58
+ installationId: data['installation_id'],
59
+ updatedAt: data['updated_at'],
60
+ }));
61
+ });
62
+
63
+ /**
64
+ * The shape of the model mapping from the application shape into the api schema.
65
+ * Is equal to application shape if all property names match the api schema
66
+ */
67
+ export const apnsTokenRequest = z.lazy(() => {
68
+ return z
69
+ .object({
70
+ appId: z
71
+ .string()
72
+ .regex(/^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$/)
73
+ .optional(),
74
+ createdAt: z.string(),
75
+ deviceToken: z.string().min(64),
76
+ discardedAt: z.string().optional().nullable(),
77
+ id: z.string(),
78
+ installationId: z.string().optional(),
79
+ updatedAt: z.string().optional().nullable(),
80
+ })
81
+ .transform((data) => ({
82
+ app_id: data['appId'],
83
+ created_at: data['createdAt'],
84
+ device_token: data['deviceToken'],
85
+ discarded_at: data['discardedAt'],
86
+ id: data['id'],
87
+ installation_id: data['installationId'],
88
+ updated_at: data['updatedAt'],
89
+ }));
90
+ });
@@ -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 discardResult = z.lazy(() => {
7
+ return z.object({
8
+ discardedAt: z.string().optional(),
9
+ id: z.string().optional(),
10
+ });
11
+ });
12
+
13
+ /**
14
+ *
15
+ * @typedef {DiscardResult} discardResult
16
+ * @property {string}
17
+ * @property {string}
18
+ */
19
+ export type DiscardResult = z.infer<typeof discardResult>;
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 discardResultResponse = z.lazy(() => {
26
+ return z
27
+ .object({
28
+ discarded_at: z.string().optional(),
29
+ id: z.string().optional(),
30
+ })
31
+ .transform((data) => ({
32
+ discardedAt: data['discarded_at'],
33
+ id: data['id'],
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 discardResultRequest = z.lazy(() => {
42
+ return z
43
+ .object({
44
+ discardedAt: z.string().optional(),
45
+ id: z.string().optional(),
46
+ })
47
+ .transform((data) => ({
48
+ discarded_at: data['discardedAt'],
49
+ id: data['id'],
50
+ }));
51
+ });
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+
3
+ import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
4
+ import { ExpoToken, expoToken, expoTokenRequest, expoTokenResponse } from './expo-token.js';
5
+
6
+ /**
7
+ * The shape of the model inside the application code - what the users use
8
+ */
9
+ export const expoTokenCollection = z.lazy(() => {
10
+ return z.object({
11
+ data: z.array(expoToken).optional(),
12
+ links: links.optional(),
13
+ });
14
+ });
15
+
16
+ /**
17
+ *
18
+ * @typedef {ExpoTokenCollection} expoTokenCollection
19
+ * @property {ExpoToken[]}
20
+ * @property {Links}
21
+ */
22
+ export type ExpoTokenCollection = z.infer<typeof expoTokenCollection>;
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 expoTokenCollectionResponse = z.lazy(() => {
29
+ return z
30
+ .object({
31
+ data: z.array(expoTokenResponse).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 expoTokenCollectionRequest = z.lazy(() => {
45
+ return z
46
+ .object({
47
+ data: z.array(expoTokenRequest).optional(),
48
+ links: linksRequest.optional(),
49
+ })
50
+ .transform((data) => ({
51
+ data: data['data'],
52
+ links: data['links'],
53
+ }));
54
+ });
@@ -0,0 +1,45 @@
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 expoTokenPayload = z.lazy(() => {
7
+ return z.object({
8
+ deviceToken: z.string().min(1),
9
+ });
10
+ });
11
+
12
+ /**
13
+ *
14
+ * @typedef {ExpoTokenPayload} expoTokenPayload
15
+ * @property {string}
16
+ */
17
+ export type ExpoTokenPayload = z.infer<typeof expoTokenPayload>;
18
+
19
+ /**
20
+ * The shape of the model mapping from the api schema into the application shape.
21
+ * Is equal to application shape if all property names match the api schema
22
+ */
23
+ export const expoTokenPayloadResponse = z.lazy(() => {
24
+ return z
25
+ .object({
26
+ device_token: z.string().min(1),
27
+ })
28
+ .transform((data) => ({
29
+ deviceToken: data['device_token'],
30
+ }));
31
+ });
32
+
33
+ /**
34
+ * The shape of the model mapping from the application shape into the api schema.
35
+ * Is equal to application shape if all property names match the api schema
36
+ */
37
+ export const expoTokenPayloadRequest = z.lazy(() => {
38
+ return z
39
+ .object({
40
+ deviceToken: z.string().min(1),
41
+ })
42
+ .transform((data) => ({
43
+ device_token: data['deviceToken'],
44
+ }));
45
+ });
@@ -0,0 +1,69 @@
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 expoToken = z.lazy(() => {
7
+ return z.object({
8
+ createdAt: z.string(),
9
+ deviceToken: z.string().min(1),
10
+ discardedAt: z.string().optional().nullable(),
11
+ id: z.string(),
12
+ updatedAt: z.string().optional().nullable(),
13
+ });
14
+ });
15
+
16
+ /**
17
+ *
18
+ * @typedef {ExpoToken} expoToken
19
+ * @property {string}
20
+ * @property {string}
21
+ * @property {string}
22
+ * @property {string}
23
+ * @property {string}
24
+ */
25
+ export type ExpoToken = z.infer<typeof expoToken>;
26
+
27
+ /**
28
+ * The shape of the model mapping from the api schema into the application shape.
29
+ * Is equal to application shape if all property names match the api schema
30
+ */
31
+ export const expoTokenResponse = z.lazy(() => {
32
+ return z
33
+ .object({
34
+ created_at: z.string(),
35
+ device_token: z.string().min(1),
36
+ discarded_at: z.string().optional().nullable(),
37
+ id: z.string(),
38
+ updated_at: z.string().optional().nullable(),
39
+ })
40
+ .transform((data) => ({
41
+ createdAt: data['created_at'],
42
+ deviceToken: data['device_token'],
43
+ discardedAt: data['discarded_at'],
44
+ id: data['id'],
45
+ updatedAt: data['updated_at'],
46
+ }));
47
+ });
48
+
49
+ /**
50
+ * The shape of the model mapping from the application shape into the api schema.
51
+ * Is equal to application shape if all property names match the api schema
52
+ */
53
+ export const expoTokenRequest = z.lazy(() => {
54
+ return z
55
+ .object({
56
+ createdAt: z.string(),
57
+ deviceToken: z.string().min(1),
58
+ discardedAt: z.string().optional().nullable(),
59
+ id: z.string(),
60
+ updatedAt: z.string().optional().nullable(),
61
+ })
62
+ .transform((data) => ({
63
+ created_at: data['createdAt'],
64
+ device_token: data['deviceToken'],
65
+ discarded_at: data['discardedAt'],
66
+ id: data['id'],
67
+ updated_at: data['updatedAt'],
68
+ }));
69
+ });
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+
3
+ import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
4
+ import { FcmToken, fcmToken, fcmTokenRequest, fcmTokenResponse } from './fcm-token.js';
5
+
6
+ /**
7
+ * The shape of the model inside the application code - what the users use
8
+ */
9
+ export const fcmTokenCollection = z.lazy(() => {
10
+ return z.object({
11
+ data: z.array(fcmToken).optional(),
12
+ links: links.optional(),
13
+ });
14
+ });
15
+
16
+ /**
17
+ *
18
+ * @typedef {FcmTokenCollection} fcmTokenCollection
19
+ * @property {FcmToken[]}
20
+ * @property {Links}
21
+ */
22
+ export type FcmTokenCollection = z.infer<typeof fcmTokenCollection>;
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 fcmTokenCollectionResponse = z.lazy(() => {
29
+ return z
30
+ .object({
31
+ data: z.array(fcmTokenResponse).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 fcmTokenCollectionRequest = z.lazy(() => {
45
+ return z
46
+ .object({
47
+ data: z.array(fcmTokenRequest).optional(),
48
+ links: linksRequest.optional(),
49
+ })
50
+ .transform((data) => ({
51
+ data: data['data'],
52
+ links: data['links'],
53
+ }));
54
+ });
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export enum FcmTokenInstallationId {
4
+ DEVELOPMENT = 'development',
5
+ PRODUCTION = 'production',
6
+ }
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export enum FcmTokenPayloadInstallationId {
4
+ DEVELOPMENT = 'development',
5
+ PRODUCTION = 'production',
6
+ }
@@ -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 fcmTokenPayload = z.lazy(() => {
7
+ return z.object({
8
+ deviceToken: z.string().min(64),
9
+ installationId: z.string().optional(),
10
+ });
11
+ });
12
+
13
+ /**
14
+ *
15
+ * @typedef {FcmTokenPayload} fcmTokenPayload
16
+ * @property {string}
17
+ * @property {FcmTokenPayloadInstallationId}
18
+ */
19
+ export type FcmTokenPayload = z.infer<typeof fcmTokenPayload>;
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 fcmTokenPayloadResponse = z.lazy(() => {
26
+ return z
27
+ .object({
28
+ device_token: z.string().min(64),
29
+ installation_id: z.string().optional(),
30
+ })
31
+ .transform((data) => ({
32
+ deviceToken: data['device_token'],
33
+ installationId: data['installation_id'],
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 fcmTokenPayloadRequest = z.lazy(() => {
42
+ return z
43
+ .object({
44
+ deviceToken: z.string().min(64),
45
+ installationId: z.string().optional(),
46
+ })
47
+ .transform((data) => ({
48
+ device_token: data['deviceToken'],
49
+ installation_id: data['installationId'],
50
+ }));
51
+ });
@@ -0,0 +1,75 @@
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 fcmToken = z.lazy(() => {
7
+ return z.object({
8
+ createdAt: z.string(),
9
+ deviceToken: z.string().min(64),
10
+ discardedAt: z.string().optional().nullable(),
11
+ id: z.string(),
12
+ installationId: z.string().optional(),
13
+ updatedAt: z.string().optional().nullable(),
14
+ });
15
+ });
16
+
17
+ /**
18
+ *
19
+ * @typedef {FcmToken} fcmToken
20
+ * @property {string}
21
+ * @property {string}
22
+ * @property {string}
23
+ * @property {string}
24
+ * @property {FcmTokenInstallationId}
25
+ * @property {string}
26
+ */
27
+ export type FcmToken = z.infer<typeof fcmToken>;
28
+
29
+ /**
30
+ * The shape of the model mapping from the api schema into the application shape.
31
+ * Is equal to application shape if all property names match the api schema
32
+ */
33
+ export const fcmTokenResponse = z.lazy(() => {
34
+ return z
35
+ .object({
36
+ created_at: z.string(),
37
+ device_token: z.string().min(64),
38
+ discarded_at: z.string().optional().nullable(),
39
+ id: z.string(),
40
+ installation_id: z.string().optional(),
41
+ updated_at: z.string().optional().nullable(),
42
+ })
43
+ .transform((data) => ({
44
+ createdAt: data['created_at'],
45
+ deviceToken: data['device_token'],
46
+ discardedAt: data['discarded_at'],
47
+ id: data['id'],
48
+ installationId: data['installation_id'],
49
+ updatedAt: data['updated_at'],
50
+ }));
51
+ });
52
+
53
+ /**
54
+ * The shape of the model mapping from the application shape into the api schema.
55
+ * Is equal to application shape if all property names match the api schema
56
+ */
57
+ export const fcmTokenRequest = z.lazy(() => {
58
+ return z
59
+ .object({
60
+ createdAt: z.string(),
61
+ deviceToken: z.string().min(64),
62
+ discardedAt: z.string().optional().nullable(),
63
+ id: z.string(),
64
+ installationId: z.string().optional(),
65
+ updatedAt: z.string().optional().nullable(),
66
+ })
67
+ .transform((data) => ({
68
+ created_at: data['createdAt'],
69
+ device_token: data['deviceToken'],
70
+ discarded_at: data['discardedAt'],
71
+ id: data['id'],
72
+ installation_id: data['installationId'],
73
+ updated_at: data['updatedAt'],
74
+ }));
75
+ });