@ai-grator/api 0.1.25 → 0.1.28
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 +26 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +26 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/model-catalog/endpoints/index.d.ts +3 -0
- package/build/model-catalog/endpoints/index.d.ts.map +1 -0
- package/build/model-catalog/endpoints/index.js +18 -0
- package/build/model-catalog/endpoints/model-catalog.d.ts +5 -0
- package/build/model-catalog/endpoints/model-catalog.d.ts.map +1 -0
- package/build/model-catalog/endpoints/model-catalog.js +7 -0
- package/build/model-catalog/endpoints/queries/get-model-catalog.query.d.ts +39 -0
- package/build/model-catalog/endpoints/queries/get-model-catalog.query.d.ts.map +1 -0
- package/build/model-catalog/endpoints/queries/get-model-catalog.query.js +19 -0
- package/build/model-catalog/endpoints/queries/index.d.ts +2 -0
- package/build/model-catalog/endpoints/queries/index.d.ts.map +1 -0
- package/build/model-catalog/endpoints/queries/index.js +17 -0
- package/build/model-catalog/enums/index.d.ts +3 -0
- package/build/model-catalog/enums/index.d.ts.map +1 -0
- package/build/model-catalog/enums/index.js +18 -0
- package/build/model-catalog/enums/model-category.enum.d.ts +7 -0
- package/build/model-catalog/enums/model-category.enum.d.ts.map +1 -0
- package/build/model-catalog/enums/model-category.enum.js +10 -0
- package/build/model-catalog/enums/price-unit.enum.d.ts +5 -0
- package/build/model-catalog/enums/price-unit.enum.d.ts.map +1 -0
- package/build/model-catalog/enums/price-unit.enum.js +8 -0
- package/build/model-catalog/index.d.ts +4 -0
- package/build/model-catalog/index.d.ts.map +1 -0
- package/build/model-catalog/index.js +19 -0
- package/build/model-catalog/models/index.d.ts +2 -0
- package/build/model-catalog/models/index.d.ts.map +1 -0
- package/build/model-catalog/models/index.js +17 -0
- package/build/model-catalog/models/model-catalog-item-response.schema.d.ts +16 -0
- package/build/model-catalog/models/model-catalog-item-response.schema.d.ts.map +1 -0
- package/build/model-catalog/models/model-catalog-item-response.schema.js +15 -0
- package/build/scripts/generate-openapi.js +76 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/user-context/endpoints/commands/index.d.ts +3 -0
- package/build/user-context/endpoints/commands/index.d.ts.map +1 -0
- package/build/user-context/endpoints/commands/index.js +18 -0
- package/build/user-context/endpoints/commands/toggle-user-context.command.d.ts +33 -0
- package/build/user-context/endpoints/commands/toggle-user-context.command.d.ts.map +1 -0
- package/build/user-context/endpoints/commands/toggle-user-context.command.js +25 -0
- package/build/user-context/endpoints/commands/upsert-user-context.command.d.ts +37 -0
- package/build/user-context/endpoints/commands/upsert-user-context.command.d.ts.map +1 -0
- package/build/user-context/endpoints/commands/upsert-user-context.command.js +27 -0
- package/build/user-context/endpoints/index.d.ts +4 -0
- package/build/user-context/endpoints/index.d.ts.map +1 -0
- package/build/user-context/endpoints/index.js +19 -0
- package/build/user-context/endpoints/queries/get-user-context.query.d.ts +23 -0
- package/build/user-context/endpoints/queries/get-user-context.query.d.ts.map +1 -0
- package/build/user-context/endpoints/queries/get-user-context.query.js +17 -0
- package/build/user-context/endpoints/queries/index.d.ts +2 -0
- package/build/user-context/endpoints/queries/index.d.ts.map +1 -0
- package/build/user-context/endpoints/queries/index.js +17 -0
- package/build/user-context/endpoints/user-context.d.ts +7 -0
- package/build/user-context/endpoints/user-context.d.ts.map +1 -0
- package/build/user-context/endpoints/user-context.js +9 -0
- package/build/user-context/index.d.ts +3 -0
- package/build/user-context/index.d.ts.map +1 -0
- package/build/user-context/index.js +18 -0
- package/build/user-context/models/index.d.ts +2 -0
- package/build/user-context/models/index.d.ts.map +1 -0
- package/build/user-context/models/index.js +17 -0
- package/build/user-context/models/user-context-response.schema.d.ts +10 -0
- package/build/user-context/models/user-context-response.schema.d.ts.map +1 -0
- package/build/user-context/models/user-context-response.schema.js +11 -0
- package/errors/errors.ts +26 -0
- package/index.ts +2 -0
- package/model-catalog/endpoints/index.ts +2 -0
- package/model-catalog/endpoints/model-catalog.ts +5 -0
- package/model-catalog/endpoints/queries/get-model-catalog.query.ts +18 -0
- package/model-catalog/endpoints/queries/index.ts +1 -0
- package/model-catalog/enums/index.ts +2 -0
- package/model-catalog/enums/model-category.enum.ts +6 -0
- package/model-catalog/enums/price-unit.enum.ts +4 -0
- package/model-catalog/index.ts +3 -0
- package/model-catalog/models/index.ts +1 -0
- package/model-catalog/models/model-catalog-item-response.schema.ts +15 -0
- package/package.json +1 -1
- package/scripts/generate-openapi.ts +94 -0
- package/user-context/endpoints/commands/index.ts +2 -0
- package/user-context/endpoints/commands/toggle-user-context.command.ts +25 -0
- package/user-context/endpoints/commands/upsert-user-context.command.ts +27 -0
- package/user-context/endpoints/index.ts +3 -0
- package/user-context/endpoints/queries/get-user-context.query.ts +16 -0
- package/user-context/endpoints/queries/index.ts +1 -0
- package/user-context/endpoints/user-context.ts +7 -0
- package/user-context/index.ts +2 -0
- package/user-context/models/index.ts +1 -0
- package/user-context/models/user-context-response.schema.ts +12 -0
package/build/errors/errors.d.ts
CHANGED
|
@@ -743,6 +743,13 @@ export declare const ERRORS: {
|
|
|
743
743
|
readonly message: "Модель перегружена. Попробуйте позже или выберите другую модель";
|
|
744
744
|
};
|
|
745
745
|
};
|
|
746
|
+
readonly AI_EMBEDDING: {
|
|
747
|
+
readonly REQUEST_ERROR: {
|
|
748
|
+
readonly httpCode: 500;
|
|
749
|
+
readonly code: "AI_EMBEDDING.REQUEST_ERROR";
|
|
750
|
+
readonly message: "Ошибка запроса эмбеддингов к AI";
|
|
751
|
+
};
|
|
752
|
+
};
|
|
746
753
|
readonly GENERATION_PROVIDER: {
|
|
747
754
|
readonly UNAUTHORIZED: {
|
|
748
755
|
readonly httpCode: 401;
|
|
@@ -822,5 +829,24 @@ export declare const ERRORS: {
|
|
|
822
829
|
readonly message: "Не удалось отметить сообщения поддержки как прочитанные";
|
|
823
830
|
};
|
|
824
831
|
};
|
|
832
|
+
readonly MODEL_CATALOG: {
|
|
833
|
+
readonly FIND_ERROR: {
|
|
834
|
+
readonly httpCode: 500;
|
|
835
|
+
readonly code: "MODEL_CATALOG.FIND_ERROR";
|
|
836
|
+
readonly message: "Не удалось получить каталог моделей";
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
readonly USER_CONTEXT: {
|
|
840
|
+
readonly FIND_ERROR: {
|
|
841
|
+
readonly httpCode: 500;
|
|
842
|
+
readonly code: "USER_CONTEXT.FIND_ERROR";
|
|
843
|
+
readonly message: "Не удалось найти контекст пользователя";
|
|
844
|
+
};
|
|
845
|
+
readonly UPSERT_ERROR: {
|
|
846
|
+
readonly httpCode: 500;
|
|
847
|
+
readonly code: "USER_CONTEXT.UPSERT_ERROR";
|
|
848
|
+
readonly message: "Не удалось сохранить контекст пользователя";
|
|
849
|
+
};
|
|
850
|
+
};
|
|
825
851
|
};
|
|
826
852
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAm1BT,CAAC"}
|
package/build/errors/errors.js
CHANGED
|
@@ -746,6 +746,13 @@ exports.ERRORS = {
|
|
|
746
746
|
message: 'Модель перегружена. Попробуйте позже или выберите другую модель',
|
|
747
747
|
},
|
|
748
748
|
},
|
|
749
|
+
AI_EMBEDDING: {
|
|
750
|
+
REQUEST_ERROR: {
|
|
751
|
+
httpCode: 500,
|
|
752
|
+
code: 'AI_EMBEDDING.REQUEST_ERROR',
|
|
753
|
+
message: 'Ошибка запроса эмбеддингов к AI',
|
|
754
|
+
},
|
|
755
|
+
},
|
|
749
756
|
GENERATION_PROVIDER: {
|
|
750
757
|
UNAUTHORIZED: {
|
|
751
758
|
httpCode: 401,
|
|
@@ -825,4 +832,23 @@ exports.ERRORS = {
|
|
|
825
832
|
message: 'Не удалось отметить сообщения поддержки как прочитанные',
|
|
826
833
|
},
|
|
827
834
|
},
|
|
835
|
+
MODEL_CATALOG: {
|
|
836
|
+
FIND_ERROR: {
|
|
837
|
+
httpCode: 500,
|
|
838
|
+
code: 'MODEL_CATALOG.FIND_ERROR',
|
|
839
|
+
message: 'Не удалось получить каталог моделей',
|
|
840
|
+
},
|
|
841
|
+
},
|
|
842
|
+
USER_CONTEXT: {
|
|
843
|
+
FIND_ERROR: {
|
|
844
|
+
httpCode: 500,
|
|
845
|
+
code: 'USER_CONTEXT.FIND_ERROR',
|
|
846
|
+
message: 'Не удалось найти контекст пользователя',
|
|
847
|
+
},
|
|
848
|
+
UPSERT_ERROR: {
|
|
849
|
+
httpCode: 500,
|
|
850
|
+
code: 'USER_CONTEXT.UPSERT_ERROR',
|
|
851
|
+
message: 'Не удалось сохранить контекст пользователя',
|
|
852
|
+
},
|
|
853
|
+
},
|
|
828
854
|
};
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './_common';
|
|
2
2
|
export * from './ai-model';
|
|
3
3
|
export * from './generation-model';
|
|
4
|
+
export * from './model-catalog';
|
|
4
5
|
export * from './generation-job';
|
|
5
6
|
export * from './article';
|
|
6
7
|
export * from './auth';
|
|
@@ -17,4 +18,5 @@ export * from './file';
|
|
|
17
18
|
export * from './generation-job-chat';
|
|
18
19
|
export * from './marketplace-card';
|
|
19
20
|
export * from './support';
|
|
21
|
+
export * from './user-context';
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./_common"), exports);
|
|
18
18
|
__exportStar(require("./ai-model"), exports);
|
|
19
19
|
__exportStar(require("./generation-model"), exports);
|
|
20
|
+
__exportStar(require("./model-catalog"), exports);
|
|
20
21
|
__exportStar(require("./generation-job"), exports);
|
|
21
22
|
__exportStar(require("./article"), exports);
|
|
22
23
|
__exportStar(require("./auth"), exports);
|
|
@@ -33,3 +34,4 @@ __exportStar(require("./file"), exports);
|
|
|
33
34
|
__exportStar(require("./generation-job-chat"), exports);
|
|
34
35
|
__exportStar(require("./marketplace-card"), exports);
|
|
35
36
|
__exportStar(require("./support"), exports);
|
|
37
|
+
__exportStar(require("./user-context"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../model-catalog/endpoints/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./model-catalog"), exports);
|
|
18
|
+
__exportStar(require("./queries"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../model-catalog/endpoints/model-catalog.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EAAG,QAAiB,CAAC;AAE1D,eAAO,MAAM,oBAAoB;;CAEvB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HTTP_METHODS } from '../../../_common';
|
|
3
|
+
export declare const GetModelCatalogQueryResponse: z.ZodObject<{
|
|
4
|
+
models: z.ZodArray<z.ZodObject<{
|
|
5
|
+
uuid: z.ZodUUID;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
description: z.ZodNullable<z.ZodString>;
|
|
8
|
+
category: z.ZodEnum<typeof import("../..").MODEL_CATEGORY>;
|
|
9
|
+
icons: z.ZodObject<{
|
|
10
|
+
light: z.ZodString;
|
|
11
|
+
dark: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
priceFrom: z.ZodNumber;
|
|
14
|
+
priceUnit: z.ZodEnum<typeof import("../..").PRICE_UNIT>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const GetModelCatalogQuery: {
|
|
18
|
+
method: HTTP_METHODS.GET;
|
|
19
|
+
path: "";
|
|
20
|
+
summary: string;
|
|
21
|
+
responses: {
|
|
22
|
+
200: z.ZodObject<{
|
|
23
|
+
models: z.ZodArray<z.ZodObject<{
|
|
24
|
+
uuid: z.ZodUUID;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
description: z.ZodNullable<z.ZodString>;
|
|
27
|
+
category: z.ZodEnum<typeof import("../..").MODEL_CATEGORY>;
|
|
28
|
+
icons: z.ZodObject<{
|
|
29
|
+
light: z.ZodString;
|
|
30
|
+
dark: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
priceFrom: z.ZodNumber;
|
|
33
|
+
priceUnit: z.ZodEnum<typeof import("../..").PRICE_UNIT>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
500: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=get-model-catalog.query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-model-catalog.query.d.ts","sourceRoot":"","sources":["../../../../model-catalog/endpoints/queries/get-model-catalog.query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,YAAY,EAA2B,MAAM,kBAAkB,CAAC;AAIzF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;iBAEvC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;CAQ/B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetModelCatalogQuery = exports.GetModelCatalogQueryResponse = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _common_1 = require("../../../_common");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
const model_catalog_1 = require("../model-catalog");
|
|
8
|
+
exports.GetModelCatalogQueryResponse = zod_1.z.object({
|
|
9
|
+
models: zod_1.z.array(models_1.ModelCatalogItemResponseSchema),
|
|
10
|
+
});
|
|
11
|
+
exports.GetModelCatalogQuery = (0, _common_1.defineContract)({
|
|
12
|
+
method: _common_1.HTTP_METHODS.GET,
|
|
13
|
+
path: model_catalog_1.MODEL_CATALOG_ROUTES.GET_ALL,
|
|
14
|
+
summary: 'Get public model catalog',
|
|
15
|
+
responses: {
|
|
16
|
+
200: exports.GetModelCatalogQueryResponse,
|
|
17
|
+
500: _common_1.HttpErrorResponseSchema,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../model-catalog/endpoints/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-model-catalog.query"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../model-catalog/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./model-category.enum"), exports);
|
|
18
|
+
__exportStar(require("./price-unit.enum"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-category.enum.d.ts","sourceRoot":"","sources":["../../../model-catalog/enums/model-category.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;CAClB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MODEL_CATEGORY = void 0;
|
|
4
|
+
var MODEL_CATEGORY;
|
|
5
|
+
(function (MODEL_CATEGORY) {
|
|
6
|
+
MODEL_CATEGORY["TEXT"] = "text";
|
|
7
|
+
MODEL_CATEGORY["IMAGE"] = "image";
|
|
8
|
+
MODEL_CATEGORY["VIDEO"] = "video";
|
|
9
|
+
MODEL_CATEGORY["MUSIC"] = "music";
|
|
10
|
+
})(MODEL_CATEGORY || (exports.MODEL_CATEGORY = MODEL_CATEGORY = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-unit.enum.d.ts","sourceRoot":"","sources":["../../../model-catalog/enums/price-unit.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAClB,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;CACpC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRICE_UNIT = void 0;
|
|
4
|
+
var PRICE_UNIT;
|
|
5
|
+
(function (PRICE_UNIT) {
|
|
6
|
+
PRICE_UNIT["PER_MILLION_TOKENS"] = "per_million_tokens";
|
|
7
|
+
PRICE_UNIT["PER_GENERATION"] = "per_generation";
|
|
8
|
+
})(PRICE_UNIT || (exports.PRICE_UNIT = PRICE_UNIT = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model-catalog/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
18
|
+
__exportStar(require("./models"), exports);
|
|
19
|
+
__exportStar(require("./endpoints"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../model-catalog/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./model-catalog-item-response.schema"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MODEL_CATEGORY, PRICE_UNIT } from '../enums';
|
|
3
|
+
export declare const ModelCatalogItemResponseSchema: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodUUID;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
description: z.ZodNullable<z.ZodString>;
|
|
7
|
+
category: z.ZodEnum<typeof MODEL_CATEGORY>;
|
|
8
|
+
icons: z.ZodObject<{
|
|
9
|
+
light: z.ZodString;
|
|
10
|
+
dark: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
priceFrom: z.ZodNumber;
|
|
13
|
+
priceUnit: z.ZodEnum<typeof PRICE_UNIT>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type ModelCatalogItemResponseSchemaType = z.infer<typeof ModelCatalogItemResponseSchema>;
|
|
16
|
+
//# sourceMappingURL=model-catalog-item-response.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog-item-response.schema.d.ts","sourceRoot":"","sources":["../../../model-catalog/models/model-catalog-item-response.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtD,eAAO,MAAM,8BAA8B;;;;;;;;;;;iBAQzC,CAAC;AAEH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelCatalogItemResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _common_1 = require("../../_common");
|
|
6
|
+
const enums_1 = require("../enums");
|
|
7
|
+
exports.ModelCatalogItemResponseSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.uuid(),
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
description: zod_1.z.string().nullable(),
|
|
11
|
+
category: zod_1.z.enum(enums_1.MODEL_CATEGORY),
|
|
12
|
+
icons: _common_1.IconSchema,
|
|
13
|
+
priceFrom: zod_1.z.number().nonnegative(),
|
|
14
|
+
priceUnit: zod_1.z.enum(enums_1.PRICE_UNIT),
|
|
15
|
+
});
|
|
@@ -62,6 +62,8 @@ const create_payment_command_1 = require("../payment/endpoints/commands/create-p
|
|
|
62
62
|
const ai_model_1 = require("../ai-model/endpoints/ai-model");
|
|
63
63
|
const get_ai_model_by_uuid_query_1 = require("../ai-model/endpoints/queries/get-ai-model-by-uuid.query");
|
|
64
64
|
const get_ai_models_query_1 = require("../ai-model/endpoints/queries/get-ai-models.query");
|
|
65
|
+
const model_catalog_1 = require("../model-catalog/endpoints/model-catalog");
|
|
66
|
+
const get_model_catalog_query_1 = require("../model-catalog/endpoints/queries/get-model-catalog.query");
|
|
65
67
|
const generation_model_1 = require("../generation-model/endpoints/generation-model");
|
|
66
68
|
const get_generation_models_query_1 = require("../generation-model/endpoints/queries/get-generation-models.query");
|
|
67
69
|
const get_generation_models_by_type_query_1 = require("../generation-model/endpoints/queries/get-generation-models-by-type.query");
|
|
@@ -87,6 +89,10 @@ const update_marketplace_card_command_1 = require("../marketplace-card/endpoints
|
|
|
87
89
|
const get_marketplace_card_query_1 = require("../marketplace-card/endpoints/queries/get-marketplace-card.query");
|
|
88
90
|
const get_marketplace_card_history_query_1 = require("../marketplace-card/endpoints/queries/get-marketplace-card-history.query");
|
|
89
91
|
const get_marketplace_card_config_query_1 = require("../marketplace-card/endpoints/queries/get-marketplace-card-config.query");
|
|
92
|
+
const user_context_1 = require("../user-context/endpoints/user-context");
|
|
93
|
+
const get_user_context_query_1 = require("../user-context/endpoints/queries/get-user-context.query");
|
|
94
|
+
const upsert_user_context_command_1 = require("../user-context/endpoints/commands/upsert-user-context.command");
|
|
95
|
+
const toggle_user_context_command_1 = require("../user-context/endpoints/commands/toggle-user-context.command");
|
|
90
96
|
const supportedHttpMethods = new Set(['get', 'post', 'put', 'patch', 'delete']);
|
|
91
97
|
function toOpenApiPath(controller, routePath) {
|
|
92
98
|
const normalizedController = controller.replace(/^\/+|\/+$/g, '');
|
|
@@ -184,6 +190,7 @@ async function main() {
|
|
|
184
190
|
registerSchema('AiModelsGetAllResponse', get_ai_models_query_1.GetAllAiModelsQueryResponse);
|
|
185
191
|
registerSchema('AiModelsGetByUuidParams', get_ai_model_by_uuid_query_1.GetAiModelByUuidQueryParams);
|
|
186
192
|
registerSchema('AiModelsGetByUuidResponse', get_ai_model_by_uuid_query_1.GetAiModelByUuidQueryResponse);
|
|
193
|
+
registerSchema('ModelCatalogGetAllResponse', get_model_catalog_query_1.GetModelCatalogQueryResponse);
|
|
187
194
|
registerSchema('GenerationModelGetAllResponse', get_generation_models_query_1.GetGenerationModelsQueryResponse);
|
|
188
195
|
registerSchema('GenerationModelGetByTypeParams', get_generation_models_by_type_query_1.GetGenerationModelsByTypeQueryParams);
|
|
189
196
|
registerSchema('GenerationModelGetByTypeResponse', get_generation_models_by_type_query_1.GetGenerationModelsByTypeQueryResponse);
|
|
@@ -276,6 +283,11 @@ async function main() {
|
|
|
276
283
|
registerSchema('MarketplaceCardHistoryQuery', get_marketplace_card_history_query_1.GetMarketplaceCardHistoryQueryQuery);
|
|
277
284
|
registerSchema('MarketplaceCardHistoryResponse', get_marketplace_card_history_query_1.GetMarketplaceCardHistoryQueryResponse);
|
|
278
285
|
registerSchema('MarketplaceCardConfigResponse', get_marketplace_card_config_query_1.GetMarketplaceCardConfigResponse);
|
|
286
|
+
registerSchema('UserContextGetResponse', get_user_context_query_1.GetUserContextQueryResponse);
|
|
287
|
+
registerSchema('UserContextUpsertRequest', upsert_user_context_command_1.UpsertUserContextCommandBody);
|
|
288
|
+
registerSchema('UserContextUpsertResponse', upsert_user_context_command_1.UpsertUserContextCommandResponse);
|
|
289
|
+
registerSchema('UserContextToggleRequest', toggle_user_context_command_1.ToggleUserContextCommandBody);
|
|
290
|
+
registerSchema('UserContextToggleResponse', toggle_user_context_command_1.ToggleUserContextCommandResponse);
|
|
279
291
|
const authContracts = [
|
|
280
292
|
register_command_1.RegisterCommand,
|
|
281
293
|
login_command_1.LoginCommand,
|
|
@@ -309,6 +321,11 @@ async function main() {
|
|
|
309
321
|
];
|
|
310
322
|
const walletContracts = [get_wallet_balance_query_1.GetWalletBalanceQuery, get_wallet_transactions_query_1.GetWalletTransactionsQuery];
|
|
311
323
|
const paymentContracts = [create_payment_command_1.CreatePaymentCommand];
|
|
324
|
+
const userContextContracts = [
|
|
325
|
+
get_user_context_query_1.GetUserContextQuery,
|
|
326
|
+
upsert_user_context_command_1.UpsertUserContextCommand,
|
|
327
|
+
toggle_user_context_command_1.ToggleUserContextCommand,
|
|
328
|
+
];
|
|
312
329
|
const marketplaceCardContracts = [
|
|
313
330
|
create_marketplace_card_command_1.CreateMarketplaceCardCommand,
|
|
314
331
|
get_marketplace_card_history_query_1.GetMarketplaceCardHistoryQuery,
|
|
@@ -318,6 +335,7 @@ async function main() {
|
|
|
318
335
|
delete_marketplace_card_command_1.DeleteMarketplaceCardCommand,
|
|
319
336
|
];
|
|
320
337
|
const aiModelContracts = [get_ai_models_query_1.GetAllAiModelsQuery, get_ai_model_by_uuid_query_1.GetAiModelByUuidQuery];
|
|
338
|
+
const modelCatalogContracts = [get_model_catalog_query_1.GetModelCatalogQuery];
|
|
321
339
|
const generationModelContracts = [
|
|
322
340
|
get_generation_models_query_1.GetGenerationModelsQuery,
|
|
323
341
|
get_generation_models_by_type_query_1.GetGenerationModelsByTypeQuery,
|
|
@@ -595,6 +613,35 @@ async function main() {
|
|
|
595
613
|
responses: buildResponses(contract.responses, resolveSchema),
|
|
596
614
|
});
|
|
597
615
|
}
|
|
616
|
+
for (const contract of modelCatalogContracts) {
|
|
617
|
+
const method = contract.method.toLowerCase();
|
|
618
|
+
if (!supportedHttpMethods.has(method)) {
|
|
619
|
+
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
620
|
+
}
|
|
621
|
+
registry.registerPath({
|
|
622
|
+
method: method,
|
|
623
|
+
path: toOpenApiPath(model_catalog_1.MODEL_CATALOG_CONTROLLER, contract.path),
|
|
624
|
+
summary: contract.summary,
|
|
625
|
+
tags: ['Model Catalog'],
|
|
626
|
+
request: {
|
|
627
|
+
...(contract.request?.body
|
|
628
|
+
? {
|
|
629
|
+
body: {
|
|
630
|
+
required: true,
|
|
631
|
+
content: {
|
|
632
|
+
'application/json': {
|
|
633
|
+
schema: resolveSchema(contract.request.body),
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
},
|
|
637
|
+
}
|
|
638
|
+
: {}),
|
|
639
|
+
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
640
|
+
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
641
|
+
},
|
|
642
|
+
responses: buildResponses(contract.responses, resolveSchema),
|
|
643
|
+
});
|
|
644
|
+
}
|
|
598
645
|
for (const contract of generationModelContracts) {
|
|
599
646
|
const method = contract.method.toLowerCase();
|
|
600
647
|
if (!supportedHttpMethods.has(method)) {
|
|
@@ -740,6 +787,35 @@ async function main() {
|
|
|
740
787
|
responses: buildResponses(contract.responses, resolveSchema),
|
|
741
788
|
});
|
|
742
789
|
}
|
|
790
|
+
for (const contract of userContextContracts) {
|
|
791
|
+
const method = contract.method.toLowerCase();
|
|
792
|
+
if (!supportedHttpMethods.has(method)) {
|
|
793
|
+
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
794
|
+
}
|
|
795
|
+
registry.registerPath({
|
|
796
|
+
method: method,
|
|
797
|
+
path: toOpenApiPath(user_context_1.USER_CONTEXT_CONTROLLER, contract.path),
|
|
798
|
+
summary: contract.summary,
|
|
799
|
+
tags: ['User Context'],
|
|
800
|
+
request: {
|
|
801
|
+
...(contract.request?.body
|
|
802
|
+
? {
|
|
803
|
+
body: {
|
|
804
|
+
required: true,
|
|
805
|
+
content: {
|
|
806
|
+
'application/json': {
|
|
807
|
+
schema: resolveSchema(contract.request.body),
|
|
808
|
+
},
|
|
809
|
+
},
|
|
810
|
+
},
|
|
811
|
+
}
|
|
812
|
+
: {}),
|
|
813
|
+
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
814
|
+
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
815
|
+
},
|
|
816
|
+
responses: buildResponses(contract.responses, resolveSchema),
|
|
817
|
+
});
|
|
818
|
+
}
|
|
743
819
|
const generator = new zod_to_openapi_1.OpenApiGeneratorV3(registry.definitions);
|
|
744
820
|
const document = generator.generateDocument({
|
|
745
821
|
openapi: '3.0.0',
|