@ai-grator/api 0.1.38 → 0.1.39
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/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/scripts/generate-openapi.js +62 -491
- package/build/tsconfig.tsbuildinfo +1 -1
- 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/scripts/generate-openapi.ts +89 -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");
|
|
@@ -329,6 +330,8 @@ async function main() {
|
|
|
329
330
|
registerSchema('AdminUpdateOrganizationRequest', update_admin_organization_command_1.UpdateAdminOrganizationCommandBody);
|
|
330
331
|
registerSchema('AdminUpdateOrganizationResponse', update_admin_organization_command_1.UpdateAdminOrganizationCommandResponse);
|
|
331
332
|
registerSchema('OrganizationGetResponse', get_organization_query_1.GetOrganizationQueryResponse);
|
|
333
|
+
registerSchema('PublicPageGetBySlugParams', get_public_page_by_slug_query_1.GetPublicPageBySlugQueryParams);
|
|
334
|
+
registerSchema('PublicPageGetBySlugResponse', get_public_page_by_slug_query_1.GetPublicPageBySlugQueryResponse);
|
|
332
335
|
registerSchema('UserContextGetResponse', get_user_context_query_1.GetUserContextQueryResponse);
|
|
333
336
|
registerSchema('UserContextUpsertRequest', upsert_user_context_command_1.UpsertUserContextCommandBody);
|
|
334
337
|
registerSchema('UserContextUpsertResponse', upsert_user_context_command_1.UpsertUserContextCommandResponse);
|
|
@@ -382,6 +385,7 @@ async function main() {
|
|
|
382
385
|
];
|
|
383
386
|
const aiModelContracts = [get_ai_models_query_1.GetAllAiModelsQuery, get_ai_model_by_uuid_query_1.GetAiModelByUuidQuery];
|
|
384
387
|
const publicModelContracts = [list_public_models_query_1.ListPublicModelsQuery, get_public_model_by_slug_query_1.GetPublicModelBySlugQuery];
|
|
388
|
+
const publicPageContracts = [get_public_page_by_slug_query_1.GetPublicPageBySlugQuery];
|
|
385
389
|
const modelCatalogContracts = [get_model_catalog_query_1.GetModelCatalogQuery];
|
|
386
390
|
const generationModelContracts = [
|
|
387
391
|
get_generation_models_query_1.GetGenerationModelsQuery,
|
|
@@ -439,500 +443,67 @@ async function main() {
|
|
|
439
443
|
update_admin_organization_command_1.UpdateAdminOrganizationCommand,
|
|
440
444
|
];
|
|
441
445
|
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),
|
|
446
|
+
const DEFAULT_BODY_CONTENT_TYPE = 'application/json';
|
|
447
|
+
const SSE_CREATED_CONTRACTS = new Set([create_message_command_1.CreateMessageCommand]);
|
|
448
|
+
const registerContractGroup = ({ controller, tag, contracts, bodyContentType = DEFAULT_BODY_CONTENT_TYPE, }) => {
|
|
449
|
+
for (const contract of contracts) {
|
|
450
|
+
const method = contract.method.toLowerCase();
|
|
451
|
+
if (!supportedHttpMethods.has(method)) {
|
|
452
|
+
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
453
|
+
}
|
|
454
|
+
registry.registerPath({
|
|
455
|
+
method: method,
|
|
456
|
+
path: toOpenApiPath(controller, contract.path),
|
|
457
|
+
summary: contract.summary,
|
|
458
|
+
tags: [tag],
|
|
459
|
+
request: {
|
|
460
|
+
...(contract.request?.body
|
|
461
|
+
? {
|
|
462
|
+
body: {
|
|
463
|
+
required: true,
|
|
464
|
+
content: {
|
|
465
|
+
[bodyContentType]: {
|
|
466
|
+
schema: resolveSchema(contract.request.body),
|
|
467
|
+
},
|
|
518
468
|
},
|
|
519
469
|
},
|
|
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}`);
|
|
470
|
+
}
|
|
471
|
+
: {}),
|
|
472
|
+
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
473
|
+
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
474
|
+
},
|
|
475
|
+
responses: SSE_CREATED_CONTRACTS.has(contract)
|
|
476
|
+
? buildSseSuccessResponses(contract.responses, 201, resolveSchema)
|
|
477
|
+
: buildResponses(contract.responses, resolveSchema),
|
|
478
|
+
});
|
|
912
479
|
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
480
|
+
};
|
|
481
|
+
const contractGroups = [
|
|
482
|
+
{ controller: auth_1.AUTH_CONTROLLER, tag: 'Auth', contracts: authContracts },
|
|
483
|
+
{ controller: chat_1.CHAT_CONTROLLER, tag: 'Chat', contracts: chatContracts },
|
|
484
|
+
{ controller: message_1.MESSAGE_CONTROLLER, tag: 'Message', contracts: messageContracts },
|
|
485
|
+
{ controller: file_1.FILE_CONTROLLER, tag: 'File', contracts: fileContracts, bodyContentType: 'multipart/form-data' },
|
|
486
|
+
{ controller: support_1.SUPPORT_CONTROLLER, tag: 'Support', contracts: supportContracts },
|
|
487
|
+
{ controller: wallet_1.WALLET_CONTROLLER, tag: 'Wallet', contracts: walletContracts },
|
|
488
|
+
{ controller: payment_1.PAYMENT_CONTROLLER, tag: 'Payment', contracts: paymentContracts },
|
|
489
|
+
{ controller: ai_model_1.AI_MODELS_CONTROLLER, tag: 'AI Models', contracts: aiModelContracts },
|
|
490
|
+
{ controller: model_page_1.PUBLIC_MODEL_CONTROLLER, tag: 'Models (public)', contracts: publicModelContracts },
|
|
491
|
+
{ controller: model_page_1.PUBLIC_PAGE_CONTROLLER, tag: 'Pages (public)', contracts: publicPageContracts },
|
|
492
|
+
{ controller: model_catalog_1.MODEL_CATALOG_CONTROLLER, tag: 'Model Catalog', contracts: modelCatalogContracts },
|
|
493
|
+
{ controller: generation_model_1.GENERATION_MODEL_CONTROLLER, tag: 'Generation Models', contracts: generationModelContracts },
|
|
494
|
+
{ controller: generation_job_1.GENERATION_JOB_CONTROLLER, tag: 'Generation Jobs', contracts: generationJobContracts },
|
|
495
|
+
{
|
|
496
|
+
controller: generation_job_chat_1.GENERATION_JOB_CHAT_CONTROLLER,
|
|
497
|
+
tag: 'Generation Job Chats',
|
|
498
|
+
contracts: generationJobChatContracts,
|
|
499
|
+
},
|
|
500
|
+
{ controller: admin_1.ADMIN_CONTROLLER, tag: 'Admin', contracts: adminContracts },
|
|
501
|
+
{ controller: marketplace_card_1.MARKETPLACE_CARD_CONTROLLER, tag: 'Marketplace Cards', contracts: marketplaceCardContracts },
|
|
502
|
+
{ controller: organization_1.ORGANIZATION_CONTROLLER, tag: 'Organization', contracts: organizationContracts },
|
|
503
|
+
{ controller: user_context_1.USER_CONTEXT_CONTROLLER, tag: 'User Context', contracts: userContextContracts },
|
|
504
|
+
];
|
|
505
|
+
for (const group of contractGroups) {
|
|
506
|
+
registerContractGroup(group);
|
|
936
507
|
}
|
|
937
508
|
const generator = new zod_to_openapi_1.OpenApiGeneratorV3(registry.definitions);
|
|
938
509
|
const document = generator.generateDocument({
|