@goat-it/schemas 0.0.21-beta → 0.0.22-beta

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 (24) hide show
  1. package/dist/src/contexts/question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape.d.mts +1 -1
  2. package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.d.mts +2 -0
  3. package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs +2 -1
  4. package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs.map +1 -1
  5. package/dist/src/contexts/question/application/dto/find-questions-query/find-questions-query.dto.shape.d.mts +1 -1
  6. package/dist/src/contexts/question/application/dto/find-random-questions-body/find-random-questions-body.dto.shape.d.mts +4 -4
  7. package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.d.mts +2 -0
  8. package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.mjs +3 -2
  9. package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.mjs.map +1 -1
  10. package/dist/src/contexts/question/application/dto/question-modification/question-modification.dto.shape.d.mts +2 -0
  11. package/dist/src/contexts/question/application/dto/question-modification/question-modification.dto.shape.mjs +3 -2
  12. package/dist/src/contexts/question/application/dto/question-modification/question-modification.dto.shape.mjs.map +1 -1
  13. package/dist/src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.mjs +5 -1
  14. package/dist/src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.mjs.map +1 -1
  15. package/dist/src/shared/domain/value-objects/locale/locale.types.d.mts +3 -1
  16. package/dist/src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs +1 -1
  17. package/dist/src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs.map +1 -1
  18. package/dist/tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.mjs +5 -0
  19. package/dist/tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.mjs.map +1 -1
  20. package/dist/tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.mjs +5 -0
  21. package/dist/tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.mjs.map +1 -1
  22. package/dist/tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.mjs +5 -0
  23. package/dist/tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.mjs.map +1 -1
  24. package/package.json +4 -4
@@ -16,7 +16,7 @@ declare const ADMIN_FIND_QUESTIONS_QUERY_DTO: z.ZodObject<{
16
16
  category: z.ZodOptional<z.ZodEnum<QuestionCategoryEnum>>;
17
17
  "cognitive-difficulty": z.ZodOptional<z.ZodEnum<QuestionCognitiveDifficultyEnum>>;
18
18
  "author-role": z.ZodOptional<z.ZodEnum<QuestionAuthorRoleEnum>>;
19
- "theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>>>;
19
+ "theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
20
20
  "is-fully-translated": z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
21
21
  }, z.core.$strip>;
22
22
  type AdminFindQuestionsQueryDto = z.infer<typeof ADMIN_FIND_QUESTIONS_QUERY_DTO>;
@@ -1,4 +1,5 @@
1
1
  import { QuestionThemeStatusEnum } from "../../../../question-theme/domain/types/question-theme.value-objects.mjs";
2
+ import { LocaleEnum } from "../../../../../shared/domain/value-objects/locale/locale.types.mjs";
2
3
  import { QuestionCategoryEnum, QuestionCognitiveDifficultyEnum, QuestionStatusEnum } from "../../../domain/types/question.value-objects.mjs";
3
4
  import { z } from "zod";
4
5
  //#region ../../src/contexts/question/application/dto/admin-question/admin-question.dto.shape.d.ts
@@ -48,6 +49,7 @@ declare const ADMIN_QUESTION_DTO: z.ZodObject<{
48
49
  comment: z.ZodOptional<z.ZodString>;
49
50
  }, z.core.$strict>>;
50
51
  sourceUrls: z.ZodArray<z.ZodURL>;
52
+ applicableLocales: z.ZodOptional<z.ZodArray<z.ZodEnum<LocaleEnum>>>;
51
53
  createdAt: z.ZodISODateTime;
52
54
  updatedAt: z.ZodISODateTime;
53
55
  }, z.core.$strict>;
@@ -1,5 +1,5 @@
1
1
  import "../../../domain/constants/question.constants.mjs";
