@cravery/core 0.0.21 → 0.0.22

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 (63) hide show
  1. package/dist/lib/ai/embedding.d.ts +1 -1
  2. package/dist/lib/ai/embedding.d.ts.map +1 -1
  3. package/dist/lib/ai/embedding.js +12 -9
  4. package/dist/lib/ai/embedding.js.map +1 -1
  5. package/dist/lib/ai/genkit.d.ts +3 -3
  6. package/dist/lib/ai/genkit.d.ts.map +1 -1
  7. package/dist/lib/ai/genkit.js +12 -8
  8. package/dist/lib/ai/genkit.js.map +1 -1
  9. package/dist/types/core/settings.d.ts.map +1 -1
  10. package/dist/types/core/settings.js.map +1 -1
  11. package/dist/types/iam/user.d.ts.map +1 -1
  12. package/dist/types/iam/user.js.map +1 -1
  13. package/package.json +56 -56
  14. package/src/lib/ai/embedding.ts +15 -9
  15. package/src/lib/ai/flow.ts +89 -89
  16. package/src/lib/ai/genkit.ts +18 -12
  17. package/src/lib/api.ts +103 -103
  18. package/src/lib/utils/sanitize.ts +38 -38
  19. package/src/types/ai/recipe.ts +61 -61
  20. package/src/types/ai/translation.ts +27 -27
  21. package/src/types/core/asset.ts +17 -17
  22. package/src/types/core/enums/image_type.ts +5 -5
  23. package/src/types/core/enums/locale.ts +5 -5
  24. package/src/types/core/enums/measurement_system.ts +5 -5
  25. package/src/types/core/enums/theme.ts +5 -5
  26. package/src/types/core/enums/url_type.ts +13 -13
  27. package/src/types/core/settings.ts +68 -61
  28. package/src/types/iam/enums/profile_status.ts +10 -10
  29. package/src/types/iam/enums/subscription_role.ts +5 -5
  30. package/src/types/iam/enums/subscription_status.ts +10 -10
  31. package/src/types/iam/enums/subscription_tier.ts +4 -4
  32. package/src/types/iam/enums/user_role.ts +11 -11
  33. package/src/types/iam/enums/user_status.ts +10 -10
  34. package/src/types/iam/profile.ts +45 -45
  35. package/src/types/iam/subscription.ts +45 -45
  36. package/src/types/iam/user.ts +36 -31
  37. package/src/types/moderation/enums/moderation_status.ts +9 -9
  38. package/src/types/moderation/enums/priority.ts +5 -5
  39. package/src/types/moderation/enums/severity.ts +5 -5
  40. package/src/types/moderation/enums/suggestion_category.ts +11 -11
  41. package/src/types/moderation/moderation.ts +87 -87
  42. package/src/types/recipe/enums/allergen.ts +19 -19
  43. package/src/types/recipe/enums/cuisine.ts +39 -39
  44. package/src/types/recipe/enums/dietary_tag.ts +21 -21
  45. package/src/types/recipe/enums/difficulty.ts +10 -10
  46. package/src/types/recipe/enums/meal_type.ts +14 -14
  47. package/src/types/recipe/enums/recipe_source.ts +5 -5
  48. package/src/types/recipe/enums/recipe_status.ts +12 -12
  49. package/src/types/recipe/enums/spiciness.ts +5 -5
  50. package/src/types/recipe/enums/temperature_unit.ts +5 -5
  51. package/src/types/recipe/enums/unit.ts +51 -51
  52. package/src/types/recipe/equipment.ts +31 -31
  53. package/src/types/recipe/filters.ts +35 -35
  54. package/src/types/recipe/ingredient.ts +70 -70
  55. package/src/types/recipe/instruction.ts +31 -31
  56. package/src/types/recipe/nutrition.ts +29 -29
  57. package/src/types/recipe/recipe.ts +198 -198
  58. package/src/types/recipe/temperature.ts +12 -12
  59. package/src/types/report/enums/report_priority.ts +10 -10
  60. package/src/types/report/enums/report_status.ts +10 -10
  61. package/src/types/report/enums/report_target_type.ts +10 -10
  62. package/src/types/report/enums/report_type.ts +12 -12
  63. package/src/types/report/report.ts +68 -68
