@tourmalinecore/flamingo-api-js-client 1.1.1
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 +359 -0
- package/dist/index.js +278 -0
- package/package.json +28 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/** WhatWentWrong */
|
|
2
|
+
export declare enum WhatWentWrong {
|
|
3
|
+
ErrorInResponse = "ErrorInResponse",
|
|
4
|
+
NoLinksToSources = "NoLinksToSources",
|
|
5
|
+
IncompleteAnswer = "IncompleteAnswer",
|
|
6
|
+
DoesntAnswerMyQuestion = "DoesntAnswerMyQuestion",
|
|
7
|
+
NotAllSourcesHaveBeenUsed = "NotAllSourcesHaveBeenUsed",
|
|
8
|
+
SourcesAreNotRelevantToAnswer = "SourcesAreNotRelevantToAnswer",
|
|
9
|
+
Other = "Other"
|
|
10
|
+
}
|
|
11
|
+
/** SourceType */
|
|
12
|
+
export declare enum SourceType {
|
|
13
|
+
GitHub = "GitHub",
|
|
14
|
+
GitLab = "GitLab"
|
|
15
|
+
}
|
|
16
|
+
/** SourceSyncStatus */
|
|
17
|
+
export declare enum SourceSyncStatus {
|
|
18
|
+
SyncNotStarted = "SyncNotStarted",
|
|
19
|
+
SyncInProgress = "SyncInProgress",
|
|
20
|
+
RequiresAttention = "RequiresAttention",
|
|
21
|
+
SyncComplete = "SyncComplete"
|
|
22
|
+
}
|
|
23
|
+
/** ChatAnswerSourceDto */
|
|
24
|
+
export interface ChatAnswerSourceDto {
|
|
25
|
+
/** Id */
|
|
26
|
+
id: number;
|
|
27
|
+
/** Url */
|
|
28
|
+
url: string;
|
|
29
|
+
type: SourceType;
|
|
30
|
+
/**
|
|
31
|
+
* Lastsyncedatutc
|
|
32
|
+
* @format date-time
|
|
33
|
+
*/
|
|
34
|
+
lastSyncedAtUtc: string;
|
|
35
|
+
}
|
|
36
|
+
/** CreateSourceRequest */
|
|
37
|
+
export interface CreateSourceRequest {
|
|
38
|
+
type: SourceType;
|
|
39
|
+
/** Name */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Url */
|
|
42
|
+
url: string;
|
|
43
|
+
/** Accesstoken */
|
|
44
|
+
accessToken: string | null;
|
|
45
|
+
}
|
|
46
|
+
/** CreateSourceResponse */
|
|
47
|
+
export interface CreateSourceResponse {
|
|
48
|
+
/** Newsourceid */
|
|
49
|
+
newSourceId: number;
|
|
50
|
+
}
|
|
51
|
+
/** CreateWorkspaceRequest */
|
|
52
|
+
export interface CreateWorkspaceRequest {
|
|
53
|
+
/** Name */
|
|
54
|
+
name: string;
|
|
55
|
+
}
|
|
56
|
+
/** CreateWorkspaceResponse */
|
|
57
|
+
export interface CreateWorkspaceResponse {
|
|
58
|
+
/** Newworkspaceid */
|
|
59
|
+
newWorkspaceId: number;
|
|
60
|
+
}
|
|
61
|
+
/** FileDto */
|
|
62
|
+
export interface FileDto {
|
|
63
|
+
/** Path */
|
|
64
|
+
path: string;
|
|
65
|
+
/** Url */
|
|
66
|
+
url: string;
|
|
67
|
+
}
|
|
68
|
+
/** FullSourceDto */
|
|
69
|
+
export interface FullSourceDto {
|
|
70
|
+
/** Id */
|
|
71
|
+
id: number;
|
|
72
|
+
/** Url */
|
|
73
|
+
url: string;
|
|
74
|
+
/** Name */
|
|
75
|
+
name: string;
|
|
76
|
+
type: SourceType;
|
|
77
|
+
/**
|
|
78
|
+
* Lastsyncedatutc
|
|
79
|
+
* @format date-time
|
|
80
|
+
*/
|
|
81
|
+
lastSyncedAtUtc: string;
|
|
82
|
+
status: SourceSyncStatus;
|
|
83
|
+
/** Errormessage */
|
|
84
|
+
errorMessage?: string | null;
|
|
85
|
+
}
|
|
86
|
+
/** GetOneSourceResponse */
|
|
87
|
+
export interface GetOneSourceResponse {
|
|
88
|
+
/** Url */
|
|
89
|
+
url: string;
|
|
90
|
+
/** Name */
|
|
91
|
+
name: string;
|
|
92
|
+
type: SourceType;
|
|
93
|
+
}
|
|
94
|
+
/** GetSourcesResponse */
|
|
95
|
+
export interface GetSourcesResponse {
|
|
96
|
+
/** Sources */
|
|
97
|
+
sources: FullSourceDto[];
|
|
98
|
+
}
|
|
99
|
+
/** GetWorkspacesResponse */
|
|
100
|
+
export interface GetWorkspacesResponse {
|
|
101
|
+
/** Workspaces */
|
|
102
|
+
workspaces: WorkspaceDto[];
|
|
103
|
+
}
|
|
104
|
+
/** GiveNegativeFeedbackRequest */
|
|
105
|
+
export interface GiveNegativeFeedbackRequest {
|
|
106
|
+
whatWentWrong: WhatWentWrong;
|
|
107
|
+
/** Problemdescriptioninfreeform */
|
|
108
|
+
problemDescriptionInFreeForm: string | null;
|
|
109
|
+
}
|
|
110
|
+
/** HTTPValidationError */
|
|
111
|
+
export interface HTTPValidationError {
|
|
112
|
+
/** Detail */
|
|
113
|
+
detail?: ValidationError[];
|
|
114
|
+
}
|
|
115
|
+
/** HardDeleteResponse */
|
|
116
|
+
export interface HardDeleteResponse {
|
|
117
|
+
/** Isdeleted */
|
|
118
|
+
isDeleted: boolean;
|
|
119
|
+
}
|
|
120
|
+
/** ReferenceDto */
|
|
121
|
+
export interface ReferenceDto {
|
|
122
|
+
source: ChatAnswerSourceDto;
|
|
123
|
+
file: FileDto;
|
|
124
|
+
}
|
|
125
|
+
/** SendMessageFromEvaluationResponse */
|
|
126
|
+
export interface SendMessageFromEvaluationResponse {
|
|
127
|
+
/** Answer */
|
|
128
|
+
answer: string;
|
|
129
|
+
/** Retrievedchunks */
|
|
130
|
+
retrievedChunks: string[];
|
|
131
|
+
}
|
|
132
|
+
/** SendMessageRequest */
|
|
133
|
+
export interface SendMessageRequest {
|
|
134
|
+
/** Message */
|
|
135
|
+
message: string;
|
|
136
|
+
/** Workspacesids */
|
|
137
|
+
workspacesIds: number[];
|
|
138
|
+
}
|
|
139
|
+
/** SendMessageResponse */
|
|
140
|
+
export interface SendMessageResponse {
|
|
141
|
+
/** Newmessageid */
|
|
142
|
+
newMessageId: number;
|
|
143
|
+
/** Answer */
|
|
144
|
+
answer: string;
|
|
145
|
+
/** References */
|
|
146
|
+
references: ReferenceDto[];
|
|
147
|
+
}
|
|
148
|
+
/** SoftDeleteResponse */
|
|
149
|
+
export interface SoftDeleteResponse {
|
|
150
|
+
/** Isdeleted */
|
|
151
|
+
isDeleted: boolean;
|
|
152
|
+
}
|
|
153
|
+
/** UpdateSourceRequest */
|
|
154
|
+
export interface UpdateSourceRequest {
|
|
155
|
+
type: SourceType;
|
|
156
|
+
/** Url */
|
|
157
|
+
url: string;
|
|
158
|
+
/** Accesstoken */
|
|
159
|
+
accessToken: string | null;
|
|
160
|
+
}
|
|
161
|
+
/** ValidationError */
|
|
162
|
+
export interface ValidationError {
|
|
163
|
+
/** Location */
|
|
164
|
+
loc: (string | number)[];
|
|
165
|
+
/** Message */
|
|
166
|
+
msg: string;
|
|
167
|
+
/** Error Type */
|
|
168
|
+
type: string;
|
|
169
|
+
}
|
|
170
|
+
/** WorkspaceDto */
|
|
171
|
+
export interface WorkspaceDto {
|
|
172
|
+
/** Id */
|
|
173
|
+
id: number;
|
|
174
|
+
/** Name */
|
|
175
|
+
name: string;
|
|
176
|
+
/** Sourcescount */
|
|
177
|
+
sourcesCount: number;
|
|
178
|
+
}
|
|
179
|
+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
|
|
180
|
+
export type QueryParamsType = Record<string | number, any>;
|
|
181
|
+
export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
|
|
182
|
+
/** set parameter to `true` for call `securityWorker` for this request */
|
|
183
|
+
secure?: boolean;
|
|
184
|
+
/** request path */
|
|
185
|
+
path: string;
|
|
186
|
+
/** content type of request body */
|
|
187
|
+
type?: ContentType;
|
|
188
|
+
/** query params */
|
|
189
|
+
query?: QueryParamsType;
|
|
190
|
+
/** format of response (i.e. response.json() -> format: "json") */
|
|
191
|
+
format?: ResponseType;
|
|
192
|
+
/** request body */
|
|
193
|
+
body?: unknown;
|
|
194
|
+
}
|
|
195
|
+
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
|
|
196
|
+
export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, "data" | "cancelToken"> {
|
|
197
|
+
securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
|
|
198
|
+
secure?: boolean;
|
|
199
|
+
format?: ResponseType;
|
|
200
|
+
}
|
|
201
|
+
export declare enum ContentType {
|
|
202
|
+
Json = "application/json",
|
|
203
|
+
JsonApi = "application/vnd.api+json",
|
|
204
|
+
FormData = "multipart/form-data",
|
|
205
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
206
|
+
Text = "text/plain"
|
|
207
|
+
}
|
|
208
|
+
export declare class HttpClient<SecurityDataType = unknown> {
|
|
209
|
+
instance: AxiosInstance;
|
|
210
|
+
private securityData;
|
|
211
|
+
private securityWorker?;
|
|
212
|
+
private secure?;
|
|
213
|
+
private format?;
|
|
214
|
+
constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
|
|
215
|
+
setSecurityData: (data: SecurityDataType | null) => void;
|
|
216
|
+
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
217
|
+
protected stringifyFormItem(formItem: unknown): string;
|
|
218
|
+
protected createFormData(input: Record<string, unknown>): FormData;
|
|
219
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<AxiosResponse<T>>;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* @title flamingo-api
|
|
223
|
+
* @version 0.1.0
|
|
224
|
+
* @baseUrl /api
|
|
225
|
+
*/
|
|
226
|
+
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
227
|
+
workspaces: {
|
|
228
|
+
/**
|
|
229
|
+
* No description
|
|
230
|
+
*
|
|
231
|
+
* @tags Workspaces operations
|
|
232
|
+
* @name GetAllWorkspacesWorkspacesGet
|
|
233
|
+
* @summary Get All Workspaces
|
|
234
|
+
* @request GET:/workspaces
|
|
235
|
+
*/
|
|
236
|
+
getAllWorkspacesWorkspacesGet: (params?: RequestParams) => Promise<AxiosResponse<GetWorkspacesResponse, any, {}>>;
|
|
237
|
+
/**
|
|
238
|
+
* @description Used only for auto-testing
|
|
239
|
+
*
|
|
240
|
+
* @tags Workspaces operations
|
|
241
|
+
* @name CreateWorkspaceWorkspacesPost
|
|
242
|
+
* @summary Create Workspace
|
|
243
|
+
* @request POST:/workspaces
|
|
244
|
+
*/
|
|
245
|
+
createWorkspaceWorkspacesPost: (data: CreateWorkspaceRequest, params?: RequestParams) => Promise<AxiosResponse<CreateWorkspaceResponse, any, {}>>;
|
|
246
|
+
/**
|
|
247
|
+
* @description Used only for auto-testing
|
|
248
|
+
*
|
|
249
|
+
* @tags Workspaces operations
|
|
250
|
+
* @name HardDeleteWorkspaceWorkspacesWorkspaceIdHardDeleteDelete
|
|
251
|
+
* @summary Hard Delete Workspace
|
|
252
|
+
* @request DELETE:/workspaces/{workspaceId}/hard-delete
|
|
253
|
+
*/
|
|
254
|
+
hardDeleteWorkspaceWorkspacesWorkspaceIdHardDeleteDelete: (workspaceId: number, params?: RequestParams) => Promise<AxiosResponse<HardDeleteResponse, any, {}>>;
|
|
255
|
+
/**
|
|
256
|
+
* No description
|
|
257
|
+
*
|
|
258
|
+
* @tags Sources operations, bound to a particular workspace
|
|
259
|
+
* @name GetAllSourcesOfAWorkspaceWorkspacesWorkspaceIdSourcesGet
|
|
260
|
+
* @summary Get All Sources Of A Workspace
|
|
261
|
+
* @request GET:/workspaces/{workspaceId}/sources
|
|
262
|
+
*/
|
|
263
|
+
getAllSourcesOfAWorkspaceWorkspacesWorkspaceIdSourcesGet: (workspaceId: number, params?: RequestParams) => Promise<AxiosResponse<GetSourcesResponse, any, {}>>;
|
|
264
|
+
/**
|
|
265
|
+
* No description
|
|
266
|
+
*
|
|
267
|
+
* @tags Sources operations, bound to a particular workspace
|
|
268
|
+
* @name CreateSourceWorkspacesWorkspaceIdSourcesPost
|
|
269
|
+
* @summary Create Source
|
|
270
|
+
* @request POST:/workspaces/{workspaceId}/sources
|
|
271
|
+
*/
|
|
272
|
+
createSourceWorkspacesWorkspaceIdSourcesPost: (workspaceId: number, data: CreateSourceRequest, params?: RequestParams) => Promise<AxiosResponse<CreateSourceResponse, any, {}>>;
|
|
273
|
+
/**
|
|
274
|
+
* No description
|
|
275
|
+
*
|
|
276
|
+
* @tags Sources operations, bound to a particular workspace
|
|
277
|
+
* @name GetOneSourceWorkspacesWorkspaceIdSourcesSourceIdGet
|
|
278
|
+
* @summary Get One Source
|
|
279
|
+
* @request GET:/workspaces/{workspaceId}/sources/{sourceId}
|
|
280
|
+
*/
|
|
281
|
+
getOneSourceWorkspacesWorkspaceIdSourcesSourceIdGet: (workspaceId: number, sourceId: number, params?: RequestParams) => Promise<AxiosResponse<GetOneSourceResponse, any, {}>>;
|
|
282
|
+
/**
|
|
283
|
+
* No description
|
|
284
|
+
*
|
|
285
|
+
* @tags Sources operations, bound to a particular workspace
|
|
286
|
+
* @name UpdateSourceWorkspacesWorkspaceIdSourcesSourceIdPost
|
|
287
|
+
* @summary Update Source
|
|
288
|
+
* @request POST:/workspaces/{workspaceId}/sources/{sourceId}
|
|
289
|
+
*/
|
|
290
|
+
updateSourceWorkspacesWorkspaceIdSourcesSourceIdPost: (workspaceId: number, sourceId: number, data: UpdateSourceRequest, params?: RequestParams) => Promise<AxiosResponse<any, any, {}>>;
|
|
291
|
+
/**
|
|
292
|
+
* No description
|
|
293
|
+
*
|
|
294
|
+
* @tags Sources operations, bound to a particular workspace
|
|
295
|
+
* @name ForceSyncSourceWorkspacesWorkspaceIdSourcesSourceIdForceSyncPost
|
|
296
|
+
* @summary Force Sync Source
|
|
297
|
+
* @request POST:/workspaces/{workspaceId}/sources/{sourceId}/force-sync
|
|
298
|
+
*/
|
|
299
|
+
forceSyncSourceWorkspacesWorkspaceIdSourcesSourceIdForceSyncPost: (workspaceId: number, sourceId: number, params?: RequestParams) => Promise<AxiosResponse<any, any, {}>>;
|
|
300
|
+
/**
|
|
301
|
+
* No description
|
|
302
|
+
*
|
|
303
|
+
* @tags Sources operations, bound to a particular workspace
|
|
304
|
+
* @name SoftDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdSoftDeleteDelete
|
|
305
|
+
* @summary Soft Delete Source
|
|
306
|
+
* @request DELETE:/workspaces/{workspaceId}/sources/{sourceId}/soft-delete
|
|
307
|
+
*/
|
|
308
|
+
softDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdSoftDeleteDelete: (workspaceId: number, sourceId: number, params?: RequestParams) => Promise<AxiosResponse<SoftDeleteResponse, any, {}>>;
|
|
309
|
+
/**
|
|
310
|
+
* @description Used only for auto-testing
|
|
311
|
+
*
|
|
312
|
+
* @tags Sources operations, bound to a particular workspace
|
|
313
|
+
* @name HardDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdHardDeleteDelete
|
|
314
|
+
* @summary Hard Delete Source
|
|
315
|
+
* @request DELETE:/workspaces/{workspaceId}/sources/{sourceId}/hard-delete
|
|
316
|
+
*/
|
|
317
|
+
hardDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdHardDeleteDelete: (workspaceId: number, sourceId: number, params?: RequestParams) => Promise<AxiosResponse<HardDeleteResponse, any, {}>>;
|
|
318
|
+
};
|
|
319
|
+
chats: {
|
|
320
|
+
/**
|
|
321
|
+
* No description
|
|
322
|
+
*
|
|
323
|
+
* @tags Chat operations
|
|
324
|
+
* @name SendMessageToChatChatsChatIdMessagesPost
|
|
325
|
+
* @summary Send Message To Chat
|
|
326
|
+
* @request POST:/chats/{chatId}/messages
|
|
327
|
+
*/
|
|
328
|
+
sendMessageToChatChatsChatIdMessagesPost: (chatId: number, data: SendMessageRequest, params?: RequestParams) => Promise<AxiosResponse<SendMessageResponse, any, {}>>;
|
|
329
|
+
/**
|
|
330
|
+
* @description Used only for running the evaluation against this API
|
|
331
|
+
*
|
|
332
|
+
* @tags Chat operations
|
|
333
|
+
* @name SendMessageToChatFromEvaluationChatsSendMessageFromEvaluationPost
|
|
334
|
+
* @summary Send Message To Chat From Evaluation
|
|
335
|
+
* @request POST:/chats/send-message-from-evaluation
|
|
336
|
+
*/
|
|
337
|
+
sendMessageToChatFromEvaluationChatsSendMessageFromEvaluationPost: (data: SendMessageRequest, params?: RequestParams) => Promise<AxiosResponse<SendMessageFromEvaluationResponse, any, {}>>;
|
|
338
|
+
/**
|
|
339
|
+
* No description
|
|
340
|
+
*
|
|
341
|
+
* @tags Chat operations
|
|
342
|
+
* @name GivePositiveFeedbackToAnswerChatsChatIdMessagesMessageIdGivePositiveFeedbackToAnswerPost
|
|
343
|
+
* @summary Give Positive Feedback To Answer
|
|
344
|
+
* @request POST:/chats/{chatId}/messages/{messageId}/give-positive-feedback-to-answer
|
|
345
|
+
*/
|
|
346
|
+
givePositiveFeedbackToAnswerChatsChatIdMessagesMessageIdGivePositiveFeedbackToAnswerPost: (chatId: number, messageId: number, params?: RequestParams) => Promise<AxiosResponse<any, any, {}>>;
|
|
347
|
+
};
|
|
348
|
+
chatsChatId: {
|
|
349
|
+
/**
|
|
350
|
+
* No description
|
|
351
|
+
*
|
|
352
|
+
* @tags Chat operations
|
|
353
|
+
* @name GiveNegativeFeedbackToAnswerChatsChatIdMessagesMessageIdGiveNegativeFeedbackToAnswerPost
|
|
354
|
+
* @summary Give Negative Feedback To Answer
|
|
355
|
+
* @request POST:/chats{chatId}/messages/{messageId}/give-negative-feedback-to-answer
|
|
356
|
+
*/
|
|
357
|
+
giveNegativeFeedbackToAnswerChatsChatIdMessagesMessageIdGiveNegativeFeedbackToAnswerPost: (chatId: number, messageId: number, data: GiveNegativeFeedbackRequest, params?: RequestParams) => Promise<AxiosResponse<any, any, {}>>;
|
|
358
|
+
};
|
|
359
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
/*
|
|
6
|
+
* ---------------------------------------------------------------
|
|
7
|
+
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
8
|
+
* ## ##
|
|
9
|
+
* ## AUTHOR: acacode ##
|
|
10
|
+
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
11
|
+
* ---------------------------------------------------------------
|
|
12
|
+
*/
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
23
|
+
var t = {};
|
|
24
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
25
|
+
t[p] = s[p];
|
|
26
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
27
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
29
|
+
t[p[i]] = s[p[i]];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
};
|
|
33
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
34
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Api = exports.HttpClient = exports.ContentType = exports.SourceSyncStatus = exports.SourceType = exports.WhatWentWrong = void 0;
|
|
38
|
+
/** WhatWentWrong */
|
|
39
|
+
var WhatWentWrong;
|
|
40
|
+
(function (WhatWentWrong) {
|
|
41
|
+
WhatWentWrong["ErrorInResponse"] = "ErrorInResponse";
|
|
42
|
+
WhatWentWrong["NoLinksToSources"] = "NoLinksToSources";
|
|
43
|
+
WhatWentWrong["IncompleteAnswer"] = "IncompleteAnswer";
|
|
44
|
+
WhatWentWrong["DoesntAnswerMyQuestion"] = "DoesntAnswerMyQuestion";
|
|
45
|
+
WhatWentWrong["NotAllSourcesHaveBeenUsed"] = "NotAllSourcesHaveBeenUsed";
|
|
46
|
+
WhatWentWrong["SourcesAreNotRelevantToAnswer"] = "SourcesAreNotRelevantToAnswer";
|
|
47
|
+
WhatWentWrong["Other"] = "Other";
|
|
48
|
+
})(WhatWentWrong || (exports.WhatWentWrong = WhatWentWrong = {}));
|
|
49
|
+
/** SourceType */
|
|
50
|
+
var SourceType;
|
|
51
|
+
(function (SourceType) {
|
|
52
|
+
SourceType["GitHub"] = "GitHub";
|
|
53
|
+
SourceType["GitLab"] = "GitLab";
|
|
54
|
+
})(SourceType || (exports.SourceType = SourceType = {}));
|
|
55
|
+
/** SourceSyncStatus */
|
|
56
|
+
var SourceSyncStatus;
|
|
57
|
+
(function (SourceSyncStatus) {
|
|
58
|
+
SourceSyncStatus["SyncNotStarted"] = "SyncNotStarted";
|
|
59
|
+
SourceSyncStatus["SyncInProgress"] = "SyncInProgress";
|
|
60
|
+
SourceSyncStatus["RequiresAttention"] = "RequiresAttention";
|
|
61
|
+
SourceSyncStatus["SyncComplete"] = "SyncComplete";
|
|
62
|
+
})(SourceSyncStatus || (exports.SourceSyncStatus = SourceSyncStatus = {}));
|
|
63
|
+
const axios_1 = __importDefault(require("axios"));
|
|
64
|
+
var ContentType;
|
|
65
|
+
(function (ContentType) {
|
|
66
|
+
ContentType["Json"] = "application/json";
|
|
67
|
+
ContentType["JsonApi"] = "application/vnd.api+json";
|
|
68
|
+
ContentType["FormData"] = "multipart/form-data";
|
|
69
|
+
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
|
|
70
|
+
ContentType["Text"] = "text/plain";
|
|
71
|
+
})(ContentType || (exports.ContentType = ContentType = {}));
|
|
72
|
+
class HttpClient {
|
|
73
|
+
constructor(_a = {}) {
|
|
74
|
+
var { securityWorker, secure, format } = _a, axiosConfig = __rest(_a, ["securityWorker", "secure", "format"]);
|
|
75
|
+
this.securityData = null;
|
|
76
|
+
this.setSecurityData = (data) => {
|
|
77
|
+
this.securityData = data;
|
|
78
|
+
};
|
|
79
|
+
this.request = (_a) => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
var { secure, path, type, query, format, body } = _a, params = __rest(_a, ["secure", "path", "type", "query", "format", "body"]);
|
|
81
|
+
const secureParams = ((typeof secure === "boolean" ? secure : this.secure) &&
|
|
82
|
+
this.securityWorker &&
|
|
83
|
+
(yield this.securityWorker(this.securityData))) ||
|
|
84
|
+
{};
|
|
85
|
+
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
86
|
+
const responseFormat = format || this.format || undefined;
|
|
87
|
+
if (type === ContentType.FormData &&
|
|
88
|
+
body &&
|
|
89
|
+
body !== null &&
|
|
90
|
+
typeof body === "object") {
|
|
91
|
+
body = this.createFormData(body);
|
|
92
|
+
}
|
|
93
|
+
if (type === ContentType.Text &&
|
|
94
|
+
body &&
|
|
95
|
+
body !== null &&
|
|
96
|
+
typeof body !== "string") {
|
|
97
|
+
body = JSON.stringify(body);
|
|
98
|
+
}
|
|
99
|
+
return this.instance.request(Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (requestParams.headers || {})), (type ? { "Content-Type": type } : {})), params: query, responseType: responseFormat, data: body, url: path }));
|
|
100
|
+
});
|
|
101
|
+
this.instance = axios_1.default.create(Object.assign(Object.assign({}, axiosConfig), { baseURL: axiosConfig.baseURL || "/api" }));
|
|
102
|
+
this.secure = secure;
|
|
103
|
+
this.format = format;
|
|
104
|
+
this.securityWorker = securityWorker;
|
|
105
|
+
}
|
|
106
|
+
mergeRequestParams(params1, params2) {
|
|
107
|
+
const method = params1.method || (params2 && params2.method);
|
|
108
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, this.instance.defaults), params1), (params2 || {})), { headers: Object.assign(Object.assign(Object.assign({}, ((method &&
|
|
109
|
+
this.instance.defaults.headers[method.toLowerCase()]) ||
|
|
110
|
+
{})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
|
|
111
|
+
}
|
|
112
|
+
stringifyFormItem(formItem) {
|
|
113
|
+
if (typeof formItem === "object" && formItem !== null) {
|
|
114
|
+
return JSON.stringify(formItem);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return `${formItem}`;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
createFormData(input) {
|
|
121
|
+
if (input instanceof FormData) {
|
|
122
|
+
return input;
|
|
123
|
+
}
|
|
124
|
+
return Object.keys(input || {}).reduce((formData, key) => {
|
|
125
|
+
const property = input[key];
|
|
126
|
+
const propertyContent = property instanceof Array ? property : [property];
|
|
127
|
+
for (const formItem of propertyContent) {
|
|
128
|
+
const isFileType = formItem instanceof Blob || formItem instanceof File;
|
|
129
|
+
formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
|
|
130
|
+
}
|
|
131
|
+
return formData;
|
|
132
|
+
}, new FormData());
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.HttpClient = HttpClient;
|
|
136
|
+
/**
|
|
137
|
+
* @title flamingo-api
|
|
138
|
+
* @version 0.1.0
|
|
139
|
+
* @baseUrl /api
|
|
140
|
+
*/
|
|
141
|
+
class Api extends HttpClient {
|
|
142
|
+
constructor() {
|
|
143
|
+
super(...arguments);
|
|
144
|
+
this.workspaces = {
|
|
145
|
+
/**
|
|
146
|
+
* No description
|
|
147
|
+
*
|
|
148
|
+
* @tags Workspaces operations
|
|
149
|
+
* @name GetAllWorkspacesWorkspacesGet
|
|
150
|
+
* @summary Get All Workspaces
|
|
151
|
+
* @request GET:/workspaces
|
|
152
|
+
*/
|
|
153
|
+
getAllWorkspacesWorkspacesGet: (params = {}) => this.request(Object.assign({ path: `/workspaces`, method: "GET", format: "json" }, params)),
|
|
154
|
+
/**
|
|
155
|
+
* @description Used only for auto-testing
|
|
156
|
+
*
|
|
157
|
+
* @tags Workspaces operations
|
|
158
|
+
* @name CreateWorkspaceWorkspacesPost
|
|
159
|
+
* @summary Create Workspace
|
|
160
|
+
* @request POST:/workspaces
|
|
161
|
+
*/
|
|
162
|
+
createWorkspaceWorkspacesPost: (data, params = {}) => this.request(Object.assign({ path: `/workspaces`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
163
|
+
/**
|
|
164
|
+
* @description Used only for auto-testing
|
|
165
|
+
*
|
|
166
|
+
* @tags Workspaces operations
|
|
167
|
+
* @name HardDeleteWorkspaceWorkspacesWorkspaceIdHardDeleteDelete
|
|
168
|
+
* @summary Hard Delete Workspace
|
|
169
|
+
* @request DELETE:/workspaces/{workspaceId}/hard-delete
|
|
170
|
+
*/
|
|
171
|
+
hardDeleteWorkspaceWorkspacesWorkspaceIdHardDeleteDelete: (workspaceId, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/hard-delete`, method: "DELETE", format: "json" }, params)),
|
|
172
|
+
/**
|
|
173
|
+
* No description
|
|
174
|
+
*
|
|
175
|
+
* @tags Sources operations, bound to a particular workspace
|
|
176
|
+
* @name GetAllSourcesOfAWorkspaceWorkspacesWorkspaceIdSourcesGet
|
|
177
|
+
* @summary Get All Sources Of A Workspace
|
|
178
|
+
* @request GET:/workspaces/{workspaceId}/sources
|
|
179
|
+
*/
|
|
180
|
+
getAllSourcesOfAWorkspaceWorkspacesWorkspaceIdSourcesGet: (workspaceId, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/sources`, method: "GET", format: "json" }, params)),
|
|
181
|
+
/**
|
|
182
|
+
* No description
|
|
183
|
+
*
|
|
184
|
+
* @tags Sources operations, bound to a particular workspace
|
|
185
|
+
* @name CreateSourceWorkspacesWorkspaceIdSourcesPost
|
|
186
|
+
* @summary Create Source
|
|
187
|
+
* @request POST:/workspaces/{workspaceId}/sources
|
|
188
|
+
*/
|
|
189
|
+
createSourceWorkspacesWorkspaceIdSourcesPost: (workspaceId, data, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/sources`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
190
|
+
/**
|
|
191
|
+
* No description
|
|
192
|
+
*
|
|
193
|
+
* @tags Sources operations, bound to a particular workspace
|
|
194
|
+
* @name GetOneSourceWorkspacesWorkspaceIdSourcesSourceIdGet
|
|
195
|
+
* @summary Get One Source
|
|
196
|
+
* @request GET:/workspaces/{workspaceId}/sources/{sourceId}
|
|
197
|
+
*/
|
|
198
|
+
getOneSourceWorkspacesWorkspaceIdSourcesSourceIdGet: (workspaceId, sourceId, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/sources/${sourceId}`, method: "GET", format: "json" }, params)),
|
|
199
|
+
/**
|
|
200
|
+
* No description
|
|
201
|
+
*
|
|
202
|
+
* @tags Sources operations, bound to a particular workspace
|
|
203
|
+
* @name UpdateSourceWorkspacesWorkspaceIdSourcesSourceIdPost
|
|
204
|
+
* @summary Update Source
|
|
205
|
+
* @request POST:/workspaces/{workspaceId}/sources/{sourceId}
|
|
206
|
+
*/
|
|
207
|
+
updateSourceWorkspacesWorkspaceIdSourcesSourceIdPost: (workspaceId, sourceId, data, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/sources/${sourceId}`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
208
|
+
/**
|
|
209
|
+
* No description
|
|
210
|
+
*
|
|
211
|
+
* @tags Sources operations, bound to a particular workspace
|
|
212
|
+
* @name ForceSyncSourceWorkspacesWorkspaceIdSourcesSourceIdForceSyncPost
|
|
213
|
+
* @summary Force Sync Source
|
|
214
|
+
* @request POST:/workspaces/{workspaceId}/sources/{sourceId}/force-sync
|
|
215
|
+
*/
|
|
216
|
+
forceSyncSourceWorkspacesWorkspaceIdSourcesSourceIdForceSyncPost: (workspaceId, sourceId, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/sources/${sourceId}/force-sync`, method: "POST", format: "json" }, params)),
|
|
217
|
+
/**
|
|
218
|
+
* No description
|
|
219
|
+
*
|
|
220
|
+
* @tags Sources operations, bound to a particular workspace
|
|
221
|
+
* @name SoftDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdSoftDeleteDelete
|
|
222
|
+
* @summary Soft Delete Source
|
|
223
|
+
* @request DELETE:/workspaces/{workspaceId}/sources/{sourceId}/soft-delete
|
|
224
|
+
*/
|
|
225
|
+
softDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdSoftDeleteDelete: (workspaceId, sourceId, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/sources/${sourceId}/soft-delete`, method: "DELETE", format: "json" }, params)),
|
|
226
|
+
/**
|
|
227
|
+
* @description Used only for auto-testing
|
|
228
|
+
*
|
|
229
|
+
* @tags Sources operations, bound to a particular workspace
|
|
230
|
+
* @name HardDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdHardDeleteDelete
|
|
231
|
+
* @summary Hard Delete Source
|
|
232
|
+
* @request DELETE:/workspaces/{workspaceId}/sources/{sourceId}/hard-delete
|
|
233
|
+
*/
|
|
234
|
+
hardDeleteSourceWorkspacesWorkspaceIdSourcesSourceIdHardDeleteDelete: (workspaceId, sourceId, params = {}) => this.request(Object.assign({ path: `/workspaces/${workspaceId}/sources/${sourceId}/hard-delete`, method: "DELETE", format: "json" }, params)),
|
|
235
|
+
};
|
|
236
|
+
this.chats = {
|
|
237
|
+
/**
|
|
238
|
+
* No description
|
|
239
|
+
*
|
|
240
|
+
* @tags Chat operations
|
|
241
|
+
* @name SendMessageToChatChatsChatIdMessagesPost
|
|
242
|
+
* @summary Send Message To Chat
|
|
243
|
+
* @request POST:/chats/{chatId}/messages
|
|
244
|
+
*/
|
|
245
|
+
sendMessageToChatChatsChatIdMessagesPost: (chatId, data, params = {}) => this.request(Object.assign({ path: `/chats/${chatId}/messages`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
246
|
+
/**
|
|
247
|
+
* @description Used only for running the evaluation against this API
|
|
248
|
+
*
|
|
249
|
+
* @tags Chat operations
|
|
250
|
+
* @name SendMessageToChatFromEvaluationChatsSendMessageFromEvaluationPost
|
|
251
|
+
* @summary Send Message To Chat From Evaluation
|
|
252
|
+
* @request POST:/chats/send-message-from-evaluation
|
|
253
|
+
*/
|
|
254
|
+
sendMessageToChatFromEvaluationChatsSendMessageFromEvaluationPost: (data, params = {}) => this.request(Object.assign({ path: `/chats/send-message-from-evaluation`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
255
|
+
/**
|
|
256
|
+
* No description
|
|
257
|
+
*
|
|
258
|
+
* @tags Chat operations
|
|
259
|
+
* @name GivePositiveFeedbackToAnswerChatsChatIdMessagesMessageIdGivePositiveFeedbackToAnswerPost
|
|
260
|
+
* @summary Give Positive Feedback To Answer
|
|
261
|
+
* @request POST:/chats/{chatId}/messages/{messageId}/give-positive-feedback-to-answer
|
|
262
|
+
*/
|
|
263
|
+
givePositiveFeedbackToAnswerChatsChatIdMessagesMessageIdGivePositiveFeedbackToAnswerPost: (chatId, messageId, params = {}) => this.request(Object.assign({ path: `/chats/${chatId}/messages/${messageId}/give-positive-feedback-to-answer`, method: "POST", format: "json" }, params)),
|
|
264
|
+
};
|
|
265
|
+
this.chatsChatId = {
|
|
266
|
+
/**
|
|
267
|
+
* No description
|
|
268
|
+
*
|
|
269
|
+
* @tags Chat operations
|
|
270
|
+
* @name GiveNegativeFeedbackToAnswerChatsChatIdMessagesMessageIdGiveNegativeFeedbackToAnswerPost
|
|
271
|
+
* @summary Give Negative Feedback To Answer
|
|
272
|
+
* @request POST:/chats{chatId}/messages/{messageId}/give-negative-feedback-to-answer
|
|
273
|
+
*/
|
|
274
|
+
giveNegativeFeedbackToAnswerChatsChatIdMessagesMessageIdGiveNegativeFeedbackToAnswerPost: (chatId, messageId, data, params = {}) => this.request(Object.assign({ path: `/chats${chatId}/messages/${messageId}/give-negative-feedback-to-answer`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
exports.Api = Api;
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tourmalinecore/flamingo-api-js-client",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Client for flamingo-api that provides TypeScript types and client to make network calls from JavaScript.",
|
|
5
|
+
"homepage": "https://github.com/TourmalineCore/flamingo-api#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/TourmalineCore/flamingo-api/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/TourmalineCore/flamingo-api.git"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "TourmalineCore",
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.2.2"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"axios": ">=1.8.2"
|
|
27
|
+
}
|
|
28
|
+
}
|