@ai-grator/api 0.1.47 → 0.1.48
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/admin/endpoints/commands/create-admin-page.command.ts +1 -1
- package/admin/endpoints/commands/update-admin-page.command.ts +11 -2
- package/admin/models/admin-page-issue.schema.ts +15 -0
- package/admin/models/admin-page-response.schema.ts +2 -0
- package/admin/models/index.ts +1 -0
- package/build/admin/endpoints/commands/create-admin-page.command.d.ts +28 -12
- package/build/admin/endpoints/commands/create-admin-page.command.d.ts.map +1 -1
- package/build/admin/endpoints/commands/create-admin-page.command.js +1 -1
- package/build/admin/endpoints/commands/update-admin-page-status.command.d.ts +16 -0
- package/build/admin/endpoints/commands/update-admin-page-status.command.d.ts.map +1 -1
- package/build/admin/endpoints/commands/update-admin-page.command.d.ts +51 -30
- package/build/admin/endpoints/commands/update-admin-page.command.d.ts.map +1 -1
- package/build/admin/endpoints/commands/update-admin-page.command.js +3 -1
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts +16 -0
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts.map +1 -1
- package/build/admin/models/admin-page-issue.schema.d.ts +16 -0
- package/build/admin/models/admin-page-issue.schema.d.ts.map +1 -0
- package/build/admin/models/admin-page-issue.schema.js +13 -0
- package/build/admin/models/admin-page-response.schema.d.ts +8 -0
- package/build/admin/models/admin-page-response.schema.d.ts.map +1 -1
- package/build/admin/models/admin-page-response.schema.js +2 -0
- package/build/admin/models/index.d.ts +1 -0
- package/build/admin/models/index.d.ts.map +1 -1
- package/build/admin/models/index.js +1 -0
- package/build/errors/errors.d.ts +5 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +5 -0
- package/build/model-page/models/seo-meta.schema.d.ts +24 -4
- package/build/model-page/models/seo-meta.schema.d.ts.map +1 -1
- package/build/model-page/models/seo-meta.schema.js +7 -5
- package/build/tsconfig.tsbuildinfo +1 -1
- package/errors/errors.ts +5 -0
- package/model-page/models/seo-meta.schema.ts +11 -4
- package/package.json +1 -1
package/errors/errors.ts
CHANGED
|
@@ -893,6 +893,11 @@ export const ERRORS = {
|
|
|
893
893
|
code: 'MODEL_PAGE.MODEL_ALREADY_LINKED',
|
|
894
894
|
message: 'К этой модели уже привязана другая страница',
|
|
895
895
|
},
|
|
896
|
+
SEO_INCOMPLETE: {
|
|
897
|
+
httpCode: 409,
|
|
898
|
+
code: 'MODEL_PAGE.SEO_INCOMPLETE',
|
|
899
|
+
message: 'Нельзя опубликовать страницу с незаполненными title, h1 и meta description',
|
|
900
|
+
},
|
|
896
901
|
CREATE_ERROR: {
|
|
897
902
|
httpCode: 500,
|
|
898
903
|
code: 'MODEL_PAGE.CREATE_ERROR',
|
|
@@ -43,22 +43,29 @@ export const DraftSeoMetaSchema = SeoMetaSchema.extend({
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
export const SeoMetaInputSchema = z.object({
|
|
46
|
-
title: z.string().min(1),
|
|
47
|
-
metaDescription: z.string().min(1),
|
|
48
|
-
h1: z.string().min(1),
|
|
46
|
+
title: z.string().min(1).nullable().default(null),
|
|
47
|
+
metaDescription: z.string().min(1).nullable().default(null),
|
|
48
|
+
h1: z.string().min(1).nullable().default(null),
|
|
49
49
|
focusKeyword: z.string().min(1).nullable().default(null),
|
|
50
50
|
canonicalUrl: CanonicalUrlSchema.default(CANONICAL_URL_AUTO),
|
|
51
51
|
robotsIndex: z.enum(ROBOTS_INDEX).default(ROBOTS_INDEX.INDEX),
|
|
52
52
|
robotsFollow: z.enum(ROBOTS_FOLLOW).default(ROBOTS_FOLLOW.FOLLOW),
|
|
53
53
|
ogTitle: z.string().min(1).nullable().default(null),
|
|
54
54
|
ogDescription: z.string().min(1).nullable().default(null),
|
|
55
|
-
ogImage: z.string().min(1),
|
|
55
|
+
ogImage: z.string().min(1).nullable().default(null),
|
|
56
56
|
twitterCard: z.enum(TWITTER_CARD).default(TWITTER_CARD.SUMMARY_LARGE_IMAGE),
|
|
57
57
|
hreflangAlternates: z.array(HreflangAlternateSchema).default([]),
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
export const SeoMetaPatchSchema = DraftSeoMetaSchema.partial();
|
|
61
|
+
|
|
62
|
+
export const PUBLICATION_REQUIRED_SEO_FIELDS = ['title', 'h1', 'metaDescription'] as const;
|
|
63
|
+
|
|
64
|
+
export type PublicationRequiredSeoField = (typeof PUBLICATION_REQUIRED_SEO_FIELDS)[number];
|
|
65
|
+
|
|
60
66
|
export type HreflangAlternateSchemaType = z.infer<typeof HreflangAlternateSchema>;
|
|
61
67
|
export type SeoMetaSchemaType = z.infer<typeof SeoMetaSchema>;
|
|
62
68
|
export type PublicSeoMetaSchemaType = z.infer<typeof PublicSeoMetaSchema>;
|
|
63
69
|
export type DraftSeoMetaSchemaType = z.infer<typeof DraftSeoMetaSchema>;
|
|
64
70
|
export type SeoMetaInputSchemaType = z.infer<typeof SeoMetaInputSchema>;
|
|
71
|
+
export type SeoMetaPatchSchemaType = z.infer<typeof SeoMetaPatchSchema>;
|