@super_studio/ecforce-ai-agent-server 0.1.0
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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +471 -0
- package/dist/index.mjs +471 -0
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/sdk/__generated__/index.d.ts +536 -0
- package/dist/sdk/__generated__/index.d.ts.map +1 -0
- package/dist/sdk/generate.d.ts +2 -0
- package/dist/sdk/generate.d.ts.map +1 -0
- package/dist/sdk/index.d.ts +18 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/package.json +36 -0
- package/src/.tmp/test-script.ts +18 -0
- package/src/index.ts +1 -0
- package/src/lib/constants.ts +1 -0
- package/src/sdk/__generated__/index.ts +982 -0
- package/src/sdk/generate.ts +66 -0
- package/src/sdk/index.ts +46 -0
|
@@ -0,0 +1,982 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/*
|
|
5
|
+
* ---------------------------------------------------------------
|
|
6
|
+
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
7
|
+
* ## ##
|
|
8
|
+
* ## AUTHOR: acacode ##
|
|
9
|
+
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
10
|
+
* ---------------------------------------------------------------
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export type QueryParamsType = Record<string | number, any>;
|
|
14
|
+
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
|
15
|
+
|
|
16
|
+
export interface FullRequestParams extends Omit<RequestInit, "body"> {
|
|
17
|
+
/** set parameter to `true` for call `securityWorker` for this request */
|
|
18
|
+
secure?: boolean;
|
|
19
|
+
/** request path */
|
|
20
|
+
path: string;
|
|
21
|
+
/** content type of request body */
|
|
22
|
+
type?: ContentType;
|
|
23
|
+
/** query params */
|
|
24
|
+
query?: QueryParamsType;
|
|
25
|
+
/** format of response (i.e. response.json() -> format: "json") */
|
|
26
|
+
format?: ResponseFormat;
|
|
27
|
+
/** request body */
|
|
28
|
+
body?: unknown;
|
|
29
|
+
/** base url */
|
|
30
|
+
baseUrl?: string;
|
|
31
|
+
/** request cancellation token */
|
|
32
|
+
cancelToken?: CancelToken;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type RequestParams = Omit<
|
|
36
|
+
FullRequestParams,
|
|
37
|
+
"body" | "method" | "query" | "path"
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
export interface ApiConfig<SecurityDataType = unknown> {
|
|
41
|
+
baseUrl?: string;
|
|
42
|
+
baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
|
|
43
|
+
securityWorker?: (
|
|
44
|
+
securityData: SecurityDataType | null,
|
|
45
|
+
) => Promise<RequestParams | void> | RequestParams | void;
|
|
46
|
+
customFetch?: typeof fetch;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface HttpResponse<D extends unknown, E extends unknown = unknown>
|
|
50
|
+
extends Response {
|
|
51
|
+
data: D;
|
|
52
|
+
error: E;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
type CancelToken = Symbol | string | number;
|
|
56
|
+
|
|
57
|
+
export enum ContentType {
|
|
58
|
+
Json = "application/json",
|
|
59
|
+
JsonApi = "application/vnd.api+json",
|
|
60
|
+
FormData = "multipart/form-data",
|
|
61
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
62
|
+
Text = "text/plain",
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class HttpClient<SecurityDataType = unknown> {
|
|
66
|
+
public baseUrl: string = "/api";
|
|
67
|
+
private securityData: SecurityDataType | null = null;
|
|
68
|
+
private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
|
|
69
|
+
private abortControllers = new Map<CancelToken, AbortController>();
|
|
70
|
+
private customFetch = (...fetchParams: Parameters<typeof fetch>) =>
|
|
71
|
+
fetch(...fetchParams);
|
|
72
|
+
|
|
73
|
+
private baseApiParams: RequestParams = {
|
|
74
|
+
credentials: "same-origin",
|
|
75
|
+
headers: {},
|
|
76
|
+
redirect: "follow",
|
|
77
|
+
referrerPolicy: "no-referrer",
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
|
|
81
|
+
Object.assign(this, apiConfig);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public setSecurityData = (data: SecurityDataType | null) => {
|
|
85
|
+
this.securityData = data;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
protected encodeQueryParam(key: string, value: any) {
|
|
89
|
+
const encodedKey = encodeURIComponent(key);
|
|
90
|
+
return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
protected addQueryParam(query: QueryParamsType, key: string) {
|
|
94
|
+
return this.encodeQueryParam(key, query[key]);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
protected addArrayQueryParam(query: QueryParamsType, key: string) {
|
|
98
|
+
const value = query[key];
|
|
99
|
+
return value.map((v: any) => this.encodeQueryParam(key, v)).join("&");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
protected toQueryString(rawQuery?: QueryParamsType): string {
|
|
103
|
+
const query = rawQuery || {};
|
|
104
|
+
const keys = Object.keys(query).filter(
|
|
105
|
+
(key) => "undefined" !== typeof query[key],
|
|
106
|
+
);
|
|
107
|
+
return keys
|
|
108
|
+
.map((key) =>
|
|
109
|
+
Array.isArray(query[key])
|
|
110
|
+
? this.addArrayQueryParam(query, key)
|
|
111
|
+
: this.addQueryParam(query, key),
|
|
112
|
+
)
|
|
113
|
+
.join("&");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
protected addQueryParams(rawQuery?: QueryParamsType): string {
|
|
117
|
+
const queryString = this.toQueryString(rawQuery);
|
|
118
|
+
return queryString ? `?${queryString}` : "";
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private contentFormatters: Record<ContentType, (input: any) => any> = {
|
|
122
|
+
[ContentType.Json]: (input: any) =>
|
|
123
|
+
input !== null && (typeof input === "object" || typeof input === "string")
|
|
124
|
+
? JSON.stringify(input)
|
|
125
|
+
: input,
|
|
126
|
+
[ContentType.JsonApi]: (input: any) =>
|
|
127
|
+
input !== null && (typeof input === "object" || typeof input === "string")
|
|
128
|
+
? JSON.stringify(input)
|
|
129
|
+
: input,
|
|
130
|
+
[ContentType.Text]: (input: any) =>
|
|
131
|
+
input !== null && typeof input !== "string"
|
|
132
|
+
? JSON.stringify(input)
|
|
133
|
+
: input,
|
|
134
|
+
[ContentType.FormData]: (input: any) => {
|
|
135
|
+
if (input instanceof FormData) {
|
|
136
|
+
return input;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return Object.keys(input || {}).reduce((formData, key) => {
|
|
140
|
+
const property = input[key];
|
|
141
|
+
formData.append(
|
|
142
|
+
key,
|
|
143
|
+
property instanceof Blob
|
|
144
|
+
? property
|
|
145
|
+
: typeof property === "object" && property !== null
|
|
146
|
+
? JSON.stringify(property)
|
|
147
|
+
: `${property}`,
|
|
148
|
+
);
|
|
149
|
+
return formData;
|
|
150
|
+
}, new FormData());
|
|
151
|
+
},
|
|
152
|
+
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
protected mergeRequestParams(
|
|
156
|
+
params1: RequestParams,
|
|
157
|
+
params2?: RequestParams,
|
|
158
|
+
): RequestParams {
|
|
159
|
+
return {
|
|
160
|
+
...this.baseApiParams,
|
|
161
|
+
...params1,
|
|
162
|
+
...(params2 || {}),
|
|
163
|
+
headers: {
|
|
164
|
+
...(this.baseApiParams.headers || {}),
|
|
165
|
+
...(params1.headers || {}),
|
|
166
|
+
...((params2 && params2.headers) || {}),
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
protected createAbortSignal = (
|
|
172
|
+
cancelToken: CancelToken,
|
|
173
|
+
): AbortSignal | undefined => {
|
|
174
|
+
if (this.abortControllers.has(cancelToken)) {
|
|
175
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
176
|
+
if (abortController) {
|
|
177
|
+
return abortController.signal;
|
|
178
|
+
}
|
|
179
|
+
return void 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const abortController = new AbortController();
|
|
183
|
+
this.abortControllers.set(cancelToken, abortController);
|
|
184
|
+
return abortController.signal;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
public abortRequest = (cancelToken: CancelToken) => {
|
|
188
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
189
|
+
|
|
190
|
+
if (abortController) {
|
|
191
|
+
abortController.abort();
|
|
192
|
+
this.abortControllers.delete(cancelToken);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
public request = async <T = any, E = any>({
|
|
197
|
+
body,
|
|
198
|
+
secure,
|
|
199
|
+
path,
|
|
200
|
+
type,
|
|
201
|
+
query,
|
|
202
|
+
format,
|
|
203
|
+
baseUrl,
|
|
204
|
+
cancelToken,
|
|
205
|
+
...params
|
|
206
|
+
}: FullRequestParams): Promise<T> => {
|
|
207
|
+
const secureParams =
|
|
208
|
+
((typeof secure === "boolean" ? secure : this.baseApiParams.secure) &&
|
|
209
|
+
this.securityWorker &&
|
|
210
|
+
(await this.securityWorker(this.securityData))) ||
|
|
211
|
+
{};
|
|
212
|
+
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
213
|
+
const queryString = query && this.toQueryString(query);
|
|
214
|
+
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
|
|
215
|
+
const responseFormat = format || requestParams.format;
|
|
216
|
+
|
|
217
|
+
return this.customFetch(
|
|
218
|
+
`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
|
|
219
|
+
{
|
|
220
|
+
...requestParams,
|
|
221
|
+
headers: {
|
|
222
|
+
...(requestParams.headers || {}),
|
|
223
|
+
...(type && type !== ContentType.FormData
|
|
224
|
+
? { "Content-Type": type }
|
|
225
|
+
: {}),
|
|
226
|
+
},
|
|
227
|
+
signal:
|
|
228
|
+
(cancelToken
|
|
229
|
+
? this.createAbortSignal(cancelToken)
|
|
230
|
+
: requestParams.signal) || null,
|
|
231
|
+
body:
|
|
232
|
+
typeof body === "undefined" || body === null
|
|
233
|
+
? null
|
|
234
|
+
: payloadFormatter(body),
|
|
235
|
+
},
|
|
236
|
+
).then(async (response) => {
|
|
237
|
+
const r = response as HttpResponse<T, E>;
|
|
238
|
+
r.data = null as unknown as T;
|
|
239
|
+
r.error = null as unknown as E;
|
|
240
|
+
|
|
241
|
+
const data = !responseFormat
|
|
242
|
+
? r
|
|
243
|
+
: await response[responseFormat]()
|
|
244
|
+
.then((data) => {
|
|
245
|
+
if (r.ok) {
|
|
246
|
+
r.data = data;
|
|
247
|
+
} else {
|
|
248
|
+
r.error = data;
|
|
249
|
+
}
|
|
250
|
+
return r;
|
|
251
|
+
})
|
|
252
|
+
.catch((e) => {
|
|
253
|
+
r.error = e;
|
|
254
|
+
return r;
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
if (cancelToken) {
|
|
258
|
+
this.abortControllers.delete(cancelToken);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (!response.ok) throw data;
|
|
262
|
+
return data.data;
|
|
263
|
+
});
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @title ecforce ai agent api
|
|
269
|
+
* @version 1.0.0
|
|
270
|
+
* @baseUrl /api
|
|
271
|
+
*/
|
|
272
|
+
export class Api<
|
|
273
|
+
SecurityDataType extends unknown,
|
|
274
|
+
> extends HttpClient<SecurityDataType> {
|
|
275
|
+
version = {
|
|
276
|
+
/**
|
|
277
|
+
* @description バージョンを取得する
|
|
278
|
+
*
|
|
279
|
+
* @tags meta
|
|
280
|
+
* @name GetVersion
|
|
281
|
+
* @summary getVersion
|
|
282
|
+
* @request GET:/v1/version
|
|
283
|
+
* @secure
|
|
284
|
+
*/
|
|
285
|
+
getVersion: (params: RequestParams = {}) =>
|
|
286
|
+
this.request<
|
|
287
|
+
{
|
|
288
|
+
version: string;
|
|
289
|
+
},
|
|
290
|
+
any
|
|
291
|
+
>({
|
|
292
|
+
path: `/v1/version`,
|
|
293
|
+
method: "GET",
|
|
294
|
+
secure: true,
|
|
295
|
+
format: "json",
|
|
296
|
+
...params,
|
|
297
|
+
}),
|
|
298
|
+
};
|
|
299
|
+
agent = {
|
|
300
|
+
/**
|
|
301
|
+
* @description エージェント一覧を取得する
|
|
302
|
+
*
|
|
303
|
+
* @tags agent
|
|
304
|
+
* @name List
|
|
305
|
+
* @summary list
|
|
306
|
+
* @request GET:/v1/agent
|
|
307
|
+
* @secure
|
|
308
|
+
*/
|
|
309
|
+
list: (params: RequestParams = {}) =>
|
|
310
|
+
this.request<
|
|
311
|
+
{
|
|
312
|
+
/** @maxLength 30 */
|
|
313
|
+
id: string;
|
|
314
|
+
/** @maxLength 30 */
|
|
315
|
+
orgId: string;
|
|
316
|
+
/** @maxLength 255 */
|
|
317
|
+
name: string;
|
|
318
|
+
/** @maxLength 30 */
|
|
319
|
+
activeConfigId: string;
|
|
320
|
+
/** @format date-time */
|
|
321
|
+
createdAt: string;
|
|
322
|
+
/** @format date-time */
|
|
323
|
+
updatedAt: string;
|
|
324
|
+
createdBy: string | null;
|
|
325
|
+
updatedBy: string | null;
|
|
326
|
+
deletedAt: string | null;
|
|
327
|
+
deletedBy: string | null;
|
|
328
|
+
activeConfig: {
|
|
329
|
+
/** @maxLength 30 */
|
|
330
|
+
id: string;
|
|
331
|
+
/** @maxLength 30 */
|
|
332
|
+
agentId: string;
|
|
333
|
+
/** @maxLength 30 */
|
|
334
|
+
orgId: string;
|
|
335
|
+
/**
|
|
336
|
+
* @min -2147483648
|
|
337
|
+
* @max 2147483647
|
|
338
|
+
*/
|
|
339
|
+
version: number;
|
|
340
|
+
configJson:
|
|
341
|
+
| (string | number | boolean | null)
|
|
342
|
+
| Record<string, any>
|
|
343
|
+
| null[];
|
|
344
|
+
/** @format date-time */
|
|
345
|
+
createdAt: string;
|
|
346
|
+
/** @format date-time */
|
|
347
|
+
updatedAt: string;
|
|
348
|
+
deletedAt: string | null;
|
|
349
|
+
deletedBy: string | null;
|
|
350
|
+
};
|
|
351
|
+
}[],
|
|
352
|
+
any
|
|
353
|
+
>({
|
|
354
|
+
path: `/v1/agent`,
|
|
355
|
+
method: "GET",
|
|
356
|
+
secure: true,
|
|
357
|
+
format: "json",
|
|
358
|
+
...params,
|
|
359
|
+
}),
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* @description エージェントを作成する
|
|
363
|
+
*
|
|
364
|
+
* @tags agent
|
|
365
|
+
* @name Create
|
|
366
|
+
* @summary create
|
|
367
|
+
* @request POST:/v1/agent
|
|
368
|
+
* @secure
|
|
369
|
+
*/
|
|
370
|
+
create: (
|
|
371
|
+
data: {
|
|
372
|
+
/** @minLength 1 */
|
|
373
|
+
name: string;
|
|
374
|
+
configJson: {
|
|
375
|
+
defaultModel:
|
|
376
|
+
| "gpt-4.1-mini"
|
|
377
|
+
| "gpt-4.1-nano"
|
|
378
|
+
| "o3-mini"
|
|
379
|
+
| "o4-mini"
|
|
380
|
+
| "gpt-5"
|
|
381
|
+
| "gpt-5-mini"
|
|
382
|
+
| "gpt-5-nano"
|
|
383
|
+
| "gemini-2.0-flash"
|
|
384
|
+
| "gemini-2.5-flash";
|
|
385
|
+
defaultThinkingModel:
|
|
386
|
+
| "o3-mini"
|
|
387
|
+
| "o4-mini"
|
|
388
|
+
| "gpt-5"
|
|
389
|
+
| "gpt-5-mini"
|
|
390
|
+
| "gpt-5-nano";
|
|
391
|
+
systemPrompt: string;
|
|
392
|
+
nativeTools: {
|
|
393
|
+
displayChart?: boolean;
|
|
394
|
+
generateImage?: boolean;
|
|
395
|
+
ecforceFaq?: boolean;
|
|
396
|
+
getCurrentTime?: boolean;
|
|
397
|
+
webSearch?: boolean;
|
|
398
|
+
};
|
|
399
|
+
interfaceFeatures: {
|
|
400
|
+
modelSelection?: boolean;
|
|
401
|
+
attachments?: boolean;
|
|
402
|
+
thinkMode?: boolean;
|
|
403
|
+
};
|
|
404
|
+
allowedDomains: string[];
|
|
405
|
+
};
|
|
406
|
+
},
|
|
407
|
+
params: RequestParams = {},
|
|
408
|
+
) =>
|
|
409
|
+
this.request<
|
|
410
|
+
{
|
|
411
|
+
agent: {
|
|
412
|
+
/** @maxLength 30 */
|
|
413
|
+
id: string;
|
|
414
|
+
/** @maxLength 30 */
|
|
415
|
+
orgId: string;
|
|
416
|
+
/** @maxLength 255 */
|
|
417
|
+
name: string;
|
|
418
|
+
/** @maxLength 30 */
|
|
419
|
+
activeConfigId: string;
|
|
420
|
+
/** @format date-time */
|
|
421
|
+
createdAt: string;
|
|
422
|
+
/** @format date-time */
|
|
423
|
+
updatedAt: string;
|
|
424
|
+
createdBy: string | null;
|
|
425
|
+
updatedBy: string | null;
|
|
426
|
+
deletedAt: string | null;
|
|
427
|
+
deletedBy: string | null;
|
|
428
|
+
};
|
|
429
|
+
config: {
|
|
430
|
+
/** @maxLength 30 */
|
|
431
|
+
id: string;
|
|
432
|
+
/** @maxLength 30 */
|
|
433
|
+
agentId: string;
|
|
434
|
+
/** @maxLength 30 */
|
|
435
|
+
orgId: string;
|
|
436
|
+
/**
|
|
437
|
+
* @min -2147483648
|
|
438
|
+
* @max 2147483647
|
|
439
|
+
*/
|
|
440
|
+
version: number;
|
|
441
|
+
configJson:
|
|
442
|
+
| (string | number | boolean | null)
|
|
443
|
+
| Record<string, any>
|
|
444
|
+
| null[];
|
|
445
|
+
/** @format date-time */
|
|
446
|
+
createdAt: string;
|
|
447
|
+
/** @format date-time */
|
|
448
|
+
updatedAt: string;
|
|
449
|
+
deletedAt: string | null;
|
|
450
|
+
deletedBy: string | null;
|
|
451
|
+
};
|
|
452
|
+
},
|
|
453
|
+
any
|
|
454
|
+
>({
|
|
455
|
+
path: `/v1/agent`,
|
|
456
|
+
method: "POST",
|
|
457
|
+
body: data,
|
|
458
|
+
secure: true,
|
|
459
|
+
type: ContentType.Json,
|
|
460
|
+
format: "json",
|
|
461
|
+
...params,
|
|
462
|
+
}),
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* @description エージェント詳細を取得する
|
|
466
|
+
*
|
|
467
|
+
* @tags agent
|
|
468
|
+
* @name Get
|
|
469
|
+
* @summary get
|
|
470
|
+
* @request GET:/v1/agent/{id}
|
|
471
|
+
* @secure
|
|
472
|
+
*/
|
|
473
|
+
get: (id: string, params: RequestParams = {}) =>
|
|
474
|
+
this.request<
|
|
475
|
+
{
|
|
476
|
+
/** @maxLength 30 */
|
|
477
|
+
id: string;
|
|
478
|
+
/** @maxLength 30 */
|
|
479
|
+
orgId: string;
|
|
480
|
+
/** @maxLength 255 */
|
|
481
|
+
name: string;
|
|
482
|
+
/** @maxLength 30 */
|
|
483
|
+
activeConfigId: string;
|
|
484
|
+
/** @format date-time */
|
|
485
|
+
createdAt: string;
|
|
486
|
+
/** @format date-time */
|
|
487
|
+
updatedAt: string;
|
|
488
|
+
createdBy: string | null;
|
|
489
|
+
updatedBy: string | null;
|
|
490
|
+
deletedAt: string | null;
|
|
491
|
+
deletedBy: string | null;
|
|
492
|
+
activeConfig: {
|
|
493
|
+
/** @maxLength 30 */
|
|
494
|
+
id: string;
|
|
495
|
+
/** @maxLength 30 */
|
|
496
|
+
agentId: string;
|
|
497
|
+
/** @maxLength 30 */
|
|
498
|
+
orgId: string;
|
|
499
|
+
/**
|
|
500
|
+
* @min -2147483648
|
|
501
|
+
* @max 2147483647
|
|
502
|
+
*/
|
|
503
|
+
version: number;
|
|
504
|
+
configJson:
|
|
505
|
+
| (string | number | boolean | null)
|
|
506
|
+
| Record<string, any>
|
|
507
|
+
| null[];
|
|
508
|
+
/** @format date-time */
|
|
509
|
+
createdAt: string;
|
|
510
|
+
/** @format date-time */
|
|
511
|
+
updatedAt: string;
|
|
512
|
+
deletedAt: string | null;
|
|
513
|
+
deletedBy: string | null;
|
|
514
|
+
};
|
|
515
|
+
},
|
|
516
|
+
any
|
|
517
|
+
>({
|
|
518
|
+
path: `/v1/agent/${id}`,
|
|
519
|
+
method: "GET",
|
|
520
|
+
secure: true,
|
|
521
|
+
format: "json",
|
|
522
|
+
...params,
|
|
523
|
+
}),
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* @description エージェントを更新する
|
|
527
|
+
*
|
|
528
|
+
* @tags agent
|
|
529
|
+
* @name Update
|
|
530
|
+
* @summary update
|
|
531
|
+
* @request PUT:/v1/agent/{id}
|
|
532
|
+
* @secure
|
|
533
|
+
*/
|
|
534
|
+
update: (
|
|
535
|
+
id: string,
|
|
536
|
+
data?: {
|
|
537
|
+
/** @minLength 1 */
|
|
538
|
+
name?: string;
|
|
539
|
+
configJson?: {
|
|
540
|
+
defaultModel:
|
|
541
|
+
| "gpt-4.1-mini"
|
|
542
|
+
| "gpt-4.1-nano"
|
|
543
|
+
| "o3-mini"
|
|
544
|
+
| "o4-mini"
|
|
545
|
+
| "gpt-5"
|
|
546
|
+
| "gpt-5-mini"
|
|
547
|
+
| "gpt-5-nano"
|
|
548
|
+
| "gemini-2.0-flash"
|
|
549
|
+
| "gemini-2.5-flash";
|
|
550
|
+
defaultThinkingModel:
|
|
551
|
+
| "o3-mini"
|
|
552
|
+
| "o4-mini"
|
|
553
|
+
| "gpt-5"
|
|
554
|
+
| "gpt-5-mini"
|
|
555
|
+
| "gpt-5-nano";
|
|
556
|
+
systemPrompt: string;
|
|
557
|
+
nativeTools: {
|
|
558
|
+
displayChart?: boolean;
|
|
559
|
+
generateImage?: boolean;
|
|
560
|
+
ecforceFaq?: boolean;
|
|
561
|
+
getCurrentTime?: boolean;
|
|
562
|
+
webSearch?: boolean;
|
|
563
|
+
};
|
|
564
|
+
interfaceFeatures: {
|
|
565
|
+
modelSelection?: boolean;
|
|
566
|
+
attachments?: boolean;
|
|
567
|
+
thinkMode?: boolean;
|
|
568
|
+
};
|
|
569
|
+
allowedDomains: string[];
|
|
570
|
+
};
|
|
571
|
+
},
|
|
572
|
+
params: RequestParams = {},
|
|
573
|
+
) =>
|
|
574
|
+
this.request<
|
|
575
|
+
{
|
|
576
|
+
/** @maxLength 30 */
|
|
577
|
+
id: string;
|
|
578
|
+
/** @maxLength 30 */
|
|
579
|
+
orgId: string;
|
|
580
|
+
/** @maxLength 255 */
|
|
581
|
+
name: string;
|
|
582
|
+
/** @maxLength 30 */
|
|
583
|
+
activeConfigId: string;
|
|
584
|
+
/** @format date-time */
|
|
585
|
+
createdAt: string;
|
|
586
|
+
/** @format date-time */
|
|
587
|
+
updatedAt: string;
|
|
588
|
+
createdBy: string | null;
|
|
589
|
+
updatedBy: string | null;
|
|
590
|
+
deletedAt: string | null;
|
|
591
|
+
deletedBy: string | null;
|
|
592
|
+
activeConfig: {
|
|
593
|
+
/** @maxLength 30 */
|
|
594
|
+
id: string;
|
|
595
|
+
/** @maxLength 30 */
|
|
596
|
+
agentId: string;
|
|
597
|
+
/** @maxLength 30 */
|
|
598
|
+
orgId: string;
|
|
599
|
+
/**
|
|
600
|
+
* @min -2147483648
|
|
601
|
+
* @max 2147483647
|
|
602
|
+
*/
|
|
603
|
+
version: number;
|
|
604
|
+
configJson:
|
|
605
|
+
| (string | number | boolean | null)
|
|
606
|
+
| Record<string, any>
|
|
607
|
+
| null[];
|
|
608
|
+
/** @format date-time */
|
|
609
|
+
createdAt: string;
|
|
610
|
+
/** @format date-time */
|
|
611
|
+
updatedAt: string;
|
|
612
|
+
deletedAt: string | null;
|
|
613
|
+
deletedBy: string | null;
|
|
614
|
+
};
|
|
615
|
+
},
|
|
616
|
+
any
|
|
617
|
+
>({
|
|
618
|
+
path: `/v1/agent/${id}`,
|
|
619
|
+
method: "PUT",
|
|
620
|
+
body: data,
|
|
621
|
+
secure: true,
|
|
622
|
+
type: ContentType.Json,
|
|
623
|
+
format: "json",
|
|
624
|
+
...params,
|
|
625
|
+
}),
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* @description エージェントを削除する
|
|
629
|
+
*
|
|
630
|
+
* @tags agent
|
|
631
|
+
* @name Delete
|
|
632
|
+
* @summary delete
|
|
633
|
+
* @request DELETE:/v1/agent/{id}
|
|
634
|
+
* @secure
|
|
635
|
+
*/
|
|
636
|
+
delete: (id: string, data?: object, params: RequestParams = {}) =>
|
|
637
|
+
this.request<
|
|
638
|
+
{
|
|
639
|
+
success: boolean;
|
|
640
|
+
},
|
|
641
|
+
any
|
|
642
|
+
>({
|
|
643
|
+
path: `/v1/agent/${id}`,
|
|
644
|
+
method: "DELETE",
|
|
645
|
+
body: data,
|
|
646
|
+
secure: true,
|
|
647
|
+
type: ContentType.Json,
|
|
648
|
+
format: "json",
|
|
649
|
+
...params,
|
|
650
|
+
}),
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* @description エージェントのUI機能設定を取得する(公開)
|
|
654
|
+
*
|
|
655
|
+
* @tags agent
|
|
656
|
+
* @name GetInterfaceFeatures
|
|
657
|
+
* @summary getInterfaceFeatures
|
|
658
|
+
* @request GET:/v1/agent/{id}/interface-features
|
|
659
|
+
* @secure
|
|
660
|
+
*/
|
|
661
|
+
getInterfaceFeatures: (id: string, params: RequestParams = {}) =>
|
|
662
|
+
this.request<
|
|
663
|
+
{
|
|
664
|
+
modelSelection?: boolean;
|
|
665
|
+
attachments?: boolean;
|
|
666
|
+
thinkMode?: boolean;
|
|
667
|
+
},
|
|
668
|
+
any
|
|
669
|
+
>({
|
|
670
|
+
path: `/v1/agent/${id}/interface-features`,
|
|
671
|
+
method: "GET",
|
|
672
|
+
secure: true,
|
|
673
|
+
format: "json",
|
|
674
|
+
...params,
|
|
675
|
+
}),
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* @description エージェントのツール設定を取得する(公開)
|
|
679
|
+
*
|
|
680
|
+
* @tags agent
|
|
681
|
+
* @name GetToolSettings
|
|
682
|
+
* @summary getToolSettings
|
|
683
|
+
* @request POST:/v1/agent/tool-settings
|
|
684
|
+
* @secure
|
|
685
|
+
*/
|
|
686
|
+
getToolSettings: (
|
|
687
|
+
data: {
|
|
688
|
+
mcps?: {
|
|
689
|
+
name: string;
|
|
690
|
+
url: string;
|
|
691
|
+
headers?: Record<string, string>;
|
|
692
|
+
type?: "mcp" | "custom";
|
|
693
|
+
}[];
|
|
694
|
+
},
|
|
695
|
+
params: RequestParams = {},
|
|
696
|
+
) =>
|
|
697
|
+
this.request<
|
|
698
|
+
Record<
|
|
699
|
+
string,
|
|
700
|
+
{
|
|
701
|
+
displayName: string;
|
|
702
|
+
requireConfirmation: boolean;
|
|
703
|
+
description?: string;
|
|
704
|
+
}
|
|
705
|
+
>,
|
|
706
|
+
any
|
|
707
|
+
>({
|
|
708
|
+
path: `/v1/agent/tool-settings`,
|
|
709
|
+
method: "POST",
|
|
710
|
+
body: data,
|
|
711
|
+
secure: true,
|
|
712
|
+
type: ContentType.Json,
|
|
713
|
+
format: "json",
|
|
714
|
+
...params,
|
|
715
|
+
}),
|
|
716
|
+
};
|
|
717
|
+
org = {
|
|
718
|
+
/**
|
|
719
|
+
* @description 所属する組織一覧を取得する
|
|
720
|
+
*
|
|
721
|
+
* @tags org
|
|
722
|
+
* @name List
|
|
723
|
+
* @summary list
|
|
724
|
+
* @request GET:/v1/org
|
|
725
|
+
* @secure
|
|
726
|
+
*/
|
|
727
|
+
list: (params: RequestParams = {}) =>
|
|
728
|
+
this.request<
|
|
729
|
+
{
|
|
730
|
+
/** @maxLength 255 */
|
|
731
|
+
name: string;
|
|
732
|
+
/** @maxLength 255 */
|
|
733
|
+
slug: string;
|
|
734
|
+
/** @maxLength 255 */
|
|
735
|
+
plan: string;
|
|
736
|
+
}[],
|
|
737
|
+
any
|
|
738
|
+
>({
|
|
739
|
+
path: `/v1/org`,
|
|
740
|
+
method: "GET",
|
|
741
|
+
secure: true,
|
|
742
|
+
format: "json",
|
|
743
|
+
...params,
|
|
744
|
+
}),
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* @description 組織詳細を取得する
|
|
748
|
+
*
|
|
749
|
+
* @tags org
|
|
750
|
+
* @name Get
|
|
751
|
+
* @summary get
|
|
752
|
+
* @request GET:/v1/org/{slug}
|
|
753
|
+
* @secure
|
|
754
|
+
*/
|
|
755
|
+
get: (slug: string, params: RequestParams = {}) =>
|
|
756
|
+
this.request<
|
|
757
|
+
{
|
|
758
|
+
/** @maxLength 255 */
|
|
759
|
+
name: string;
|
|
760
|
+
/** @maxLength 255 */
|
|
761
|
+
slug: string;
|
|
762
|
+
/** @maxLength 255 */
|
|
763
|
+
plan: string;
|
|
764
|
+
},
|
|
765
|
+
any
|
|
766
|
+
>({
|
|
767
|
+
path: `/v1/org/${slug}`,
|
|
768
|
+
method: "GET",
|
|
769
|
+
secure: true,
|
|
770
|
+
format: "json",
|
|
771
|
+
...params,
|
|
772
|
+
}),
|
|
773
|
+
};
|
|
774
|
+
apiKeys = {
|
|
775
|
+
/**
|
|
776
|
+
* @description APIキー一覧を取得する
|
|
777
|
+
*
|
|
778
|
+
* @tags apiKey
|
|
779
|
+
* @name List
|
|
780
|
+
* @summary list
|
|
781
|
+
* @request GET:/v1/api-keys/{type}
|
|
782
|
+
* @secure
|
|
783
|
+
*/
|
|
784
|
+
list: (type: "personal" | "org", params: RequestParams = {}) =>
|
|
785
|
+
this.request<
|
|
786
|
+
{
|
|
787
|
+
id: string;
|
|
788
|
+
name: string;
|
|
789
|
+
lastUsedAt: string | null;
|
|
790
|
+
/** @format date-time */
|
|
791
|
+
createdAt: string;
|
|
792
|
+
createdByUser: {
|
|
793
|
+
/** @maxLength 30 */
|
|
794
|
+
id: string;
|
|
795
|
+
/** @maxLength 255 */
|
|
796
|
+
name: string;
|
|
797
|
+
/** @maxLength 255 */
|
|
798
|
+
email: string;
|
|
799
|
+
} | null;
|
|
800
|
+
updatedByUser: {
|
|
801
|
+
/** @maxLength 30 */
|
|
802
|
+
id: string;
|
|
803
|
+
/** @maxLength 255 */
|
|
804
|
+
name: string;
|
|
805
|
+
/** @maxLength 255 */
|
|
806
|
+
email: string;
|
|
807
|
+
} | null;
|
|
808
|
+
}[],
|
|
809
|
+
any
|
|
810
|
+
>({
|
|
811
|
+
path: `/v1/api-keys/${type}`,
|
|
812
|
+
method: "GET",
|
|
813
|
+
secure: true,
|
|
814
|
+
format: "json",
|
|
815
|
+
...params,
|
|
816
|
+
}),
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* @description APIキーを作成する
|
|
820
|
+
*
|
|
821
|
+
* @tags apiKey
|
|
822
|
+
* @name Create
|
|
823
|
+
* @summary create
|
|
824
|
+
* @request POST:/v1/api-keys
|
|
825
|
+
* @secure
|
|
826
|
+
*/
|
|
827
|
+
create: (
|
|
828
|
+
data: {
|
|
829
|
+
type: "personal" | "org";
|
|
830
|
+
name?: string;
|
|
831
|
+
},
|
|
832
|
+
params: RequestParams = {},
|
|
833
|
+
) =>
|
|
834
|
+
this.request<
|
|
835
|
+
{
|
|
836
|
+
apiKey: {
|
|
837
|
+
/** @maxLength 30 */
|
|
838
|
+
id: string;
|
|
839
|
+
/** @maxLength 30 */
|
|
840
|
+
orgId: string;
|
|
841
|
+
/** @maxLength 30 */
|
|
842
|
+
userId: string;
|
|
843
|
+
/** @maxLength 255 */
|
|
844
|
+
tokenHash: string;
|
|
845
|
+
lastUsedAt: string | null;
|
|
846
|
+
/** @format date-time */
|
|
847
|
+
createdAt: string;
|
|
848
|
+
/** @format date-time */
|
|
849
|
+
updatedAt: string;
|
|
850
|
+
createdBy: string | null;
|
|
851
|
+
updatedBy: string | null;
|
|
852
|
+
deletedAt: string | null;
|
|
853
|
+
deletedBy: string | null;
|
|
854
|
+
};
|
|
855
|
+
plaintextToken: string;
|
|
856
|
+
},
|
|
857
|
+
any
|
|
858
|
+
>({
|
|
859
|
+
path: `/v1/api-keys`,
|
|
860
|
+
method: "POST",
|
|
861
|
+
body: data,
|
|
862
|
+
secure: true,
|
|
863
|
+
type: ContentType.Json,
|
|
864
|
+
format: "json",
|
|
865
|
+
...params,
|
|
866
|
+
}),
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* @description APIキーを更新する
|
|
870
|
+
*
|
|
871
|
+
* @tags apiKey
|
|
872
|
+
* @name Update
|
|
873
|
+
* @summary update
|
|
874
|
+
* @request PATCH:/v1/api-keys/{id}
|
|
875
|
+
* @secure
|
|
876
|
+
*/
|
|
877
|
+
update: (
|
|
878
|
+
id: string,
|
|
879
|
+
data?: {
|
|
880
|
+
/** @minLength 1 */
|
|
881
|
+
name?: string;
|
|
882
|
+
},
|
|
883
|
+
params: RequestParams = {},
|
|
884
|
+
) =>
|
|
885
|
+
this.request<
|
|
886
|
+
{
|
|
887
|
+
id: string;
|
|
888
|
+
name: string;
|
|
889
|
+
lastUsedAt: string | null;
|
|
890
|
+
/** @format date-time */
|
|
891
|
+
createdAt: string;
|
|
892
|
+
createdByUser: {
|
|
893
|
+
/** @maxLength 30 */
|
|
894
|
+
id: string;
|
|
895
|
+
/** @maxLength 255 */
|
|
896
|
+
name: string;
|
|
897
|
+
/** @maxLength 255 */
|
|
898
|
+
email: string;
|
|
899
|
+
} | null;
|
|
900
|
+
updatedByUser: {
|
|
901
|
+
/** @maxLength 30 */
|
|
902
|
+
id: string;
|
|
903
|
+
/** @maxLength 255 */
|
|
904
|
+
name: string;
|
|
905
|
+
/** @maxLength 255 */
|
|
906
|
+
email: string;
|
|
907
|
+
} | null;
|
|
908
|
+
},
|
|
909
|
+
any
|
|
910
|
+
>({
|
|
911
|
+
path: `/v1/api-keys/${id}`,
|
|
912
|
+
method: "PATCH",
|
|
913
|
+
body: data,
|
|
914
|
+
secure: true,
|
|
915
|
+
type: ContentType.Json,
|
|
916
|
+
format: "json",
|
|
917
|
+
...params,
|
|
918
|
+
}),
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* @description APIキーを削除する
|
|
922
|
+
*
|
|
923
|
+
* @tags apiKey
|
|
924
|
+
* @name Delete
|
|
925
|
+
* @summary delete
|
|
926
|
+
* @request DELETE:/v1/api-keys/{id}
|
|
927
|
+
* @secure
|
|
928
|
+
*/
|
|
929
|
+
delete: (id: string, data?: object, params: RequestParams = {}) =>
|
|
930
|
+
this.request<
|
|
931
|
+
{
|
|
932
|
+
success: boolean;
|
|
933
|
+
},
|
|
934
|
+
any
|
|
935
|
+
>({
|
|
936
|
+
path: `/v1/api-keys/${id}`,
|
|
937
|
+
method: "DELETE",
|
|
938
|
+
body: data,
|
|
939
|
+
secure: true,
|
|
940
|
+
type: ContentType.Json,
|
|
941
|
+
format: "json",
|
|
942
|
+
...params,
|
|
943
|
+
}),
|
|
944
|
+
};
|
|
945
|
+
chat = {
|
|
946
|
+
/**
|
|
947
|
+
* @description 新しいチャットセッションを開始してトークンを返す
|
|
948
|
+
*
|
|
949
|
+
* @tags chat
|
|
950
|
+
* @name StartSession
|
|
951
|
+
* @summary startSession
|
|
952
|
+
* @request POST:/v1/chat/start-session
|
|
953
|
+
* @secure
|
|
954
|
+
*/
|
|
955
|
+
startSession: (
|
|
956
|
+
data: {
|
|
957
|
+
/** @minLength 1 */
|
|
958
|
+
agentId: string;
|
|
959
|
+
/** @minLength 1 */
|
|
960
|
+
externalUserId: string;
|
|
961
|
+
metadata?: Record<string, string>;
|
|
962
|
+
},
|
|
963
|
+
params: RequestParams = {},
|
|
964
|
+
) =>
|
|
965
|
+
this.request<
|
|
966
|
+
{
|
|
967
|
+
sessionId: string;
|
|
968
|
+
token: string;
|
|
969
|
+
expiresAt: string;
|
|
970
|
+
},
|
|
971
|
+
any
|
|
972
|
+
>({
|
|
973
|
+
path: `/v1/chat/start-session`,
|
|
974
|
+
method: "POST",
|
|
975
|
+
body: data,
|
|
976
|
+
secure: true,
|
|
977
|
+
type: ContentType.Json,
|
|
978
|
+
format: "json",
|
|
979
|
+
...params,
|
|
980
|
+
}),
|
|
981
|
+
};
|
|
982
|
+
}
|