2
- import { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from "../shared/zod/validators/question.dto.zod.validators.mjs";
2
+ import { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from "../shared/zod/validators/question.dto.zod.validators.mjs";
3
3
  import { ADMIN_QUESTION_CONTENT_DTO } from "./admin-question-content/admin-question-content.dto.shape.mjs";
4
4
  import { ADMIN_QUESTION_THEME_ASSIGNMENT_DTO } from "./admin-question-theme-assignment/admin-question-theme-assignment.dto.shape.mjs";
5
5
  import { QUESTION_REJECTION_DTO } from "../shared/question-rejection/question-rejection.dto.shape.mjs";
@@ -16,6 +16,7 @@ const ADMIN_QUESTION_DTO = z.strictObject({
16
16
  status: zQuestionStatus(),
17
17
  rejection: QUESTION_REJECTION_DTO.optional().describe("Question's rejection details, if applicable"),
18
18
  sourceUrls: zQuestionSourceUrls(),
19
+ applicableLocales: zQuestionApplicableLocales(0).describe("Subset of locales this question is relevant for, if restricted"),
19
20
  createdAt: zQuestionCreatedAt(),
20
21
  updatedAt: zQuestionUpdatedAt()
21
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"admin-question.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/admin-question/admin-question.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { ADMIN_QUESTION_THEME_ASSIGNMENT_DTO } from \"@question/application/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.shape\";\nimport { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_REJECTION_DTO } from \"@question/application/dto/shared/question-rejection/question-rejection.dto.shape\";\nimport { QUESTION_AUTHOR_DTO } from \"@question/application/dto/shared/question-author/question-author.dto.shape\";\nimport { ADMIN_QUESTION_CONTENT_DTO } from \"@question/application/dto/admin-question/admin-question-content/admin-question-content.dto.shape\";\n\nconst ADMIN_QUESTION_DTO = z.strictObject({\n id: zQuestionId(),\n category: zQuestionCategory(),\n themes: z.array(ADMIN_QUESTION_THEME_ASSIGNMENT_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .describe(\"Question's themes\"),\n content: ADMIN_QUESTION_CONTENT_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_DTO,\n status: zQuestionStatus(),\n rejection: QUESTION_REJECTION_DTO\n .optional()\n .describe(\"Question's rejection details, if applicable\"),\n sourceUrls: zQuestionSourceUrls(),\n createdAt: zQuestionCreatedAt(),\n updatedAt: zQuestionUpdatedAt(),\n});\n\nexport type AdminQuestionDto = z.infer<typeof ADMIN_QUESTION_DTO>;\n\nexport { ADMIN_QUESTION_DTO };"],"mappings":";;;;;;;;AASA,MAAM,qBAAqB,EAAE,aAAa;CACxC,IAAI,YAAY;CAChB,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,mCAAmC,CAAC,CACjD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,QAAQ,gBAAgB;CACxB,WAAW,uBACR,SAAS,CAAC,CACV,SAAS,6CAA6C;CACzD,YAAY,oBAAoB;CAChC,WAAW,mBAAmB;CAC9B,WAAW,mBAAmB;AAChC,CAAC"}
1
+ {"version":3,"file":"admin-question.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/admin-question/admin-question.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { ADMIN_QUESTION_THEME_ASSIGNMENT_DTO } from \"@question/application/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.shape\";\nimport { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_REJECTION_DTO } from \"@question/application/dto/shared/question-rejection/question-rejection.dto.shape\";\nimport { QUESTION_AUTHOR_DTO } from \"@question/application/dto/shared/question-author/question-author.dto.shape\";\nimport { ADMIN_QUESTION_CONTENT_DTO } from \"@question/application/dto/admin-question/admin-question-content/admin-question-content.dto.shape\";\n\nconst ADMIN_QUESTION_DTO = z.strictObject({\n id: zQuestionId(),\n category: zQuestionCategory(),\n themes: z.array(ADMIN_QUESTION_THEME_ASSIGNMENT_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .describe(\"Question's themes\"),\n content: ADMIN_QUESTION_CONTENT_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_DTO,\n status: zQuestionStatus(),\n rejection: QUESTION_REJECTION_DTO\n .optional()\n .describe(\"Question's rejection details, if applicable\"),\n sourceUrls: zQuestionSourceUrls(),\n applicableLocales: zQuestionApplicableLocales(0)\n .describe(\"Subset of locales this question is relevant for, if restricted\"),\n createdAt: zQuestionCreatedAt(),\n updatedAt: zQuestionUpdatedAt(),\n});\n\nexport type AdminQuestionDto = z.infer<typeof ADMIN_QUESTION_DTO>;\n\nexport { ADMIN_QUESTION_DTO };"],"mappings":";;;;;;;;AASA,MAAM,qBAAqB,EAAE,aAAa;CACxC,IAAI,YAAY;CAChB,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,mCAAmC,CAAC,CACjD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,QAAQ,gBAAgB;CACxB,WAAW,uBACR,SAAS,CAAC,CACV,SAAS,6CAA6C;CACzD,YAAY,oBAAoB;CAChC,mBAAmB,2BAA2B,CAAC,CAAC,CAC7C,SAAS,gEAAgE;CAC5E,WAAW,mBAAmB;CAC9B,WAAW,mBAAmB;AAChC,CAAC"}
@@ -14,7 +14,7 @@ declare const FIND_QUESTIONS_QUERY_DTO: z.ZodObject<{
14
14
  category: z.ZodOptional<z.ZodEnum<QuestionCategoryEnum>>;
15
15
  "cognitive-difficulty": z.ZodOptional<z.ZodEnum<QuestionCognitiveDifficultyEnum>>;
16
16
  "author-role": z.ZodOptional<z.ZodEnum<QuestionAuthorRoleEnum>>;
17
- "theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>>>;
17
+ "theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
18
18
  }, z.core.$strip>;
19
19
  type FindQuestionsQueryDto = z.infer<typeof FIND_QUESTIONS_QUERY_DTO>;
20
20
  //#endregion
@@ -3,10 +3,10 @@ import { z } from "zod";
3
3
  //#region ../../src/contexts/question/application/dto/find-random-questions-body/find-random-questions-body.dto.shape.d.ts
4
4
  declare const FIND_RANDOM_QUESTIONS_BODY_DTO: z.ZodObject<{
5
5
  limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6
- excludedIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>>>;
7
- categories: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCategoryEnum>>>>;
8
- cognitiveDifficulties: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCognitiveDifficultyEnum>>>>;
9
- themeIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>>>;
6
+ excludedIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
7
+ categories: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCategoryEnum>>, unknown>>;
8
+ cognitiveDifficulties: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCognitiveDifficultyEnum>>, unknown>>;
9
+ themeIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
10
10
  }, z.core.$strip>;
11
11
  type FindRandomQuestionsBodyDto = z.infer<typeof FIND_RANDOM_QUESTIONS_BODY_DTO>;
12
12
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { LocaleEnum } from "../../../../../shared/domain/value-objects/locale/locale.types.mjs";
1
2
  import { QuestionCategoryEnum, QuestionCognitiveDifficultyEnum } from "../../../domain/types/question.value-objects.mjs";
2
3
  import { z } from "zod";
3
4
  //#region ../../src/contexts/question/application/dto/question-creation/question-creation.dto.shape.d.ts
@@ -23,6 +24,7 @@ declare const QUESTION_CREATION_DTO: z.ZodObject<{
23
24
  name: z.ZodString;
24
25
  }, z.core.$strip>;
25
26
  sourceUrls: z.ZodArray<z.ZodURL>;
27
+ applicableLocales: z.ZodOptional<z.ZodArray<z.ZodEnum<LocaleEnum>>>;
26
28
  }, z.core.$strip>;
27
29
  type QuestionCreationDto = z.infer<typeof QUESTION_CREATION_DTO>;
28
30
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import "../../../domain/constants/question.constants.mjs";
2
2
  import { areValuesUniqueByKey, hasExactlyOneByKey } from "../../../../../shared/application/dto/zod/refinements/array/array.zod.refinements.mjs";
3
- import { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
3
+ import { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
4
4
  import { QUESTION_AUTHOR_CREATION_DTO } from "./question-author-creation/question-author-creation.dto.shape.mjs";
5
5
  import { QUESTION_CONTENT_CREATION_DTO } from "./question-content-creation/question-content-creation.dto.shape.mjs";
6
6
  import { QUESTION_THEME_ASSIGNMENT_CREATION_DTO } from "./question-theme-assignment-creation/question-theme-assignment-creation.dto.shape.mjs";
@@ -12,7 +12,8 @@ const QUESTION_CREATION_DTO = z.object({
12
12
  content: QUESTION_CONTENT_CREATION_DTO,
13
13
  cognitiveDifficulty: zQuestionCognitiveDifficulty(),
14
14
  author: QUESTION_AUTHOR_CREATION_DTO,
15
- sourceUrls: zQuestionSourceUrls()
15
+ sourceUrls: zQuestionSourceUrls(),
16
+ applicableLocales: zQuestionApplicableLocales()
16
17
  });
17
18
  //#endregion
18
19
  export { QUESTION_CREATION_DTO };
@@ -1 +1 @@
1
- {"version":3,"file":"question-creation.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-creation/question-creation.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueByKey, hasExactlyOneByKey } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_CREATION_DTO } from \"@question/application/dto/question-creation/question-author-creation/question-author-creation.dto.shape\";\nimport { QUESTION_CONTENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-content-creation/question-content-creation.dto.shape\";\nimport { QUESTION_THEME_ASSIGNMENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.shape\";\nimport { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\n\nconst QUESTION_CREATION_DTO = z.object({\n category: zQuestionCategory(),\n themes: z.array(QUESTION_THEME_ASSIGNMENT_CREATION_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .refine(themes => areValuesUniqueByKey(themes, \"themeId\"), { message: \"Theme IDs must be unique\" })\n .refine(themes => hasExactlyOneByKey(themes, \"isPrimary\", true), { message: \"There must be exactly one primary theme\" })\n .describe(\"Question's themes\"),\n content: QUESTION_CONTENT_CREATION_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_CREATION_DTO,\n sourceUrls: zQuestionSourceUrls(),\n});\n\nexport type QuestionCreationDto = z.infer<typeof QUESTION_CREATION_DTO>;\n\nexport { QUESTION_CREATION_DTO };"],"mappings":";;;;;;;;AAUA,MAAM,wBAAwB,EAAE,OAAO;CACrC,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,sCAAsC,CAAC,CACpD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,QAAO,WAAU,qBAAqB,QAAQ,SAAS,GAAG,EAAE,SAAS,2BAA2B,CAAC,CAAC,CAClG,QAAO,WAAU,mBAAmB,QAAQ,aAAa,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAAC,CACvH,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,YAAY,oBAAoB;AAClC,CAAC"}
1
+ {"version":3,"file":"question-creation.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-creation/question-creation.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueByKey, hasExactlyOneByKey } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_CREATION_DTO } from \"@question/application/dto/question-creation/question-author-creation/question-author-creation.dto.shape\";\nimport { QUESTION_CONTENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-content-creation/question-content-creation.dto.shape\";\nimport { QUESTION_THEME_ASSIGNMENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.shape\";\nimport { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\n\nconst QUESTION_CREATION_DTO = z.object({\n category: zQuestionCategory(),\n themes: z.array(QUESTION_THEME_ASSIGNMENT_CREATION_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .refine(themes => areValuesUniqueByKey(themes, \"themeId\"), { message: \"Theme IDs must be unique\" })\n .refine(themes => hasExactlyOneByKey(themes, \"isPrimary\", true), { message: \"There must be exactly one primary theme\" })\n .describe(\"Question's themes\"),\n content: QUESTION_CONTENT_CREATION_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_CREATION_DTO,\n sourceUrls: zQuestionSourceUrls(),\n applicableLocales: zQuestionApplicableLocales(),\n});\n\nexport type QuestionCreationDto = z.infer<typeof QUESTION_CREATION_DTO>;\n\nexport { QUESTION_CREATION_DTO };"],"mappings":";;;;;;;;AAUA,MAAM,wBAAwB,EAAE,OAAO;CACrC,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,sCAAsC,CAAC,CACpD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,QAAO,WAAU,qBAAqB,QAAQ,SAAS,GAAG,EAAE,SAAS,2BAA2B,CAAC,CAAC,CAClG,QAAO,WAAU,mBAAmB,QAAQ,aAAa,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAAC,CACvH,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,YAAY,oBAAoB;CAChC,mBAAmB,2BAA2B;AAChD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { LocaleEnum } from "../../../../../shared/domain/value-objects/locale/locale.types.mjs";
1
2
  import { QuestionCategoryEnum, QuestionCognitiveDifficultyEnum } from "../../../domain/types/question.value-objects.mjs";
2
3
  import { z } from "zod";
3
4
  //#region ../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.d.ts
@@ -11,6 +12,7 @@ declare const QUESTION_MODIFICATION_DTO: z.ZodObject<{
11
12
  context: z.ZodOptional<z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>>;
12
13
  trivia: z.ZodOptional<z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodArray<z.ZodString>>>, z.core.$strip>>;
13
14
  }, z.core.$strip>>;
15
+ applicableLocales: z.ZodOptional<z.ZodArray<z.ZodEnum<LocaleEnum>>>;
14
16
  }, z.core.$strip>;
