@thejob/schema 1.0.28 → 1.0.29
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/index.d.ts +0 -5
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +0 -5
- package/dist/cjs/interfaces.index.d.ts +50 -9
- package/dist/cjs/interfaces.index.d.ts.map +1 -1
- package/dist/cjs/job/job.schema.d.ts +14 -2
- package/dist/cjs/job/job.schema.d.ts.map +1 -1
- package/dist/cjs/job-application/job-application.schema.d.ts +15 -3
- package/dist/cjs/job-application/job-application.schema.d.ts.map +1 -1
- package/dist/cjs/job-role-template/job-role-template.schema.d.ts +14 -2
- package/dist/cjs/job-role-template/job-role-template.schema.d.ts.map +1 -1
- package/dist/cjs/question/choice-question.schema.d.ts +5 -2
- package/dist/cjs/question/choice-question.schema.d.ts.map +1 -1
- package/dist/cjs/question/choice-question.schema.js +10 -3
- package/dist/cjs/question/input-question.schema.d.ts +2 -2
- package/dist/cjs/question/input-question.schema.d.ts.map +1 -1
- package/dist/cjs/question/input-question.schema.js +3 -3
- package/dist/cjs/question/question.schema.js +5 -0
- package/dist/cjs/question/read-and-acknowledge.schema.d.ts +28 -3
- package/dist/cjs/question/read-and-acknowledge.schema.d.ts.map +1 -1
- package/dist/cjs/question/read-and-acknowledge.schema.js +13 -6
- package/dist/esm/index.d.ts +0 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -5
- package/dist/esm/interfaces.index.d.ts +50 -9
- package/dist/esm/interfaces.index.d.ts.map +1 -1
- package/dist/esm/job/job.schema.d.ts +14 -2
- package/dist/esm/job/job.schema.d.ts.map +1 -1
- package/dist/esm/job-application/job-application.schema.d.ts +15 -3
- package/dist/esm/job-application/job-application.schema.d.ts.map +1 -1
- package/dist/esm/job-role-template/job-role-template.schema.d.ts +14 -2
- package/dist/esm/job-role-template/job-role-template.schema.d.ts.map +1 -1
- package/dist/esm/question/choice-question.schema.d.ts +5 -2
- package/dist/esm/question/choice-question.schema.d.ts.map +1 -1
- package/dist/esm/question/choice-question.schema.js +12 -5
- package/dist/esm/question/input-question.schema.d.ts +2 -2
- package/dist/esm/question/input-question.schema.d.ts.map +1 -1
- package/dist/esm/question/input-question.schema.js +3 -3
- package/dist/esm/question/question.schema.js +5 -0
- package/dist/esm/question/read-and-acknowledge.schema.d.ts +28 -3
- package/dist/esm/question/read-and-acknowledge.schema.d.ts.map +1 -1
- package/dist/esm/question/read-and-acknowledge.schema.js +13 -6
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
// input-question.schema.ts
|
|
1
2
|
import { object, string } from "../yup-extended";
|
|
2
|
-
import { QuestionType } from "./question.constant";
|
|
3
3
|
import { QuestionSchema } from "./question.schema";
|
|
4
|
+
import { QuestionType } from "./question.constant";
|
|
4
5
|
export const InputQuestionSchema = QuestionSchema.concat(object().shape({
|
|
5
6
|
type: string()
|
|
6
7
|
.oneOf([QuestionType.Input])
|
|
@@ -13,6 +14,5 @@ export const InputQuestionSchema = QuestionSchema.concat(object().shape({
|
|
|
13
14
|
is: false,
|
|
14
15
|
then: (schema) => schema.required("This field is required."),
|
|
15
16
|
otherwise: (schema) => schema.optional(),
|
|
16
|
-
})
|
|
17
|
-
.label("Answer"),
|
|
17
|
+
}),
|
|
18
18
|
}));
|
|
@@ -9,6 +9,11 @@ export const QuestionSchema = object().shape({
|
|
|
9
9
|
readonly: boolean().optional().label("Readonly"),
|
|
10
10
|
isNew: boolean().optional().label("Is New"),
|
|
11
11
|
});
|
|
12
|
+
// export type TQuestionnaire = (
|
|
13
|
+
// | TInputQuestionSchema
|
|
14
|
+
// | TChoiceQuestionSchema
|
|
15
|
+
// | TReadAndAcknowledgeQuestionSchema
|
|
16
|
+
// )[];
|
|
12
17
|
// Note: The TMixedValue and TQuestionSchema types might need adjustments
|
|
13
18
|
// depending on how you use them downstream, but this is the logical
|
|
14
19
|
// change for the schema itself.
|
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Common } from "../common";
|
|
2
|
+
import { InferType } from "../yup-extended";
|
|
3
|
+
import { QuestionType } from "./question.constant";
|
|
4
|
+
export declare const ReadAndAcknowledgeQuestionSchema: import("yup").ObjectSchema<{
|
|
5
|
+
label: string | undefined;
|
|
6
|
+
default: boolean;
|
|
7
|
+
title: string;
|
|
8
|
+
type: QuestionType.ReadAndAcknowledge;
|
|
9
|
+
isOptional: boolean | undefined;
|
|
10
|
+
readonly: boolean | undefined;
|
|
11
|
+
isNew: boolean | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
type: QuestionType.ReadAndAcknowledge;
|
|
14
|
+
description: string;
|
|
15
|
+
preferredAnswer: NonNullable<Common.Yes | Common.No | undefined>;
|
|
16
|
+
answers: NonNullable<Common.Yes | Common.No | undefined>;
|
|
17
|
+
}, import("yup").AnyObject, {
|
|
18
|
+
label: undefined;
|
|
19
|
+
default: false;
|
|
20
|
+
title: undefined;
|
|
21
|
+
type: undefined;
|
|
22
|
+
isOptional: undefined;
|
|
23
|
+
readonly: undefined;
|
|
24
|
+
isNew: undefined;
|
|
25
|
+
description: undefined;
|
|
26
|
+
preferredAnswer: undefined;
|
|
27
|
+
answers: undefined;
|
|
28
|
+
}, "">;
|
|
4
29
|
export type TReadAndAcknowledgeQuestionSchema = InferType<typeof ReadAndAcknowledgeQuestionSchema>;
|
|
5
30
|
//# sourceMappingURL=read-and-acknowledge.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-and-acknowledge.schema.d.ts","sourceRoot":"","sources":["../../../src/question/read-and-acknowledge.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"read-and-acknowledge.schema.d.ts","sourceRoot":"","sources":["../../../src/question/read-and-acknowledge.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;MAU5C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,SAAS,CACvD,OAAO,gCAAgC,CACxC,CAAC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
// read-and-acknowledge-question.schema.ts
|
|
1
2
|
import { Common } from "../common";
|
|
2
3
|
import { object, string } from "../yup-extended";
|
|
4
|
+
import { QuestionType } from "./question.constant";
|
|
3
5
|
import { QuestionSchema } from "./question.schema";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const AcknowledgeAnswerSchema = string()
|
|
7
|
+
.oneOf([Common.Yes, Common.No])
|
|
8
|
+
.required("This question must be acknowledged.");
|
|
9
|
+
export const ReadAndAcknowledgeQuestionSchema = QuestionSchema.concat(object().shape({
|
|
10
|
+
type: string()
|
|
11
|
+
.oneOf([QuestionType.ReadAndAcknowledge])
|
|
8
12
|
.required()
|
|
9
|
-
.label("
|
|
10
|
-
|
|
13
|
+
.label("Question type"),
|
|
14
|
+
description: string().max(10000).required().label("Content"),
|
|
15
|
+
preferredAnswer: AcknowledgeAnswerSchema.label("Preferred Answer"),
|
|
16
|
+
answers: AcknowledgeAnswerSchema.label("Answer"),
|
|
17
|
+
}));
|