@goat-it/schemas 0.0.1 → 0.0.4-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.
- package/dist/question/index.d.mts +3 -3
- package/dist/question/index.mjs +1 -2
- package/dist/question-theme/index.mjs +1 -2
- package/dist/shared/locale/index.mjs +1 -2
- package/dist/src/contexts/question/application/dto/admin-question/admin-question-content/admin-question-content.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/admin-question/admin-question-content/admin-question-content.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.d.mts +52 -11
- package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs +2 -4
- package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question/question-content/question-content.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/question/question-content/question-content.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question/question-theme-assignment/question-theme-assignment.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/question/question-theme-assignment/question-theme-assignment.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question/question.dto.shape.d.mts +52 -11
- package/dist/src/contexts/question/application/dto/question/question.dto.shape.mjs +2 -4
- package/dist/src/contexts/question/application/dto/question/question.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question-creation/question-author-creation/question-author-creation.dto.shape.mjs +3 -4
- package/dist/src/contexts/question/application/dto/question-creation/question-author-creation/question-author-creation.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question-creation/question-content-creation/question-content-creation.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/question-creation/question-content-creation/question-content-creation.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.d.mts +23 -6
- package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.mjs +2 -4
- package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.shape.d.mts +1 -1
- package/dist/src/contexts/question/application/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/shared/question-author/question-author.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/shared/question-author/question-author.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/shared/question-rejection/question-rejection.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/application/dto/shared/question-rejection/question-rejection.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/shared/zod/refinements/question-author/question-author.dto.zod.refinement.mjs +1 -1
- package/dist/src/contexts/question/application/dto/shared/zod/refinements/question-author/question-author.dto.zod.refinement.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.mjs +2 -4
- package/dist/src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.mjs.map +1 -1
- package/dist/src/contexts/question/domain/value-objects/question-author/question-author.constants.mjs +5 -9
- package/dist/src/contexts/question/domain/value-objects/question-author/question-author.constants.mjs.map +1 -1
- package/dist/src/contexts/question/domain/value-objects/question-category/question-category.constants.mjs +1 -1
- package/dist/src/contexts/question/domain/value-objects/question-category/question-category.types.d.mts +3 -1
- package/dist/src/contexts/question/domain/value-objects/question-cognitive-difficulty/question-cognitive-difficulty.constants.mjs +1 -1
- package/dist/src/contexts/question/domain/value-objects/question-cognitive-difficulty/question-cognitive-difficulty.types.d.mts +3 -1
- package/dist/src/contexts/question/domain/value-objects/question-rejection/question-rejection.constants.mjs +1 -1
- package/dist/src/contexts/question/domain/value-objects/question-status/question-status.constants.mjs +5 -10
- package/dist/src/contexts/question/domain/value-objects/question-status/question-status.constants.mjs.map +1 -1
- package/dist/src/contexts/question/domain/value-objects/question-status/question-status.types.d.mts +3 -1
- package/dist/src/contexts/question/modules/question-theme/application/dto/admin-question-theme/admin-question-theme.dto.shape.d.mts +9 -8
- package/dist/src/contexts/question/modules/question-theme/application/dto/admin-question-theme/admin-question-theme.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/modules/question-theme/application/dto/admin-question-theme/admin-question-theme.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme/question-theme.dto.shape.d.mts +6 -5
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme/question-theme.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme/question-theme.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme-creation/question-theme-creation.dto.shape.d.mts +4 -4
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme-creation/question-theme-creation.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme-creation/question-theme-creation.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme-modification/question-theme-modification.dto.shape.d.mts +4 -4
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme-modification/question-theme-modification.dto.shape.mjs +1 -2
- package/dist/src/contexts/question/modules/question-theme/application/dto/question-theme-modification/question-theme-modification.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants.mjs +1 -1
- package/dist/src/contexts/question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants.mjs +2 -5
- package/dist/src/contexts/question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants.mjs.map +1 -1
- package/dist/src/shared/application/dto/zod/refinements/array/array.zod.refinements.mjs +1 -1
- package/dist/src/shared/domain/value-objects/locale/locale.constants.mjs +1 -1
- package/dist/src/shared/infrastructure/http/zod/validators/localization/constants/localization.zod.validators.constants.mjs +2 -6
- package/dist/src/shared/infrastructure/http/zod/validators/localization/constants/localization.zod.validators.constants.mjs.map +1 -1
- package/dist/src/shared/infrastructure/http/zod/validators/localization/localization.zod.validators.mjs +5 -6
- package/dist/src/shared/infrastructure/http/zod/validators/localization/localization.zod.validators.mjs.map +1 -1
- package/dist/src/shared/infrastructure/http/zod/validators/string/constants/string.zod.validators.constants.mjs +3 -4
- package/dist/src/shared/infrastructure/http/zod/validators/string/constants/string.zod.validators.constants.mjs.map +1 -1
- package/dist/src/shared/infrastructure/http/zod/validators/string/string.zod.validators.mjs +5 -7
- package/dist/src/shared/infrastructure/http/zod/validators/string/string.zod.validators.mjs.map +1 -1
- package/dist/src/shared/types/enum.types.d.mts +22 -0
- package/package.json +11 -5
- package/dist/src/contexts/question/domain/value-objects/question-source-urls/question-source-urls.constants.mjs +0 -7
- package/dist/src/contexts/question/domain/value-objects/question-source-urls/question-source-urls.constants.mjs.map +0 -1
- package/dist/src/contexts/question/domain/value-objects/question-theme-assignment/question-theme-assignment.constants.mjs +0 -7
- package/dist/src/contexts/question/domain/value-objects/question-theme-assignment/question-theme-assignment.constants.mjs.map +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { QUESTION_REJECTION_TYPES } from "../../../../domain/value-objects/question-rejection/question-rejection.constants.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
3
|
//#region ../../src/contexts/question/application/dto/shared/question-rejection/question-rejection.dto.shape.ts
|
|
5
4
|
const QUESTION_REJECTION_DTO = z.strictObject({
|
|
6
5
|
type: z.enum(QUESTION_REJECTION_TYPES).describe("Question rejection's type").meta({ example: QUESTION_REJECTION_TYPES[0] }),
|
|
7
6
|
comment: z.string().optional().describe("Comment explaining the reason for rejection").meta({ example: "The question is too ambiguous." })
|
|
8
7
|
}).describe("Question rejection details");
|
|
9
|
-
|
|
10
8
|
//#endregion
|
|
11
9
|
export { QUESTION_REJECTION_DTO };
|
|
10
|
+
|
|
12
11
|
//# sourceMappingURL=question-rejection.dto.shape.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-rejection.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../src/contexts/question/application/dto/shared/question-rejection/question-rejection.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_REJECTION_TYPES } from \"@question/domain/value-objects/question-rejection/question-rejection.constants\";\n\nconst QUESTION_REJECTION_DTO = z.strictObject({\n type: z.enum(QUESTION_REJECTION_TYPES)\n .describe(\"Question rejection's type\")\n .meta({ example: QUESTION_REJECTION_TYPES[0] }),\n comment: z.string()\n .optional()\n .describe(\"Comment explaining the reason for rejection\")\n .meta({ example: \"The question is too ambiguous.\" }),\n}).describe(\"Question rejection details\");\n\nexport type QuestionRejectionDto = z.infer<typeof QUESTION_REJECTION_DTO>;\n\nexport { QUESTION_REJECTION_DTO };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-rejection.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../src/contexts/question/application/dto/shared/question-rejection/question-rejection.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_REJECTION_TYPES } from \"@question/domain/value-objects/question-rejection/question-rejection.constants\";\n\nconst QUESTION_REJECTION_DTO = z.strictObject({\n type: z.enum(QUESTION_REJECTION_TYPES)\n .describe(\"Question rejection's type\")\n .meta({ example: QUESTION_REJECTION_TYPES[0] }),\n comment: z.string()\n .optional()\n .describe(\"Comment explaining the reason for rejection\")\n .meta({ example: \"The question is too ambiguous.\" }),\n}).describe(\"Question rejection details\");\n\nexport type QuestionRejectionDto = z.infer<typeof QUESTION_REJECTION_DTO>;\n\nexport { QUESTION_REJECTION_DTO };"],"mappings":";;;AAIA,MAAM,yBAAyB,EAAE,aAAa;CAC5C,MAAM,EAAE,KAAK,yBAAyB,CACnC,SAAS,4BAA4B,CACrC,KAAK,EAAE,SAAS,yBAAyB,IAAI,CAAC;CACjD,SAAS,EAAE,QAAQ,CAChB,UAAU,CACV,SAAS,8CAA8C,CACvD,KAAK,EAAE,SAAS,kCAAkC,CAAC;CACvD,CAAC,CAAC,SAAS,6BAA6B"}
|
|
@@ -4,7 +4,7 @@ function isGameIdSetOnGameRole(questionAuthorDtoZodRefinement) {
|
|
|
4
4
|
if (role === "game") return typeof gameId === "string" && gameId.length > 0;
|
|
5
5
|
return gameId === void 0;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
//#endregion
|
|
9
8
|
export { isGameIdSetOnGameRole };
|
|
9
|
+
|
|
10
10
|
//# sourceMappingURL=question-author.dto.zod.refinement.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-author.dto.zod.refinement.mjs","names":[],"sources":["../../../../../../../../../../../../src/contexts/question/application/dto/shared/zod/refinements/question-author/question-author.dto.zod.refinement.ts"],"sourcesContent":["import type { QuestionAuthorRole } from \"@question/domain/value-objects/question-author/question-author.types\";\n\ntype QuestionAuthorDtoZodRefinement = {\n role: QuestionAuthorRole;\n gameId?: string;\n name?: string;\n};\n\nfunction isGameIdSetOnGameRole(questionAuthorDtoZodRefinement: QuestionAuthorDtoZodRefinement): boolean {\n const { role, gameId } = questionAuthorDtoZodRefinement;\n if (role === \"game\") {\n return typeof gameId === \"string\" && gameId.length > 0;\n }\n return gameId === undefined;\n}\n\nexport {\n isGameIdSetOnGameRole,\n};"],"mappings":";AAQA,SAAS,sBAAsB,gCAAyE;CACtG,MAAM,EAAE,MAAM,WAAW;AACzB,KAAI,SAAS,OACX,QAAO,OAAO,WAAW,YAAY,OAAO,SAAS;AAEvD,QAAO,WAAW"}
|
|
1
|
+
{"version":3,"file":"question-author.dto.zod.refinement.mjs","names":[],"sources":["../../../../../../../../../../../../src/contexts/question/application/dto/shared/zod/refinements/question-author/question-author.dto.zod.refinement.ts"],"sourcesContent":["import type { QuestionAuthorRole } from \"@question/domain/value-objects/question-author/question-author.types\";\n\ntype QuestionAuthorDtoZodRefinement = {\n role: QuestionAuthorRole;\n gameId?: string;\n name?: string;\n};\n\nfunction isGameIdSetOnGameRole(questionAuthorDtoZodRefinement: QuestionAuthorDtoZodRefinement): boolean {\n const { role, gameId } = questionAuthorDtoZodRefinement;\n if (role === \"game\") {\n return typeof gameId === \"string\" && gameId.length > 0;\n }\n return gameId === undefined;\n}\n\nexport {\n isGameIdSetOnGameRole,\n};"],"mappings":";AAQA,SAAS,sBAAsB,gCAAyE;CACtG,MAAM,EAAE,MAAM,WAAW;AACzB,KAAI,SAAS,OACX,QAAO,OAAO,WAAW,YAAY,OAAO,SAAS;AAEvD,QAAO,WAAW,KAAA"}
|
|
@@ -2,9 +2,7 @@ import { QUESTION_COGNITIVE_DIFFICULTIES } from "../../../../../domain/value-obj
|
|
|
2
2
|
import { QUESTION_CATEGORIES } from "../../../../../domain/value-objects/question-category/question-category.constants.mjs";
|
|
3
3
|
import { QUESTION_STATUSES } from "../../../../../domain/value-objects/question-status/question-status.constants.mjs";
|
|
4
4
|
import { areValuesUniqueFromStrings } from "../../../../../../../shared/application/dto/zod/refinements/array/array.zod.refinements.mjs";
|
|
5
|
-
import { QUESTION_SOURCE_URLS_MAX_ITEMS, QUESTION_SOURCE_URLS_MIN_ITEMS } from "../../../../../domain/value-objects/question-source-urls/question-source-urls.constants.mjs";
|
|
6
5
|
import { z } from "zod";
|
|
7
|
-
|
|
8
6
|
//#region ../../src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.ts
|
|
9
7
|
function zQuestionCognitiveDifficulty() {
|
|
10
8
|
return z.enum(QUESTION_COGNITIVE_DIFFICULTIES).describe("Question's cognitive difficulty level");
|
|
@@ -16,9 +14,9 @@ function zQuestionCategory() {
|
|
|
16
14
|
return z.enum(QUESTION_CATEGORIES).describe("Question's category");
|
|
17
15
|
}
|
|
18
16
|
function zQuestionSourceUrls() {
|
|
19
|
-
return z.array(z.url()).min(
|
|
17
|
+
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"] });
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
//#endregion
|
|
23
20
|
export { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls, zQuestionStatus };
|
|
21
|
+
|
|
24
22
|
//# 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\";\n\nimport { QUESTION_CATEGORIES } from \"@question/domain/value-objects/question-category/question-category.constants\";\nimport { QUESTION_SOURCE_URLS_MAX_ITEMS, QUESTION_SOURCE_URLS_MIN_ITEMS } from \"@question/domain/value-objects/question-source-urls/question-source-urls.constants\";\nimport { QUESTION_STATUSES } from \"@question/domain/value-objects/question-status/question-status.constants\";\nimport { QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/value-objects/question-cognitive-difficulty/question-cognitive-difficulty.constants\";\n\nimport type { ZodEnum, ZodURL, ZodArray } from \"zod\";\n\nimport type { QuestionCategoryEnum } from \"@question/domain/value-objects/question-category/question-category.types\";\nimport type { QuestionStatusEnum } from \"@question/domain/value-objects/question-status/question-status.types\";\nimport type { QuestionCognitiveDifficultyEnum } from \"@question/domain/value-objects/question-cognitive-difficulty/question-cognitive-difficulty.types\";\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\nexport {\n zQuestionCognitiveDifficulty,\n zQuestionStatus,\n zQuestionCategory,\n zQuestionSourceUrls,\n};"],"mappings":"
|
|
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\";\n\nimport { QUESTION_CATEGORIES } from \"@question/domain/value-objects/question-category/question-category.constants\";\nimport { QUESTION_SOURCE_URLS_MAX_ITEMS, QUESTION_SOURCE_URLS_MIN_ITEMS } from \"@question/domain/value-objects/question-source-urls/question-source-urls.constants\";\nimport { QUESTION_STATUSES } from \"@question/domain/value-objects/question-status/question-status.constants\";\nimport { QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/value-objects/question-cognitive-difficulty/question-cognitive-difficulty.constants\";\n\nimport type { ZodEnum, ZodURL, ZodArray } from \"zod\";\n\nimport type { QuestionCategoryEnum } from \"@question/domain/value-objects/question-category/question-category.types\";\nimport type { QuestionStatusEnum } from \"@question/domain/value-objects/question-status/question-status.types\";\nimport type { QuestionCognitiveDifficultyEnum } from \"@question/domain/value-objects/question-cognitive-difficulty/question-cognitive-difficulty.types\";\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\nexport {\n zQuestionCognitiveDifficulty,\n zQuestionStatus,\n zQuestionCategory,\n zQuestionSourceUrls,\n};"],"mappings":";;;;;;AAeA,SAAS,+BAAyE;AAChF,QAAO,EAAE,KAAK,gCAAgC,CAC3C,SAAS,wCAAwC;;AAGtD,SAAS,kBAA+C;AACtD,QAAO,EAAE,KAAK,kBAAkB,CAC7B,SAAS,oBAAoB;;AAGlC,SAAS,oBAAmD;AAC1D,QAAO,EAAE,KAAK,oBAAoB,CAC/B,SAAS,sBAAsB;;AAGpC,SAAS,sBAAwC;AAC/C,QAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CACpB,IAAA,EAAmC,CACnC,IAAA,EAAmC,CACnC,OAAO,4BAA4B,EAAE,SAAS,8BAA8B,CAAC,CAC7E,SAAS,8CAA8C,CACvD,KAAK,EAAE,SAAS,CAAC,+BAA+B,8BAA8B,EAAE,CAAC"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
//#region ../../src/contexts/question/domain/value-objects/question-author/question-author.constants.ts
|
|
2
2
|
const QUESTION_AUTHOR_ROLE_ADMIN = "admin";
|
|
3
|
-
const QUESTION_AUTHOR_ROLE_GAME = "game";
|
|
4
|
-
const QUESTION_AUTHOR_ROLE_AI = "ai";
|
|
5
3
|
const QUESTION_AUTHOR_ROLES = [
|
|
6
4
|
QUESTION_AUTHOR_ROLE_ADMIN,
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"game",
|
|
6
|
+
"ai"
|
|
9
7
|
];
|
|
10
|
-
const QUESTION_CREATION_AUTHOR_ROLES = [QUESTION_AUTHOR_ROLE_ADMIN,
|
|
11
|
-
const QUESTION_AUTHOR_NAME_MIN_LENGTH = 3;
|
|
12
|
-
const QUESTION_AUTHOR_NAME_MAX_LENGTH = 30;
|
|
13
|
-
|
|
8
|
+
const QUESTION_CREATION_AUTHOR_ROLES = [QUESTION_AUTHOR_ROLE_ADMIN, "ai"];
|
|
14
9
|
//#endregion
|
|
15
|
-
export {
|
|
10
|
+
export { QUESTION_AUTHOR_ROLES, QUESTION_CREATION_AUTHOR_ROLES };
|
|
11
|
+
|
|
16
12
|
//# sourceMappingURL=question-author.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-author.constants.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/domain/value-objects/question-author/question-author.constants.ts"],"sourcesContent":["const QUESTION_AUTHOR_ROLE_ADMIN = \"admin\";\nconst QUESTION_AUTHOR_ROLE_GAME = \"game\";\nconst QUESTION_AUTHOR_ROLE_AI = \"ai\";\n\nconst QUESTION_AUTHOR_ROLES = [\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_GAME,\n QUESTION_AUTHOR_ROLE_AI,\n] as const satisfies readonly string[];\n\nconst QUESTION_CREATION_AUTHOR_ROLES = [\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_AI,\n] as const satisfies readonly string[];\n\nconst QUESTION_AUTHOR_NAME_MIN_LENGTH = 3;\n\nconst QUESTION_AUTHOR_NAME_MAX_LENGTH = 30;\n\nexport {\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_GAME,\n QUESTION_AUTHOR_ROLE_AI,\n QUESTION_AUTHOR_ROLES,\n QUESTION_CREATION_AUTHOR_ROLES,\n QUESTION_AUTHOR_NAME_MIN_LENGTH,\n QUESTION_AUTHOR_NAME_MAX_LENGTH,\n};"],"mappings":";AAAA,MAAM,6BAA6B;
|
|
1
|
+
{"version":3,"file":"question-author.constants.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/domain/value-objects/question-author/question-author.constants.ts"],"sourcesContent":["const QUESTION_AUTHOR_ROLE_ADMIN = \"admin\";\nconst QUESTION_AUTHOR_ROLE_GAME = \"game\";\nconst QUESTION_AUTHOR_ROLE_AI = \"ai\";\n\nconst QUESTION_AUTHOR_ROLES = [\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_GAME,\n QUESTION_AUTHOR_ROLE_AI,\n] as const satisfies readonly string[];\n\nconst QUESTION_CREATION_AUTHOR_ROLES = [\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_AI,\n] as const satisfies readonly string[];\n\nconst QUESTION_AUTHOR_NAME_MIN_LENGTH = 3;\n\nconst QUESTION_AUTHOR_NAME_MAX_LENGTH = 30;\n\nexport {\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_GAME,\n QUESTION_AUTHOR_ROLE_AI,\n QUESTION_AUTHOR_ROLES,\n QUESTION_CREATION_AUTHOR_ROLES,\n QUESTION_AUTHOR_NAME_MIN_LENGTH,\n QUESTION_AUTHOR_NAME_MAX_LENGTH,\n};"],"mappings":";AAAA,MAAM,6BAA6B;AAInC,MAAM,wBAAwB;CAC5B;CAJgC;;CAOjC;AAED,MAAM,iCAAiC,CACrC,4BAAA,KAED"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { QUESTION_CATEGORIES } from "./question-category.constants.mjs";
|
|
2
|
+
import { TupleToEnum } from "../../../../../shared/types/enum.types.mjs";
|
|
2
3
|
import { TupleToUnion } from "type-fest";
|
|
3
4
|
|
|
4
5
|
//#region ../../src/contexts/question/domain/value-objects/question-category/question-category.types.d.ts
|
|
5
6
|
type QuestionCategory = TupleToUnion<typeof QUESTION_CATEGORIES>;
|
|
7
|
+
type QuestionCategoryEnum = TupleToEnum<typeof QUESTION_CATEGORIES>;
|
|
6
8
|
//#endregion
|
|
7
|
-
export { type QuestionCategory };
|
|
9
|
+
export { type QuestionCategory, type QuestionCategoryEnum };
|
|
8
10
|
//# sourceMappingURL=question-category.types.d.mts.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { QUESTION_COGNITIVE_DIFFICULTIES } from "./question-cognitive-difficulty.constants.mjs";
|
|
2
|
+
import { TupleToEnum } from "../../../../../shared/types/enum.types.mjs";
|
|
2
3
|
import { TupleToUnion } from "type-fest";
|
|
3
4
|
|
|
4
5
|
//#region ../../src/contexts/question/domain/value-objects/question-cognitive-difficulty/question-cognitive-difficulty.types.d.ts
|
|
5
6
|
type QuestionCognitiveDifficulty = TupleToUnion<typeof QUESTION_COGNITIVE_DIFFICULTIES>;
|
|
7
|
+
type QuestionCognitiveDifficultyEnum = TupleToEnum<typeof QUESTION_COGNITIVE_DIFFICULTIES>;
|
|
6
8
|
//#endregion
|
|
7
|
-
export { type QuestionCognitiveDifficulty };
|
|
9
|
+
export { type QuestionCognitiveDifficulty, type QuestionCognitiveDifficultyEnum };
|
|
8
10
|
//# sourceMappingURL=question-cognitive-difficulty.types.d.mts.map
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
//#region ../../src/contexts/question/domain/value-objects/question-status/question-status.constants.ts
|
|
2
|
-
const QUESTION_STATUS_PENDING = "pending";
|
|
3
|
-
const QUESTION_STATUS_ACTIVE = "active";
|
|
4
|
-
const QUESTION_STATUS_ARCHIVED = "archived";
|
|
5
|
-
const QUESTION_STATUS_REJECTED = "rejected";
|
|
6
1
|
const QUESTION_STATUSES = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"pending",
|
|
3
|
+
"active",
|
|
4
|
+
"archived",
|
|
5
|
+
"rejected"
|
|
11
6
|
];
|
|
12
|
-
|
|
13
7
|
//#endregion
|
|
14
8
|
export { QUESTION_STATUSES };
|
|
9
|
+
|
|
15
10
|
//# sourceMappingURL=question-status.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-status.constants.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/domain/value-objects/question-status/question-status.constants.ts"],"sourcesContent":["const QUESTION_STATUS_PENDING = \"pending\";\nconst QUESTION_STATUS_ACTIVE = \"active\";\nconst QUESTION_STATUS_ARCHIVED = \"archived\";\nconst QUESTION_STATUS_REJECTED = \"rejected\";\n\nconst QUESTION_STATUSES = [\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_ACTIVE,\n QUESTION_STATUS_ARCHIVED,\n QUESTION_STATUS_REJECTED,\n] as const satisfies readonly string[];\n\nconst QUESTION_CREATION_STATUSES = [\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_ACTIVE,\n] as const satisfies readonly string[];\n\nexport {\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_ACTIVE,\n QUESTION_STATUS_ARCHIVED,\n QUESTION_STATUS_REJECTED,\n QUESTION_STATUSES,\n QUESTION_CREATION_STATUSES,\n};"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-status.constants.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/domain/value-objects/question-status/question-status.constants.ts"],"sourcesContent":["const QUESTION_STATUS_PENDING = \"pending\";\nconst QUESTION_STATUS_ACTIVE = \"active\";\nconst QUESTION_STATUS_ARCHIVED = \"archived\";\nconst QUESTION_STATUS_REJECTED = \"rejected\";\n\nconst QUESTION_STATUSES = [\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_ACTIVE,\n QUESTION_STATUS_ARCHIVED,\n QUESTION_STATUS_REJECTED,\n] as const satisfies readonly string[];\n\nconst QUESTION_CREATION_STATUSES = [\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_ACTIVE,\n] as const satisfies readonly string[];\n\nexport {\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_ACTIVE,\n QUESTION_STATUS_ARCHIVED,\n QUESTION_STATUS_REJECTED,\n QUESTION_STATUSES,\n QUESTION_CREATION_STATUSES,\n};"],"mappings":"AAKA,MAAM,oBAAoB;CALM;CACD;CACE;CACA;CAOhC"}
|
package/dist/src/contexts/question/domain/value-objects/question-status/question-status.types.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { QUESTION_STATUSES } from "./question-status.constants.mjs";
|
|
2
|
+
import { TupleToEnum } from "../../../../../shared/types/enum.types.mjs";
|
|
2
3
|
import { TupleToUnion } from "type-fest";
|
|
3
4
|
|
|
4
5
|
//#region ../../src/contexts/question/domain/value-objects/question-status/question-status.types.d.ts
|
|
5
6
|
type QuestionStatus = TupleToUnion<typeof QUESTION_STATUSES>;
|
|
7
|
+
type QuestionStatusEnum = TupleToEnum<typeof QUESTION_STATUSES>;
|
|
6
8
|
//#endregion
|
|
7
|
-
export { type QuestionStatus };
|
|
9
|
+
export { type QuestionStatus, type QuestionStatusEnum };
|
|
8
10
|
//# sourceMappingURL=question-status.types.d.mts.map
|
|
@@ -2,16 +2,17 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/admin-question-theme/admin-question-theme.dto.shape.d.ts
|
|
4
4
|
declare const ADMIN_QUESTION_THEME_DTO: z.ZodObject<{
|
|
5
|
-
id:
|
|
6
|
-
slug:
|
|
7
|
-
label:
|
|
8
|
-
aliases:
|
|
9
|
-
description:
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
slug: z.ZodString;
|
|
7
|
+
label: z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>;
|
|
8
|
+
aliases: z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodArray<z.ZodString>>>, z.core.$strip>;
|
|
9
|
+
description: z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>;
|
|
10
10
|
status: z.ZodEnum<{
|
|
11
|
-
|
|
11
|
+
active: "active";
|
|
12
|
+
archived: "archived";
|
|
12
13
|
}>;
|
|
13
|
-
createdAt:
|
|
14
|
-
updatedAt:
|
|
14
|
+
createdAt: z.ZodISODateTime;
|
|
15
|
+
updatedAt: z.ZodISODateTime;
|
|
15
16
|
}, z.core.$strict>;
|
|
16
17
|
type AdminQuestionThemeDto = z.infer<typeof ADMIN_QUESTION_THEME_DTO>;
|
|
17
18
|
//#endregion
|
|
@@ -3,7 +3,6 @@ import { zIsoDateTime, zMongoId, zSlug } from "../../../../../../../shared/infra
|
|
|
3
3
|
import { QUESTION_THEME_SLUG_EXAMPLE } from "../zod/validators/constants/question-theme.zod.validators.constants.mjs";
|
|
4
4
|
import { QUESTION_THEME_STATUSES } from "../../../domain/value-objects/question-theme-status/question-theme-status.constants.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
7
6
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/admin-question-theme/admin-question-theme.dto.shape.ts
|
|
8
7
|
const ADMIN_QUESTION_THEME_DTO = z.strictObject({
|
|
9
8
|
id: zMongoId().describe("Question Theme's unique identifier"),
|
|
@@ -15,7 +14,7 @@ const ADMIN_QUESTION_THEME_DTO = z.strictObject({
|
|
|
15
14
|
createdAt: zIsoDateTime().describe("Question Theme's creation date"),
|
|
16
15
|
updatedAt: zIsoDateTime().describe("Question Theme's last update date")
|
|
17
16
|
});
|
|
18
|
-
|
|
19
17
|
//#endregion
|
|
20
18
|
export { ADMIN_QUESTION_THEME_DTO };
|
|
19
|
+
|
|
21
20
|
//# sourceMappingURL=admin-question-theme.dto.shape.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-question-theme.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/admin-question-theme/admin-question-theme.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zLocalizedText, zLocalizedTexts } from \"@shared/infrastructure/http/zod/validators/localization/localization.zod.validators\";\nimport { zIsoDateTime, zMongoId, zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\nimport { QUESTION_THEME_STATUSES } from \"@question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants\";\n\nconst ADMIN_QUESTION_THEME_DTO = z.strictObject({\n id: zMongoId()\n .describe(\"Question Theme's unique identifier\"),\n slug: zSlug()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: zLocalizedText()\n .describe(\"Question Theme's label in supported locales\"),\n aliases: zLocalizedTexts()\n .describe(\"Question Theme's aliases in supported locales. Help to find the theme with different keywords\"),\n description: zLocalizedText()\n .describe(\"Question Theme's description in supported locales\"),\n status: z.enum(QUESTION_THEME_STATUSES)\n .describe(\"Question Theme's status\")\n .meta({ example: QUESTION_THEME_STATUSES[0] }),\n createdAt: zIsoDateTime()\n .describe(\"Question Theme's creation date\"),\n updatedAt: zIsoDateTime()\n .describe(\"Question Theme's last update date\"),\n});\n\nexport type AdminQuestionThemeDto = z.infer<typeof ADMIN_QUESTION_THEME_DTO>;\n\nexport { ADMIN_QUESTION_THEME_DTO };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin-question-theme.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/admin-question-theme/admin-question-theme.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zLocalizedText, zLocalizedTexts } from \"@shared/infrastructure/http/zod/validators/localization/localization.zod.validators\";\nimport { zIsoDateTime, zMongoId, zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\nimport { QUESTION_THEME_STATUSES } from \"@question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants\";\n\nconst ADMIN_QUESTION_THEME_DTO = z.strictObject({\n id: zMongoId()\n .describe(\"Question Theme's unique identifier\"),\n slug: zSlug()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: zLocalizedText()\n .describe(\"Question Theme's label in supported locales\"),\n aliases: zLocalizedTexts()\n .describe(\"Question Theme's aliases in supported locales. Help to find the theme with different keywords\"),\n description: zLocalizedText()\n .describe(\"Question Theme's description in supported locales\"),\n status: z.enum(QUESTION_THEME_STATUSES)\n .describe(\"Question Theme's status\")\n .meta({ example: QUESTION_THEME_STATUSES[0] }),\n createdAt: zIsoDateTime()\n .describe(\"Question Theme's creation date\"),\n updatedAt: zIsoDateTime()\n .describe(\"Question Theme's last update date\"),\n});\n\nexport type AdminQuestionThemeDto = z.infer<typeof ADMIN_QUESTION_THEME_DTO>;\n\nexport { ADMIN_QUESTION_THEME_DTO };"],"mappings":";;;;;;AAQA,MAAM,2BAA2B,EAAE,aAAa;CAC9C,IAAI,UAAU,CACX,SAAS,qCAAqC;CACjD,MAAM,OAAO,CACV,SAAS,6CAA6C,CACtD,KAAK,EAAE,SAAS,6BAA6B,CAAC;CACjD,OAAO,gBAAgB,CACpB,SAAS,8CAA8C;CAC1D,SAAS,iBAAiB,CACvB,SAAS,gGAAgG;CAC5G,aAAa,gBAAgB,CAC1B,SAAS,oDAAoD;CAChE,QAAQ,EAAE,KAAK,wBAAwB,CACpC,SAAS,0BAA0B,CACnC,KAAK,EAAE,SAAS,wBAAwB,IAAI,CAAC;CAChD,WAAW,cAAc,CACtB,SAAS,iCAAiC;CAC7C,WAAW,cAAc,CACtB,SAAS,oCAAoC;CACjD,CAAC"}
|
|
@@ -2,16 +2,17 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/question-theme/question-theme.dto.shape.d.ts
|
|
4
4
|
declare const QUESTION_THEME_DTO: z.ZodObject<{
|
|
5
|
-
id:
|
|
6
|
-
slug:
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
slug: z.ZodString;
|
|
7
7
|
label: z.ZodString;
|
|
8
8
|
aliases: z.ZodArray<z.ZodString>;
|
|
9
9
|
description: z.ZodString;
|
|
10
10
|
status: z.ZodEnum<{
|
|
11
|
-
|
|
11
|
+
active: "active";
|
|
12
|
+
archived: "archived";
|
|
12
13
|
}>;
|
|
13
|
-
createdAt:
|
|
14
|
-
updatedAt:
|
|
14
|
+
createdAt: z.ZodISODateTime;
|
|
15
|
+
updatedAt: z.ZodISODateTime;
|
|
15
16
|
}, z.core.$strict>;
|
|
16
17
|
type QuestionThemeDto = z.infer<typeof QUESTION_THEME_DTO>;
|
|
17
18
|
//#endregion
|
|
@@ -2,7 +2,6 @@ import { zIsoDateTime, zMongoId, zSlug } from "../../../../../../../shared/infra
|
|
|
2
2
|
import { QUESTION_THEME_SLUG_EXAMPLE } from "../zod/validators/constants/question-theme.zod.validators.constants.mjs";
|
|
3
3
|
import { QUESTION_THEME_STATUSES } from "../../../domain/value-objects/question-theme-status/question-theme-status.constants.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
6
5
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/question-theme/question-theme.dto.shape.ts
|
|
7
6
|
const QUESTION_THEME_DTO = z.strictObject({
|
|
8
7
|
id: zMongoId().describe("Question Theme's unique identifier"),
|
|
@@ -18,7 +17,7 @@ const QUESTION_THEME_DTO = z.strictObject({
|
|
|
18
17
|
createdAt: zIsoDateTime().describe("Question Theme's creation date"),
|
|
19
18
|
updatedAt: zIsoDateTime().describe("Question Theme's last update date")
|
|
20
19
|
});
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
21
|
export { QUESTION_THEME_DTO };
|
|
22
|
+
|
|
24
23
|
//# sourceMappingURL=question-theme.dto.shape.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-theme.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/question-theme/question-theme.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zIsoDateTime, zMongoId, zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\nimport { QUESTION_THEME_STATUSES } from \"@question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants\";\n\nconst QUESTION_THEME_DTO = z.strictObject({\n id: zMongoId()\n .describe(\"Question Theme's unique identifier\"),\n slug: zSlug()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: z.string()\n .describe(\"Question Theme's translated label\")\n .meta({ example: \"History\" }),\n aliases: z.array(z.string())\n .describe(\"Question Theme's translated aliases. Help to find the theme with different keywords\")\n .meta({ example: [\"Historical Events\", \"Past\", \"Future\"] }),\n description: z.string()\n .describe(\"Question Theme's translated description\")\n .meta({ example: \"Questions related to historical events and timelines.\" }),\n status: z.enum(QUESTION_THEME_STATUSES)\n .describe(\"Question Theme's status\")\n .meta({ example: QUESTION_THEME_STATUSES[0] }),\n createdAt: zIsoDateTime()\n .describe(\"Question Theme's creation date\"),\n updatedAt: zIsoDateTime()\n .describe(\"Question Theme's last update date\"),\n});\n\nexport type QuestionThemeDto = z.infer<typeof QUESTION_THEME_DTO>;\n\nexport { QUESTION_THEME_DTO };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-theme.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/question-theme/question-theme.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zIsoDateTime, zMongoId, zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\nimport { QUESTION_THEME_STATUSES } from \"@question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants\";\n\nconst QUESTION_THEME_DTO = z.strictObject({\n id: zMongoId()\n .describe(\"Question Theme's unique identifier\"),\n slug: zSlug()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: z.string()\n .describe(\"Question Theme's translated label\")\n .meta({ example: \"History\" }),\n aliases: z.array(z.string())\n .describe(\"Question Theme's translated aliases. Help to find the theme with different keywords\")\n .meta({ example: [\"Historical Events\", \"Past\", \"Future\"] }),\n description: z.string()\n .describe(\"Question Theme's translated description\")\n .meta({ example: \"Questions related to historical events and timelines.\" }),\n status: z.enum(QUESTION_THEME_STATUSES)\n .describe(\"Question Theme's status\")\n .meta({ example: QUESTION_THEME_STATUSES[0] }),\n createdAt: zIsoDateTime()\n .describe(\"Question Theme's creation date\"),\n updatedAt: zIsoDateTime()\n .describe(\"Question Theme's last update date\"),\n});\n\nexport type QuestionThemeDto = z.infer<typeof QUESTION_THEME_DTO>;\n\nexport { QUESTION_THEME_DTO };"],"mappings":";;;;;AAOA,MAAM,qBAAqB,EAAE,aAAa;CACxC,IAAI,UAAU,CACX,SAAS,qCAAqC;CACjD,MAAM,OAAO,CACV,SAAS,6CAA6C,CACtD,KAAK,EAAE,SAAS,6BAA6B,CAAC;CACjD,OAAO,EAAE,QAAQ,CACd,SAAS,oCAAoC,CAC7C,KAAK,EAAE,SAAS,WAAW,CAAC;CAC/B,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CACzB,SAAS,sFAAsF,CAC/F,KAAK,EAAE,SAAS;EAAC;EAAqB;EAAQ;EAAS,EAAE,CAAC;CAC7D,aAAa,EAAE,QAAQ,CACpB,SAAS,0CAA0C,CACnD,KAAK,EAAE,SAAS,yDAAyD,CAAC;CAC7E,QAAQ,EAAE,KAAK,wBAAwB,CACpC,SAAS,0BAA0B,CACnC,KAAK,EAAE,SAAS,wBAAwB,IAAI,CAAC;CAChD,WAAW,cAAc,CACtB,SAAS,iCAAiC;CAC7C,WAAW,cAAc,CACtB,SAAS,oCAAoC;CACjD,CAAC"}
|
|
@@ -2,10 +2,10 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/question-theme-creation/question-theme-creation.dto.shape.d.ts
|
|
4
4
|
declare const QUESTION_THEME_CREATION_DTO: z.ZodObject<{
|
|
5
|
-
slug:
|
|
6
|
-
label:
|
|
7
|
-
aliases:
|
|
8
|
-
description:
|
|
5
|
+
slug: z.ZodString;
|
|
6
|
+
label: z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>;
|
|
7
|
+
aliases: z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodArray<z.ZodString>>>, z.core.$strip>;
|
|
8
|
+
description: z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
type QuestionThemeCreationDto = z.infer<typeof QUESTION_THEME_CREATION_DTO>;
|
|
11
11
|
//#endregion
|
|
@@ -2,7 +2,6 @@ import { zLocalizedText, zLocalizedTexts } from "../../../../../../../shared/inf
|
|
|
2
2
|
import { zSlug } from "../../../../../../../shared/infrastructure/http/zod/validators/string/string.zod.validators.mjs";
|
|
3
3
|
import { QUESTION_THEME_SLUG_EXAMPLE } from "../zod/validators/constants/question-theme.zod.validators.constants.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
6
5
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/question-theme-creation/question-theme-creation.dto.shape.ts
|
|
7
6
|
const QUESTION_THEME_CREATION_DTO = z.object({
|
|
8
7
|
slug: zSlug().describe("Question Theme's unique slug in kebab-case").meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),
|
|
@@ -10,7 +9,7 @@ const QUESTION_THEME_CREATION_DTO = z.object({
|
|
|
10
9
|
aliases: zLocalizedTexts().describe("Question Theme's translated aliases. Help to find the theme with different keywords"),
|
|
11
10
|
description: zLocalizedText().describe("Question Theme's translated description")
|
|
12
11
|
});
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
13
|
export { QUESTION_THEME_CREATION_DTO };
|
|
14
|
+
|
|
16
15
|
//# sourceMappingURL=question-theme-creation.dto.shape.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-theme-creation.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/question-theme-creation/question-theme-creation.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zLocalizedText, zLocalizedTexts } from \"@shared/infrastructure/http/zod/validators/localization/localization.zod.validators\";\nimport { zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\n\nconst QUESTION_THEME_CREATION_DTO = z.object({\n slug: zSlug()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: zLocalizedText()\n .describe(\"Question Theme's translated label\"),\n aliases: zLocalizedTexts()\n .describe(\"Question Theme's translated aliases. Help to find the theme with different keywords\"),\n description: zLocalizedText()\n .describe(\"Question Theme's translated description\"),\n});\n\nexport type QuestionThemeCreationDto = z.infer<typeof QUESTION_THEME_CREATION_DTO>;\n\nexport { QUESTION_THEME_CREATION_DTO };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-theme-creation.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/question-theme-creation/question-theme-creation.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zLocalizedText, zLocalizedTexts } from \"@shared/infrastructure/http/zod/validators/localization/localization.zod.validators\";\nimport { zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\n\nconst QUESTION_THEME_CREATION_DTO = z.object({\n slug: zSlug()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: zLocalizedText()\n .describe(\"Question Theme's translated label\"),\n aliases: zLocalizedTexts()\n .describe(\"Question Theme's translated aliases. Help to find the theme with different keywords\"),\n description: zLocalizedText()\n .describe(\"Question Theme's translated description\"),\n});\n\nexport type QuestionThemeCreationDto = z.infer<typeof QUESTION_THEME_CREATION_DTO>;\n\nexport { QUESTION_THEME_CREATION_DTO };"],"mappings":";;;;;AAOA,MAAM,8BAA8B,EAAE,OAAO;CAC3C,MAAM,OAAO,CACV,SAAS,6CAA6C,CACtD,KAAK,EAAE,SAAS,6BAA6B,CAAC;CACjD,OAAO,gBAAgB,CACpB,SAAS,oCAAoC;CAChD,SAAS,iBAAiB,CACvB,SAAS,sFAAsF;CAClG,aAAa,gBAAgB,CAC1B,SAAS,0CAA0C;CACvD,CAAC"}
|
|
@@ -2,10 +2,10 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/question-theme-modification/question-theme-modification.dto.shape.d.ts
|
|
4
4
|
declare const QUESTION_THEME_MODIFICATION_DTO: z.ZodObject<{
|
|
5
|
-
slug:
|
|
6
|
-
label:
|
|
7
|
-
aliases:
|
|
8
|
-
description:
|
|
5
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
6
|
+
label: z.ZodOptional<z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>>;
|
|
7
|
+
aliases: z.ZodOptional<z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodArray<z.ZodString>>>, z.core.$strip>>;
|
|
8
|
+
description: z.ZodOptional<z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
type QuestionThemeModificationDto = z.infer<typeof QUESTION_THEME_MODIFICATION_DTO>;
|
|
11
11
|
//#endregion
|
|
@@ -2,7 +2,6 @@ import { zLocalizedText, zLocalizedTexts } from "../../../../../../../shared/inf
|
|
|
2
2
|
import { zSlug } from "../../../../../../../shared/infrastructure/http/zod/validators/string/string.zod.validators.mjs";
|
|
3
3
|
import { QUESTION_THEME_SLUG_EXAMPLE } from "../zod/validators/constants/question-theme.zod.validators.constants.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
6
5
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/question-theme-modification/question-theme-modification.dto.shape.ts
|
|
7
6
|
const QUESTION_THEME_MODIFICATION_DTO = z.object({
|
|
8
7
|
slug: zSlug().optional().describe("Question Theme's unique slug in kebab-case").meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),
|
|
@@ -10,7 +9,7 @@ const QUESTION_THEME_MODIFICATION_DTO = z.object({
|
|
|
10
9
|
aliases: zLocalizedTexts().optional().describe("Question Theme's translated aliases. Help to find the theme with different keywords"),
|
|
11
10
|
description: zLocalizedText().optional().describe("Question Theme's translated description")
|
|
12
11
|
});
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
13
|
export { QUESTION_THEME_MODIFICATION_DTO };
|
|
14
|
+
|
|
16
15
|
//# sourceMappingURL=question-theme-modification.dto.shape.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-theme-modification.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/question-theme-modification/question-theme-modification.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zLocalizedText, zLocalizedTexts } from \"@shared/infrastructure/http/zod/validators/localization/localization.zod.validators\";\nimport { zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\n\nconst QUESTION_THEME_MODIFICATION_DTO = z.object({\n slug: zSlug()\n .optional()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: zLocalizedText()\n .optional()\n .describe(\"Question Theme's translated label\"),\n aliases: zLocalizedTexts()\n .optional()\n .describe(\"Question Theme's translated aliases. Help to find the theme with different keywords\"),\n description: zLocalizedText()\n .optional()\n .describe(\"Question Theme's translated description\"),\n});\n\nexport type QuestionThemeModificationDto = z.infer<typeof QUESTION_THEME_MODIFICATION_DTO>;\n\nexport { QUESTION_THEME_MODIFICATION_DTO };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-theme-modification.dto.shape.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/application/dto/question-theme-modification/question-theme-modification.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zLocalizedText, zLocalizedTexts } from \"@shared/infrastructure/http/zod/validators/localization/localization.zod.validators\";\nimport { zSlug } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_THEME_SLUG_EXAMPLE } from \"@question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants\";\n\nconst QUESTION_THEME_MODIFICATION_DTO = z.object({\n slug: zSlug()\n .optional()\n .describe(\"Question Theme's unique slug in kebab-case\")\n .meta({ example: QUESTION_THEME_SLUG_EXAMPLE }),\n label: zLocalizedText()\n .optional()\n .describe(\"Question Theme's translated label\"),\n aliases: zLocalizedTexts()\n .optional()\n .describe(\"Question Theme's translated aliases. Help to find the theme with different keywords\"),\n description: zLocalizedText()\n .optional()\n .describe(\"Question Theme's translated description\"),\n});\n\nexport type QuestionThemeModificationDto = z.infer<typeof QUESTION_THEME_MODIFICATION_DTO>;\n\nexport { QUESTION_THEME_MODIFICATION_DTO };"],"mappings":";;;;;AAOA,MAAM,kCAAkC,EAAE,OAAO;CAC/C,MAAM,OAAO,CACV,UAAU,CACV,SAAS,6CAA6C,CACtD,KAAK,EAAE,SAAS,6BAA6B,CAAC;CACjD,OAAO,gBAAgB,CACpB,UAAU,CACV,SAAS,oCAAoC;CAChD,SAAS,iBAAiB,CACvB,UAAU,CACV,SAAS,sFAAsF;CAClG,aAAa,gBAAgB,CAC1B,UAAU,CACV,SAAS,0CAA0C;CACvD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region ../../src/contexts/question/modules/question-theme/application/dto/zod/validators/constants/question-theme.zod.validators.constants.ts
|
|
2
2
|
const QUESTION_THEME_SLUG_EXAMPLE = "general-knowledge";
|
|
3
|
-
|
|
4
3
|
//#endregion
|
|
5
4
|
export { QUESTION_THEME_SLUG_EXAMPLE };
|
|
5
|
+
|
|
6
6
|
//# sourceMappingURL=question-theme.zod.validators.constants.mjs.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const DEFAULT_QUESTION_THEME_STATUS = "active";
|
|
3
|
-
const QUESTION_THEME_STATUS_ARCHIVED = "archived";
|
|
4
|
-
const QUESTION_THEME_STATUSES = [DEFAULT_QUESTION_THEME_STATUS, QUESTION_THEME_STATUS_ARCHIVED];
|
|
5
|
-
|
|
1
|
+
const QUESTION_THEME_STATUSES = ["active", "archived"];
|
|
6
2
|
//#endregion
|
|
7
3
|
export { QUESTION_THEME_STATUSES };
|
|
4
|
+
|
|
8
5
|
//# sourceMappingURL=question-theme-status.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-theme-status.constants.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants.ts"],"sourcesContent":["const DEFAULT_QUESTION_THEME_STATUS = \"active\";\n\nconst QUESTION_THEME_STATUS_ARCHIVED = \"archived\";\n\nconst QUESTION_THEME_STATUSES = [\n DEFAULT_QUESTION_THEME_STATUS,\n QUESTION_THEME_STATUS_ARCHIVED,\n] as const satisfies readonly string[];\n\nexport {\n QUESTION_THEME_STATUSES,\n DEFAULT_QUESTION_THEME_STATUS,\n QUESTION_THEME_STATUS_ARCHIVED,\n};"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-theme-status.constants.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/modules/question-theme/domain/value-objects/question-theme-status/question-theme-status.constants.ts"],"sourcesContent":["const DEFAULT_QUESTION_THEME_STATUS = \"active\";\n\nconst QUESTION_THEME_STATUS_ARCHIVED = \"archived\";\n\nconst QUESTION_THEME_STATUSES = [\n DEFAULT_QUESTION_THEME_STATUS,\n QUESTION_THEME_STATUS_ARCHIVED,\n] as const satisfies readonly string[];\n\nexport {\n QUESTION_THEME_STATUSES,\n DEFAULT_QUESTION_THEME_STATUS,\n QUESTION_THEME_STATUS_ARCHIVED,\n};"],"mappings":"AAIA,MAAM,0BAA0B,CAJM,UAEC,WAKtC"}
|
|
@@ -8,7 +8,7 @@ function areValuesUniqueByKey(array, key) {
|
|
|
8
8
|
function hasExactlyOneByKey(array, key, value) {
|
|
9
9
|
return array.filter((item) => item[key] === value).length === 1;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
//#endregion
|
|
13
12
|
export { areValuesUniqueByKey, areValuesUniqueFromStrings, hasExactlyOneByKey };
|
|
13
|
+
|
|
14
14
|
//# sourceMappingURL=array.zod.refinements.mjs.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
//#region ../../src/shared/infrastructure/http/zod/validators/localization/constants/localization.zod.validators.constants.ts
|
|
2
|
-
const LOCALIZED_TEXT_ENTRY_MIN_LENGTH = 1;
|
|
3
|
-
const LOCALIZED_TEXT_ENTRY_MAX_LENGTH = 500;
|
|
4
|
-
const LOCALIZED_TEXTS_MIN_LENGTH = 1;
|
|
5
|
-
const LOCALIZED_TEXTS_MAX_LENGTH = 10;
|
|
6
2
|
const LOCALE_EXAMPLES = {
|
|
7
3
|
en: "Example text in English.",
|
|
8
4
|
fr: "Exemple de texte en français.",
|
|
@@ -11,7 +7,7 @@ const LOCALE_EXAMPLES = {
|
|
|
11
7
|
it: "Testo di esempio in italiano.",
|
|
12
8
|
pt: "Texto de exemplo em português."
|
|
13
9
|
};
|
|
14
|
-
|
|
15
10
|
//#endregion
|
|
16
|
-
export { LOCALE_EXAMPLES
|
|
11
|
+
export { LOCALE_EXAMPLES };
|
|
12
|
+
|
|
17
13
|
//# sourceMappingURL=localization.zod.validators.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.zod.validators.constants.mjs","names":[],"sources":["../../../../../../../../../../../src/shared/infrastructure/http/zod/validators/localization/constants/localization.zod.validators.constants.ts"],"sourcesContent":["import type { Locale } from \"@shared/domain/value-objects/locale/locale.types\";\n\nconst LOCALIZED_TEXT_ENTRY_MIN_LENGTH = 1;\n\nconst LOCALIZED_TEXT_ENTRY_MAX_LENGTH = 500;\n\nconst LOCALIZED_TEXTS_MIN_LENGTH = 1;\n\nconst LOCALIZED_TEXTS_MAX_LENGTH = 10;\n\nconst LOCALE_EXAMPLES: Record<Locale, string> = {\n en: \"Example text in English.\",\n fr: \"Exemple de texte en français.\",\n es: \"Texto de ejemplo en español.\",\n de: \"Beispieltext auf Deutsch.\",\n it: \"Testo di esempio in italiano.\",\n pt: \"Texto de exemplo em português.\",\n} as const;\n\nexport {\n LOCALIZED_TEXT_ENTRY_MIN_LENGTH,\n LOCALIZED_TEXT_ENTRY_MAX_LENGTH,\n LOCALIZED_TEXTS_MIN_LENGTH,\n LOCALIZED_TEXTS_MAX_LENGTH,\n LOCALE_EXAMPLES,\n};"],"mappings":";
|
|
1
|
+
{"version":3,"file":"localization.zod.validators.constants.mjs","names":[],"sources":["../../../../../../../../../../../src/shared/infrastructure/http/zod/validators/localization/constants/localization.zod.validators.constants.ts"],"sourcesContent":["import type { Locale } from \"@shared/domain/value-objects/locale/locale.types\";\n\nconst LOCALIZED_TEXT_ENTRY_MIN_LENGTH = 1;\n\nconst LOCALIZED_TEXT_ENTRY_MAX_LENGTH = 500;\n\nconst LOCALIZED_TEXTS_MIN_LENGTH = 1;\n\nconst LOCALIZED_TEXTS_MAX_LENGTH = 10;\n\nconst LOCALE_EXAMPLES: Record<Locale, string> = {\n en: \"Example text in English.\",\n fr: \"Exemple de texte en français.\",\n es: \"Texto de ejemplo en español.\",\n de: \"Beispieltext auf Deutsch.\",\n it: \"Testo di esempio in italiano.\",\n pt: \"Texto de exemplo em português.\",\n} as const;\n\nexport {\n LOCALIZED_TEXT_ENTRY_MIN_LENGTH,\n LOCALIZED_TEXT_ENTRY_MAX_LENGTH,\n LOCALIZED_TEXTS_MIN_LENGTH,\n LOCALIZED_TEXTS_MAX_LENGTH,\n LOCALE_EXAMPLES,\n};"],"mappings":";AAUA,MAAM,kBAA0C;CAC9C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LOCALE_LABELS } from "../../../../../domain/value-objects/locale/locale.constants.mjs";
|
|
2
|
-
import { LOCALE_EXAMPLES
|
|
2
|
+
import { LOCALE_EXAMPLES } from "./constants/localization.zod.validators.constants.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
5
4
|
//#region ../../src/shared/infrastructure/http/zod/validators/localization/localization.zod.validators.ts
|
|
6
5
|
function createZLocaleEntries(entryFactory) {
|
|
7
6
|
return {
|
|
@@ -16,13 +15,13 @@ function createZLocaleEntries(entryFactory) {
|
|
|
16
15
|
function zLocalizedTextEntry(locale) {
|
|
17
16
|
const localeLabel = LOCALE_LABELS[locale];
|
|
18
17
|
const localeExample = LOCALE_EXAMPLES[locale];
|
|
19
|
-
return z.string().trim().min(
|
|
18
|
+
return z.string().trim().min(1).max(500).optional().describe(`Text in ${localeLabel}`).meta({ example: localeExample });
|
|
20
19
|
}
|
|
21
20
|
function zLocalizedTextsEntry(locale) {
|
|
22
21
|
const localeLabel = LOCALE_LABELS[locale];
|
|
23
22
|
const localeExample = LOCALE_EXAMPLES[locale];
|
|
24
|
-
const zLocalizedTextsValue = z.string().trim().min(
|
|
25
|
-
return z.array(zLocalizedTextsValue).min(
|
|
23
|
+
const zLocalizedTextsValue = z.string().trim().min(1).max(500);
|
|
24
|
+
return z.array(zLocalizedTextsValue).min(1).max(10).optional().describe(`Texts in ${localeLabel}`).meta({ example: [localeExample] });
|
|
26
25
|
}
|
|
27
26
|
function zLocalizedText() {
|
|
28
27
|
const localeEntries = createZLocaleEntries(zLocalizedTextEntry);
|
|
@@ -32,7 +31,7 @@ function zLocalizedTexts() {
|
|
|
32
31
|
const localeEntries = createZLocaleEntries(zLocalizedTextsEntry);
|
|
33
32
|
return z.strictObject(localeEntries).describe("Localized texts object with translations for multiple languages");
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
//#endregion
|
|
37
35
|
export { zLocalizedText, zLocalizedTexts };
|
|
36
|
+
|
|
38
37
|
//# sourceMappingURL=localization.zod.validators.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../src/shared/infrastructure/http/zod/validators/localization/localization.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { LOCALE_LABELS } from \"@shared/domain/value-objects/locale/locale.constants\";\nimport { LOCALE_EXAMPLES, LOCALIZED_TEXT_ENTRY_MAX_LENGTH, LOCALIZED_TEXT_ENTRY_MIN_LENGTH, LOCALIZED_TEXTS_MAX_LENGTH, LOCALIZED_TEXTS_MIN_LENGTH } from \"@shared/infrastructure/http/zod/validators/localization/constants/localization.zod.validators.constants\";\n\nimport type { ZodObject, ZodString, ZodOptional, ZodArray } from \"zod\";\n\nimport type { Locale } from \"@shared/domain/value-objects/locale/locale.types\";\n\nfunction createZLocaleEntries<T>(entryFactory: (locale: Locale) => T): Record<Locale, T> {\n return {\n en: entryFactory(\"en\"),\n fr: entryFactory(\"fr\"),\n es: entryFactory(\"es\"),\n de: entryFactory(\"de\"),\n it: entryFactory(\"it\"),\n pt: entryFactory(\"pt\"),\n };\n}\n\nfunction zLocalizedTextEntry(locale: Locale): ZodOptional<ZodString> {\n const localeLabel = LOCALE_LABELS[locale];\n const localeExample = LOCALE_EXAMPLES[locale];\n\n return z.string()\n .trim()\n .min(LOCALIZED_TEXT_ENTRY_MIN_LENGTH)\n .max(LOCALIZED_TEXT_ENTRY_MAX_LENGTH)\n .optional()\n .describe(`Text in ${localeLabel}`)\n .meta({ example: localeExample });\n}\n\nfunction zLocalizedTextsEntry(locale: Locale): ZodOptional<ZodArray<ZodString>> {\n const localeLabel = LOCALE_LABELS[locale];\n const localeExample = LOCALE_EXAMPLES[locale];\n\n const zLocalizedTextsValue = z.string()\n .trim()\n .min(LOCALIZED_TEXT_ENTRY_MIN_LENGTH)\n .max(LOCALIZED_TEXT_ENTRY_MAX_LENGTH);\n\n return z.array(zLocalizedTextsValue)\n .min(LOCALIZED_TEXTS_MIN_LENGTH)\n .max(LOCALIZED_TEXTS_MAX_LENGTH)\n .optional()\n .describe(`Texts in ${localeLabel}`)\n .meta({ example: [localeExample] });\n}\n\nfunction zLocalizedText(): ZodObject<Record<Locale, ZodOptional<ZodString>>> {\n const localeEntries: Record<Locale, ZodOptional<ZodString>> = createZLocaleEntries(zLocalizedTextEntry);\n\n return z.strictObject(localeEntries)\n .describe(\"Localized text object with translations for multiple languages\");\n}\n\nfunction zLocalizedTexts(): ZodObject<Record<Locale, ZodOptional<ZodArray<ZodString>>>> {\n const localeEntries: Record<Locale, ZodOptional<ZodArray<ZodString>>> = createZLocaleEntries(zLocalizedTextsEntry);\n\n return z.strictObject(localeEntries)\n .describe(\"Localized texts object with translations for multiple languages\");\n}\n\nexport {\n createZLocaleEntries,\n zLocalizedTextEntry,\n zLocalizedTextsEntry,\n zLocalizedText,\n zLocalizedTexts,\n};"],"mappings":"
|
|
1
|
+
{"version":3,"file":"localization.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../src/shared/infrastructure/http/zod/validators/localization/localization.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { LOCALE_LABELS } from \"@shared/domain/value-objects/locale/locale.constants\";\nimport { LOCALE_EXAMPLES, LOCALIZED_TEXT_ENTRY_MAX_LENGTH, LOCALIZED_TEXT_ENTRY_MIN_LENGTH, LOCALIZED_TEXTS_MAX_LENGTH, LOCALIZED_TEXTS_MIN_LENGTH } from \"@shared/infrastructure/http/zod/validators/localization/constants/localization.zod.validators.constants\";\n\nimport type { ZodObject, ZodString, ZodOptional, ZodArray } from \"zod\";\n\nimport type { Locale } from \"@shared/domain/value-objects/locale/locale.types\";\n\nfunction createZLocaleEntries<T>(entryFactory: (locale: Locale) => T): Record<Locale, T> {\n return {\n en: entryFactory(\"en\"),\n fr: entryFactory(\"fr\"),\n es: entryFactory(\"es\"),\n de: entryFactory(\"de\"),\n it: entryFactory(\"it\"),\n pt: entryFactory(\"pt\"),\n };\n}\n\nfunction zLocalizedTextEntry(locale: Locale): ZodOptional<ZodString> {\n const localeLabel = LOCALE_LABELS[locale];\n const localeExample = LOCALE_EXAMPLES[locale];\n\n return z.string()\n .trim()\n .min(LOCALIZED_TEXT_ENTRY_MIN_LENGTH)\n .max(LOCALIZED_TEXT_ENTRY_MAX_LENGTH)\n .optional()\n .describe(`Text in ${localeLabel}`)\n .meta({ example: localeExample });\n}\n\nfunction zLocalizedTextsEntry(locale: Locale): ZodOptional<ZodArray<ZodString>> {\n const localeLabel = LOCALE_LABELS[locale];\n const localeExample = LOCALE_EXAMPLES[locale];\n\n const zLocalizedTextsValue = z.string()\n .trim()\n .min(LOCALIZED_TEXT_ENTRY_MIN_LENGTH)\n .max(LOCALIZED_TEXT_ENTRY_MAX_LENGTH);\n\n return z.array(zLocalizedTextsValue)\n .min(LOCALIZED_TEXTS_MIN_LENGTH)\n .max(LOCALIZED_TEXTS_MAX_LENGTH)\n .optional()\n .describe(`Texts in ${localeLabel}`)\n .meta({ example: [localeExample] });\n}\n\nfunction zLocalizedText(): ZodObject<Record<Locale, ZodOptional<ZodString>>> {\n const localeEntries: Record<Locale, ZodOptional<ZodString>> = createZLocaleEntries(zLocalizedTextEntry);\n\n return z.strictObject(localeEntries)\n .describe(\"Localized text object with translations for multiple languages\");\n}\n\nfunction zLocalizedTexts(): ZodObject<Record<Locale, ZodOptional<ZodArray<ZodString>>>> {\n const localeEntries: Record<Locale, ZodOptional<ZodArray<ZodString>>> = createZLocaleEntries(zLocalizedTextsEntry);\n\n return z.strictObject(localeEntries)\n .describe(\"Localized texts object with translations for multiple languages\");\n}\n\nexport {\n createZLocaleEntries,\n zLocalizedTextEntry,\n zLocalizedTextsEntry,\n zLocalizedText,\n zLocalizedTexts,\n};"],"mappings":";;;;AASA,SAAS,qBAAwB,cAAwD;AACvF,QAAO;EACL,IAAI,aAAa,KAAK;EACtB,IAAI,aAAa,KAAK;EACtB,IAAI,aAAa,KAAK;EACtB,IAAI,aAAa,KAAK;EACtB,IAAI,aAAa,KAAK;EACtB,IAAI,aAAa,KAAK;EACvB;;AAGH,SAAS,oBAAoB,QAAwC;CACnE,MAAM,cAAc,cAAc;CAClC,MAAM,gBAAgB,gBAAgB;AAEtC,QAAO,EAAE,QAAQ,CACd,MAAM,CACN,IAAA,EAAoC,CACpC,IAAA,IAAoC,CACpC,UAAU,CACV,SAAS,WAAW,cAAc,CAClC,KAAK,EAAE,SAAS,eAAe,CAAC;;AAGrC,SAAS,qBAAqB,QAAkD;CAC9E,MAAM,cAAc,cAAc;CAClC,MAAM,gBAAgB,gBAAgB;CAEtC,MAAM,uBAAuB,EAAE,QAAQ,CACpC,MAAM,CACN,IAAA,EAAoC,CACpC,IAAA,IAAoC;AAEvC,QAAO,EAAE,MAAM,qBAAqB,CACjC,IAAA,EAA+B,CAC/B,IAAA,GAA+B,CAC/B,UAAU,CACV,SAAS,YAAY,cAAc,CACnC,KAAK,EAAE,SAAS,CAAC,cAAc,EAAE,CAAC;;AAGvC,SAAS,iBAAoE;CAC3E,MAAM,gBAAwD,qBAAqB,oBAAoB;AAEvG,QAAO,EAAE,aAAa,cAAc,CACjC,SAAS,iEAAiE;;AAG/E,SAAS,kBAA+E;CACtF,MAAM,gBAAkE,qBAAqB,qBAAqB;AAElH,QAAO,EAAE,aAAa,cAAc,CACjC,SAAS,kEAAkE"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
//#region ../../src/shared/infrastructure/http/zod/validators/string/constants/string.zod.validators.constants.ts
|
|
2
2
|
const SLUG_REGEX = /^[\da-z]+(?:-[\da-z]+)*$/u;
|
|
3
|
-
const
|
|
4
|
-
const SLUG_MAX_LENGTH = 50;
|
|
3
|
+
const MONGO_ID_REGEX = /^[\da-f]{24}$/iu;
|
|
5
4
|
const ISO_DATE_TIME_EXAMPLE = "2026-04-14T00:00:00.000Z";
|
|
6
|
-
|
|
7
5
|
//#endregion
|
|
8
|
-
export { ISO_DATE_TIME_EXAMPLE,
|
|
6
|
+
export { ISO_DATE_TIME_EXAMPLE, MONGO_ID_REGEX, SLUG_REGEX };
|
|
7
|
+
|
|
9
8
|
//# sourceMappingURL=string.zod.validators.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.zod.validators.constants.mjs","names":[],"sources":["../../../../../../../../../../../src/shared/infrastructure/http/zod/validators/string/constants/string.zod.validators.constants.ts"],"sourcesContent":["const SLUG_REGEX = /^[\\da-z]+(?:-[\\da-z]+)*$/u;\n\nconst SLUG_MIN_LENGTH = 3;\n\nconst SLUG_MAX_LENGTH = 50;\n\nconst ISO_DATE_TIME_EXAMPLE = \"2026-04-14T00:00:00.000Z\";\n\nexport {\n SLUG_REGEX,\n SLUG_MIN_LENGTH,\n SLUG_MAX_LENGTH,\n ISO_DATE_TIME_EXAMPLE,\n};"],"mappings":";AAAA,MAAM,aAAa;AAEnB,MAAM,
|
|
1
|
+
{"version":3,"file":"string.zod.validators.constants.mjs","names":[],"sources":["../../../../../../../../../../../src/shared/infrastructure/http/zod/validators/string/constants/string.zod.validators.constants.ts"],"sourcesContent":["const SLUG_REGEX = /^[\\da-z]+(?:-[\\da-z]+)*$/u;\n\nconst MONGO_ID_REGEX = /^[\\da-f]{24}$/iu;\n\nconst SLUG_MIN_LENGTH = 3;\n\nconst SLUG_MAX_LENGTH = 50;\n\nconst ISO_DATE_TIME_EXAMPLE = \"2026-04-14T00:00:00.000Z\";\n\nexport {\n SLUG_REGEX,\n MONGO_ID_REGEX,\n SLUG_MIN_LENGTH,\n SLUG_MAX_LENGTH,\n ISO_DATE_TIME_EXAMPLE,\n};"],"mappings":";AAAA,MAAM,aAAa;AAEnB,MAAM,iBAAiB;AAMvB,MAAM,wBAAwB"}
|