@ai-grator/api 0.1.38 → 0.1.40
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/build/admin/endpoints/commands/create-admin-page.command.d.ts +48 -0
- package/build/admin/endpoints/commands/create-admin-page.command.d.ts.map +1 -1
- package/build/admin/endpoints/commands/update-admin-page-status.command.d.ts +24 -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 +48 -0
- package/build/admin/endpoints/commands/update-admin-page.command.d.ts.map +1 -1
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts +24 -0
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts.map +1 -1
- package/build/admin/models/admin-page-response.schema.d.ts +12 -0
- package/build/admin/models/admin-page-response.schema.d.ts.map +1 -1
- package/build/errors/errors.d.ts +7 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +7 -0
- package/build/generation-job/endpoints/commands/create-generation-job.command.d.ts +2 -2
- package/build/generation-job/endpoints/commands/update-generation-job.command.d.ts +2 -2
- package/build/generation-job/endpoints/queries/get-generation-job-by-uuid.query.d.ts +2 -2
- package/build/generation-job/endpoints/queries/get-generation-job-history.query.d.ts +3 -3
- package/build/generation-job/endpoints/queries/get-generation-jobs.query.d.ts +2 -2
- package/build/generation-job/models/generation-job-attachment-file.schema.d.ts +2 -2
- package/build/generation-job/models/generation-job-response.schema.d.ts +1 -1
- 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/model-page.d.ts +4 -0
- package/build/model-page/endpoints/model-page.d.ts.map +1 -1
- package/build/model-page/endpoints/model-page.js +5 -1
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts +24 -0
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts.map +1 -1
- package/build/model-page/endpoints/queries/get-public-page-by-slug.query.d.ts +387 -0
- package/build/model-page/endpoints/queries/get-public-page-by-slug.query.d.ts.map +1 -0
- package/build/model-page/endpoints/queries/get-public-page-by-slug.query.js +25 -0
- package/build/model-page/endpoints/queries/index.d.ts +1 -0
- package/build/model-page/endpoints/queries/index.d.ts.map +1 -1
- package/build/model-page/endpoints/queries/index.js +1 -0
- package/build/model-page/models/index.d.ts +1 -0
- package/build/model-page/models/index.d.ts.map +1 -1
- package/build/model-page/models/index.js +1 -0
- package/build/model-page/models/page-content.schema.d.ts +37 -0
- package/build/model-page/models/page-content.schema.d.ts.map +1 -1
- package/build/model-page/models/page-content.schema.js +13 -1
- package/build/model-page/models/public-model-detail.schema.d.ts +12 -0
- package/build/model-page/models/public-model-detail.schema.d.ts.map +1 -1
- package/build/model-page/models/public-page.schema.d.ts +187 -0
- package/build/model-page/models/public-page.schema.d.ts.map +1 -0
- package/build/model-page/models/public-page.schema.js +16 -0
- package/build/pricing-page/endpoints/index.d.ts +3 -0
- package/build/pricing-page/endpoints/index.d.ts.map +1 -0
- package/build/pricing-page/endpoints/index.js +18 -0
- package/build/pricing-page/endpoints/pricing-page.d.ts +5 -0
- package/build/pricing-page/endpoints/pricing-page.d.ts.map +1 -0
- package/build/pricing-page/endpoints/pricing-page.js +7 -0
- package/build/pricing-page/endpoints/queries/get-pricing-page.query.d.ts +132 -0
- package/build/pricing-page/endpoints/queries/get-pricing-page.query.d.ts.map +1 -0
- package/build/pricing-page/endpoints/queries/get-pricing-page.query.js +16 -0
- package/build/pricing-page/endpoints/queries/index.d.ts +2 -0
- package/build/pricing-page/endpoints/queries/index.d.ts.map +1 -0
- package/build/pricing-page/endpoints/queries/index.js +17 -0
- package/build/pricing-page/index.d.ts +3 -0
- package/build/pricing-page/index.d.ts.map +1 -0
- package/build/pricing-page/index.js +18 -0
- package/build/pricing-page/models/index.d.ts +9 -0
- package/build/pricing-page/models/index.d.ts.map +1 -0
- package/build/pricing-page/models/index.js +24 -0
- package/build/pricing-page/models/pricing-breadcrumb-item.schema.d.ts +7 -0
- package/build/pricing-page/models/pricing-breadcrumb-item.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-breadcrumb-item.schema.js +8 -0
- package/build/pricing-page/models/pricing-calculator-task.schema.d.ts +48 -0
- package/build/pricing-page/models/pricing-calculator-task.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-calculator-task.schema.js +27 -0
- package/build/pricing-page/models/pricing-faq-item.schema.d.ts +7 -0
- package/build/pricing-page/models/pricing-faq-item.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-faq-item.schema.js +8 -0
- package/build/pricing-page/models/pricing-image-model.schema.d.ts +10 -0
- package/build/pricing-page/models/pricing-image-model.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-image-model.schema.js +11 -0
- package/build/pricing-page/models/pricing-models.schema.d.ts +45 -0
- package/build/pricing-page/models/pricing-models.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-models.schema.js +17 -0
- package/build/pricing-page/models/pricing-page.schema.d.ts +64 -0
- package/build/pricing-page/models/pricing-page.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-page.schema.js +15 -0
- package/build/pricing-page/models/pricing-text-model.schema.d.ts +10 -0
- package/build/pricing-page/models/pricing-text-model.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-text-model.schema.js +11 -0
- package/build/pricing-page/models/pricing-video-model.schema.d.ts +13 -0
- package/build/pricing-page/models/pricing-video-model.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-video-model.schema.js +14 -0
- package/build/scripts/generate-openapi.js +67 -491
- package/build/tsconfig.tsbuildinfo +1 -1
- package/errors/errors.ts +7 -0
- package/index.ts +1 -0
- package/model-page/endpoints/model-page.ts +6 -0
- package/model-page/endpoints/queries/get-public-page-by-slug.query.ts +28 -0
- package/model-page/endpoints/queries/index.ts +1 -0
- package/model-page/models/index.ts +1 -0
- package/model-page/models/page-content.schema.ts +15 -0
- package/model-page/models/public-page.schema.ts +17 -0
- package/package.json +1 -1
- package/pricing-page/endpoints/index.ts +2 -0
- package/pricing-page/endpoints/pricing-page.ts +5 -0
- package/pricing-page/endpoints/queries/get-pricing-page.query.ts +15 -0
- package/pricing-page/endpoints/queries/index.ts +1 -0
- package/pricing-page/index.ts +2 -0
- package/pricing-page/models/index.ts +8 -0
- package/pricing-page/models/pricing-breadcrumb-item.schema.ts +8 -0
- package/pricing-page/models/pricing-calculator-task.schema.ts +34 -0
- package/pricing-page/models/pricing-faq-item.schema.ts +8 -0
- package/pricing-page/models/pricing-image-model.schema.ts +11 -0
- package/pricing-page/models/pricing-models.schema.ts +19 -0
- package/pricing-page/models/pricing-page.schema.ts +15 -0
- package/pricing-page/models/pricing-text-model.schema.ts +11 -0
- package/pricing-page/models/pricing-video-model.schema.ts +14 -0
- package/scripts/generate-openapi.ts +97 -526
package/errors/errors.ts
CHANGED
|
@@ -909,6 +909,13 @@ export const ERRORS = {
|
|
|
909
909
|
message: 'Не удалось удалить страницу',
|
|
910
910
|
},
|
|
911
911
|
},
|
|
912
|
+
PRICING_PAGE: {
|
|
913
|
+
FIND_ERROR: {
|
|
914
|
+
httpCode: 500,
|
|
915
|
+
code: 'PRICING_PAGE.FIND_ERROR',
|
|
916
|
+
message: 'Не удалось получить данные страницы цен',
|
|
917
|
+
},
|
|
918
|
+
},
|
|
912
919
|
MODEL_FAMILY: {
|
|
913
920
|
NOT_FOUND: {
|
|
914
921
|
httpCode: 404,
|
package/index.ts
CHANGED
|
@@ -4,3 +4,9 @@ export const PUBLIC_MODEL_ROUTES = {
|
|
|
4
4
|
LIST: '',
|
|
5
5
|
GET_BY_SLUG: (slug: string) => `${slug}`,
|
|
6
6
|
} as const;
|
|
7
|
+
|
|
8
|
+
export const PUBLIC_PAGE_CONTROLLER = 'pages' as const;
|
|
9
|
+
|
|
10
|
+
export const PUBLIC_PAGE_ROUTES = {
|
|
11
|
+
GET_BY_SLUG: (slug: string) => `${slug}`,
|
|
12
|
+
} as const;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PublicPageSchema } from '../../models';
|
|
4
|
+
import { PUBLIC_PAGE_ROUTES } from '../model-page';
|
|
5
|
+
|
|
6
|
+
export const GetPublicPageBySlugQueryParams = z.object({
|
|
7
|
+
slug: z.string().min(1),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const GetPublicPageBySlugQueryResponse = PublicPageSchema;
|
|
11
|
+
|
|
12
|
+
export const GetPublicPageBySlugQuery = defineContract({
|
|
13
|
+
method: HTTP_METHODS.GET,
|
|
14
|
+
path: PUBLIC_PAGE_ROUTES.GET_BY_SLUG(':slug'),
|
|
15
|
+
summary: 'Get published static or hub page by slug',
|
|
16
|
+
request: {
|
|
17
|
+
params: GetPublicPageBySlugQueryParams,
|
|
18
|
+
},
|
|
19
|
+
responses: {
|
|
20
|
+
200: GetPublicPageBySlugQueryResponse,
|
|
21
|
+
404: HttpErrorResponseSchema,
|
|
22
|
+
500: HttpErrorResponseSchema,
|
|
23
|
+
503: HttpErrorResponseSchema,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type GetPublicPageBySlugQueryParamsType = z.infer<typeof GetPublicPageBySlugQueryParams>;
|
|
28
|
+
export type GetPublicPageBySlugQueryResponseType = z.infer<typeof GetPublicPageBySlugQueryResponse>;
|
|
@@ -166,6 +166,20 @@ export const PricingWidgetBlockSchema = BlockBaseSchema.extend({
|
|
|
166
166
|
ctaSlug: z.string().min(1),
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
+
export const PricingTableBlockSchema = BlockBaseSchema.extend({
|
|
170
|
+
type: z.literal('pricingTable'),
|
|
171
|
+
rows: z
|
|
172
|
+
.array(
|
|
173
|
+
z.object({
|
|
174
|
+
label: z.string().min(1),
|
|
175
|
+
price: z.string().min(1),
|
|
176
|
+
unit: z.string().min(1),
|
|
177
|
+
note: z.string().min(1).nullable(),
|
|
178
|
+
}),
|
|
179
|
+
)
|
|
180
|
+
.min(1),
|
|
181
|
+
});
|
|
182
|
+
|
|
169
183
|
export const PageContentBlockSchema = z.discriminatedUnion('type', [
|
|
170
184
|
RichTextBlockSchema,
|
|
171
185
|
FeatureListBlockSchema,
|
|
@@ -178,6 +192,7 @@ export const PageContentBlockSchema = z.discriminatedUnion('type', [
|
|
|
178
192
|
RelatedLinksBlockSchema,
|
|
179
193
|
DemoBlockSchema,
|
|
180
194
|
PricingWidgetBlockSchema,
|
|
195
|
+
PricingTableBlockSchema,
|
|
181
196
|
]);
|
|
182
197
|
|
|
183
198
|
export const PageContentSchema = z.object({
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PAGE_TYPE } from '../enums';
|
|
3
|
+
import { PageContentSchema } from './page-content.schema';
|
|
4
|
+
import { SchemaTogglesSchema } from './schema-toggles.schema';
|
|
5
|
+
import { PublicSeoMetaSchema } from './seo-meta.schema';
|
|
6
|
+
|
|
7
|
+
export const PUBLIC_PAGE_TYPES = [PAGE_TYPE.STATIC, PAGE_TYPE.HUB] as const;
|
|
8
|
+
|
|
9
|
+
export const PublicPageSchema = z.object({
|
|
10
|
+
slug: z.string().min(1),
|
|
11
|
+
type: z.enum(PUBLIC_PAGE_TYPES),
|
|
12
|
+
seo: PublicSeoMetaSchema,
|
|
13
|
+
schemaToggles: SchemaTogglesSchema,
|
|
14
|
+
content: PageContentSchema.nullable(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type PublicPageSchemaType = z.infer<typeof PublicPageSchema>;
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
2
|
+
import { PricingPageSchema } from '../../models';
|
|
3
|
+
import { PRICING_PAGE_ROUTES } from '../pricing-page';
|
|
4
|
+
|
|
5
|
+
export const GetPricingPageQueryResponse = PricingPageSchema;
|
|
6
|
+
|
|
7
|
+
export const GetPricingPageQuery = defineContract({
|
|
8
|
+
method: HTTP_METHODS.GET,
|
|
9
|
+
path: PRICING_PAGE_ROUTES.GET,
|
|
10
|
+
summary: 'Get pricing page data: model tables, calculator tasks, FAQ and breadcrumb',
|
|
11
|
+
responses: {
|
|
12
|
+
200: GetPricingPageQueryResponse,
|
|
13
|
+
500: HttpErrorResponseSchema,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-pricing-page.query';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './pricing-breadcrumb-item.schema';
|
|
2
|
+
export * from './pricing-calculator-task.schema';
|
|
3
|
+
export * from './pricing-faq-item.schema';
|
|
4
|
+
export * from './pricing-image-model.schema';
|
|
5
|
+
export * from './pricing-models.schema';
|
|
6
|
+
export * from './pricing-page.schema';
|
|
7
|
+
export * from './pricing-text-model.schema';
|
|
8
|
+
export * from './pricing-video-model.schema';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const PricingCalculatorTaskBaseSchema = z.object({
|
|
4
|
+
key: z.string().min(1),
|
|
5
|
+
label: z.string().min(1),
|
|
6
|
+
price: z.number().nonnegative(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const PricingCalculatorTextTaskSchema = PricingCalculatorTaskBaseSchema.extend({
|
|
10
|
+
type: z.literal('text'),
|
|
11
|
+
inputChars: z.number().int().positive(),
|
|
12
|
+
outputChars: z.number().int().positive(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const PricingCalculatorImageTaskSchema = PricingCalculatorTaskBaseSchema.extend({
|
|
16
|
+
type: z.literal('image'),
|
|
17
|
+
units: z.number().int().positive(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const PricingCalculatorVideoTaskSchema = PricingCalculatorTaskBaseSchema.extend({
|
|
21
|
+
type: z.literal('video'),
|
|
22
|
+
units: z.number().int().positive(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const PricingCalculatorTaskSchema = z.discriminatedUnion('type', [
|
|
26
|
+
PricingCalculatorTextTaskSchema,
|
|
27
|
+
PricingCalculatorImageTaskSchema,
|
|
28
|
+
PricingCalculatorVideoTaskSchema,
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
export type PricingCalculatorTextTaskSchemaType = z.infer<typeof PricingCalculatorTextTaskSchema>;
|
|
32
|
+
export type PricingCalculatorImageTaskSchemaType = z.infer<typeof PricingCalculatorImageTaskSchema>;
|
|
33
|
+
export type PricingCalculatorVideoTaskSchemaType = z.infer<typeof PricingCalculatorVideoTaskSchema>;
|
|
34
|
+
export type PricingCalculatorTaskSchemaType = z.infer<typeof PricingCalculatorTaskSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const PricingImageModelSchema = z.object({
|
|
4
|
+
slug: z.string().min(1),
|
|
5
|
+
name: z.string().min(1),
|
|
6
|
+
maxResolution: z.string().min(1).nullable(),
|
|
7
|
+
maxReferences: z.number().int().nonnegative().nullable(),
|
|
8
|
+
pricePerImage: z.number().nonnegative(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type PricingImageModelSchemaType = z.infer<typeof PricingImageModelSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PricingImageModelSchema } from './pricing-image-model.schema';
|
|
3
|
+
import { PricingTextModelSchema } from './pricing-text-model.schema';
|
|
4
|
+
import { PricingVideoModelSchema } from './pricing-video-model.schema';
|
|
5
|
+
|
|
6
|
+
export const PricingTextModelsSchema = z.object({
|
|
7
|
+
inputUnitChars: z.number().int().positive(),
|
|
8
|
+
outputUnitChars: z.number().int().positive(),
|
|
9
|
+
items: z.array(PricingTextModelSchema),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const PricingModelsSchema = z.object({
|
|
13
|
+
text: PricingTextModelsSchema,
|
|
14
|
+
image: z.array(PricingImageModelSchema),
|
|
15
|
+
video: z.array(PricingVideoModelSchema),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type PricingTextModelsSchemaType = z.infer<typeof PricingTextModelsSchema>;
|
|
19
|
+
export type PricingModelsSchemaType = z.infer<typeof PricingModelsSchema>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PricingBreadcrumbItemSchema } from './pricing-breadcrumb-item.schema';
|
|
3
|
+
import { PricingCalculatorTaskSchema } from './pricing-calculator-task.schema';
|
|
4
|
+
import { PricingFaqItemSchema } from './pricing-faq-item.schema';
|
|
5
|
+
import { PricingModelsSchema } from './pricing-models.schema';
|
|
6
|
+
|
|
7
|
+
export const PricingPageSchema = z.object({
|
|
8
|
+
updatedAt: z.iso.datetime(),
|
|
9
|
+
models: PricingModelsSchema,
|
|
10
|
+
calculatorTasks: z.array(PricingCalculatorTaskSchema),
|
|
11
|
+
faq: z.array(PricingFaqItemSchema),
|
|
12
|
+
breadcrumb: z.array(PricingBreadcrumbItemSchema),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type PricingPageSchemaType = z.infer<typeof PricingPageSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const PricingTextModelSchema = z.object({
|
|
4
|
+
slug: z.string().min(1),
|
|
5
|
+
name: z.string().min(1),
|
|
6
|
+
context: z.number().int().positive(),
|
|
7
|
+
inputPrice: z.number().nonnegative(),
|
|
8
|
+
outputPrice: z.number().nonnegative(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type PricingTextModelSchemaType = z.infer<typeof PricingTextModelSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const PricingVideoModelSchema = z.object({
|
|
4
|
+
slug: z.string().min(1),
|
|
5
|
+
name: z.string().min(1),
|
|
6
|
+
maxResolution: z.string().min(1).nullable(),
|
|
7
|
+
maxInputChars: z.number().int().nonnegative().nullable(),
|
|
8
|
+
maxDurationSec: z.number().int().positive().nullable(),
|
|
9
|
+
maxReferences: z.number().int().nonnegative().nullable(),
|
|
10
|
+
audio: z.boolean().nullable(),
|
|
11
|
+
pricePerSecond: z.number().nonnegative(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type PricingVideoModelSchemaType = z.infer<typeof PricingVideoModelSchema>;
|