@@ -1,35 +1,35 @@
1
- import { z } from "genkit";
2
- import {
3
- CuisineSchema,
4
- DietaryTagSchema,
5
- DifficultySchema,
6
- MealTypeSchema,
7
- SpicinessSchema,
8
- type Cuisine,
9
- type DietaryTag,
10
- type Difficulty,
11
- type MealType,
12
- type Spiciness,
13
- } from "./enums";
14
-
15
- export interface RecipeFilters {
16
- cuisines?: Cuisine[];
17
- dietaryTags?: DietaryTag[];
18
- difficulty?: Difficulty;
19
- excludeIngredients?: string[];
20
- includeIngredients?: string[];
21
- mealTypes?: MealType[];
22
- spiciness?: Spiciness;
23
- timeLimit?: number;
24
- }
25
-
26
- export const RecipeFiltersSchema = z.object({
27
- cuisines: z.array(CuisineSchema).optional(),
28
- dietaryTags: z.array(DietaryTagSchema).optional(),
29
- difficulty: DifficultySchema.optional(),
30
- excludeIngredients: z.array(z.string()).optional(),
31
- includeIngredients: z.array(z.string()).optional(),
32
- mealTypes: z.array(MealTypeSchema).optional(),
33
- spiciness: SpicinessSchema.optional(),
34
- timeLimit: z.number().int().min(5).max(300).optional(),
35
- }) satisfies z.ZodType<RecipeFilters>;
1
+ import { z } from "genkit";
2
+ import {
3
+ CuisineSchema,
4
+ DietaryTagSchema,
5
+ DifficultySchema,
6
+ MealTypeSchema,
7
+ SpicinessSchema,
8
+ type Cuisine,
9
+ type DietaryTag,
10
+ type Difficulty,
11
+ type MealType,
12
+ type Spiciness,
13
+ } from "./enums";
14
+
15
+ export interface RecipeFilters {
16
+ cuisines?: Cuisine[];
17
+ dietaryTags?: DietaryTag[];
18
+ difficulty?: Difficulty;
19
+ excludeIngredients?: string[];
20
+ includeIngredients?: string[];
21
+ mealTypes?: MealType[];
22
+ spiciness?: Spiciness;
23
+ timeLimit?: number;
24
+ }
25
+
26
+ export const RecipeFiltersSchema = z.object({
27
+ cuisines: z.array(CuisineSchema).optional(),
28
+ dietaryTags: z.array(DietaryTagSchema).optional(),
29
+ difficulty: DifficultySchema.optional(),
30
+ excludeIngredients: z.array(z.string()).optional(),
31
+ includeIngredients: z.array(z.string()).optional(),
32
+ mealTypes: z.array(MealTypeSchema).optional(),
33
+ spiciness: SpicinessSchema.optional(),
34
+ timeLimit: z.number().int().min(5).max(300).optional(),
35
+ }) satisfies z.ZodType<RecipeFilters>;
@@ -1,70 +1,70 @@
1
- import { z } from "genkit";
2
- import { SLUG_REGEX } from "../../config";
3
- import { UnitSchema, type Unit } from "./enums";
4
-
5
- export interface IngredientMeta {
6
- quantity?: number;
7
- required?: boolean;
8
- slug: string;
9
- unit?: Unit;
10
- }
11
-
12
- export const IngredientMetaSchema = z.object({
13
- quantity: z.number().positive().optional(),
14
- required: z.boolean().optional(),
15
- slug: z.string().regex(SLUG_REGEX),
16
- unit: UnitSchema.optional(),
17
- }) satisfies z.ZodType<IngredientMeta>;
18
-
19
- export interface IngredientContent {
20
- name: string;
21
- notes?: string;
22
- slug: string;
23
- }
24
-
25
- export const IngredientContentSchema = z.object({
26
- name: z.string().min(1).max(100),
27
- notes: z.string().max(200).optional(),
28
- slug: z.string().regex(SLUG_REGEX),
29
- }) satisfies z.ZodType<IngredientContent>;
30
-
31
- export interface Ingredient extends IngredientMeta, IngredientContent {}
32
-
33
- export const IngredientSchema = z.object({
34
- ...IngredientMetaSchema.shape,
35
- ...IngredientContentSchema.shape,
36
- }) satisfies z.ZodType<Ingredient>;
37
-
38
- export interface IngredientSectionMeta {
39
- ingredients: IngredientMeta[];
40
- slug: string;
41
- }
42
-
43
- export const IngredientSectionMetaSchema = z.object({
44
- ingredients: z.array(IngredientMetaSchema).min(1),
45
- slug: z.string().regex(SLUG_REGEX),
46
- }) satisfies z.ZodType<IngredientSectionMeta>;
47
-
48
- export interface IngredientSectionContent {
49
- ingredients: IngredientContent[];
50
- slug: string;
51
- title?: string;
52
- }
53
-
54
- export const IngredientSectionContentSchema = z.object({
55
- ingredients: z.array(IngredientContentSchema).min(1),
56
- slug: z.string().regex(SLUG_REGEX),
57
- title: z.string().max(100).optional(),
58
- }) satisfies z.ZodType<IngredientSectionContent>;
59
-
60
- export interface IngredientSection {
61
- ingredients: Ingredient[];
62
- slug: string;
63
- title?: string;
64
- }
65
-
66
- export const IngredientSectionSchema = z.object({
67
- ingredients: z.array(IngredientSchema).min(1),
68
- slug: z.string().regex(SLUG_REGEX),
69
- title: z.string().max(100).optional(),
70
- }) satisfies z.ZodType<IngredientSection>;
1
+ import { z } from "genkit";
2
+ import { SLUG_REGEX } from "../../config";
3
+ import { UnitSchema, type Unit } from "./enums";
4
+
5
+ export interface IngredientMeta {
6
+ quantity?: number;
7
+ required?: boolean;
8
+ slug: string;
9
+ unit?: Unit;
10
+ }
11
+
12
+ export const IngredientMetaSchema = z.object({
13
+ quantity: z.number().positive().optional(),
14
+ required: z.boolean().optional(),
15
+ slug: z.string().regex(SLUG_REGEX),
16
+ unit: UnitSchema.optional(),
17
+ }) satisfies z.ZodType<IngredientMeta>;
18
+
19
+ export interface IngredientContent {
20
+ name: string;
21
+ notes?: string;
22
+ slug: string;
23
+ }
24
+
25
+ export const IngredientContentSchema = z.object({
26
+ name: z.string().min(1).max(100),
27
+ notes: z.string().max(200).optional(),
28
+ slug: z.string().regex(SLUG_REGEX),
29
+ }) satisfies z.ZodType<IngredientContent>;
30
+
31
+ export interface Ingredient extends IngredientMeta, IngredientContent {}
32
+
33
+ export const IngredientSchema = z.object({
34
+ ...IngredientMetaSchema.shape,
35
+ ...IngredientContentSchema.shape,
36
+ }) satisfies z.ZodType<Ingredient>;
37
+
38
+ export interface IngredientSectionMeta {
39
+ ingredients: IngredientMeta[];
40
+ slug: string;
41
+ }
42
+
43
+ export const IngredientSectionMetaSchema = z.object({
44
+ ingredients: z.array(IngredientMetaSchema).min(1),
45
+ slug: z.string().regex(SLUG_REGEX),
46
+ }) satisfies z.ZodType<IngredientSectionMeta>;
47
+
48
+ export interface IngredientSectionContent {
49
+ ingredients: IngredientContent[];
50
+ slug: string;
51
+ title?: string;
52
+ }
53
+
54
+ export const IngredientSectionContentSchema = z.object({
55
+ ingredients: z.array(IngredientContentSchema).min(1),
56
+ slug: z.string().regex(SLUG_REGEX),
57
+ title: z.string().max(100).optional(),
58
+ }) satisfies z.ZodType<IngredientSectionContent>;
59
+
60
+ export interface IngredientSection {
61
+ ingredients: Ingredient[];
62
+ slug: string;
63
+ title?: string;
64
+ }
65
+
66
+ export const IngredientSectionSchema = z.object({
67
+ ingredients: z.array(IngredientSchema).min(1),
68
+ slug: z.string().regex(SLUG_REGEX),
69
+ title: z.string().max(100).optional(),
70
+ }) satisfies z.ZodType<IngredientSection>;
@@ -1,31 +1,31 @@
1
- import { z } from "genkit";
2
- import { TemperatureSchema, type Temperature } from "./temperature";
3
-
4
- export interface InstructionMeta {
5
- duration?: number;
6
- step: number;
7
- temperature?: Temperature;
8
- }
9
-
10
- export const InstructionMetaSchema = z.object({
11
- duration: z.number().int().positive().optional(),
12
- step: z.number().int().positive(),
13
- temperature: TemperatureSchema.optional(),
14
- }) satisfies z.ZodType<InstructionMeta>;
15
-
16
- export interface InstructionContent {
17
- step: number;
18
- text: string;
19
- }
20
-
21
- export const InstructionContentSchema = z.object({
22
- step: z.number().int().positive(),
23
- text: z.string().min(1).max(1000),
24
- }) satisfies z.ZodType<InstructionContent>;
25
-
26
- export interface Instruction extends InstructionMeta, InstructionContent {}
27
-
28
- export const InstructionSchema = z.object({
29
- ...InstructionMetaSchema.shape,
30
- ...InstructionContentSchema.shape,
31
- }) satisfies z.ZodType<Instruction>;
1
+ import { z } from "genkit";
2
+ import { TemperatureSchema, type Temperature } from "./temperature";
3
+
4
+ export interface InstructionMeta {
5
+ duration?: number;
6
+ step: number;
7
+ temperature?: Temperature;
8
+ }
9
+
10
+ export const InstructionMetaSchema = z.object({
11
+ duration: z.number().int().positive().optional(),
12
+ step: z.number().int().positive(),
13
+ temperature: TemperatureSchema.optional(),
14
+ }) satisfies z.ZodType<InstructionMeta>;
15
+
16
+ export interface InstructionContent {
17
+ step: number;
18
+ text: string;
19
+ }
20
+
21
+ export const InstructionContentSchema = z.object({
22
+ step: z.number().int().positive(),
23
+ text: z.string().min(1).max(1000),
24
+ }) satisfies z.ZodType<InstructionContent>;
25
+
26
+ export interface Instruction extends InstructionMeta, InstructionContent {}
27
+
28
+ export const InstructionSchema = z.object({
29
+ ...InstructionMetaSchema.shape,
30
+ ...InstructionContentSchema.shape,
31
+ }) satisfies z.ZodType<Instruction>;
@@ -1,29 +1,29 @@
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 interface Nutrition {
8
- calories: number;
9
- carbs?: number;
10
- cholesterol?: number;
11
- fat?: number;
12
- fiber?: number;
13
- protein?: number;
14
- saturatedFat?: number;
15
- sodium?: number;
16
- sugar?: number;
17
- }
18
-
19
- export const NutritionSchema = z.object({
20
- calories: z.number().nonnegative(),
21
- carbs: z.number().nonnegative().optional(),
22
- cholesterol: z.number().nonnegative().optional(),
23
- fat: z.number().nonnegative().optional(),
24
- fiber: z.number().nonnegative().optional(),
25
- protein: z.number().nonnegative().optional(),
26
- saturatedFat: z.number().nonnegative().optional(),
27
- sodium: z.number().nonnegative().optional(),
28
- sugar: z.number().nonnegative().optional(),
29
- }) satisfies z.ZodType<Nutrition>;
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 interface Nutrition {
8
+ calories: number;
9
+ carbs?: number;
10
+ cholesterol?: number;
11
+ fat?: number;
12
+ fiber?: number;
13
+ protein?: number;
14
+ saturatedFat?: number;
15
+ sodium?: number;
16
+ sugar?: number;
17
+ }
18
+
19
+ export const NutritionSchema = z.object({
20
+ calories: z.number().nonnegative(),
21
+ carbs: z.number().nonnegative().optional(),
22
+ cholesterol: z.number().nonnegative().optional(),
23
+ fat: z.number().nonnegative().optional(),
24
+ fiber: z.number().nonnegative().optional(),
25
+ protein: z.number().nonnegative().optional(),
26
+ saturatedFat: z.number().nonnegative().optional(),
27
+ sodium: z.number().nonnegative().optional(),
28
+ sugar: z.number().nonnegative().optional(),
29
+ }) satisfies z.ZodType<Nutrition>;