@frigear-nu/shifts 0.0.0-stage → 0.0.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 (341) hide show
  1. package/README.md +53 -2
  2. package/dist/module.d.mts +709 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +253 -0
  5. package/dist/runtime/access.d.ts +2 -0
  6. package/dist/runtime/access.js +84 -0
  7. package/dist/runtime/app/components/ShiftBroadcastSlideover.d.vue.ts +19 -0
  8. package/dist/runtime/app/components/ShiftBroadcastSlideover.vue +142 -0
  9. package/dist/runtime/app/components/ShiftBroadcastSlideover.vue.d.ts +19 -0
  10. package/dist/runtime/app/components/ShiftBroadcastsCard.d.vue.ts +9 -0
  11. package/dist/runtime/app/components/ShiftBroadcastsCard.vue +74 -0
  12. package/dist/runtime/app/components/ShiftBroadcastsCard.vue.d.ts +9 -0
  13. package/dist/runtime/app/components/ShiftBulkSlideover.d.vue.ts +15 -0
  14. package/dist/runtime/app/components/ShiftBulkSlideover.vue +185 -0
  15. package/dist/runtime/app/components/ShiftBulkSlideover.vue.d.ts +15 -0
  16. package/dist/runtime/app/components/ShiftCheckInCard.d.vue.ts +13 -0
  17. package/dist/runtime/app/components/ShiftCheckInCard.vue +238 -0
  18. package/dist/runtime/app/components/ShiftCheckInCard.vue.d.ts +13 -0
  19. package/dist/runtime/app/components/ShiftCopySlideover.d.vue.ts +11 -0
  20. package/dist/runtime/app/components/ShiftCopySlideover.vue +71 -0
  21. package/dist/runtime/app/components/ShiftCopySlideover.vue.d.ts +11 -0
  22. package/dist/runtime/app/components/ShiftDayView.d.vue.ts +16 -0
  23. package/dist/runtime/app/components/ShiftDayView.vue +124 -0
  24. package/dist/runtime/app/components/ShiftDayView.vue.d.ts +16 -0
  25. package/dist/runtime/app/components/ShiftFeedSlideover.d.vue.ts +7 -0
  26. package/dist/runtime/app/components/ShiftFeedSlideover.vue +172 -0
  27. package/dist/runtime/app/components/ShiftFeedSlideover.vue.d.ts +7 -0
  28. package/dist/runtime/app/components/ShiftNowCard.d.vue.ts +6 -0
  29. package/dist/runtime/app/components/ShiftNowCard.vue +83 -0
  30. package/dist/runtime/app/components/ShiftNowCard.vue.d.ts +6 -0
  31. package/dist/runtime/app/components/ShiftPassFullscreen.d.vue.ts +13 -0
  32. package/dist/runtime/app/components/ShiftPassFullscreen.vue +79 -0
  33. package/dist/runtime/app/components/ShiftPassFullscreen.vue.d.ts +13 -0
  34. package/dist/runtime/app/components/ShiftPerkSlideover.d.vue.ts +14 -0
  35. package/dist/runtime/app/components/ShiftPerkSlideover.vue +103 -0
  36. package/dist/runtime/app/components/ShiftPerkSlideover.vue.d.ts +14 -0
  37. package/dist/runtime/app/components/ShiftPerksCard.d.vue.ts +8 -0
  38. package/dist/runtime/app/components/ShiftPerksCard.vue +66 -0
  39. package/dist/runtime/app/components/ShiftPerksCard.vue.d.ts +8 -0
  40. package/dist/runtime/app/components/ShiftQrScanner.d.vue.ts +10 -0
  41. package/dist/runtime/app/components/ShiftQrScanner.vue +44 -0
  42. package/dist/runtime/app/components/ShiftQrScanner.vue.d.ts +10 -0
  43. package/dist/runtime/app/components/ShiftRoleSlideover.d.vue.ts +15 -0
  44. package/dist/runtime/app/components/ShiftRoleSlideover.vue +88 -0
  45. package/dist/runtime/app/components/ShiftRoleSlideover.vue.d.ts +15 -0
  46. package/dist/runtime/app/components/ShiftScheduleSettingsFields.d.vue.ts +11 -0
  47. package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue +61 -0
  48. package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue.d.ts +11 -0
  49. package/dist/runtime/app/components/ShiftScheduleSlideover.d.vue.ts +12 -0
  50. package/dist/runtime/app/components/ShiftScheduleSlideover.vue +129 -0
  51. package/dist/runtime/app/components/ShiftScheduleSlideover.vue.d.ts +12 -0
  52. package/dist/runtime/app/components/ShiftSlideover.d.vue.ts +13 -0
  53. package/dist/runtime/app/components/ShiftSlideover.vue +353 -0
  54. package/dist/runtime/app/components/ShiftSlideover.vue.d.ts +13 -0
  55. package/dist/runtime/app/components/ShiftStationSlideover.d.vue.ts +15 -0
  56. package/dist/runtime/app/components/ShiftStationSlideover.vue +92 -0
  57. package/dist/runtime/app/components/ShiftStationSlideover.vue.d.ts +15 -0
  58. package/dist/runtime/app/composables/index.d.ts +6 -0
  59. package/dist/runtime/app/composables/index.js +5 -0
  60. package/dist/runtime/app/composables/useShiftsActions.d.ts +61 -0
  61. package/dist/runtime/app/composables/useShiftsActions.js +224 -0
  62. package/dist/runtime/app/composables/useShiftsFormat.d.ts +12 -0
  63. package/dist/runtime/app/composables/useShiftsFormat.js +14 -0
  64. package/dist/runtime/app/composables/useShiftsLinks.d.ts +12 -0
  65. package/dist/runtime/app/composables/useShiftsLinks.js +6 -0
  66. package/dist/runtime/app/composables/useShiftsTranslate.d.ts +5 -0
  67. package/dist/runtime/app/composables/useShiftsTranslate.js +12 -0
  68. package/dist/runtime/app/composables/useShiftsVenueFeatures.d.ts +17 -0
  69. package/dist/runtime/app/composables/useShiftsVenueFeatures.js +18 -0
  70. package/dist/runtime/app/dashboard/NextShift.d.vue.ts +3 -0
  71. package/dist/runtime/app/dashboard/NextShift.vue +69 -0
  72. package/dist/runtime/app/dashboard/NextShift.vue.d.ts +3 -0
  73. package/dist/runtime/app/dashboard/OpenSwaps.d.vue.ts +3 -0
  74. package/dist/runtime/app/dashboard/OpenSwaps.vue +69 -0
  75. package/dist/runtime/app/dashboard/OpenSwaps.vue.d.ts +3 -0
  76. package/dist/runtime/app/dashboard/TeamOnNow.d.vue.ts +3 -0
  77. package/dist/runtime/app/dashboard/TeamOnNow.vue +72 -0
  78. package/dist/runtime/app/dashboard/TeamOnNow.vue.d.ts +3 -0
  79. package/dist/runtime/app/pages/check-in.d.vue.ts +3 -0
  80. package/dist/runtime/app/pages/check-in.vue +93 -0
  81. package/dist/runtime/app/pages/check-in.vue.d.ts +3 -0
  82. package/dist/runtime/app/pages/lead.d.vue.ts +3 -0
  83. package/dist/runtime/app/pages/lead.vue +300 -0
  84. package/dist/runtime/app/pages/lead.vue.d.ts +3 -0
  85. package/dist/runtime/app/pages/shift.d.vue.ts +3 -0
  86. package/dist/runtime/app/pages/shift.vue +482 -0
  87. package/dist/runtime/app/pages/shift.vue.d.ts +3 -0
  88. package/dist/runtime/app/pages/shifts.d.vue.ts +3 -0
  89. package/dist/runtime/app/pages/shifts.vue +169 -0
  90. package/dist/runtime/app/pages/shifts.vue.d.ts +3 -0
  91. package/dist/runtime/app/pages/station.d.vue.ts +3 -0
  92. package/dist/runtime/app/pages/station.vue +104 -0
  93. package/dist/runtime/app/pages/station.vue.d.ts +3 -0
  94. package/dist/runtime/app/pages/swaps.d.vue.ts +3 -0
  95. package/dist/runtime/app/pages/swaps.vue +192 -0
  96. package/dist/runtime/app/pages/swaps.vue.d.ts +3 -0
  97. package/dist/runtime/app/tabs/Shifts.d.vue.ts +9 -0
  98. package/dist/runtime/app/tabs/Shifts.vue +487 -0
  99. package/dist/runtime/app/tabs/Shifts.vue.d.ts +9 -0
  100. package/dist/runtime/app/utils/admin-shifts.d.ts +42 -0
  101. package/dist/runtime/app/utils/admin-shifts.js +36 -0
  102. package/dist/runtime/dashboard.d.ts +8 -0
  103. package/dist/runtime/dashboard.js +30 -0
  104. package/dist/runtime/emails/shifts-broadcast.d.vue.ts +8 -0
  105. package/dist/runtime/emails/shifts-broadcast.vue +24 -0
  106. package/dist/runtime/emails/shifts-broadcast.vue.d.ts +8 -0
  107. package/dist/runtime/emails/shifts-reminder.d.vue.ts +12 -0
  108. package/dist/runtime/emails/shifts-reminder.vue +34 -0
  109. package/dist/runtime/emails/shifts-reminder.vue.d.ts +12 -0
  110. package/dist/runtime/emails/shifts-swap-accepted.d.vue.ts +11 -0
  111. package/dist/runtime/emails/shifts-swap-accepted.vue +32 -0
  112. package/dist/runtime/emails/shifts-swap-accepted.vue.d.ts +11 -0
  113. package/dist/runtime/emails/shifts-swap-completed.d.vue.ts +11 -0
  114. package/dist/runtime/emails/shifts-swap-completed.vue +32 -0
  115. package/dist/runtime/emails/shifts-swap-completed.vue.d.ts +11 -0
  116. package/dist/runtime/emails/shifts-swap-offered.d.vue.ts +11 -0
  117. package/dist/runtime/emails/shifts-swap-offered.vue +32 -0
  118. package/dist/runtime/emails/shifts-swap-offered.vue.d.ts +11 -0
  119. package/dist/runtime/emails/shifts-swap-pending.d.vue.ts +11 -0
  120. package/dist/runtime/emails/shifts-swap-pending.vue +32 -0
  121. package/dist/runtime/emails/shifts-swap-pending.vue.d.ts +11 -0
  122. package/dist/runtime/emails/shifts-swap-proposed.d.vue.ts +11 -0
  123. package/dist/runtime/emails/shifts-swap-proposed.vue +32 -0
  124. package/dist/runtime/emails/shifts-swap-proposed.vue.d.ts +11 -0
  125. package/dist/runtime/emails/shifts-swap-rejected.d.vue.ts +11 -0
  126. package/dist/runtime/emails/shifts-swap-rejected.vue +32 -0
  127. package/dist/runtime/emails/shifts-swap-rejected.vue.d.ts +11 -0
  128. package/dist/runtime/i18n/lang/da.json +626 -0
  129. package/dist/runtime/i18n/lang/en.json +626 -0
  130. package/dist/runtime/menus.d.ts +2 -0
  131. package/dist/runtime/menus.js +17 -0
  132. package/dist/runtime/notifications.d.ts +9 -0
  133. package/dist/runtime/notifications.js +36 -0
  134. package/dist/runtime/server/db/schema.postgresql.d.ts +2151 -0
  135. package/dist/runtime/server/db/schema.postgresql.js +228 -0
  136. package/dist/runtime/server/db/schema.sqlite.d.ts +2263 -0
  137. package/dist/runtime/server/db/schema.sqlite.js +228 -0
  138. package/dist/runtime/server/digest-email.d.ts +17 -0
  139. package/dist/runtime/server/digest-email.js +42 -0
  140. package/dist/runtime/server/plugins/station-key.d.ts +2 -0
  141. package/dist/runtime/server/plugins/station-key.js +5 -0
  142. package/dist/runtime/server/plugins/teams.d.ts +2 -0
  143. package/dist/runtime/server/plugins/teams.js +19 -0
  144. package/dist/runtime/server/policies.d.ts +2 -0
  145. package/dist/runtime/server/policies.js +41 -0
  146. package/dist/runtime/server/reminder-email.d.ts +67 -0
  147. package/dist/runtime/server/reminder-email.js +109 -0
  148. package/dist/runtime/server/routes/admin/assignment.delete.d.ts +2 -0
  149. package/dist/runtime/server/routes/admin/assignment.delete.js +10 -0
  150. package/dist/runtime/server/routes/admin/assignments.post.d.ts +2 -0
  151. package/dist/runtime/server/routes/admin/assignments.post.js +11 -0
  152. package/dist/runtime/server/routes/admin/broadcasts.get.d.ts +2 -0
  153. package/dist/runtime/server/routes/admin/broadcasts.get.js +8 -0
  154. package/dist/runtime/server/routes/admin/broadcasts.post.d.ts +2 -0
  155. package/dist/runtime/server/routes/admin/broadcasts.post.js +9 -0
  156. package/dist/runtime/server/routes/admin/candidates.get.d.ts +2 -0
  157. package/dist/runtime/server/routes/admin/candidates.get.js +10 -0
  158. package/dist/runtime/server/routes/admin/operation-teams.get.d.ts +2 -0
  159. package/dist/runtime/server/routes/admin/operation-teams.get.js +9 -0
  160. package/dist/runtime/server/routes/admin/perk.delete.d.ts +2 -0
  161. package/dist/runtime/server/routes/admin/perk.delete.js +10 -0
  162. package/dist/runtime/server/routes/admin/perk.patch.d.ts +2 -0
  163. package/dist/runtime/server/routes/admin/perk.patch.js +10 -0
  164. package/dist/runtime/server/routes/admin/perks.get.d.ts +2 -0
  165. package/dist/runtime/server/routes/admin/perks.get.js +9 -0
  166. package/dist/runtime/server/routes/admin/perks.post.d.ts +2 -0
  167. package/dist/runtime/server/routes/admin/perks.post.js +10 -0
  168. package/dist/runtime/server/routes/admin/role.delete.d.ts +2 -0
  169. package/dist/runtime/server/routes/admin/role.delete.js +11 -0
  170. package/dist/runtime/server/routes/admin/role.patch.d.ts +2 -0
  171. package/dist/runtime/server/routes/admin/role.patch.js +11 -0
  172. package/dist/runtime/server/routes/admin/roles.get.d.ts +2 -0
  173. package/dist/runtime/server/routes/admin/roles.get.js +9 -0
  174. package/dist/runtime/server/routes/admin/roles.post.d.ts +2 -0
  175. package/dist/runtime/server/routes/admin/roles.post.js +10 -0
  176. package/dist/runtime/server/routes/admin/schedule-copy.post.d.ts +2 -0
  177. package/dist/runtime/server/routes/admin/schedule-copy.post.js +12 -0
  178. package/dist/runtime/server/routes/admin/schedule-publish.post.d.ts +2 -0
  179. package/dist/runtime/server/routes/admin/schedule-publish.post.js +9 -0
  180. package/dist/runtime/server/routes/admin/schedule.delete.d.ts +2 -0
  181. package/dist/runtime/server/routes/admin/schedule.delete.js +10 -0
  182. package/dist/runtime/server/routes/admin/schedule.get.d.ts +2 -0
  183. package/dist/runtime/server/routes/admin/schedule.get.js +9 -0
  184. package/dist/runtime/server/routes/admin/schedule.patch.d.ts +2 -0
  185. package/dist/runtime/server/routes/admin/schedule.patch.js +10 -0
  186. package/dist/runtime/server/routes/admin/schedules.get.d.ts +2 -0
  187. package/dist/runtime/server/routes/admin/schedules.get.js +10 -0
  188. package/dist/runtime/server/routes/admin/schedules.post.d.ts +2 -0
  189. package/dist/runtime/server/routes/admin/schedules.post.js +9 -0
  190. package/dist/runtime/server/routes/admin/shift.delete.d.ts +2 -0
  191. package/dist/runtime/server/routes/admin/shift.delete.js +10 -0
  192. package/dist/runtime/server/routes/admin/shift.patch.d.ts +2 -0
  193. package/dist/runtime/server/routes/admin/shift.patch.js +10 -0
  194. package/dist/runtime/server/routes/admin/shifts-bulk.post.d.ts +2 -0
  195. package/dist/runtime/server/routes/admin/shifts-bulk.post.js +10 -0
  196. package/dist/runtime/server/routes/admin/shifts.get.d.ts +2 -0
  197. package/dist/runtime/server/routes/admin/shifts.get.js +10 -0
  198. package/dist/runtime/server/routes/admin/station.delete.d.ts +2 -0
  199. package/dist/runtime/server/routes/admin/station.delete.js +11 -0
  200. package/dist/runtime/server/routes/admin/station.patch.d.ts +2 -0
  201. package/dist/runtime/server/routes/admin/station.patch.js +11 -0
  202. package/dist/runtime/server/routes/admin/stations.get.d.ts +2 -0
  203. package/dist/runtime/server/routes/admin/stations.get.js +9 -0
  204. package/dist/runtime/server/routes/admin/stations.post.d.ts +2 -0
  205. package/dist/runtime/server/routes/admin/stations.post.js +10 -0
  206. package/dist/runtime/server/routes/admin/swap-cancel.post.d.ts +2 -0
  207. package/dist/runtime/server/routes/admin/swap-cancel.post.js +10 -0
  208. package/dist/runtime/server/routes/admin/swaps.get.d.ts +2 -0
  209. package/dist/runtime/server/routes/admin/swaps.get.js +10 -0
  210. package/dist/runtime/server/routes/feed/feed.get.d.ts +2 -0
  211. package/dist/runtime/server/routes/feed/feed.get.js +9 -0
  212. package/dist/runtime/server/routes/lead/attended.post.d.ts +2 -0
  213. package/dist/runtime/server/routes/lead/attended.post.js +11 -0
  214. package/dist/runtime/server/routes/lead/broadcast.post.d.ts +2 -0
  215. package/dist/runtime/server/routes/lead/broadcast.post.js +12 -0
  216. package/dist/runtime/server/routes/lead/check-in.post.d.ts +2 -0
  217. package/dist/runtime/server/routes/lead/check-in.post.js +9 -0
  218. package/dist/runtime/server/routes/lead/exceptions.get.d.ts +2 -0
  219. package/dist/runtime/server/routes/lead/exceptions.get.js +8 -0
  220. package/dist/runtime/server/routes/lead/no-show.post.d.ts +2 -0
  221. package/dist/runtime/server/routes/lead/no-show.post.js +11 -0
  222. package/dist/runtime/server/routes/lead/now.get.d.ts +2 -0
  223. package/dist/runtime/server/routes/lead/now.get.js +9 -0
  224. package/dist/runtime/server/routes/lead/on-duty.get.d.ts +2 -0
  225. package/dist/runtime/server/routes/lead/on-duty.get.js +10 -0
  226. package/dist/runtime/server/routes/lead/stations.get.d.ts +2 -0
  227. package/dist/runtime/server/routes/lead/stations.get.js +8 -0
  228. package/dist/runtime/server/routes/lead/team-shifts.get.d.ts +2 -0
  229. package/dist/runtime/server/routes/lead/team-shifts.get.js +9 -0
  230. package/dist/runtime/server/routes/lead/team-swaps.get.d.ts +2 -0
  231. package/dist/runtime/server/routes/lead/team-swaps.get.js +9 -0
  232. package/dist/runtime/server/routes/me/check-in.post.d.ts +2 -0
  233. package/dist/runtime/server/routes/me/check-in.post.js +11 -0
  234. package/dist/runtime/server/routes/me/earned-perk-claim.post.d.ts +2 -0
  235. package/dist/runtime/server/routes/me/earned-perk-claim.post.js +10 -0
  236. package/dist/runtime/server/routes/me/earned-perks.get.d.ts +2 -0
  237. package/dist/runtime/server/routes/me/earned-perks.get.js +9 -0
  238. package/dist/runtime/server/routes/me/feed-token.delete.d.ts +2 -0
  239. package/dist/runtime/server/routes/me/feed-token.delete.js +7 -0
  240. package/dist/runtime/server/routes/me/feed-token.get.d.ts +2 -0
  241. package/dist/runtime/server/routes/me/feed-token.get.js +6 -0
  242. package/dist/runtime/server/routes/me/feed-token.post.d.ts +2 -0
  243. package/dist/runtime/server/routes/me/feed-token.post.js +7 -0
  244. package/dist/runtime/server/routes/me/leads.get.d.ts +2 -0
  245. package/dist/runtime/server/routes/me/leads.get.js +5 -0
  246. package/dist/runtime/server/routes/me/now.get.d.ts +2 -0
  247. package/dist/runtime/server/routes/me/now.get.js +5 -0
  248. package/dist/runtime/server/routes/me/pass.get.d.ts +2 -0
  249. package/dist/runtime/server/routes/me/pass.get.js +11 -0
  250. package/dist/runtime/server/routes/me/settle.post.d.ts +2 -0
  251. package/dist/runtime/server/routes/me/settle.post.js +14 -0
  252. package/dist/runtime/server/routes/me/shift.get.d.ts +2 -0
  253. package/dist/runtime/server/routes/me/shift.get.js +10 -0
  254. package/dist/runtime/server/routes/me/shifts.get.d.ts +2 -0
  255. package/dist/runtime/server/routes/me/shifts.get.js +6 -0
  256. package/dist/runtime/server/routes/me/swap.delete.d.ts +2 -0
  257. package/dist/runtime/server/routes/me/swap.delete.js +11 -0
  258. package/dist/runtime/server/routes/me/swap.post.d.ts +2 -0
  259. package/dist/runtime/server/routes/me/swap.post.js +11 -0
  260. package/dist/runtime/server/routes/stations/token.get.d.ts +2 -0
  261. package/dist/runtime/server/routes/stations/token.get.js +12 -0
  262. package/dist/runtime/server/routes/swaps/approve.post.d.ts +2 -0
  263. package/dist/runtime/server/routes/swaps/approve.post.js +9 -0
  264. package/dist/runtime/server/routes/swaps/list.get.d.ts +2 -0
  265. package/dist/runtime/server/routes/swaps/list.get.js +5 -0
  266. package/dist/runtime/server/routes/swaps/offer-accept.post.d.ts +2 -0
  267. package/dist/runtime/server/routes/swaps/offer-accept.post.js +9 -0
  268. package/dist/runtime/server/routes/swaps/offer-reject.post.d.ts +2 -0
  269. package/dist/runtime/server/routes/swaps/offer-reject.post.js +9 -0
  270. package/dist/runtime/server/routes/swaps/offer.delete.d.ts +2 -0
  271. package/dist/runtime/server/routes/swaps/offer.delete.js +11 -0
  272. package/dist/runtime/server/routes/swaps/offer.post.d.ts +2 -0
  273. package/dist/runtime/server/routes/swaps/offer.post.js +11 -0
  274. package/dist/runtime/server/routes/swaps/reject.post.d.ts +2 -0
  275. package/dist/runtime/server/routes/swaps/reject.post.js +9 -0
  276. package/dist/runtime/server/swap-email.d.ts +28 -0
  277. package/dist/runtime/server/swap-email.js +49 -0
  278. package/dist/runtime/server/tasks/close-shifts.d.ts +2 -0
  279. package/dist/runtime/server/tasks/close-shifts.js +9 -0
  280. package/dist/runtime/server/tasks/send-reminders.d.ts +2 -0
  281. package/dist/runtime/server/tasks/send-reminders.js +9 -0
  282. package/dist/runtime/server/utils/shifts-admin.d.ts +67 -0
  283. package/dist/runtime/server/utils/shifts-admin.js +312 -0
  284. package/dist/runtime/server/utils/shifts-assign.d.ts +89 -0
  285. package/dist/runtime/server/utils/shifts-assign.js +264 -0
  286. package/dist/runtime/server/utils/shifts-automation.d.ts +37 -0
  287. package/dist/runtime/server/utils/shifts-automation.js +171 -0
  288. package/dist/runtime/server/utils/shifts-broadcasts.d.ts +38 -0
  289. package/dist/runtime/server/utils/shifts-broadcasts.js +113 -0
  290. package/dist/runtime/server/utils/shifts-core.d.ts +78 -0
  291. package/dist/runtime/server/utils/shifts-core.js +142 -0
  292. package/dist/runtime/server/utils/shifts-dto.d.ts +32 -0
  293. package/dist/runtime/server/utils/shifts-dto.js +127 -0
  294. package/dist/runtime/server/utils/shifts-emails.d.ts +16 -0
  295. package/dist/runtime/server/utils/shifts-emails.js +44 -0
  296. package/dist/runtime/server/utils/shifts-exceptions.d.ts +7 -0
  297. package/dist/runtime/server/utils/shifts-exceptions.js +32 -0
  298. package/dist/runtime/server/utils/shifts-feed.d.ts +16 -0
  299. package/dist/runtime/server/utils/shifts-feed.js +73 -0
  300. package/dist/runtime/server/utils/shifts-notify.d.ts +40 -0
  301. package/dist/runtime/server/utils/shifts-notify.js +22 -0
  302. package/dist/runtime/server/utils/shifts-on-duty.d.ts +12 -0
  303. package/dist/runtime/server/utils/shifts-on-duty.js +37 -0
  304. package/dist/runtime/server/utils/shifts-perks.d.ts +46 -0
  305. package/dist/runtime/server/utils/shifts-perks.js +183 -0
  306. package/dist/runtime/server/utils/shifts-reminders.d.ts +30 -0
  307. package/dist/runtime/server/utils/shifts-reminders.js +102 -0
  308. package/dist/runtime/server/utils/shifts-schemas.d.ts +318 -0
  309. package/dist/runtime/server/utils/shifts-schemas.js +177 -0
  310. package/dist/runtime/server/utils/shifts-station-key.d.ts +7 -0
  311. package/dist/runtime/server/utils/shifts-station-key.js +22 -0
  312. package/dist/runtime/server/utils/shifts-stations.d.ts +28 -0
  313. package/dist/runtime/server/utils/shifts-stations.js +109 -0
  314. package/dist/runtime/server/utils/shifts-swaps.d.ts +114 -0
  315. package/dist/runtime/server/utils/shifts-swaps.js +559 -0
  316. package/dist/runtime/server/utils/shifts-views.d.ts +62 -0
  317. package/dist/runtime/server/utils/shifts-views.js +212 -0
  318. package/dist/runtime/utils/api.d.ts +108 -0
  319. package/dist/runtime/utils/api.js +111 -0
  320. package/dist/runtime/utils/checkin.d.ts +59 -0
  321. package/dist/runtime/utils/checkin.js +57 -0
  322. package/dist/runtime/utils/guards.d.ts +21 -0
  323. package/dist/runtime/utils/guards.js +36 -0
  324. package/dist/runtime/utils/ics.d.ts +32 -0
  325. package/dist/runtime/utils/ics.js +56 -0
  326. package/dist/runtime/utils/index.d.ts +16 -0
  327. package/dist/runtime/utils/index.js +15 -0
  328. package/dist/runtime/utils/links.d.ts +30 -0
  329. package/dist/runtime/utils/links.js +18 -0
  330. package/dist/runtime/utils/reminders.d.ts +27 -0
  331. package/dist/runtime/utils/reminders.js +28 -0
  332. package/dist/runtime/utils/settings.d.ts +28 -0
  333. package/dist/runtime/utils/settings.js +18 -0
  334. package/dist/runtime/utils/station-key.d.ts +9 -0
  335. package/dist/runtime/utils/station-key.js +12 -0
  336. package/dist/runtime/utils/status.d.ts +23 -0
  337. package/dist/runtime/utils/status.js +46 -0
  338. package/dist/runtime/utils/time.d.ts +22 -0
  339. package/dist/runtime/utils/time.js +14 -0
  340. package/dist/types.d.mts +5 -0
  341. package/package.json +131 -3
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,104 @@
1
+ <script setup>
2
+ import { shiftsApi } from "../../utils/api";
3
+ import { computed, errorMessage, navigateTo, onBeforeUnmount, onMounted, useAuthPages, useFetch, useHead, useModuleT, useRoute, useShiftsLinks, useShiftsTranslate, watch } from "#imports";
4
+ defineOptions({ name: "ShiftsStationPage" });
5
+ const t = useModuleT("shifts");
6
+ const tr = useShiftsTranslate();
7
+ const links = useShiftsLinks();
8
+ const route = useRoute();
9
+ const stationId = computed(() => String(route.params.stationId ?? ""));
10
+ const { data, error, refresh } = await useFetch(() => shiftsApi.stationToken(stationId.value), {
11
+ key: computed(() => `shifts:station:${stationId.value}`),
12
+ server: false
13
+ });
14
+ watch(error, async (value) => {
15
+ if (value?.statusCode === 401) await navigateTo({ path: useAuthPages().login, query: { redirect: route.path } });
16
+ }, { immediate: true });
17
+ const qr = computed(() => data.value ? `data:image/svg+xml;utf8,${encodeURIComponent(data.value.svg)}` : null);
18
+ let timer;
19
+ function schedule() {
20
+ clearTimeout(timer);
21
+ const next = data.value ? Date.parse(data.value.refreshAt) - Date.now() + 250 : 5e3;
22
+ timer = setTimeout(async () => {
23
+ await refresh();
24
+ schedule();
25
+ }, Math.min(Math.max(next, 1e3), 3e4));
26
+ }
27
+ let lock = null;
28
+ async function acquire() {
29
+ try {
30
+ lock = await navigator.wakeLock?.request("screen") ?? null;
31
+ } catch {
32
+ lock = null;
33
+ }
34
+ }
35
+ const onVisible = () => {
36
+ if (document.visibilityState !== "visible") return;
37
+ void acquire();
38
+ void refresh().then(schedule);
39
+ };
40
+ onMounted(() => {
41
+ schedule();
42
+ void acquire();
43
+ document.addEventListener("visibilitychange", onVisible);
44
+ });
45
+ onBeforeUnmount(() => {
46
+ clearTimeout(timer);
47
+ document.removeEventListener("visibilitychange", onVisible);
48
+ void lock?.release().catch(() => {
49
+ });
50
+ });
51
+ useHead({ title: () => data.value ? tr(data.value.station.name) : t("station.title", "Check-in station") });
52
+ </script>
53
+
54
+ <template>
55
+ <div class="fixed inset-0 z-[100] flex flex-col items-center justify-between gap-4 bg-white p-4 text-black">
56
+ <div class="flex w-full items-start justify-between gap-2">
57
+ <div>
58
+ <p class="text-2xl font-semibold">
59
+ {{ data ? tr(data.station.name) : t("station.title", "Check-in station") }}
60
+ </p>
61
+ <p
62
+ v-if="data"
63
+ class="text-lg text-neutral-600"
64
+ >
65
+ {{ tr(data.station.teamName) }}
66
+ </p>
67
+ </div>
68
+ <UButton
69
+ :to="links.shifts()"
70
+ color="neutral"
71
+ variant="solid"
72
+ icon="i-lucide-x"
73
+ :label="t('station.close', 'Close station')"
74
+ />
75
+ </div>
76
+ <img
77
+ v-if="qr"
78
+ :src="qr"
79
+ :alt="t('station.qrAlt', 'QR code to check in at this station')"
80
+ class="aspect-square w-[min(92vw,70vh)] max-w-full bg-white"
81
+ >
82
+ <div
83
+ v-else-if="error && error.statusCode !== 401"
84
+ class="flex max-w-md flex-col items-center gap-2 text-center"
85
+ >
86
+ <p class="text-xl font-semibold">
87
+ {{ error.statusCode === 403 ? t("station.forbidden", "Only leads of the team can open this station") : error.statusCode === 404 ? t("station.notFound", "This station does not exist") : error.statusCode === 501 ? t("station.notConfigured", "Station check-in is not set up on this server") : t("station.loadFailed", "The station could not be loaded") }}
88
+ </p>
89
+ <p
90
+ v-if="error.statusCode !== 403 && error.statusCode !== 404"
91
+ class="text-neutral-600"
92
+ >
93
+ {{ errorMessage(error, "") }}
94
+ </p>
95
+ </div>
96
+ <USkeleton
97
+ v-else
98
+ class="aspect-square w-[min(92vw,70vh)]"
99
+ />
100
+ <p class="text-center text-lg">
101
+ {{ t("station.help", "Scan this code in the app, on your shift, to check in. It changes every 30 seconds.") }}
102
+ </p>
103
+ </div>
104
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,192 @@
1
+ <script setup>
2
+ import { shiftsApi } from "../../utils/api";
3
+ import { SHIFT_SWAP_OFFER_STATUS_LABELS } from "../../utils/status";
4
+ import { allowsSwapKind } from "../../utils/settings";
5
+ import { $fetch, computed, errorMessage, navigateTo, onMounted, reactive, ref, useAction, useAuthPages, useFetch, useHead, useModuleT, useRoute, useShiftsFormat, useShiftsLinks, useShiftsTranslate } from "#imports";
6
+ defineOptions({ name: "ShiftsSwapsPage" });
7
+ const t = useModuleT("shifts");
8
+ const tr = useShiftsTranslate();
9
+ const format = useShiftsFormat();
10
+ const links = useShiftsLinks();
11
+ const { busy, run } = useAction();
12
+ const route = useRoute();
13
+ const { data: swaps, error, refresh } = await useFetch(shiftsApi.swaps, { key: "shifts:swaps", default: () => [] });
14
+ if (error.value?.statusCode === 401) {
15
+ await navigateTo({ path: useAuthPages().login, query: { redirect: route.path } });
16
+ }
17
+ const { data: mine, refresh: refreshMine } = await useFetch(shiftsApi.me.shifts, { key: "shifts:me", default: () => [] });
18
+ const now = ref(0);
19
+ onMounted(() => now.value = Date.now());
20
+ const upcomingMine = computed(() => mine.value.filter((item) => item.assignment.status === "assigned" && Date.parse(item.shift.startsAt) > now.value));
21
+ const myOpen = computed(() => upcomingMine.value.filter((item) => item.swap));
22
+ const giving = reactive({});
23
+ const givingOptions = (swap) => upcomingMine.value.filter((item) => !swap.wantedAssignmentId || item.assignment.id === swap.wantedAssignmentId).filter((item) => allowsSwapKind(item.settings, "trade")).filter((item) => item.shift.scheduleId === swap.shift.scheduleId || swap.settings.coverage !== "all" && item.settings.coverage !== "all").map((item) => ({ label: `${tr(item.teamName)} \xB7 ${format.range(item.shift.startsAt, item.shift.endsAt)}`, value: item.assignment.id }));
24
+ async function offer(swap) {
25
+ const back = swap.kind === "trade" ? giving[swap.id] ?? swap.wantedAssignmentId ?? null : null;
26
+ if (swap.kind === "trade" && !back) return;
27
+ const done = await run(
28
+ () => $fetch(shiftsApi.offers(swap.id), { method: "POST", body: { assignmentId: back } }).then(() => true),
29
+ swap.kind === "trade" ? { success: t("swaps.tradeOffered", "Offered {name} a trade", { name: swap.owner.name ?? "" }), error: t("swaps.offerFailed", "Could not make the offer") } : { success: t("swaps.offered", "Offered to take the shift of {name}", { name: swap.owner.name ?? "" }), error: t("swaps.offerFailed", "Could not make the offer") }
30
+ );
31
+ if (done) await Promise.all([refresh(), refreshMine()]);
32
+ }
33
+ async function withdraw(swap) {
34
+ if (!swap.myOffer) return;
35
+ const done = await run(
36
+ () => $fetch(shiftsApi.offer(swap.id, swap.myOffer.id), { method: "DELETE" }).then(() => true),
37
+ { success: t("swaps.offerWithdrawn", "Withdrew your offer"), error: t("swaps.offerWithdrawFailed", "Could not withdraw the offer") }
38
+ );
39
+ if (done) await refresh();
40
+ }
41
+ useHead({ title: () => t("swaps.title", "Open swaps") });
42
+ </script>
43
+
44
+ <template>
45
+ <UContainer>
46
+ <UPage>
47
+ <UPageHeader
48
+ :title="t('swaps.title', 'Open swaps')"
49
+ :description="t('swaps.description', 'Shifts others want to trade or give away that you can take. A trade asks for one of your own shifts in return.')"
50
+ >
51
+ <template #links>
52
+ <UButton
53
+ :to="links.shifts()"
54
+ icon="i-lucide-arrow-left"
55
+ color="neutral"
56
+ variant="ghost"
57
+ :label="t('shift.back', 'My shifts')"
58
+ />
59
+ </template>
60
+ </UPageHeader>
61
+ <UPageBody class="max-w-3xl">
62
+ <SectionCard
63
+ v-if="myOpen.length"
64
+ :title="t('swaps.mine', 'Your shifts on offer')"
65
+ >
66
+ <ul class="divide-default divide-y">
67
+ <li
68
+ v-for="item in myOpen"
69
+ :key="item.assignment.id"
70
+ class="flex items-center justify-between gap-2 py-2"
71
+ >
72
+ <span class="text-sm">{{ tr(item.teamName) }} · {{ format.range(item.shift.startsAt, item.shift.endsAt) }}</span>
73
+ <UButton
74
+ :to="links.shift(item.assignment.id)"
75
+ size="sm"
76
+ color="neutral"
77
+ variant="outline"
78
+ :label="t('swaps.seeOffers', 'See offers')"
79
+ />
80
+ </li>
81
+ </ul>
82
+ </SectionCard>
83
+
84
+ <UEmpty
85
+ v-if="error && error.statusCode !== 401"
86
+ icon="i-lucide-circle-alert"
87
+ :title="t('swaps.loadFailed', 'The swaps could not be loaded')"
88
+ :description="errorMessage(error, '')"
89
+ :actions="[{ label: t('tryAgain', 'Try again'), icon: 'i-lucide-rotate-ccw', color: 'neutral', variant: 'outline', onClick: () => refresh() }]"
90
+ />
91
+ <UEmpty
92
+ v-else-if="!swaps.length"
93
+ icon="i-lucide-arrow-left-right"
94
+ :title="t('swaps.empty', 'No open swaps for you')"
95
+ :description="t('swaps.emptyDescription', 'When somebody on your team offers a shift you can take, it shows up here.')"
96
+ />
97
+ <div
98
+ v-else
99
+ class="flex flex-col gap-3"
100
+ >
101
+ <SectionCard
102
+ v-for="swap in swaps"
103
+ :key="swap.id"
104
+ :title="`${tr(swap.shift.teamName)} \xB7 ${format.range(swap.shift.startsAt, swap.shift.endsAt)}`"
105
+ :description="t('swaps.from', 'From {name} \xB7 {schedule}', { name: swap.owner.name ?? '', schedule: tr(swap.shift.scheduleName) })"
106
+ >
107
+ <template #actions>
108
+ <div class="flex items-center gap-2">
109
+ <UBadge
110
+ color="neutral"
111
+ variant="subtle"
112
+ :label="swap.kind === 'trade' ? t('swapKinds.trade', 'Trade') : t('swapKinds.release', 'Give away')"
113
+ />
114
+ <UBadge
115
+ v-if="swap.myOffer"
116
+ color="primary"
117
+ variant="subtle"
118
+ :label="t(`offerStatuses.${swap.myOffer.status}`, SHIFT_SWAP_OFFER_STATUS_LABELS[swap.myOffer.status])"
119
+ />
120
+ </div>
121
+ </template>
122
+ <UAlert
123
+ v-if="swap.settings.coverage === 'all'"
124
+ class="mb-3"
125
+ color="info"
126
+ variant="subtle"
127
+ icon="i-lucide-info"
128
+ :title="t('shift.tradeOnly', 'Trade only: you must work all your shifts.')"
129
+ />
130
+ <p
131
+ v-if="swap.wantedShift && !swap.myOffer"
132
+ class="text-muted mb-3 text-sm"
133
+ >
134
+ {{ t("swaps.wants", "Wants your shift on {team}, {when}", { team: tr(swap.wantedShift.teamName), when: format.range(swap.wantedShift.startsAt, swap.wantedShift.endsAt) }) }}
135
+ </p>
136
+ <div
137
+ v-if="!swap.myOffer && swap.kind === 'trade'"
138
+ class="flex flex-wrap items-end gap-2"
139
+ >
140
+ <UFormField
141
+ :label="t('swaps.giveBack', 'You give in return')"
142
+ :description="givingOptions(swap).length ? void 0 : t('swaps.nothingToTrade', 'You have no upcoming shift to trade.')"
143
+ required
144
+ class="min-w-64 flex-1"
145
+ >
146
+ <USelect
147
+ v-model="giving[swap.id]"
148
+ :items="givingOptions(swap)"
149
+ :placeholder="t('swaps.pickShift', 'Choose one of your shifts')"
150
+ :disabled="!givingOptions(swap).length"
151
+ class="w-full"
152
+ />
153
+ </UFormField>
154
+ <UButton
155
+ :loading="busy"
156
+ :disabled="!giving[swap.id] && !swap.wantedAssignmentId"
157
+ :label="t('swaps.tradeAction', 'Offer a trade')"
158
+ @click="offer(swap)"
159
+ />
160
+ </div>
161
+ <div
162
+ v-else-if="!swap.myOffer"
163
+ class="flex justify-end"
164
+ >
165
+ <UButton
166
+ :loading="busy"
167
+ :label="t('swaps.offerAction', 'Take the shift over')"
168
+ @click="offer(swap)"
169
+ />
170
+ </div>
171
+ <div
172
+ v-else
173
+ class="flex items-center justify-between gap-2"
174
+ >
175
+ <span class="text-muted text-sm">
176
+ {{ swap.myOffer.offeredShift ? t("swaps.youGive", "You give {team}, {when}", { team: tr(swap.myOffer.offeredShift.teamName), when: format.range(swap.myOffer.offeredShift.startsAt, swap.myOffer.offeredShift.endsAt) }) : t("swaps.youTake", "You take the shift over") }}
177
+ </span>
178
+ <UButton
179
+ color="neutral"
180
+ variant="outline"
181
+ size="sm"
182
+ :loading="busy"
183
+ :label="t('swaps.withdrawOffer', 'Withdraw offer')"
184
+ @click="withdraw(swap)"
185
+ />
186
+ </div>
187
+ </SectionCard>
188
+ </div>
189
+ </UPageBody>
190
+ </UPage>
191
+ </UContainer>
192
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,9 @@
1
+ type __VLS_Props = {
2
+ operation?: {
3
+ id: string;
4
+ slug?: string;
5
+ };
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;