@glissandoo/lib 1.123.2 → 1.123.3

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 (521) hide show
  1. package/package.json +1 -1
  2. package/types/firestore.ts +1998 -0
  3. package/types/messagebirdChatWidget.ts +20 -0
  4. package/types/minVersion.ts +4 -0
  5. package/types/payoutRule.ts +132 -0
  6. package/types/supabase/generated.ts +1682 -0
  7. package/types/supabase/index.ts +36 -0
  8. package/types/supabase/overwrites/comm.ts +18 -0
  9. package/types/supabase/overwrites/comm_history.ts +10 -0
  10. package/types/supabase/overwrites/event.ts +28 -0
  11. package/types/supabase/overwrites/event_history.ts +10 -0
  12. package/types/supabase/overwrites/group.ts +49 -0
  13. package/types/supabase/overwrites/group_history.ts +9 -0
  14. package/types/supabase/overwrites/index.ts +7 -0
  15. package/types/supabase/overwrites/offer.ts +15 -0
  16. package/types/supabase/overwrites/offer_history.ts +10 -0
  17. package/types/supabase/overwrites/repertoire.ts +12 -0
  18. package/types/supabase/overwrites/repertoire_history.ts +10 -0
  19. package/types/supabase/overwrites/utils.ts +4 -0
  20. package/.firebaserc +0 -7
  21. package/.husky/pre-commit +0 -4
  22. package/README.md +0 -70
  23. package/scripts/setHusky.js +0 -11
  24. package/supabase/.dev.env +0 -1
  25. package/supabase/.prod.env +0 -1
  26. package/supabase/.sample.env +0 -2
  27. package/supabase/README.md +0 -126
  28. package/supabase/config.toml +0 -68
  29. package/supabase/migrations/20231117044943_remote_schema.sql +0 -228
  30. package/supabase/migrations/20231117124947_event_selection_mode_closed_at_nullable.sql +0 -1
  31. package/supabase/migrations/20231121002132_remote_schema.sql +0 -31
  32. package/supabase/migrations/20231121004031_references_nullable.sql +0 -3
  33. package/supabase/migrations/20231121014339_updated_at_trigger.sql +0 -13
  34. package/supabase/migrations/20231122111241_remote_schema.sql +0 -25
  35. package/supabase/migrations/20231124151424_snake_case_to_camel_case.sql +0 -105
  36. package/supabase/migrations/20231129133721_add_columns_for_sites.sql +0 -11
  37. package/supabase/migrations/20231129142806_promoter_can_be_null.sql +0 -3
  38. package/supabase/migrations/20231130125327_group_location_latlon.sql +0 -3
  39. package/supabase/migrations/20231130150154_error_solvings.sql +0 -9
  40. package/supabase/migrations/20240405115914_new_columns.sql +0 -9
  41. package/supabase/migrations/20240405121956_init_offer.sql +0 -81
  42. package/supabase/migrations/20240503032440_add_columns_to_offer.sql +0 -11
  43. package/supabase/migrations/20240503101641_add_column_createdOn.sql +0 -19
  44. package/supabase/migrations/20240506035104_add_groupInfo_to_offer.sql +0 -10
  45. package/supabase/migrations/20240510110328_add_relationships_to_offer.sql +0 -9
  46. package/supabase/migrations/20240514100316_offers_public.sql +0 -9
  47. package/supabase/migrations/20260506013030_add_user_mirror.sql +0 -50
  48. package/supabase/migrations/20260506013031_add_user_group_mirror.sql +0 -31
  49. package/supabase/migrations/20260529000000_init_group_payment.sql +0 -79
  50. package/supabase/migrations/20260529120000_group_payment_realtime.sql +0 -19
  51. package/supabase/migrations/20260529130000_group_payment_anon_read.sql +0 -16
  52. package/supabase/migrations/20260601000000_group_payment_concept_norm.sql +0 -20
  53. package/supabase/migrations/20260605000000_init_partnership_domain.sql +0 -333
  54. package/supabase/migrations/20260605000100_partnership_recurring_rpc.sql +0 -62
  55. package/supabase/migrations/20260606000000_partnership_payer.sql +0 -83
  56. package/supabase/migrations/20260607000000_partnership_partner_number_not_unique.sql +0 -10
  57. package/supabase/migrations/20260608000000_partnership_payment_method_bizum.sql +0 -2
  58. package/supabase/migrations/20260609000000_partnership_payment_sepa_end_to_end.sql +0 -13
  59. package/supabase/migrations/20260617000000_partnership_portal_query_indexes.sql +0 -23
  60. package/supabase/migrations/20260618000000_partnership_communication_attachments.sql +0 -5
  61. package/supabase/migrations/20260701000000_partnership_recurring_rpc_drop_ambiguous.sql +0 -29
  62. package/supabase/migrations/20260713191700_add_personal_calendar_feed.sql +0 -506
  63. package/supabase/migrations/20260714193734_add_pending_calendar_invitations.sql +0 -403
  64. package/supabase/migrations/20260714205623_add_event_datetime_end_backfill.sql +0 -64
  65. package/supabase/migrations/20260729161126_remove_calendar_event_history_dependency.sql +0 -19
  66. package/supabase/migrations/20260729161202_reconcile_production_remote_schema.sql +0 -135
  67. package/supabase/migrations/20260804120000_add_calendar_feed_token_cipher.sql +0 -9
  68. package/supabase/migrations/20260805120000_replace_usergroup_with_group_playerids.sql +0 -363
  69. package/supabase/seed.sql +0 -2973
  70. /package/{lib/functions → functions}/auth.d.ts +0 -0
  71. /package/{lib/functions → functions}/auth.js +0 -0
  72. /package/{lib/functions → functions}/calendarFeed.d.ts +0 -0
  73. /package/{lib/functions → functions}/calendarFeed.js +0 -0
  74. /package/{lib/functions → functions}/communication.d.ts +0 -0
  75. /package/{lib/functions → functions}/communication.js +0 -0
  76. /package/{lib/functions → functions}/communicationComment.d.ts +0 -0
  77. /package/{lib/functions → functions}/communicationComment.js +0 -0
  78. /package/{lib/functions → functions}/customer.d.ts +0 -0
  79. /package/{lib/functions → functions}/customer.js +0 -0
  80. /package/{lib/functions → functions}/customerGroup.d.ts +0 -0
  81. /package/{lib/functions → functions}/customerGroup.js +0 -0
  82. /package/{lib/functions → functions}/event.d.ts +0 -0
  83. /package/{lib/functions → functions}/event.js +0 -0
  84. /package/{lib/functions → functions}/eventPlayer.d.ts +0 -0
  85. /package/{lib/functions → functions}/eventPlayer.js +0 -0
  86. /package/{lib/functions → functions}/eventRepertory.d.ts +0 -0
  87. /package/{lib/functions → functions}/eventRepertory.js +0 -0
  88. /package/{lib/functions → functions}/eventoPayout.d.ts +0 -0
  89. /package/{lib/functions → functions}/eventoPayout.js +0 -0
  90. /package/{lib/functions → functions}/federation.d.ts +0 -0
  91. /package/{lib/functions → functions}/federation.js +0 -0
  92. /package/{lib/functions → functions}/federationPartnership.d.ts +0 -0
  93. /package/{lib/functions → functions}/federationPartnership.js +0 -0
  94. /package/{lib/functions → functions}/group.d.ts +0 -0
  95. /package/{lib/functions → functions}/group.js +0 -0
  96. /package/{lib/functions → functions}/groupEventStage.d.ts +0 -0
  97. /package/{lib/functions → functions}/groupEventStage.js +0 -0
  98. /package/{lib/functions → functions}/groupModule.d.ts +0 -0
  99. /package/{lib/functions → functions}/groupModule.js +0 -0
  100. /package/{lib/functions → functions}/groupPayment.d.ts +0 -0
  101. /package/{lib/functions → functions}/groupPayment.js +0 -0
  102. /package/{lib/functions → functions}/groupPayoutRule.d.ts +0 -0
  103. /package/{lib/functions → functions}/groupPayoutRule.js +0 -0
  104. /package/{lib/functions → functions}/groupPlayer.d.ts +0 -0
  105. /package/{lib/functions → functions}/groupPlayer.js +0 -0
  106. /package/{lib/functions → functions}/groupRepertory.d.ts +0 -0
  107. /package/{lib/functions → functions}/groupRepertory.js +0 -0
  108. /package/{lib/functions → functions}/index.d.ts +0 -0
  109. /package/{lib/functions → functions}/index.js +0 -0
  110. /package/{lib/functions → functions}/inventory.d.ts +0 -0
  111. /package/{lib/functions → functions}/inventory.js +0 -0
  112. /package/{lib/functions → functions}/inventoryItem.d.ts +0 -0
  113. /package/{lib/functions → functions}/inventoryItem.js +0 -0
  114. /package/{lib/functions → functions}/jwt.d.ts +0 -0
  115. /package/{lib/functions → functions}/jwt.js +0 -0
  116. /package/{lib/functions → functions}/misc.d.ts +0 -0
  117. /package/{lib/functions → functions}/misc.js +0 -0
  118. /package/{lib/functions → functions}/notification.d.ts +0 -0
  119. /package/{lib/functions → functions}/notification.js +0 -0
  120. /package/{lib/functions → functions}/offer.d.ts +0 -0
  121. /package/{lib/functions → functions}/offer.js +0 -0
  122. /package/{lib/functions → functions}/offerApplicant.d.ts +0 -0
  123. /package/{lib/functions → functions}/offerApplicant.js +0 -0
  124. /package/{lib/functions → functions}/partnership.d.ts +0 -0
  125. /package/{lib/functions → functions}/partnership.js +0 -0
  126. /package/{lib/functions → functions}/partnershipCommunication.d.ts +0 -0
  127. /package/{lib/functions → functions}/partnershipCommunication.js +0 -0
  128. /package/{lib/functions → functions}/partnershipGroup.d.ts +0 -0
  129. /package/{lib/functions → functions}/partnershipGroup.js +0 -0
  130. /package/{lib/functions → functions}/partnershipPartner.d.ts +0 -0
  131. /package/{lib/functions → functions}/partnershipPartner.js +0 -0
  132. /package/{lib/functions → functions}/partnershipPayment.d.ts +0 -0
  133. /package/{lib/functions → functions}/partnershipPayment.js +0 -0
  134. /package/{lib/functions → functions}/partnershipPlan.d.ts +0 -0
  135. /package/{lib/functions → functions}/partnershipPlan.js +0 -0
  136. /package/{lib/functions → functions}/partnershipSepaPaymentGroup.d.ts +0 -0
  137. /package/{lib/functions → functions}/partnershipSepaPaymentGroup.js +0 -0
  138. /package/{lib/functions → functions}/partnershipSubscription.d.ts +0 -0
  139. /package/{lib/functions → functions}/partnershipSubscription.js +0 -0
  140. /package/{lib/functions → functions}/regions.d.ts +0 -0
  141. /package/{lib/functions → functions}/regions.js +0 -0
  142. /package/{lib/functions → functions}/subscription.d.ts +0 -0
  143. /package/{lib/functions → functions}/subscription.js +0 -0
  144. /package/{lib/functions → functions}/user.d.ts +0 -0
  145. /package/{lib/functions → functions}/user.js +0 -0
  146. /package/{lib/functions → functions}/userNotification.d.ts +0 -0
  147. /package/{lib/functions → functions}/userNotification.js +0 -0
  148. /package/{lib/helpers → helpers}/appScenes.d.ts +0 -0
  149. /package/{lib/helpers → helpers}/appScenes.js +0 -0
  150. /package/{lib/helpers → helpers}/audios.d.ts +0 -0
  151. /package/{lib/helpers → helpers}/audios.js +0 -0
  152. /package/{lib/helpers → helpers}/auth.d.ts +0 -0
  153. /package/{lib/helpers → helpers}/auth.js +0 -0
  154. /package/{lib/helpers → helpers}/badges.d.ts +0 -0
  155. /package/{lib/helpers → helpers}/badges.js +0 -0
  156. /package/{lib/helpers → helpers}/collections.d.ts +0 -0
  157. /package/{lib/helpers → helpers}/collections.js +0 -0
  158. /package/{lib/helpers → helpers}/communicationTemplate/index.d.ts +0 -0
  159. /package/{lib/helpers → helpers}/communicationTemplate/index.js +0 -0
  160. /package/{lib/helpers → helpers}/communicationTemplate/newGroup.d.ts +0 -0
  161. /package/{lib/helpers → helpers}/communicationTemplate/newGroup.js +0 -0
  162. /package/{lib/helpers → helpers}/communicationTemplate/newMember.d.ts +0 -0
  163. /package/{lib/helpers → helpers}/communicationTemplate/newMember.js +0 -0
  164. /package/{lib/helpers → helpers}/countries.d.ts +0 -0
  165. /package/{lib/helpers → helpers}/countries.js +0 -0
  166. /package/{lib/helpers → helpers}/currency.d.ts +0 -0
  167. /package/{lib/helpers → helpers}/currency.js +0 -0
  168. /package/{lib/helpers → helpers}/dlinks.d.ts +0 -0
  169. /package/{lib/helpers → helpers}/dlinks.js +0 -0
  170. /package/{lib/helpers → helpers}/errors.d.ts +0 -0
  171. /package/{lib/helpers → helpers}/errors.js +0 -0
  172. /package/{lib/helpers → helpers}/fileSections/index.d.ts +0 -0
  173. /package/{lib/helpers → helpers}/fileSections/index.js +0 -0
  174. /package/{lib/helpers → helpers}/fileSections/orders.d.ts +0 -0
  175. /package/{lib/helpers → helpers}/fileSections/orders.js +0 -0
  176. /package/{lib/helpers → helpers}/glissandooAdmin.d.ts +0 -0
  177. /package/{lib/helpers → helpers}/glissandooAdmin.js +0 -0
  178. /package/{lib/helpers → helpers}/instruments/index.d.ts +0 -0
  179. /package/{lib/helpers → helpers}/instruments/index.js +0 -0
  180. /package/{lib/helpers → helpers}/instruments/lists.d.ts +0 -0
  181. /package/{lib/helpers → helpers}/instruments/lists.js +0 -0
  182. /package/{lib/helpers → helpers}/instruments/orders.d.ts +0 -0
  183. /package/{lib/helpers → helpers}/instruments/orders.js +0 -0
  184. /package/{lib/helpers → helpers}/musicStyles/index.d.ts +0 -0
  185. /package/{lib/helpers → helpers}/musicStyles/index.js +0 -0
  186. /package/{lib/helpers → helpers}/musicStyles/orders.d.ts +0 -0
  187. /package/{lib/helpers → helpers}/musicStyles/orders.js +0 -0
  188. /package/{lib/helpers → helpers}/notifications/index.d.ts +0 -0
  189. /package/{lib/helpers → helpers}/notifications/index.js +0 -0
  190. /package/{lib/helpers → helpers}/notifications/placeholders.d.ts +0 -0
  191. /package/{lib/helpers → helpers}/notifications/placeholders.js +0 -0
  192. /package/{lib/helpers → helpers}/objects.d.ts +0 -0
  193. /package/{lib/helpers → helpers}/objects.js +0 -0
  194. /package/{lib/helpers → helpers}/paymentForecast.d.ts +0 -0
  195. /package/{lib/helpers → helpers}/paymentForecast.js +0 -0
  196. /package/{lib/helpers → helpers}/payoutRules.d.ts +0 -0
  197. /package/{lib/helpers → helpers}/payoutRules.js +0 -0
  198. /package/{lib/helpers → helpers}/plans.d.ts +0 -0
  199. /package/{lib/helpers → helpers}/plans.js +0 -0
  200. /package/{lib/helpers → helpers}/rates.d.ts +0 -0
  201. /package/{lib/helpers → helpers}/rates.js +0 -0
  202. /package/{lib/helpers → helpers}/reasons.d.ts +0 -0
  203. /package/{lib/helpers → helpers}/reasons.js +0 -0
  204. /package/{lib/helpers → helpers}/slate.d.ts +0 -0
  205. /package/{lib/helpers → helpers}/slate.js +0 -0
  206. /package/{lib/helpers → helpers}/styles.d.ts +0 -0
  207. /package/{lib/helpers → helpers}/styles.js +0 -0
  208. /package/{lib/helpers → helpers}/ts-extras/array-includes.d.ts +0 -0
  209. /package/{lib/helpers → helpers}/ts-extras/array-includes.js +0 -0
  210. /package/{lib/helpers → helpers}/ts-extras/as-mutable.d.ts +0 -0
  211. /package/{lib/helpers → helpers}/ts-extras/as-mutable.js +0 -0
  212. /package/{lib/helpers → helpers}/ts-extras/assert-error.d.ts +0 -0
  213. /package/{lib/helpers → helpers}/ts-extras/assert-error.js +0 -0
  214. /package/{lib/helpers → helpers}/ts-extras/index.d.ts +0 -0
  215. /package/{lib/helpers → helpers}/ts-extras/index.js +0 -0
  216. /package/{lib/helpers → helpers}/ts-extras/is-defined.d.ts +0 -0
  217. /package/{lib/helpers → helpers}/ts-extras/is-defined.js +0 -0
  218. /package/{lib/helpers → helpers}/ts-extras/is-empty.d.ts +0 -0
  219. /package/{lib/helpers → helpers}/ts-extras/is-empty.js +0 -0
  220. /package/{lib/helpers → helpers}/ts-extras/is-finite.d.ts +0 -0
  221. /package/{lib/helpers → helpers}/ts-extras/is-finite.js +0 -0
  222. /package/{lib/helpers → helpers}/ts-extras/is-infinite.d.ts +0 -0
  223. /package/{lib/helpers → helpers}/ts-extras/is-infinite.js +0 -0
  224. /package/{lib/helpers → helpers}/ts-extras/is-integer.d.ts +0 -0
  225. /package/{lib/helpers → helpers}/ts-extras/is-integer.js +0 -0
  226. /package/{lib/helpers → helpers}/ts-extras/is-present.d.ts +0 -0
  227. /package/{lib/helpers → helpers}/ts-extras/is-present.js +0 -0
  228. /package/{lib/helpers → helpers}/ts-extras/is-safe-integer.d.ts +0 -0
  229. /package/{lib/helpers → helpers}/ts-extras/is-safe-integer.js +0 -0
  230. /package/{lib/helpers → helpers}/ts-extras/object-entries.d.ts +0 -0
  231. /package/{lib/helpers → helpers}/ts-extras/object-entries.js +0 -0
  232. /package/{lib/helpers → helpers}/ts-extras/object-from-entries.d.ts +0 -0
  233. /package/{lib/helpers → helpers}/ts-extras/object-from-entries.js +0 -0
  234. /package/{lib/helpers → helpers}/ts-extras/object-has-own.d.ts +0 -0
  235. /package/{lib/helpers → helpers}/ts-extras/object-has-own.js +0 -0
  236. /package/{lib/helpers → helpers}/ts-extras/object-keys.d.ts +0 -0
  237. /package/{lib/helpers → helpers}/ts-extras/object-keys.js +0 -0
  238. /package/{lib/helpers → helpers}/ts-extras/set-has.d.ts +0 -0
  239. /package/{lib/helpers → helpers}/ts-extras/set-has.js +0 -0
  240. /package/{lib/helpers → helpers}/types.d.ts +0 -0
  241. /package/{lib/helpers → helpers}/types.js +0 -0
  242. /package/{lib/helpers → helpers}/utils.d.ts +0 -0
  243. /package/{lib/helpers → helpers}/utils.js +0 -0
  244. /package/{lib/index.d.ts → index.d.ts} +0 -0
  245. /package/{lib/index.js → index.js} +0 -0
  246. /package/{lib/lang → lang}/ca.json +0 -0
  247. /package/{lib/lang → lang}/de.json +0 -0
  248. /package/{lib/lang → lang}/en.json +0 -0
  249. /package/{lib/lang → lang}/es.json +0 -0
  250. /package/{lib/lang → lang}/eu.json +0 -0
  251. /package/{lib/lang → lang}/fr.json +0 -0
  252. /package/{lib/lang → lang}/gl.json +0 -0
  253. /package/{lib/lang → lang}/index.d.ts +0 -0
  254. /package/{lib/lang → lang}/index.js +0 -0
  255. /package/{lib/lang → lang}/it.json +0 -0
  256. /package/{lib/lang → lang}/nl.json +0 -0
  257. /package/{lib/lang → lang}/pt.json +0 -0
  258. /package/{lib/models → models}/Communication/Comment/index.d.ts +0 -0
  259. /package/{lib/models → models}/Communication/Comment/index.js +0 -0
  260. /package/{lib/models → models}/Communication/Comment/types.d.ts +0 -0
  261. /package/{lib/models → models}/Communication/Comment/types.js +0 -0
  262. /package/{lib/models → models}/Communication/index.d.ts +0 -0
  263. /package/{lib/models → models}/Communication/index.js +0 -0
  264. /package/{lib/models → models}/Communication/types.d.ts +0 -0
  265. /package/{lib/models → models}/Communication/types.js +0 -0
  266. /package/{lib/models → models}/Counters/Group/Analytics/index.d.ts +0 -0
  267. /package/{lib/models → models}/Counters/Group/Analytics/index.js +0 -0
  268. /package/{lib/models → models}/Counters/Group/Analytics/types.d.ts +0 -0
  269. /package/{lib/models → models}/Counters/Group/Analytics/types.js +0 -0
  270. /package/{lib/models → models}/Counters/Group/index.d.ts +0 -0
  271. /package/{lib/models → models}/Counters/Group/index.js +0 -0
  272. /package/{lib/models → models}/Counters/Group/types.d.ts +0 -0
  273. /package/{lib/models → models}/Counters/Group/types.js +0 -0
  274. /package/{lib/models → models}/Counters/event.d.ts +0 -0
  275. /package/{lib/models → models}/Counters/event.js +0 -0
  276. /package/{lib/models → models}/Counters/index.d.ts +0 -0
  277. /package/{lib/models → models}/Counters/index.js +0 -0
  278. /package/{lib/models → models}/Counters/types.d.ts +0 -0
  279. /package/{lib/models → models}/Counters/types.js +0 -0
  280. /package/{lib/models → models}/Customer/Group/index.d.ts +0 -0
  281. /package/{lib/models → models}/Customer/Group/index.js +0 -0
  282. /package/{lib/models → models}/Customer/Group/types.d.ts +0 -0
  283. /package/{lib/models → models}/Customer/Group/types.js +0 -0
  284. /package/{lib/models → models}/Customer/basic.d.ts +0 -0
  285. /package/{lib/models → models}/Customer/basic.js +0 -0
  286. /package/{lib/models → models}/Customer/index.d.ts +0 -0
  287. /package/{lib/models → models}/Customer/index.js +0 -0
  288. /package/{lib/models → models}/Customer/types.d.ts +0 -0
  289. /package/{lib/models → models}/Customer/types.js +0 -0
  290. /package/{lib/models → models}/Evento/Player/basic.d.ts +0 -0
  291. /package/{lib/models → models}/Evento/Player/basic.js +0 -0
  292. /package/{lib/models → models}/Evento/Player/index.d.ts +0 -0
  293. /package/{lib/models → models}/Evento/Player/index.js +0 -0
  294. /package/{lib/models → models}/Evento/Player/types.d.ts +0 -0
  295. /package/{lib/models → models}/Evento/Player/types.js +0 -0
  296. /package/{lib/models → models}/Evento/Repertory/index.d.ts +0 -0
  297. /package/{lib/models → models}/Evento/Repertory/index.js +0 -0
  298. /package/{lib/models → models}/Evento/Repertory/types.d.ts +0 -0
  299. /package/{lib/models → models}/Evento/Repertory/types.js +0 -0
  300. /package/{lib/models → models}/Evento/basic.d.ts +0 -0
  301. /package/{lib/models → models}/Evento/basic.js +0 -0
  302. /package/{lib/models → models}/Evento/index.d.ts +0 -0
  303. /package/{lib/models → models}/Evento/index.js +0 -0
  304. /package/{lib/models → models}/Evento/promoter.d.ts +0 -0
  305. /package/{lib/models → models}/Evento/promoter.js +0 -0
  306. /package/{lib/models → models}/Evento/tiny.d.ts +0 -0
  307. /package/{lib/models → models}/Evento/tiny.js +0 -0
  308. /package/{lib/models → models}/Evento/types.d.ts +0 -0
  309. /package/{lib/models → models}/Evento/types.js +0 -0
  310. /package/{lib/models → models}/Federation/Partnership/index.d.ts +0 -0
  311. /package/{lib/models → models}/Federation/Partnership/index.js +0 -0
  312. /package/{lib/models → models}/Federation/Partnership/types.d.ts +0 -0
  313. /package/{lib/models → models}/Federation/Partnership/types.js +0 -0
  314. /package/{lib/models → models}/Federation/index.d.ts +0 -0
  315. /package/{lib/models → models}/Federation/index.js +0 -0
  316. /package/{lib/models → models}/Federation/types.d.ts +0 -0
  317. /package/{lib/models → models}/Federation/types.js +0 -0
  318. /package/{lib/models → models}/Group/Analytics/index.d.ts +0 -0
  319. /package/{lib/models → models}/Group/Analytics/index.js +0 -0
  320. /package/{lib/models → models}/Group/Analytics/types.d.ts +0 -0
  321. /package/{lib/models → models}/Group/Analytics/types.js +0 -0
  322. /package/{lib/models → models}/Group/Event/index.d.ts +0 -0
  323. /package/{lib/models → models}/Group/Event/index.js +0 -0
  324. /package/{lib/models → models}/Group/Event/types.d.ts +0 -0
  325. /package/{lib/models → models}/Group/Event/types.js +0 -0
  326. /package/{lib/models → models}/Group/Payment/index.d.ts +0 -0
  327. /package/{lib/models → models}/Group/Payment/index.js +0 -0
  328. /package/{lib/models → models}/Group/Payment/supabase.d.ts +0 -0
  329. /package/{lib/models → models}/Group/Payment/supabase.js +0 -0
  330. /package/{lib/models → models}/Group/Payment/types.d.ts +0 -0
  331. /package/{lib/models → models}/Group/Payment/types.js +0 -0
  332. /package/{lib/models → models}/Group/Player/Event/index.d.ts +0 -0
  333. /package/{lib/models → models}/Group/Player/Event/index.js +0 -0
  334. /package/{lib/models → models}/Group/Player/Event/types.d.ts +0 -0
  335. /package/{lib/models → models}/Group/Player/Event/types.js +0 -0
  336. /package/{lib/models → models}/Group/Player/Log/index.d.ts +0 -0
  337. /package/{lib/models → models}/Group/Player/Log/index.js +0 -0
  338. /package/{lib/models → models}/Group/Player/Log/types.d.ts +0 -0
  339. /package/{lib/models → models}/Group/Player/Log/types.js +0 -0
  340. /package/{lib/models → models}/Group/Player/index.d.ts +0 -0
  341. /package/{lib/models → models}/Group/Player/index.js +0 -0
  342. /package/{lib/models → models}/Group/Player/types.d.ts +0 -0
  343. /package/{lib/models → models}/Group/Player/types.js +0 -0
  344. /package/{lib/models → models}/Group/Repertory/File/Section/index.d.ts +0 -0
  345. /package/{lib/models → models}/Group/Repertory/File/Section/index.js +0 -0
  346. /package/{lib/models → models}/Group/Repertory/File/Section/types.d.ts +0 -0
  347. /package/{lib/models → models}/Group/Repertory/File/Section/types.js +0 -0
  348. /package/{lib/models → models}/Group/Repertory/File/index.d.ts +0 -0
  349. /package/{lib/models → models}/Group/Repertory/File/index.js +0 -0
  350. /package/{lib/models → models}/Group/Repertory/File/types.d.ts +0 -0
  351. /package/{lib/models → models}/Group/Repertory/File/types.js +0 -0
  352. /package/{lib/models → models}/Group/Repertory/FilePath/index.d.ts +0 -0
  353. /package/{lib/models → models}/Group/Repertory/FilePath/index.js +0 -0
  354. /package/{lib/models → models}/Group/Repertory/index.d.ts +0 -0
  355. /package/{lib/models → models}/Group/Repertory/index.js +0 -0
  356. /package/{lib/models → models}/Group/Repertory/types.d.ts +0 -0
  357. /package/{lib/models → models}/Group/Repertory/types.js +0 -0
  358. /package/{lib/models → models}/Group/StageTemplate/index.d.ts +0 -0
  359. /package/{lib/models → models}/Group/StageTemplate/index.js +0 -0
  360. /package/{lib/models → models}/Group/StageTemplate/types.d.ts +0 -0
  361. /package/{lib/models → models}/Group/StageTemplate/types.js +0 -0
  362. /package/{lib/models → models}/Group/basic.d.ts +0 -0
  363. /package/{lib/models → models}/Group/basic.js +0 -0
  364. /package/{lib/models → models}/Group/index.d.ts +0 -0
  365. /package/{lib/models → models}/Group/index.js +0 -0
  366. /package/{lib/models → models}/Group/types.d.ts +0 -0
  367. /package/{lib/models → models}/Group/types.js +0 -0
  368. /package/{lib/models → models}/Instrument/group.d.ts +0 -0
  369. /package/{lib/models → models}/Instrument/group.js +0 -0
  370. /package/{lib/models → models}/Instrument/index.d.ts +0 -0
  371. /package/{lib/models → models}/Instrument/index.js +0 -0
  372. /package/{lib/models → models}/Inventory/Item/index.d.ts +0 -0
  373. /package/{lib/models → models}/Inventory/Item/index.js +0 -0
  374. /package/{lib/models → models}/Inventory/Item/types.d.ts +0 -0
  375. /package/{lib/models → models}/Inventory/Item/types.js +0 -0
  376. /package/{lib/models → models}/Inventory/index.d.ts +0 -0
  377. /package/{lib/models → models}/Inventory/index.js +0 -0
  378. /package/{lib/models → models}/Inventory/types.d.ts +0 -0
  379. /package/{lib/models → models}/Inventory/types.js +0 -0
  380. /package/{lib/models → models}/Metrics/index.d.ts +0 -0
  381. /package/{lib/models → models}/Metrics/index.js +0 -0
  382. /package/{lib/models → models}/Metrics/types.d.ts +0 -0
  383. /package/{lib/models → models}/Metrics/types.js +0 -0
  384. /package/{lib/models → models}/Model/index.d.ts +0 -0
  385. /package/{lib/models → models}/Model/index.js +0 -0
  386. /package/{lib/models → models}/Model/lang.d.ts +0 -0
  387. /package/{lib/models → models}/Model/lang.js +0 -0
  388. /package/{lib/models → models}/MusicStyle/index.d.ts +0 -0
  389. /package/{lib/models → models}/MusicStyle/index.js +0 -0
  390. /package/{lib/models → models}/Notification/index.d.ts +0 -0
  391. /package/{lib/models → models}/Notification/index.js +0 -0
  392. /package/{lib/models → models}/Notification/types.d.ts +0 -0
  393. /package/{lib/models → models}/Notification/types.js +0 -0
  394. /package/{lib/models → models}/Offer/Applicant/index.d.ts +0 -0
  395. /package/{lib/models → models}/Offer/Applicant/index.js +0 -0
  396. /package/{lib/models → models}/Offer/Applicant/types.d.ts +0 -0
  397. /package/{lib/models → models}/Offer/Applicant/types.js +0 -0
  398. /package/{lib/models → models}/Offer/index.d.ts +0 -0
  399. /package/{lib/models → models}/Offer/index.js +0 -0
  400. /package/{lib/models → models}/Offer/types.d.ts +0 -0
  401. /package/{lib/models → models}/Offer/types.js +0 -0
  402. /package/{lib/models → models}/Partnership/Communication/index.d.ts +0 -0
  403. /package/{lib/models → models}/Partnership/Communication/index.js +0 -0
  404. /package/{lib/models → models}/Partnership/Communication/supabase.d.ts +0 -0
  405. /package/{lib/models → models}/Partnership/Communication/supabase.js +0 -0
  406. /package/{lib/models → models}/Partnership/Communication/types.d.ts +0 -0
  407. /package/{lib/models → models}/Partnership/Communication/types.js +0 -0
  408. /package/{lib/models → models}/Partnership/Group/index.d.ts +0 -0
  409. /package/{lib/models → models}/Partnership/Group/index.js +0 -0
  410. /package/{lib/models → models}/Partnership/Group/supabase.d.ts +0 -0
  411. /package/{lib/models → models}/Partnership/Group/supabase.js +0 -0
  412. /package/{lib/models → models}/Partnership/Group/types.d.ts +0 -0
  413. /package/{lib/models → models}/Partnership/Group/types.js +0 -0
  414. /package/{lib/models → models}/Partnership/Partner/index.d.ts +0 -0
  415. /package/{lib/models → models}/Partnership/Partner/index.js +0 -0
  416. /package/{lib/models → models}/Partnership/Partner/supabase.d.ts +0 -0
  417. /package/{lib/models → models}/Partnership/Partner/supabase.js +0 -0
  418. /package/{lib/models → models}/Partnership/Partner/types.d.ts +0 -0
  419. /package/{lib/models → models}/Partnership/Partner/types.js +0 -0
  420. /package/{lib/models → models}/Partnership/Payment/index.d.ts +0 -0
  421. /package/{lib/models → models}/Partnership/Payment/index.js +0 -0
  422. /package/{lib/models → models}/Partnership/Payment/supabase.d.ts +0 -0
  423. /package/{lib/models → models}/Partnership/Payment/supabase.js +0 -0
  424. /package/{lib/models → models}/Partnership/Payment/types.d.ts +0 -0
  425. /package/{lib/models → models}/Partnership/Payment/types.js +0 -0
  426. /package/{lib/models → models}/Partnership/Plan/index.d.ts +0 -0
  427. /package/{lib/models → models}/Partnership/Plan/index.js +0 -0
  428. /package/{lib/models → models}/Partnership/Plan/supabase.d.ts +0 -0
  429. /package/{lib/models → models}/Partnership/Plan/supabase.js +0 -0
  430. /package/{lib/models → models}/Partnership/Plan/types.d.ts +0 -0
  431. /package/{lib/models → models}/Partnership/Plan/types.js +0 -0
  432. /package/{lib/models → models}/Partnership/SepaPaymentGroup/index.d.ts +0 -0
  433. /package/{lib/models → models}/Partnership/SepaPaymentGroup/index.js +0 -0
  434. /package/{lib/models → models}/Partnership/SepaPaymentGroup/supabase.d.ts +0 -0
  435. /package/{lib/models → models}/Partnership/SepaPaymentGroup/supabase.js +0 -0
  436. /package/{lib/models → models}/Partnership/SepaPaymentGroup/types.d.ts +0 -0
  437. /package/{lib/models → models}/Partnership/SepaPaymentGroup/types.js +0 -0
  438. /package/{lib/models → models}/Partnership/Subscription/index.d.ts +0 -0
  439. /package/{lib/models → models}/Partnership/Subscription/index.js +0 -0
  440. /package/{lib/models → models}/Partnership/Subscription/supabase.d.ts +0 -0
  441. /package/{lib/models → models}/Partnership/Subscription/supabase.js +0 -0
  442. /package/{lib/models → models}/Partnership/Subscription/types.d.ts +0 -0
  443. /package/{lib/models → models}/Partnership/Subscription/types.js +0 -0
  444. /package/{lib/models → models}/Partnership/basic.d.ts +0 -0
  445. /package/{lib/models → models}/Partnership/basic.js +0 -0
  446. /package/{lib/models → models}/Partnership/index.d.ts +0 -0
  447. /package/{lib/models → models}/Partnership/index.js +0 -0
  448. /package/{lib/models → models}/Partnership/types.d.ts +0 -0
  449. /package/{lib/models → models}/Partnership/types.js +0 -0
  450. /package/{lib/models → models}/Player/basic.d.ts +0 -0
  451. /package/{lib/models → models}/Player/basic.js +0 -0
  452. /package/{lib/models → models}/Player/types.d.ts +0 -0
  453. /package/{lib/models → models}/Player/types.js +0 -0
  454. /package/{lib/models → models}/Repertory/basic.d.ts +0 -0
  455. /package/{lib/models → models}/Repertory/basic.js +0 -0
  456. /package/{lib/models → models}/Repertory/types.d.ts +0 -0
  457. /package/{lib/models → models}/Repertory/types.js +0 -0
  458. /package/{lib/models → models}/User/Group/index.d.ts +0 -0
  459. /package/{lib/models → models}/User/Group/index.js +0 -0
  460. /package/{lib/models → models}/User/Group/types.d.ts +0 -0
  461. /package/{lib/models → models}/User/Group/types.js +0 -0
  462. /package/{lib/models → models}/User/Notification/index.d.ts +0 -0
  463. /package/{lib/models → models}/User/Notification/index.js +0 -0
  464. /package/{lib/models → models}/User/Notification/types.d.ts +0 -0
  465. /package/{lib/models → models}/User/Notification/types.js +0 -0
  466. /package/{lib/models → models}/User/OfferAlarm/index.d.ts +0 -0
  467. /package/{lib/models → models}/User/OfferAlarm/index.js +0 -0
  468. /package/{lib/models → models}/User/OfferAlarm/types.d.ts +0 -0
  469. /package/{lib/models → models}/User/OfferAlarm/types.js +0 -0
  470. /package/{lib/models → models}/User/Partnership/index.d.ts +0 -0
  471. /package/{lib/models → models}/User/Partnership/index.js +0 -0
  472. /package/{lib/models → models}/User/Partnership/types.d.ts +0 -0
  473. /package/{lib/models → models}/User/Partnership/types.js +0 -0
  474. /package/{lib/models → models}/User/basic.d.ts +0 -0
  475. /package/{lib/models → models}/User/basic.js +0 -0
  476. /package/{lib/models → models}/User/extended.d.ts +0 -0
  477. /package/{lib/models → models}/User/extended.js +0 -0
  478. /package/{lib/models → models}/User/index.d.ts +0 -0
  479. /package/{lib/models → models}/User/index.js +0 -0
  480. /package/{lib/models → models}/User/types.d.ts +0 -0
  481. /package/{lib/models → models}/User/types.js +0 -0
  482. /package/{lib/models → models}/WebhookEvent/index.d.ts +0 -0
  483. /package/{lib/models → models}/WebhookEvent/index.js +0 -0
  484. /package/{lib/models → models}/WebhookEvent/types.d.ts +0 -0
  485. /package/{lib/models → models}/WebhookEvent/types.js +0 -0
  486. /package/{lib/types → types}/firestore.d.ts +0 -0
  487. /package/{lib/types → types}/firestore.js +0 -0
  488. /package/{lib/types → types}/messagebirdChatWidget.d.ts +0 -0
  489. /package/{lib/types → types}/messagebirdChatWidget.js +0 -0
  490. /package/{lib/types → types}/minVersion.d.ts +0 -0
  491. /package/{lib/types → types}/minVersion.js +0 -0
  492. /package/{lib/types → types}/payoutRule.d.ts +0 -0
  493. /package/{lib/types → types}/payoutRule.js +0 -0
  494. /package/{lib/types → types}/supabase/generated.d.ts +0 -0
  495. /package/{lib/types → types}/supabase/generated.js +0 -0
  496. /package/{lib/types → types}/supabase/index.d.ts +0 -0
  497. /package/{lib/types → types}/supabase/index.js +0 -0
  498. /package/{lib/types → types}/supabase/overwrites/comm.d.ts +0 -0
  499. /package/{lib/types → types}/supabase/overwrites/comm.js +0 -0
  500. /package/{lib/types → types}/supabase/overwrites/comm_history.d.ts +0 -0
  501. /package/{lib/types → types}/supabase/overwrites/comm_history.js +0 -0
  502. /package/{lib/types → types}/supabase/overwrites/event.d.ts +0 -0
  503. /package/{lib/types → types}/supabase/overwrites/event.js +0 -0
  504. /package/{lib/types → types}/supabase/overwrites/event_history.d.ts +0 -0
  505. /package/{lib/types → types}/supabase/overwrites/event_history.js +0 -0
  506. /package/{lib/types → types}/supabase/overwrites/group.d.ts +0 -0
  507. /package/{lib/types → types}/supabase/overwrites/group.js +0 -0
  508. /package/{lib/types → types}/supabase/overwrites/group_history.d.ts +0 -0
  509. /package/{lib/types → types}/supabase/overwrites/group_history.js +0 -0
  510. /package/{lib/types → types}/supabase/overwrites/index.d.ts +0 -0
  511. /package/{lib/types → types}/supabase/overwrites/index.js +0 -0
  512. /package/{lib/types → types}/supabase/overwrites/offer.d.ts +0 -0
  513. /package/{lib/types → types}/supabase/overwrites/offer.js +0 -0
  514. /package/{lib/types → types}/supabase/overwrites/offer_history.d.ts +0 -0
  515. /package/{lib/types → types}/supabase/overwrites/offer_history.js +0 -0
  516. /package/{lib/types → types}/supabase/overwrites/repertoire.d.ts +0 -0
  517. /package/{lib/types → types}/supabase/overwrites/repertoire.js +0 -0
  518. /package/{lib/types → types}/supabase/overwrites/repertoire_history.d.ts +0 -0
  519. /package/{lib/types → types}/supabase/overwrites/repertoire_history.js +0 -0
  520. /package/{lib/types → types}/supabase/overwrites/utils.d.ts +0 -0
  521. /package/{lib/types → types}/supabase/overwrites/utils.js +0 -0
