@dmptool/types 1.0.2 → 1.0.3

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.
Files changed (34) hide show
  1. package/dist/answers/__tests__/answers.spec.js +32 -32
  2. package/dist/answers/answer.d.ts +2 -2
  3. package/dist/answers/answer.js +2 -2
  4. package/dist/answers/dateAnswers.d.ts +4 -4
  5. package/dist/answers/dateAnswers.js +3 -3
  6. package/dist/answers/graphQLAnswers.d.ts +4 -4
  7. package/dist/answers/graphQLAnswers.js +3 -3
  8. package/dist/answers/index.d.ts +2 -2
  9. package/dist/answers/index.js +17 -17
  10. package/dist/answers/optionBasedAnswers.d.ts +6 -6
  11. package/dist/answers/optionBasedAnswers.js +4 -4
  12. package/dist/answers/primitiveAnswers.d.ts +14 -14
  13. package/dist/answers/primitiveAnswers.js +8 -8
  14. package/dist/answers/tableAnswers.d.ts +4 -4
  15. package/dist/answers/tableAnswers.js +18 -18
  16. package/dist/questions/__tests__/dateQuestions.spec.js +6 -6
  17. package/dist/questions/__tests__/graphQLQuestions.spec.js +4 -4
  18. package/dist/questions/__tests__/optionBasedQuestions.spec.js +6 -6
  19. package/dist/questions/__tests__/primitiveQuestions.spec.js +14 -14
  20. package/dist/questions/dateQuestions.d.ts +4 -4
  21. package/dist/questions/dateQuestions.js +5 -5
  22. package/dist/questions/graphQLQuestions.d.ts +4 -4
  23. package/dist/questions/graphQLQuestions.js +3 -3
  24. package/dist/questions/index.d.ts +2 -2
  25. package/dist/questions/index.js +17 -17
  26. package/dist/questions/optionBasedQuestions.d.ts +6 -6
  27. package/dist/questions/optionBasedQuestions.js +11 -11
  28. package/dist/questions/primitiveQuestions.d.ts +14 -14
  29. package/dist/questions/primitiveQuestions.js +8 -8
  30. package/dist/questions/question.d.ts +2 -2
  31. package/dist/questions/question.js +2 -2
  32. package/dist/questions/tableQuestions.d.ts +4 -4
  33. package/dist/questions/tableQuestions.js +18 -18
  34. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const AnyTableColumnQuestion: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2
+ export declare const AnyTableColumnQuestionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3
3
  meta: z.ZodObject<{
4
4
  schemaVersion: z.ZodLiteral<"1.0">;
5
5
  labelTranslationKey: z.ZodOptional<z.ZodString>;
@@ -1076,7 +1076,7 @@ export declare const AnyTableColumnQuestion: z.ZodDiscriminatedUnion<"type", [z.
1076
1076
  pattern?: string | undefined;
1077
1077
  };
1078
1078
  }>]>;
1079
- export declare const TableQuestion: z.ZodObject<{
1079
+ export declare const TableQuestionSchema: z.ZodObject<{
1080
1080
  meta: z.ZodObject<{
1081
1081
  schemaVersion: z.ZodLiteral<"1.0">;
1082
1082
  labelTranslationKey: z.ZodOptional<z.ZodString>;
@@ -2634,5 +2634,5 @@ export declare const TableQuestion: z.ZodObject<{
2634
2634
  };
2635
2635
  })[];
2636
2636
  }>;
2637
- export type TableQuestionType = z.infer<typeof TableQuestion>;
2638
- export type AnyTableColumnQuestionType = z.infer<typeof AnyTableColumnQuestion>;
2637
+ export type TableQuestionType = z.infer<typeof TableQuestionSchema>;
2638
+ export type AnyTableColumnQuestionType = z.infer<typeof AnyTableColumnQuestionSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TableQuestion = exports.AnyTableColumnQuestion = void 0;
3
+ exports.TableQuestionSchema = exports.AnyTableColumnQuestionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const primitiveQuestions_1 = require("./primitiveQuestions");
6
6
  const dateQuestions_1 = require("./dateQuestions");
@@ -8,26 +8,26 @@ const optionBasedQuestions_1 = require("./optionBasedQuestions");
8
8
  const graphQLQuestions_1 = require("./graphQLQuestions");
9
9
  const question_1 = require("./question");
10
10
  // Union types for all questions and answers (tables cannot be nested so no TableQuestion here!)
11
- exports.AnyTableColumnQuestion = zod_1.z.discriminatedUnion('type', [
12
- primitiveQuestions_1.BooleanQuestion,
13
- optionBasedQuestions_1.CheckboxesQuestion,
14
- primitiveQuestions_1.CurrencyQuestion,
15
- dateQuestions_1.DatePickerQuestion,
16
- dateQuestions_1.DateRangeQuestion,
17
- primitiveQuestions_1.EmailQuestion,
18
- graphQLQuestions_1.FilteredSearchQuestion,
19
- primitiveQuestions_1.NumberQuestion,
20
- optionBasedQuestions_1.RadioButtonsQuestion,
21
- optionBasedQuestions_1.SelectBoxQuestion,
22
- primitiveQuestions_1.TextAreaQuestion,
23
- primitiveQuestions_1.TextQuestion,
24
- graphQLQuestions_1.TypeaheadSearchQuestion,
25
- primitiveQuestions_1.URLQuestion
11
+ exports.AnyTableColumnQuestionSchema = zod_1.z.discriminatedUnion('type', [
12
+ primitiveQuestions_1.BooleanQuestionSchema,
13
+ optionBasedQuestions_1.CheckboxesQuestionSchema,
14
+ primitiveQuestions_1.CurrencyQuestionSchema,
15
+ dateQuestions_1.DatePickerQuestionSchema,
16
+ dateQuestions_1.DateRangeQuestionSchema,
17
+ primitiveQuestions_1.EmailQuestionSchema,
18
+ graphQLQuestions_1.FilteredSearchQuestionSchema,
19
+ primitiveQuestions_1.NumberQuestionSchema,
20
+ optionBasedQuestions_1.RadioButtonsQuestionSchema,
21
+ optionBasedQuestions_1.SelectBoxQuestionSchema,
22
+ primitiveQuestions_1.TextAreaQuestionSchema,
23
+ primitiveQuestions_1.TextQuestionSchema,
24
+ graphQLQuestions_1.TypeaheadSearchQuestionSchema,
25
+ primitiveQuestions_1.URLQuestionSchema
26
26
  ]);
27
27
  // Table question and answer
28
- exports.TableQuestion = question_1.Question.merge(zod_1.z.object({
28
+ exports.TableQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
29
29
  type: zod_1.z.literal('table'), // The type of question
30
- columns: zod_1.z.array(exports.AnyTableColumnQuestion), // The columns of the table (note: tables cannot be nested)
30
+ columns: zod_1.z.array(exports.AnyTableColumnQuestionSchema), // The columns of the table (note: tables cannot be nested)
31
31
  attributes: zod_1.z.object({
32
32
  canAddRows: zod_1.z.boolean().optional(), // Whether to allow adding rows (default is true)
33
33
  canRemoveRows: zod_1.z.boolean().optional(), // Whether to allow removing rows (default is true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmptool/types",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "TypeScript types for DMPTool",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",