@rjromeoent/ein-supabase 0.1.5 → 0.1.6

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/README.md CHANGED
@@ -31,9 +31,21 @@ From the Event Intelligence Network repo root:
31
31
  ```sh
32
32
  npm install
33
33
  npm run generate:supabase-types
34
+ npm run test:functions
35
+ npm run test:db:rad
34
36
  npm run build:packages
37
+ npm run verify:ein-supabase
35
38
  ```
36
39
 
40
+ `test:db:rad` is an optional integration test suite. It requires
41
+ `DATABASE_URL` to point at a disposable or remote Supabase Postgres database
42
+ and each SQL test runs inside a transaction that rolls back its fixtures. It
43
+ proves the RAD Booking offer-context consumer RPC updates both the read model
44
+ and event consumer offset against real database constraints, and it validates
45
+ RAD decision integrity rules such as append-only decision logs and
46
+ offer-created/link consistency. It also verifies app-scoped RAD RLS blocks
47
+ cross-organization decision-log reads under the `authenticated` role.
48
+
37
49
  Or from this package directory:
38
50
 
39
51
  ```sh
@@ -54,11 +66,17 @@ available to the publishing user, types are regenerated, and the package build
54
66
  passes:
55
67
 
56
68
  ```sh
57
- npm run build:packages
69
+ npm run verify:ein-supabase
58
70
  npm run pack:ein-supabase
59
71
  npm run publish:ein-supabase
