@omni-graph/omni-model 0.7.12 → 0.7.14-17-gf960c6a
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/constants/languageCodeMapper.d.ts +107 -1
- package/dist/constants/languageCodeMapper.d.ts.map +1 -1
- package/dist/constants/languageCodeMapper.js +7 -2
- package/dist/constants/languageCodeMapper.js.map +1 -1
- package/dist/functions/filtering/textHandler.d.ts +1 -1
- package/dist/zod/account-settings/accountSettings.d.ts +206 -62
- package/dist/zod/account-settings/accountSettings.d.ts.map +1 -1
- package/dist/zod/account-settings/accountSettings.js +16 -1
- package/dist/zod/account-settings/accountSettings.js.map +1 -1
- package/dist/zod/account-settings/base.d.ts +2 -0
- package/dist/zod/account-settings/base.d.ts.map +1 -1
- package/dist/zod/account-settings/base.js +2 -0
- package/dist/zod/account-settings/base.js.map +1 -1
- package/dist/zod/recommendations/base.d.ts +42 -17
- package/dist/zod/recommendations/base.d.ts.map +1 -1
- package/dist/zod/recommendations/base.js +35 -13
- package/dist/zod/recommendations/base.js.map +1 -1
- package/dist/zod/recommendations/content-optimization/base.d.ts +51 -47
- package/dist/zod/recommendations/content-optimization/base.d.ts.map +1 -1
- package/dist/zod/recommendations/content-optimization/base.js +2 -2
- package/dist/zod/recommendations/content-optimization/base.js.map +1 -1
- package/dist/zod/recommendations/content-optimization/index.d.ts +2 -0
- package/dist/zod/recommendations/content-optimization/index.d.ts.map +1 -1
- package/dist/zod/recommendations/content-optimization/index.js +2 -0
- package/dist/zod/recommendations/content-optimization/index.js.map +1 -1
- package/dist/zod/recommendations/content-optimization/metaAttributes.d.ts +10289 -0
- package/dist/zod/recommendations/content-optimization/metaAttributes.d.ts.map +1 -0
- package/dist/zod/recommendations/content-optimization/metaAttributes.js +142 -0
- package/dist/zod/recommendations/content-optimization/metaAttributes.js.map +1 -0
- package/dist/zod/recommendations/content-optimization/productRecommendation.d.ts +360 -0
- package/dist/zod/recommendations/content-optimization/productRecommendation.d.ts.map +1 -0
- package/dist/zod/recommendations/content-optimization/productRecommendation.js +128 -0
- package/dist/zod/recommendations/content-optimization/productRecommendation.js.map +1 -0
- package/dist/zod/recommendations/content-optimization/translation.d.ts +9 -242
- package/dist/zod/recommendations/content-optimization/translation.d.ts.map +1 -1
- package/dist/zod/recommendations/content-optimization/translation.js +15 -23
- package/dist/zod/recommendations/content-optimization/translation.js.map +1 -1
- package/dist/zod/recommendations/index.d.ts +4336 -0
- package/dist/zod/recommendations/index.d.ts.map +1 -1
- package/dist/zod/recommendations/index.js +10 -0
- package/dist/zod/recommendations/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { ProductRecommendationAnalyticsIds, ObjectScopedRecommendationObjectClassSchema, ObjectScopedRecommendationStateSchema, ProductRecommendationDataBaseSchema, } from '../base';
|
|
3
|
+
import { DesignGuideSectionSchema } from '../../account-settings';
|
|
4
|
+
import { TranslationRecommendationDataSchema } from './translation';
|
|
5
|
+
export const ProductDataSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
vendor: z.string().optional(),
|
|
8
|
+
product_description: z.string().optional(),
|
|
9
|
+
product_attributes: z.record(z.string(), z.union([z.string(), z.null()])).optional(),
|
|
10
|
+
collections: z.array(z.string()).optional(),
|
|
11
|
+
product_name: z.string().optional(),
|
|
12
|
+
product_tags: z.array(z.string()).optional(),
|
|
13
|
+
dimensions: z.array(z.string()).optional(),
|
|
14
|
+
product_description_html: z.string().optional(),
|
|
15
|
+
})
|
|
16
|
+
.nullable()
|
|
17
|
+
.optional();
|
|
18
|
+
export const InputDataSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
product_data: z
|
|
21
|
+
.string()
|
|
22
|
+
.transform((str) => {
|
|
23
|
+
if (!str)
|
|
24
|
+
return null;
|
|
25
|
+
try {
|
|
26
|
+
return JSON.parse(str);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
// ignore this since it will be moved to omni-model
|
|
30
|
+
console.error('❌ Invalid JSON in product_data:', str);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
.pipe(ProductDataSchema)
|
|
35
|
+
.optional(),
|
|
36
|
+
product_feedback: z.string().nullable().optional(),
|
|
37
|
+
task_feedback: z.string().nullable().optional(),
|
|
38
|
+
tone_of_voice: z.string().nullable().optional(),
|
|
39
|
+
company_description: z.string().nullable().optional(),
|
|
40
|
+
})
|
|
41
|
+
.optional();
|
|
42
|
+
export const ProductRecommendationDataSchema = ProductRecommendationDataBaseSchema.extend({
|
|
43
|
+
analyticsId: z.enum([
|
|
44
|
+
'content_optimization_write_seo',
|
|
45
|
+
'content_optimization_write_product_description_html',
|
|
46
|
+
'content_optimization_refine_product_description_html',
|
|
47
|
+
]),
|
|
48
|
+
input_data: InputDataSchema.optional(),
|
|
49
|
+
});
|
|
50
|
+
export const RecommendationDataSchema = z.union([TranslationRecommendationDataSchema, ProductRecommendationDataSchema]);
|
|
51
|
+
const ProductAttributesSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
store_url: z.string().optional(),
|
|
54
|
+
})
|
|
55
|
+
.catchall(z.union([z.string(), z.boolean(), z.null()]));
|
|
56
|
+
export const ProductInformationSchema = z.object({
|
|
57
|
+
is_enabled: z.boolean().optional(),
|
|
58
|
+
product_name: z.string().optional(),
|
|
59
|
+
vendor: z.string().optional(),
|
|
60
|
+
product_tags: z.array(z.string()).optional(),
|
|
61
|
+
product_attributes: ProductAttributesSchema,
|
|
62
|
+
collections: z.array(z.string()).optional(),
|
|
63
|
+
});
|
|
64
|
+
const RecommendationLookupSchema = z
|
|
65
|
+
.object({
|
|
66
|
+
product_name: z.string(),
|
|
67
|
+
vendor: z.string(),
|
|
68
|
+
product_tags: z.array(z.string()),
|
|
69
|
+
product_type: z.string(),
|
|
70
|
+
group_id: z.string().optional(),
|
|
71
|
+
})
|
|
72
|
+
.optional();
|
|
73
|
+
const EditedRecommendationDataSchema = z
|
|
74
|
+
.object({
|
|
75
|
+
recommendationData: z.object({
|
|
76
|
+
output_data: z.string(),
|
|
77
|
+
}),
|
|
78
|
+
})
|
|
79
|
+
.nullable()
|
|
80
|
+
.optional();
|
|
81
|
+
export const ProductRecommendationMetaDataSchema = z.object({
|
|
82
|
+
product_information: ProductInformationSchema.optional(),
|
|
83
|
+
llm_model: z.string().optional(),
|
|
84
|
+
product_url: z.string().optional().nullable(),
|
|
85
|
+
is_enabled: z.boolean().optional(),
|
|
86
|
+
related_categories: z.array(z.string()).optional(),
|
|
87
|
+
lead_time_days: z.number().optional(),
|
|
88
|
+
product_names: z.array(z.string()).optional(),
|
|
89
|
+
structured_output: z
|
|
90
|
+
.string()
|
|
91
|
+
.nullable()
|
|
92
|
+
.optional()
|
|
93
|
+
.transform((str) => {
|
|
94
|
+
if (!str)
|
|
95
|
+
return null;
|
|
96
|
+
return JSON.parse(str);
|
|
97
|
+
})
|
|
98
|
+
.pipe(z
|
|
99
|
+
.object({
|
|
100
|
+
sections: z.array(DesignGuideSectionSchema),
|
|
101
|
+
})
|
|
102
|
+
.nullable()),
|
|
103
|
+
});
|
|
104
|
+
export const ProductRecommendationSchema = z.object({
|
|
105
|
+
analyticsId: ProductRecommendationAnalyticsIds,
|
|
106
|
+
recommendationData: RecommendationDataSchema,
|
|
107
|
+
objectClass: ObjectScopedRecommendationObjectClassSchema,
|
|
108
|
+
objectId: z.string(),
|
|
109
|
+
category: z.string(),
|
|
110
|
+
metadata: ProductRecommendationMetaDataSchema.optional(),
|
|
111
|
+
editedRecommendationData: EditedRecommendationDataSchema,
|
|
112
|
+
summary: z.string(),
|
|
113
|
+
cardPictureAltText: z.string(),
|
|
114
|
+
cardPictureUrl: z.string(),
|
|
115
|
+
cardTitle: z.string(),
|
|
116
|
+
cardSubtitle: z.string().optional(),
|
|
117
|
+
updatedAt: z.string(),
|
|
118
|
+
state: ObjectScopedRecommendationStateSchema,
|
|
119
|
+
feedback: z.string(),
|
|
120
|
+
lookup: RecommendationLookupSchema,
|
|
121
|
+
mutedUntil: z.string().optional(),
|
|
122
|
+
isMuted: z.boolean(),
|
|
123
|
+
isPending: z.boolean(),
|
|
124
|
+
severity: z.number().nullable().optional(),
|
|
125
|
+
accountId: z.string(),
|
|
126
|
+
algorithmVersion: z.string().optional(),
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=productRecommendation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productRecommendation.js","sourceRoot":"","sources":["../../../../src/zod/recommendations/content-optimization/productRecommendation.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACL,iCAAiC,EACjC,2CAA2C,EAC3C,qCAAqC,EACrC,mCAAmC,GACpC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,wBAAwB,EAAC,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAC,mCAAmC,EAAC,MAAM,eAAe,CAAC;AAElE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,kBAAkB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpF,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ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2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,WAAW,EAAE,iCAAiC;IAC9C,kBAAkB,EAAE,wBAAwB;IAC5C,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,mCAAmC,CAAC,QAAQ,EAAE;IACxD,wBAAwB,EAAE,8BAA8B;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,qCAAqC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,MAAM,EAAE,0BAA0B;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC"}
|
|
@@ -1,252 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const TranslationRecommendationDataSchema: z.ZodObject<{
|
|
3
3
|
output_data: z.ZodString;
|
|
4
|
-
original_data: z.
|
|
4
|
+
original_data: z.ZodString;
|
|
5
5
|
input_language: z.ZodString;
|
|
6
6
|
output_language: z.ZodString;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
input_data: z.
|
|
7
|
+
health_score: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
analyticsId: z.ZodLiteral<"content_optimization_translate_product_description_html">;
|
|
9
|
+
input_data: z.ZodOptional<z.ZodObject<{
|
|
10
10
|
original_language_description: z.ZodString;
|
|
11
11
|
old_translation: z.ZodString;
|
|
12
|
-
product_feedback: z.ZodNullable<z.ZodString
|
|
13
|
-
task_feedback: z.ZodNullable<z.ZodString
|
|
12
|
+
product_feedback: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
task_feedback: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
14
|
tone_of_voice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
15
|
company_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
16
|
}, z.core.$strip>>;
|
|
17
17
|
}, z.core.$strip>;
|
|
18
|
-
export
|
|
19
|
-
accountId: z.ZodString;
|
|
20
|
-
analyticsId: z.ZodUnion<readonly [z.ZodEnum<{
|
|
21
|
-
content_optimization_write_seo: "content_optimization_write_seo";
|
|
22
|
-
content_optimization_refine_product_description_html: "content_optimization_refine_product_description_html";
|
|
23
|
-
content_optimization_translate_product_description_html: "content_optimization_translate_product_description_html";
|
|
24
|
-
content_optimization_write_product_description_html: "content_optimization_write_product_description_html";
|
|
25
|
-
content_optimization_reduce_similarity_product_description_html: "content_optimization_reduce_similarity_product_description_html";
|
|
26
|
-
}>, z.ZodEnum<{
|
|
27
|
-
inventory_optimization_reorder_recommendation: "inventory_optimization_reorder_recommendation";
|
|
28
|
-
inventory_optimization_reorder_recommendation_entries: "inventory_optimization_reorder_recommendation_entries";
|
|
29
|
-
}>]>;
|
|
30
|
-
objectClass: z.ZodCatch<z.ZodEnum<{
|
|
31
|
-
UNKNOWN: "UNKNOWN";
|
|
32
|
-
location: "location";
|
|
33
|
-
product: "product";
|
|
34
|
-
sku: "sku";
|
|
35
|
-
pseudo_product: "pseudo_product";
|
|
36
|
-
}>>;
|
|
37
|
-
objectId: z.ZodString;
|
|
38
|
-
category: z.ZodString;
|
|
39
|
-
summary: z.ZodString;
|
|
40
|
-
cardPictureUrl: z.ZodOptional<z.ZodString>;
|
|
41
|
-
cardPictureAltText: z.ZodOptional<z.ZodString>;
|
|
42
|
-
cardTitle: z.ZodString;
|
|
43
|
-
cardSubtitle: z.ZodOptional<z.ZodString>;
|
|
44
|
-
lookup: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
45
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
46
|
-
state: z.ZodCatch<z.ZodEnum<{
|
|
47
|
-
UNKNOWN: "UNKNOWN";
|
|
48
|
-
PENDING: "PENDING";
|
|
49
|
-
ACCEPTED: "ACCEPTED";
|
|
50
|
-
REJECTED: "REJECTED";
|
|
51
|
-
ACCEPTED_AND_HANDLED: "ACCEPTED_AND_HANDLED";
|
|
52
|
-
ACCEPTED_HANDLING_FAILED: "ACCEPTED_HANDLING_FAILED";
|
|
53
|
-
INVALIDATED: "INVALIDATED";
|
|
54
|
-
GENERATING: "GENERATING";
|
|
55
|
-
GENERATION_FAILED: "GENERATION_FAILED";
|
|
56
|
-
IMPLICITLY_REJECTED: "IMPLICITLY_REJECTED";
|
|
57
|
-
REVERTED: "REVERTED";
|
|
58
|
-
REVERTED_HANDLING_FAILED: "REVERTED_HANDLING_FAILED";
|
|
59
|
-
REVERTED_AND_HANDLED: "REVERTED_AND_HANDLED";
|
|
60
|
-
PLACEHOLDER: "PLACEHOLDER";
|
|
61
|
-
}>>;
|
|
62
|
-
mutedUntil: z.ZodOptional<z.ZodDate>;
|
|
63
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
64
|
-
severity: z.ZodNumber;
|
|
65
|
-
algorithmVersion: z.ZodString;
|
|
66
|
-
isMuted: z.ZodBoolean;
|
|
67
|
-
isPending: z.ZodBoolean;
|
|
68
|
-
statusDetails: z.ZodOptional<z.ZodAny>;
|
|
69
|
-
editedRecommendationData: z.ZodOptional<z.ZodObject<{
|
|
70
|
-
recommendationData: z.ZodObject<{
|
|
71
|
-
output_data: z.ZodString;
|
|
72
|
-
original_data: z.ZodNullable<z.ZodString>;
|
|
73
|
-
input_language: z.ZodString;
|
|
74
|
-
output_language: z.ZodString;
|
|
75
|
-
input_health_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
76
|
-
output_health_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
77
|
-
}, z.core.$strip>;
|
|
78
|
-
}, z.core.$strip>>;
|
|
79
|
-
metadata: z.ZodObject<{
|
|
80
|
-
chat_history: z.ZodString;
|
|
81
|
-
product_information: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
82
|
-
is_enabled?: boolean | undefined;
|
|
83
|
-
product_name?: string | undefined;
|
|
84
|
-
vendor?: string | undefined;
|
|
85
|
-
product_tags?: string[] | undefined;
|
|
86
|
-
product_attributes?: Record<string, string | null> | undefined;
|
|
87
|
-
collections?: string[] | undefined;
|
|
88
|
-
} | undefined, string>>>;
|
|
89
|
-
llm_model: z.ZodOptional<z.ZodString>;
|
|
90
|
-
severity_unweighted: z.ZodOptional<z.ZodNumber>;
|
|
91
|
-
recommendation_created_at: z.ZodOptional<z.ZodString>;
|
|
92
|
-
product_url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
93
|
-
is_enabled: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
94
|
-
related_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
-
lead_time_days: z.ZodOptional<z.ZodNumber>;
|
|
96
|
-
online_summary_with_citations: z.ZodOptional<z.ZodString>;
|
|
97
|
-
product_names: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
-
translatable_content_digest: z.ZodString;
|
|
99
|
-
resource_key: z.ZodCatch<z.ZodEnum<{
|
|
100
|
-
UNKNOWN: "UNKNOWN";
|
|
101
|
-
product_name: "product_name";
|
|
102
|
-
product_description_html: "product_description_html";
|
|
103
|
-
}>>;
|
|
104
|
-
}, z.core.$strip>;
|
|
105
|
-
recommendationData: z.ZodObject<{
|
|
106
|
-
output_data: z.ZodString;
|
|
107
|
-
original_data: z.ZodNullable<z.ZodString>;
|
|
108
|
-
input_language: z.ZodString;
|
|
109
|
-
output_language: z.ZodString;
|
|
110
|
-
input_health_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
111
|
-
output_health_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
112
|
-
input_data: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.ZodObject<{
|
|
113
|
-
original_language_description: z.ZodString;
|
|
114
|
-
old_translation: z.ZodString;
|
|
115
|
-
product_feedback: z.ZodNullable<z.ZodString>;
|
|
116
|
-
task_feedback: z.ZodNullable<z.ZodString>;
|
|
117
|
-
tone_of_voice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
-
company_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
|
-
}, z.core.$strip>>;
|
|
120
|
-
}, z.core.$strip>;
|
|
121
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
122
|
-
outputData: string;
|
|
123
|
-
accountId: string;
|
|
124
|
-
analyticsId: "content_optimization_write_seo" | "content_optimization_refine_product_description_html" | "content_optimization_translate_product_description_html" | "content_optimization_write_product_description_html" | "content_optimization_reduce_similarity_product_description_html" | "inventory_optimization_reorder_recommendation" | "inventory_optimization_reorder_recommendation_entries";
|
|
125
|
-
objectClass: "UNKNOWN" | "location" | "product" | "sku" | "pseudo_product";
|
|
126
|
-
objectId: string;
|
|
127
|
-
category: string;
|
|
128
|
-
summary: string;
|
|
129
|
-
cardTitle: string;
|
|
130
|
-
lookup: Record<string, string>;
|
|
131
|
-
updatedAt: Date;
|
|
132
|
-
state: "UNKNOWN" | "PENDING" | "ACCEPTED" | "REJECTED" | "ACCEPTED_AND_HANDLED" | "ACCEPTED_HANDLING_FAILED" | "INVALIDATED" | "GENERATING" | "GENERATION_FAILED" | "IMPLICITLY_REJECTED" | "REVERTED" | "REVERTED_HANDLING_FAILED" | "REVERTED_AND_HANDLED" | "PLACEHOLDER";
|
|
133
|
-
severity: number;
|
|
134
|
-
algorithmVersion: string;
|
|
135
|
-
isMuted: boolean;
|
|
136
|
-
isPending: boolean;
|
|
137
|
-
metadata: {
|
|
138
|
-
chat_history: string;
|
|
139
|
-
product_information?: {
|
|
140
|
-
is_enabled?: boolean | undefined;
|
|
141
|
-
product_name?: string | undefined;
|
|
142
|
-
vendor?: string | undefined;
|
|
143
|
-
product_tags?: string[] | undefined;
|
|
144
|
-
product_attributes?: Record<string, string | null> | undefined;
|
|
145
|
-
collections?: string[] | undefined;
|
|
146
|
-
} | undefined;
|
|
147
|
-
llm_model?: string | undefined;
|
|
148
|
-
severity_unweighted?: number | undefined;
|
|
149
|
-
recommendation_created_at?: string | undefined;
|
|
150
|
-
product_url?: string | undefined;
|
|
151
|
-
is_enabled?: boolean | undefined;
|
|
152
|
-
related_categories?: string[] | undefined;
|
|
153
|
-
lead_time_days?: number | undefined;
|
|
154
|
-
online_summary_with_citations?: string | undefined;
|
|
155
|
-
product_names?: string[] | undefined;
|
|
156
|
-
};
|
|
157
|
-
recommendationData: {
|
|
158
|
-
output_data: string;
|
|
159
|
-
original_data: string | null;
|
|
160
|
-
input_language: string;
|
|
161
|
-
output_language: string;
|
|
162
|
-
input_health_score?: number | null | undefined;
|
|
163
|
-
output_health_score?: number | null | undefined;
|
|
164
|
-
};
|
|
165
|
-
cardPictureUrl?: string | undefined;
|
|
166
|
-
cardPictureAltText?: string | undefined;
|
|
167
|
-
cardSubtitle?: string | undefined;
|
|
168
|
-
mutedUntil?: Date | undefined;
|
|
169
|
-
feedback?: string | undefined;
|
|
170
|
-
statusDetails?: any;
|
|
171
|
-
editedRecommendationData?: {
|
|
172
|
-
recommendationData: {
|
|
173
|
-
output_data: string;
|
|
174
|
-
original_data: string | null;
|
|
175
|
-
input_language: string;
|
|
176
|
-
output_language: string;
|
|
177
|
-
input_health_score?: number | null | undefined;
|
|
178
|
-
output_health_score?: number | null | undefined;
|
|
179
|
-
};
|
|
180
|
-
} | undefined;
|
|
181
|
-
}, {
|
|
182
|
-
accountId: string;
|
|
183
|
-
analyticsId: "content_optimization_write_seo" | "content_optimization_refine_product_description_html" | "content_optimization_translate_product_description_html" | "content_optimization_write_product_description_html" | "content_optimization_reduce_similarity_product_description_html" | "inventory_optimization_reorder_recommendation" | "inventory_optimization_reorder_recommendation_entries";
|
|
184
|
-
objectClass: "UNKNOWN" | "location" | "product" | "sku" | "pseudo_product";
|
|
185
|
-
objectId: string;
|
|
186
|
-
category: string;
|
|
187
|
-
summary: string;
|
|
188
|
-
cardTitle: string;
|
|
189
|
-
lookup: Record<string, string>;
|
|
190
|
-
updatedAt: Date;
|
|
191
|
-
state: "UNKNOWN" | "PENDING" | "ACCEPTED" | "REJECTED" | "ACCEPTED_AND_HANDLED" | "ACCEPTED_HANDLING_FAILED" | "INVALIDATED" | "GENERATING" | "GENERATION_FAILED" | "IMPLICITLY_REJECTED" | "REVERTED" | "REVERTED_HANDLING_FAILED" | "REVERTED_AND_HANDLED" | "PLACEHOLDER";
|
|
192
|
-
severity: number;
|
|
193
|
-
algorithmVersion: string;
|
|
194
|
-
isMuted: boolean;
|
|
195
|
-
isPending: boolean;
|
|
196
|
-
metadata: {
|
|
197
|
-
chat_history: string;
|
|
198
|
-
translatable_content_digest: string;
|
|
199
|
-
resource_key: "UNKNOWN" | "product_name" | "product_description_html";
|
|
200
|
-
product_information?: {
|
|
201
|
-
is_enabled?: boolean | undefined;
|
|
202
|
-
product_name?: string | undefined;
|
|
203
|
-
vendor?: string | undefined;
|
|
204
|
-
product_tags?: string[] | undefined;
|
|
205
|
-
product_attributes?: Record<string, string | null> | undefined;
|
|
206
|
-
collections?: string[] | undefined;
|
|
207
|
-
} | undefined;
|
|
208
|
-
llm_model?: string | undefined;
|
|
209
|
-
severity_unweighted?: number | undefined;
|
|
210
|
-
recommendation_created_at?: string | undefined;
|
|
211
|
-
product_url?: string | undefined;
|
|
212
|
-
is_enabled?: boolean | undefined;
|
|
213
|
-
related_categories?: string[] | undefined;
|
|
214
|
-
lead_time_days?: number | undefined;
|
|
215
|
-
online_summary_with_citations?: string | undefined;
|
|
216
|
-
product_names?: string[] | undefined;
|
|
217
|
-
};
|
|
218
|
-
recommendationData: {
|
|
219
|
-
output_data: string;
|
|
220
|
-
original_data: string | null;
|
|
221
|
-
input_language: string;
|
|
222
|
-
output_language: string;
|
|
223
|
-
input_data: {
|
|
224
|
-
original_language_description: string;
|
|
225
|
-
old_translation: string;
|
|
226
|
-
product_feedback: string | null;
|
|
227
|
-
task_feedback: string | null;
|
|
228
|
-
tone_of_voice?: string | null | undefined;
|
|
229
|
-
company_description?: string | null | undefined;
|
|
230
|
-
};
|
|
231
|
-
input_health_score?: number | null | undefined;
|
|
232
|
-
output_health_score?: number | null | undefined;
|
|
233
|
-
};
|
|
234
|
-
cardPictureUrl?: string | undefined;
|
|
235
|
-
cardPictureAltText?: string | undefined;
|
|
236
|
-
cardSubtitle?: string | undefined;
|
|
237
|
-
mutedUntil?: Date | undefined;
|
|
238
|
-
feedback?: string | undefined;
|
|
239
|
-
statusDetails?: any;
|
|
240
|
-
editedRecommendationData?: {
|
|
241
|
-
recommendationData: {
|
|
242
|
-
output_data: string;
|
|
243
|
-
original_data: string | null;
|
|
244
|
-
input_language: string;
|
|
245
|
-
output_language: string;
|
|
246
|
-
input_health_score?: number | null | undefined;
|
|
247
|
-
output_health_score?: number | null | undefined;
|
|
248
|
-
};
|
|
249
|
-
} | undefined;
|
|
250
|
-
}>>;
|
|
251
|
-
export type TranslationRecommendation = z.infer<typeof TranslationRecommendationSchema>;
|
|
18
|
+
export type TranslationRecommendationData = z.infer<typeof TranslationRecommendationDataSchema>;
|
|
252
19
|
//# sourceMappingURL=translation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../../src/zod/recommendations/content-optimization/translation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../../src/zod/recommendations/content-optimization/translation.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAcpB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;iBAG9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { ProductRecommendationDataBaseSchema } from '../base';
|
|
3
|
+
const TranslationRecommendationInputSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
original_language_description: z.string(),
|
|
6
|
+
old_translation: z.string(),
|
|
7
|
+
product_feedback: z.string().nullable().optional(),
|
|
8
|
+
task_feedback: z.string().nullable().optional(),
|
|
9
|
+
tone_of_voice: z.string().nullable().optional(),
|
|
10
|
+
company_description: z.string().nullable().optional(),
|
|
11
|
+
})
|
|
12
|
+
.optional();
|
|
13
|
+
export const TranslationRecommendationDataSchema = ProductRecommendationDataBaseSchema.extend({
|
|
14
|
+
analyticsId: z.literal('content_optimization_translate_product_description_html'),
|
|
15
|
+
input_data: TranslationRecommendationInputSchema,
|
|
7
16
|
});
|
|
8
|
-
export const TranslationRecommendationData = ContentOptimizationRecommendationDataBaseSchema.extend({
|
|
9
|
-
input_data: z
|
|
10
|
-
.string()
|
|
11
|
-
.transform((str) => JSON.parse(str))
|
|
12
|
-
.pipe(z.object({
|
|
13
|
-
original_language_description: z.string(),
|
|
14
|
-
old_translation: z.string(),
|
|
15
|
-
product_feedback: z.string().nullable(),
|
|
16
|
-
task_feedback: z.string().nullable(),
|
|
17
|
-
tone_of_voice: z.string().nullable().optional(),
|
|
18
|
-
company_description: z.string().nullable().optional(),
|
|
19
|
-
})),
|
|
20
|
-
});
|
|
21
|
-
export const TranslationRecommendationSchema = ContentOptimizationRecommendationBaseSchema.merge(z.object({
|
|
22
|
-
metadata: TranslationMetadata,
|
|
23
|
-
recommendationData: TranslationRecommendationData,
|
|
24
|
-
})).transform(computeOutputData);
|
|
25
17
|
//# sourceMappingURL=translation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../../src/zod/recommendations/content-optimization/translation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../../src/zod/recommendations/content-optimization/translation.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAC,mCAAmC,EAAC,MAAM,SAAS,CAAC;AAE5D,MAAM,oCAAoC,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,6BAA6B,EAAE,CAAC,CAAC,MAAM,EAAE;IACzC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAClD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACtD,CAAC;KACD,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,mCAAmC,GAAG,mCAAmC,CAAC,MAAM,CAAC;IAC5F,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,yDAAyD,CAAC;IACjF,UAAU,EAAE,oCAAoC;CACjD,CAAC,CAAC"}
|