@survicate/survicate-web-package 27.1.28-npm → 27.2.0-npm

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "27.1.28-npm",
2
+ "version": "27.2.0-npm",
3
3
  "name": "@survicate/survicate-web-package",
4
4
  "description": "Survicate Web Package",
5
5
  "author": {
@@ -19,7 +19,7 @@ export enum SurveyType {
19
19
  }
20
20
 
21
21
  export interface ShowSurveyOptions {
22
- forceDisplay?: true;
22
+ forceDisplay?: boolean;
23
23
  displayMethod?: AppearMethodApi;
24
24
  displayOptions?: {
25
25
  delay?: number;
@@ -43,11 +43,31 @@ export enum ApiEvents {
43
43
  export interface ConfigModel {
44
44
  disableTargeting?: true;
45
45
  disableSensitiveDataPersistence?: boolean;
46
+ hiddenSurveys?: string[];
46
47
  nonce?: string;
47
48
  traits?: {[key: string]: any};
48
49
  workspaceKey: string;
49
50
  }
50
51
 
52
+ export enum SurveyQuestionAnswerType {
53
+ single = 'single',
54
+ text = 'text',
55
+ rating = 'rating',
56
+ ranking = 'ranking',
57
+ numericalScale = 'numerical_scale',
58
+ customerSatisfaction = 'csat'
59
+ }
60
+
61
+ export enum SurveyNpsAnswerType {
62
+ nps = 'nps',
63
+ }
64
+
65
+ export interface SurveyPointInfo {
66
+ pointId: number;
67
+ answerType: SurveyQuestionAnswerType | SurveyNpsAnswerType,
68
+ answers?: Array<{id: number}>;
69
+ }
70
+
51
71
  export interface SurveyApi {
52
72
  addEventListener: (event: ApiEvents, callback: CallbackTypes) => number | void;
53
73
  destroyVisitor: (callback?: () => void) => void;
@@ -74,6 +94,8 @@ declare const Survicate: {
74
94
  retarget: () => void;
75
95
  setVisitorTraits: (attributes: VisitorAttributes) => void;
76
96
  showSurvey: (id: string, options: ShowSurveyOptions) => boolean;
97
+ submitAnswer: (params: { surveyId: string; pointId: number; answerId: number; answer: string | number}) => void;
98
+ getSurveyPointsMetadata: (surveyId: string) => SurveyPointInfo[] | null;
77
99
  traits?: VisitorAttributes;
78
100
  };
79
101