remove duplicated question types, update js sdk to 0.1.11

This commit is contained in:
Matthias Nannt
2023-04-19 16:03:26 +02:00
parent 8352d05d04
commit d835e78d92
6 changed files with 8 additions and 69 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@formbricks/js",
"version": "0.1.10",
"version": "0.1.11",
"description": "Formbricks-js allows you to connect your app to Formbricks, display surveys and trigger events.",
"keywords": [
"Formbricks",

View File

@@ -1,7 +1,7 @@
import { h } from "preact";
import { useEffect, useState } from "preact/hooks";
import { cn } from "../lib/utils";
import type { MultipleChoiceMultiQuestion } from "@formbricks/types/js";
import type { MultipleChoiceMultiQuestion } from "@formbricks/types/questions";
import Headline from "./Headline";
import Subheader from "./Subheader";

View File

@@ -1,7 +1,7 @@
import { h } from "preact";
import { useState } from "preact/hooks";
import { cn } from "../lib/utils";
import type { MultipleChoiceSingleQuestion } from "@formbricks/types/js";
import type { MultipleChoiceSingleQuestion } from "@formbricks/types/questions";
import Headline from "./Headline";
import Subheader from "./Subheader";

View File

@@ -1,5 +1,5 @@
import type { OpenTextQuestion } from "@formbricks/types/questions";
import { h } from "preact";
import type { OpenTextQuestion, Question } from "@formbricks/types/js";
import Headline from "./Headline";
import Subheader from "./Subheader";

View File

@@ -1,5 +1,5 @@
import { h } from "preact";
import type { Question } from "@formbricks/types/js";
import type { Question } from "@formbricks/types/questions";
import OpenTextQuestion from "./OpenTextQuestion";
import MultipleChoiceSingleQuestion from "./MultipleChoiceSingleQuestion";
import MultipleChoiceMultiQuestion from "./MultipleChoiceMultiQuestion";

View File

@@ -1,3 +1,6 @@
import { Question } from "./questions";
import { ThankYouCard } from "./surveys";
export interface ResponseCreateRequest {
surveyId: string;
personId: string;
@@ -73,70 +76,6 @@ export interface Survey {
thankYouCard: ThankYouCard;
}
export interface ThankYouCard {
enabled: boolean;
headline?: string;
subheader?: string;
}
export interface ThankYouCard {
enabled: boolean;
headline?: string;
subheader?: string;
}
export type Question =
| OpenTextQuestion
| MultipleChoiceSingleQuestion
| MultipleChoiceMultiQuestion
| NPSQuestion;
export interface OpenTextQuestion {
id: string;
type: "openText";
headline: string;
subheader?: string;
placeholder?: string;
buttonLabel?: string;
required: boolean;
}
export interface MultipleChoiceSingleQuestion {
id: string;
type: "multipleChoiceSingle";
headline: string;
subheader?: string;
required: boolean;
buttonLabel?: string;
choices?: Choice[];
}
export interface MultipleChoiceMultiQuestion {
id: string;
type: "multipleChoiceMulti";
headline: string;
subheader?: string;
required: boolean;
buttonLabel?: string;
choices?: Choice[];
}
export interface NPSQuestion {
id: string;
type: "nps";
headline: string;
subheader?: string;
required: boolean;
buttonLabel?: string;
lowerLabel: string;
upperLabel: string;
}
export interface Choice {
id: string;
label: string;
}
export interface Trigger {
id: string;
eventClass: {