@@ -1,403 +0,0 @@
1
- ALTER TABLE "public"."calendar_feed"
2
- ADD COLUMN "include_pending" BOOLEAN NOT NULL DEFAULT true;
3
-
4
- CREATE OR REPLACE FUNCTION "private"."updateEventCalendarRevision"()
5
- RETURNS trigger
6
- LANGUAGE plpgsql
7
- SECURITY INVOKER
8
- SET search_path = ''
9
- AS $$
10
- BEGIN
11
- IF ROW(
12
- NEW."promoter",
13
- NEW."displayName",
14
- NEW."datetime",
15
- NEW."datetimeEnd",
16
- NEW."description",
17
- NEW."locality",
18
- NEW."online",
19
- NEW."timezone",
20
- NEW."selectionMode",
21
- NEW."shortDynamicLink",
22
- NEW."deletedAt",
23
- NEW."players"
24
- ) IS DISTINCT FROM ROW(
25
- OLD."promoter",
26
- OLD."displayName",
27
- OLD."datetime",
28
- OLD."datetimeEnd",
29
- OLD."description",
30
- OLD."locality",
31
- OLD."online",
32
- OLD."timezone",
33
- OLD."selectionMode",
34
- OLD."shortDynamicLink",
35
- OLD."deletedAt",
36
- OLD."players"
37
- ) THEN
38
- -- Only a state this feed previously published can create a cancellation.
39
- -- Pending invitations are published by default, so a direct decline now
40
- -- becomes a tombstone. Feeds that hide pending invitations do not receive
41
- -- a cancellation for an invitation they never saw.
42
- INSERT INTO "public"."calendar_event_cancellation" (
43
- "user_id",
44
- "event_id",
45
- "starts_at",
46
- "ends_at",
47
- "event_type",
48
- "display_name",
49
- "group_name",
50
- "latitude",
51
- "longitude",
52
- "description",
53
- "location",
54
- "timezone",
55
- "last_modified",
56
- "sequence",
57
- "url",
58
- "cancelled_at",
59
- "expires_at"
60
- )
61
- SELECT
62
- feed."user_id",
63
- OLD."id",
64
- OLD."datetime",
65
- OLD."datetimeEnd",
66
- OLD."type"::TEXT,
67
- NULLIF(OLD."displayName", ''),
68
- event_group."displayName",
69
- CASE
70
- WHEN "extensions"."st_x"(OLD."location"::"extensions"."geometry") <> 0
71
- OR "extensions"."st_y"(OLD."location"::"extensions"."geometry") <> 0
72
- THEN "extensions"."st_x"(OLD."location"::"extensions"."geometry")
73
- ELSE NULL
74
- END,
75
- CASE
76
- WHEN "extensions"."st_x"(OLD."location"::"extensions"."geometry") <> 0
77
- OR "extensions"."st_y"(OLD."location"::"extensions"."geometry") <> 0
78
- THEN "extensions"."st_y"(OLD."location"::"extensions"."geometry")
79
- ELSE NULL
80
- END,
81
- OLD."description",
82
- NULLIF(OLD."locality", ''),
83
- OLD."timezone",
84
- now(),
85
- OLD."calendarSequence" + 1,
86
- CASE
87
- WHEN OLD."shortDynamicLink" ~ '^https://(app(-dev)?\.glissandoo\.com|glissandoo\.com|dev\.glissandoo\.com|glissandoo\.page\.link)/'
88
- THEN OLD."shortDynamicLink"
89
- ELSE NULL
90
- END,
91
- now(),
92
- now() + INTERVAL '90 days'
93
- FROM unnest(OLD."playerIds") AS invited("user_id")
94
- JOIN "public"."calendar_feed" AS feed
95
- ON feed."user_id" = invited."user_id"
96
- AND feed."enabled"
97
- AND feed."revoked_at" IS NULL
98
- JOIN "public"."group" AS event_group
99
- ON event_group."id" = OLD."promoter"
100
- WHERE
101
- OLD."datetimeEnd" >= now() - INTERVAL '30 days'
102
- AND OLD."datetime" <= now() + INTERVAL '18 months'
103
- AND (
104
- COALESCE((OLD."players" -> feed."user_id" ->> 'isGuest')::BOOLEAN, false)
105
- OR EXISTS (
106
- SELECT 1
107
- FROM "public"."userGroup" AS old_membership
108
- WHERE old_membership."userId" = feed."user_id"
109
- AND old_membership."groupId" = OLD."promoter"
110
- )
111
- )
112
- AND (
113
- CASE "private"."calendarPlayerState"(
114
- OLD."players" -> feed."user_id",
115
- OLD."selectionMode"::TEXT
116
- )
117
- WHEN 'accepted' THEN true
118
- WHEN 'tentative' THEN feed."include_tentative"
119
- WHEN 'unanswered' THEN feed."include_pending"
120
- ELSE false
121
- END
122
- OR (
123
- OLD."players" -> feed."user_id" -> 'selected'
124
- IS DISTINCT FROM 'false'::JSONB
125
- AND NEW."players" -> feed."user_id" -> 'selected' = 'false'::JSONB
126
- )
127
- )
128
- AND (
129
- NEW."deletedAt" IS NOT NULL
130
- OR NEW."datetimeEnd" < now() - INTERVAL '30 days'
131
- OR NEW."datetime" > now() + INTERVAL '18 months'
132
- OR NOT (
133
- CASE "private"."calendarPlayerState"(
134
- NEW."players" -> feed."user_id",
135
- NEW."selectionMode"::TEXT
136
- )
137
- WHEN 'accepted' THEN true
138
- WHEN 'tentative' THEN feed."include_tentative"
139
- WHEN 'unanswered' THEN feed."include_pending"
140
- ELSE false
141
- END
142
- AND (
143
- COALESCE(
144
- (NEW."players" -> feed."user_id" ->> 'isGuest')::BOOLEAN,
145
- false
146
- )
147
- OR EXISTS (
148
- SELECT 1
149
- FROM "public"."userGroup" AS new_membership
150
- WHERE new_membership."userId" = feed."user_id"
151
- AND new_membership."groupId" = NEW."promoter"
152
- )
153
- )
154
- )
155
- )
156
- ON CONFLICT ("user_id", "event_id") DO UPDATE SET
157
- "starts_at" = EXCLUDED."starts_at",
158
- "ends_at" = EXCLUDED."ends_at",
159
- "event_type" = EXCLUDED."event_type",
160
- "display_name" = EXCLUDED."display_name",
161
- "group_name" = EXCLUDED."group_name",
162
- "latitude" = EXCLUDED."latitude",
163
- "longitude" = EXCLUDED."longitude",
164
- "description" = EXCLUDED."description",
165
- "location" = EXCLUDED."location",
166
- "timezone" = EXCLUDED."timezone",
167
- "last_modified" = EXCLUDED."last_modified",
168
- "sequence" = GREATEST(
169
- "calendar_event_cancellation"."sequence" + 1,
170
- EXCLUDED."sequence"
171
- ),
172
- "url" = EXCLUDED."url",
173
- "cancelled_at" = EXCLUDED."cancelled_at",
174
- "expires_at" = EXCLUDED."expires_at";
175
-
176
- NEW."calendarSequence" := GREATEST(
177
- OLD."calendarSequence" + 1,
178
- NEW."calendarSequence"
179
- );
180
- ELSE
181
- NEW."calendarSequence" := GREATEST(
182
- OLD."calendarSequence",
183
- NEW."calendarSequence"
184
- );
185
- END IF;
186
-
187
- RETURN NEW;
188
- END;
189
- $$;
190
-
191
- REVOKE ALL ON FUNCTION "private"."updateEventCalendarRevision"()
192
- FROM PUBLIC, "anon", "authenticated";
193
- GRANT EXECUTE ON FUNCTION "private"."updateEventCalendarRevision"() TO "service_role";
194
-
195
- DROP FUNCTION "public"."resolveCalendarFeed"(TEXT);
196
-
197
- CREATE FUNCTION "public"."resolveCalendarFeed"("p_token_hash" TEXT)
198
- RETURNS TABLE (
199
- "userId" TEXT,
200
- "includeTentative" BOOLEAN,
201
- "includePending" BOOLEAN
202
- )
203
- LANGUAGE sql
204
- STABLE
205
- SECURITY INVOKER
206
- SET search_path = ''
207
- AS $$
208
- SELECT
209
- feed."user_id",
210
- feed."include_tentative",
211
- feed."include_pending"
212
- FROM "public"."calendar_feed" AS feed
213
- JOIN "public"."user" AS app_user ON app_user."userId" = feed."user_id"
214
- WHERE feed."token_hash" = "p_token_hash"
215
- AND feed."enabled"
216
- AND feed."revoked_at" IS NULL
217
- AND app_user."deletedAt" IS NULL
218
- LIMIT 1;
219
- $$;
220
-
221
- REVOKE ALL ON FUNCTION "public"."resolveCalendarFeed"(TEXT)
222
- FROM PUBLIC, "anon", "authenticated";
223
- GRANT EXECUTE ON FUNCTION "public"."resolveCalendarFeed"(TEXT) TO "service_role";
224
-
225
- DROP FUNCTION "public"."getCalendarFeedEvents"(TEXT, BOOLEAN, TIMESTAMPTZ, TIMESTAMPTZ);
226
-
227
- CREATE FUNCTION "public"."getCalendarFeedEvents"(
228
- "p_user_id" TEXT,
229
- "p_include_tentative" BOOLEAN,
230
- "p_include_pending" BOOLEAN,
231
- "p_range_start" TIMESTAMPTZ,
232
- "p_range_end" TIMESTAMPTZ
233
- )
234
- RETURNS TABLE (
235
- "eventId" TEXT,
236
- "startsAt" TIMESTAMPTZ,
237
- "endsAt" TIMESTAMPTZ,
238
- "allDay" BOOLEAN,
239
- "summary" TEXT,
240
- "eventType" TEXT,
241
- "groupName" TEXT,
242
- "language" TEXT,
243
- "description" TEXT,
244
- "location" TEXT,
245
- "latitude" DOUBLE PRECISION,
246
- "longitude" DOUBLE PRECISION,
247
- "timezone" TEXT,
248
- "lastModified" TIMESTAMPTZ,
249
- "sequence" BIGINT,
250
- "status" TEXT,
251
- "participationStatus" TEXT,
252
- "url" TEXT
253
- )
254
- LANGUAGE sql
255
- STABLE
256
- SECURITY INVOKER
257
- SET search_path = ''
258
- AS $$
259
- WITH current_events AS (
260
- SELECT
261
- e."id" AS "eventId",
262
- e."datetime" AS "startsAt",
263
- e."datetimeEnd" AS "endsAt",
264
- false AS "allDay",
265
- COALESCE(NULLIF(e."displayName", ''), '') AS "summary",
266
- e."type"::TEXT AS "eventType",
267
- g."displayName" AS "groupName",
268
- feed_user."language" AS "language",
269
- e."description" AS "description",
270
- NULLIF(e."locality", '') AS "location",
271
- CASE
272
- WHEN "extensions"."st_x"(e."location"::"extensions"."geometry") <> 0
273
- OR "extensions"."st_y"(e."location"::"extensions"."geometry") <> 0
274
- THEN "extensions"."st_x"(e."location"::"extensions"."geometry")
275
- ELSE NULL
276
- END AS "latitude",
277
- CASE
278
- WHEN "extensions"."st_x"(e."location"::"extensions"."geometry") <> 0
279
- OR "extensions"."st_y"(e."location"::"extensions"."geometry") <> 0
280
- THEN "extensions"."st_y"(e."location"::"extensions"."geometry")
281
- ELSE NULL
282
- END AS "longitude",
283
- e."timezone" AS "timezone",
284
- GREATEST(e."updatedAt", feed."updated_at") AS "lastModified",
285
- e."calendarSequence" + feed."content_revision" AS "sequence",
286
- "private"."calendarPlayerState"(
287
- e."players" -> "p_user_id",
288
- e."selectionMode"::TEXT
289
- ) AS "playerState",
290
- CASE
291
- WHEN e."shortDynamicLink" ~ '^https://(app(-dev)?\.glissandoo\.com|glissandoo\.com|dev\.glissandoo\.com|glissandoo\.page\.link)/'
292
- THEN e."shortDynamicLink"
293
- ELSE NULL
294
- END AS "url"
295
- FROM "public"."event" AS e
296
- JOIN "public"."group" AS g ON g."id" = e."promoter"
297
- JOIN "public"."user" AS feed_user ON feed_user."userId" = "p_user_id"
298
- JOIN "public"."calendar_feed" AS feed ON feed."user_id" = "p_user_id"
299
- WHERE e."deletedAt" IS NULL
300
- AND g."deletedAt" IS NULL
301
- AND feed_user."deletedAt" IS NULL
302
- AND e."datetimeEnd" >= "p_range_start"
303
- AND e."datetime" <= "p_range_end"
304
- AND e."players" ? "p_user_id"
305
- AND (
306
- COALESCE((e."players" -> "p_user_id" ->> 'isGuest')::BOOLEAN, false)
307
- OR EXISTS (
308
- SELECT 1
309
- FROM "public"."userGroup" AS membership
310
- WHERE membership."userId" = "p_user_id"
311
- AND membership."groupId" = e."promoter"
312
- )
313
- )
314
- ),
315
- visible_events AS (
316
- SELECT *
317
- FROM current_events
318
- WHERE CASE "playerState"
319
- WHEN 'accepted' THEN true
320
- WHEN 'tentative' THEN "p_include_tentative"
321
- WHEN 'unanswered' THEN "p_include_pending"
322
- ELSE false
323
- END
324
- )
325
- SELECT
326
- visible."eventId",
327
- visible."startsAt",
328
- visible."endsAt",
329
- visible."allDay",
330
- visible."summary",
331
- visible."eventType",
332
- visible."groupName",
333
- visible."language",
334
- visible."description",
335
- visible."location",
336
- visible."latitude",
337
- visible."longitude",
338
- visible."timezone",
339
- visible."lastModified",
340
- visible."sequence",
341
- CASE
342
- WHEN visible."playerState" = 'accepted' THEN 'CONFIRMED'
343
- ELSE 'TENTATIVE'
344
- END AS "status",
345
- CASE visible."playerState"
346
- WHEN 'accepted' THEN 'ACCEPTED'
347
- WHEN 'tentative' THEN 'TENTATIVE'
348
- ELSE 'NEEDS-ACTION'
349
- END AS "participationStatus",
350
- visible."url"
351
- FROM visible_events AS visible
352
-
353
- UNION ALL
354
-
355
- SELECT
356
- cancelled."event_id",
357
- cancelled."starts_at",
358
- cancelled."ends_at",
359
- cancelled."all_day",
360
- COALESCE(cancelled."display_name", ''),
361
- cancelled."event_type",
362
- cancelled."group_name",
363
- feed_user."language",
364
- cancelled."description",
365
- cancelled."location",
366
- cancelled."latitude",
367
- cancelled."longitude",
368
- cancelled."timezone",
369
- GREATEST(cancelled."last_modified", feed."updated_at"),
370
- cancelled."sequence" + feed."content_revision",
371
- 'CANCELLED',
372
- NULL,
373
- cancelled."url"
374
- FROM "public"."calendar_event_cancellation" AS cancelled
375
- JOIN "public"."calendar_feed" AS feed
376
- ON feed."user_id" = cancelled."user_id"
377
- JOIN "public"."user" AS feed_user
378
- ON feed_user."userId" = cancelled."user_id"
379
- WHERE cancelled."user_id" = "p_user_id"
380
- AND cancelled."expires_at" > now()
381
- AND cancelled."ends_at" >= "p_range_start"
382
- AND cancelled."starts_at" <= "p_range_end"
383
- AND NOT EXISTS (
384
- SELECT 1
385
- FROM visible_events AS visible
386
- WHERE visible."eventId" = cancelled."event_id"
387
- );
388
- $$;
389
-
390
- REVOKE ALL ON FUNCTION "public"."getCalendarFeedEvents"(
391
- TEXT,
392
- BOOLEAN,
393
- BOOLEAN,
394
- TIMESTAMPTZ,
395
- TIMESTAMPTZ
396
- ) FROM PUBLIC, "anon", "authenticated";
397
- GRANT EXECUTE ON FUNCTION "public"."getCalendarFeedEvents"(
398
- TEXT,
399
- BOOLEAN,
400
- BOOLEAN,
401
- TIMESTAMPTZ,
402
- TIMESTAMPTZ
403
- ) TO "service_role";
@@ -1,64 +0,0 @@
1
- CREATE FUNCTION "public"."backfillEventDatetimeEnds"(
2
- "p_events" JSONB,
3
- "p_apply" BOOLEAN DEFAULT false
4
- )
5
- RETURNS TABLE (
6
- "matched" BIGINT,
7
- "mismatched" BIGINT,
8
- "changed" BIGINT
9
- )
10
- LANGUAGE plpgsql
11
- SECURITY INVOKER
12
- SET search_path = ''
13
- AS $$
14
- BEGIN
15
- IF jsonb_typeof("p_events") IS DISTINCT FROM 'array' THEN
16
- RAISE EXCEPTION 'p_events must be a JSON array';
17
- END IF;
18
-
19
- IF jsonb_array_length("p_events") > 500 THEN
20
- RAISE EXCEPTION 'p_events cannot contain more than 500 events';
21
- END IF;
22
-
23
- RETURN QUERY
24
- WITH payload AS MATERIALIZED (
25
- SELECT DISTINCT ON (item ->> 'id')
26
- item ->> 'id' AS "id",
27
- (item ->> 'datetimeEnd')::TIMESTAMPTZ AS "datetime_end"
28
- FROM jsonb_array_elements("p_events") AS input(item)
29
- WHERE jsonb_typeof(item) = 'object'
30
- AND NULLIF(item ->> 'id', '') IS NOT NULL
31
- AND NULLIF(item ->> 'datetimeEnd', '') IS NOT NULL
32
- ORDER BY item ->> 'id'
33
- ),
34
- candidates AS MATERIALIZED (
35
- SELECT
36
- e."id",
37
- e."datetimeEnd" AS "current_end",
38
- payload."datetime_end" AS "authoritative_end"
39
- FROM "public"."event" AS e
40
- JOIN payload ON payload."id" = e."id"
41
- ),
42
- updated AS (
43
- UPDATE "public"."event" AS e
44
- SET "datetimeEnd" = candidates."authoritative_end"
45
- FROM candidates
46
- WHERE "p_apply"
47
- AND candidates."id" = e."id"
48
- AND candidates."current_end" IS DISTINCT FROM candidates."authoritative_end"
49
- RETURNING e."id"
50
- )
51
- SELECT
52
- count(*)::BIGINT AS "matched",
53
- count(*) FILTER (
54
- WHERE candidates."current_end" IS DISTINCT FROM candidates."authoritative_end"
55
- )::BIGINT AS "mismatched",
56
- (SELECT count(*)::BIGINT FROM updated) AS "changed"
57
- FROM candidates;
58
- END;
59
- $$;
60
-
61
- REVOKE ALL ON FUNCTION "public"."backfillEventDatetimeEnds"(JSONB, BOOLEAN)
62
- FROM PUBLIC, "anon", "authenticated";
63
- GRANT EXECUTE ON FUNCTION "public"."backfillEventDatetimeEnds"(JSONB, BOOLEAN)
64
- TO "service_role";
@@ -1,19 +0,0 @@
1
- -- Calendar cancellations are captured from the mirrored event row itself.
2
- -- Keeping a second trigger on event_history made the feed depend on a schema
3
- -- that was introduced alongside Composers and could publish the same decline
4
- -- twice in different transaction orderings.
5
- DO $$
6
- BEGIN
7
- IF to_regclass('public.event_history') IS NOT NULL THEN
8
- DROP TRIGGER IF EXISTS "event_history__capture_calendar_decline"
9
- ON "public"."event_history";
10
- END IF;
11
- END;
12
- $$;
13
-
14
- DROP FUNCTION IF EXISTS "private"."captureCalendarDeclineFromHistory"();
15
- DROP FUNCTION IF EXISTS "private"."upsertCalendarDeclineCancellation"(
16
- TEXT,
17
- TEXT,
18
- TIMESTAMPTZ
19
- );
@@ -1,135 +0,0 @@
1
- -- These shared mirror/history tables were created directly in the production
2
- -- database before their schema was represented by repository migrations.
3
- -- Keep this migration idempotent so it can also be applied to dev, where the
4
- -- same objects already exist through the Composer migration series.
5
-
6
- CREATE SEQUENCE IF NOT EXISTS "public"."event_history_id_seq";
7
-
8
- CREATE TABLE IF NOT EXISTS "public"."comm" (
9
- "id" TEXT PRIMARY KEY,
10
- "group_id" TEXT NOT NULL,
11
- "owner_id" TEXT NOT NULL,
12
- "title" TEXT NOT NULL,
13
- "type" TEXT NOT NULL,
14
- "comments_count" BIGINT NOT NULL DEFAULT 0,
15
- "block_answers" BOOLEAN NOT NULL DEFAULT false,
16
- "template_id" TEXT,
17
- "server_template" TEXT,
18
- "server" BOOLEAN NOT NULL,
19
- "recipients" TEXT[] NOT NULL,
20
- "deleted_at" TIMESTAMP,
21
- "deleted_by" TEXT,
22
- "edited_at" TIMESTAMP,
23
- "edited_by" TEXT,
24
- "created_at" TIMESTAMPTZ NOT NULL DEFAULT now()
25
- );
26
-
27
- CREATE TABLE IF NOT EXISTS "public"."event_history" (
28
- "event_id" TEXT NOT NULL,
29
- "group_id" TEXT NOT NULL,
30
- "user_id" TEXT NOT NULL,
31
- "value" JSONB,
32
- "prev_value" JSONB,
33
- "created_at" TIMESTAMPTZ NOT NULL,
34
- "id" INTEGER PRIMARY KEY DEFAULT nextval('"public"."event_history_id_seq"'::regclass),
35
- "action" TEXT NOT NULL
36
- );
37
-
38
- ALTER SEQUENCE "public"."event_history_id_seq"
39
- OWNED BY "public"."event_history"."id";
40
-
41
- CREATE TABLE IF NOT EXISTS "public"."comm_history" (
42
- "comm_id" TEXT NOT NULL,
43
- "group_id" TEXT NOT NULL,
44
- "user_id" TEXT NOT NULL,
45
- "value" JSONB,
46
- "prev_value" JSONB,
47
- "created_at" TIMESTAMPTZ NOT NULL,
48
- "id" INTEGER PRIMARY KEY DEFAULT nextval('"public"."event_history_id_seq"'::regclass),
49
- "action" TEXT NOT NULL
50
- );
51
-
52
- CREATE TABLE IF NOT EXISTS "public"."group_history" (
53
- "group_id" TEXT NOT NULL,
54
- "user_id" TEXT NOT NULL,
55
- "value" JSONB,
56
- "prev_value" JSONB,
57
- "created_at" TIMESTAMPTZ NOT NULL,
58
- "id" INTEGER PRIMARY KEY DEFAULT nextval('"public"."event_history_id_seq"'::regclass),
59
- "action" TEXT NOT NULL
60
- );
61
-
62
- CREATE TABLE IF NOT EXISTS "public"."offer_history" (
63
- "offer_id" TEXT NOT NULL,
64
- "group_id" TEXT NOT NULL,
65
- "user_id" TEXT NOT NULL,
66
- "value" JSONB,
67
- "prev_value" JSONB,
68
- "created_at" TIMESTAMPTZ NOT NULL,
69
- "id" INTEGER PRIMARY KEY DEFAULT nextval('"public"."event_history_id_seq"'::regclass),
70
- "action" TEXT NOT NULL
71
- );
72
-
73
- CREATE TABLE IF NOT EXISTS "public"."repertoire" (
74
- "id" TEXT PRIMARY KEY,
75
- "created_at" TIMESTAMPTZ NOT NULL DEFAULT now(),
76
- "group_id" TEXT NOT NULL,
77
- "title" TEXT NOT NULL,
78
- "compositor" TEXT,
79
- "tags" TEXT[] NOT NULL,
80
- "events" TEXT[] NOT NULL,
81
- "owner_id" TEXT NOT NULL,
82
- "visibility" TEXT NOT NULL,
83
- "last_event_datetime" TIMESTAMP
84
- );
85
-
86
- CREATE TABLE IF NOT EXISTS "public"."repertoire_history" (
87
- "theme_id" TEXT NOT NULL,
88
- "group_id" TEXT NOT NULL,
89
- "user_id" TEXT NOT NULL,
90
- "value" JSONB,
91
- "prev_value" JSONB,
92
- "created_at" TIMESTAMPTZ NOT NULL,
93
- "id" INTEGER PRIMARY KEY DEFAULT nextval('"public"."event_history_id_seq"'::regclass),
94
- "action" TEXT NOT NULL
95
- );
96
-
97
- ALTER TABLE "public"."comm" ENABLE ROW LEVEL SECURITY;
98
- ALTER TABLE "public"."comm_history" ENABLE ROW LEVEL SECURITY;
99
- ALTER TABLE "public"."event_history" ENABLE ROW LEVEL SECURITY;
100
- ALTER TABLE "public"."group_history" ENABLE ROW LEVEL SECURITY;
101
- ALTER TABLE "public"."offer_history" ENABLE ROW LEVEL SECURITY;
102
- ALTER TABLE "public"."repertoire" ENABLE ROW LEVEL SECURITY;
103
- ALTER TABLE "public"."repertoire_history" ENABLE ROW LEVEL SECURITY;
104
-
105
- GRANT ALL ON TABLE "public"."comm" TO "service_role";
106
- GRANT ALL ON TABLE "public"."comm_history" TO "service_role";
107
- GRANT ALL ON TABLE "public"."event_history" TO "service_role";
108
- GRANT ALL ON TABLE "public"."group_history" TO "service_role";
109
- GRANT ALL ON TABLE "public"."offer_history" TO "service_role";
110
- GRANT ALL ON TABLE "public"."repertoire" TO "service_role";
111
- GRANT ALL ON TABLE "public"."repertoire_history" TO "service_role";
112
- GRANT USAGE, SELECT ON SEQUENCE "public"."event_history_id_seq" TO "service_role";
113
-
114
- CREATE INDEX IF NOT EXISTS "idx_event_history_event_created"
115
- ON "public"."event_history" ("event_id", "created_at" DESC);
116
- CREATE INDEX IF NOT EXISTS "idx_event_history_user_created"
117
- ON "public"."event_history" ("user_id", "created_at" DESC);
118
- CREATE INDEX IF NOT EXISTS "idx_repertoire_history_theme_created"
119
- ON "public"."repertoire_history" ("theme_id", "created_at" DESC);
120
- CREATE INDEX IF NOT EXISTS "idx_repertoire_history_user_created"
121
- ON "public"."repertoire_history" ("user_id", "created_at" DESC);
122
-
123
- ALTER TYPE "public"."event_type" ADD VALUE IF NOT EXISTS 'other';
124
- ALTER TABLE "public"."event" ALTER COLUMN "createdOn" DROP NOT NULL;
125
-
126
- CREATE OR REPLACE FUNCTION "public"."immutable_unaccent"(TEXT)
127
- RETURNS TEXT
128
- LANGUAGE sql
129
- IMMUTABLE
130
- PARALLEL SAFE
131
- STRICT
132
- SET search_path = ''
133
- AS $$
134
- SELECT "public"."unaccent"('public.unaccent', $1);
135
- $$;
@@ -1,9 +0,0 @@
1
- -- Store an encrypted copy of the feed token so the subscription URL can be
2
- -- shown again from getStatus (recoverable), instead of being a one-time secret.
3
- -- The public feed endpoint keeps validating by "token_hash"; this column is
4
- -- only read by the service-role Functions layer, which decrypts it in the app
5
- -- layer (AES-256-GCM, key held in the CALENDAR_FEED_KEY env var / .env). The
6
- -- database never sees the plaintext token or the key, so a database leak still
7
- -- cannot rebuild anyone's feed URL.
8
- ALTER TABLE "public"."calendar_feed"
9
- ADD COLUMN IF NOT EXISTS "token_cipher" TEXT;