15
17
  type QuestionModificationDto = z.infer<typeof QUESTION_MODIFICATION_DTO>;
16
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
1
+ import { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
2
2
  import { QUESTION_CONTENT_MODIFICATION_DTO } from "./question-content-modification/question-content-modification.dto.shape.mjs";
3
3
  import { z } from "zod";
4
4
  //#region ../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.ts
@@ -6,7 +6,8 @@ const QUESTION_MODIFICATION_DTO = z.object({
6
6
  category: zQuestionCategory().optional(),
7
7
  cognitiveDifficulty: zQuestionCognitiveDifficulty().optional(),
8
8
  sourceUrls: zQuestionSourceUrls().optional(),
9
- content: QUESTION_CONTENT_MODIFICATION_DTO.optional()
9
+ content: QUESTION_CONTENT_MODIFICATION_DTO.optional(),
10
+ applicableLocales: zQuestionApplicableLocales(0).describe("Subset of locales this question is relevant for; submit an empty array to clear the restriction (all locales required again)")
10
11
  });
11
12
  //#endregion
12
13
  export { QUESTION_MODIFICATION_DTO };
@@ -1 +1 @@
1
- {"version":3,"file":"question-modification.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_CONTENT_MODIFICATION_DTO } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\n\nconst QUESTION_MODIFICATION_DTO = z.object({\n category: zQuestionCategory()\n .optional(),\n cognitiveDifficulty: zQuestionCognitiveDifficulty()\n .optional(),\n sourceUrls: zQuestionSourceUrls()\n .optional(),\n content: QUESTION_CONTENT_MODIFICATION_DTO\n .optional(),\n});\n\ntype QuestionModificationDto = z.infer<typeof QUESTION_MODIFICATION_DTO>;\n\nexport type { QuestionModificationDto };\n\nexport { QUESTION_MODIFICATION_DTO };"],"mappings":";;;;AAKA,MAAM,4BAA4B,EAAE,OAAO;CACzC,UAAU,kBAAkB,CAAC,CAC1B,SAAS;CACZ,qBAAqB,6BAA6B,CAAC,CAChD,SAAS;CACZ,YAAY,oBAAoB,CAAC,CAC9B,SAAS;CACZ,SAAS,kCACN,SAAS;AACd,CAAC"}
1
+ {"version":3,"file":"question-modification.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_CONTENT_MODIFICATION_DTO } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\n\nconst QUESTION_MODIFICATION_DTO = z.object({\n category: zQuestionCategory()\n .optional(),\n cognitiveDifficulty: zQuestionCognitiveDifficulty()\n .optional(),\n sourceUrls: zQuestionSourceUrls()\n .optional(),\n content: QUESTION_CONTENT_MODIFICATION_DTO\n .optional(),\n applicableLocales: zQuestionApplicableLocales(0)\n .describe(\"Subset of locales this question is relevant for; submit an empty array to clear the restriction (all locales required again)\"),\n});\n\ntype QuestionModificationDto = z.infer<typeof QUESTION_MODIFICATION_DTO>;\n\nexport type { QuestionModificationDto };\n\nexport { QUESTION_MODIFICATION_DTO };"],"mappings":";;;;AAKA,MAAM,4BAA4B,EAAE,OAAO;CACzC,UAAU,kBAAkB,CAAC,CAC1B,SAAS;CACZ,qBAAqB,6BAA6B,CAAC,CAChD,SAAS;CACZ,YAAY,oBAAoB,CAAC,CAC9B,SAAS;CACZ,SAAS,kCACN,SAAS;CACZ,mBAAmB,2BAA2B,CAAC,CAAC,CAC7C,SAAS,8HAA8H;AAC5I,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { LOCALES } from "../../../../../../../shared/domain/value-objects/locale/locale.constants.mjs";
1
2
  import { QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from "../../../../../domain/constants/question.constants.mjs";
2
3
  import { areValuesUniqueFromStrings } from "../../../../../../../shared/application/dto/zod/refinements/array/array.zod.refinements.mjs";
3
4
  import { normalizeToArray } from "../../../../../../../shared/application/dto/zod/preprocessors/array/array.zod.preprocessors.mjs";
@@ -18,6 +19,9 @@ function zQuestionStatus() {
18
19
  function zQuestionCategory() {
19
20
  return z.enum(QUESTION_CATEGORIES).describe("Question's category");
20
21
  }
22
+ function zQuestionApplicableLocales(minItems = 1) {
23
+ return z.array(z.enum(LOCALES)).min(minItems).max(LOCALES.length).refine(areValuesUniqueFromStrings, { message: "Locales must be unique" }).optional().describe("Subset of locales this question is relevant for; omit if relevant for all locales");
24
+ }
21
25
  function zQuestionSourceUrls() {
22
26
  return z.array(z.url()).min(1).max(5).refine(areValuesUniqueFromStrings, { message: "Source URLs must be unique" }).describe("List of unique source URLs for the question").meta({ example: ["https://example.com/source1", "https://example.com/source2"] });
23
27
  }
@@ -43,6 +47,6 @@ function zQuestionUpdatedAt() {
43
47
  return zIsoDateTime().describe("Question's last update date");
44
48
  }
45
49
  //#endregion
46
- export { zQuestionAuthorRole, zQuestionCategoriesFilter, zQuestionCategory, zQuestionCognitiveDifficultiesFilter, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionExcludedIdsFilter, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionThemeIdsFilter, zQuestionUpdatedAt };
50
+ export { zQuestionApplicableLocales, zQuestionAuthorRole, zQuestionCategoriesFilter, zQuestionCategory, zQuestionCognitiveDifficultiesFilter, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionExcludedIdsFilter, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionThemeIdsFilter, zQuestionUpdatedAt };
47
51
 
48
52
  //# sourceMappingURL=question.dto.zod.validators.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"question.dto.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueFromStrings } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\nimport { normalizeToArray } from \"@shared/application/dto/zod/preprocessors/array/array.zod.preprocessors\";\nimport { zCreateFilterArray } from \"@shared/application/dto/zod/validators/array/array.zod.validators\";\nimport { zIsoDateTime, zMongoId } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_SOURCE_URLS_MAX_ITEMS, QUESTION_SOURCE_URLS_MIN_ITEMS, QUESTION_STATUSES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport { FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM, FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM } from \"@question/application/dto/find-random-questions-body/constants/find-random-questions-body.dto.constants\";\nimport type { QuestionAuthorRoleEnum, QuestionCategoryEnum, QuestionStatusEnum, QuestionCognitiveDifficultyEnum } from \"@question/domain/types/question.value-objects\";\n\nimport type { ZodEnum, ZodURL, ZodArray, ZodString, ZodISODateTime, ZodOptional, ZodPreprocess } from \"zod\";\n\nfunction zQuestionAuthorRole(): ZodEnum<QuestionAuthorRoleEnum> {\n return z.enum(QUESTION_AUTHOR_ROLES)\n .describe(\"Question author's role\");\n}\n\nfunction zQuestionCognitiveDifficulty(): ZodEnum<QuestionCognitiveDifficultyEnum> {\n return z.enum(QUESTION_COGNITIVE_DIFFICULTIES)\n .describe(\"Question's cognitive difficulty level\");\n}\n\nfunction zQuestionStatus(): ZodEnum<QuestionStatusEnum> {\n return z.enum(QUESTION_STATUSES)\n .describe(\"Question's status\");\n}\n\nfunction zQuestionCategory(): ZodEnum<QuestionCategoryEnum> {\n return z.enum(QUESTION_CATEGORIES)\n .describe(\"Question's category\");\n}\n\nfunction zQuestionSourceUrls(): ZodArray<ZodURL> {\n return z.array(z.url())\n .min(QUESTION_SOURCE_URLS_MIN_ITEMS)\n .max(QUESTION_SOURCE_URLS_MAX_ITEMS)\n .refine(areValuesUniqueFromStrings, { message: \"Source URLs must be unique\" })\n .describe(\"List of unique source URLs for the question\")\n .meta({ example: [\"https://example.com/source1\", \"https://example.com/source2\"] });\n}\n\nfunction zQuestionExcludedIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return zCreateFilterArray(\n zMongoId().describe(\"Question ID to exclude\"),\n \"Excluded IDs must be unique\",\n \"List of question IDs to exclude from the random pool\",\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM,\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM,\n );\n}\n\nfunction zQuestionCategoriesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCategoryEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_CATEGORIES),\n \"Categories must be unique\",\n \"List of categories to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionCognitiveDifficultiesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCognitiveDifficultyEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_COGNITIVE_DIFFICULTIES),\n \"Cognitive difficulties must be unique\",\n \"List of cognitive difficulties to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionThemeIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return z.preprocess(\n normalizeToArray,\n z.array(zMongoId().describe(\"Theme ID to filter questions by\")).min(1),\n )\n .optional()\n .describe(\"List of theme IDs to filter questions by (OR logic)\");\n}\n\nfunction zQuestionId(): ZodString {\n return zMongoId()\n .describe(\"Question's unique identifier\");\n}\n\nfunction zQuestionCreatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's creation date\");\n}\n\nfunction zQuestionUpdatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's last update date\");\n}\n\nexport {\n zQuestionAuthorRole,\n zQuestionCognitiveDifficulty,\n zQuestionStatus,\n zQuestionCategory,\n zQuestionSourceUrls,\n zQuestionExcludedIdsFilter,\n zQuestionCategoriesFilter,\n zQuestionCognitiveDifficultiesFilter,\n zQuestionThemeIdsFilter,\n zQuestionId,\n zQuestionCreatedAt,\n zQuestionUpdatedAt,\n};"],"mappings":";;;;;;;;AAaA,SAAS,sBAAuD;CAC9D,OAAO,EAAE,KAAK,qBAAqB,CAAC,CACjC,SAAS,wBAAwB;AACtC;AAEA,SAAS,+BAAyE;CAChF,OAAO,EAAE,KAAK,+BAA+B,CAAC,CAC3C,SAAS,uCAAuC;AACrD;AAEA,SAAS,kBAA+C;CACtD,OAAO,EAAE,KAAK,iBAAiB,CAAC,CAC7B,SAAS,mBAAmB;AACjC;AAEA,SAAS,oBAAmD;CAC1D,OAAO,EAAE,KAAK,mBAAmB,CAAC,CAC/B,SAAS,qBAAqB;AACnC;AAEA,SAAS,sBAAwC;CAC/C,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CACpB,IAAA,CAAkC,CAAC,CACnC,IAAA,CAAkC,CAAC,CACnC,OAAO,4BAA4B,EAAE,SAAS,6BAA6B,CAAC,CAAC,CAC7E,SAAS,6CAA6C,CAAC,CACvD,KAAK,EAAE,SAAS,CAAC,+BAA+B,6BAA6B,EAAE,CAAC;AACrF;AAEA,SAAS,6BAA8E;CACrF,OAAO,mBACL,SAAS,CAAC,CAAC,SAAS,wBAAwB,GAC5C,+BACA,wDAAA,GAEA,+CACF;AACF;AAEA,SAAS,4BAAiG;CACxG,OAAO,mBACL,EAAE,KAAK,mBAAmB,GAC1B,6BACA,4CACA,CACF;AACF;AAEA,SAAS,uCAAuH;CAC9H,OAAO,mBACL,EAAE,KAAK,+BAA+B,GACtC,yCACA,wDACA,CACF;AACF;AAEA,SAAS,0BAA2E;CAClF,OAAO,EAAE,WACP,kBACA,EAAE,MAAM,SAAS,CAAC,CAAC,SAAS,iCAAiC,CAAC,CAAC,CAAC,IAAI,CAAC,CACvE,CAAC,CACE,SAAS,CAAC,CACV,SAAS,qDAAqD;AACnE;AAEA,SAAS,cAAyB;CAChC,OAAO,SAAS,CAAC,CACd,SAAS,8BAA8B;AAC5C;AAEA,SAAS,qBAAqC;CAC5C,OAAO,aAAa,CAAC,CAClB,SAAS,0BAA0B;AACxC;AAEA,SAAS,qBAAqC;CAC5C,OAAO,aAAa,CAAC,CAClB,SAAS,6BAA6B;AAC3C"}
1
+ {"version":3,"file":"question.dto.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueFromStrings } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\nimport { normalizeToArray } from \"@shared/application/dto/zod/preprocessors/array/array.zod.preprocessors\";\nimport { zCreateFilterArray } from \"@shared/application/dto/zod/validators/array/array.zod.validators\";\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\nimport { zIsoDateTime, zMongoId } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_SOURCE_URLS_MAX_ITEMS, QUESTION_SOURCE_URLS_MIN_ITEMS, QUESTION_STATUSES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport { FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM, FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM } from \"@question/application/dto/find-random-questions-body/constants/find-random-questions-body.dto.constants\";\nimport type { QuestionAuthorRoleEnum, QuestionCategoryEnum, QuestionStatusEnum, QuestionCognitiveDifficultyEnum } from \"@question/domain/types/question.value-objects\";\n\nimport type { ZodEnum, ZodURL, ZodArray, ZodString, ZodISODateTime, ZodOptional, ZodPreprocess } from \"zod\";\n\nimport type { LocaleEnum } from \"@shared/domain/value-objects/locale/locale.types\";\n\nfunction zQuestionAuthorRole(): ZodEnum<QuestionAuthorRoleEnum> {\n return z.enum(QUESTION_AUTHOR_ROLES)\n .describe(\"Question author's role\");\n}\n\nfunction zQuestionCognitiveDifficulty(): ZodEnum<QuestionCognitiveDifficultyEnum> {\n return z.enum(QUESTION_COGNITIVE_DIFFICULTIES)\n .describe(\"Question's cognitive difficulty level\");\n}\n\nfunction zQuestionStatus(): ZodEnum<QuestionStatusEnum> {\n return z.enum(QUESTION_STATUSES)\n .describe(\"Question's status\");\n}\n\nfunction zQuestionCategory(): ZodEnum<QuestionCategoryEnum> {\n return z.enum(QUESTION_CATEGORIES)\n .describe(\"Question's category\");\n}\n\nfunction zQuestionApplicableLocales(minItems = 1): ZodOptional<ZodArray<ZodEnum<LocaleEnum>>> {\n return z.array(z.enum(LOCALES))\n .min(minItems)\n .max(LOCALES.length)\n .refine(areValuesUniqueFromStrings, { message: \"Locales must be unique\" })\n .optional()\n .describe(\"Subset of locales this question is relevant for; omit if relevant for all locales\");\n}\n\nfunction zQuestionSourceUrls(): ZodArray<ZodURL> {\n return z.array(z.url())\n .min(QUESTION_SOURCE_URLS_MIN_ITEMS)\n .max(QUESTION_SOURCE_URLS_MAX_ITEMS)\n .refine(areValuesUniqueFromStrings, { message: \"Source URLs must be unique\" })\n .describe(\"List of unique source URLs for the question\")\n .meta({ example: [\"https://example.com/source1\", \"https://example.com/source2\"] });\n}\n\nfunction zQuestionExcludedIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return zCreateFilterArray(\n zMongoId().describe(\"Question ID to exclude\"),\n \"Excluded IDs must be unique\",\n \"List of question IDs to exclude from the random pool\",\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM,\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM,\n );\n}\n\nfunction zQuestionCategoriesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCategoryEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_CATEGORIES),\n \"Categories must be unique\",\n \"List of categories to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionCognitiveDifficultiesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCognitiveDifficultyEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_COGNITIVE_DIFFICULTIES),\n \"Cognitive difficulties must be unique\",\n \"List of cognitive difficulties to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionThemeIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return z.preprocess(\n normalizeToArray,\n z.array(zMongoId().describe(\"Theme ID to filter questions by\")).min(1),\n )\n .optional()\n .describe(\"List of theme IDs to filter questions by (OR logic)\");\n}\n\nfunction zQuestionId(): ZodString {\n return zMongoId()\n .describe(\"Question's unique identifier\");\n}\n\nfunction zQuestionCreatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's creation date\");\n}\n\nfunction zQuestionUpdatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's last update date\");\n}\n\nexport {\n zQuestionAuthorRole,\n zQuestionCognitiveDifficulty,\n zQuestionStatus,\n zQuestionCategory,\n zQuestionApplicableLocales,\n zQuestionSourceUrls,\n zQuestionExcludedIdsFilter,\n zQuestionCategoriesFilter,\n zQuestionCognitiveDifficultiesFilter,\n zQuestionThemeIdsFilter,\n zQuestionId,\n zQuestionCreatedAt,\n zQuestionUpdatedAt,\n};"],"mappings":";;;;;;;;;AAgBA,SAAS,sBAAuD;CAC9D,OAAO,EAAE,KAAK,qBAAqB,CAAC,CACjC,SAAS,wBAAwB;AACtC;AAEA,SAAS,+BAAyE;CAChF,OAAO,EAAE,KAAK,+BAA+B,CAAC,CAC3C,SAAS,uCAAuC;AACrD;AAEA,SAAS,kBAA+C;CACtD,OAAO,EAAE,KAAK,iBAAiB,CAAC,CAC7B,SAAS,mBAAmB;AACjC;AAEA,SAAS,oBAAmD;CAC1D,OAAO,EAAE,KAAK,mBAAmB,CAAC,CAC/B,SAAS,qBAAqB;AACnC;AAEA,SAAS,2BAA2B,WAAW,GAA+C;CAC5F,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,CAAC,CAC5B,IAAI,QAAQ,CAAC,CACb,IAAI,QAAQ,MAAM,CAAC,CACnB,OAAO,4BAA4B,EAAE,SAAS,yBAAyB,CAAC,CAAC,CACzE,SAAS,CAAC,CACV,SAAS,mFAAmF;AACjG;AAEA,SAAS,sBAAwC;CAC/C,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CACpB,IAAA,CAAkC,CAAC,CACnC,IAAA,CAAkC,CAAC,CACnC,OAAO,4BAA4B,EAAE,SAAS,6BAA6B,CAAC,CAAC,CAC7E,SAAS,6CAA6C,CAAC,CACvD,KAAK,EAAE,SAAS,CAAC,+BAA+B,6BAA6B,EAAE,CAAC;AACrF;AAEA,SAAS,6BAA8E;CACrF,OAAO,mBACL,SAAS,CAAC,CAAC,SAAS,wBAAwB,GAC5C,+BACA,wDAAA,GAEA,+CACF;AACF;AAEA,SAAS,4BAAiG;CACxG,OAAO,mBACL,EAAE,KAAK,mBAAmB,GAC1B,6BACA,4CACA,CACF;AACF;AAEA,SAAS,uCAAuH;CAC9H,OAAO,mBACL,EAAE,KAAK,+BAA+B,GACtC,yCACA,wDACA,CACF;AACF;AAEA,SAAS,0BAA2E;CAClF,OAAO,EAAE,WACP,kBACA,EAAE,MAAM,SAAS,CAAC,CAAC,SAAS,iCAAiC,CAAC,CAAC,CAAC,IAAI,CAAC,CACvE,CAAC,CACE,SAAS,CAAC,CACV,SAAS,qDAAqD;AACnE;AAEA,SAAS,cAAyB;CAChC,OAAO,SAAS,CAAC,CACd,SAAS,8BAA8B;AAC5C;AAEA,SAAS,qBAAqC;CAC5C,OAAO,aAAa,CAAC,CAClB,SAAS,0BAA0B;AACxC;AAEA,SAAS,qBAAqC;CAC5C,OAAO,aAAa,CAAC,CAClB,SAAS,6BAA6B;AAC3C"}
@@ -1,7 +1,9 @@
1
+ import { TupleToEnum } from "../../../types/enum.types.mjs";
1
2
  import { LOCALES } from "./locale.constants.mjs";
2
3
  import { TupleToUnion } from "type-fest";
3
4
  //#region ../../src/shared/domain/value-objects/locale/locale.types.d.ts
4
5
  type Locale = TupleToUnion<typeof LOCALES>;
6
+ type LocaleEnum = TupleToEnum<typeof LOCALES>;
5
7
  type LocalizationOptions = {
6
8
  locale: Locale;
7
9
  fallbackLocale: Locale;
@@ -9,5 +11,5 @@ type LocalizationOptions = {
9
11
  type LocalizedText = Record<Locale, string>;
10
12
  type LocalizedTexts = Record<Locale, string[]>;
11
13
  //#endregion
12
- export type { Locale, LocalizationOptions, LocalizedText, LocalizedTexts };
14
+ export type { Locale, LocaleEnum, LocalizationOptions, LocalizedText, LocalizedTexts };
13
15
  //# sourceMappingURL=locale.types.d.mts.map
@@ -4,7 +4,7 @@ function zIsFullyTranslated() {
4
4
  return z.stringbool({
5
5
  truthy: ["true"],
6
6
  falsy: ["false"]
7
- }).optional().describe("Filters resources by whether every LocalizedText/LocalizedTexts field has all 6 supported locales set");
7
+ }).optional().describe("Filters resources by translation completeness: 'true' returns only fully translated resources, 'false' returns only incomplete ones. A resource is fully translated when all mandatory LocalizedText/LocalizedTexts fields have a value in every applicable locale, and all optional LocalizedText/LocalizedTexts fields are either absent (never translated) or have a value in every applicable locale. Applicable locales come from the resource's applicableLocales field: if absent or empty, all 6 supported locales apply (en, fr, es, de, it, pt).");
8
8
  }
9
9
  function zTranslationCompletenessStats() {
10
10
  return z.strictObject({
@@ -1 +1 @@
1
- {"version":3,"file":"translation-completeness.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ZodBoolean, ZodCodec, ZodNumber, ZodObject, ZodOptional, ZodString } from \"zod\";\n\nfunction zIsFullyTranslated(): ZodOptional<ZodCodec<ZodString, ZodBoolean>> {\n return z.stringbool({ truthy: [\"true\"], falsy: [\"false\"] })\n .optional()\n .describe(\"Filters resources by whether every LocalizedText/LocalizedTexts field has all 6 supported locales set\");\n}\n\nfunction zTranslationCompletenessStats(): ZodObject<z.util.Writeable<{ fullyTranslated: ZodNumber; incomplete: ZodNumber }>, z.core.$strict> {\n return z.strictObject({\n fullyTranslated: z.number().int().nonnegative()\n .describe(\"Number of resources that are fully translated across all locales\"),\n incomplete: z.number().int().nonnegative()\n .describe(\"Number of resources missing at least one locale in at least one field\"),\n });\n}\n\nexport { zIsFullyTranslated, zTranslationCompletenessStats };"],"mappings":";;AAIA,SAAS,qBAAmE;CAC1E,OAAO,EAAE,WAAW;EAAE,QAAQ,CAAC,MAAM;EAAG,OAAO,CAAC,OAAO;CAAE,CAAC,CAAC,CACxD,SAAS,CAAC,CACV,SAAS,uGAAuG;AACrH;AAEA,SAAS,gCAAoI;CAC3I,OAAO,EAAE,aAAa;EACpB,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAC5C,SAAS,kEAAkE;EAC9E,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CACvC,SAAS,uEAAuE;CACrF,CAAC;AACH"}
1
+ {"version":3,"file":"translation-completeness.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ZodBoolean, ZodCodec, ZodNumber, ZodObject, ZodOptional, ZodString } from \"zod\";\n\nfunction zIsFullyTranslated(): ZodOptional<ZodCodec<ZodString, ZodBoolean>> {\n return z.stringbool({ truthy: [\"true\"], falsy: [\"false\"] })\n .optional()\n .describe(\"Filters resources by translation completeness: 'true' returns only fully translated resources, 'false' returns only incomplete ones. \" +\n \"A resource is fully translated when all mandatory LocalizedText/LocalizedTexts fields have a value \" +\n \"in every applicable locale, and all optional LocalizedText/LocalizedTexts fields are either absent (never translated) \" +\n \"or have a value in every applicable locale. \" +\n \"Applicable locales come from the resource's applicableLocales field: if absent or empty, \" +\n \"all 6 supported locales apply (en, fr, es, de, it, pt).\");\n}\n\nfunction zTranslationCompletenessStats(): ZodObject<z.util.Writeable<{ fullyTranslated: ZodNumber; incomplete: ZodNumber }>, z.core.$strict> {\n return z.strictObject({\n fullyTranslated: z.number().int().nonnegative()\n .describe(\"Number of resources that are fully translated across all locales\"),\n incomplete: z.number().int().nonnegative()\n .describe(\"Number of resources missing at least one locale in at least one field\"),\n });\n}\n\nexport { zIsFullyTranslated, zTranslationCompletenessStats };"],"mappings":";;AAIA,SAAS,qBAAmE;CAC1E,OAAO,EAAE,WAAW;EAAE,QAAQ,CAAC,MAAM;EAAG,OAAO,CAAC,OAAO;CAAE,CAAC,CAAC,CACxD,SAAS,CAAC,CACV,SAAS,4hBAKiD;AAC/D;AAEA,SAAS,gCAAoI;CAC3I,OAAO,EAAE,aAAa;EACpB,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAC5C,SAAS,kEAAkE;EAC9E,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CACvC,SAAS,uEAAuE;CACrF,CAAC;AACH"}
@@ -1,3 +1,4 @@
1
+ import { LOCALES } from "../../../../../../../../src/shared/domain/value-objects/locale/locale.constants.mjs";
1
2
  import { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from "../../../../../../../../src/contexts/question/domain/constants/question.constants.mjs";
2
3
  import { createFakeAdminQuestionContentDto } from "./admin-question-content/admin-question-content.dto.faketory.mjs";
3
4
  import { createFakeAdminQuestionThemeAssignmentDto } from "./admin-question-theme-assignment/admin-question-theme-assignment.dto.faketory.mjs";
@@ -16,6 +17,10 @@ function createFakeAdminQuestionDto(adminQuestionDto = {}) {
16
17
  status: faker.helpers.arrayElement(QUESTION_STATUSES),
17
18
  rejection: faker.helpers.maybe(createFakeQuestionRejectionDto),
18
19
  sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),
20
+ applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, {
21
+ min: 1,
22
+ max: LOCALES.length
23
+ })),
19
24
  createdAt: faker.date.anytime().toISOString(),
20
25
  updatedAt: faker.date.anytime().toISOString(),
21
26
  ...adminQuestionDto
@@ -1 +1 @@
1
- {"version":3,"file":"admin-question.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport type { AdminQuestionDto } from \"@question/application/dto/admin-question/admin-question.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeAdminQuestionThemeAssignmentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.faketory\";\nimport { createFakeAdminQuestionContentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-content/admin-question-content.dto.faketory\";\nimport { createFakeQuestionAuthorDto } from \"@faketories/contexts/question/dto/shared/question-author/question-author.dto.faketory\";\nimport { createFakeQuestionRejectionDto } from \"@faketories/contexts/question/dto/shared/question-rejection/question-rejection.dto.faketory\";\n\nfunction createFakeAdminQuestionDto(adminQuestionDto: Partial<AdminQuestionDto> = {}): AdminQuestionDto {\n return {\n id: faker.database.mongodbObjectId(),\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeAdminQuestionThemeAssignmentDto()],\n content: createFakeAdminQuestionContentDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorDto(),\n status: faker.helpers.arrayElement(QUESTION_STATUSES),\n rejection: faker.helpers.maybe(createFakeQuestionRejectionDto),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n createdAt: faker.date.anytime().toISOString(),\n updatedAt: faker.date.anytime().toISOString(),\n ...adminQuestionDto,\n };\n}\n\nexport {\n createFakeAdminQuestionDto,\n};"],"mappings":";;;;;;;AAUA,SAAS,2BAA2B,mBAA8C,CAAC,GAAqB;CACtG,OAAO;EACL,IAAI,MAAM,SAAS,gBAAgB;EACnC,UAAU,MAAM,QAAQ,aAAa,mBAAmB;EACxD,QAAQ,CAAC,0CAA0C,CAAC;EACpD,SAAS,kCAAkC;EAC3C,qBAAqB,MAAM,QAAQ,aAAa,+BAA+B;EAC/E,QAAQ,4BAA4B;EACpC,QAAQ,MAAM,QAAQ,aAAa,iBAAiB;EACpD,WAAW,MAAM,QAAQ,MAAM,8BAA8B;EAC7D,YAAY,MAAM,QAAQ,kBAAkB,MAAM,SAAS,IAAI,GAAG,CAAC;EACnE,WAAW,MAAM,KAAK,QAAQ,CAAC,CAAC,YAAY;EAC5C,WAAW,MAAM,KAAK,QAAQ,CAAC,CAAC,YAAY;EAC5C,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"admin-question.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\n\nimport type { AdminQuestionDto } from \"@question/application/dto/admin-question/admin-question.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeAdminQuestionThemeAssignmentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.faketory\";\nimport { createFakeAdminQuestionContentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-content/admin-question-content.dto.faketory\";\nimport { createFakeQuestionAuthorDto } from \"@faketories/contexts/question/dto/shared/question-author/question-author.dto.faketory\";\nimport { createFakeQuestionRejectionDto } from \"@faketories/contexts/question/dto/shared/question-rejection/question-rejection.dto.faketory\";\n\nfunction createFakeAdminQuestionDto(adminQuestionDto: Partial<AdminQuestionDto> = {}): AdminQuestionDto {\n return {\n id: faker.database.mongodbObjectId(),\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeAdminQuestionThemeAssignmentDto()],\n content: createFakeAdminQuestionContentDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorDto(),\n status: faker.helpers.arrayElement(QUESTION_STATUSES),\n rejection: faker.helpers.maybe(createFakeQuestionRejectionDto),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, { min: 1, max: LOCALES.length })),\n createdAt: faker.date.anytime().toISOString(),\n updatedAt: faker.date.anytime().toISOString(),\n ...adminQuestionDto,\n };\n}\n\nexport {\n createFakeAdminQuestionDto,\n};"],"mappings":";;;;;;;;AAYA,SAAS,2BAA2B,mBAA8C,CAAC,GAAqB;CACtG,OAAO;EACL,IAAI,MAAM,SAAS,gBAAgB;EACnC,UAAU,MAAM,QAAQ,aAAa,mBAAmB;EACxD,QAAQ,CAAC,0CAA0C,CAAC;EACpD,SAAS,kCAAkC;EAC3C,qBAAqB,MAAM,QAAQ,aAAa,+BAA+B;EAC/E,QAAQ,4BAA4B;EACpC,QAAQ,MAAM,QAAQ,aAAa,iBAAiB;EACpD,WAAW,MAAM,QAAQ,MAAM,8BAA8B;EAC7D,YAAY,MAAM,QAAQ,kBAAkB,MAAM,SAAS,IAAI,GAAG,CAAC;EACnE,mBAAmB,MAAM,QAAQ,YAAY,MAAM,QAAQ,cAAc,SAAS;GAAE,KAAK;GAAG,KAAK,QAAQ;EAAO,CAAC,CAAC;EAClH,WAAW,MAAM,KAAK,QAAQ,CAAC,CAAC,YAAY;EAC5C,WAAW,MAAM,KAAK,QAAQ,CAAC,CAAC,YAAY;EAC5C,GAAG;CACL;AACF"}
@@ -1,3 +1,4 @@
1
+ import { LOCALES } from "../../../../../../../../src/shared/domain/value-objects/locale/locale.constants.mjs";
1
2
  import { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from "../../../../../../../../src/contexts/question/domain/constants/question.constants.mjs";
2
3
  import { createFakeQuestionAuthorCreationDto } from "./question-author-creation/question-author-creation.dto.faketory.mjs";
3
4
  import { createFakeQuestionContentCreationDto } from "./question-content-creation/question-content-creation.dto.faketory.mjs";
@@ -12,6 +13,10 @@ function createFakeQuestionCreationDto(creationDto = {}) {
12
13
  cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),
13
14
  author: createFakeQuestionAuthorCreationDto(),
14
15
  sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),
