mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 13:16:51 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
35ca1f80f2
commit
288ffeb2d6
3 changed files with 139 additions and 5 deletions
|
|
@ -16,9 +16,15 @@ import { Route as PainelRouteImport } from './routes/painel'
|
||||||
import { Route as LoginRouteImport } from './routes/login'
|
import { Route as LoginRouteImport } from './routes/login'
|
||||||
import { Route as IndexRouteImport } from './routes/index'
|
import { Route as IndexRouteImport } from './routes/index'
|
||||||
import { Route as PainelIndexRouteImport } from './routes/painel.index'
|
import { Route as PainelIndexRouteImport } from './routes/painel.index'
|
||||||
|
import { Route as PainelSkillsRouteImport } from './routes/painel.skills'
|
||||||
import { Route as PainelFaturamentoRouteImport } from './routes/painel.faturamento'
|
import { Route as PainelFaturamentoRouteImport } from './routes/painel.faturamento'
|
||||||
import { Route as PainelConfiguracoesRouteImport } from './routes/painel.configuracoes'
|
import { Route as PainelConfiguracoesRouteImport } from './routes/painel.configuracoes'
|
||||||
|
import { Route as PainelAgenteRouteImport } from './routes/painel.agente'
|
||||||
import { Route as CheckoutSucessoRouteImport } from './routes/checkout.sucesso'
|
import { Route as CheckoutSucessoRouteImport } from './routes/checkout.sucesso'
|
||||||
|
import { Route as PainelSkillsIndexRouteImport } from './routes/painel.skills.index'
|
||||||
|
import { Route as PainelSkillsPreviewRouteImport } from './routes/painel.skills.preview'
|
||||||
|
import { Route as PainelSkillsNovaRouteImport } from './routes/painel.skills.nova'
|
||||||
|
import { Route as PainelSkillsIdRouteImport } from './routes/painel.skills.$id'
|
||||||
|
|
||||||
const SignupRoute = SignupRouteImport.update({
|
const SignupRoute = SignupRouteImport.update({
|
||||||
id: '/signup',
|
id: '/signup',
|
||||||
|
|
@ -55,6 +61,11 @@ const PainelIndexRoute = PainelIndexRouteImport.update({
|
||||||
path: '/',
|
path: '/',
|
||||||
getParentRoute: () => PainelRoute,
|
getParentRoute: () => PainelRoute,
|
||||||
} as any)
|
} as any)
|
||||||
|
const PainelSkillsRoute = PainelSkillsRouteImport.update({
|
||||||
|
id: '/skills',
|
||||||
|
path: '/skills',
|
||||||
|
getParentRoute: () => PainelRoute,
|
||||||
|
} as any)
|
||||||
const PainelFaturamentoRoute = PainelFaturamentoRouteImport.update({
|
const PainelFaturamentoRoute = PainelFaturamentoRouteImport.update({
|
||||||
id: '/faturamento',
|
id: '/faturamento',
|
||||||
path: '/faturamento',
|
path: '/faturamento',
|
||||||
|
|
@ -65,11 +76,36 @@ const PainelConfiguracoesRoute = PainelConfiguracoesRouteImport.update({
|
||||||
path: '/configuracoes',
|
path: '/configuracoes',
|
||||||
getParentRoute: () => PainelRoute,
|
getParentRoute: () => PainelRoute,
|
||||||
} as any)
|
} as any)
|
||||||
|
const PainelAgenteRoute = PainelAgenteRouteImport.update({
|
||||||
|
id: '/agente',
|
||||||
|
path: '/agente',
|
||||||
|
getParentRoute: () => PainelRoute,
|
||||||
|
} as any)
|
||||||
const CheckoutSucessoRoute = CheckoutSucessoRouteImport.update({
|
const CheckoutSucessoRoute = CheckoutSucessoRouteImport.update({
|
||||||
id: '/checkout/sucesso',
|
id: '/checkout/sucesso',
|
||||||
path: '/checkout/sucesso',
|
path: '/checkout/sucesso',
|
||||||
getParentRoute: () => rootRouteImport,
|
getParentRoute: () => rootRouteImport,
|
||||||
} as any)
|
} as any)
|
||||||
|
const PainelSkillsIndexRoute = PainelSkillsIndexRouteImport.update({
|
||||||
|
id: '/',
|
||||||
|
path: '/',
|
||||||
|
getParentRoute: () => PainelSkillsRoute,
|
||||||
|
} as any)
|
||||||
|
const PainelSkillsPreviewRoute = PainelSkillsPreviewRouteImport.update({
|
||||||
|
id: '/preview',
|
||||||
|
path: '/preview',
|
||||||
|
getParentRoute: () => PainelSkillsRoute,
|
||||||
|
} as any)
|
||||||
|
const PainelSkillsNovaRoute = PainelSkillsNovaRouteImport.update({
|
||||||
|
id: '/nova',
|
||||||
|
path: '/nova',
|
||||||
|
getParentRoute: () => PainelSkillsRoute,
|
||||||
|
} as any)
|
||||||
|
const PainelSkillsIdRoute = PainelSkillsIdRouteImport.update({
|
||||||
|
id: '/$id',
|
||||||
|
path: '/$id',
|
||||||
|
getParentRoute: () => PainelSkillsRoute,
|
||||||
|
} as any)
|
||||||
|
|
||||||
export interface FileRoutesByFullPath {
|
export interface FileRoutesByFullPath {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
|
|
@ -79,9 +115,15 @@ export interface FileRoutesByFullPath {
|
||||||
'/redefinir-senha': typeof RedefinirSenhaRoute
|
'/redefinir-senha': typeof RedefinirSenhaRoute
|
||||||
'/signup': typeof SignupRoute
|
'/signup': typeof SignupRoute
|
||||||
'/checkout/sucesso': typeof CheckoutSucessoRoute
|
'/checkout/sucesso': typeof CheckoutSucessoRoute
|
||||||
|
'/painel/agente': typeof PainelAgenteRoute
|
||||||
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
||||||
'/painel/faturamento': typeof PainelFaturamentoRoute
|
'/painel/faturamento': typeof PainelFaturamentoRoute
|
||||||
|
'/painel/skills': typeof PainelSkillsRouteWithChildren
|
||||||
'/painel/': typeof PainelIndexRoute
|
'/painel/': typeof PainelIndexRoute
|
||||||
|
'/painel/skills/$id': typeof PainelSkillsIdRoute
|
||||||
|
'/painel/skills/nova': typeof PainelSkillsNovaRoute
|
||||||
|
'/painel/skills/preview': typeof PainelSkillsPreviewRoute
|
||||||
|
'/painel/skills/': typeof PainelSkillsIndexRoute
|
||||||
}
|
}
|
||||||
export interface FileRoutesByTo {
|
export interface FileRoutesByTo {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
|
|
@ -90,9 +132,14 @@ export interface FileRoutesByTo {
|
||||||
'/redefinir-senha': typeof RedefinirSenhaRoute
|
'/redefinir-senha': typeof RedefinirSenhaRoute
|
||||||
'/signup': typeof SignupRoute
|
'/signup': typeof SignupRoute
|
||||||
'/checkout/sucesso': typeof CheckoutSucessoRoute
|
'/checkout/sucesso': typeof CheckoutSucessoRoute
|
||||||
|
'/painel/agente': typeof PainelAgenteRoute
|
||||||
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
||||||
'/painel/faturamento': typeof PainelFaturamentoRoute
|
'/painel/faturamento': typeof PainelFaturamentoRoute
|
||||||
'/painel': typeof PainelIndexRoute
|
'/painel': typeof PainelIndexRoute
|
||||||
|
'/painel/skills/$id': typeof PainelSkillsIdRoute
|
||||||
|
'/painel/skills/nova': typeof PainelSkillsNovaRoute
|
||||||
|
'/painel/skills/preview': typeof PainelSkillsPreviewRoute
|
||||||
|
'/painel/skills': typeof PainelSkillsIndexRoute
|
||||||
}
|
}
|
||||||
export interface FileRoutesById {
|
export interface FileRoutesById {
|
||||||
__root__: typeof rootRouteImport
|
__root__: typeof rootRouteImport
|
||||||
|
|
@ -103,9 +150,15 @@ export interface FileRoutesById {
|
||||||
'/redefinir-senha': typeof RedefinirSenhaRoute
|
'/redefinir-senha': typeof RedefinirSenhaRoute
|
||||||
'/signup': typeof SignupRoute
|
'/signup': typeof SignupRoute
|
||||||
'/checkout/sucesso': typeof CheckoutSucessoRoute
|
'/checkout/sucesso': typeof CheckoutSucessoRoute
|
||||||
|
'/painel/agente': typeof PainelAgenteRoute
|
||||||
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
||||||
'/painel/faturamento': typeof PainelFaturamentoRoute
|
'/painel/faturamento': typeof PainelFaturamentoRoute
|
||||||
|
'/painel/skills': typeof PainelSkillsRouteWithChildren
|
||||||
'/painel/': typeof PainelIndexRoute
|
'/painel/': typeof PainelIndexRoute
|
||||||
|
'/painel/skills/$id': typeof PainelSkillsIdRoute
|
||||||
|
'/painel/skills/nova': typeof PainelSkillsNovaRoute
|
||||||
|
'/painel/skills/preview': typeof PainelSkillsPreviewRoute
|
||||||
|
'/painel/skills/': typeof PainelSkillsIndexRoute
|
||||||
}
|
}
|
||||||
export interface FileRouteTypes {
|
export interface FileRouteTypes {
|
||||||
fileRoutesByFullPath: FileRoutesByFullPath
|
fileRoutesByFullPath: FileRoutesByFullPath
|
||||||
|
|
@ -117,9 +170,15 @@ export interface FileRouteTypes {
|
||||||
| '/redefinir-senha'
|
| '/redefinir-senha'
|
||||||
| '/signup'
|
| '/signup'
|
||||||
| '/checkout/sucesso'
|
| '/checkout/sucesso'
|
||||||
|
| '/painel/agente'
|
||||||
| '/painel/configuracoes'
|
| '/painel/configuracoes'
|
||||||
| '/painel/faturamento'
|
| '/painel/faturamento'
|
||||||
|
| '/painel/skills'
|
||||||
| '/painel/'
|
| '/painel/'
|
||||||
|
| '/painel/skills/$id'
|
||||||
|
| '/painel/skills/nova'
|
||||||
|
| '/painel/skills/preview'
|
||||||
|
| '/painel/skills/'
|
||||||
fileRoutesByTo: FileRoutesByTo
|
fileRoutesByTo: FileRoutesByTo
|
||||||
to:
|
to:
|
||||||
| '/'
|
| '/'
|
||||||
|
|
@ -128,9 +187,14 @@ export interface FileRouteTypes {
|
||||||
| '/redefinir-senha'
|
| '/redefinir-senha'
|
||||||
| '/signup'
|
| '/signup'
|
||||||
| '/checkout/sucesso'
|
| '/checkout/sucesso'
|
||||||
|
| '/painel/agente'
|
||||||
| '/painel/configuracoes'
|
| '/painel/configuracoes'
|
||||||
| '/painel/faturamento'
|
| '/painel/faturamento'
|
||||||
| '/painel'
|
| '/painel'
|
||||||
|
| '/painel/skills/$id'
|
||||||
|
| '/painel/skills/nova'
|
||||||
|
| '/painel/skills/preview'
|
||||||
|
| '/painel/skills'
|
||||||
id:
|
id:
|
||||||
| '__root__'
|
| '__root__'
|
||||||
| '/'
|
| '/'
|
||||||
|
|
@ -140,9 +204,15 @@ export interface FileRouteTypes {
|
||||||
| '/redefinir-senha'
|
| '/redefinir-senha'
|
||||||
| '/signup'
|
| '/signup'
|
||||||
| '/checkout/sucesso'
|
| '/checkout/sucesso'
|
||||||
|
| '/painel/agente'
|
||||||
| '/painel/configuracoes'
|
| '/painel/configuracoes'
|
||||||
| '/painel/faturamento'
|
| '/painel/faturamento'
|
||||||
|
| '/painel/skills'
|
||||||
| '/painel/'
|
| '/painel/'
|
||||||
|
| '/painel/skills/$id'
|
||||||
|
| '/painel/skills/nova'
|
||||||
|
| '/painel/skills/preview'
|
||||||
|
| '/painel/skills/'
|
||||||
fileRoutesById: FileRoutesById
|
fileRoutesById: FileRoutesById
|
||||||
}
|
}
|
||||||
export interface RootRouteChildren {
|
export interface RootRouteChildren {
|
||||||
|
|
@ -206,6 +276,13 @@ declare module '@tanstack/react-router' {
|
||||||
preLoaderRoute: typeof PainelIndexRouteImport
|
preLoaderRoute: typeof PainelIndexRouteImport
|
||||||
parentRoute: typeof PainelRoute
|
parentRoute: typeof PainelRoute
|
||||||
}
|
}
|
||||||
|
'/painel/skills': {
|
||||||
|
id: '/painel/skills'
|
||||||
|
path: '/skills'
|
||||||
|
fullPath: '/painel/skills'
|
||||||
|
preLoaderRoute: typeof PainelSkillsRouteImport
|
||||||
|
parentRoute: typeof PainelRoute
|
||||||
|
}
|
||||||
'/painel/faturamento': {
|
'/painel/faturamento': {
|
||||||
id: '/painel/faturamento'
|
id: '/painel/faturamento'
|
||||||
path: '/faturamento'
|
path: '/faturamento'
|
||||||
|
|
@ -220,6 +297,13 @@ declare module '@tanstack/react-router' {
|
||||||
preLoaderRoute: typeof PainelConfiguracoesRouteImport
|
preLoaderRoute: typeof PainelConfiguracoesRouteImport
|
||||||
parentRoute: typeof PainelRoute
|
parentRoute: typeof PainelRoute
|
||||||
}
|
}
|
||||||
|
'/painel/agente': {
|
||||||
|
id: '/painel/agente'
|
||||||
|
path: '/agente'
|
||||||
|
fullPath: '/painel/agente'
|
||||||
|
preLoaderRoute: typeof PainelAgenteRouteImport
|
||||||
|
parentRoute: typeof PainelRoute
|
||||||
|
}
|
||||||
'/checkout/sucesso': {
|
'/checkout/sucesso': {
|
||||||
id: '/checkout/sucesso'
|
id: '/checkout/sucesso'
|
||||||
path: '/checkout/sucesso'
|
path: '/checkout/sucesso'
|
||||||
|
|
@ -227,18 +311,68 @@ declare module '@tanstack/react-router' {
|
||||||
preLoaderRoute: typeof CheckoutSucessoRouteImport
|
preLoaderRoute: typeof CheckoutSucessoRouteImport
|
||||||
parentRoute: typeof rootRouteImport
|
parentRoute: typeof rootRouteImport
|
||||||
}
|
}
|
||||||
|
'/painel/skills/': {
|
||||||
|
id: '/painel/skills/'
|
||||||
|
path: '/'
|
||||||
|
fullPath: '/painel/skills/'
|
||||||
|
preLoaderRoute: typeof PainelSkillsIndexRouteImport
|
||||||
|
parentRoute: typeof PainelSkillsRoute
|
||||||
|
}
|
||||||
|
'/painel/skills/preview': {
|
||||||
|
id: '/painel/skills/preview'
|
||||||
|
path: '/preview'
|
||||||
|
fullPath: '/painel/skills/preview'
|
||||||
|
preLoaderRoute: typeof PainelSkillsPreviewRouteImport
|
||||||
|
parentRoute: typeof PainelSkillsRoute
|
||||||
|
}
|
||||||
|
'/painel/skills/nova': {
|
||||||
|
id: '/painel/skills/nova'
|
||||||
|
path: '/nova'
|
||||||
|
fullPath: '/painel/skills/nova'
|
||||||
|
preLoaderRoute: typeof PainelSkillsNovaRouteImport
|
||||||
|
parentRoute: typeof PainelSkillsRoute
|
||||||
|
}
|
||||||
|
'/painel/skills/$id': {
|
||||||
|
id: '/painel/skills/$id'
|
||||||
|
path: '/$id'
|
||||||
|
fullPath: '/painel/skills/$id'
|
||||||
|
preLoaderRoute: typeof PainelSkillsIdRouteImport
|
||||||
|
parentRoute: typeof PainelSkillsRoute
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface PainelSkillsRouteChildren {
|
||||||
|
PainelSkillsIdRoute: typeof PainelSkillsIdRoute
|
||||||
|
PainelSkillsNovaRoute: typeof PainelSkillsNovaRoute
|
||||||
|
PainelSkillsPreviewRoute: typeof PainelSkillsPreviewRoute
|
||||||
|
PainelSkillsIndexRoute: typeof PainelSkillsIndexRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
const PainelSkillsRouteChildren: PainelSkillsRouteChildren = {
|
||||||
|
PainelSkillsIdRoute: PainelSkillsIdRoute,
|
||||||
|
PainelSkillsNovaRoute: PainelSkillsNovaRoute,
|
||||||
|
PainelSkillsPreviewRoute: PainelSkillsPreviewRoute,
|
||||||
|
PainelSkillsIndexRoute: PainelSkillsIndexRoute,
|
||||||
|
}
|
||||||
|
|
||||||
|
const PainelSkillsRouteWithChildren = PainelSkillsRoute._addFileChildren(
|
||||||
|
PainelSkillsRouteChildren,
|
||||||
|
)
|
||||||
|
|
||||||
interface PainelRouteChildren {
|
interface PainelRouteChildren {
|
||||||
|
PainelAgenteRoute: typeof PainelAgenteRoute
|
||||||
PainelConfiguracoesRoute: typeof PainelConfiguracoesRoute
|
PainelConfiguracoesRoute: typeof PainelConfiguracoesRoute
|
||||||
PainelFaturamentoRoute: typeof PainelFaturamentoRoute
|
PainelFaturamentoRoute: typeof PainelFaturamentoRoute
|
||||||
|
PainelSkillsRoute: typeof PainelSkillsRouteWithChildren
|
||||||
PainelIndexRoute: typeof PainelIndexRoute
|
PainelIndexRoute: typeof PainelIndexRoute
|
||||||
}
|
}
|
||||||
|
|
||||||
const PainelRouteChildren: PainelRouteChildren = {
|
const PainelRouteChildren: PainelRouteChildren = {
|
||||||
|
PainelAgenteRoute: PainelAgenteRoute,
|
||||||
PainelConfiguracoesRoute: PainelConfiguracoesRoute,
|
PainelConfiguracoesRoute: PainelConfiguracoesRoute,
|
||||||
PainelFaturamentoRoute: PainelFaturamentoRoute,
|
PainelFaturamentoRoute: PainelFaturamentoRoute,
|
||||||
|
PainelSkillsRoute: PainelSkillsRouteWithChildren,
|
||||||
PainelIndexRoute: PainelIndexRoute,
|
PainelIndexRoute: PainelIndexRoute,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,14 +105,14 @@ function SkillDetailPage() {
|
||||||
const maxVer = Math.max(...versions.data.map((v) => v.version_number), 0);
|
const maxVer = Math.max(...versions.data.map((v) => v.version_number), 0);
|
||||||
const { data, error } = await supabase
|
const { data, error } = await supabase
|
||||||
.from("skill_versions")
|
.from("skill_versions")
|
||||||
.insert({
|
.insert([{
|
||||||
skill_id: id,
|
skill_id: id,
|
||||||
version_number: maxVer + 1,
|
version_number: maxVer + 1,
|
||||||
markdown_content: markdown,
|
markdown_content: markdown,
|
||||||
form_inputs: currentVersion?.form_inputs ?? {},
|
form_inputs: (currentVersion?.form_inputs ?? {}) as Record<string, unknown>,
|
||||||
is_live: false,
|
is_live: false,
|
||||||
created_by: user.id,
|
created_by: user.id,
|
||||||
})
|
}])
|
||||||
.select("id, version_number")
|
.select("id, version_number")
|
||||||
.single();
|
.single();
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
|
||||||
|
|
@ -99,14 +99,14 @@ function SkillPreviewPage() {
|
||||||
// 2. Create version
|
// 2. Create version
|
||||||
const { data: ver, error: verErr } = await supabase
|
const { data: ver, error: verErr } = await supabase
|
||||||
.from("skill_versions")
|
.from("skill_versions")
|
||||||
.insert({
|
.insert([{
|
||||||
skill_id: skill.id,
|
skill_id: skill.id,
|
||||||
version_number: 1,
|
version_number: 1,
|
||||||
markdown_content: markdown,
|
markdown_content: markdown,
|
||||||
form_inputs: formInputs as Record<string, unknown>,
|
form_inputs: formInputs as Record<string, unknown>,
|
||||||
is_live: false,
|
is_live: false,
|
||||||
created_by: user.id,
|
created_by: user.id,
|
||||||
})
|
}])
|
||||||
.select("id")
|
.select("id")
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue