@ai-grator/api 0.1.39 → 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/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/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 +5 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/errors/errors.ts +7 -0
- package/index.ts +1 -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 +8 -0
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
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,11 @@ 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';
|
|
317
322
|
import { GENERATION_MODEL_CONTROLLER } from '../generation-model/endpoints/generation-model';
|
|
318
323
|
import {
|
|
319
324
|
GetGenerationModelsQuery,
|
|
@@ -563,6 +568,7 @@ async function main() {
|
|
|
563
568
|
registerSchema('PublicModelsGetBySlugParams', GetPublicModelBySlugQueryParams);
|
|
564
569
|
registerSchema('PublicModelsGetBySlugResponse', GetPublicModelBySlugQueryResponse);
|
|
565
570
|
registerSchema('ModelCatalogGetAllResponse', GetModelCatalogQueryResponse);
|
|
571
|
+
registerSchema('PricingPageGetResponse', GetPricingPageQueryResponse);
|
|
566
572
|
registerSchema('GenerationModelGetAllResponse', GetGenerationModelsQueryResponse);
|
|
567
573
|
registerSchema('GenerationModelGetByTypeParams', GetGenerationModelsByTypeQueryParams);
|
|
568
574
|
registerSchema('GenerationModelGetByTypeResponse', GetGenerationModelsByTypeQueryResponse);
|
|
@@ -739,6 +745,7 @@ async function main() {
|
|
|
739
745
|
const publicModelContracts: HttpContract[] = [ListPublicModelsQuery, GetPublicModelBySlugQuery];
|
|
740
746
|
const publicPageContracts: HttpContract[] = [GetPublicPageBySlugQuery];
|
|
741
747
|
const modelCatalogContracts: HttpContract[] = [GetModelCatalogQuery];
|
|
748
|
+
const pricingPageContracts: HttpContract[] = [GetPricingPageQuery];
|
|
742
749
|
const generationModelContracts: HttpContract[] = [
|
|
743
750
|
GetGenerationModelsQuery,
|
|
744
751
|
GetGenerationModelsByTypeQuery,
|
|
@@ -852,6 +859,7 @@ async function main() {
|
|
|
852
859
|
{ controller: PUBLIC_MODEL_CONTROLLER, tag: 'Models (public)', contracts: publicModelContracts },
|
|
853
860
|
{ controller: PUBLIC_PAGE_CONTROLLER, tag: 'Pages (public)', contracts: publicPageContracts },
|
|
854
861
|
{ controller: MODEL_CATALOG_CONTROLLER, tag: 'Model Catalog', contracts: modelCatalogContracts },
|
|
862
|
+
{ controller: PRICING_PAGE_CONTROLLER, tag: 'Pricing Page (public)', contracts: pricingPageContracts },
|
|
855
863
|
{ controller: GENERATION_MODEL_CONTROLLER, tag: 'Generation Models', contracts: generationModelContracts },
|
|
856
864
|
{ controller: GENERATION_JOB_CONTROLLER, tag: 'Generation Jobs', contracts: generationJobContracts },
|
|
857
865
|
{
|