@cravery/core 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/config/collections.d.ts +8 -0
  2. package/dist/config/collections.d.ts.map +1 -0
  3. package/dist/config/collections.js +11 -0
  4. package/dist/config/collections.js.map +1 -0
  5. package/dist/config/common.d.ts +2 -0
  6. package/dist/config/common.d.ts.map +1 -0
  7. package/dist/config/common.js +5 -0
  8. package/dist/config/common.js.map +1 -0
  9. package/dist/config/credits.d.ts +2 -0
  10. package/dist/config/credits.d.ts.map +1 -0
  11. package/dist/config/credits.js +5 -0
  12. package/dist/config/credits.js.map +1 -0
  13. package/dist/config/index.d.ts +3 -0
  14. package/dist/config/index.d.ts.map +1 -0
  15. package/dist/config/index.js +19 -0
  16. package/dist/config/index.js.map +1 -0
  17. package/dist/enums/allergen.d.ts +19 -0
  18. package/dist/enums/allergen.d.ts.map +1 -0
  19. package/dist/enums/allergen.js +21 -0
  20. package/dist/enums/allergen.js.map +1 -0
  21. package/dist/enums/cuisine.d.ts +39 -0
  22. package/dist/enums/cuisine.d.ts.map +1 -0
  23. package/dist/enums/cuisine.js +41 -0
  24. package/dist/enums/cuisine.js.map +1 -0
  25. package/dist/enums/dietary_tag.d.ts +21 -0
  26. package/dist/enums/dietary_tag.d.ts.map +1 -0
  27. package/dist/enums/dietary_tag.js +23 -0
  28. package/dist/enums/dietary_tag.js.map +1 -0
  29. package/dist/enums/difficulty.d.ts +10 -0
  30. package/dist/enums/difficulty.d.ts.map +1 -0
  31. package/dist/enums/difficulty.js +12 -0
  32. package/dist/enums/difficulty.js.map +1 -0
  33. package/dist/enums/image_type.d.ts +8 -0
  34. package/dist/enums/image_type.d.ts.map +1 -0
  35. package/dist/enums/image_type.js +7 -0
  36. package/dist/enums/image_type.js.map +1 -0
  37. package/dist/enums/index.d.ts +22 -0
  38. package/dist/enums/index.d.ts.map +1 -0
  39. package/dist/enums/index.js +38 -0
  40. package/dist/enums/index.js.map +1 -0
  41. package/dist/enums/locale.d.ts +11 -0
  42. package/dist/enums/locale.d.ts.map +1 -0
  43. package/dist/enums/locale.js +7 -0
  44. package/dist/enums/locale.js.map +1 -0
  45. package/dist/enums/meal_type.d.ts +14 -0
  46. package/dist/enums/meal_type.d.ts.map +1 -0
  47. package/dist/enums/meal_type.js +16 -0
  48. package/dist/enums/meal_type.js.map +1 -0
  49. package/dist/enums/moderation_status.d.ts +9 -0
  50. package/dist/enums/moderation_status.d.ts.map +1 -0
  51. package/dist/enums/moderation_status.js +11 -0
  52. package/dist/enums/moderation_status.js.map +1 -0
  53. package/dist/enums/priority.d.ts +9 -0
  54. package/dist/enums/priority.d.ts.map +1 -0
  55. package/dist/enums/priority.js +7 -0
  56. package/dist/enums/priority.js.map +1 -0
  57. package/dist/enums/profile_status.d.ts +10 -0
  58. package/dist/enums/profile_status.d.ts.map +1 -0
  59. package/dist/enums/profile_status.js +12 -0
  60. package/dist/enums/profile_status.js.map +1 -0
  61. package/dist/enums/recipe_source.d.ts +10 -0
  62. package/dist/enums/recipe_source.d.ts.map +1 -0
  63. package/dist/enums/recipe_source.js +7 -0
  64. package/dist/enums/recipe_source.js.map +1 -0
  65. package/dist/enums/recipe_status.d.ts +10 -0
  66. package/dist/enums/recipe_status.d.ts.map +1 -0
  67. package/dist/enums/recipe_status.js +12 -0
  68. package/dist/enums/recipe_status.js.map +1 -0
  69. package/dist/enums/role.d.ts +11 -0
  70. package/dist/enums/role.d.ts.map +1 -0
  71. package/dist/enums/role.js +13 -0
  72. package/dist/enums/role.js.map +1 -0
  73. package/dist/enums/severity.d.ts +9 -0
  74. package/dist/enums/severity.d.ts.map +1 -0
  75. package/dist/enums/severity.js +7 -0
  76. package/dist/enums/severity.js.map +1 -0
  77. package/dist/enums/spiciness.d.ts +10 -0
  78. package/dist/enums/spiciness.d.ts.map +1 -0
  79. package/dist/enums/spiciness.js +7 -0
  80. package/dist/enums/spiciness.js.map +1 -0
  81. package/dist/enums/status.d.ts +11 -0
  82. package/dist/enums/status.d.ts.map +1 -0
  83. package/dist/enums/status.js +13 -0
  84. package/dist/enums/status.js.map +1 -0
  85. package/dist/enums/subscription_tier.d.ts +8 -0
  86. package/dist/enums/subscription_tier.d.ts.map +1 -0
  87. package/dist/enums/subscription_tier.js +6 -0
  88. package/dist/enums/subscription_tier.js.map +1 -0
  89. package/dist/enums/suggestion_category.d.ts +11 -0
  90. package/dist/enums/suggestion_category.d.ts.map +1 -0
  91. package/dist/enums/suggestion_category.js +13 -0
  92. package/dist/enums/suggestion_category.js.map +1 -0
  93. package/dist/enums/temperature_unit.d.ts +8 -0
  94. package/dist/enums/temperature_unit.d.ts.map +1 -0
  95. package/dist/enums/temperature_unit.js +7 -0
  96. package/dist/enums/temperature_unit.js.map +1 -0
  97. package/dist/enums/unit.d.ts +43 -0
  98. package/dist/enums/unit.d.ts.map +1 -0
  99. package/dist/enums/unit.js +53 -0
  100. package/dist/enums/unit.js.map +1 -0
  101. package/dist/enums/url_type.d.ts +13 -0
  102. package/dist/enums/url_type.d.ts.map +1 -0
  103. package/dist/enums/url_type.js +15 -0
  104. package/dist/enums/url_type.js.map +1 -0
  105. package/dist/enums/user_status.d.ts +10 -0
  106. package/dist/enums/user_status.d.ts.map +1 -0
  107. package/dist/enums/user_status.js +12 -0
  108. package/dist/enums/user_status.js.map +1 -0
  109. package/dist/index.d.ts +4 -1
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +18 -0
  112. package/dist/index.js.map +1 -1
  113. package/dist/lib/index.d.ts +2 -0
  114. package/dist/lib/index.d.ts.map +1 -0
  115. package/dist/lib/index.js +3 -0
  116. package/dist/lib/index.js.map +1 -0
  117. package/dist/types/ai/config.d.ts +20 -0
  118. package/dist/types/ai/config.d.ts.map +1 -0
  119. package/dist/types/ai/config.js +3 -0
  120. package/dist/types/ai/config.js.map +1 -0
  121. package/dist/types/ai/filters.d.ts +82 -0
  122. package/dist/types/ai/filters.d.ts.map +1 -0
  123. package/dist/types/ai/filters.js +16 -0
  124. package/dist/types/ai/filters.js.map +1 -0
  125. package/dist/types/ai/index.d.ts +5 -0
  126. package/dist/types/ai/index.d.ts.map +1 -0
  127. package/dist/types/ai/index.js +21 -0
  128. package/dist/types/ai/index.js.map +1 -0
  129. package/dist/types/ai/recipe.d.ts +179 -0
  130. package/dist/types/ai/recipe.d.ts.map +1 -0
  131. package/dist/types/ai/recipe.js +28 -0
  132. package/dist/types/ai/recipe.js.map +1 -0
  133. package/dist/types/ai/translation.d.ts +26 -0
  134. package/dist/types/ai/translation.d.ts.map +1 -0
  135. package/dist/types/ai/translation.js +16 -0
  136. package/dist/types/ai/translation.js.map +1 -0
  137. package/dist/types/equipment.d.ts +20 -0
  138. package/dist/types/equipment.d.ts.map +1 -0
  139. package/dist/types/equipment.js +16 -0
  140. package/dist/types/equipment.js.map +1 -0
  141. package/dist/types/index.d.ts +12 -0
  142. package/dist/types/index.d.ts.map +1 -0
  143. package/dist/types/index.js +28 -0
  144. package/dist/types/index.js.map +1 -0
  145. package/dist/types/ingredient.d.ts +209 -0
  146. package/dist/types/ingredient.d.ts.map +1 -0
  147. package/dist/types/ingredient.js +33 -0
  148. package/dist/types/ingredient.js.map +1 -0
  149. package/dist/types/instruction.d.ts +32 -0
  150. package/dist/types/instruction.d.ts.map +1 -0
  151. package/dist/types/instruction.js +16 -0
  152. package/dist/types/instruction.js.map +1 -0
  153. package/dist/types/moderation.d.ts +87 -0
  154. package/dist/types/moderation.d.ts.map +1 -0
  155. package/dist/types/moderation.js +38 -0
  156. package/dist/types/moderation.js.map +1 -0
  157. package/dist/types/nutrition.d.ts +18 -0
  158. package/dist/types/nutrition.d.ts.map +1 -0
  159. package/dist/types/nutrition.js +20 -0
  160. package/dist/types/nutrition.js.map +1 -0
  161. package/dist/types/profile.d.ts +30 -0
  162. package/dist/types/profile.d.ts.map +1 -0
  163. package/dist/types/profile.js +26 -0
  164. package/dist/types/profile.js.map +1 -0
  165. package/dist/types/recipe.d.ts +448 -0
  166. package/dist/types/recipe.d.ts.map +1 -0
  167. package/dist/types/recipe.js +82 -0
  168. package/dist/types/recipe.js.map +1 -0
  169. package/dist/types/subscription.d.ts +16 -0
  170. package/dist/types/subscription.d.ts.map +1 -0
  171. package/dist/types/subscription.js +14 -0
  172. package/dist/types/subscription.js.map +1 -0
  173. package/dist/types/temperature.d.ts +10 -0
  174. package/dist/types/temperature.d.ts.map +1 -0
  175. package/dist/types/temperature.js +10 -0
  176. package/dist/types/temperature.js.map +1 -0
  177. package/dist/types/user.d.ts +26 -0
  178. package/dist/types/user.d.ts.map +1 -0
  179. package/dist/types/user.js +17 -0
  180. package/dist/types/user.js.map +1 -0
  181. package/package.json +3 -1
  182. package/src/config/collections.ts +7 -0
  183. package/src/config/common.ts +1 -0
  184. package/src/config/index.ts +2 -0
  185. package/src/enums/allergen.ts +19 -0
  186. package/src/enums/cuisine.ts +39 -0
  187. package/src/enums/dietary_tag.ts +21 -0
  188. package/src/enums/difficulty.ts +10 -0
  189. package/src/enums/image_type.ts +5 -0
  190. package/src/enums/index.ts +21 -0
  191. package/src/enums/locale.ts +5 -0
  192. package/src/enums/meal_type.ts +14 -0
  193. package/src/enums/moderation_status.ts +9 -0
  194. package/src/enums/priority.ts +5 -0
  195. package/src/enums/profile_status.ts +10 -0
  196. package/src/enums/recipe_source.ts +5 -0
  197. package/src/enums/recipe_status.ts +10 -0
  198. package/src/enums/role.ts +11 -0
  199. package/src/enums/severity.ts +5 -0
  200. package/src/enums/spiciness.ts +5 -0
  201. package/src/enums/status.ts +11 -0
  202. package/src/enums/subscription_tier.ts +4 -0
  203. package/src/enums/suggestion_category.ts +11 -0
  204. package/src/enums/temperature_unit.ts +5 -0
  205. package/src/enums/unit.ts +51 -0
  206. package/src/enums/url_type.ts +13 -0
  207. package/src/enums/user_status.ts +10 -0
  208. package/src/index.ts +4 -0
  209. package/src/lib/index.ts +0 -0
  210. package/src/types/ai/config.ts +26 -0
  211. package/src/types/ai/filters.ts +20 -0
  212. package/src/types/ai/index.ts +4 -0
  213. package/src/types/ai/recipe.ts +33 -0
  214. package/src/types/ai/translation.ts +14 -0
  215. package/src/types/equipment.ts +21 -0
  216. package/src/types/index.ts +11 -0
  217. package/src/types/ingredient.ts +46 -0
  218. package/src/types/instruction.ts +21 -0
  219. package/src/types/moderation.ts +48 -0
  220. package/src/types/nutrition.ts +18 -0
  221. package/src/types/profile.ts +27 -0
  222. package/src/types/recipe.ts +109 -0
  223. package/src/types/subscription.ts +13 -0
  224. package/src/types/temperature.ts +8 -0
  225. package/src/types/user.ts +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cravery/core",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Clean architecture foundation for Cravery",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,6 +15,8 @@
