diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/actions.ts b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/actions.ts index 9fc8e99cbc..90939fe923 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/actions.ts +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/actions.ts @@ -23,7 +23,7 @@ import { loadNewSegmentInSurvey, updateSurvey, } from "@formbricks/lib/survey/service"; -import { TActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClassInput } from "@formbricks/types/action-classes"; import { AuthorizationError } from "@formbricks/types/errors"; import { TProduct } from "@formbricks/types/product"; import { TBaseFilters, TSegmentUpdateInput, ZSegmentFilters } from "@formbricks/types/segment"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddActionModal.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddActionModal.tsx index 8d92c6337b..5f58034978 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddActionModal.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddActionModal.tsx @@ -1,6 +1,6 @@ "use client"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { TSurvey } from "@formbricks/types/surveys/types"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; import { CreateNewActionTab } from "./CreateNewActionTab"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx index 650add6580..12f9d552e7 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx @@ -2,7 +2,7 @@ import { PlusIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyAddressQuestion } from "@formbricks/types/surveys/types"; import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedSettings.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedSettings.tsx index 49b885237b..04b5e4c944 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedSettings.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedSettings.tsx @@ -1,4 +1,4 @@ -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestion } from "@formbricks/types/surveys/types"; import { LogicEditor } from "./LogicEditor"; import { UpdateQuestionId } from "./UpdateQuestionId"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CTAQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CTAQuestionForm.tsx index 53dcdeea30..501f4a3106 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CTAQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CTAQuestionForm.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { LocalizedEditor } from "@formbricks/ee/multi-language/components/localized-editor"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyCTAQuestion } from "@formbricks/types/surveys/types"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CalQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CalQuestionForm.tsx index a7febe067a..0617a89557 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CalQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CalQuestionForm.tsx @@ -1,7 +1,7 @@ import { PlusIcon } from "lucide-react"; import { useEffect, useState } from "react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyCalQuestion } from "@formbricks/types/surveys/types"; import { Button } from "@formbricks/ui/Button"; import { Checkbox } from "@formbricks/ui/Checkbox"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ConsentQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ConsentQuestionForm.tsx index fc4c79a8b4..2b26ffb6db 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ConsentQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ConsentQuestionForm.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { LocalizedEditor } from "@formbricks/ee/multi-language/components/localized-editor"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyConsentQuestion } from "@formbricks/types/surveys/types"; import { Label } from "@formbricks/ui/Label"; import { QuestionFormInput } from "@formbricks/ui/QuestionFormInput"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CreateNewActionTab.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CreateNewActionTab.tsx index bcc9d9e734..33a222f416 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CreateNewActionTab.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CreateNewActionTab.tsx @@ -9,7 +9,7 @@ import { TActionClassInput, TActionClassInputCode, ZActionClassInput, -} from "@formbricks/types/actionClasses"; +} from "@formbricks/types/action-classes"; import { TSurvey } from "@formbricks/types/surveys/types"; import { Button } from "@formbricks/ui/Button"; import { FormControl, FormError, FormField, FormItem, FormLabel } from "@formbricks/ui/Form"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/DateQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/DateQuestionForm.tsx index 5dd1621073..e9b1a1b76f 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/DateQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/DateQuestionForm.tsx @@ -1,6 +1,6 @@ import { PlusIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyDateQuestion } from "@formbricks/types/surveys/types"; import { Button } from "@formbricks/ui/Button"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx index 394e81bb41..5fafa13f37 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx @@ -4,7 +4,7 @@ import * as Collapsible from "@radix-ui/react-collapsible"; import { useState } from "react"; import { cn } from "@formbricks/lib/cn"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey } from "@formbricks/types/surveys/types"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditWelcomeCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditWelcomeCard.tsx index 6c7665dc29..c5181ce902 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditWelcomeCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditWelcomeCard.tsx @@ -5,7 +5,7 @@ import { usePathname } from "next/navigation"; import { useState } from "react"; import { LocalizedEditor } from "@formbricks/ee/multi-language/components/localized-editor"; import { cn } from "@formbricks/lib/cn"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey } from "@formbricks/types/surveys/types"; import { FileInput } from "@formbricks/ui/FileInput"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx index 70ac0fa80e..33afc9289b 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx @@ -7,7 +7,7 @@ import { toast } from "react-hot-toast"; import { extractLanguageCodes } from "@formbricks/lib/i18n/utils"; import { createI18nString } from "@formbricks/lib/i18n/utils"; import { useGetBillingInfo } from "@formbricks/lib/organization/hooks/useGetBillingInfo"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TAllowedFileExtension, ZAllowedFileExtension } from "@formbricks/types/common"; import { TProduct } from "@formbricks/types/product"; import { TSurvey, TSurveyFileUploadQuestion } from "@formbricks/types/surveys/types"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/LogicEditor.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/LogicEditor.tsx index a7ca782c88..eff70cec30 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/LogicEditor.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/LogicEditor.tsx @@ -11,7 +11,7 @@ import { toast } from "react-hot-toast"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyLogic, diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx index 87b262f6d5..e308a742d8 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx @@ -2,7 +2,7 @@ import { PlusIcon, TrashIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TI18nString, TSurvey, TSurveyMatrixQuestion } from "@formbricks/types/surveys/types"; import { Button } from "@formbricks/ui/Button"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx index 1e4ae7a943..ac6c9f25c6 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx @@ -7,7 +7,7 @@ import { PlusIcon } from "lucide-react"; import { useEffect, useRef, useState } from "react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TI18nString, TShuffleOption, diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx index 618ccd12fe..619a0b6790 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx @@ -2,7 +2,7 @@ import { PlusIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyNPSQuestion } from "@formbricks/types/surveys/types"; import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/OpenQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/OpenQuestionForm.tsx index 68e31ec8a7..35b4177d0a 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/OpenQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/OpenQuestionForm.tsx @@ -2,7 +2,7 @@ import { HashIcon, LinkIcon, MailIcon, MessageSquareTextIcon, PhoneIcon, PlusIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyOpenTextQuestion, diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/PictureSelectionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/PictureSelectionForm.tsx index a39aac39f6..5568c60636 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/PictureSelectionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/PictureSelectionForm.tsx @@ -2,7 +2,7 @@ import { createId } from "@paralleldrive/cuid2"; import { PlusIcon } from "lucide-react"; import { cn } from "@formbricks/lib/cn"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyPictureSelectionQuestion } from "@formbricks/types/surveys/types"; import { Button } from "@formbricks/ui/Button"; import { FileInput } from "@formbricks/ui/FileInput"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionCard.tsx index af3b42b101..b52b18c007 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionCard.tsx @@ -8,7 +8,7 @@ import { ChevronDownIcon, ChevronRightIcon, GripIcon } from "lucide-react"; import { useState } from "react"; import { cn } from "@formbricks/lib/cn"; import { recallToHeadline } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TProduct } from "@formbricks/types/product"; import { TI18nString, diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx index 9b79ac9bbf..87e54f2ce1 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx @@ -1,5 +1,5 @@ import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TProduct } from "@formbricks/types/product"; import { TSurvey } from "@formbricks/types/surveys/types"; import { QuestionCard } from "./QuestionCard"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx index 9f2f2511dc..997a9a1f6d 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx @@ -15,7 +15,7 @@ import { MultiLanguageCard } from "@formbricks/ee/multi-language/components/mult import { extractLanguageCodes, getLocalizedValue, translateQuestion } from "@formbricks/lib/i18n/utils"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { checkForEmptyFallBackValue, extractRecallInfo } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TProduct } from "@formbricks/types/product"; import { TSurvey, TSurveyQuestion } from "@formbricks/types/surveys/types"; import { findQuestionsWithCyclicLogic } from "@formbricks/types/surveys/validation"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx index aec728497c..42c801c13e 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx @@ -1,6 +1,6 @@ import { HashIcon, PlusIcon, SmileIcon, StarIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyRatingQuestion } from "@formbricks/types/surveys/types"; import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx index ed653df07c..533650dabc 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx @@ -1,6 +1,6 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; import { useState } from "react"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { TSurvey } from "@formbricks/types/surveys/types"; import { Input } from "@formbricks/ui/Input"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx index 2f435265d4..dd3be09829 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx @@ -3,7 +3,7 @@ import { CSS } from "@dnd-kit/utilities"; import { GripVerticalIcon, PlusIcon, TrashIcon } from "lucide-react"; import { cn } from "@formbricks/lib/cn"; import { createI18nString } from "@formbricks/lib/i18n/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TI18nString, TSurvey, diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SettingsView.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SettingsView.tsx index 0a24dc42ad..702ca4b99e 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SettingsView.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SettingsView.tsx @@ -1,6 +1,6 @@ import { AdvancedTargetingCard } from "@formbricks/ee/advanced-targeting/components/advanced-targeting-card"; -import { TActionClass } from "@formbricks/types/actionClasses"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TMembershipRole } from "@formbricks/types/memberships"; import { TProduct } from "@formbricks/types/product"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx index f9cf6f9d31..6e1f2100ce 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx @@ -4,8 +4,8 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { extractLanguageCodes, getEnabledLanguages } from "@formbricks/lib/i18n/utils"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { useDocumentVisibility } from "@formbricks/lib/useDocumentVisibility"; -import { TActionClass } from "@formbricks/types/actionClasses"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TMembershipRole } from "@formbricks/types/memberships"; import { TProduct } from "@formbricks/types/product"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/TargetingCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/TargetingCard.tsx index 77d575324f..98ad735831 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/TargetingCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/TargetingCard.tsx @@ -9,7 +9,7 @@ import { toast } from "react-hot-toast"; import { cn } from "@formbricks/lib/cn"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { isAdvancedSegment } from "@formbricks/lib/segment/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TBaseFilter, TSegment, TSegmentCreateInput, TSegmentUpdateInput } from "@formbricks/types/segment"; import { TSurvey } from "@formbricks/types/surveys/types"; import { AlertDialog } from "@formbricks/ui/AlertDialog"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx index c244113cd8..faf0b8779d 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx @@ -11,7 +11,7 @@ import { } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { TMembershipRole } from "@formbricks/types/memberships"; import { TSurvey } from "@formbricks/types/surveys/types"; import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts index cc1d9f5200..98a83d02a1 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts @@ -4,7 +4,7 @@ import { getServerSession } from "next-auth"; import { canUserAccessAttributeClass } from "@formbricks/lib/attributeClass/auth"; import { authOptions } from "@formbricks/lib/authOptions"; import { getSegmentsByAttributeClassName } from "@formbricks/lib/segment/service"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { AuthorizationError } from "@formbricks/types/errors"; export const getSegmentsByAttributeClassAction = async ( diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx index ef96621ae3..91eac2ae0c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx @@ -4,7 +4,7 @@ import { TagIcon } from "lucide-react"; import { useEffect, useState } from "react"; import { convertDateTimeStringShort } from "@formbricks/lib/time"; import { capitalizeFirstLetter } from "@formbricks/lib/utils/strings"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { Label } from "@formbricks/ui/Label"; import { LoadingSpinner } from "@formbricks/ui/LoadingSpinner"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx index 7101d0b96c..86a28c74d3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx @@ -1,7 +1,7 @@ "use client"; import { useMemo, useState } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { Switch } from "@formbricks/ui/Switch"; import { AttributeDetailModal } from "./AttributeDetailModal"; import { AttributeClassDataRow } from "./AttributeRowData"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx index 566aa1848e..dc2037c8aa 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx @@ -1,5 +1,5 @@ import { TagIcon } from "lucide-react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; import { AttributeActivityTab } from "./AttributeActivityTab"; import { AttributeSettingsTab } from "./AttributeSettingsTab"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx index adf2bc04a8..cd511e5f26 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx @@ -3,7 +3,7 @@ import { getServerSession } from "next-auth"; import { authOptions } from "@formbricks/lib/authOptions"; import { getResponsesByPersonId } from "@formbricks/lib/response/service"; import { getSurveys } from "@formbricks/lib/survey/service"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey } from "@formbricks/types/surveys/types"; import { TTag } from "@formbricks/types/tags"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx index 16deb9e1f5..740afae14f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx @@ -3,7 +3,7 @@ import { ResponseFeed } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed"; import { ArrowDownUpIcon } from "lucide-react"; import { useEffect, useState } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TResponse } from "@formbricks/types/responses"; import { TSurvey } from "@formbricks/types/surveys/types"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx index d15a6efdca..1cb3518be4 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx @@ -4,7 +4,7 @@ import { useEffect, useState } from "react"; import { useMembershipRole } from "@formbricks/lib/membership/hooks/useMembershipRole"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TResponse } from "@formbricks/types/responses"; import { TSurvey } from "@formbricks/types/surveys/types"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicCreateSegmentModal.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicCreateSegmentModal.tsx index 5400a0c11e..b1ce3c34e7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicCreateSegmentModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicCreateSegmentModal.tsx @@ -6,7 +6,7 @@ import { useMemo, useState } from "react"; import toast from "react-hot-toast"; import { createSegmentAction } from "@formbricks/ee/advanced-targeting/lib/actions"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TBaseFilter, TSegment, ZSegmentFilters } from "@formbricks/types/segment"; import { BasicAddFilterModal } from "@formbricks/ui/BasicAddFilterModal"; import { BasicSegmentEditor } from "@formbricks/ui/BasicSegmentEditor"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx index 72433955cd..15805c6635 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx @@ -6,7 +6,7 @@ import { useMemo, useState } from "react"; import toast from "react-hot-toast"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { isAdvancedSegment } from "@formbricks/lib/segment/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TBaseFilter, TSegment, TSegmentWithSurveyNames, ZSegmentFilters } from "@formbricks/types/segment"; import { BasicAddFilterModal } from "@formbricks/ui/BasicAddFilterModal"; import { BasicSegmentEditor } from "@formbricks/ui/BasicSegmentEditor"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/EditSegmentModal.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/EditSegmentModal.tsx index 796ceabab4..086a68860a 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/EditSegmentModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/EditSegmentModal.tsx @@ -2,8 +2,8 @@ import { UsersIcon } from "lucide-react"; import { SegmentSettings } from "@formbricks/ee/advanced-targeting/components/segment-settings"; -import { TActionClass } from "@formbricks/types/actionClasses"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSegment, TSegmentWithSurveyNames } from "@formbricks/types/segment"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; import { BasicSegmentSettings } from "./BasicSegmentSettings"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx index 219be99fd9..5ec528044f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx @@ -1,5 +1,5 @@ -import { TActionClass } from "@formbricks/types/actionClasses"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSegment } from "@formbricks/types/segment"; import { SegmentTableDataRowContainer } from "./SegmentTableDataRowContainer"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx index da79323c14..3b6eff9828 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx @@ -3,8 +3,8 @@ import { format, formatDistanceToNow } from "date-fns"; import { UsersIcon } from "lucide-react"; import { useState } from "react"; -import { TActionClass } from "@formbricks/types/actionClasses"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSegment, TSegmentWithSurveyNames } from "@formbricks/types/segment"; import { EditSegmentModal } from "./EditSegmentModal"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx index f6bfcb3109..a3a98f42ac 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx @@ -1,7 +1,7 @@ import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { getSurveysBySegmentId } from "@formbricks/lib/survey/service"; -import { TActionClass } from "@formbricks/types/actionClasses"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSegment } from "@formbricks/types/segment"; import { SegmentTableDataRow } from "./SegmentTableDataRow"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/actions.ts b/apps/web/app/(app)/environments/[environmentId]/actions/actions.ts index 6c818b346f..23179e7de3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/actions/actions.ts @@ -11,7 +11,7 @@ import { deleteActionClass, updateActionClass } from "@formbricks/lib/actionClas import { authOptions } from "@formbricks/lib/authOptions"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; import { getSurveysByActionClassId } from "@formbricks/lib/survey/service"; -import { TActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClassInput } from "@formbricks/types/action-classes"; import { AuthorizationError } from "@formbricks/types/errors"; export const deleteActionClassAction = async (environmentId, actionClassId: string) => { diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx index c8d13071e7..53c7363848 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx @@ -4,7 +4,7 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; import { useEffect, useState } from "react"; import { convertDateTimeStringShort } from "@formbricks/lib/time"; import { capitalizeFirstLetter } from "@formbricks/lib/utils/strings"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { TProductConfigChannel } from "@formbricks/types/product"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx index 1599dd2b9d..d0e8c0f179 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { useMembershipRole } from "@formbricks/lib/membership/hooks/useMembershipRole"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { TProductConfigChannel } from "@formbricks/types/product"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { ActionDetailModal } from "./ActionDetailModal"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx index 3fad9c4df6..0091de3a50 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx @@ -1,5 +1,5 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { TMembershipRole } from "@formbricks/types/memberships"; import { TProductConfigChannel } from "@formbricks/types/product"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx index 27e6c9a38f..b1f6989ce2 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx @@ -1,6 +1,6 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; import { timeSinceConditionally } from "@formbricks/lib/time"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; export const ActionClassDataRow = ({ actionClass }: { actionClass: TActionClass }) => { return ( diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx index d00db100fa..3399f754f1 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx @@ -13,7 +13,7 @@ import { FormProvider, useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; import { z } from "zod"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; -import { TActionClass, TActionClassInput, ZActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClass, TActionClassInput, ZActionClassInput } from "@formbricks/types/action-classes"; import { TMembershipRole } from "@formbricks/types/memberships"; import { Button } from "@formbricks/ui/Button"; import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/AddActionModal.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/AddActionModal.tsx index 79b27c84d9..79ad06fa07 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/AddActionModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/AddActionModal.tsx @@ -5,7 +5,7 @@ import { MousePointerClickIcon, PlusIcon } from "lucide-react"; import { useState } from "react"; import { useMembershipRole } from "@formbricks/lib/membership/hooks/useMembershipRole"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { Button } from "@formbricks/ui/Button"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { Modal } from "@formbricks/ui/Modal"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx index 06a2dceed2..9ceacdae94 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx @@ -11,7 +11,7 @@ import { Controller, useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TIntegrationItem } from "@formbricks/types/integration"; import { TIntegrationAirtable, diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx index c3a234e3c2..f88da82282 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx @@ -4,7 +4,7 @@ import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/inte import { authorize } from "@/app/(app)/environments/[environmentId]/integrations/airtable/lib/airtable"; import airtableLogo from "@/images/airtableLogo.svg"; import { useState } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationItem } from "@formbricks/types/integration"; import { TIntegrationAirtable } from "@formbricks/types/integration/airtable"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx index f8feafa74b..a1c6daaa09 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx @@ -9,7 +9,7 @@ import { Trash2Icon } from "lucide-react"; import { useState } from "react"; import { toast } from "react-hot-toast"; import { timeSince } from "@formbricks/lib/time"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationItem } from "@formbricks/types/integration"; import { TIntegrationAirtable } from "@formbricks/types/integration/airtable"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts index bec98e9510..ca90fb831c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts @@ -5,7 +5,7 @@ import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { getSpreadsheetNameById } from "@formbricks/lib/googleSheet/service"; import { AuthorizationError } from "@formbricks/types/errors"; -import { TIntegrationGoogleSheets } from "@formbricks/types/integration/googleSheet"; +import { TIntegrationGoogleSheets } from "@formbricks/types/integration/google-sheet"; export async function getSpreadsheetNameByIdAction( googleSheetIntegration: TIntegrationGoogleSheets, diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx index a6580243fc..bdcaa08638 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx @@ -12,12 +12,12 @@ import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TIntegrationGoogleSheets, TIntegrationGoogleSheetsConfigData, TIntegrationGoogleSheetsInput, -} from "@formbricks/types/integration/googleSheet"; +} from "@formbricks/types/integration/google-sheet"; import { TSurvey } from "@formbricks/types/surveys/types"; import { AdditionalIntegrationSettings } from "@formbricks/ui/AdditionalIntegrationSettings"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx index 428af9ecad..805be49c2b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx @@ -4,12 +4,12 @@ import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/inte import { authorize } from "@/app/(app)/environments/[environmentId]/integrations/google-sheets/lib/google"; import googleSheetLogo from "@/images/googleSheetsLogo.png"; import { useState } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationGoogleSheets, TIntegrationGoogleSheetsConfigData, -} from "@formbricks/types/integration/googleSheet"; +} from "@formbricks/types/integration/google-sheet"; import { TSurvey } from "@formbricks/types/surveys/types"; import { ConnectIntegration } from "@formbricks/ui/ConnectIntegration"; import { AddIntegrationModal } from "./AddIntegrationModal"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx index c410f76121..a53f668040 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx @@ -9,7 +9,7 @@ import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationGoogleSheets, TIntegrationGoogleSheetsConfigData, -} from "@formbricks/types/integration/googleSheet"; +} from "@formbricks/types/integration/google-sheet"; import { Button } from "@formbricks/ui/Button"; import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; import { EmptySpaceFiller } from "@formbricks/ui/EmptySpaceFiller"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx index b9811e9075..646a32e3ff 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx @@ -10,7 +10,7 @@ import { getEnvironment } from "@formbricks/lib/environment/service"; import { getIntegrations } from "@formbricks/lib/integration/service"; import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; import { getSurveys } from "@formbricks/lib/survey/service"; -import { TIntegrationGoogleSheets } from "@formbricks/types/integration/googleSheet"; +import { TIntegrationGoogleSheets } from "@formbricks/types/integration/google-sheet"; import { GoBackButton } from "@formbricks/ui/GoBackButton"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/AddIntegrationModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/AddIntegrationModal.tsx index abb2df7b69..dee8a49b99 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/AddIntegrationModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/AddIntegrationModal.tsx @@ -14,7 +14,7 @@ import toast from "react-hot-toast"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TIntegrationInput } from "@formbricks/types/integration"; import { TIntegrationNotion, diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx index 0dc292095f..45df2a1f00 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx @@ -4,7 +4,7 @@ import { AddIntegrationModal } from "@/app/(app)/environments/[environmentId]/in import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/integrations/notion/components/ManageIntegration"; import notionLogo from "@/images/notion.png"; import { useState } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationNotion, diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx index 8e963fc112..9f041e708e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx @@ -6,7 +6,7 @@ import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TIntegrationItem } from "@formbricks/types/integration"; import { TIntegrationSlack, diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx index f29c505d66..8dce451421 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx @@ -6,7 +6,7 @@ import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/inte import { authorize } from "@/app/(app)/environments/[environmentId]/integrations/slack/lib/slack"; import slackLogo from "@/images/slacklogo.png"; import { useState } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationItem } from "@formbricks/types/integration"; import { TIntegrationSlack, TIntegrationSlackConfigData } from "@formbricks/types/integration/slack"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts index df4d779656..05bb874963 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts @@ -5,7 +5,7 @@ import { canUserAccessApiKey } from "@formbricks/lib/apiKey/auth"; import { createApiKey, deleteApiKey } from "@formbricks/lib/apiKey/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; -import { TApiKeyCreateInput } from "@formbricks/types/apiKeys"; +import { TApiKeyCreateInput } from "@formbricks/types/api-keys"; import { AuthorizationError } from "@formbricks/types/errors"; export const deleteApiKeyAction = async (id: string) => { diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx index 39ca95a63f..6213ac7acf 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx @@ -5,7 +5,7 @@ import { useState } from "react"; import toast from "react-hot-toast"; import { timeSince } from "@formbricks/lib/time"; import { capitalizeFirstLetter } from "@formbricks/lib/utils/strings"; -import { TApiKey } from "@formbricks/types/apiKeys"; +import { TApiKey } from "@formbricks/types/api-keys"; import { Button } from "@formbricks/ui/Button"; import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; import { createApiKeyAction, deleteApiKeyAction } from "../actions"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx index 405a65de8b..633e51f4ed 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx @@ -1,7 +1,7 @@ import Link from "next/link"; import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { timeSince } from "@formbricks/lib/time"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryAddress } from "@formbricks/types/surveys/types"; import { AddressResponse } from "@formbricks/ui/AddressResponse"; import { PersonAvatar } from "@formbricks/ui/Avatars"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx index cf2a3e1856..96cd16426d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx @@ -1,5 +1,5 @@ import { InboxIcon } from "lucide-react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryCta } from "@formbricks/types/surveys/types"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; import { convertFloatToNDecimal } from "../lib/utils"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx index f4bd4e0e9f..ded3e63428 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx @@ -1,5 +1,5 @@ import { convertFloatToNDecimal } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/lib/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryCal } from "@formbricks/types/surveys/types"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx index 3538414e62..9188a198a3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx @@ -1,4 +1,4 @@ -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryConsent } from "@formbricks/types/surveys/types"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; import { convertFloatToNDecimal } from "../lib/utils"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx index 52fe05603a..b5e4259273 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { timeSince } from "@formbricks/lib/time"; import { formatDateWithOrdinal } from "@formbricks/lib/utils/datetime"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryDate } from "@formbricks/types/surveys/types"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx index 84ceb02aab..718444d84d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { getOriginalFileNameFromUrl } from "@formbricks/lib/storage/utils"; import { timeSince } from "@formbricks/lib/time"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryFileUpload } from "@formbricks/types/surveys/types"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx index c2be1d051f..bfa7003a1b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx @@ -1,4 +1,4 @@ -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryMatrix } from "@formbricks/types/surveys/types"; import { TooltipRenderer } from "@formbricks/ui/Tooltip"; import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx index b149088ce1..869026d5b8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx @@ -1,7 +1,7 @@ import Link from "next/link"; import { useState } from "react"; import { getPersonIdentifier } from "@formbricks/lib/person/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryMultipleChoice, TSurveyType } from "@formbricks/types/surveys/types"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx index 935b88c1be..bffeb3de37 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx @@ -1,4 +1,4 @@ -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryNps } from "@formbricks/types/surveys/types"; import { HalfCircle, ProgressBar } from "@formbricks/ui/ProgressBar"; import { convertFloatToNDecimal } from "../lib/utils"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx index 665a8cd960..9d87c46195 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx @@ -2,7 +2,7 @@ import Link from "next/link"; import { useState } from "react"; import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { timeSince } from "@formbricks/lib/time"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryOpenText } from "@formbricks/types/surveys/types"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx index 0aedc0797b..fd2987edc8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx @@ -1,5 +1,5 @@ import Image from "next/image"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryPictureSelection } from "@formbricks/types/surveys/types"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; import { convertFloatToNDecimal } from "../lib/utils"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx index f4a208b596..a586146abf 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx @@ -1,7 +1,7 @@ import { questionTypes } from "@/app/lib/questions"; import { InboxIcon } from "lucide-react"; import { recallToHeadline } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummary } from "@formbricks/types/surveys/types"; interface HeadProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RatingSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RatingSummary.tsx index 3471b3b537..9ac7ccc6aa 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RatingSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RatingSummary.tsx @@ -1,7 +1,7 @@ import { convertFloatToNDecimal } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/lib/utils"; import { CircleSlash2, SmileIcon, StarIcon } from "lucide-react"; import { useMemo } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyQuestionSummaryRating } from "@formbricks/types/surveys/types"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; import { RatingResponse } from "@formbricks/ui/RatingResponse"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryList.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryList.tsx index 5157d55e94..4689bac4e8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryList.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryList.tsx @@ -11,7 +11,7 @@ import { NPSSummary } from "@/app/(app)/environments/[environmentId]/surveys/[su import { OpenTextSummary } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary"; import { PictureChoiceSummary } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary"; import { RatingSummary } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RatingSummary"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TSurveySummary } from "@formbricks/types/surveys/types"; import { TSurveyQuestionTypeEnum } from "@formbricks/types/surveys/types"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx index 780df28597..d23ceb1f21 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx @@ -16,7 +16,7 @@ import { import { useParams, useSearchParams } from "next/navigation"; import { useEffect, useMemo, useState } from "react"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey, TSurveySummary } from "@formbricks/types/surveys/types"; import { TUser } from "@formbricks/types/user"; diff --git a/apps/web/app/[shortUrlId]/page.tsx b/apps/web/app/[shortUrlId]/page.tsx index 316b508f7c..13906f66b5 100644 --- a/apps/web/app/[shortUrlId]/page.tsx +++ b/apps/web/app/[shortUrlId]/page.tsx @@ -2,7 +2,7 @@ import { getMetadataForLinkSurvey } from "@/app/s/[surveyId]/metadata"; import type { Metadata } from "next"; import { notFound, redirect } from "next/navigation"; import { getShortUrl } from "@formbricks/lib/shortUrl/service"; -import { TShortUrl, ZShortUrlId } from "@formbricks/types/shortUrl"; +import { TShortUrl, ZShortUrlId } from "@formbricks/types/short-url"; export const generateMetadata = async ({ params }): Promise => { if (!params.shortUrlId) { diff --git a/apps/web/app/api/cron/weekly-summary/lib/notificationResponse.ts b/apps/web/app/api/cron/weekly-summary/lib/notificationResponse.ts index 72db33df97..80c6f67fd1 100644 --- a/apps/web/app/api/cron/weekly-summary/lib/notificationResponse.ts +++ b/apps/web/app/api/cron/weekly-summary/lib/notificationResponse.ts @@ -6,7 +6,7 @@ import { TWeeklySummaryNotificationDataSurvey, TWeeklySummaryNotificationResponse, TWeeklySummarySurveyResponseData, -} from "@formbricks/types/weeklySummary"; +} from "@formbricks/types/weekly-summary"; export const getNotificationResponse = ( environment: TWeeklySummaryEnvironmentData, diff --git a/apps/web/app/api/cron/weekly-summary/lib/product.ts b/apps/web/app/api/cron/weekly-summary/lib/product.ts index 1b1adfb8ad..0e67aeecf0 100644 --- a/apps/web/app/api/cron/weekly-summary/lib/product.ts +++ b/apps/web/app/api/cron/weekly-summary/lib/product.ts @@ -1,5 +1,5 @@ import { prisma } from "@formbricks/database"; -import { TWeeklySummaryProductData } from "@formbricks/types/weeklySummary"; +import { TWeeklySummaryProductData } from "@formbricks/types/weekly-summary"; export const getProductsByOrganizationId = async ( organizationId: string diff --git a/apps/web/app/api/pipeline/lib/handleIntegrations.ts b/apps/web/app/api/pipeline/lib/handleIntegrations.ts index fef448e70a..a3cc193250 100644 --- a/apps/web/app/api/pipeline/lib/handleIntegrations.ts +++ b/apps/web/app/api/pipeline/lib/handleIntegrations.ts @@ -6,7 +6,7 @@ import { processResponseData } from "@formbricks/lib/responses"; import { writeDataToSlack } from "@formbricks/lib/slack/service"; import { TIntegration } from "@formbricks/types/integration"; import { TIntegrationAirtable } from "@formbricks/types/integration/airtable"; -import { TIntegrationGoogleSheets } from "@formbricks/types/integration/googleSheet"; +import { TIntegrationGoogleSheets } from "@formbricks/types/integration/google-sheet"; import { TIntegrationNotion, TIntegrationNotionConfigData } from "@formbricks/types/integration/notion"; import { TIntegrationSlack } from "@formbricks/types/integration/slack"; import { TPipelineInput } from "@formbricks/types/pipelines"; diff --git a/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts b/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts index 678b7ca992..f7456e6475 100644 --- a/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts @@ -21,7 +21,7 @@ import { COLOR_DEFAULTS } from "@formbricks/lib/styling/constants"; import { getSyncSurveys, transformToLegacySurvey } from "@formbricks/lib/survey/service"; import { isVersionGreaterThanOrEqualTo } from "@formbricks/lib/utils/version"; import { TJsAppLegacyStateSync, TJsAppStateSync, ZJsPeopleUserIdInput } from "@formbricks/types/js"; -import { TLegacySurvey } from "@formbricks/types/legacySurveys"; +import { TLegacySurvey } from "@formbricks/types/legacy-surveys"; import { TProductLegacy } from "@formbricks/types/product"; import { TSurvey } from "@formbricks/types/surveys/types"; diff --git a/apps/web/app/api/v1/client/[environmentId]/app/sync/lib/utils.ts b/apps/web/app/api/v1/client/[environmentId]/app/sync/lib/utils.ts index 409201a622..2790e3092f 100644 --- a/apps/web/app/api/v1/client/[environmentId]/app/sync/lib/utils.ts +++ b/apps/web/app/api/v1/client/[environmentId]/app/sync/lib/utils.ts @@ -1,6 +1,6 @@ import { parseRecallInfo } from "@formbricks/lib/utils/recall"; import { TAttributes } from "@formbricks/types/attributes"; -import { TLegacySurvey } from "@formbricks/types/legacySurveys"; +import { TLegacySurvey } from "@formbricks/types/legacy-surveys"; import { TSurvey } from "@formbricks/types/surveys/types"; export const replaceAttributeRecall = (survey: TSurvey, attributes: TAttributes): TSurvey => { diff --git a/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts b/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts index a5d853205e..7942a997f1 100644 --- a/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts @@ -14,7 +14,7 @@ import { COLOR_DEFAULTS } from "@formbricks/lib/styling/constants"; import { getSurveys, transformToLegacySurvey } from "@formbricks/lib/survey/service"; import { isVersionGreaterThanOrEqualTo } from "@formbricks/lib/utils/version"; import { TJsWebsiteLegacyStateSync, TJsWebsiteStateSync, ZJsWebsiteSyncInput } from "@formbricks/types/js"; -import { TLegacySurvey } from "@formbricks/types/legacySurveys"; +import { TLegacySurvey } from "@formbricks/types/legacy-surveys"; import { TProductLegacy } from "@formbricks/types/product"; import { TSurvey } from "@formbricks/types/surveys/types"; diff --git a/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts b/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts index 518985b3ef..1ead8bcc46 100644 --- a/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts +++ b/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts @@ -2,7 +2,7 @@ import { authenticateRequest, handleErrorResponse } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { deleteActionClass, getActionClass, updateActionClass } from "@formbricks/lib/actionClass/service"; -import { TActionClass, ZActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClass, ZActionClassInput } from "@formbricks/types/action-classes"; import { TAuthenticationApiKey } from "@formbricks/types/auth"; const fetchAndAuthorizeActionClass = async ( diff --git a/apps/web/app/api/v1/management/action-classes/route.ts b/apps/web/app/api/v1/management/action-classes/route.ts index 3c69a95d8b..6a032ee6e3 100644 --- a/apps/web/app/api/v1/management/action-classes/route.ts +++ b/apps/web/app/api/v1/management/action-classes/route.ts @@ -2,7 +2,7 @@ import { authenticateRequest } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { createActionClass, getActionClasses } from "@formbricks/lib/actionClass/service"; -import { TActionClass, ZActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClass, ZActionClassInput } from "@formbricks/types/action-classes"; import { DatabaseError } from "@formbricks/types/errors"; export const GET = async (request: Request) => { diff --git a/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts b/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts index 0ffa82c481..6a555493d7 100644 --- a/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts +++ b/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts @@ -6,7 +6,7 @@ import { getAttributeClass, updateAttributeClass, } from "@formbricks/lib/attributeClass/service"; -import { TAttributeClass, ZAttributeClassUpdateInput } from "@formbricks/types/attributeClasses"; +import { TAttributeClass, ZAttributeClassUpdateInput } from "@formbricks/types/attribute-classes"; import { TAuthenticationApiKey } from "@formbricks/types/auth"; const fetchAndAuthorizeAttributeClass = async ( diff --git a/apps/web/app/api/v1/management/attribute-classes/route.ts b/apps/web/app/api/v1/management/attribute-classes/route.ts index 65c615d002..133283a8e4 100644 --- a/apps/web/app/api/v1/management/attribute-classes/route.ts +++ b/apps/web/app/api/v1/management/attribute-classes/route.ts @@ -2,7 +2,7 @@ import { authenticateRequest } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { createAttributeClass, getAttributeClasses } from "@formbricks/lib/attributeClass/service"; -import { TAttributeClass, ZAttributeClassInput } from "@formbricks/types/attributeClasses"; +import { TAttributeClass, ZAttributeClassInput } from "@formbricks/types/attribute-classes"; import { DatabaseError } from "@formbricks/types/errors"; export const GET = async (request: Request) => { diff --git a/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx b/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx index 7db896138f..9f33f3bba5 100644 --- a/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx +++ b/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx @@ -9,7 +9,7 @@ import { useEffect, useMemo, useState } from "react"; import { FormbricksAPI } from "@formbricks/api"; import { ResponseQueue } from "@formbricks/lib/responseQueue"; import { SurveyState } from "@formbricks/lib/surveyState"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TProduct } from "@formbricks/types/product"; import { TResponse, TResponseHiddenFieldValue, TResponseUpdate } from "@formbricks/types/responses"; import { TUploadFileConfig } from "@formbricks/types/storage"; diff --git a/apps/web/app/s/[surveyId]/components/PinScreen.tsx b/apps/web/app/s/[surveyId]/components/PinScreen.tsx index 5e2504311f..e5a57e43ee 100644 --- a/apps/web/app/s/[surveyId]/components/PinScreen.tsx +++ b/apps/web/app/s/[surveyId]/components/PinScreen.tsx @@ -5,7 +5,7 @@ import { LinkSurvey } from "@/app/s/[surveyId]/components/LinkSurvey"; import { TSurveyPinValidationResponseError } from "@/app/s/[surveyId]/types"; import { useCallback, useEffect, useState } from "react"; import { cn } from "@formbricks/lib/cn"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TProduct } from "@formbricks/types/product"; import { TResponse } from "@formbricks/types/responses"; import { TSurvey } from "@formbricks/types/surveys/types"; diff --git a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx index 2b1bc1a2da..c1b311fb4d 100644 --- a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx +++ b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx @@ -8,7 +8,7 @@ import { Toaster, toast } from "react-hot-toast"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { isValidEmail } from "@formbricks/lib/utils/email"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TProductStyling } from "@formbricks/types/product"; import { TSurvey } from "@formbricks/types/surveys/types"; import { Button } from "@formbricks/ui/Button"; diff --git a/packages/api/src/api/client/action.ts b/packages/api/src/api/client/action.ts index 1392c98063..b0fa3ed1cf 100644 --- a/packages/api/src/api/client/action.ts +++ b/packages/api/src/api/client/action.ts @@ -1,5 +1,5 @@ import { type TActionInput } from "@formbricks/types/actions"; -import { type Result } from "@formbricks/types/errorHandlers"; +import { type Result } from "@formbricks/types/error-handlers"; import { type NetworkError } from "@formbricks/types/errors"; import { makeRequest } from "../../utils/make-request"; diff --git a/packages/api/src/api/client/attribute.ts b/packages/api/src/api/client/attribute.ts index 6137392bc7..f99d40a72f 100644 --- a/packages/api/src/api/client/attribute.ts +++ b/packages/api/src/api/client/attribute.ts @@ -1,5 +1,5 @@ import { type TAttributeUpdateInput } from "@formbricks/types/attributes"; -import { type Result } from "@formbricks/types/errorHandlers"; +import { type Result } from "@formbricks/types/error-handlers"; import { type NetworkError } from "@formbricks/types/errors"; import { makeRequest } from "../../utils/make-request"; diff --git a/packages/api/src/api/client/display.ts b/packages/api/src/api/client/display.ts index 8a300abb14..1b06a95524 100644 --- a/packages/api/src/api/client/display.ts +++ b/packages/api/src/api/client/display.ts @@ -1,5 +1,5 @@ import { type TDisplayCreateInput, type TDisplayUpdateInput } from "@formbricks/types/displays"; -import { type Result } from "@formbricks/types/errorHandlers"; +import { type Result } from "@formbricks/types/error-handlers"; import { type NetworkError } from "@formbricks/types/errors"; import { makeRequest } from "../../utils/make-request"; diff --git a/packages/api/src/api/client/people.ts b/packages/api/src/api/client/people.ts index 0b256254d2..96c316fb20 100644 --- a/packages/api/src/api/client/people.ts +++ b/packages/api/src/api/client/people.ts @@ -1,4 +1,4 @@ -import { type Result } from "@formbricks/types/errorHandlers"; +import { type Result } from "@formbricks/types/error-handlers"; import { type NetworkError } from "@formbricks/types/errors"; import { makeRequest } from "../../utils/make-request"; diff --git a/packages/api/src/api/client/response.ts b/packages/api/src/api/client/response.ts index f90449e5f9..aa59bfef99 100644 --- a/packages/api/src/api/client/response.ts +++ b/packages/api/src/api/client/response.ts @@ -1,4 +1,4 @@ -import { type Result } from "@formbricks/types/errorHandlers"; +import { type Result } from "@formbricks/types/error-handlers"; import { type NetworkError } from "@formbricks/types/errors"; import { type TResponseInput, type TResponseUpdateInput } from "@formbricks/types/responses"; import { makeRequest } from "../../utils/make-request"; diff --git a/packages/api/src/utils/make-request.ts b/packages/api/src/utils/make-request.ts index d69f87ac95..6624b37bcb 100644 --- a/packages/api/src/utils/make-request.ts +++ b/packages/api/src/utils/make-request.ts @@ -1,4 +1,4 @@ -import { type Result, err, ok, wrapThrowsAsync } from "@formbricks/types/errorHandlers"; +import { type Result, err, ok, wrapThrowsAsync } from "@formbricks/types/error-handlers"; import { type NetworkError } from "@formbricks/types/errors"; import type { ApiErrorResponse, ApiResponse, ApiSuccessResponse } from "../types"; diff --git a/packages/config-eslint/library.js b/packages/config-eslint/library.js index 6adae30b84..544f9ec5da 100644 --- a/packages/config-eslint/library.js +++ b/packages/config-eslint/library.js @@ -30,5 +30,5 @@ module.exports = { }, }, }, - ignorePatterns: ["node_modules/", "dist/", "*.config.js"], + ignorePatterns: ["node_modules/", "dist/", "*.config.js", "*.d.ts"], }; diff --git a/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/lib/i18n.ts b/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/lib/i18n.ts index 939429c290..59fa57de9e 100644 --- a/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/lib/i18n.ts +++ b/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/lib/i18n.ts @@ -3,7 +3,7 @@ import { TLegacySurveyQuestion, TLegacySurveyThankYouCard, TLegacySurveyWelcomeCard, -} from "@formbricks/types/legacySurveys"; +} from "@formbricks/types/legacy-surveys"; import { TLanguage } from "@formbricks/types/product"; import { TI18nString, diff --git a/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts b/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts index 4e4b573b1d..1e9165eaaf 100644 --- a/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts +++ b/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts @@ -1,5 +1,5 @@ import { PrismaClient } from "@prisma/client"; -import { TActionClassNoCodeConfig } from "@formbricks/types/actionClasses"; +import { TActionClassNoCodeConfig } from "@formbricks/types/action-classes"; const prisma = new PrismaClient(); diff --git a/packages/database/jsonTypes.ts b/packages/database/jsonTypes.ts index 8e87389cff..121cab4145 100644 --- a/packages/database/jsonTypes.ts +++ b/packages/database/jsonTypes.ts @@ -1,4 +1,4 @@ -import { TActionClassNoCodeConfig } from "@formbricks/types/actionClasses"; +import { TActionClassNoCodeConfig } from "@formbricks/types/action-classes"; import { TIntegrationConfig } from "@formbricks/types/integration"; import { TOrganizationBilling } from "@formbricks/types/organizations"; import { TProductConfig, TProductStyling } from "@formbricks/types/product"; diff --git a/packages/database/zod-utils.ts b/packages/database/zod-utils.ts index e2be879bb3..d228cf817d 100644 --- a/packages/database/zod-utils.ts +++ b/packages/database/zod-utils.ts @@ -1,7 +1,7 @@ import { z } from "zod"; export const ZActionProperties = z.record(z.string()); -export { ZActionClassNoCodeConfig } from "@formbricks/types/actionClasses"; +export { ZActionClassNoCodeConfig } from "@formbricks/types/action-classes"; export { ZIntegrationConfig } from "@formbricks/types/integration"; export { diff --git a/packages/ee/advanced-targeting/components/add-filter-modal.tsx b/packages/ee/advanced-targeting/components/add-filter-modal.tsx index e2556846c9..0ca84dfa90 100644 --- a/packages/ee/advanced-targeting/components/add-filter-modal.tsx +++ b/packages/ee/advanced-targeting/components/add-filter-modal.tsx @@ -4,8 +4,8 @@ import { createId } from "@paralleldrive/cuid2"; import { FingerprintIcon, MonitorSmartphoneIcon, MousePointerClick, TagIcon, Users2Icon } from "lucide-react"; import React, { useMemo, useState } from "react"; import { cn } from "@formbricks/lib/cn"; -import type { TActionClass } from "@formbricks/types/actionClasses"; -import type { TAttributeClass } from "@formbricks/types/attributeClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; +import type { TAttributeClass } from "@formbricks/types/attribute-classes"; import type { TBaseFilter, TSegment, diff --git a/packages/ee/advanced-targeting/components/advanced-targeting-card.tsx b/packages/ee/advanced-targeting/components/advanced-targeting-card.tsx index dd507efdb6..7a2c625b48 100644 --- a/packages/ee/advanced-targeting/components/advanced-targeting-card.tsx +++ b/packages/ee/advanced-targeting/components/advanced-targeting-card.tsx @@ -8,8 +8,8 @@ import React, { useEffect, useMemo, useState } from "react"; import toast from "react-hot-toast"; import { cn } from "@formbricks/lib/cn"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; -import type { TActionClass } from "@formbricks/types/actionClasses"; -import type { TAttributeClass } from "@formbricks/types/attributeClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; +import type { TAttributeClass } from "@formbricks/types/attribute-classes"; import type { TBaseFilter, TSegment, diff --git a/packages/ee/advanced-targeting/components/create-segment-modal.tsx b/packages/ee/advanced-targeting/components/create-segment-modal.tsx index 0e2abe26ae..7052050e9a 100644 --- a/packages/ee/advanced-targeting/components/create-segment-modal.tsx +++ b/packages/ee/advanced-targeting/components/create-segment-modal.tsx @@ -5,8 +5,8 @@ import { useRouter } from "next/navigation"; import { useMemo, useState } from "react"; import toast from "react-hot-toast"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; -import type { TActionClass } from "@formbricks/types/actionClasses"; -import type { TAttributeClass } from "@formbricks/types/attributeClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; +import type { TAttributeClass } from "@formbricks/types/attribute-classes"; import type { TBaseFilter, TSegment } from "@formbricks/types/segment"; import { ZSegmentFilters } from "@formbricks/types/segment"; import { Button } from "@formbricks/ui/Button"; diff --git a/packages/ee/advanced-targeting/components/segment-editor.tsx b/packages/ee/advanced-targeting/components/segment-editor.tsx index 4e47b75880..644630cd00 100644 --- a/packages/ee/advanced-targeting/components/segment-editor.tsx +++ b/packages/ee/advanced-targeting/components/segment-editor.tsx @@ -11,8 +11,8 @@ import { moveResource, toggleGroupConnector, } from "@formbricks/lib/segment/utils"; -import type { TActionClass } from "@formbricks/types/actionClasses"; -import type { TAttributeClass } from "@formbricks/types/attributeClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; +import type { TAttributeClass } from "@formbricks/types/attribute-classes"; import type { TBaseFilter, TBaseFilters, TSegment, TSegmentConnector } from "@formbricks/types/segment"; import { Button } from "@formbricks/ui/Button"; import { diff --git a/packages/ee/advanced-targeting/components/segment-filter.tsx b/packages/ee/advanced-targeting/components/segment-filter.tsx index 66035f496a..df7accbdab 100644 --- a/packages/ee/advanced-targeting/components/segment-filter.tsx +++ b/packages/ee/advanced-targeting/components/segment-filter.tsx @@ -26,8 +26,8 @@ import { updateSegmentIdInFilter, } from "@formbricks/lib/segment/utils"; import { isCapitalized } from "@formbricks/lib/utils/strings"; -import type { TActionClass } from "@formbricks/types/actionClasses"; -import type { TAttributeClass } from "@formbricks/types/attributeClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; +import type { TAttributeClass } from "@formbricks/types/attribute-classes"; import type { TActionMetric, TArithmeticOperator, diff --git a/packages/ee/advanced-targeting/components/segment-settings.tsx b/packages/ee/advanced-targeting/components/segment-settings.tsx index 59e248a55b..9949f463aa 100644 --- a/packages/ee/advanced-targeting/components/segment-settings.tsx +++ b/packages/ee/advanced-targeting/components/segment-settings.tsx @@ -6,8 +6,8 @@ import { useMemo, useState } from "react"; import toast from "react-hot-toast"; import { cn } from "@formbricks/lib/cn"; import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; -import type { TActionClass } from "@formbricks/types/actionClasses"; -import type { TAttributeClass } from "@formbricks/types/attributeClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; +import type { TAttributeClass } from "@formbricks/types/attribute-classes"; import type { TBaseFilter, TSegment, TSegmentWithSurveyNames } from "@formbricks/types/segment"; import { ZSegmentFilters } from "@formbricks/types/segment"; import { Button } from "@formbricks/ui/Button"; diff --git a/packages/email/components/weekly-summary/create-reminder-notification-body.tsx b/packages/email/components/weekly-summary/create-reminder-notification-body.tsx index 9a1c7434d0..588725715e 100644 --- a/packages/email/components/weekly-summary/create-reminder-notification-body.tsx +++ b/packages/email/components/weekly-summary/create-reminder-notification-body.tsx @@ -1,7 +1,7 @@ import { Container, Text } from "@react-email/components"; import React from "react"; import { WEBAPP_URL } from "@formbricks/lib/constants"; -import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weeklySummary"; +import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weekly-summary"; import { EmailButton } from "../general/email-button"; import { NotificationFooter } from "./notification-footer"; diff --git a/packages/email/components/weekly-summary/live-survey-notification.tsx b/packages/email/components/weekly-summary/live-survey-notification.tsx index 3e7ad8e71b..4fb610fc73 100644 --- a/packages/email/components/weekly-summary/live-survey-notification.tsx +++ b/packages/email/components/weekly-summary/live-survey-notification.tsx @@ -5,7 +5,7 @@ import type { TSurveyStatus } from "@formbricks/types/surveys/types"; import type { TWeeklySummaryNotificationDataSurvey, TWeeklySummarySurveyResponseData, -} from "@formbricks/types/weeklySummary"; +} from "@formbricks/types/weekly-summary"; import { EmailButton } from "../general/email-button"; import { renderEmailResponseValue } from "../survey/response-finished-email"; diff --git a/packages/email/components/weekly-summary/no-live-survey-notification-email.tsx b/packages/email/components/weekly-summary/no-live-survey-notification-email.tsx index 262461211f..26b7057ba1 100644 --- a/packages/email/components/weekly-summary/no-live-survey-notification-email.tsx +++ b/packages/email/components/weekly-summary/no-live-survey-notification-email.tsx @@ -1,5 +1,5 @@ import React from "react"; -import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weeklySummary"; +import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weekly-summary"; import { CreateReminderNotificationBody } from "./create-reminder-notification-body"; import { NotificationHeader } from "./notification-header"; diff --git a/packages/email/components/weekly-summary/notification-insight.tsx b/packages/email/components/weekly-summary/notification-insight.tsx index da1fd22293..887e5092f4 100644 --- a/packages/email/components/weekly-summary/notification-insight.tsx +++ b/packages/email/components/weekly-summary/notification-insight.tsx @@ -1,6 +1,6 @@ import { Column, Container, Row, Section, Text } from "@react-email/components"; import React from "react"; -import type { TWeeklySummaryInsights } from "@formbricks/types/weeklySummary"; +import type { TWeeklySummaryInsights } from "@formbricks/types/weekly-summary"; interface NotificationInsightProps { insights: TWeeklySummaryInsights; diff --git a/packages/email/components/weekly-summary/weekly-summary-notification-email.tsx b/packages/email/components/weekly-summary/weekly-summary-notification-email.tsx index 8fae32a78d..0b34472fa5 100644 --- a/packages/email/components/weekly-summary/weekly-summary-notification-email.tsx +++ b/packages/email/components/weekly-summary/weekly-summary-notification-email.tsx @@ -1,5 +1,5 @@ import React from "react"; -import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weeklySummary"; +import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weekly-summary"; import { LiveSurveyNotification } from "./live-survey-notification"; import { NotificationFooter } from "./notification-footer"; import { NotificationHeader } from "./notification-header"; diff --git a/packages/email/index.tsx b/packages/email/index.tsx index f86a19f291..d285ffcce2 100644 --- a/packages/email/index.tsx +++ b/packages/email/index.tsx @@ -15,7 +15,7 @@ import { createInviteToken, createToken, createTokenForLinkSurvey } from "@formb import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; import type { TResponse } from "@formbricks/types/responses"; import type { TSurvey } from "@formbricks/types/surveys/types"; -import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weeklySummary"; +import type { TWeeklySummaryNotificationResponse } from "@formbricks/types/weekly-summary"; import { ForgotPasswordEmail } from "./components/auth/forgot-password-email"; import { PasswordResetNotifyEmail } from "./components/auth/password-reset-notify-email"; import { VerificationEmail } from "./components/auth/verification-email"; diff --git a/packages/js-core/src/app/lib/noCodeActions.ts b/packages/js-core/src/app/lib/noCodeActions.ts index 82951dd4f2..4b66732300 100644 --- a/packages/js-core/src/app/lib/noCodeActions.ts +++ b/packages/js-core/src/app/lib/noCodeActions.ts @@ -1,4 +1,4 @@ -import type { TActionClass } from "@formbricks/types/actionClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; import { ErrorHandler, NetworkError, Result, err, match, okVoid } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { evaluateNoCodeConfigClick, handleUrlFilters } from "../../shared/utils"; diff --git a/packages/js-core/src/app/lib/widget.ts b/packages/js-core/src/app/lib/widget.ts index 5e545774ca..595eda42c5 100644 --- a/packages/js-core/src/app/lib/widget.ts +++ b/packages/js-core/src/app/lib/widget.ts @@ -4,6 +4,7 @@ import { SurveyState } from "@formbricks/lib/surveyState"; import { getStyling } from "@formbricks/lib/utils/styling"; import { TJsTrackProperties } from "@formbricks/types/js"; import { TResponseHiddenFieldValue, TResponseUpdate } from "@formbricks/types/responses"; +import { TUploadFileConfig } from "@formbricks/types/storage"; import { TSurvey } from "@formbricks/types/surveys/types"; import { ErrorHandler } from "../../shared/errors"; import { Logger } from "../../shared/logger"; @@ -163,7 +164,7 @@ const renderWidget = async ( }); }, onClose: closeSurvey, - onFileUpload: async (file: File, params) => { + onFileUpload: async (file: File, params: TUploadFileConfig) => { const api = new FormbricksAPI({ apiHost: inAppConfig.get().apiHost, environmentId: inAppConfig.get().environmentId, diff --git a/packages/js-core/src/shared/commandQueue.ts b/packages/js-core/src/shared/commandQueue.ts index 34e097015b..65fc6b5144 100644 --- a/packages/js-core/src/shared/commandQueue.ts +++ b/packages/js-core/src/shared/commandQueue.ts @@ -1,4 +1,4 @@ -import { wrapThrowsAsync } from "@formbricks/types/errorHandlers"; +import { wrapThrowsAsync } from "@formbricks/types/error-handlers"; import { TJsPackageType } from "@formbricks/types/js"; import { checkInitialized as checkInitializedInApp } from "../app/lib/initialize"; import { checkInitialized as checkInitializedWebsite } from "../website/lib/initialize"; diff --git a/packages/js-core/src/shared/utils.ts b/packages/js-core/src/shared/utils.ts index b4aeb26d7c..ab2c4ad41b 100644 --- a/packages/js-core/src/shared/utils.ts +++ b/packages/js-core/src/shared/utils.ts @@ -2,7 +2,7 @@ import { TActionClass, TActionClassNoCodeConfig, TActionClassPageUrlRule, -} from "@formbricks/types/actionClasses"; +} from "@formbricks/types/action-classes"; import { TAttributes } from "@formbricks/types/attributes"; import { TJsTrackProperties } from "@formbricks/types/js"; import { TResponseHiddenFieldValue } from "@formbricks/types/responses"; diff --git a/packages/js-core/src/website/lib/noCodeActions.ts b/packages/js-core/src/website/lib/noCodeActions.ts index 1523843cf2..085e021944 100644 --- a/packages/js-core/src/website/lib/noCodeActions.ts +++ b/packages/js-core/src/website/lib/noCodeActions.ts @@ -1,4 +1,4 @@ -import type { TActionClass } from "@formbricks/types/actionClasses"; +import type { TActionClass } from "@formbricks/types/action-classes"; import { ErrorHandler, NetworkError, Result, err, match, okVoid } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { evaluateNoCodeConfigClick, handleUrlFilters } from "../../shared/utils"; diff --git a/packages/js-core/src/website/lib/widget.ts b/packages/js-core/src/website/lib/widget.ts index 31c46bd564..726d75c9b4 100644 --- a/packages/js-core/src/website/lib/widget.ts +++ b/packages/js-core/src/website/lib/widget.ts @@ -4,6 +4,7 @@ import { SurveyState } from "@formbricks/lib/surveyState"; import { getStyling } from "@formbricks/lib/utils/styling"; import { TJSWebsiteStateDisplay, TJsTrackProperties } from "@formbricks/types/js"; import { TResponseHiddenFieldValue, TResponseUpdate } from "@formbricks/types/responses"; +import { TUploadFileConfig } from "@formbricks/types/storage"; import { TSurvey } from "@formbricks/types/surveys/types"; import { Logger } from "../../shared/logger"; import { getDefaultLanguageCode, getLanguageCode, handleHiddenFields } from "../../shared/utils"; @@ -193,7 +194,7 @@ const renderWidget = async ( }); }, onClose: closeSurvey, - onFileUpload: async (file: File, params) => { + onFileUpload: async (file: File, params: TUploadFileConfig) => { const api = new FormbricksAPI({ apiHost: websiteConfig.get().apiHost, environmentId: websiteConfig.get().environmentId, diff --git a/packages/js/index.html b/packages/js/index.html index 1b92346ff5..24e57a5f15 100644 --- a/packages/js/index.html +++ b/packages/js/index.html @@ -7,7 +7,7 @@ e.parentNode.insertBefore(t, e), setTimeout(function () { formbricks.init({ - environmentId: "cly414cqm000cstwa5s8w0mg2", + environmentId: "clyfn6ncr00052s58w7bgcl3a", userId: "RANDOM_USER_ID", apiHost: "http://localhost:3000", }); diff --git a/packages/js/src/shared/loadFormbricks.ts b/packages/js/src/shared/loadFormbricks.ts index b9250a8584..b20b8918b3 100644 --- a/packages/js/src/shared/loadFormbricks.ts +++ b/packages/js/src/shared/loadFormbricks.ts @@ -1,4 +1,4 @@ -import { Result, wrapThrowsAsync } from "../../../types/errorHandlers"; +import { Result, wrapThrowsAsync } from "../../../types/error-handlers"; import { MethodQueue } from "../methodQueue"; let isInitializing = false; diff --git a/packages/lib/actionClass/service.ts b/packages/lib/actionClass/service.ts index 9801f2c511..f6f8423c25 100644 --- a/packages/lib/actionClass/service.ts +++ b/packages/lib/actionClass/service.ts @@ -4,7 +4,7 @@ import "server-only"; import { Prisma } from "@prisma/client"; import { cache as reactCache } from "react"; import { prisma } from "@formbricks/database"; -import { TActionClass, TActionClassInput, ZActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClass, TActionClassInput, ZActionClassInput } from "@formbricks/types/action-classes"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; diff --git a/packages/lib/actionClient/utils.ts b/packages/lib/actionClient/utils.ts index f35b93750d..52a89515f2 100644 --- a/packages/lib/actionClient/utils.ts +++ b/packages/lib/actionClient/utils.ts @@ -1,6 +1,6 @@ import { returnValidationErrors } from "next-safe-action"; import { ZodIssue, z } from "zod"; -import { TOperation, TResource } from "@formbricks/types/actionClient"; +import { TOperation, TResource } from "@formbricks/types/action-client"; import { AuthorizationError } from "@formbricks/types/errors"; import { TMembershipRole } from "@formbricks/types/memberships"; import { getMembershipRole } from "../membership/hooks/actions"; diff --git a/packages/lib/apiKey/service.ts b/packages/lib/apiKey/service.ts index 7a52567c2d..31dd253aaf 100644 --- a/packages/lib/apiKey/service.ts +++ b/packages/lib/apiKey/service.ts @@ -3,7 +3,7 @@ import { Prisma } from "@prisma/client"; import { createHash, randomBytes } from "crypto"; import { cache as reactCache } from "react"; import { prisma } from "@formbricks/database"; -import { TApiKey, TApiKeyCreateInput, ZApiKeyCreateInput } from "@formbricks/types/apiKeys"; +import { TApiKey, TApiKeyCreateInput, ZApiKeyCreateInput } from "@formbricks/types/api-keys"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, InvalidInputError } from "@formbricks/types/errors"; diff --git a/packages/lib/attributeClass/service.ts b/packages/lib/attributeClass/service.ts index 5d809cafc2..e464245384 100644 --- a/packages/lib/attributeClass/service.ts +++ b/packages/lib/attributeClass/service.ts @@ -10,7 +10,7 @@ import { TAttributeClassUpdateInput, ZAttributeClassType, ZAttributeClassUpdateInput, -} from "@formbricks/types/attributeClasses"; +} from "@formbricks/types/attribute-classes"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, OperationNotAllowedError } from "@formbricks/types/errors"; diff --git a/packages/lib/googleSheet/service.ts b/packages/lib/googleSheet/service.ts index 4d82b37e14..bd956dc48d 100644 --- a/packages/lib/googleSheet/service.ts +++ b/packages/lib/googleSheet/service.ts @@ -6,7 +6,7 @@ import { DatabaseError, UnknownError } from "@formbricks/types/errors"; import { TIntegrationGoogleSheets, ZIntegrationGoogleSheets, -} from "@formbricks/types/integration/googleSheet"; +} from "@formbricks/types/integration/google-sheet"; import { GOOGLE_SHEETS_CLIENT_ID, GOOGLE_SHEETS_CLIENT_SECRET, diff --git a/packages/lib/i18n/reverseTranslation.ts b/packages/lib/i18n/reverseTranslation.ts index 581f9fd105..6b217ffa0a 100644 --- a/packages/lib/i18n/reverseTranslation.ts +++ b/packages/lib/i18n/reverseTranslation.ts @@ -1,5 +1,5 @@ import "server-only"; -import { TLegacySurvey, ZLegacySurvey } from "@formbricks/types/legacySurveys"; +import { TLegacySurvey, ZLegacySurvey } from "@formbricks/types/legacy-surveys"; import { TI18nString, TSurvey } from "@formbricks/types/surveys/types"; import { structuredClone } from "../pollyfills/structuredClone"; import { isI18nObject } from "./utils"; diff --git a/packages/lib/i18n/utils.ts b/packages/lib/i18n/utils.ts index 28a9a3d03c..e5513b3c3e 100644 --- a/packages/lib/i18n/utils.ts +++ b/packages/lib/i18n/utils.ts @@ -3,7 +3,7 @@ import { TLegacySurveyQuestion, TLegacySurveyThankYouCard, TLegacySurveyWelcomeCard, -} from "@formbricks/types/legacySurveys"; +} from "@formbricks/types/legacy-surveys"; import { TLanguage } from "@formbricks/types/product"; import { TI18nString, diff --git a/packages/lib/shortUrl/service.ts b/packages/lib/shortUrl/service.ts index 498d062cc5..4dda378272 100644 --- a/packages/lib/shortUrl/service.ts +++ b/packages/lib/shortUrl/service.ts @@ -4,7 +4,7 @@ import { cache as reactCache } from "react"; import { z } from "zod"; import { prisma } from "@formbricks/database"; import { DatabaseError } from "@formbricks/types/errors"; -import { TShortUrl, ZShortUrlId } from "@formbricks/types/shortUrl"; +import { TShortUrl, ZShortUrlId } from "@formbricks/types/short-url"; import { cache } from "../cache"; import { validateInputs } from "../utils/validate"; import { shortUrlCache } from "./cache"; diff --git a/packages/lib/survey/service.ts b/packages/lib/survey/service.ts index 897454a9ad..127e466883 100644 --- a/packages/lib/survey/service.ts +++ b/packages/lib/survey/service.ts @@ -2,11 +2,11 @@ import "server-only"; import { Prisma } from "@prisma/client"; import { cache as reactCache } from "react"; import { prisma } from "@formbricks/database"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { ZOptionalNumber } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, InvalidInputError, ResourceNotFoundError } from "@formbricks/types/errors"; -import { TLegacySurvey } from "@formbricks/types/legacySurveys"; +import { TLegacySurvey } from "@formbricks/types/legacy-surveys"; import { TPerson } from "@formbricks/types/people"; import { TSegment, ZSegmentFilters } from "@formbricks/types/segment"; import { TSurvey, TSurveyFilterCriteria, TSurveyInput, ZSurvey } from "@formbricks/types/surveys/types"; diff --git a/packages/lib/survey/tests/__mock__/survey.mock.ts b/packages/lib/survey/tests/__mock__/survey.mock.ts index 8066ade5bf..35fb05dae8 100644 --- a/packages/lib/survey/tests/__mock__/survey.mock.ts +++ b/packages/lib/survey/tests/__mock__/survey.mock.ts @@ -1,6 +1,6 @@ import { Prisma } from "@prisma/client"; -import { TActionClass } from "@formbricks/types/actionClasses"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TOrganization } from "@formbricks/types/organizations"; import { TProduct } from "@formbricks/types/product"; import { diff --git a/packages/lib/survey/utils.ts b/packages/lib/survey/utils.ts index e0fe00dd9a..8b300cc405 100644 --- a/packages/lib/survey/utils.ts +++ b/packages/lib/survey/utils.ts @@ -1,6 +1,6 @@ import "server-only"; import { Prisma } from "@prisma/client"; -import { TLegacySurvey } from "@formbricks/types/legacySurveys"; +import { TLegacySurvey } from "@formbricks/types/legacy-surveys"; import { TSegment } from "@formbricks/types/segment"; import { TSurvey, TSurveyFilterCriteria } from "@formbricks/types/surveys/types"; diff --git a/packages/lib/templates.ts b/packages/lib/templates.ts index cb85ad6b6a..e3ecaef049 100644 --- a/packages/lib/templates.ts +++ b/packages/lib/templates.ts @@ -1,5 +1,5 @@ import { createId } from "@paralleldrive/cuid2"; -import { TActionClass } from "@formbricks/types/actionClasses"; +import { TActionClass } from "@formbricks/types/action-classes"; import { TSurveyCTAQuestion, TSurveyDisplayOption, diff --git a/packages/lib/utils/recall.ts b/packages/lib/utils/recall.ts index 3b7dbeaf88..daecc7840f 100644 --- a/packages/lib/utils/recall.ts +++ b/packages/lib/utils/recall.ts @@ -1,4 +1,4 @@ -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TAttributes } from "@formbricks/types/attributes"; import { TResponseData } from "@formbricks/types/responses"; import { diff --git a/packages/lib/utils/testUrlMatch.ts b/packages/lib/utils/testUrlMatch.ts index c4c0c629af..ccf9f58bdd 100644 --- a/packages/lib/utils/testUrlMatch.ts +++ b/packages/lib/utils/testUrlMatch.ts @@ -1,4 +1,4 @@ -import { TActionClassPageUrlRule } from "@formbricks/types/actionClasses"; +import { TActionClassPageUrlRule } from "@formbricks/types/action-classes"; export const testURLmatch = ( testUrl: string, diff --git a/packages/lib/webhook/utils.ts b/packages/lib/webhook/utils.ts index 5c413723cf..5365042520 100644 --- a/packages/lib/webhook/utils.ts +++ b/packages/lib/webhook/utils.ts @@ -1,5 +1,5 @@ import "server-only"; -import { Result } from "@formbricks/types/errorHandlers"; +import { Result } from "@formbricks/types/error-handlers"; export const testEndpoint = async (url: string): Promise> => { try { diff --git a/packages/surveys/src/components/general/Survey.tsx b/packages/surveys/src/components/general/Survey.tsx index bf3879d942..86e562a362 100644 --- a/packages/surveys/src/components/general/Survey.tsx +++ b/packages/surveys/src/components/general/Survey.tsx @@ -13,7 +13,7 @@ import { parseRecallInformation, replaceRecallInfo } from "@/lib/recall"; import { cn } from "@/lib/utils"; import { useEffect, useMemo, useRef, useState } from "preact/hooks"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; -import { SurveyBaseProps } from "@formbricks/types/formbricksSurveys"; +import { SurveyBaseProps } from "@formbricks/types/formbricks-surveys"; import type { TResponseData, TResponseDataValue, TResponseTtc } from "@formbricks/types/responses"; export const Survey = ({ diff --git a/packages/surveys/src/components/general/SurveyInline.tsx b/packages/surveys/src/components/general/SurveyInline.tsx index 1c2d058de7..2672dc97fd 100644 --- a/packages/surveys/src/components/general/SurveyInline.tsx +++ b/packages/surveys/src/components/general/SurveyInline.tsx @@ -1,4 +1,4 @@ -import { SurveyInlineProps } from "@formbricks/types/formbricksSurveys"; +import { SurveyInlineProps } from "@formbricks/types/formbricks-surveys"; import { Survey } from "./Survey"; export const SurveyInline = (props: SurveyInlineProps) => { diff --git a/packages/surveys/src/components/general/SurveyModal.tsx b/packages/surveys/src/components/general/SurveyModal.tsx index c52ea2ceac..98557552eb 100644 --- a/packages/surveys/src/components/general/SurveyModal.tsx +++ b/packages/surveys/src/components/general/SurveyModal.tsx @@ -1,6 +1,6 @@ import { Modal } from "@/components/wrappers/Modal"; import { useState } from "preact/hooks"; -import { SurveyModalProps } from "@formbricks/types/formbricksSurveys"; +import { SurveyModalProps } from "@formbricks/types/formbricks-surveys"; import { Survey } from "./Survey"; export const SurveyModal = ({ diff --git a/packages/surveys/src/index.ts b/packages/surveys/src/index.ts index 46faec1811..c6ec3ddaec 100644 --- a/packages/surveys/src/index.ts +++ b/packages/surveys/src/index.ts @@ -2,7 +2,7 @@ import { SurveyInline } from "@/components/general/SurveyInline"; import { SurveyModal } from "@/components/general/SurveyModal"; import { addCustomThemeToDom, addStylesToDom } from "@/lib/styles"; import { h, render } from "preact"; -import { SurveyInlineProps, SurveyModalProps } from "@formbricks/types/formbricksSurveys"; +import { SurveyInlineProps, SurveyModalProps } from "@formbricks/types/formbricks-surveys"; export const renderSurveyInline = (props: SurveyInlineProps) => { addStylesToDom(); diff --git a/packages/types/actionClasses.ts b/packages/types/action-classes.ts similarity index 99% rename from packages/types/actionClasses.ts rename to packages/types/action-classes.ts index 9690e9598e..da580ea322 100644 --- a/packages/types/actionClasses.ts +++ b/packages/types/action-classes.ts @@ -1,4 +1,4 @@ -import z from "zod"; +import { z } from "zod"; export const ZActionClassMatchType = z.union([ z.literal("exactMatch"), diff --git a/packages/types/actionClient.ts b/packages/types/action-client.ts similarity index 100% rename from packages/types/actionClient.ts rename to packages/types/action-client.ts diff --git a/packages/types/actions.ts b/packages/types/actions.ts index 4ad4a2537e..c04e302bf9 100644 --- a/packages/types/actions.ts +++ b/packages/types/actions.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZActionClass } from "./actionClasses"; +import { ZActionClass } from "./action-classes"; export const ZAction = z.object({ id: z.string(), diff --git a/packages/types/apiKeys.ts b/packages/types/api-keys.ts similarity index 100% rename from packages/types/apiKeys.ts rename to packages/types/api-keys.ts diff --git a/packages/types/attributeClasses.ts b/packages/types/attribute-classes.ts similarity index 97% rename from packages/types/attributeClasses.ts rename to packages/types/attribute-classes.ts index 0287fdd684..6dc93e3a07 100644 --- a/packages/types/attributeClasses.ts +++ b/packages/types/attribute-classes.ts @@ -1,4 +1,4 @@ -import z from "zod"; +import { z } from "zod"; export const ZAttributeClassType = z.enum(["code", "noCode", "automatic"]); diff --git a/packages/types/common.ts b/packages/types/common.ts index bfdc93eb14..e6b7397fef 100644 --- a/packages/types/common.ts +++ b/packages/types/common.ts @@ -6,7 +6,7 @@ export const ZNumber = z.number(); export const ZOptionalNumber = z.number().optional(); -export const ZColor = z.string().regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/); +export const ZColor = z.string().regex(/^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/); export const ZPlacement = z.enum(["bottomLeft", "bottomRight", "topLeft", "topRight", "center"]); diff --git a/packages/types/error-handlers.ts b/packages/types/error-handlers.ts new file mode 100644 index 0000000000..1db4923f9f --- /dev/null +++ b/packages/types/error-handlers.ts @@ -0,0 +1,153 @@ +export type Result = { ok: true; data: T } | { ok: false; error: E }; + +export const ok = (data: T): Result => ({ ok: true, data }); + +export const okVoid = (): Result => ({ ok: true, data: undefined }); + +export const err = (error: E): Result => ({ + ok: false, + error, +}); + +// Applies the given function `fn` to the data property of the input `result` object +// and returns a new `Result` object with the transformed data property. +// +// T - The type of the input data. +// R - The type of the output data. +// +// fn - The function to apply to the data property of the input `result` object. +// Returns a new function that takes in a `Result` object and returns a new `Result` object. +// +// +// Example: +// const divideByTwo = (num: number): Result => { +// if (num === 0) { +// return { ok: false, error: "Cannot divide zero" }; +// } +// +// return { ok: true, data: num / 2 }; +// } +// +// const wrappedDivideByTwo = wrap(divideByTwo); +// +// const result1: Result = { ok: true, data: 10 }; +// const result2: Result = { ok: false, error: "Invalid input" }; +// const result3: Result = { ok: true, data: 0 }; +// +// console.log(wrappedDivideByTwo(result1)); // { ok: true, data: 5 } +// console.log(wrappedDivideByTwo(result2)); // { ok: false, error: "Invalid input" } +// console.log(wrappedDivideByTwo(result3)); // { ok: false, error: "Cannot divide zero" } +export const wrap = + (fn: (value: T) => R) => + (result: Result): Result => + result.ok ? { ok: true, data: fn(result.data) } : result; + +// Matches the given `result` object against its `ok` property and invokes the `onSuccess` function +// if `ok` is `true`, or the `onError` function if `ok` is `false`. Returns the result of the invoked function. +// +// TSuccess - Type of the success value. +// TError - Type of the error value. +// TReturn - Type of the return value. +// +// result - The `Result` object to match against. +// onSuccess - The function to invoke if `result.ok` is `true`. +// onError - The function to invoke if `result.ok` is `false`. +// +// Returns the result of the invoked function. +// +// Example: +// const test = (): Result => { +// return err(new Error("error happened")); +// } +// +// const result = test(); +// +// match(result, (value) => { +// console.log(value); // never run with this example +// }, (error) => { +// console.log(error); // Error: error happened +// }); +export const match = ( + result: Result, + onSuccess: (value: TSuccess) => TReturn, + onError: (error: TError) => TReturn +): TReturn => (result.ok ? onSuccess(result.data) : onError(result.error)); + +// Wraps a function `fn` that may throw an error into a new function that returns a `Result` object. +// If the wrapped function throws an error, the returned `Result` object will have an `ok` property of `false` +// and an `error` property containing the thrown error. Otherwise, the returned `Result` object will have an +// `ok` property of `true` and a `data` property containing the result of the wrapped function. +// +// T - The type of the result value. +// A - An array of the types of the arguments expected by the wrapped function. +// +// fn - The function to wrap. +// Returns a new function that returns a `Result` object. +// +// Example: +// function divideByTwo(num: number): number { +// if (num === 0) { +// throw new Error("Cannot divide zero"); +// } +// return num / 2; +// } +// +// const wrappedDivideByTwo = wrapThrows(divideByTwo); +// +// const result1: Result = wrappedDivideByTwo(10); // { ok: true, data: 5 } +// const result2: Result = wrappedDivideByTwo(0); // { ok: false, error: Error("Cannot divide zero") } +export const wrapThrows = + (fn: (...args: A) => T): ((...args: A) => Result) => + (...args: A): Result => { + try { + return { + ok: true, + data: fn(...args), + }; + } catch (error) { + return { + ok: false, + error: error as Error, + }; + } + }; + +// Wraps an asynchronous function `fn` that may throw an error into a new function that returns a `Result` object. +// If the wrapped function throws an error, the returned `Result` object will have an `ok` property of `false` +// and an `error` property containing the thrown error. Otherwise, the returned `Result` object will have an +// `ok` property of `true` and a `data` property containing the result of the wrapped function. +// +// T - The type of the result value. +// A - An array of the types of the arguments expected by the wrapped function. +// +// fn - The asynchronous function to wrap. +// Returns a new function that returns a `Result` object. +// +// Example: +// async function fetchData(url: string): Promise { +// const response = await fetch(url); +// if (!response.ok) { +// throw new Error("Network response was not ok"); +// } +// return response.text(); +// } +// +// const wrappedFetchData = wrapThrowsAsync(fetchData); +// +// const result1: Result = await wrappedFetchData("https://example.com"); // { ok: true, data: "..." } +// const result2: Result = await wrappedFetchData("https://bad-url.com"); // { ok: false, error: Error("Network response was not ok") } +export const wrapThrowsAsync = + (fn: (...args: A) => Promise) => + async (...args: A): Promise> => { + try { + return { + ok: true, + data: await fn(...args), + }; + } catch (error) { + return { + ok: false, + error: error as Error, + }; + } + }; diff --git a/packages/types/errorHandlers.ts b/packages/types/errorHandlers.ts deleted file mode 100644 index 778f8611ac..0000000000 --- a/packages/types/errorHandlers.ts +++ /dev/null @@ -1,135 +0,0 @@ -export type Result = { ok: true; data: T } | { ok: false; error: E }; - -export const ok = (data: T): Result => ({ ok: true, data }); - -export const okVoid = (): Result => ({ ok: true, data: undefined }); - -export const err = (error: E): Result => ({ - ok: false, - error, -}); - -/** - * Applies the given function `fn` to the data property of the input `result` object - * and returns a new `Result` object with the transformed data property. - * - * @template T The type of the input data. - * @template R The type of the output data. - * - * @param {function(value: T): R} fn The function to apply to the data property of the input `result` object. - * @returns {function(result: Result): Result} A new function that takes in a `Result` object and returns a new `Result` object. - * - * @example - * const divideByTwo = (num: number): Result => { - * if (num === 0) { - * return { ok: false, error: "Cannot divide zero" }; - * } - * - * return { ok: true, data: num / 2 }; - * } - * - * const wrappedDivideByTwo = wrap(divideByTwo); - * - * const result1: Result = { ok: true, data: 10 }; - * const result2: Result = { ok: false, error: "Invalid input" }; - * const result3: Result = { ok: true, data: 0 }; - * - * console.log(wrappedDivideByTwo(result1)); // { ok: true, data: 5 } - * console.log(wrappedDivideByTwo(result2)); // { ok: false, error: "Invalid input" } - * console.log(wrappedDivideByTwo(result3)); // { ok: false, error: "Cannot divide zero" } - */ - -export const wrap = - (fn: (value: T) => R) => - (result: Result): Result => - result.ok === true ? { ok: true, data: fn(result.data) } : result; - -/** - * Matches the given `result` object against its `ok` property and invokes the `onSuccess` function - * if `ok` is `true`, or the `onError` function if `ok` is `false`. Returns the result of the invoked function. Match a Result object and run a function depending on the result. - * - * @template TSuccess - Type of the success value - * @template TError - Type of the error value - * @template TReturn - Type of the return value - * - * @param {Result} result The `Result` object to match against. - * @param {(value: TSuccess) => TReturn} onSuccess The function to invoke if `result.ok` is `true`. - * @param {(error: TError) => TReturn} onError The function to invoke if `result.ok` is `false`. - * - * @returns {TReturn} The result of the invoked function. - * - * @example - * const test = (): Result => { - * return err(new Error("error happened")); - * } - * - * const result = test(); - * - * match(result, (value) => { - * console.log(value); // never run with this example - * }, (error) => { - * console.log(error); // Error: error happened - * }); - */ -export const match = ( - result: Result, - onSuccess: (value: TSuccess) => TReturn, - onError: (error: TError) => TReturn -): TReturn => (result.ok === true ? onSuccess(result.data) : onError(result.error)); - -/** - * Wraps a function `fn` that may throw an error into a new function that returns a `Result` object. - * If the wrapped function throws an error, the returned `Result` object will have an `ok` property of `false` - * and an `error` property containing the thrown error. Otherwise, the returned `Result` object will have an - * `ok` property of `true` and a `data` property containing the result of the wrapped function. - * - * @template T The type of the result value. - * @template A An array of the types of the arguments expected by the wrapped function. - * - * @param {(...args: A) => T} fn The function to wrap. - * @returns {(...args: A) => Result} A new function that returns a `Result` object. - * - * @example - * function divideByTwo(num: number): number { - * if (num === 0) { - * throw new Error("Cannot divide zero"); - * } - * return num / 2; - * } - * - * const wrappedDivideByTwo = wrapThrows(divideByTwo); - * - * const result1: Result = wrappedDivideByTwo(10); // { ok: true, data: 5 } - * const result2: Result = wrappedDivideByTwo(0); // { ok: false, error: Error("Cannot divide zero") } - */ -export const wrapThrows = - (fn: (...args: A) => T): ((...args: A) => Result) => - (...args: A): Result => { - try { - return { - ok: true, - data: fn(...args), - }; - } catch (error: any) { - return { - ok: false, - error, - }; - } - }; - -export const wrapThrowsAsync = - (fn: (...args: A) => Promise) => - async (...args: A): Promise> => { - try { - return { - ok: true, - data: await fn(...args), - }; - } catch (error) { - return { - ok: false, - error: error as Error, - }; - } - }; diff --git a/packages/types/errors.ts b/packages/types/errors.ts index d89c405b50..ed9d854224 100644 --- a/packages/types/errors.ts +++ b/packages/types/errors.ts @@ -80,12 +80,12 @@ class AuthorizationError extends Error { } } -type NetworkError = { +interface NetworkError { code: "network_error"; message: string; status: number; url: URL; -}; +} export const ZErrorHandler = z.function().args(z.any()).returns(z.void()); diff --git a/packages/types/formbricksSurveys.ts b/packages/types/formbricks-surveys.ts similarity index 83% rename from packages/types/formbricksSurveys.ts rename to packages/types/formbricks-surveys.ts index bdb510393c..e009c8fc23 100644 --- a/packages/types/formbricksSurveys.ts +++ b/packages/types/formbricks-surveys.ts @@ -1,7 +1,7 @@ -import { TProductStyling } from "./product"; -import { TResponseData, TResponseUpdate } from "./responses"; -import { TUploadFileConfig } from "./storage"; -import { TSurvey, TSurveyStyling } from "./surveys/types"; +import { type TProductStyling } from "./product"; +import { type TResponseData, type TResponseUpdate } from "./responses"; +import { type TUploadFileConfig } from "./storage"; +import type { TSurvey, TSurveyStyling } from "./surveys/types"; export interface SurveyBaseProps { survey: TSurvey; diff --git a/packages/types/integration/airtable.ts b/packages/types/integration/airtable.ts index 3feed5a554..a9518406d4 100644 --- a/packages/types/integration/airtable.ts +++ b/packages/types/integration/airtable.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./sharedTypes"; +import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./shared-types"; export const ZIntegrationAirtableCredential = z.object({ expiry_date: z.string(), diff --git a/packages/types/integration/googleSheet.ts b/packages/types/integration/google-sheet.ts similarity index 99% rename from packages/types/integration/googleSheet.ts rename to packages/types/integration/google-sheet.ts index 901ccfff24..28579fc05a 100644 --- a/packages/types/integration/googleSheet.ts +++ b/packages/types/integration/google-sheet.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./sharedTypes"; +import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./shared-types"; export const ZGoogleCredential = z.object({ scope: z.string(), diff --git a/packages/types/integration/index.ts b/packages/types/integration/index.ts index 4a37c9f5e0..d9096513d8 100644 --- a/packages/types/integration/index.ts +++ b/packages/types/integration/index.ts @@ -1,11 +1,9 @@ import { z } from "zod"; import { ZIntegrationAirtableConfig, ZIntegrationAirtableInput } from "./airtable"; -import { ZIntegrationGoogleSheetsConfig, ZIntegrationGoogleSheetsInput } from "./googleSheet"; +import { ZIntegrationGoogleSheetsConfig, ZIntegrationGoogleSheetsInput } from "./google-sheet"; import { ZIntegrationNotionConfig, ZIntegrationNotionInput } from "./notion"; import { ZIntegrationSlackConfig, ZIntegrationSlackInput } from "./slack"; -export * from "./sharedTypes"; - export const ZIntegrationType = z.enum(["googleSheets", "n8n", "airtable", "notion", "slack"]); export type TIntegrationType = z.infer; diff --git a/packages/types/integration/notion.ts b/packages/types/integration/notion.ts index cb41967d29..599d7ff43a 100644 --- a/packages/types/integration/notion.ts +++ b/packages/types/integration/notion.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./sharedTypes"; +import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./shared-types"; export const ZIntegrationNotionCredential = z.object({ access_token: z.string(), diff --git a/packages/types/integration/sharedTypes.ts b/packages/types/integration/shared-types.ts similarity index 92% rename from packages/types/integration/sharedTypes.ts rename to packages/types/integration/shared-types.ts index b8369ac81d..cc3d1f5dc4 100644 --- a/packages/types/integration/sharedTypes.ts +++ b/packages/types/integration/shared-types.ts @@ -1,7 +1,5 @@ import { z } from "zod"; -export * from "./sharedTypes"; - export const ZIntegrationBase = z.object({ id: z.string(), environmentId: z.string(), diff --git a/packages/types/integration/slack.ts b/packages/types/integration/slack.ts index 02520d7db4..bfcc74d23c 100644 --- a/packages/types/integration/slack.ts +++ b/packages/types/integration/slack.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./sharedTypes"; +import { ZIntegrationBase, ZIntegrationBaseSurveyData } from "./shared-types"; export const ZIntegrationSlackConfigData = z .object({ diff --git a/packages/types/invites.ts b/packages/types/invites.ts index 0118937178..91172c4220 100644 --- a/packages/types/invites.ts +++ b/packages/types/invites.ts @@ -1,4 +1,4 @@ -import z from "zod"; +import { z } from "zod"; import { ZMembershipRole } from "./memberships"; export const ZInvite = z.object({ diff --git a/packages/types/js.ts b/packages/types/js.ts index 62ff52036d..a87b143bcb 100644 --- a/packages/types/js.ts +++ b/packages/types/js.ts @@ -1,7 +1,7 @@ -import z from "zod"; -import { ZActionClass } from "./actionClasses"; +import { z } from "zod"; +import { ZActionClass } from "./action-classes"; import { ZAttributes } from "./attributes"; -import { ZLegacySurvey } from "./legacySurveys"; +import { ZLegacySurvey } from "./legacy-surveys"; import { ZPerson } from "./people"; import { ZProduct } from "./product"; import { ZResponseHiddenFieldValue } from "./responses"; @@ -19,7 +19,7 @@ const ZSurveyWithTriggers = ZSurvey.innerType() .extend({ triggers: z.array(ZActionClass).or(z.array(z.string())), }) - .superRefine(ZSurvey._def.effect.type === "refinement" ? ZSurvey._def.effect.refinement : () => {}); + .superRefine(ZSurvey._def.effect.type === "refinement" ? ZSurvey._def.effect.refinement : () => null); export type TSurveyWithTriggers = z.infer; diff --git a/packages/types/legacySurveys.ts b/packages/types/legacy-surveys.ts similarity index 100% rename from packages/types/legacySurveys.ts rename to packages/types/legacy-surveys.ts diff --git a/packages/types/memberships.ts b/packages/types/memberships.ts index ec7d09c57d..d3f75c601b 100644 --- a/packages/types/memberships.ts +++ b/packages/types/memberships.ts @@ -1,4 +1,4 @@ -import z from "zod"; +import { z } from "zod"; export const ZMembershipRole = z.enum(["owner", "admin", "editor", "developer", "viewer"]); diff --git a/packages/types/next-auth.d.ts b/packages/types/next-auth.d.ts index 3584faf2e5..b0f2b66f58 100644 --- a/packages/types/next-auth.d.ts +++ b/packages/types/next-auth.d.ts @@ -1,5 +1,5 @@ import NextAuth from "next-auth"; -import { TUser } from "./user"; +import { type TUser } from "./user"; declare module "next-auth" { /** diff --git a/packages/types/package.json b/packages/types/package.json index 11975d8a04..4019c551fc 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -5,6 +5,7 @@ "main": "index.ts", "sideEffects": false, "scripts": { + "lint": "eslint . --ext .ts,.js,.tsx,.jsx", "clean": "rimraf node_modules .turbo" }, "devDependencies": { diff --git a/packages/types/people.ts b/packages/types/people.ts index 96f659f4aa..d981e31ba1 100644 --- a/packages/types/people.ts +++ b/packages/types/people.ts @@ -1,4 +1,4 @@ -import z from "zod"; +import { z } from "zod"; export const ZPerson = z.object({ id: z.string().cuid2(), diff --git a/packages/types/segment.ts b/packages/types/segment.ts index a8e1bbdbc8..b79c6c460b 100644 --- a/packages/types/segment.ts +++ b/packages/types/segment.ts @@ -270,11 +270,11 @@ export const ZSegmentConnector = z.enum(["and", "or"]).nullable(); export type TSegmentConnector = z.infer; -export type TBaseFilter = { +export interface TBaseFilter { id: string; connector: TSegmentConnector; resource: TSegmentFilter | TBaseFilters; -}; +} export type TBaseFilters = TBaseFilter[]; @@ -287,12 +287,10 @@ const refineFilters = (filters: TBaseFilters): boolean => { if (Array.isArray(group.resource)) { result = refineFilters(group.resource); - } else { + } else if (i === 0 && group.connector !== null) { // if the connector for a "first" group is not null, it's invalid - if (i === 0 && group.connector !== null) { - result = false; - break; - } + result = false; + break; } } @@ -303,7 +301,6 @@ const refineFilters = (filters: TBaseFilters): boolean => { // more on recusrsive types -> https://zod.dev/?id=recursive-types // TODO: Figure out why this is not working, and then remove the ts-ignore -// @ts-ignore export const ZSegmentFilters: z.ZodType = z .array( z.object({ @@ -357,15 +354,13 @@ export const ZSegmentUpdateInput = z export type TSegmentUpdateInput = z.infer; -export type TEvaluateSegmentUserAttributeData = { - [attributeClassName: string]: string | number; -}; +export type TEvaluateSegmentUserAttributeData = Record; -export type TEvaluateSegmentUserData = { +export interface TEvaluateSegmentUserData { personId: string; userId: string; environmentId: string; attributes: TEvaluateSegmentUserAttributeData; actionIds: string[]; deviceType: "phone" | "desktop"; -}; +} diff --git a/packages/types/shortUrl.ts b/packages/types/short-url.ts similarity index 92% rename from packages/types/shortUrl.ts rename to packages/types/short-url.ts index 5ffd7317c7..23ccd12620 100644 --- a/packages/types/shortUrl.ts +++ b/packages/types/short-url.ts @@ -1,4 +1,4 @@ -import z from "zod"; +import { z } from "zod"; export const ZShortUrlId = z.string().length(10); diff --git a/packages/types/styling.ts b/packages/types/styling.ts index 458b7c9677..d6f303eaf3 100644 --- a/packages/types/styling.ts +++ b/packages/types/styling.ts @@ -24,7 +24,7 @@ export const ZSurveyStylingBackground = z .refine( (surveyBackground) => { if (surveyBackground.bgType === "upload") { - return !!surveyBackground.bg; + return Boolean(surveyBackground.bg); } return true; diff --git a/packages/types/surveys/types.ts b/packages/types/surveys/types.ts index eaca6be669..545d2bb98e 100644 --- a/packages/types/surveys/types.ts +++ b/packages/types/surveys/types.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZActionClass, ZActionClassNoCodeConfig } from "../actionClasses"; +import { ZActionClass, ZActionClassNoCodeConfig } from "../action-classes"; import { ZAttributes } from "../attributes"; import { ZAllowedFileExtension, ZColor, ZPlacement } from "../common"; import { ZId } from "../environment"; @@ -365,10 +365,9 @@ export const ZSurveyMultipleChoiceQuestion = ZSurveyQuestionBase.extend({ if (type === TSurveyQuestionTypeEnum.MultipleChoiceSingle) { // The single choice question should not have 'includesAll' logic return !logic?.some((l) => l.condition === "includesAll"); - } else { - // The multi choice question should not have 'notEquals' logic - return !logic?.some((l) => l.condition === "notEquals"); } + // The multi choice question should not have 'notEquals' logic + return !logic?.some((l) => l.condition === "notEquals"); }, { message: @@ -598,10 +597,12 @@ export const ZSurvey = z .superRefine((survey, ctx) => { const { questions, languages, welcomeCard, thankYouCard } = survey; + let multiLangIssue: z.IssueData | null; + // welcome card validations if (welcomeCard.enabled) { if (welcomeCard.headline) { - const multiLangIssue = validateCardFieldsForAllLanguages( + multiLangIssue = validateCardFieldsForAllLanguages( "cardHeadline", welcomeCard.headline, languages, @@ -614,7 +615,7 @@ export const ZSurvey = z } if (welcomeCard.html) { - const multiLangIssue = validateCardFieldsForAllLanguages( + multiLangIssue = validateCardFieldsForAllLanguages( "welcomeCardHtml", welcomeCard.html, languages, @@ -626,7 +627,7 @@ export const ZSurvey = z } if (welcomeCard.buttonLabel) { - const multiLangIssue = validateCardFieldsForAllLanguages( + multiLangIssue = validateCardFieldsForAllLanguages( "buttonLabel", welcomeCard.buttonLabel, languages, @@ -641,18 +642,13 @@ export const ZSurvey = z // Custom default validation for each question questions.forEach((question, questionIndex) => { const existingLogicConditions = new Set(); - const multiLangIssue = validateQuestionLabels("headline", question.headline, languages, questionIndex); + multiLangIssue = validateQuestionLabels("headline", question.headline, languages, questionIndex); if (multiLangIssue) { ctx.addIssue(multiLangIssue); } if (question.subheader) { - const multiLangIssue = validateQuestionLabels( - "subheader", - question.subheader, - languages, - questionIndex - ); + multiLangIssue = validateQuestionLabels("subheader", question.subheader, languages, questionIndex); if (multiLangIssue) { ctx.addIssue(multiLangIssue); } @@ -677,13 +673,12 @@ export const ZSurvey = z continue; } - const questionFieldValue = question[field as keyof typeof question] as TI18nString; + const questionFieldValue = question[field as keyof typeof question] as TI18nString | null; if ( - questionFieldValue && - typeof questionFieldValue[defaultLanguageCode] !== "undefined" && + typeof questionFieldValue?.[defaultLanguageCode] !== "undefined" && questionFieldValue[defaultLanguageCode].trim() !== "" ) { - const multiLangIssue = validateQuestionLabels(field, questionFieldValue, languages, questionIndex); + multiLangIssue = validateQuestionLabels(field, questionFieldValue, languages, questionIndex); if (multiLangIssue) { ctx.addIssue(multiLangIssue); } @@ -692,7 +687,7 @@ export const ZSurvey = z if (question.type === TSurveyQuestionTypeEnum.OpenText) { if (question.placeholder) { - const multiLangIssue = validateQuestionLabels( + multiLangIssue = validateQuestionLabels( "placeholder", question.placeholder, languages, @@ -709,8 +704,8 @@ export const ZSurvey = z question.type === TSurveyQuestionTypeEnum.MultipleChoiceMulti ) { question.choices.forEach((choice, choiceIndex) => { - const multiLangIssue = validateQuestionLabels( - `Choice ${choiceIndex + 1}`, + multiLangIssue = validateQuestionLabels( + `Choice ${String(choiceIndex + 1)}`, choice.label, languages, questionIndex, @@ -729,7 +724,7 @@ export const ZSurvey = z if (duplicateChoicesLanguageCodes.length > 0) { const invalidLanguageCodes = duplicateChoicesLanguageCodes.map((invalidLanguageCode) => invalidLanguageCode === "default" - ? languages.find((lang) => lang.default)?.language.code || "default" + ? languages.find((lang) => lang.default)?.language.code ?? "default" : invalidLanguageCode ); @@ -737,7 +732,7 @@ export const ZSurvey = z ctx.addIssue({ code: z.ZodIssueCode.custom, - message: `Question ${questionIndex + 1} has duplicate choice labels ${isDefaultOnly ? "" : "for the following languages:"}`, + message: `Question ${String(questionIndex + 1)} has duplicate choice labels ${isDefaultOnly ? "" : "for the following languages:"}`, path: ["questions", questionIndex, "choices"], params: isDefaultOnly ? undefined : { invalidLanguageCodes }, }); @@ -745,12 +740,7 @@ export const ZSurvey = z } if (question.type === TSurveyQuestionTypeEnum.Consent) { - const multiLangIssue = validateQuestionLabels( - "consent.label", - question.label, - languages, - questionIndex - ); + multiLangIssue = validateQuestionLabels("consent.label", question.label, languages, questionIndex); if (multiLangIssue) { ctx.addIssue(multiLangIssue); @@ -759,7 +749,7 @@ export const ZSurvey = z if (question.type === TSurveyQuestionTypeEnum.CTA) { if (!question.required && question.dismissButtonLabel) { - const multiLangIssue = validateQuestionLabels( + multiLangIssue = validateQuestionLabels( "dismissButtonLabel", question.dismissButtonLabel, languages, @@ -773,8 +763,8 @@ export const ZSurvey = z if (question.type === TSurveyQuestionTypeEnum.Matrix) { question.rows.forEach((row, rowIndex) => { - const multiLangIssue = validateQuestionLabels( - `Row ${rowIndex + 1}`, + multiLangIssue = validateQuestionLabels( + `Row ${String(rowIndex + 1)}`, row, languages, questionIndex, @@ -786,8 +776,8 @@ export const ZSurvey = z }); question.columns.forEach((column, columnIndex) => { - const multiLangIssue = validateQuestionLabels( - `Column ${columnIndex + 1}`, + multiLangIssue = validateQuestionLabels( + `Column ${String(columnIndex + 1)}`, column, languages, questionIndex, @@ -804,7 +794,7 @@ export const ZSurvey = z if (duplicateRowsLanguageCodes.length > 0) { const invalidLanguageCodes = duplicateRowsLanguageCodes.map((invalidLanguageCode) => invalidLanguageCode === "default" - ? languages.find((lang) => lang.default)?.language.code || "default" + ? languages.find((lang) => lang.default)?.language.code ?? "default" : invalidLanguageCode ); @@ -812,7 +802,7 @@ export const ZSurvey = z ctx.addIssue({ code: z.ZodIssueCode.custom, - message: `Question ${questionIndex + 1} has duplicate row labels ${isDefaultOnly ? "" : "for the following languages:"}`, + message: `Question ${String(questionIndex + 1)} has duplicate row labels ${isDefaultOnly ? "" : "for the following languages:"}`, path: ["questions", questionIndex, "rows"], params: isDefaultOnly ? undefined : { invalidLanguageCodes }, }); @@ -821,7 +811,7 @@ export const ZSurvey = z if (duplicateColumnLanguageCodes.length > 0) { const invalidLanguageCodes = duplicateColumnLanguageCodes.map((invalidLanguageCode) => invalidLanguageCode === "default" - ? languages.find((lang) => lang.default)?.language.code || "default" + ? languages.find((lang) => lang.default)?.language.code ?? "default" : invalidLanguageCode ); @@ -829,7 +819,7 @@ export const ZSurvey = z ctx.addIssue({ code: z.ZodIssueCode.custom, - message: `Question ${questionIndex + 1} has duplicate column labels ${isDefaultOnly ? "" : "for the following languages:"}`, + message: `Question ${String(questionIndex + 1)} has duplicate column labels ${isDefaultOnly ? "" : "for the following languages:"}`, path: ["questions", questionIndex, "columns"], params: isDefaultOnly ? undefined : { invalidLanguageCodes }, }); @@ -841,7 +831,7 @@ export const ZSurvey = z if (question.allowedFileExtensions && question.allowedFileExtensions.length === 0) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: `Question ${questionIndex + 1} must have atleast one allowed file extension`, + message: `Question ${String(questionIndex + 1)} must have atleast one allowed file extension`, path: ["questions", questionIndex, "allowedFileExtensions"], }); } @@ -850,12 +840,12 @@ export const ZSurvey = z if (question.logic) { question.logic.forEach((logic, logicIndex) => { const logicConditions = ["condition", "value", "destination"] as const; - const validFields = logicConditions.filter((field) => logic[field] !== undefined)?.length; + const validFields = logicConditions.filter((field) => logic[field] !== undefined).length; if (validFields < 2) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: `Logic for question ${questionIndex + 1} is missing required fields`, + message: `Logic for question ${String(questionIndex + 1)} is missing required fields`, path: ["questions", questionIndex, "logic"], }); } @@ -863,13 +853,13 @@ export const ZSurvey = z if (question.required && logic.condition === "skipped") { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: `Logic for question ${questionIndex + 1} is invalid. Required questions cannot be skipped.`, + message: `Logic for question ${String(questionIndex + 1)} is invalid. Required questions cannot be skipped.`, path: ["questions", questionIndex, "logic"], }); } // logic condition and value mapping should not be repeated - const thisLogic = `${logic.condition}-${logic.value}`; + const thisLogic = `${logic.condition ?? ""}-${String(logic.value)}`; if (existingLogicConditions.has(thisLogic)) { ctx.addIssue({ code: z.ZodIssueCode.custom, @@ -889,7 +879,7 @@ export const ZSurvey = z const questionIndex = questions.findIndex((q) => q.id === questionId); ctx.addIssue({ code: z.ZodIssueCode.custom, - message: `Cyclic logic detected 🔃 Please check the logic of question ${questionIndex + 1}.`, + message: `Cyclic logic detected 🔃 Please check the logic of question ${String(questionIndex + 1)}.`, path: ["questions", questionIndex, "logic"], }); }); @@ -898,7 +888,7 @@ export const ZSurvey = z // thank you card validations if (thankYouCard.enabled) { if (thankYouCard.headline) { - const multiLangIssue = validateCardFieldsForAllLanguages( + multiLangIssue = validateCardFieldsForAllLanguages( "cardHeadline", thankYouCard.headline, languages, @@ -911,7 +901,7 @@ export const ZSurvey = z } if (thankYouCard.subheader) { - const multiLangIssue = validateCardFieldsForAllLanguages( + multiLangIssue = validateCardFieldsForAllLanguages( "subheader", thankYouCard.subheader, languages, @@ -924,7 +914,7 @@ export const ZSurvey = z } if (thankYouCard.buttonLabel) { - const multiLangIssue = validateCardFieldsForAllLanguages( + multiLangIssue = validateCardFieldsForAllLanguages( "thankYouCardButtonLabel", thankYouCard.buttonLabel, languages, @@ -946,7 +936,7 @@ export const ZSurveyUpdateInput = ZSurvey.innerType() updatedAt: z.coerce.date(), }) ) - .superRefine(ZSurvey._def.effect.type === "refinement" ? ZSurvey._def.effect.refinement : () => {}); + .superRefine(ZSurvey._def.effect.type === "refinement" ? ZSurvey._def.effect.refinement : () => undefined); export const ZSurveyInput = z.object({ name: z.string(), @@ -977,12 +967,12 @@ export const ZSurveyInput = z.object({ export type TSurvey = z.infer; -export type TSurveyDates = { +export interface TSurveyDates { createdAt: TSurvey["createdAt"]; updatedAt: TSurvey["updatedAt"]; runOnDate: TSurvey["runOnDate"]; closeOnDate: TSurvey["closeOnDate"]; -}; +} export type TSurveyInput = z.infer; diff --git a/packages/types/surveys/validation.ts b/packages/types/surveys/validation.ts index a4b478839e..c5e8abe145 100644 --- a/packages/types/surveys/validation.ts +++ b/packages/types/surveys/validation.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { TI18nString, TSurveyLanguage, TSurveyQuestion } from "./types"; +import type { TI18nString, TSurveyLanguage, TSurveyQuestion } from "./types"; export const FORBIDDEN_IDS = [ "userId", @@ -30,7 +30,7 @@ const FIELD_TO_LABEL_MAP: Record = { thankYouCardButtonLabel: "button label", }; -export const extractLanguageCodes = (surveyLanguages: TSurveyLanguage[]): string[] => { +const extractLanguageCodes = (surveyLanguages?: TSurveyLanguage[]): string[] => { if (!surveyLanguages) return []; return surveyLanguages.map((surveyLanguage) => surveyLanguage.default ? "default" : surveyLanguage.language.code @@ -43,12 +43,12 @@ const validateLabelForAllLanguages = (label: TI18nString, surveyLanguages: TSurv const languages = !languageCodes.length ? ["default"] : languageCodes; const invalidLanguageCodes = languages.filter( - (language) => !label || !label[language] || label[language].trim() === "" + (language) => !label[language] || label[language].trim() === "" ); return invalidLanguageCodes.map((invalidLanguageCode) => { if (invalidLanguageCode === "default") { - return surveyLanguages.find((lang) => lang.default)?.language.code || "default"; + return surveyLanguages.find((lang) => lang.default)?.language.code ?? "default"; } return invalidLanguageCode; @@ -60,10 +60,10 @@ export const validateQuestionLabels = ( fieldLabel: TI18nString, languages: TSurveyLanguage[], questionIndex: number, - skipArticle: boolean = false + skipArticle = false ): z.IssueData | null => { const invalidLanguageCodes = validateLabelForAllLanguages(fieldLabel, languages); - const isDefaultOnly = invalidLanguageCodes?.length === 1 && invalidLanguageCodes[0] === "default"; + const isDefaultOnly = invalidLanguageCodes.length === 1 && invalidLanguageCodes[0] === "default"; const messagePrefix = skipArticle ? "" : "The "; const messageField = FIELD_TO_LABEL_MAP[field] ? FIELD_TO_LABEL_MAP[field] : field; @@ -72,7 +72,7 @@ export const validateQuestionLabels = ( if (invalidLanguageCodes.length) { return { code: z.ZodIssueCode.custom, - message: `${messagePrefix}${messageField} in question ${questionIndex + 1}${messageSuffix}`, + message: `${messagePrefix}${messageField} in question ${String(questionIndex + 1)}${messageSuffix}`, path: ["questions", questionIndex, field], params: isDefaultOnly ? undefined : { invalidLanguageCodes }, }; @@ -86,10 +86,10 @@ export const validateCardFieldsForAllLanguages = ( fieldLabel: TI18nString, languages: TSurveyLanguage[], cardType: "welcome" | "thankYou", - skipArticle: boolean = false + skipArticle = false ): z.IssueData | null => { const invalidLanguageCodes = validateLabelForAllLanguages(fieldLabel, languages); - const isDefaultOnly = invalidLanguageCodes?.length === 1 && invalidLanguageCodes[0] === "default"; + const isDefaultOnly = invalidLanguageCodes.length === 1 && invalidLanguageCodes[0] === "default"; const messagePrefix = skipArticle ? "" : "The "; const messageField = FIELD_TO_LABEL_MAP[field] ? FIELD_TO_LABEL_MAP[field] : field; @@ -121,7 +121,7 @@ export const findLanguageCodesForDuplicateLabels = ( const duplicateLabels = new Set(); for (const language of languagesToCheck) { - const labelTexts = labels.map((label) => label[language]?.trim()).filter(Boolean); + const labelTexts = labels.map((label) => label[language].trim()).filter(Boolean); const uniqueLabels = new Set(labelTexts); if (uniqueLabels.size !== labelTexts.length) { @@ -136,15 +136,15 @@ export const findLanguageCodesForDuplicateLabels = ( export const findQuestionsWithCyclicLogic = (questions: TSurveyQuestion[]): string[] => { const visited: Record = {}; const recStack: Record = {}; - const cyclicQuestions: Set = new Set(); + const cyclicQuestions = new Set(); const checkForCyclicLogic = (questionId: string): boolean => { if (!visited[questionId]) { visited[questionId] = true; recStack[questionId] = true; - const question = questions.find((question) => question.id === questionId); - if (question && question.logic && question.logic.length > 0) { + const question = questions.find((ques) => ques.id === questionId); + if (question?.logic && question.logic.length > 0) { for (const logic of question.logic) { const destination = logic.destination; if (!destination) { @@ -161,8 +161,8 @@ export const findQuestionsWithCyclicLogic = (questions: TSurveyQuestion[]): stri } } else { // Handle default behavior - const nextQuestionIndex = questions.findIndex((question) => question.id === questionId) + 1; - const nextQuestion = questions[nextQuestionIndex]; + const nextQuestionIndex = questions.findIndex((ques) => ques.id === questionId) + 1; + const nextQuestion = questions[nextQuestionIndex] as TSurveyQuestion | undefined; if (nextQuestion && !visited[nextQuestion.id] && checkForCyclicLogic(nextQuestion.id)) { return true; } diff --git a/packages/types/templates.ts b/packages/types/templates.ts index 6a6e13bd3d..1cf5218357 100644 --- a/packages/types/templates.ts +++ b/packages/types/templates.ts @@ -1,5 +1,9 @@ import { z } from "zod"; -import { ZLegacySurveyQuestions, ZLegacySurveyThankYouCard, ZLegacySurveyWelcomeCard } from "./legacySurveys"; +import { + ZLegacySurveyQuestions, + ZLegacySurveyThankYouCard, + ZLegacySurveyWelcomeCard, +} from "./legacy-surveys"; import { ZProductConfigChannel, ZProductConfigIndustry } from "./product"; import { ZSurveyHiddenFields, diff --git a/packages/types/user.ts b/packages/types/user.ts index c99c8cfa26..1603737c83 100644 --- a/packages/types/user.ts +++ b/packages/types/user.ts @@ -1,4 +1,4 @@ -import z from "zod"; +import { z } from "zod"; const ZRole = z.enum(["project_manager", "engineer", "founder", "marketing_specialist", "other"]); diff --git a/packages/types/weeklySummary.ts b/packages/types/weekly-summary.ts similarity index 98% rename from packages/types/weeklySummary.ts rename to packages/types/weekly-summary.ts index 5f0303ab0b..d8412ed188 100644 --- a/packages/types/weeklySummary.ts +++ b/packages/types/weekly-summary.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZAttributeClass } from "./attributeClasses"; +import { ZAttributeClass } from "./attribute-classes"; import { ZResponseData } from "./responses"; import { ZSurveyHiddenFields, ZSurveyQuestion, ZSurveyQuestionType, ZSurveyStatus } from "./surveys/types"; import { ZUserNotificationSettings } from "./user"; diff --git a/packages/ui/BasicAddFilterModal/index.tsx b/packages/ui/BasicAddFilterModal/index.tsx index da99a77c88..56a3792a13 100644 --- a/packages/ui/BasicAddFilterModal/index.tsx +++ b/packages/ui/BasicAddFilterModal/index.tsx @@ -2,7 +2,7 @@ import { FingerprintIcon, TagIcon } from "lucide-react"; import { useMemo, useState } from "react"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TBaseFilter } from "@formbricks/types/segment"; import { Input } from "../Input"; import { Modal } from "../Modal"; diff --git a/packages/ui/BasicSegmentEditor/components/AttributeSegmentFilter.tsx b/packages/ui/BasicSegmentEditor/components/AttributeSegmentFilter.tsx index c1e5d5b5b7..3c2cc6f25d 100644 --- a/packages/ui/BasicSegmentEditor/components/AttributeSegmentFilter.tsx +++ b/packages/ui/BasicSegmentEditor/components/AttributeSegmentFilter.tsx @@ -9,7 +9,7 @@ import { updateOperatorInFilter, } from "@formbricks/lib/segment/utils"; import { isCapitalized } from "@formbricks/lib/utils/strings"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { ARITHMETIC_OPERATORS, ATTRIBUTE_OPERATORS, diff --git a/packages/ui/BasicSegmentEditor/components/BasicSegmentFilter.tsx b/packages/ui/BasicSegmentEditor/components/BasicSegmentFilter.tsx index 922c124d25..2029a93adf 100644 --- a/packages/ui/BasicSegmentEditor/components/BasicSegmentFilter.tsx +++ b/packages/ui/BasicSegmentEditor/components/BasicSegmentFilter.tsx @@ -1,6 +1,6 @@ import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { updateFilterValue } from "@formbricks/lib/segment/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSegment, TSegmentAttributeFilter, diff --git a/packages/ui/BasicSegmentEditor/index.tsx b/packages/ui/BasicSegmentEditor/index.tsx index 260ab63f20..321d97aff4 100644 --- a/packages/ui/BasicSegmentEditor/index.tsx +++ b/packages/ui/BasicSegmentEditor/index.tsx @@ -1,6 +1,6 @@ import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { deleteResource, isResourceFilter, moveResource } from "@formbricks/lib/segment/utils"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TBaseFilters, TSegment } from "@formbricks/types/segment"; import { BasicSegmentFilter } from "./components/BasicSegmentFilter"; diff --git a/packages/ui/QuestionFormInput/components/RecallItemSelect.tsx b/packages/ui/QuestionFormInput/components/RecallItemSelect.tsx index 3fdf182950..c487ffba25 100644 --- a/packages/ui/QuestionFormInput/components/RecallItemSelect.tsx +++ b/packages/ui/QuestionFormInput/components/RecallItemSelect.tsx @@ -13,7 +13,7 @@ import { } from "lucide-react"; import { useMemo, useState } from "react"; import { replaceRecallInfoWithUnderline } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TSurvey, TSurveyHiddenFields, diff --git a/packages/ui/QuestionFormInput/index.tsx b/packages/ui/QuestionFormInput/index.tsx index d0a0299148..ce728d2e35 100644 --- a/packages/ui/QuestionFormInput/index.tsx +++ b/packages/ui/QuestionFormInput/index.tsx @@ -16,7 +16,7 @@ import { recallToHeadline, replaceRecallInfoWithUnderline, } from "@formbricks/lib/utils/recall"; -import { TAttributeClass } from "@formbricks/types/attributeClasses"; +import { TAttributeClass } from "@formbricks/types/attribute-classes"; import { TI18nString, TSurvey, diff --git a/packages/ui/Survey/index.tsx b/packages/ui/Survey/index.tsx index eb964c6cbe..7f4eb9236c 100644 --- a/packages/ui/Survey/index.tsx +++ b/packages/ui/Survey/index.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useMemo } from "react"; -import { SurveyInlineProps, SurveyModalProps } from "@formbricks/types/formbricksSurveys"; +import { SurveyInlineProps, SurveyModalProps } from "@formbricks/types/formbricks-surveys"; import { loadSurveyScript } from "./lib/loadScript"; const createContainerId = () => `formbricks-survey-container`; diff --git a/packages/ui/organisms/NoCodeActionForm/components/CssSelector.tsx b/packages/ui/organisms/NoCodeActionForm/components/CssSelector.tsx index 757eee8bdd..1166008158 100644 --- a/packages/ui/organisms/NoCodeActionForm/components/CssSelector.tsx +++ b/packages/ui/organisms/NoCodeActionForm/components/CssSelector.tsx @@ -1,5 +1,5 @@ import { UseFormReturn } from "react-hook-form"; -import { TActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClassInput } from "@formbricks/types/action-classes"; import { AdvancedOptionToggle } from "../../../AdvancedOptionToggle"; import { FormControl, FormField, FormItem } from "../../../Form"; import { Input } from "../../../Input"; diff --git a/packages/ui/organisms/NoCodeActionForm/components/InnerHtmlSelector.tsx b/packages/ui/organisms/NoCodeActionForm/components/InnerHtmlSelector.tsx index 385dcf032b..bdb2bc30a4 100644 --- a/packages/ui/organisms/NoCodeActionForm/components/InnerHtmlSelector.tsx +++ b/packages/ui/organisms/NoCodeActionForm/components/InnerHtmlSelector.tsx @@ -1,5 +1,5 @@ import { UseFormReturn } from "react-hook-form"; -import { TActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClassInput } from "@formbricks/types/action-classes"; import { AdvancedOptionToggle } from "../../../AdvancedOptionToggle"; import { FormControl, FormField, FormItem } from "../../../Form"; import { Input } from "../../../Input"; diff --git a/packages/ui/organisms/NoCodeActionForm/components/PageUrlSelector.tsx b/packages/ui/organisms/NoCodeActionForm/components/PageUrlSelector.tsx index 5577081354..5554af7d12 100644 --- a/packages/ui/organisms/NoCodeActionForm/components/PageUrlSelector.tsx +++ b/packages/ui/organisms/NoCodeActionForm/components/PageUrlSelector.tsx @@ -5,7 +5,7 @@ import { UseFormReturn } from "react-hook-form"; import toast from "react-hot-toast"; import { cn } from "@formbricks/lib/cn"; import { testURLmatch } from "@formbricks/lib/utils/testUrlMatch"; -import { TActionClassInput, TActionClassPageUrlRule } from "@formbricks/types/actionClasses"; +import { TActionClassInput, TActionClassPageUrlRule } from "@formbricks/types/action-classes"; import { Alert, AlertDescription, AlertTitle } from "../../../Alert"; import { Button } from "../../../Button"; import { FormControl, FormField, FormItem } from "../../../Form"; diff --git a/packages/ui/organisms/NoCodeActionForm/index.tsx b/packages/ui/organisms/NoCodeActionForm/index.tsx index e6a1f46102..abaeb25e34 100644 --- a/packages/ui/organisms/NoCodeActionForm/index.tsx +++ b/packages/ui/organisms/NoCodeActionForm/index.tsx @@ -1,6 +1,6 @@ import { InfoIcon } from "lucide-react"; import { UseFormReturn } from "react-hook-form"; -import { TActionClassInput } from "@formbricks/types/actionClasses"; +import { TActionClassInput } from "@formbricks/types/action-classes"; import { Alert, AlertDescription, AlertTitle } from "../../Alert"; import { FormControl, FormError, FormField, FormItem } from "../../Form"; import { Label } from "../../Label";