// ----------------------------------------------------------------------------- // Enum Typedefs // ----------------------------------------------------------------------------- /** * @typedef {"greaterThan" | "equals" | "smallerThan"} CompareString */ /** * @typedef {"mobileInvitation" | "code"} FormType */ /** * @typedef {"slide" | "numbersSquare" | "gradingSlider" | "gradingDropdown" | "stars" | "emoticons" | "numbers" | "smilies" | "bars"} RatingViewType */ // ----------------------------------------------------------------------------- // Model Typedefs // ----------------------------------------------------------------------------- /** * JWT Access Token to be used to access the APIe * @typedef {Object} AccessTokenWrapper * @property {string} accessToken JWT Access Token to be used to access the API */ /** * @typedef {Object} ComponentCheckbox * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} label Component label * @property {string[]} options Maximum number of characters * @property {string} [description] Component description */ /** * @typedef {Object} ComponentDropdown * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} placeholder Component placeholder * @property {string} label Component label * @property {string[]} options Maximum number of characters * @property {string} [description] Component description */ /** * @typedef {Object} ComponentGrading * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} label Component label * @property {RatingViewType} ratingViewType Rating View Type * @property {string} [description] Component description */ /** * @typedef {Object} ComponentGrading0To10 * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} label Component label * @property {RatingViewType} ratingViewType Rating View Type * @property {string} [description] Component description */ /** * @typedef {Object} ComponentGrading1To10 * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} label Component label * @property {RatingViewType} ratingViewType Rating View Type * @property {string} [description] Component description */ /** * @typedef {Object} ComponentImage * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {Image} [imageObject] Image Object uploaded to Medallia, if it's a copy of a previous survey this field doesnt' show up * @property {Image} [uploadedResource] Image Object from a copied survey, it only shows when imageObject is not present */ /** * @typedef {Object} ComponentLabel * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {string} [labelContent] Label Content * @property {number} num_of_lines Label Number of Lines */ /** * @typedef {Object} ComponentNps * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} label Component placeholder * @property {string} [description] Component description * @property {RatingViewType} ratingViewType Rating View Type */ /** * @typedef {Object} ComponentRadioSelector * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} label Component label * @property {string[]} options Maximum number of characters * @property {string} [description] Component description */ /** * @typedef {Object} ComponentTextArea * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} placeholder Component placeholder * @property {string} label Component placeholder * @property {number} num_of_lines Number of lines, string parameter though (-‸ლ) * @property {string} [description] Component description */ /** * @typedef {Object} ComponentTextInput * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {boolean} required Component required * @property {string} placeholder Component placeholder * @property {string} label Component label * @property {number} max_chars Maximum number of characters * @property {string} [description] Component description */ /** * Configuration main object, including forms * @typedef {Object} Configuration * @property {number} propertyId Account id * @property {string} feedbackSubmitUrl url * @property {Form[]} forms Definition and configuration of forms that were created in the command center */ /** * @typedef {Object} DynamicData * @property {number} index Component index * @property {number} id Component id * @property {boolean} required Component required * @property {string} component Component type * @property {string} unique_name Component unique name * @property {string} placeholder Component placeholder * @property {string} label Component placeholder * @property {string} [description] Component description * @property {string[]} [options] Options available if required * @property {Image} [imageObject] Image if required */ /** * Feedback main object with survey's results * @typedef {Object} Feedback * @property {number} formId The submitted form id (from the configuration). * @property {FeedbackData} dynamicData Survey Feedback Data */ /** * @typedef {Object} FeedbackCheckbox * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {number[]} value Checkbox selected value * @property {string} type Component feedback type */ /** * Object that will hold the form pages and custom parameters. * @typedef {Object} FeedbackData * @property {*} [customParams] List of survey's pages results * @property {FeedbackPage[]} pages List of survey's pages results */ /** * @typedef {Object} FeedbackDropdown * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {number} value Dropdown selected value * @property {string} type Component feedback type */ /** * @typedef {Object} FeedbackGrading * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {number} value Grading selected value * @property {string} type Component feedback type */ /** * @typedef {Object} FeedbackGrading0To10 * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {number} value Grading selected value * @property {string} type Component feedback type */ /** * @typedef {Object} FeedbackGrading1To10 * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {number} value Grading selected value * @property {string} type Component feedback type */ /** * @typedef {Object} FeedbackNps * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {number} value NPS selected value * @property {string} type Component feedback type */ /** * Object that will hold the form page * @typedef {Object} FeedbackPage * @property {FeedbackUnion[]} components List of survey's pages results */ /** * @typedef {Object} FeedbackRadioSelector * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {number} value Radio Selected Value * @property {string} type Component feedback type */ /** * @typedef {Object} FeedbackTextArea * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {string} value Text Area Content * @property {string} type Component feedback type */ /** * @typedef {Object} FeedbackTextInput * @property {number} index Component index * @property {number} id Component id * @property {string} unique_name Unique name * @property {string} value Text Area Content * @property {string} type Component feedback type */ /** * @typedef {Object} Form * @property {number} formId Form Identifier * @property {string} name Form name * @property {string} title Form title * @property {FormType} formType Form type * @property {InviteData} [inviteData] Invitation data * @property {TriggerData} [triggerData] Invitation trigger conditions * @property {FormJson} formJson Wrapper around form data */ /** * @typedef {Object} FormJson * @property {Page[]} pages Form Page */ /** * @typedef {Object} Image * @property {string} name Image Name * @property {string} url Image Url */ /** * @typedef {Object} InviteData * @property {string} invitationHeadline Invitation Headline * @property {string} invitationText Invitation Text * @property {string} provideButtonText Provide feedback button text * @property {string} declineButtonText Decline provide feedback button text * @property {string} laterButtonText Provide feedback later button text */ /** * @typedef {Object} NumberOfAppSession * @property {string} number Number of app sessions * @property {CompareString} compareString Compare String */ /** * @typedef {Object} NumberOfDays * @property {string} days Don't invite a visitor who submitted feedback in the past x days */ /** * @typedef {Object} Page * @property {string} name Page name * @property {number} index Page index * @property {ComponentUnion[]} dynamicData */ /** * @typedef {Object} PercentageOfSessions * @property {string} prec Don't invite a visitor who submitted feedback in the past x days */ /** * @typedef {Object} TimeInForeground * @property {string} time Time in Foreground, in seconds * @property {CompareString} compareString Compare String */ /** * @typedef {Object} TriggerData * @property {NumberOfAppSession} [numberOfAppSession] Number of App Sessions to show the invite, with compare string * @property {TimeInForeground} [timeInForeground] App Time in foreground in seconds to show the invite, with compare string * @property {string[]} [mobileappVersion] Mobile App Versions * @property {NumberOfDays} [submitted] Don't invite a visitor who submitted feedback in the past x days * @property {NumberOfDays} [declined] Don't invite a visitor who declined an invitation in the past x days * @property {string[]} [mobileosVersion] Mobile App Versions * @property {PercentageOfSessions} [percentageOfSessions] Invite to this percentage of sessions * @property {string} [genericRule] Set of generic rules creates in the invitation settings */ // ----------------------------------------------------------------------------- // Union Typedefs // ----------------------------------------------------------------------------- /** * Represents the question or fields to be filled by the user * @typedef {(ComponentLabel & { component: "label" } | ComponentImage & { component: "image" } | ComponentNps & { component: "nps" } | ComponentTextArea & { component: "textArea" } | ComponentTextInput & { component: "textInput" } | ComponentRadioSelector & { component: "radio" } | ComponentCheckbox & { component: "checkbox" } | ComponentDropdown & { component: "select" } | ComponentGrading & { component: "grading" } | ComponentGrading0To10 & { component: "grading0to10" } | ComponentGrading1To10 & { component: "grading1to10" })} ComponentUnion */ /** * Represents the component or fields to be filled by the user * @typedef {(FeedbackNps & { component: "nps" } | FeedbackTextArea & { component: "textArea" } | FeedbackTextInput & { component: "textInput" } | FeedbackRadioSelector & { component: "radio" } | FeedbackCheckbox & { component: "checkbox" } | FeedbackDropdown & { component: "select" } | FeedbackGrading & { component: "grading" } | FeedbackGrading0To10 & { component: "grading0to10" } | FeedbackGrading1To10 & { component: "grading1to10" })} FeedbackUnion */