@dmptool/types 1.0.0 → 1.0.1
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/README.md +33 -2
- package/dist/answers/__tests__/answers.spec.d.ts +1 -0
- package/dist/answers/__tests__/answers.spec.js +122 -0
- package/dist/answers/answer.d.ts +12 -0
- package/dist/answers/answer.js +10 -0
- package/dist/answers/dateAnswers.d.ts +39 -0
- package/dist/answers/dateAnswers.js +16 -0
- package/dist/answers/graphQLAnswers.d.ts +23 -0
- package/dist/answers/graphQLAnswers.js +14 -0
- package/dist/{answers.d.ts → answers/index.d.ts} +102 -268
- package/dist/answers/index.js +48 -0
- package/dist/answers/optionBasedAnswers.d.ts +34 -0
- package/dist/answers/optionBasedAnswers.js +18 -0
- package/dist/answers/primitiveAnswers.d.ts +78 -0
- package/dist/answers/primitiveAnswers.js +34 -0
- package/dist/answers/tableAnswers.d.ts +388 -0
- package/dist/answers/tableAnswers.js +31 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/questions/__tests__/dateQuestions.spec.d.ts +1 -0
- package/dist/questions/__tests__/dateQuestions.spec.js +149 -0
- package/dist/questions/__tests__/graphQLQuestions.spec.d.ts +1 -0
- package/dist/questions/__tests__/graphQLQuestions.spec.js +87 -0
- package/dist/questions/__tests__/optionBasedQuestions.spec.d.ts +1 -0
- package/dist/questions/__tests__/optionBasedQuestions.spec.js +152 -0
- package/dist/questions/__tests__/primitiveQuestions.spec.d.ts +1 -0
- package/dist/questions/__tests__/primitiveQuestions.spec.js +189 -0
- package/dist/{dateQuestions.js → questions/dateQuestions.js} +3 -3
- package/dist/{graphQLQuestions.js → questions/graphQLQuestions.js} +3 -3
- package/dist/{tableQuestions.d.ts → questions/index.d.ts} +97 -1650
- package/dist/questions/index.js +48 -0
- package/dist/{optionBasedQuestions.js → questions/optionBasedQuestions.js} +4 -4
- package/dist/{primitiveQuestions.d.ts → questions/primitiveQuestions.d.ts} +0 -27
- package/dist/{primitiveQuestions.js → questions/primitiveQuestions.js} +8 -35
- package/dist/questions/question.d.ts +29 -0
- package/dist/questions/question.js +32 -0
- package/dist/questions/tableQuestions.d.ts +2638 -0
- package/dist/{tableQuestions.js → questions/tableQuestions.js} +5 -22
- package/dist/schemas/anyAnswer.schema.json +110 -47
- package/dist/schemas/anyTableColumnAnswer.schema.json +267 -0
- package/dist/schemas/anyTableColumnQuestion.schema.json +637 -0
- package/dist/schemas/tableAnswer.schema.json +2 -2
- package/package.json +8 -1
- package/dist/answers.js +0 -87
- /package/dist/{dateQuestions.d.ts → questions/dateQuestions.d.ts} +0 -0
- /package/dist/{graphQLQuestions.d.ts → questions/graphQLQuestions.d.ts} +0 -0
- /package/dist/{optionBasedQuestions.d.ts → questions/optionBasedQuestions.d.ts} +0 -0
package/dist/answers.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableAnswer = exports.AnyAnswer = exports.URLAnswer = exports.TypeaheadSearchAnswer = exports.TextAreaAnswer = exports.TextAnswer = exports.SelectBoxAnswer = exports.RadioButtonsAnswer = exports.NumberAnswer = exports.FilteredSearchAnswer = exports.EmailAnswer = exports.DateRangeAnswer = exports.DatePickerAnswer = exports.CurrencyAnswer = exports.CheckboxesAnswer = exports.BooleanAnswer = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const primitiveQuestions_1 = require("./primitiveQuestions");
|
|
6
|
-
const Answer = zod_1.z.object({
|
|
7
|
-
type: primitiveQuestions_1.QuestionTypesEnum, // The type of answer
|
|
8
|
-
answer: zod_1.z.string(), // The answer to the question (string)
|
|
9
|
-
});
|
|
10
|
-
exports.BooleanAnswer = zod_1.z.object({
|
|
11
|
-
type: zod_1.z.literal('boolean'), // The type of answer
|
|
12
|
-
answer: zod_1.z.boolean() // The answer to the question (true/false)
|
|
13
|
-
});
|
|
14
|
-
exports.CheckboxesAnswer = zod_1.z.object({
|
|
15
|
-
type: zod_1.z.literal('checkBoxes'), // The type of answer
|
|
16
|
-
answer: zod_1.z.array(zod_1.z.string()) // The answer to the question (array of strings)
|
|
17
|
-
});
|
|
18
|
-
exports.CurrencyAnswer = zod_1.z.object({
|
|
19
|
-
type: zod_1.z.literal('currency'), // The type of answer
|
|
20
|
-
answer: zod_1.z.number() // The answer to the question (number)
|
|
21
|
-
});
|
|
22
|
-
exports.DatePickerAnswer = Answer.merge(zod_1.z.object({
|
|
23
|
-
type: zod_1.z.literal('datePicker'), // The type of question
|
|
24
|
-
}));
|
|
25
|
-
exports.DateRangeAnswer = Answer.merge(zod_1.z.object({
|
|
26
|
-
type: zod_1.z.literal('dateRange'), // The type of answer
|
|
27
|
-
answer: zod_1.z.object({
|
|
28
|
-
start: zod_1.z.string(), // The start date (string)
|
|
29
|
-
end: zod_1.z.string() // The end date (string)
|
|
30
|
-
})
|
|
31
|
-
}));
|
|
32
|
-
exports.EmailAnswer = zod_1.z.object({
|
|
33
|
-
type: zod_1.z.literal('email'), // The type of question
|
|
34
|
-
answer: zod_1.z.string() // The answer to the question (string)
|
|
35
|
-
});
|
|
36
|
-
exports.FilteredSearchAnswer = Answer.merge(zod_1.z.object({
|
|
37
|
-
type: zod_1.z.literal('filteredSearch'), // The type of answer
|
|
38
|
-
answer: zod_1.z.array(zod_1.z.string()) // The answer to the filtered search (array of strings)
|
|
39
|
-
}));
|
|
40
|
-
exports.NumberAnswer = zod_1.z.object({
|
|
41
|
-
type: zod_1.z.literal('number'), // The type of answer
|
|
42
|
-
answer: zod_1.z.number() // The answer to the question (number)
|
|
43
|
-
});
|
|
44
|
-
exports.RadioButtonsAnswer = zod_1.z.object({
|
|
45
|
-
type: zod_1.z.literal('radioButtons'), // The type of answer
|
|
46
|
-
answer: zod_1.z.string() // The answer to the question (string)
|
|
47
|
-
});
|
|
48
|
-
exports.SelectBoxAnswer = zod_1.z.object({
|
|
49
|
-
type: zod_1.z.literal('selectBox'), // The type of answer
|
|
50
|
-
answer: zod_1.z.string() // The answer to the question (string)
|
|
51
|
-
});
|
|
52
|
-
exports.TextAnswer = zod_1.z.object({
|
|
53
|
-
type: zod_1.z.literal('text'), // The type of answer
|
|
54
|
-
answer: zod_1.z.string() // The answer to the question (string)
|
|
55
|
-
});
|
|
56
|
-
exports.TextAreaAnswer = zod_1.z.object({
|
|
57
|
-
type: zod_1.z.literal('textArea'), // The type of answer
|
|
58
|
-
answer: zod_1.z.string() // The answer to the question (string)
|
|
59
|
-
});
|
|
60
|
-
exports.TypeaheadSearchAnswer = zod_1.z.object({
|
|
61
|
-
type: zod_1.z.literal('typeaheadSearch'), // The type of answer
|
|
62
|
-
answer: zod_1.z.string() // The answer to the typeahead search (string)
|
|
63
|
-
});
|
|
64
|
-
exports.URLAnswer = zod_1.z.object({
|
|
65
|
-
type: zod_1.z.literal('url'), // The type of answer
|
|
66
|
-
answer: zod_1.z.string() // The answer to the question (string)
|
|
67
|
-
});
|
|
68
|
-
exports.AnyAnswer = zod_1.z.discriminatedUnion('type', [
|
|
69
|
-
exports.BooleanAnswer,
|
|
70
|
-
exports.CheckboxesAnswer,
|
|
71
|
-
exports.CurrencyAnswer,
|
|
72
|
-
exports.DatePickerAnswer,
|
|
73
|
-
exports.DateRangeAnswer,
|
|
74
|
-
exports.EmailAnswer,
|
|
75
|
-
exports.FilteredSearchAnswer,
|
|
76
|
-
exports.NumberAnswer,
|
|
77
|
-
exports.RadioButtonsAnswer,
|
|
78
|
-
exports.SelectBoxAnswer,
|
|
79
|
-
exports.TextAreaAnswer,
|
|
80
|
-
exports.TextAnswer,
|
|
81
|
-
exports.TypeaheadSearchAnswer,
|
|
82
|
-
exports.URLAnswer
|
|
83
|
-
]);
|
|
84
|
-
exports.TableAnswer = zod_1.z.object({
|
|
85
|
-
type: zod_1.z.literal('table'), // The type of answer
|
|
86
|
-
answer: zod_1.z.array(exports.AnyAnswer) // The answer to the question (array of answers)
|
|
87
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|