@thejob/schema 1.0.26 → 1.0.28

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 (55) hide show
  1. package/dist/cjs/common/common.schema.d.ts.map +1 -1
  2. package/dist/cjs/index.d.ts +5 -0
  3. package/dist/cjs/index.d.ts.map +1 -1
  4. package/dist/cjs/index.js +5 -0
  5. package/dist/cjs/interfaces.index.d.ts +103 -77
  6. package/dist/cjs/interfaces.index.d.ts.map +1 -1
  7. package/dist/cjs/job/job.schema.d.ts +23 -8
  8. package/dist/cjs/job/job.schema.d.ts.map +1 -1
  9. package/dist/cjs/job/job.schema.js +3 -1
  10. package/dist/cjs/job/utils.d.ts +3 -2
  11. package/dist/cjs/job/utils.d.ts.map +1 -1
  12. package/dist/cjs/job-application/job-application.schema.d.ts +19 -11
  13. package/dist/cjs/job-application/job-application.schema.d.ts.map +1 -1
  14. package/dist/cjs/job-application/job-application.schema.js +54 -52
  15. package/dist/cjs/job-role-template/job-role-template.schema.d.ts +23 -8
  16. package/dist/cjs/job-role-template/job-role-template.schema.d.ts.map +1 -1
  17. package/dist/cjs/page/page-location/page-location.schema.d.ts.map +1 -1
  18. package/dist/cjs/question/choice-question.schema.d.ts +44 -3
  19. package/dist/cjs/question/choice-question.schema.d.ts.map +1 -1
  20. package/dist/cjs/question/choice-question.schema.js +38 -11
  21. package/dist/cjs/question/input-question.schema.d.ts +26 -4
  22. package/dist/cjs/question/input-question.schema.d.ts.map +1 -1
  23. package/dist/cjs/question/input-question.schema.js +15 -2
  24. package/dist/cjs/question/question.schema.d.ts +2 -17
  25. package/dist/cjs/question/question.schema.d.ts.map +1 -1
  26. package/dist/cjs/question/question.schema.js +3 -11
  27. package/dist/esm/common/common.schema.d.ts.map +1 -1
  28. package/dist/esm/common/common.schema.js +1 -1
  29. package/dist/esm/index.d.ts +5 -0
  30. package/dist/esm/index.d.ts.map +1 -1
  31. package/dist/esm/index.js +5 -0
  32. package/dist/esm/interfaces.index.d.ts +103 -77
  33. package/dist/esm/interfaces.index.d.ts.map +1 -1
  34. package/dist/esm/job/job.schema.d.ts +23 -8
  35. package/dist/esm/job/job.schema.d.ts.map +1 -1
  36. package/dist/esm/job/job.schema.js +3 -1
  37. package/dist/esm/job/utils.d.ts +3 -2
  38. package/dist/esm/job/utils.d.ts.map +1 -1
  39. package/dist/esm/job-application/job-application.schema.d.ts +19 -11
  40. package/dist/esm/job-application/job-application.schema.d.ts.map +1 -1
  41. package/dist/esm/job-application/job-application.schema.js +56 -54
  42. package/dist/esm/job-role-template/job-role-template.schema.d.ts +23 -8
  43. package/dist/esm/job-role-template/job-role-template.schema.d.ts.map +1 -1
  44. package/dist/esm/page/page-location/page-location.schema.d.ts.map +1 -1
  45. package/dist/esm/page/page-location/page-location.schema.js +1 -1
  46. package/dist/esm/question/choice-question.schema.d.ts +44 -3
  47. package/dist/esm/question/choice-question.schema.d.ts.map +1 -1
  48. package/dist/esm/question/choice-question.schema.js +41 -14
  49. package/dist/esm/question/input-question.schema.d.ts +26 -4
  50. package/dist/esm/question/input-question.schema.d.ts.map +1 -1
  51. package/dist/esm/question/input-question.schema.js +15 -2
  52. package/dist/esm/question/question.schema.d.ts +2 -17
  53. package/dist/esm/question/question.schema.d.ts.map +1 -1
  54. package/dist/esm/question/question.schema.js +5 -13
  55. package/package.json +1 -1
