@bettercms-ai/types 1.6.0 → 1.7.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/dist/index.d.ts +18 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -641,25 +641,42 @@ interface DeliveryList<T> {
|
|
|
641
641
|
|
|
642
642
|
/**
|
|
643
643
|
* Form — a CMS form that renders on a page and accepts submissions.
|
|
644
|
+
*
|
|
645
|
+
* Mirrors the authoring row in `packages/db/src/schema/forms.ts`. That file is the source
|
|
646
|
+
* of truth; this is the public, Drizzle-free restatement of it. The two MUST stay in step —
|
|
647
|
+
* a consumer that types a form off this file and writes it back through the API silently
|
|
648
|
+
* drops whatever this file forgot to declare.
|
|
644
649
|
*/
|
|
645
650
|
interface Form {
|
|
646
651
|
id: string;
|
|
647
652
|
workspaceId: string;
|
|
653
|
+
/** Scopes the form to a project. Null for workspace-level forms. */
|
|
654
|
+
projectId: string | null;
|
|
648
655
|
name: string;
|
|
649
656
|
fields: FormField[];
|
|
657
|
+
/** Draft forms reject submissions at every ingress (403). New forms start as drafts. */
|
|
658
|
+
status: FormStatus;
|
|
650
659
|
submitLabel?: string;
|
|
651
660
|
successMessage?: string;
|
|
652
661
|
redirectUrl?: string;
|
|
653
662
|
createdAt: string;
|
|
654
663
|
updatedAt: string;
|
|
655
664
|
}
|
|
665
|
+
type FormStatus = "draft" | "published";
|
|
656
666
|
interface FormField {
|
|
657
667
|
key: string;
|
|
658
668
|
label: string;
|
|
659
|
-
type: "text" | "email" | "textarea" | "select" | "checkbox";
|
|
669
|
+
type: "text" | "email" | "textarea" | "select" | "checkbox" | "checkboxes" | "radio" | "number" | "phone" | "date" | "url" | "consent" | "hidden";
|
|
660
670
|
placeholder?: string;
|
|
671
|
+
helpText?: string;
|
|
661
672
|
required?: boolean;
|
|
662
673
|
options?: string[];
|
|
674
|
+
hidden?: boolean;
|
|
675
|
+
defaultValue?: string;
|
|
676
|
+
showIf?: {
|
|
677
|
+
field: string;
|
|
678
|
+
equals: string;
|
|
679
|
+
};
|
|
663
680
|
}
|
|
664
681
|
/**
|
|
665
682
|
* FormSubmission — a single form submission submitted by a visitor.
|