@cravery/core 0.0.9 → 0.0.10
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../src/types/ai/flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../src/types/ai/flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAW3B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;EAKzC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAMpC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAG9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAWhF,eAAO,MAAM,0BAA0B;;;;;;EAErC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EAItC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../../src/types/ai/flow.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../../src/types/ai/flow.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAC3B,oCAIkB;AAClB,mDAA6D;AAC7D,qDAAsE;AACtE,uDAAiE;AAEjE,0BAA0B;AACb,QAAA,8BAA8B,GAAG,UAAC,CAAC,MAAM,CAAC;IACrD,QAAQ,EAAE,gCAAwB;IAClC,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,sBAAc;IACxB,UAAU,EAAE,UAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,UAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,oBAAY;IACpB,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,UAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,UAAC,CAAC,KAAK,CAAC,UAAC,CAAC,MAAM,EAAE,CAAC;IAChC,YAAY,EAAE,UAAC,CAAC,KAAK,CAAC,UAAC,CAAC,MAAM,EAAE,CAAC;CAClC,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,UAAC,CAAC,MAAM,CAAC;IACjD,YAAY,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,G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C5B,MAAM,4BAA4B,GAAG;IACnC,aAAa;IACb,UAAU;IACV,OAAO;IACP,MAAM;IACN,WAAW;CACH,CAAC;AAEE,QAAA,0BAA0B,GAAG,UAAC,CAAC,MAAM,CAAC;IACjD,QAAQ,EAAE,UAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,UAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,UAAC,CAAC,OAAO,EAAE;IACjB,MAAM,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,UAAU,EAAE,UAAC,CAAC,KAAK,CAAC,UAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;CAC1D,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/types/iam/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/types/iam/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAGL,KAAK,IAAI,EACT,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrB,CAAC;AAEH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,UAAU,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,IAAI,EACJ,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/types/iam/user.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAE3B,
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/types/iam/user.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAE3B,oCAKkB;AAEL,QAAA,UAAU,GAAG,UAAC,CAAC,MAAM,CAAC;IACjC,SAAS,EAAE,UAAC,CAAC,MAAM,EAAa;IAChC,SAAS,EAAE,UAAC,CAAC,MAAM,EAAa,CAAC,QAAQ,EAAE;IAC3C,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACzB,EAAE,EAAE,UAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,kBAAU;IAChB,MAAM,EAAE,wBAAgB;IACxB,cAAc,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,UAAC,CAAC,MAAM,EAAa;IAChC,QAAQ,EAAE,UAAC,CAAC,OAAO,EAAE;CACtB,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/types/ai/flow.ts
CHANGED
|
@@ -1,78 +1,82 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
import { z } from "genkit";
|
|
2
|
+
import {
|
|
3
|
+
LocaleSchema,
|
|
4
|
+
SeveritySchema,
|
|
5
|
+
SuggestionCategorySchema,
|
|
6
|
+
} from "../enums";
|
|
7
|
+
import { EquipmentContentSchema } from "../recipe/equipment";
|
|
8
|
+
import { IngredientSectionContentSchema } from "../recipe/ingredient";
|
|
9
|
+
import { InstructionContentSchema } from "../recipe/instruction";
|
|
10
|
+
|
|
11
|
+
// Moderation flow schemas
|
|
12
|
+
export const ModerationFlowSuggestionSchema = z.object({
|
|
13
|
+
category: SuggestionCategorySchema,
|
|
14
|
+
field: z.string(),
|
|
15
|
+
severity: SeveritySchema,
|
|
16
|
+
suggestion: z.string(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const ModerationFlowInputSchema = z.object({
|
|
20
|
+
locale: LocaleSchema,
|
|
21
|
+
title: z.string(),
|
|
22
|
+
description: z.string(),
|
|
23
|
+
ingredients: z.array(z.string()),
|
|
24
|
+
instructions: z.array(z.string()),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const ModerationFlowOutputSchema = z.object({
|
|
28
|
+
qualityScore: z.number().min(0).max(1),
|
|
29
|
+
suggestions: z.array(ModerationFlowSuggestionSchema),
|
|
30
|
+
autoApproved: z.boolean(),
|
|
31
|
+
autoRejected: z.boolean(),
|
|
32
|
+
rejectionReason: z.string().optional(),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type ModerationFlowInput = z.infer<typeof ModerationFlowInputSchema>;
|
|
36
|
+
export type ModerationFlowOutput = z.infer<typeof ModerationFlowOutputSchema>;
|
|
37
|
+
|
|
38
|
+
// Translation flow schemas
|
|
39
|
+
export const TranslationFlowInputSchema = z.object({
|
|
40
|
+
sourceLocale: LocaleSchema,
|
|
41
|
+
targetLocale: LocaleSchema,
|
|
42
|
+
title: z.string(),
|
|
43
|
+
description: z.string(),
|
|
44
|
+
ingredientSections: z.array(IngredientSectionContentSchema),
|
|
45
|
+
instructions: z.array(InstructionContentSchema),
|
|
46
|
+
equipment: z.array(EquipmentContentSchema).optional(),
|
|
47
|
+
tips: z.array(z.string()).optional(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const TranslationFlowOutputSchema = z.object({
|
|
51
|
+
title: z.string(),
|
|
52
|
+
description: z.string(),
|
|
53
|
+
ingredientSections: z.array(IngredientSectionContentSchema),
|
|
54
|
+
instructions: z.array(InstructionContentSchema),
|
|
55
|
+
equipment: z.array(EquipmentContentSchema).optional(),
|
|
56
|
+
tips: z.array(z.string()).optional(),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export type TranslationFlowInput = z.infer<typeof TranslationFlowInputSchema>;
|
|
60
|
+
export type TranslationFlowOutput = z.infer<typeof TranslationFlowOutputSchema>;
|
|
61
|
+
|
|
62
|
+
// Image safety flow schemas
|
|
63
|
+
const IMAGE_SAFETY_CATEGORY_VALUES = [
|
|
64
|
+
"appropriate",
|
|
65
|
+
"violence",
|
|
66
|
+
"adult",
|
|
67
|
+
"hate",
|
|
68
|
+
"dangerous",
|
|
69
|
+
] as const;
|
|
70
|
+
|
|
71
|
+
export const ImageSafetyFlowInputSchema = z.object({
|
|
72
|
+
imageUrl: z.string(),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const ImageSafetyFlowOutputSchema = z.object({
|
|
76
|
+
safe: z.boolean(),
|
|
77
|
+
reason: z.string().optional(),
|
|
78
|
+
categories: z.array(z.enum(IMAGE_SAFETY_CATEGORY_VALUES)),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export type ImageSafetyFlowInput = z.infer<typeof ImageSafetyFlowInputSchema>;
|
|
82
|
+
export type ImageSafetyFlowOutput = z.infer<typeof ImageSafetyFlowOutputSchema>;
|
package/src/types/iam/user.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { z } from "genkit";
|
|
2
2
|
import type { Timestamp } from "firebase-admin/firestore";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
RoleSchema,
|
|
5
|
+
UserStatusSchema,
|
|
6
|
+
type Role,
|
|
7
|
+
type UserStatus,
|
|
8
|
+
} from "../enums";
|
|
4
9
|
|
|
5
10
|
export const UserSchema = z.object({
|
|
6
11
|
createdAt: z.custom<Timestamp>(),
|