@reachy/audience-module 1.0.18 → 1.0.19

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.
@@ -8,10 +8,11 @@ export class SupabaseContactRepository {
8
8
  private supabase: any
9
9
  private engine: V2AudienceEngine
10
10
 
11
- constructor(params: { supabaseClient: any; debug?: boolean; logger?: any }) {
11
+ constructor(params: { supabaseClient: any; clickhouseClient?: any; debug?: boolean; logger?: any }) {
12
12
  this.supabase = params.supabaseClient
13
13
  this.engine = new V2AudienceEngine({
14
14
  supabaseClient: params.supabaseClient,
15
+ clickhouseClient: params.clickhouseClient,
15
16
  debug: params.debug,
16
17
  logger: params.logger
17
18
  })
@@ -130,6 +130,12 @@ export interface AudienceBuilderConfig {
130
130
  * sem depender de repositórios do reachy-api.
131
131
  */
132
132
  supabaseClient?: any
133
+ /**
134
+ * Quando fornecido, o engine V2 usa ClickHouse para avaliar rules de evento (kind='event')
135
+ * em vez do Supabase — elimina N queries paginadas + JS aggregation.
136
+ * Requer AUDIENCE_EVENTS_BACKEND=clickhouse na aplicação que instancia o módulo.
137
+ */
138
+ clickhouseClient?: any
133
139
  }
134
140
 
135
141
  export interface CreateAudienceData {