@breign/client 1.0.129 → 1.0.131
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/dist/apis/AdminApi.d.ts +103 -0
- package/dist/apis/AdminApi.js +267 -0
- package/dist/apis/AiGatewayApi.d.ts +26 -1
- package/dist/apis/AiGatewayApi.js +47 -1
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/models/AiGatewayUsageBreakdownItemUio.d.ts +62 -0
- package/dist/models/AiGatewayUsageBreakdownItemUio.js +70 -0
- package/dist/models/AiGatewayUsagePointUio.d.ts +56 -0
- package/dist/models/AiGatewayUsagePointUio.js +66 -0
- package/dist/models/AiGatewayUsageTotalUio.d.ts +62 -0
- package/dist/models/AiGatewayUsageTotalUio.js +70 -0
- package/dist/models/AiGatewayUsageUio.d.ts +59 -0
- package/dist/models/AiGatewayUsageUio.js +69 -0
- package/dist/models/ToolPresetCreateRequestUio.d.ts +118 -0
- package/dist/models/ToolPresetCreateRequestUio.js +86 -0
- package/dist/models/ToolPresetDeleteAllResponseUio.d.ts +32 -0
- package/dist/models/ToolPresetDeleteAllResponseUio.js +50 -0
- package/dist/models/ToolPresetImportItemUio.d.ts +136 -0
- package/dist/models/ToolPresetImportItemUio.js +92 -0
- package/dist/models/ToolPresetImportRequestUio.d.ts +33 -0
- package/dist/models/ToolPresetImportRequestUio.js +51 -0
- package/dist/models/ToolPresetImportResponseUio.d.ts +38 -0
- package/dist/models/ToolPresetImportResponseUio.js +54 -0
- package/dist/models/ToolPresetOAuthRegistrationUio.d.ts +26 -0
- package/dist/models/ToolPresetOAuthRegistrationUio.js +52 -0
- package/dist/models/ToolPresetPageUio.d.ts +63 -0
- package/dist/models/ToolPresetPageUio.js +71 -0
- package/dist/models/ToolPresetTransportUio.d.ts +25 -0
- package/dist/models/ToolPresetTransportUio.js +51 -0
- package/dist/models/ToolPresetUio.d.ts +136 -0
- package/dist/models/ToolPresetUio.js +112 -0
- package/dist/models/ToolPresetUpdateRequestUio.d.ts +118 -0
- package/dist/models/ToolPresetUpdateRequestUio.js +78 -0
- package/dist/models/index.d.ts +14 -0
- package/dist/models/index.js +14 -0
- package/dist/openapi.json +1771 -965
- package/package.json +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* brain-client
|
|
3
|
+
* Api ands models for brain-app and brain-app
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.0-SNAPSHOT
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { ToolPresetCreateRequestUio, ToolPresetDeleteAllResponseUio, ToolPresetImportRequestUio, ToolPresetImportResponseUio, ToolPresetPageUio, ToolPresetUio, ToolPresetUpdateRequestUio } from '../models/index';
|
|
14
|
+
export interface CreateAdminToolPresetRequest {
|
|
15
|
+
toolPresetCreateRequestUio: ToolPresetCreateRequestUio;
|
|
16
|
+
}
|
|
17
|
+
export interface DeleteAdminToolPresetRequest {
|
|
18
|
+
toolPresetId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetAdminToolPresetsRequest {
|
|
21
|
+
page?: number;
|
|
22
|
+
limit?: number;
|
|
23
|
+
search?: string;
|
|
24
|
+
category?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ImportAdminToolPresetsRequest {
|
|
27
|
+
toolPresetImportRequestUio: ToolPresetImportRequestUio;
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateAdminToolPresetRequest {
|
|
30
|
+
toolPresetId: string;
|
|
31
|
+
toolPresetUpdateRequestUio: ToolPresetUpdateRequestUio;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export declare class AdminApi extends runtime.BaseAPI {
|
|
37
|
+
/**
|
|
38
|
+
* Create a tool preset
|
|
39
|
+
*/
|
|
40
|
+
createAdminToolPresetRaw(requestParameters: CreateAdminToolPresetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolPresetUio>>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a tool preset
|
|
43
|
+
*/
|
|
44
|
+
createAdminToolPreset(toolPresetCreateRequestUio: ToolPresetCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolPresetUio>;
|
|
45
|
+
/**
|
|
46
|
+
* Delete a tool preset
|
|
47
|
+
*/
|
|
48
|
+
deleteAdminToolPresetRaw(requestParameters: DeleteAdminToolPresetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
49
|
+
/**
|
|
50
|
+
* Delete a tool preset
|
|
51
|
+
*/
|
|
52
|
+
deleteAdminToolPreset(toolPresetId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Clears the shared tool library
|
|
55
|
+
* Delete every tool preset
|
|
56
|
+
*/
|
|
57
|
+
deleteAllAdminToolPresetsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolPresetDeleteAllResponseUio>>;
|
|
58
|
+
/**
|
|
59
|
+
* Clears the shared tool library
|
|
60
|
+
* Delete every tool preset
|
|
61
|
+
*/
|
|
62
|
+
deleteAllAdminToolPresets(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolPresetDeleteAllResponseUio>;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the whole shared tool library at once, without pagination. The payload can be fed back as-is to /admin/tool-presets/import.
|
|
65
|
+
* Export every tool preset
|
|
66
|
+
*/
|
|
67
|
+
exportAdminToolPresetsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ToolPresetUio>>>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the whole shared tool library at once, without pagination. The payload can be fed back as-is to /admin/tool-presets/import.
|
|
70
|
+
* Export every tool preset
|
|
71
|
+
*/
|
|
72
|
+
exportAdminToolPresets(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ToolPresetUio>>;
|
|
73
|
+
/**
|
|
74
|
+
* Returns a page of the shared tool library, including inactive presets. Use /admin/tool-presets/export to retrieve the whole library at once.
|
|
75
|
+
* List tool presets
|
|
76
|
+
*/
|
|
77
|
+
getAdminToolPresetsRaw(requestParameters: GetAdminToolPresetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolPresetPageUio>>;
|
|
78
|
+
/**
|
|
79
|
+
* Returns a page of the shared tool library, including inactive presets. Use /admin/tool-presets/export to retrieve the whole library at once.
|
|
80
|
+
* List tool presets
|
|
81
|
+
*/
|
|
82
|
+
getAdminToolPresets(page?: number, limit?: number, search?: string, category?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolPresetPageUio>;
|
|
83
|
+
/**
|
|
84
|
+
* Replaces the presets that already exist (matched on their slug) and adds the new ones. Presets absent from the payload are left untouched.
|
|
85
|
+
* Import tool presets
|
|
86
|
+
*/
|
|
87
|
+
importAdminToolPresetsRaw(requestParameters: ImportAdminToolPresetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolPresetImportResponseUio>>;
|
|
88
|
+
/**
|
|
89
|
+
* Replaces the presets that already exist (matched on their slug) and adds the new ones. Presets absent from the payload are left untouched.
|
|
90
|
+
* Import tool presets
|
|
91
|
+
*/
|
|
92
|
+
importAdminToolPresets(toolPresetImportRequestUio: ToolPresetImportRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolPresetImportResponseUio>;
|
|
93
|
+
/**
|
|
94
|
+
* Partial update — only the provided properties are modified
|
|
95
|
+
* Update a tool preset
|
|
96
|
+
*/
|
|
97
|
+
updateAdminToolPresetRaw(requestParameters: UpdateAdminToolPresetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToolPresetUio>>;
|
|
98
|
+
/**
|
|
99
|
+
* Partial update — only the provided properties are modified
|
|
100
|
+
* Update a tool preset
|
|
101
|
+
*/
|
|
102
|
+
updateAdminToolPreset(toolPresetId: string, toolPresetUpdateRequestUio: ToolPresetUpdateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolPresetUio>;
|
|
103
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* brain-client
|
|
6
|
+
* Api ands models for brain-app and brain-app
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.0-SNAPSHOT
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.AdminApi = void 0;
|
|
50
|
+
const runtime = __importStar(require("../runtime"));
|
|
51
|
+
const index_1 = require("../models/index");
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
class AdminApi extends runtime.BaseAPI {
|
|
56
|
+
/**
|
|
57
|
+
* Create a tool preset
|
|
58
|
+
*/
|
|
59
|
+
async createAdminToolPresetRaw(requestParameters, initOverrides) {
|
|
60
|
+
if (requestParameters['toolPresetCreateRequestUio'] == null) {
|
|
61
|
+
throw new runtime.RequiredError('toolPresetCreateRequestUio', 'Required parameter "toolPresetCreateRequestUio" was null or undefined when calling createAdminToolPreset().');
|
|
62
|
+
}
|
|
63
|
+
const queryParameters = {};
|
|
64
|
+
const headerParameters = {};
|
|
65
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
66
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
67
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
68
|
+
}
|
|
69
|
+
const response = await this.request({
|
|
70
|
+
path: `/admin/tool-presets`,
|
|
71
|
+
method: 'POST',
|
|
72
|
+
headers: headerParameters,
|
|
73
|
+
query: queryParameters,
|
|
74
|
+
body: (0, index_1.ToolPresetCreateRequestUioToJSON)(requestParameters['toolPresetCreateRequestUio']),
|
|
75
|
+
}, initOverrides);
|
|
76
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ToolPresetUioFromJSON)(jsonValue));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a tool preset
|
|
80
|
+
*/
|
|
81
|
+
async createAdminToolPreset(toolPresetCreateRequestUio, initOverrides) {
|
|
82
|
+
const response = await this.createAdminToolPresetRaw({ toolPresetCreateRequestUio: toolPresetCreateRequestUio }, initOverrides);
|
|
83
|
+
return await response.value();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Delete a tool preset
|
|
87
|
+
*/
|
|
88
|
+
async deleteAdminToolPresetRaw(requestParameters, initOverrides) {
|
|
89
|
+
if (requestParameters['toolPresetId'] == null) {
|
|
90
|
+
throw new runtime.RequiredError('toolPresetId', 'Required parameter "toolPresetId" was null or undefined when calling deleteAdminToolPreset().');
|
|
91
|
+
}
|
|
92
|
+
const queryParameters = {};
|
|
93
|
+
const headerParameters = {};
|
|
94
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
95
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
96
|
+
}
|
|
97
|
+
const response = await this.request({
|
|
98
|
+
path: `/admin/tool-presets/{toolPresetId}`.replace(`{${"toolPresetId"}}`, encodeURIComponent(String(requestParameters['toolPresetId']))),
|
|
99
|
+
method: 'DELETE',
|
|
100
|
+
headers: headerParameters,
|
|
101
|
+
query: queryParameters,
|
|
102
|
+
}, initOverrides);
|
|
103
|
+
return new runtime.VoidApiResponse(response);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Delete a tool preset
|
|
107
|
+
*/
|
|
108
|
+
async deleteAdminToolPreset(toolPresetId, initOverrides) {
|
|
109
|
+
await this.deleteAdminToolPresetRaw({ toolPresetId: toolPresetId }, initOverrides);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Clears the shared tool library
|
|
113
|
+
* Delete every tool preset
|
|
114
|
+
*/
|
|
115
|
+
async deleteAllAdminToolPresetsRaw(initOverrides) {
|
|
116
|
+
const queryParameters = {};
|
|
117
|
+
const headerParameters = {};
|
|
118
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
119
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
120
|
+
}
|
|
121
|
+
const response = await this.request({
|
|
122
|
+
path: `/admin/tool-presets`,
|
|
123
|
+
method: 'DELETE',
|
|
124
|
+
headers: headerParameters,
|
|
125
|
+
query: queryParameters,
|
|
126
|
+
}, initOverrides);
|
|
127
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ToolPresetDeleteAllResponseUioFromJSON)(jsonValue));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Clears the shared tool library
|
|
131
|
+
* Delete every tool preset
|
|
132
|
+
*/
|
|
133
|
+
async deleteAllAdminToolPresets(initOverrides) {
|
|
134
|
+
const response = await this.deleteAllAdminToolPresetsRaw(initOverrides);
|
|
135
|
+
return await response.value();
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Returns the whole shared tool library at once, without pagination. The payload can be fed back as-is to /admin/tool-presets/import.
|
|
139
|
+
* Export every tool preset
|
|
140
|
+
*/
|
|
141
|
+
async exportAdminToolPresetsRaw(initOverrides) {
|
|
142
|
+
const queryParameters = {};
|
|
143
|
+
const headerParameters = {};
|
|
144
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
145
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
146
|
+
}
|
|
147
|
+
const response = await this.request({
|
|
148
|
+
path: `/admin/tool-presets/export`,
|
|
149
|
+
method: 'GET',
|
|
150
|
+
headers: headerParameters,
|
|
151
|
+
query: queryParameters,
|
|
152
|
+
}, initOverrides);
|
|
153
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.ToolPresetUioFromJSON));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Returns the whole shared tool library at once, without pagination. The payload can be fed back as-is to /admin/tool-presets/import.
|
|
157
|
+
* Export every tool preset
|
|
158
|
+
*/
|
|
159
|
+
async exportAdminToolPresets(initOverrides) {
|
|
160
|
+
const response = await this.exportAdminToolPresetsRaw(initOverrides);
|
|
161
|
+
return await response.value();
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Returns a page of the shared tool library, including inactive presets. Use /admin/tool-presets/export to retrieve the whole library at once.
|
|
165
|
+
* List tool presets
|
|
166
|
+
*/
|
|
167
|
+
async getAdminToolPresetsRaw(requestParameters, initOverrides) {
|
|
168
|
+
const queryParameters = {};
|
|
169
|
+
if (requestParameters['page'] != null) {
|
|
170
|
+
queryParameters['page'] = requestParameters['page'];
|
|
171
|
+
}
|
|
172
|
+
if (requestParameters['limit'] != null) {
|
|
173
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
174
|
+
}
|
|
175
|
+
if (requestParameters['search'] != null) {
|
|
176
|
+
queryParameters['search'] = requestParameters['search'];
|
|
177
|
+
}
|
|
178
|
+
if (requestParameters['category'] != null) {
|
|
179
|
+
queryParameters['category'] = requestParameters['category'];
|
|
180
|
+
}
|
|
181
|
+
const headerParameters = {};
|
|
182
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
183
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
184
|
+
}
|
|
185
|
+
const response = await this.request({
|
|
186
|
+
path: `/admin/tool-presets`,
|
|
187
|
+
method: 'GET',
|
|
188
|
+
headers: headerParameters,
|
|
189
|
+
query: queryParameters,
|
|
190
|
+
}, initOverrides);
|
|
191
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ToolPresetPageUioFromJSON)(jsonValue));
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Returns a page of the shared tool library, including inactive presets. Use /admin/tool-presets/export to retrieve the whole library at once.
|
|
195
|
+
* List tool presets
|
|
196
|
+
*/
|
|
197
|
+
async getAdminToolPresets(page, limit, search, category, initOverrides) {
|
|
198
|
+
const response = await this.getAdminToolPresetsRaw({ page: page, limit: limit, search: search, category: category }, initOverrides);
|
|
199
|
+
return await response.value();
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Replaces the presets that already exist (matched on their slug) and adds the new ones. Presets absent from the payload are left untouched.
|
|
203
|
+
* Import tool presets
|
|
204
|
+
*/
|
|
205
|
+
async importAdminToolPresetsRaw(requestParameters, initOverrides) {
|
|
206
|
+
if (requestParameters['toolPresetImportRequestUio'] == null) {
|
|
207
|
+
throw new runtime.RequiredError('toolPresetImportRequestUio', 'Required parameter "toolPresetImportRequestUio" was null or undefined when calling importAdminToolPresets().');
|
|
208
|
+
}
|
|
209
|
+
const queryParameters = {};
|
|
210
|
+
const headerParameters = {};
|
|
211
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
212
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
213
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
214
|
+
}
|
|
215
|
+
const response = await this.request({
|
|
216
|
+
path: `/admin/tool-presets/import`,
|
|
217
|
+
method: 'POST',
|
|
218
|
+
headers: headerParameters,
|
|
219
|
+
query: queryParameters,
|
|
220
|
+
body: (0, index_1.ToolPresetImportRequestUioToJSON)(requestParameters['toolPresetImportRequestUio']),
|
|
221
|
+
}, initOverrides);
|
|
222
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ToolPresetImportResponseUioFromJSON)(jsonValue));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Replaces the presets that already exist (matched on their slug) and adds the new ones. Presets absent from the payload are left untouched.
|
|
226
|
+
* Import tool presets
|
|
227
|
+
*/
|
|
228
|
+
async importAdminToolPresets(toolPresetImportRequestUio, initOverrides) {
|
|
229
|
+
const response = await this.importAdminToolPresetsRaw({ toolPresetImportRequestUio: toolPresetImportRequestUio }, initOverrides);
|
|
230
|
+
return await response.value();
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Partial update — only the provided properties are modified
|
|
234
|
+
* Update a tool preset
|
|
235
|
+
*/
|
|
236
|
+
async updateAdminToolPresetRaw(requestParameters, initOverrides) {
|
|
237
|
+
if (requestParameters['toolPresetId'] == null) {
|
|
238
|
+
throw new runtime.RequiredError('toolPresetId', 'Required parameter "toolPresetId" was null or undefined when calling updateAdminToolPreset().');
|
|
239
|
+
}
|
|
240
|
+
if (requestParameters['toolPresetUpdateRequestUio'] == null) {
|
|
241
|
+
throw new runtime.RequiredError('toolPresetUpdateRequestUio', 'Required parameter "toolPresetUpdateRequestUio" was null or undefined when calling updateAdminToolPreset().');
|
|
242
|
+
}
|
|
243
|
+
const queryParameters = {};
|
|
244
|
+
const headerParameters = {};
|
|
245
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
246
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
247
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
248
|
+
}
|
|
249
|
+
const response = await this.request({
|
|
250
|
+
path: `/admin/tool-presets/{toolPresetId}`.replace(`{${"toolPresetId"}}`, encodeURIComponent(String(requestParameters['toolPresetId']))),
|
|
251
|
+
method: 'PUT',
|
|
252
|
+
headers: headerParameters,
|
|
253
|
+
query: queryParameters,
|
|
254
|
+
body: (0, index_1.ToolPresetUpdateRequestUioToJSON)(requestParameters['toolPresetUpdateRequestUio']),
|
|
255
|
+
}, initOverrides);
|
|
256
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ToolPresetUioFromJSON)(jsonValue));
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Partial update — only the provided properties are modified
|
|
260
|
+
* Update a tool preset
|
|
261
|
+
*/
|
|
262
|
+
async updateAdminToolPreset(toolPresetId, toolPresetUpdateRequestUio, initOverrides) {
|
|
263
|
+
const response = await this.updateAdminToolPresetRaw({ toolPresetId: toolPresetId, toolPresetUpdateRequestUio: toolPresetUpdateRequestUio }, initOverrides);
|
|
264
|
+
return await response.value();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.AdminApi = AdminApi;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { AiGatewayChatCompletionRequestUio, AiGatewayChatCompletionResponseUio, AiGatewayEmbeddingRequestUio, AiGatewayEmbeddingResponseUio, AiGatewayModelListUio, AiGatewayModelUio, OpenAiChatCompletionRequestUio, OpenAiChatCompletionResponseUio } from '../models/index';
|
|
13
|
+
import type { AiGatewayChatCompletionRequestUio, AiGatewayChatCompletionResponseUio, AiGatewayEmbeddingRequestUio, AiGatewayEmbeddingResponseUio, AiGatewayModelListUio, AiGatewayModelUio, AiGatewayUsageUio, OpenAiChatCompletionRequestUio, OpenAiChatCompletionResponseUio } from '../models/index';
|
|
14
14
|
export interface CreateAiGatewayChatCompletionRequest {
|
|
15
15
|
organizationId: string;
|
|
16
16
|
aiGatewayChatCompletionRequestUio: AiGatewayChatCompletionRequestUio;
|
|
@@ -26,6 +26,12 @@ export interface CreateOpenAiChatCompletionRequest {
|
|
|
26
26
|
export interface GetAiGatewayCreditsRequest {
|
|
27
27
|
organizationId: string;
|
|
28
28
|
}
|
|
29
|
+
export interface GetAiGatewayMetricsRequest {
|
|
30
|
+
organizationId: string;
|
|
31
|
+
startDate?: Date;
|
|
32
|
+
endDate?: Date;
|
|
33
|
+
granularity?: GetAiGatewayMetricsGranularityEnum;
|
|
34
|
+
}
|
|
29
35
|
export interface GetAiGatewayModelRequest {
|
|
30
36
|
organizationId: string;
|
|
31
37
|
model: string;
|
|
@@ -77,6 +83,16 @@ export declare class AiGatewayApi extends runtime.BaseAPI {
|
|
|
77
83
|
* Get AI gateway credits
|
|
78
84
|
*/
|
|
79
85
|
getAiGatewayCredits(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Usage de la passerelle pour l\'organisation sur une période : totaux, série temporelle et répartitions par modèle, par provider et par utilisateur. Réservé aux administrateurs de l\'organisation.
|
|
88
|
+
* Get AI gateway usage metrics
|
|
89
|
+
*/
|
|
90
|
+
getAiGatewayMetricsRaw(requestParameters: GetAiGatewayMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiGatewayUsageUio>>;
|
|
91
|
+
/**
|
|
92
|
+
* Usage de la passerelle pour l\'organisation sur une période : totaux, série temporelle et répartitions par modèle, par provider et par utilisateur. Réservé aux administrateurs de l\'organisation.
|
|
93
|
+
* Get AI gateway usage metrics
|
|
94
|
+
*/
|
|
95
|
+
getAiGatewayMetrics(organizationId: string, startDate?: Date, endDate?: Date, granularity?: GetAiGatewayMetricsGranularityEnum, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayUsageUio>;
|
|
80
96
|
/**
|
|
81
97
|
* Returns a single model in an OpenAI-compatible shape, resolved against the organization\'s engine providers.
|
|
82
98
|
* Get a model available through the AI gateway
|
|
@@ -98,3 +114,12 @@ export declare class AiGatewayApi extends runtime.BaseAPI {
|
|
|
98
114
|
*/
|
|
99
115
|
listAiGatewayModels(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayModelListUio>;
|
|
100
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* @export
|
|
119
|
+
*/
|
|
120
|
+
export declare const GetAiGatewayMetricsGranularityEnum: {
|
|
121
|
+
readonly Hour: "hour";
|
|
122
|
+
readonly Day: "day";
|
|
123
|
+
readonly Week: "week";
|
|
124
|
+
};
|
|
125
|
+
export type GetAiGatewayMetricsGranularityEnum = typeof GetAiGatewayMetricsGranularityEnum[keyof typeof GetAiGatewayMetricsGranularityEnum];
|
|
@@ -46,7 +46,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
46
46
|
};
|
|
47
47
|
})();
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.AiGatewayApi = void 0;
|
|
49
|
+
exports.GetAiGatewayMetricsGranularityEnum = exports.AiGatewayApi = void 0;
|
|
50
50
|
const runtime = __importStar(require("../runtime"));
|
|
51
51
|
const index_1 = require("../models/index");
|
|
52
52
|
/**
|
|
@@ -183,6 +183,44 @@ class AiGatewayApi extends runtime.BaseAPI {
|
|
|
183
183
|
async getAiGatewayCredits(organizationId, initOverrides) {
|
|
184
184
|
await this.getAiGatewayCreditsRaw({ organizationId: organizationId }, initOverrides);
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Usage de la passerelle pour l\'organisation sur une période : totaux, série temporelle et répartitions par modèle, par provider et par utilisateur. Réservé aux administrateurs de l\'organisation.
|
|
188
|
+
* Get AI gateway usage metrics
|
|
189
|
+
*/
|
|
190
|
+
async getAiGatewayMetricsRaw(requestParameters, initOverrides) {
|
|
191
|
+
if (requestParameters['organizationId'] == null) {
|
|
192
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getAiGatewayMetrics().');
|
|
193
|
+
}
|
|
194
|
+
const queryParameters = {};
|
|
195
|
+
if (requestParameters['startDate'] != null) {
|
|
196
|
+
queryParameters['startDate'] = requestParameters['startDate'].toISOString();
|
|
197
|
+
}
|
|
198
|
+
if (requestParameters['endDate'] != null) {
|
|
199
|
+
queryParameters['endDate'] = requestParameters['endDate'].toISOString();
|
|
200
|
+
}
|
|
201
|
+
if (requestParameters['granularity'] != null) {
|
|
202
|
+
queryParameters['granularity'] = requestParameters['granularity'];
|
|
203
|
+
}
|
|
204
|
+
const headerParameters = {};
|
|
205
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
206
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
207
|
+
}
|
|
208
|
+
const response = await this.request({
|
|
209
|
+
path: `/organizations/{organizationId}/ai-gateway/metrics`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
210
|
+
method: 'GET',
|
|
211
|
+
headers: headerParameters,
|
|
212
|
+
query: queryParameters,
|
|
213
|
+
}, initOverrides);
|
|
214
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AiGatewayUsageUioFromJSON)(jsonValue));
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Usage de la passerelle pour l\'organisation sur une période : totaux, série temporelle et répartitions par modèle, par provider et par utilisateur. Réservé aux administrateurs de l\'organisation.
|
|
218
|
+
* Get AI gateway usage metrics
|
|
219
|
+
*/
|
|
220
|
+
async getAiGatewayMetrics(organizationId, startDate, endDate, granularity, initOverrides) {
|
|
221
|
+
const response = await this.getAiGatewayMetricsRaw({ organizationId: organizationId, startDate: startDate, endDate: endDate, granularity: granularity }, initOverrides);
|
|
222
|
+
return await response.value();
|
|
223
|
+
}
|
|
186
224
|
/**
|
|
187
225
|
* Returns a single model in an OpenAI-compatible shape, resolved against the organization\'s engine providers.
|
|
188
226
|
* Get a model available through the AI gateway
|
|
@@ -246,3 +284,11 @@ class AiGatewayApi extends runtime.BaseAPI {
|
|
|
246
284
|
}
|
|
247
285
|
}
|
|
248
286
|
exports.AiGatewayApi = AiGatewayApi;
|
|
287
|
+
/**
|
|
288
|
+
* @export
|
|
289
|
+
*/
|
|
290
|
+
exports.GetAiGatewayMetricsGranularityEnum = {
|
|
291
|
+
Hour: 'hour',
|
|
292
|
+
Day: 'day',
|
|
293
|
+
Week: 'week'
|
|
294
|
+
};
|
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./AdminApi"), exports);
|
|
19
20
|
__exportStar(require("./AgentApi"), exports);
|
|
20
21
|
__exportStar(require("./AiGatewayApi"), exports);
|
|
21
22
|
__exportStar(require("./AppApi"), exports);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* brain-client
|
|
3
|
+
* Api ands models for brain-app and brain-app
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.0-SNAPSHOT
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Consommation agrégée sur une dimension (modèle, provider ou utilisateur).
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AiGatewayUsageBreakdownItemUio
|
|
16
|
+
*/
|
|
17
|
+
export interface AiGatewayUsageBreakdownItemUio {
|
|
18
|
+
/**
|
|
19
|
+
* Identifiant brut de la dimension (id de modèle, de provider ou d'utilisateur)
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof AiGatewayUsageBreakdownItemUio
|
|
22
|
+
*/
|
|
23
|
+
key: string;
|
|
24
|
+
/**
|
|
25
|
+
* Libellé affichable ; pour un utilisateur, son email lorsqu'il est connu
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof AiGatewayUsageBreakdownItemUio
|
|
28
|
+
*/
|
|
29
|
+
label: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof AiGatewayUsageBreakdownItemUio
|
|
34
|
+
*/
|
|
35
|
+
requests: number;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof AiGatewayUsageBreakdownItemUio
|
|
40
|
+
*/
|
|
41
|
+
inputTokens: number;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof AiGatewayUsageBreakdownItemUio
|
|
46
|
+
*/
|
|
47
|
+
outputTokens: number;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof AiGatewayUsageBreakdownItemUio
|
|
52
|
+
*/
|
|
53
|
+
totalTokens: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check if a given object implements the AiGatewayUsageBreakdownItemUio interface.
|
|
57
|
+
*/
|
|
58
|
+
export declare function instanceOfAiGatewayUsageBreakdownItemUio(value: object): value is AiGatewayUsageBreakdownItemUio;
|
|
59
|
+
export declare function AiGatewayUsageBreakdownItemUioFromJSON(json: any): AiGatewayUsageBreakdownItemUio;
|
|
60
|
+
export declare function AiGatewayUsageBreakdownItemUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AiGatewayUsageBreakdownItemUio;
|
|
61
|
+
export declare function AiGatewayUsageBreakdownItemUioToJSON(json: any): AiGatewayUsageBreakdownItemUio;
|
|
62
|
+
export declare function AiGatewayUsageBreakdownItemUioToJSONTyped(value?: AiGatewayUsageBreakdownItemUio | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* brain-client
|
|
6
|
+
* Api ands models for brain-app and brain-app
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.0-SNAPSHOT
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfAiGatewayUsageBreakdownItemUio = instanceOfAiGatewayUsageBreakdownItemUio;
|
|
17
|
+
exports.AiGatewayUsageBreakdownItemUioFromJSON = AiGatewayUsageBreakdownItemUioFromJSON;
|
|
18
|
+
exports.AiGatewayUsageBreakdownItemUioFromJSONTyped = AiGatewayUsageBreakdownItemUioFromJSONTyped;
|
|
19
|
+
exports.AiGatewayUsageBreakdownItemUioToJSON = AiGatewayUsageBreakdownItemUioToJSON;
|
|
20
|
+
exports.AiGatewayUsageBreakdownItemUioToJSONTyped = AiGatewayUsageBreakdownItemUioToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the AiGatewayUsageBreakdownItemUio interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfAiGatewayUsageBreakdownItemUio(value) {
|
|
25
|
+
if (!('key' in value) || value['key'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('label' in value) || value['label'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('requests' in value) || value['requests'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
if (!('inputTokens' in value) || value['inputTokens'] === undefined)
|
|
32
|
+
return false;
|
|
33
|
+
if (!('outputTokens' in value) || value['outputTokens'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if (!('totalTokens' in value) || value['totalTokens'] === undefined)
|
|
36
|
+
return false;
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
function AiGatewayUsageBreakdownItemUioFromJSON(json) {
|
|
40
|
+
return AiGatewayUsageBreakdownItemUioFromJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
function AiGatewayUsageBreakdownItemUioFromJSONTyped(json, ignoreDiscriminator) {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
'key': json['key'],
|
|
48
|
+
'label': json['label'],
|
|
49
|
+
'requests': json['requests'],
|
|
50
|
+
'inputTokens': json['inputTokens'],
|
|
51
|
+
'outputTokens': json['outputTokens'],
|
|
52
|
+
'totalTokens': json['totalTokens'],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function AiGatewayUsageBreakdownItemUioToJSON(json) {
|
|
56
|
+
return AiGatewayUsageBreakdownItemUioToJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
function AiGatewayUsageBreakdownItemUioToJSONTyped(value, ignoreDiscriminator = false) {
|
|
59
|
+
if (value == null) {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
'key': value['key'],
|
|
64
|
+
'label': value['label'],
|
|
65
|
+
'requests': value['requests'],
|
|
66
|
+
'inputTokens': value['inputTokens'],
|
|
67
|
+
'outputTokens': value['outputTokens'],
|
|
68
|
+
'totalTokens': value['totalTokens'],
|
|
69
|
+
};
|
|
70
|
+
}
|