60
72
  ```
61
73
 
74
+ `verify:ein-supabase` regenerates Supabase types, fails if the generated
75
+ database contract is not committed, runs Deno edge-function tests, builds the
76
+ package, and runs an npm pack dry-run. The rollbacked DB integration test is
77
+ kept as an explicit script because it needs a live Postgres connection.
78
+ Publishing should not happen from unverified or locally drifted schema types.
79
+
62
80
  The package is configured as a public scoped package. That is intentional for
63
81
  Lovable apps: app deploys can install it without an npm auth token. Do not put
64
82
  secrets, service-role keys, database passwords, or private environment values in
@@ -19021,6 +19021,101 @@ export type Database = {
19021
19021
  };
19022
19022
  };
19023
19023
  Functions: {
19024
+ advanced_filtered_availability_search_rows: {
19025
+ Args: {
19026
+ p_active_only?: boolean;
19027
+ p_agencies?: string[];
19028
+ p_artists?: string[];
19029
+ p_assigned_only?: boolean;
19030
+ p_center_city?: string;
19031
+ p_city?: string;
19032
+ p_date_from: string;
19033
+ p_date_to: string;
19034
+ p_event_edition_id?: string;
19035
+ p_fanbase_max?: number;
19036
+ p_fanbase_min?: number;
19037
+ p_genres?: string[];
19038
+ p_has_market_conflict?: boolean;
19039
+ p_has_nearby_interest?: boolean;
19040
+ p_has_radius_conflict?: boolean;
19041
+ p_has_routing_opportunity?: boolean;
19042
+ p_momentums?: string[];
19043
+ p_organization_id: string;
19044
+ p_quote_high?: number;
19045
+ p_quote_low?: number;
19046
+ p_radius_miles?: number;
19047
+ p_require_available_with_routing?: boolean;
19048
+ p_search?: string;
19049
+ p_spotify_max?: number;
19050
+ p_spotify_min?: number;
19051
+ p_states?: string[];
19052
+ p_statuses?: string[];
19053
+ };
19054
+ Returns: {
19055
+ agency: string;
19056
+ analytics_activity_score: number;
19057
+ analytics_activity_tier: string;
19058
+ analytics_artist_rank: number;
19059
+ analytics_chartmetric_id: string;
19060
+ analytics_instagram_engagement: number;
19061
+ analytics_instagram_followers: number;
19062
+ analytics_last_updated_at: string;
19063
+ analytics_next_update_due: string;
19064
+ analytics_spotify_followers: number;
19065
+ analytics_spotify_monthly_listeners: number;
19066
+ analytics_tiktok_engagement: number;
19067
+ analytics_tiktok_followers: number;
19068
+ analytics_tiktok_track_posts: number;
19069
+ analytics_total_fanbase: number;
19070
+ artist_id: string;
19071
+ artist_name: string;
19072
+ artist_normalized_name: string;
19073
+ confidence: number;
19074
+ core_artist_website: string;
19075
+ data_freshness_days: number;
19076
+ date: string;
19077
+ distance_miles: number;
19078
+ financials_avg_gross: number;
19079
+ financials_avg_guarantee: number;
19080
+ financials_avg_tickets_sold: number;
19081
+ financials_quote_high: number;
19082
+ financials_quote_low: number;
19083
+ financials_total_shows: number;
19084
+ genre: string;
19085
+ historical_scrape_status: string;
19086
+ id: string;
19087
+ inferred_at: string;
19088
+ interest_source: string;
19089
+ is_active: boolean;
19090
+ is_assigned: boolean;
19091
+ is_inferred: boolean;
19092
+ is_market_match: boolean;
19093
+ is_radius_match: boolean;
19094
+ last_scraped_at: string;
19095
+ last_sync_status: string;
19096
+ lineage: Json;
19097
+ location_city_key: string;
19098
+ market_city: string;
19099
+ market_id: string;
19100
+ market_market: string;
19101
+ market_state: string;
19102
+ momentum: string;
19103
+ organization_id: string;
19104
+ primary_source: string;
19105
+ reg_last_mod_date: string;
19106
+ reg_last_synced_at: string;
19107
+ reg_metadata_last_synced_at: string;
19108
+ status: string;
19109
+ status_display: string;
19110
+ tracked_artist_id: string;
19111
+ tracked_artist_website: string;
19112
+ updated_at: string;
19113
+ venue_capacity: number;
19114
+ venue_id: string;
19115
+ venue_name: string;
19116
+ venue_type: string;
19117
+ }[];
19118
+ };
19024
19119
  consume_booking_offer_context_events: {
19025
19120
  Args: {
19026
19121
  _consumer_name?: string;
@@ -19042,11 +19137,16 @@ export type Database = {
19042
19137
  p_fanbase_max?: number;
19043
19138
  p_fanbase_min?: number;
19044
19139
  p_genres?: string[];
19140
+ p_has_market_conflict?: boolean;
19141
+ p_has_nearby_interest?: boolean;
19142
+ p_has_radius_conflict?: boolean;
19143
+ p_has_routing_opportunity?: boolean;
19045
19144
  p_momentums?: string[];
19046
19145
  p_organization_id: string;
19047
19146
  p_quote_high?: number;
19048
19147
  p_quote_low?: number;
19049
19148
  p_radius_miles?: number;
19149
+ p_require_available_with_routing?: boolean;
19050
19150
  p_search?: string;
19051
19151
  p_spotify_max?: number;
19052
19152
  p_spotify_min?: number;
@@ -19055,6 +19155,24 @@ export type Database = {
19055
19155
  };
19056
19156
  Returns: number;
19057
19157
  };
19158
+ dashboard_advanced_filtered_window_ids: {
19159
+ Args: {
19160
+ p_availability_window_ids: string[];
19161
+ p_center_city?: string;
19162
+ p_has_market_conflict?: boolean;
19163
+ p_has_nearby_interest?: boolean;
19164
+ p_has_radius_conflict?: boolean;
19165
+ p_has_routing_opportunity?: boolean;
19166
+ p_interest_from?: string;
19167
+ p_interest_to?: string;
19168
+ p_organization_id: string;
19169
+ p_radius_miles?: number;
19170
+ p_require_available_with_routing?: boolean;
19171
+ };
19172
+ Returns: {
19173
+ availability_window_id: string;
19174
+ }[];
19175
+ };
19058
19176
  filtered_availability_search_rows: {
19059
19177
  Args: {
19060
19178
  p_active_only?: boolean;
@@ -19668,6 +19786,10 @@ export type Database = {
19668
19786
  p_fanbase_max?: number;
19669
19787
  p_fanbase_min?: number;
19670
19788
  p_genres?: string[];
19789
+ p_has_market_conflict?: boolean;
19790
+ p_has_nearby_interest?: boolean;
19791
+ p_has_radius_conflict?: boolean;
19792
+ p_has_routing_opportunity?: boolean;
19671
19793
  p_limit?: number;
19672
19794
  p_momentums?: string[];
19673
19795
  p_offset?: number;
@@ -19675,6 +19797,7 @@ export type Database = {
19675
19797
  p_quote_high?: number;
19676
19798
  p_quote_low?: number;
19677
19799
  p_radius_miles?: number;
19800
+ p_require_available_with_routing?: boolean;
19678
19801
  p_search?: string;
19679
19802
  p_spotify_max?: number;
19680
19803
  p_spotify_min?: number;
@@ -19779,6 +19902,10 @@ export type Database = {
19779
19902
  p_fanbase_max?: number;
19780
19903
  p_fanbase_min?: number;
19781
19904
  p_genres?: string[];
19905
+ p_has_market_conflict?: boolean;
19906
+ p_has_nearby_interest?: boolean;
19907
+ p_has_radius_conflict?: boolean;
19908
+ p_has_routing_opportunity?: boolean;
19782
19909
  p_momentums?: string[];
19783
19910
  p_organization_id: string;
19784
19911
  p_page?: number;
@@ -19786,6 +19913,7 @@ export type Database = {
19786
19913
  p_quote_high?: number;
19787
19914
  p_quote_low?: number;
19788
19915
  p_radius_miles?: number;
19916
+ p_require_available_with_routing?: boolean;
19789
19917
  p_search?: string;
19790
19918
  p_spotify_max?: number;
19791
19919
  p_spotify_min?: number;
@@ -19872,11 +20000,16 @@ export type Database = {
19872
20000
  p_fanbase_max?: number;
19873
20001
  p_fanbase_min?: number;
19874
20002
  p_genres?: string[];
20003
+ p_has_market_conflict?: boolean;
20004
+ p_has_nearby_interest?: boolean;
20005
+ p_has_radius_conflict?: boolean;
20006
+ p_has_routing_opportunity?: boolean;
19875
20007
  p_momentums?: string[];
19876
20008
  p_organization_id: string;
19877
20009
  p_quote_high?: number;
19878
20010
  p_quote_low?: number;
19879
20011
  p_radius_miles?: number;
20012
+ p_require_available_with_routing?: boolean;
19880
20013
  p_search?: string;
19881
20014
  p_spotify_max?: number;
19882
20015
  p_spotify_min?: number;
@@ -19915,6 +20048,10 @@ export type Database = {
19915
20048
  p_fanbase_max?: number;
19916
20049
  p_fanbase_min?: number;
19917
20050
  p_genres?: string[];
20051
+ p_has_market_conflict?: boolean;
20052
+ p_has_nearby_interest?: boolean;
20053
+ p_has_radius_conflict?: boolean;
20054
+ p_has_routing_opportunity?: boolean;
19918
20055
  p_momentums?: string[];
19919
20056
  p_organization_id: string;
19920
20057
  p_page?: number;
@@ -19922,6 +20059,7 @@ export type Database = {
19922
20059
  p_quote_high?: number;
19923
20060
  p_quote_low?: number;
19924
20061
  p_radius_miles?: number;
20062
+ p_require_available_with_routing?: boolean;
19925
20063
  p_search?: string;
19926
20064
  p_spotify_max?: number;
19927
20065
  p_spotify_min?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjromeoent/ein-supabase",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Shared Supabase types, app context, and contract helpers for EIN-connected apps.",
5
5
  "type": "module",
6
6
  "sideEffects": false,