@thejob/schema 1.0.30 → 1.0.32
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/dist/cjs/interfaces.index.d.ts +0 -6
- package/dist/cjs/interfaces.index.d.ts.map +1 -1
- package/dist/cjs/job/job.schema.d.ts +4 -6
- package/dist/cjs/job/job.schema.d.ts.map +1 -1
- package/dist/cjs/job/job.schema.js +18 -1
- package/dist/cjs/job/utils.d.ts +83 -2
- package/dist/cjs/job/utils.d.ts.map +1 -1
- package/dist/cjs/job-role-template/job-role-template.schema.d.ts +0 -3
- package/dist/cjs/job-role-template/job-role-template.schema.d.ts.map +1 -1
- package/dist/cjs/question/input-question.schema.d.ts.map +1 -1
- package/dist/cjs/question/input-question.schema.js +5 -4
- package/dist/esm/interfaces.index.d.ts +0 -6
- package/dist/esm/interfaces.index.d.ts.map +1 -1
- package/dist/esm/job/job.schema.d.ts +4 -6
- package/dist/esm/job/job.schema.d.ts.map +1 -1
- package/dist/esm/job/job.schema.js +18 -1
- package/dist/esm/job/utils.d.ts +83 -2
- package/dist/esm/job/utils.d.ts.map +1 -1
- package/dist/esm/job-role-template/job-role-template.schema.d.ts +0 -3
- package/dist/esm/job-role-template/job-role-template.schema.d.ts.map +1 -1
- package/dist/esm/question/input-question.schema.d.ts.map +1 -1
- package/dist/esm/question/input-question.schema.js +5 -4
- package/package.json +1 -1
package/dist/esm/job/utils.d.ts
CHANGED
|
@@ -1,4 +1,85 @@
|
|
|
1
1
|
import { ObjectSchema } from "yup";
|
|
2
|
-
import { QuestionType
|
|
3
|
-
export declare const getSchemaByQuestion: (type: QuestionType) => ObjectSchema<
|
|
2
|
+
import { QuestionType } from "../question";
|
|
3
|
+
export declare const getSchemaByQuestion: (type: QuestionType) => 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
|
+
}, ""> | ObjectSchema<{
|
|
26
|
+
label: string | undefined;
|
|
27
|
+
default: boolean;
|
|
28
|
+
title: string;
|
|
29
|
+
type: QuestionType.Choice;
|
|
30
|
+
isOptional: boolean | undefined;
|
|
31
|
+
readonly: boolean | undefined;
|
|
32
|
+
isNew: boolean | undefined;
|
|
33
|
+
} & {
|
|
34
|
+
type: QuestionType.Choice;
|
|
35
|
+
optionsFrom: import("..").Common.EducationLevel | import("..").Common.ExperienceLevel | import("..").Common.Skill | undefined;
|
|
36
|
+
options: (string | {
|
|
37
|
+
logo?: string | undefined;
|
|
38
|
+
name: string;
|
|
39
|
+
id: string;
|
|
40
|
+
} | {
|
|
41
|
+
value: "others" | (string | undefined)[];
|
|
42
|
+
otherValue: string | string[];
|
|
43
|
+
} | undefined)[];
|
|
44
|
+
answerChoiceType: NonNullable<import("../question").AnswerChoiceType | undefined>;
|
|
45
|
+
preferredAnswer: import("../question").TMixedValue | import("../question").TMixedValue[] | undefined;
|
|
46
|
+
answers: import("../question").TMixedValue | import("../question").TMixedValue[] | undefined;
|
|
47
|
+
}, import("yup").AnyObject, {
|
|
48
|
+
label: undefined;
|
|
49
|
+
default: false;
|
|
50
|
+
title: undefined;
|
|
51
|
+
type: undefined;
|
|
52
|
+
isOptional: undefined;
|
|
53
|
+
readonly: undefined;
|
|
54
|
+
isNew: undefined;
|
|
55
|
+
optionsFrom: undefined;
|
|
56
|
+
options: "";
|
|
57
|
+
answerChoiceType: import("../question").AnswerChoiceType.Single;
|
|
58
|
+
preferredAnswer: undefined;
|
|
59
|
+
answers: undefined;
|
|
60
|
+
}, ""> | ObjectSchema<{
|
|
61
|
+
label: string | undefined;
|
|
62
|
+
default: boolean;
|
|
63
|
+
title: string;
|
|
64
|
+
type: QuestionType.ReadAndAcknowledge;
|
|
65
|
+
isOptional: boolean | undefined;
|
|
66
|
+
readonly: boolean | undefined;
|
|
67
|
+
isNew: boolean | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
type: QuestionType.ReadAndAcknowledge;
|
|
70
|
+
description: string;
|
|
71
|
+
preferredAnswer: NonNullable<import("..").Common.Yes | import("..").Common.No | undefined>;
|
|
72
|
+
answers: NonNullable<import("..").Common.Yes | import("..").Common.No | undefined>;
|
|
73
|
+
}, import("yup").AnyObject, {
|
|
74
|
+
label: undefined;
|
|
75
|
+
default: false;
|
|
76
|
+
title: undefined;
|
|
77
|
+
type: undefined;
|
|
78
|
+
isOptional: undefined;
|
|
79
|
+
readonly: undefined;
|
|
80
|
+
isNew: undefined;
|
|
81
|
+
description: undefined;
|
|
82
|
+
preferredAnswer: undefined;
|
|
83
|
+
answers: undefined;
|
|
84
|
+
}, "">;
|
|
4
85
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/job/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAGL,YAAY,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/job/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAGL,YAAY,EAKb,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,mBAAmB,GAAI,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWrD,CAAC"}
|
|
@@ -26,7 +26,6 @@ export declare const JobRoleTemplateSchema: import("yup").ObjectSchema<{
|
|
|
26
26
|
isOptional?: boolean | undefined;
|
|
27
27
|
readonly?: boolean | undefined;
|
|
28
28
|
preferredAnswer?: string | undefined;
|
|
29
|
-
answers?: string | undefined;
|
|
30
29
|
type: import("..").QuestionType.Input;
|
|
31
30
|
default: boolean;
|
|
32
31
|
title: string;
|
|
@@ -36,7 +35,6 @@ export declare const JobRoleTemplateSchema: import("yup").ObjectSchema<{
|
|
|
36
35
|
isOptional?: boolean | undefined;
|
|
37
36
|
readonly?: boolean | undefined;
|
|
38
37
|
preferredAnswer?: import("..").TMixedValue | import("..").TMixedValue[] | undefined;
|
|
39
|
-
answers?: import("..").TMixedValue | import("..").TMixedValue[] | undefined;
|
|
40
38
|
optionsFrom?: import("..").Common.EducationLevel | import("..").Common.ExperienceLevel | import("..").Common.Skill | undefined;
|
|
41
39
|
type: import("..").QuestionType.Choice;
|
|
42
40
|
default: boolean;
|
|
@@ -60,7 +58,6 @@ export declare const JobRoleTemplateSchema: import("yup").ObjectSchema<{
|
|
|
60
58
|
description: string;
|
|
61
59
|
title: string;
|
|
62
60
|
preferredAnswer: NonNullable<import("..").Common.Yes | import("..").Common.No | undefined>;
|
|
63
|
-
answers: NonNullable<import("..").Common.Yes | import("..").Common.No | undefined>;
|
|
64
61
|
})[] | undefined;
|
|
65
62
|
}, import("yup").AnyObject, {
|
|
66
63
|
headline: 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
|
|
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":"input-question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/input-question.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAU,YAAY,EAAU,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"input-question.schema.d.ts","sourceRoot":"","sources":["../../../src/question/input-question.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAU,YAAY,EAAU,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;MAgB/B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -11,8 +11,9 @@ export const InputQuestionSchema = QuestionSchema.concat(object().shape({
|
|
|
11
11
|
answers: string()
|
|
12
12
|
.max(500)
|
|
13
13
|
.when("isOptional", {
|
|
14
|
-
is:
|
|
15
|
-
then: (schema) => schema.
|
|
16
|
-
otherwise: (schema) => schema.
|
|
17
|
-
})
|
|
14
|
+
is: (isOptional) => Boolean(isOptional),
|
|
15
|
+
then: (schema) => schema.optional(),
|
|
16
|
+
otherwise: (schema) => schema.required(),
|
|
17
|
+
})
|
|
18
|
+
.label("Answer"),
|
|
18
19
|
}));
|