@fayz-ai/plugin-conversations 0.26.0 → 0.27.1
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/dist/CampaignsSurface-75POQIRI.js +860 -0
- package/dist/CampaignsSurface-75POQIRI.js.map +1 -0
- package/dist/{ConversationsPage-7W7LDH2H.js → ConversationsPage-RYEND3MG.js} +345 -170
- package/dist/ConversationsPage-RYEND3MG.js.map +1 -0
- package/dist/TemplatesSurface-QNTRYYTX.js +281 -0
- package/dist/TemplatesSurface-QNTRYYTX.js.map +1 -0
- package/dist/chunk-4OWC3V53.js +323 -0
- package/dist/chunk-4OWC3V53.js.map +1 -0
- package/dist/chunk-HMWUU5O7.js +75 -0
- package/dist/chunk-HMWUU5O7.js.map +1 -0
- package/dist/{chunk-6EZLUC62.js → chunk-VZLFELO6.js} +4 -74
- package/dist/chunk-VZLFELO6.js.map +1 -0
- package/dist/data/journeys.d.ts +198 -0
- package/dist/data/journeys.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +106 -10
- package/dist/index.js.map +1 -1
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/main.browser.js +3 -1
- package/dist/migrations/main.browser.js.map +1 -1
- package/dist/migrations/main.js +260 -2
- package/dist/migrations/main.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/views/ContactPanel.d.ts.map +1 -1
- package/dist/views/ConversationList.d.ts.map +1 -1
- package/dist/views/ConversationsPage.d.ts +2 -0
- package/dist/views/ConversationsPage.d.ts.map +1 -1
- package/dist/views/MessageThread.d.ts.map +1 -1
- package/dist/views/campaigns/CampaignWizard.d.ts +8 -0
- package/dist/views/campaigns/CampaignWizard.d.ts.map +1 -0
- package/dist/views/campaigns/CampaignsSurface.d.ts +4 -0
- package/dist/views/campaigns/CampaignsSurface.d.ts.map +1 -0
- package/dist/views/campaigns/NumberProtection.d.ts +5 -0
- package/dist/views/campaigns/NumberProtection.d.ts.map +1 -0
- package/dist/views/campaigns/TemplatesSurface.d.ts +3 -0
- package/dist/views/campaigns/TemplatesSurface.d.ts.map +1 -0
- package/dist/views/contact-profile.d.ts +58 -0
- package/dist/views/contact-profile.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/ConversationsPage-7W7LDH2H.js.map +0 -1
- package/dist/chunk-6EZLUC62.js.map +0 -1
- package/dist/views/LeadCard.d.ts +0 -6
- package/dist/views/LeadCard.d.ts.map +0 -1
package/dist/locales/en.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiKrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/locales/pt-BR.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/locales/pt-BR.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiKvC,CAAA"}
|
|
@@ -15,6 +15,8 @@ export declare const MIGRATION_013_A_MIDIA_FICA_CONOSCO = "-- ------------------
|
|
|
15
15
|
export declare const MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY = "-- 014_claiming_targets_is_server_only.sql\n--\n-- 003 revoked `conversations_claim_targets` from PUBLIC and anon but not from\n-- `authenticated`, which the pool's default privileges grant on every new\n-- function in public. Live, any signed-in user of any tenant could claim (and\n-- so burn) another tenant's campaign targets by uuid \u2014 SECURITY DEFINER, no\n-- caller check. The only caller is the conversations-provider edge function,\n-- which uses the service-role key.\n\nREVOKE ALL ON FUNCTION public.conversations_claim_targets(uuid, integer) FROM PUBLIC, anon, authenticated;\nGRANT EXECUTE ON FUNCTION public.conversations_claim_targets(uuid, integer) TO service_role;\n";
|
|
16
16
|
export declare const MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING = "-- ============================================================================\n-- 015_the_service_door_for_messaging \u2014 the WhatsApp edge functions move to the\n-- integration service (ADR 0003 phase 2, wave 2).\n--\n-- Two kinds of table, two kinds of access:\n--\n-- * tenant tables a member already writes (conversations, messages,\n-- campaigns, templates): the service writes them AS the store's owner or\n-- as the verified caller (core migrations 210/212), under RLS. Nothing\n-- here.\n-- * service tables only a machine writes, which service_role wrote until\n-- now: provider credentials, channels, opt-outs, webhook events, provider\n-- templates, payment requests. fayz_integration gets exactly that, table\n-- by table, with an explicit policy. Panels keep their SELECT policies.\n--\n-- And the three server-only functions the webhooks call get EXECUTE for the\n-- service role (they were service_role only, 014).\n--\n-- Guarded: the role is an operator step. Replay-safe.\n-- ============================================================================\n\nDO $$\nDECLARE\n t text;\n f text;\nBEGIN\n IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'fayz_integration') THEN\n RETURN;\n END IF;\n\n FOREACH t IN ARRAY ARRAY[\n 'plg_conversations_providers',\n 'plg_conversations_channels',\n 'plg_conversations_optouts',\n 'plg_conversations_webhook_events',\n 'plg_automations_provider_templates',\n 'plg_conversations_payment_requests'\n ] LOOP\n IF to_regclass('public.' || t) IS NULL THEN CONTINUE; END IF;\n EXECUTE format('GRANT SELECT, INSERT, UPDATE, DELETE ON public.%I TO fayz_integration', t);\n EXECUTE format('DROP POLICY IF EXISTS %I ON public.%I', t || '_service', t);\n EXECUTE format('CREATE POLICY %I ON public.%I FOR ALL TO fayz_integration USING (true) WITH CHECK (true)', t || '_service', t);\n END LOOP;\n\n FOREACH f IN ARRAY ARRAY[\n 'public.conversations_claim_targets(uuid, integer)',\n 'public.plg_booking_apply_channel_reply(uuid, text, uuid)',\n 'public.plg_conversations_match_by_phone(text, text, text, uuid)'\n ] LOOP\n IF to_regprocedure(f) IS NOT NULL THEN\n EXECUTE format('GRANT EXECUTE ON FUNCTION %s TO fayz_integration', f);\n END IF;\n END LOOP;\nEND $$;\n";
|
|
17
17
|
export declare const MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT = "-- ============================================================================\n-- 016_a_delivery_receipt_finds_its_tenant \u2014 the Tyxter webhook moves to the\n-- integration service (ADR 0003 phase 2).\n--\n-- A delivery receipt names only the provider's message id. The service writes\n-- the inbox AS the store's owner (core 212), so it must learn the store first:\n-- this answers the tenant of the message that id was sent as, and nothing\n-- else. SECURITY DEFINER, service role only.\n--\n-- Replay-safe: CREATE OR REPLACE; guarded grants.\n-- ============================================================================\n\nCREATE OR REPLACE FUNCTION public.conversations_message_tenant(p_provider_message_id text) RETURNS uuid\nLANGUAGE sql STABLE SECURITY DEFINER SET search_path TO ''\nAS $function$\n SELECT m.tenant_id\n FROM public.plg_conversation_messages m\n WHERE m.provider_message_id = p_provider_message_id\n ORDER BY m.at DESC NULLS LAST\n LIMIT 1;\n$function$;\n\nDO $$\nBEGIN\n REVOKE ALL ON FUNCTION public.conversations_message_tenant(text) FROM PUBLIC;\n IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'anon') THEN REVOKE ALL ON FUNCTION public.conversations_message_tenant(text) FROM anon; END IF;\n IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'authenticated') THEN REVOKE ALL ON FUNCTION public.conversations_message_tenant(text) FROM authenticated; END IF;\n IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'service_role') THEN GRANT EXECUTE ON FUNCTION public.conversations_message_tenant(text) TO service_role; END IF;\n IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'fayz_integration') THEN GRANT EXECUTE ON FUNCTION public.conversations_message_tenant(text) TO fayz_integration; END IF;\nEND $$;\n";
|
|
18
|
+
export declare const MIGRATION_017_A_CAMPAIGN_HAS_STEPS = "-- 017_a_campaign_has_steps.sql\n--\n-- A campaign was one template sent once to a list of phones. The re-engagement\n-- the sales team needs is a JOURNEY over a SEGMENT: for every deal in the\n-- segment, touch 1 today, touch 2 in three days if nobody answered, touch 3 in\n-- seven \u2014 each touch on its own channel (WhatsApp, e-mail, a task for the\n-- seller), each one trying the deal's NEXT contact route (another phone of the\n-- person, another person of the company, the group), and all of it stopping\n-- the moment anybody answers. Silvio's V1 journeys are the model.\n--\n-- Shape:\n-- campaign segment + audience (people | deals), unit, stop_on_reply,\n-- settings (caps and kill-switch thresholds)\n-- steps ordered; wait before the step; channel; template; which\n-- contact route to use\n-- enrollments one per deal (or person) in the campaign: the ordered routes,\n-- the next step and when it is due, the state\n-- targets stay the per-send log (claim lease, provider ids, delivered,\n-- read, replied), now pointing at the enrollment and the step\n-- templates gain variants (alternative bodies, so identical text is not\n-- a robot signature) and a channel (whatsapp | email)\n--\n-- The engine (enrol, schedule, rotate, pace, send, stop on reply) runs in the\n-- integration service; the database keeps the rows, the RLS and the leases.\n\n-- \u2500\u2500 campaign \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nALTER TABLE public.plg_conversations_campaigns\n ADD COLUMN IF NOT EXISTS segment_id uuid,\n ADD COLUMN IF NOT EXISTS audience text NOT NULL DEFAULT 'people',\n ADD COLUMN IF NOT EXISTS unit_id uuid,\n ADD COLUMN IF NOT EXISTS description text,\n ADD COLUMN IF NOT EXISTS stop_on_reply boolean NOT NULL DEFAULT true,\n ADD COLUMN IF NOT EXISTS settings jsonb NOT NULL DEFAULT '{}'::jsonb;\n\nDO $$ BEGIN\n ALTER TABLE public.plg_conversations_campaigns\n ADD CONSTRAINT plg_conversations_campaigns_audience CHECK (audience IN ('people', 'deals'));\nEXCEPTION WHEN duplicate_object THEN NULL; END $$;\n\nCOMMENT ON COLUMN public.plg_conversations_campaigns.settings IS\n 'Caps and kill switches for this campaign: per_day new contacts, pause_after_failures, min_reply_rate_after, max_optout_rate. Defaults come from the channel pacing (017).';\n\n-- \u2500\u2500 templates: variants and channel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nALTER TABLE public.plg_conversations_templates\n ADD COLUMN IF NOT EXISTS variants text[] NOT NULL DEFAULT '{}',\n ADD COLUMN IF NOT EXISTS channel text NOT NULL DEFAULT 'whatsapp',\n ADD COLUMN IF NOT EXISTS subject text;\n\nDO $$ BEGIN\n ALTER TABLE public.plg_conversations_templates\n ADD CONSTRAINT plg_conversations_templates_channel CHECK (channel IN ('whatsapp', 'email'));\nEXCEPTION WHEN duplicate_object THEN NULL; END $$;\n\nCOMMENT ON COLUMN public.plg_conversations_templates.variants IS\n 'Alternative bodies with the same meaning and the same {{variables}}. The sender rotates them so a campaign is not one identical text sent a hundred times (017).';\n\n-- \u2500\u2500 steps \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nCREATE TABLE IF NOT EXISTS public.plg_conversations_campaign_steps (\n id uuid PRIMARY KEY DEFAULT gen_random_uuid(),\n tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,\n campaign_id uuid NOT NULL REFERENCES public.plg_conversations_campaigns(id) ON DELETE CASCADE,\n position integer NOT NULL,\n -- Wait before this step, counted from the previous step (or from enrolment\n -- for the first one). Minutes, so \"3 days\" and \"2 hours\" are both exact.\n wait_minutes integer NOT NULL DEFAULT 0,\n channel text NOT NULL DEFAULT 'whatsapp',\n template_id uuid REFERENCES public.plg_conversations_templates(id) ON DELETE SET NULL,\n -- For `task`: what the seller is asked to do.\n task_title text,\n -- Which contact route this step uses: the same one as the previous step, or\n -- the next one (another phone, another person of the company, the group).\n contact_route text NOT NULL DEFAULT 'next',\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT plg_conversations_campaign_steps_channel CHECK (channel IN ('whatsapp', 'email', 'task')),\n CONSTRAINT plg_conversations_campaign_steps_route CHECK (contact_route IN ('same', 'next')),\n CONSTRAINT plg_conversations_campaign_steps_wait CHECK (wait_minutes >= 0)\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS plg_conversations_campaign_steps_position\n ON public.plg_conversations_campaign_steps (campaign_id, position);\n\nALTER TABLE public.plg_conversations_campaign_steps ENABLE ROW LEVEL SECURITY;\nALTER TABLE public.plg_conversations_campaign_steps FORCE ROW LEVEL SECURITY;\nDROP POLICY IF EXISTS plg_conversations_campaign_steps_rw ON public.plg_conversations_campaign_steps;\nCREATE POLICY plg_conversations_campaign_steps_rw ON public.plg_conversations_campaign_steps\n FOR ALL TO authenticated\n USING (tenant_id IN (SELECT public.user_tenant_ids()))\n WITH CHECK (tenant_id IN (SELECT public.user_tenant_ids()));\nGRANT SELECT, INSERT, UPDATE, DELETE ON public.plg_conversations_campaign_steps TO authenticated, service_role;\n\n-- \u2500\u2500 enrollments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nCREATE TABLE IF NOT EXISTS public.plg_conversations_campaign_enrollments (\n id uuid PRIMARY KEY DEFAULT gen_random_uuid(),\n tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,\n campaign_id uuid NOT NULL REFERENCES public.plg_conversations_campaigns(id) ON DELETE CASCADE,\n -- The deal (deal audience) or the person (people audience). Not foreign\n -- keys: deleting a deal must not delete the proof that it was contacted.\n deal_id uuid,\n person_id uuid,\n -- Whose deal it is: the reply goes to this seller's inbox.\n owner_id uuid,\n -- The ordered contact routes: [{person_id, name, phone_e164, email, via}],\n -- `via` = primary | other_phone | company | group.\n routes jsonb NOT NULL DEFAULT '[]'::jsonb,\n route_index integer NOT NULL DEFAULT 0,\n -- The NEXT step to run (position), and when.\n next_step integer NOT NULL DEFAULT 1,\n next_run_at timestamptz,\n state text NOT NULL DEFAULT 'active',\n state_reason text,\n replied_at timestamptz,\n enrolled_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT plg_conversations_campaign_enrollments_state\n CHECK (state IN ('active', 'replied', 'opted_out', 'completed', 'failed', 'exited', 'no_route'))\n);\n\n-- Once per deal (or person) per campaign.\nCREATE UNIQUE INDEX IF NOT EXISTS plg_conversations_campaign_enrollments_once\n ON public.plg_conversations_campaign_enrollments (campaign_id, coalesce(deal_id, person_id));\n\nCREATE INDEX IF NOT EXISTS plg_conversations_campaign_enrollments_due\n ON public.plg_conversations_campaign_enrollments (next_run_at)\n WHERE state = 'active';\n\nALTER TABLE public.plg_conversations_campaign_enrollments ENABLE ROW LEVEL SECURITY;\nALTER TABLE public.plg_conversations_campaign_enrollments FORCE ROW LEVEL SECURITY;\nDROP POLICY IF EXISTS plg_conversations_campaign_enrollments_rw ON public.plg_conversations_campaign_enrollments;\nCREATE POLICY plg_conversations_campaign_enrollments_rw ON public.plg_conversations_campaign_enrollments\n FOR ALL TO authenticated\n USING (tenant_id IN (SELECT public.user_tenant_ids()))\n WITH CHECK (tenant_id IN (SELECT public.user_tenant_ids()));\nGRANT SELECT, INSERT, UPDATE, DELETE ON public.plg_conversations_campaign_enrollments TO authenticated, service_role;\n\n-- \u2500\u2500 targets: the per-send log points at its enrollment and step \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nALTER TABLE public.plg_conversations_campaign_targets\n ADD COLUMN IF NOT EXISTS enrollment_id uuid REFERENCES public.plg_conversations_campaign_enrollments(id) ON DELETE SET NULL,\n ADD COLUMN IF NOT EXISTS step_position integer,\n ADD COLUMN IF NOT EXISTS channel text NOT NULL DEFAULT 'whatsapp',\n ADD COLUMN IF NOT EXISTS email text,\n ADD COLUMN IF NOT EXISTS variant integer,\n ADD COLUMN IF NOT EXISTS rendered_body text;\n\n-- An e-mail step has no phone.\nALTER TABLE public.plg_conversations_campaign_targets ALTER COLUMN phone_e164 DROP NOT NULL;\n\n-- \"Once per campaign, per phone, per round\" stopped being true the day a\n-- campaign has steps: touch 2 goes to the same phone as touch 1, on purpose.\n-- The rule is now once per campaign, per address, per round, PER STEP.\nDROP INDEX IF EXISTS public.plg_conversations_campaign_targets_once;\nCREATE UNIQUE INDEX IF NOT EXISTS plg_conversations_campaign_targets_once_per_step\n ON public.plg_conversations_campaign_targets\n (campaign_id, coalesce(phone_e164, email), rotation, coalesce(step_position, 0));\n\nCREATE INDEX IF NOT EXISTS plg_conversations_campaign_targets_enrollment\n ON public.plg_conversations_campaign_targets (enrollment_id);\n\n-- \u2500\u2500 the Evolution pace, from what practitioners report \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- 003 started Evolution at 250 a day and 12 a minute. The 2026-10-28 research\n-- (Baileys/Evolution issues, Meta's own test of a cap on unanswered messages)\n-- says first contact with people who have not answered is what gets a number\n-- restricted, and that 30\u201340 NEW contacts a day, at most 10 an hour, 2\u20135 min\n-- apart, on business days, is where old numbers survive. The unofficial\n-- connection breaks WhatsApp's terms by existing; pace lowers the odds, it\n-- does not remove them.\nCREATE OR REPLACE FUNCTION public.conversations_default_pacing(p_provider text)\nRETURNS jsonb LANGUAGE sql IMMUTABLE AS $$\n SELECT CASE p_provider\n WHEN 'tyxter' THEN jsonb_build_object(\n 'per_minute', 60, 'per_hour', 1000, 'per_day', null,\n 'delay_seconds', jsonb_build_array(1, 3),\n 'same_recipient_seconds', 6,\n 'hours', jsonb_build_object('start', '09:00', 'end', '18:00', 'weekdays_only', true))\n WHEN 'evolution' THEN jsonb_build_object(\n 'per_minute', 1, 'per_hour', 10, 'per_day', 40,\n 'delay_seconds', jsonb_build_array(120, 300),\n 'typing_seconds', jsonb_build_array(3, 8),\n 'same_recipient_seconds', 6,\n 'batch_size', 10, 'batch_cooldown_minutes', 20,\n 'hours', jsonb_build_object('start', '09:00', 'end', '18:00', 'weekdays_only', true))\n ELSE '{}'::jsonb END\n$$;\n\n-- \u2500\u2500 what the monitor needs: one row per step \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nDROP VIEW IF EXISTS public.v_conversations_campaign_step_progress;\nCREATE VIEW public.v_conversations_campaign_step_progress\nWITH (security_invoker = true) AS\n SELECT t.campaign_id,\n t.tenant_id,\n coalesce(t.step_position, 1) AS step_position,\n count(*) AS total,\n count(*) FILTER (WHERE t.state IN ('queued', 'sending')) AS pending,\n count(*) FILTER (WHERE t.state IN ('sent','delivered','read','replied')) AS sent,\n count(*) FILTER (WHERE t.delivered_at IS NOT NULL OR t.state IN ('delivered','read','replied')) AS delivered,\n count(*) FILTER (WHERE t.read_at IS NOT NULL OR t.state IN ('read','replied')) AS read,\n count(*) FILTER (WHERE t.state = 'replied' OR t.replied_at IS NOT NULL) AS replied,\n count(*) FILTER (WHERE t.state = 'failed') AS failed,\n count(*) FILTER (WHERE t.state = 'skipped') AS skipped\n FROM public.plg_conversations_campaign_targets t\n WHERE t.tenant_id IN (SELECT public.user_tenant_ids())\n GROUP BY t.campaign_id, t.tenant_id, coalesce(t.step_position, 1);\n\nGRANT SELECT ON public.v_conversations_campaign_step_progress TO authenticated;\n\nDROP VIEW IF EXISTS public.v_conversations_campaign_enrollment_summary;\nCREATE VIEW public.v_conversations_campaign_enrollment_summary\nWITH (security_invoker = true) AS\n SELECT e.campaign_id,\n e.tenant_id,\n count(*) AS enrolled,\n count(*) FILTER (WHERE e.state = 'active') AS active,\n count(*) FILTER (WHERE e.state = 'replied') AS replied,\n count(*) FILTER (WHERE e.state = 'opted_out') AS opted_out,\n count(*) FILTER (WHERE e.state = 'completed') AS completed,\n count(*) FILTER (WHERE e.state = 'no_route') AS no_route,\n count(*) FILTER (WHERE e.state IN ('failed', 'exited')) AS stopped\n FROM public.plg_conversations_campaign_enrollments e\n WHERE e.tenant_id IN (SELECT public.user_tenant_ids())\n GROUP BY e.campaign_id, e.tenant_id;\n\nGRANT SELECT ON public.v_conversations_campaign_enrollment_summary TO authenticated;\n";
|
|
19
|
+
export declare const MIGRATION_018_THE_ENGINE_FINDS_RUNNING_CAMPAIGNS = "-- 018_the_engine_finds_running_campaigns.sql\n--\n-- The campaign engine (integration service, every minute) needs one thing it\n-- cannot get under a tenant's RLS: which tenants have a campaign running at\n-- all. Everything after that it does AS the tenant (asActor), so it reads and\n-- writes campaigns, steps, enrollments and targets under the same policies as\n-- a person on the screen.\n--\n-- Same pattern as shop_notify_claim: a SECURITY DEFINER read granted to the\n-- service role only.\n\nCREATE OR REPLACE FUNCTION public.conversations_running_campaigns()\nRETURNS TABLE(campaign_id uuid, tenant_id uuid)\nLANGUAGE sql\nSTABLE SECURITY DEFINER\nSET search_path TO ''\nAS $function$\n SELECT c.id, c.tenant_id\n FROM public.plg_conversations_campaigns c\n WHERE c.status = 'running'\n ORDER BY c.started_at NULLS LAST, c.created_at\n$function$;\n\nREVOKE ALL ON FUNCTION public.conversations_running_campaigns() FROM PUBLIC, anon, authenticated;\nGRANT EXECUTE ON FUNCTION public.conversations_running_campaigns() TO service_role;\n\nDO $$ BEGIN\n IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'fayz_integration') THEN\n GRANT EXECUTE ON FUNCTION public.conversations_running_campaigns() TO fayz_integration;\n END IF;\nEND $$;\n";
|
|
18
20
|
export declare const MIGRATIONS: Array<{
|
|
19
21
|
id: string;
|
|
20
22
|
sql: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,2rhCAkgBlC,CAAA;AAED,eAAO,MAAM,gDAAgD,i0LAuG5D,CAAA;AAED,eAAO,MAAM,oDAAoD,m5bAuOhE,CAAA;AAED,eAAO,MAAM,0DAA0D,81rBAwWtE,CAAA;AAED,eAAO,MAAM,gEAAgE,+lJA2E5E,CAAA;AAED,eAAO,MAAM,yDAAyD,w1RAmKrE,CAAA;AAED,eAAO,MAAM,sCAAsC,mtOA6HlD,CAAA;AAED,eAAO,MAAM,6CAA6C,qmIA6DzD,CAAA;AAED,eAAO,MAAM,yCAAyC,ywGA8CrD,CAAA;AAED,eAAO,MAAM,qDAAqD,40FAiDjE,CAAA;AAED,eAAO,MAAM,6CAA6C,6oJA0FzD,CAAA;AAED,eAAO,MAAM,qDAAqD,itGA8DjE,CAAA;AAED,eAAO,MAAM,4CAA4C,6gIA6DxD,CAAA;AAED,eAAO,MAAM,kCAAkC,qlIAiE9C,CAAA;AAED,eAAO,MAAM,6CAA6C,orBAWzD,CAAA;AAED,eAAO,MAAM,4CAA4C,8wEAsDxD,CAAA;AAED,eAAO,MAAM,iDAAiD,yuDA8B7D,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,2rhCAkgBlC,CAAA;AAED,eAAO,MAAM,gDAAgD,i0LAuG5D,CAAA;AAED,eAAO,MAAM,oDAAoD,m5bAuOhE,CAAA;AAED,eAAO,MAAM,0DAA0D,81rBAwWtE,CAAA;AAED,eAAO,MAAM,gEAAgE,+lJA2E5E,CAAA;AAED,eAAO,MAAM,yDAAyD,w1RAmKrE,CAAA;AAED,eAAO,MAAM,sCAAsC,mtOA6HlD,CAAA;AAED,eAAO,MAAM,6CAA6C,qmIA6DzD,CAAA;AAED,eAAO,MAAM,yCAAyC,ywGA8CrD,CAAA;AAED,eAAO,MAAM,qDAAqD,40FAiDjE,CAAA;AAED,eAAO,MAAM,6CAA6C,6oJA0FzD,CAAA;AAED,eAAO,MAAM,qDAAqD,itGA8DjE,CAAA;AAED,eAAO,MAAM,4CAA4C,6gIA6DxD,CAAA;AAED,eAAO,MAAM,kCAAkC,qlIAiE9C,CAAA;AAED,eAAO,MAAM,6CAA6C,orBAWzD,CAAA;AAED,eAAO,MAAM,4CAA4C,8wEAsDxD,CAAA;AAED,eAAO,MAAM,iDAAiD,yuDA8B7D,CAAA;AAED,eAAO,MAAM,kCAAkC,wwcA+N9C,CAAA;AAED,eAAO,MAAM,gDAAgD,ivCA+B5D,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAoBzD,CAAA"}
|
|
@@ -16,8 +16,10 @@ var MIGRATION_013_A_MIDIA_FICA_CONOSCO = "";
|
|
|
16
16
|
var MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY = "";
|
|
17
17
|
var MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING = "";
|
|
18
18
|
var MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT = "";
|
|
19
|
+
var MIGRATION_017_A_CAMPAIGN_HAS_STEPS = "";
|
|
20
|
+
var MIGRATION_018_THE_ENGINE_FINDS_RUNNING_CAMPAIGNS = "";
|
|
19
21
|
var MIGRATIONS = [];
|
|
20
22
|
|
|
21
|
-
export { MIGRATIONS, MIGRATION_000_BASELINE, MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO, MIGRATION_002_A_CASA_ESCOLHE_POR_ONDE_O_WHATSAPP_SAI, MIGRATION_003_A_CAMPANHA_SAI_NO_RITMO_QUE_O_NUMERO_AGUENTA, MIGRATION_004_A_TELA_SABE_SE_PODE_FALAR_ANTES_DE_DEIXAR_ESCREVER, MIGRATION_005_A_CONVERSA_CONTA_AO_FUNIL_QUE_HOUVE_CONTATO, MIGRATION_006_A_CAIXA_AVISA_QUE_CHEGOU, MIGRATION_007_A_CONVERSA_DIZ_DE_QUEM_E_O_LEAD, MIGRATION_008_DAR_POR_VISTA_E_UMA_DECISAO, MIGRATION_009_A_MENSAGEM_INTEIRA_ATRAVESSA_O_REALTIME, MIGRATION_010_A_CHEGADA_E_ANUNCIADA_POR_CONTA, MIGRATION_011_O_ANUNCIO_E_UMA_CAMPAINHA_NAO_UM_RECADO, MIGRATION_012_A_RICH_MESSAGE_KEEPS_ITS_SHAPE, MIGRATION_013_A_MIDIA_FICA_CONOSCO, MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY, MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING, MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT };
|
|
23
|
+
export { MIGRATIONS, MIGRATION_000_BASELINE, MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO, MIGRATION_002_A_CASA_ESCOLHE_POR_ONDE_O_WHATSAPP_SAI, MIGRATION_003_A_CAMPANHA_SAI_NO_RITMO_QUE_O_NUMERO_AGUENTA, MIGRATION_004_A_TELA_SABE_SE_PODE_FALAR_ANTES_DE_DEIXAR_ESCREVER, MIGRATION_005_A_CONVERSA_CONTA_AO_FUNIL_QUE_HOUVE_CONTATO, MIGRATION_006_A_CAIXA_AVISA_QUE_CHEGOU, MIGRATION_007_A_CONVERSA_DIZ_DE_QUEM_E_O_LEAD, MIGRATION_008_DAR_POR_VISTA_E_UMA_DECISAO, MIGRATION_009_A_MENSAGEM_INTEIRA_ATRAVESSA_O_REALTIME, MIGRATION_010_A_CHEGADA_E_ANUNCIADA_POR_CONTA, MIGRATION_011_O_ANUNCIO_E_UMA_CAMPAINHA_NAO_UM_RECADO, MIGRATION_012_A_RICH_MESSAGE_KEEPS_ITS_SHAPE, MIGRATION_013_A_MIDIA_FICA_CONOSCO, MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY, MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING, MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT, MIGRATION_017_A_CAMPAIGN_HAS_STEPS, MIGRATION_018_THE_ENGINE_FINDS_RUNNING_CAMPAIGNS };
|
|
22
24
|
//# sourceMappingURL=main.browser.js.map
|
|
23
25
|
//# sourceMappingURL=main.browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../node_modules/.cache/fayz-migration-stubs/main.ts"],"names":[],"mappings":";AAEO,IAAM,sBAAA,GAAyB;AAC/B,IAAM,gDAAA,GAAmD;AACzD,IAAM,oDAAA,GAAuD;AAC7D,IAAM,0DAAA,GAA6D;AACnE,IAAM,gEAAA,GAAmE;AACzE,IAAM,yDAAA,GAA4D;AAClE,IAAM,sCAAA,GAAyC;AAC/C,IAAM,6CAAA,GAAgD;AACtD,IAAM,yCAAA,GAA4C;AAClD,IAAM,qDAAA,GAAwD;AAC9D,IAAM,6CAAA,GAAgD;AACtD,IAAM,qDAAA,GAAwD;AAC9D,IAAM,4CAAA,GAA+C;AACrD,IAAM,kCAAA,GAAqC;AAC3C,IAAM,6CAAA,GAAgD;AACtD,IAAM,4CAAA,GAA+C;AACrD,IAAM,iDAAA,GAAoD;AAC1D,IAAM,aAAiD","file":"main.browser.js","sourcesContent":["// GENERATED by scripts/tsup-migrations.mjs — the browser build of a\n// migrations barrel: the same names, no SQL. See that script for why.\nexport const MIGRATION_000_BASELINE = ''\nexport const MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO = ''\nexport const MIGRATION_002_A_CASA_ESCOLHE_POR_ONDE_O_WHATSAPP_SAI = ''\nexport const MIGRATION_003_A_CAMPANHA_SAI_NO_RITMO_QUE_O_NUMERO_AGUENTA = ''\nexport const MIGRATION_004_A_TELA_SABE_SE_PODE_FALAR_ANTES_DE_DEIXAR_ESCREVER = ''\nexport const MIGRATION_005_A_CONVERSA_CONTA_AO_FUNIL_QUE_HOUVE_CONTATO = ''\nexport const MIGRATION_006_A_CAIXA_AVISA_QUE_CHEGOU = ''\nexport const MIGRATION_007_A_CONVERSA_DIZ_DE_QUEM_E_O_LEAD = ''\nexport const MIGRATION_008_DAR_POR_VISTA_E_UMA_DECISAO = ''\nexport const MIGRATION_009_A_MENSAGEM_INTEIRA_ATRAVESSA_O_REALTIME = ''\nexport const MIGRATION_010_A_CHEGADA_E_ANUNCIADA_POR_CONTA = ''\nexport const MIGRATION_011_O_ANUNCIO_E_UMA_CAMPAINHA_NAO_UM_RECADO = ''\nexport const MIGRATION_012_A_RICH_MESSAGE_KEEPS_ITS_SHAPE = ''\nexport const MIGRATION_013_A_MIDIA_FICA_CONOSCO = ''\nexport const MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY = ''\nexport const MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING = ''\nexport const MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT = ''\nexport const MIGRATIONS: Array<{ id: string; sql: string }> = []\n"]}
|
|
1
|
+
{"version":3,"sources":["../../node_modules/.cache/fayz-migration-stubs/main.ts"],"names":[],"mappings":";AAEO,IAAM,sBAAA,GAAyB;AAC/B,IAAM,gDAAA,GAAmD;AACzD,IAAM,oDAAA,GAAuD;AAC7D,IAAM,0DAAA,GAA6D;AACnE,IAAM,gEAAA,GAAmE;AACzE,IAAM,yDAAA,GAA4D;AAClE,IAAM,sCAAA,GAAyC;AAC/C,IAAM,6CAAA,GAAgD;AACtD,IAAM,yCAAA,GAA4C;AAClD,IAAM,qDAAA,GAAwD;AAC9D,IAAM,6CAAA,GAAgD;AACtD,IAAM,qDAAA,GAAwD;AAC9D,IAAM,4CAAA,GAA+C;AACrD,IAAM,kCAAA,GAAqC;AAC3C,IAAM,6CAAA,GAAgD;AACtD,IAAM,4CAAA,GAA+C;AACrD,IAAM,iDAAA,GAAoD;AAC1D,IAAM,kCAAA,GAAqC;AAC3C,IAAM,gDAAA,GAAmD;AACzD,IAAM,aAAiD","file":"main.browser.js","sourcesContent":["// GENERATED by scripts/tsup-migrations.mjs — the browser build of a\n// migrations barrel: the same names, no SQL. See that script for why.\nexport const MIGRATION_000_BASELINE = ''\nexport const MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO = ''\nexport const MIGRATION_002_A_CASA_ESCOLHE_POR_ONDE_O_WHATSAPP_SAI = ''\nexport const MIGRATION_003_A_CAMPANHA_SAI_NO_RITMO_QUE_O_NUMERO_AGUENTA = ''\nexport const MIGRATION_004_A_TELA_SABE_SE_PODE_FALAR_ANTES_DE_DEIXAR_ESCREVER = ''\nexport const MIGRATION_005_A_CONVERSA_CONTA_AO_FUNIL_QUE_HOUVE_CONTATO = ''\nexport const MIGRATION_006_A_CAIXA_AVISA_QUE_CHEGOU = ''\nexport const MIGRATION_007_A_CONVERSA_DIZ_DE_QUEM_E_O_LEAD = ''\nexport const MIGRATION_008_DAR_POR_VISTA_E_UMA_DECISAO = ''\nexport const MIGRATION_009_A_MENSAGEM_INTEIRA_ATRAVESSA_O_REALTIME = ''\nexport const MIGRATION_010_A_CHEGADA_E_ANUNCIADA_POR_CONTA = ''\nexport const MIGRATION_011_O_ANUNCIO_E_UMA_CAMPAINHA_NAO_UM_RECADO = ''\nexport const MIGRATION_012_A_RICH_MESSAGE_KEEPS_ITS_SHAPE = ''\nexport const MIGRATION_013_A_MIDIA_FICA_CONOSCO = ''\nexport const MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY = ''\nexport const MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING = ''\nexport const MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT = ''\nexport const MIGRATION_017_A_CAMPAIGN_HAS_STEPS = ''\nexport const MIGRATION_018_THE_ENGINE_FINDS_RUNNING_CAMPAIGNS = ''\nexport const MIGRATIONS: Array<{ id: string; sql: string }> = []\n"]}
|
package/dist/migrations/main.js
CHANGED
|
@@ -2116,6 +2116,262 @@ BEGIN
|
|
|
2116
2116
|
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'fayz_integration') THEN GRANT EXECUTE ON FUNCTION public.conversations_message_tenant(text) TO fayz_integration; END IF;
|
|
2117
2117
|
END $$;
|
|
2118
2118
|
`;
|
|
2119
|
+
var MIGRATION_017_A_CAMPAIGN_HAS_STEPS = `-- 017_a_campaign_has_steps.sql
|
|
2120
|
+
--
|
|
2121
|
+
-- A campaign was one template sent once to a list of phones. The re-engagement
|
|
2122
|
+
-- the sales team needs is a JOURNEY over a SEGMENT: for every deal in the
|
|
2123
|
+
-- segment, touch 1 today, touch 2 in three days if nobody answered, touch 3 in
|
|
2124
|
+
-- seven \u2014 each touch on its own channel (WhatsApp, e-mail, a task for the
|
|
2125
|
+
-- seller), each one trying the deal's NEXT contact route (another phone of the
|
|
2126
|
+
-- person, another person of the company, the group), and all of it stopping
|
|
2127
|
+
-- the moment anybody answers. Silvio's V1 journeys are the model.
|
|
2128
|
+
--
|
|
2129
|
+
-- Shape:
|
|
2130
|
+
-- campaign segment + audience (people | deals), unit, stop_on_reply,
|
|
2131
|
+
-- settings (caps and kill-switch thresholds)
|
|
2132
|
+
-- steps ordered; wait before the step; channel; template; which
|
|
2133
|
+
-- contact route to use
|
|
2134
|
+
-- enrollments one per deal (or person) in the campaign: the ordered routes,
|
|
2135
|
+
-- the next step and when it is due, the state
|
|
2136
|
+
-- targets stay the per-send log (claim lease, provider ids, delivered,
|
|
2137
|
+
-- read, replied), now pointing at the enrollment and the step
|
|
2138
|
+
-- templates gain variants (alternative bodies, so identical text is not
|
|
2139
|
+
-- a robot signature) and a channel (whatsapp | email)
|
|
2140
|
+
--
|
|
2141
|
+
-- The engine (enrol, schedule, rotate, pace, send, stop on reply) runs in the
|
|
2142
|
+
-- integration service; the database keeps the rows, the RLS and the leases.
|
|
2143
|
+
|
|
2144
|
+
-- \u2500\u2500 campaign \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2145
|
+
ALTER TABLE public.plg_conversations_campaigns
|
|
2146
|
+
ADD COLUMN IF NOT EXISTS segment_id uuid,
|
|
2147
|
+
ADD COLUMN IF NOT EXISTS audience text NOT NULL DEFAULT 'people',
|
|
2148
|
+
ADD COLUMN IF NOT EXISTS unit_id uuid,
|
|
2149
|
+
ADD COLUMN IF NOT EXISTS description text,
|
|
2150
|
+
ADD COLUMN IF NOT EXISTS stop_on_reply boolean NOT NULL DEFAULT true,
|
|
2151
|
+
ADD COLUMN IF NOT EXISTS settings jsonb NOT NULL DEFAULT '{}'::jsonb;
|
|
2152
|
+
|
|
2153
|
+
DO $$ BEGIN
|
|
2154
|
+
ALTER TABLE public.plg_conversations_campaigns
|
|
2155
|
+
ADD CONSTRAINT plg_conversations_campaigns_audience CHECK (audience IN ('people', 'deals'));
|
|
2156
|
+
EXCEPTION WHEN duplicate_object THEN NULL; END $$;
|
|
2157
|
+
|
|
2158
|
+
COMMENT ON COLUMN public.plg_conversations_campaigns.settings IS
|
|
2159
|
+
'Caps and kill switches for this campaign: per_day new contacts, pause_after_failures, min_reply_rate_after, max_optout_rate. Defaults come from the channel pacing (017).';
|
|
2160
|
+
|
|
2161
|
+
-- \u2500\u2500 templates: variants and channel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2162
|
+
ALTER TABLE public.plg_conversations_templates
|
|
2163
|
+
ADD COLUMN IF NOT EXISTS variants text[] NOT NULL DEFAULT '{}',
|
|
2164
|
+
ADD COLUMN IF NOT EXISTS channel text NOT NULL DEFAULT 'whatsapp',
|
|
2165
|
+
ADD COLUMN IF NOT EXISTS subject text;
|
|
2166
|
+
|
|
2167
|
+
DO $$ BEGIN
|
|
2168
|
+
ALTER TABLE public.plg_conversations_templates
|
|
2169
|
+
ADD CONSTRAINT plg_conversations_templates_channel CHECK (channel IN ('whatsapp', 'email'));
|
|
2170
|
+
EXCEPTION WHEN duplicate_object THEN NULL; END $$;
|
|
2171
|
+
|
|
2172
|
+
COMMENT ON COLUMN public.plg_conversations_templates.variants IS
|
|
2173
|
+
'Alternative bodies with the same meaning and the same {{variables}}. The sender rotates them so a campaign is not one identical text sent a hundred times (017).';
|
|
2174
|
+
|
|
2175
|
+
-- \u2500\u2500 steps \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2176
|
+
CREATE TABLE IF NOT EXISTS public.plg_conversations_campaign_steps (
|
|
2177
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
2178
|
+
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
2179
|
+
campaign_id uuid NOT NULL REFERENCES public.plg_conversations_campaigns(id) ON DELETE CASCADE,
|
|
2180
|
+
position integer NOT NULL,
|
|
2181
|
+
-- Wait before this step, counted from the previous step (or from enrolment
|
|
2182
|
+
-- for the first one). Minutes, so "3 days" and "2 hours" are both exact.
|
|
2183
|
+
wait_minutes integer NOT NULL DEFAULT 0,
|
|
2184
|
+
channel text NOT NULL DEFAULT 'whatsapp',
|
|
2185
|
+
template_id uuid REFERENCES public.plg_conversations_templates(id) ON DELETE SET NULL,
|
|
2186
|
+
-- For \`task\`: what the seller is asked to do.
|
|
2187
|
+
task_title text,
|
|
2188
|
+
-- Which contact route this step uses: the same one as the previous step, or
|
|
2189
|
+
-- the next one (another phone, another person of the company, the group).
|
|
2190
|
+
contact_route text NOT NULL DEFAULT 'next',
|
|
2191
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
2192
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
2193
|
+
CONSTRAINT plg_conversations_campaign_steps_channel CHECK (channel IN ('whatsapp', 'email', 'task')),
|
|
2194
|
+
CONSTRAINT plg_conversations_campaign_steps_route CHECK (contact_route IN ('same', 'next')),
|
|
2195
|
+
CONSTRAINT plg_conversations_campaign_steps_wait CHECK (wait_minutes >= 0)
|
|
2196
|
+
);
|
|
2197
|
+
|
|
2198
|
+
CREATE UNIQUE INDEX IF NOT EXISTS plg_conversations_campaign_steps_position
|
|
2199
|
+
ON public.plg_conversations_campaign_steps (campaign_id, position);
|
|
2200
|
+
|
|
2201
|
+
ALTER TABLE public.plg_conversations_campaign_steps ENABLE ROW LEVEL SECURITY;
|
|
2202
|
+
ALTER TABLE public.plg_conversations_campaign_steps FORCE ROW LEVEL SECURITY;
|
|
2203
|
+
DROP POLICY IF EXISTS plg_conversations_campaign_steps_rw ON public.plg_conversations_campaign_steps;
|
|
2204
|
+
CREATE POLICY plg_conversations_campaign_steps_rw ON public.plg_conversations_campaign_steps
|
|
2205
|
+
FOR ALL TO authenticated
|
|
2206
|
+
USING (tenant_id IN (SELECT public.user_tenant_ids()))
|
|
2207
|
+
WITH CHECK (tenant_id IN (SELECT public.user_tenant_ids()));
|
|
2208
|
+
GRANT SELECT, INSERT, UPDATE, DELETE ON public.plg_conversations_campaign_steps TO authenticated, service_role;
|
|
2209
|
+
|
|
2210
|
+
-- \u2500\u2500 enrollments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2211
|
+
CREATE TABLE IF NOT EXISTS public.plg_conversations_campaign_enrollments (
|
|
2212
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
2213
|
+
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
2214
|
+
campaign_id uuid NOT NULL REFERENCES public.plg_conversations_campaigns(id) ON DELETE CASCADE,
|
|
2215
|
+
-- The deal (deal audience) or the person (people audience). Not foreign
|
|
2216
|
+
-- keys: deleting a deal must not delete the proof that it was contacted.
|
|
2217
|
+
deal_id uuid,
|
|
2218
|
+
person_id uuid,
|
|
2219
|
+
-- Whose deal it is: the reply goes to this seller's inbox.
|
|
2220
|
+
owner_id uuid,
|
|
2221
|
+
-- The ordered contact routes: [{person_id, name, phone_e164, email, via}],
|
|
2222
|
+
-- \`via\` = primary | other_phone | company | group.
|
|
2223
|
+
routes jsonb NOT NULL DEFAULT '[]'::jsonb,
|
|
2224
|
+
route_index integer NOT NULL DEFAULT 0,
|
|
2225
|
+
-- The NEXT step to run (position), and when.
|
|
2226
|
+
next_step integer NOT NULL DEFAULT 1,
|
|
2227
|
+
next_run_at timestamptz,
|
|
2228
|
+
state text NOT NULL DEFAULT 'active',
|
|
2229
|
+
state_reason text,
|
|
2230
|
+
replied_at timestamptz,
|
|
2231
|
+
enrolled_at timestamptz NOT NULL DEFAULT now(),
|
|
2232
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
2233
|
+
CONSTRAINT plg_conversations_campaign_enrollments_state
|
|
2234
|
+
CHECK (state IN ('active', 'replied', 'opted_out', 'completed', 'failed', 'exited', 'no_route'))
|
|
2235
|
+
);
|
|
2236
|
+
|
|
2237
|
+
-- Once per deal (or person) per campaign.
|
|
2238
|
+
CREATE UNIQUE INDEX IF NOT EXISTS plg_conversations_campaign_enrollments_once
|
|
2239
|
+
ON public.plg_conversations_campaign_enrollments (campaign_id, coalesce(deal_id, person_id));
|
|
2240
|
+
|
|
2241
|
+
CREATE INDEX IF NOT EXISTS plg_conversations_campaign_enrollments_due
|
|
2242
|
+
ON public.plg_conversations_campaign_enrollments (next_run_at)
|
|
2243
|
+
WHERE state = 'active';
|
|
2244
|
+
|
|
2245
|
+
ALTER TABLE public.plg_conversations_campaign_enrollments ENABLE ROW LEVEL SECURITY;
|
|
2246
|
+
ALTER TABLE public.plg_conversations_campaign_enrollments FORCE ROW LEVEL SECURITY;
|
|
2247
|
+
DROP POLICY IF EXISTS plg_conversations_campaign_enrollments_rw ON public.plg_conversations_campaign_enrollments;
|
|
2248
|
+
CREATE POLICY plg_conversations_campaign_enrollments_rw ON public.plg_conversations_campaign_enrollments
|
|
2249
|
+
FOR ALL TO authenticated
|
|
2250
|
+
USING (tenant_id IN (SELECT public.user_tenant_ids()))
|
|
2251
|
+
WITH CHECK (tenant_id IN (SELECT public.user_tenant_ids()));
|
|
2252
|
+
GRANT SELECT, INSERT, UPDATE, DELETE ON public.plg_conversations_campaign_enrollments TO authenticated, service_role;
|
|
2253
|
+
|
|
2254
|
+
-- \u2500\u2500 targets: the per-send log points at its enrollment and step \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2255
|
+
ALTER TABLE public.plg_conversations_campaign_targets
|
|
2256
|
+
ADD COLUMN IF NOT EXISTS enrollment_id uuid REFERENCES public.plg_conversations_campaign_enrollments(id) ON DELETE SET NULL,
|
|
2257
|
+
ADD COLUMN IF NOT EXISTS step_position integer,
|
|
2258
|
+
ADD COLUMN IF NOT EXISTS channel text NOT NULL DEFAULT 'whatsapp',
|
|
2259
|
+
ADD COLUMN IF NOT EXISTS email text,
|
|
2260
|
+
ADD COLUMN IF NOT EXISTS variant integer,
|
|
2261
|
+
ADD COLUMN IF NOT EXISTS rendered_body text;
|
|
2262
|
+
|
|
2263
|
+
-- An e-mail step has no phone.
|
|
2264
|
+
ALTER TABLE public.plg_conversations_campaign_targets ALTER COLUMN phone_e164 DROP NOT NULL;
|
|
2265
|
+
|
|
2266
|
+
-- "Once per campaign, per phone, per round" stopped being true the day a
|
|
2267
|
+
-- campaign has steps: touch 2 goes to the same phone as touch 1, on purpose.
|
|
2268
|
+
-- The rule is now once per campaign, per address, per round, PER STEP.
|
|
2269
|
+
DROP INDEX IF EXISTS public.plg_conversations_campaign_targets_once;
|
|
2270
|
+
CREATE UNIQUE INDEX IF NOT EXISTS plg_conversations_campaign_targets_once_per_step
|
|
2271
|
+
ON public.plg_conversations_campaign_targets
|
|
2272
|
+
(campaign_id, coalesce(phone_e164, email), rotation, coalesce(step_position, 0));
|
|
2273
|
+
|
|
2274
|
+
CREATE INDEX IF NOT EXISTS plg_conversations_campaign_targets_enrollment
|
|
2275
|
+
ON public.plg_conversations_campaign_targets (enrollment_id);
|
|
2276
|
+
|
|
2277
|
+
-- \u2500\u2500 the Evolution pace, from what practitioners report \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2278
|
+
--
|
|
2279
|
+
-- 003 started Evolution at 250 a day and 12 a minute. The 2026-10-28 research
|
|
2280
|
+
-- (Baileys/Evolution issues, Meta's own test of a cap on unanswered messages)
|
|
2281
|
+
-- says first contact with people who have not answered is what gets a number
|
|
2282
|
+
-- restricted, and that 30\u201340 NEW contacts a day, at most 10 an hour, 2\u20135 min
|
|
2283
|
+
-- apart, on business days, is where old numbers survive. The unofficial
|
|
2284
|
+
-- connection breaks WhatsApp's terms by existing; pace lowers the odds, it
|
|
2285
|
+
-- does not remove them.
|
|
2286
|
+
CREATE OR REPLACE FUNCTION public.conversations_default_pacing(p_provider text)
|
|
2287
|
+
RETURNS jsonb LANGUAGE sql IMMUTABLE AS $$
|
|
2288
|
+
SELECT CASE p_provider
|
|
2289
|
+
WHEN 'tyxter' THEN jsonb_build_object(
|
|
2290
|
+
'per_minute', 60, 'per_hour', 1000, 'per_day', null,
|
|
2291
|
+
'delay_seconds', jsonb_build_array(1, 3),
|
|
2292
|
+
'same_recipient_seconds', 6,
|
|
2293
|
+
'hours', jsonb_build_object('start', '09:00', 'end', '18:00', 'weekdays_only', true))
|
|
2294
|
+
WHEN 'evolution' THEN jsonb_build_object(
|
|
2295
|
+
'per_minute', 1, 'per_hour', 10, 'per_day', 40,
|
|
2296
|
+
'delay_seconds', jsonb_build_array(120, 300),
|
|
2297
|
+
'typing_seconds', jsonb_build_array(3, 8),
|
|
2298
|
+
'same_recipient_seconds', 6,
|
|
2299
|
+
'batch_size', 10, 'batch_cooldown_minutes', 20,
|
|
2300
|
+
'hours', jsonb_build_object('start', '09:00', 'end', '18:00', 'weekdays_only', true))
|
|
2301
|
+
ELSE '{}'::jsonb END
|
|
2302
|
+
$$;
|
|
2303
|
+
|
|
2304
|
+
-- \u2500\u2500 what the monitor needs: one row per step \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2305
|
+
DROP VIEW IF EXISTS public.v_conversations_campaign_step_progress;
|
|
2306
|
+
CREATE VIEW public.v_conversations_campaign_step_progress
|
|
2307
|
+
WITH (security_invoker = true) AS
|
|
2308
|
+
SELECT t.campaign_id,
|
|
2309
|
+
t.tenant_id,
|
|
2310
|
+
coalesce(t.step_position, 1) AS step_position,
|
|
2311
|
+
count(*) AS total,
|
|
2312
|
+
count(*) FILTER (WHERE t.state IN ('queued', 'sending')) AS pending,
|
|
2313
|
+
count(*) FILTER (WHERE t.state IN ('sent','delivered','read','replied')) AS sent,
|
|
2314
|
+
count(*) FILTER (WHERE t.delivered_at IS NOT NULL OR t.state IN ('delivered','read','replied')) AS delivered,
|
|
2315
|
+
count(*) FILTER (WHERE t.read_at IS NOT NULL OR t.state IN ('read','replied')) AS read,
|
|
2316
|
+
count(*) FILTER (WHERE t.state = 'replied' OR t.replied_at IS NOT NULL) AS replied,
|
|
2317
|
+
count(*) FILTER (WHERE t.state = 'failed') AS failed,
|
|
2318
|
+
count(*) FILTER (WHERE t.state = 'skipped') AS skipped
|
|
2319
|
+
FROM public.plg_conversations_campaign_targets t
|
|
2320
|
+
WHERE t.tenant_id IN (SELECT public.user_tenant_ids())
|
|
2321
|
+
GROUP BY t.campaign_id, t.tenant_id, coalesce(t.step_position, 1);
|
|
2322
|
+
|
|
2323
|
+
GRANT SELECT ON public.v_conversations_campaign_step_progress TO authenticated;
|
|
2324
|
+
|
|
2325
|
+
DROP VIEW IF EXISTS public.v_conversations_campaign_enrollment_summary;
|
|
2326
|
+
CREATE VIEW public.v_conversations_campaign_enrollment_summary
|
|
2327
|
+
WITH (security_invoker = true) AS
|
|
2328
|
+
SELECT e.campaign_id,
|
|
2329
|
+
e.tenant_id,
|
|
2330
|
+
count(*) AS enrolled,
|
|
2331
|
+
count(*) FILTER (WHERE e.state = 'active') AS active,
|
|
2332
|
+
count(*) FILTER (WHERE e.state = 'replied') AS replied,
|
|
2333
|
+
count(*) FILTER (WHERE e.state = 'opted_out') AS opted_out,
|
|
2334
|
+
count(*) FILTER (WHERE e.state = 'completed') AS completed,
|
|
2335
|
+
count(*) FILTER (WHERE e.state = 'no_route') AS no_route,
|
|
2336
|
+
count(*) FILTER (WHERE e.state IN ('failed', 'exited')) AS stopped
|
|
2337
|
+
FROM public.plg_conversations_campaign_enrollments e
|
|
2338
|
+
WHERE e.tenant_id IN (SELECT public.user_tenant_ids())
|
|
2339
|
+
GROUP BY e.campaign_id, e.tenant_id;
|
|
2340
|
+
|
|
2341
|
+
GRANT SELECT ON public.v_conversations_campaign_enrollment_summary TO authenticated;
|
|
2342
|
+
`;
|
|
2343
|
+
var MIGRATION_018_THE_ENGINE_FINDS_RUNNING_CAMPAIGNS = `-- 018_the_engine_finds_running_campaigns.sql
|
|
2344
|
+
--
|
|
2345
|
+
-- The campaign engine (integration service, every minute) needs one thing it
|
|
2346
|
+
-- cannot get under a tenant's RLS: which tenants have a campaign running at
|
|
2347
|
+
-- all. Everything after that it does AS the tenant (asActor), so it reads and
|
|
2348
|
+
-- writes campaigns, steps, enrollments and targets under the same policies as
|
|
2349
|
+
-- a person on the screen.
|
|
2350
|
+
--
|
|
2351
|
+
-- Same pattern as shop_notify_claim: a SECURITY DEFINER read granted to the
|
|
2352
|
+
-- service role only.
|
|
2353
|
+
|
|
2354
|
+
CREATE OR REPLACE FUNCTION public.conversations_running_campaigns()
|
|
2355
|
+
RETURNS TABLE(campaign_id uuid, tenant_id uuid)
|
|
2356
|
+
LANGUAGE sql
|
|
2357
|
+
STABLE SECURITY DEFINER
|
|
2358
|
+
SET search_path TO ''
|
|
2359
|
+
AS $function$
|
|
2360
|
+
SELECT c.id, c.tenant_id
|
|
2361
|
+
FROM public.plg_conversations_campaigns c
|
|
2362
|
+
WHERE c.status = 'running'
|
|
2363
|
+
ORDER BY c.started_at NULLS LAST, c.created_at
|
|
2364
|
+
$function$;
|
|
2365
|
+
|
|
2366
|
+
REVOKE ALL ON FUNCTION public.conversations_running_campaigns() FROM PUBLIC, anon, authenticated;
|
|
2367
|
+
GRANT EXECUTE ON FUNCTION public.conversations_running_campaigns() TO service_role;
|
|
2368
|
+
|
|
2369
|
+
DO $$ BEGIN
|
|
2370
|
+
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'fayz_integration') THEN
|
|
2371
|
+
GRANT EXECUTE ON FUNCTION public.conversations_running_campaigns() TO fayz_integration;
|
|
2372
|
+
END IF;
|
|
2373
|
+
END $$;
|
|
2374
|
+
`;
|
|
2119
2375
|
var MIGRATIONS = [
|
|
2120
2376
|
{ id: "000_baseline", sql: MIGRATION_000_BASELINE },
|
|
2121
2377
|
{ id: "001_a_caixa_sabe_quem_falou_por_ultimo", sql: MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO },
|
|
@@ -2133,9 +2389,11 @@ var MIGRATIONS = [
|
|
|
2133
2389
|
{ id: "013_a_midia_fica_conosco", sql: MIGRATION_013_A_MIDIA_FICA_CONOSCO },
|
|
2134
2390
|
{ id: "014_claiming_targets_is_server_only", sql: MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY },
|
|
2135
2391
|
{ id: "015_the_service_door_for_messaging", sql: MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING },
|
|
2136
|
-
{ id: "016_a_delivery_receipt_finds_its_tenant", sql: MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT }
|
|
2392
|
+
{ id: "016_a_delivery_receipt_finds_its_tenant", sql: MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT },
|
|
2393
|
+
{ id: "017_a_campaign_has_steps", sql: MIGRATION_017_A_CAMPAIGN_HAS_STEPS },
|
|
2394
|
+
{ id: "018_the_engine_finds_running_campaigns", sql: MIGRATION_018_THE_ENGINE_FINDS_RUNNING_CAMPAIGNS }
|
|
2137
2395
|
];
|
|
2138
2396
|
|
|
2139
|
-
export { MIGRATIONS, MIGRATION_000_BASELINE, MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO, MIGRATION_002_A_CASA_ESCOLHE_POR_ONDE_O_WHATSAPP_SAI, MIGRATION_003_A_CAMPANHA_SAI_NO_RITMO_QUE_O_NUMERO_AGUENTA, MIGRATION_004_A_TELA_SABE_SE_PODE_FALAR_ANTES_DE_DEIXAR_ESCREVER, MIGRATION_005_A_CONVERSA_CONTA_AO_FUNIL_QUE_HOUVE_CONTATO, MIGRATION_006_A_CAIXA_AVISA_QUE_CHEGOU, MIGRATION_007_A_CONVERSA_DIZ_DE_QUEM_E_O_LEAD, MIGRATION_008_DAR_POR_VISTA_E_UMA_DECISAO, MIGRATION_009_A_MENSAGEM_INTEIRA_ATRAVESSA_O_REALTIME, MIGRATION_010_A_CHEGADA_E_ANUNCIADA_POR_CONTA, MIGRATION_011_O_ANUNCIO_E_UMA_CAMPAINHA_NAO_UM_RECADO, MIGRATION_012_A_RICH_MESSAGE_KEEPS_ITS_SHAPE, MIGRATION_013_A_MIDIA_FICA_CONOSCO, MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY, MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING, MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT };
|
|
2397
|
+
export { MIGRATIONS, MIGRATION_000_BASELINE, MIGRATION_001_A_CAIXA_SABE_QUEM_FALOU_POR_ULTIMO, MIGRATION_002_A_CASA_ESCOLHE_POR_ONDE_O_WHATSAPP_SAI, MIGRATION_003_A_CAMPANHA_SAI_NO_RITMO_QUE_O_NUMERO_AGUENTA, MIGRATION_004_A_TELA_SABE_SE_PODE_FALAR_ANTES_DE_DEIXAR_ESCREVER, MIGRATION_005_A_CONVERSA_CONTA_AO_FUNIL_QUE_HOUVE_CONTATO, MIGRATION_006_A_CAIXA_AVISA_QUE_CHEGOU, MIGRATION_007_A_CONVERSA_DIZ_DE_QUEM_E_O_LEAD, MIGRATION_008_DAR_POR_VISTA_E_UMA_DECISAO, MIGRATION_009_A_MENSAGEM_INTEIRA_ATRAVESSA_O_REALTIME, MIGRATION_010_A_CHEGADA_E_ANUNCIADA_POR_CONTA, MIGRATION_011_O_ANUNCIO_E_UMA_CAMPAINHA_NAO_UM_RECADO, MIGRATION_012_A_RICH_MESSAGE_KEEPS_ITS_SHAPE, MIGRATION_013_A_MIDIA_FICA_CONOSCO, MIGRATION_014_CLAIMING_TARGETS_IS_SERVER_ONLY, MIGRATION_015_THE_SERVICE_DOOR_FOR_MESSAGING, MIGRATION_016_A_DELIVERY_RECEIPT_FINDS_ITS_TENANT, MIGRATION_017_A_CAMPAIGN_HAS_STEPS, MIGRATION_018_THE_ENGINE_FINDS_RUNNING_CAMPAIGNS };
|
|
2140
2398
|
//# sourceMappingURL=main.js.map
|
|
2141
2399
|
//# sourceMappingURL=main.js.map
|