@encatch/schema 0.1.19 → 0.1.21

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.
@@ -1,6 +1,6 @@
1
1
  export { questionTypeSchema, validationRuleTypeSchema, validationRuleSchema, visibilityConditionSchema, sectionSchema, questionStatusSchema, ratingDisplayStyleSchema, ratingRepresentationSizeSchema, multipleChoiceDisplayStyleSchema, multipleChoiceMultipleDisplayStyleSchema, choiceOrderOptionSchema, questionSchema, ratingQuestionSchema, annotationQuestionSchema, questionOptionSchema, nestedOptionSchema, multipleChoiceSingleQuestionSchema, multipleChoiceMultipleQuestionSchema, npsQuestionSchema, shortAnswerQuestionSchema, longAnswerQuestionSchema, nestedDropdownQuestionSchema, combinedQuestionSchema, QuestionTypes, ValidationRuleTypes, VisibilityConditionOperators, QuestionStatuses, RatingDisplayStyles, RatingRepresentationSizes, MultipleChoiceDisplayStyles, MultipleChoiceMultipleDisplayStyles, ChoiceOrderOptions, type QuestionType, type ValidationRule, type VisibilityCondition, type QuestionStatus, type Question, type RatingDisplayStyle, type RatingRepresentationSize, type RatingQuestion, type AnnotationQuestion, type QuestionOption, type NestedOption, type MultipleChoiceDisplayStyle, type MultipleChoiceSingleQuestion, type MultipleChoiceMultipleDisplayStyle, type MultipleChoiceMultipleQuestion, type NpsQuestion, type ShortAnswerQuestion, type LongAnswerQuestion, type ChoiceOrderOption, type NestedDropdownQuestion, type Section, type CombinedQuestion, } from "./schemas/fields/field-schema";
2
2
  export { SimpleAnswerSchema, ChoiceAnswerSchema, MultipleChoiceAnswerSchema, ScaleAnswerSchema, ContinuousSumAnswerSchema, RankingAnswerSchema, TextAnswerSchema, AnswerSchema, type SimpleAnswer, type ChoiceAnswer, type MultipleChoiceAnswer, type ScaleAnswer, type ContinuousSumAnswer, type RankingAnswer, type TextAnswer, type Answer, } from "./schemas/fields/answer-schema";
3
- export { surveyTypeSchema, yesNoSchema, recurringUnitSchema, frequencyAndSchedulingPropertiesSchema, externalPublishingPropertiesSchema, publicationStatusSchema, feedbackConfigurationSchema, SurveyTypes, YesNoValues, RecurringUnits, PublicationStatuses, durationSchema, type SurveyType, type YesNo, type RecurringUnit, type PublicationStatus, type Duration, type FeedbackConfiguration, type FrequencyAndSchedulingProperties, type ExternalPublishingProperties, } from "./schemas/fields/form-schema";
3
+ export { surveyTypeSchema, yesNoSchema, recurringUnitSchema, frequencyAndSchedulingPropertiesSchema, externalPublishingPropertiesSchema, publicationStatusSchema, feedbackConfigurationSchema, SurveyTypes, YesNoValues, RecurringUnits, PublicationStatuses, type SurveyType, type YesNo, type RecurringUnit, type PublicationStatus, type FeedbackConfiguration, type FrequencyAndSchedulingProperties, type ExternalPublishingProperties, } from "./schemas/fields/form-schema";
4
4
  export { otherConfigurationPropertiesSchema, welcomeScreenPropertiesSchema, endScreenPropertiesSchema, appearancePropertiesSchema, formPropertiesSchema, type FormProperties, type OtherConfigurationProperties, type WelcomeScreenProperties, type EndScreenProperties, type AppearanceProperties, } from "./schemas/fields/form-properties-schema";
5
5
  export { dismissBehaviorSchema, WelcomeScreenFieldsSchema, EndScreenFieldsSchema, WelcomeFieldsTranslationSchema, EndFieldsTranslationSchema, OtherFieldsSchema, LanguageFieldSchema, LanguagesSchema, OtherFieldsTranslationSchema, DismissBehaviors, type WelcomeFields, type EndFields, type WelcomeFieldsTranslation, type EndFieldsTranslation, type OtherFields, type OtherFieldsTranslation, type LanguageField, type Languages, } from "./schemas/fields/other-screen-schema";
6
6
  export { positionSchema, themeModeSchema, featureSettingsSchema, themeColorsSchema, themesSchema, themeConfigurationSchema, Positions, ThemeModes, type Position, type FeatureSettings, type ThemeColors, type Themes, type ThemeMode, type ThemeConfiguration, } from "./schemas/fields/theme-schema";
