@ai-grator/api 0.1.39 → 0.1.41
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/contact-form/endpoints/commands/index.d.ts +2 -0
- package/build/contact-form/endpoints/commands/index.d.ts.map +1 -0
- package/build/contact-form/endpoints/commands/index.js +17 -0
- package/build/contact-form/endpoints/commands/submit-contact-form.command.d.ts +25 -0
- package/build/contact-form/endpoints/commands/submit-contact-form.command.d.ts.map +1 -0
- package/build/contact-form/endpoints/commands/submit-contact-form.command.js +25 -0
- package/build/contact-form/endpoints/contact-form.d.ts +5 -0
- package/build/contact-form/endpoints/contact-form.d.ts.map +1 -0
- package/build/contact-form/endpoints/contact-form.js +7 -0
- package/build/contact-form/endpoints/index.d.ts +3 -0
- package/build/contact-form/endpoints/index.d.ts.map +1 -0
- package/build/contact-form/endpoints/index.js +18 -0
- package/build/contact-form/index.d.ts +2 -0
- package/build/contact-form/index.d.ts.map +1 -0
- package/build/contact-form/index.js +17 -0
- package/build/errors/errors.d.ts +14 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +14 -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 +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -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 +11 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/contact-form/endpoints/commands/index.ts +1 -0
- package/contact-form/endpoints/commands/submit-contact-form.command.ts +25 -0
- package/contact-form/endpoints/contact-form.ts +5 -0
- package/contact-form/endpoints/index.ts +2 -0
- package/contact-form/index.ts +1 -0
- package/errors/errors.ts +14 -0
- package/index.ts +2 -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 +18 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './submit-contact-form.command';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema, HttpSuccessResponseSchema } from '../../../_common';
|
|
3
|
+
import { CONTACT_FORM_ROUTES } from '../contact-form';
|
|
4
|
+
|
|
5
|
+
export const SubmitContactFormCommandBody = z.object({
|
|
6
|
+
email: z.email(),
|
|
7
|
+
message: z.string().trim().min(1).max(2000),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const SubmitContactFormCommandResponse = HttpSuccessResponseSchema;
|
|
11
|
+
|
|
12
|
+
export const SubmitContactFormCommand = defineContract({
|
|
13
|
+
method: HTTP_METHODS.POST,
|
|
14
|
+
path: CONTACT_FORM_ROUTES.SUBMIT,
|
|
15
|
+
summary: 'Submit the public contact form; forwards the message to support by email',
|
|
16
|
+
request: {
|
|
17
|
+
body: SubmitContactFormCommandBody,
|
|
18
|
+
},
|
|
19
|
+
responses: {
|
|
20
|
+
200: SubmitContactFormCommandResponse,
|
|
21
|
+
400: HttpErrorResponseSchema,
|
|
22
|
+
429: HttpErrorResponseSchema,
|
|
23
|
+
500: HttpErrorResponseSchema,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './endpoints';
|
package/errors/errors.ts
CHANGED
|
@@ -909,6 +909,20 @@ 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
|
+
},
|
|
919
|
+
CONTACT_FORM: {
|
|
920
|
+
SUBMIT_ERROR: {
|
|
921
|
+
httpCode: 500,
|
|
922
|
+
code: 'CONTACT_FORM.SUBMIT_ERROR',
|
|
923
|
+
message: 'Не удалось отправить сообщение в поддержку',
|
|
924
|
+
},
|
|
925
|
+
},
|
|
912
926
|
MODEL_FAMILY: {
|
|
913
927
|
NOT_FOUND: {
|
|
914
928
|
httpCode: 404,
|
package/index.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './ai-model';
|
|
|
3
3
|
export * from './generation-model';
|
|
4
4
|
export * from './model-catalog';
|
|
5
5
|
export * from './model-page';
|
|
6
|
+
export * from './pricing-page';
|
|
7
|
+
export * from './contact-form';
|
|
6
8
|
export * from './generation-job';
|
|
7
9
|
export * from './article';
|
|
8
10
|
export * from './auth';
|
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>;
|
|
@@ -314,6 +314,17 @@ import {
|
|
|
314
314
|
GetModelCatalogQuery,
|
|
315
315
|
GetModelCatalogQueryResponse,
|
|
316
316
|
} from '../model-catalog/endpoints/queries/get-model-catalog.query';
|
|
317
|
+
import { PRICING_PAGE_CONTROLLER } from '../pricing-page/endpoints/pricing-page';
|
|
318
|
+
import {
|
|
319
|
+
GetPricingPageQuery,
|
|
320
|
+
GetPricingPageQueryResponse,
|
|
321
|
+
} from '../pricing-page/endpoints/queries/get-pricing-page.query';
|
|
322
|
+
import { CONTACT_FORM_CONTROLLER } from '../contact-form/endpoints/contact-form';
|
|
323
|
+
import {
|
|
324
|
+
SubmitContactFormCommand,
|
|
325
|
+
SubmitContactFormCommandBody,
|
|
326
|
+
SubmitContactFormCommandResponse,
|
|
327
|
+
} from '../contact-form/endpoints/commands/submit-contact-form.command';
|
|
317
328
|
import { GENERATION_MODEL_CONTROLLER } from '../generation-model/endpoints/generation-model';
|
|
318
329
|
import {
|
|
319
330
|
GetGenerationModelsQuery,
|
|
@@ -563,6 +574,9 @@ async function main() {
|
|
|
563
574
|
registerSchema('PublicModelsGetBySlugParams', GetPublicModelBySlugQueryParams);
|
|
564
575
|
registerSchema('PublicModelsGetBySlugResponse', GetPublicModelBySlugQueryResponse);
|
|
565
576
|
registerSchema('ModelCatalogGetAllResponse', GetModelCatalogQueryResponse);
|
|
577
|
+
registerSchema('PricingPageGetResponse', GetPricingPageQueryResponse);
|
|
578
|
+
registerSchema('ContactFormSubmitRequest', SubmitContactFormCommandBody);
|
|
579
|
+
registerSchema('ContactFormSubmitResponse', SubmitContactFormCommandResponse);
|
|
566
580
|
registerSchema('GenerationModelGetAllResponse', GetGenerationModelsQueryResponse);
|
|
567
581
|
registerSchema('GenerationModelGetByTypeParams', GetGenerationModelsByTypeQueryParams);
|
|
568
582
|
registerSchema('GenerationModelGetByTypeResponse', GetGenerationModelsByTypeQueryResponse);
|
|
@@ -739,6 +753,8 @@ async function main() {
|
|
|
739
753
|
const publicModelContracts: HttpContract[] = [ListPublicModelsQuery, GetPublicModelBySlugQuery];
|
|
740
754
|
const publicPageContracts: HttpContract[] = [GetPublicPageBySlugQuery];
|
|
741
755
|
const modelCatalogContracts: HttpContract[] = [GetModelCatalogQuery];
|
|
756
|
+
const pricingPageContracts: HttpContract[] = [GetPricingPageQuery];
|
|
757
|
+
const contactFormContracts: HttpContract[] = [SubmitContactFormCommand];
|
|
742
758
|
const generationModelContracts: HttpContract[] = [
|
|
743
759
|
GetGenerationModelsQuery,
|
|
744
760
|
GetGenerationModelsByTypeQuery,
|
|
@@ -852,6 +868,8 @@ async function main() {
|
|
|
852
868
|
{ controller: PUBLIC_MODEL_CONTROLLER, tag: 'Models (public)', contracts: publicModelContracts },
|
|
853
869
|
{ controller: PUBLIC_PAGE_CONTROLLER, tag: 'Pages (public)', contracts: publicPageContracts },
|
|
854
870
|
{ controller: MODEL_CATALOG_CONTROLLER, tag: 'Model Catalog', contracts: modelCatalogContracts },
|
|
871
|
+
{ controller: PRICING_PAGE_CONTROLLER, tag: 'Pricing Page (public)', contracts: pricingPageContracts },
|
|
872
|
+
{ controller: CONTACT_FORM_CONTROLLER, tag: 'Contact Form (public)', contracts: contactFormContracts },
|
|
855
873
|
{ controller: GENERATION_MODEL_CONTROLLER, tag: 'Generation Models', contracts: generationModelContracts },
|
|
856
874
|
{ controller: GENERATION_JOB_CONTROLLER, tag: 'Generation Jobs', contracts: generationJobContracts },
|
|
857
875
|
{
|