@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.
Files changed (43) hide show
  1. package/dist/cjs/index.d.ts +0 -5
  2. package/dist/cjs/index.d.ts.map +1 -1
  3. package/dist/cjs/index.js +0 -5
  4. package/dist/cjs/interfaces.index.d.ts +50 -9
  5. package/dist/cjs/interfaces.index.d.ts.map +1 -1
  6. package/dist/cjs/job/job.schema.d.ts +14 -2
  7. package/dist/cjs/job/job.schema.d.ts.map +1 -1
  8. package/dist/cjs/job-application/job-application.schema.d.ts +15 -3
  9. package/dist/cjs/job-application/job-application.schema.d.ts.map +1 -1
  10. package/dist/cjs/job-role-template/job-role-template.schema.d.ts +14 -2
  11. package/dist/cjs/job-role-template/job-role-template.schema.d.ts.map +1 -1
  12. package/dist/cjs/question/choice-question.schema.d.ts +5 -2
  13. package/dist/cjs/question/choice-question.schema.d.ts.map +1 -1
  14. package/dist/cjs/question/choice-question.schema.js +10 -3
  15. package/dist/cjs/question/input-question.schema.d.ts +2 -2
  16. package/dist/cjs/question/input-question.schema.d.ts.map +1 -1
  17. package/dist/cjs/question/input-question.schema.js +3 -3
  18. package/dist/cjs/question/question.schema.js +5 -0
  19. package/dist/cjs/question/read-and-acknowledge.schema.d.ts +28 -3
  20. package/dist/cjs/question/read-and-acknowledge.schema.d.ts.map +1 -1
  21. package/dist/cjs/question/read-and-acknowledge.schema.js +13 -6
  22. package/dist/esm/index.d.ts +0 -5
  23. package/dist/esm/index.d.ts.map +1 -1
  24. package/dist/esm/index.js +0 -5
  25. package/dist/esm/interfaces.index.d.ts +50 -9
  26. package/dist/esm/interfaces.index.d.ts.map +1 -1
  27. package/dist/esm/job/job.schema.d.ts +14 -2
  28. package/dist/esm/job/job.schema.d.ts.map +1 -1
  29. package/dist/esm/job-application/job-application.schema.d.ts +15 -3
  30. package/dist/esm/job-application/job-application.schema.d.ts.map +1 -1
  31. package/dist/esm/job-role-template/job-role-template.schema.d.ts +14 -2
  32. package/dist/esm/job-role-template/job-role-template.schema.d.ts.map +1 -1
  33. package/dist/esm/question/choice-question.schema.d.ts +5 -2
  34. package/dist/esm/question/choice-question.schema.d.ts.map +1 -1
  35. package/dist/esm/question/choice-question.schema.js +12 -5
  36. package/dist/esm/question/input-question.schema.d.ts +2 -2
  37. package/dist/esm/question/input-question.schema.d.ts.map +1 -1
  38. package/dist/esm/question/input-question.schema.js +3 -3
  39. package/dist/esm/question/question.schema.js +5 -0
  40. package/dist/esm/question/read-and-acknowledge.schema.d.ts +28 -3
  41. package/dist/esm/question/read-and-acknowledge.schema.d.ts.map +1 -1
  42. package/dist/esm/question/read-and-acknowledge.schema.js +13 -6
  43. 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 { InferType, ObjectSchema } from "../yup-extended";
2
- import { TQuestionSchema } from "./question.schema";
3
- export declare const ReadAndAcknowledgeQuestionSchema: ObjectSchema<TQuestionSchema>;
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,SAAS,EAAU,YAAY,EAAU,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAkB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpE,eAAO,MAAM,gCAAgC,EAAI,YAAY,CAAC,eAAe,CAU5E,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,SAAS,CACvD,OAAO,gCAAgC,CACxC,CAAC"}
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
- export const ReadAndAcknowledgeQuestionSchema = (QuestionSchema.concat(object().shape({
5
- description: string().max(10000).required().label("Content"),
6
- preferredAnswer: string()
7
- .oneOf([Common.Yes, Common.No])
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("Preferred Answer"),
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
+ }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thejob/schema",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",