@dmptool/types 1.0.3 → 1.0.4

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
  import { z } from 'zod';
2
2
  export declare const AnswerSchema: z.ZodObject<{
3
- type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "option", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
3
+ type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
4
4
  answer: z.ZodString;
5
5
  meta: z.ZodObject<{
6
6
  schemaVersion: z.ZodLiteral<"1.0">;
@@ -10,13 +10,13 @@ export declare const AnswerSchema: z.ZodObject<{
10
10
  schemaVersion: "1.0";
11
11
  }>;
12
12
  }, "strip", z.ZodTypeAny, {
13
- type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "option" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
13
+ type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
14
14
  meta: {
15
15
  schemaVersion: "1.0";
16
16
  };
17
17
  answer: string;
18
18
  }, {
19
- type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "option" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
19
+ type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
20
20
  meta: {
21
21
  schemaVersion: "1.0";
22
22
  };
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { QuestionTypesEnum } from '../questions';
2
3
  export * from './answer';
3
4
  export * from './dateAnswers';
4
5
  export * from './graphQLAnswers';
@@ -877,4 +878,5 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
877
878
  };
878
879
  answer: string;
879
880
  }>]>;
881
+ export declare const AnswerSchemaMap: Record<z.infer<typeof QuestionTypesEnum>, z.ZodTypeAny>;
880
882
  export type AnyAnswerType = z.infer<typeof AnyAnswerSchema>;
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.AnyAnswerSchema = void 0;
17
+ exports.AnswerSchemaMap = exports.AnyAnswerSchema = void 0;
18
18
  const zod_1 = require("zod");
19
19
  const dateAnswers_1 = require("./dateAnswers");
20
20
  const graphQLAnswers_1 = require("./graphQLAnswers");
@@ -46,3 +46,21 @@ exports.AnyAnswerSchema = zod_1.z.discriminatedUnion('type', [
46
46
  graphQLAnswers_1.TypeaheadSearchAnswerSchema,
47
47
  primitiveAnswers_1.URLAnswerSchema
48
48
  ]);
49
+ // Export a mapping between question types and their corresponding answer schemas
50
+ exports.AnswerSchemaMap = {
51
+ boolean: primitiveAnswers_1.BooleanAnswerSchema,
52
+ checkBoxes: optionBasedAnswers_1.CheckboxesAnswerSchema,
53
+ currency: primitiveAnswers_1.CurrencyAnswerSchema,
54
+ datePicker: dateAnswers_1.DatePickerAnswerSchema,
55
+ dateRange: dateAnswers_1.DateRangeAnswerSchema,
56
+ email: primitiveAnswers_1.EmailAnswerSchema,
57
+ filteredSearch: graphQLAnswers_1.FilteredSearchAnswerSchema,
58
+ number: primitiveAnswers_1.NumberAnswerSchema,
59
+ radioButtons: optionBasedAnswers_1.RadioButtonsAnswerSchema,
60
+ selectBox: optionBasedAnswers_1.SelectBoxAnswerSchema,
61
+ table: tableAnswers_1.TableAnswerSchema,
62
+ text: primitiveAnswers_1.TextAnswerSchema,
63
+ textArea: primitiveAnswers_1.TextAreaAnswerSchema,
64
+ typeaheadSearch: graphQLAnswers_1.TypeaheadSearchAnswerSchema,
65
+ url: primitiveAnswers_1.URLAnswerSchema
66
+ };
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { QuestionTypesEnum } from './question';
2
3
  export * from './question';
3
4
  export * from './dateQuestions';
4
5
  export * from './graphQLQuestions';
@@ -2639,4 +2640,5 @@ export declare const AnyQuestionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodOb
2639
2640
  pattern?: string | undefined;
2640
2641
  };
2641
2642
  }>]>;
2643
+ export declare const QuestionSchemaMap: Record<z.infer<typeof QuestionTypesEnum>, z.ZodTypeAny>;
2642
2644
  export type AnyQuestionType = z.infer<typeof AnyQuestionSchema>;
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.AnyQuestionSchema = void 0;
17
+ exports.QuestionSchemaMap = exports.AnyQuestionSchema = void 0;
18
18
  const zod_1 = require("zod");
19
19
  const primitiveQuestions_1 = require("./primitiveQuestions");
20
20
  const dateQuestions_1 = require("./dateQuestions");
@@ -46,3 +46,21 @@ exports.AnyQuestionSchema = zod_1.z.discriminatedUnion('type', [
46
46
  graphQLQuestions_1.TypeaheadSearchQuestionSchema,
47
47
  primitiveQuestions_1.URLQuestionSchema
48
48
  ]);
49
+ // Export a mapping between question types and their corresponding question schemas
50
+ exports.QuestionSchemaMap = {
51
+ boolean: primitiveQuestions_1.BooleanQuestionSchema,
52
+ checkBoxes: optionBasedQuestions_1.CheckboxesQuestionSchema,
53
+ currency: primitiveQuestions_1.CurrencyQuestionSchema,
54
+ datePicker: dateQuestions_1.DatePickerQuestionSchema,
55
+ dateRange: dateQuestions_1.DateRangeQuestionSchema,
56
+ email: primitiveQuestions_1.EmailQuestionSchema,
57
+ filteredSearch: graphQLQuestions_1.FilteredSearchQuestionSchema,
58
+ number: primitiveQuestions_1.NumberQuestionSchema,
59
+ radioButtons: optionBasedQuestions_1.RadioButtonsQuestionSchema,
60
+ selectBox: optionBasedQuestions_1.SelectBoxQuestionSchema,
61
+ table: tableQuestions_1.TableQuestionSchema,
62
+ text: primitiveQuestions_1.TextQuestionSchema,
63
+ textArea: primitiveQuestions_1.TextAreaQuestionSchema,
64
+ typeaheadSearch: graphQLQuestions_1.TypeaheadSearchQuestionSchema,
65
+ url: primitiveQuestions_1.URLQuestionSchema
66
+ };
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  export declare const CURRENT_SCHEMA_VERSION = "1.0";
3
- export declare const QuestionTypesEnum: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "option", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
3
+ export declare const QuestionTypesEnum: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
4
4
  export declare const QuestionSchema: z.ZodObject<{
5
- type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "option", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
5
+ type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
6
6
  meta: z.ZodObject<{
7
7
  schemaVersion: z.ZodLiteral<"1.0">;
8
8
  labelTranslationKey: z.ZodOptional<z.ZodString>;
@@ -14,13 +14,13 @@ export declare const QuestionSchema: z.ZodObject<{
14
14
  labelTranslationKey?: string | undefined;
15
15
  }>;
16
16
  }, "strip", z.ZodTypeAny, {
17
- type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "option" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
17
+ type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
18
18
  meta: {
19
19
  schemaVersion: "1.0";
20
20
  labelTranslationKey?: string | undefined;
21
21
  };
22
22
  }, {
23
- type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "option" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
23
+ type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
24
24
  meta: {
25
25
  schemaVersion: "1.0";
26
26
  labelTranslationKey?: string | undefined;
@@ -13,7 +13,6 @@ exports.QuestionTypesEnum = zod_1.z.enum([
13
13
  'email',
14
14
  'filteredSearch',
15
15
  'number',
16
- 'option',
17
16
  'radioButtons',
18
17
  'selectBox',
19
18
  'table',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmptool/types",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "TypeScript types for DMPTool",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",