@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.
- 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/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/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 +61 -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 +31 -31
- package/src/types/recipe/filters.ts +35 -35
- package/src/types/recipe/ingredient.ts +70 -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,87 +1,87 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
-
import { LocaleSchema, type Locale } from "../core";
|
|
4
|
-
import {
|
|
5
|
-
ModerationStatusSchema,
|
|
6
|
-
PrioritySchema,
|
|
7
|
-
SeveritySchema,
|
|
8
|
-
SuggestionCategorySchema,
|
|
9
|
-
type ModerationStatus,
|
|
10
|
-
type Priority,
|
|
11
|
-
type Severity,
|
|
12
|
-
type SuggestionCategory,
|
|
13
|
-
} from "./enums";
|
|
14
|
-
|
|
15
|
-
export interface ModerationSuggestion {
|
|
16
|
-
category: SuggestionCategory;
|
|
17
|
-
field: string;
|
|
18
|
-
severity: Severity;
|
|
19
|
-
suggestion: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const ModerationSuggestionSchema = z.object({
|
|
23
|
-
category: SuggestionCategorySchema,
|
|
24
|
-
field: z.string(),
|
|
25
|
-
severity: SeveritySchema,
|
|
26
|
-
suggestion: z.string(),
|
|
27
|
-
}) satisfies z.ZodType<ModerationSuggestion>;
|
|
28
|
-
|
|
29
|
-
export interface Moderation {
|
|
30
|
-
assessedAt?: Timestamp;
|
|
31
|
-
createdAt: Timestamp;
|
|
32
|
-
id: string;
|
|
33
|
-
originalLocale: Locale;
|
|
34
|
-
priority: Priority;
|
|
35
|
-
qualityScore?: number;
|
|
36
|
-
recipeId: string;
|
|
37
|
-
rejectionReason?: string;
|
|
38
|
-
reviewedAt?: Timestamp;
|
|
39
|
-
reviewedBy?: string;
|
|
40
|
-
status: ModerationStatus;
|
|
41
|
-
suggestions?: ModerationSuggestion[];
|
|
42
|
-
userId: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const ModerationSchema = z.object({
|
|
46
|
-
assessedAt: z.custom<Timestamp>().optional(),
|
|
47
|
-
createdAt: z.custom<Timestamp>(),
|
|
48
|
-
id: z.string(),
|
|
49
|
-
originalLocale: LocaleSchema,
|
|
50
|
-
priority: PrioritySchema,
|
|
51
|
-
qualityScore: z.number().min(0).max(1).optional(),
|
|
52
|
-
recipeId: z.string(),
|
|
53
|
-
rejectionReason: z.string().optional(),
|
|
54
|
-
reviewedAt: z.custom<Timestamp>().optional(),
|
|
55
|
-
reviewedBy: z.string().optional(),
|
|
56
|
-
status: ModerationStatusSchema,
|
|
57
|
-
suggestions: z.array(ModerationSuggestionSchema).optional(),
|
|
58
|
-
userId: z.string(),
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export interface ModerateRecipeInput {
|
|
62
|
-
moderationId: string;
|
|
63
|
-
recipeId: string;
|
|
64
|
-
userId: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export const ModerateRecipeInputSchema = z.object({
|
|
68
|
-
moderationId: z.string(),
|
|
69
|
-
recipeId: z.string(),
|
|
70
|
-
userId: z.string(),
|
|
71
|
-
}) satisfies z.ZodType<ModerateRecipeInput>;
|
|
72
|
-
|
|
73
|
-
export interface ModerateRecipeOutput {
|
|
74
|
-
autoApproved: boolean;
|
|
75
|
-
autoRejected: boolean;
|
|
76
|
-
qualityScore: number;
|
|
77
|
-
rejectionReason?: string;
|
|
78
|
-
suggestions: ModerationSuggestion[];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const ModerateRecipeOutputSchema = z.object({
|
|
82
|
-
autoApproved: z.boolean(),
|
|
83
|
-
autoRejected: z.boolean(),
|
|
84
|
-
qualityScore: z.number().min(0).max(1),
|
|
85
|
-
rejectionReason: z.string().optional(),
|
|
86
|
-
suggestions: z.array(ModerationSuggestionSchema),
|
|
87
|
-
}) satisfies z.ZodType<ModerateRecipeOutput>;
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
+
import { LocaleSchema, type Locale } from "../core";
|
|
4
|
+
import {
|
|
5
|
+
ModerationStatusSchema,
|
|
6
|
+
PrioritySchema,
|
|
7
|
+
SeveritySchema,
|
|
8
|
+
SuggestionCategorySchema,
|
|
9
|
+
type ModerationStatus,
|
|
10
|
+
type Priority,
|
|
11
|
+
type Severity,
|
|
12
|
+
type SuggestionCategory,
|
|
13
|
+
} from "./enums";
|
|
14
|
+
|
|
15
|
+
export interface ModerationSuggestion {
|
|
16
|
+
category: SuggestionCategory;
|
|
17
|
+
field: string;
|
|
18
|
+
severity: Severity;
|
|
19
|
+
suggestion: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const ModerationSuggestionSchema = z.object({
|
|
23
|
+
category: SuggestionCategorySchema,
|
|
24
|
+
field: z.string(),
|
|
25
|
+
severity: SeveritySchema,
|
|
26
|
+
suggestion: z.string(),
|
|
27
|
+
}) satisfies z.ZodType<ModerationSuggestion>;
|
|
28
|
+
|
|
29
|
+
export interface Moderation {
|
|
30
|
+
assessedAt?: Timestamp;
|
|
31
|
+
createdAt: Timestamp;
|
|
32
|
+
id: string;
|
|
33
|
+
originalLocale: Locale;
|
|
34
|
+
priority: Priority;
|
|
35
|
+
qualityScore?: number;
|
|
36
|
+
recipeId: string;
|
|
37
|
+
rejectionReason?: string;
|
|
38
|
+
reviewedAt?: Timestamp;
|
|
39
|
+
reviewedBy?: string;
|
|
40
|
+
status: ModerationStatus;
|
|
41
|
+
suggestions?: ModerationSuggestion[];
|
|
42
|
+
userId: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const ModerationSchema = z.object({
|
|
46
|
+
assessedAt: z.custom<Timestamp>().optional(),
|
|
47
|
+
createdAt: z.custom<Timestamp>(),
|
|
48
|
+
id: z.string(),
|
|
49
|
+
originalLocale: LocaleSchema,
|
|
50
|
+
priority: PrioritySchema,
|
|
51
|
+
qualityScore: z.number().min(0).max(1).optional(),
|
|
52
|
+
recipeId: z.string(),
|
|
53
|
+
rejectionReason: z.string().optional(),
|
|
54
|
+
reviewedAt: z.custom<Timestamp>().optional(),
|
|
55
|
+
reviewedBy: z.string().optional(),
|
|
56
|
+
status: ModerationStatusSchema,
|
|
57
|
+
suggestions: z.array(ModerationSuggestionSchema).optional(),
|
|
58
|
+
userId: z.string(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export interface ModerateRecipeInput {
|
|
62
|
+
moderationId: string;
|
|
63
|
+
recipeId: string;
|
|
64
|
+
userId: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const ModerateRecipeInputSchema = z.object({
|
|
68
|
+
moderationId: z.string(),
|
|
69
|
+
recipeId: z.string(),
|
|
70
|
+
userId: z.string(),
|
|
71
|
+
}) satisfies z.ZodType<ModerateRecipeInput>;
|
|
72
|
+
|
|
73
|
+
export interface ModerateRecipeOutput {
|
|
74
|
+
autoApproved: boolean;
|
|
75
|
+
autoRejected: boolean;
|
|
76
|
+
qualityScore: number;
|
|
77
|
+
rejectionReason?: string;
|
|
78
|
+
suggestions: ModerationSuggestion[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const ModerateRecipeOutputSchema = z.object({
|
|
82
|
+
autoApproved: z.boolean(),
|
|
83
|
+
autoRejected: z.boolean(),
|
|
84
|
+
qualityScore: z.number().min(0).max(1),
|
|
85
|
+
rejectionReason: z.string().optional(),
|
|
86
|
+
suggestions: z.array(ModerationSuggestionSchema),
|
|
87
|
+
}) satisfies z.ZodType<ModerateRecipeOutput>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
|
-
export const RECIPE_SOURCE_VALUES = ["image", "text", "url"] as const;
|
|
4
|
-
export const RecipeSourceSchema = z.enum(RECIPE_SOURCE_VALUES);
|
|
5
|
-
export type RecipeSource = (typeof RECIPE_SOURCE_VALUES)[number];
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
|
|
3
|
+
export const RECIPE_SOURCE_VALUES = ["image", "text", "url"] as const;
|
|
4
|
+
export const RecipeSourceSchema = z.enum(RECIPE_SOURCE_VALUES);
|
|
5
|
+
export type RecipeSource = (typeof RECIPE_SOURCE_VALUES)[number];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
|
-
export const RECIPE_STATUS_VALUES = [
|
|
4
|
-
"active",
|
|
5
|
-
"archived",
|
|
6
|
-
"deleted",
|
|
7
|
-
"flagged",
|
|
8
|
-
"pending",
|
|
9
|
-
"rejected",
|
|
10
|
-
] as const;
|
|
11
|
-
export const RecipeStatusSchema = z.enum(RECIPE_STATUS_VALUES);
|
|
12
|
-
export type RecipeStatus = (typeof RECIPE_STATUS_VALUES)[number];
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
|
|
3
|
+
export const RECIPE_STATUS_VALUES = [
|
|
4
|
+
"active",
|
|
5
|
+
"archived",
|
|
6
|
+
"deleted",
|
|
7
|
+
"flagged",
|
|
8
|
+
"pending",
|
|
9
|
+
"rejected",
|
|
10
|
+
] as const;
|
|
11
|
+
export const RecipeStatusSchema = z.enum(RECIPE_STATUS_VALUES);
|
|
12
|
+
export type RecipeStatus = (typeof RECIPE_STATUS_VALUES)[number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
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];
|
|
1
|
+
import { z } from "genkit";
|
|
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];
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
import { SLUG_REGEX } from "../../config";
|
|
3
|
-
|
|
4
|
-
export interface EquipmentMeta {
|
|
5
|
-
required?: boolean;
|
|
6
|
-
slug: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const EquipmentMetaSchema = z.object({
|
|
10
|
-
required: z.boolean().optional(),
|
|
11
|
-
slug: z.string().regex(SLUG_REGEX),
|
|
12
|
-
}) satisfies z.ZodType<EquipmentMeta>;
|
|
13
|
-
|
|
14
|
-
export interface EquipmentContent {
|
|
15
|
-
name: string;
|
|
16
|
-
notes?: string;
|
|
17
|
-
slug: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const EquipmentContentSchema = z.object({
|
|
21
|
-
name: z.string().min(1).max(100),
|
|
22
|
-
notes: z.string().max(200).optional(),
|
|
23
|
-
slug: z.string().regex(SLUG_REGEX),
|
|
24
|
-
}) satisfies z.ZodType<EquipmentContent>;
|
|
25
|
-
|
|
26
|
-
export interface Equipment extends EquipmentMeta, EquipmentContent {}
|
|
27
|
-
|
|
28
|
-
export const EquipmentSchema = z.object({
|
|
29
|
-
...EquipmentMetaSchema.shape,
|
|
30
|
-
...EquipmentContentSchema.shape,
|
|
31
|
-
}) satisfies z.ZodType<Equipment>;
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import { SLUG_REGEX } from "../../config";
|
|
3
|
+
|
|
4
|
+
export interface EquipmentMeta {
|
|
5
|
+
required?: boolean;
|
|
6
|
+
slug: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const EquipmentMetaSchema = z.object({
|
|
10
|
+
required: z.boolean().optional(),
|
|
11
|
+
slug: z.string().regex(SLUG_REGEX),
|
|
12
|
+
}) satisfies z.ZodType<EquipmentMeta>;
|
|
13
|
+
|
|
14
|
+
export interface EquipmentContent {
|
|
15
|
+
name: string;
|
|
16
|
+
notes?: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const EquipmentContentSchema = z.object({
|
|
21
|
+
name: z.string().min(1).max(100),
|
|
22
|
+
notes: z.string().max(200).optional(),
|
|
23
|
+
slug: z.string().regex(SLUG_REGEX),
|
|
24
|
+
}) satisfies z.ZodType<EquipmentContent>;
|
|
25
|
+
|
|
26
|
+
export interface Equipment extends EquipmentMeta, EquipmentContent {}
|
|
27
|
+
|
|
28
|
+
export const EquipmentSchema = z.object({
|
|
29
|
+
...EquipmentMetaSchema.shape,
|
|
30
|
+
...EquipmentContentSchema.shape,
|
|
31
|
+
}) satisfies z.ZodType<Equipment>;
|