@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.
- package/package.json +1 -1
- package/types/firestore.ts +1998 -0
- package/types/messagebirdChatWidget.ts +20 -0
- package/types/minVersion.ts +4 -0
- package/types/payoutRule.ts +132 -0
- package/types/supabase/generated.ts +1682 -0
- package/types/supabase/index.ts +36 -0
- package/types/supabase/overwrites/comm.ts +18 -0
- package/types/supabase/overwrites/comm_history.ts +10 -0
- package/types/supabase/overwrites/event.ts +28 -0
- package/types/supabase/overwrites/event_history.ts +10 -0
- package/types/supabase/overwrites/group.ts +49 -0
- package/types/supabase/overwrites/group_history.ts +9 -0
- package/types/supabase/overwrites/index.ts +7 -0
- package/types/supabase/overwrites/offer.ts +15 -0
- package/types/supabase/overwrites/offer_history.ts +10 -0
- package/types/supabase/overwrites/repertoire.ts +12 -0
- package/types/supabase/overwrites/repertoire_history.ts +10 -0
- package/types/supabase/overwrites/utils.ts +4 -0
- package/.firebaserc +0 -7
- package/.husky/pre-commit +0 -4
- package/README.md +0 -70
- package/scripts/setHusky.js +0 -11
- package/supabase/.dev.env +0 -1
- package/supabase/.prod.env +0 -1
- package/supabase/.sample.env +0 -2
- package/supabase/README.md +0 -126
- package/supabase/config.toml +0 -68
- package/supabase/migrations/20231117044943_remote_schema.sql +0 -228
- package/supabase/migrations/20231117124947_event_selection_mode_closed_at_nullable.sql +0 -1
- package/supabase/migrations/20231121002132_remote_schema.sql +0 -31
- package/supabase/migrations/20231121004031_references_nullable.sql +0 -3
- package/supabase/migrations/20231121014339_updated_at_trigger.sql +0 -13
- package/supabase/migrations/20231122111241_remote_schema.sql +0 -25
- package/supabase/migrations/20231124151424_snake_case_to_camel_case.sql +0 -105
- package/supabase/migrations/20231129133721_add_columns_for_sites.sql +0 -11
- package/supabase/migrations/20231129142806_promoter_can_be_null.sql +0 -3
- package/supabase/migrations/20231130125327_group_location_latlon.sql +0 -3
- package/supabase/migrations/20231130150154_error_solvings.sql +0 -9
- package/supabase/migrations/20240405115914_new_columns.sql +0 -9
- package/supabase/migrations/20240405121956_init_offer.sql +0 -81
- package/supabase/migrations/20240503032440_add_columns_to_offer.sql +0 -11
- package/supabase/migrations/20240503101641_add_column_createdOn.sql +0 -19
- package/supabase/migrations/20240506035104_add_groupInfo_to_offer.sql +0 -10
- package/supabase/migrations/20240510110328_add_relationships_to_offer.sql +0 -9
- package/supabase/migrations/20240514100316_offers_public.sql +0 -9
- package/supabase/migrations/20260506013030_add_user_mirror.sql +0 -50
- package/supabase/migrations/20260506013031_add_user_group_mirror.sql +0 -31
- package/supabase/migrations/20260529000000_init_group_payment.sql +0 -79
- package/supabase/migrations/20260529120000_group_payment_realtime.sql +0 -19
- package/supabase/migrations/20260529130000_group_payment_anon_read.sql +0 -16
- package/supabase/migrations/20260601000000_group_payment_concept_norm.sql +0 -20
- package/supabase/migrations/20260605000000_init_partnership_domain.sql +0 -333
- package/supabase/migrations/20260605000100_partnership_recurring_rpc.sql +0 -62
- package/supabase/migrations/20260606000000_partnership_payer.sql +0 -83
- package/supabase/migrations/20260607000000_partnership_partner_number_not_unique.sql +0 -10
- package/supabase/migrations/20260608000000_partnership_payment_method_bizum.sql +0 -2
- package/supabase/migrations/20260609000000_partnership_payment_sepa_end_to_end.sql +0 -13
- package/supabase/migrations/20260617000000_partnership_portal_query_indexes.sql +0 -23
- package/supabase/migrations/20260618000000_partnership_communication_attachments.sql +0 -5
- package/supabase/migrations/20260701000000_partnership_recurring_rpc_drop_ambiguous.sql +0 -29
- package/supabase/migrations/20260713191700_add_personal_calendar_feed.sql +0 -506
- package/supabase/migrations/20260714193734_add_pending_calendar_invitations.sql +0 -403
- package/supabase/migrations/20260714205623_add_event_datetime_end_backfill.sql +0 -64
- package/supabase/migrations/20260729161126_remove_calendar_event_history_dependency.sql +0 -19
- package/supabase/migrations/20260729161202_reconcile_production_remote_schema.sql +0 -135
- package/supabase/migrations/20260804120000_add_calendar_feed_token_cipher.sql +0 -9
- package/supabase/migrations/20260805120000_replace_usergroup_with_group_playerids.sql +0 -363
- package/supabase/seed.sql +0 -2973
- /package/{lib/functions → functions}/auth.d.ts +0 -0
- /package/{lib/functions → functions}/auth.js +0 -0
- /package/{lib/functions → functions}/calendarFeed.d.ts +0 -0
- /package/{lib/functions → functions}/calendarFeed.js +0 -0
- /package/{lib/functions → functions}/communication.d.ts +0 -0
- /package/{lib/functions → functions}/communication.js +0 -0
- /package/{lib/functions → functions}/communicationComment.d.ts +0 -0
- /package/{lib/functions → functions}/communicationComment.js +0 -0
- /package/{lib/functions → functions}/customer.d.ts +0 -0
- /package/{lib/functions → functions}/customer.js +0 -0
- /package/{lib/functions → functions}/customerGroup.d.ts +0 -0
- /package/{lib/functions → functions}/customerGroup.js +0 -0
- /package/{lib/functions → functions}/event.d.ts +0 -0
- /package/{lib/functions → functions}/event.js +0 -0
- /package/{lib/functions → functions}/eventPlayer.d.ts +0 -0
- /package/{lib/functions → functions}/eventPlayer.js +0 -0
- /package/{lib/functions → functions}/eventRepertory.d.ts +0 -0
- /package/{lib/functions → functions}/eventRepertory.js +0 -0
- /package/{lib/functions → functions}/eventoPayout.d.ts +0 -0
- /package/{lib/functions → functions}/eventoPayout.js +0 -0
- /package/{lib/functions → functions}/federation.d.ts +0 -0
- /package/{lib/functions → functions}/federation.js +0 -0
- /package/{lib/functions → functions}/federationPartnership.d.ts +0 -0
- /package/{lib/functions → functions}/federationPartnership.js +0 -0
- /package/{lib/functions → functions}/group.d.ts +0 -0
- /package/{lib/functions → functions}/group.js +0 -0
- /package/{lib/functions → functions}/groupEventStage.d.ts +0 -0
- /package/{lib/functions → functions}/groupEventStage.js +0 -0
- /package/{lib/functions → functions}/groupModule.d.ts +0 -0
- /package/{lib/functions → functions}/groupModule.js +0 -0
- /package/{lib/functions → functions}/groupPayment.d.ts +0 -0
- /package/{lib/functions → functions}/groupPayment.js +0 -0
- /package/{lib/functions → functions}/groupPayoutRule.d.ts +0 -0
- /package/{lib/functions → functions}/groupPayoutRule.js +0 -0
- /package/{lib/functions → functions}/groupPlayer.d.ts +0 -0
- /package/{lib/functions → functions}/groupPlayer.js +0 -0
- /package/{lib/functions → functions}/groupRepertory.d.ts +0 -0
- /package/{lib/functions → functions}/groupRepertory.js +0 -0
- /package/{lib/functions → functions}/index.d.ts +0 -0
- /package/{lib/functions → functions}/index.js +0 -0
- /package/{lib/functions → functions}/inventory.d.ts +0 -0
- /package/{lib/functions → functions}/inventory.js +0 -0
- /package/{lib/functions → functions}/inventoryItem.d.ts +0 -0
- /package/{lib/functions → functions}/inventoryItem.js +0 -0
- /package/{lib/functions → functions}/jwt.d.ts +0 -0
- /package/{lib/functions → functions}/jwt.js +0 -0
- /package/{lib/functions → functions}/misc.d.ts +0 -0
- /package/{lib/functions → functions}/misc.js +0 -0
- /package/{lib/functions → functions}/notification.d.ts +0 -0
- /package/{lib/functions → functions}/notification.js +0 -0
- /package/{lib/functions → functions}/offer.d.ts +0 -0
- /package/{lib/functions → functions}/offer.js +0 -0
- /package/{lib/functions → functions}/offerApplicant.d.ts +0 -0
- /package/{lib/functions → functions}/offerApplicant.js +0 -0
- /package/{lib/functions → functions}/partnership.d.ts +0 -0
- /package/{lib/functions → functions}/partnership.js +0 -0
- /package/{lib/functions → functions}/partnershipCommunication.d.ts +0 -0
- /package/{lib/functions → functions}/partnershipCommunication.js +0 -0
- /package/{lib/functions → functions}/partnershipGroup.d.ts +0 -0
- /package/{lib/functions → functions}/partnershipGroup.js +0 -0
- /package/{lib/functions → functions}/partnershipPartner.d.ts +0 -0
- /package/{lib/functions → functions}/partnershipPartner.js +0 -0
- /package/{lib/functions → functions}/partnershipPayment.d.ts +0 -0
- /package/{lib/functions → functions}/partnershipPayment.js +0 -0
- /package/{lib/functions → functions}/partnershipPlan.d.ts +0 -0
- /package/{lib/functions → functions}/partnershipPlan.js +0 -0
- /package/{lib/functions → functions}/partnershipSepaPaymentGroup.d.ts +0 -0
- /package/{lib/functions → functions}/partnershipSepaPaymentGroup.js +0 -0
- /package/{lib/functions → functions}/partnershipSubscription.d.ts +0 -0
- /package/{lib/functions → functions}/partnershipSubscription.js +0 -0
- /package/{lib/functions → functions}/regions.d.ts +0 -0
- /package/{lib/functions → functions}/regions.js +0 -0
- /package/{lib/functions → functions}/subscription.d.ts +0 -0
- /package/{lib/functions → functions}/subscription.js +0 -0
- /package/{lib/functions → functions}/user.d.ts +0 -0
- /package/{lib/functions → functions}/user.js +0 -0
- /package/{lib/functions → functions}/userNotification.d.ts +0 -0
- /package/{lib/functions → functions}/userNotification.js +0 -0
- /package/{lib/helpers → helpers}/appScenes.d.ts +0 -0
- /package/{lib/helpers → helpers}/appScenes.js +0 -0
- /package/{lib/helpers → helpers}/audios.d.ts +0 -0
- /package/{lib/helpers → helpers}/audios.js +0 -0
- /package/{lib/helpers → helpers}/auth.d.ts +0 -0
- /package/{lib/helpers → helpers}/auth.js +0 -0
- /package/{lib/helpers → helpers}/badges.d.ts +0 -0
- /package/{lib/helpers → helpers}/badges.js +0 -0
- /package/{lib/helpers → helpers}/collections.d.ts +0 -0
- /package/{lib/helpers → helpers}/collections.js +0 -0
- /package/{lib/helpers → helpers}/communicationTemplate/index.d.ts +0 -0
- /package/{lib/helpers → helpers}/communicationTemplate/index.js +0 -0
- /package/{lib/helpers → helpers}/communicationTemplate/newGroup.d.ts +0 -0
- /package/{lib/helpers → helpers}/communicationTemplate/newGroup.js +0 -0
- /package/{lib/helpers → helpers}/communicationTemplate/newMember.d.ts +0 -0
- /package/{lib/helpers → helpers}/communicationTemplate/newMember.js +0 -0
- /package/{lib/helpers → helpers}/countries.d.ts +0 -0
- /package/{lib/helpers → helpers}/countries.js +0 -0
- /package/{lib/helpers → helpers}/currency.d.ts +0 -0
- /package/{lib/helpers → helpers}/currency.js +0 -0
- /package/{lib/helpers → helpers}/dlinks.d.ts +0 -0
- /package/{lib/helpers → helpers}/dlinks.js +0 -0
- /package/{lib/helpers → helpers}/errors.d.ts +0 -0
- /package/{lib/helpers → helpers}/errors.js +0 -0
- /package/{lib/helpers → helpers}/fileSections/index.d.ts +0 -0
- /package/{lib/helpers → helpers}/fileSections/index.js +0 -0
- /package/{lib/helpers → helpers}/fileSections/orders.d.ts +0 -0
- /package/{lib/helpers → helpers}/fileSections/orders.js +0 -0
- /package/{lib/helpers → helpers}/glissandooAdmin.d.ts +0 -0
- /package/{lib/helpers → helpers}/glissandooAdmin.js +0 -0
- /package/{lib/helpers → helpers}/instruments/index.d.ts +0 -0
- /package/{lib/helpers → helpers}/instruments/index.js +0 -0
- /package/{lib/helpers → helpers}/instruments/lists.d.ts +0 -0
- /package/{lib/helpers → helpers}/instruments/lists.js +0 -0
- /package/{lib/helpers → helpers}/instruments/orders.d.ts +0 -0
- /package/{lib/helpers → helpers}/instruments/orders.js +0 -0
- /package/{lib/helpers → helpers}/musicStyles/index.d.ts +0 -0
- /package/{lib/helpers → helpers}/musicStyles/index.js +0 -0
- /package/{lib/helpers → helpers}/musicStyles/orders.d.ts +0 -0
- /package/{lib/helpers → helpers}/musicStyles/orders.js +0 -0
- /package/{lib/helpers → helpers}/notifications/index.d.ts +0 -0
- /package/{lib/helpers → helpers}/notifications/index.js +0 -0
- /package/{lib/helpers → helpers}/notifications/placeholders.d.ts +0 -0
- /package/{lib/helpers → helpers}/notifications/placeholders.js +0 -0
- /package/{lib/helpers → helpers}/objects.d.ts +0 -0
- /package/{lib/helpers → helpers}/objects.js +0 -0
- /package/{lib/helpers → helpers}/paymentForecast.d.ts +0 -0
- /package/{lib/helpers → helpers}/paymentForecast.js +0 -0
- /package/{lib/helpers → helpers}/payoutRules.d.ts +0 -0
- /package/{lib/helpers → helpers}/payoutRules.js +0 -0
- /package/{lib/helpers → helpers}/plans.d.ts +0 -0
- /package/{lib/helpers → helpers}/plans.js +0 -0
- /package/{lib/helpers → helpers}/rates.d.ts +0 -0
- /package/{lib/helpers → helpers}/rates.js +0 -0
- /package/{lib/helpers → helpers}/reasons.d.ts +0 -0
- /package/{lib/helpers → helpers}/reasons.js +0 -0
- /package/{lib/helpers → helpers}/slate.d.ts +0 -0
- /package/{lib/helpers → helpers}/slate.js +0 -0
- /package/{lib/helpers → helpers}/styles.d.ts +0 -0
- /package/{lib/helpers → helpers}/styles.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/array-includes.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/array-includes.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/as-mutable.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/as-mutable.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/assert-error.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/assert-error.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/index.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/index.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-defined.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-defined.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-empty.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-empty.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-finite.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-finite.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-infinite.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-infinite.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-integer.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-integer.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-present.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-present.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-safe-integer.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/is-safe-integer.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-entries.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-entries.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-from-entries.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-from-entries.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-has-own.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-has-own.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-keys.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/object-keys.js +0 -0
- /package/{lib/helpers → helpers}/ts-extras/set-has.d.ts +0 -0
- /package/{lib/helpers → helpers}/ts-extras/set-has.js +0 -0
- /package/{lib/helpers → helpers}/types.d.ts +0 -0
- /package/{lib/helpers → helpers}/types.js +0 -0
- /package/{lib/helpers → helpers}/utils.d.ts +0 -0
- /package/{lib/helpers → helpers}/utils.js +0 -0
- /package/{lib/index.d.ts → index.d.ts} +0 -0
- /package/{lib/index.js → index.js} +0 -0
- /package/{lib/lang → lang}/ca.json +0 -0
- /package/{lib/lang → lang}/de.json +0 -0
- /package/{lib/lang → lang}/en.json +0 -0
- /package/{lib/lang → lang}/es.json +0 -0
- /package/{lib/lang → lang}/eu.json +0 -0
- /package/{lib/lang → lang}/fr.json +0 -0
- /package/{lib/lang → lang}/gl.json +0 -0
- /package/{lib/lang → lang}/index.d.ts +0 -0
- /package/{lib/lang → lang}/index.js +0 -0
- /package/{lib/lang → lang}/it.json +0 -0
- /package/{lib/lang → lang}/nl.json +0 -0
- /package/{lib/lang → lang}/pt.json +0 -0
- /package/{lib/models → models}/Communication/Comment/index.d.ts +0 -0
- /package/{lib/models → models}/Communication/Comment/index.js +0 -0
- /package/{lib/models → models}/Communication/Comment/types.d.ts +0 -0
- /package/{lib/models → models}/Communication/Comment/types.js +0 -0
- /package/{lib/models → models}/Communication/index.d.ts +0 -0
- /package/{lib/models → models}/Communication/index.js +0 -0
- /package/{lib/models → models}/Communication/types.d.ts +0 -0
- /package/{lib/models → models}/Communication/types.js +0 -0
- /package/{lib/models → models}/Counters/Group/Analytics/index.d.ts +0 -0
- /package/{lib/models → models}/Counters/Group/Analytics/index.js +0 -0
- /package/{lib/models → models}/Counters/Group/Analytics/types.d.ts +0 -0
- /package/{lib/models → models}/Counters/Group/Analytics/types.js +0 -0
- /package/{lib/models → models}/Counters/Group/index.d.ts +0 -0
- /package/{lib/models → models}/Counters/Group/index.js +0 -0
- /package/{lib/models → models}/Counters/Group/types.d.ts +0 -0
- /package/{lib/models → models}/Counters/Group/types.js +0 -0
- /package/{lib/models → models}/Counters/event.d.ts +0 -0
- /package/{lib/models → models}/Counters/event.js +0 -0
- /package/{lib/models → models}/Counters/index.d.ts +0 -0
- /package/{lib/models → models}/Counters/index.js +0 -0
- /package/{lib/models → models}/Counters/types.d.ts +0 -0
- /package/{lib/models → models}/Counters/types.js +0 -0
- /package/{lib/models → models}/Customer/Group/index.d.ts +0 -0
- /package/{lib/models → models}/Customer/Group/index.js +0 -0
- /package/{lib/models → models}/Customer/Group/types.d.ts +0 -0
- /package/{lib/models → models}/Customer/Group/types.js +0 -0
- /package/{lib/models → models}/Customer/basic.d.ts +0 -0
- /package/{lib/models → models}/Customer/basic.js +0 -0
- /package/{lib/models → models}/Customer/index.d.ts +0 -0
- /package/{lib/models → models}/Customer/index.js +0 -0
- /package/{lib/models → models}/Customer/types.d.ts +0 -0
- /package/{lib/models → models}/Customer/types.js +0 -0
- /package/{lib/models → models}/Evento/Player/basic.d.ts +0 -0
- /package/{lib/models → models}/Evento/Player/basic.js +0 -0
- /package/{lib/models → models}/Evento/Player/index.d.ts +0 -0
- /package/{lib/models → models}/Evento/Player/index.js +0 -0
- /package/{lib/models → models}/Evento/Player/types.d.ts +0 -0
- /package/{lib/models → models}/Evento/Player/types.js +0 -0
- /package/{lib/models → models}/Evento/Repertory/index.d.ts +0 -0
- /package/{lib/models → models}/Evento/Repertory/index.js +0 -0
- /package/{lib/models → models}/Evento/Repertory/types.d.ts +0 -0
- /package/{lib/models → models}/Evento/Repertory/types.js +0 -0
- /package/{lib/models → models}/Evento/basic.d.ts +0 -0
- /package/{lib/models → models}/Evento/basic.js +0 -0
- /package/{lib/models → models}/Evento/index.d.ts +0 -0
- /package/{lib/models → models}/Evento/index.js +0 -0
- /package/{lib/models → models}/Evento/promoter.d.ts +0 -0
- /package/{lib/models → models}/Evento/promoter.js +0 -0
- /package/{lib/models → models}/Evento/tiny.d.ts +0 -0
- /package/{lib/models → models}/Evento/tiny.js +0 -0
- /package/{lib/models → models}/Evento/types.d.ts +0 -0
- /package/{lib/models → models}/Evento/types.js +0 -0
- /package/{lib/models → models}/Federation/Partnership/index.d.ts +0 -0
- /package/{lib/models → models}/Federation/Partnership/index.js +0 -0
- /package/{lib/models → models}/Federation/Partnership/types.d.ts +0 -0
- /package/{lib/models → models}/Federation/Partnership/types.js +0 -0
- /package/{lib/models → models}/Federation/index.d.ts +0 -0
- /package/{lib/models → models}/Federation/index.js +0 -0
- /package/{lib/models → models}/Federation/types.d.ts +0 -0
- /package/{lib/models → models}/Federation/types.js +0 -0
- /package/{lib/models → models}/Group/Analytics/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Analytics/index.js +0 -0
- /package/{lib/models → models}/Group/Analytics/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Analytics/types.js +0 -0
- /package/{lib/models → models}/Group/Event/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Event/index.js +0 -0
- /package/{lib/models → models}/Group/Event/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Event/types.js +0 -0
- /package/{lib/models → models}/Group/Payment/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Payment/index.js +0 -0
- /package/{lib/models → models}/Group/Payment/supabase.d.ts +0 -0
- /package/{lib/models → models}/Group/Payment/supabase.js +0 -0
- /package/{lib/models → models}/Group/Payment/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Payment/types.js +0 -0
- /package/{lib/models → models}/Group/Player/Event/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Player/Event/index.js +0 -0
- /package/{lib/models → models}/Group/Player/Event/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Player/Event/types.js +0 -0
- /package/{lib/models → models}/Group/Player/Log/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Player/Log/index.js +0 -0
- /package/{lib/models → models}/Group/Player/Log/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Player/Log/types.js +0 -0
- /package/{lib/models → models}/Group/Player/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Player/index.js +0 -0
- /package/{lib/models → models}/Group/Player/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Player/types.js +0 -0
- /package/{lib/models → models}/Group/Repertory/File/Section/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Repertory/File/Section/index.js +0 -0
- /package/{lib/models → models}/Group/Repertory/File/Section/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Repertory/File/Section/types.js +0 -0
- /package/{lib/models → models}/Group/Repertory/File/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Repertory/File/index.js +0 -0
- /package/{lib/models → models}/Group/Repertory/File/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Repertory/File/types.js +0 -0
- /package/{lib/models → models}/Group/Repertory/FilePath/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Repertory/FilePath/index.js +0 -0
- /package/{lib/models → models}/Group/Repertory/index.d.ts +0 -0
- /package/{lib/models → models}/Group/Repertory/index.js +0 -0
- /package/{lib/models → models}/Group/Repertory/types.d.ts +0 -0
- /package/{lib/models → models}/Group/Repertory/types.js +0 -0
- /package/{lib/models → models}/Group/StageTemplate/index.d.ts +0 -0
- /package/{lib/models → models}/Group/StageTemplate/index.js +0 -0
- /package/{lib/models → models}/Group/StageTemplate/types.d.ts +0 -0
- /package/{lib/models → models}/Group/StageTemplate/types.js +0 -0
- /package/{lib/models → models}/Group/basic.d.ts +0 -0
- /package/{lib/models → models}/Group/basic.js +0 -0
- /package/{lib/models → models}/Group/index.d.ts +0 -0
- /package/{lib/models → models}/Group/index.js +0 -0
- /package/{lib/models → models}/Group/types.d.ts +0 -0
- /package/{lib/models → models}/Group/types.js +0 -0
- /package/{lib/models → models}/Instrument/group.d.ts +0 -0
- /package/{lib/models → models}/Instrument/group.js +0 -0
- /package/{lib/models → models}/Instrument/index.d.ts +0 -0
- /package/{lib/models → models}/Instrument/index.js +0 -0
- /package/{lib/models → models}/Inventory/Item/index.d.ts +0 -0
- /package/{lib/models → models}/Inventory/Item/index.js +0 -0
- /package/{lib/models → models}/Inventory/Item/types.d.ts +0 -0
- /package/{lib/models → models}/Inventory/Item/types.js +0 -0
- /package/{lib/models → models}/Inventory/index.d.ts +0 -0
- /package/{lib/models → models}/Inventory/index.js +0 -0
- /package/{lib/models → models}/Inventory/types.d.ts +0 -0
- /package/{lib/models → models}/Inventory/types.js +0 -0
- /package/{lib/models → models}/Metrics/index.d.ts +0 -0
- /package/{lib/models → models}/Metrics/index.js +0 -0
- /package/{lib/models → models}/Metrics/types.d.ts +0 -0
- /package/{lib/models → models}/Metrics/types.js +0 -0
- /package/{lib/models → models}/Model/index.d.ts +0 -0
- /package/{lib/models → models}/Model/index.js +0 -0
- /package/{lib/models → models}/Model/lang.d.ts +0 -0
- /package/{lib/models → models}/Model/lang.js +0 -0
- /package/{lib/models → models}/MusicStyle/index.d.ts +0 -0
- /package/{lib/models → models}/MusicStyle/index.js +0 -0
- /package/{lib/models → models}/Notification/index.d.ts +0 -0
- /package/{lib/models → models}/Notification/index.js +0 -0
- /package/{lib/models → models}/Notification/types.d.ts +0 -0
- /package/{lib/models → models}/Notification/types.js +0 -0
- /package/{lib/models → models}/Offer/Applicant/index.d.ts +0 -0
- /package/{lib/models → models}/Offer/Applicant/index.js +0 -0
- /package/{lib/models → models}/Offer/Applicant/types.d.ts +0 -0
- /package/{lib/models → models}/Offer/Applicant/types.js +0 -0
- /package/{lib/models → models}/Offer/index.d.ts +0 -0
- /package/{lib/models → models}/Offer/index.js +0 -0
- /package/{lib/models → models}/Offer/types.d.ts +0 -0
- /package/{lib/models → models}/Offer/types.js +0 -0
- /package/{lib/models → models}/Partnership/Communication/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Communication/index.js +0 -0
- /package/{lib/models → models}/Partnership/Communication/supabase.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Communication/supabase.js +0 -0
- /package/{lib/models → models}/Partnership/Communication/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Communication/types.js +0 -0
- /package/{lib/models → models}/Partnership/Group/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Group/index.js +0 -0
- /package/{lib/models → models}/Partnership/Group/supabase.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Group/supabase.js +0 -0
- /package/{lib/models → models}/Partnership/Group/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Group/types.js +0 -0
- /package/{lib/models → models}/Partnership/Partner/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Partner/index.js +0 -0
- /package/{lib/models → models}/Partnership/Partner/supabase.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Partner/supabase.js +0 -0
- /package/{lib/models → models}/Partnership/Partner/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Partner/types.js +0 -0
- /package/{lib/models → models}/Partnership/Payment/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Payment/index.js +0 -0
- /package/{lib/models → models}/Partnership/Payment/supabase.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Payment/supabase.js +0 -0
- /package/{lib/models → models}/Partnership/Payment/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Payment/types.js +0 -0
- /package/{lib/models → models}/Partnership/Plan/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Plan/index.js +0 -0
- /package/{lib/models → models}/Partnership/Plan/supabase.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Plan/supabase.js +0 -0
- /package/{lib/models → models}/Partnership/Plan/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Plan/types.js +0 -0
- /package/{lib/models → models}/Partnership/SepaPaymentGroup/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/SepaPaymentGroup/index.js +0 -0
- /package/{lib/models → models}/Partnership/SepaPaymentGroup/supabase.d.ts +0 -0
- /package/{lib/models → models}/Partnership/SepaPaymentGroup/supabase.js +0 -0
- /package/{lib/models → models}/Partnership/SepaPaymentGroup/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/SepaPaymentGroup/types.js +0 -0
- /package/{lib/models → models}/Partnership/Subscription/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Subscription/index.js +0 -0
- /package/{lib/models → models}/Partnership/Subscription/supabase.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Subscription/supabase.js +0 -0
- /package/{lib/models → models}/Partnership/Subscription/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/Subscription/types.js +0 -0
- /package/{lib/models → models}/Partnership/basic.d.ts +0 -0
- /package/{lib/models → models}/Partnership/basic.js +0 -0
- /package/{lib/models → models}/Partnership/index.d.ts +0 -0
- /package/{lib/models → models}/Partnership/index.js +0 -0
- /package/{lib/models → models}/Partnership/types.d.ts +0 -0
- /package/{lib/models → models}/Partnership/types.js +0 -0
- /package/{lib/models → models}/Player/basic.d.ts +0 -0
- /package/{lib/models → models}/Player/basic.js +0 -0
- /package/{lib/models → models}/Player/types.d.ts +0 -0
- /package/{lib/models → models}/Player/types.js +0 -0
- /package/{lib/models → models}/Repertory/basic.d.ts +0 -0
- /package/{lib/models → models}/Repertory/basic.js +0 -0
- /package/{lib/models → models}/Repertory/types.d.ts +0 -0
- /package/{lib/models → models}/Repertory/types.js +0 -0
- /package/{lib/models → models}/User/Group/index.d.ts +0 -0
- /package/{lib/models → models}/User/Group/index.js +0 -0
- /package/{lib/models → models}/User/Group/types.d.ts +0 -0
- /package/{lib/models → models}/User/Group/types.js +0 -0
- /package/{lib/models → models}/User/Notification/index.d.ts +0 -0
- /package/{lib/models → models}/User/Notification/index.js +0 -0
- /package/{lib/models → models}/User/Notification/types.d.ts +0 -0
- /package/{lib/models → models}/User/Notification/types.js +0 -0
- /package/{lib/models → models}/User/OfferAlarm/index.d.ts +0 -0
- /package/{lib/models → models}/User/OfferAlarm/index.js +0 -0
- /package/{lib/models → models}/User/OfferAlarm/types.d.ts +0 -0
- /package/{lib/models → models}/User/OfferAlarm/types.js +0 -0
- /package/{lib/models → models}/User/Partnership/index.d.ts +0 -0
- /package/{lib/models → models}/User/Partnership/index.js +0 -0
- /package/{lib/models → models}/User/Partnership/types.d.ts +0 -0
- /package/{lib/models → models}/User/Partnership/types.js +0 -0
- /package/{lib/models → models}/User/basic.d.ts +0 -0
- /package/{lib/models → models}/User/basic.js +0 -0
- /package/{lib/models → models}/User/extended.d.ts +0 -0
- /package/{lib/models → models}/User/extended.js +0 -0
- /package/{lib/models → models}/User/index.d.ts +0 -0
- /package/{lib/models → models}/User/index.js +0 -0
- /package/{lib/models → models}/User/types.d.ts +0 -0
- /package/{lib/models → models}/User/types.js +0 -0
- /package/{lib/models → models}/WebhookEvent/index.d.ts +0 -0
- /package/{lib/models → models}/WebhookEvent/index.js +0 -0
- /package/{lib/models → models}/WebhookEvent/types.d.ts +0 -0
- /package/{lib/models → models}/WebhookEvent/types.js +0 -0
- /package/{lib/types → types}/firestore.d.ts +0 -0
- /package/{lib/types → types}/firestore.js +0 -0
- /package/{lib/types → types}/messagebirdChatWidget.d.ts +0 -0
- /package/{lib/types → types}/messagebirdChatWidget.js +0 -0
- /package/{lib/types → types}/minVersion.d.ts +0 -0
- /package/{lib/types → types}/minVersion.js +0 -0
- /package/{lib/types → types}/payoutRule.d.ts +0 -0
- /package/{lib/types → types}/payoutRule.js +0 -0
- /package/{lib/types → types}/supabase/generated.d.ts +0 -0
- /package/{lib/types → types}/supabase/generated.js +0 -0
- /package/{lib/types → types}/supabase/index.d.ts +0 -0
- /package/{lib/types → types}/supabase/index.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/comm.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/comm.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/comm_history.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/comm_history.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/event.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/event.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/event_history.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/event_history.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/group.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/group.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/group_history.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/group_history.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/index.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/index.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/offer.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/offer.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/offer_history.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/offer_history.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/repertoire.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/repertoire.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/repertoire_history.d.ts +0 -0
- /package/{lib/types → types}/supabase/overwrites/repertoire_history.js +0 -0
- /package/{lib/types → types}/supabase/overwrites/utils.d.ts +0 -0
- /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;
|