sistema-de-chamados/convex
2025-10-09 22:08:20 -03:00
..
_generated feat: adicionar painel de máquinas e autenticação por agente 2025-10-07 21:37:41 -03:00
alerts.ts convex: mover action de envio de alertas para arquivo Node ('alerts_actions.ts' com 'use node'); remover import de 'tls' do módulo de queries/mutations; ajustar cron para usar api.alerts_actions; remover tentativa de envio de e-mail no mutation addComment (evitar Node API em isolate). 2025-10-07 17:04:38 -03:00
alerts_actions.ts convex: mover action de envio de alertas para arquivo Node ('alerts_actions.ts' com 'use node'); remover import de 'tls' do módulo de queries/mutations; ajustar cron para usar api.alerts_actions; remover tentativa de envio de e-mail no mutation addComment (evitar Node API em isolate). 2025-10-07 17:04:38 -03:00
bootstrap.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
categories.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
commentTemplates.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
companies.ts Hours by client: add search and CSV filtering; add alerts cron (BRT 08:00 guard) + alerts panel filters; admin companies shows last alert; PDF Inter font from public/fonts; fix Select empty value; type cleanups; tests for CSV/TZ; remove Knowledge Base nav 2025-10-07 15:39:55 -03:00
convex.config.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
crons.ts convex(cron): fornecer objeto de argumentos para action sendHoursUsageAlerts na crons.interval (TS2554) 2025-10-07 17:46:56 -03:00
fields.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
files.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
invites.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
machines.ts feat(desktop-agent,admin/inventory): secure token storage via keyring; extended inventory collectors per OS; new /api/machines/inventory endpoint; posture rules + tickets; Admin UI inventory with filters, search and export; docs + CI desktop release 2025-10-09 22:08:20 -03:00
migrations.ts feat: CSV exports, PDF improvements, play internal/external with hour split, roles cleanup, admin companies with 'Cliente avulso', ticket list spacing/alignment fixes, status translations and mappings 2025-10-07 13:42:45 -03:00
queues.ts feat: CSV exports, PDF improvements, play internal/external with hour split, roles cleanup, admin companies with 'Cliente avulso', ticket list spacing/alignment fixes, status translations and mappings 2025-10-07 13:42:45 -03:00
rbac.ts feat: CSV exports, PDF improvements, play internal/external with hour split, roles cleanup, admin companies with 'Cliente avulso', ticket list spacing/alignment fixes, status translations and mappings 2025-10-07 13:42:45 -03:00
README.md chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
reports.ts views: criar página /views com gráficos (Canais movido do dashboard, CSAT distribuição, Filas abertas); dashboard: trocar por gráfico Abertos x Resolvidos (últimos 7/30/90 dias); reports: nova query openedResolvedByDay 2025-10-07 17:28:01 -03:00
schema.ts feat: adicionar painel de máquinas e autenticação por agente 2025-10-07 21:37:41 -03:00
seed.ts feat: CSV exports, PDF improvements, play internal/external with hour split, roles cleanup, admin companies with 'Cliente avulso', ticket list spacing/alignment fixes, status translations and mappings 2025-10-07 13:42:45 -03:00
slas.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
teams.ts chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
tickets.ts Ajusta timeline, comentários internos e contadores de trabalho 2025-10-07 22:12:18 -03:00
tsconfig.json chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
users.ts feat: CSV exports, PDF improvements, play internal/external with hour split, roles cleanup, admin companies with 'Cliente avulso', ticket list spacing/alignment fixes, status translations and mappings 2025-10-07 13:42:45 -03:00

Welcome to your Convex functions directory!

Write your Convex functions here. See https://docs.convex.dev/functions for more.

A query function that takes two arguments looks like:

// convex/myFunctions.ts
import { query } from "./_generated/server";
import { v } from "convex/values";

export const myQueryFunction = query({
  // Validators for arguments.
  args: {
    first: v.number(),
    second: v.string(),
  },

  // Function implementation.
  handler: async (ctx, args) => {
    // Read the database as many times as you need here.
    // See https://docs.convex.dev/database/reading-data.
    const documents = await ctx.db.query("tablename").collect();

    // Arguments passed from the client are properties of the args object.
    console.log(args.first, args.second);

    // Write arbitrary JavaScript here: filter, aggregate, build derived data,
    // remove non-public properties, or create new objects.
    return documents;
  },
});

Using this query function in a React component looks like:

const data = useQuery(api.myFunctions.myQueryFunction, {
  first: 10,
  second: "hello",
});

A mutation function looks like:

// convex/myFunctions.ts
import { mutation } from "./_generated/server";
import { v } from "convex/values";

export const myMutationFunction = mutation({
  // Validators for arguments.
  args: {
    first: v.string(),
    second: v.string(),
  },

  // Function implementation.
  handler: async (ctx, args) => {
    // Insert or modify documents in the database here.
    // Mutations can also read from the database like queries.
    // See https://docs.convex.dev/database/writing-data.
    const message = { body: args.first, author: args.second };
    const id = await ctx.db.insert("messages", message);

    // Optionally, return a value from your mutation.
    return await ctx.db.get(id);
  },
});

Using this mutation function in a React component looks like:

const mutation = useMutation(api.myFunctions.myMutationFunction);
function handleButtonPress() {
  // fire and forget, the most common way to use mutations
  mutation({ first: "Hello!", second: "me" });
  // OR
  // use the result once the mutation has completed
  mutation({ first: "Hello!", second: "me" }).then((result) =>
    console.log(result),
  );
}

Use the Convex CLI to push your functions to a deployment. See everything the Convex CLI can do by running npx convex -h in your project root directory. To learn more, launch the docs with npx convex docs.