16
+ applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, {
17
+ min: 1,
18
+ max: LOCALES.length
19
+ })),
15
20
  ...creationDto
16
21
  };
17
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"question-creation.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport type { QuestionCreationDto } from \"@question/application/dto/question-creation/question-creation.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeQuestionContentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-content-creation/question-content-creation.dto.faketory\";\nimport { createFakeQuestionThemeAssignmentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.faketory\";\nimport { createFakeQuestionAuthorCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-author-creation/question-author-creation.dto.faketory\";\n\nfunction createFakeQuestionCreationDto(creationDto: Partial<QuestionCreationDto> = {}): QuestionCreationDto {\n return {\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeQuestionThemeAssignmentCreationDto()],\n content: createFakeQuestionContentCreationDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorCreationDto(),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n ...creationDto,\n };\n}\n\nexport { createFakeQuestionCreationDto };"],"mappings":";;;;;;AASA,SAAS,8BAA8B,cAA4C,CAAC,GAAwB;CAC1G,OAAO;EACL,UAAU,MAAM,QAAQ,aAAa,mBAAmB;EACxD,QAAQ,CAAC,6CAA6C,CAAC;EACvD,SAAS,qCAAqC;EAC9C,qBAAqB,MAAM,QAAQ,aAAa,+BAA+B;EAC/E,QAAQ,oCAAoC;EAC5C,YAAY,MAAM,QAAQ,kBAAkB,MAAM,SAAS,IAAI,GAAG,CAAC;EACnE,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"question-creation.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\n\nimport type { QuestionCreationDto } from \"@question/application/dto/question-creation/question-creation.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeQuestionContentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-content-creation/question-content-creation.dto.faketory\";\nimport { createFakeQuestionThemeAssignmentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.faketory\";\nimport { createFakeQuestionAuthorCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-author-creation/question-author-creation.dto.faketory\";\n\nfunction createFakeQuestionCreationDto(creationDto: Partial<QuestionCreationDto> = {}): QuestionCreationDto {\n return {\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeQuestionThemeAssignmentCreationDto()],\n content: createFakeQuestionContentCreationDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorCreationDto(),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, { min: 1, max: LOCALES.length })),\n ...creationDto,\n };\n}\n\nexport { createFakeQuestionCreationDto };"],"mappings":";;;;;;;AAWA,SAAS,8BAA8B,cAA4C,CAAC,GAAwB;CAC1G,OAAO;EACL,UAAU,MAAM,QAAQ,aAAa,mBAAmB;EACxD,QAAQ,CAAC,6CAA6C,CAAC;EACvD,SAAS,qCAAqC;EAC9C,qBAAqB,MAAM,QAAQ,aAAa,+BAA+B;EAC/E,QAAQ,oCAAoC;EAC5C,YAAY,MAAM,QAAQ,kBAAkB,MAAM,SAAS,IAAI,GAAG,CAAC;EACnE,mBAAmB,MAAM,QAAQ,YAAY,MAAM,QAAQ,cAAc,SAAS;GAAE,KAAK;GAAG,KAAK,QAAQ;EAAO,CAAC,CAAC;EAClH,GAAG;CACL;AACF"}
@@ -1,3 +1,4 @@
1
+ import { LOCALES } from "../../../../../../../../src/shared/domain/value-objects/locale/locale.constants.mjs";
1
2
  import { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from "../../../../../../../../src/contexts/question/domain/constants/question.constants.mjs";
2
3
  import { createFakeLocalizedText, createFakeLocalizedTexts } from "../../../../shared/locale/locale.faketory.mjs";
3
4
  import { faker } from "@faker-js/faker";
@@ -17,6 +18,10 @@ function createFakeQuestionModificationDto(overrides = {}) {
17
18
  cognitiveDifficulty: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),
18
19
  sourceUrls: faker.helpers.maybe(() => [faker.internet.url(), faker.internet.url()]),
19
20
  content: faker.helpers.maybe(createFakeQuestionContentModificationDto),
21
+ applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, {
22
+ min: 1,
23
+ max: LOCALES.length
24
+ })),
20
25
  ...overrides
