@ai-grator/api 0.1.40 → 0.1.42
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 +7 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +7 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/pricing-page/endpoints/queries/get-pricing-page.query.d.ts +12 -0
- package/build/pricing-page/endpoints/queries/get-pricing-page.query.d.ts.map +1 -1
- package/build/pricing-page/models/index.d.ts +1 -0
- package/build/pricing-page/models/index.d.ts.map +1 -1
- package/build/pricing-page/models/index.js +1 -0
- package/build/pricing-page/models/pricing-condition-item.schema.d.ts +7 -0
- package/build/pricing-page/models/pricing-condition-item.schema.d.ts.map +1 -0
- package/build/pricing-page/models/pricing-condition-item.schema.js +8 -0
- package/build/pricing-page/models/pricing-page.schema.d.ts +6 -0
- package/build/pricing-page/models/pricing-page.schema.d.ts.map +1 -1
- package/build/pricing-page/models/pricing-page.schema.js +4 -0
- package/build/scripts/generate-openapi.js +6 -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 +7 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/pricing-page/models/index.ts +1 -0
- package/pricing-page/models/pricing-condition-item.schema.ts +8 -0
- package/pricing-page/models/pricing-page.schema.ts +4 -0
- package/scripts/generate-openapi.ts +10 -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
|
@@ -916,6 +916,13 @@ export const ERRORS = {
|
|
|
916
916
|
message: 'Не удалось получить данные страницы цен',
|
|
917
917
|
},
|
|
918
918
|
},
|
|
919
|
+
CONTACT_FORM: {
|
|
920
|
+
SUBMIT_ERROR: {
|
|
921
|
+
httpCode: 500,
|
|
922
|
+
code: 'CONTACT_FORM.SUBMIT_ERROR',
|
|
923
|
+
message: 'Не удалось отправить сообщение в поддержку',
|
|
924
|
+
},
|
|
925
|
+
},
|
|
919
926
|
MODEL_FAMILY: {
|
|
920
927
|
NOT_FOUND: {
|
|
921
928
|
httpCode: 404,
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './pricing-breadcrumb-item.schema';
|
|
2
2
|
export * from './pricing-calculator-task.schema';
|
|
3
|
+
export * from './pricing-condition-item.schema';
|
|
3
4
|
export * from './pricing-faq-item.schema';
|
|
4
5
|
export * from './pricing-image-model.schema';
|
|
5
6
|
export * from './pricing-models.schema';
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { PricingBreadcrumbItemSchema } from './pricing-breadcrumb-item.schema';
|
|
3
3
|
import { PricingCalculatorTaskSchema } from './pricing-calculator-task.schema';
|
|
4
|
+
import { PricingConditionItemSchema } from './pricing-condition-item.schema';
|
|
4
5
|
import { PricingFaqItemSchema } from './pricing-faq-item.schema';
|
|
5
6
|
import { PricingModelsSchema } from './pricing-models.schema';
|
|
6
7
|
|
|
7
8
|
export const PricingPageSchema = z.object({
|
|
9
|
+
h1: z.string().min(1),
|
|
10
|
+
lead: z.string().min(1).nullable(),
|
|
8
11
|
updatedAt: z.iso.datetime(),
|
|
9
12
|
models: PricingModelsSchema,
|
|
10
13
|
calculatorTasks: z.array(PricingCalculatorTaskSchema),
|
|
14
|
+
conditions: z.array(PricingConditionItemSchema),
|
|
11
15
|
faq: z.array(PricingFaqItemSchema),
|
|
12
16
|
breadcrumb: z.array(PricingBreadcrumbItemSchema),
|
|
13
17
|
});
|
|
@@ -319,6 +319,12 @@ import {
|
|
|
319
319
|
GetPricingPageQuery,
|
|
320
320
|
GetPricingPageQueryResponse,
|
|
321
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';
|
|
322
328
|
import { GENERATION_MODEL_CONTROLLER } from '../generation-model/endpoints/generation-model';
|
|
323
329
|
import {
|
|
324
330
|
GetGenerationModelsQuery,
|
|
@@ -569,6 +575,8 @@ async function main() {
|
|
|
569
575
|
registerSchema('PublicModelsGetBySlugResponse', GetPublicModelBySlugQueryResponse);
|
|
570
576
|
registerSchema('ModelCatalogGetAllResponse', GetModelCatalogQueryResponse);
|
|
571
577
|
registerSchema('PricingPageGetResponse', GetPricingPageQueryResponse);
|
|
578
|
+
registerSchema('ContactFormSubmitRequest', SubmitContactFormCommandBody);
|
|
579
|
+
registerSchema('ContactFormSubmitResponse', SubmitContactFormCommandResponse);
|
|
572
580
|
registerSchema('GenerationModelGetAllResponse', GetGenerationModelsQueryResponse);
|
|
573
581
|
registerSchema('GenerationModelGetByTypeParams', GetGenerationModelsByTypeQueryParams);
|
|
574
582
|
registerSchema('GenerationModelGetByTypeResponse', GetGenerationModelsByTypeQueryResponse);
|
|
@@ -746,6 +754,7 @@ async function main() {
|
|
|
746
754
|
const publicPageContracts: HttpContract[] = [GetPublicPageBySlugQuery];
|
|
747
755
|
const modelCatalogContracts: HttpContract[] = [GetModelCatalogQuery];
|
|
748
756
|
const pricingPageContracts: HttpContract[] = [GetPricingPageQuery];
|
|
757
|
+
const contactFormContracts: HttpContract[] = [SubmitContactFormCommand];
|
|
749
758
|
const generationModelContracts: HttpContract[] = [
|
|
750
759
|
GetGenerationModelsQuery,
|
|
751
760
|
GetGenerationModelsByTypeQuery,
|
|
@@ -860,6 +869,7 @@ async function main() {
|
|
|
860
869
|
{ controller: PUBLIC_PAGE_CONTROLLER, tag: 'Pages (public)', contracts: publicPageContracts },
|
|
861
870
|
{ controller: MODEL_CATALOG_CONTROLLER, tag: 'Model Catalog', contracts: modelCatalogContracts },
|
|
862
871
|
{ controller: PRICING_PAGE_CONTROLLER, tag: 'Pricing Page (public)', contracts: pricingPageContracts },
|
|
872
|
+
{ controller: CONTACT_FORM_CONTROLLER, tag: 'Contact Form (public)', contracts: contactFormContracts },
|
|
863
873
|
{ controller: GENERATION_MODEL_CONTROLLER, tag: 'Generation Models', contracts: generationModelContracts },
|
|
864
874
|
{ controller: GENERATION_JOB_CONTROLLER, tag: 'Generation Jobs', contracts: generationJobContracts },
|
|
865
875
|
{
|