@cravery/core 0.0.18 → 0.0.19
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/lib/ai/flow.d.ts +1 -1
- package/dist/lib/ai/flow.d.ts.map +1 -1
- package/dist/lib/ai/flow.js +11 -11
- package/dist/lib/ai/flow.js.map +1 -1
- package/dist/lib/api.d.ts +1 -1
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +2 -2
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/utils/sanitize.d.ts +1 -1
- package/dist/lib/utils/sanitize.d.ts.map +1 -1
- package/dist/types/ai/recipe.d.ts +2 -3
- package/dist/types/ai/recipe.d.ts.map +1 -1
- package/dist/types/ai/recipe.js +14 -14
- package/dist/types/ai/recipe.js.map +1 -1
- package/dist/types/ai/translation.d.ts +2 -3
- package/dist/types/ai/translation.d.ts.map +1 -1
- package/dist/types/ai/translation.js +8 -8
- package/dist/types/ai/translation.js.map +1 -1
- package/dist/types/core/asset.d.ts +2 -3
- package/dist/types/core/asset.d.ts.map +1 -1
- package/dist/types/core/asset.js +6 -6
- package/dist/types/core/asset.js.map +1 -1
- package/dist/types/core/enums/image_type.d.ts +1 -1
- package/dist/types/core/enums/image_type.d.ts.map +1 -1
- package/dist/types/core/enums/image_type.js +2 -2
- package/dist/types/core/enums/image_type.js.map +1 -1
- package/dist/types/core/enums/locale.d.ts +1 -1
- package/dist/types/core/enums/locale.d.ts.map +1 -1
- package/dist/types/core/enums/locale.js +2 -2
- package/dist/types/core/enums/locale.js.map +1 -1
- package/dist/types/core/enums/measurement_system.d.ts +1 -1
- package/dist/types/core/enums/measurement_system.d.ts.map +1 -1
- package/dist/types/core/enums/measurement_system.js +2 -2
- package/dist/types/core/enums/measurement_system.js.map +1 -1
- package/dist/types/core/enums/theme.d.ts +1 -1
- package/dist/types/core/enums/theme.d.ts.map +1 -1
- package/dist/types/core/enums/theme.js +2 -2
- package/dist/types/core/enums/theme.js.map +1 -1
- package/dist/types/core/enums/url_type.d.ts +1 -1
- package/dist/types/core/enums/url_type.d.ts.map +1 -1
- package/dist/types/core/enums/url_type.js +2 -2
- package/dist/types/core/enums/url_type.js.map +1 -1
- package/dist/types/core/settings.d.ts +3 -5
- package/dist/types/core/settings.d.ts.map +1 -1
- package/dist/types/core/settings.js +14 -14
- package/dist/types/core/settings.js.map +1 -1
- package/dist/types/iam/enums/profile_status.d.ts +1 -1
- package/dist/types/iam/enums/profile_status.d.ts.map +1 -1
- package/dist/types/iam/enums/profile_status.js +2 -2
- package/dist/types/iam/enums/profile_status.js.map +1 -1
- package/dist/types/iam/enums/subscription_role.d.ts +1 -1
- package/dist/types/iam/enums/subscription_role.d.ts.map +1 -1
- package/dist/types/iam/enums/subscription_role.js +2 -2
- package/dist/types/iam/enums/subscription_role.js.map +1 -1
- package/dist/types/iam/enums/subscription_status.d.ts +1 -1
- package/dist/types/iam/enums/subscription_status.d.ts.map +1 -1
- package/dist/types/iam/enums/subscription_status.js +2 -2
- package/dist/types/iam/enums/subscription_status.js.map +1 -1
- package/dist/types/iam/enums/subscription_tier.d.ts +1 -1
- package/dist/types/iam/enums/subscription_tier.d.ts.map +1 -1
- package/dist/types/iam/enums/subscription_tier.js +2 -2
- package/dist/types/iam/enums/subscription_tier.js.map +1 -1
- package/dist/types/iam/enums/user_role.d.ts +1 -1
- package/dist/types/iam/enums/user_role.d.ts.map +1 -1
- package/dist/types/iam/enums/user_role.js +2 -2
- package/dist/types/iam/enums/user_role.js.map +1 -1
- package/dist/types/iam/enums/user_status.d.ts +1 -1
- package/dist/types/iam/enums/user_status.d.ts.map +1 -1
- package/dist/types/iam/enums/user_status.js +2 -2
- package/dist/types/iam/enums/user_status.js.map +1 -1
- package/dist/types/iam/profile.d.ts +3 -5
- package/dist/types/iam/profile.d.ts.map +1 -1
- package/dist/types/iam/profile.js +17 -17
- package/dist/types/iam/profile.js.map +1 -1
- package/dist/types/iam/subscription.d.ts +3 -5
- package/dist/types/iam/subscription.d.ts.map +1 -1
- package/dist/types/iam/subscription.js +11 -11
- package/dist/types/iam/subscription.js.map +1 -1
- package/dist/types/iam/user.d.ts +2 -3
- package/dist/types/iam/user.d.ts.map +1 -1
- package/dist/types/iam/user.js +10 -10
- package/dist/types/iam/user.js.map +1 -1
- package/dist/types/moderation/enums/moderation_status.d.ts +1 -1
- package/dist/types/moderation/enums/moderation_status.d.ts.map +1 -1
- package/dist/types/moderation/enums/moderation_status.js +2 -2
- package/dist/types/moderation/enums/moderation_status.js.map +1 -1
- package/dist/types/moderation/enums/priority.d.ts +1 -1
- package/dist/types/moderation/enums/priority.d.ts.map +1 -1
- package/dist/types/moderation/enums/priority.js +2 -2
- package/dist/types/moderation/enums/priority.js.map +1 -1
- package/dist/types/moderation/enums/severity.d.ts +1 -1
- package/dist/types/moderation/enums/severity.d.ts.map +1 -1
- package/dist/types/moderation/enums/severity.js +2 -2
- package/dist/types/moderation/enums/severity.js.map +1 -1
- package/dist/types/moderation/enums/suggestion_category.d.ts +1 -1
- package/dist/types/moderation/enums/suggestion_category.d.ts.map +1 -1
- package/dist/types/moderation/enums/suggestion_category.js +2 -2
- package/dist/types/moderation/enums/suggestion_category.js.map +1 -1
- package/dist/types/moderation/moderation.d.ts +5 -9
- package/dist/types/moderation/moderation.d.ts.map +1 -1
- package/dist/types/moderation/moderation.js +25 -25
- package/dist/types/moderation/moderation.js.map +1 -1
- package/dist/types/recipe/enums/allergen.d.ts +1 -1
- package/dist/types/recipe/enums/allergen.d.ts.map +1 -1
- package/dist/types/recipe/enums/allergen.js +2 -2
- package/dist/types/recipe/enums/allergen.js.map +1 -1
- package/dist/types/recipe/enums/cuisine.d.ts +1 -1
- package/dist/types/recipe/enums/cuisine.d.ts.map +1 -1
- package/dist/types/recipe/enums/cuisine.js +2 -2
- package/dist/types/recipe/enums/cuisine.js.map +1 -1
- package/dist/types/recipe/enums/dietary_tag.d.ts +1 -1
- package/dist/types/recipe/enums/dietary_tag.d.ts.map +1 -1
- package/dist/types/recipe/enums/dietary_tag.js +2 -2
- package/dist/types/recipe/enums/dietary_tag.js.map +1 -1
- package/dist/types/recipe/enums/difficulty.d.ts +1 -1
- package/dist/types/recipe/enums/difficulty.d.ts.map +1 -1
- package/dist/types/recipe/enums/difficulty.js +2 -2
- package/dist/types/recipe/enums/difficulty.js.map +1 -1
- package/dist/types/recipe/enums/meal_type.d.ts +1 -1
- package/dist/types/recipe/enums/meal_type.d.ts.map +1 -1
- package/dist/types/recipe/enums/meal_type.js +2 -2
- package/dist/types/recipe/enums/meal_type.js.map +1 -1
- package/dist/types/recipe/enums/recipe_source.d.ts +1 -1
- package/dist/types/recipe/enums/recipe_source.d.ts.map +1 -1
- package/dist/types/recipe/enums/recipe_source.js +2 -2
- package/dist/types/recipe/enums/recipe_source.js.map +1 -1
- package/dist/types/recipe/enums/recipe_status.d.ts +1 -1
- package/dist/types/recipe/enums/recipe_status.d.ts.map +1 -1
- package/dist/types/recipe/enums/recipe_status.js +2 -2
- package/dist/types/recipe/enums/recipe_status.js.map +1 -1
- package/dist/types/recipe/enums/spiciness.d.ts +1 -1
- package/dist/types/recipe/enums/spiciness.d.ts.map +1 -1
- package/dist/types/recipe/enums/spiciness.js +2 -2
- package/dist/types/recipe/enums/spiciness.js.map +1 -1
- package/dist/types/recipe/enums/temperature_unit.d.ts +1 -1
- package/dist/types/recipe/enums/temperature_unit.d.ts.map +1 -1
- package/dist/types/recipe/enums/temperature_unit.js +2 -2
- package/dist/types/recipe/enums/temperature_unit.js.map +1 -1
- package/dist/types/recipe/enums/unit.d.ts +1 -1
- package/dist/types/recipe/enums/unit.d.ts.map +1 -1
- package/dist/types/recipe/enums/unit.js +2 -2
- package/dist/types/recipe/enums/unit.js.map +1 -1
- package/dist/types/recipe/equipment.d.ts +4 -7
- package/dist/types/recipe/equipment.d.ts.map +1 -1
- package/dist/types/recipe/equipment.js +9 -9
- package/dist/types/recipe/equipment.js.map +1 -1
- package/dist/types/recipe/filters.d.ts +2 -3
- package/dist/types/recipe/filters.d.ts.map +1 -1
- package/dist/types/recipe/filters.js +8 -8
- package/dist/types/recipe/filters.js.map +1 -1
- package/dist/types/recipe/ingredient.d.ts +6 -11
- package/dist/types/recipe/ingredient.d.ts.map +1 -1
- package/dist/types/recipe/ingredient.js +21 -21
- package/dist/types/recipe/ingredient.js.map +1 -1
- package/dist/types/recipe/instruction.d.ts +4 -7
- package/dist/types/recipe/instruction.d.ts.map +1 -1
- package/dist/types/recipe/instruction.js +8 -8
- package/dist/types/recipe/instruction.js.map +1 -1
- package/dist/types/recipe/nutrition.d.ts +2 -3
- package/dist/types/recipe/nutrition.d.ts.map +1 -1
- package/dist/types/recipe/nutrition.js +11 -11
- package/dist/types/recipe/nutrition.js.map +1 -1
- package/dist/types/recipe/recipe.d.ts +5 -9
- package/dist/types/recipe/recipe.d.ts.map +1 -1
- package/dist/types/recipe/recipe.js +53 -53
- package/dist/types/recipe/recipe.js.map +1 -1
- package/dist/types/recipe/temperature.d.ts +2 -3
- package/dist/types/recipe/temperature.d.ts.map +1 -1
- package/dist/types/recipe/temperature.js +3 -3
- package/dist/types/recipe/temperature.js.map +1 -1
- package/dist/types/report/enums/report_priority.d.ts +1 -1
- package/dist/types/report/enums/report_priority.d.ts.map +1 -1
- package/dist/types/report/enums/report_priority.js +2 -2
- package/dist/types/report/enums/report_priority.js.map +1 -1
- package/dist/types/report/enums/report_status.d.ts +1 -1
- package/dist/types/report/enums/report_status.d.ts.map +1 -1
- package/dist/types/report/enums/report_status.js +2 -2
- package/dist/types/report/enums/report_status.js.map +1 -1
- package/dist/types/report/enums/report_target_type.d.ts +1 -1
- package/dist/types/report/enums/report_target_type.d.ts.map +1 -1
- package/dist/types/report/enums/report_target_type.js +2 -2
- package/dist/types/report/enums/report_target_type.js.map +1 -1
- package/dist/types/report/enums/report_type.d.ts +1 -1
- package/dist/types/report/enums/report_type.d.ts.map +1 -1
- package/dist/types/report/enums/report_type.js +2 -2
- package/dist/types/report/enums/report_type.js.map +1 -1
- package/dist/types/report/report.d.ts +3 -5
- package/dist/types/report/report.d.ts.map +1 -1
- package/dist/types/report/report.js +20 -20
- package/dist/types/report/report.js.map +1 -1
- package/package.json +56 -57
- package/src/lib/ai/flow.ts +89 -89
- package/src/lib/api.ts +103 -103
- package/src/lib/utils/sanitize.ts +38 -38
- package/src/types/ai/recipe.ts +34 -34
- package/src/types/ai/translation.ts +16 -16
- package/src/types/core/asset.ts +11 -11
- package/src/types/core/enums/image_type.ts +5 -5
- package/src/types/core/enums/locale.ts +5 -5
- package/src/types/core/enums/measurement_system.ts +5 -5
- package/src/types/core/enums/theme.ts +5 -5
- package/src/types/core/enums/url_type.ts +13 -13
- package/src/types/core/settings.ts +35 -35
- package/src/types/iam/enums/profile_status.ts +10 -10
- package/src/types/iam/enums/subscription_role.ts +5 -5
- package/src/types/iam/enums/subscription_status.ts +10 -10
- package/src/types/iam/enums/subscription_tier.ts +4 -4
- package/src/types/iam/enums/user_role.ts +11 -11
- package/src/types/iam/enums/user_status.ts +10 -10
- package/src/types/iam/profile.ts +26 -26
- package/src/types/iam/subscription.ts +27 -27
- package/src/types/iam/user.ts +17 -17
- package/src/types/moderation/enums/moderation_status.ts +9 -9
- package/src/types/moderation/enums/priority.ts +5 -5
- package/src/types/moderation/enums/severity.ts +5 -5
- package/src/types/moderation/enums/suggestion_category.ts +11 -11
- package/src/types/moderation/moderation.ts +50 -50
- package/src/types/recipe/enums/allergen.ts +19 -19
- package/src/types/recipe/enums/cuisine.ts +39 -39
- package/src/types/recipe/enums/dietary_tag.ts +21 -21
- package/src/types/recipe/enums/difficulty.ts +10 -10
- package/src/types/recipe/enums/meal_type.ts +14 -14
- package/src/types/recipe/enums/recipe_source.ts +5 -5
- package/src/types/recipe/enums/recipe_status.ts +12 -12
- package/src/types/recipe/enums/spiciness.ts +5 -5
- package/src/types/recipe/enums/temperature_unit.ts +5 -5
- package/src/types/recipe/enums/unit.ts +51 -51
- package/src/types/recipe/equipment.ts +21 -21
- package/src/types/recipe/filters.ts +20 -20
- package/src/types/recipe/ingredient.ts +46 -46
- package/src/types/recipe/instruction.ts +21 -21
- package/src/types/recipe/nutrition.ts +18 -18
- package/src/types/recipe/recipe.ts +109 -109
- package/src/types/recipe/temperature.ts +8 -8
- package/src/types/report/enums/report_priority.ts +10 -10
- package/src/types/report/enums/report_status.ts +10 -10
- package/src/types/report/enums/report_target_type.ts +10 -10
- package/src/types/report/enums/report_type.ts +12 -12
- package/src/types/report/report.ts +38 -38
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
import { SLUG_REGEX } from "../../config";
|
|
3
|
-
import { UnitSchema } from "./enums";
|
|
4
|
-
|
|
5
|
-
export const IngredientMetaSchema = z.object({
|
|
6
|
-
quantity: z.number().positive().optional(),
|
|
7
|
-
required: z.boolean().optional(),
|
|
8
|
-
slug: z.string().regex(SLUG_REGEX),
|
|
9
|
-
unit: UnitSchema.optional(),
|
|
10
|
-
});
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export const IngredientContentSchema = z.object({
|
|
14
|
-
name: z.string().min(1).max(100),
|
|
15
|
-
notes: z.string().max(200).optional(),
|
|
16
|
-
slug: z.string().regex(SLUG_REGEX),
|
|
17
|
-
});
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
export const IngredientSchema = z.object({
|
|
21
|
-
...IngredientMetaSchema.shape,
|
|
22
|
-
...IngredientContentSchema.shape,
|
|
23
|
-
});
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
export const IngredientSectionMetaSchema = z.object({
|
|
27
|
-
ingredients: z.array(IngredientMetaSchema).min(1),
|
|
28
|
-
slug: z.string().regex(SLUG_REGEX),
|
|
29
|
-
});
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
export const IngredientSectionContentSchema = z.object({
|
|
33
|
-
ingredients: z.array(IngredientContentSchema).min(1),
|
|
34
|
-
slug: z.string().regex(SLUG_REGEX),
|
|
35
|
-
title: z.string().max(100).optional(),
|
|
36
|
-
});
|
|
37
|
-
export type IngredientSectionContent = z.infer<
|
|
38
|
-
typeof IngredientSectionContentSchema
|
|
39
|
-
>;
|
|
40
|
-
|
|
41
|
-
export const IngredientSectionSchema = z.object({
|
|
42
|
-
ingredients: z.array(IngredientSchema).min(1),
|
|
43
|
-
slug: z.string().regex(SLUG_REGEX),
|
|
44
|
-
title: z.string().max(100).optional(),
|
|
45
|
-
});
|
|
46
|
-
export
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import { SLUG_REGEX } from "../../config";
|
|
3
|
+
import { UnitSchema } from "./enums";
|
|
4
|
+
|
|
5
|
+
export const IngredientMetaSchema = z.object({
|
|
6
|
+
quantity: z.number().positive().optional(),
|
|
7
|
+
required: z.boolean().optional(),
|
|
8
|
+
slug: z.string().regex(SLUG_REGEX),
|
|
9
|
+
unit: UnitSchema.optional(),
|
|
10
|
+
});
|
|
11
|
+
export type IngredientMeta = z.infer<typeof IngredientMetaSchema>;
|
|
12
|
+
|
|
13
|
+
export const IngredientContentSchema = z.object({
|
|
14
|
+
name: z.string().min(1).max(100),
|
|
15
|
+
notes: z.string().max(200).optional(),
|
|
16
|
+
slug: z.string().regex(SLUG_REGEX),
|
|
17
|
+
});
|
|
18
|
+
export type IngredientContent = z.infer<typeof IngredientContentSchema>;
|
|
19
|
+
|
|
20
|
+
export const IngredientSchema = z.object({
|
|
21
|
+
...IngredientMetaSchema.shape,
|
|
22
|
+
...IngredientContentSchema.shape,
|
|
23
|
+
});
|
|
24
|
+
export type Ingredient = z.infer<typeof IngredientSchema>;
|
|
25
|
+
|
|
26
|
+
export const IngredientSectionMetaSchema = z.object({
|
|
27
|
+
ingredients: z.array(IngredientMetaSchema).min(1),
|
|
28
|
+
slug: z.string().regex(SLUG_REGEX),
|
|
29
|
+
});
|
|
30
|
+
export type IngredientSectionMeta = z.infer<typeof IngredientSectionMetaSchema>;
|
|
31
|
+
|
|
32
|
+
export const IngredientSectionContentSchema = z.object({
|
|
33
|
+
ingredients: z.array(IngredientContentSchema).min(1),
|
|
34
|
+
slug: z.string().regex(SLUG_REGEX),
|
|
35
|
+
title: z.string().max(100).optional(),
|
|
36
|
+
});
|
|
37
|
+
export type IngredientSectionContent = z.infer<
|
|
38
|
+
typeof IngredientSectionContentSchema
|
|
39
|
+
>;
|
|
40
|
+
|
|
41
|
+
export const IngredientSectionSchema = z.object({
|
|
42
|
+
ingredients: z.array(IngredientSchema).min(1),
|
|
43
|
+
slug: z.string().regex(SLUG_REGEX),
|
|
44
|
+
title: z.string().max(100).optional(),
|
|
45
|
+
});
|
|
46
|
+
export type IngredientSection = z.infer<typeof IngredientSectionSchema>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
import { TemperatureSchema } from "./temperature";
|
|
3
|
-
|
|
4
|
-
export const InstructionMetaSchema = z.object({
|
|
5
|
-
duration: z.number().int().positive().optional(),
|
|
6
|
-
step: z.number().int().positive(),
|
|
7
|
-
temperature: TemperatureSchema.optional(),
|
|
8
|
-
});
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
export const InstructionContentSchema = z.object({
|
|
12
|
-
step: z.number().int().positive(),
|
|
13
|
-
text: z.string().min(1).max(1000),
|
|
14
|
-
});
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
export const InstructionSchema = z.object({
|
|
18
|
-
...InstructionMetaSchema.shape,
|
|
19
|
-
...InstructionContentSchema.shape,
|
|
20
|
-
});
|
|
21
|
-
export
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import { TemperatureSchema } from "./temperature";
|
|
3
|
+
|
|
4
|
+
export const InstructionMetaSchema = z.object({
|
|
5
|
+
duration: z.number().int().positive().optional(),
|
|
6
|
+
step: z.number().int().positive(),
|
|
7
|
+
temperature: TemperatureSchema.optional(),
|
|
8
|
+
});
|
|
9
|
+
export type InstructionMeta = z.infer<typeof InstructionMetaSchema>;
|
|
10
|
+
|
|
11
|
+
export const InstructionContentSchema = z.object({
|
|
12
|
+
step: z.number().int().positive(),
|
|
13
|
+
text: z.string().min(1).max(1000),
|
|
14
|
+
});
|
|
15
|
+
export type InstructionContent = z.infer<typeof InstructionContentSchema>;
|
|
16
|
+
|
|
17
|
+
export const InstructionSchema = z.object({
|
|
18
|
+
...InstructionMetaSchema.shape,
|
|
19
|
+
...InstructionContentSchema.shape,
|
|
20
|
+
});
|
|
21
|
+
export type Instruction = z.infer<typeof InstructionSchema>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Nutrition data per serving.
|
|
5
|
-
* Units: calories (kcal), fat/carbs/protein/fiber/sugar (g), cholesterol/sodium (mg)
|
|
6
|
-
*/
|
|
7
|
-
export const NutritionSchema = z.object({
|
|
8
|
-
calories: z.number().nonnegative(),
|
|
9
|
-
carbs: z.number().nonnegative().optional(),
|
|
10
|
-
cholesterol: z.number().nonnegative().optional(),
|
|
11
|
-
fat: z.number().nonnegative().optional(),
|
|
12
|
-
fiber: z.number().nonnegative().optional(),
|
|
13
|
-
protein: z.number().nonnegative().optional(),
|
|
14
|
-
saturatedFat: z.number().nonnegative().optional(),
|
|
15
|
-
sodium: z.number().nonnegative().optional(),
|
|
16
|
-
sugar: z.number().nonnegative().optional(),
|
|
17
|
-
});
|
|
18
|
-
export
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Nutrition data per serving.
|
|
5
|
+
* Units: calories (kcal), fat/carbs/protein/fiber/sugar (g), cholesterol/sodium (mg)
|
|
6
|
+
*/
|
|
7
|
+
export const NutritionSchema = z.object({
|
|
8
|
+
calories: z.number().nonnegative(),
|
|
9
|
+
carbs: z.number().nonnegative().optional(),
|
|
10
|
+
cholesterol: z.number().nonnegative().optional(),
|
|
11
|
+
fat: z.number().nonnegative().optional(),
|
|
12
|
+
fiber: z.number().nonnegative().optional(),
|
|
13
|
+
protein: z.number().nonnegative().optional(),
|
|
14
|
+
saturatedFat: z.number().nonnegative().optional(),
|
|
15
|
+
sodium: z.number().nonnegative().optional(),
|
|
16
|
+
sugar: z.number().nonnegative().optional(),
|
|
17
|
+
});
|
|
18
|
+
export type Nutrition = z.infer<typeof NutritionSchema>;
|
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
-
import { LocaleSchema } from "../core";
|
|
4
|
-
import {
|
|
5
|
-
AllergenSchema,
|
|
6
|
-
CuisineSchema,
|
|
7
|
-
DietaryTagSchema,
|
|
8
|
-
DifficultySchema,
|
|
9
|
-
MealTypeSchema,
|
|
10
|
-
RecipeSourceSchema,
|
|
11
|
-
RecipeStatusSchema,
|
|
12
|
-
SpicinessSchema,
|
|
13
|
-
} from "./enums";
|
|
14
|
-
import {
|
|
15
|
-
EquipmentContentSchema,
|
|
16
|
-
EquipmentMetaSchema,
|
|
17
|
-
EquipmentSchema,
|
|
18
|
-
} from "./equipment";
|
|
19
|
-
import {
|
|
20
|
-
IngredientSectionContentSchema,
|
|
21
|
-
IngredientSectionMetaSchema,
|
|
22
|
-
IngredientSectionSchema,
|
|
23
|
-
} from "./ingredient";
|
|
24
|
-
import {
|
|
25
|
-
InstructionContentSchema,
|
|
26
|
-
InstructionMetaSchema,
|
|
27
|
-
InstructionSchema,
|
|
28
|
-
} from "./instruction";
|
|
29
|
-
import { NutritionSchema } from "./nutrition";
|
|
30
|
-
|
|
31
|
-
export const RecipeMetaSchema = z.object({
|
|
32
|
-
allergens: z.array(AllergenSchema),
|
|
33
|
-
confidence: z.number().min(0).max(1),
|
|
34
|
-
createdAt: z.custom<Timestamp>(),
|
|
35
|
-
createdBy: z.string(),
|
|
36
|
-
cuisine: CuisineSchema,
|
|
37
|
-
deletedAt: z.custom<Timestamp>().optional(),
|
|
38
|
-
dietaryTags: z.array(DietaryTagSchema),
|
|
39
|
-
difficulty: DifficultySchema,
|
|
40
|
-
equipment: z.array(EquipmentMetaSchema).max(30).optional(),
|
|
41
|
-
id: z.string(),
|
|
42
|
-
imageUrl: z.string().optional(),
|
|
43
|
-
ingredientSections: z.array(IngredientSectionMetaSchema).min(1).max(20),
|
|
44
|
-
instructions: z.array(InstructionMetaSchema).min(1).max(100),
|
|
45
|
-
mealTypes: z.array(MealTypeSchema).min(1),
|
|
46
|
-
nutrition: NutritionSchema.optional(),
|
|
47
|
-
originalLocale: LocaleSchema,
|
|
48
|
-
servings: z.number().int().min(1).max(100),
|
|
49
|
-
source: RecipeSourceSchema,
|
|
50
|
-
sourceUrl: z.string().optional(),
|
|
51
|
-
spiciness: SpicinessSchema,
|
|
52
|
-
status: RecipeStatusSchema,
|
|
53
|
-
time: z.number().int().min(1).max(1440),
|
|
54
|
-
updatedAt: z.custom<Timestamp>(),
|
|
55
|
-
});
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
export const RecipeContentSchema = z.object({
|
|
59
|
-
description: z.string().min(10).max(2000),
|
|
60
|
-
equipment: z.array(EquipmentContentSchema).optional(),
|
|
61
|
-
ingredientSections: z.array(IngredientSectionContentSchema).min(1).max(20),
|
|
62
|
-
instructions: z.array(InstructionContentSchema).min(1).max(100),
|
|
63
|
-
locale: LocaleSchema,
|
|
64
|
-
tips: z.array(z.string().max(500)).max(20).optional(),
|
|
65
|
-
title: z.string().min(3).max(200),
|
|
66
|
-
});
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
export const RecipeSchema = z.object({
|
|
70
|
-
allergens: z.array(AllergenSchema),
|
|
71
|
-
confidence: z.number().min(0).max(1),
|
|
72
|
-
createdAt: z.custom<Timestamp>(),
|
|
73
|
-
createdBy: z.string(),
|
|
74
|
-
cuisine: CuisineSchema,
|
|
75
|
-
deletedAt: z.custom<Timestamp>().optional(),
|
|
76
|
-
description: z.string().min(10).max(2000),
|
|
77
|
-
dietaryTags: z.array(DietaryTagSchema),
|
|
78
|
-
difficulty: DifficultySchema,
|
|
79
|
-
equipment: z.array(EquipmentSchema).optional(),
|
|
80
|
-
id: z.string(),
|
|
81
|
-
imageUrl: z.string().optional(),
|
|
82
|
-
ingredientSections: z.array(IngredientSectionSchema).min(1),
|
|
83
|
-
instructions: z.array(InstructionSchema).min(1),
|
|
84
|
-
locale: LocaleSchema,
|
|
85
|
-
mealTypes: z.array(MealTypeSchema).min(1),
|
|
86
|
-
nutrition: NutritionSchema.optional(),
|
|
87
|
-
originalLocale: LocaleSchema,
|
|
88
|
-
servings: z.number().int().min(1).max(100),
|
|
89
|
-
source: RecipeSourceSchema,
|
|
90
|
-
sourceUrl: z.string().optional(),
|
|
91
|
-
spiciness: SpicinessSchema,
|
|
92
|
-
status: RecipeStatusSchema,
|
|
93
|
-
time: z.number().int().min(1).max(1440),
|
|
94
|
-
tips: z.array(z.string().max(500)).optional(),
|
|
95
|
-
title: z.string().min(3).max(200),
|
|
96
|
-
updatedAt: z.custom<Timestamp>(),
|
|
97
|
-
});
|
|
98
|
-
export
|
|
99
|
-
|
|
100
|
-
export const RecipeStatsSchema = z.object({
|
|
101
|
-
comments: z.number().int().nonnegative(),
|
|
102
|
-
likes: z.number().int().nonnegative(),
|
|
103
|
-
rating: z.number().min(0).max(5),
|
|
104
|
-
ratingCount: z.number().int().nonnegative(),
|
|
105
|
-
saves: z.number().int().nonnegative(),
|
|
106
|
-
updatedAt: z.number().int(),
|
|
107
|
-
views: z.number().int().nonnegative(),
|
|
108
|
-
});
|
|
109
|
-
export
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
+
import { LocaleSchema } from "../core";
|
|
4
|
+
import {
|
|
5
|
+
AllergenSchema,
|
|
6
|
+
CuisineSchema,
|
|
7
|
+
DietaryTagSchema,
|
|
8
|
+
DifficultySchema,
|
|
9
|
+
MealTypeSchema,
|
|
10
|
+
RecipeSourceSchema,
|
|
11
|
+
RecipeStatusSchema,
|
|
12
|
+
SpicinessSchema,
|
|
13
|
+
} from "./enums";
|
|
14
|
+
import {
|
|
15
|
+
EquipmentContentSchema,
|
|
16
|
+
EquipmentMetaSchema,
|
|
17
|
+
EquipmentSchema,
|
|
18
|
+
} from "./equipment";
|
|
19
|
+
import {
|
|
20
|
+
IngredientSectionContentSchema,
|
|
21
|
+
IngredientSectionMetaSchema,
|
|
22
|
+
IngredientSectionSchema,
|
|
23
|
+
} from "./ingredient";
|
|
24
|
+
import {
|
|
25
|
+
InstructionContentSchema,
|
|
26
|
+
InstructionMetaSchema,
|
|
27
|
+
InstructionSchema,
|
|
28
|
+
} from "./instruction";
|
|
29
|
+
import { NutritionSchema } from "./nutrition";
|
|
30
|
+
|
|
31
|
+
export const RecipeMetaSchema = z.object({
|
|
32
|
+
allergens: z.array(AllergenSchema),
|
|
33
|
+
confidence: z.number().min(0).max(1),
|
|
34
|
+
createdAt: z.custom<Timestamp>(),
|
|
35
|
+
createdBy: z.string(),
|
|
36
|
+
cuisine: CuisineSchema,
|
|
37
|
+
deletedAt: z.custom<Timestamp>().optional(),
|
|
38
|
+
dietaryTags: z.array(DietaryTagSchema),
|
|
39
|
+
difficulty: DifficultySchema,
|
|
40
|
+
equipment: z.array(EquipmentMetaSchema).max(30).optional(),
|
|
41
|
+
id: z.string(),
|
|
42
|
+
imageUrl: z.string().optional(),
|
|
43
|
+
ingredientSections: z.array(IngredientSectionMetaSchema).min(1).max(20),
|
|
44
|
+
instructions: z.array(InstructionMetaSchema).min(1).max(100),
|
|
45
|
+
mealTypes: z.array(MealTypeSchema).min(1),
|
|
46
|
+
nutrition: NutritionSchema.optional(),
|
|
47
|
+
originalLocale: LocaleSchema,
|
|
48
|
+
servings: z.number().int().min(1).max(100),
|
|
49
|
+
source: RecipeSourceSchema,
|
|
50
|
+
sourceUrl: z.string().optional(),
|
|
51
|
+
spiciness: SpicinessSchema,
|
|
52
|
+
status: RecipeStatusSchema,
|
|
53
|
+
time: z.number().int().min(1).max(1440),
|
|
54
|
+
updatedAt: z.custom<Timestamp>(),
|
|
55
|
+
});
|
|
56
|
+
export type RecipeMeta = z.infer<typeof RecipeMetaSchema>;
|
|
57
|
+
|
|
58
|
+
export const RecipeContentSchema = z.object({
|
|
59
|
+
description: z.string().min(10).max(2000),
|
|
60
|
+
equipment: z.array(EquipmentContentSchema).optional(),
|
|
61
|
+
ingredientSections: z.array(IngredientSectionContentSchema).min(1).max(20),
|
|
62
|
+
instructions: z.array(InstructionContentSchema).min(1).max(100),
|
|
63
|
+
locale: LocaleSchema,
|
|
64
|
+
tips: z.array(z.string().max(500)).max(20).optional(),
|
|
65
|
+
title: z.string().min(3).max(200),
|
|
66
|
+
});
|
|
67
|
+
export type RecipeContent = z.infer<typeof RecipeContentSchema>;
|
|
68
|
+
|
|
69
|
+
export const RecipeSchema = z.object({
|
|
70
|
+
allergens: z.array(AllergenSchema),
|
|
71
|
+
confidence: z.number().min(0).max(1),
|
|
72
|
+
createdAt: z.custom<Timestamp>(),
|
|
73
|
+
createdBy: z.string(),
|
|
74
|
+
cuisine: CuisineSchema,
|
|
75
|
+
deletedAt: z.custom<Timestamp>().optional(),
|
|
76
|
+
description: z.string().min(10).max(2000),
|
|
77
|
+
dietaryTags: z.array(DietaryTagSchema),
|
|
78
|
+
difficulty: DifficultySchema,
|
|
79
|
+
equipment: z.array(EquipmentSchema).optional(),
|
|
80
|
+
id: z.string(),
|
|
81
|
+
imageUrl: z.string().optional(),
|
|
82
|
+
ingredientSections: z.array(IngredientSectionSchema).min(1),
|
|
83
|
+
instructions: z.array(InstructionSchema).min(1),
|
|
84
|
+
locale: LocaleSchema,
|
|
85
|
+
mealTypes: z.array(MealTypeSchema).min(1),
|
|
86
|
+
nutrition: NutritionSchema.optional(),
|
|
87
|
+
originalLocale: LocaleSchema,
|
|
88
|
+
servings: z.number().int().min(1).max(100),
|
|
89
|
+
source: RecipeSourceSchema,
|
|
90
|
+
sourceUrl: z.string().optional(),
|
|
91
|
+
spiciness: SpicinessSchema,
|
|
92
|
+
status: RecipeStatusSchema,
|
|
93
|
+
time: z.number().int().min(1).max(1440),
|
|
94
|
+
tips: z.array(z.string().max(500)).optional(),
|
|
95
|
+
title: z.string().min(3).max(200),
|
|
96
|
+
updatedAt: z.custom<Timestamp>(),
|
|
97
|
+
});
|
|
98
|
+
export type Recipe = z.infer<typeof RecipeSchema>;
|
|
99
|
+
|
|
100
|
+
export const RecipeStatsSchema = z.object({
|
|
101
|
+
comments: z.number().int().nonnegative(),
|
|
102
|
+
likes: z.number().int().nonnegative(),
|
|
103
|
+
rating: z.number().min(0).max(5),
|
|
104
|
+
ratingCount: z.number().int().nonnegative(),
|
|
105
|
+
saves: z.number().int().nonnegative(),
|
|
106
|
+
updatedAt: z.number().int(),
|
|
107
|
+
views: z.number().int().nonnegative(),
|
|
108
|
+
});
|
|
109
|
+
export type RecipeStats = z.infer<typeof RecipeStatsSchema>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
import { TemperatureUnitSchema } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const TemperatureSchema = z.object({
|
|
5
|
-
unit: TemperatureUnitSchema,
|
|
6
|
-
value: z.number().min(-50).max(1000),
|
|
7
|
-
});
|
|
8
|
-
export
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import { TemperatureUnitSchema } from "./enums";
|
|
3
|
+
|
|
4
|
+
export const TemperatureSchema = z.object({
|
|
5
|
+
unit: TemperatureUnitSchema,
|
|
6
|
+
value: z.number().min(-50).max(1000),
|
|
7
|
+
});
|
|
8
|
+
export type Temperature = z.infer<typeof TemperatureSchema>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
|
|
3
|
-
export const REPORT_PRIORITY_VALUES = [
|
|
4
|
-
"critical",
|
|
5
|
-
"high",
|
|
6
|
-
"low",
|
|
7
|
-
"medium",
|
|
8
|
-
] as const;
|
|
9
|
-
export const ReportPrioritySchema = z.enum(REPORT_PRIORITY_VALUES);
|
|
10
|
-
export type ReportPriority = (typeof REPORT_PRIORITY_VALUES)[number];
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
|
|
3
|
+
export const REPORT_PRIORITY_VALUES = [
|
|
4
|
+
"critical",
|
|
5
|
+
"high",
|
|
6
|
+
"low",
|
|
7
|
+
"medium",
|
|
8
|
+
] as const;
|
|
9
|
+
export const ReportPrioritySchema = z.enum(REPORT_PRIORITY_VALUES);
|
|
10
|
+
export type ReportPriority = (typeof REPORT_PRIORITY_VALUES)[number];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
|
|
3
|
-
export const REPORT_STATUS_VALUES = [
|
|
4
|
-
"escalated",
|
|
5
|
-
"pending",
|
|
6
|
-
"resolved",
|
|
7
|
-
"reviewed",
|
|
8
|
-
] as const;
|
|
9
|
-
export const ReportStatusSchema = z.enum(REPORT_STATUS_VALUES);
|
|
10
|
-
export type ReportStatus = (typeof REPORT_STATUS_VALUES)[number];
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
|
|
3
|
+
export const REPORT_STATUS_VALUES = [
|
|
4
|
+
"escalated",
|
|
5
|
+
"pending",
|
|
6
|
+
"resolved",
|
|
7
|
+
"reviewed",
|
|
8
|
+
] as const;
|
|
9
|
+
export const ReportStatusSchema = z.enum(REPORT_STATUS_VALUES);
|
|
10
|
+
export type ReportStatus = (typeof REPORT_STATUS_VALUES)[number];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
|
|
3
|
-
export const REPORT_TARGET_TYPE_VALUES = [
|
|
4
|
-
"image",
|
|
5
|
-
"profile",
|
|
6
|
-
"recipe",
|
|
7
|
-
"user",
|
|
8
|
-
] as const;
|
|
9
|
-
export const ReportTargetTypeSchema = z.enum(REPORT_TARGET_TYPE_VALUES);
|
|
10
|
-
export type ReportTargetType = (typeof REPORT_TARGET_TYPE_VALUES)[number];
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
|
|
3
|
+
export const REPORT_TARGET_TYPE_VALUES = [
|
|
4
|
+
"image",
|
|
5
|
+
"profile",
|
|
6
|
+
"recipe",
|
|
7
|
+
"user",
|
|
8
|
+
] as const;
|
|
9
|
+
export const ReportTargetTypeSchema = z.enum(REPORT_TARGET_TYPE_VALUES);
|
|
10
|
+
export type ReportTargetType = (typeof REPORT_TARGET_TYPE_VALUES)[number];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
|
|
3
|
-
export const REPORT_TYPE_VALUES = [
|
|
4
|
-
"auto_rejected",
|
|
5
|
-
"manual_rejected",
|
|
6
|
-
"repeated_violations",
|
|
7
|
-
"unsafe_generated",
|
|
8
|
-
"unsafe_upload",
|
|
9
|
-
"user_report",
|
|
10
|
-
] as const;
|
|
11
|
-
export const ReportTypeSchema = z.enum(REPORT_TYPE_VALUES);
|
|
12
|
-
export type ReportType = (typeof REPORT_TYPE_VALUES)[number];
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
|
|
3
|
+
export const REPORT_TYPE_VALUES = [
|
|
4
|
+
"auto_rejected",
|
|
5
|
+
"manual_rejected",
|
|
6
|
+
"repeated_violations",
|
|
7
|
+
"unsafe_generated",
|
|
8
|
+
"unsafe_upload",
|
|
9
|
+
"user_report",
|
|
10
|
+
] as const;
|
|
11
|
+
export const ReportTypeSchema = z.enum(REPORT_TYPE_VALUES);
|
|
12
|
+
export type ReportType = (typeof REPORT_TYPE_VALUES)[number];
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
-
import {
|
|
4
|
-
ReportPrioritySchema,
|
|
5
|
-
ReportStatusSchema,
|
|
6
|
-
ReportTargetTypeSchema,
|
|
7
|
-
ReportTypeSchema,
|
|
8
|
-
} from "./enums";
|
|
9
|
-
|
|
10
|
-
export const ReportEvidenceSchema = z.object({
|
|
11
|
-
aiScore: z.number().min(0).max(1).optional(),
|
|
12
|
-
aiSuggestions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
13
|
-
contentSnapshot: z.string().optional(),
|
|
14
|
-
imageHashes: z.array(z.string()).optional(),
|
|
15
|
-
});
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
export const ReportSchema = z.object({
|
|
19
|
-
categories: z.array(z.string()),
|
|
20
|
-
createdAt: z.custom<Timestamp>(),
|
|
21
|
-
description: z.string(),
|
|
22
|
-
evidence: ReportEvidenceSchema.optional(),
|
|
23
|
-
id: z.string(),
|
|
24
|
-
notes: z.string().optional(),
|
|
25
|
-
priority: ReportPrioritySchema,
|
|
26
|
-
reason: z.string(),
|
|
27
|
-
reportedBy: z.string().optional(),
|
|
28
|
-
resolution: z.string().optional(),
|
|
29
|
-
reviewedAt: z.custom<Timestamp>().optional(),
|
|
30
|
-
reviewedBy: z.string().optional(),
|
|
31
|
-
status: ReportStatusSchema,
|
|
32
|
-
targetId: z.string(),
|
|
33
|
-
targetType: ReportTargetTypeSchema,
|
|
34
|
-
type: ReportTypeSchema,
|
|
35
|
-
updatedAt: z.custom<Timestamp>(),
|
|
36
|
-
userId: z.string(),
|
|
37
|
-
});
|
|
38
|
-
export
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
+
import {
|
|
4
|
+
ReportPrioritySchema,
|
|
5
|
+
ReportStatusSchema,
|
|
6
|
+
ReportTargetTypeSchema,
|
|
7
|
+
ReportTypeSchema,
|
|
8
|
+
} from "./enums";
|
|
9
|
+
|
|
10
|
+
export const ReportEvidenceSchema = z.object({
|
|
11
|
+
aiScore: z.number().min(0).max(1).optional(),
|
|
12
|
+
aiSuggestions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
13
|
+
contentSnapshot: z.string().optional(),
|
|
14
|
+
imageHashes: z.array(z.string()).optional(),
|
|
15
|
+
});
|
|
16
|
+
export type ReportEvidence = z.infer<typeof ReportEvidenceSchema>;
|
|
17
|
+
|
|
18
|
+
export const ReportSchema = z.object({
|
|
19
|
+
categories: z.array(z.string()),
|
|
20
|
+
createdAt: z.custom<Timestamp>(),
|
|
21
|
+
description: z.string(),
|
|
22
|
+
evidence: ReportEvidenceSchema.optional(),
|
|
23
|
+
id: z.string(),
|
|
24
|
+
notes: z.string().optional(),
|
|
25
|
+
priority: ReportPrioritySchema,
|
|
26
|
+
reason: z.string(),
|
|
27
|
+
reportedBy: z.string().optional(),
|
|
28
|
+
resolution: z.string().optional(),
|
|
29
|
+
reviewedAt: z.custom<Timestamp>().optional(),
|
|
30
|
+
reviewedBy: z.string().optional(),
|
|
31
|
+
status: ReportStatusSchema,
|
|
32
|
+
targetId: z.string(),
|
|
33
|
+
targetType: ReportTargetTypeSchema,
|
|
34
|
+
type: ReportTypeSchema,
|
|
35
|
+
updatedAt: z.custom<Timestamp>(),
|
|
36
|
+
userId: z.string(),
|
|
37
|
+
});
|
|
38
|
+
export type Report = z.infer<typeof ReportSchema>;
|