21
26
  };
22
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"question-modification.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport type { QuestionContentModificationDto } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\nimport type { QuestionModificationDto } from \"@question/application/dto/question-modification/question-modification.dto.shape\";\n\nimport { createFakeLocalizedText, createFakeLocalizedTexts } from \"@faketories/shared/locale/locale.faketory\";\n\nfunction createFakeQuestionContentModificationDto(overrides: Partial<QuestionContentModificationDto> = {}): QuestionContentModificationDto {\n return {\n statement: faker.helpers.maybe(createFakeLocalizedText),\n answer: faker.helpers.maybe(createFakeLocalizedText),\n context: faker.helpers.maybe(createFakeLocalizedText),\n trivia: faker.helpers.maybe(createFakeLocalizedTexts),\n ...overrides,\n };\n}\n\nfunction createFakeQuestionModificationDto(overrides: Partial<QuestionModificationDto> = {}): QuestionModificationDto {\n return {\n category: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_CATEGORIES)),\n cognitiveDifficulty: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),\n sourceUrls: faker.helpers.maybe(() => [faker.internet.url(), faker.internet.url()]),\n content: faker.helpers.maybe(createFakeQuestionContentModificationDto),\n ...overrides,\n };\n}\n\nexport {\n createFakeQuestionContentModificationDto,\n createFakeQuestionModificationDto,\n};"],"mappings":";;;;AAQA,SAAS,yCAAyC,YAAqD,CAAC,GAAmC;CACzI,OAAO;EACL,WAAW,MAAM,QAAQ,MAAM,uBAAuB;EACtD,QAAQ,MAAM,QAAQ,MAAM,uBAAuB;EACnD,SAAS,MAAM,QAAQ,MAAM,uBAAuB;EACpD,QAAQ,MAAM,QAAQ,MAAM,wBAAwB;EACpD,GAAG;CACL;AACF;AAEA,SAAS,kCAAkC,YAA8C,CAAC,GAA4B;CACpH,OAAO;EACL,UAAU,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,mBAAmB,CAAC;EACnF,qBAAqB,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,+BAA+B,CAAC;EAC1G,YAAY,MAAM,QAAQ,YAAY,CAAC,MAAM,SAAS,IAAI,GAAG,MAAM,SAAS,IAAI,CAAC,CAAC;EAClF,SAAS,MAAM,QAAQ,MAAM,wCAAwC;EACrE,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"question-modification.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\n\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport type { QuestionContentModificationDto } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\nimport type { QuestionModificationDto } from \"@question/application/dto/question-modification/question-modification.dto.shape\";\n\nimport { createFakeLocalizedText, createFakeLocalizedTexts } from \"@faketories/shared/locale/locale.faketory\";\n\nfunction createFakeQuestionContentModificationDto(overrides: Partial<QuestionContentModificationDto> = {}): QuestionContentModificationDto {\n return {\n statement: faker.helpers.maybe(createFakeLocalizedText),\n answer: faker.helpers.maybe(createFakeLocalizedText),\n context: faker.helpers.maybe(createFakeLocalizedText),\n trivia: faker.helpers.maybe(createFakeLocalizedTexts),\n ...overrides,\n };\n}\n\nfunction createFakeQuestionModificationDto(overrides: Partial<QuestionModificationDto> = {}): QuestionModificationDto {\n return {\n category: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_CATEGORIES)),\n cognitiveDifficulty: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),\n sourceUrls: faker.helpers.maybe(() => [faker.internet.url(), faker.internet.url()]),\n content: faker.helpers.maybe(createFakeQuestionContentModificationDto),\n applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, { min: 1, max: LOCALES.length })),\n ...overrides,\n };\n}\n\nexport {\n createFakeQuestionContentModificationDto,\n createFakeQuestionModificationDto,\n};"],"mappings":";;;;;AAUA,SAAS,yCAAyC,YAAqD,CAAC,GAAmC;CACzI,OAAO;EACL,WAAW,MAAM,QAAQ,MAAM,uBAAuB;EACtD,QAAQ,MAAM,QAAQ,MAAM,uBAAuB;EACnD,SAAS,MAAM,QAAQ,MAAM,uBAAuB;EACpD,QAAQ,MAAM,QAAQ,MAAM,wBAAwB;EACpD,GAAG;CACL;AACF;AAEA,SAAS,kCAAkC,YAA8C,CAAC,GAA4B;CACpH,OAAO;EACL,UAAU,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,mBAAmB,CAAC;EACnF,qBAAqB,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,+BAA+B,CAAC;EAC1G,YAAY,MAAM,QAAQ,YAAY,CAAC,MAAM,SAAS,IAAI,GAAG,MAAM,SAAS,IAAI,CAAC,CAAC;EAClF,SAAS,MAAM,QAAQ,MAAM,wCAAwC;EACrE,mBAAmB,MAAM,QAAQ,YAAY,MAAM,QAAQ,cAAc,SAAS;GAAE,KAAK;GAAG,KAAK,QAAQ;EAAO,CAAC,CAAC;EAClH,GAAG;CACL;AACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@goat-it/schemas",
3
3
  "type": "module",
4
- "version": "0.0.21-beta",
4
+ "version": "0.0.22-beta",
5
5
  "description": "Shared types, constants and Zod schemas for the Goat It projects.",
6
6
  "author": "Antoine ZANARDI",
7
7
  "license": "MIT",
@@ -14,11 +14,11 @@
14
14
  "@arethetypeswrong/core": "^0.18.5",
15
15
  "tsdown": "^0.22.14",
16
16
  "typescript": "^6.0.3",
17
- "zod": "^4.4.3"
17
+ "zod": "^4.5.4"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@faker-js/faker": ">=10.6.0",
21
- "zod": "^4.4.3"
21
+ "zod": "^4.5.4"
22
22
  },
23
23
  "publishConfig": {
24
24
  "access": "public",
@@ -64,7 +64,7 @@
64
64
  }
65
65
  },
66
66
  "dependencies": {
67
- "type-fest": "^5.8.0"
67
+ "type-fest": "^5.9.0"
68
68
  },
69
69
  "sideEffects": false,
70
70
  "scripts": {