@dmptool/types 1.2.3 → 1.2.5
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 +8 -0
- package/dist/answers/__tests__/answers.spec.js +122 -6
- package/dist/answers/answer.d.ts +3 -3
- package/dist/answers/graphQLAnswers.d.ts +120 -25
- package/dist/answers/graphQLAnswers.js +22 -5
- package/dist/answers/index.d.ts +399 -31
- package/dist/answers/index.js +8 -2
- package/dist/answers/numberAnswers.d.ts +40 -0
- package/dist/answers/numberAnswers.js +8 -1
- package/dist/answers/tableAnswers.d.ts +1688 -75
- package/dist/answers/tableAnswers.js +63 -2
- package/dist/questions/__tests__/graphQLQuestions.spec.js +177 -39
- package/dist/questions/__tests__/numberQuestions.spec.js +36 -0
- package/dist/questions/__tests__/tableQuestion.spec.js +145 -0
- package/dist/questions/__tests__/usage.spec.js +162 -1
- package/dist/questions/graphQLQuestions.d.ts +420 -60
- package/dist/questions/graphQLQuestions.js +257 -11
- package/dist/questions/index.d.ts +4849 -189
- package/dist/questions/index.js +9 -2
- package/dist/questions/numberQuestions.d.ts +105 -0
- package/dist/questions/numberQuestions.js +12 -1
- package/dist/questions/question.d.ts +4 -4
- package/dist/questions/question.js +25 -4
- package/dist/questions/tableQuestions.d.ts +5930 -679
- package/dist/questions/tableQuestions.js +188 -3
- package/dist/schemas/anyAnswer.schema.json +137 -17
- package/dist/schemas/anyQuestion.schema.json +847 -101
- package/dist/schemas/anyTableColumnAnswer.schema.json +116 -5
- package/dist/schemas/anyTableColumnQuestion.schema.json +326 -24
- package/dist/schemas/licenseSearchAnswer.schema.json +49 -0
- package/dist/schemas/licenseSearchQuestion.schema.json +164 -0
- package/dist/schemas/metadataStandardSearchAnswer.schema.json +49 -0
- package/dist/schemas/metadataStandardSearchQuestion.schema.json +174 -0
- package/dist/schemas/numberWithContextAnswer.schema.json +45 -0
- package/dist/schemas/numberWithContextQuestion.schema.json +84 -0
- package/dist/schemas/repositorySearchAnswer.schema.json +49 -0
- package/dist/schemas/repositorySearchQuestion.schema.json +180 -0
- package/dist/schemas/researchOutputTableAnswer.schema.json +519 -0
- package/dist/schemas/researchOutputTableQuestion.schema.json +1183 -0
- package/dist/schemas/tableAnswer.schema.json +116 -5
- package/dist/schemas/tableQuestion.schema.json +348 -24
- package/package.json +9 -5
package/dist/answers/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { DateAnswerType, DateRangeAnswerType } from './dateAnswers';
|
|
3
|
-
import { AffiliationSearchAnswerType } from './graphQLAnswers';
|
|
3
|
+
import { AffiliationSearchAnswerType, LicenseSearchAnswerType, MetadataStandardSearchAnswerType, RepositorySearchAnswerType } from './graphQLAnswers';
|
|
4
4
|
import { BooleanAnswerType, CheckboxesAnswerType, RadioButtonsAnswerType, SelectBoxAnswerType, MultiselectBoxAnswerType } from './optionBasedAnswers';
|
|
5
|
-
import { CurrencyAnswerType, NumberAnswerType, NumberRangeAnswerType } from './numberAnswers';
|
|
6
|
-
import { TableAnswerType } from './tableAnswers';
|
|
5
|
+
import { CurrencyAnswerType, NumberAnswerType, NumberRangeAnswerType, NumberWithContextAnswerType } from './numberAnswers';
|
|
6
|
+
import { ResearchOutputTableAnswerType, TableAnswerType } from './tableAnswers';
|
|
7
7
|
import { EmailAnswerType, TextAnswerType, TextAreaAnswerType, URLAnswerType } from './textAnswers';
|
|
8
8
|
import { QuestionFormatsEnum } from '../questions';
|
|
9
9
|
export * from './answer';
|
|
@@ -212,6 +212,82 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
212
212
|
}, {
|
|
213
213
|
schemaVersion?: string | undefined;
|
|
214
214
|
}>>;
|
|
215
|
+
} & {
|
|
216
|
+
type: z.ZodLiteral<"licenseSearch">;
|
|
217
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodObject<{
|
|
218
|
+
licenseId: z.ZodDefault<z.ZodString>;
|
|
219
|
+
licenseName: z.ZodDefault<z.ZodString>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
licenseId: string;
|
|
222
|
+
licenseName: string;
|
|
223
|
+
}, {
|
|
224
|
+
licenseId?: string | undefined;
|
|
225
|
+
licenseName?: string | undefined;
|
|
226
|
+
}>>, "many">>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
type: "licenseSearch";
|
|
229
|
+
meta: {
|
|
230
|
+
schemaVersion: string;
|
|
231
|
+
};
|
|
232
|
+
answer: {
|
|
233
|
+
licenseId: string;
|
|
234
|
+
licenseName: string;
|
|
235
|
+
}[];
|
|
236
|
+
}, {
|
|
237
|
+
type: "licenseSearch";
|
|
238
|
+
meta?: {
|
|
239
|
+
schemaVersion?: string | undefined;
|
|
240
|
+
} | undefined;
|
|
241
|
+
answer?: ({
|
|
242
|
+
licenseId?: string | undefined;
|
|
243
|
+
licenseName?: string | undefined;
|
|
244
|
+
} | undefined)[] | undefined;
|
|
245
|
+
}>, z.ZodObject<{
|
|
246
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
247
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
schemaVersion: string;
|
|
250
|
+
}, {
|
|
251
|
+
schemaVersion?: string | undefined;
|
|
252
|
+
}>>;
|
|
253
|
+
} & {
|
|
254
|
+
type: z.ZodLiteral<"metadataStandardSearch">;
|
|
255
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodObject<{
|
|
256
|
+
metadataStandardId: z.ZodDefault<z.ZodString>;
|
|
257
|
+
metadataStandardName: z.ZodDefault<z.ZodString>;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
metadataStandardId: string;
|
|
260
|
+
metadataStandardName: string;
|
|
261
|
+
}, {
|
|
262
|
+
metadataStandardId?: string | undefined;
|
|
263
|
+
metadataStandardName?: string | undefined;
|
|
264
|
+
}>>, "many">>;
|
|
265
|
+
}, "strip", z.ZodTypeAny, {
|
|
266
|
+
type: "metadataStandardSearch";
|
|
267
|
+
meta: {
|
|
268
|
+
schemaVersion: string;
|
|
269
|
+
};
|
|
270
|
+
answer: {
|
|
271
|
+
metadataStandardId: string;
|
|
272
|
+
metadataStandardName: string;
|
|
273
|
+
}[];
|
|
274
|
+
}, {
|
|
275
|
+
type: "metadataStandardSearch";
|
|
276
|
+
meta?: {
|
|
277
|
+
schemaVersion?: string | undefined;
|
|
278
|
+
} | undefined;
|
|
279
|
+
answer?: ({
|
|
280
|
+
metadataStandardId?: string | undefined;
|
|
281
|
+
metadataStandardName?: string | undefined;
|
|
282
|
+
} | undefined)[] | undefined;
|
|
283
|
+
}>, z.ZodObject<{
|
|
284
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
285
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
schemaVersion: string;
|
|
288
|
+
}, {
|
|
289
|
+
schemaVersion?: string | undefined;
|
|
290
|
+
}>>;
|
|
215
291
|
} & {
|
|
216
292
|
type: z.ZodLiteral<"multiselectBox">;
|
|
217
293
|
answer: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -319,6 +395,44 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
319
395
|
}, {
|
|
320
396
|
schemaVersion?: string | undefined;
|
|
321
397
|
}>>;
|
|
398
|
+
} & {
|
|
399
|
+
type: z.ZodLiteral<"repositorySearch">;
|
|
400
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodObject<{
|
|
401
|
+
repositoryId: z.ZodDefault<z.ZodString>;
|
|
402
|
+
repositoryName: z.ZodDefault<z.ZodString>;
|
|
403
|
+
}, "strip", z.ZodTypeAny, {
|
|
404
|
+
repositoryId: string;
|
|
405
|
+
repositoryName: string;
|
|
406
|
+
}, {
|
|
407
|
+
repositoryId?: string | undefined;
|
|
408
|
+
repositoryName?: string | undefined;
|
|
409
|
+
}>>, "many">>;
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
type: "repositorySearch";
|
|
412
|
+
meta: {
|
|
413
|
+
schemaVersion: string;
|
|
414
|
+
};
|
|
415
|
+
answer: {
|
|
416
|
+
repositoryId: string;
|
|
417
|
+
repositoryName: string;
|
|
418
|
+
}[];
|
|
419
|
+
}, {
|
|
420
|
+
type: "repositorySearch";
|
|
421
|
+
meta?: {
|
|
422
|
+
schemaVersion?: string | undefined;
|
|
423
|
+
} | undefined;
|
|
424
|
+
answer?: ({
|
|
425
|
+
repositoryId?: string | undefined;
|
|
426
|
+
repositoryName?: string | undefined;
|
|
427
|
+
} | undefined)[] | undefined;
|
|
428
|
+
}>, z.ZodObject<{
|
|
429
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
430
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
431
|
+
}, "strip", z.ZodTypeAny, {
|
|
432
|
+
schemaVersion: string;
|
|
433
|
+
}, {
|
|
434
|
+
schemaVersion?: string | undefined;
|
|
435
|
+
}>>;
|
|
322
436
|
} & {
|
|
323
437
|
type: z.ZodLiteral<"selectBox">;
|
|
324
438
|
answer: z.ZodDefault<z.ZodString>;
|
|
@@ -546,20 +660,73 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
546
660
|
schemaVersion?: string | undefined;
|
|
547
661
|
}>>;
|
|
548
662
|
} & {
|
|
549
|
-
type: z.ZodLiteral<"
|
|
550
|
-
answer: z.ZodDefault<z.ZodArray<z.
|
|
663
|
+
type: z.ZodLiteral<"licenseSearch">;
|
|
664
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodObject<{
|
|
665
|
+
licenseId: z.ZodDefault<z.ZodString>;
|
|
666
|
+
licenseName: z.ZodDefault<z.ZodString>;
|
|
667
|
+
}, "strip", z.ZodTypeAny, {
|
|
668
|
+
licenseId: string;
|
|
669
|
+
licenseName: string;
|
|
670
|
+
}, {
|
|
671
|
+
licenseId?: string | undefined;
|
|
672
|
+
licenseName?: string | undefined;
|
|
673
|
+
}>>, "many">>;
|
|
551
674
|
}, "strip", z.ZodTypeAny, {
|
|
552
|
-
type: "
|
|
675
|
+
type: "licenseSearch";
|
|
553
676
|
meta: {
|
|
554
677
|
schemaVersion: string;
|
|
555
678
|
};
|
|
556
|
-
answer:
|
|
679
|
+
answer: {
|
|
680
|
+
licenseId: string;
|
|
681
|
+
licenseName: string;
|
|
682
|
+
}[];
|
|
557
683
|
}, {
|
|
558
|
-
type: "
|
|
684
|
+
type: "licenseSearch";
|
|
559
685
|
meta?: {
|
|
560
686
|
schemaVersion?: string | undefined;
|
|
561
687
|
} | undefined;
|
|
562
|
-
answer?:
|
|
688
|
+
answer?: ({
|
|
689
|
+
licenseId?: string | undefined;
|
|
690
|
+
licenseName?: string | undefined;
|
|
691
|
+
} | undefined)[] | undefined;
|
|
692
|
+
}>, z.ZodObject<{
|
|
693
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
694
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
695
|
+
}, "strip", z.ZodTypeAny, {
|
|
696
|
+
schemaVersion: string;
|
|
697
|
+
}, {
|
|
698
|
+
schemaVersion?: string | undefined;
|
|
699
|
+
}>>;
|
|
700
|
+
} & {
|
|
701
|
+
type: z.ZodLiteral<"metadataStandardSearch">;
|
|
702
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodObject<{
|
|
703
|
+
metadataStandardId: z.ZodDefault<z.ZodString>;
|
|
704
|
+
metadataStandardName: z.ZodDefault<z.ZodString>;
|
|
705
|
+
}, "strip", z.ZodTypeAny, {
|
|
706
|
+
metadataStandardId: string;
|
|
707
|
+
metadataStandardName: string;
|
|
708
|
+
}, {
|
|
709
|
+
metadataStandardId?: string | undefined;
|
|
710
|
+
metadataStandardName?: string | undefined;
|
|
711
|
+
}>>, "many">>;
|
|
712
|
+
}, "strip", z.ZodTypeAny, {
|
|
713
|
+
type: "metadataStandardSearch";
|
|
714
|
+
meta: {
|
|
715
|
+
schemaVersion: string;
|
|
716
|
+
};
|
|
717
|
+
answer: {
|
|
718
|
+
metadataStandardId: string;
|
|
719
|
+
metadataStandardName: string;
|
|
720
|
+
}[];
|
|
721
|
+
}, {
|
|
722
|
+
type: "metadataStandardSearch";
|
|
723
|
+
meta?: {
|
|
724
|
+
schemaVersion?: string | undefined;
|
|
725
|
+
} | undefined;
|
|
726
|
+
answer?: ({
|
|
727
|
+
metadataStandardId?: string | undefined;
|
|
728
|
+
metadataStandardName?: string | undefined;
|
|
729
|
+
} | undefined)[] | undefined;
|
|
563
730
|
}>, z.ZodObject<{
|
|
564
731
|
meta: z.ZodDefault<z.ZodObject<{
|
|
565
732
|
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
@@ -614,6 +781,44 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
614
781
|
}, {
|
|
615
782
|
schemaVersion?: string | undefined;
|
|
616
783
|
}>>;
|
|
784
|
+
} & {
|
|
785
|
+
type: z.ZodLiteral<"numberWithContext">;
|
|
786
|
+
answer: z.ZodObject<{
|
|
787
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
788
|
+
context: z.ZodDefault<z.ZodString>;
|
|
789
|
+
}, "strip", z.ZodTypeAny, {
|
|
790
|
+
value: number;
|
|
791
|
+
context: string;
|
|
792
|
+
}, {
|
|
793
|
+
value?: number | undefined;
|
|
794
|
+
context?: string | undefined;
|
|
795
|
+
}>;
|
|
796
|
+
}, "strip", z.ZodTypeAny, {
|
|
797
|
+
type: "numberWithContext";
|
|
798
|
+
meta: {
|
|
799
|
+
schemaVersion: string;
|
|
800
|
+
};
|
|
801
|
+
answer: {
|
|
802
|
+
value: number;
|
|
803
|
+
context: string;
|
|
804
|
+
};
|
|
805
|
+
}, {
|
|
806
|
+
type: "numberWithContext";
|
|
807
|
+
answer: {
|
|
808
|
+
value?: number | undefined;
|
|
809
|
+
context?: string | undefined;
|
|
810
|
+
};
|
|
811
|
+
meta?: {
|
|
812
|
+
schemaVersion?: string | undefined;
|
|
813
|
+
} | undefined;
|
|
814
|
+
}>, z.ZodObject<{
|
|
815
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
816
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
817
|
+
}, "strip", z.ZodTypeAny, {
|
|
818
|
+
schemaVersion: string;
|
|
819
|
+
}, {
|
|
820
|
+
schemaVersion?: string | undefined;
|
|
821
|
+
}>>;
|
|
617
822
|
} & {
|
|
618
823
|
type: z.ZodLiteral<"radioButtons">;
|
|
619
824
|
answer: z.ZodDefault<z.ZodString>;
|
|
@@ -637,6 +842,44 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
637
842
|
}, {
|
|
638
843
|
schemaVersion?: string | undefined;
|
|
639
844
|
}>>;
|
|
845
|
+
} & {
|
|
846
|
+
type: z.ZodLiteral<"repositorySearch">;
|
|
847
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodObject<{
|
|
848
|
+
repositoryId: z.ZodDefault<z.ZodString>;
|
|
849
|
+
repositoryName: z.ZodDefault<z.ZodString>;
|
|
850
|
+
}, "strip", z.ZodTypeAny, {
|
|
851
|
+
repositoryId: string;
|
|
852
|
+
repositoryName: string;
|
|
853
|
+
}, {
|
|
854
|
+
repositoryId?: string | undefined;
|
|
855
|
+
repositoryName?: string | undefined;
|
|
856
|
+
}>>, "many">>;
|
|
857
|
+
}, "strip", z.ZodTypeAny, {
|
|
858
|
+
type: "repositorySearch";
|
|
859
|
+
meta: {
|
|
860
|
+
schemaVersion: string;
|
|
861
|
+
};
|
|
862
|
+
answer: {
|
|
863
|
+
repositoryId: string;
|
|
864
|
+
repositoryName: string;
|
|
865
|
+
}[];
|
|
866
|
+
}, {
|
|
867
|
+
type: "repositorySearch";
|
|
868
|
+
meta?: {
|
|
869
|
+
schemaVersion?: string | undefined;
|
|
870
|
+
} | undefined;
|
|
871
|
+
answer?: ({
|
|
872
|
+
repositoryId?: string | undefined;
|
|
873
|
+
repositoryName?: string | undefined;
|
|
874
|
+
} | undefined)[] | undefined;
|
|
875
|
+
}>, z.ZodObject<{
|
|
876
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
877
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
878
|
+
}, "strip", z.ZodTypeAny, {
|
|
879
|
+
schemaVersion: string;
|
|
880
|
+
}, {
|
|
881
|
+
schemaVersion?: string | undefined;
|
|
882
|
+
}>>;
|
|
640
883
|
} & {
|
|
641
884
|
type: z.ZodLiteral<"selectBox">;
|
|
642
885
|
answer: z.ZodDefault<z.ZodString>;
|
|
@@ -739,20 +982,41 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
739
982
|
end: string;
|
|
740
983
|
};
|
|
741
984
|
} | {
|
|
742
|
-
type: "
|
|
985
|
+
type: "affiliationSearch";
|
|
743
986
|
meta: {
|
|
744
987
|
schemaVersion: string;
|
|
745
988
|
};
|
|
746
|
-
answer:
|
|
989
|
+
answer: {
|
|
990
|
+
affiliationId: string;
|
|
991
|
+
affiliationName: string;
|
|
992
|
+
};
|
|
747
993
|
} | {
|
|
748
|
-
type: "
|
|
994
|
+
type: "licenseSearch";
|
|
749
995
|
meta: {
|
|
750
996
|
schemaVersion: string;
|
|
751
997
|
};
|
|
752
998
|
answer: {
|
|
753
|
-
|
|
754
|
-
|
|
999
|
+
licenseId: string;
|
|
1000
|
+
licenseName: string;
|
|
1001
|
+
}[];
|
|
1002
|
+
} | {
|
|
1003
|
+
type: "metadataStandardSearch";
|
|
1004
|
+
meta: {
|
|
1005
|
+
schemaVersion: string;
|
|
1006
|
+
};
|
|
1007
|
+
answer: {
|
|
1008
|
+
metadataStandardId: string;
|
|
1009
|
+
metadataStandardName: string;
|
|
1010
|
+
}[];
|
|
1011
|
+
} | {
|
|
1012
|
+
type: "repositorySearch";
|
|
1013
|
+
meta: {
|
|
1014
|
+
schemaVersion: string;
|
|
755
1015
|
};
|
|
1016
|
+
answer: {
|
|
1017
|
+
repositoryId: string;
|
|
1018
|
+
repositoryName: string;
|
|
1019
|
+
}[];
|
|
756
1020
|
} | {
|
|
757
1021
|
type: "boolean";
|
|
758
1022
|
meta: {
|
|
@@ -795,6 +1059,15 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
795
1059
|
schemaVersion: string;
|
|
796
1060
|
};
|
|
797
1061
|
answer: number;
|
|
1062
|
+
} | {
|
|
1063
|
+
type: "numberWithContext";
|
|
1064
|
+
meta: {
|
|
1065
|
+
schemaVersion: string;
|
|
1066
|
+
};
|
|
1067
|
+
answer: {
|
|
1068
|
+
value: number;
|
|
1069
|
+
context: string;
|
|
1070
|
+
};
|
|
798
1071
|
} | {
|
|
799
1072
|
type: "email";
|
|
800
1073
|
meta: {
|
|
@@ -836,12 +1109,6 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
836
1109
|
start?: string | undefined;
|
|
837
1110
|
end?: string | undefined;
|
|
838
1111
|
} | undefined;
|
|
839
|
-
} | {
|
|
840
|
-
type: "filteredSearch";
|
|
841
|
-
meta?: {
|
|
842
|
-
schemaVersion?: string | undefined;
|
|
843
|
-
} | undefined;
|
|
844
|
-
answer?: string[] | undefined;
|
|
845
1112
|
} | {
|
|
846
1113
|
type: "affiliationSearch";
|
|
847
1114
|
meta?: {
|
|
@@ -851,6 +1118,33 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
851
1118
|
affiliationId?: string | undefined;
|
|
852
1119
|
affiliationName?: string | undefined;
|
|
853
1120
|
} | undefined;
|
|
1121
|
+
} | {
|
|
1122
|
+
type: "licenseSearch";
|
|
1123
|
+
meta?: {
|
|
1124
|
+
schemaVersion?: string | undefined;
|
|
1125
|
+
} | undefined;
|
|
1126
|
+
answer?: ({
|
|
1127
|
+
licenseId?: string | undefined;
|
|
1128
|
+
licenseName?: string | undefined;
|
|
1129
|
+
} | undefined)[] | undefined;
|
|
1130
|
+
} | {
|
|
1131
|
+
type: "metadataStandardSearch";
|
|
1132
|
+
meta?: {
|
|
1133
|
+
schemaVersion?: string | undefined;
|
|
1134
|
+
} | undefined;
|
|
1135
|
+
answer?: ({
|
|
1136
|
+
metadataStandardId?: string | undefined;
|
|
1137
|
+
metadataStandardName?: string | undefined;
|
|
1138
|
+
} | undefined)[] | undefined;
|
|
1139
|
+
} | {
|
|
1140
|
+
type: "repositorySearch";
|
|
1141
|
+
meta?: {
|
|
1142
|
+
schemaVersion?: string | undefined;
|
|
1143
|
+
} | undefined;
|
|
1144
|
+
answer?: ({
|
|
1145
|
+
repositoryId?: string | undefined;
|
|
1146
|
+
repositoryName?: string | undefined;
|
|
1147
|
+
} | undefined)[] | undefined;
|
|
854
1148
|
} | {
|
|
855
1149
|
type: "boolean";
|
|
856
1150
|
meta?: {
|
|
@@ -893,6 +1187,15 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
893
1187
|
schemaVersion?: string | undefined;
|
|
894
1188
|
} | undefined;
|
|
895
1189
|
answer?: number | undefined;
|
|
1190
|
+
} | {
|
|
1191
|
+
type: "numberWithContext";
|
|
1192
|
+
answer: {
|
|
1193
|
+
value?: number | undefined;
|
|
1194
|
+
context?: string | undefined;
|
|
1195
|
+
};
|
|
1196
|
+
meta?: {
|
|
1197
|
+
schemaVersion?: string | undefined;
|
|
1198
|
+
} | undefined;
|
|
896
1199
|
} | {
|
|
897
1200
|
type: "email";
|
|
898
1201
|
meta?: {
|
|
@@ -941,20 +1244,41 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
941
1244
|
end: string;
|
|
942
1245
|
};
|
|
943
1246
|
} | {
|
|
944
|
-
type: "
|
|
1247
|
+
type: "affiliationSearch";
|
|
945
1248
|
meta: {
|
|
946
1249
|
schemaVersion: string;
|
|
947
1250
|
};
|
|
948
|
-
answer:
|
|
1251
|
+
answer: {
|
|
1252
|
+
affiliationId: string;
|
|
1253
|
+
affiliationName: string;
|
|
1254
|
+
};
|
|
949
1255
|
} | {
|
|
950
|
-
type: "
|
|
1256
|
+
type: "licenseSearch";
|
|
951
1257
|
meta: {
|
|
952
1258
|
schemaVersion: string;
|
|
953
1259
|
};
|
|
954
1260
|
answer: {
|
|
955
|
-
|
|
956
|
-
|
|
1261
|
+
licenseId: string;
|
|
1262
|
+
licenseName: string;
|
|
1263
|
+
}[];
|
|
1264
|
+
} | {
|
|
1265
|
+
type: "metadataStandardSearch";
|
|
1266
|
+
meta: {
|
|
1267
|
+
schemaVersion: string;
|
|
957
1268
|
};
|
|
1269
|
+
answer: {
|
|
1270
|
+
metadataStandardId: string;
|
|
1271
|
+
metadataStandardName: string;
|
|
1272
|
+
}[];
|
|
1273
|
+
} | {
|
|
1274
|
+
type: "repositorySearch";
|
|
1275
|
+
meta: {
|
|
1276
|
+
schemaVersion: string;
|
|
1277
|
+
};
|
|
1278
|
+
answer: {
|
|
1279
|
+
repositoryId: string;
|
|
1280
|
+
repositoryName: string;
|
|
1281
|
+
}[];
|
|
958
1282
|
} | {
|
|
959
1283
|
type: "boolean";
|
|
960
1284
|
meta: {
|
|
@@ -997,6 +1321,15 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
997
1321
|
schemaVersion: string;
|
|
998
1322
|
};
|
|
999
1323
|
answer: number;
|
|
1324
|
+
} | {
|
|
1325
|
+
type: "numberWithContext";
|
|
1326
|
+
meta: {
|
|
1327
|
+
schemaVersion: string;
|
|
1328
|
+
};
|
|
1329
|
+
answer: {
|
|
1330
|
+
value: number;
|
|
1331
|
+
context: string;
|
|
1332
|
+
};
|
|
1000
1333
|
} | {
|
|
1001
1334
|
type: "email";
|
|
1002
1335
|
meta: {
|
|
@@ -1045,12 +1378,6 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
1045
1378
|
start?: string | undefined;
|
|
1046
1379
|
end?: string | undefined;
|
|
1047
1380
|
} | undefined;
|
|
1048
|
-
} | {
|
|
1049
|
-
type: "filteredSearch";
|
|
1050
|
-
meta?: {
|
|
1051
|
-
schemaVersion?: string | undefined;
|
|
1052
|
-
} | undefined;
|
|
1053
|
-
answer?: string[] | undefined;
|
|
1054
1381
|
} | {
|
|
1055
1382
|
type: "affiliationSearch";
|
|
1056
1383
|
meta?: {
|
|
@@ -1060,6 +1387,33 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
1060
1387
|
affiliationId?: string | undefined;
|
|
1061
1388
|
affiliationName?: string | undefined;
|
|
1062
1389
|
} | undefined;
|
|
1390
|
+
} | {
|
|
1391
|
+
type: "licenseSearch";
|
|
1392
|
+
meta?: {
|
|
1393
|
+
schemaVersion?: string | undefined;
|
|
1394
|
+
} | undefined;
|
|
1395
|
+
answer?: ({
|
|
1396
|
+
licenseId?: string | undefined;
|
|
1397
|
+
licenseName?: string | undefined;
|
|
1398
|
+
} | undefined)[] | undefined;
|
|
1399
|
+
} | {
|
|
1400
|
+
type: "metadataStandardSearch";
|
|
1401
|
+
meta?: {
|
|
1402
|
+
schemaVersion?: string | undefined;
|
|
1403
|
+
} | undefined;
|
|
1404
|
+
answer?: ({
|
|
1405
|
+
metadataStandardId?: string | undefined;
|
|
1406
|
+
metadataStandardName?: string | undefined;
|
|
1407
|
+
} | undefined)[] | undefined;
|
|
1408
|
+
} | {
|
|
1409
|
+
type: "repositorySearch";
|
|
1410
|
+
meta?: {
|
|
1411
|
+
schemaVersion?: string | undefined;
|
|
1412
|
+
} | undefined;
|
|
1413
|
+
answer?: ({
|
|
1414
|
+
repositoryId?: string | undefined;
|
|
1415
|
+
repositoryName?: string | undefined;
|
|
1416
|
+
} | undefined)[] | undefined;
|
|
1063
1417
|
} | {
|
|
1064
1418
|
type: "boolean";
|
|
1065
1419
|
meta?: {
|
|
@@ -1102,6 +1456,15 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
1102
1456
|
schemaVersion?: string | undefined;
|
|
1103
1457
|
} | undefined;
|
|
1104
1458
|
answer?: number | undefined;
|
|
1459
|
+
} | {
|
|
1460
|
+
type: "numberWithContext";
|
|
1461
|
+
answer: {
|
|
1462
|
+
value?: number | undefined;
|
|
1463
|
+
context?: string | undefined;
|
|
1464
|
+
};
|
|
1465
|
+
meta?: {
|
|
1466
|
+
schemaVersion?: string | undefined;
|
|
1467
|
+
} | undefined;
|
|
1105
1468
|
} | {
|
|
1106
1469
|
type: "email";
|
|
1107
1470
|
meta?: {
|
|
@@ -1209,10 +1572,15 @@ export interface AnswerTypeMap {
|
|
|
1209
1572
|
date: DateAnswerType;
|
|
1210
1573
|
dateRange: DateRangeAnswerType;
|
|
1211
1574
|
email: EmailAnswerType;
|
|
1575
|
+
licenseSearch: LicenseSearchAnswerType;
|
|
1576
|
+
metadataStandardSearch: MetadataStandardSearchAnswerType;
|
|
1212
1577
|
multiselectBox: MultiselectBoxAnswerType;
|
|
1213
1578
|
number: NumberAnswerType;
|
|
1214
1579
|
numberRange: NumberRangeAnswerType;
|
|
1580
|
+
numberWithContext: NumberWithContextAnswerType;
|
|
1215
1581
|
radioButtons: RadioButtonsAnswerType;
|
|
1582
|
+
repositorySearch: RepositorySearchAnswerType;
|
|
1583
|
+
researchOutputTable: ResearchOutputTableAnswerType;
|
|
1216
1584
|
selectBox: SelectBoxAnswerType;
|
|
1217
1585
|
table: TableAnswerType;
|
|
1218
1586
|
text: TextAnswerType;
|
package/dist/answers/index.js
CHANGED
|
@@ -39,11 +39,13 @@ exports.AnyAnswerSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
39
39
|
dateAnswers_1.DateAnswerSchema,
|
|
40
40
|
dateAnswers_1.DateRangeAnswerSchema,
|
|
41
41
|
textAnswers_1.EmailAnswerSchema,
|
|
42
|
-
|
|
42
|
+
graphQLAnswers_1.LicenseSearchAnswerSchema,
|
|
43
|
+
graphQLAnswers_1.MetadataStandardSearchAnswerSchema,
|
|
43
44
|
optionBasedAnswers_1.MultiselectBoxAnswerSchema,
|
|
44
45
|
numberAnswers_1.NumberAnswerSchema,
|
|
45
46
|
numberAnswers_1.NumberRangeAnswerSchema,
|
|
46
47
|
optionBasedAnswers_1.RadioButtonsAnswerSchema,
|
|
48
|
+
graphQLAnswers_1.RepositorySearchAnswerSchema,
|
|
47
49
|
optionBasedAnswers_1.SelectBoxAnswerSchema,
|
|
48
50
|
tableAnswers_1.TableAnswerSchema,
|
|
49
51
|
textAnswers_1.TextAnswerSchema,
|
|
@@ -59,11 +61,15 @@ exports.AnswerSchemaMap = {
|
|
|
59
61
|
date: dateAnswers_1.DateAnswerSchema,
|
|
60
62
|
dateRange: dateAnswers_1.DateRangeAnswerSchema,
|
|
61
63
|
email: textAnswers_1.EmailAnswerSchema,
|
|
62
|
-
|
|
64
|
+
licenseSearch: graphQLAnswers_1.LicenseSearchAnswerSchema,
|
|
65
|
+
metadataStandardSearch: graphQLAnswers_1.MetadataStandardSearchAnswerSchema,
|
|
63
66
|
multiselectBox: optionBasedAnswers_1.MultiselectBoxAnswerSchema,
|
|
64
67
|
number: numberAnswers_1.NumberAnswerSchema,
|
|
65
68
|
numberRange: numberAnswers_1.NumberRangeAnswerSchema,
|
|
69
|
+
numberWithContext: numberAnswers_1.NumberWithContextAnswerSchema,
|
|
66
70
|
radioButtons: optionBasedAnswers_1.RadioButtonsAnswerSchema,
|
|
71
|
+
repositorySearch: graphQLAnswers_1.RepositorySearchAnswerSchema,
|
|
72
|
+
researchOutputTable: tableAnswers_1.ResearchOutputTableAnswerSchema,
|
|
67
73
|
selectBox: optionBasedAnswers_1.SelectBoxAnswerSchema,
|
|
68
74
|
table: tableAnswers_1.TableAnswerSchema,
|
|
69
75
|
text: textAnswers_1.TextAnswerSchema,
|
|
@@ -86,6 +86,46 @@ export declare const NumberRangeAnswerSchema: z.ZodObject<{
|
|
|
86
86
|
end?: number | undefined;
|
|
87
87
|
} | undefined;
|
|
88
88
|
}>;
|
|
89
|
+
export declare const NumberWithContextAnswerSchema: z.ZodObject<{
|
|
90
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
91
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
schemaVersion: string;
|
|
94
|
+
}, {
|
|
95
|
+
schemaVersion?: string | undefined;
|
|
96
|
+
}>>;
|
|
97
|
+
} & {
|
|
98
|
+
type: z.ZodLiteral<"numberWithContext">;
|
|
99
|
+
answer: z.ZodObject<{
|
|
100
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
101
|
+
context: z.ZodDefault<z.ZodString>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
value: number;
|
|
104
|
+
context: string;
|
|
105
|
+
}, {
|
|
106
|
+
value?: number | undefined;
|
|
107
|
+
context?: string | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
type: "numberWithContext";
|
|
111
|
+
meta: {
|
|
112
|
+
schemaVersion: string;
|
|
113
|
+
};
|
|
114
|
+
answer: {
|
|
115
|
+
value: number;
|
|
116
|
+
context: string;
|
|
117
|
+
};
|
|
118
|
+
}, {
|
|
119
|
+
type: "numberWithContext";
|
|
120
|
+
answer: {
|
|
121
|
+
value?: number | undefined;
|
|
122
|
+
context?: string | undefined;
|
|
123
|
+
};
|
|
124
|
+
meta?: {
|
|
125
|
+
schemaVersion?: string | undefined;
|
|
126
|
+
} | undefined;
|
|
127
|
+
}>;
|
|
89
128
|
export type CurrencyAnswerType = z.infer<typeof CurrencyAnswerSchema>;
|
|
90
129
|
export type NumberAnswerType = z.infer<typeof NumberAnswerSchema>;
|
|
91
130
|
export type NumberRangeAnswerType = z.infer<typeof NumberRangeAnswerSchema>;
|
|
131
|
+
export type NumberWithContextAnswerType = z.infer<typeof NumberWithContextAnswerSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NumberRangeAnswerSchema = exports.NumberAnswerSchema = exports.CurrencyAnswerSchema = void 0;
|
|
3
|
+
exports.NumberWithContextAnswerSchema = exports.NumberRangeAnswerSchema = exports.NumberAnswerSchema = exports.CurrencyAnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
// Answers to Number Question Types
|
|
@@ -19,3 +19,10 @@ exports.NumberRangeAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
|
19
19
|
end: zod_1.z.number().default(0) // The end number
|
|
20
20
|
}).default({})
|
|
21
21
|
}));
|
|
22
|
+
exports.NumberWithContextAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
23
|
+
type: zod_1.z.literal('numberWithContext'),
|
|
24
|
+
answer: zod_1.z.object({
|
|
25
|
+
value: zod_1.z.number().default(0),
|
|
26
|
+
context: zod_1.z.string().default('') // Additional context for the number
|
|
27
|
+
})
|
|
28
|
+
}));
|