@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
@@ -1,11 +1,10 @@
1
- import { DbDefaultSchema, NameIdLogoSchema, OtherValueSchema, SupportedExperienceLevels, } from "../common";
1
+ import { DbDefaultSchema, SupportedExperienceLevels, } from "../common";
2
2
  import { getSchemaByQuestion } from "../job/utils";
3
3
  import { LocationSchema } from "../location";
4
4
  import { MobileNumberSchema } from "../phone";
5
- import { AnswerChoiceType, QuestionType } from "../question";
6
5
  import { ResumeSchema } from "../resume";
7
6
  import { EducationSchema, WorkExperienceSchema, } from "../user";
8
- import { array, boolean, date, lazy, mixed, number, object, string, } from "../yup-extended";
7
+ import { array, boolean, date, lazy, number, object, string, } from "../yup-extended";
9
8
  import { JobApplicationStatus, SupportedJobApplicationScores, SupportedJobApplicationsStatuses, } from "./job-application.constant";
10
9
  export const JobApplicationSchema = object()
11
10
  .shape({
@@ -38,57 +37,60 @@ export const JobApplicationSchema = object()
38
37
  .default(JobApplicationStatus.Open)
39
38
  .label("Status"),
40
39
  questionnaire: array().of(lazy((question) => {
41
- const StringSchema = string().max(500);
42
- return getSchemaByQuestion(question.type).concat(object().shape({
43
- answers: mixed().when("type", {
44
- is: (type) => type === QuestionType.Input,
45
- then: () => lazy(() => {
46
- if (question.isOptional) {
47
- return StringSchema.optional().label("Answer");
48
- }
49
- else {
50
- return StringSchema.required().label("Answer");
51
- }
52
- }),
53
- otherwise: () => lazy(() => {
54
- const commonSchema = mixed().oneOfSchema([
55
- StringSchema,
56
- NameIdLogoSchema,
57
- OtherValueSchema,
58
- ]);
59
- if (question.answerChoiceType === AnswerChoiceType.Multiple) {
60
- return lazy(() => {
61
- const subCommonSchema = array().of(commonSchema);
62
- if (question.isOptional) {
63
- return subCommonSchema
64
- .optional()
65
- .default([])
66
- .label("Answer");
67
- }
68
- else {
69
- return subCommonSchema
70
- .default([])
71
- .min(1, "Select at least 1 option")
72
- .required("Select at least 1 option")
73
- .label("Answer");
74
- }
75
- });
76
- }
77
- else {
78
- return lazy(() => {
79
- if (question.isOptional) {
80
- return commonSchema.optional().label("Answer");
81
- }
82
- else {
83
- return commonSchema
84
- .required("Select an option")
85
- .label("Answer");
86
- }
87
- });
88
- }
89
- }),
90
- }),
91
- }));
40
+ // const StringSchema = string().max(500);
41
+ return getSchemaByQuestion(question.type);
42
+ // .concat(
43
+ // object().shape({
44
+ // answers: mixed<
45
+ // string | TNameIdLogoSchema | TOtherValueSchema
46
+ // >().when("type", {
47
+ // is: (type: QuestionType) => type === QuestionType.Input,
48
+ // then: () =>
49
+ // lazy(() => {
50
+ // if (question.isOptional) {
51
+ // return StringSchema.optional().label("Answer");
52
+ // } else {
53
+ // return StringSchema.required().label("Answer");
54
+ // }
55
+ // }),
56
+ // otherwise: () =>
57
+ // lazy(() => {
58
+ // const commonSchema = mixed().oneOfSchema([
59
+ // StringSchema,
60
+ // NameIdLogoSchema,
61
+ // OtherValueSchema,
62
+ // ]);
63
+ // if (question.answerChoiceType === AnswerChoiceType.Multiple) {
64
+ // return lazy(() => {
65
+ // const subCommonSchema = array().of(commonSchema);
66
+ // if (question.isOptional) {
67
+ // return subCommonSchema
68
+ // .optional()
69
+ // .default([])
70
+ // .label("Answer");
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
+ // } else {
80
+ // return lazy(() => {
81
+ // if (question.isOptional) {
82
+ // return commonSchema.optional().label("Answer");
83
+ // } else {
84
+ // return commonSchema
85
+ // .required("Select an option")
86
+ // .label("Answer");
87
+ // }
88
+ // });
89
+ // }
90
+ // }),
91
+ // }),
92
+ // })
93
+ // );
92
94
  })),
93
95
  history: array()
94
96
  .of(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,4 +1,4 @@
1
- import { object, string, boolean } from "../../yup-extended";
1
+ import { boolean, object, string } from "../../yup-extended";
2
2
  export const PageLocationSchema = object()
3
3
  .shape({
4
4
  isHeadquarters: boolean()
@@ -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"}
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { Common, NameIdLogoSchema, OtherValueSchema } from "../common";
3
- import { array, lazy, mixed, object, string, } from "../yup-extended";
4
- import { AnswerChoiceType, QuestionType, SupportedAnswerChoiceTypes, } from "./question.constant";
2
+ import { NameIdLogoSchema, OtherValueSchema, } from "../common";
3
+ import { array, lazy, mixed, object, string } from "../yup-extended";
4
+ import { AnswerChoiceType, QuestionType } from "./question.constant";
5
5
  import { QuestionSchema } from "./question.schema";
6
6
  // TODO: Refactor this to use string instead of objcts for values
7
7
  const displayByName = (option) => {
@@ -76,30 +76,57 @@ const ChoicePreferredAnswerSchema = (label = "Preferred answer") => mixed().when
76
76
  .optional()
77
77
  .label(label),
78
78
  });
79
- export const ChoiceQuestionSchema = (QuestionSchema.concat(object().shape({
79
+ const ChoiceAnswerSchema = lazy((question) => {
80
+ const commonSchema = mixed().oneOfSchema([
81
+ string().max(500),
82
+ NameIdLogoSchema,
83
+ OtherValueSchema,
84
+ ]);
85
+ if (question.answerChoiceType === AnswerChoiceType.Multiple) {
86
+ const multiAnswerSchema = array().of(commonSchema);
87
+ if (question.isOptional) {
88
+ return multiAnswerSchema.optional().default([]);
89
+ }
90
+ else {
91
+ return multiAnswerSchema
92
+ .min(1, "Select at least one option.")
93
+ .required("Select at least one option.")
94
+ .default([]);
95
+ }
96
+ }
97
+ else {
98
+ // Single choice
99
+ if (question.isOptional) {
100
+ return commonSchema.optional();
101
+ }
102
+ else {
103
+ return commonSchema.required("Select an option.");
104
+ }
105
+ }
106
+ });
107
+ export const ChoiceQuestionSchema = QuestionSchema.concat(object().shape({
80
108
  type: string()
81
109
  .oneOf([QuestionType.Choice])
82
110
  .required()
83
111
  .label("Question type"),
84
- optionsFrom: mixed()
85
- .oneOf([Common.Skill, Common.EducationLevel, Common.ExperienceLevel])
86
- .optional()
87
- .label("Option field"),
112
+ optionsFrom: string().optional().label("Options From"),
88
113
  options: array()
89
114
  .of(lazy((option) => {
90
115
  if (typeof option === "string") {
91
116
  return string();
92
117
  }
93
118
  else {
94
- return mixed().oneOfSchema([NameIdLogoSchema, OtherValueSchema]);
119
+ return mixed().oneOfSchema([
120
+ NameIdLogoSchema,
121
+ OtherValueSchema,
122
+ ]);
95
123
  }
96
124
  }))
97
125
  .min(1)
98
126
  .required()
99
127
  .label("Options"),
100
- answerChoiceType: string()
101
- .oneOf(SupportedAnswerChoiceTypes)
102
- .required()
103
- .label("Type"),
128
+ // preferredAnswer uses the existing validation
104
129
  preferredAnswer: ChoicePreferredAnswerSchema("Preferred answer"),
105
- })));
130
+ // The answers field now has its own complete validation logic
131
+ answers: ChoiceAnswerSchema,
132
+ }));
@@ -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"}
@@ -1,5 +1,18 @@
1
1
  import { object, string } from "../yup-extended";
2
+ import { QuestionType } from "./question.constant";
2
3
  import { QuestionSchema } from "./question.schema";
3
- export const InputQuestionSchema = (QuestionSchema.concat(object().shape({
4
+ export const InputQuestionSchema = QuestionSchema.concat(object().shape({
5
+ type: string()
6
+ .oneOf([QuestionType.Input])
7
+ .required()
8
+ .label("Question type"),
4
9
  preferredAnswer: string().max(100).optional().label("Preferred Answer"),
5
- })));
10
+ answers: string()
11
+ .max(500)
12
+ .when("isOptional", {
13
+ is: false,
14
+ then: (schema) => schema.required("This field is required."),
15
+ otherwise: (schema) => schema.optional(),
16
+ })
17
+ .label("Answer"),
18
+ }));
@@ -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"}
@@ -1,5 +1,5 @@
1
- import { array, boolean, mixed, object, string, } from "../yup-extended";
2
- import { AnswerChoiceType, SupportedAnswerChoiceTypes, SupportedQuestionTypes, } from "./question.constant";
1
+ import { boolean, object, string } from "../yup-extended";
2
+ import { SupportedQuestionTypes } from "./question.constant";
3
3
  export const QuestionSchema = object().shape({
4
4
  label: string().max(50).optional().label("Label"),
5
5
  default: boolean().optional().default(false).label("Default"),
@@ -7,16 +7,8 @@ export const QuestionSchema = object().shape({
7
7
  type: string().oneOf(SupportedQuestionTypes).required().label("Type"),
8
8
  isOptional: boolean().optional().label("Mark if the question is optional"),
9
9
  readonly: boolean().optional().label("Readonly"),
10
- preferredAnswer: mixed().optional().label("Preferred Answer"),
11
- optionsFrom: string().optional().label("Options From"),
12
- options: array().of(mixed()).optional().label("Options"),
13
- description: string().optional().label("Content"),
14
- answers: mixed().optional().label("Answer"),
15
- answerChoiceType: string()
16
- .oneOf(SupportedAnswerChoiceTypes)
17
- .required()
18
- .default(AnswerChoiceType.Single)
19
- .label("Answer Choice Type"),
20
10
  isNew: boolean().optional().label("Is New"),
21
11
  });
22
- //ljlkj
12
+ // Note: The TMixedValue and TQuestionSchema types might need adjustments
13
+ // depending on how you use them downstream, but this is the logical
14
+ // change for the schema itself.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thejob/schema",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",