@@ -5,7 +5,6 @@ const common_1 = require("../common");
5
5
  const utils_1 = require("../job/utils");
6
6
  const location_1 = require("../location");
7
7
  const phone_1 = require("../phone");
8
- const question_1 = require("../question");
9
8
  const resume_1 = require("../resume");
10
9
  const user_1 = require("../user");
11
10
  const yup_extended_1 = require("../yup-extended");
@@ -41,57 +40,60 @@ exports.JobApplicationSchema = (0, yup_extended_1.object)()
41
40
  .default(job_application_constant_1.JobApplicationStatus.Open)
42
41
  .label("Status"),
43
42
  questionnaire: (0, yup_extended_1.array)().of((0, yup_extended_1.lazy)((question) => {
44
- const StringSchema = (0, yup_extended_1.string)().max(500);
45
- return (0, utils_1.getSchemaByQuestion)(question.type).concat((0, yup_extended_1.object)().shape({
46
- answers: (0, yup_extended_1.mixed)().when("type", {
47
- is: (type) => type === question_1.QuestionType.Input,
48
- then: () => (0, yup_extended_1.lazy)(() => {
49
- if (question.isOptional) {
50
- return StringSchema.optional().label("Answer");
51
- }
52
- else {
53
- return StringSchema.required().label("Answer");
54
- }
55
- }),
56
- otherwise: () => (0, yup_extended_1.lazy)(() => {
57
- const commonSchema = (0, yup_extended_1.mixed)().oneOfSchema([
58
- StringSchema,
59
- common_1.NameIdLogoSchema,
60
- common_1.OtherValueSchema,
61
- ]);
62
- if (question.answerChoiceType === question_1.AnswerChoiceType.Multiple) {
63
- return (0, yup_extended_1.lazy)(() => {
64
- const subCommonSchema = (0, yup_extended_1.array)().of(commonSchema);
65
- if (question.isOptional) {
66
- return subCommonSchema
67
- .optional()
68
- .default([])
69
- .label("Answer");
70
- }
71
- else {
72
- return subCommonSchema
73
- .default([])
74
- .min(1, "Select at least 1 option")
75
- .required("Select at least 1 option")
76
- .label("Answer");
77
- }
78
- });
79
- }
80
- else {
81
- return (0, yup_extended_1.lazy)(() => {
82
- if (question.isOptional) {
83
- return commonSchema.optional().label("Answer");
84
- }
85
- else {
86
- return commonSchema
87
- .required("Select an option")
88
- .label("Answer");
89
- }
90
- });
91
- }
92
- }),
93
- }),
94
- }));
43
+ // const StringSchema = string().max(500);
44
+ return (0, utils_1.getSchemaByQuestion)(question.type);
45
+ // .concat(
46
+ // object().shape({
47
+ // answers: mixed<
48
+ // string | TNameIdLogoSchema | TOtherValueSchema
49
+ // >().when("type", {
50
+ // is: (type: QuestionType) => type === QuestionType.Input,
51
+ // then: () =>
52
+ // lazy(() => {
53
+ // if (question.isOptional) {
54
+ // return StringSchema.optional().label("Answer");
55
+ // } else {
56
+ // return StringSchema.required().label("Answer");
57
+ // }
58
+ // }),
59
+ // otherwise: () =>
60
+ // lazy(() => {
61
+ // const commonSchema = mixed().oneOfSchema([
62
+ // StringSchema,
63
+ // NameIdLogoSchema,
64
+ // OtherValueSchema,
65
+ // ]);
66
+ // if (question.answerChoiceType === AnswerChoiceType.Multiple) {
67
+ // return lazy(() => {
68
+ // const subCommonSchema = array().of(commonSchema);
69
+ // if (question.isOptional) {
70
+ // return subCommonSchema
71
+ // .optional()
72
+ // .default([])
73
+ // .label("Answer");
74
+ // } else {
75
+ // return subCommonSchema
76
+ // .default([])
77
+ // .min(1, "Select at least 1 option")
78
+ // .required("Select at least 1 option")
79
+ // .label("Answer");
80
+ // }
81
+ // });
82
+ // } else {
83
+ // return lazy(() => {
84
+ // if (question.isOptional) {
85
+ // return commonSchema.optional().label("Answer");
86
+ // } else {
87
+ // return commonSchema
88
+ // .required("Select an option")
89
+ // .label("Answer");
90
+ // }
91
+ // });
92
+ // }
93
+ // }),
94
+ // }),
95
+ // })
96
+ // );
95
97
  })),
