create-bw-app 0.14.0 → 0.15.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/package.json +1 -1
- package/src/constants.mjs +19 -10
- package/src/generator.mjs +6 -1
- package/template/base/app/(auth)/admin-invite/[invitationId]/page.tsx +6 -0
- package/template/base/app/api/cron/keepalive/route.ts +2 -0
- package/template/base/app/api/invitations/[invitationId]/accept/route.ts +5 -0
- package/template/base/app/api/invitations/[invitationId]/register/route.ts +5 -0
- package/template/base/app/api/invitations/[invitationId]/route.ts +5 -0
- package/template/base/app/api/invitations/_dependencies.ts +37 -0
- package/template/base/app/api/organizations/[id]/invitations/[invitationId]/route.ts +9 -0
- package/template/base/app/api/organizations/[id]/invitations/route.ts +11 -0
- package/template/base/app/api/organizations/[id]/route.ts +6 -0
- package/template/base/app/api/organizations/route.ts +6 -0
- package/template/base/config/env.ts +7 -0
- package/template/base/config/shell.overrides.ts +29 -1
- package/template/modules/projects/app/(shell)/account/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/[projectId]/loading.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/[projectId]/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/loading.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/page.tsx +1 -0
package/package.json
CHANGED
package/src/constants.mjs
CHANGED
|
@@ -137,6 +137,7 @@ export const PLATFORM_STARTER_FILES = [
|
|
|
137
137
|
"app/(auth)/reset-password/page.tsx",
|
|
138
138
|
"app/(auth)/auth/post-login/page.tsx",
|
|
139
139
|
"app/(auth)/auth/confirmed/page.tsx",
|
|
140
|
+
"app/(auth)/admin-invite/[invitationId]/page.tsx",
|
|
140
141
|
"app/(auth)/invite/[invitationId]/page.tsx",
|
|
141
142
|
"app/(auth)/invite/[invitationId]/invite-route-mount.tsx",
|
|
142
143
|
"app/(shell)/layout.tsx",
|
|
@@ -145,6 +146,14 @@ export const PLATFORM_STARTER_FILES = [
|
|
|
145
146
|
"app/(shell)/dashboard/dashboard-live-mount.tsx",
|
|
146
147
|
"app/(shell)/dashboard/page.tsx",
|
|
147
148
|
"app/api/account/route.ts",
|
|
149
|
+
"app/api/invitations/_dependencies.ts",
|
|
150
|
+
"app/api/invitations/[invitationId]/route.ts",
|
|
151
|
+
"app/api/invitations/[invitationId]/accept/route.ts",
|
|
152
|
+
"app/api/invitations/[invitationId]/register/route.ts",
|
|
153
|
+
"app/api/organizations/route.ts",
|
|
154
|
+
"app/api/organizations/[id]/route.ts",
|
|
155
|
+
"app/api/organizations/[id]/invitations/route.ts",
|
|
156
|
+
"app/api/organizations/[id]/invitations/[invitationId]/route.ts",
|
|
148
157
|
"app/auth/callback/route.ts",
|
|
149
158
|
"app/auth/cleanup/route.ts",
|
|
150
159
|
"app/layout.tsx",
|
|
@@ -153,16 +162,16 @@ export const PLATFORM_STARTER_FILES = [
|
|
|
153
162
|
];
|
|
154
163
|
|
|
155
164
|
export const APP_DEPENDENCY_DEFAULTS = {
|
|
156
|
-
"@brightweblabs/app-shell": "^0.6.
|
|
157
|
-
"@brightweblabs/core-auth": "^0.
|
|
158
|
-
"@brightweblabs/infra": "^0.
|
|
159
|
-
"@brightweblabs/module-admin": "^0.5.
|
|
160
|
-
"@brightweblabs/module-crm": "^0.8.
|
|
161
|
-
"@brightweblabs/module-marketing": "^0.2.
|
|
162
|
-
"@brightweblabs/module-orgs": "^0.3.
|
|
163
|
-
"@brightweblabs/module-projects": "^0.
|
|
164
|
-
"@brightweblabs/theme": "^0.
|
|
165
|
-
"@brightweblabs/ui": "^1.1.
|
|
165
|
+
"@brightweblabs/app-shell": "^0.6.2",
|
|
166
|
+
"@brightweblabs/core-auth": "^0.7.0",
|
|
167
|
+
"@brightweblabs/infra": "^0.4.0",
|
|
168
|
+
"@brightweblabs/module-admin": "^0.5.5",
|
|
169
|
+
"@brightweblabs/module-crm": "^0.8.5",
|
|
170
|
+
"@brightweblabs/module-marketing": "^0.2.4",
|
|
171
|
+
"@brightweblabs/module-orgs": "^0.3.5",
|
|
172
|
+
"@brightweblabs/module-projects": "^0.7.0",
|
|
173
|
+
"@brightweblabs/theme": "^0.5.0",
|
|
174
|
+
"@brightweblabs/ui": "^1.1.1",
|
|
166
175
|
"geist": "1.7.2",
|
|
167
176
|
"lucide-react": "^1.8.0",
|
|
168
177
|
"next": "^16.0.0",
|
package/src/generator.mjs
CHANGED
|
@@ -906,7 +906,7 @@ export function createShellConfig(selectedModules) {
|
|
|
906
906
|
...importLines,
|
|
907
907
|
'import { starterBrandConfig } from "./brand";',
|
|
908
908
|
'import { getEnabledStarterModules } from "./modules";',
|
|
909
|
-
'import { shellRegistrationOverrides } from "./shell.overrides";',
|
|
909
|
+
'import { additionalShellModules, shellRegistrationOverrides } from "./shell.overrides";',
|
|
910
910
|
"",
|
|
911
911
|
"const dashboardModuleRegistration: ShellModuleRegistration<ShellContextualAction> = {",
|
|
912
912
|
' key: "dashboard",',
|
|
@@ -921,6 +921,11 @@ export function createShellConfig(selectedModules) {
|
|
|
921
921
|
"",
|
|
922
922
|
...registrationLines,
|
|
923
923
|
"",
|
|
924
|
+
" // App-owned surfaces. Declared in config/shell.overrides.ts because",
|
|
925
|
+
" // applyShellRegistrationOverrides can only transform existing",
|
|
926
|
+
" // registrations, and this file is regenerated by create-bw-app update.",
|
|
927
|
+
" registrations.push(...additionalShellModules);",
|
|
928
|
+
"",
|
|
924
929
|
" return registrations;",
|
|
925
930
|
"}",
|
|
926
931
|
"",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createInvitationAcceptHandler } from "@brightweblabs/core-auth/routes";
|
|
2
|
+
import { invitationHttpDependencies } from "../../_dependencies";
|
|
3
|
+
|
|
4
|
+
export const dynamic = "force-dynamic";
|
|
5
|
+
export const POST = createInvitationAcceptHandler(invitationHttpDependencies);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createInvitationRegisterHandler } from "@brightweblabs/core-auth/routes";
|
|
2
|
+
import { invitationHttpDependencies } from "../../_dependencies";
|
|
3
|
+
|
|
4
|
+
export const dynamic = "force-dynamic";
|
|
5
|
+
export const POST = createInvitationRegisterHandler(invitationHttpDependencies);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { requireServerUserAccess } from "@brightweblabs/core-auth/server";
|
|
2
|
+
import { requireServiceRoleClient } from "@brightweblabs/infra/server";
|
|
3
|
+
import {
|
|
4
|
+
getAdminUserInvitationDetails,
|
|
5
|
+
registerUserFromAdminInvitation,
|
|
6
|
+
} from "@brightweblabs/module-admin";
|
|
7
|
+
import { ensureCrmContactForProfile } from "@brightweblabs/module-crm";
|
|
8
|
+
import {
|
|
9
|
+
acceptOrganizationInvitation,
|
|
10
|
+
getOrganizationInvitationDetails,
|
|
11
|
+
registerUserFromOrganizationInvitation,
|
|
12
|
+
} from "@brightweblabs/module-orgs";
|
|
13
|
+
|
|
14
|
+
export const invitationHttpDependencies = {
|
|
15
|
+
getServiceClient: requireServiceRoleClient,
|
|
16
|
+
getAccess: requireServerUserAccess,
|
|
17
|
+
getOrganizationInvitation: getOrganizationInvitationDetails,
|
|
18
|
+
getAdminInvitation: getAdminUserInvitationDetails,
|
|
19
|
+
registerOrganizationInvitation: (client: never, input: {
|
|
20
|
+
invitationId: string;
|
|
21
|
+
firstName: string;
|
|
22
|
+
lastName: string;
|
|
23
|
+
password: string;
|
|
24
|
+
}) => registerUserFromOrganizationInvitation(client, {
|
|
25
|
+
...input,
|
|
26
|
+
ensureCrmContactForProfile,
|
|
27
|
+
}),
|
|
28
|
+
registerAdminInvitation: registerUserFromAdminInvitation,
|
|
29
|
+
acceptOrganizationInvitation: (client: never, input: {
|
|
30
|
+
invitationId: string;
|
|
31
|
+
profileId: string;
|
|
32
|
+
userEmail: string;
|
|
33
|
+
}) => acceptOrganizationInvitation(client, {
|
|
34
|
+
...input,
|
|
35
|
+
ensureCrmContactForProfile,
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const dynamic = "force-dynamic";
|
|
2
|
+
|
|
3
|
+
export async function DELETE(
|
|
4
|
+
request: Request,
|
|
5
|
+
context: { params: Promise<{ id: string; invitationId: string }> },
|
|
6
|
+
) {
|
|
7
|
+
const { handleOrganizationInvitationDeleteRequest } = await import("@brightweblabs/module-orgs");
|
|
8
|
+
return handleOrganizationInvitationDeleteRequest(request, context);
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const dynamic = "force-dynamic";
|
|
2
|
+
|
|
3
|
+
export async function GET(request: Request, context: { params: Promise<{ id: string }> }) {
|
|
4
|
+
const { handleOrganizationInvitationsGetRequest } = await import("@brightweblabs/module-orgs");
|
|
5
|
+
return handleOrganizationInvitationsGetRequest(request, context);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function POST(request: Request, context: { params: Promise<{ id: string }> }) {
|
|
9
|
+
const { handleOrganizationInvitationsPostRequest } = await import("@brightweblabs/module-orgs");
|
|
10
|
+
return handleOrganizationInvitationsPostRequest(request, context);
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const dynamic = "force-dynamic";
|
|
2
|
+
|
|
3
|
+
export async function PATCH(request: Request, context: { params: Promise<{ id: string }> }) {
|
|
4
|
+
const { handleOrganizationPatchRequest } = await import("@brightweblabs/module-orgs");
|
|
5
|
+
return handleOrganizationPatchRequest(request, context);
|
|
6
|
+
}
|
|
@@ -42,6 +42,13 @@ export const starterEnvRequirements: StarterEnvRequirement[] = [
|
|
|
42
42
|
description: "Supabase secret key for privileged Admin, CRM, Marketing, and Projects actions.",
|
|
43
43
|
requiredFor: ["crm", "marketing", "projects", "admin"],
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
key: "SUPABASE_KEEPALIVE_SECRET",
|
|
47
|
+
scope: "server",
|
|
48
|
+
description:
|
|
49
|
+
"Bearer secret for /api/cron/keepalive, which a scheduler calls so free-tier Supabase projects do not idle-pause.",
|
|
50
|
+
requiredFor: ["core-auth"],
|
|
51
|
+
},
|
|
45
52
|
{
|
|
46
53
|
key: "RESEND_API_KEY",
|
|
47
54
|
scope: "server",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ShellContextualAction,
|
|
3
|
+
ShellModuleRegistration,
|
|
4
|
+
ShellRegistrationOverrides,
|
|
5
|
+
} from "@brightweblabs/app-shell";
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* App-owned shell customizations. This scaffolded file is never overwritten by
|
|
@@ -14,3 +18,27 @@ import type { ShellRegistrationOverrides } from "@brightweblabs/app-shell";
|
|
|
14
18
|
* ```
|
|
15
19
|
*/
|
|
16
20
|
export const shellRegistrationOverrides: ShellRegistrationOverrides = {};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* App-owned nav modules — surfaces this app implements itself, which no
|
|
24
|
+
* BrightWeb package provides.
|
|
25
|
+
*
|
|
26
|
+
* `shellRegistrationOverrides` can only transform registrations that already
|
|
27
|
+
* exist, so it cannot introduce a new one. Put app-owned surfaces here instead
|
|
28
|
+
* of editing `config/shell.ts`, which is regenerated by `create-bw-app update`.
|
|
29
|
+
*
|
|
30
|
+
* @example An app-owned tool mounted under the Ferramentas section:
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { BookOpen } from "lucide-react";
|
|
33
|
+
*
|
|
34
|
+
* export const additionalShellModules: ShellModuleRegistration<ShellContextualAction>[] = [
|
|
35
|
+
* {
|
|
36
|
+
* key: "tools",
|
|
37
|
+
* placement: "tools",
|
|
38
|
+
* navItems: [{ href: "/ferramentas/conteudos", label: "Conteúdos", icon: BookOpen, visibility: "admin" }],
|
|
39
|
+
* toolbarRoutes: [{ surface: "insights-cms", match: { prefixes: ["/ferramentas/conteudos"] } }],
|
|
40
|
+
* },
|
|
41
|
+
* ];
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export const additionalShellModules: ShellModuleRegistration<ShellContextualAction>[] = [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientAccountPage as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectDetailLoading as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectDetailRoute as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectsListLoading as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectsListPage as default } from "@brightweblabs/module-projects";
|