@dmptool/types 1.1.3 → 1.2.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 +119 -47
- package/dist/answers/__tests__/answers.spec.js +27 -28
- package/dist/answers/__tests__/usage.spec.d.ts +1 -0
- package/dist/answers/__tests__/usage.spec.js +178 -0
- package/dist/answers/answer.d.ts +12 -15
- package/dist/answers/answer.js +3 -4
- package/dist/answers/dateAnswers.d.ts +30 -30
- package/dist/answers/dateAnswers.js +6 -5
- package/dist/answers/graphQLAnswers.d.ts +41 -26
- package/dist/answers/graphQLAnswers.js +7 -4
- package/dist/answers/index.d.ts +887 -1088
- package/dist/answers/index.js +2 -2
- package/dist/answers/numberAnswers.d.ts +41 -41
- package/dist/answers/numberAnswers.js +8 -8
- package/dist/answers/optionBasedAnswers.d.ts +55 -55
- package/dist/answers/optionBasedAnswers.js +10 -10
- package/dist/answers/tableAnswers.d.ts +880 -1778
- package/dist/answers/tableAnswers.js +12 -8
- package/dist/answers/textAnswers.d.ts +44 -44
- package/dist/answers/textAnswers.js +8 -8
- package/dist/questions/__tests__/graphQLQuestions.spec.js +1 -1
- package/dist/questions/__tests__/usage.spec.d.ts +8 -0
- package/dist/questions/__tests__/usage.spec.js +312 -0
- package/dist/questions/dateQuestions.d.ts +81 -82
- package/dist/questions/dateQuestions.js +12 -16
- package/dist/questions/graphQLQuestions.d.ts +142 -142
- package/dist/questions/graphQLQuestions.js +35 -30
- package/dist/questions/index.d.ts +1492 -1672
- package/dist/questions/index.js +2 -2
- package/dist/questions/numberQuestions.d.ts +97 -98
- package/dist/questions/numberQuestions.js +7 -19
- package/dist/questions/optionBasedQuestions.d.ts +163 -166
- package/dist/questions/optionBasedQuestions.js +20 -36
- package/dist/questions/question.d.ts +24 -48
- package/dist/questions/question.js +78 -17
- package/dist/questions/tableQuestions.d.ts +2215 -2227
- package/dist/questions/tableQuestions.js +6 -11
- package/dist/questions/textQuestions.d.ts +104 -104
- package/dist/questions/textQuestions.js +6 -23
- package/dist/schemas/affiliationSearchAnswer.schema.json +20 -12
- package/dist/schemas/affiliationSearchQuestion.schema.json +30 -36
- package/dist/schemas/anyAnswer.schema.json +235 -233
- package/dist/schemas/anyQuestion.schema.json +292 -493
- package/dist/schemas/anyTableColumnAnswer.schema.json +104 -106
- package/dist/schemas/anyTableColumnQuestion.schema.json +164 -325
- package/dist/schemas/booleanAnswer.schema.json +8 -11
- package/dist/schemas/booleanQuestion.schema.json +7 -10
- package/dist/schemas/checkboxesAnswer.schema.json +13 -14
- package/dist/schemas/checkboxesQuestion.schema.json +12 -13
- package/dist/schemas/currencyAnswer.schema.json +8 -11
- package/dist/schemas/currencyQuestion.schema.json +7 -10
- package/dist/schemas/dateAnswer.schema.json +8 -11
- package/dist/schemas/dateQuestion.schema.json +7 -10
- package/dist/schemas/dateRangeAnswer.schema.json +16 -21
- package/dist/schemas/dateRangeQuestion.schema.json +38 -20
- package/dist/schemas/emailAnswer.schema.json +8 -11
- package/dist/schemas/emailQuestion.schema.json +7 -10
- package/dist/schemas/multiselectBoxAnswer.schema.json +13 -14
- package/dist/schemas/multiselectBoxQuestion.schema.json +14 -14
- package/dist/schemas/numberAnswer.schema.json +8 -11
- package/dist/schemas/numberQuestion.schema.json +7 -10
- package/dist/schemas/numberRangeAnswer.schema.json +17 -22
- package/dist/schemas/numberRangeQuestion.schema.json +18 -19
- package/dist/schemas/radioButtonsAnswer.schema.json +8 -11
- package/dist/schemas/radioButtonsQuestion.schema.json +12 -13
- package/dist/schemas/selectBoxAnswer.schema.json +8 -11
- package/dist/schemas/selectBoxQuestion.schema.json +18 -15
- package/dist/schemas/tableAnswer.schema.json +343 -338
- package/dist/schemas/tableQuestion.schema.json +178 -352
- package/dist/schemas/textAnswer.schema.json +8 -11
- package/dist/schemas/textAreaAnswer.schema.json +8 -11
- package/dist/schemas/textAreaQuestion.schema.json +7 -10
- package/dist/schemas/textQuestion.schema.json +7 -10
- package/dist/schemas/urlAnswer.schema.json +8 -11
- package/dist/schemas/urlQuestion.schema.json +7 -10
- package/package.json +1 -1
|
@@ -5,12 +5,13 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
// Answers to Date Question Types
|
|
7
7
|
exports.DateAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
8
|
-
type: zod_1.z.literal('date'),
|
|
8
|
+
type: zod_1.z.literal('date'),
|
|
9
|
+
answer: zod_1.z.string().default('')
|
|
9
10
|
}));
|
|
10
11
|
exports.DateRangeAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
11
|
-
type: zod_1.z.literal('dateRange'),
|
|
12
|
+
type: zod_1.z.literal('dateRange'),
|
|
12
13
|
answer: zod_1.z.object({
|
|
13
|
-
start: zod_1.z.string(), // The start date (string)
|
|
14
|
-
end: zod_1.z.string() // The end date (string)
|
|
15
|
-
})
|
|
14
|
+
start: zod_1.z.string().default(''), // The start date (string)
|
|
15
|
+
end: zod_1.z.string().default('') // The end date (string)
|
|
16
|
+
}).default({})
|
|
16
17
|
}));
|
|
@@ -1,51 +1,66 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const FilteredSearchAnswerSchema: z.ZodObject<{
|
|
3
|
-
meta: z.ZodObject<{
|
|
4
|
-
schemaVersion: z.
|
|
3
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
schemaVersion:
|
|
6
|
+
schemaVersion: string;
|
|
7
7
|
}, {
|
|
8
|
-
schemaVersion
|
|
9
|
-
}
|
|
8
|
+
schemaVersion?: string | undefined;
|
|
9
|
+
}>>;
|
|
10
10
|
} & {
|
|
11
11
|
type: z.ZodLiteral<"filteredSearch">;
|
|
12
|
-
answer: z.ZodArray<z.ZodString, "many"
|
|
12
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
14
|
type: "filteredSearch";
|
|
15
15
|
meta: {
|
|
16
|
-
schemaVersion:
|
|
16
|
+
schemaVersion: string;
|
|
17
17
|
};
|
|
18
18
|
answer: string[];
|
|
19
19
|
}, {
|
|
20
20
|
type: "filteredSearch";
|
|
21
|
-
meta
|
|
22
|
-
schemaVersion
|
|
23
|
-
};
|
|
24
|
-
answer
|
|
21
|
+
meta?: {
|
|
22
|
+
schemaVersion?: string | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
answer?: string[] | undefined;
|
|
25
25
|
}>;
|
|
26
26
|
export declare const AffiliationSearchAnswerSchema: z.ZodObject<{
|
|
27
|
-
meta: z.ZodObject<{
|
|
28
|
-
schemaVersion: z.
|
|
27
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
28
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
schemaVersion:
|
|
30
|
+
schemaVersion: string;
|
|
31
31
|
}, {
|
|
32
|
-
schemaVersion
|
|
33
|
-
}
|
|
32
|
+
schemaVersion?: string | undefined;
|
|
33
|
+
}>>;
|
|
34
34
|
} & {
|
|
35
|
-
type: z.ZodLiteral<"
|
|
36
|
-
answer: z.
|
|
35
|
+
type: z.ZodLiteral<"affiliationSearch">;
|
|
36
|
+
answer: z.ZodDefault<z.ZodObject<{
|
|
37
|
+
affiliationId: z.ZodDefault<z.ZodString>;
|
|
38
|
+
affiliationName: z.ZodDefault<z.ZodString>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
affiliationId: string;
|
|
41
|
+
affiliationName: string;
|
|
42
|
+
}, {
|
|
43
|
+
affiliationId?: string | undefined;
|
|
44
|
+
affiliationName?: string | undefined;
|
|
45
|
+
}>>;
|
|
37
46
|
}, "strip", z.ZodTypeAny, {
|
|
38
|
-
type: "
|
|
47
|
+
type: "affiliationSearch";
|
|
39
48
|
meta: {
|
|
40
|
-
schemaVersion:
|
|
49
|
+
schemaVersion: string;
|
|
41
50
|
};
|
|
42
|
-
answer:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
meta: {
|
|
46
|
-
schemaVersion: "1.0";
|
|
51
|
+
answer: {
|
|
52
|
+
affiliationId: string;
|
|
53
|
+
affiliationName: string;
|
|
47
54
|
};
|
|
48
|
-
|
|
55
|
+
}, {
|
|
56
|
+
type: "affiliationSearch";
|
|
57
|
+
meta?: {
|
|
58
|
+
schemaVersion?: string | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
answer?: {
|
|
61
|
+
affiliationId?: string | undefined;
|
|
62
|
+
affiliationName?: string | undefined;
|
|
63
|
+
} | undefined;
|
|
49
64
|
}>;
|
|
50
65
|
export type FilteredSearchAnswerType = z.infer<typeof FilteredSearchAnswerSchema>;
|
|
51
66
|
export type AffiliationSearchAnswerType = z.infer<typeof AffiliationSearchAnswerSchema>;
|
|
@@ -5,10 +5,13 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
// Answers to GraphQL Question Types
|
|
7
7
|
exports.FilteredSearchAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
8
|
-
type: zod_1.z.literal('filteredSearch'),
|
|
9
|
-
answer: zod_1.z.array(zod_1.z.string()) // The answer to the filtered search
|
|
8
|
+
type: zod_1.z.literal('filteredSearch'),
|
|
9
|
+
answer: zod_1.z.array(zod_1.z.string()).default(['']) // The answer to the filtered search
|
|
10
10
|
}));
|
|
11
11
|
exports.AffiliationSearchAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
12
|
-
type: zod_1.z.literal('
|
|
13
|
-
answer: zod_1.z.
|
|
12
|
+
type: zod_1.z.literal('affiliationSearch'),
|
|
13
|
+
answer: zod_1.z.object({
|
|
14
|
+
affiliationId: zod_1.z.string().default(''), // The unique id of the affiliation (e.g. ROR URI)
|
|
15
|
+
affiliationName: zod_1.z.string().default('') // The name of the affiliation
|
|
16
|
+
}).default({})
|
|
14
17
|
}));
|