@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../user-context/endpoints/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,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("./upsert-user-context.command"), exports);
|
|
18
|
+
__exportStar(require("./toggle-user-context.command"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HTTP_METHODS } from '../../../_common';
|
|
3
|
+
export declare const ToggleUserContextCommandBody: z.ZodObject<{
|
|
4
|
+
enabled: z.ZodBoolean;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const ToggleUserContextCommandResponse: z.ZodObject<{
|
|
7
|
+
name: z.ZodNullable<z.ZodString>;
|
|
8
|
+
aboutMe: z.ZodNullable<z.ZodString>;
|
|
9
|
+
preferences: z.ZodNullable<z.ZodString>;
|
|
10
|
+
enabled: z.ZodBoolean;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const ToggleUserContextCommand: {
|
|
13
|
+
method: HTTP_METHODS.POST;
|
|
14
|
+
path: "toggle";
|
|
15
|
+
summary: string;
|
|
16
|
+
request: {
|
|
17
|
+
body: z.ZodObject<{
|
|
18
|
+
enabled: z.ZodBoolean;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
};
|
|
21
|
+
responses: {
|
|
22
|
+
200: z.ZodObject<{
|
|
23
|
+
name: z.ZodNullable<z.ZodString>;
|
|
24
|
+
aboutMe: z.ZodNullable<z.ZodString>;
|
|
25
|
+
preferences: z.ZodNullable<z.ZodString>;
|
|
26
|
+
enabled: z.ZodBoolean;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
400: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
29
|
+
401: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
30
|
+
500: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=toggle-user-context.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-user-context.command.d.ts","sourceRoot":"","sources":["../../../../user-context/endpoints/commands/toggle-user-context.command.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,gCAAgC;;;;;iBAA4B,CAAC;AAE1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;CAanC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToggleUserContextCommand = exports.ToggleUserContextCommandResponse = exports.ToggleUserContextCommandBody = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _common_1 = require("../../../_common");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
const user_context_1 = require("../user-context");
|
|
8
|
+
exports.ToggleUserContextCommandBody = zod_1.z.object({
|
|
9
|
+
enabled: zod_1.z.boolean(),
|
|
10
|
+
});
|
|
11
|
+
exports.ToggleUserContextCommandResponse = models_1.UserContextResponseSchema;
|
|
12
|
+
exports.ToggleUserContextCommand = (0, _common_1.defineContract)({
|
|
13
|
+
method: _common_1.HTTP_METHODS.POST,
|
|
14
|
+
path: user_context_1.USER_CONTEXT_ROUTES.TOGGLE,
|
|
15
|
+
summary: 'Enable or disable applying the current user personalization context',
|
|
16
|
+
request: {
|
|
17
|
+
body: exports.ToggleUserContextCommandBody,
|
|
18
|
+
},
|
|
19
|
+
responses: {
|
|
20
|
+
200: exports.ToggleUserContextCommandResponse,
|
|
21
|
+
400: _common_1.HttpErrorResponseSchema,
|
|
22
|
+
401: _common_1.HttpErrorResponseSchema,
|
|
23
|
+
500: _common_1.HttpErrorResponseSchema,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HTTP_METHODS } from '../../../_common';
|
|
3
|
+
export declare const UpsertUserContextCommandBody: z.ZodObject<{
|
|
4
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
aboutMe: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
preferences: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const UpsertUserContextCommandResponse: z.ZodObject<{
|
|
9
|
+
name: z.ZodNullable<z.ZodString>;
|
|
10
|
+
aboutMe: z.ZodNullable<z.ZodString>;
|
|
11
|
+
preferences: z.ZodNullable<z.ZodString>;
|
|
12
|
+
enabled: z.ZodBoolean;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const UpsertUserContextCommand: {
|
|
15
|
+
method: HTTP_METHODS.POST;
|
|
16
|
+
path: "";
|
|
17
|
+
summary: string;
|
|
18
|
+
request: {
|
|
19
|
+
body: z.ZodObject<{
|
|
20
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
aboutMe: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
preferences: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
};
|
|
25
|
+
responses: {
|
|
26
|
+
200: z.ZodObject<{
|
|
27
|
+
name: z.ZodNullable<z.ZodString>;
|
|
28
|
+
aboutMe: z.ZodNullable<z.ZodString>;
|
|
29
|
+
preferences: z.ZodNullable<z.ZodString>;
|
|
30
|
+
enabled: z.ZodBoolean;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
400: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
33
|
+
401: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
34
|
+
500: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=upsert-user-context.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upsert-user-context.command.d.ts","sourceRoot":"","sources":["../../../../user-context/endpoints/commands/upsert-user-context.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,YAAY,EAA2B,MAAM,kBAAkB,CAAC;AAIzF,eAAO,MAAM,4BAA4B;;;;iBAIvC,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;iBAA4B,CAAC;AAE1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;CAanC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpsertUserContextCommand = exports.UpsertUserContextCommandResponse = exports.UpsertUserContextCommandBody = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _common_1 = require("../../../_common");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
const user_context_1 = require("../user-context");
|
|
8
|
+
exports.UpsertUserContextCommandBody = zod_1.z.object({
|
|
9
|
+
name: zod_1.z.string().max(models_1.USER_CONTEXT_FIELD_MAX_LENGTH).nullable().optional(),
|
|
10
|
+
aboutMe: zod_1.z.string().max(models_1.USER_CONTEXT_FIELD_MAX_LENGTH).nullable().optional(),
|
|
11
|
+
preferences: zod_1.z.string().max(models_1.USER_CONTEXT_FIELD_MAX_LENGTH).nullable().optional(),
|
|
12
|
+
});
|
|
13
|
+
exports.UpsertUserContextCommandResponse = models_1.UserContextResponseSchema;
|
|
14
|
+
exports.UpsertUserContextCommand = (0, _common_1.defineContract)({
|
|
15
|
+
method: _common_1.HTTP_METHODS.POST,
|
|
16
|
+
path: user_context_1.USER_CONTEXT_ROUTES.UPSERT,
|
|
17
|
+
summary: 'Create or update the current user personalization context',
|
|
18
|
+
request: {
|
|
19
|
+
body: exports.UpsertUserContextCommandBody,
|
|
20
|
+
},
|
|
21
|
+
responses: {
|
|
22
|
+
200: exports.UpsertUserContextCommandResponse,
|
|
23
|
+
400: _common_1.HttpErrorResponseSchema,
|
|
24
|
+
401: _common_1.HttpErrorResponseSchema,
|
|
25
|
+
500: _common_1.HttpErrorResponseSchema,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../user-context/endpoints/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,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("./user-context"), exports);
|
|
18
|
+
__exportStar(require("./commands"), exports);
|
|
19
|
+
__exportStar(require("./queries"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTTP_METHODS } from '../../../_common';
|
|
2
|
+
export declare const GetUserContextQueryResponse: import("zod").ZodObject<{
|
|
3
|
+
name: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4
|
+
aboutMe: import("zod").ZodNullable<import("zod").ZodString>;
|
|
5
|
+
preferences: import("zod").ZodNullable<import("zod").ZodString>;
|
|
6
|
+
enabled: import("zod").ZodBoolean;
|
|
7
|
+
}, import("zod/v4/core").$strip>;
|
|
8
|
+
export declare const GetUserContextQuery: {
|
|
9
|
+
method: HTTP_METHODS.GET;
|
|
10
|
+
path: "";
|
|
11
|
+
summary: string;
|
|
12
|
+
responses: {
|
|
13
|
+
200: import("zod").ZodObject<{
|
|
14
|
+
name: import("zod").ZodNullable<import("zod").ZodString>;
|
|
15
|
+
aboutMe: import("zod").ZodNullable<import("zod").ZodString>;
|
|
16
|
+
preferences: import("zod").ZodNullable<import("zod").ZodString>;
|
|
17
|
+
enabled: import("zod").ZodBoolean;
|
|
18
|
+
}, import("zod/v4/core").$strip>;
|
|
19
|
+
401: import("zod").ZodType<import("../../../_common").HttpErrorResponse, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
20
|
+
500: import("zod").ZodType<import("../../../_common").HttpErrorResponse, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=get-user-context.query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-context.query.d.ts","sourceRoot":"","sources":["../../../../user-context/endpoints/queries/get-user-context.query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAA2B,MAAM,kBAAkB,CAAC;AAIzF,eAAO,MAAM,2BAA2B;;;;;gCAA4B,CAAC;AAErE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;CAS9B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetUserContextQuery = exports.GetUserContextQueryResponse = void 0;
|
|
4
|
+
const _common_1 = require("../../../_common");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
const user_context_1 = require("../user-context");
|
|
7
|
+
exports.GetUserContextQueryResponse = models_1.UserContextResponseSchema;
|
|
8
|
+
exports.GetUserContextQuery = (0, _common_1.defineContract)({
|
|
9
|
+
method: _common_1.HTTP_METHODS.GET,
|
|
10
|
+
path: user_context_1.USER_CONTEXT_ROUTES.GET,
|
|
11
|
+
summary: 'Get the current user personalization context',
|
|
12
|
+
responses: {
|
|
13
|
+
200: exports.GetUserContextQueryResponse,
|
|
14
|
+
401: _common_1.HttpErrorResponseSchema,
|
|
15
|
+
500: _common_1.HttpErrorResponseSchema,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../user-context/endpoints/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,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-user-context.query"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-context.d.ts","sourceRoot":"","sources":["../../../user-context/endpoints/user-context.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,EAAG,cAAuB,CAAC;AAE/D,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_CONTEXT_ROUTES = exports.USER_CONTEXT_CONTROLLER = void 0;
|
|
4
|
+
exports.USER_CONTEXT_CONTROLLER = 'user-context';
|
|
5
|
+
exports.USER_CONTEXT_ROUTES = {
|
|
6
|
+
GET: '',
|
|
7
|
+
UPSERT: '',
|
|
8
|
+
TOGGLE: 'toggle',
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../user-context/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,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("./models"), exports);
|
|
18
|
+
__exportStar(require("./endpoints"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../user-context/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,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("./user-context-response.schema"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const USER_CONTEXT_FIELD_MAX_LENGTH = 2000;
|
|
3
|
+
export declare const UserContextResponseSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodNullable<z.ZodString>;
|
|
5
|
+
aboutMe: z.ZodNullable<z.ZodString>;
|
|
6
|
+
preferences: z.ZodNullable<z.ZodString>;
|
|
7
|
+
enabled: z.ZodBoolean;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type UserContextResponseSchemaType = z.infer<typeof UserContextResponseSchema>;
|
|
10
|
+
//# sourceMappingURL=user-context-response.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-context-response.schema.d.ts","sourceRoot":"","sources":["../../../user-context/models/user-context-response.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserContextResponseSchema = exports.USER_CONTEXT_FIELD_MAX_LENGTH = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.USER_CONTEXT_FIELD_MAX_LENGTH = 2000;
|
|
6
|
+
exports.UserContextResponseSchema = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string().max(exports.USER_CONTEXT_FIELD_MAX_LENGTH).nullable(),
|
|
8
|
+
aboutMe: zod_1.z.string().max(exports.USER_CONTEXT_FIELD_MAX_LENGTH).nullable(),
|
|
9
|
+
preferences: zod_1.z.string().max(exports.USER_CONTEXT_FIELD_MAX_LENGTH).nullable(),
|
|
10
|
+
enabled: zod_1.z.boolean(),
|
|
11
|
+
});
|
package/errors/errors.ts
CHANGED
|
@@ -744,6 +744,13 @@ export const ERRORS = {
|
|
|
744
744
|
message: 'Модель перегружена. Попробуйте позже или выберите другую модель',
|
|
745
745
|
},
|
|
746
746
|
},
|
|
747
|
+
AI_EMBEDDING: {
|
|
748
|
+
REQUEST_ERROR: {
|
|
749
|
+
httpCode: 500,
|
|
750
|
+
code: 'AI_EMBEDDING.REQUEST_ERROR',
|
|
751
|
+
message: 'Ошибка запроса эмбеддингов к AI',
|
|
752
|
+
},
|
|
753
|
+
},
|
|
747
754
|
GENERATION_PROVIDER: {
|
|
748
755
|
UNAUTHORIZED: {
|
|
749
756
|
httpCode: 401,
|
|
@@ -823,4 +830,23 @@ export const ERRORS = {
|
|
|
823
830
|
message: 'Не удалось отметить сообщения поддержки как прочитанные',
|
|
824
831
|
},
|
|
825
832
|
},
|
|
833
|
+
MODEL_CATALOG: {
|
|
834
|
+
FIND_ERROR: {
|
|
835
|
+
httpCode: 500,
|
|
836
|
+
code: 'MODEL_CATALOG.FIND_ERROR',
|
|
837
|
+
message: 'Не удалось получить каталог моделей',
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
USER_CONTEXT: {
|
|
841
|
+
FIND_ERROR: {
|
|
842
|
+
httpCode: 500,
|
|
843
|
+
code: 'USER_CONTEXT.FIND_ERROR',
|
|
844
|
+
message: 'Не удалось найти контекст пользователя',
|
|
845
|
+
},
|
|
846
|
+
UPSERT_ERROR: {
|
|
847
|
+
httpCode: 500,
|
|
848
|
+
code: 'USER_CONTEXT.UPSERT_ERROR',
|
|
849
|
+
message: 'Не удалось сохранить контекст пользователя',
|
|
850
|
+
},
|
|
851
|
+
},
|
|
826
852
|
} as const;
|
package/index.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,3 +18,4 @@ 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';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { ModelCatalogItemResponseSchema } from '../../models';
|
|
4
|
+
import { MODEL_CATALOG_ROUTES } from '../model-catalog';
|
|
5
|
+
|
|
6
|
+
export const GetModelCatalogQueryResponse = z.object({
|
|
7
|
+
models: z.array(ModelCatalogItemResponseSchema),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const GetModelCatalogQuery = defineContract({
|
|
11
|
+
method: HTTP_METHODS.GET,
|
|
12
|
+
path: MODEL_CATALOG_ROUTES.GET_ALL,
|
|
13
|
+
summary: 'Get public model catalog',
|
|
14
|
+
responses: {
|
|
15
|
+
200: GetModelCatalogQueryResponse,
|
|
16
|
+
500: HttpErrorResponseSchema,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-model-catalog.query';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './model-catalog-item-response.schema';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconSchema } from '../../_common';
|
|
3
|
+
import { MODEL_CATEGORY, PRICE_UNIT } from '../enums';
|
|
4
|
+
|
|
5
|
+
export const ModelCatalogItemResponseSchema = z.object({
|
|
6
|
+
uuid: z.uuid(),
|
|
7
|
+
name: z.string(),
|
|
8
|
+
description: z.string().nullable(),
|
|
9
|
+
category: z.enum(MODEL_CATEGORY),
|
|
10
|
+
icons: IconSchema,
|
|
11
|
+
priceFrom: z.number().nonnegative(),
|
|
12
|
+
priceUnit: z.enum(PRICE_UNIT),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type ModelCatalogItemResponseSchemaType = z.infer<typeof ModelCatalogItemResponseSchema>;
|