@@ -2,10 +2,6 @@ import { z } from "zod";
2
2
  export declare const feedbackConfigurationItemSchema: z.ZodObject<{
3
3
  feedbackConfigurationId: z.ZodString;
4
4
  feedbackTitle: z.ZodString;
5
- duration: z.ZodObject<{
6
- from: z.ZodString;
7
- to: z.ZodString;
8
- }, z.core.$strip>;
9
5
  triggerProperties: z.ZodObject<{
10
6
  isAuto: z.ZodBoolean;
11
7
  isManual: z.ZodBoolean;
@@ -1244,10 +1240,6 @@ export declare const fetchConfigurationListResponseSchema: z.ZodObject<{
1244
1240
  feedbackConfiguration: z.ZodArray<z.ZodObject<{
1245
1241
  feedbackConfigurationId: z.ZodString;
1246
1242
  feedbackTitle: z.ZodString;
1247
- duration: z.ZodObject<{
1248
- from: z.ZodString;
1249
- to: z.ZodString;
1250
- }, z.core.$strip>;
1251
1243
  triggerProperties: z.ZodObject<{
1252
1244
  isAuto: z.ZodBoolean;
1253
1245
  isManual: z.ZodBoolean;
@@ -147,10 +147,6 @@ export declare const formPropertiesSchema: z.ZodObject<{
147
147
  feedback_configuration: z.ZodObject<{
148
148
  form_title: z.ZodString;
149
149
  form_description: z.ZodString;
150
- duration: z.ZodObject<{
151
- from: z.ZodString;
152
- to: z.ZodString;
153
- }, z.core.$strip>;
154
150
  is_published: z.ZodEnum<{
155
151
  D: "D";
156
152
  P: "P";
@@ -637,66 +633,63 @@ export declare const formPropertiesSchema: z.ZodObject<{
637
633
  label: z.ZodString;
638
634
  isFixed: z.ZodDefault<z.ZodBoolean>;
639
635
  }, z.core.$strip>>;
640
- translations: z.ZodObject<{
641
- defaultLanguage: z.ZodString;
642
- questions: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
643
- type: z.ZodLiteral<"rating">;
644
- title: z.ZodString;
645
- description: z.ZodOptional<z.ZodString>;
646
- errorMessage: z.ZodOptional<z.ZodString>;
647
- minLabel: z.ZodOptional<z.ZodString>;
648
- maxLabel: z.ZodOptional<z.ZodString>;
649
- }, z.core.$strip>, z.ZodObject<{
650
- type: z.ZodLiteral<"single_choice">;
651
- title: z.ZodString;
652
- description: z.ZodOptional<z.ZodString>;
653
- errorMessage: z.ZodOptional<z.ZodString>;
654
- placeholder: z.ZodOptional<z.ZodString>;
655
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
656
- type: z.ZodLiteral<"multiple_choice_multiple">;
657
- title: z.ZodString;
658
- description: z.ZodOptional<z.ZodString>;
659
- errorMessage: z.ZodOptional<z.ZodString>;
660
- placeholder: z.ZodOptional<z.ZodString>;
661
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
662
- type: z.ZodLiteral<"nps">;
663
- title: z.ZodString;
664
- description: z.ZodOptional<z.ZodString>;
665
- errorMessage: z.ZodOptional<z.ZodString>;
666
- minLabel: z.ZodOptional<z.ZodString>;
667
- maxLabel: z.ZodOptional<z.ZodString>;
668
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
669
- type: z.ZodLiteral<"short_answer">;
670
- title: z.ZodString;
671
- description: z.ZodOptional<z.ZodString>;
672
- errorMessage: z.ZodOptional<z.ZodString>;
673
- placeholder: z.ZodOptional<z.ZodString>;
674
- }, z.core.$strip>, z.ZodObject<{
675
- type: z.ZodLiteral<"long_text">;
676
- title: z.ZodString;
677
- description: z.ZodOptional<z.ZodString>;
678
- errorMessage: z.ZodOptional<z.ZodString>;
679
- placeholder: z.ZodOptional<z.ZodString>;
680
- }, z.core.$strip>, z.ZodObject<{
681
- type: z.ZodLiteral<"nested_selection">;
682
- title: z.ZodString;
683
- description: z.ZodOptional<z.ZodString>;
684
- errorMessage: z.ZodOptional<z.ZodString>;
685
- placeholder: z.ZodOptional<z.ZodString>;
686
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
687
- type: z.ZodLiteral<"annotation">;
688
- title: z.ZodString;
689
- description: z.ZodOptional<z.ZodString>;
690
- errorMessage: z.ZodOptional<z.ZodString>;
691
- annotationText: z.ZodOptional<z.ZodString>;
692
- noAnnotationText: z.ZodOptional<z.ZodString>;
693
- }, z.core.$strip>]>>>;
694
- }, z.core.$strip>;
636
+ translations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
637
+ type: z.ZodLiteral<"rating">;
638
+ title: z.ZodString;
639
+ description: z.ZodOptional<z.ZodString>;
640
+ errorMessage: z.ZodOptional<z.ZodString>;
641
+ minLabel: z.ZodOptional<z.ZodString>;
642
+ maxLabel: z.ZodOptional<z.ZodString>;
643
+ }, z.core.$strip>, z.ZodObject<{
644
+ type: z.ZodLiteral<"single_choice">;
645
+ title: z.ZodString;
646
+ description: z.ZodOptional<z.ZodString>;
647
+ errorMessage: z.ZodOptional<z.ZodString>;
648
+ placeholder: z.ZodOptional<z.ZodString>;
649
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
650
+ type: z.ZodLiteral<"multiple_choice_multiple">;
651
+ title: z.ZodString;
652
+ description: z.ZodOptional<z.ZodString>;
653
+ errorMessage: z.ZodOptional<z.ZodString>;
654
+ placeholder: z.ZodOptional<z.ZodString>;
655
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
656
+ type: z.ZodLiteral<"nps">;
657
+ title: z.ZodString;
658
+ description: z.ZodOptional<z.ZodString>;
659
+ errorMessage: z.ZodOptional<z.ZodString>;
660
+ minLabel: z.ZodOptional<z.ZodString>;
661
+ maxLabel: z.ZodOptional<z.ZodString>;
662
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
663
+ type: z.ZodLiteral<"short_answer">;
664
+ title: z.ZodString;
665
+ description: z.ZodOptional<z.ZodString>;
666
+ errorMessage: z.ZodOptional<z.ZodString>;
667
+ placeholder: z.ZodOptional<z.ZodString>;
668
+ }, z.core.$strip>, z.ZodObject<{
669
+ type: z.ZodLiteral<"long_text">;
670
+ title: z.ZodString;
671
+ description: z.ZodOptional<z.ZodString>;
672
+ errorMessage: z.ZodOptional<z.ZodString>;
673
+ placeholder: z.ZodOptional<z.ZodString>;
674
+ }, z.core.$strip>, z.ZodObject<{
675
+ type: z.ZodLiteral<"nested_selection">;
676
+ title: z.ZodString;
677
+ description: z.ZodOptional<z.ZodString>;
678
+ errorMessage: z.ZodOptional<z.ZodString>;
679
+ placeholder: z.ZodOptional<z.ZodString>;
680
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
681
+ type: z.ZodLiteral<"annotation">;
682
+ title: z.ZodString;
683
+ description: z.ZodOptional<z.ZodString>;
684
+ errorMessage: z.ZodOptional<z.ZodString>;
685
+ annotationText: z.ZodOptional<z.ZodString>;
686
+ noAnnotationText: z.ZodOptional<z.ZodString>;
687
+ }, z.core.$strip>]>>>;
695
688
  }, z.core.$strip>;
696
689
  frequency_and_scheduling_properties: z.ZodObject<{
697
690
  surveyType: z.ZodEnum<{
691
+ S: "S";
698
692
  R: "R";
699
- O: "O";
700
693
  }>;
701
694
  showOnce: z.ZodEnum<{
702
695
  Y: "Y";
@@ -1,11 +1,11 @@
1
1
  import { z } from "zod";
2
2
  export declare const surveyTypeSchema: z.ZodEnum<{
3
+ S: "S";
3
4
  R: "R";
4
- O: "O";
5
5
  }>;
6
6
  export declare const SurveyTypes: {
7
7
  readonly RECURRING: "R";
8
- readonly ONE_TIME: "O";
8
+ readonly ONE_TIME: "S";
9
9
  };
10
10
  export declare const yesNoSchema: z.ZodEnum<{
11
11
  Y: "Y";
@@ -33,8 +33,8 @@ export declare const RecurringUnits: {
33
33
  };
34
34
  export declare const frequencyAndSchedulingPropertiesSchema: z.ZodObject<{
35
35
  surveyType: z.ZodEnum<{
36
+ S: "S";
36
37
  R: "R";
37
- O: "O";
38
38
  }>;
39
39
  showOnce: z.ZodEnum<{
40
40
  Y: "Y";
@@ -67,17 +67,9 @@ export declare const PublicationStatuses: {
67
67
  readonly DRAFT: "D";
68
68
  readonly ARCHIVED: "A";
69
69
  };
70
- export declare const durationSchema: z.ZodObject<{
71
- from: z.ZodString;
72
- to: z.ZodString;
73
- }, z.core.$strip>;
74
70
  export declare const feedbackConfigurationSchema: z.ZodObject<{
75
71
  form_title: z.ZodString;
76
72
  form_description: z.ZodString;
77
- duration: z.ZodObject<{
78
- from: z.ZodString;
79
- to: z.ZodString;
80
- }, z.core.$strip>;
81
73
  is_published: z.ZodEnum<{
82
74
  D: "D";
83
75
  P: "P";
@@ -88,7 +80,6 @@ export type SurveyType = z.infer<typeof surveyTypeSchema>;
88
80
  export type YesNo = z.infer<typeof yesNoSchema>;
89
81
  export type RecurringUnit = z.infer<typeof recurringUnitSchema>;
90
82
  export type PublicationStatus = z.infer<typeof publicationStatusSchema>;
91
- export type Duration = z.infer<typeof durationSchema>;
92
83
  export type FeedbackConfiguration = z.infer<typeof feedbackConfigurationSchema>;
93
84
  export type FrequencyAndSchedulingProperties = z.infer<typeof frequencyAndSchedulingPropertiesSchema>;
94
85
  export type ExternalPublishingProperties = z.infer<typeof externalPublishingPropertiesSchema>;
@@ -216,61 +216,58 @@ export declare const questionCentricTranslationsSchema: z.ZodRecord<z.ZodString,
216
216
  annotationText: z.ZodOptional<z.ZodString>;
217
217
  noAnnotationText: z.ZodOptional<z.ZodString>;
218
218
  }, z.core.$strip>]>>>;
219
- export declare const translationsSchema: z.ZodObject<{
220
- defaultLanguage: z.ZodString;
221
- questions: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
222
- type: z.ZodLiteral<"rating">;
223
- title: z.ZodString;
224
- description: z.ZodOptional<z.ZodString>;
225
- errorMessage: z.ZodOptional<z.ZodString>;
226
- minLabel: z.ZodOptional<z.ZodString>;
227
- maxLabel: z.ZodOptional<z.ZodString>;
228
- }, z.core.$strip>, z.ZodObject<{
229
- type: z.ZodLiteral<"single_choice">;
230
- title: z.ZodString;
231
- description: z.ZodOptional<z.ZodString>;
232
- errorMessage: z.ZodOptional<z.ZodString>;
233
- placeholder: z.ZodOptional<z.ZodString>;
234
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
235
- type: z.ZodLiteral<"multiple_choice_multiple">;
236
- title: z.ZodString;
237
- description: z.ZodOptional<z.ZodString>;
238
- errorMessage: z.ZodOptional<z.ZodString>;
239
- placeholder: z.ZodOptional<z.ZodString>;
240
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
241
- type: z.ZodLiteral<"nps">;
242
- title: z.ZodString;
243
- description: z.ZodOptional<z.ZodString>;
244
- errorMessage: z.ZodOptional<z.ZodString>;
245
- minLabel: z.ZodOptional<z.ZodString>;
246
- maxLabel: z.ZodOptional<z.ZodString>;
247
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
248
- type: z.ZodLiteral<"short_answer">;
249
- title: z.ZodString;
250
- description: z.ZodOptional<z.ZodString>;
251
- errorMessage: z.ZodOptional<z.ZodString>;
252
- placeholder: z.ZodOptional<z.ZodString>;
253
- }, z.core.$strip>, z.ZodObject<{
254
- type: z.ZodLiteral<"long_text">;
255
- title: z.ZodString;
256
- description: z.ZodOptional<z.ZodString>;
257
- errorMessage: z.ZodOptional<z.ZodString>;
258
- placeholder: z.ZodOptional<z.ZodString>;
259
- }, z.core.$strip>, z.ZodObject<{
260
- type: z.ZodLiteral<"nested_selection">;
261
- title: z.ZodString;
262
- description: z.ZodOptional<z.ZodString>;
263
- errorMessage: z.ZodOptional<z.ZodString>;
264
- placeholder: z.ZodOptional<z.ZodString>;
265
- }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
266
- type: z.ZodLiteral<"annotation">;
267
- title: z.ZodString;
268
- description: z.ZodOptional<z.ZodString>;
269
- errorMessage: z.ZodOptional<z.ZodString>;
270
- annotationText: z.ZodOptional<z.ZodString>;
271
- noAnnotationText: z.ZodOptional<z.ZodString>;
272
- }, z.core.$strip>]>>>;
273
- }, z.core.$strip>;
219
+ export declare const translationsSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
220
+ type: z.ZodLiteral<"rating">;
221
+ title: z.ZodString;
222
+ description: z.ZodOptional<z.ZodString>;
223
+ errorMessage: z.ZodOptional<z.ZodString>;
224
+ minLabel: z.ZodOptional<z.ZodString>;
225
+ maxLabel: z.ZodOptional<z.ZodString>;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ type: z.ZodLiteral<"single_choice">;
228
+ title: z.ZodString;
229
+ description: z.ZodOptional<z.ZodString>;
230
+ errorMessage: z.ZodOptional<z.ZodString>;
231
+ placeholder: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
233
+ type: z.ZodLiteral<"multiple_choice_multiple">;
234
+ title: z.ZodString;
235
+ description: z.ZodOptional<z.ZodString>;
236
+ errorMessage: z.ZodOptional<z.ZodString>;
237
+ placeholder: z.ZodOptional<z.ZodString>;
238
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
239
+ type: z.ZodLiteral<"nps">;
240
+ title: z.ZodString;
241
+ description: z.ZodOptional<z.ZodString>;
242
+ errorMessage: z.ZodOptional<z.ZodString>;
243
+ minLabel: z.ZodOptional<z.ZodString>;
244
+ maxLabel: z.ZodOptional<z.ZodString>;
245
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
246
+ type: z.ZodLiteral<"short_answer">;
247
+ title: z.ZodString;
248
+ description: z.ZodOptional<z.ZodString>;
249
+ errorMessage: z.ZodOptional<z.ZodString>;
250
+ placeholder: z.ZodOptional<z.ZodString>;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ type: z.ZodLiteral<"long_text">;
253
+ title: z.ZodString;
254
+ description: z.ZodOptional<z.ZodString>;
255
+ errorMessage: z.ZodOptional<z.ZodString>;
256
+ placeholder: z.ZodOptional<z.ZodString>;
257
+ }, z.core.$strip>, z.ZodObject<{
258
+ type: z.ZodLiteral<"nested_selection">;
259
+ title: z.ZodString;
260
+ description: z.ZodOptional<z.ZodString>;
261
+ errorMessage: z.ZodOptional<z.ZodString>;
262
+ placeholder: z.ZodOptional<z.ZodString>;
263
+ }, z.core.$catchall<z.ZodString>>, z.ZodObject<{
264
+ type: z.ZodLiteral<"annotation">;
265
+ title: z.ZodString;
266
+ description: z.ZodOptional<z.ZodString>;
267
+ errorMessage: z.ZodOptional<z.ZodString>;
268
+ annotationText: z.ZodOptional<z.ZodString>;
269
+ noAnnotationText: z.ZodOptional<z.ZodString>;
270
+ }, z.core.$strip>]>>>;
274
271
  export type TranslationEntry = z.infer<typeof translationEntrySchema>;
275
272
  export type RatingQuestionTranslation = z.infer<typeof ratingQuestionTranslationSchema>;
276
273
  export type SingleChoiceQuestionTranslation = z.infer<typeof singleChoiceQuestionTranslationSchema>;
@@ -287,7 +284,8 @@ export type QuestionCentricTranslations = z.infer<typeof questionCentricTranslat
287
284
  export type Translations = z.infer<typeof translationsSchema>;
288
285
  export declare class TranslationProvider {
289
286
  private translations;
290
- constructor(translations: Translations);
287
+ private defaultLanguage;
288
+ constructor(translations: Translations, defaultLanguage?: string);
291
289
  /**
292
290
  * Get translations for a specific question in a specific language
293
291
  */
@@ -325,4 +323,4 @@ export declare class TranslationProvider {
325
323
  */
326
324
  getQuestionType(questionId: string, languageCode?: string): string | null;
327
325
  }
328
- export declare function createTranslationProvider(translations: Translations): TranslationProvider;
326
+ export declare function createTranslationProvider(translations: Translations, defaultLanguage?: string): TranslationProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@encatch/schema",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "TypeScript schema definitions using Zod for validation and type inference of encatch product",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",