15
15
  },
16
16
  "keywords": [],
17
17
  "dependencies": {
18
+ "@genkit-ai/vertexai": "^1.27.0",
19
+ "genkit": "^1.27.0",
18
20
  "zod": "^4.3.5"
19
21
  },
20
22
  "devDependencies": {
@@ -0,0 +1,7 @@
1
+ export const Collections = {
2
+ Moderations: "moderations",
3
+ Profiles: "profiles",
4
+ Recipes: "recipes",
5
+ Subscriptions: "subscriptions",
6
+ Users: "users",
7
+ };
@@ -0,0 +1 @@
1
+ export const SlugRegex = /^[a-z][a-z0-9-]*[a-z0-9]$/;
@@ -0,0 +1,2 @@
1
+ export * from "./collections";
2
+ export * from "./common";
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+
3
+ export const ALLERGEN_VALUES = [
4
+ "celery",
5
+ "dairy",
6
+ "eggs",
7
+ "fish",
8
+ "gluten",
9
+ "lupin",
10
+ "mustard",
11
+ "nuts",
12
+ "peanuts",
13
+ "sesame",
14
+ "shellfish",
15
+ "soy",
16
+ "sulfites",
17
+ ] as const;
18
+ export const AllergenSchema = z.enum(ALLERGEN_VALUES);
19
+ export type Allergen = (typeof ALLERGEN_VALUES)[number];
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+
3
+ export const CUISINE_VALUES = [
4
+ "african",
5
+ "american",
6
+ "brazilian",
7
+ "british",
8
+ "caribbean",
9
+ "chinese",
10
+ "egyptian",
11
+ "emirati",
12
+ "ethiopian",
13
+ "filipino",
14
+ "french",
15
+ "fusion",
16
+ "german",
17
+ "greek",
18
+ "indian",
19
+ "indonesian",
20
+ "italian",
21
+ "japanese",
22
+ "korean",
23
+ "lebanese",
24
+ "malaysian",
25
+ "mexican",
26
+ "moroccan",
27
+ "pakistani",
28
+ "persian",
29
+ "russian",
30
+ "saudi",
31
+ "spanish",
32
+ "sudanese",
33
+ "thai",
34
+ "turkish",
35
+ "vietnamese",
36
+ "other",
37
+ ] as const;
38
+ export const CuisineSchema = z.enum(CUISINE_VALUES);
39
+ export type Cuisine = (typeof CUISINE_VALUES)[number];
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+
3
+ export const DIETARY_TAG_VALUES = [
4
+ "dairy_free",
5
+ "egg_free",
6
+ "gluten_free",
7
+ "halal",
8
+ "high_protein",
9
+ "keto",
10
+ "low_carb",
11
+ "low_fat",
12
+ "low_sodium",
13
+ "low_sugar",
14
+ "nut_free",
15
+ "pescatarian",
16
+ "soy_free",
17
+ "vegan",
18
+ "vegetarian",
19
+ ] as const;
20
+ export const DietaryTagSchema = z.enum(DIETARY_TAG_VALUES);
21
+ export type DietaryTag = (typeof DIETARY_TAG_VALUES)[number];
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const DIFFICULTY_VALUES = [
4
+ "beginner",
5
+ "intermediate",
6
+ "advanced",
7
+ "expert",
8
+ ] as const;
9
+ export const DifficultySchema = z.enum(DIFFICULTY_VALUES);
10
+ export type Difficulty = (typeof DIFFICULTY_VALUES)[number];
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const IMAGE_TYPE_VALUES = ["recipe", "ingredients"] as const;
4
+ export const ImageTypeSchema = z.enum(IMAGE_TYPE_VALUES);
5
+ export type ImageType = z.infer<typeof ImageTypeSchema>;
@@ -0,0 +1,21 @@
1
+ export * from "./allergen";
2
+ export * from "./cuisine";
3
+ export * from "./dietary_tag";
4
+ export * from "./difficulty";
5
+ export * from "./image_type";
6
+ export * from "./locale";
7
+ export * from "./meal_type";
8
+ export * from "./moderation_status";
9
+ export * from "./priority";
10
+ export * from "./profile_status";
11
+ export * from "./recipe_source";
12
+ export * from "./recipe_status";
13
+ export * from "./role";
14
+ export * from "./severity";
15
+ export * from "./spiciness";
16
+ export * from "./subscription_tier";
17
+ export * from "./suggestion_category";
18
+ export * from "./temperature_unit";
19
+ export * from "./unit";
20
+ export * from "./url_type";
21
+ export * from "./user_status";
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const LOCALE_VALUES = ["en", "ar", "es", "fr", "ru"] as const;
4
+ export const LocaleSchema = z.enum(LOCALE_VALUES);
5
+ export type Locale = (typeof LOCALE_VALUES)[number];
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+
3
+ export const MEAL_TYPE_VALUES = [
4
+ "appetizer",
5
+ "breakfast",
6
+ "brunch",
7
+ "dessert",
8
+ "dinner",
9
+ "drink",
10
+ "lunch",
11
+ "snack",
12
+ ] as const;
13
+ export const MealTypeSchema = z.enum(MEAL_TYPE_VALUES);
14
+ export type MealType = (typeof MEAL_TYPE_VALUES)[number];
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const MODERATION_STATUS_VALUES = [
4
+ "approved",
5
+ "pending",
6
+ "rejected",
7
+ ] as const;
8
+ export const ModerationStatusSchema = z.enum(MODERATION_STATUS_VALUES);
9
+ export type ModerationStatus = (typeof MODERATION_STATUS_VALUES)[number];
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const PRIORITY_VALUES = ["low", "medium", "high"] as const;
4
+ export const PrioritySchema = z.enum(PRIORITY_VALUES);
5
+ export type Priority = (typeof PRIORITY_VALUES)[number];
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const PROFILE_STATUS_VALUES = [
4
+ "active",
5
+ "deleted",
6
+ "pending",
7
+ "suspended",
8
+ ] as const;
9
+ export const ProfileStatusSchema = z.enum(PROFILE_STATUS_VALUES);
10
+ export type ProfileStatus = (typeof PROFILE_STATUS_VALUES)[number];
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const RECIPE_SOURCE_VALUES = ["image", "text", "url", "video"] as const;
4
+ export const RecipeSourceSchema = z.enum(RECIPE_SOURCE_VALUES);
5
+ export type RecipeSource = (typeof RECIPE_SOURCE_VALUES)[number];
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const RECIPE_STATUS_VALUES = [
4
+ "active",
5
+ "archived",
6
+ "deleted",
7
+ "pending",
8
+ ] as const;
9
+ export const RecipeStatusSchema = z.enum(RECIPE_STATUS_VALUES);
10
+ export type RecipeStatus = (typeof RECIPE_STATUS_VALUES)[number];
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ export const ROLE_VALUES = [
4
+ "admin",
5
+ "moderator",
6
+ "translator",
7
+ "user",
8
+ "guest",
9
+ ] as const;
10
+ export const RoleSchema = z.enum(ROLE_VALUES);
11
+ export type Role = (typeof ROLE_VALUES)[number];
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const SEVERITY_VALUES = ["low", "medium", "high"] as const;
4
+ export const SeveritySchema = z.enum(SEVERITY_VALUES);
5
+ export type Severity = (typeof SEVERITY_VALUES)[number];
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const SPICINESS_VALUES = ["none", "mild", "medium", "hot"] as const;
4
+ export const SpicinessSchema = z.enum(SPICINESS_VALUES);
5
+ export type Spiciness = (typeof SPICINESS_VALUES)[number];
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ export const STATUS_VALUES = [
4
+ "active",
5
+ "archived",
6
+ "cancelled",
7
+ "deleted",
8
+ "pending",
9
+ ] as const;
10
+ export const StatusSchema = z.enum(STATUS_VALUES);
11
+ export type Status = (typeof STATUS_VALUES)[number];
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+
3
+ export const SubscriptionTierSchema = z.enum(["family", "free", "pro"]);
4
+ export type SubscriptionTier = z.infer<typeof SubscriptionTierSchema>;
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ export const SUGGESTION_CATEGORY_VALUES = [
4
+ "missing_info",
5
+ "unclear_instruction",
6
+ "image_quality",
7
+ "nutrition",
8
+ "safety",
9
+ ] as const;
10
+ export const SuggestionCategorySchema = z.enum(SUGGESTION_CATEGORY_VALUES);
11
+ export type SuggestionCategory = z.infer<typeof SuggestionCategorySchema>;
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const TEMPERATURE_UNIT_VALUES = ["celsius", "fahrenheit"] as const;
4
+ export const TemperatureUnitSchema = z.enum(TEMPERATURE_UNIT_VALUES);
5
+ export type TemperatureUnit = (typeof TEMPERATURE_UNIT_VALUES)[number];
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+
3
+ export const UNIT_VALUES = [
4
+ // Volume (metric)
5
+ "ml",
6
+ "l",
7
+ // Volume (imperial)
8
+ "tsp",
9
+ "tbsp",
10
+ "fl_oz",
11
+ "cup",
12
+ "pint",
13
+ "quart",
14
+ "gallon",
15
+ // Weight (metric)
16
+ "mg",
17
+ "g",
18
+ "kg",
19
+ // Weight (imperial)
20
+ "oz",
21
+ "lb",
22
+ // Count/portion
23
+ "piece",
24
+ "whole",
25
+ "half",
26
+ "quarter",
27
+ "slice",
28
+ "serving",
29
+ // Produce-specific
30
+ "clove",
31
+ "stalk",
32
+ "sprig",
33
+ "leaf",
34
+ "bunch",
35
+ "head",
36
+ "fillet",
37
+ "stick",
38
+ "sheet",
39
+ // Container
40
+ "can",
41
+ "package",
42
+ "bottle",
43
+ "jar",
44
+ // Imprecise
45
+ "handful",
46
+ "pinch",
47
+ "dash",
48
+ "drop",
49
+ ] as const;
50
+ export const UnitSchema = z.enum(UNIT_VALUES);
51
+ export type Unit = (typeof UNIT_VALUES)[number];
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+
3
+ export const URL_TYPE_VALUES = [
4
+ "facebook",
5
+ "instagram",
6
+ "pdf",
7
+ "pinterest",
8
+ "tiktok",
9
+ "website",
10
+ "youtube",
11
+ ] as const;
12
+ export const UrlTypeSchema = z.enum(URL_TYPE_VALUES);
13
+ export type UrlType = z.infer<typeof UrlTypeSchema>;
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const USER_STATUS_VALUES = [
4
+ "active",
5
+ "deleted",
6
+ "pending",
7
+ "suspended",
8
+ ] as const;
9
+ export const UserStatusSchema = z.enum(USER_STATUS_VALUES);
10
+ export type UserStatus = (typeof USER_STATUS_VALUES)[number];
package/src/index.ts CHANGED
@@ -0,0 +1,4 @@
1
+ export * from "./config";
2
+ export * from "./enums";
3
+ export * from "./lib";
4
+ export * from "./types";
File without changes
@@ -0,0 +1,26 @@
1
+ /**
2
+ * AI model configuration, costs are in USD:
3
+ * - multimodal: cost per 1,000,000 input/output tokens
4
+ * - image: cost per image
5
+ * - embedding: cost per 1,000 input tokens
6
+ */
7
+ export type AIModel =
8
+ | "Gemini25Flash"
9
+ | "Gemini25Pro"
10
+ | "Imagen4Fast"
11
+ | "TextEmbedding005";
12
+ export type AIModelType = "multimodal" | "image" | "embedding";
13
+
14
+ export interface AIModelCost {
15
+ input: number;
16
+ output: number;
17
+ }
18
+
19
+ export interface AIModelConfig {
20
+ id: string;
21
+ name: string;
22
+ type: AIModelType;
23
+ cost: AIModelCost;
24
+ }
25
+
26
+ export type AIConfig = Record<AIModel, AIModelConfig>;
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ import {
3
+ CuisineSchema,
4
+ DietaryTagSchema,
5
+ DifficultySchema,
6
+ MealTypeSchema,
7
+ SpicinessSchema,
8
+ } from "../../enums";
9
+
10
+ export const RecipeFiltersSchema = z.object({
11
+ cuisines: z.array(CuisineSchema).optional(),
12
+ dietaryTags: z.array(DietaryTagSchema).optional(),
13
+ difficulty: DifficultySchema.optional(),
14
+ excludeIngredients: z.array(z.string()).optional(),
15
+ includeIngredients: z.array(z.string()).optional(),
16
+ mealTypes: z.array(MealTypeSchema).optional(),
17
+ spiciness: SpicinessSchema.optional(),
18
+ timeLimit: z.number().int().min(5).max(180).optional(),
19
+ });
20
+ export type RecipeFilters = z.infer<typeof RecipeFiltersSchema>;
@@ -0,0 +1,4 @@
1
+ export * from "./config";
2
+ export * from "./filters";
3
+ export * from "./recipe";
4
+ export * from "./translation";
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ import {
3
+ AllergenSchema,
4
+ CuisineSchema,
5
+ DietaryTagSchema,
6
+ DifficultySchema,
7
+ MealTypeSchema,
8
+ SpicinessSchema,
9
+ } from "../../enums";
10
+ import { EquipmentSchema } from "../equipment";
11
+ import { IngredientSectionSchema } from "../ingredient";
12
+ import { InstructionSchema } from "../instruction";
13
+ import { NutritionSchema } from "../nutrition";
14
+
15
+ export const AIRecipeSchema = z.object({
16
+ allergens: z.array(AllergenSchema),
17
+ confidence: z.number().min(0).max(1),
18
+ cuisine: CuisineSchema,
19
+ description: z.string().min(10).max(2000),
20
+ dietaryTags: z.array(DietaryTagSchema),
21
+ difficulty: DifficultySchema,
22
+ equipment: z.array(EquipmentSchema).max(20).optional(),
23
+ ingredientSections: z.array(IngredientSectionSchema).min(1).max(10),
24
+ instructions: z.array(InstructionSchema).min(1).max(50),
25
+ mealTypes: z.array(MealTypeSchema).min(1),
26
+ nutrition: NutritionSchema.optional(),
27
+ servings: z.number().int().min(1).max(100),
28
+ spiciness: SpicinessSchema,
29
+ time: z.number().int().min(1).max(1440),
30
+ tips: z.array(z.string().max(500)).max(10).optional(),
31
+ title: z.string().min(3).max(200),
32
+ });
33
+ export type AIRecipe = z.infer<typeof AIRecipeSchema>;
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ import { EquipmentContentSchema } from "../equipment";
3
+ import { IngredientSectionContentSchema } from "../ingredient";
4
+ import { InstructionContentSchema } from "../instruction";
5
+
6
+ export const AIRecipeTranslationSchema = z.object({
7
+ description: z.string().min(10).max(2000),
8
+ equipment: z.array(EquipmentContentSchema).optional(),
9
+ ingredientSections: z.array(IngredientSectionContentSchema).min(1),
10
+ instructions: z.array(InstructionContentSchema).min(1),
11
+ tips: z.array(z.string().max(500)).optional(),
12
+ title: z.string().min(3).max(200),
13
+ });
14
+ export type AIRecipeTranslation = z.infer<typeof AIRecipeTranslationSchema>;
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import { SlugRegex } from "../config";
3
+
4
+ export const EquipmentMetaSchema = z.object({
5
+ optional: z.boolean().optional(),
6
+ slug: z.string().regex(SlugRegex),
7
+ });
8
+ export type EquipmentMeta = z.infer<typeof EquipmentMetaSchema>;
9
+
10
+ export const EquipmentContentSchema = z.object({
11
+ name: z.string().min(1).max(100),
12
+ notes: z.string().max(200).optional(),
13
+ slug: z.string().regex(SlugRegex),
14
+ });
15
+ export type EquipmentContent = z.infer<typeof EquipmentContentSchema>;
16
+
17
+ export const EquipmentSchema = z.object({
18
+ ...EquipmentMetaSchema.shape,
19
+ ...EquipmentContentSchema.shape,
20
+ });
21
+ export type Equipment = z.infer<typeof EquipmentSchema>;
@@ -0,0 +1,11 @@
1
+ export * from "./ai";
2
+ export * from "./equipment";
3
+ export * from "./ingredient";
4
+ export * from "./instruction";
5
+ export * from "./moderation";
6
+ export * from "./nutrition";
7
+ export * from "./profile";
8
+ export * from "./recipe";
9
+ export * from "./subscription";
10
+ export * from "./temperature";
11
+ export * from "./user";
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ import { SlugRegex } from "../config";
3
+ import { UnitSchema } from "../enums";
4
+
5
+ export const IngredientMetaSchema = z.object({
6
+ optional: z.boolean().optional(),
7
+ quantity: z.number().positive().optional(),
8
+ slug: z.string().regex(SlugRegex),
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(SlugRegex),
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(SlugRegex),
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(SlugRegex),
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(SlugRegex),
44
+ title: z.string().max(100).optional(),
45
+ });
46
+ export type IngredientSection = z.infer<typeof IngredientSectionSchema>;
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
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>;
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ import { Timestamp } from "firebase-admin/firestore";
3
+ import {
4
+ ModerationStatusSchema,
5
+ PrioritySchema,
6
+ SeveritySchema,
7
+ SuggestionCategorySchema,
8
+ } from "../enums";
9
+
10
+ export const ModerationSuggestionSchema = z.object({
11
+ category: SuggestionCategorySchema,
12
+ field: z.string(),
13
+ severity: SeveritySchema,
14
+ suggestion: z.string(),
15
+ });
16
+ export type ModerationSuggestion = z.infer<typeof ModerationSuggestionSchema>;
17
+
18
+ export const ModerationSchema = z.object({
19
+ id: z.string(),
20
+ recipeId: z.string(),
21
+ userId: z.string(),
22
+ status: ModerationStatusSchema,
23
+ priority: PrioritySchema,
24
+ qualityScore: z.number().min(0).max(1).optional(),
25
+ aiSuggestions: z.array(ModerationSuggestionSchema).optional(),
26
+ rejectionReason: z.string().optional(),
27
+ createdAt: z.custom<Timestamp>(),
28
+ assessedAt: z.custom<Timestamp>().optional(),
29
+ reviewedBy: z.string().optional(),
30
+ reviewedAt: z.custom<Timestamp>().optional(),
31
+ });
32
+ export type Moderation = z.infer<typeof ModerationSchema>;
33
+
34
+ export const ModerateRecipeInputSchema = z.object({
35
+ moderationId: z.string(),
36
+ recipeId: z.string(),
37
+ userId: z.string(),
38
+ });
39
+ export type ModerateRecipeInput = z.infer<typeof ModerateRecipeInputSchema>;
40
+
41
+ export const ModerateRecipeOutputSchema = z.object({
42
+ qualityScore: z.number().min(0).max(1),
43
+ suggestions: z.array(ModerationSuggestionSchema),
44
+ autoApproved: z.boolean(),
45
+ autoRejected: z.boolean(),
46
+ rejectionReason: z.string().optional(),
47
+ });
48
+ export type ModerateRecipeOutput = z.infer<typeof ModerateRecipeOutputSchema>;
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
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>;