@glissandoo/lib 1.123.1 → 1.123.2
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.
- package/.firebaserc +7 -0
- package/.husky/pre-commit +4 -0
- package/README.md +70 -0
- package/{models → lib/models}/User/index.d.ts +7 -1
- package/{models → lib/models}/User/index.js +9 -0
- package/{models → lib/models}/User/types.d.ts +6 -0
- package/{models → lib/models}/User/types.js +5 -1
- package/package.json +1 -1
- package/scripts/setHusky.js +11 -0
- package/supabase/.dev.env +1 -0
- package/supabase/.prod.env +1 -0
- package/supabase/.sample.env +2 -0
- package/supabase/README.md +126 -0
- package/supabase/config.toml +68 -0
- package/supabase/migrations/20231117044943_remote_schema.sql +228 -0
- package/supabase/migrations/20231117124947_event_selection_mode_closed_at_nullable.sql +1 -0
- package/supabase/migrations/20231121002132_remote_schema.sql +31 -0
- package/supabase/migrations/20231121004031_references_nullable.sql +3 -0
- package/supabase/migrations/20231121014339_updated_at_trigger.sql +13 -0
- package/supabase/migrations/20231122111241_remote_schema.sql +25 -0
- package/supabase/migrations/20231124151424_snake_case_to_camel_case.sql +105 -0
- package/supabase/migrations/20231129133721_add_columns_for_sites.sql +11 -0
- package/supabase/migrations/20231129142806_promoter_can_be_null.sql +3 -0
- package/supabase/migrations/20231130125327_group_location_latlon.sql +3 -0
- package/supabase/migrations/20231130150154_error_solvings.sql +9 -0
- package/supabase/migrations/20240405115914_new_columns.sql +9 -0
- package/supabase/migrations/20240405121956_init_offer.sql +81 -0
- package/supabase/migrations/20240503032440_add_columns_to_offer.sql +11 -0
- package/supabase/migrations/20240503101641_add_column_createdOn.sql +19 -0
- package/supabase/migrations/20240506035104_add_groupInfo_to_offer.sql +10 -0
- package/supabase/migrations/20240510110328_add_relationships_to_offer.sql +9 -0
- package/supabase/migrations/20240514100316_offers_public.sql +9 -0
- package/supabase/migrations/20260506013030_add_user_mirror.sql +50 -0
- package/supabase/migrations/20260506013031_add_user_group_mirror.sql +31 -0
- package/supabase/migrations/20260529000000_init_group_payment.sql +79 -0
- package/supabase/migrations/20260529120000_group_payment_realtime.sql +19 -0
- package/supabase/migrations/20260529130000_group_payment_anon_read.sql +16 -0
- package/supabase/migrations/20260601000000_group_payment_concept_norm.sql +20 -0
- package/supabase/migrations/20260605000000_init_partnership_domain.sql +333 -0
- package/supabase/migrations/20260605000100_partnership_recurring_rpc.sql +62 -0
- package/supabase/migrations/20260606000000_partnership_payer.sql +83 -0
- package/supabase/migrations/20260607000000_partnership_partner_number_not_unique.sql +10 -0
- package/supabase/migrations/20260608000000_partnership_payment_method_bizum.sql +2 -0
- package/supabase/migrations/20260609000000_partnership_payment_sepa_end_to_end.sql +13 -0
- package/supabase/migrations/20260617000000_partnership_portal_query_indexes.sql +23 -0
- package/supabase/migrations/20260618000000_partnership_communication_attachments.sql +5 -0
- package/supabase/migrations/20260701000000_partnership_recurring_rpc_drop_ambiguous.sql +29 -0
- package/supabase/migrations/20260713191700_add_personal_calendar_feed.sql +506 -0
- package/supabase/migrations/20260714193734_add_pending_calendar_invitations.sql +403 -0
- package/supabase/migrations/20260714205623_add_event_datetime_end_backfill.sql +64 -0
- package/supabase/migrations/20260729161126_remove_calendar_event_history_dependency.sql +19 -0
- package/supabase/migrations/20260729161202_reconcile_production_remote_schema.sql +135 -0
- package/supabase/migrations/20260804120000_add_calendar_feed_token_cipher.sql +9 -0
- package/supabase/migrations/20260805120000_replace_usergroup_with_group_playerids.sql +363 -0
- package/supabase/seed.sql +2973 -0
- package/types/firestore.ts +0 -1998
- package/types/messagebirdChatWidget.ts +0 -20
- package/types/minVersion.ts +0 -4
- package/types/payoutRule.ts +0 -132
- package/types/supabase/generated.ts +0 -1682
- package/types/supabase/index.ts +0 -36
- package/types/supabase/overwrites/comm.ts +0 -18
- package/types/supabase/overwrites/comm_history.ts +0 -10
- package/types/supabase/overwrites/event.ts +0 -28
- package/types/supabase/overwrites/event_history.ts +0 -10
- package/types/supabase/overwrites/group.ts +0 -49
- package/types/supabase/overwrites/group_history.ts +0 -9
- package/types/supabase/overwrites/index.ts +0 -7
- package/types/supabase/overwrites/offer.ts +0 -15
- package/types/supabase/overwrites/offer_history.ts +0 -10
- package/types/supabase/overwrites/repertoire.ts +0 -12
- package/types/supabase/overwrites/repertoire_history.ts +0 -10
- package/types/supabase/overwrites/utils.ts +0 -4
- /package/{functions → lib/functions}/auth.d.ts +0 -0
- /package/{functions → lib/functions}/auth.js +0 -0
- /package/{functions → lib/functions}/calendarFeed.d.ts +0 -0
- /package/{functions → lib/functions}/calendarFeed.js +0 -0
- /package/{functions → lib/functions}/communication.d.ts +0 -0
- /package/{functions → lib/functions}/communication.js +0 -0
- /package/{functions → lib/functions}/communicationComment.d.ts +0 -0
- /package/{functions → lib/functions}/communicationComment.js +0 -0
- /package/{functions → lib/functions}/customer.d.ts +0 -0
- /package/{functions → lib/functions}/customer.js +0 -0
- /package/{functions → lib/functions}/customerGroup.d.ts +0 -0
- /package/{functions → lib/functions}/customerGroup.js +0 -0
- /package/{functions → lib/functions}/event.d.ts +0 -0
- /package/{functions → lib/functions}/event.js +0 -0
- /package/{functions → lib/functions}/eventPlayer.d.ts +0 -0
- /package/{functions → lib/functions}/eventPlayer.js +0 -0
- /package/{functions → lib/functions}/eventRepertory.d.ts +0 -0
- /package/{functions → lib/functions}/eventRepertory.js +0 -0
- /package/{functions → lib/functions}/eventoPayout.d.ts +0 -0
- /package/{functions → lib/functions}/eventoPayout.js +0 -0
- /package/{functions → lib/functions}/federation.d.ts +0 -0
- /package/{functions → lib/functions}/federation.js +0 -0
- /package/{functions → lib/functions}/federationPartnership.d.ts +0 -0
- /package/{functions → lib/functions}/federationPartnership.js +0 -0
- /package/{functions → lib/functions}/group.d.ts +0 -0
- /package/{functions → lib/functions}/group.js +0 -0
- /package/{functions → lib/functions}/groupEventStage.d.ts +0 -0
- /package/{functions → lib/functions}/groupEventStage.js +0 -0
- /package/{functions → lib/functions}/groupModule.d.ts +0 -0
- /package/{functions → lib/functions}/groupModule.js +0 -0
- /package/{functions → lib/functions}/groupPayment.d.ts +0 -0
- /package/{functions → lib/functions}/groupPayment.js +0 -0
- /package/{functions → lib/functions}/groupPayoutRule.d.ts +0 -0
- /package/{functions → lib/functions}/groupPayoutRule.js +0 -0
- /package/{functions → lib/functions}/groupPlayer.d.ts +0 -0
- /package/{functions → lib/functions}/groupPlayer.js +0 -0
- /package/{functions → lib/functions}/groupRepertory.d.ts +0 -0
- /package/{functions → lib/functions}/groupRepertory.js +0 -0
- /package/{functions → lib/functions}/index.d.ts +0 -0
- /package/{functions → lib/functions}/index.js +0 -0
- /package/{functions → lib/functions}/inventory.d.ts +0 -0
- /package/{functions → lib/functions}/inventory.js +0 -0
- /package/{functions → lib/functions}/inventoryItem.d.ts +0 -0
- /package/{functions → lib/functions}/inventoryItem.js +0 -0
- /package/{functions → lib/functions}/jwt.d.ts +0 -0
- /package/{functions → lib/functions}/jwt.js +0 -0
- /package/{functions → lib/functions}/misc.d.ts +0 -0
- /package/{functions → lib/functions}/misc.js +0 -0
- /package/{functions → lib/functions}/notification.d.ts +0 -0
- /package/{functions → lib/functions}/notification.js +0 -0
- /package/{functions → lib/functions}/offer.d.ts +0 -0
- /package/{functions → lib/functions}/offer.js +0 -0
- /package/{functions → lib/functions}/offerApplicant.d.ts +0 -0
- /package/{functions → lib/functions}/offerApplicant.js +0 -0
- /package/{functions → lib/functions}/partnership.d.ts +0 -0
- /package/{functions → lib/functions}/partnership.js +0 -0
- /package/{functions → lib/functions}/partnershipCommunication.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipCommunication.js +0 -0
- /package/{functions → lib/functions}/partnershipGroup.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipGroup.js +0 -0
- /package/{functions → lib/functions}/partnershipPartner.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipPartner.js +0 -0
- /package/{functions → lib/functions}/partnershipPayment.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipPayment.js +0 -0
- /package/{functions → lib/functions}/partnershipPlan.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipPlan.js +0 -0
- /package/{functions → lib/functions}/partnershipSepaPaymentGroup.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipSepaPaymentGroup.js +0 -0
- /package/{functions → lib/functions}/partnershipSubscription.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipSubscription.js +0 -0
- /package/{functions → lib/functions}/regions.d.ts +0 -0
- /package/{functions → lib/functions}/regions.js +0 -0
- /package/{functions → lib/functions}/subscription.d.ts +0 -0
- /package/{functions → lib/functions}/subscription.js +0 -0
- /package/{functions → lib/functions}/user.d.ts +0 -0
- /package/{functions → lib/functions}/user.js +0 -0
- /package/{functions → lib/functions}/userNotification.d.ts +0 -0
- /package/{functions → lib/functions}/userNotification.js +0 -0
- /package/{helpers → lib/helpers}/appScenes.d.ts +0 -0
- /package/{helpers → lib/helpers}/appScenes.js +0 -0
- /package/{helpers → lib/helpers}/audios.d.ts +0 -0
- /package/{helpers → lib/helpers}/audios.js +0 -0
- /package/{helpers → lib/helpers}/auth.d.ts +0 -0
- /package/{helpers → lib/helpers}/auth.js +0 -0
- /package/{helpers → lib/helpers}/badges.d.ts +0 -0
- /package/{helpers → lib/helpers}/badges.js +0 -0
- /package/{helpers → lib/helpers}/collections.d.ts +0 -0
- /package/{helpers → lib/helpers}/collections.js +0 -0
- /package/{helpers → lib/helpers}/communicationTemplate/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/communicationTemplate/index.js +0 -0
- /package/{helpers → lib/helpers}/communicationTemplate/newGroup.d.ts +0 -0
- /package/{helpers → lib/helpers}/communicationTemplate/newGroup.js +0 -0
- /package/{helpers → lib/helpers}/communicationTemplate/newMember.d.ts +0 -0
- /package/{helpers → lib/helpers}/communicationTemplate/newMember.js +0 -0
- /package/{helpers → lib/helpers}/countries.d.ts +0 -0
- /package/{helpers → lib/helpers}/countries.js +0 -0
- /package/{helpers → lib/helpers}/currency.d.ts +0 -0
- /package/{helpers → lib/helpers}/currency.js +0 -0
- /package/{helpers → lib/helpers}/dlinks.d.ts +0 -0
- /package/{helpers → lib/helpers}/dlinks.js +0 -0
- /package/{helpers → lib/helpers}/errors.d.ts +0 -0
- /package/{helpers → lib/helpers}/errors.js +0 -0
- /package/{helpers → lib/helpers}/fileSections/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/fileSections/index.js +0 -0
- /package/{helpers → lib/helpers}/fileSections/orders.d.ts +0 -0
- /package/{helpers → lib/helpers}/fileSections/orders.js +0 -0
- /package/{helpers → lib/helpers}/glissandooAdmin.d.ts +0 -0
- /package/{helpers → lib/helpers}/glissandooAdmin.js +0 -0
- /package/{helpers → lib/helpers}/instruments/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/instruments/index.js +0 -0
- /package/{helpers → lib/helpers}/instruments/lists.d.ts +0 -0
- /package/{helpers → lib/helpers}/instruments/lists.js +0 -0
- /package/{helpers → lib/helpers}/instruments/orders.d.ts +0 -0
- /package/{helpers → lib/helpers}/instruments/orders.js +0 -0
- /package/{helpers → lib/helpers}/musicStyles/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/musicStyles/index.js +0 -0
- /package/{helpers → lib/helpers}/musicStyles/orders.d.ts +0 -0
- /package/{helpers → lib/helpers}/musicStyles/orders.js +0 -0
- /package/{helpers → lib/helpers}/notifications/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/notifications/index.js +0 -0
- /package/{helpers → lib/helpers}/notifications/placeholders.d.ts +0 -0
- /package/{helpers → lib/helpers}/notifications/placeholders.js +0 -0
- /package/{helpers → lib/helpers}/objects.d.ts +0 -0
- /package/{helpers → lib/helpers}/objects.js +0 -0
- /package/{helpers → lib/helpers}/paymentForecast.d.ts +0 -0
- /package/{helpers → lib/helpers}/paymentForecast.js +0 -0
- /package/{helpers → lib/helpers}/payoutRules.d.ts +0 -0
- /package/{helpers → lib/helpers}/payoutRules.js +0 -0
- /package/{helpers → lib/helpers}/plans.d.ts +0 -0
- /package/{helpers → lib/helpers}/plans.js +0 -0
- /package/{helpers → lib/helpers}/rates.d.ts +0 -0
- /package/{helpers → lib/helpers}/rates.js +0 -0
- /package/{helpers → lib/helpers}/reasons.d.ts +0 -0
- /package/{helpers → lib/helpers}/reasons.js +0 -0
- /package/{helpers → lib/helpers}/slate.d.ts +0 -0
- /package/{helpers → lib/helpers}/slate.js +0 -0
- /package/{helpers → lib/helpers}/styles.d.ts +0 -0
- /package/{helpers → lib/helpers}/styles.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/array-includes.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/array-includes.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/as-mutable.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/as-mutable.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/assert-error.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/assert-error.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/index.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-defined.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-defined.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-empty.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-empty.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-finite.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-finite.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-infinite.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-infinite.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-integer.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-integer.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-present.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-present.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-safe-integer.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/is-safe-integer.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-entries.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-entries.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-from-entries.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-from-entries.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-has-own.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-has-own.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-keys.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/object-keys.js +0 -0
- /package/{helpers → lib/helpers}/ts-extras/set-has.d.ts +0 -0
- /package/{helpers → lib/helpers}/ts-extras/set-has.js +0 -0
- /package/{helpers → lib/helpers}/types.d.ts +0 -0
- /package/{helpers → lib/helpers}/types.js +0 -0
- /package/{helpers → lib/helpers}/utils.d.ts +0 -0
- /package/{helpers → lib/helpers}/utils.js +0 -0
- /package/{index.d.ts → lib/index.d.ts} +0 -0
- /package/{index.js → lib/index.js} +0 -0
- /package/{lang → lib/lang}/ca.json +0 -0
- /package/{lang → lib/lang}/de.json +0 -0
- /package/{lang → lib/lang}/en.json +0 -0
- /package/{lang → lib/lang}/es.json +0 -0
- /package/{lang → lib/lang}/eu.json +0 -0
- /package/{lang → lib/lang}/fr.json +0 -0
- /package/{lang → lib/lang}/gl.json +0 -0
- /package/{lang → lib/lang}/index.d.ts +0 -0
- /package/{lang → lib/lang}/index.js +0 -0
- /package/{lang → lib/lang}/it.json +0 -0
- /package/{lang → lib/lang}/nl.json +0 -0
- /package/{lang → lib/lang}/pt.json +0 -0
- /package/{models → lib/models}/Communication/Comment/index.d.ts +0 -0
- /package/{models → lib/models}/Communication/Comment/index.js +0 -0
- /package/{models → lib/models}/Communication/Comment/types.d.ts +0 -0
- /package/{models → lib/models}/Communication/Comment/types.js +0 -0
- /package/{models → lib/models}/Communication/index.d.ts +0 -0
- /package/{models → lib/models}/Communication/index.js +0 -0
- /package/{models → lib/models}/Communication/types.d.ts +0 -0
- /package/{models → lib/models}/Communication/types.js +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/index.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/index.js +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/types.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/types.js +0 -0
- /package/{models → lib/models}/Counters/Group/index.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/index.js +0 -0
- /package/{models → lib/models}/Counters/Group/types.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/types.js +0 -0
- /package/{models → lib/models}/Counters/event.d.ts +0 -0
- /package/{models → lib/models}/Counters/event.js +0 -0
- /package/{models → lib/models}/Counters/index.d.ts +0 -0
- /package/{models → lib/models}/Counters/index.js +0 -0
- /package/{models → lib/models}/Counters/types.d.ts +0 -0
- /package/{models → lib/models}/Counters/types.js +0 -0
- /package/{models → lib/models}/Customer/Group/index.d.ts +0 -0
- /package/{models → lib/models}/Customer/Group/index.js +0 -0
- /package/{models → lib/models}/Customer/Group/types.d.ts +0 -0
- /package/{models → lib/models}/Customer/Group/types.js +0 -0
- /package/{models → lib/models}/Customer/basic.d.ts +0 -0
- /package/{models → lib/models}/Customer/basic.js +0 -0
- /package/{models → lib/models}/Customer/index.d.ts +0 -0
- /package/{models → lib/models}/Customer/index.js +0 -0
- /package/{models → lib/models}/Customer/types.d.ts +0 -0
- /package/{models → lib/models}/Customer/types.js +0 -0
- /package/{models → lib/models}/Evento/Player/basic.d.ts +0 -0
- /package/{models → lib/models}/Evento/Player/basic.js +0 -0
- /package/{models → lib/models}/Evento/Player/index.d.ts +0 -0
- /package/{models → lib/models}/Evento/Player/index.js +0 -0
- /package/{models → lib/models}/Evento/Player/types.d.ts +0 -0
- /package/{models → lib/models}/Evento/Player/types.js +0 -0
- /package/{models → lib/models}/Evento/Repertory/index.d.ts +0 -0
- /package/{models → lib/models}/Evento/Repertory/index.js +0 -0
- /package/{models → lib/models}/Evento/Repertory/types.d.ts +0 -0
- /package/{models → lib/models}/Evento/Repertory/types.js +0 -0
- /package/{models → lib/models}/Evento/basic.d.ts +0 -0
- /package/{models → lib/models}/Evento/basic.js +0 -0
- /package/{models → lib/models}/Evento/index.d.ts +0 -0
- /package/{models → lib/models}/Evento/index.js +0 -0
- /package/{models → lib/models}/Evento/promoter.d.ts +0 -0
- /package/{models → lib/models}/Evento/promoter.js +0 -0
- /package/{models → lib/models}/Evento/tiny.d.ts +0 -0
- /package/{models → lib/models}/Evento/tiny.js +0 -0
- /package/{models → lib/models}/Evento/types.d.ts +0 -0
- /package/{models → lib/models}/Evento/types.js +0 -0
- /package/{models → lib/models}/Federation/Partnership/index.d.ts +0 -0
- /package/{models → lib/models}/Federation/Partnership/index.js +0 -0
- /package/{models → lib/models}/Federation/Partnership/types.d.ts +0 -0
- /package/{models → lib/models}/Federation/Partnership/types.js +0 -0
- /package/{models → lib/models}/Federation/index.d.ts +0 -0
- /package/{models → lib/models}/Federation/index.js +0 -0
- /package/{models → lib/models}/Federation/types.d.ts +0 -0
- /package/{models → lib/models}/Federation/types.js +0 -0
- /package/{models → lib/models}/Group/Analytics/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Analytics/index.js +0 -0
- /package/{models → lib/models}/Group/Analytics/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Analytics/types.js +0 -0
- /package/{models → lib/models}/Group/Event/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Event/index.js +0 -0
- /package/{models → lib/models}/Group/Event/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Event/types.js +0 -0
- /package/{models → lib/models}/Group/Payment/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Payment/index.js +0 -0
- /package/{models → lib/models}/Group/Payment/supabase.d.ts +0 -0
- /package/{models → lib/models}/Group/Payment/supabase.js +0 -0
- /package/{models → lib/models}/Group/Payment/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Payment/types.js +0 -0
- /package/{models → lib/models}/Group/Player/Event/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Event/index.js +0 -0
- /package/{models → lib/models}/Group/Player/Event/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Event/types.js +0 -0
- /package/{models → lib/models}/Group/Player/Log/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Log/index.js +0 -0
- /package/{models → lib/models}/Group/Player/Log/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Log/types.js +0 -0
- /package/{models → lib/models}/Group/Player/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/index.js +0 -0
- /package/{models → lib/models}/Group/Player/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/types.js +0 -0
- /package/{models → lib/models}/Group/Repertory/File/Section/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Repertory/File/Section/index.js +0 -0
- /package/{models → lib/models}/Group/Repertory/File/Section/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Repertory/File/Section/types.js +0 -0
- /package/{models → lib/models}/Group/Repertory/File/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Repertory/File/index.js +0 -0
- /package/{models → lib/models}/Group/Repertory/File/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Repertory/File/types.js +0 -0
- /package/{models → lib/models}/Group/Repertory/FilePath/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Repertory/FilePath/index.js +0 -0
- /package/{models → lib/models}/Group/Repertory/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Repertory/index.js +0 -0
- /package/{models → lib/models}/Group/Repertory/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Repertory/types.js +0 -0
- /package/{models → lib/models}/Group/StageTemplate/index.d.ts +0 -0
- /package/{models → lib/models}/Group/StageTemplate/index.js +0 -0
- /package/{models → lib/models}/Group/StageTemplate/types.d.ts +0 -0
- /package/{models → lib/models}/Group/StageTemplate/types.js +0 -0
- /package/{models → lib/models}/Group/basic.d.ts +0 -0
- /package/{models → lib/models}/Group/basic.js +0 -0
- /package/{models → lib/models}/Group/index.d.ts +0 -0
- /package/{models → lib/models}/Group/index.js +0 -0
- /package/{models → lib/models}/Group/types.d.ts +0 -0
- /package/{models → lib/models}/Group/types.js +0 -0
- /package/{models → lib/models}/Instrument/group.d.ts +0 -0
- /package/{models → lib/models}/Instrument/group.js +0 -0
- /package/{models → lib/models}/Instrument/index.d.ts +0 -0
- /package/{models → lib/models}/Instrument/index.js +0 -0
- /package/{models → lib/models}/Inventory/Item/index.d.ts +0 -0
- /package/{models → lib/models}/Inventory/Item/index.js +0 -0
- /package/{models → lib/models}/Inventory/Item/types.d.ts +0 -0
- /package/{models → lib/models}/Inventory/Item/types.js +0 -0
- /package/{models → lib/models}/Inventory/index.d.ts +0 -0
- /package/{models → lib/models}/Inventory/index.js +0 -0
- /package/{models → lib/models}/Inventory/types.d.ts +0 -0
- /package/{models → lib/models}/Inventory/types.js +0 -0
- /package/{models → lib/models}/Metrics/index.d.ts +0 -0
- /package/{models → lib/models}/Metrics/index.js +0 -0
- /package/{models → lib/models}/Metrics/types.d.ts +0 -0
- /package/{models → lib/models}/Metrics/types.js +0 -0
- /package/{models → lib/models}/Model/index.d.ts +0 -0
- /package/{models → lib/models}/Model/index.js +0 -0
- /package/{models → lib/models}/Model/lang.d.ts +0 -0
- /package/{models → lib/models}/Model/lang.js +0 -0
- /package/{models → lib/models}/MusicStyle/index.d.ts +0 -0
- /package/{models → lib/models}/MusicStyle/index.js +0 -0
- /package/{models → lib/models}/Notification/index.d.ts +0 -0
- /package/{models → lib/models}/Notification/index.js +0 -0
- /package/{models → lib/models}/Notification/types.d.ts +0 -0
- /package/{models → lib/models}/Notification/types.js +0 -0
- /package/{models → lib/models}/Offer/Applicant/index.d.ts +0 -0
- /package/{models → lib/models}/Offer/Applicant/index.js +0 -0
- /package/{models → lib/models}/Offer/Applicant/types.d.ts +0 -0
- /package/{models → lib/models}/Offer/Applicant/types.js +0 -0
- /package/{models → lib/models}/Offer/index.d.ts +0 -0
- /package/{models → lib/models}/Offer/index.js +0 -0
- /package/{models → lib/models}/Offer/types.d.ts +0 -0
- /package/{models → lib/models}/Offer/types.js +0 -0
- /package/{models → lib/models}/Partnership/Communication/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Communication/index.js +0 -0
- /package/{models → lib/models}/Partnership/Communication/supabase.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Communication/supabase.js +0 -0
- /package/{models → lib/models}/Partnership/Communication/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Communication/types.js +0 -0
- /package/{models → lib/models}/Partnership/Group/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Group/index.js +0 -0
- /package/{models → lib/models}/Partnership/Group/supabase.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Group/supabase.js +0 -0
- /package/{models → lib/models}/Partnership/Group/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Group/types.js +0 -0
- /package/{models → lib/models}/Partnership/Partner/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Partner/index.js +0 -0
- /package/{models → lib/models}/Partnership/Partner/supabase.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Partner/supabase.js +0 -0
- /package/{models → lib/models}/Partnership/Partner/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Partner/types.js +0 -0
- /package/{models → lib/models}/Partnership/Payment/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Payment/index.js +0 -0
- /package/{models → lib/models}/Partnership/Payment/supabase.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Payment/supabase.js +0 -0
- /package/{models → lib/models}/Partnership/Payment/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Payment/types.js +0 -0
- /package/{models → lib/models}/Partnership/Plan/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Plan/index.js +0 -0
- /package/{models → lib/models}/Partnership/Plan/supabase.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Plan/supabase.js +0 -0
- /package/{models → lib/models}/Partnership/Plan/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Plan/types.js +0 -0
- /package/{models → lib/models}/Partnership/SepaPaymentGroup/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/SepaPaymentGroup/index.js +0 -0
- /package/{models → lib/models}/Partnership/SepaPaymentGroup/supabase.d.ts +0 -0
- /package/{models → lib/models}/Partnership/SepaPaymentGroup/supabase.js +0 -0
- /package/{models → lib/models}/Partnership/SepaPaymentGroup/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/SepaPaymentGroup/types.js +0 -0
- /package/{models → lib/models}/Partnership/Subscription/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Subscription/index.js +0 -0
- /package/{models → lib/models}/Partnership/Subscription/supabase.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Subscription/supabase.js +0 -0
- /package/{models → lib/models}/Partnership/Subscription/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Subscription/types.js +0 -0
- /package/{models → lib/models}/Partnership/basic.d.ts +0 -0
- /package/{models → lib/models}/Partnership/basic.js +0 -0
- /package/{models → lib/models}/Partnership/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/index.js +0 -0
- /package/{models → lib/models}/Partnership/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/types.js +0 -0
- /package/{models → lib/models}/Player/basic.d.ts +0 -0
- /package/{models → lib/models}/Player/basic.js +0 -0
- /package/{models → lib/models}/Player/types.d.ts +0 -0
- /package/{models → lib/models}/Player/types.js +0 -0
- /package/{models → lib/models}/Repertory/basic.d.ts +0 -0
- /package/{models → lib/models}/Repertory/basic.js +0 -0
- /package/{models → lib/models}/Repertory/types.d.ts +0 -0
- /package/{models → lib/models}/Repertory/types.js +0 -0
- /package/{models → lib/models}/User/Group/index.d.ts +0 -0
- /package/{models → lib/models}/User/Group/index.js +0 -0
- /package/{models → lib/models}/User/Group/types.d.ts +0 -0
- /package/{models → lib/models}/User/Group/types.js +0 -0
- /package/{models → lib/models}/User/Notification/index.d.ts +0 -0
- /package/{models → lib/models}/User/Notification/index.js +0 -0
- /package/{models → lib/models}/User/Notification/types.d.ts +0 -0
- /package/{models → lib/models}/User/Notification/types.js +0 -0
- /package/{models → lib/models}/User/OfferAlarm/index.d.ts +0 -0
- /package/{models → lib/models}/User/OfferAlarm/index.js +0 -0
- /package/{models → lib/models}/User/OfferAlarm/types.d.ts +0 -0
- /package/{models → lib/models}/User/OfferAlarm/types.js +0 -0
- /package/{models → lib/models}/User/Partnership/index.d.ts +0 -0
- /package/{models → lib/models}/User/Partnership/index.js +0 -0
- /package/{models → lib/models}/User/Partnership/types.d.ts +0 -0
- /package/{models → lib/models}/User/Partnership/types.js +0 -0
- /package/{models → lib/models}/User/basic.d.ts +0 -0
- /package/{models → lib/models}/User/basic.js +0 -0
- /package/{models → lib/models}/User/extended.d.ts +0 -0
- /package/{models → lib/models}/User/extended.js +0 -0
- /package/{models → lib/models}/WebhookEvent/index.d.ts +0 -0
- /package/{models → lib/models}/WebhookEvent/index.js +0 -0
- /package/{models → lib/models}/WebhookEvent/types.d.ts +0 -0
- /package/{models → lib/models}/WebhookEvent/types.js +0 -0
- /package/{types → lib/types}/firestore.d.ts +0 -0
- /package/{types → lib/types}/firestore.js +0 -0
- /package/{types → lib/types}/messagebirdChatWidget.d.ts +0 -0
- /package/{types → lib/types}/messagebirdChatWidget.js +0 -0
- /package/{types → lib/types}/minVersion.d.ts +0 -0
- /package/{types → lib/types}/minVersion.js +0 -0
- /package/{types → lib/types}/payoutRule.d.ts +0 -0
- /package/{types → lib/types}/payoutRule.js +0 -0
- /package/{types → lib/types}/supabase/generated.d.ts +0 -0
- /package/{types → lib/types}/supabase/generated.js +0 -0
- /package/{types → lib/types}/supabase/index.d.ts +0 -0
- /package/{types → lib/types}/supabase/index.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/comm.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/comm.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/comm_history.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/comm_history.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/event.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/event.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/event_history.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/event_history.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/group.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/group.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/group_history.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/group_history.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/index.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/index.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/offer.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/offer.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/offer_history.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/offer_history.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/repertoire.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/repertoire.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/repertoire_history.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/repertoire_history.js +0 -0
- /package/{types → lib/types}/supabase/overwrites/utils.d.ts +0 -0
- /package/{types → lib/types}/supabase/overwrites/utils.js +0 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
-- Building the GIN index on "event"."players" over a large table can exceed the
|
|
2
|
+
-- default statement timeout. Disable it for this migration's transaction.
|
|
3
|
+
SET statement_timeout = 0;
|
|
4
|
+
|
|
5
|
+
CREATE SCHEMA IF NOT EXISTS "private";
|
|
6
|
+
REVOKE ALL ON SCHEMA "private" FROM PUBLIC, "anon", "authenticated";
|
|
7
|
+
GRANT USAGE ON SCHEMA "private" TO "service_role";
|
|
8
|
+
|
|
9
|
+
CREATE TABLE "public"."calendar_feed" (
|
|
10
|
+
"user_id" TEXT PRIMARY KEY REFERENCES "public"."user" ("userId") ON DELETE CASCADE,
|
|
11
|
+
"token_hash" TEXT NOT NULL UNIQUE CHECK ("token_hash" ~ '^[0-9a-f]{64}$'),
|
|
12
|
+
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
|
13
|
+
"include_tentative" BOOLEAN NOT NULL DEFAULT true,
|
|
14
|
+
"content_revision" BIGINT NOT NULL DEFAULT 0 CHECK ("content_revision" >= 0),
|
|
15
|
+
"created_at" TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
16
|
+
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
17
|
+
"revoked_at" TIMESTAMPTZ,
|
|
18
|
+
CHECK (NOT "enabled" OR "revoked_at" IS NULL)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
CREATE INDEX "calendar_feed_enabled_token_hash_idx"
|
|
22
|
+
ON "public"."calendar_feed" ("token_hash")
|
|
23
|
+
WHERE "enabled" AND "revoked_at" IS NULL;
|
|
24
|
+
|
|
25
|
+
CREATE TRIGGER "calendar_feed__handle_updated_at"
|
|
26
|
+
BEFORE UPDATE ON "public"."calendar_feed"
|
|
27
|
+
FOR EACH ROW EXECUTE FUNCTION extensions.moddatetime('updated_at');
|
|
28
|
+
|
|
29
|
+
ALTER TABLE "public"."calendar_feed" ENABLE ROW LEVEL SECURITY;
|
|
30
|
+
|
|
31
|
+
REVOKE ALL ON TABLE "public"."calendar_feed" FROM "anon", "authenticated";
|
|
32
|
+
GRANT ALL ON TABLE "public"."calendar_feed" TO "service_role";
|
|
33
|
+
|
|
34
|
+
CREATE TABLE "public"."calendar_event_cancellation" (
|
|
35
|
+
"user_id" TEXT NOT NULL REFERENCES "public"."calendar_feed" ("user_id") ON DELETE CASCADE,
|
|
36
|
+
"event_id" TEXT NOT NULL,
|
|
37
|
+
"starts_at" TIMESTAMPTZ NOT NULL,
|
|
38
|
+
"ends_at" TIMESTAMPTZ NOT NULL,
|
|
39
|
+
"all_day" BOOLEAN NOT NULL DEFAULT false,
|
|
40
|
+
"event_type" TEXT NOT NULL,
|
|
41
|
+
"display_name" TEXT,
|
|
42
|
+
"group_name" TEXT NOT NULL,
|
|
43
|
+
"latitude" DOUBLE PRECISION,
|
|
44
|
+
"longitude" DOUBLE PRECISION,
|
|
45
|
+
"description" TEXT,
|
|
46
|
+
"location" TEXT,
|
|
47
|
+
"timezone" TEXT NOT NULL,
|
|
48
|
+
"last_modified" TIMESTAMPTZ NOT NULL,
|
|
49
|
+
"sequence" BIGINT NOT NULL CHECK ("sequence" >= 0),
|
|
50
|
+
"url" TEXT,
|
|
51
|
+
"cancelled_at" TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
52
|
+
"expires_at" TIMESTAMPTZ NOT NULL DEFAULT (now() + INTERVAL '90 days'),
|
|
53
|
+
PRIMARY KEY ("user_id", "event_id")
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
CREATE INDEX "calendar_event_cancellation_user_expiry_idx"
|
|
57
|
+
ON "public"."calendar_event_cancellation" ("user_id", "expires_at");
|
|
58
|
+
|
|
59
|
+
ALTER TABLE "public"."calendar_event_cancellation" ENABLE ROW LEVEL SECURITY;
|
|
60
|
+
|
|
61
|
+
REVOKE ALL ON TABLE "public"."calendar_event_cancellation" FROM "anon", "authenticated";
|
|
62
|
+
GRANT ALL ON TABLE "public"."calendar_event_cancellation" TO "service_role";
|
|
63
|
+
|
|
64
|
+
ALTER TABLE "public"."event"
|
|
65
|
+
ADD COLUMN "calendarSequence" BIGINT NOT NULL DEFAULT 0
|
|
66
|
+
CHECK ("calendarSequence" >= 0);
|
|
67
|
+
|
|
68
|
+
CREATE INDEX "event_calendar_datetime_idx"
|
|
69
|
+
ON "public"."event" ("datetime", "datetimeEnd")
|
|
70
|
+
WHERE "deletedAt" IS NULL;
|
|
71
|
+
|
|
72
|
+
CREATE INDEX "event_calendar_players_idx"
|
|
73
|
+
ON "public"."event" USING GIN ("players")
|
|
74
|
+
WHERE "deletedAt" IS NULL;
|
|
75
|
+
|
|
76
|
+
CREATE OR REPLACE FUNCTION "private"."calendarPlayerState"(
|
|
77
|
+
"player" JSONB,
|
|
78
|
+
"selection_mode" TEXT
|
|
79
|
+
)
|
|
80
|
+
RETURNS TEXT
|
|
81
|
+
LANGUAGE sql
|
|
82
|
+
IMMUTABLE
|
|
83
|
+
SECURITY INVOKER
|
|
84
|
+
SET search_path = ''
|
|
85
|
+
AS $$
|
|
86
|
+
SELECT CASE
|
|
87
|
+
WHEN "player" IS NULL THEN 'unauthorized'
|
|
88
|
+
WHEN "player"->>'status' = 'declined' THEN 'declined'
|
|
89
|
+
WHEN COALESCE(("player"->>'selected')::BOOLEAN, true) = false THEN 'declined'
|
|
90
|
+
WHEN COALESCE(("player"->>'selected')::BOOLEAN, false) THEN 'accepted'
|
|
91
|
+
WHEN "player"->>'status' = 'confirmed' AND "selection_mode" IS NULL THEN 'accepted'
|
|
92
|
+
WHEN "player"->>'status' = 'confirmed' THEN 'tentative'
|
|
93
|
+
WHEN COALESCE(("player"->>'interested')::BOOLEAN, false) THEN 'tentative'
|
|
94
|
+
ELSE 'unanswered'
|
|
95
|
+
END;
|
|
96
|
+
$$;
|
|
97
|
+
|
|
98
|
+
REVOKE ALL ON FUNCTION "private"."calendarPlayerState"(JSONB, TEXT) FROM PUBLIC, "anon", "authenticated";
|
|
99
|
+
GRANT EXECUTE ON FUNCTION "private"."calendarPlayerState"(JSONB, TEXT) TO "service_role";
|
|
100
|
+
|
|
101
|
+
CREATE OR REPLACE FUNCTION "private"."updateCalendarFeedLanguageRevision"()
|
|
102
|
+
RETURNS trigger
|
|
103
|
+
LANGUAGE plpgsql
|
|
104
|
+
SECURITY INVOKER
|
|
105
|
+
SET search_path = ''
|
|
106
|
+
AS $$
|
|
107
|
+
BEGIN
|
|
108
|
+
IF NEW."language" IS DISTINCT FROM OLD."language" THEN
|
|
109
|
+
UPDATE "public"."calendar_feed"
|
|
110
|
+
SET "content_revision" = "content_revision" + 1
|
|
111
|
+
WHERE "user_id" = NEW."userId";
|
|
112
|
+
END IF;
|
|
113
|
+
|
|
114
|
+
RETURN NEW;
|
|
115
|
+
END;
|
|
116
|
+
$$;
|
|
117
|
+
|
|
118
|
+
REVOKE ALL ON FUNCTION "private"."updateCalendarFeedLanguageRevision"()
|
|
119
|
+
FROM PUBLIC, "anon", "authenticated";
|
|
120
|
+
GRANT EXECUTE ON FUNCTION "private"."updateCalendarFeedLanguageRevision"() TO "service_role";
|
|
121
|
+
|
|
122
|
+
CREATE TRIGGER "user__update_calendar_feed_language_revision"
|
|
123
|
+
AFTER UPDATE OF "language" ON "public"."user"
|
|
124
|
+
FOR EACH ROW EXECUTE FUNCTION "private"."updateCalendarFeedLanguageRevision"();
|
|
125
|
+
|
|
126
|
+
CREATE OR REPLACE FUNCTION "private"."updateEventCalendarRevision"()
|
|
127
|
+
RETURNS trigger
|
|
128
|
+
LANGUAGE plpgsql
|
|
129
|
+
SECURITY INVOKER
|
|
130
|
+
SET search_path = ''
|
|
131
|
+
AS $$
|
|
132
|
+
BEGIN
|
|
133
|
+
IF ROW(
|
|
134
|
+
NEW."promoter",
|
|
135
|
+
NEW."displayName",
|
|
136
|
+
NEW."datetime",
|
|
137
|
+
NEW."datetimeEnd",
|
|
138
|
+
NEW."description",
|
|
139
|
+
NEW."locality",
|
|
140
|
+
NEW."online",
|
|
141
|
+
NEW."timezone",
|
|
142
|
+
NEW."selectionMode",
|
|
143
|
+
NEW."shortDynamicLink",
|
|
144
|
+
NEW."deletedAt",
|
|
145
|
+
NEW."players"
|
|
146
|
+
) IS DISTINCT FROM ROW(
|
|
147
|
+
OLD."promoter",
|
|
148
|
+
OLD."displayName",
|
|
149
|
+
OLD."datetime",
|
|
150
|
+
OLD."datetimeEnd",
|
|
151
|
+
OLD."description",
|
|
152
|
+
OLD."locality",
|
|
153
|
+
OLD."online",
|
|
154
|
+
OLD."timezone",
|
|
155
|
+
OLD."selectionMode",
|
|
156
|
+
OLD."shortDynamicLink",
|
|
157
|
+
OLD."deletedAt",
|
|
158
|
+
OLD."players"
|
|
159
|
+
) THEN
|
|
160
|
+
-- Only a state this feed previously published can create a cancellation.
|
|
161
|
+
-- A direct decline or unanswered invitation therefore never creates a
|
|
162
|
+
-- tombstone, while confirmed/tentative -> declined or selected=false does.
|
|
163
|
+
INSERT INTO "public"."calendar_event_cancellation" (
|
|
164
|
+
"user_id",
|
|
165
|
+
"event_id",
|
|
166
|
+
"starts_at",
|
|
167
|
+
"ends_at",
|
|
168
|
+
"event_type",
|
|
169
|
+
"display_name",
|
|
170
|
+
"group_name",
|
|
171
|
+
"latitude",
|
|
172
|
+
"longitude",
|
|
173
|
+
"description",
|
|
174
|
+
"location",
|
|
175
|
+
"timezone",
|
|
176
|
+
"last_modified",
|
|
177
|
+
"sequence",
|
|
178
|
+
"url",
|
|
179
|
+
"cancelled_at",
|
|
180
|
+
"expires_at"
|
|
181
|
+
)
|
|
182
|
+
SELECT
|
|
183
|
+
feed."user_id",
|
|
184
|
+
OLD."id",
|
|
185
|
+
OLD."datetime",
|
|
186
|
+
OLD."datetimeEnd",
|
|
187
|
+
OLD."type"::TEXT,
|
|
188
|
+
NULLIF(OLD."displayName", ''),
|
|
189
|
+
event_group."displayName",
|
|
190
|
+
CASE
|
|
191
|
+
WHEN "extensions"."st_x"(OLD."location"::"extensions"."geometry") <> 0
|
|
192
|
+
OR "extensions"."st_y"(OLD."location"::"extensions"."geometry") <> 0
|
|
193
|
+
THEN "extensions"."st_x"(OLD."location"::"extensions"."geometry")
|
|
194
|
+
ELSE NULL
|
|
195
|
+
END,
|
|
196
|
+
CASE
|
|
197
|
+
WHEN "extensions"."st_x"(OLD."location"::"extensions"."geometry") <> 0
|
|
198
|
+
OR "extensions"."st_y"(OLD."location"::"extensions"."geometry") <> 0
|
|
199
|
+
THEN "extensions"."st_y"(OLD."location"::"extensions"."geometry")
|
|
200
|
+
ELSE NULL
|
|
201
|
+
END,
|
|
202
|
+
OLD."description",
|
|
203
|
+
NULLIF(OLD."locality", ''),
|
|
204
|
+
OLD."timezone",
|
|
205
|
+
now(),
|
|
206
|
+
OLD."calendarSequence" + 1,
|
|
207
|
+
CASE
|
|
208
|
+
WHEN OLD."shortDynamicLink" ~ '^https://(app(-dev)?\.glissandoo\.com|glissandoo\.com|dev\.glissandoo\.com|glissandoo\.page\.link)/'
|
|
209
|
+
THEN OLD."shortDynamicLink"
|
|
210
|
+
ELSE NULL
|
|
211
|
+
END,
|
|
212
|
+
now(),
|
|
213
|
+
now() + INTERVAL '90 days'
|
|
214
|
+
FROM unnest(OLD."playerIds") AS invited("user_id")
|
|
215
|
+
JOIN "public"."calendar_feed" AS feed
|
|
216
|
+
ON feed."user_id" = invited."user_id"
|
|
217
|
+
AND feed."enabled"
|
|
218
|
+
AND feed."revoked_at" IS NULL
|
|
219
|
+
JOIN "public"."group" AS event_group
|
|
220
|
+
ON event_group."id" = OLD."promoter"
|
|
221
|
+
WHERE
|
|
222
|
+
OLD."datetimeEnd" >= now() - INTERVAL '30 days'
|
|
223
|
+
AND OLD."datetime" <= now() + INTERVAL '18 months'
|
|
224
|
+
AND (
|
|
225
|
+
COALESCE((OLD."players" -> feed."user_id" ->> 'isGuest')::BOOLEAN, false)
|
|
226
|
+
OR EXISTS (
|
|
227
|
+
SELECT 1
|
|
228
|
+
FROM "public"."userGroup" AS old_membership
|
|
229
|
+
WHERE old_membership."userId" = feed."user_id"
|
|
230
|
+
AND old_membership."groupId" = OLD."promoter"
|
|
231
|
+
)
|
|
232
|
+
)
|
|
233
|
+
AND (
|
|
234
|
+
CASE "private"."calendarPlayerState"(
|
|
235
|
+
OLD."players" -> feed."user_id",
|
|
236
|
+
OLD."selectionMode"::TEXT
|
|
237
|
+
)
|
|
238
|
+
WHEN 'accepted' THEN true
|
|
239
|
+
WHEN 'tentative' THEN feed."include_tentative"
|
|
240
|
+
ELSE false
|
|
241
|
+
END
|
|
242
|
+
OR (
|
|
243
|
+
OLD."players" -> feed."user_id" -> 'selected'
|
|
244
|
+
IS DISTINCT FROM 'false'::JSONB
|
|
245
|
+
AND NEW."players" -> feed."user_id" -> 'selected' = 'false'::JSONB
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
AND (
|
|
249
|
+
NEW."deletedAt" IS NOT NULL
|
|
250
|
+
OR NEW."datetimeEnd" < now() - INTERVAL '30 days'
|
|
251
|
+
OR NEW."datetime" > now() + INTERVAL '18 months'
|
|
252
|
+
OR NOT (
|
|
253
|
+
CASE "private"."calendarPlayerState"(
|
|
254
|
+
NEW."players" -> feed."user_id",
|
|
255
|
+
NEW."selectionMode"::TEXT
|
|
256
|
+
)
|
|
257
|
+
WHEN 'accepted' THEN true
|
|
258
|
+
WHEN 'tentative' THEN feed."include_tentative"
|
|
259
|
+
ELSE false
|
|
260
|
+
END
|
|
261
|
+
AND (
|
|
262
|
+
COALESCE(
|
|
263
|
+
(NEW."players" -> feed."user_id" ->> 'isGuest')::BOOLEAN,
|
|
264
|
+
false
|
|
265
|
+
)
|
|
266
|
+
OR EXISTS (
|
|
267
|
+
SELECT 1
|
|
268
|
+
FROM "public"."userGroup" AS new_membership
|
|
269
|
+
WHERE new_membership."userId" = feed."user_id"
|
|
270
|
+
AND new_membership."groupId" = NEW."promoter"
|
|
271
|
+
)
|
|
272
|
+
)
|
|
273
|
+
)
|
|
274
|
+
)
|
|
275
|
+
ON CONFLICT ("user_id", "event_id") DO UPDATE SET
|
|
276
|
+
"starts_at" = EXCLUDED."starts_at",
|
|
277
|
+
"ends_at" = EXCLUDED."ends_at",
|
|
278
|
+
"event_type" = EXCLUDED."event_type",
|
|
279
|
+
"display_name" = EXCLUDED."display_name",
|
|
280
|
+
"group_name" = EXCLUDED."group_name",
|
|
281
|
+
"latitude" = EXCLUDED."latitude",
|
|
282
|
+
"longitude" = EXCLUDED."longitude",
|
|
283
|
+
"description" = EXCLUDED."description",
|
|
284
|
+
"location" = EXCLUDED."location",
|
|
285
|
+
"timezone" = EXCLUDED."timezone",
|
|
286
|
+
"last_modified" = EXCLUDED."last_modified",
|
|
287
|
+
"sequence" = GREATEST(
|
|
288
|
+
"calendar_event_cancellation"."sequence" + 1,
|
|
289
|
+
EXCLUDED."sequence"
|
|
290
|
+
),
|
|
291
|
+
"url" = EXCLUDED."url",
|
|
292
|
+
"cancelled_at" = EXCLUDED."cancelled_at",
|
|
293
|
+
"expires_at" = EXCLUDED."expires_at";
|
|
294
|
+
|
|
295
|
+
NEW."calendarSequence" := GREATEST(
|
|
296
|
+
OLD."calendarSequence" + 1,
|
|
297
|
+
NEW."calendarSequence"
|
|
298
|
+
);
|
|
299
|
+
ELSE
|
|
300
|
+
NEW."calendarSequence" := GREATEST(
|
|
301
|
+
OLD."calendarSequence",
|
|
302
|
+
NEW."calendarSequence"
|
|
303
|
+
);
|
|
304
|
+
END IF;
|
|
305
|
+
|
|
306
|
+
RETURN NEW;
|
|
307
|
+
END;
|
|
308
|
+
$$;
|
|
309
|
+
|
|
310
|
+
REVOKE ALL ON FUNCTION "private"."updateEventCalendarRevision"() FROM PUBLIC, "anon", "authenticated";
|
|
311
|
+
|
|
312
|
+
CREATE TRIGGER "event__update_calendar_revision"
|
|
313
|
+
BEFORE UPDATE ON "public"."event"
|
|
314
|
+
FOR EACH ROW EXECUTE FUNCTION "private"."updateEventCalendarRevision"();
|
|
315
|
+
|
|
316
|
+
CREATE OR REPLACE FUNCTION "public"."resolveCalendarFeed"("p_token_hash" TEXT)
|
|
317
|
+
RETURNS TABLE (
|
|
318
|
+
"userId" TEXT,
|
|
319
|
+
"includeTentative" BOOLEAN
|
|
320
|
+
)
|
|
321
|
+
LANGUAGE sql
|
|
322
|
+
STABLE
|
|
323
|
+
SECURITY INVOKER
|
|
324
|
+
SET search_path = ''
|
|
325
|
+
AS $$
|
|
326
|
+
SELECT
|
|
327
|
+
feed."user_id",
|
|
328
|
+
feed."include_tentative"
|
|
329
|
+
FROM "public"."calendar_feed" AS feed
|
|
330
|
+
JOIN "public"."user" AS app_user ON app_user."userId" = feed."user_id"
|
|
331
|
+
WHERE feed."token_hash" = "p_token_hash"
|
|
332
|
+
AND feed."enabled"
|
|
333
|
+
AND feed."revoked_at" IS NULL
|
|
334
|
+
AND app_user."deletedAt" IS NULL
|
|
335
|
+
LIMIT 1;
|
|
336
|
+
$$;
|
|
337
|
+
|
|
338
|
+
REVOKE ALL ON FUNCTION "public"."resolveCalendarFeed"(TEXT) FROM PUBLIC, "anon", "authenticated";
|
|
339
|
+
GRANT EXECUTE ON FUNCTION "public"."resolveCalendarFeed"(TEXT) TO "service_role";
|
|
340
|
+
|
|
341
|
+
CREATE OR REPLACE FUNCTION "public"."getCalendarFeedEvents"(
|
|
342
|
+
"p_user_id" TEXT,
|
|
343
|
+
"p_include_tentative" BOOLEAN,
|
|
344
|
+
"p_range_start" TIMESTAMPTZ,
|
|
345
|
+
"p_range_end" TIMESTAMPTZ
|
|
346
|
+
)
|
|
347
|
+
RETURNS TABLE (
|
|
348
|
+
"eventId" TEXT,
|
|
349
|
+
"startsAt" TIMESTAMPTZ,
|
|
350
|
+
"endsAt" TIMESTAMPTZ,
|
|
351
|
+
"allDay" BOOLEAN,
|
|
352
|
+
"summary" TEXT,
|
|
353
|
+
"eventType" TEXT,
|
|
354
|
+
"groupName" TEXT,
|
|
355
|
+
"language" TEXT,
|
|
356
|
+
"description" TEXT,
|
|
357
|
+
"location" TEXT,
|
|
358
|
+
"latitude" DOUBLE PRECISION,
|
|
359
|
+
"longitude" DOUBLE PRECISION,
|
|
360
|
+
"timezone" TEXT,
|
|
361
|
+
"lastModified" TIMESTAMPTZ,
|
|
362
|
+
"sequence" BIGINT,
|
|
363
|
+
"status" TEXT,
|
|
364
|
+
"url" TEXT
|
|
365
|
+
)
|
|
366
|
+
LANGUAGE sql
|
|
367
|
+
STABLE
|
|
368
|
+
SECURITY INVOKER
|
|
369
|
+
SET search_path = ''
|
|
370
|
+
AS $$
|
|
371
|
+
WITH current_events AS (
|
|
372
|
+
SELECT
|
|
373
|
+
e."id" AS "eventId",
|
|
374
|
+
e."datetime" AS "startsAt",
|
|
375
|
+
e."datetimeEnd" AS "endsAt",
|
|
376
|
+
false AS "allDay",
|
|
377
|
+
COALESCE(NULLIF(e."displayName", ''), '') AS "summary",
|
|
378
|
+
e."type"::TEXT AS "eventType",
|
|
379
|
+
g."displayName" AS "groupName",
|
|
380
|
+
feed_user."language" AS "language",
|
|
381
|
+
e."description" AS "description",
|
|
382
|
+
NULLIF(e."locality", '') AS "location",
|
|
383
|
+
CASE
|
|
384
|
+
WHEN "extensions"."st_x"(e."location"::"extensions"."geometry") <> 0
|
|
385
|
+
OR "extensions"."st_y"(e."location"::"extensions"."geometry") <> 0
|
|
386
|
+
THEN "extensions"."st_x"(e."location"::"extensions"."geometry")
|
|
387
|
+
ELSE NULL
|
|
388
|
+
END AS "latitude",
|
|
389
|
+
CASE
|
|
390
|
+
WHEN "extensions"."st_x"(e."location"::"extensions"."geometry") <> 0
|
|
391
|
+
OR "extensions"."st_y"(e."location"::"extensions"."geometry") <> 0
|
|
392
|
+
THEN "extensions"."st_y"(e."location"::"extensions"."geometry")
|
|
393
|
+
ELSE NULL
|
|
394
|
+
END AS "longitude",
|
|
395
|
+
e."timezone" AS "timezone",
|
|
396
|
+
GREATEST(e."updatedAt", feed."updated_at") AS "lastModified",
|
|
397
|
+
e."calendarSequence" + feed."content_revision" AS "sequence",
|
|
398
|
+
"private"."calendarPlayerState"(
|
|
399
|
+
e."players" -> "p_user_id",
|
|
400
|
+
e."selectionMode"::TEXT
|
|
401
|
+
) AS "playerState",
|
|
402
|
+
CASE
|
|
403
|
+
WHEN e."shortDynamicLink" ~ '^https://(app(-dev)?\.glissandoo\.com|glissandoo\.com|dev\.glissandoo\.com|glissandoo\.page\.link)/'
|
|
404
|
+
THEN e."shortDynamicLink"
|
|
405
|
+
ELSE NULL
|
|
406
|
+
END AS "url"
|
|
407
|
+
FROM "public"."event" AS e
|
|
408
|
+
JOIN "public"."group" AS g ON g."id" = e."promoter"
|
|
409
|
+
JOIN "public"."user" AS feed_user ON feed_user."userId" = "p_user_id"
|
|
410
|
+
JOIN "public"."calendar_feed" AS feed ON feed."user_id" = "p_user_id"
|
|
411
|
+
WHERE e."deletedAt" IS NULL
|
|
412
|
+
AND g."deletedAt" IS NULL
|
|
413
|
+
AND feed_user."deletedAt" IS NULL
|
|
414
|
+
AND e."datetimeEnd" >= "p_range_start"
|
|
415
|
+
AND e."datetime" <= "p_range_end"
|
|
416
|
+
AND e."players" ? "p_user_id"
|
|
417
|
+
AND (
|
|
418
|
+
COALESCE((e."players" -> "p_user_id" ->> 'isGuest')::BOOLEAN, false)
|
|
419
|
+
OR EXISTS (
|
|
420
|
+
SELECT 1
|
|
421
|
+
FROM "public"."userGroup" AS membership
|
|
422
|
+
WHERE membership."userId" = "p_user_id"
|
|
423
|
+
AND membership."groupId" = e."promoter"
|
|
424
|
+
)
|
|
425
|
+
)
|
|
426
|
+
),
|
|
427
|
+
visible_events AS (
|
|
428
|
+
SELECT *
|
|
429
|
+
FROM current_events
|
|
430
|
+
WHERE CASE "playerState"
|
|
431
|
+
WHEN 'accepted' THEN true
|
|
432
|
+
WHEN 'tentative' THEN "p_include_tentative"
|
|
433
|
+
ELSE false
|
|
434
|
+
END
|
|
435
|
+
)
|
|
436
|
+
SELECT
|
|
437
|
+
visible."eventId",
|
|
438
|
+
visible."startsAt",
|
|
439
|
+
visible."endsAt",
|
|
440
|
+
visible."allDay",
|
|
441
|
+
visible."summary",
|
|
442
|
+
visible."eventType",
|
|
443
|
+
visible."groupName",
|
|
444
|
+
visible."language",
|
|
445
|
+
visible."description",
|
|
446
|
+
visible."location",
|
|
447
|
+
visible."latitude",
|
|
448
|
+
visible."longitude",
|
|
449
|
+
visible."timezone",
|
|
450
|
+
visible."lastModified",
|
|
451
|
+
visible."sequence",
|
|
452
|
+
CASE
|
|
453
|
+
WHEN visible."playerState" = 'accepted' THEN 'CONFIRMED'
|
|
454
|
+
ELSE 'TENTATIVE'
|
|
455
|
+
END AS "status",
|
|
456
|
+
visible."url"
|
|
457
|
+
FROM visible_events AS visible
|
|
458
|
+
|
|
459
|
+
UNION ALL
|
|
460
|
+
|
|
461
|
+
SELECT
|
|
462
|
+
cancelled."event_id",
|
|
463
|
+
cancelled."starts_at",
|
|
464
|
+
cancelled."ends_at",
|
|
465
|
+
cancelled."all_day",
|
|
466
|
+
COALESCE(cancelled."display_name", ''),
|
|
467
|
+
cancelled."event_type",
|
|
468
|
+
cancelled."group_name",
|
|
469
|
+
feed_user."language",
|
|
470
|
+
cancelled."description",
|
|
471
|
+
cancelled."location",
|
|
472
|
+
cancelled."latitude",
|
|
473
|
+
cancelled."longitude",
|
|
474
|
+
cancelled."timezone",
|
|
475
|
+
GREATEST(cancelled."last_modified", feed."updated_at"),
|
|
476
|
+
cancelled."sequence" + feed."content_revision",
|
|
477
|
+
'CANCELLED',
|
|
478
|
+
cancelled."url"
|
|
479
|
+
FROM "public"."calendar_event_cancellation" AS cancelled
|
|
480
|
+
JOIN "public"."calendar_feed" AS feed
|
|
481
|
+
ON feed."user_id" = cancelled."user_id"
|
|
482
|
+
JOIN "public"."user" AS feed_user
|
|
483
|
+
ON feed_user."userId" = cancelled."user_id"
|
|
484
|
+
WHERE cancelled."user_id" = "p_user_id"
|
|
485
|
+
AND cancelled."expires_at" > now()
|
|
486
|
+
AND cancelled."ends_at" >= "p_range_start"
|
|
487
|
+
AND cancelled."starts_at" <= "p_range_end"
|
|
488
|
+
AND NOT EXISTS (
|
|
489
|
+
SELECT 1
|
|
490
|
+
FROM visible_events AS visible
|
|
491
|
+
WHERE visible."eventId" = cancelled."event_id"
|
|
492
|
+
);
|
|
493
|
+
$$;
|
|
494
|
+
|
|
495
|
+
REVOKE ALL ON FUNCTION "public"."getCalendarFeedEvents"(
|
|
496
|
+
TEXT,
|
|
497
|
+
BOOLEAN,
|
|
498
|
+
TIMESTAMPTZ,
|
|
499
|
+
TIMESTAMPTZ
|
|
500
|
+
) FROM PUBLIC, "anon", "authenticated";
|
|
501
|
+
GRANT EXECUTE ON FUNCTION "public"."getCalendarFeedEvents"(
|
|
502
|
+
TEXT,
|
|
503
|
+
BOOLEAN,
|
|
504
|
+
TIMESTAMPTZ,
|
|
505
|
+
TIMESTAMPTZ
|
|
506
|
+
) TO "service_role";
|