@cravery/core 0.0.24 → 0.0.26
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/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/ai/embedding.d.ts +2 -1
- package/dist/lib/ai/embedding.d.ts.map +1 -1
- package/dist/lib/ai/embedding.js +4 -17
- package/dist/lib/ai/embedding.js.map +1 -1
- package/dist/lib/ai/genkit.d.ts +1 -0
- package/dist/lib/ai/genkit.d.ts.map +1 -1
- package/dist/lib/ai/genkit.js +14 -1
- package/dist/lib/ai/genkit.js.map +1 -1
- package/dist/types/ai/recipe.d.ts +1 -244
- package/dist/types/ai/recipe.d.ts.map +1 -1
- package/dist/types/ai/recipe.js +0 -28
- package/dist/types/ai/recipe.js.map +1 -1
- package/dist/types/ai/translation.d.ts +1 -107
- package/dist/types/ai/translation.d.ts.map +1 -1
- package/dist/types/ai/translation.js +0 -11
- package/dist/types/ai/translation.js.map +1 -1
- package/dist/types/core/api.d.ts +4 -4
- package/dist/types/core/api.d.ts.map +1 -1
- package/dist/types/core/asset.d.ts +2 -22
- package/dist/types/core/asset.d.ts.map +1 -1
- package/dist/types/core/asset.js +0 -9
- package/dist/types/core/asset.js.map +1 -1
- package/dist/types/core/entity.d.ts +7 -0
- package/dist/types/core/entity.d.ts.map +1 -0
- package/dist/types/core/entity.js +3 -0
- package/dist/types/core/entity.js.map +1 -0
- package/dist/types/core/index.d.ts +5 -1
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/index.js +5 -1
- package/dist/types/core/index.js.map +1 -1
- package/dist/types/core/locale.d.ts +3 -0
- package/dist/types/core/locale.d.ts.map +1 -0
- package/dist/types/core/locale.js +5 -0
- package/dist/types/core/locale.js.map +1 -0
- package/dist/types/core/measurement_system.d.ts +3 -0
- package/dist/types/core/measurement_system.d.ts.map +1 -0
- package/dist/types/core/measurement_system.js +5 -0
- package/dist/types/core/measurement_system.js.map +1 -0
- package/dist/types/core/settings.d.ts +5 -88
- package/dist/types/core/settings.d.ts.map +1 -1
- package/dist/types/core/settings.js +0 -25
- package/dist/types/core/settings.js.map +1 -1
- package/dist/types/core/theme.d.ts +3 -0
- package/dist/types/core/theme.d.ts.map +1 -0
- package/dist/types/core/theme.js +5 -0
- package/dist/types/core/theme.js.map +1 -0
- package/dist/types/core/timestamp.d.ts +5 -0
- package/dist/types/core/timestamp.d.ts.map +1 -0
- package/dist/types/core/timestamp.js +3 -0
- package/dist/types/core/timestamp.js.map +1 -0
- package/dist/types/iam/index.d.ts +6 -1
- package/dist/types/iam/index.d.ts.map +1 -1
- package/dist/types/iam/index.js +6 -1
- package/dist/types/iam/index.js.map +1 -1
- package/dist/types/iam/profile.d.ts +2 -56
- package/dist/types/iam/profile.d.ts.map +1 -1
- package/dist/types/iam/profile.js +0 -22
- package/dist/types/iam/profile.js.map +1 -1
- package/dist/types/iam/profile_status.d.ts +3 -0
- package/dist/types/iam/profile_status.d.ts.map +1 -0
- package/dist/types/iam/profile_status.js +10 -0
- package/dist/types/iam/profile_status.js.map +1 -0
- package/dist/types/iam/subscription.d.ts +4 -80
- package/dist/types/iam/subscription.d.ts.map +1 -1
- package/dist/types/iam/subscription.js +0 -19
- package/dist/types/iam/subscription.js.map +1 -1
- package/dist/types/iam/subscription_role.d.ts +3 -0
- package/dist/types/iam/subscription_role.d.ts.map +1 -0
- package/dist/types/iam/subscription_role.js +5 -0
- package/dist/types/iam/subscription_role.js.map +1 -0
- package/dist/types/iam/subscription_status.d.ts +3 -0
- package/dist/types/iam/subscription_status.d.ts.map +1 -0
- package/dist/types/iam/subscription_status.js +10 -0
- package/dist/types/iam/subscription_status.js.map +1 -0
- package/dist/types/iam/subscription_tier.d.ts +3 -0
- package/dist/types/iam/subscription_tier.d.ts.map +1 -0
- package/dist/types/iam/subscription_tier.js +5 -0
- package/dist/types/iam/subscription_tier.js.map +1 -0
- package/dist/types/iam/user.d.ts +3 -42
- package/dist/types/iam/user.d.ts.map +1 -1
- package/dist/types/iam/user.js +0 -16
- package/dist/types/iam/user.js.map +1 -1
- package/dist/types/iam/user_role.d.ts +5 -0
- package/dist/types/iam/user_role.d.ts.map +1 -0
- package/dist/types/iam/user_role.js +16 -0
- package/dist/types/iam/user_role.js.map +1 -0
- package/dist/types/iam/user_status.d.ts +3 -0
- package/dist/types/iam/user_status.d.ts.map +1 -0
- package/dist/types/iam/user_status.js +10 -0
- package/dist/types/iam/user_status.js.map +1 -0
- package/dist/types/moderation/index.d.ts +4 -1
- package/dist/types/moderation/index.d.ts.map +1 -1
- package/dist/types/moderation/index.js +4 -1
- package/dist/types/moderation/index.js.map +1 -1
- package/dist/types/moderation/moderation.d.ts +5 -137
- package/dist/types/moderation/moderation.d.ts.map +1 -1
- package/dist/types/moderation/moderation.js +0 -37
- package/dist/types/moderation/moderation.js.map +1 -1
- package/dist/types/moderation/moderation_status.d.ts +3 -0
- package/dist/types/moderation/moderation_status.d.ts.map +1 -0
- package/dist/types/moderation/moderation_status.js +9 -0
- package/dist/types/moderation/moderation_status.js.map +1 -0
- package/dist/types/moderation/priority.d.ts +3 -0
- package/dist/types/moderation/priority.d.ts.map +1 -0
- package/dist/types/moderation/priority.js +5 -0
- package/dist/types/moderation/priority.js.map +1 -0
- package/dist/types/moderation/severity.d.ts +3 -0
- package/dist/types/moderation/severity.d.ts.map +1 -0
- package/dist/types/moderation/severity.js +5 -0
- package/dist/types/moderation/severity.js.map +1 -0
- package/dist/types/moderation/suggestion_category.d.ts +3 -0
- package/dist/types/moderation/suggestion_category.d.ts.map +1 -0
- package/dist/types/moderation/suggestion_category.js +11 -0
- package/dist/types/moderation/suggestion_category.js.map +1 -0
- package/dist/types/recipe/allergen.d.ts +3 -0
- package/dist/types/recipe/allergen.d.ts.map +1 -0
- package/dist/types/recipe/allergen.js +19 -0
- package/dist/types/recipe/allergen.js.map +1 -0
- package/dist/types/recipe/cuisine.d.ts +3 -0
- package/dist/types/recipe/cuisine.d.ts.map +1 -0
- package/dist/types/recipe/cuisine.js +39 -0
- package/dist/types/recipe/cuisine.js.map +1 -0
- package/dist/types/recipe/dietary_tag.d.ts +3 -0
- package/dist/types/recipe/dietary_tag.d.ts.map +1 -0
- package/dist/types/recipe/dietary_tag.js +21 -0
- package/dist/types/recipe/dietary_tag.js.map +1 -0
- package/dist/types/recipe/difficulty.d.ts +3 -0
- package/dist/types/recipe/difficulty.d.ts.map +1 -0
- package/dist/types/recipe/difficulty.js +10 -0
- package/dist/types/recipe/difficulty.js.map +1 -0
- package/dist/types/recipe/equipment.d.ts +0 -40
- package/dist/types/recipe/equipment.d.ts.map +1 -1
- package/dist/types/recipe/equipment.js +0 -12
- package/dist/types/recipe/equipment.js.map +1 -1
- package/dist/types/recipe/filters.d.ts +5 -30
- package/dist/types/recipe/filters.d.ts.map +1 -1
- package/dist/types/recipe/filters.js +0 -13
- package/dist/types/recipe/filters.js.map +1 -1
- package/dist/types/recipe/index.d.ts +10 -1
- package/dist/types/recipe/index.d.ts.map +1 -1
- package/dist/types/recipe/index.js +10 -1
- package/dist/types/recipe/index.js.map +1 -1
- package/dist/types/recipe/ingredient.d.ts +1 -169
- package/dist/types/recipe/ingredient.d.ts.map +1 -1
- package/dist/types/recipe/ingredient.js +0 -29
- package/dist/types/recipe/ingredient.js.map +1 -1
- package/dist/types/recipe/instruction.d.ts +2 -72
- package/dist/types/recipe/instruction.d.ts.map +1 -1
- package/dist/types/recipe/instruction.js +0 -13
- package/dist/types/recipe/instruction.js.map +1 -1
- package/dist/types/recipe/meal_type.d.ts +3 -0
- package/dist/types/recipe/meal_type.d.ts.map +1 -0
- package/dist/types/recipe/meal_type.js +14 -0
- package/dist/types/recipe/meal_type.js.map +1 -0
- package/dist/types/recipe/nutrition.d.ts +0 -36
- package/dist/types/recipe/nutrition.d.ts.map +1 -1
- package/dist/types/recipe/nutrition.js +0 -13
- package/dist/types/recipe/nutrition.js.map +1 -1
- package/dist/types/recipe/recipe.d.ts +14 -525
- package/dist/types/recipe/recipe.d.ts.map +1 -1
- package/dist/types/recipe/recipe.js +0 -80
- package/dist/types/recipe/recipe.js.map +1 -1
- package/dist/types/recipe/recipe_source.d.ts +3 -0
- package/dist/types/recipe/recipe_source.d.ts.map +1 -0
- package/dist/types/recipe/recipe_source.js +5 -0
- package/dist/types/recipe/recipe_source.js.map +1 -0
- package/dist/types/recipe/recipe_status.d.ts +3 -0
- package/dist/types/recipe/recipe_status.d.ts.map +1 -0
- package/dist/types/recipe/recipe_status.js +12 -0
- package/dist/types/recipe/recipe_status.js.map +1 -0
- package/dist/types/recipe/spiciness.d.ts +3 -0
- package/dist/types/recipe/spiciness.d.ts.map +1 -0
- package/dist/types/recipe/spiciness.js +5 -0
- package/dist/types/recipe/spiciness.js.map +1 -0
- package/dist/types/recipe/temperature.d.ts +1 -12
- package/dist/types/recipe/temperature.d.ts.map +1 -1
- package/dist/types/recipe/temperature.js +0 -7
- package/dist/types/recipe/temperature.js.map +1 -1
- package/dist/types/recipe/temperature_unit.d.ts +3 -0
- package/dist/types/recipe/temperature_unit.d.ts.map +1 -0
- package/dist/types/recipe/temperature_unit.js +5 -0
- package/dist/types/recipe/temperature_unit.js.map +1 -0
- package/dist/types/recipe/unit.d.ts +3 -0
- package/dist/types/recipe/unit.d.ts.map +1 -0
- package/dist/types/recipe/unit.js +51 -0
- package/dist/types/recipe/unit.js.map +1 -0
- package/dist/types/report/index.d.ts +4 -1
- package/dist/types/report/index.d.ts.map +1 -1
- package/dist/types/report/index.js +4 -1
- package/dist/types/report/index.js.map +1 -1
- package/dist/types/report/report.d.ts +5 -94
- package/dist/types/report/report.d.ts.map +1 -1
- package/dist/types/report/report.js +0 -29
- package/dist/types/report/report.js.map +1 -1
- package/dist/types/report/report_priority.d.ts +3 -0
- package/dist/types/report/report_priority.d.ts.map +1 -0
- package/dist/types/report/report_priority.js +10 -0
- package/dist/types/report/report_priority.js.map +1 -0
- package/dist/types/report/report_status.d.ts +3 -0
- package/dist/types/report/report_status.d.ts.map +1 -0
- package/dist/types/report/report_status.js +10 -0
- package/dist/types/report/report_status.js.map +1 -0
- package/dist/types/report/report_target_type.d.ts +3 -0
- package/dist/types/report/report_target_type.d.ts.map +1 -0
- package/dist/types/report/report_target_type.js +10 -0
- package/dist/types/report/report_target_type.js.map +1 -0
- package/dist/types/report/report_type.d.ts +3 -0
- package/dist/types/report/report_type.d.ts.map +1 -0
- package/dist/types/report/report_type.js +12 -0
- package/dist/types/report/report_type.js.map +1 -0
- package/package.json +3 -14
- package/src/index.ts +0 -1
- package/src/types/ai/recipe.ts +10 -47
- package/src/types/ai/translation.ts +1 -18
- package/src/types/core/api.ts +4 -4
- package/src/types/core/asset.ts +2 -14
- package/src/types/core/entity.ts +7 -0
- package/src/types/core/index.ts +5 -1
- package/src/types/core/{enums/locale.ts → locale.ts} +0 -3
- package/src/types/core/{enums/measurement_system.ts → measurement_system.ts} +0 -3
- package/src/types/core/settings.ts +9 -43
- package/src/types/core/{enums/theme.ts → theme.ts} +0 -3
- package/src/types/core/timestamp.ts +4 -0
- package/src/types/iam/index.ts +6 -1
- package/src/types/iam/profile.ts +2 -24
- package/src/types/iam/{enums/profile_status.ts → profile_status.ts} +0 -3
- package/src/types/iam/subscription.ts +4 -28
- package/src/types/iam/{enums/subscription_role.ts → subscription_role.ts} +0 -3
- package/src/types/iam/{enums/subscription_status.ts → subscription_status.ts} +0 -3
- package/src/types/iam/subscription_tier.ts +2 -0
- package/src/types/iam/user.ts +3 -22
- package/src/types/iam/user_role.ts +15 -0
- package/src/types/iam/{enums/user_status.ts → user_status.ts} +0 -3
- package/src/types/moderation/index.ts +4 -1
- package/src/types/moderation/moderation.ts +5 -50
- package/src/types/moderation/{enums/moderation_status.ts → moderation_status.ts} +0 -3
- package/src/types/moderation/{enums/priority.ts → priority.ts} +0 -3
- package/src/types/moderation/{enums/severity.ts → severity.ts} +0 -3
- package/src/types/moderation/suggestion_category.ts +8 -0
- package/src/types/recipe/{enums/allergen.ts → allergen.ts} +0 -3
- package/src/types/recipe/{enums/cuisine.ts → cuisine.ts} +0 -3
- package/src/types/recipe/{enums/dietary_tag.ts → dietary_tag.ts} +0 -3
- package/src/types/recipe/{enums/difficulty.ts → difficulty.ts} +0 -3
- package/src/types/recipe/equipment.ts +0 -18
- package/src/types/recipe/filters.ts +5 -24
- package/src/types/recipe/index.ts +10 -1
- package/src/types/recipe/ingredient.ts +1 -37
- package/src/types/recipe/instruction.ts +2 -19
- package/src/types/recipe/{enums/meal_type.ts → meal_type.ts} +0 -3
- package/src/types/recipe/nutrition.ts +0 -18
- package/src/types/recipe/recipe.ts +18 -118
- package/src/types/recipe/{enums/recipe_source.ts → recipe_source.ts} +0 -3
- package/src/types/recipe/{enums/recipe_status.ts → recipe_status.ts} +0 -3
- package/src/types/recipe/{enums/spiciness.ts → spiciness.ts} +0 -3
- package/src/types/recipe/temperature.ts +1 -7
- package/src/types/recipe/{enums/temperature_unit.ts → temperature_unit.ts} +0 -3
- package/src/types/recipe/{enums/unit.ts → unit.ts} +0 -3
- package/src/types/report/index.ts +4 -1
- package/src/types/report/report.ts +5 -40
- package/src/types/report/{enums/report_priority.ts → report_priority.ts} +0 -3
- package/src/types/report/{enums/report_status.ts → report_status.ts} +0 -3
- package/src/types/report/{enums/report_target_type.ts → report_target_type.ts} +0 -3
- package/src/types/report/{enums/report_type.ts → report_type.ts} +0 -3
- package/src/lib/ai/cost.ts +0 -82
- package/src/lib/ai/embedding.ts +0 -64
- package/src/lib/ai/errors.ts +0 -43
- package/src/lib/ai/flow.ts +0 -134
- package/src/lib/ai/genkit.ts +0 -24
- package/src/lib/ai/image.ts +0 -27
- package/src/lib/ai/index.ts +0 -6
- package/src/lib/api.ts +0 -103
- package/src/lib/firebase.ts +0 -5
- package/src/lib/iam.ts +0 -37
- package/src/lib/index.ts +0 -7
- package/src/lib/storage.ts +0 -60
- package/src/lib/usage/index.ts +0 -1
- package/src/lib/usage/usage.service.ts +0 -192
- package/src/lib/utils/index.ts +0 -2
- package/src/lib/utils/sanitize.ts +0 -38
- package/src/lib/utils/slug.ts +0 -33
- package/src/types/core/enums/image_type.ts +0 -5
- package/src/types/core/enums/index.ts +0 -5
- package/src/types/core/enums/url_type.ts +0 -13
- package/src/types/iam/enums/index.ts +0 -6
- package/src/types/iam/enums/subscription_tier.ts +0 -4
- package/src/types/iam/enums/user_role.ts +0 -11
- package/src/types/moderation/enums/index.ts +0 -4
- package/src/types/moderation/enums/suggestion_category.ts +0 -11
- package/src/types/recipe/enums/index.ts +0 -10
- package/src/types/report/enums/index.ts +0 -4
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
EquipmentContentSchema,
|
|
4
|
-
IngredientSectionContentSchema,
|
|
5
|
-
InstructionContentSchema,
|
|
6
|
-
type EquipmentContent,
|
|
7
|
-
type IngredientSectionContent,
|
|
8
|
-
type InstructionContent,
|
|
9
|
-
} from "../recipe";
|
|
1
|
+
import { EquipmentContent, IngredientSectionContent, InstructionContent } from "../recipe";
|
|
10
2
|
|
|
11
3
|
export interface AIRecipeTranslation {
|
|
12
4
|
description: string;
|
|
@@ -16,12 +8,3 @@ export interface AIRecipeTranslation {
|
|
|
16
8
|
tips?: string[];
|
|
17
9
|
title: string;
|
|
18
10
|
}
|
|
19
|
-
|
|
20
|
-
export const AIRecipeTranslationSchema = z.object({
|
|
21
|
-
description: z.string().min(10).max(2000),
|
|
22
|
-
equipment: z.array(EquipmentContentSchema).optional(),
|
|
23
|
-
ingredientSections: z.array(IngredientSectionContentSchema).min(1),
|
|
24
|
-
instructions: z.array(InstructionContentSchema).min(1),
|
|
25
|
-
tips: z.array(z.string().max(500)).optional(),
|
|
26
|
-
title: z.string().min(3).max(200),
|
|
27
|
-
}) satisfies z.ZodType<AIRecipeTranslation>;
|
package/src/types/core/api.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface ApiSuccessResponse<T> {
|
|
2
2
|
success: true;
|
|
3
3
|
data: T;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export interface ApiErrorResponse {
|
|
7
7
|
success: false;
|
|
8
8
|
error: {
|
|
9
9
|
code: string;
|
|
10
10
|
message: string;
|
|
11
11
|
details?: unknown;
|
|
12
12
|
};
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
|
|
15
15
|
export type ApiResponse<T> = ApiSuccessResponse<T> | ApiErrorResponse;
|
|
16
16
|
|
package/src/types/core/asset.ts
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
-
import { SLUG_REGEX } from "../../config";
|
|
1
|
+
import { Entity } from "./entity";
|
|
4
2
|
|
|
5
|
-
export interface Asset {
|
|
6
|
-
createdAt: Timestamp;
|
|
7
|
-
id: string;
|
|
3
|
+
export interface Asset extends Entity {
|
|
8
4
|
imageUrl?: string;
|
|
9
|
-
updatedAt: Timestamp;
|
|
10
5
|
}
|
|
11
|
-
|
|
12
|
-
export const AssetSchema = z.object({
|
|
13
|
-
createdAt: z.custom<Timestamp>(),
|
|
14
|
-
id: z.string().regex(SLUG_REGEX),
|
|
15
|
-
imageUrl: z.string().optional(),
|
|
16
|
-
updatedAt: z.custom<Timestamp>(),
|
|
17
|
-
});
|
package/src/types/core/index.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from "./api";
|
|
2
2
|
export * from "./asset";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./entity";
|
|
4
4
|
export * from "./errors";
|
|
5
|
+
export * from "./locale";
|
|
6
|
+
export * from "./measurement_system";
|
|
5
7
|
export * from "./settings";
|
|
8
|
+
export * from "./theme";
|
|
9
|
+
export * from "./timestamp";
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
1
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type Theme,
|
|
10
|
-
} from "./enums";
|
|
11
|
-
import {
|
|
12
|
-
AllergenSchema,
|
|
13
|
-
CuisineSchema,
|
|
14
|
-
DietaryTagSchema,
|
|
15
|
-
SpicinessSchema,
|
|
16
|
-
TemperatureUnitSchema,
|
|
17
|
-
type Allergen,
|
|
18
|
-
type Cuisine,
|
|
19
|
-
type DietaryTag,
|
|
20
|
-
type Spiciness,
|
|
21
|
-
type TemperatureUnit,
|
|
2
|
+
Allergen,
|
|
3
|
+
Cuisine,
|
|
4
|
+
DietaryTag,
|
|
5
|
+
Spiciness,
|
|
6
|
+
TemperatureUnit,
|
|
22
7
|
} from "../recipe";
|
|
8
|
+
import { Locale } from "./locale";
|
|
9
|
+
import { MeasurementSystem } from "./measurement_system";
|
|
10
|
+
import { Theme } from "./theme";
|
|
11
|
+
import { Timestamp } from "./timestamp";
|
|
23
12
|
|
|
24
13
|
export interface NotificationSettings {
|
|
25
14
|
email: boolean;
|
|
@@ -28,13 +17,6 @@ export interface NotificationSettings {
|
|
|
28
17
|
weeklyDigest: boolean;
|
|
29
18
|
}
|
|
30
19
|
|
|
31
|
-
export const NotificationSettingsSchema = z.object({
|
|
32
|
-
email: z.boolean(),
|
|
33
|
-
push: z.boolean(),
|
|
34
|
-
marketing: z.boolean(),
|
|
35
|
-
weeklyDigest: z.boolean(),
|
|
36
|
-
}) satisfies z.ZodType<NotificationSettings>;
|
|
37
|
-
|
|
38
20
|
export interface Settings {
|
|
39
21
|
id: string;
|
|
40
22
|
allergens: Allergen[];
|
|
@@ -50,19 +32,3 @@ export interface Settings {
|
|
|
50
32
|
createdAt: Timestamp;
|
|
51
33
|
updatedAt: Timestamp;
|
|
52
34
|
}
|
|
53
|
-
|
|
54
|
-
export const SettingsSchema = z.object({
|
|
55
|
-
id: z.string(),
|
|
56
|
-
allergens: z.array(AllergenSchema),
|
|
57
|
-
dietaryTags: z.array(DietaryTagSchema),
|
|
58
|
-
cuisines: z.array(CuisineSchema),
|
|
59
|
-
spiciness: SpicinessSchema.optional(),
|
|
60
|
-
excludedIngredients: z.array(z.string()),
|
|
61
|
-
locale: LocaleSchema,
|
|
62
|
-
temperatureUnit: TemperatureUnitSchema,
|
|
63
|
-
measurementSystem: MeasurementSystemSchema,
|
|
64
|
-
theme: ThemeSchema,
|
|
65
|
-
notifications: NotificationSettingsSchema,
|
|
66
|
-
createdAt: z.custom<Timestamp>(),
|
|
67
|
-
updatedAt: z.custom<Timestamp>(),
|
|
68
|
-
});
|
package/src/types/iam/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./profile_status";
|
|
2
2
|
export * from "./profile";
|
|
3
|
+
export * from "./subscription_role";
|
|
4
|
+
export * from "./subscription_status";
|
|
5
|
+
export * from "./subscription_tier";
|
|
3
6
|
export * from "./subscription";
|
|
7
|
+
export * from "./user_role";
|
|
8
|
+
export * from "./user_status";
|
|
4
9
|
export * from "./user";
|
package/src/types/iam/profile.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { ProfileStatusSchema, type ProfileStatus } from "./enums";
|
|
1
|
+
import { Timestamp } from "../core";
|
|
2
|
+
import { ProfileStatus } from "./profile_status";
|
|
4
3
|
|
|
5
4
|
export interface Profile {
|
|
6
5
|
bio?: string;
|
|
@@ -14,18 +13,6 @@ export interface Profile {
|
|
|
14
13
|
verified: boolean;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
export const ProfileSchema = z.object({
|
|
18
|
-
bio: z.string().max(280).optional(),
|
|
19
|
-
createdAt: z.custom<Timestamp>(),
|
|
20
|
-
id: z.string(),
|
|
21
|
-
imageUrl: z.string().url().optional(),
|
|
22
|
-
name: z.string().min(1).max(50),
|
|
23
|
-
public: z.boolean(),
|
|
24
|
-
status: ProfileStatusSchema,
|
|
25
|
-
updatedAt: z.custom<Timestamp>(),
|
|
26
|
-
verified: z.boolean(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
16
|
export interface ProfileStats {
|
|
30
17
|
followers: number;
|
|
31
18
|
following: number;
|
|
@@ -34,12 +21,3 @@ export interface ProfileStats {
|
|
|
34
21
|
saves: number;
|
|
35
22
|
updatedAt: number;
|
|
36
23
|
}
|
|
37
|
-
|
|
38
|
-
export const ProfileStatsSchema = z.object({
|
|
39
|
-
followers: z.number().int().nonnegative(),
|
|
40
|
-
following: z.number().int().nonnegative(),
|
|
41
|
-
likes: z.number().int().nonnegative(),
|
|
42
|
-
recipes: z.number().int().nonnegative(),
|
|
43
|
-
saves: z.number().int().nonnegative(),
|
|
44
|
-
updatedAt: z.number().int(),
|
|
45
|
-
}) satisfies z.ZodType<ProfileStats>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const PROFILE_STATUS_VALUES = [
|
|
4
2
|
"active",
|
|
5
3
|
"deleted",
|
|
6
4
|
"pending",
|
|
7
5
|
"suspended",
|
|
8
6
|
] as const;
|
|
9
|
-
export const ProfileStatusSchema = z.enum(PROFILE_STATUS_VALUES);
|
|
10
7
|
export type ProfileStatus = (typeof PROFILE_STATUS_VALUES)[number];
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
SubscriptionStatusSchema,
|
|
6
|
-
SubscriptionTierSchema,
|
|
7
|
-
type SubscriptionRole,
|
|
8
|
-
type SubscriptionStatus,
|
|
9
|
-
type SubscriptionTier,
|
|
10
|
-
} from "./enums";
|
|
11
|
-
import { MAX_MEMBERS_FAMILY_PLAN } from "../../config";
|
|
1
|
+
import { Timestamp } from "../core";
|
|
2
|
+
import { SubscriptionRole } from "./subscription_role";
|
|
3
|
+
import { SubscriptionStatus } from "./subscription_status";
|
|
4
|
+
import { SubscriptionTier } from "./subscription_tier";
|
|
12
5
|
|
|
13
6
|
export interface Member {
|
|
14
7
|
userId: string;
|
|
@@ -18,14 +11,6 @@ export interface Member {
|
|
|
18
11
|
joinedAt?: Timestamp;
|
|
19
12
|
}
|
|
20
13
|
|
|
21
|
-
export const MemberSchema = z.object({
|
|
22
|
-
userId: z.string(),
|
|
23
|
-
role: SubscriptionRoleSchema,
|
|
24
|
-
status: SubscriptionStatusSchema,
|
|
25
|
-
invitedAt: z.custom<Timestamp>(),
|
|
26
|
-
joinedAt: z.custom<Timestamp>().optional(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
14
|
export interface Subscription {
|
|
30
15
|
expiresAt: Timestamp;
|
|
31
16
|
id: string;
|
|
@@ -34,12 +19,3 @@ export interface Subscription {
|
|
|
34
19
|
tier: SubscriptionTier;
|
|
35
20
|
updatedAt: Timestamp;
|
|
36
21
|
}
|
|
37
|
-
|
|
38
|
-
export const SubscriptionSchema = z.object({
|
|
39
|
-
expiresAt: z.custom<Timestamp>(),
|
|
40
|
-
id: z.string(),
|
|
41
|
-
members: z.array(MemberSchema).max(MAX_MEMBERS_FAMILY_PLAN).optional(),
|
|
42
|
-
providerId: z.string(),
|
|
43
|
-
tier: SubscriptionTierSchema,
|
|
44
|
-
updatedAt: z.custom<Timestamp>(),
|
|
45
|
-
});
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const SUBSCRIPTION_STATUS_VALUES = [
|
|
4
2
|
"active",
|
|
5
3
|
"deleted",
|
|
6
4
|
"pending",
|
|
7
5
|
"rejected",
|
|
8
6
|
] as const;
|
|
9
|
-
export const SubscriptionStatusSchema = z.enum(SUBSCRIPTION_STATUS_VALUES);
|
|
10
7
|
export type SubscriptionStatus = (typeof SUBSCRIPTION_STATUS_VALUES)[number];
|
package/src/types/iam/user.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
UserRoleSchema,
|
|
5
|
-
UserStatusSchema,
|
|
6
|
-
type UserRole,
|
|
7
|
-
type UserStatus,
|
|
8
|
-
} from "./enums";
|
|
1
|
+
import { Timestamp } from "../core";
|
|
2
|
+
import { UserRole } from "./user_role";
|
|
3
|
+
import { UserStatus } from "./user_status";
|
|
9
4
|
|
|
10
5
|
export interface User {
|
|
11
6
|
createdAt: Timestamp;
|
|
@@ -20,17 +15,3 @@ export interface User {
|
|
|
20
15
|
updatedAt: Timestamp;
|
|
21
16
|
verified: boolean;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
|
-
export const UserSchema = z.object({
|
|
25
|
-
createdAt: z.custom<Timestamp>(),
|
|
26
|
-
deletedAt: z.custom<Timestamp>().optional(),
|
|
27
|
-
email: z.string().email(),
|
|
28
|
-
id: z.string(),
|
|
29
|
-
imageUrl: z.string().url().optional(),
|
|
30
|
-
name: z.string().min(1).max(50),
|
|
31
|
-
role: UserRoleSchema,
|
|
32
|
-
status: UserStatusSchema,
|
|
33
|
-
subscriptionId: z.string().optional(),
|
|
34
|
-
updatedAt: z.custom<Timestamp>(),
|
|
35
|
-
verified: z.boolean(),
|
|
36
|
-
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const USER_ROLE_VALUES = [
|
|
2
|
+
"admin",
|
|
3
|
+
"moderator",
|
|
4
|
+
"translator",
|
|
5
|
+
"user",
|
|
6
|
+
"guest",
|
|
7
|
+
] as const;
|
|
8
|
+
export type UserRole = (typeof USER_ROLE_VALUES)[number];
|
|
9
|
+
|
|
10
|
+
export const PRIVILEGED_USER_ROLES: UserRole[] = [
|
|
11
|
+
"admin",
|
|
12
|
+
"moderator",
|
|
13
|
+
"translator",
|
|
14
|
+
];
|
|
15
|
+
export type PrivilegedUserRole = (typeof PRIVILEGED_USER_ROLES)[number];
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const USER_STATUS_VALUES = [
|
|
4
2
|
"active",
|
|
5
3
|
"deleted",
|
|
6
4
|
"pending",
|
|
7
5
|
"suspended",
|
|
8
6
|
] as const;
|
|
9
|
-
export const UserStatusSchema = z.enum(USER_STATUS_VALUES);
|
|
10
7
|
export type UserStatus = (typeof USER_STATUS_VALUES)[number];
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
PrioritySchema,
|
|
7
|
-
SeveritySchema,
|
|
8
|
-
SuggestionCategorySchema,
|
|
9
|
-
type ModerationStatus,
|
|
10
|
-
type Priority,
|
|
11
|
-
type Severity,
|
|
12
|
-
type SuggestionCategory,
|
|
13
|
-
} from "./enums";
|
|
1
|
+
import { Locale, Timestamp } from "../core";
|
|
2
|
+
import { ModerationStatus } from "./moderation_status";
|
|
3
|
+
import { Priority } from "./priority";
|
|
4
|
+
import { Severity } from "./severity";
|
|
5
|
+
import { SuggestionCategory } from "./suggestion_category";
|
|
14
6
|
|
|
15
7
|
export interface ModerationSuggestion {
|
|
16
8
|
category: SuggestionCategory;
|
|
@@ -19,13 +11,6 @@ export interface ModerationSuggestion {
|
|
|
19
11
|
suggestion: string;
|
|
20
12
|
}
|
|
21
13
|
|
|
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
14
|
export interface Moderation {
|
|
30
15
|
assessedAt?: Timestamp;
|
|
31
16
|
createdAt: Timestamp;
|
|
@@ -42,34 +27,12 @@ export interface Moderation {
|
|
|
42
27
|
userId: string;
|
|
43
28
|
}
|
|
44
29
|
|
|
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
30
|
export interface ModerateRecipeInput {
|
|
62
31
|
moderationId: string;
|
|
63
32
|
recipeId: string;
|
|
64
33
|
userId: string;
|
|
65
34
|
}
|
|
66
35
|
|
|
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
36
|
export interface ModerateRecipeOutput {
|
|
74
37
|
autoApproved: boolean;
|
|
75
38
|
autoRejected: boolean;
|
|
@@ -77,11 +40,3 @@ export interface ModerateRecipeOutput {
|
|
|
77
40
|
rejectionReason?: string;
|
|
78
41
|
suggestions: ModerationSuggestion[];
|
|
79
42
|
}
|
|
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,9 +1,6 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const MODERATION_STATUS_VALUES = [
|
|
4
2
|
"approved",
|
|
5
3
|
"pending",
|
|
6
4
|
"rejected",
|
|
7
5
|
] as const;
|
|
8
|
-
export const ModerationStatusSchema = z.enum(MODERATION_STATUS_VALUES);
|
|
9
6
|
export type ModerationStatus = (typeof MODERATION_STATUS_VALUES)[number];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const ALLERGEN_VALUES = [
|
|
4
2
|
"celery",
|
|
5
3
|
"dairy",
|
|
@@ -15,5 +13,4 @@ export const ALLERGEN_VALUES = [
|
|
|
15
13
|
"soy",
|
|
16
14
|
"sulfites",
|
|
17
15
|
] as const;
|
|
18
|
-
export const AllergenSchema = z.enum(ALLERGEN_VALUES);
|
|
19
16
|
export type Allergen = (typeof ALLERGEN_VALUES)[number];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const CUISINE_VALUES = [
|
|
4
2
|
"african",
|
|
5
3
|
"american",
|
|
@@ -35,5 +33,4 @@ export const CUISINE_VALUES = [
|
|
|
35
33
|
"vietnamese",
|
|
36
34
|
"other",
|
|
37
35
|
] as const;
|
|
38
|
-
export const CuisineSchema = z.enum(CUISINE_VALUES);
|
|
39
36
|
export type Cuisine = (typeof CUISINE_VALUES)[number];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const DIETARY_TAG_VALUES = [
|
|
4
2
|
"dairy_free",
|
|
5
3
|
"egg_free",
|
|
@@ -17,5 +15,4 @@ export const DIETARY_TAG_VALUES = [
|
|
|
17
15
|
"vegan",
|
|
18
16
|
"vegetarian",
|
|
19
17
|
] as const;
|
|
20
|
-
export const DietaryTagSchema = z.enum(DIETARY_TAG_VALUES);
|
|
21
18
|
export type DietaryTag = (typeof DIETARY_TAG_VALUES)[number];
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export const DIFFICULTY_VALUES = [
|
|
4
2
|
"beginner",
|
|
5
3
|
"intermediate",
|
|
6
4
|
"advanced",
|
|
7
5
|
"expert",
|
|
8
6
|
] as const;
|
|
9
|
-
export const DifficultySchema = z.enum(DIFFICULTY_VALUES);
|
|
10
7
|
export type Difficulty = (typeof DIFFICULTY_VALUES)[number];
|
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
|
|
3
1
|
export interface EquipmentMeta {
|
|
4
2
|
required?: boolean;
|
|
5
3
|
slug: string;
|
|
6
4
|
}
|
|
7
5
|
|
|
8
|
-
export const EquipmentMetaSchema = z.object({
|
|
9
|
-
required: z.boolean().optional(),
|
|
10
|
-
slug: z.string(),
|
|
11
|
-
}) satisfies z.ZodType<EquipmentMeta>;
|
|
12
|
-
|
|
13
6
|
export interface EquipmentContent {
|
|
14
7
|
name: string;
|
|
15
8
|
notes?: string;
|
|
16
9
|
slug: string;
|
|
17
10
|
}
|
|
18
11
|
|
|
19
|
-
export const EquipmentContentSchema = z.object({
|
|
20
|
-
name: z.string(),
|
|
21
|
-
notes: z.string().optional(),
|
|
22
|
-
slug: z.string(),
|
|
23
|
-
}) satisfies z.ZodType<EquipmentContent>;
|
|
24
|
-
|
|
25
12
|
export interface Equipment extends EquipmentMeta, EquipmentContent {}
|
|
26
|
-
|
|
27
|
-
export const EquipmentSchema = z.object({
|
|
28
|
-
...EquipmentMetaSchema.shape,
|
|
29
|
-
...EquipmentContentSchema.shape,
|
|
30
|
-
}) satisfies z.ZodType<Equipment>;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
MealTypeSchema,
|
|
7
|
-
SpicinessSchema,
|
|
8
|
-
type Cuisine,
|
|
9
|
-
type DietaryTag,
|
|
10
|
-
type Difficulty,
|
|
11
|
-
type MealType,
|
|
12
|
-
type Spiciness,
|
|
13
|
-
} from "./enums";
|
|
1
|
+
import { Cuisine } from "./cuisine";
|
|
2
|
+
import { DietaryTag } from "./dietary_tag";
|
|
3
|
+
import { Difficulty } from "./difficulty";
|
|
4
|
+
import { MealType } from "./meal_type";
|
|
5
|
+
import { Spiciness } from "./spiciness";
|
|
14
6
|
|
|
15
7
|
export interface RecipeFilters {
|
|
16
8
|
cuisines?: Cuisine[];
|
|
@@ -22,14 +14,3 @@ export interface RecipeFilters {
|
|
|
22
14
|
spiciness?: Spiciness;
|
|
23
15
|
timeLimit?: number;
|
|
24
16
|
}
|
|
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,8 +1,17 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./allergen";
|
|
2
|
+
export * from "./cuisine";
|
|
3
|
+
export * from "./dietary_tag";
|
|
4
|
+
export * from "./difficulty";
|
|
2
5
|
export * from "./equipment";
|
|
3
6
|
export * from "./filters";
|
|
4
7
|
export * from "./ingredient";
|
|
5
8
|
export * from "./instruction";
|
|
9
|
+
export * from "./meal_type";
|
|
6
10
|
export * from "./nutrition";
|
|
11
|
+
export * from "./recipe_source";
|
|
12
|
+
export * from "./recipe_status";
|
|
7
13
|
export * from "./recipe";
|
|
14
|
+
export * from "./spiciness";
|
|
15
|
+
export * from "./temperature_unit";
|
|
8
16
|
export * from "./temperature";
|
|
17
|
+
export * from "./unit";
|