@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
|
@@ -74,6 +74,7 @@ const get_admin_page_query_1 = require("../admin/endpoints/queries/get-admin-pag
|
|
|
74
74
|
const get_admin_model_families_query_1 = require("../admin/endpoints/queries/get-admin-model-families.query");
|
|
75
75
|
const get_admin_organization_query_1 = require("../admin/endpoints/queries/get-admin-organization.query");
|
|
76
76
|
const ai_model_1 = require("../ai-model/endpoints/ai-model");
|
|
77
|
+
const get_public_page_by_slug_query_1 = require("../model-page/endpoints/queries/get-public-page-by-slug.query");
|
|
77
78
|
const model_page_1 = require("../model-page/endpoints/model-page");
|
|
78
79
|
const get_ai_model_by_uuid_query_1 = require("../ai-model/endpoints/queries/get-ai-model-by-uuid.query");
|
|
79
80
|
const get_ai_models_query_1 = require("../ai-model/endpoints/queries/get-ai-models.query");
|
|
@@ -81,6 +82,8 @@ const get_public_model_by_slug_query_1 = require("../model-page/endpoints/querie
|
|
|
81
82
|
const list_public_models_query_1 = require("../model-page/endpoints/queries/list-public-models.query");
|
|
82
83
|
const model_catalog_1 = require("../model-catalog/endpoints/model-catalog");
|
|
83
84
|
const get_model_catalog_query_1 = require("../model-catalog/endpoints/queries/get-model-catalog.query");
|
|
85
|
+
const pricing_page_1 = require("../pricing-page/endpoints/pricing-page");
|
|
86
|
+
const get_pricing_page_query_1 = require("../pricing-page/endpoints/queries/get-pricing-page.query");
|
|
84
87
|
const generation_model_1 = require("../generation-model/endpoints/generation-model");
|
|
85
88
|
const get_generation_models_query_1 = require("../generation-model/endpoints/queries/get-generation-models.query");
|
|
86
89
|
const get_generation_models_by_type_query_1 = require("../generation-model/endpoints/queries/get-generation-models-by-type.query");
|
|
@@ -211,6 +214,7 @@ async function main() {
|
|
|
211
214
|
registerSchema('PublicModelsGetBySlugParams', get_public_model_by_slug_query_1.GetPublicModelBySlugQueryParams);
|
|
212
215
|
registerSchema('PublicModelsGetBySlugResponse', get_public_model_by_slug_query_1.GetPublicModelBySlugQueryResponse);
|
|
213
216
|
registerSchema('ModelCatalogGetAllResponse', get_model_catalog_query_1.GetModelCatalogQueryResponse);
|
|
217
|
+
registerSchema('PricingPageGetResponse', get_pricing_page_query_1.GetPricingPageQueryResponse);
|
|
214
218
|
registerSchema('GenerationModelGetAllResponse', get_generation_models_query_1.GetGenerationModelsQueryResponse);
|
|
215
219
|
registerSchema('GenerationModelGetByTypeParams', get_generation_models_by_type_query_1.GetGenerationModelsByTypeQueryParams);
|
|
216
220
|
registerSchema('GenerationModelGetByTypeResponse', get_generation_models_by_type_query_1.GetGenerationModelsByTypeQueryResponse);
|
|
@@ -329,6 +333,8 @@ async function main() {
|
|
|
329
333
|
registerSchema('AdminUpdateOrganizationRequest', update_admin_organization_command_1.UpdateAdminOrganizationCommandBody);
|
|
330
334
|
registerSchema('AdminUpdateOrganizationResponse', update_admin_organization_command_1.UpdateAdminOrganizationCommandResponse);
|
|
331
335
|
registerSchema('OrganizationGetResponse', get_organization_query_1.GetOrganizationQueryResponse);
|
|
336
|
+
registerSchema('PublicPageGetBySlugParams', get_public_page_by_slug_query_1.GetPublicPageBySlugQueryParams);
|
|
337
|
+
registerSchema('PublicPageGetBySlugResponse', get_public_page_by_slug_query_1.GetPublicPageBySlugQueryResponse);
|
|
332
338
|
registerSchema('UserContextGetResponse', get_user_context_query_1.GetUserContextQueryResponse);
|
|
333
339
|
registerSchema('UserContextUpsertRequest', upsert_user_context_command_1.UpsertUserContextCommandBody);
|
|
334
340
|
registerSchema('UserContextUpsertResponse', upsert_user_context_command_1.UpsertUserContextCommandResponse);
|
|
@@ -382,7 +388,9 @@ async function main() {
|
|
|
382
388
|
];
|
|
383
389
|
const aiModelContracts = [get_ai_models_query_1.GetAllAiModelsQuery, get_ai_model_by_uuid_query_1.GetAiModelByUuidQuery];
|
|
384
390
|
const publicModelContracts = [list_public_models_query_1.ListPublicModelsQuery, get_public_model_by_slug_query_1.GetPublicModelBySlugQuery];
|
|
391
|
+
const publicPageContracts = [get_public_page_by_slug_query_1.GetPublicPageBySlugQuery];
|
|
385
392
|
const modelCatalogContracts = [get_model_catalog_query_1.GetModelCatalogQuery];
|
|
393
|
+
const pricingPageContracts = [get_pricing_page_query_1.GetPricingPageQuery];
|
|
386
394
|
const generationModelContracts = [
|
|
387
395
|
get_generation_models_query_1.GetGenerationModelsQuery,
|
|
388
396
|
get_generation_models_by_type_query_1.GetGenerationModelsByTypeQuery,
|
|
@@ -439,500 +447,68 @@ async function main() {
|
|
|
439
447
|
update_admin_organization_command_1.UpdateAdminOrganizationCommand,
|
|
440
448
|
];
|
|
441
449
|
const organizationContracts = [get_organization_query_1.GetOrganizationQuery];
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
: {}),
|
|
465
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
466
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
467
|
-
},
|
|
468
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
for (const contract of chatContracts) {
|
|
472
|
-
const method = contract.method.toLowerCase();
|
|
473
|
-
if (!supportedHttpMethods.has(method)) {
|
|
474
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
475
|
-
}
|
|
476
|
-
registry.registerPath({
|
|
477
|
-
method: method,
|
|
478
|
-
path: toOpenApiPath(chat_1.CHAT_CONTROLLER, contract.path),
|
|
479
|
-
summary: contract.summary,
|
|
480
|
-
tags: ['Chat'],
|
|
481
|
-
request: {
|
|
482
|
-
...(contract.request?.body
|
|
483
|
-
? {
|
|
484
|
-
body: {
|
|
485
|
-
required: true,
|
|
486
|
-
content: {
|
|
487
|
-
'application/json': {
|
|
488
|
-
schema: resolveSchema(contract.request.body),
|
|
489
|
-
},
|
|
490
|
-
},
|
|
491
|
-
},
|
|
492
|
-
}
|
|
493
|
-
: {}),
|
|
494
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
495
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
496
|
-
},
|
|
497
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
for (const contract of messageContracts) {
|
|
501
|
-
const method = contract.method.toLowerCase();
|
|
502
|
-
if (!supportedHttpMethods.has(method)) {
|
|
503
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
504
|
-
}
|
|
505
|
-
registry.registerPath({
|
|
506
|
-
method: method,
|
|
507
|
-
path: toOpenApiPath(message_1.MESSAGE_CONTROLLER, contract.path),
|
|
508
|
-
summary: contract.summary,
|
|
509
|
-
tags: ['Message'],
|
|
510
|
-
request: {
|
|
511
|
-
...(contract.request?.body
|
|
512
|
-
? {
|
|
513
|
-
body: {
|
|
514
|
-
required: true,
|
|
515
|
-
content: {
|
|
516
|
-
'application/json': {
|
|
517
|
-
schema: resolveSchema(contract.request.body),
|
|
450
|
+
const DEFAULT_BODY_CONTENT_TYPE = 'application/json';
|
|
451
|
+
const SSE_CREATED_CONTRACTS = new Set([create_message_command_1.CreateMessageCommand]);
|
|
452
|
+
const registerContractGroup = ({ controller, tag, contracts, bodyContentType = DEFAULT_BODY_CONTENT_TYPE, }) => {
|
|
453
|
+
for (const contract of contracts) {
|
|
454
|
+
const method = contract.method.toLowerCase();
|
|
455
|
+
if (!supportedHttpMethods.has(method)) {
|
|
456
|
+
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
457
|
+
}
|
|
458
|
+
registry.registerPath({
|
|
459
|
+
method: method,
|
|
460
|
+
path: toOpenApiPath(controller, contract.path),
|
|
461
|
+
summary: contract.summary,
|
|
462
|
+
tags: [tag],
|
|
463
|
+
request: {
|
|
464
|
+
...(contract.request?.body
|
|
465
|
+
? {
|
|
466
|
+
body: {
|
|
467
|
+
required: true,
|
|
468
|
+
content: {
|
|
469
|
+
[bodyContentType]: {
|
|
470
|
+
schema: resolveSchema(contract.request.body),
|
|
471
|
+
},
|
|
518
472
|
},
|
|
519
473
|
},
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
: {}),
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
for (const contract of fileContracts) {
|
|
532
|
-
const method = contract.method.toLowerCase();
|
|
533
|
-
if (!supportedHttpMethods.has(method)) {
|
|
534
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
535
|
-
}
|
|
536
|
-
registry.registerPath({
|
|
537
|
-
method: method,
|
|
538
|
-
path: toOpenApiPath(file_1.FILE_CONTROLLER, contract.path),
|
|
539
|
-
summary: contract.summary,
|
|
540
|
-
tags: ['File'],
|
|
541
|
-
request: {
|
|
542
|
-
...(contract.request?.body
|
|
543
|
-
? {
|
|
544
|
-
body: {
|
|
545
|
-
required: true,
|
|
546
|
-
content: {
|
|
547
|
-
'multipart/form-data': {
|
|
548
|
-
schema: resolveSchema(contract.request.body),
|
|
549
|
-
},
|
|
550
|
-
},
|
|
551
|
-
},
|
|
552
|
-
}
|
|
553
|
-
: {}),
|
|
554
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
555
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
556
|
-
},
|
|
557
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
for (const contract of supportContracts) {
|
|
561
|
-
const method = contract.method.toLowerCase();
|
|
562
|
-
if (!supportedHttpMethods.has(method)) {
|
|
563
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
564
|
-
}
|
|
565
|
-
registry.registerPath({
|
|
566
|
-
method: method,
|
|
567
|
-
path: toOpenApiPath(support_1.SUPPORT_CONTROLLER, contract.path),
|
|
568
|
-
summary: contract.summary,
|
|
569
|
-
tags: ['Support'],
|
|
570
|
-
request: {
|
|
571
|
-
...(contract.request?.body
|
|
572
|
-
? {
|
|
573
|
-
body: {
|
|
574
|
-
required: true,
|
|
575
|
-
content: {
|
|
576
|
-
'application/json': {
|
|
577
|
-
schema: resolveSchema(contract.request.body),
|
|
578
|
-
},
|
|
579
|
-
},
|
|
580
|
-
},
|
|
581
|
-
}
|
|
582
|
-
: {}),
|
|
583
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
584
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
585
|
-
},
|
|
586
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
for (const contract of walletContracts) {
|
|
590
|
-
const method = contract.method.toLowerCase();
|
|
591
|
-
if (!supportedHttpMethods.has(method)) {
|
|
592
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
593
|
-
}
|
|
594
|
-
registry.registerPath({
|
|
595
|
-
method: method,
|
|
596
|
-
path: toOpenApiPath(wallet_1.WALLET_CONTROLLER, contract.path),
|
|
597
|
-
summary: contract.summary,
|
|
598
|
-
tags: ['Wallet'],
|
|
599
|
-
request: {
|
|
600
|
-
...(contract.request?.body
|
|
601
|
-
? {
|
|
602
|
-
body: {
|
|
603
|
-
required: true,
|
|
604
|
-
content: {
|
|
605
|
-
'application/json': {
|
|
606
|
-
schema: resolveSchema(contract.request.body),
|
|
607
|
-
},
|
|
608
|
-
},
|
|
609
|
-
},
|
|
610
|
-
}
|
|
611
|
-
: {}),
|
|
612
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
613
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
614
|
-
},
|
|
615
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
for (const contract of paymentContracts) {
|
|
619
|
-
const method = contract.method.toLowerCase();
|
|
620
|
-
if (!supportedHttpMethods.has(method)) {
|
|
621
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
622
|
-
}
|
|
623
|
-
registry.registerPath({
|
|
624
|
-
method: method,
|
|
625
|
-
path: toOpenApiPath(payment_1.PAYMENT_CONTROLLER, contract.path),
|
|
626
|
-
summary: contract.summary,
|
|
627
|
-
tags: ['Payment'],
|
|
628
|
-
request: {
|
|
629
|
-
...(contract.request?.body
|
|
630
|
-
? {
|
|
631
|
-
body: {
|
|
632
|
-
required: true,
|
|
633
|
-
content: {
|
|
634
|
-
'application/json': {
|
|
635
|
-
schema: resolveSchema(contract.request.body),
|
|
636
|
-
},
|
|
637
|
-
},
|
|
638
|
-
},
|
|
639
|
-
}
|
|
640
|
-
: {}),
|
|
641
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
642
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
643
|
-
},
|
|
644
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
for (const contract of aiModelContracts) {
|
|
648
|
-
const method = contract.method.toLowerCase();
|
|
649
|
-
if (!supportedHttpMethods.has(method)) {
|
|
650
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
651
|
-
}
|
|
652
|
-
registry.registerPath({
|
|
653
|
-
method: method,
|
|
654
|
-
path: toOpenApiPath(ai_model_1.AI_MODELS_CONTROLLER, contract.path),
|
|
655
|
-
summary: contract.summary,
|
|
656
|
-
tags: ['AI Models'],
|
|
657
|
-
request: {
|
|
658
|
-
...(contract.request?.body
|
|
659
|
-
? {
|
|
660
|
-
body: {
|
|
661
|
-
required: true,
|
|
662
|
-
content: {
|
|
663
|
-
'application/json': {
|
|
664
|
-
schema: resolveSchema(contract.request.body),
|
|
665
|
-
},
|
|
666
|
-
},
|
|
667
|
-
},
|
|
668
|
-
}
|
|
669
|
-
: {}),
|
|
670
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
671
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
672
|
-
},
|
|
673
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
for (const contract of publicModelContracts) {
|
|
677
|
-
const method = contract.method.toLowerCase();
|
|
678
|
-
if (!supportedHttpMethods.has(method)) {
|
|
679
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
680
|
-
}
|
|
681
|
-
registry.registerPath({
|
|
682
|
-
method: method,
|
|
683
|
-
path: toOpenApiPath(model_page_1.PUBLIC_MODEL_CONTROLLER, contract.path),
|
|
684
|
-
summary: contract.summary,
|
|
685
|
-
tags: ['Models (public)'],
|
|
686
|
-
request: {
|
|
687
|
-
...(contract.request?.body
|
|
688
|
-
? {
|
|
689
|
-
body: {
|
|
690
|
-
required: true,
|
|
691
|
-
content: {
|
|
692
|
-
'application/json': {
|
|
693
|
-
schema: resolveSchema(contract.request.body),
|
|
694
|
-
},
|
|
695
|
-
},
|
|
696
|
-
},
|
|
697
|
-
}
|
|
698
|
-
: {}),
|
|
699
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
700
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
701
|
-
},
|
|
702
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
for (const contract of modelCatalogContracts) {
|
|
706
|
-
const method = contract.method.toLowerCase();
|
|
707
|
-
if (!supportedHttpMethods.has(method)) {
|
|
708
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
709
|
-
}
|
|
710
|
-
registry.registerPath({
|
|
711
|
-
method: method,
|
|
712
|
-
path: toOpenApiPath(model_catalog_1.MODEL_CATALOG_CONTROLLER, contract.path),
|
|
713
|
-
summary: contract.summary,
|
|
714
|
-
tags: ['Model Catalog'],
|
|
715
|
-
request: {
|
|
716
|
-
...(contract.request?.body
|
|
717
|
-
? {
|
|
718
|
-
body: {
|
|
719
|
-
required: true,
|
|
720
|
-
content: {
|
|
721
|
-
'application/json': {
|
|
722
|
-
schema: resolveSchema(contract.request.body),
|
|
723
|
-
},
|
|
724
|
-
},
|
|
725
|
-
},
|
|
726
|
-
}
|
|
727
|
-
: {}),
|
|
728
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
729
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
730
|
-
},
|
|
731
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
for (const contract of generationModelContracts) {
|
|
735
|
-
const method = contract.method.toLowerCase();
|
|
736
|
-
if (!supportedHttpMethods.has(method)) {
|
|
737
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
738
|
-
}
|
|
739
|
-
registry.registerPath({
|
|
740
|
-
method: method,
|
|
741
|
-
path: toOpenApiPath(generation_model_1.GENERATION_MODEL_CONTROLLER, contract.path),
|
|
742
|
-
summary: contract.summary,
|
|
743
|
-
tags: ['Generation Models'],
|
|
744
|
-
request: {
|
|
745
|
-
...(contract.request?.body
|
|
746
|
-
? {
|
|
747
|
-
body: {
|
|
748
|
-
required: true,
|
|
749
|
-
content: {
|
|
750
|
-
'application/json': {
|
|
751
|
-
schema: resolveSchema(contract.request.body),
|
|
752
|
-
},
|
|
753
|
-
},
|
|
754
|
-
},
|
|
755
|
-
}
|
|
756
|
-
: {}),
|
|
757
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
758
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
759
|
-
},
|
|
760
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
for (const contract of generationJobContracts) {
|
|
764
|
-
const method = contract.method.toLowerCase();
|
|
765
|
-
if (!supportedHttpMethods.has(method)) {
|
|
766
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
767
|
-
}
|
|
768
|
-
registry.registerPath({
|
|
769
|
-
method: method,
|
|
770
|
-
path: toOpenApiPath(generation_job_1.GENERATION_JOB_CONTROLLER, contract.path),
|
|
771
|
-
summary: contract.summary,
|
|
772
|
-
tags: ['Generation Jobs'],
|
|
773
|
-
request: {
|
|
774
|
-
...(contract.request?.body
|
|
775
|
-
? {
|
|
776
|
-
body: {
|
|
777
|
-
required: true,
|
|
778
|
-
content: {
|
|
779
|
-
'application/json': {
|
|
780
|
-
schema: resolveSchema(contract.request.body),
|
|
781
|
-
},
|
|
782
|
-
},
|
|
783
|
-
},
|
|
784
|
-
}
|
|
785
|
-
: {}),
|
|
786
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
787
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
788
|
-
},
|
|
789
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
for (const contract of generationJobChatContracts) {
|
|
793
|
-
const method = contract.method.toLowerCase();
|
|
794
|
-
if (!supportedHttpMethods.has(method)) {
|
|
795
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
796
|
-
}
|
|
797
|
-
registry.registerPath({
|
|
798
|
-
method: method,
|
|
799
|
-
path: toOpenApiPath(generation_job_chat_1.GENERATION_JOB_CHAT_CONTROLLER, contract.path),
|
|
800
|
-
summary: contract.summary,
|
|
801
|
-
tags: ['Generation Job Chats'],
|
|
802
|
-
request: {
|
|
803
|
-
...(contract.request?.body
|
|
804
|
-
? {
|
|
805
|
-
body: {
|
|
806
|
-
required: true,
|
|
807
|
-
content: {
|
|
808
|
-
'application/json': {
|
|
809
|
-
schema: resolveSchema(contract.request.body),
|
|
810
|
-
},
|
|
811
|
-
},
|
|
812
|
-
},
|
|
813
|
-
}
|
|
814
|
-
: {}),
|
|
815
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
816
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
817
|
-
},
|
|
818
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
for (const contract of adminContracts) {
|
|
822
|
-
const method = contract.method.toLowerCase();
|
|
823
|
-
if (!supportedHttpMethods.has(method)) {
|
|
824
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
825
|
-
}
|
|
826
|
-
registry.registerPath({
|
|
827
|
-
method: method,
|
|
828
|
-
path: toOpenApiPath(admin_1.ADMIN_CONTROLLER, contract.path),
|
|
829
|
-
summary: contract.summary,
|
|
830
|
-
tags: ['Admin'],
|
|
831
|
-
request: {
|
|
832
|
-
...(contract.request?.body
|
|
833
|
-
? {
|
|
834
|
-
body: {
|
|
835
|
-
required: true,
|
|
836
|
-
content: {
|
|
837
|
-
'application/json': {
|
|
838
|
-
schema: resolveSchema(contract.request.body),
|
|
839
|
-
},
|
|
840
|
-
},
|
|
841
|
-
},
|
|
842
|
-
}
|
|
843
|
-
: {}),
|
|
844
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
845
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
846
|
-
},
|
|
847
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
for (const contract of marketplaceCardContracts) {
|
|
851
|
-
const method = contract.method.toLowerCase();
|
|
852
|
-
if (!supportedHttpMethods.has(method)) {
|
|
853
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
854
|
-
}
|
|
855
|
-
registry.registerPath({
|
|
856
|
-
method: method,
|
|
857
|
-
path: toOpenApiPath(marketplace_card_1.MARKETPLACE_CARD_CONTROLLER, contract.path),
|
|
858
|
-
summary: contract.summary,
|
|
859
|
-
tags: ['Marketplace Cards'],
|
|
860
|
-
request: {
|
|
861
|
-
...(contract.request?.body
|
|
862
|
-
? {
|
|
863
|
-
body: {
|
|
864
|
-
required: true,
|
|
865
|
-
content: {
|
|
866
|
-
'application/json': {
|
|
867
|
-
schema: resolveSchema(contract.request.body),
|
|
868
|
-
},
|
|
869
|
-
},
|
|
870
|
-
},
|
|
871
|
-
}
|
|
872
|
-
: {}),
|
|
873
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
874
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
875
|
-
},
|
|
876
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
for (const contract of organizationContracts) {
|
|
880
|
-
const method = contract.method.toLowerCase();
|
|
881
|
-
if (!supportedHttpMethods.has(method)) {
|
|
882
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
883
|
-
}
|
|
884
|
-
registry.registerPath({
|
|
885
|
-
method: method,
|
|
886
|
-
path: toOpenApiPath(organization_1.ORGANIZATION_CONTROLLER, contract.path),
|
|
887
|
-
summary: contract.summary,
|
|
888
|
-
tags: ['Organization'],
|
|
889
|
-
request: {
|
|
890
|
-
...(contract.request?.body
|
|
891
|
-
? {
|
|
892
|
-
body: {
|
|
893
|
-
required: true,
|
|
894
|
-
content: {
|
|
895
|
-
'application/json': {
|
|
896
|
-
schema: resolveSchema(contract.request.body),
|
|
897
|
-
},
|
|
898
|
-
},
|
|
899
|
-
},
|
|
900
|
-
}
|
|
901
|
-
: {}),
|
|
902
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
903
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
904
|
-
},
|
|
905
|
-
responses: buildResponses(contract.responses, resolveSchema),
|
|
906
|
-
});
|
|
907
|
-
}
|
|
908
|
-
for (const contract of userContextContracts) {
|
|
909
|
-
const method = contract.method.toLowerCase();
|
|
910
|
-
if (!supportedHttpMethods.has(method)) {
|
|
911
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
474
|
+
}
|
|
475
|
+
: {}),
|
|
476
|
+
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
477
|
+
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
478
|
+
},
|
|
479
|
+
responses: SSE_CREATED_CONTRACTS.has(contract)
|
|
480
|
+
? buildSseSuccessResponses(contract.responses, 201, resolveSchema)
|
|
481
|
+
: buildResponses(contract.responses, resolveSchema),
|
|
482
|
+
});
|
|
912
483
|
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
484
|
+
};
|
|
485
|
+
const contractGroups = [
|
|
486
|
+
{ controller: auth_1.AUTH_CONTROLLER, tag: 'Auth', contracts: authContracts },
|
|
487
|
+
{ controller: chat_1.CHAT_CONTROLLER, tag: 'Chat', contracts: chatContracts },
|
|
488
|
+
{ controller: message_1.MESSAGE_CONTROLLER, tag: 'Message', contracts: messageContracts },
|
|
489
|
+
{ controller: file_1.FILE_CONTROLLER, tag: 'File', contracts: fileContracts, bodyContentType: 'multipart/form-data' },
|
|
490
|
+
{ controller: support_1.SUPPORT_CONTROLLER, tag: 'Support', contracts: supportContracts },
|
|
491
|
+
{ controller: wallet_1.WALLET_CONTROLLER, tag: 'Wallet', contracts: walletContracts },
|
|
492
|
+
{ controller: payment_1.PAYMENT_CONTROLLER, tag: 'Payment', contracts: paymentContracts },
|
|
493
|
+
{ controller: ai_model_1.AI_MODELS_CONTROLLER, tag: 'AI Models', contracts: aiModelContracts },
|
|
494
|
+
{ controller: model_page_1.PUBLIC_MODEL_CONTROLLER, tag: 'Models (public)', contracts: publicModelContracts },
|
|
495
|
+
{ controller: model_page_1.PUBLIC_PAGE_CONTROLLER, tag: 'Pages (public)', contracts: publicPageContracts },
|
|
496
|
+
{ controller: model_catalog_1.MODEL_CATALOG_CONTROLLER, tag: 'Model Catalog', contracts: modelCatalogContracts },
|
|
497
|
+
{ controller: pricing_page_1.PRICING_PAGE_CONTROLLER, tag: 'Pricing Page (public)', contracts: pricingPageContracts },
|
|
498
|
+
{ controller: generation_model_1.GENERATION_MODEL_CONTROLLER, tag: 'Generation Models', contracts: generationModelContracts },
|
|
499
|
+
{ controller: generation_job_1.GENERATION_JOB_CONTROLLER, tag: 'Generation Jobs', contracts: generationJobContracts },
|
|
500
|
+
{
|
|
501
|
+
controller: generation_job_chat_1.GENERATION_JOB_CHAT_CONTROLLER,
|
|
502
|
+
tag: 'Generation Job Chats',
|
|
503
|
+
contracts: generationJobChatContracts,
|
|
504
|
+
},
|
|
505
|
+
{ controller: admin_1.ADMIN_CONTROLLER, tag: 'Admin', contracts: adminContracts },
|
|
506
|
+
{ controller: marketplace_card_1.MARKETPLACE_CARD_CONTROLLER, tag: 'Marketplace Cards', contracts: marketplaceCardContracts },
|
|
507
|
+
{ controller: organization_1.ORGANIZATION_CONTROLLER, tag: 'Organization', contracts: organizationContracts },
|
|
508
|
+
{ controller: user_context_1.USER_CONTEXT_CONTROLLER, tag: 'User Context', contracts: userContextContracts },
|
|
509
|
+
];
|
|
510
|
+
for (const group of contractGroups) {
|
|
511
|
+
registerContractGroup(group);
|
|
936
512
|
}
|
|
937
513
|
const generator = new zod_to_openapi_1.OpenApiGeneratorV3(registry.definitions);
|
|
938
514
|
const document = generator.generateDocument({
|