DE
Beta-Übersetzung

@core / forms

1.1.0 ▾
verifiziertMIT
GitHub

Formulare und Leads: im Code oder im Admin, Spam-Schutz, DSGVO-Einwilligung, E-Mail-Hinweise, signierte Webhooks, CSV

Code11 DateienKontext~815 TokensPrüfung bestanden

Der genaue Baum, der nach .genpmignore eingebunden wird. Gepinnt an

src/lib/forms/schema.tsschreibgeschützt · 76db1c0
// Tablas de @core/forms. Las recoge drizzle-kit vía src/lib/db/drizzle.config.ts.
import { index, jsonb, pgTable, text } from 'drizzle-orm/pg-core';
import { primaryId, timestamps } from '../db/index.ts';

export const formSubmissions = pgTable(
  'form_submissions',
  {
    id: primaryId('sub'),
    formKey: text('form_key').notNull(),
    data: jsonb('data').$type<Record<string, unknown>>().notNull(),
    /** Versión del texto de consentimiento aceptado (prueba RGPD), si el formulario lo pide. */
    consentVersion: text('consent_version'),
    /** Página desde la que se envió (sin query) y parámetros de campaña capturados. */
    sourcePath: text('source_path'),
    utm: jsonb('utm').$type<Record<string, string>>(),
    /** Pasos de `forms.process` ya hechos (`notify`, `auto_reply`, `webhook`, `handler:<n>`): un reintento no los repite. */
    processed: jsonb('processed').$type<string[]>().notNull().default([]),
    status: text('status', { enum: ['new', 'read', 'archived', 'spam'] })
      .notNull()
      .default('new'),
    ...timestamps,
  },
  (t) => [index('form_submissions_form_idx').on(t.formKey, t.createdAt)],
);

export type FormSubmission = typeof formSubmissions.$inferSelect;

@core/forms melden

Melde dich mit GitHub an, um ein Paket zu melden.