@cravery/core 0.0.21 → 0.0.23
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/embedding.d.ts +1 -1
- package/dist/lib/ai/embedding.d.ts.map +1 -1
- package/dist/lib/ai/embedding.js +12 -9
- package/dist/lib/ai/embedding.js.map +1 -1
- package/dist/lib/ai/genkit.d.ts +3 -3
- package/dist/lib/ai/genkit.d.ts.map +1 -1
- package/dist/lib/ai/genkit.js +12 -8
- package/dist/lib/ai/genkit.js.map +1 -1
- package/dist/types/ai/recipe.d.ts.map +1 -1
- package/dist/types/ai/recipe.js +17 -10
- package/dist/types/ai/recipe.js.map +1 -1
- package/dist/types/core/settings.d.ts.map +1 -1
- package/dist/types/core/settings.js.map +1 -1
- package/dist/types/iam/user.d.ts.map +1 -1
- package/dist/types/iam/user.js.map +1 -1
- package/dist/types/recipe/equipment.d.ts.map +1 -1
- package/dist/types/recipe/equipment.js +4 -5
- package/dist/types/recipe/equipment.js.map +1 -1
- package/dist/types/recipe/ingredient.d.ts.map +1 -1
- package/dist/types/recipe/ingredient.js +13 -14
- package/dist/types/recipe/ingredient.js.map +1 -1
- package/dist/types/recipe/instruction.js +4 -4
- package/dist/types/recipe/instruction.js.map +1 -1
- package/dist/types/recipe/nutrition.js +9 -9
- package/dist/types/recipe/nutrition.js.map +1 -1
- package/package.json +56 -56
- package/src/lib/ai/embedding.ts +15 -9
- package/src/lib/ai/flow.ts +89 -89
- package/src/lib/ai/genkit.ts +18 -12
- package/src/lib/api.ts +103 -103
- package/src/lib/utils/sanitize.ts +38 -38
- package/src/types/ai/recipe.ts +68 -61
- package/src/types/ai/translation.ts +27 -27
- package/src/types/core/asset.ts +17 -17
- 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 +68 -61
- 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 +45 -45
- package/src/types/iam/subscription.ts +45 -45
- package/src/types/iam/user.ts +36 -31
- 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 +87 -87
- 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 +30 -31
- package/src/types/recipe/filters.ts +35 -35
- package/src/types/recipe/ingredient.ts +69 -70
- package/src/types/recipe/instruction.ts +31 -31
- package/src/types/recipe/nutrition.ts +29 -29
- package/src/types/recipe/recipe.ts +198 -198
- package/src/types/recipe/temperature.ts +12 -12
- 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 +68 -68
|
@@ -1,198 +1,198 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
-
import { LocaleSchema, type Locale } from "../core";
|
|
4
|
-
import {
|
|
5
|
-
AllergenSchema,
|
|
6
|
-
CuisineSchema,
|
|
7
|
-
DietaryTagSchema,
|
|
8
|
-
DifficultySchema,
|
|
9
|
-
MealTypeSchema,
|
|
10
|
-
RecipeSourceSchema,
|
|
11
|
-
RecipeStatusSchema,
|
|
12
|
-
SpicinessSchema,
|
|
13
|
-
type Allergen,
|
|
14
|
-
type Cuisine,
|
|
15
|
-
type DietaryTag,
|
|
16
|
-
type Difficulty,
|
|
17
|
-
type MealType,
|
|
18
|
-
type RecipeSource,
|
|
19
|
-
type RecipeStatus,
|
|
20
|
-
type Spiciness,
|
|
21
|
-
} from "./enums";
|
|
22
|
-
import {
|
|
23
|
-
EquipmentContentSchema,
|
|
24
|
-
EquipmentMetaSchema,
|
|
25
|
-
EquipmentSchema,
|
|
26
|
-
type Equipment,
|
|
27
|
-
type EquipmentContent,
|
|
28
|
-
type EquipmentMeta,
|
|
29
|
-
} from "./equipment";
|
|
30
|
-
import {
|
|
31
|
-
IngredientSectionContentSchema,
|
|
32
|
-
IngredientSectionMetaSchema,
|
|
33
|
-
IngredientSectionSchema,
|
|
34
|
-
type IngredientSection,
|
|
35
|
-
type IngredientSectionContent,
|
|
36
|
-
type IngredientSectionMeta,
|
|
37
|
-
} from "./ingredient";
|
|
38
|
-
import {
|
|
39
|
-
InstructionContentSchema,
|
|
40
|
-
InstructionMetaSchema,
|
|
41
|
-
InstructionSchema,
|
|
42
|
-
type Instruction,
|
|
43
|
-
type InstructionContent,
|
|
44
|
-
type InstructionMeta,
|
|
45
|
-
} from "./instruction";
|
|
46
|
-
import { NutritionSchema, type Nutrition } from "./nutrition";
|
|
47
|
-
|
|
48
|
-
export interface RecipeMeta {
|
|
49
|
-
allergens: Allergen[];
|
|
50
|
-
confidence: number;
|
|
51
|
-
createdAt: Timestamp;
|
|
52
|
-
createdBy: string;
|
|
53
|
-
cuisine: Cuisine;
|
|
54
|
-
deletedAt?: Timestamp;
|
|
55
|
-
dietaryTags: DietaryTag[];
|
|
56
|
-
difficulty: Difficulty;
|
|
57
|
-
equipment?: EquipmentMeta[];
|
|
58
|
-
id: string;
|
|
59
|
-
imageUrl?: string;
|
|
60
|
-
ingredientSections: IngredientSectionMeta[];
|
|
61
|
-
instructions: InstructionMeta[];
|
|
62
|
-
mealTypes: MealType[];
|
|
63
|
-
nutrition?: Nutrition;
|
|
64
|
-
originalLocale: Locale;
|
|
65
|
-
servings: number;
|
|
66
|
-
source: RecipeSource;
|
|
67
|
-
sourceUrl?: string;
|
|
68
|
-
spiciness: Spiciness;
|
|
69
|
-
status: RecipeStatus;
|
|
70
|
-
time: number;
|
|
71
|
-
updatedAt: Timestamp;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const RecipeMetaSchema = z.object({
|
|
75
|
-
allergens: z.array(AllergenSchema),
|
|
76
|
-
confidence: z.number().min(0).max(1),
|
|
77
|
-
createdAt: z.custom<Timestamp>(),
|
|
78
|
-
createdBy: z.string(),
|
|
79
|
-
cuisine: CuisineSchema,
|
|
80
|
-
deletedAt: z.custom<Timestamp>().optional(),
|
|
81
|
-
dietaryTags: z.array(DietaryTagSchema),
|
|
82
|
-
difficulty: DifficultySchema,
|
|
83
|
-
equipment: z.array(EquipmentMetaSchema).max(30).optional(),
|
|
84
|
-
id: z.string(),
|
|
85
|
-
imageUrl: z.string().optional(),
|
|
86
|
-
ingredientSections: z.array(IngredientSectionMetaSchema).min(1).max(20),
|
|
87
|
-
instructions: z.array(InstructionMetaSchema).min(1).max(100),
|
|
88
|
-
mealTypes: z.array(MealTypeSchema).min(1),
|
|
89
|
-
nutrition: NutritionSchema.optional(),
|
|
90
|
-
originalLocale: LocaleSchema,
|
|
91
|
-
servings: z.number().int().min(1).max(100),
|
|
92
|
-
source: RecipeSourceSchema,
|
|
93
|
-
sourceUrl: z.string().optional(),
|
|
94
|
-
spiciness: SpicinessSchema,
|
|
95
|
-
status: RecipeStatusSchema,
|
|
96
|
-
time: z.number().int().min(1).max(1440),
|
|
97
|
-
updatedAt: z.custom<Timestamp>(),
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
export interface RecipeContent {
|
|
101
|
-
description: string;
|
|
102
|
-
equipment?: EquipmentContent[];
|
|
103
|
-
ingredientSections: IngredientSectionContent[];
|
|
104
|
-
instructions: InstructionContent[];
|
|
105
|
-
locale: Locale;
|
|
106
|
-
tips?: string[];
|
|
107
|
-
title: string;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export const RecipeContentSchema = z.object({
|
|
111
|
-
description: z.string().min(10).max(2000),
|
|
112
|
-
equipment: z.array(EquipmentContentSchema).optional(),
|
|
113
|
-
ingredientSections: z.array(IngredientSectionContentSchema).min(1).max(20),
|
|
114
|
-
instructions: z.array(InstructionContentSchema).min(1).max(100),
|
|
115
|
-
locale: LocaleSchema,
|
|
116
|
-
tips: z.array(z.string().max(500)).max(20).optional(),
|
|
117
|
-
title: z.string().min(3).max(200),
|
|
118
|
-
}) satisfies z.ZodType<RecipeContent>;
|
|
119
|
-
|
|
120
|
-
export interface Recipe {
|
|
121
|
-
allergens: Allergen[];
|
|
122
|
-
confidence: number;
|
|
123
|
-
createdAt: Timestamp;
|
|
124
|
-
createdBy: string;
|
|
125
|
-
cuisine: Cuisine;
|
|
126
|
-
deletedAt?: Timestamp;
|
|
127
|
-
description: string;
|
|
128
|
-
dietaryTags: DietaryTag[];
|
|
129
|
-
difficulty: Difficulty;
|
|
130
|
-
equipment?: Equipment[];
|
|
131
|
-
id: string;
|
|
132
|
-
imageUrl?: string;
|
|
133
|
-
ingredientSections: IngredientSection[];
|
|
134
|
-
instructions: Instruction[];
|
|
135
|
-
locale: Locale;
|
|
136
|
-
mealTypes: MealType[];
|
|
137
|
-
nutrition?: Nutrition;
|
|
138
|
-
originalLocale: Locale;
|
|
139
|
-
servings: number;
|
|
140
|
-
source: RecipeSource;
|
|
141
|
-
sourceUrl?: string;
|
|
142
|
-
spiciness: Spiciness;
|
|
143
|
-
status: RecipeStatus;
|
|
144
|
-
time: number;
|
|
145
|
-
tips?: string[];
|
|
146
|
-
title: string;
|
|
147
|
-
updatedAt: Timestamp;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export const RecipeSchema = z.object({
|
|
151
|
-
allergens: z.array(AllergenSchema),
|
|
152
|
-
confidence: z.number().min(0).max(1),
|
|
153
|
-
createdAt: z.custom<Timestamp>(),
|
|
154
|
-
createdBy: z.string(),
|
|
155
|
-
cuisine: CuisineSchema,
|
|
156
|
-
deletedAt: z.custom<Timestamp>().optional(),
|
|
157
|
-
description: z.string().min(10).max(2000),
|
|
158
|
-
dietaryTags: z.array(DietaryTagSchema),
|
|
159
|
-
difficulty: DifficultySchema,
|
|
160
|
-
equipment: z.array(EquipmentSchema).optional(),
|
|
161
|
-
id: z.string(),
|
|
162
|
-
imageUrl: z.string().optional(),
|
|
163
|
-
ingredientSections: z.array(IngredientSectionSchema).min(1),
|
|
164
|
-
instructions: z.array(InstructionSchema).min(1),
|
|
165
|
-
locale: LocaleSchema,
|
|
166
|
-
mealTypes: z.array(MealTypeSchema).min(1),
|
|
167
|
-
nutrition: NutritionSchema.optional(),
|
|
168
|
-
originalLocale: LocaleSchema,
|
|
169
|
-
servings: z.number().int().min(1).max(100),
|
|
170
|
-
source: RecipeSourceSchema,
|
|
171
|
-
sourceUrl: z.string().optional(),
|
|
172
|
-
spiciness: SpicinessSchema,
|
|
173
|
-
status: RecipeStatusSchema,
|
|
174
|
-
time: z.number().int().min(1).max(1440),
|
|
175
|
-
tips: z.array(z.string().max(500)).optional(),
|
|
176
|
-
title: z.string().min(3).max(200),
|
|
177
|
-
updatedAt: z.custom<Timestamp>(),
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
export interface RecipeStats {
|
|
181
|
-
comments: number;
|
|
182
|
-
likes: number;
|
|
183
|
-
rating: number;
|
|
184
|
-
ratingCount: number;
|
|
185
|
-
saves: number;
|
|
186
|
-
updatedAt: number;
|
|
187
|
-
views: number;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export const RecipeStatsSchema = z.object({
|
|
191
|
-
comments: z.number().int().nonnegative(),
|
|
192
|
-
likes: z.number().int().nonnegative(),
|
|
193
|
-
rating: z.number().min(0).max(5),
|
|
194
|
-
ratingCount: z.number().int().nonnegative(),
|
|
195
|
-
saves: z.number().int().nonnegative(),
|
|
196
|
-
updatedAt: z.number().int(),
|
|
197
|
-
views: z.number().int().nonnegative(),
|
|
198
|
-
}) satisfies z.ZodType<RecipeStats>;
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
+
import { LocaleSchema, type Locale } from "../core";
|
|
4
|
+
import {
|
|
5
|
+
AllergenSchema,
|
|
6
|
+
CuisineSchema,
|
|
7
|
+
DietaryTagSchema,
|
|
8
|
+
DifficultySchema,
|
|
9
|
+
MealTypeSchema,
|
|
10
|
+
RecipeSourceSchema,
|
|
11
|
+
RecipeStatusSchema,
|
|
12
|
+
SpicinessSchema,
|
|
13
|
+
type Allergen,
|
|
14
|
+
type Cuisine,
|
|
15
|
+
type DietaryTag,
|
|
16
|
+
type Difficulty,
|
|
17
|
+
type MealType,
|
|
18
|
+
type RecipeSource,
|
|
19
|
+
type RecipeStatus,
|
|
20
|
+
type Spiciness,
|
|
21
|
+
} from "./enums";
|
|
22
|
+
import {
|
|
23
|
+
EquipmentContentSchema,
|
|
24
|
+
EquipmentMetaSchema,
|
|
25
|
+
EquipmentSchema,
|
|
26
|
+
type Equipment,
|
|
27
|
+
type EquipmentContent,
|
|
28
|
+
type EquipmentMeta,
|
|
29
|
+
} from "./equipment";
|
|
30
|
+
import {
|
|
31
|
+
IngredientSectionContentSchema,
|
|
32
|
+
IngredientSectionMetaSchema,
|
|
33
|
+
IngredientSectionSchema,
|
|
34
|
+
type IngredientSection,
|
|
35
|
+
type IngredientSectionContent,
|
|
36
|
+
type IngredientSectionMeta,
|
|
37
|
+
} from "./ingredient";
|
|
38
|
+
import {
|
|
39
|
+
InstructionContentSchema,
|
|
40
|
+
InstructionMetaSchema,
|
|
41
|
+
InstructionSchema,
|
|
42
|
+
type Instruction,
|
|
43
|
+
type InstructionContent,
|
|
44
|
+
type InstructionMeta,
|
|
45
|
+
} from "./instruction";
|
|
46
|
+
import { NutritionSchema, type Nutrition } from "./nutrition";
|
|
47
|
+
|
|
48
|
+
export interface RecipeMeta {
|
|
49
|
+
allergens: Allergen[];
|
|
50
|
+
confidence: number;
|
|
51
|
+
createdAt: Timestamp;
|
|
52
|
+
createdBy: string;
|
|
53
|
+
cuisine: Cuisine;
|
|
54
|
+
deletedAt?: Timestamp;
|
|
55
|
+
dietaryTags: DietaryTag[];
|
|
56
|
+
difficulty: Difficulty;
|
|
57
|
+
equipment?: EquipmentMeta[];
|
|
58
|
+
id: string;
|
|
59
|
+
imageUrl?: string;
|
|
60
|
+
ingredientSections: IngredientSectionMeta[];
|
|
61
|
+
instructions: InstructionMeta[];
|
|
62
|
+
mealTypes: MealType[];
|
|
63
|
+
nutrition?: Nutrition;
|
|
64
|
+
originalLocale: Locale;
|
|
65
|
+
servings: number;
|
|
66
|
+
source: RecipeSource;
|
|
67
|
+
sourceUrl?: string;
|
|
68
|
+
spiciness: Spiciness;
|
|
69
|
+
status: RecipeStatus;
|
|
70
|
+
time: number;
|
|
71
|
+
updatedAt: Timestamp;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const RecipeMetaSchema = z.object({
|
|
75
|
+
allergens: z.array(AllergenSchema),
|
|
76
|
+
confidence: z.number().min(0).max(1),
|
|
77
|
+
createdAt: z.custom<Timestamp>(),
|
|
78
|
+
createdBy: z.string(),
|
|
79
|
+
cuisine: CuisineSchema,
|
|
80
|
+
deletedAt: z.custom<Timestamp>().optional(),
|
|
81
|
+
dietaryTags: z.array(DietaryTagSchema),
|
|
82
|
+
difficulty: DifficultySchema,
|
|
83
|
+
equipment: z.array(EquipmentMetaSchema).max(30).optional(),
|
|
84
|
+
id: z.string(),
|
|
85
|
+
imageUrl: z.string().optional(),
|
|
86
|
+
ingredientSections: z.array(IngredientSectionMetaSchema).min(1).max(20),
|
|
87
|
+
instructions: z.array(InstructionMetaSchema).min(1).max(100),
|
|
88
|
+
mealTypes: z.array(MealTypeSchema).min(1),
|
|
89
|
+
nutrition: NutritionSchema.optional(),
|
|
90
|
+
originalLocale: LocaleSchema,
|
|
91
|
+
servings: z.number().int().min(1).max(100),
|
|
92
|
+
source: RecipeSourceSchema,
|
|
93
|
+
sourceUrl: z.string().optional(),
|
|
94
|
+
spiciness: SpicinessSchema,
|
|
95
|
+
status: RecipeStatusSchema,
|
|
96
|
+
time: z.number().int().min(1).max(1440),
|
|
97
|
+
updatedAt: z.custom<Timestamp>(),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export interface RecipeContent {
|
|
101
|
+
description: string;
|
|
102
|
+
equipment?: EquipmentContent[];
|
|
103
|
+
ingredientSections: IngredientSectionContent[];
|
|
104
|
+
instructions: InstructionContent[];
|
|
105
|
+
locale: Locale;
|
|
106
|
+
tips?: string[];
|
|
107
|
+
title: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const RecipeContentSchema = z.object({
|
|
111
|
+
description: z.string().min(10).max(2000),
|
|
112
|
+
equipment: z.array(EquipmentContentSchema).optional(),
|
|
113
|
+
ingredientSections: z.array(IngredientSectionContentSchema).min(1).max(20),
|
|
114
|
+
instructions: z.array(InstructionContentSchema).min(1).max(100),
|
|
115
|
+
locale: LocaleSchema,
|
|
116
|
+
tips: z.array(z.string().max(500)).max(20).optional(),
|
|
117
|
+
title: z.string().min(3).max(200),
|
|
118
|
+
}) satisfies z.ZodType<RecipeContent>;
|
|
119
|
+
|
|
120
|
+
export interface Recipe {
|
|
121
|
+
allergens: Allergen[];
|
|
122
|
+
confidence: number;
|
|
123
|
+
createdAt: Timestamp;
|
|
124
|
+
createdBy: string;
|
|
125
|
+
cuisine: Cuisine;
|
|
126
|
+
deletedAt?: Timestamp;
|
|
127
|
+
description: string;
|
|
128
|
+
dietaryTags: DietaryTag[];
|
|
129
|
+
difficulty: Difficulty;
|
|
130
|
+
equipment?: Equipment[];
|
|
131
|
+
id: string;
|
|
132
|
+
imageUrl?: string;
|
|
133
|
+
ingredientSections: IngredientSection[];
|
|
134
|
+
instructions: Instruction[];
|
|
135
|
+
locale: Locale;
|
|
136
|
+
mealTypes: MealType[];
|
|
137
|
+
nutrition?: Nutrition;
|
|
138
|
+
originalLocale: Locale;
|
|
139
|
+
servings: number;
|
|
140
|
+
source: RecipeSource;
|
|
141
|
+
sourceUrl?: string;
|
|
142
|
+
spiciness: Spiciness;
|
|
143
|
+
status: RecipeStatus;
|
|
144
|
+
time: number;
|
|
145
|
+
tips?: string[];
|
|
146
|
+
title: string;
|
|
147
|
+
updatedAt: Timestamp;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const RecipeSchema = z.object({
|
|
151
|
+
allergens: z.array(AllergenSchema),
|
|
152
|
+
confidence: z.number().min(0).max(1),
|
|
153
|
+
createdAt: z.custom<Timestamp>(),
|
|
154
|
+
createdBy: z.string(),
|
|
155
|
+
cuisine: CuisineSchema,
|
|
156
|
+
deletedAt: z.custom<Timestamp>().optional(),
|
|
157
|
+
description: z.string().min(10).max(2000),
|
|
158
|
+
dietaryTags: z.array(DietaryTagSchema),
|
|
159
|
+
difficulty: DifficultySchema,
|
|
160
|
+
equipment: z.array(EquipmentSchema).optional(),
|
|
161
|
+
id: z.string(),
|
|
162
|
+
imageUrl: z.string().optional(),
|
|
163
|
+
ingredientSections: z.array(IngredientSectionSchema).min(1),
|
|
164
|
+
instructions: z.array(InstructionSchema).min(1),
|
|
165
|
+
locale: LocaleSchema,
|
|
166
|
+
mealTypes: z.array(MealTypeSchema).min(1),
|
|
167
|
+
nutrition: NutritionSchema.optional(),
|
|
168
|
+
originalLocale: LocaleSchema,
|
|
169
|
+
servings: z.number().int().min(1).max(100),
|
|
170
|
+
source: RecipeSourceSchema,
|
|
171
|
+
sourceUrl: z.string().optional(),
|
|
172
|
+
spiciness: SpicinessSchema,
|
|
173
|
+
status: RecipeStatusSchema,
|
|
174
|
+
time: z.number().int().min(1).max(1440),
|
|
175
|
+
tips: z.array(z.string().max(500)).optional(),
|
|
176
|
+
title: z.string().min(3).max(200),
|
|
177
|
+
updatedAt: z.custom<Timestamp>(),
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
export interface RecipeStats {
|
|
181
|
+
comments: number;
|
|
182
|
+
likes: number;
|
|
183
|
+
rating: number;
|
|
184
|
+
ratingCount: number;
|
|
185
|
+
saves: number;
|
|
186
|
+
updatedAt: number;
|
|
187
|
+
views: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export const RecipeStatsSchema = z.object({
|
|
191
|
+
comments: z.number().int().nonnegative(),
|
|
192
|
+
likes: z.number().int().nonnegative(),
|
|
193
|
+
rating: z.number().min(0).max(5),
|
|
194
|
+
ratingCount: z.number().int().nonnegative(),
|
|
195
|
+
saves: z.number().int().nonnegative(),
|
|
196
|
+
updatedAt: z.number().int(),
|
|
197
|
+
views: z.number().int().nonnegative(),
|
|
198
|
+
}) satisfies z.ZodType<RecipeStats>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
import { TemperatureUnitSchema, type TemperatureUnit } from "./enums";
|
|
3
|
-
|
|
4
|
-
export interface Temperature {
|
|
5
|
-
unit: TemperatureUnit;
|
|
6
|
-
value: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const TemperatureSchema = z.object({
|
|
10
|
-
unit: TemperatureUnitSchema,
|
|
11
|
-
value: z.number().min(-50).max(1000),
|
|
12
|
-
}) satisfies z.ZodType<Temperature>;
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import { TemperatureUnitSchema, type TemperatureUnit } from "./enums";
|
|
3
|
+
|
|
4
|
+
export interface Temperature {
|
|
5
|
+
unit: TemperatureUnit;
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const TemperatureSchema = z.object({
|
|
10
|
+
unit: TemperatureUnitSchema,
|
|
11
|
+
value: z.number().min(-50).max(1000),
|
|
12
|
+
}) satisfies z.ZodType<Temperature>;
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
+
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 "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
|
+
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 "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
|
+
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 "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
|
+
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,68 +1,68 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
-
import {
|
|
4
|
-
ReportPrioritySchema,
|
|
5
|
-
ReportStatusSchema,
|
|
6
|
-
ReportTargetTypeSchema,
|
|
7
|
-
ReportTypeSchema,
|
|
8
|
-
type ReportPriority,
|
|
9
|
-
type ReportStatus,
|
|
10
|
-
type ReportTargetType,
|
|
11
|
-
type ReportType,
|
|
12
|
-
} from "./enums";
|
|
13
|
-
|
|
14
|
-
export interface ReportEvidence {
|
|
15
|
-
aiScore?: number;
|
|
16
|
-
aiSuggestions?: Record<string, unknown>[];
|
|
17
|
-
contentSnapshot?: string;
|
|
18
|
-
imageHashes?: string[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const ReportEvidenceSchema = z.object({
|
|
22
|
-
aiScore: z.number().min(0).max(1).optional(),
|
|
23
|
-
aiSuggestions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
24
|
-
contentSnapshot: z.string().optional(),
|
|
25
|
-
imageHashes: z.array(z.string()).optional(),
|
|
26
|
-
}) satisfies z.ZodType<ReportEvidence>;
|
|
27
|
-
|
|
28
|
-
export interface Report {
|
|
29
|
-
categories: string[];
|
|
30
|
-
createdAt: Timestamp;
|
|
31
|
-
description: string;
|
|
32
|
-
evidence?: ReportEvidence;
|
|
33
|
-
id: string;
|
|
34
|
-
notes?: string;
|
|
35
|
-
priority: ReportPriority;
|
|
36
|
-
reason: string;
|
|
37
|
-
reportedBy?: string;
|
|
38
|
-
resolution?: string;
|
|
39
|
-
reviewedAt?: Timestamp;
|
|
40
|
-
reviewedBy?: string;
|
|
41
|
-
status: ReportStatus;
|
|
42
|
-
targetId: string;
|
|
43
|
-
targetType: ReportTargetType;
|
|
44
|
-
type: ReportType;
|
|
45
|
-
updatedAt: Timestamp;
|
|
46
|
-
userId: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const ReportSchema = z.object({
|
|
50
|
-
categories: z.array(z.string()),
|
|
51
|
-
createdAt: z.custom<Timestamp>(),
|
|
52
|
-
description: z.string(),
|
|
53
|
-
evidence: ReportEvidenceSchema.optional(),
|
|
54
|
-
id: z.string(),
|
|
55
|
-
notes: z.string().optional(),
|
|
56
|
-
priority: ReportPrioritySchema,
|
|
57
|
-
reason: z.string(),
|
|
58
|
-
reportedBy: z.string().optional(),
|
|
59
|
-
resolution: z.string().optional(),
|
|
60
|
-
reviewedAt: z.custom<Timestamp>().optional(),
|
|
61
|
-
reviewedBy: z.string().optional(),
|
|
62
|
-
status: ReportStatusSchema,
|
|
63
|
-
targetId: z.string(),
|
|
64
|
-
targetType: ReportTargetTypeSchema,
|
|
65
|
-
type: ReportTypeSchema,
|
|
66
|
-
updatedAt: z.custom<Timestamp>(),
|
|
67
|
-
userId: z.string(),
|
|
68
|
-
});
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
+
import {
|
|
4
|
+
ReportPrioritySchema,
|
|
5
|
+
ReportStatusSchema,
|
|
6
|
+
ReportTargetTypeSchema,
|
|
7
|
+
ReportTypeSchema,
|
|
8
|
+
type ReportPriority,
|
|
9
|
+
type ReportStatus,
|
|
10
|
+
type ReportTargetType,
|
|
11
|
+
type ReportType,
|
|
12
|
+
} from "./enums";
|
|
13
|
+
|
|
14
|
+
export interface ReportEvidence {
|
|
15
|
+
aiScore?: number;
|
|
16
|
+
aiSuggestions?: Record<string, unknown>[];
|
|
17
|
+
contentSnapshot?: string;
|
|
18
|
+
imageHashes?: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const ReportEvidenceSchema = z.object({
|
|
22
|
+
aiScore: z.number().min(0).max(1).optional(),
|
|
23
|
+
aiSuggestions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
24
|
+
contentSnapshot: z.string().optional(),
|
|
25
|
+
imageHashes: z.array(z.string()).optional(),
|
|
26
|
+
}) satisfies z.ZodType<ReportEvidence>;
|
|
27
|
+
|
|
28
|
+
export interface Report {
|
|
29
|
+
categories: string[];
|
|
30
|
+
createdAt: Timestamp;
|
|
31
|
+
description: string;
|
|
32
|
+
evidence?: ReportEvidence;
|
|
33
|
+
id: string;
|
|
34
|
+
notes?: string;
|
|
35
|
+
priority: ReportPriority;
|
|
36
|
+
reason: string;
|
|
37
|
+
reportedBy?: string;
|
|
38
|
+
resolution?: string;
|
|
39
|
+
reviewedAt?: Timestamp;
|
|
40
|
+
reviewedBy?: string;
|
|
41
|
+
status: ReportStatus;
|
|
42
|
+
targetId: string;
|
|
43
|
+
targetType: ReportTargetType;
|
|
44
|
+
type: ReportType;
|
|
45
|
+
updatedAt: Timestamp;
|
|
46
|
+
userId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const ReportSchema = z.object({
|
|
50
|
+
categories: z.array(z.string()),
|
|
51
|
+
createdAt: z.custom<Timestamp>(),
|
|
52
|
+
description: z.string(),
|
|
53
|
+
evidence: ReportEvidenceSchema.optional(),
|
|
54
|
+
id: z.string(),
|
|
55
|
+
notes: z.string().optional(),
|
|
56
|
+
priority: ReportPrioritySchema,
|
|
57
|
+
reason: z.string(),
|
|
58
|
+
reportedBy: z.string().optional(),
|
|
59
|
+
resolution: z.string().optional(),
|
|
60
|
+
reviewedAt: z.custom<Timestamp>().optional(),
|
|
61
|
+
reviewedBy: z.string().optional(),
|
|
62
|
+
status: ReportStatusSchema,
|
|
63
|
+
targetId: z.string(),
|
|
64
|
+
targetType: ReportTargetTypeSchema,
|
|
65
|
+
type: ReportTypeSchema,
|
|
66
|
+
updatedAt: z.custom<Timestamp>(),
|
|
67
|
+
userId: z.string(),
|
|
68
|
+
});
|