@ai-grator/api 0.1.37 → 0.1.38
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/admin.ts +18 -0
- package/admin/endpoints/commands/create-admin-model-family.command.ts +28 -0
- package/admin/endpoints/commands/create-admin-page.command.ts +56 -0
- package/admin/endpoints/commands/delete-admin-model-family.command.ts +29 -0
- package/admin/endpoints/commands/delete-admin-page.command.ts +28 -0
- package/admin/endpoints/commands/index.ts +8 -0
- package/admin/endpoints/commands/update-admin-model-family.command.ts +38 -0
- package/admin/endpoints/commands/update-admin-organization.command.ts +28 -0
- package/admin/endpoints/commands/update-admin-page-status.command.ts +37 -0
- package/admin/endpoints/commands/update-admin-page.command.ts +55 -0
- package/admin/endpoints/queries/get-admin-model-families.query.ts +22 -0
- package/admin/endpoints/queries/get-admin-organization.query.ts +21 -0
- package/admin/endpoints/queries/get-admin-page.query.ts +29 -0
- package/admin/endpoints/queries/get-admin-pages.query.ts +38 -0
- package/admin/endpoints/queries/index.ts +4 -0
- package/admin/models/admin-page-list-item.schema.ts +19 -0
- package/admin/models/admin-page-response.schema.ts +33 -0
- package/admin/models/index.ts +2 -0
- package/build/admin/endpoints/admin.d.ts +12 -0
- package/build/admin/endpoints/admin.d.ts.map +1 -1
- package/build/admin/endpoints/admin.js +15 -0
- package/build/admin/endpoints/commands/create-admin-model-family.command.d.ts +41 -0
- package/build/admin/endpoints/commands/create-admin-model-family.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/create-admin-model-family.command.js +24 -0
- package/build/admin/endpoints/commands/create-admin-page.command.d.ts +753 -0
- package/build/admin/endpoints/commands/create-admin-page.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/create-admin-page.command.js +44 -0
- package/build/admin/endpoints/commands/delete-admin-model-family.command.d.ts +27 -0
- package/build/admin/endpoints/commands/delete-admin-model-family.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/delete-admin-model-family.command.js +26 -0
- package/build/admin/endpoints/commands/delete-admin-page.command.d.ts +26 -0
- package/build/admin/endpoints/commands/delete-admin-page.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/delete-admin-page.command.js +25 -0
- package/build/admin/endpoints/commands/index.d.ts +8 -0
- package/build/admin/endpoints/commands/index.d.ts.map +1 -1
- package/build/admin/endpoints/commands/index.js +8 -0
- package/build/admin/endpoints/commands/update-admin-model-family.command.d.ts +49 -0
- package/build/admin/endpoints/commands/update-admin-model-family.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/update-admin-model-family.command.js +30 -0
- package/build/admin/endpoints/commands/update-admin-organization.command.d.ts +71 -0
- package/build/admin/endpoints/commands/update-admin-organization.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/update-admin-organization.command.js +24 -0
- package/build/admin/endpoints/commands/update-admin-page-status.command.d.ts +409 -0
- package/build/admin/endpoints/commands/update-admin-page-status.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/update-admin-page-status.command.js +32 -0
- package/build/admin/endpoints/commands/update-admin-page.command.d.ts +753 -0
- package/build/admin/endpoints/commands/update-admin-page.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/update-admin-page.command.js +50 -0
- package/build/admin/endpoints/queries/get-admin-model-families.query.d.ts +30 -0
- package/build/admin/endpoints/queries/get-admin-model-families.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-model-families.query.js +21 -0
- package/build/admin/endpoints/queries/get-admin-organization.query.d.ts +41 -0
- package/build/admin/endpoints/queries/get-admin-organization.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-organization.query.js +19 -0
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts +400 -0
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-page.query.js +26 -0
- package/build/admin/endpoints/queries/get-admin-pages.query.d.ts +74 -0
- package/build/admin/endpoints/queries/get-admin-pages.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-pages.query.js +35 -0
- package/build/admin/endpoints/queries/index.d.ts +4 -0
- package/build/admin/endpoints/queries/index.d.ts.map +1 -1
- package/build/admin/endpoints/queries/index.js +4 -0
- package/build/admin/models/admin-page-list-item.schema.d.ts +18 -0
- package/build/admin/models/admin-page-list-item.schema.d.ts.map +1 -0
- package/build/admin/models/admin-page-list-item.schema.js +19 -0
- package/build/admin/models/admin-page-response.schema.d.ts +192 -0
- package/build/admin/models/admin-page-response.schema.d.ts.map +1 -0
- package/build/admin/models/admin-page-response.schema.js +24 -0
- package/build/admin/models/index.d.ts +2 -0
- package/build/admin/models/index.d.ts.map +1 -1
- package/build/admin/models/index.js +2 -0
- package/build/errors/errors.d.ts +94 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +94 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts +60 -6
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts.map +1 -1
- package/build/model-page/enums/index.d.ts +6 -0
- package/build/model-page/enums/index.d.ts.map +1 -0
- package/build/model-page/enums/index.js +21 -0
- package/build/model-page/enums/page-locale.enum.d.ts +4 -0
- package/build/model-page/enums/page-locale.enum.d.ts.map +1 -0
- package/build/model-page/enums/page-locale.enum.js +7 -0
- package/build/model-page/enums/page-status.enum.d.ts +7 -0
- package/build/model-page/enums/page-status.enum.d.ts.map +1 -0
- package/build/model-page/enums/page-status.enum.js +10 -0
- package/build/model-page/enums/page-type.enum.d.ts +8 -0
- package/build/model-page/enums/page-type.enum.d.ts.map +1 -0
- package/build/model-page/enums/page-type.enum.js +11 -0
- package/build/model-page/enums/robots.enum.d.ts +9 -0
- package/build/model-page/enums/robots.enum.d.ts.map +1 -0
- package/build/model-page/enums/robots.enum.js +13 -0
- package/build/model-page/enums/twitter-card.enum.d.ts +5 -0
- package/build/model-page/enums/twitter-card.enum.d.ts.map +1 -0
- package/build/model-page/enums/twitter-card.enum.js +8 -0
- package/build/model-page/index.d.ts +1 -0
- package/build/model-page/index.d.ts.map +1 -1
- package/build/model-page/index.js +1 -0
- package/build/model-page/models/index.d.ts +3 -0
- package/build/model-page/models/index.d.ts.map +1 -1
- package/build/model-page/models/index.js +3 -0
- package/build/model-page/models/model-family.schema.d.ts +16 -0
- package/build/model-page/models/model-family.schema.d.ts.map +1 -0
- package/build/model-page/models/model-family.schema.js +16 -0
- package/build/model-page/models/public-model-detail.schema.d.ts +30 -3
- package/build/model-page/models/public-model-detail.schema.d.ts.map +1 -1
- package/build/model-page/models/public-model-detail.schema.js +7 -3
- package/build/model-page/models/schema-toggles.schema.d.ts +22 -0
- package/build/model-page/models/schema-toggles.schema.d.ts.map +1 -0
- package/build/model-page/models/schema-toggles.schema.js +22 -0
- package/build/model-page/models/seo-meta.schema.d.ts +84 -0
- package/build/model-page/models/seo-meta.schema.d.ts.map +1 -0
- package/build/model-page/models/seo-meta.schema.js +53 -0
- package/build/organization/endpoints/index.d.ts +3 -0
- package/build/organization/endpoints/index.d.ts.map +1 -0
- package/build/organization/endpoints/index.js +18 -0
- package/build/organization/endpoints/organization.d.ts +5 -0
- package/build/organization/endpoints/organization.d.ts.map +1 -0
- package/build/organization/endpoints/organization.js +7 -0
- package/build/organization/endpoints/queries/get-organization.query.d.ts +37 -0
- package/build/organization/endpoints/queries/get-organization.query.d.ts.map +1 -0
- package/build/organization/endpoints/queries/get-organization.query.js +17 -0
- package/build/organization/endpoints/queries/index.d.ts +2 -0
- package/build/organization/endpoints/queries/index.d.ts.map +1 -0
- package/build/organization/endpoints/queries/index.js +17 -0
- package/build/organization/index.d.ts +3 -0
- package/build/organization/index.d.ts.map +1 -0
- package/build/organization/index.js +18 -0
- package/build/organization/models/index.d.ts +2 -0
- package/build/organization/models/index.d.ts.map +1 -0
- package/build/organization/models/index.js +17 -0
- package/build/organization/models/organization.schema.d.ts +30 -0
- package/build/organization/models/organization.schema.d.ts.map +1 -0
- package/build/organization/models/organization.schema.js +20 -0
- package/build/scripts/generate-openapi.js +82 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/errors/errors.ts +94 -0
- package/index.ts +1 -0
- package/model-page/enums/index.ts +5 -0
- package/model-page/enums/page-locale.enum.ts +3 -0
- package/model-page/enums/page-status.enum.ts +6 -0
- package/model-page/enums/page-type.enum.ts +7 -0
- package/model-page/enums/robots.enum.ts +9 -0
- package/model-page/enums/twitter-card.enum.ts +4 -0
- package/model-page/index.ts +1 -0
- package/model-page/models/index.ts +3 -0
- package/model-page/models/model-family.schema.ts +18 -0
- package/model-page/models/public-model-detail.schema.ts +7 -3
- package/model-page/models/schema-toggles.schema.ts +25 -0
- package/model-page/models/seo-meta.schema.ts +64 -0
- package/organization/endpoints/index.ts +2 -0
- package/organization/endpoints/organization.ts +5 -0
- package/organization/endpoints/queries/get-organization.query.ts +16 -0
- package/organization/endpoints/queries/index.ts +1 -0
- package/organization/index.ts +2 -0
- package/organization/models/index.ts +1 -0
- package/organization/models/organization.schema.ts +22 -0
- package/package.json +1 -1
- package/scripts/generate-openapi.ts +136 -0
package/errors/errors.ts
CHANGED
|
@@ -873,6 +873,100 @@ export const ERRORS = {
|
|
|
873
873
|
code: 'MODEL_PAGE.PRICE_UNAVAILABLE',
|
|
874
874
|
message: 'Не удалось рассчитать цены для страницы модели',
|
|
875
875
|
},
|
|
876
|
+
NOT_FOUND: {
|
|
877
|
+
httpCode: 404,
|
|
878
|
+
code: 'MODEL_PAGE.NOT_FOUND',
|
|
879
|
+
message: 'Страница не найдена',
|
|
880
|
+
},
|
|
881
|
+
FIND_ERROR: {
|
|
882
|
+
httpCode: 500,
|
|
883
|
+
code: 'MODEL_PAGE.FIND_ERROR',
|
|
884
|
+
message: 'Не удалось получить страницы',
|
|
885
|
+
},
|
|
886
|
+
SLUG_ALREADY_EXISTS: {
|
|
887
|
+
httpCode: 409,
|
|
888
|
+
code: 'MODEL_PAGE.SLUG_ALREADY_EXISTS',
|
|
889
|
+
message: 'Страница с таким slug уже существует',
|
|
890
|
+
},
|
|
891
|
+
MODEL_ALREADY_LINKED: {
|
|
892
|
+
httpCode: 409,
|
|
893
|
+
code: 'MODEL_PAGE.MODEL_ALREADY_LINKED',
|
|
894
|
+
message: 'К этой модели уже привязана другая страница',
|
|
895
|
+
},
|
|
896
|
+
CREATE_ERROR: {
|
|
897
|
+
httpCode: 500,
|
|
898
|
+
code: 'MODEL_PAGE.CREATE_ERROR',
|
|
899
|
+
message: 'Не удалось создать страницу',
|
|
900
|
+
},
|
|
901
|
+
UPDATE_ERROR: {
|
|
902
|
+
httpCode: 500,
|
|
903
|
+
code: 'MODEL_PAGE.UPDATE_ERROR',
|
|
904
|
+
message: 'Не удалось обновить страницу',
|
|
905
|
+
},
|
|
906
|
+
DELETE_ERROR: {
|
|
907
|
+
httpCode: 500,
|
|
908
|
+
code: 'MODEL_PAGE.DELETE_ERROR',
|
|
909
|
+
message: 'Не удалось удалить страницу',
|
|
910
|
+
},
|
|
911
|
+
},
|
|
912
|
+
MODEL_FAMILY: {
|
|
913
|
+
NOT_FOUND: {
|
|
914
|
+
httpCode: 404,
|
|
915
|
+
code: 'MODEL_FAMILY.NOT_FOUND',
|
|
916
|
+
message: 'Семейство моделей не найдено',
|
|
917
|
+
},
|
|
918
|
+
FIND_ERROR: {
|
|
919
|
+
httpCode: 500,
|
|
920
|
+
code: 'MODEL_FAMILY.FIND_ERROR',
|
|
921
|
+
message: 'Не удалось получить семейства моделей',
|
|
922
|
+
},
|
|
923
|
+
NAME_ALREADY_EXISTS: {
|
|
924
|
+
httpCode: 409,
|
|
925
|
+
code: 'MODEL_FAMILY.NAME_ALREADY_EXISTS',
|
|
926
|
+
message: 'Семейство моделей с таким названием уже существует',
|
|
927
|
+
},
|
|
928
|
+
HAS_LINKED_PAGES: {
|
|
929
|
+
httpCode: 409,
|
|
930
|
+
code: 'MODEL_FAMILY.HAS_LINKED_PAGES',
|
|
931
|
+
message: 'Нельзя удалить семейство, к которому привязаны страницы',
|
|
932
|
+
},
|
|
933
|
+
CREATE_ERROR: {
|
|
934
|
+
httpCode: 500,
|
|
935
|
+
code: 'MODEL_FAMILY.CREATE_ERROR',
|
|
936
|
+
message: 'Не удалось создать семейство моделей',
|
|
937
|
+
},
|
|
938
|
+
UPDATE_ERROR: {
|
|
939
|
+
httpCode: 500,
|
|
940
|
+
code: 'MODEL_FAMILY.UPDATE_ERROR',
|
|
941
|
+
message: 'Не удалось обновить семейство моделей',
|
|
942
|
+
},
|
|
943
|
+
DELETE_ERROR: {
|
|
944
|
+
httpCode: 500,
|
|
945
|
+
code: 'MODEL_FAMILY.DELETE_ERROR',
|
|
946
|
+
message: 'Не удалось удалить семейство моделей',
|
|
947
|
+
},
|
|
948
|
+
},
|
|
949
|
+
ORGANIZATION: {
|
|
950
|
+
NOT_FOUND: {
|
|
951
|
+
httpCode: 404,
|
|
952
|
+
code: 'ORGANIZATION.NOT_FOUND',
|
|
953
|
+
message: 'Реквизиты организации не заполнены',
|
|
954
|
+
},
|
|
955
|
+
INCOMPLETE_DETAILS: {
|
|
956
|
+
httpCode: 400,
|
|
957
|
+
code: 'ORGANIZATION.INCOMPLETE_DETAILS',
|
|
958
|
+
message: 'Реквизиты организации ещё не заведены: заполните все поля целиком',
|
|
959
|
+
},
|
|
960
|
+
FIND_ERROR: {
|
|
961
|
+
httpCode: 500,
|
|
962
|
+
code: 'ORGANIZATION.FIND_ERROR',
|
|
963
|
+
message: 'Не удалось получить реквизиты организации',
|
|
964
|
+
},
|
|
965
|
+
UPDATE_ERROR: {
|
|
966
|
+
httpCode: 500,
|
|
967
|
+
code: 'ORGANIZATION.UPDATE_ERROR',
|
|
968
|
+
message: 'Не удалось обновить реквизиты организации',
|
|
969
|
+
},
|
|
876
970
|
},
|
|
877
971
|
USER_CONTEXT: {
|
|
878
972
|
FIND_ERROR: {
|
package/index.ts
CHANGED
package/model-page/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './page-card.schema';
|
|
2
2
|
export * from './page-content.schema';
|
|
3
|
+
export * from './seo-meta.schema';
|
|
4
|
+
export * from './schema-toggles.schema';
|
|
5
|
+
export * from './model-family.schema';
|
|
3
6
|
export * from './public-model-card.schema';
|
|
4
7
|
export * from './public-model-detail.schema';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MODEL_CATEGORY } from '../../model-catalog';
|
|
3
|
+
|
|
4
|
+
export const ModelFamilySchema = z.object({
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
name: z.string().min(1),
|
|
7
|
+
developer: z.string().min(1),
|
|
8
|
+
category: z.enum(MODEL_CATEGORY),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const ModelFamilyInputSchema = z.object({
|
|
12
|
+
name: z.string().min(1).max(255),
|
|
13
|
+
developer: z.string().min(1).max(255),
|
|
14
|
+
category: z.enum(MODEL_CATEGORY),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type ModelFamilySchemaType = z.infer<typeof ModelFamilySchema>;
|
|
18
|
+
export type ModelFamilyInputSchemaType = z.infer<typeof ModelFamilyInputSchema>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { FILE_TYPE } from '../../file';
|
|
3
|
+
import { ModelFamilySchema } from './model-family.schema';
|
|
3
4
|
import { PageCardSchema } from './page-card.schema';
|
|
4
5
|
import { PageContentSchema } from './page-content.schema';
|
|
5
6
|
import { PublicModelCardSchema } from './public-model-card.schema';
|
|
7
|
+
import { SchemaTogglesSchema } from './schema-toggles.schema';
|
|
8
|
+
import { PublicSeoMetaSchema } from './seo-meta.schema';
|
|
6
9
|
|
|
7
10
|
export const PublicChatModelCapabilitiesSchema = z.object({
|
|
8
11
|
reasoning: z.boolean(),
|
|
@@ -23,10 +26,11 @@ export const PublicGenerationModelDetailsSchema = z.object({
|
|
|
23
26
|
});
|
|
24
27
|
|
|
25
28
|
export const PublicModelDetailSchema = PublicModelCardSchema.extend({
|
|
26
|
-
h1: z.string().min(1),
|
|
27
29
|
card: PageCardSchema.nullable(),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
seo: PublicSeoMetaSchema,
|
|
31
|
+
schemaToggles: SchemaTogglesSchema,
|
|
32
|
+
family: ModelFamilySchema.nullable(),
|
|
33
|
+
versionName: z.string().min(1).nullable(),
|
|
30
34
|
content: PageContentSchema.nullable(),
|
|
31
35
|
chat: PublicChatModelDetailsSchema.nullable(),
|
|
32
36
|
generation: PublicGenerationModelDetailsSchema.nullable(),
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const SchemaTogglesSchema = z.object({
|
|
4
|
+
enableProductSchema: z.boolean(),
|
|
5
|
+
enableFAQSchema: z.boolean(),
|
|
6
|
+
enableBreadcrumbSchema: z.boolean(),
|
|
7
|
+
enableOrganizationSchema: z.boolean(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const DEFAULT_SCHEMA_TOGGLES = {
|
|
11
|
+
enableProductSchema: false,
|
|
12
|
+
enableFAQSchema: false,
|
|
13
|
+
enableBreadcrumbSchema: false,
|
|
14
|
+
enableOrganizationSchema: false,
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
export const SchemaTogglesInputSchema = z.object({
|
|
18
|
+
enableProductSchema: z.boolean().default(DEFAULT_SCHEMA_TOGGLES.enableProductSchema),
|
|
19
|
+
enableFAQSchema: z.boolean().default(DEFAULT_SCHEMA_TOGGLES.enableFAQSchema),
|
|
20
|
+
enableBreadcrumbSchema: z.boolean().default(DEFAULT_SCHEMA_TOGGLES.enableBreadcrumbSchema),
|
|
21
|
+
enableOrganizationSchema: z.boolean().default(DEFAULT_SCHEMA_TOGGLES.enableOrganizationSchema),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type SchemaTogglesSchemaType = z.infer<typeof SchemaTogglesSchema>;
|
|
25
|
+
export type SchemaTogglesInputSchemaType = z.infer<typeof SchemaTogglesInputSchema>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ROBOTS_FOLLOW, ROBOTS_INDEX, TWITTER_CARD } from '../enums';
|
|
3
|
+
|
|
4
|
+
export const CANONICAL_URL_AUTO = 'auto' as const;
|
|
5
|
+
|
|
6
|
+
export const SEO_TITLE_MAX_LENGTH = 70;
|
|
7
|
+
export const SEO_META_DESCRIPTION_MAX_LENGTH = 160;
|
|
8
|
+
|
|
9
|
+
export const HreflangAlternateSchema = z.object({
|
|
10
|
+
locale: z.string().min(1),
|
|
11
|
+
url: z.url(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const CanonicalUrlSchema = z.union([z.literal(CANONICAL_URL_AUTO), z.url()]);
|
|
15
|
+
|
|
16
|
+
export const SeoMetaSchema = z.object({
|
|
17
|
+
title: z.string().min(1),
|
|
18
|
+
metaDescription: z.string().min(1),
|
|
19
|
+
h1: z.string().min(1),
|
|
20
|
+
focusKeyword: z.string().min(1).nullable(),
|
|
21
|
+
canonicalUrl: CanonicalUrlSchema,
|
|
22
|
+
robotsIndex: z.enum(ROBOTS_INDEX),
|
|
23
|
+
robotsFollow: z.enum(ROBOTS_FOLLOW),
|
|
24
|
+
ogTitle: z.string().min(1).nullable(),
|
|
25
|
+
ogDescription: z.string().min(1).nullable(),
|
|
26
|
+
ogImage: z.string().min(1),
|
|
27
|
+
twitterCard: z.enum(TWITTER_CARD),
|
|
28
|
+
hreflangAlternates: z.array(HreflangAlternateSchema),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const PublicSeoMetaSchema = SeoMetaSchema.extend({
|
|
32
|
+
metaDescription: z.string().min(1).nullable(),
|
|
33
|
+
ogTitle: z.string().min(1),
|
|
34
|
+
ogDescription: z.string().min(1).nullable(),
|
|
35
|
+
ogImage: z.string().min(1).nullable(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const DraftSeoMetaSchema = SeoMetaSchema.extend({
|
|
39
|
+
title: z.string().min(1).nullable(),
|
|
40
|
+
metaDescription: z.string().min(1).nullable(),
|
|
41
|
+
h1: z.string().min(1).nullable(),
|
|
42
|
+
ogImage: z.string().min(1).nullable(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const SeoMetaInputSchema = z.object({
|
|
46
|
+
title: z.string().min(1),
|
|
47
|
+
metaDescription: z.string().min(1),
|
|
48
|
+
h1: z.string().min(1),
|
|
49
|
+
focusKeyword: z.string().min(1).nullable().default(null),
|
|
50
|
+
canonicalUrl: CanonicalUrlSchema.default(CANONICAL_URL_AUTO),
|
|
51
|
+
robotsIndex: z.enum(ROBOTS_INDEX).default(ROBOTS_INDEX.INDEX),
|
|
52
|
+
robotsFollow: z.enum(ROBOTS_FOLLOW).default(ROBOTS_FOLLOW.FOLLOW),
|
|
53
|
+
ogTitle: z.string().min(1).nullable().default(null),
|
|
54
|
+
ogDescription: z.string().min(1).nullable().default(null),
|
|
55
|
+
ogImage: z.string().min(1),
|
|
56
|
+
twitterCard: z.enum(TWITTER_CARD).default(TWITTER_CARD.SUMMARY_LARGE_IMAGE),
|
|
57
|
+
hreflangAlternates: z.array(HreflangAlternateSchema).default([]),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export type HreflangAlternateSchemaType = z.infer<typeof HreflangAlternateSchema>;
|
|
61
|
+
export type SeoMetaSchemaType = z.infer<typeof SeoMetaSchema>;
|
|
62
|
+
export type PublicSeoMetaSchemaType = z.infer<typeof PublicSeoMetaSchema>;
|
|
63
|
+
export type DraftSeoMetaSchemaType = z.infer<typeof DraftSeoMetaSchema>;
|
|
64
|
+
export type SeoMetaInputSchemaType = z.infer<typeof SeoMetaInputSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
2
|
+
import { OrganizationSchema } from '../../models';
|
|
3
|
+
import { ORGANIZATION_ROUTES } from '../organization';
|
|
4
|
+
|
|
5
|
+
export const GetOrganizationQueryResponse = OrganizationSchema;
|
|
6
|
+
|
|
7
|
+
export const GetOrganizationQuery = defineContract({
|
|
8
|
+
method: HTTP_METHODS.GET,
|
|
9
|
+
path: ORGANIZATION_ROUTES.GET,
|
|
10
|
+
summary: 'Get organization details',
|
|
11
|
+
responses: {
|
|
12
|
+
200: GetOrganizationQueryResponse,
|
|
13
|
+
404: HttpErrorResponseSchema,
|
|
14
|
+
500: HttpErrorResponseSchema,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-organization.query';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './organization.schema';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const OrganizationSchema = z.object({
|
|
4
|
+
legalName: z.string().min(1),
|
|
5
|
+
inn: z.string().min(1),
|
|
6
|
+
ogrn: z.string().min(1),
|
|
7
|
+
legalAddress: z.string().min(1),
|
|
8
|
+
phone: z.string().min(1),
|
|
9
|
+
email: z.email(),
|
|
10
|
+
paymentBadges: z.array(z.string().min(1)),
|
|
11
|
+
supportChatUrl: z.url(),
|
|
12
|
+
offerUrl: z.url(),
|
|
13
|
+
privacyUrl: z.url(),
|
|
14
|
+
consentUrl: z.url(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const OrganizationInputSchema = OrganizationSchema.partial().refine((value) => Object.keys(value).length > 0, {
|
|
18
|
+
message: 'At least one field is required',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type OrganizationSchemaType = z.infer<typeof OrganizationSchema>;
|
|
22
|
+
export type OrganizationInputSchemaType = z.infer<typeof OrganizationInputSchema>;
|
package/package.json
CHANGED
|
@@ -214,6 +214,72 @@ import {
|
|
|
214
214
|
CreatePaymentCommandBody,
|
|
215
215
|
CreatePaymentCommandResponse,
|
|
216
216
|
} from '../payment/endpoints/commands/create-payment.command';
|
|
217
|
+
import { ORGANIZATION_CONTROLLER } from '../organization/endpoints/organization';
|
|
218
|
+
import {
|
|
219
|
+
GetOrganizationQuery,
|
|
220
|
+
GetOrganizationQueryResponse,
|
|
221
|
+
} from '../organization/endpoints/queries/get-organization.query';
|
|
222
|
+
import {
|
|
223
|
+
CreateAdminPageCommand,
|
|
224
|
+
CreateAdminPageCommandBody,
|
|
225
|
+
CreateAdminPageCommandResponse,
|
|
226
|
+
} from '../admin/endpoints/commands/create-admin-page.command';
|
|
227
|
+
import {
|
|
228
|
+
UpdateAdminPageCommand,
|
|
229
|
+
UpdateAdminPageCommandBody,
|
|
230
|
+
UpdateAdminPageCommandParams,
|
|
231
|
+
UpdateAdminPageCommandResponse,
|
|
232
|
+
} from '../admin/endpoints/commands/update-admin-page.command';
|
|
233
|
+
import {
|
|
234
|
+
UpdateAdminPageStatusCommand,
|
|
235
|
+
UpdateAdminPageStatusCommandBody,
|
|
236
|
+
UpdateAdminPageStatusCommandParams,
|
|
237
|
+
UpdateAdminPageStatusCommandResponse,
|
|
238
|
+
} from '../admin/endpoints/commands/update-admin-page-status.command';
|
|
239
|
+
import {
|
|
240
|
+
DeleteAdminPageCommand,
|
|
241
|
+
DeleteAdminPageCommandParams,
|
|
242
|
+
DeleteAdminPageCommandResponse,
|
|
243
|
+
} from '../admin/endpoints/commands/delete-admin-page.command';
|
|
244
|
+
import {
|
|
245
|
+
CreateAdminModelFamilyCommand,
|
|
246
|
+
CreateAdminModelFamilyCommandBody,
|
|
247
|
+
CreateAdminModelFamilyCommandResponse,
|
|
248
|
+
} from '../admin/endpoints/commands/create-admin-model-family.command';
|
|
249
|
+
import {
|
|
250
|
+
UpdateAdminModelFamilyCommand,
|
|
251
|
+
UpdateAdminModelFamilyCommandBody,
|
|
252
|
+
UpdateAdminModelFamilyCommandParams,
|
|
253
|
+
UpdateAdminModelFamilyCommandResponse,
|
|
254
|
+
} from '../admin/endpoints/commands/update-admin-model-family.command';
|
|
255
|
+
import {
|
|
256
|
+
DeleteAdminModelFamilyCommand,
|
|
257
|
+
DeleteAdminModelFamilyCommandParams,
|
|
258
|
+
DeleteAdminModelFamilyCommandResponse,
|
|
259
|
+
} from '../admin/endpoints/commands/delete-admin-model-family.command';
|
|
260
|
+
import {
|
|
261
|
+
UpdateAdminOrganizationCommand,
|
|
262
|
+
UpdateAdminOrganizationCommandBody,
|
|
263
|
+
UpdateAdminOrganizationCommandResponse,
|
|
264
|
+
} from '../admin/endpoints/commands/update-admin-organization.command';
|
|
265
|
+
import {
|
|
266
|
+
GetAdminPagesQuery,
|
|
267
|
+
GetAdminPagesQueryQuery,
|
|
268
|
+
GetAdminPagesQueryResponse,
|
|
269
|
+
} from '../admin/endpoints/queries/get-admin-pages.query';
|
|
270
|
+
import {
|
|
271
|
+
GetAdminPageQuery,
|
|
272
|
+
GetAdminPageQueryParams,
|
|
273
|
+
GetAdminPageQueryResponse,
|
|
274
|
+
} from '../admin/endpoints/queries/get-admin-page.query';
|
|
275
|
+
import {
|
|
276
|
+
GetAdminModelFamiliesQuery,
|
|
277
|
+
GetAdminModelFamiliesQueryResponse,
|
|
278
|
+
} from '../admin/endpoints/queries/get-admin-model-families.query';
|
|
279
|
+
import {
|
|
280
|
+
GetAdminOrganizationQuery,
|
|
281
|
+
GetAdminOrganizationQueryResponse,
|
|
282
|
+
} from '../admin/endpoints/queries/get-admin-organization.query';
|
|
217
283
|
import { AI_MODELS_CONTROLLER } from '../ai-model/endpoints/ai-model';
|
|
218
284
|
import { PUBLIC_MODEL_CONTROLLER } from '../model-page/endpoints/model-page';
|
|
219
285
|
import {
|
|
@@ -572,6 +638,32 @@ async function main() {
|
|
|
572
638
|
registerSchema('MarketplaceCardHistoryQuery', GetMarketplaceCardHistoryQueryQuery);
|
|
573
639
|
registerSchema('MarketplaceCardHistoryResponse', GetMarketplaceCardHistoryQueryResponse);
|
|
574
640
|
registerSchema('MarketplaceCardConfigResponse', GetMarketplaceCardConfigResponse);
|
|
641
|
+
registerSchema('AdminGetPagesQuery', GetAdminPagesQueryQuery);
|
|
642
|
+
registerSchema('AdminGetPagesResponse', GetAdminPagesQueryResponse);
|
|
643
|
+
registerSchema('AdminGetPageParams', GetAdminPageQueryParams);
|
|
644
|
+
registerSchema('AdminGetPageResponse', GetAdminPageQueryResponse);
|
|
645
|
+
registerSchema('AdminCreatePageRequest', CreateAdminPageCommandBody);
|
|
646
|
+
registerSchema('AdminCreatePageResponse', CreateAdminPageCommandResponse);
|
|
647
|
+
registerSchema('AdminUpdatePageParams', UpdateAdminPageCommandParams);
|
|
648
|
+
registerSchema('AdminUpdatePageRequest', UpdateAdminPageCommandBody);
|
|
649
|
+
registerSchema('AdminUpdatePageResponse', UpdateAdminPageCommandResponse);
|
|
650
|
+
registerSchema('AdminUpdatePageStatusParams', UpdateAdminPageStatusCommandParams);
|
|
651
|
+
registerSchema('AdminUpdatePageStatusRequest', UpdateAdminPageStatusCommandBody);
|
|
652
|
+
registerSchema('AdminUpdatePageStatusResponse', UpdateAdminPageStatusCommandResponse);
|
|
653
|
+
registerSchema('AdminDeletePageParams', DeleteAdminPageCommandParams);
|
|
654
|
+
registerSchema('AdminDeletePageResponse', DeleteAdminPageCommandResponse);
|
|
655
|
+
registerSchema('AdminGetModelFamiliesResponse', GetAdminModelFamiliesQueryResponse);
|
|
656
|
+
registerSchema('AdminCreateModelFamilyRequest', CreateAdminModelFamilyCommandBody);
|
|
657
|
+
registerSchema('AdminCreateModelFamilyResponse', CreateAdminModelFamilyCommandResponse);
|
|
658
|
+
registerSchema('AdminUpdateModelFamilyParams', UpdateAdminModelFamilyCommandParams);
|
|
659
|
+
registerSchema('AdminUpdateModelFamilyRequest', UpdateAdminModelFamilyCommandBody);
|
|
660
|
+
registerSchema('AdminUpdateModelFamilyResponse', UpdateAdminModelFamilyCommandResponse);
|
|
661
|
+
registerSchema('AdminDeleteModelFamilyParams', DeleteAdminModelFamilyCommandParams);
|
|
662
|
+
registerSchema('AdminDeleteModelFamilyResponse', DeleteAdminModelFamilyCommandResponse);
|
|
663
|
+
registerSchema('AdminGetOrganizationResponse', GetAdminOrganizationQueryResponse);
|
|
664
|
+
registerSchema('AdminUpdateOrganizationRequest', UpdateAdminOrganizationCommandBody);
|
|
665
|
+
registerSchema('AdminUpdateOrganizationResponse', UpdateAdminOrganizationCommandResponse);
|
|
666
|
+
registerSchema('OrganizationGetResponse', GetOrganizationQueryResponse);
|
|
575
667
|
registerSchema('UserContextGetResponse', GetUserContextQueryResponse);
|
|
576
668
|
registerSchema('UserContextUpsertRequest', UpsertUserContextCommandBody);
|
|
577
669
|
registerSchema('UserContextUpsertResponse', UpsertUserContextCommandResponse);
|
|
@@ -669,7 +761,20 @@ async function main() {
|
|
|
669
761
|
GetAdminSupportChatMessagesQuery,
|
|
670
762
|
SendAdminSupportReplyCommand,
|
|
671
763
|
MarkAdminSupportChatReadCommand,
|
|
764
|
+
GetAdminPagesQuery,
|
|
765
|
+
GetAdminPageQuery,
|
|
766
|
+
CreateAdminPageCommand,
|
|
767
|
+
UpdateAdminPageCommand,
|
|
768
|
+
UpdateAdminPageStatusCommand,
|
|
769
|
+
DeleteAdminPageCommand,
|
|
770
|
+
GetAdminModelFamiliesQuery,
|
|
771
|
+
CreateAdminModelFamilyCommand,
|
|
772
|
+
UpdateAdminModelFamilyCommand,
|
|
773
|
+
DeleteAdminModelFamilyCommand,
|
|
774
|
+
GetAdminOrganizationQuery,
|
|
775
|
+
UpdateAdminOrganizationCommand,
|
|
672
776
|
];
|
|
777
|
+
const organizationContracts: HttpContract[] = [GetOrganizationQuery];
|
|
673
778
|
|
|
674
779
|
for (const contract of authContracts) {
|
|
675
780
|
const method = contract.method.toLowerCase();
|
|
@@ -1139,6 +1244,37 @@ async function main() {
|
|
|
1139
1244
|
});
|
|
1140
1245
|
}
|
|
1141
1246
|
|
|
1247
|
+
for (const contract of organizationContracts) {
|
|
1248
|
+
const method = contract.method.toLowerCase();
|
|
1249
|
+
if (!supportedHttpMethods.has(method)) {
|
|
1250
|
+
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
registry.registerPath({
|
|
1254
|
+
method: method as 'get' | 'post' | 'put' | 'patch' | 'delete',
|
|
1255
|
+
path: toOpenApiPath(ORGANIZATION_CONTROLLER, contract.path),
|
|
1256
|
+
summary: contract.summary,
|
|
1257
|
+
tags: ['Organization'],
|
|
1258
|
+
request: {
|
|
1259
|
+
...(contract.request?.body
|
|
1260
|
+
? {
|
|
1261
|
+
body: {
|
|
1262
|
+
required: true,
|
|
1263
|
+
content: {
|
|
1264
|
+
'application/json': {
|
|
1265
|
+
schema: resolveSchema(contract.request.body),
|
|
1266
|
+
},
|
|
1267
|
+
},
|
|
1268
|
+
},
|
|
1269
|
+
}
|
|
1270
|
+
: {}),
|
|
1271
|
+
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
1272
|
+
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
1273
|
+
},
|
|
1274
|
+
responses: buildResponses(contract.responses, resolveSchema),
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1142
1278
|
for (const contract of userContextContracts) {
|
|
1143
1279
|
const method = contract.method.toLowerCase();
|
|
1144
1280
|
if (!supportedHttpMethods.has(method)) {
|