96
98
  history: (0, yup_extended_1.array)()
97
99
  .of((0, yup_extended_1.object)().shape({
@@ -20,16 +20,32 @@ export declare const JobRoleTemplateSchema: import("yup").ObjectSchema<{
20
20
  otherValue: string | string[];
21
21
  } | undefined>;
22
22
  tags: any[] | undefined;
23
- questionnaire: {
24
- description?: string | undefined;
23
+ questionnaire: ({
25
24
  label?: string | undefined;
26
25
  isNew?: boolean | undefined;
27
26
  isOptional?: boolean | undefined;
28
27
  readonly?: boolean | undefined;
29
- preferredAnswer?: import("..").TMixedValue | undefined;
28
+ preferredAnswer?: string | undefined;
29
+ answers?: string | undefined;
30
+ type: import("..").QuestionType.Input;
31
+ default: boolean;
32
+ title: string;
33
+ } | {
34
+ label?: string | undefined;
35
+ isNew?: boolean | undefined;
36
+ isOptional?: boolean | undefined;
37
+ readonly?: boolean | undefined;
38
+ preferredAnswer?: import("..").TMixedValue | import("..").TMixedValue[] | undefined;
39
+ answers?: import("..").TMixedValue | (string | number | boolean | {
40
+ logo?: string | undefined;
41
+ name: string;
42
+ id: string;
43
+ } | {
44
+ value: "others" | (string | undefined)[];
45
+ otherValue: string | string[];
46
+ } | undefined)[] | undefined;
30
47
  optionsFrom?: string | undefined;
31
- answers?: import("..").TMixedValue | undefined;
32
- type: NonNullable<import("..").QuestionType | undefined>;
48
+ type: import("..").QuestionType.Choice;
33
49
  default: boolean;
34
50
  title: string;
35
51
  options: (string | {
@@ -39,9 +55,8 @@ export declare const JobRoleTemplateSchema: import("yup").ObjectSchema<{
39
55
  } | {
40
56
  value: "others" | (string | undefined)[];
41
57
  otherValue: string | string[];
42
- })[];
43
- answerChoiceType: NonNullable<import("..").AnswerChoiceType | undefined>;
44
- }[] | undefined;
58
+ } | undefined)[];
59
+ } | {})[] | undefined;
45
60
  }, import("yup").AnyObject, {
46
61
  headline: undefined;
47
62
  slug: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"job-role-template.schema.d.ts","sourceRoot":"","sources":["../../../src/job-role-template/job-role-template.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQhC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"job-role-template.schema.d.ts","sourceRoot":"","sources":["../../../src/job-role-template/job-role-template.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQhC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-location.schema.d.ts","sourceRoot":"","sources":["../../../../src/page/page-location/page-location.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,SAAS,EAAW,MAAM,oBAAoB,CAAC;AAExE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;MAgBD,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"page-location.schema.d.ts","sourceRoot":"","sources":["../../../../src/page/page-location/page-location.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA2B,MAAM,oBAAoB,CAAC;AAExE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;MAgBD,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1,5 +1,46 @@
1
- import { InferType, ObjectSchema } from "../yup-extended";
2
- import { TQuestionSchema } from "./question.schema";
3
- export declare const ChoiceQuestionSchema: ObjectSchema<TQuestionSchema>;
1
+ import { InferType } from "../yup-extended";
2
+ import { QuestionType } from "./question.constant";
3
+ import { TMixedValue } from "./question.schema";
4
+ export declare const ChoiceQuestionSchema: import("yup").ObjectSchema<{
5
+ label: string | undefined;
6
+ default: boolean;
7
+ title: string;
8
+ type: QuestionType.Choice;
9
+ isOptional: boolean | undefined;
10
+ readonly: boolean | undefined;
11
+ isNew: boolean | undefined;
12
+ } & {
13
+ type: QuestionType.Choice;
14
+ optionsFrom: string | undefined;
15
+ options: (string | {
16
+ logo?: string | undefined;
17
+ name: string;
18
+ id: string;
19
+ } | {
20
+ value: "others" | (string | undefined)[];
21
+ otherValue: string | string[];
22
+ } | undefined)[];
23
+ preferredAnswer: TMixedValue | TMixedValue[] | undefined;
24
+ answers: TMixedValue | (string | number | boolean | {
25
+ logo?: string | undefined;
26
+ name: string;
27
+ id: string;
28
+ } | {
29
+ value: "others" | (string | undefined)[];
30
+ otherValue: string | string[];
31
+ } | undefined)[] | undefined;
32
+ }, import("yup").AnyObject, {
33
+ label: undefined;
34
+ default: false;
35
+ title: undefined;
36
+ type: undefined;
37
+ isOptional: undefined;
38
+ readonly: undefined;
39
+ isNew: undefined;
40
+ optionsFrom: undefined;
41
+ options: "";
42
+ preferredAnswer: undefined;
43
+ answers: undefined;
44
+ }, "">;
4
45
  export type TChoiceQuestionSchema = InferType<typeof ChoiceQuestionSchema>;
5
46
  //# sourceMappingURL=choice-question.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"choice-question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/choice-question.schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,SAAS,EAIT,YAAY,EAEb,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAAkB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAiGpE,eAAO,MAAM,oBAAoB,EAAI,YAAY,CAAC,eAAe,CA+BhE,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"choice-question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/choice-question.schema.ts"],"names":[],"mappings":"AAOA,OAAO,EAAS,SAAS,EAA+B,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAoB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4HhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4BhC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -79,30 +79,57 @@ const ChoicePreferredAnswerSchema = (label = "Preferred answer") => (0, yup_exte
79
79
  .optional()
80
80
  .label(label),
81
81
  });
82
- exports.ChoiceQuestionSchema = (question_schema_1.QuestionSchema.concat((0, yup_extended_1.object)().shape({
82
+ const ChoiceAnswerSchema = (0, yup_extended_1.lazy)((question) => {
83
+ const commonSchema = (0, yup_extended_1.mixed)().oneOfSchema([
84
+ (0, yup_extended_1.string)().max(500),
85
+ common_1.NameIdLogoSchema,
86
+ common_1.OtherValueSchema,
87
+ ]);
88
+ if (question.answerChoiceType === question_constant_1.AnswerChoiceType.Multiple) {
89
+ const multiAnswerSchema = (0, yup_extended_1.array)().of(commonSchema);
90
+ if (question.isOptional) {
91
+ return multiAnswerSchema.optional().default([]);
92
+ }
93
+ else {
94
+ return multiAnswerSchema
95
+ .min(1, "Select at least one option.")
96
+ .required("Select at least one option.")
97
+ .default([]);
98
+ }
99
+ }
100
+ else {
101
+ // Single choice
102
+ if (question.isOptional) {
103
+ return commonSchema.optional();
104
+ }
105
+ else {
106
+ return commonSchema.required("Select an option.");
107
+ }
108
+ }
109
+ });
110
+ exports.ChoiceQuestionSchema = question_schema_1.QuestionSchema.concat((0, yup_extended_1.object)().shape({
83
111
  type: (0, yup_extended_1.string)()
84
112
  .oneOf([question_constant_1.QuestionType.Choice])
85
113
  .required()
86
114
  .label("Question type"),
87
- optionsFrom: (0, yup_extended_1.mixed)()
88
- .oneOf([common_1.Common.Skill, common_1.Common.EducationLevel, common_1.Common.ExperienceLevel])
89
- .optional()
90
- .label("Option field"),
115
+ optionsFrom: (0, yup_extended_1.string)().optional().label("Options From"),
91
116
  options: (0, yup_extended_1.array)()
92
117
  .of((0, yup_extended_1.lazy)((option) => {
93
118
  if (typeof option === "string") {
94
119
  return (0, yup_extended_1.string)();
95
120
  }
96
121
  else {
97
- return (0, yup_extended_1.mixed)().oneOfSchema([common_1.NameIdLogoSchema, common_1.OtherValueSchema]);
122
+ return (0, yup_extended_1.mixed)().oneOfSchema([
123
+ common_1.NameIdLogoSchema,
124
+ common_1.OtherValueSchema,
125
+ ]);
98
126
  }
99
127
  }))
100
128
  .min(1)
101
129
  .required()
102
130
  .label("Options"),
103
- answerChoiceType: (0, yup_extended_1.string)()
104
- .oneOf(question_constant_1.SupportedAnswerChoiceTypes)
105
- .required()
106
- .label("Type"),
131
+ // preferredAnswer uses the existing validation
107
132
  preferredAnswer: ChoicePreferredAnswerSchema("Preferred answer"),
108
- })));
133
+ // The answers field now has its own complete validation logic
134
+ answers: ChoiceAnswerSchema,
135
+ }));
@@ -1,5 +1,27 @@
1
- import { InferType, ObjectSchema } from "../yup-extended";
2
- import { TQuestionSchema } from "./question.schema";
3
- export declare const InputQuestionSchema: ObjectSchema<TQuestionSchema>;
4
- export type TInputQuestionSchema = Omit<InferType<typeof InputQuestionSchema>, "options">;
1
+ import { InferType } from "../yup-extended";
2
+ import { QuestionType } from "./question.constant";
3
+ export declare const InputQuestionSchema: import("yup").ObjectSchema<{
4
+ label: string | undefined;
5
+ default: boolean;
6
+ title: string;
7
+ type: QuestionType.Input;
8
+ isOptional: boolean | undefined;
9
+ readonly: boolean | undefined;
10
+ isNew: boolean | undefined;
11
+ } & {
12
+ type: QuestionType.Input;
13
+ preferredAnswer: string | undefined;
14
+ answers: string | undefined;
15
+ }, import("yup").AnyObject, {
16
+ label: undefined;
17
+ default: false;
18
+ title: undefined;
19
+ type: undefined;
20
+ isOptional: undefined;
21
+ readonly: undefined;
22
+ isNew: undefined;
23
+ preferredAnswer: undefined;
24
+ answers: undefined;
25
+ }, "">;
26
+ export type TInputQuestionSchema = InferType<typeof InputQuestionSchema>;
5
27
  //# sourceMappingURL=input-question.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/input-question.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,YAAY,EAAU,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAkB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpE,eAAO,MAAM,mBAAmB,EAAI,YAAY,CAAC,eAAe,CAM/D,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,SAAS,CAAC,OAAO,mBAAmB,CAAC,EACrC,SAAS,CACV,CAAC"}
1
+ {"version":3,"file":"input-question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/input-question.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;MAgB/B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -2,7 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InputQuestionSchema = void 0;
4
4
  const yup_extended_1 = require("../yup-extended");
5
+ const question_constant_1 = require("./question.constant");
5
6
  const question_schema_1 = require("./question.schema");
6
- exports.InputQuestionSchema = (question_schema_1.QuestionSchema.concat((0, yup_extended_1.object)().shape({
7
+ exports.InputQuestionSchema = question_schema_1.QuestionSchema.concat((0, yup_extended_1.object)().shape({
8
+ type: (0, yup_extended_1.string)()
9
+ .oneOf([question_constant_1.QuestionType.Input])
10
+ .required()
11
+ .label("Question type"),
7
12
  preferredAnswer: (0, yup_extended_1.string)().max(100).optional().label("Preferred Answer"),
8
- })));
13
+ answers: (0, yup_extended_1.string)()
14
+ .max(500)
15
+ .when("isOptional", {
16
+ is: false,
17
+ then: (schema) => schema.required("This field is required."),
18
+ otherwise: (schema) => schema.optional(),
19
+ })
20
+ .label("Answer"),
21
+ }));
@@ -1,7 +1,6 @@
1
1
  import { TNameIdLogoSchema, TOtherValueSchema } from "../common";
2
2
  import { InferType } from "../yup-extended";
3
- import { AnswerChoiceType } from "./question.constant";
4
- export type TMixedValue = string | boolean | number | TNameIdLogoSchema | TOtherValueSchema | Array<string | boolean | number | TNameIdLogoSchema | TOtherValueSchema>;
3
+ export type TMixedValue = string | boolean | number | TNameIdLogoSchema | TOtherValueSchema;
5
4
  export declare const QuestionSchema: import("yup").ObjectSchema<{
6
5
  label: string | undefined;
7
6
  default: boolean;
@@ -9,12 +8,6 @@ export declare const QuestionSchema: import("yup").ObjectSchema<{
9
8
  type: NonNullable<import("./question.constant").QuestionType | undefined>;
10
9
  isOptional: boolean | undefined;
11
10
  readonly: boolean | undefined;
12
- preferredAnswer: TMixedValue | undefined;
13
- optionsFrom: string | undefined;
14
- options: ({} | undefined)[] | undefined;
15
- description: string | undefined;
16
- answers: TMixedValue | undefined;
17
- answerChoiceType: NonNullable<AnswerChoiceType | undefined>;
18
11
  isNew: boolean | undefined;
19
12
  }, import("yup").AnyObject, {
20
13
  label: undefined;
@@ -23,15 +16,7 @@ export declare const QuestionSchema: import("yup").ObjectSchema<{
23
16
  type: undefined;
24
17
  isOptional: undefined;
25
18
  readonly: undefined;
26
- preferredAnswer: undefined;
27
- optionsFrom: undefined;
28
- options: "";
29
- description: undefined;
30
- answers: undefined;
31
- answerChoiceType: AnswerChoiceType.Single;
32
19
  isNew: undefined;
33
20
  }, "">;
34
- export type TQuestionSchema = Omit<InferType<typeof QuestionSchema>, "options"> & {
35
- options: Array<TNameIdLogoSchema | TOtherValueSchema | string>;
36
- };
21
+ export type TQuestionSchema = Omit<InferType<typeof QuestionSchema>, "options">;
37
22
  //# sourceMappingURL=question.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/question.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAGL,SAAS,EAIV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAGjB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,OAAO,GACP,MAAM,GACN,iBAAiB,GACjB,iBAAiB,GACjB,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;AAE7E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBzB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,CAAC,OAAO,cAAc,CAAC,EAChC,SAAS,CACV,GAAG;IACF,OAAO,EAAE,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,GAAG,MAAM,CAAC,CAAC;CAEhE,CAAC"}
1
+ {"version":3,"file":"question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/question.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAW,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAGrE,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,OAAO,GACP,MAAM,GACN,iBAAiB,GACjB,iBAAiB,CAAC;AAEtB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;MAQzB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC"}
@@ -10,16 +10,8 @@ exports.QuestionSchema = (0, yup_extended_1.object)().shape({
10
10
  type: (0, yup_extended_1.string)().oneOf(question_constant_1.SupportedQuestionTypes).required().label("Type"),
11
11
  isOptional: (0, yup_extended_1.boolean)().optional().label("Mark if the question is optional"),
12
12
  readonly: (0, yup_extended_1.boolean)().optional().label("Readonly"),
13
- preferredAnswer: (0, yup_extended_1.mixed)().optional().label("Preferred Answer"),
14
- optionsFrom: (0, yup_extended_1.string)().optional().label("Options From"),
15
- options: (0, yup_extended_1.array)().of((0, yup_extended_1.mixed)()).optional().label("Options"),
16
- description: (0, yup_extended_1.string)().optional().label("Content"),
17
- answers: (0, yup_extended_1.mixed)().optional().label("Answer"),
18
- answerChoiceType: (0, yup_extended_1.string)()
19
- .oneOf(question_constant_1.SupportedAnswerChoiceTypes)
20
- .required()
21
- .default(question_constant_1.AnswerChoiceType.Single)
22
- .label("Answer Choice Type"),
23
13
  isNew: (0, yup_extended_1.boolean)().optional().label("Is New"),
24
14
  });
25
- //ljlkj
15
+ // Note: The TMixedValue and TQuestionSchema types might need adjustments
16
+ // depending on how you use them downstream, but this is the logical
17
+ // change for the schema itself.
@@ -1 +1 @@
1
- {"version":3,"file":"common.schema.d.ts","sourceRoot":"","sources":["../../../src/common/common.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAQV,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,gBAAgB;;;;;;;;MAOlB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEnE,eAAO,MAAM,gBAAgB;;;;;;MAwBlB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEnE,eAAO,MAAM,uBAAuB;;;;MAIlC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAC9C,OAAO,uBAAuB,CAC/B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;MAYjB,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,eAAe,CAAC,CAAC;AAEjE,eAAO,MAAM,uBAAuB,GAAI,WAAU,MAAW;;;;;;;;MAKzD,CAAC;AAEL,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAC9C,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAC3C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;MAGnC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,CAC/C,OAAO,wBAAwB,CAChC,CAAC"}
1
+ {"version":3,"file":"common.schema.d.ts","sourceRoot":"","sources":["../../../src/common/common.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAKV,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,gBAAgB;;;;;;;;MAOlB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEnE,eAAO,MAAM,gBAAgB;;;;;;MAwBlB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEnE,eAAO,MAAM,uBAAuB;;;;MAIlC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAC9C,OAAO,uBAAuB,CAC/B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;MAYjB,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,eAAe,CAAC,CAAC;AAEjE,eAAO,MAAM,uBAAuB,GAAI,WAAU,MAAW;;;;;;;;MAKzD,CAAC;AAEL,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAC9C,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAC3C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;MAGnC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,CAC/C,OAAO,wBAAwB,CAChC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { object, string, array, boolean, lazy, number, } from "../yup-extended";
1
+ import { array, boolean, lazy, number, object, string, } from "../yup-extended";
2
2
  export const NameIdLogoSchema = object()
3
3
  .shape({
4
4
  id: string().objectId().required().label("Id"),
@@ -23,4 +23,9 @@ export * from "./group";
23
23
  export * from "./social-account";
24
24
  export * from "./yup-extended";
25
25
  export * from './interfaces.index';
26
+ export * from './interfaces.index';
27
+ export * from './interfaces.index';
28
+ export * from './interfaces.index';
29
+ export * from './interfaces.index';
30
+ export * from './interfaces.index';
26
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
package/dist/esm/index.js CHANGED
@@ -23,3 +23,8 @@ export * from "./group";
23
23
  export * from "./social-account";
24
24
  export * from "./yup-extended";
25
25
  export * from './interfaces.index';
26
+ export * from './interfaces.index';
27
+ export * from './interfaces.index';
28
+ export * from './interfaces.index';
29
+ export * from './interfaces.index';
30
+ export * from './interfaces.index';