create-bw-app 0.13.2 → 0.14.0
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 +2 -2
- package/package.json +1 -1
- package/src/app-manifest.mjs +4 -2
- package/src/constants.mjs +95 -18
- package/src/doctor.mjs +38 -0
- package/src/generator.mjs +75 -19
- package/template/base/app/(auth)/auth/confirmed/page.tsx +1 -0
- package/template/base/app/(auth)/auth/post-login/page.tsx +1 -0
- package/template/base/app/(auth)/auth-provider.tsx +25 -0
- package/template/base/app/(auth)/forgot-password/page.tsx +1 -0
- package/template/base/app/(auth)/invite/[invitationId]/invite-route-mount.tsx +10 -0
- package/template/base/app/(auth)/invite/[invitationId]/page.tsx +1 -0
- package/template/base/app/(auth)/layout.tsx +5 -0
- package/template/base/app/(auth)/login/page.tsx +1 -0
- package/template/base/app/(auth)/reset-password/page.tsx +1 -0
- package/template/base/app/(auth)/signup/page.tsx +1 -0
- package/template/base/app/(shell)/account/page.tsx +5 -0
- package/template/base/app/(shell)/dashboard/dashboard-live-mount.tsx +21 -0
- package/template/base/app/(shell)/dashboard/page.tsx +1 -0
- package/template/base/app/(shell)/layout.tsx +24 -0
- package/template/base/app/(shell)/shell-layout-client.tsx +134 -0
- package/template/base/app/api/account/route.ts +2 -0
- package/template/base/app/auth/callback/route.ts +1 -0
- package/template/base/app/auth/cleanup/route.ts +1 -0
- package/template/base/app/layout.tsx +8 -2
- package/template/base/config/env.ts +98 -0
- package/template/module-manifests/marketing/brightweb.module.json +12 -0
- package/template/modules/marketing/app/(shell)/marketing/page.tsx +1 -0
- package/template/modules/marketing/app/api/marketing/_handlers.ts +144 -0
- package/template/modules/marketing/app/api/marketing/analytics/campaigns/[id]/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/analytics/overview/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/analytics/segments/[id]/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/[id]/cancel/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/[id]/recipients/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/[id]/retry/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/[id]/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/[id]/schedule/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/[id]/send/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/[id]/test/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/campaigns/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/segments/[id]/preview/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/segments/[id]/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/segments/preview/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/segments/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/topics/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/unsubscribe/[token]/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/webhooks/resend/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/worker/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/workflows/[id]/activate/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/workflows/[id]/nodes/[nodeId]/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/workflows/[id]/nodes/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/workflows/[id]/pause/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/workflows/[id]/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/workflows/[id]/runs/route.ts +2 -0
- package/template/modules/marketing/app/api/marketing/workflows/route.ts +2 -0
- package/template/modules/projects/app/(shell)/projects/[id]/board/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/projects/[id]/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/projects/[id]/tasks/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/projects/layout.tsx +5 -0
- package/template/modules/projects/app/(shell)/projects/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/projects/projects-live-mounts.tsx +27 -0
- package/template/modules/projects/app/(shell)/projects/projects-server-mounts.tsx +54 -0
- package/template/modules/projects/app/api/projects/[id]/activity/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/links/[itemId]/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/links/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/members/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/milestones/[itemId]/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/milestones/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/tasks/[itemId]/route.ts +2 -0
- package/template/modules/projects/app/api/projects/[id]/tasks/route.ts +2 -0
- package/template/modules/projects/app/api/projects/_handlers.ts +86 -0
- package/template/modules/projects/app/api/projects/organizations/route.ts +2 -0
- package/template/modules/projects/app/api/projects/route.ts +2 -0
- package/template/modules/projects/app/api/projects/stats/route.ts +2 -0
- package/template/supabase/README.md +3 -0
- package/template/supabase/module-registry.json +6 -0
- package/template/supabase/modules/core/migrations/20260726180000_enable_rate_limit_counters_rls.sql +2 -0
- package/template/supabase/modules/marketing/README.md +12 -0
- package/template/supabase/modules/marketing/migrations/20260725120000_marketing_v1.sql +118 -0
- package/template/supabase/modules/marketing/migrations/20260725130000_marketing_campaigns.sql +133 -0
- package/template/supabase/modules/marketing/migrations/20260726120000_marketing_segments.sql +41 -0
- package/template/supabase/modules/marketing/migrations/20260726150000_marketing_workflows.sql +174 -0
- package/template/supabase/modules/marketing/migrations/20260726170000_marketing_engine_safety.sql +68 -0
- /package/template/modules/admin/app/{admin → (shell)/admin}/users/page.tsx +0 -0
- /package/template/modules/crm/app/{crm → (shell)/crm}/layout.tsx +0 -0
- /package/template/modules/crm/app/{crm → (shell)/crm}/page.tsx +0 -0
- /package/template/modules/crm/app/{crm → (shell)/crm}/report/page.tsx +0 -0
package/template/supabase/modules/marketing/migrations/20260726170000_marketing_engine_safety.sql
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
alter table public.marketing_worker_cursors
|
|
2
|
+
add column if not exists cursor_id uuid;
|
|
3
|
+
|
|
4
|
+
with duplicate_steps as (
|
|
5
|
+
select
|
|
6
|
+
id,
|
|
7
|
+
row_number() over (
|
|
8
|
+
partition by run_id, node_id
|
|
9
|
+
order by executed_at, id
|
|
10
|
+
) as duplicate_number
|
|
11
|
+
from public.marketing_workflow_step_runs
|
|
12
|
+
where node_id is not null
|
|
13
|
+
)
|
|
14
|
+
delete from public.marketing_workflow_step_runs
|
|
15
|
+
where id in (
|
|
16
|
+
select id
|
|
17
|
+
from duplicate_steps
|
|
18
|
+
where duplicate_number > 1
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
create unique index if not exists marketing_workflow_step_runs_run_node_idx
|
|
22
|
+
on public.marketing_workflow_step_runs (run_id, node_id)
|
|
23
|
+
where node_id is not null;
|
|
24
|
+
|
|
25
|
+
create or replace function public.claim_marketing_campaign_recipients(
|
|
26
|
+
target_campaign_id uuid,
|
|
27
|
+
claim_limit integer,
|
|
28
|
+
claim_time timestamptz default now()
|
|
29
|
+
)
|
|
30
|
+
returns setof public.marketing_campaign_recipients
|
|
31
|
+
language sql
|
|
32
|
+
security definer
|
|
33
|
+
set search_path = public
|
|
34
|
+
as $$
|
|
35
|
+
update public.marketing_campaign_recipients
|
|
36
|
+
set status = 'sending',
|
|
37
|
+
attempt_count = attempt_count + 1,
|
|
38
|
+
next_attempt_at = null,
|
|
39
|
+
updated_at = claim_time
|
|
40
|
+
where id in (
|
|
41
|
+
select id
|
|
42
|
+
from public.marketing_campaign_recipients
|
|
43
|
+
where campaign_id = target_campaign_id
|
|
44
|
+
and (
|
|
45
|
+
status = 'queued'
|
|
46
|
+
or (
|
|
47
|
+
status = 'failed'
|
|
48
|
+
and attempt_count < 3
|
|
49
|
+
and next_attempt_at is not null
|
|
50
|
+
and next_attempt_at <= claim_time
|
|
51
|
+
)
|
|
52
|
+
or (
|
|
53
|
+
status = 'sending'
|
|
54
|
+
and attempt_count < 3
|
|
55
|
+
and updated_at <= claim_time - interval '15 minutes'
|
|
56
|
+
)
|
|
57
|
+
)
|
|
58
|
+
order by created_at, id
|
|
59
|
+
for update skip locked
|
|
60
|
+
limit greatest(1, least(claim_limit, 1000))
|
|
61
|
+
)
|
|
62
|
+
returning *;
|
|
63
|
+
$$;
|
|
64
|
+
|
|
65
|
+
revoke all on function public.claim_marketing_campaign_recipients(uuid, integer, timestamptz)
|
|
66
|
+
from public, anon, authenticated;
|
|
67
|
+
grant execute on function public.claim_marketing_campaign_recipients(uuid, integer, timestamptz)
|
|
68
|
+
to service_role;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|