graphlit-client 1.0.20250531004 → 1.0.20250610001
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/CHANGELOG.md +64 -0
- package/README.md +441 -53
- package/dist/client.d.ts +128 -3
- package/dist/client.js +1616 -1567
- package/dist/generated/graphql-documents.d.ts +1 -0
- package/dist/generated/graphql-documents.js +376 -312
- package/dist/generated/graphql-types.d.ts +211 -23
- package/dist/generated/graphql-types.js +299 -246
- package/dist/model-mapping.d.ts +18 -0
- package/dist/model-mapping.js +95 -0
- package/dist/stream-helpers.d.ts +106 -0
- package/dist/stream-helpers.js +237 -0
- package/dist/streaming/chunk-buffer.d.ts +25 -0
- package/dist/streaming/chunk-buffer.js +170 -0
- package/dist/streaming/llm-formatters.d.ts +64 -0
- package/dist/streaming/llm-formatters.js +187 -0
- package/dist/streaming/providers.d.ts +18 -0
- package/dist/streaming/providers.js +353 -0
- package/dist/streaming/ui-event-adapter.d.ts +52 -0
- package/dist/streaming/ui-event-adapter.js +288 -0
- package/dist/types/agent.d.ts +39 -0
- package/dist/types/agent.js +1 -0
- package/dist/types/streaming.d.ts +58 -0
- package/dist/types/streaming.js +7 -0
- package/dist/types/ui-events.d.ts +38 -0
- package/dist/types/ui-events.js +1 -0
- package/package.json +32 -5
package/dist/client.js
CHANGED
@@ -1,56 +1,83 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
1
|
+
import * as jwt from "jsonwebtoken";
|
2
|
+
import { ApolloClient, InMemoryCache, createHttpLink, ApolloLink, ApolloError, } from "@apollo/client/core";
|
3
|
+
import * as Types from "./generated/graphql-types.js";
|
4
|
+
import * as Documents from "./generated/graphql-documents.js";
|
5
|
+
import * as dotenv from "dotenv";
|
6
|
+
import { getServiceType, } from "./model-mapping.js";
|
7
|
+
import { UIEventAdapter } from "./streaming/ui-event-adapter.js";
|
8
|
+
import { formatMessagesForOpenAI, formatMessagesForAnthropic, formatMessagesForGoogle, } from "./streaming/llm-formatters.js";
|
9
|
+
import { streamWithOpenAI, streamWithAnthropic, streamWithGoogle, } from "./streaming/providers.js";
|
10
|
+
// Optional imports for streaming LLM clients
|
11
|
+
// These are peer dependencies and may not be installed
|
12
|
+
let OpenAI;
|
13
|
+
let Anthropic;
|
14
|
+
let GoogleGenerativeAI;
|
15
|
+
try {
|
16
|
+
OpenAI = require("openai").default || require("openai");
|
17
|
+
}
|
18
|
+
catch (e) {
|
19
|
+
// OpenAI not installed
|
20
|
+
}
|
21
|
+
try {
|
22
|
+
Anthropic =
|
23
|
+
require("@anthropic-ai/sdk").default || require("@anthropic-ai/sdk");
|
24
|
+
}
|
25
|
+
catch (e) {
|
26
|
+
// Anthropic SDK not installed
|
27
|
+
}
|
28
|
+
try {
|
29
|
+
GoogleGenerativeAI = require("@google/generative-ai").GoogleGenerativeAI;
|
30
|
+
}
|
31
|
+
catch (e) {
|
32
|
+
// Google Generative AI not installed
|
33
|
+
}
|
34
|
+
// Provider categorization for streaming capabilities
|
35
|
+
const STREAMING_PROVIDERS = {
|
36
|
+
// Native streaming with dedicated SDKs
|
37
|
+
NATIVE: [
|
38
|
+
Types.ModelServiceTypes.OpenAi,
|
39
|
+
Types.ModelServiceTypes.Anthropic,
|
40
|
+
Types.ModelServiceTypes.Google,
|
41
|
+
],
|
42
|
+
// OpenAI-compatible streaming (use OpenAI SDK)
|
43
|
+
OPENAI_COMPATIBLE: [
|
44
|
+
Types.ModelServiceTypes.Groq,
|
45
|
+
Types.ModelServiceTypes.Cerebras,
|
46
|
+
Types.ModelServiceTypes.Mistral,
|
47
|
+
Types.ModelServiceTypes.Deepseek,
|
48
|
+
],
|
49
|
+
// May require fallback simulation
|
50
|
+
FALLBACK_CANDIDATES: [
|
51
|
+
Types.ModelServiceTypes.AzureAi,
|
52
|
+
Types.ModelServiceTypes.AzureOpenAi,
|
53
|
+
Types.ModelServiceTypes.Cohere,
|
54
|
+
Types.ModelServiceTypes.Bedrock,
|
55
|
+
Types.ModelServiceTypes.Jina,
|
56
|
+
Types.ModelServiceTypes.Replicate,
|
57
|
+
Types.ModelServiceTypes.Voyage,
|
58
|
+
],
|
43
59
|
};
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
45
|
-
exports.Types = exports.Graphlit = void 0;
|
46
|
-
const jwt = __importStar(require("jsonwebtoken"));
|
47
|
-
const core_1 = require("@apollo/client/core");
|
48
|
-
const Documents = __importStar(require("./generated/graphql-documents.js"));
|
49
|
-
const dotenv = __importStar(require("dotenv"));
|
50
60
|
// Define the Graphlit class
|
51
61
|
class Graphlit {
|
62
|
+
client;
|
63
|
+
token;
|
64
|
+
apiUri;
|
65
|
+
organizationId;
|
66
|
+
environmentId;
|
67
|
+
ownerId;
|
68
|
+
userId;
|
69
|
+
jwtSecret;
|
70
|
+
// Streaming client instances (optional - can be provided by user)
|
71
|
+
openaiClient;
|
72
|
+
anthropicClient;
|
73
|
+
googleClient;
|
52
74
|
constructor(organizationId, environmentId, jwtSecret, ownerId, userId, apiUri) {
|
53
|
-
this.apiUri =
|
75
|
+
this.apiUri =
|
76
|
+
apiUri ||
|
77
|
+
(typeof process !== "undefined"
|
78
|
+
? process.env.GRAPHLIT_API_URL
|
79
|
+
: undefined) ||
|
80
|
+
"https://data-scus.graphlit.io/api/v1/graphql";
|
54
81
|
if (typeof process !== "undefined") {
|
55
82
|
dotenv.config();
|
56
83
|
this.organizationId =
|
@@ -83,10 +110,10 @@ class Graphlit {
|
|
83
110
|
refreshClient() {
|
84
111
|
this.client = undefined;
|
85
112
|
this.generateToken();
|
86
|
-
const httpLink =
|
113
|
+
const httpLink = createHttpLink({
|
87
114
|
uri: this.apiUri,
|
88
115
|
});
|
89
|
-
const authLink = new
|
116
|
+
const authLink = new ApolloLink((operation, forward) => {
|
90
117
|
operation.setContext({
|
91
118
|
headers: {
|
92
119
|
Authorization: this.token ? `Bearer ${this.token}` : "",
|
@@ -94,9 +121,9 @@ class Graphlit {
|
|
94
121
|
});
|
95
122
|
return forward(operation);
|
96
123
|
});
|
97
|
-
this.client = new
|
124
|
+
this.client = new ApolloClient({
|
98
125
|
link: authLink.concat(httpLink),
|
99
|
-
cache: new
|
126
|
+
cache: new InMemoryCache(),
|
100
127
|
defaultOptions: {
|
101
128
|
watchQuery: {
|
102
129
|
errorPolicy: "all",
|
@@ -113,1790 +140,1814 @@ class Graphlit {
|
|
113
140
|
},
|
114
141
|
});
|
115
142
|
}
|
143
|
+
/**
|
144
|
+
* Set a custom OpenAI client instance for streaming
|
145
|
+
* @param client - OpenAI client instance (e.g., new OpenAI({ apiKey: "..." }))
|
146
|
+
*/
|
147
|
+
setOpenAIClient(client) {
|
148
|
+
this.openaiClient = client;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* Set a custom Anthropic client instance for streaming
|
152
|
+
* @param client - Anthropic client instance (e.g., new Anthropic({ apiKey: "..." }))
|
153
|
+
*/
|
154
|
+
setAnthropicClient(client) {
|
155
|
+
this.anthropicClient = client;
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Set a custom Google Generative AI client instance for streaming
|
159
|
+
* @param client - Google GenerativeAI client instance (e.g., new GoogleGenerativeAI(apiKey))
|
160
|
+
*/
|
161
|
+
setGoogleClient(client) {
|
162
|
+
this.googleClient = client;
|
163
|
+
}
|
116
164
|
generateToken() {
|
117
165
|
if (!this.jwtSecret) {
|
118
166
|
throw new Error("Graphlit environment JWT secret is required.");
|
119
167
|
}
|
120
168
|
const expiration = Math.floor(Date.now() / 1000) + 24 * 60 * 60; // one day from now
|
121
169
|
const payload = {
|
122
|
-
"https://graphlit.io/jwt/claims":
|
170
|
+
"https://graphlit.io/jwt/claims": {
|
171
|
+
"x-graphlit-organization-id": this.organizationId,
|
172
|
+
"x-graphlit-environment-id": this.environmentId,
|
173
|
+
...(this.ownerId && { "x-graphlit-owner-id": this.ownerId }),
|
174
|
+
...(this.userId && { "x-graphlit-user-id": this.userId }),
|
175
|
+
"x-graphlit-role": "Owner",
|
176
|
+
},
|
123
177
|
exp: expiration,
|
124
178
|
iss: "graphlit",
|
125
179
|
aud: "https://portal.graphlit.io",
|
126
180
|
};
|
127
181
|
this.token = jwt.sign(payload, this.jwtSecret, { algorithm: "HS256" });
|
128
182
|
}
|
129
|
-
getProject() {
|
130
|
-
return
|
131
|
-
return this.queryAndCheckError(Documents.GetProject, {});
|
132
|
-
});
|
183
|
+
async getProject() {
|
184
|
+
return this.queryAndCheckError(Documents.GetProject, {});
|
133
185
|
}
|
134
|
-
updateProject(project) {
|
135
|
-
return
|
136
|
-
return this.mutateAndCheckError(Documents.UpdateProject, { project: project });
|
137
|
-
});
|
186
|
+
async updateProject(project) {
|
187
|
+
return this.mutateAndCheckError(Documents.UpdateProject, { project: project });
|
138
188
|
}
|
139
|
-
lookupProjectUsage(correlationId) {
|
140
|
-
return
|
141
|
-
return this.queryAndCheckError(Documents.LookupUsage, { correlationId: correlationId });
|
142
|
-
});
|
189
|
+
async lookupProjectUsage(correlationId) {
|
190
|
+
return this.queryAndCheckError(Documents.LookupUsage, { correlationId: correlationId });
|
143
191
|
}
|
144
|
-
lookupProjectCredits(correlationId) {
|
145
|
-
return
|
146
|
-
return this.queryAndCheckError(Documents.LookupCredits, { correlationId: correlationId });
|
147
|
-
});
|
192
|
+
async lookupProjectCredits(correlationId) {
|
193
|
+
return this.queryAndCheckError(Documents.LookupCredits, { correlationId: correlationId });
|
148
194
|
}
|
149
|
-
queryProjectTokens(startDate, duration) {
|
150
|
-
return
|
151
|
-
return this.queryAndCheckError(Documents.QueryTokens, { startDate: startDate, duration: duration });
|
152
|
-
});
|
195
|
+
async queryProjectTokens(startDate, duration) {
|
196
|
+
return this.queryAndCheckError(Documents.QueryTokens, { startDate: startDate, duration: duration });
|
153
197
|
}
|
154
|
-
queryProjectUsage(startDate, duration, names, excludedNames, offset, limit) {
|
155
|
-
return
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
limit: limit,
|
163
|
-
});
|
198
|
+
async queryProjectUsage(startDate, duration, names, excludedNames, offset, limit) {
|
199
|
+
return this.queryAndCheckError(Documents.QueryUsage, {
|
200
|
+
startDate: startDate,
|
201
|
+
duration: duration,
|
202
|
+
names: names,
|
203
|
+
excludedNames: excludedNames,
|
204
|
+
offset: offset,
|
205
|
+
limit: limit,
|
164
206
|
});
|
165
207
|
}
|
166
|
-
queryProjectCredits(startDate, duration) {
|
167
|
-
return
|
168
|
-
return this.queryAndCheckError(Documents.QueryCredits, { startDate: startDate, duration: duration });
|
169
|
-
});
|
208
|
+
async queryProjectCredits(startDate, duration) {
|
209
|
+
return this.queryAndCheckError(Documents.QueryCredits, { startDate: startDate, duration: duration });
|
170
210
|
}
|
171
|
-
sendNotification(connector, text, textType) {
|
172
|
-
return
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
textType: textType,
|
177
|
-
});
|
211
|
+
async sendNotification(connector, text, textType) {
|
212
|
+
return this.mutateAndCheckError(Documents.SendNotification, {
|
213
|
+
connector: connector,
|
214
|
+
text: text,
|
215
|
+
textType: textType,
|
178
216
|
});
|
179
217
|
}
|
180
|
-
mapWeb(uri, allowedPaths, excludedPaths, correlationId) {
|
181
|
-
return
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
correlationId: correlationId,
|
187
|
-
});
|
218
|
+
async mapWeb(uri, allowedPaths, excludedPaths, correlationId) {
|
219
|
+
return this.queryAndCheckError(Documents.MapWeb, {
|
220
|
+
uri: uri,
|
221
|
+
allowedPaths: allowedPaths,
|
222
|
+
excludedPaths: excludedPaths,
|
223
|
+
correlationId: correlationId,
|
188
224
|
});
|
189
225
|
}
|
190
|
-
searchWeb(text, service, limit, correlationId) {
|
191
|
-
return
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
correlationId: correlationId,
|
197
|
-
});
|
226
|
+
async searchWeb(text, service, limit, correlationId) {
|
227
|
+
return this.queryAndCheckError(Documents.SearchWeb, {
|
228
|
+
text: text,
|
229
|
+
service: service,
|
230
|
+
limit: limit,
|
231
|
+
correlationId: correlationId,
|
198
232
|
});
|
199
233
|
}
|
200
|
-
createAlert(alert, correlationId) {
|
201
|
-
return
|
202
|
-
return this.mutateAndCheckError(Documents.CreateAlert, { alert: alert, correlationId: correlationId });
|
203
|
-
});
|
234
|
+
async createAlert(alert, correlationId) {
|
235
|
+
return this.mutateAndCheckError(Documents.CreateAlert, { alert: alert, correlationId: correlationId });
|
204
236
|
}
|
205
|
-
updateAlert(alert) {
|
206
|
-
return
|
207
|
-
return this.mutateAndCheckError(Documents.UpdateAlert, { alert: alert });
|
208
|
-
});
|
237
|
+
async updateAlert(alert) {
|
238
|
+
return this.mutateAndCheckError(Documents.UpdateAlert, { alert: alert });
|
209
239
|
}
|
210
|
-
deleteAlert(id) {
|
211
|
-
return
|
212
|
-
return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
|
213
|
-
});
|
240
|
+
async deleteAlert(id) {
|
241
|
+
return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
|
214
242
|
}
|
215
|
-
deleteAlerts(ids, isSynchronous) {
|
216
|
-
return
|
217
|
-
return this.mutateAndCheckError(Documents.DeleteAlerts, { ids: ids, isSynchronous: isSynchronous });
|
218
|
-
});
|
243
|
+
async deleteAlerts(ids, isSynchronous) {
|
244
|
+
return this.mutateAndCheckError(Documents.DeleteAlerts, { ids: ids, isSynchronous: isSynchronous });
|
219
245
|
}
|
220
|
-
deleteAllAlerts(filter, isSynchronous, correlationId) {
|
221
|
-
return
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
correlationId: correlationId,
|
226
|
-
});
|
246
|
+
async deleteAllAlerts(filter, isSynchronous, correlationId) {
|
247
|
+
return this.mutateAndCheckError(Documents.DeleteAllAlerts, {
|
248
|
+
filter: filter,
|
249
|
+
isSynchronous: isSynchronous,
|
250
|
+
correlationId: correlationId,
|
227
251
|
});
|
228
252
|
}
|
229
|
-
enableAlert(id) {
|
230
|
-
return
|
231
|
-
return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
|
232
|
-
});
|
253
|
+
async enableAlert(id) {
|
254
|
+
return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
|
233
255
|
}
|
234
|
-
disableAlert(id) {
|
235
|
-
return
|
236
|
-
return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
|
237
|
-
});
|
256
|
+
async disableAlert(id) {
|
257
|
+
return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
|
238
258
|
}
|
239
|
-
getAlert(id) {
|
240
|
-
return
|
241
|
-
return this.queryAndCheckError(Documents.GetAlert, { id: id });
|
242
|
-
});
|
259
|
+
async getAlert(id) {
|
260
|
+
return this.queryAndCheckError(Documents.GetAlert, { id: id });
|
243
261
|
}
|
244
|
-
queryAlerts(filter) {
|
245
|
-
return
|
246
|
-
return this.queryAndCheckError(Documents.QueryAlerts, { filter: filter });
|
247
|
-
});
|
262
|
+
async queryAlerts(filter) {
|
263
|
+
return this.queryAndCheckError(Documents.QueryAlerts, { filter: filter });
|
248
264
|
}
|
249
|
-
countAlerts(filter) {
|
250
|
-
return
|
251
|
-
return this.queryAndCheckError(Documents.CountAlerts, { filter: filter });
|
252
|
-
});
|
265
|
+
async countAlerts(filter) {
|
266
|
+
return this.queryAndCheckError(Documents.CountAlerts, { filter: filter });
|
253
267
|
}
|
254
|
-
createCollection(collection) {
|
255
|
-
return
|
256
|
-
return this.mutateAndCheckError(Documents.CreateCollection, { collection: collection });
|
257
|
-
});
|
268
|
+
async createCollection(collection) {
|
269
|
+
return this.mutateAndCheckError(Documents.CreateCollection, { collection: collection });
|
258
270
|
}
|
259
|
-
updateCollection(collection) {
|
260
|
-
return
|
261
|
-
return this.mutateAndCheckError(Documents.UpdateCollection, { collection: collection });
|
262
|
-
});
|
271
|
+
async updateCollection(collection) {
|
272
|
+
return this.mutateAndCheckError(Documents.UpdateCollection, { collection: collection });
|
263
273
|
}
|
264
|
-
deleteCollection(id) {
|
265
|
-
return
|
266
|
-
return this.mutateAndCheckError(Documents.DeleteCollection, { id: id });
|
267
|
-
});
|
274
|
+
async deleteCollection(id) {
|
275
|
+
return this.mutateAndCheckError(Documents.DeleteCollection, { id: id });
|
268
276
|
}
|
269
|
-
deleteCollections(ids, isSynchronous) {
|
270
|
-
return
|
271
|
-
return this.mutateAndCheckError(Documents.DeleteCollections, { ids: ids, isSynchronous: isSynchronous });
|
272
|
-
});
|
277
|
+
async deleteCollections(ids, isSynchronous) {
|
278
|
+
return this.mutateAndCheckError(Documents.DeleteCollections, { ids: ids, isSynchronous: isSynchronous });
|
273
279
|
}
|
274
|
-
deleteAllCollections(filter, isSynchronous, correlationId) {
|
275
|
-
return
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
correlationId: correlationId,
|
280
|
-
});
|
280
|
+
async deleteAllCollections(filter, isSynchronous, correlationId) {
|
281
|
+
return this.mutateAndCheckError(Documents.DeleteAllCollections, {
|
282
|
+
filter: filter,
|
283
|
+
isSynchronous: isSynchronous,
|
284
|
+
correlationId: correlationId,
|
281
285
|
});
|
282
286
|
}
|
283
|
-
addContentsToCollections(contents, collections) {
|
284
|
-
return
|
285
|
-
|
286
|
-
|
287
|
-
collections: collections,
|
288
|
-
});
|
287
|
+
async addContentsToCollections(contents, collections) {
|
288
|
+
return this.mutateAndCheckError(Documents.AddContentsToCollections, {
|
289
|
+
contents: contents,
|
290
|
+
collections: collections,
|
289
291
|
});
|
290
292
|
}
|
291
|
-
removeContentsFromCollection(contents, collection) {
|
292
|
-
return
|
293
|
-
|
294
|
-
|
295
|
-
collection: collection,
|
296
|
-
});
|
293
|
+
async removeContentsFromCollection(contents, collection) {
|
294
|
+
return this.mutateAndCheckError(Documents.RemoveContentsFromCollection, {
|
295
|
+
contents: contents,
|
296
|
+
collection: collection,
|
297
297
|
});
|
298
298
|
}
|
299
|
-
getCollection(id) {
|
300
|
-
return
|
301
|
-
return this.queryAndCheckError(Documents.GetCollection, { id: id });
|
302
|
-
});
|
299
|
+
async getCollection(id) {
|
300
|
+
return this.queryAndCheckError(Documents.GetCollection, { id: id });
|
303
301
|
}
|
304
|
-
queryCollections(filter) {
|
305
|
-
return
|
306
|
-
return this.queryAndCheckError(Documents.QueryCollections, { filter: filter });
|
307
|
-
});
|
302
|
+
async queryCollections(filter) {
|
303
|
+
return this.queryAndCheckError(Documents.QueryCollections, { filter: filter });
|
308
304
|
}
|
309
|
-
countCollections(filter) {
|
310
|
-
return
|
311
|
-
return this.queryAndCheckError(Documents.CountCollections, { filter: filter });
|
312
|
-
});
|
305
|
+
async countCollections(filter) {
|
306
|
+
return this.queryAndCheckError(Documents.CountCollections, { filter: filter });
|
313
307
|
}
|
314
|
-
describeImage(prompt, uri, specification, correlationId) {
|
315
|
-
return
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
correlationId: correlationId,
|
321
|
-
});
|
308
|
+
async describeImage(prompt, uri, specification, correlationId) {
|
309
|
+
return this.mutateAndCheckError(Documents.DescribeImage, {
|
310
|
+
prompt: prompt,
|
311
|
+
uri: uri,
|
312
|
+
specification: specification,
|
313
|
+
correlationId: correlationId,
|
322
314
|
});
|
323
315
|
}
|
324
|
-
describeEncodedImage(prompt, mimeType, data, specification, correlationId) {
|
325
|
-
return
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
correlationId: correlationId,
|
332
|
-
});
|
316
|
+
async describeEncodedImage(prompt, mimeType, data, specification, correlationId) {
|
317
|
+
return this.mutateAndCheckError(Documents.DescribeEncodedImage, {
|
318
|
+
prompt: prompt,
|
319
|
+
mimeType: mimeType,
|
320
|
+
data: data,
|
321
|
+
specification: specification,
|
322
|
+
correlationId: correlationId,
|
333
323
|
});
|
334
324
|
}
|
335
|
-
screenshotPage(uri, maximumHeight, isSynchronous, workflow, collections, correlationId) {
|
336
|
-
return
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
correlationId: correlationId,
|
344
|
-
});
|
325
|
+
async screenshotPage(uri, maximumHeight, isSynchronous, workflow, collections, correlationId) {
|
326
|
+
return this.mutateAndCheckError(Documents.ScreenshotPage, {
|
327
|
+
uri: uri,
|
328
|
+
maximumHeight: maximumHeight,
|
329
|
+
isSynchronous: isSynchronous,
|
330
|
+
workflow: workflow,
|
331
|
+
collections: collections,
|
332
|
+
correlationId: correlationId,
|
345
333
|
});
|
346
|
-
}
|
347
|
-
ingestTextBatch(batch, textType, collections, observations, correlationId) {
|
348
|
-
return
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
334
|
+
}
|
335
|
+
async ingestTextBatch(batch, textType, collections, observations, correlationId) {
|
336
|
+
return this.mutateAndCheckError(Documents.IngestTextBatch, {
|
337
|
+
batch: batch,
|
338
|
+
textType: textType,
|
339
|
+
collections: collections,
|
340
|
+
observations: observations,
|
341
|
+
correlationId: correlationId,
|
342
|
+
});
|
343
|
+
}
|
344
|
+
async ingestBatch(uris, workflow, collections, observations, correlationId) {
|
345
|
+
return this.mutateAndCheckError(Documents.IngestBatch, {
|
346
|
+
uris: uris,
|
347
|
+
workflow: workflow,
|
348
|
+
collections: collections,
|
349
|
+
observations: observations,
|
350
|
+
correlationId: correlationId,
|
351
|
+
});
|
352
|
+
}
|
353
|
+
async ingestUri(uri, name, id, isSynchronous, workflow, collections, observations, correlationId) {
|
354
|
+
return this.mutateAndCheckError(Documents.IngestUri, {
|
355
|
+
uri: uri,
|
356
|
+
name: name,
|
357
|
+
id: id,
|
358
|
+
isSynchronous: isSynchronous,
|
359
|
+
workflow: workflow,
|
360
|
+
collections: collections,
|
361
|
+
observations: observations,
|
362
|
+
correlationId: correlationId,
|
363
|
+
});
|
364
|
+
}
|
365
|
+
async ingestText(text, name, textType, uri, id, isSynchronous, workflow, collections, observations, correlationId) {
|
366
|
+
return this.mutateAndCheckError(Documents.IngestText, {
|
367
|
+
name: name,
|
368
|
+
text: text,
|
369
|
+
textType: textType,
|
370
|
+
uri: uri,
|
371
|
+
id: id,
|
372
|
+
isSynchronous: isSynchronous,
|
373
|
+
workflow: workflow,
|
374
|
+
collections: collections,
|
375
|
+
observations: observations,
|
376
|
+
correlationId: correlationId,
|
377
|
+
});
|
378
|
+
}
|
379
|
+
async ingestMemory(text, name, textType, id, collections, correlationId) {
|
380
|
+
return this.mutateAndCheckError(Documents.IngestMemory, {
|
381
|
+
name: name,
|
382
|
+
text: text,
|
383
|
+
textType: textType,
|
384
|
+
id: id,
|
385
|
+
collections: collections,
|
386
|
+
correlationId: correlationId,
|
387
|
+
});
|
388
|
+
}
|
389
|
+
async ingestEvent(markdown, name, description, eventDate, id, collections, correlationId) {
|
390
|
+
return this.mutateAndCheckError(Documents.IngestEvent, {
|
391
|
+
name: name,
|
392
|
+
markdown: markdown,
|
393
|
+
description: description,
|
394
|
+
eventDate: eventDate,
|
395
|
+
id: id,
|
396
|
+
collections: collections,
|
397
|
+
correlationId: correlationId,
|
398
|
+
});
|
399
|
+
}
|
400
|
+
async ingestEncodedFile(name, data, mimeType, fileCreationDate, fileModifiedDate, id, isSynchronous, workflow, collections, observations, correlationId) {
|
401
|
+
return this.mutateAndCheckError(Documents.IngestEncodedFile, {
|
402
|
+
name: name,
|
403
|
+
data: data,
|
404
|
+
mimeType: mimeType,
|
405
|
+
fileCreationDate: fileCreationDate,
|
406
|
+
fileModifiedDate: fileModifiedDate,
|
407
|
+
id: id,
|
408
|
+
isSynchronous: isSynchronous,
|
409
|
+
workflow: workflow,
|
410
|
+
collections: collections,
|
411
|
+
observations: observations,
|
412
|
+
correlationId: correlationId,
|
413
|
+
});
|
414
|
+
}
|
415
|
+
async updateContent(content) {
|
416
|
+
return this.mutateAndCheckError(Documents.UpdateContent, { content: content });
|
417
|
+
}
|
418
|
+
async deleteContent(id) {
|
419
|
+
return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
|
420
|
+
}
|
421
|
+
async deleteContents(ids, isSynchronous) {
|
422
|
+
return this.mutateAndCheckError(Documents.DeleteContents, { ids: ids, isSynchronous: isSynchronous });
|
423
|
+
}
|
424
|
+
async deleteAllContents(filter, isSynchronous, correlationId) {
|
425
|
+
return this.mutateAndCheckError(Documents.DeleteAllContents, {
|
426
|
+
filter: filter,
|
427
|
+
isSynchronous: isSynchronous,
|
428
|
+
correlationId: correlationId,
|
429
|
+
});
|
430
|
+
}
|
431
|
+
async summarizeText(summarization, text, textType, correlationId) {
|
432
|
+
return this.mutateAndCheckError(Documents.SummarizeText, {
|
433
|
+
summarization: summarization,
|
434
|
+
text: text,
|
435
|
+
textType: textType,
|
436
|
+
correlationId: correlationId,
|
437
|
+
});
|
438
|
+
}
|
439
|
+
async summarizeContents(summarizations, filter, correlationId) {
|
440
|
+
return this.mutateAndCheckError(Documents.SummarizeContents, {
|
441
|
+
summarizations: summarizations,
|
442
|
+
filter: filter,
|
443
|
+
correlationId: correlationId,
|
444
|
+
});
|
445
|
+
}
|
446
|
+
async extractText(prompt, text, tools, specification, textType, correlationId) {
|
447
|
+
return this.mutateAndCheckError(Documents.ExtractText, {
|
448
|
+
prompt: prompt,
|
449
|
+
text: text,
|
450
|
+
textType: textType,
|
451
|
+
specification: specification,
|
452
|
+
tools: tools,
|
453
|
+
correlationId: correlationId,
|
454
|
+
});
|
455
|
+
}
|
456
|
+
async extractContents(prompt, tools, specification, filter, correlationId) {
|
457
|
+
return this.mutateAndCheckError(Documents.ExtractContents, {
|
458
|
+
prompt: prompt,
|
459
|
+
filter: filter,
|
460
|
+
specification: specification,
|
461
|
+
tools: tools,
|
462
|
+
correlationId: correlationId,
|
463
|
+
});
|
464
|
+
}
|
465
|
+
async publishContents(publishPrompt, connector, summaryPrompt, summarySpecification, publishSpecification, name, filter, workflow, isSynchronous, includeDetails, correlationId) {
|
466
|
+
return this.mutateAndCheckError(Documents.PublishContents, {
|
467
|
+
summaryPrompt: summaryPrompt,
|
468
|
+
summarySpecification: summarySpecification,
|
469
|
+
connector: connector,
|
470
|
+
publishPrompt: publishPrompt,
|
471
|
+
publishSpecification: publishSpecification,
|
472
|
+
name: name,
|
473
|
+
filter: filter,
|
474
|
+
workflow: workflow,
|
475
|
+
isSynchronous: isSynchronous,
|
476
|
+
includeDetails: includeDetails,
|
477
|
+
correlationId: correlationId,
|
478
|
+
});
|
479
|
+
}
|
480
|
+
async publishText(text, textType, connector, name, workflow, isSynchronous, correlationId) {
|
481
|
+
return this.mutateAndCheckError(Documents.PublishText, {
|
482
|
+
text: text,
|
483
|
+
textType: textType,
|
484
|
+
connector: connector,
|
485
|
+
name: name,
|
486
|
+
workflow: workflow,
|
487
|
+
isSynchronous: isSynchronous,
|
488
|
+
correlationId: correlationId,
|
489
|
+
});
|
490
|
+
}
|
491
|
+
async getContent(id) {
|
492
|
+
return this.queryAndCheckError(Documents.GetContent, { id: id });
|
493
|
+
}
|
494
|
+
async queryContents(filter) {
|
495
|
+
return this.queryAndCheckError(Documents.QueryContents, { filter: filter });
|
496
|
+
}
|
497
|
+
async queryContentsFacets(filter) {
|
498
|
+
return this.queryAndCheckError(Documents.QueryContentsFacets, { filter: filter });
|
499
|
+
}
|
500
|
+
async queryContentsGraph(filter) {
|
501
|
+
return this.queryAndCheckError(Documents.QueryContentsGraph, {
|
502
|
+
filter: filter,
|
503
|
+
graph: {
|
504
|
+
/* return everything */
|
505
|
+
},
|
356
506
|
});
|
357
507
|
}
|
358
|
-
|
359
|
-
return
|
360
|
-
return this.mutateAndCheckError(Documents.IngestBatch, {
|
361
|
-
uris: uris,
|
362
|
-
workflow: workflow,
|
363
|
-
collections: collections,
|
364
|
-
observations: observations,
|
365
|
-
correlationId: correlationId,
|
366
|
-
});
|
367
|
-
});
|
508
|
+
async countContents(filter) {
|
509
|
+
return this.queryAndCheckError(Documents.CountContents, { filter: filter });
|
368
510
|
}
|
369
|
-
|
370
|
-
return
|
371
|
-
return this.mutateAndCheckError(Documents.IngestUri, {
|
372
|
-
uri: uri,
|
373
|
-
name: name,
|
374
|
-
id: id,
|
375
|
-
isSynchronous: isSynchronous,
|
376
|
-
workflow: workflow,
|
377
|
-
collections: collections,
|
378
|
-
observations: observations,
|
379
|
-
correlationId: correlationId,
|
380
|
-
});
|
381
|
-
});
|
511
|
+
async isContentDone(id) {
|
512
|
+
return this.queryAndCheckError(Documents.IsContentDone, { id: id });
|
382
513
|
}
|
383
|
-
|
384
|
-
return
|
385
|
-
|
386
|
-
|
387
|
-
text: text,
|
388
|
-
textType: textType,
|
389
|
-
uri: uri,
|
390
|
-
id: id,
|
391
|
-
isSynchronous: isSynchronous,
|
392
|
-
workflow: workflow,
|
393
|
-
collections: collections,
|
394
|
-
observations: observations,
|
395
|
-
correlationId: correlationId,
|
396
|
-
});
|
514
|
+
async createConversation(conversation, correlationId) {
|
515
|
+
return this.mutateAndCheckError(Documents.CreateConversation, {
|
516
|
+
conversation: conversation,
|
517
|
+
correlationId: correlationId,
|
397
518
|
});
|
398
519
|
}
|
399
|
-
|
400
|
-
return
|
401
|
-
return this.mutateAndCheckError(Documents.IngestMemory, {
|
402
|
-
name: name,
|
403
|
-
text: text,
|
404
|
-
textType: textType,
|
405
|
-
collections: collections,
|
406
|
-
correlationId: correlationId,
|
407
|
-
});
|
408
|
-
});
|
520
|
+
async updateConversation(conversation) {
|
521
|
+
return this.mutateAndCheckError(Documents.UpdateConversation, { conversation: conversation });
|
409
522
|
}
|
410
|
-
|
411
|
-
return
|
412
|
-
return this.mutateAndCheckError(Documents.IngestEvent, {
|
413
|
-
name: name,
|
414
|
-
markdown: markdown,
|
415
|
-
description: description,
|
416
|
-
eventDate: eventDate,
|
417
|
-
collections: collections,
|
418
|
-
correlationId: correlationId,
|
419
|
-
});
|
420
|
-
});
|
523
|
+
async deleteConversation(id) {
|
524
|
+
return this.mutateAndCheckError(Documents.DeleteConversation, { id: id });
|
421
525
|
}
|
422
|
-
|
423
|
-
return
|
424
|
-
|
425
|
-
|
426
|
-
data: data,
|
427
|
-
mimeType: mimeType,
|
428
|
-
fileCreationDate: fileCreationDate,
|
429
|
-
fileModifiedDate: fileModifiedDate,
|
430
|
-
id: id,
|
431
|
-
isSynchronous: isSynchronous,
|
432
|
-
workflow: workflow,
|
433
|
-
collections: collections,
|
434
|
-
observations: observations,
|
435
|
-
correlationId: correlationId,
|
436
|
-
});
|
526
|
+
async deleteConversations(ids, isSynchronous) {
|
527
|
+
return this.mutateAndCheckError(Documents.DeleteConversations, {
|
528
|
+
ids: ids,
|
529
|
+
isSynchronous: isSynchronous,
|
437
530
|
});
|
438
531
|
}
|
439
|
-
|
440
|
-
return
|
441
|
-
|
532
|
+
async deleteAllConversations(filter, isSynchronous, correlationId) {
|
533
|
+
return this.mutateAndCheckError(Documents.DeleteAllConversations, {
|
534
|
+
filter: filter,
|
535
|
+
isSynchronous: isSynchronous,
|
536
|
+
correlationId: correlationId,
|
442
537
|
});
|
443
538
|
}
|
444
|
-
|
445
|
-
return
|
446
|
-
return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
|
447
|
-
});
|
539
|
+
async clearConversation(id) {
|
540
|
+
return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
|
448
541
|
}
|
449
|
-
|
450
|
-
return
|
451
|
-
return this.mutateAndCheckError(Documents.DeleteContents, { ids: ids, isSynchronous: isSynchronous });
|
452
|
-
});
|
542
|
+
async closeConversation(id) {
|
543
|
+
return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
|
453
544
|
}
|
454
|
-
|
455
|
-
return
|
456
|
-
return this.mutateAndCheckError(Documents.DeleteAllContents, {
|
457
|
-
filter: filter,
|
458
|
-
isSynchronous: isSynchronous,
|
459
|
-
correlationId: correlationId,
|
460
|
-
});
|
461
|
-
});
|
545
|
+
async getConversation(id) {
|
546
|
+
return this.queryAndCheckError(Documents.GetConversation, { id: id });
|
462
547
|
}
|
463
|
-
|
464
|
-
return
|
465
|
-
return this.mutateAndCheckError(Documents.SummarizeText, {
|
466
|
-
summarization: summarization,
|
467
|
-
text: text,
|
468
|
-
textType: textType,
|
469
|
-
correlationId: correlationId,
|
470
|
-
});
|
471
|
-
});
|
548
|
+
async queryConversations(filter) {
|
549
|
+
return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
|
472
550
|
}
|
473
|
-
|
474
|
-
return
|
475
|
-
return this.mutateAndCheckError(Documents.SummarizeContents, {
|
476
|
-
summarizations: summarizations,
|
477
|
-
filter: filter,
|
478
|
-
correlationId: correlationId,
|
479
|
-
});
|
480
|
-
});
|
551
|
+
async countConversations(filter) {
|
552
|
+
return this.queryAndCheckError(Documents.CountConversations, { filter: filter });
|
481
553
|
}
|
482
|
-
|
483
|
-
return
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
tools: tools,
|
490
|
-
correlationId: correlationId,
|
491
|
-
});
|
554
|
+
async reviseImage(prompt, uri, id, specification, correlationId) {
|
555
|
+
return this.mutateAndCheckError(Documents.ReviseImage, {
|
556
|
+
prompt: prompt,
|
557
|
+
uri: uri,
|
558
|
+
id: id,
|
559
|
+
specification: specification,
|
560
|
+
correlationId: correlationId,
|
492
561
|
});
|
493
562
|
}
|
494
|
-
|
495
|
-
return
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
});
|
563
|
+
async reviseEncodedImage(prompt, mimeType, data, id, specification, correlationId) {
|
564
|
+
return this.mutateAndCheckError(Documents.ReviseEncodedImage, {
|
565
|
+
prompt: prompt,
|
566
|
+
mimeType: mimeType,
|
567
|
+
data: data,
|
568
|
+
id: id,
|
569
|
+
specification: specification,
|
570
|
+
correlationId: correlationId,
|
503
571
|
});
|
504
572
|
}
|
505
|
-
|
506
|
-
return
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
publishSpecification: publishSpecification,
|
513
|
-
name: name,
|
514
|
-
filter: filter,
|
515
|
-
workflow: workflow,
|
516
|
-
isSynchronous: isSynchronous,
|
517
|
-
includeDetails: includeDetails,
|
518
|
-
correlationId: correlationId,
|
519
|
-
});
|
573
|
+
async reviseText(prompt, text, id, specification, correlationId) {
|
574
|
+
return this.mutateAndCheckError(Documents.ReviseText, {
|
575
|
+
prompt: prompt,
|
576
|
+
text: text,
|
577
|
+
id: id,
|
578
|
+
specification: specification,
|
579
|
+
correlationId: correlationId,
|
520
580
|
});
|
521
581
|
}
|
522
|
-
|
523
|
-
return
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
workflow: workflow,
|
530
|
-
isSynchronous: isSynchronous,
|
531
|
-
correlationId: correlationId,
|
532
|
-
});
|
582
|
+
async reviseContent(prompt, content, id, specification, correlationId) {
|
583
|
+
return this.mutateAndCheckError(Documents.ReviseContent, {
|
584
|
+
prompt: prompt,
|
585
|
+
content: content,
|
586
|
+
id: id,
|
587
|
+
specification: specification,
|
588
|
+
correlationId: correlationId,
|
533
589
|
});
|
534
590
|
}
|
535
|
-
|
536
|
-
return
|
537
|
-
|
591
|
+
async prompt(prompt, mimeType, data, specification, messages, correlationId) {
|
592
|
+
return this.mutateAndCheckError(Documents.Prompt, {
|
593
|
+
prompt: prompt,
|
594
|
+
mimeType: mimeType,
|
595
|
+
data: data,
|
596
|
+
specification: specification,
|
597
|
+
messages: messages,
|
598
|
+
correlationId: correlationId,
|
538
599
|
});
|
539
600
|
}
|
540
|
-
|
541
|
-
return
|
542
|
-
|
601
|
+
async retrieveSources(prompt, filter, augmentedFilter, retrievalStrategy, rerankingStrategy, correlationId) {
|
602
|
+
return this.mutateAndCheckError(Documents.RetrieveSources, {
|
603
|
+
prompt: prompt,
|
604
|
+
filter: filter,
|
605
|
+
augmentedFilter: augmentedFilter,
|
606
|
+
retrievalStrategy: retrievalStrategy,
|
607
|
+
rerankingStrategy: rerankingStrategy,
|
608
|
+
correlationId: correlationId,
|
543
609
|
});
|
544
610
|
}
|
545
|
-
|
546
|
-
return
|
547
|
-
|
611
|
+
async formatConversation(prompt, id, specification, tools, includeDetails, correlationId) {
|
612
|
+
return this.mutateAndCheckError(Documents.FormatConversation, {
|
613
|
+
prompt: prompt,
|
614
|
+
id: id,
|
615
|
+
specification: specification,
|
616
|
+
tools: tools,
|
617
|
+
includeDetails: includeDetails,
|
618
|
+
correlationId: correlationId,
|
548
619
|
});
|
549
620
|
}
|
550
|
-
|
551
|
-
return
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
/* return everything */
|
556
|
-
},
|
557
|
-
});
|
621
|
+
async completeConversation(completion, id, correlationId) {
|
622
|
+
return this.mutateAndCheckError(Documents.CompleteConversation, {
|
623
|
+
completion: completion,
|
624
|
+
id: id,
|
625
|
+
correlationId: correlationId,
|
558
626
|
});
|
559
627
|
}
|
560
|
-
|
561
|
-
return
|
562
|
-
|
628
|
+
async askGraphlit(prompt, type, id, specification, correlationId) {
|
629
|
+
return this.mutateAndCheckError(Documents.AskGraphlit, {
|
630
|
+
prompt: prompt,
|
631
|
+
type: type,
|
632
|
+
id: id,
|
633
|
+
specification: specification,
|
634
|
+
correlationId: correlationId,
|
563
635
|
});
|
564
636
|
}
|
565
|
-
|
566
|
-
return
|
567
|
-
|
637
|
+
async promptConversation(prompt, id, specification, mimeType, data, tools, requireTool, includeDetails, correlationId) {
|
638
|
+
return this.mutateAndCheckError(Documents.PromptConversation, {
|
639
|
+
prompt: prompt,
|
640
|
+
id: id,
|
641
|
+
specification: specification,
|
642
|
+
mimeType: mimeType,
|
643
|
+
data: data,
|
644
|
+
tools: tools,
|
645
|
+
requireTool: requireTool,
|
646
|
+
includeDetails: includeDetails,
|
647
|
+
correlationId: correlationId,
|
568
648
|
});
|
569
649
|
}
|
570
|
-
|
571
|
-
return
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
});
|
650
|
+
async continueConversation(id, responses, correlationId) {
|
651
|
+
return this.mutateAndCheckError(Documents.ContinueConversation, {
|
652
|
+
id: id,
|
653
|
+
responses: responses,
|
654
|
+
correlationId: correlationId,
|
576
655
|
});
|
577
656
|
}
|
578
|
-
|
579
|
-
return
|
580
|
-
|
657
|
+
async publishConversation(id, connector, name, workflow, isSynchronous, correlationId) {
|
658
|
+
return this.mutateAndCheckError(Documents.PublishConversation, {
|
659
|
+
id: id,
|
660
|
+
connector: connector,
|
661
|
+
name: name,
|
662
|
+
workflow: workflow,
|
663
|
+
isSynchronous: isSynchronous,
|
664
|
+
correlationId: correlationId,
|
581
665
|
});
|
582
666
|
}
|
583
|
-
|
584
|
-
return
|
585
|
-
|
667
|
+
async suggestConversation(id, count, correlationId) {
|
668
|
+
return this.mutateAndCheckError(Documents.SuggestConversation, {
|
669
|
+
id: id,
|
670
|
+
count: count,
|
671
|
+
correlationId: correlationId,
|
586
672
|
});
|
587
673
|
}
|
588
|
-
|
589
|
-
return
|
590
|
-
|
591
|
-
|
592
|
-
isSynchronous: isSynchronous,
|
593
|
-
});
|
674
|
+
async queryOneDriveFolders(properties, folderId) {
|
675
|
+
return this.queryAndCheckError(Documents.QueryOneDriveFolders, {
|
676
|
+
properties: properties,
|
677
|
+
folderId: folderId,
|
594
678
|
});
|
595
679
|
}
|
596
|
-
|
597
|
-
return
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
correlationId: correlationId,
|
602
|
-
});
|
680
|
+
async querySharePointFolders(properties, libraryId, folderId) {
|
681
|
+
return this.queryAndCheckError(Documents.QuerySharePointFolders, {
|
682
|
+
properties: properties,
|
683
|
+
libraryId: libraryId,
|
684
|
+
folderId: folderId,
|
603
685
|
});
|
604
686
|
}
|
605
|
-
|
606
|
-
return
|
607
|
-
return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
|
608
|
-
});
|
687
|
+
async querySharePointLibraries(properties) {
|
688
|
+
return this.queryAndCheckError(Documents.QuerySharePointLibraries, { properties: properties });
|
609
689
|
}
|
610
|
-
|
611
|
-
return
|
612
|
-
return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
|
613
|
-
});
|
690
|
+
async queryMicrosoftTeamsTeams(properties) {
|
691
|
+
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsTeams, { properties: properties });
|
614
692
|
}
|
615
|
-
|
616
|
-
return
|
617
|
-
|
693
|
+
async queryMicrosoftTeamsChannels(properties, teamId) {
|
694
|
+
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsChannels, {
|
695
|
+
properties: properties,
|
696
|
+
teamId: teamId,
|
618
697
|
});
|
619
698
|
}
|
620
|
-
|
621
|
-
return
|
622
|
-
return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
|
623
|
-
});
|
699
|
+
async querySlackChannels(properties) {
|
700
|
+
return this.queryAndCheckError(Documents.QuerySlackChannels, { properties: properties });
|
624
701
|
}
|
625
|
-
|
626
|
-
return
|
627
|
-
return this.queryAndCheckError(Documents.CountConversations, { filter: filter });
|
628
|
-
});
|
702
|
+
async queryLinearProjects(properties) {
|
703
|
+
return this.queryAndCheckError(Documents.QueryLinearProjects, { properties: properties });
|
629
704
|
}
|
630
|
-
|
631
|
-
return
|
632
|
-
return this.mutateAndCheckError(Documents.ReviseImage, {
|
633
|
-
prompt: prompt,
|
634
|
-
uri: uri,
|
635
|
-
id: id,
|
636
|
-
specification: specification,
|
637
|
-
correlationId: correlationId,
|
638
|
-
});
|
639
|
-
});
|
705
|
+
async queryNotionDatabases(properties) {
|
706
|
+
return this.queryAndCheckError(Documents.QueryNotionDatabases, { properties: properties });
|
640
707
|
}
|
641
|
-
|
642
|
-
return
|
643
|
-
|
644
|
-
|
645
|
-
mimeType: mimeType,
|
646
|
-
data: data,
|
647
|
-
id: id,
|
648
|
-
specification: specification,
|
649
|
-
correlationId: correlationId,
|
650
|
-
});
|
708
|
+
async queryNotionPages(properties, identifier) {
|
709
|
+
return this.queryAndCheckError(Documents.QueryNotionPages, {
|
710
|
+
properties: properties,
|
711
|
+
identifier: identifier,
|
651
712
|
});
|
652
713
|
}
|
653
|
-
|
654
|
-
return
|
655
|
-
return this.mutateAndCheckError(Documents.ReviseText, {
|
656
|
-
prompt: prompt,
|
657
|
-
text: text,
|
658
|
-
id: id,
|
659
|
-
specification: specification,
|
660
|
-
correlationId: correlationId,
|
661
|
-
});
|
662
|
-
});
|
714
|
+
async createFeed(feed, correlationId) {
|
715
|
+
return this.mutateAndCheckError(Documents.CreateFeed, { feed: feed, correlationId: correlationId });
|
663
716
|
}
|
664
|
-
|
665
|
-
return
|
666
|
-
return this.mutateAndCheckError(Documents.ReviseContent, {
|
667
|
-
prompt: prompt,
|
668
|
-
content: content,
|
669
|
-
id: id,
|
670
|
-
specification: specification,
|
671
|
-
correlationId: correlationId,
|
672
|
-
});
|
673
|
-
});
|
717
|
+
async updateFeed(feed) {
|
718
|
+
return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
|
674
719
|
}
|
675
|
-
|
676
|
-
return
|
677
|
-
return this.mutateAndCheckError(Documents.Prompt, {
|
678
|
-
prompt: prompt,
|
679
|
-
mimeType: mimeType,
|
680
|
-
data: data,
|
681
|
-
specification: specification,
|
682
|
-
messages: messages,
|
683
|
-
correlationId: correlationId,
|
684
|
-
});
|
685
|
-
});
|
720
|
+
async deleteFeed(id) {
|
721
|
+
return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
|
686
722
|
}
|
687
|
-
|
688
|
-
return
|
689
|
-
return this.mutateAndCheckError(Documents.RetrieveSources, {
|
690
|
-
prompt: prompt,
|
691
|
-
filter: filter,
|
692
|
-
augmentedFilter: augmentedFilter,
|
693
|
-
retrievalStrategy: retrievalStrategy,
|
694
|
-
rerankingStrategy: rerankingStrategy,
|
695
|
-
correlationId: correlationId,
|
696
|
-
});
|
697
|
-
});
|
723
|
+
async deleteFeeds(ids, isSynchronous) {
|
724
|
+
return this.mutateAndCheckError(Documents.DeleteFeeds, { ids: ids, isSynchronous: isSynchronous });
|
698
725
|
}
|
699
|
-
|
700
|
-
return
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
specification: specification,
|
705
|
-
includeDetails: includeDetails,
|
706
|
-
correlationId: correlationId,
|
707
|
-
});
|
726
|
+
async deleteAllFeeds(filter, isSynchronous, correlationId) {
|
727
|
+
return this.mutateAndCheckError(Documents.DeleteAllFeeds, {
|
728
|
+
filter: filter,
|
729
|
+
isSynchronous: isSynchronous,
|
730
|
+
correlationId: correlationId,
|
708
731
|
});
|
709
732
|
}
|
710
|
-
|
711
|
-
return
|
712
|
-
return this.mutateAndCheckError(Documents.CompleteConversation, {
|
713
|
-
completion: completion,
|
714
|
-
id: id,
|
715
|
-
correlationId: correlationId,
|
716
|
-
});
|
717
|
-
});
|
733
|
+
async enableFeed(id) {
|
734
|
+
return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
|
718
735
|
}
|
719
|
-
|
720
|
-
return
|
721
|
-
return this.mutateAndCheckError(Documents.AskGraphlit, {
|
722
|
-
prompt: prompt,
|
723
|
-
type: type,
|
724
|
-
id: id,
|
725
|
-
specification: specification,
|
726
|
-
correlationId: correlationId,
|
727
|
-
});
|
728
|
-
});
|
736
|
+
async disableFeed(id) {
|
737
|
+
return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
|
729
738
|
}
|
730
|
-
|
731
|
-
return
|
732
|
-
return this.mutateAndCheckError(Documents.PromptConversation, {
|
733
|
-
prompt: prompt,
|
734
|
-
id: id,
|
735
|
-
specification: specification,
|
736
|
-
mimeType: mimeType,
|
737
|
-
data: data,
|
738
|
-
tools: tools,
|
739
|
-
requireTool: requireTool,
|
740
|
-
includeDetails: includeDetails,
|
741
|
-
correlationId: correlationId,
|
742
|
-
});
|
743
|
-
});
|
739
|
+
async getFeed(id) {
|
740
|
+
return this.queryAndCheckError(Documents.GetFeed, { id: id });
|
744
741
|
}
|
745
|
-
|
746
|
-
return
|
747
|
-
return this.mutateAndCheckError(Documents.ContinueConversation, {
|
748
|
-
id: id,
|
749
|
-
responses: responses,
|
750
|
-
correlationId: correlationId,
|
751
|
-
});
|
752
|
-
});
|
742
|
+
async queryFeeds(filter) {
|
743
|
+
return this.queryAndCheckError(Documents.QueryFeeds, { filter: filter });
|
753
744
|
}
|
754
|
-
|
755
|
-
return
|
756
|
-
return this.mutateAndCheckError(Documents.PublishConversation, {
|
757
|
-
id: id,
|
758
|
-
connector: connector,
|
759
|
-
name: name,
|
760
|
-
workflow: workflow,
|
761
|
-
isSynchronous: isSynchronous,
|
762
|
-
correlationId: correlationId,
|
763
|
-
});
|
764
|
-
});
|
745
|
+
async countFeeds(filter) {
|
746
|
+
return this.queryAndCheckError(Documents.CountFeeds, { filter: filter });
|
765
747
|
}
|
766
|
-
|
767
|
-
return
|
768
|
-
return this.mutateAndCheckError(Documents.SuggestConversation, {
|
769
|
-
id: id,
|
770
|
-
count: count,
|
771
|
-
correlationId: correlationId,
|
772
|
-
});
|
773
|
-
});
|
748
|
+
async feedExists(filter) {
|
749
|
+
return this.queryAndCheckError(Documents.FeedExists, { filter: filter });
|
774
750
|
}
|
775
|
-
|
776
|
-
return
|
777
|
-
return this.queryAndCheckError(Documents.QueryOneDriveFolders, {
|
778
|
-
properties: properties,
|
779
|
-
folderId: folderId,
|
780
|
-
});
|
781
|
-
});
|
751
|
+
async isFeedDone(id) {
|
752
|
+
return this.queryAndCheckError(Documents.IsFeedDone, { id: id });
|
782
753
|
}
|
783
|
-
|
784
|
-
return
|
785
|
-
return this.queryAndCheckError(Documents.QuerySharePointFolders, {
|
786
|
-
properties: properties,
|
787
|
-
libraryId: libraryId,
|
788
|
-
folderId: folderId,
|
789
|
-
});
|
790
|
-
});
|
754
|
+
async promptSpecifications(prompt, ids) {
|
755
|
+
return this.mutateAndCheckError(Documents.PromptSpecifications, { prompt: prompt, ids: ids });
|
791
756
|
}
|
792
|
-
|
793
|
-
return
|
794
|
-
return this.queryAndCheckError(Documents.QuerySharePointLibraries, { properties: properties });
|
795
|
-
});
|
757
|
+
async createSpecification(specification) {
|
758
|
+
return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
|
796
759
|
}
|
797
|
-
|
798
|
-
return
|
799
|
-
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsTeams, { properties: properties });
|
800
|
-
});
|
760
|
+
async updateSpecification(specification) {
|
761
|
+
return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
|
801
762
|
}
|
802
|
-
|
803
|
-
return
|
804
|
-
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsChannels, {
|
805
|
-
properties: properties,
|
806
|
-
teamId: teamId,
|
807
|
-
});
|
808
|
-
});
|
763
|
+
async upsertSpecification(specification) {
|
764
|
+
return this.mutateAndCheckError(Documents.UpsertSpecification, { specification: specification });
|
809
765
|
}
|
810
|
-
|
811
|
-
return
|
812
|
-
return this.queryAndCheckError(Documents.QuerySlackChannels, { properties: properties });
|
813
|
-
});
|
766
|
+
async deleteSpecification(id) {
|
767
|
+
return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
|
814
768
|
}
|
815
|
-
|
816
|
-
return
|
817
|
-
|
769
|
+
async deleteSpecifications(ids, isSynchronous) {
|
770
|
+
return this.mutateAndCheckError(Documents.DeleteSpecifications, {
|
771
|
+
ids: ids,
|
772
|
+
isSynchronous: isSynchronous,
|
818
773
|
});
|
819
774
|
}
|
820
|
-
|
821
|
-
return
|
822
|
-
|
775
|
+
async deleteAllSpecifications(filter, isSynchronous, correlationId) {
|
776
|
+
return this.mutateAndCheckError(Documents.DeleteAllSpecifications, {
|
777
|
+
filter: filter,
|
778
|
+
isSynchronous: isSynchronous,
|
779
|
+
correlationId: correlationId,
|
823
780
|
});
|
824
781
|
}
|
825
|
-
|
826
|
-
return
|
827
|
-
return this.queryAndCheckError(Documents.QueryNotionPages, {
|
828
|
-
properties: properties,
|
829
|
-
identifier: identifier,
|
830
|
-
});
|
831
|
-
});
|
782
|
+
async getSpecification(id) {
|
783
|
+
return this.queryAndCheckError(Documents.GetSpecification, { id: id });
|
832
784
|
}
|
833
|
-
|
834
|
-
return
|
835
|
-
return this.mutateAndCheckError(Documents.CreateFeed, { feed: feed, correlationId: correlationId });
|
836
|
-
});
|
785
|
+
async querySpecifications(filter) {
|
786
|
+
return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
|
837
787
|
}
|
838
|
-
|
839
|
-
return
|
840
|
-
return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
|
841
|
-
});
|
788
|
+
async countSpecifications(filter) {
|
789
|
+
return this.queryAndCheckError(Documents.CountSpecifications, { filter: filter });
|
842
790
|
}
|
843
|
-
|
844
|
-
return
|
845
|
-
return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
|
846
|
-
});
|
791
|
+
async specificationExists(filter) {
|
792
|
+
return this.queryAndCheckError(Documents.SpecificationExists, { filter: filter });
|
847
793
|
}
|
848
|
-
|
849
|
-
return
|
850
|
-
return this.mutateAndCheckError(Documents.DeleteFeeds, { ids: ids, isSynchronous: isSynchronous });
|
851
|
-
});
|
794
|
+
async queryModels(filter) {
|
795
|
+
return this.queryAndCheckError(Documents.QueryModels, { filter: filter });
|
852
796
|
}
|
853
|
-
|
854
|
-
return
|
855
|
-
return this.mutateAndCheckError(Documents.DeleteAllFeeds, {
|
856
|
-
filter: filter,
|
857
|
-
isSynchronous: isSynchronous,
|
858
|
-
correlationId: correlationId,
|
859
|
-
});
|
860
|
-
});
|
797
|
+
async createWorkflow(workflow) {
|
798
|
+
return this.mutateAndCheckError(Documents.CreateWorkflow, { workflow: workflow });
|
861
799
|
}
|
862
|
-
|
863
|
-
return
|
864
|
-
return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
|
865
|
-
});
|
800
|
+
async updateWorkflow(workflow) {
|
801
|
+
return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
|
866
802
|
}
|
867
|
-
|
868
|
-
return
|
869
|
-
return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
|
870
|
-
});
|
803
|
+
async upsertWorkflow(workflow) {
|
804
|
+
return this.mutateAndCheckError(Documents.UpsertWorkflow, { workflow: workflow });
|
871
805
|
}
|
872
|
-
|
873
|
-
return
|
874
|
-
return this.queryAndCheckError(Documents.GetFeed, { id: id });
|
875
|
-
});
|
806
|
+
async deleteWorkflow(id) {
|
807
|
+
return this.mutateAndCheckError(Documents.DeleteWorkflow, { id: id });
|
876
808
|
}
|
877
|
-
|
878
|
-
return
|
879
|
-
return this.queryAndCheckError(Documents.QueryFeeds, { filter: filter });
|
880
|
-
});
|
809
|
+
async deleteWorkflows(ids, isSynchronous) {
|
810
|
+
return this.mutateAndCheckError(Documents.DeleteWorkflows, { ids: ids, isSynchronous: isSynchronous });
|
881
811
|
}
|
882
|
-
|
883
|
-
return
|
884
|
-
|
812
|
+
async deleteAllWorkflows(filter, isSynchronous, correlationId) {
|
813
|
+
return this.mutateAndCheckError(Documents.DeleteAllWorkflows, {
|
814
|
+
filter: filter,
|
815
|
+
isSynchronous: isSynchronous,
|
816
|
+
correlationId: correlationId,
|
885
817
|
});
|
886
818
|
}
|
887
|
-
|
888
|
-
return
|
889
|
-
return this.queryAndCheckError(Documents.FeedExists, { filter: filter });
|
890
|
-
});
|
819
|
+
async getWorkflow(id) {
|
820
|
+
return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
|
891
821
|
}
|
892
|
-
|
893
|
-
return
|
894
|
-
return this.queryAndCheckError(Documents.IsFeedDone, { id: id });
|
895
|
-
});
|
822
|
+
async queryWorkflows(filter) {
|
823
|
+
return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
|
896
824
|
}
|
897
|
-
|
898
|
-
return
|
899
|
-
return this.mutateAndCheckError(Documents.PromptSpecifications, { prompt: prompt, ids: ids });
|
900
|
-
});
|
825
|
+
async countWorkflows(filter) {
|
826
|
+
return this.queryAndCheckError(Documents.CountWorkflows, { filter: filter });
|
901
827
|
}
|
902
|
-
|
903
|
-
return
|
904
|
-
return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
|
905
|
-
});
|
828
|
+
async workflowExists(filter) {
|
829
|
+
return this.queryAndCheckError(Documents.WorkflowExists, { filter: filter });
|
906
830
|
}
|
907
|
-
|
908
|
-
return
|
909
|
-
return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
|
910
|
-
});
|
831
|
+
async createUser(user) {
|
832
|
+
return this.mutateAndCheckError(Documents.CreateUser, { user: user });
|
911
833
|
}
|
912
|
-
|
913
|
-
return
|
914
|
-
return this.mutateAndCheckError(Documents.UpsertSpecification, { specification: specification });
|
915
|
-
});
|
834
|
+
async updateUser(user) {
|
835
|
+
return this.mutateAndCheckError(Documents.UpdateUser, { user: user });
|
916
836
|
}
|
917
|
-
|
918
|
-
return
|
919
|
-
return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
|
920
|
-
});
|
837
|
+
async deleteUser(id) {
|
838
|
+
return this.mutateAndCheckError(Documents.DeleteUser, { id: id });
|
921
839
|
}
|
922
|
-
|
923
|
-
return
|
924
|
-
return this.mutateAndCheckError(Documents.DeleteSpecifications, {
|
925
|
-
ids: ids,
|
926
|
-
isSynchronous: isSynchronous,
|
927
|
-
});
|
928
|
-
});
|
840
|
+
async getUser() {
|
841
|
+
return this.queryAndCheckError(Documents.GetUser, {});
|
929
842
|
}
|
930
|
-
|
931
|
-
return
|
932
|
-
return this.mutateAndCheckError(Documents.DeleteAllSpecifications, {
|
933
|
-
filter: filter,
|
934
|
-
isSynchronous: isSynchronous,
|
935
|
-
correlationId: correlationId,
|
936
|
-
});
|
937
|
-
});
|
843
|
+
async queryUsers(filter) {
|
844
|
+
return this.queryAndCheckError(Documents.QueryUsers, { filter: filter });
|
938
845
|
}
|
939
|
-
|
940
|
-
return
|
941
|
-
return this.queryAndCheckError(Documents.GetSpecification, { id: id });
|
942
|
-
});
|
846
|
+
async countUsers(filter) {
|
847
|
+
return this.queryAndCheckError(Documents.CountUsers, { filter: filter });
|
943
848
|
}
|
944
|
-
|
945
|
-
return
|
946
|
-
return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
|
947
|
-
});
|
849
|
+
async enableUser(id) {
|
850
|
+
return this.mutateAndCheckError(Documents.EnableUser, { id: id });
|
948
851
|
}
|
949
|
-
|
950
|
-
return
|
951
|
-
return this.queryAndCheckError(Documents.CountSpecifications, { filter: filter });
|
952
|
-
});
|
852
|
+
async disableUser(id) {
|
853
|
+
return this.mutateAndCheckError(Documents.DisableUser, { id: id });
|
953
854
|
}
|
954
|
-
|
955
|
-
return
|
956
|
-
return this.queryAndCheckError(Documents.SpecificationExists, { filter: filter });
|
957
|
-
});
|
855
|
+
async createCategory(category) {
|
856
|
+
return this.mutateAndCheckError(Documents.CreateCategory, { category: category });
|
958
857
|
}
|
959
|
-
|
960
|
-
return
|
961
|
-
return this.queryAndCheckError(Documents.QueryModels, { filter: filter });
|
962
|
-
});
|
858
|
+
async updateCategory(category) {
|
859
|
+
return this.mutateAndCheckError(Documents.UpdateCategory, { category: category });
|
963
860
|
}
|
964
|
-
|
965
|
-
return
|
966
|
-
return this.mutateAndCheckError(Documents.CreateWorkflow, { workflow: workflow });
|
967
|
-
});
|
861
|
+
async upsertCategory(category) {
|
862
|
+
return this.mutateAndCheckError(Documents.UpsertCategory, { category: category });
|
968
863
|
}
|
969
|
-
|
970
|
-
return
|
971
|
-
return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
|
972
|
-
});
|
864
|
+
async deleteCategory(id) {
|
865
|
+
return this.mutateAndCheckError(Documents.DeleteCategory, { id: id });
|
973
866
|
}
|
974
|
-
|
975
|
-
return
|
976
|
-
return this.mutateAndCheckError(Documents.UpsertWorkflow, { workflow: workflow });
|
977
|
-
});
|
867
|
+
async deleteCategories(ids, isSynchronous) {
|
868
|
+
return this.mutateAndCheckError(Documents.DeleteCategories, { ids: ids, isSynchronous: isSynchronous });
|
978
869
|
}
|
979
|
-
|
980
|
-
return
|
981
|
-
|
870
|
+
async deleteAllCategories(filter, isSynchronous, correlationId) {
|
871
|
+
return this.mutateAndCheckError(Documents.DeleteAllCategories, {
|
872
|
+
filter: filter,
|
873
|
+
isSynchronous: isSynchronous,
|
874
|
+
correlationId: correlationId,
|
982
875
|
});
|
983
876
|
}
|
984
|
-
|
985
|
-
return
|
986
|
-
return this.mutateAndCheckError(Documents.DeleteWorkflows, { ids: ids, isSynchronous: isSynchronous });
|
987
|
-
});
|
877
|
+
async getCategory(id) {
|
878
|
+
return this.queryAndCheckError(Documents.GetCategory, { id: id });
|
988
879
|
}
|
989
|
-
|
990
|
-
return
|
991
|
-
return this.mutateAndCheckError(Documents.DeleteAllWorkflows, {
|
992
|
-
filter: filter,
|
993
|
-
isSynchronous: isSynchronous,
|
994
|
-
correlationId: correlationId,
|
995
|
-
});
|
996
|
-
});
|
880
|
+
async queryCategories(filter) {
|
881
|
+
return this.queryAndCheckError(Documents.QueryCategories, { filter: filter });
|
997
882
|
}
|
998
|
-
|
999
|
-
return
|
1000
|
-
return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
|
1001
|
-
});
|
883
|
+
async createLabel(label) {
|
884
|
+
return this.mutateAndCheckError(Documents.CreateLabel, { label: label });
|
1002
885
|
}
|
1003
|
-
|
1004
|
-
return
|
1005
|
-
return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
|
1006
|
-
});
|
886
|
+
async updateLabel(label) {
|
887
|
+
return this.mutateAndCheckError(Documents.UpdateLabel, { label: label });
|
1007
888
|
}
|
1008
|
-
|
1009
|
-
return
|
1010
|
-
return this.queryAndCheckError(Documents.CountWorkflows, { filter: filter });
|
1011
|
-
});
|
889
|
+
async upsertLabel(label) {
|
890
|
+
return this.mutateAndCheckError(Documents.UpsertLabel, { label: label });
|
1012
891
|
}
|
1013
|
-
|
1014
|
-
return
|
1015
|
-
return this.queryAndCheckError(Documents.WorkflowExists, { filter: filter });
|
1016
|
-
});
|
892
|
+
async deleteLabel(id) {
|
893
|
+
return this.mutateAndCheckError(Documents.DeleteLabel, { id: id });
|
1017
894
|
}
|
1018
|
-
|
1019
|
-
return
|
1020
|
-
return this.mutateAndCheckError(Documents.CreateUser, { user: user });
|
1021
|
-
});
|
895
|
+
async deleteLabels(ids, isSynchronous) {
|
896
|
+
return this.mutateAndCheckError(Documents.DeleteLabels, { ids: ids, isSynchronous: isSynchronous });
|
1022
897
|
}
|
1023
|
-
|
1024
|
-
return
|
1025
|
-
|
898
|
+
async deleteAllLabels(filter, isSynchronous, correlationId) {
|
899
|
+
return this.mutateAndCheckError(Documents.DeleteAllLabels, {
|
900
|
+
filter: filter,
|
901
|
+
isSynchronous: isSynchronous,
|
902
|
+
correlationId: correlationId,
|
1026
903
|
});
|
1027
904
|
}
|
1028
|
-
|
1029
|
-
return
|
1030
|
-
return this.mutateAndCheckError(Documents.DeleteUser, { id: id });
|
1031
|
-
});
|
905
|
+
async getLabel(id) {
|
906
|
+
return this.queryAndCheckError(Documents.GetLabel, { id: id });
|
1032
907
|
}
|
1033
|
-
|
1034
|
-
return
|
1035
|
-
return this.queryAndCheckError(Documents.GetUser, {});
|
1036
|
-
});
|
908
|
+
async queryLabels(filter) {
|
909
|
+
return this.queryAndCheckError(Documents.QueryLabels, { filter: filter });
|
1037
910
|
}
|
1038
|
-
|
1039
|
-
return
|
1040
|
-
return this.queryAndCheckError(Documents.QueryUsers, { filter: filter });
|
1041
|
-
});
|
911
|
+
async createPerson(person) {
|
912
|
+
return this.mutateAndCheckError(Documents.CreatePerson, { person: person });
|
1042
913
|
}
|
1043
|
-
|
1044
|
-
return
|
1045
|
-
return this.queryAndCheckError(Documents.CountUsers, { filter: filter });
|
1046
|
-
});
|
914
|
+
async updatePerson(person) {
|
915
|
+
return this.mutateAndCheckError(Documents.UpdatePerson, { person: person });
|
1047
916
|
}
|
1048
|
-
|
1049
|
-
return
|
1050
|
-
return this.mutateAndCheckError(Documents.EnableUser, { id: id });
|
1051
|
-
});
|
917
|
+
async deletePerson(id) {
|
918
|
+
return this.mutateAndCheckError(Documents.DeletePerson, { id: id });
|
1052
919
|
}
|
1053
|
-
|
1054
|
-
return
|
1055
|
-
return this.mutateAndCheckError(Documents.DisableUser, { id: id });
|
1056
|
-
});
|
920
|
+
async deletePersons(ids, isSynchronous) {
|
921
|
+
return this.mutateAndCheckError(Documents.DeletePersons, { ids: ids, isSynchronous: isSynchronous });
|
1057
922
|
}
|
1058
|
-
|
1059
|
-
return
|
1060
|
-
|
923
|
+
async deleteAllPersons(filter, isSynchronous, correlationId) {
|
924
|
+
return this.mutateAndCheckError(Documents.DeleteAllPersons, {
|
925
|
+
filter: filter,
|
926
|
+
isSynchronous: isSynchronous,
|
927
|
+
correlationId: correlationId,
|
1061
928
|
});
|
1062
929
|
}
|
1063
|
-
|
1064
|
-
return
|
1065
|
-
return this.mutateAndCheckError(Documents.UpdateCategory, { category: category });
|
1066
|
-
});
|
930
|
+
async getPerson(id) {
|
931
|
+
return this.queryAndCheckError(Documents.GetPerson, { id: id });
|
1067
932
|
}
|
1068
|
-
|
1069
|
-
return
|
1070
|
-
return this.mutateAndCheckError(Documents.UpsertCategory, { category: category });
|
1071
|
-
});
|
933
|
+
async queryPersons(filter) {
|
934
|
+
return this.queryAndCheckError(Documents.QueryPersons, { filter: filter });
|
1072
935
|
}
|
1073
|
-
|
1074
|
-
return
|
1075
|
-
return this.mutateAndCheckError(Documents.DeleteCategory, { id: id });
|
1076
|
-
});
|
936
|
+
async createOrganization(organization) {
|
937
|
+
return this.mutateAndCheckError(Documents.CreateOrganization, { organization: organization });
|
1077
938
|
}
|
1078
|
-
|
1079
|
-
return
|
1080
|
-
return this.mutateAndCheckError(Documents.DeleteCategories, { ids: ids, isSynchronous: isSynchronous });
|
1081
|
-
});
|
939
|
+
async updateOrganization(organization) {
|
940
|
+
return this.mutateAndCheckError(Documents.UpdateOrganization, { organization: organization });
|
1082
941
|
}
|
1083
|
-
|
1084
|
-
return
|
1085
|
-
return this.mutateAndCheckError(Documents.DeleteAllCategories, {
|
1086
|
-
filter: filter,
|
1087
|
-
isSynchronous: isSynchronous,
|
1088
|
-
correlationId: correlationId,
|
1089
|
-
});
|
1090
|
-
});
|
942
|
+
async deleteOrganization(id) {
|
943
|
+
return this.mutateAndCheckError(Documents.DeleteOrganization, { id: id });
|
1091
944
|
}
|
1092
|
-
|
1093
|
-
return
|
1094
|
-
|
945
|
+
async deleteOrganizations(ids, isSynchronous) {
|
946
|
+
return this.mutateAndCheckError(Documents.DeleteOrganizations, {
|
947
|
+
ids: ids,
|
948
|
+
isSynchronous: isSynchronous,
|
1095
949
|
});
|
1096
950
|
}
|
1097
|
-
|
1098
|
-
return
|
1099
|
-
|
951
|
+
async deleteAllOrganizations(filter, isSynchronous, correlationId) {
|
952
|
+
return this.mutateAndCheckError(Documents.DeleteAllOrganizations, {
|
953
|
+
filter: filter,
|
954
|
+
isSynchronous: isSynchronous,
|
955
|
+
correlationId: correlationId,
|
1100
956
|
});
|
1101
957
|
}
|
1102
|
-
|
1103
|
-
return
|
1104
|
-
return this.mutateAndCheckError(Documents.CreateLabel, { label: label });
|
1105
|
-
});
|
958
|
+
async getOrganization(id) {
|
959
|
+
return this.queryAndCheckError(Documents.GetOrganization, { id: id });
|
1106
960
|
}
|
1107
|
-
|
1108
|
-
return
|
1109
|
-
return this.mutateAndCheckError(Documents.UpdateLabel, { label: label });
|
1110
|
-
});
|
961
|
+
async queryOrganizations(filter) {
|
962
|
+
return this.queryAndCheckError(Documents.QueryOrganizations, { filter: filter });
|
1111
963
|
}
|
1112
|
-
|
1113
|
-
return
|
1114
|
-
return this.mutateAndCheckError(Documents.UpsertLabel, { label: label });
|
1115
|
-
});
|
964
|
+
async createPlace(place) {
|
965
|
+
return this.mutateAndCheckError(Documents.CreatePlace, { place: place });
|
1116
966
|
}
|
1117
|
-
|
1118
|
-
return
|
1119
|
-
return this.mutateAndCheckError(Documents.DeleteLabel, { id: id });
|
1120
|
-
});
|
967
|
+
async updatePlace(place) {
|
968
|
+
return this.mutateAndCheckError(Documents.UpdatePlace, { place: place });
|
1121
969
|
}
|
1122
|
-
|
1123
|
-
return
|
1124
|
-
return this.mutateAndCheckError(Documents.DeleteLabels, { ids: ids, isSynchronous: isSynchronous });
|
1125
|
-
});
|
970
|
+
async deletePlace(id) {
|
971
|
+
return this.mutateAndCheckError(Documents.DeletePlace, { id: id });
|
1126
972
|
}
|
1127
|
-
|
1128
|
-
return
|
1129
|
-
return this.mutateAndCheckError(Documents.DeleteAllLabels, {
|
1130
|
-
filter: filter,
|
1131
|
-
isSynchronous: isSynchronous,
|
1132
|
-
correlationId: correlationId,
|
1133
|
-
});
|
1134
|
-
});
|
973
|
+
async deletePlaces(ids, isSynchronous) {
|
974
|
+
return this.mutateAndCheckError(Documents.DeletePlaces, { ids: ids, isSynchronous: isSynchronous });
|
1135
975
|
}
|
1136
|
-
|
1137
|
-
return
|
1138
|
-
|
976
|
+
async deleteAllPlaces(filter, isSynchronous, correlationId) {
|
977
|
+
return this.mutateAndCheckError(Documents.DeleteAllPlaces, {
|
978
|
+
filter: filter,
|
979
|
+
isSynchronous: isSynchronous,
|
980
|
+
correlationId: correlationId,
|
1139
981
|
});
|
1140
982
|
}
|
1141
|
-
|
1142
|
-
return
|
1143
|
-
return this.queryAndCheckError(Documents.QueryLabels, { filter: filter });
|
1144
|
-
});
|
983
|
+
async getPlace(id) {
|
984
|
+
return this.queryAndCheckError(Documents.GetPlace, { id: id });
|
1145
985
|
}
|
1146
|
-
|
1147
|
-
return
|
1148
|
-
return this.mutateAndCheckError(Documents.CreatePerson, { person: person });
|
1149
|
-
});
|
986
|
+
async queryPlaces(filter) {
|
987
|
+
return this.queryAndCheckError(Documents.QueryPlaces, { filter: filter });
|
1150
988
|
}
|
1151
|
-
|
1152
|
-
return
|
1153
|
-
return this.mutateAndCheckError(Documents.UpdatePerson, { person: person });
|
1154
|
-
});
|
989
|
+
async createEvent(event) {
|
990
|
+
return this.mutateAndCheckError(Documents.CreateEvent, { event: event });
|
1155
991
|
}
|
1156
|
-
|
1157
|
-
return
|
1158
|
-
return this.mutateAndCheckError(Documents.DeletePerson, { id: id });
|
1159
|
-
});
|
992
|
+
async updateEvent(event) {
|
993
|
+
return this.mutateAndCheckError(Documents.UpdateEvent, { event: event });
|
1160
994
|
}
|
1161
|
-
|
1162
|
-
return
|
1163
|
-
return this.mutateAndCheckError(Documents.DeletePersons, { ids: ids, isSynchronous: isSynchronous });
|
1164
|
-
});
|
995
|
+
async deleteEvent(id) {
|
996
|
+
return this.mutateAndCheckError(Documents.DeleteEvent, { id: id });
|
1165
997
|
}
|
1166
|
-
|
1167
|
-
return
|
1168
|
-
return this.mutateAndCheckError(Documents.DeleteAllPersons, {
|
1169
|
-
filter: filter,
|
1170
|
-
isSynchronous: isSynchronous,
|
1171
|
-
correlationId: correlationId,
|
1172
|
-
});
|
1173
|
-
});
|
998
|
+
async deleteEvents(ids, isSynchronous) {
|
999
|
+
return this.mutateAndCheckError(Documents.DeleteEvents, { ids: ids, isSynchronous: isSynchronous });
|
1174
1000
|
}
|
1175
|
-
|
1176
|
-
return
|
1177
|
-
|
1001
|
+
async deleteAllEvents(filter, isSynchronous, correlationId) {
|
1002
|
+
return this.mutateAndCheckError(Documents.DeleteAllEvents, {
|
1003
|
+
filter: filter,
|
1004
|
+
isSynchronous: isSynchronous,
|
1005
|
+
correlationId: correlationId,
|
1178
1006
|
});
|
1179
1007
|
}
|
1180
|
-
|
1181
|
-
return
|
1182
|
-
return this.queryAndCheckError(Documents.QueryPersons, { filter: filter });
|
1183
|
-
});
|
1008
|
+
async getEvent(id) {
|
1009
|
+
return this.queryAndCheckError(Documents.GetEvent, { id: id });
|
1184
1010
|
}
|
1185
|
-
|
1186
|
-
return
|
1187
|
-
return this.mutateAndCheckError(Documents.CreateOrganization, { organization: organization });
|
1188
|
-
});
|
1011
|
+
async queryEvents(filter) {
|
1012
|
+
return this.queryAndCheckError(Documents.QueryEvents, { filter: filter });
|
1189
1013
|
}
|
1190
|
-
|
1191
|
-
return
|
1192
|
-
return this.mutateAndCheckError(Documents.UpdateOrganization, { organization: organization });
|
1193
|
-
});
|
1014
|
+
async createProduct(product) {
|
1015
|
+
return this.mutateAndCheckError(Documents.CreateProduct, { product: product });
|
1194
1016
|
}
|
1195
|
-
|
1196
|
-
return
|
1197
|
-
return this.mutateAndCheckError(Documents.DeleteOrganization, { id: id });
|
1198
|
-
});
|
1017
|
+
async updateProduct(product) {
|
1018
|
+
return this.mutateAndCheckError(Documents.UpdateProduct, { product: product });
|
1199
1019
|
}
|
1200
|
-
|
1201
|
-
return
|
1202
|
-
return this.mutateAndCheckError(Documents.DeleteOrganizations, {
|
1203
|
-
ids: ids,
|
1204
|
-
isSynchronous: isSynchronous,
|
1205
|
-
});
|
1206
|
-
});
|
1020
|
+
async deleteProduct(id) {
|
1021
|
+
return this.mutateAndCheckError(Documents.DeleteProduct, { id: id });
|
1207
1022
|
}
|
1208
|
-
|
1209
|
-
return
|
1210
|
-
return this.mutateAndCheckError(Documents.DeleteAllOrganizations, {
|
1211
|
-
filter: filter,
|
1212
|
-
isSynchronous: isSynchronous,
|
1213
|
-
correlationId: correlationId,
|
1214
|
-
});
|
1215
|
-
});
|
1023
|
+
async deleteProducts(ids, isSynchronous) {
|
1024
|
+
return this.mutateAndCheckError(Documents.DeleteProducts, { ids: ids, isSynchronous: isSynchronous });
|
1216
1025
|
}
|
1217
|
-
|
1218
|
-
return
|
1219
|
-
|
1026
|
+
async deleteAllProducts(filter, isSynchronous, correlationId) {
|
1027
|
+
return this.mutateAndCheckError(Documents.DeleteAllProducts, {
|
1028
|
+
filter: filter,
|
1029
|
+
isSynchronous: isSynchronous,
|
1030
|
+
correlationId: correlationId,
|
1220
1031
|
});
|
1221
1032
|
}
|
1222
|
-
|
1223
|
-
return
|
1224
|
-
return this.queryAndCheckError(Documents.QueryOrganizations, { filter: filter });
|
1225
|
-
});
|
1033
|
+
async getProduct(id) {
|
1034
|
+
return this.queryAndCheckError(Documents.GetProduct, { id: id });
|
1226
1035
|
}
|
1227
|
-
|
1228
|
-
return
|
1229
|
-
return this.mutateAndCheckError(Documents.CreatePlace, { place: place });
|
1230
|
-
});
|
1036
|
+
async queryProducts(filter) {
|
1037
|
+
return this.queryAndCheckError(Documents.QueryProducts, { filter: filter });
|
1231
1038
|
}
|
1232
|
-
|
1233
|
-
return
|
1234
|
-
return this.mutateAndCheckError(Documents.UpdatePlace, { place: place });
|
1235
|
-
});
|
1039
|
+
async createRepo(repo) {
|
1040
|
+
return this.mutateAndCheckError(Documents.CreateRepo, { repo: repo });
|
1236
1041
|
}
|
1237
|
-
|
1238
|
-
return
|
1239
|
-
return this.mutateAndCheckError(Documents.DeletePlace, { id: id });
|
1240
|
-
});
|
1042
|
+
async updateRepo(repo) {
|
1043
|
+
return this.mutateAndCheckError(Documents.UpdateRepo, { repo: repo });
|
1241
1044
|
}
|
1242
|
-
|
1243
|
-
return
|
1244
|
-
return this.mutateAndCheckError(Documents.DeletePlaces, { ids: ids, isSynchronous: isSynchronous });
|
1245
|
-
});
|
1045
|
+
async deleteRepo(id) {
|
1046
|
+
return this.mutateAndCheckError(Documents.DeleteRepo, { id: id });
|
1246
1047
|
}
|
1247
|
-
|
1248
|
-
return
|
1249
|
-
return this.mutateAndCheckError(Documents.DeleteAllPlaces, {
|
1250
|
-
filter: filter,
|
1251
|
-
isSynchronous: isSynchronous,
|
1252
|
-
correlationId: correlationId,
|
1253
|
-
});
|
1254
|
-
});
|
1048
|
+
async deleteRepos(ids, isSynchronous) {
|
1049
|
+
return this.mutateAndCheckError(Documents.DeleteRepos, { ids: ids, isSynchronous: isSynchronous });
|
1255
1050
|
}
|
1256
|
-
|
1257
|
-
return
|
1258
|
-
|
1051
|
+
async deleteAllRepos(filter, isSynchronous, correlationId) {
|
1052
|
+
return this.mutateAndCheckError(Documents.DeleteAllRepos, {
|
1053
|
+
filter: filter,
|
1054
|
+
isSynchronous: isSynchronous,
|
1055
|
+
correlationId: correlationId,
|
1259
1056
|
});
|
1260
1057
|
}
|
1261
|
-
|
1262
|
-
return
|
1263
|
-
return this.queryAndCheckError(Documents.QueryPlaces, { filter: filter });
|
1264
|
-
});
|
1058
|
+
async getRepo(id) {
|
1059
|
+
return this.queryAndCheckError(Documents.GetRepo, { id: id });
|
1265
1060
|
}
|
1266
|
-
|
1267
|
-
return
|
1268
|
-
return this.mutateAndCheckError(Documents.CreateEvent, { event: event });
|
1269
|
-
});
|
1061
|
+
async queryRepos(filter) {
|
1062
|
+
return this.queryAndCheckError(Documents.QueryRepos, { filter: filter });
|
1270
1063
|
}
|
1271
|
-
|
1272
|
-
return
|
1273
|
-
return this.mutateAndCheckError(Documents.UpdateEvent, { event: event });
|
1274
|
-
});
|
1064
|
+
async createSoftware(software) {
|
1065
|
+
return this.mutateAndCheckError(Documents.CreateSoftware, { software: software });
|
1275
1066
|
}
|
1276
|
-
|
1277
|
-
return
|
1278
|
-
return this.mutateAndCheckError(Documents.DeleteEvent, { id: id });
|
1279
|
-
});
|
1067
|
+
async updateSoftware(software) {
|
1068
|
+
return this.mutateAndCheckError(Documents.UpdateSoftware, { software: software });
|
1280
1069
|
}
|
1281
|
-
|
1282
|
-
return
|
1283
|
-
return this.mutateAndCheckError(Documents.DeleteEvents, { ids: ids, isSynchronous: isSynchronous });
|
1284
|
-
});
|
1070
|
+
async deleteSoftware(id) {
|
1071
|
+
return this.mutateAndCheckError(Documents.DeleteSoftware, { id: id });
|
1285
1072
|
}
|
1286
|
-
|
1287
|
-
return
|
1288
|
-
return this.mutateAndCheckError(Documents.DeleteAllEvents, {
|
1289
|
-
filter: filter,
|
1290
|
-
isSynchronous: isSynchronous,
|
1291
|
-
correlationId: correlationId,
|
1292
|
-
});
|
1293
|
-
});
|
1073
|
+
async deleteSoftwares(ids, isSynchronous) {
|
1074
|
+
return this.mutateAndCheckError(Documents.DeleteSoftwares, { ids: ids, isSynchronous: isSynchronous });
|
1294
1075
|
}
|
1295
|
-
|
1296
|
-
return
|
1297
|
-
|
1076
|
+
async deleteAllSoftwares(filter, isSynchronous, correlationId) {
|
1077
|
+
return this.mutateAndCheckError(Documents.DeleteAllSoftwares, {
|
1078
|
+
filter: filter,
|
1079
|
+
isSynchronous: isSynchronous,
|
1080
|
+
correlationId: correlationId,
|
1298
1081
|
});
|
1299
1082
|
}
|
1300
|
-
|
1301
|
-
return
|
1302
|
-
return this.queryAndCheckError(Documents.QueryEvents, { filter: filter });
|
1303
|
-
});
|
1083
|
+
async getSoftware(id) {
|
1084
|
+
return this.queryAndCheckError(Documents.GetSoftware, { id: id });
|
1304
1085
|
}
|
1305
|
-
|
1306
|
-
return
|
1307
|
-
return this.mutateAndCheckError(Documents.CreateProduct, { product: product });
|
1308
|
-
});
|
1086
|
+
async querySoftwares(filter) {
|
1087
|
+
return this.queryAndCheckError(Documents.QuerySoftwares, { filter: filter });
|
1309
1088
|
}
|
1310
|
-
|
1311
|
-
return
|
1312
|
-
return this.mutateAndCheckError(Documents.UpdateProduct, { product: product });
|
1313
|
-
});
|
1089
|
+
async createMedicalCondition(MedicalCondition) {
|
1090
|
+
return this.mutateAndCheckError(Documents.CreateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1314
1091
|
}
|
1315
|
-
|
1316
|
-
return
|
1317
|
-
return this.mutateAndCheckError(Documents.DeleteProduct, { id: id });
|
1318
|
-
});
|
1092
|
+
async updateMedicalCondition(MedicalCondition) {
|
1093
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1319
1094
|
}
|
1320
|
-
|
1321
|
-
return
|
1322
|
-
return this.mutateAndCheckError(Documents.DeleteProducts, { ids: ids, isSynchronous: isSynchronous });
|
1323
|
-
});
|
1095
|
+
async deleteMedicalCondition(id) {
|
1096
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalCondition, { id: id });
|
1324
1097
|
}
|
1325
|
-
|
1326
|
-
return
|
1327
|
-
|
1328
|
-
|
1329
|
-
isSynchronous: isSynchronous,
|
1330
|
-
correlationId: correlationId,
|
1331
|
-
});
|
1098
|
+
async deleteMedicalConditions(ids, isSynchronous) {
|
1099
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalConditions, {
|
1100
|
+
ids: ids,
|
1101
|
+
isSynchronous: isSynchronous,
|
1332
1102
|
});
|
1333
1103
|
}
|
1334
|
-
|
1335
|
-
return
|
1336
|
-
|
1104
|
+
async deleteAllMedicalConditions(filter, isSynchronous, correlationId) {
|
1105
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalConditions, {
|
1106
|
+
filter: filter,
|
1107
|
+
isSynchronous: isSynchronous,
|
1108
|
+
correlationId: correlationId,
|
1337
1109
|
});
|
1338
1110
|
}
|
1339
|
-
|
1340
|
-
return
|
1341
|
-
return this.queryAndCheckError(Documents.QueryProducts, { filter: filter });
|
1342
|
-
});
|
1111
|
+
async getMedicalCondition(id) {
|
1112
|
+
return this.queryAndCheckError(Documents.GetMedicalCondition, { id: id });
|
1343
1113
|
}
|
1344
|
-
|
1345
|
-
return
|
1346
|
-
return this.mutateAndCheckError(Documents.CreateRepo, { repo: repo });
|
1347
|
-
});
|
1114
|
+
async queryMedicalConditions(filter) {
|
1115
|
+
return this.queryAndCheckError(Documents.QueryMedicalConditions, { filter: filter });
|
1348
1116
|
}
|
1349
|
-
|
1350
|
-
return
|
1351
|
-
return this.mutateAndCheckError(Documents.UpdateRepo, { repo: repo });
|
1352
|
-
});
|
1117
|
+
async createMedicalGuideline(MedicalGuideline) {
|
1118
|
+
return this.mutateAndCheckError(Documents.CreateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1353
1119
|
}
|
1354
|
-
|
1355
|
-
return
|
1356
|
-
return this.mutateAndCheckError(Documents.DeleteRepo, { id: id });
|
1357
|
-
});
|
1120
|
+
async updateMedicalGuideline(MedicalGuideline) {
|
1121
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1358
1122
|
}
|
1359
|
-
|
1360
|
-
return
|
1361
|
-
return this.mutateAndCheckError(Documents.DeleteRepos, { ids: ids, isSynchronous: isSynchronous });
|
1362
|
-
});
|
1123
|
+
async deleteMedicalGuideline(id) {
|
1124
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalGuideline, { id: id });
|
1363
1125
|
}
|
1364
|
-
|
1365
|
-
return
|
1366
|
-
|
1367
|
-
|
1368
|
-
isSynchronous: isSynchronous,
|
1369
|
-
correlationId: correlationId,
|
1370
|
-
});
|
1126
|
+
async deleteMedicalGuidelines(ids, isSynchronous) {
|
1127
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalGuidelines, {
|
1128
|
+
ids: ids,
|
1129
|
+
isSynchronous: isSynchronous,
|
1371
1130
|
});
|
1372
1131
|
}
|
1373
|
-
|
1374
|
-
return
|
1375
|
-
|
1132
|
+
async deleteAllMedicalGuidelines(filter, isSynchronous, correlationId) {
|
1133
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalGuidelines, {
|
1134
|
+
filter: filter,
|
1135
|
+
isSynchronous: isSynchronous,
|
1136
|
+
correlationId: correlationId,
|
1376
1137
|
});
|
1377
1138
|
}
|
1378
|
-
|
1379
|
-
return
|
1380
|
-
return this.queryAndCheckError(Documents.QueryRepos, { filter: filter });
|
1381
|
-
});
|
1139
|
+
async getMedicalGuideline(id) {
|
1140
|
+
return this.queryAndCheckError(Documents.GetMedicalGuideline, { id: id });
|
1382
1141
|
}
|
1383
|
-
|
1384
|
-
return
|
1385
|
-
return this.mutateAndCheckError(Documents.CreateSoftware, { software: software });
|
1386
|
-
});
|
1387
|
-
}
|
1388
|
-
updateSoftware(software) {
|
1389
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1390
|
-
return this.mutateAndCheckError(Documents.UpdateSoftware, { software: software });
|
1391
|
-
});
|
1142
|
+
async queryMedicalGuidelines(filter) {
|
1143
|
+
return this.queryAndCheckError(Documents.QueryMedicalGuidelines, { filter: filter });
|
1392
1144
|
}
|
1393
|
-
|
1394
|
-
return
|
1395
|
-
return this.mutateAndCheckError(Documents.DeleteSoftware, { id: id });
|
1396
|
-
});
|
1145
|
+
async createMedicalDrug(MedicalDrug) {
|
1146
|
+
return this.mutateAndCheckError(Documents.CreateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1397
1147
|
}
|
1398
|
-
|
1399
|
-
return
|
1400
|
-
return this.mutateAndCheckError(Documents.DeleteSoftwares, { ids: ids, isSynchronous: isSynchronous });
|
1401
|
-
});
|
1148
|
+
async updateMedicalDrug(MedicalDrug) {
|
1149
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1402
1150
|
}
|
1403
|
-
|
1404
|
-
return
|
1405
|
-
return this.mutateAndCheckError(Documents.DeleteAllSoftwares, {
|
1406
|
-
filter: filter,
|
1407
|
-
isSynchronous: isSynchronous,
|
1408
|
-
correlationId: correlationId,
|
1409
|
-
});
|
1410
|
-
});
|
1151
|
+
async deleteMedicalDrug(id) {
|
1152
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrug, { id: id });
|
1411
1153
|
}
|
1412
|
-
|
1413
|
-
return
|
1414
|
-
return this.queryAndCheckError(Documents.GetSoftware, { id: id });
|
1415
|
-
});
|
1154
|
+
async deleteMedicalDrugs(ids, isSynchronous) {
|
1155
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrugs, { ids: ids, isSynchronous: isSynchronous });
|
1416
1156
|
}
|
1417
|
-
|
1418
|
-
return
|
1419
|
-
|
1157
|
+
async deleteAllMedicalDrugs(filter, isSynchronous, correlationId) {
|
1158
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugs, {
|
1159
|
+
filter: filter,
|
1160
|
+
isSynchronous: isSynchronous,
|
1161
|
+
correlationId: correlationId,
|
1420
1162
|
});
|
1421
1163
|
}
|
1422
|
-
|
1423
|
-
return
|
1424
|
-
return this.mutateAndCheckError(Documents.CreateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1425
|
-
});
|
1164
|
+
async getMedicalDrug(id) {
|
1165
|
+
return this.queryAndCheckError(Documents.GetMedicalDrug, { id: id });
|
1426
1166
|
}
|
1427
|
-
|
1428
|
-
return
|
1429
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1430
|
-
});
|
1167
|
+
async queryMedicalDrugs(filter) {
|
1168
|
+
return this.queryAndCheckError(Documents.QueryMedicalDrugs, { filter: filter });
|
1431
1169
|
}
|
1432
|
-
|
1433
|
-
return
|
1434
|
-
|
1170
|
+
async createMedicalIndication(MedicalIndication) {
|
1171
|
+
return this.mutateAndCheckError(Documents.CreateMedicalIndication, {
|
1172
|
+
MedicalIndication: MedicalIndication,
|
1435
1173
|
});
|
1436
1174
|
}
|
1437
|
-
|
1438
|
-
return
|
1439
|
-
|
1440
|
-
ids: ids,
|
1441
|
-
isSynchronous: isSynchronous,
|
1442
|
-
});
|
1175
|
+
async updateMedicalIndication(MedicalIndication) {
|
1176
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalIndication, {
|
1177
|
+
MedicalIndication: MedicalIndication,
|
1443
1178
|
});
|
1444
1179
|
}
|
1445
|
-
|
1446
|
-
return
|
1447
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalConditions, {
|
1448
|
-
filter: filter,
|
1449
|
-
isSynchronous: isSynchronous,
|
1450
|
-
correlationId: correlationId,
|
1451
|
-
});
|
1452
|
-
});
|
1180
|
+
async deleteMedicalIndication(id) {
|
1181
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalIndication, { id: id });
|
1453
1182
|
}
|
1454
|
-
|
1455
|
-
return
|
1456
|
-
|
1183
|
+
async deleteMedicalIndications(ids, isSynchronous) {
|
1184
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalIndications, {
|
1185
|
+
ids: ids,
|
1186
|
+
isSynchronous: isSynchronous,
|
1457
1187
|
});
|
1458
1188
|
}
|
1459
|
-
|
1460
|
-
return
|
1461
|
-
|
1189
|
+
async deleteAllMedicalIndications(filter, isSynchronous, correlationId) {
|
1190
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalIndications, {
|
1191
|
+
filter: filter,
|
1192
|
+
isSynchronous: isSynchronous,
|
1193
|
+
correlationId: correlationId,
|
1462
1194
|
});
|
1463
1195
|
}
|
1464
|
-
|
1465
|
-
return
|
1466
|
-
return this.mutateAndCheckError(Documents.CreateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1467
|
-
});
|
1196
|
+
async getMedicalIndication(id) {
|
1197
|
+
return this.queryAndCheckError(Documents.GetMedicalIndication, { id: id });
|
1468
1198
|
}
|
1469
|
-
|
1470
|
-
return
|
1471
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1472
|
-
});
|
1199
|
+
async queryMedicalIndications(filter) {
|
1200
|
+
return this.queryAndCheckError(Documents.QueryMedicalIndications, { filter: filter });
|
1473
1201
|
}
|
1474
|
-
|
1475
|
-
return
|
1476
|
-
|
1202
|
+
async createMedicalContraindication(MedicalContraindication) {
|
1203
|
+
return this.mutateAndCheckError(Documents.CreateMedicalContraindication, {
|
1204
|
+
MedicalContraindication: MedicalContraindication,
|
1477
1205
|
});
|
1478
1206
|
}
|
1479
|
-
|
1480
|
-
return
|
1481
|
-
|
1482
|
-
ids: ids,
|
1483
|
-
isSynchronous: isSynchronous,
|
1484
|
-
});
|
1207
|
+
async updateMedicalContraindication(MedicalContraindication) {
|
1208
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalContraindication, {
|
1209
|
+
MedicalContraindication: MedicalContraindication,
|
1485
1210
|
});
|
1486
1211
|
}
|
1487
|
-
|
1488
|
-
return
|
1489
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalGuidelines, {
|
1490
|
-
filter: filter,
|
1491
|
-
isSynchronous: isSynchronous,
|
1492
|
-
correlationId: correlationId,
|
1493
|
-
});
|
1494
|
-
});
|
1212
|
+
async deleteMedicalContraindication(id) {
|
1213
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalContraindication, { id: id });
|
1495
1214
|
}
|
1496
|
-
|
1497
|
-
return
|
1498
|
-
|
1215
|
+
async deleteMedicalContraindications(ids, isSynchronous) {
|
1216
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalContraindications, {
|
1217
|
+
ids: ids,
|
1218
|
+
isSynchronous: isSynchronous,
|
1499
1219
|
});
|
1500
1220
|
}
|
1501
|
-
|
1502
|
-
return
|
1503
|
-
|
1221
|
+
async deleteAllMedicalContraindications(filter, isSynchronous, correlationId) {
|
1222
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalContraindications, {
|
1223
|
+
filter: filter,
|
1224
|
+
isSynchronous: isSynchronous,
|
1225
|
+
correlationId: correlationId,
|
1504
1226
|
});
|
1505
1227
|
}
|
1506
|
-
|
1507
|
-
return
|
1508
|
-
return this.mutateAndCheckError(Documents.CreateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1509
|
-
});
|
1228
|
+
async getMedicalContraindication(id) {
|
1229
|
+
return this.queryAndCheckError(Documents.GetMedicalContraindication, { id: id });
|
1510
1230
|
}
|
1511
|
-
|
1512
|
-
return
|
1513
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1514
|
-
});
|
1515
|
-
}
|
1516
|
-
deleteMedicalDrug(id) {
|
1517
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1518
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDrug, { id: id });
|
1519
|
-
});
|
1520
|
-
}
|
1521
|
-
deleteMedicalDrugs(ids, isSynchronous) {
|
1522
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1523
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDrugs, { ids: ids, isSynchronous: isSynchronous });
|
1524
|
-
});
|
1525
|
-
}
|
1526
|
-
deleteAllMedicalDrugs(filter, isSynchronous, correlationId) {
|
1527
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1528
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugs, {
|
1529
|
-
filter: filter,
|
1530
|
-
isSynchronous: isSynchronous,
|
1531
|
-
correlationId: correlationId,
|
1532
|
-
});
|
1533
|
-
});
|
1534
|
-
}
|
1535
|
-
getMedicalDrug(id) {
|
1536
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1537
|
-
return this.queryAndCheckError(Documents.GetMedicalDrug, { id: id });
|
1538
|
-
});
|
1539
|
-
}
|
1540
|
-
queryMedicalDrugs(filter) {
|
1541
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1542
|
-
return this.queryAndCheckError(Documents.QueryMedicalDrugs, { filter: filter });
|
1543
|
-
});
|
1544
|
-
}
|
1545
|
-
createMedicalIndication(MedicalIndication) {
|
1546
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1547
|
-
return this.mutateAndCheckError(Documents.CreateMedicalIndication, {
|
1548
|
-
MedicalIndication: MedicalIndication,
|
1549
|
-
});
|
1550
|
-
});
|
1551
|
-
}
|
1552
|
-
updateMedicalIndication(MedicalIndication) {
|
1553
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1554
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalIndication, {
|
1555
|
-
MedicalIndication: MedicalIndication,
|
1556
|
-
});
|
1557
|
-
});
|
1558
|
-
}
|
1559
|
-
deleteMedicalIndication(id) {
|
1560
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1561
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalIndication, { id: id });
|
1562
|
-
});
|
1563
|
-
}
|
1564
|
-
deleteMedicalIndications(ids, isSynchronous) {
|
1565
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1566
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalIndications, {
|
1567
|
-
ids: ids,
|
1568
|
-
isSynchronous: isSynchronous,
|
1569
|
-
});
|
1570
|
-
});
|
1571
|
-
}
|
1572
|
-
deleteAllMedicalIndications(filter, isSynchronous, correlationId) {
|
1573
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1574
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalIndications, {
|
1575
|
-
filter: filter,
|
1576
|
-
isSynchronous: isSynchronous,
|
1577
|
-
correlationId: correlationId,
|
1578
|
-
});
|
1579
|
-
});
|
1231
|
+
async queryMedicalContraindications(filter) {
|
1232
|
+
return this.queryAndCheckError(Documents.QueryMedicalContraindications, { filter: filter });
|
1580
1233
|
}
|
1581
|
-
|
1582
|
-
return
|
1583
|
-
return this.queryAndCheckError(Documents.GetMedicalIndication, { id: id });
|
1584
|
-
});
|
1234
|
+
async createMedicalTest(MedicalTest) {
|
1235
|
+
return this.mutateAndCheckError(Documents.CreateMedicalTest, { MedicalTest: MedicalTest });
|
1585
1236
|
}
|
1586
|
-
|
1587
|
-
return
|
1588
|
-
return this.queryAndCheckError(Documents.QueryMedicalIndications, { filter: filter });
|
1589
|
-
});
|
1237
|
+
async updateMedicalTest(MedicalTest) {
|
1238
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalTest, { MedicalTest: MedicalTest });
|
1590
1239
|
}
|
1591
|
-
|
1592
|
-
return
|
1593
|
-
return this.mutateAndCheckError(Documents.CreateMedicalContraindication, {
|
1594
|
-
MedicalContraindication: MedicalContraindication,
|
1595
|
-
});
|
1596
|
-
});
|
1240
|
+
async deleteMedicalTest(id) {
|
1241
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTest, { id: id });
|
1597
1242
|
}
|
1598
|
-
|
1599
|
-
return
|
1600
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalContraindication, {
|
1601
|
-
MedicalContraindication: MedicalContraindication,
|
1602
|
-
});
|
1603
|
-
});
|
1243
|
+
async deleteMedicalTests(ids, isSynchronous) {
|
1244
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTests, { ids: ids, isSynchronous: isSynchronous });
|
1604
1245
|
}
|
1605
|
-
|
1606
|
-
return
|
1607
|
-
|
1246
|
+
async deleteAllMedicalTests(filter, isSynchronous, correlationId) {
|
1247
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalTests, {
|
1248
|
+
filter: filter,
|
1249
|
+
isSynchronous: isSynchronous,
|
1250
|
+
correlationId: correlationId,
|
1608
1251
|
});
|
1609
1252
|
}
|
1610
|
-
|
1611
|
-
return
|
1612
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalContraindications, {
|
1613
|
-
ids: ids,
|
1614
|
-
isSynchronous: isSynchronous,
|
1615
|
-
});
|
1616
|
-
});
|
1253
|
+
async getMedicalTest(id) {
|
1254
|
+
return this.queryAndCheckError(Documents.GetMedicalTest, { id: id });
|
1617
1255
|
}
|
1618
|
-
|
1619
|
-
return
|
1620
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalContraindications, {
|
1621
|
-
filter: filter,
|
1622
|
-
isSynchronous: isSynchronous,
|
1623
|
-
correlationId: correlationId,
|
1624
|
-
});
|
1625
|
-
});
|
1256
|
+
async queryMedicalTests(filter) {
|
1257
|
+
return this.queryAndCheckError(Documents.QueryMedicalTests, { filter: filter });
|
1626
1258
|
}
|
1627
|
-
|
1628
|
-
return
|
1629
|
-
return this.queryAndCheckError(Documents.GetMedicalContraindication, { id: id });
|
1630
|
-
});
|
1259
|
+
async createMedicalDevice(MedicalDevice) {
|
1260
|
+
return this.mutateAndCheckError(Documents.CreateMedicalDevice, { MedicalDevice: MedicalDevice });
|
1631
1261
|
}
|
1632
|
-
|
1633
|
-
return
|
1634
|
-
return this.queryAndCheckError(Documents.QueryMedicalContraindications, { filter: filter });
|
1635
|
-
});
|
1262
|
+
async updateMedicalDevice(MedicalDevice) {
|
1263
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalDevice, { MedicalDevice: MedicalDevice });
|
1636
1264
|
}
|
1637
|
-
|
1638
|
-
return
|
1639
|
-
return this.mutateAndCheckError(Documents.CreateMedicalTest, { MedicalTest: MedicalTest });
|
1640
|
-
});
|
1265
|
+
async deleteMedicalDevice(id) {
|
1266
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDevice, { id: id });
|
1641
1267
|
}
|
1642
|
-
|
1643
|
-
return
|
1644
|
-
|
1268
|
+
async deleteMedicalDevices(ids, isSynchronous) {
|
1269
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDevices, {
|
1270
|
+
ids: ids,
|
1271
|
+
isSynchronous: isSynchronous,
|
1645
1272
|
});
|
1646
1273
|
}
|
1647
|
-
|
1648
|
-
return
|
1649
|
-
|
1274
|
+
async deleteAllMedicalDevices(filter, isSynchronous, correlationId) {
|
1275
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalDevices, {
|
1276
|
+
filter: filter,
|
1277
|
+
isSynchronous: isSynchronous,
|
1278
|
+
correlationId: correlationId,
|
1650
1279
|
});
|
1651
1280
|
}
|
1652
|
-
|
1653
|
-
return
|
1654
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalTests, { ids: ids, isSynchronous: isSynchronous });
|
1655
|
-
});
|
1281
|
+
async getMedicalDevice(id) {
|
1282
|
+
return this.queryAndCheckError(Documents.GetMedicalDevice, { id: id });
|
1656
1283
|
}
|
1657
|
-
|
1658
|
-
return
|
1659
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalTests, {
|
1660
|
-
filter: filter,
|
1661
|
-
isSynchronous: isSynchronous,
|
1662
|
-
correlationId: correlationId,
|
1663
|
-
});
|
1664
|
-
});
|
1284
|
+
async queryMedicalDevices(filter) {
|
1285
|
+
return this.queryAndCheckError(Documents.QueryMedicalDevices, { filter: filter });
|
1665
1286
|
}
|
1666
|
-
|
1667
|
-
return
|
1668
|
-
return this.queryAndCheckError(Documents.GetMedicalTest, { id: id });
|
1669
|
-
});
|
1287
|
+
async createMedicalProcedure(MedicalProcedure) {
|
1288
|
+
return this.mutateAndCheckError(Documents.CreateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
|
1670
1289
|
}
|
1671
|
-
|
1672
|
-
return
|
1673
|
-
return this.queryAndCheckError(Documents.QueryMedicalTests, { filter: filter });
|
1674
|
-
});
|
1290
|
+
async updateMedicalProcedure(MedicalProcedure) {
|
1291
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
|
1675
1292
|
}
|
1676
|
-
|
1677
|
-
return
|
1678
|
-
return this.mutateAndCheckError(Documents.CreateMedicalDevice, { MedicalDevice: MedicalDevice });
|
1679
|
-
});
|
1293
|
+
async deleteMedicalProcedure(id) {
|
1294
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalProcedure, { id: id });
|
1680
1295
|
}
|
1681
|
-
|
1682
|
-
return
|
1683
|
-
|
1296
|
+
async deleteMedicalProcedures(ids, isSynchronous) {
|
1297
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalProcedures, {
|
1298
|
+
ids: ids,
|
1299
|
+
isSynchronous: isSynchronous,
|
1684
1300
|
});
|
1685
1301
|
}
|
1686
|
-
|
1687
|
-
return
|
1688
|
-
|
1302
|
+
async deleteAllMedicalProcedures(filter, isSynchronous, correlationId) {
|
1303
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalProcedures, {
|
1304
|
+
filter: filter,
|
1305
|
+
isSynchronous: isSynchronous,
|
1306
|
+
correlationId: correlationId,
|
1689
1307
|
});
|
1690
1308
|
}
|
1691
|
-
|
1692
|
-
return
|
1693
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDevices, {
|
1694
|
-
ids: ids,
|
1695
|
-
isSynchronous: isSynchronous,
|
1696
|
-
});
|
1697
|
-
});
|
1309
|
+
async getMedicalProcedure(id) {
|
1310
|
+
return this.queryAndCheckError(Documents.GetMedicalProcedure, { id: id });
|
1698
1311
|
}
|
1699
|
-
|
1700
|
-
return
|
1701
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalDevices, {
|
1702
|
-
filter: filter,
|
1703
|
-
isSynchronous: isSynchronous,
|
1704
|
-
correlationId: correlationId,
|
1705
|
-
});
|
1706
|
-
});
|
1312
|
+
async queryMedicalProcedures(filter) {
|
1313
|
+
return this.queryAndCheckError(Documents.QueryMedicalProcedures, { filter: filter });
|
1707
1314
|
}
|
1708
|
-
|
1709
|
-
return
|
1710
|
-
return this.queryAndCheckError(Documents.GetMedicalDevice, { id: id });
|
1711
|
-
});
|
1315
|
+
async createMedicalStudy(MedicalStudy) {
|
1316
|
+
return this.mutateAndCheckError(Documents.CreateMedicalStudy, { MedicalStudy: MedicalStudy });
|
1712
1317
|
}
|
1713
|
-
|
1714
|
-
return
|
1715
|
-
return this.queryAndCheckError(Documents.QueryMedicalDevices, { filter: filter });
|
1716
|
-
});
|
1318
|
+
async updateMedicalStudy(MedicalStudy) {
|
1319
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalStudy, { MedicalStudy: MedicalStudy });
|
1717
1320
|
}
|
1718
|
-
|
1719
|
-
return
|
1720
|
-
return this.mutateAndCheckError(Documents.CreateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
|
1721
|
-
});
|
1321
|
+
async deleteMedicalStudy(id) {
|
1322
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalStudy, { id: id });
|
1722
1323
|
}
|
1723
|
-
|
1724
|
-
return
|
1725
|
-
|
1324
|
+
async deleteMedicalStudies(ids, isSynchronous) {
|
1325
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalStudies, {
|
1326
|
+
ids: ids,
|
1327
|
+
isSynchronous: isSynchronous,
|
1726
1328
|
});
|
1727
1329
|
}
|
1728
|
-
|
1729
|
-
return
|
1730
|
-
|
1330
|
+
async deleteAllMedicalStudies(filter, isSynchronous, correlationId) {
|
1331
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalStudies, {
|
1332
|
+
filter: filter,
|
1333
|
+
isSynchronous: isSynchronous,
|
1334
|
+
correlationId: correlationId,
|
1731
1335
|
});
|
1732
1336
|
}
|
1733
|
-
|
1734
|
-
return
|
1735
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalProcedures, {
|
1736
|
-
ids: ids,
|
1737
|
-
isSynchronous: isSynchronous,
|
1738
|
-
});
|
1739
|
-
});
|
1337
|
+
async getMedicalStudy(id) {
|
1338
|
+
return this.queryAndCheckError(Documents.GetMedicalStudy, { id: id });
|
1740
1339
|
}
|
1741
|
-
|
1742
|
-
return
|
1743
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalProcedures, {
|
1744
|
-
filter: filter,
|
1745
|
-
isSynchronous: isSynchronous,
|
1746
|
-
correlationId: correlationId,
|
1747
|
-
});
|
1748
|
-
});
|
1340
|
+
async queryMedicalStudies(filter) {
|
1341
|
+
return this.queryAndCheckError(Documents.QueryMedicalStudies, { filter: filter });
|
1749
1342
|
}
|
1750
|
-
|
1751
|
-
return
|
1752
|
-
return this.queryAndCheckError(Documents.GetMedicalProcedure, { id: id });
|
1753
|
-
});
|
1343
|
+
async createMedicalDrugClass(MedicalDrugClass) {
|
1344
|
+
return this.mutateAndCheckError(Documents.CreateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
|
1754
1345
|
}
|
1755
|
-
|
1756
|
-
return
|
1757
|
-
return this.queryAndCheckError(Documents.QueryMedicalProcedures, { filter: filter });
|
1758
|
-
});
|
1346
|
+
async updateMedicalDrugClass(MedicalDrugClass) {
|
1347
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
|
1759
1348
|
}
|
1760
|
-
|
1761
|
-
return
|
1762
|
-
return this.mutateAndCheckError(Documents.CreateMedicalStudy, { MedicalStudy: MedicalStudy });
|
1763
|
-
});
|
1349
|
+
async deleteMedicalDrugClass(id) {
|
1350
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrugClass, { id: id });
|
1764
1351
|
}
|
1765
|
-
|
1766
|
-
return
|
1767
|
-
|
1352
|
+
async deleteMedicalDrugClasses(ids, isSynchronous) {
|
1353
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrugClasses, {
|
1354
|
+
ids: ids,
|
1355
|
+
isSynchronous: isSynchronous,
|
1768
1356
|
});
|
1769
1357
|
}
|
1770
|
-
|
1771
|
-
return
|
1772
|
-
|
1358
|
+
async deleteAllMedicalDrugClasses(filter, isSynchronous, correlationId) {
|
1359
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugClasses, {
|
1360
|
+
filter: filter,
|
1361
|
+
isSynchronous: isSynchronous,
|
1362
|
+
correlationId: correlationId,
|
1773
1363
|
});
|
1774
1364
|
}
|
1775
|
-
|
1776
|
-
return
|
1777
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalStudies, {
|
1778
|
-
ids: ids,
|
1779
|
-
isSynchronous: isSynchronous,
|
1780
|
-
});
|
1781
|
-
});
|
1365
|
+
async getMedicalDrugClass(id) {
|
1366
|
+
return this.queryAndCheckError(Documents.GetMedicalDrugClass, { id: id });
|
1782
1367
|
}
|
1783
|
-
|
1784
|
-
return
|
1785
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalStudies, {
|
1786
|
-
filter: filter,
|
1787
|
-
isSynchronous: isSynchronous,
|
1788
|
-
correlationId: correlationId,
|
1789
|
-
});
|
1790
|
-
});
|
1368
|
+
async queryMedicalDrugClasses(filter) {
|
1369
|
+
return this.queryAndCheckError(Documents.QueryMedicalDrugClasses, { filter: filter });
|
1791
1370
|
}
|
1792
|
-
|
1793
|
-
return
|
1794
|
-
return this.queryAndCheckError(Documents.GetMedicalStudy, { id: id });
|
1795
|
-
});
|
1371
|
+
async createMedicalTherapy(MedicalTherapy) {
|
1372
|
+
return this.mutateAndCheckError(Documents.CreateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
|
1796
1373
|
}
|
1797
|
-
|
1798
|
-
return
|
1799
|
-
return this.queryAndCheckError(Documents.QueryMedicalStudies, { filter: filter });
|
1800
|
-
});
|
1374
|
+
async updateMedicalTherapy(MedicalTherapy) {
|
1375
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
|
1801
1376
|
}
|
1802
|
-
|
1803
|
-
return
|
1804
|
-
return this.mutateAndCheckError(Documents.CreateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
|
1805
|
-
});
|
1377
|
+
async deleteMedicalTherapy(id) {
|
1378
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTherapy, { id: id });
|
1806
1379
|
}
|
1807
|
-
|
1808
|
-
return
|
1809
|
-
|
1380
|
+
async deleteMedicalTherapies(ids, isSynchronous) {
|
1381
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTherapies, {
|
1382
|
+
ids: ids,
|
1383
|
+
isSynchronous: isSynchronous,
|
1810
1384
|
});
|
1811
1385
|
}
|
1812
|
-
|
1813
|
-
return
|
1814
|
-
|
1386
|
+
async deleteAllMedicalTherapies(filter, isSynchronous, correlationId) {
|
1387
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalTherapies, {
|
1388
|
+
filter: filter,
|
1389
|
+
isSynchronous: isSynchronous,
|
1390
|
+
correlationId: correlationId,
|
1815
1391
|
});
|
1816
1392
|
}
|
1817
|
-
|
1818
|
-
return
|
1819
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDrugClasses, {
|
1820
|
-
ids: ids,
|
1821
|
-
isSynchronous: isSynchronous,
|
1822
|
-
});
|
1823
|
-
});
|
1393
|
+
async getMedicalTherapy(id) {
|
1394
|
+
return this.queryAndCheckError(Documents.GetMedicalTherapy, { id: id });
|
1824
1395
|
}
|
1825
|
-
|
1826
|
-
return
|
1827
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugClasses, {
|
1828
|
-
filter: filter,
|
1829
|
-
isSynchronous: isSynchronous,
|
1830
|
-
correlationId: correlationId,
|
1831
|
-
});
|
1832
|
-
});
|
1396
|
+
async queryMedicalTherapies(filter) {
|
1397
|
+
return this.queryAndCheckError(Documents.QueryMedicalTherapies, { filter: filter });
|
1833
1398
|
}
|
1834
|
-
|
1835
|
-
return
|
1836
|
-
return this.queryAndCheckError(Documents.GetMedicalDrugClass, { id: id });
|
1837
|
-
});
|
1399
|
+
async createObservation(observation) {
|
1400
|
+
return this.mutateAndCheckError(Documents.CreateObservation, { observation: observation });
|
1838
1401
|
}
|
1839
|
-
|
1840
|
-
return
|
1841
|
-
return this.queryAndCheckError(Documents.QueryMedicalDrugClasses, { filter: filter });
|
1842
|
-
});
|
1402
|
+
async updateObservation(observation) {
|
1403
|
+
return this.mutateAndCheckError(Documents.UpdateObservation, { observation: observation });
|
1843
1404
|
}
|
1844
|
-
|
1845
|
-
return
|
1846
|
-
return this.mutateAndCheckError(Documents.CreateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
|
1847
|
-
});
|
1405
|
+
async deleteObservation(id) {
|
1406
|
+
return this.mutateAndCheckError(Documents.DeleteObservation, { id: id });
|
1848
1407
|
}
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1408
|
+
/**
|
1409
|
+
* Creates an event handler that supports UI streaming mode
|
1410
|
+
* @internal
|
1411
|
+
*/
|
1412
|
+
/**
|
1413
|
+
* Check if streaming is supported with the current configuration
|
1414
|
+
* @param specification - Optional specification to check compatibility
|
1415
|
+
* @returns true if streaming is available, false otherwise
|
1416
|
+
*/
|
1417
|
+
supportsStreaming(specification) {
|
1418
|
+
// If we have a full specification, check its service type
|
1419
|
+
if (specification && "modelService" in specification) {
|
1420
|
+
const serviceType = specification.modelService;
|
1421
|
+
switch (serviceType) {
|
1422
|
+
case Types.ModelServiceTypes.OpenAi:
|
1423
|
+
return typeof OpenAI !== "undefined";
|
1424
|
+
case Types.ModelServiceTypes.Anthropic:
|
1425
|
+
return typeof Anthropic !== "undefined";
|
1426
|
+
case Types.ModelServiceTypes.Google:
|
1427
|
+
return typeof GoogleGenerativeAI !== "undefined";
|
1428
|
+
default:
|
1429
|
+
return false;
|
1430
|
+
}
|
1431
|
+
}
|
1432
|
+
// If we only have a reference or no specification, check if any client is available
|
1433
|
+
const hasOpenAI = typeof OpenAI !== "undefined";
|
1434
|
+
const hasAnthropic = typeof Anthropic !== "undefined";
|
1435
|
+
const hasGoogle = typeof GoogleGenerativeAI !== "undefined";
|
1436
|
+
return hasOpenAI || hasAnthropic || hasGoogle;
|
1437
|
+
}
|
1438
|
+
/**
|
1439
|
+
* Execute an agent with non-streaming response
|
1440
|
+
* @param prompt - The user prompt
|
1441
|
+
* @param conversationId - Optional conversation ID to continue
|
1442
|
+
* @param specification - Optional specification for the LLM
|
1443
|
+
* @param tools - Optional tool definitions
|
1444
|
+
* @param toolHandlers - Optional tool handler functions
|
1445
|
+
* @param options - Agent options
|
1446
|
+
* @returns Complete agent result with message and tool calls
|
1447
|
+
*/
|
1448
|
+
async promptAgent(prompt, conversationId, specification, tools, toolHandlers, options, mimeType, data, // base64 encoded
|
1449
|
+
correlationId) {
|
1450
|
+
const startTime = Date.now();
|
1451
|
+
const maxRounds = options?.maxToolRounds || 10;
|
1452
|
+
const timeout = options?.timeout || 300000; // 5 minutes default
|
1453
|
+
// Create abort controller for timeout
|
1454
|
+
const abortController = new AbortController();
|
1455
|
+
const timeoutId = setTimeout(() => abortController.abort(), timeout);
|
1456
|
+
try {
|
1457
|
+
// 1. Ensure conversation exists
|
1458
|
+
let actualConversationId = conversationId;
|
1459
|
+
if (!actualConversationId) {
|
1460
|
+
const createResponse = await this.createConversation({
|
1461
|
+
name: `Agent conversation`,
|
1462
|
+
specification: specification,
|
1463
|
+
tools: tools,
|
1464
|
+
}, correlationId);
|
1465
|
+
actualConversationId = createResponse.createConversation?.id;
|
1466
|
+
if (!actualConversationId) {
|
1467
|
+
throw new Error("Failed to create conversation");
|
1468
|
+
}
|
1469
|
+
}
|
1470
|
+
// 2. Initial prompt
|
1471
|
+
const promptResponse = await this.promptConversation(prompt, actualConversationId, specification, mimeType, data, tools, false, // requireTool
|
1472
|
+
false, // includeDetails
|
1473
|
+
correlationId);
|
1474
|
+
let currentMessage = promptResponse.promptConversation?.message;
|
1475
|
+
if (!currentMessage) {
|
1476
|
+
throw new Error("No message in prompt response");
|
1477
|
+
}
|
1478
|
+
// 3. Tool calling loop
|
1479
|
+
const allToolCalls = [];
|
1480
|
+
let rounds = 0;
|
1481
|
+
let totalTokens = 0;
|
1482
|
+
while (currentMessage.toolCalls?.length &&
|
1483
|
+
rounds < maxRounds &&
|
1484
|
+
!abortController.signal.aborted) {
|
1485
|
+
rounds++;
|
1486
|
+
// Execute tools
|
1487
|
+
const toolResults = await this.executeToolsForPromptAgent(currentMessage.toolCalls.filter((tc) => tc !== null), toolHandlers || {}, allToolCalls, abortController.signal);
|
1488
|
+
if (abortController.signal.aborted) {
|
1489
|
+
throw new Error("Operation timed out");
|
1490
|
+
}
|
1491
|
+
// Continue conversation
|
1492
|
+
const continueResponse = await this.continueConversation(actualConversationId, toolResults, correlationId);
|
1493
|
+
currentMessage = continueResponse.continueConversation?.message;
|
1494
|
+
if (!currentMessage)
|
1495
|
+
break;
|
1496
|
+
// Track token usage
|
1497
|
+
if (continueResponse.continueConversation?.message?.tokens) {
|
1498
|
+
totalTokens += continueResponse.continueConversation.message.tokens;
|
1499
|
+
}
|
1500
|
+
}
|
1501
|
+
return {
|
1502
|
+
message: currentMessage?.message || "",
|
1503
|
+
conversationId: actualConversationId,
|
1504
|
+
};
|
1505
|
+
}
|
1506
|
+
catch (error) {
|
1507
|
+
// Return partial result with error
|
1508
|
+
const isTimeout = error.message === "Operation timed out";
|
1509
|
+
return {
|
1510
|
+
message: "",
|
1511
|
+
conversationId: conversationId || "",
|
1512
|
+
error: {
|
1513
|
+
message: error.message || "Unknown error",
|
1514
|
+
code: error.code || (isTimeout ? "TIMEOUT" : "UNKNOWN"),
|
1515
|
+
recoverable: isTimeout || error.code === "RATE_LIMIT",
|
1516
|
+
details: error.response?.data,
|
1517
|
+
},
|
1518
|
+
};
|
1519
|
+
}
|
1520
|
+
finally {
|
1521
|
+
clearTimeout(timeoutId);
|
1522
|
+
}
|
1853
1523
|
}
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1524
|
+
/**
|
1525
|
+
* Execute an agent with streaming response
|
1526
|
+
* @param prompt - The user prompt
|
1527
|
+
* @param onEvent - Event handler for streaming events
|
1528
|
+
* @param conversationId - Optional conversation ID to continue
|
1529
|
+
* @param specification - Optional specification for the LLM
|
1530
|
+
* @param tools - Optional tool definitions
|
1531
|
+
* @param toolHandlers - Optional tool handler functions
|
1532
|
+
* @param options - Stream agent options
|
1533
|
+
* @throws Error if streaming is not supported
|
1534
|
+
*/
|
1535
|
+
async streamAgent(prompt, onEvent, conversationId, specification, tools, toolHandlers, options, mimeType, data, // base64 encoded
|
1536
|
+
correlationId) {
|
1537
|
+
const maxRounds = options?.maxToolRounds || 100;
|
1538
|
+
const abortSignal = options?.abortSignal;
|
1539
|
+
let uiAdapter;
|
1540
|
+
// Check if already aborted
|
1541
|
+
if (abortSignal?.aborted) {
|
1542
|
+
throw new Error("Operation aborted");
|
1543
|
+
}
|
1544
|
+
try {
|
1545
|
+
// Get full specification if needed
|
1546
|
+
const fullSpec = specification?.id
|
1547
|
+
? (await this.getSpecification(specification.id))
|
1548
|
+
.specification
|
1549
|
+
: undefined;
|
1550
|
+
// Check streaming support
|
1551
|
+
if (!this.supportsStreaming(fullSpec)) {
|
1552
|
+
throw new Error("Streaming is not supported for this specification. " +
|
1553
|
+
"Use promptAgent() instead or configure a streaming client.");
|
1554
|
+
}
|
1555
|
+
// Ensure conversation
|
1556
|
+
let actualConversationId = conversationId;
|
1557
|
+
if (!actualConversationId) {
|
1558
|
+
const createResponse = await this.createConversation({
|
1559
|
+
name: `Streaming agent conversation`,
|
1560
|
+
specification: specification,
|
1561
|
+
tools: tools,
|
1562
|
+
}, correlationId);
|
1563
|
+
actualConversationId = createResponse.createConversation?.id;
|
1564
|
+
if (!actualConversationId) {
|
1565
|
+
throw new Error("Failed to create conversation");
|
1566
|
+
}
|
1567
|
+
}
|
1568
|
+
// Create UI event adapter
|
1569
|
+
uiAdapter = new UIEventAdapter(onEvent, actualConversationId, {
|
1570
|
+
showTokenStream: options?.showTokenStream ?? true,
|
1571
|
+
smoothingEnabled: options?.smoothingEnabled ?? true,
|
1572
|
+
chunkingStrategy: options?.chunkingStrategy ?? "word",
|
1573
|
+
smoothingDelay: options?.smoothingDelay ?? 30,
|
1574
|
+
});
|
1575
|
+
// Start the streaming conversation
|
1576
|
+
await this.executeStreamingAgent(prompt, actualConversationId, fullSpec, tools, toolHandlers, uiAdapter, maxRounds, abortSignal, mimeType, data, correlationId);
|
1577
|
+
}
|
1578
|
+
catch (error) {
|
1579
|
+
const errorMessage = error instanceof Error ? error.message : "Streaming failed";
|
1580
|
+
if (uiAdapter) {
|
1581
|
+
uiAdapter.handleEvent({
|
1582
|
+
type: "error",
|
1583
|
+
error: errorMessage,
|
1584
|
+
});
|
1585
|
+
}
|
1586
|
+
else {
|
1587
|
+
// Fallback error event
|
1588
|
+
onEvent({
|
1589
|
+
type: "error",
|
1590
|
+
error: {
|
1591
|
+
message: errorMessage,
|
1592
|
+
recoverable: false,
|
1593
|
+
},
|
1594
|
+
conversationId: conversationId || "",
|
1595
|
+
timestamp: new Date(),
|
1596
|
+
});
|
1597
|
+
}
|
1598
|
+
throw error;
|
1599
|
+
}
|
1600
|
+
finally {
|
1601
|
+
// Clean up adapter
|
1602
|
+
if (uiAdapter) {
|
1603
|
+
uiAdapter.dispose();
|
1604
|
+
}
|
1605
|
+
}
|
1858
1606
|
}
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1607
|
+
/**
|
1608
|
+
* Execute the streaming agent workflow with tool calling loop
|
1609
|
+
*/
|
1610
|
+
async executeStreamingAgent(prompt, conversationId, specification, tools, toolHandlers, uiAdapter, maxRounds, abortSignal, mimeType, data, correlationId) {
|
1611
|
+
let currentRound = 0;
|
1612
|
+
let fullMessage = "";
|
1613
|
+
// Start the conversation
|
1614
|
+
uiAdapter.handleEvent({
|
1615
|
+
type: "start",
|
1616
|
+
conversationId,
|
1617
|
+
});
|
1618
|
+
// Format conversation once at the beginning
|
1619
|
+
const formatResponse = await this.formatConversation(prompt, conversationId, { id: specification.id }, tools, true, correlationId);
|
1620
|
+
const formattedPrompt = formatResponse.formatConversation?.message?.message;
|
1621
|
+
if (!formattedPrompt) {
|
1622
|
+
throw new Error("Failed to format conversation");
|
1623
|
+
}
|
1624
|
+
// Build message array with conversation history
|
1625
|
+
const messages = [];
|
1626
|
+
// Add system prompt if specified
|
1627
|
+
if (specification.systemPrompt) {
|
1628
|
+
messages.push({
|
1629
|
+
__typename: "ConversationMessage",
|
1630
|
+
role: Types.ConversationRoleTypes.System,
|
1631
|
+
message: specification.systemPrompt,
|
1632
|
+
timestamp: new Date().toISOString(),
|
1864
1633
|
});
|
1865
|
-
}
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1634
|
+
}
|
1635
|
+
// Get conversation history to maintain context
|
1636
|
+
const conversationResponse = await this.getConversation(conversationId);
|
1637
|
+
const conversation = conversationResponse.conversation;
|
1638
|
+
if (conversation?.messages && conversation.messages.length > 0) {
|
1639
|
+
// Add all previous messages (formatConversation already added the current prompt)
|
1640
|
+
const previousMessages = conversation.messages;
|
1641
|
+
messages.push(...previousMessages);
|
1642
|
+
}
|
1643
|
+
else {
|
1644
|
+
// If no history, just add the current user message
|
1645
|
+
messages.push({
|
1646
|
+
__typename: "ConversationMessage",
|
1647
|
+
role: Types.ConversationRoleTypes.User,
|
1648
|
+
message: formattedPrompt,
|
1649
|
+
timestamp: new Date().toISOString(),
|
1873
1650
|
});
|
1651
|
+
}
|
1652
|
+
const serviceType = getServiceType(specification);
|
1653
|
+
// Handle tool calling loop locally
|
1654
|
+
while (currentRound < maxRounds) {
|
1655
|
+
if (abortSignal?.aborted) {
|
1656
|
+
throw new Error("Operation aborted");
|
1657
|
+
}
|
1658
|
+
let toolCalls = [];
|
1659
|
+
let roundMessage = "";
|
1660
|
+
// Stream with appropriate provider
|
1661
|
+
if (serviceType === Types.ModelServiceTypes.OpenAi && OpenAI) {
|
1662
|
+
const openaiMessages = formatMessagesForOpenAI(messages);
|
1663
|
+
await this.streamWithOpenAI(specification, openaiMessages, tools, uiAdapter, (message, calls) => {
|
1664
|
+
roundMessage = message;
|
1665
|
+
toolCalls = calls;
|
1666
|
+
});
|
1667
|
+
}
|
1668
|
+
else if (serviceType === Types.ModelServiceTypes.Anthropic &&
|
1669
|
+
Anthropic) {
|
1670
|
+
const { system, messages: anthropicMessages } = formatMessagesForAnthropic(messages);
|
1671
|
+
await this.streamWithAnthropic(specification, anthropicMessages, system, tools, uiAdapter, (message, calls) => {
|
1672
|
+
roundMessage = message;
|
1673
|
+
toolCalls = calls;
|
1674
|
+
});
|
1675
|
+
}
|
1676
|
+
else if (serviceType === Types.ModelServiceTypes.Google &&
|
1677
|
+
GoogleGenerativeAI) {
|
1678
|
+
const googleMessages = formatMessagesForGoogle(messages);
|
1679
|
+
// Google doesn't use system prompts separately, they're incorporated into messages
|
1680
|
+
await this.streamWithGoogle(specification, googleMessages, undefined, // systemPrompt - Google handles this differently
|
1681
|
+
tools, uiAdapter, (message, calls) => {
|
1682
|
+
roundMessage = message;
|
1683
|
+
toolCalls = calls;
|
1684
|
+
});
|
1685
|
+
}
|
1686
|
+
else {
|
1687
|
+
// Fallback to non-streaming
|
1688
|
+
await this.fallbackToNonStreaming(prompt, conversationId, specification, tools, mimeType, data, uiAdapter, correlationId);
|
1689
|
+
break;
|
1690
|
+
}
|
1691
|
+
// Update the full message
|
1692
|
+
fullMessage = roundMessage;
|
1693
|
+
// If no tool calls, we're done
|
1694
|
+
if (!toolCalls || toolCalls.length === 0) {
|
1695
|
+
break;
|
1696
|
+
}
|
1697
|
+
// Execute tools and prepare for next round
|
1698
|
+
if (toolHandlers && toolCalls.length > 0) {
|
1699
|
+
// Add assistant message with tool calls to conversation
|
1700
|
+
const assistantMessage = {
|
1701
|
+
__typename: "ConversationMessage",
|
1702
|
+
role: Types.ConversationRoleTypes.Assistant,
|
1703
|
+
message: roundMessage,
|
1704
|
+
toolCalls: toolCalls,
|
1705
|
+
timestamp: new Date().toISOString(),
|
1706
|
+
};
|
1707
|
+
messages.push(assistantMessage);
|
1708
|
+
// Execute tools and add responses
|
1709
|
+
for (const toolCall of toolCalls) {
|
1710
|
+
const handler = toolHandlers[toolCall.name];
|
1711
|
+
if (!handler) {
|
1712
|
+
console.warn(`No handler for tool: ${toolCall.name}`);
|
1713
|
+
continue;
|
1714
|
+
}
|
1715
|
+
try {
|
1716
|
+
const args = JSON.parse(toolCall.arguments);
|
1717
|
+
// Update UI
|
1718
|
+
uiAdapter.handleEvent({
|
1719
|
+
type: "tool_call_start",
|
1720
|
+
toolCall: {
|
1721
|
+
id: toolCall.id,
|
1722
|
+
name: toolCall.name,
|
1723
|
+
},
|
1724
|
+
});
|
1725
|
+
// Execute tool
|
1726
|
+
const result = await handler(args);
|
1727
|
+
// Update UI
|
1728
|
+
uiAdapter.setToolResult(toolCall.id, result);
|
1729
|
+
// Add tool response to messages
|
1730
|
+
messages.push({
|
1731
|
+
__typename: "ConversationMessage",
|
1732
|
+
role: Types.ConversationRoleTypes.Tool,
|
1733
|
+
message: typeof result === "string" ? result : JSON.stringify(result),
|
1734
|
+
toolCallId: toolCall.id,
|
1735
|
+
timestamp: new Date().toISOString(),
|
1736
|
+
});
|
1737
|
+
}
|
1738
|
+
catch (error) {
|
1739
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
1740
|
+
console.error(`Tool execution error for ${toolCall.name}:`, error);
|
1741
|
+
// Update UI with error
|
1742
|
+
uiAdapter.setToolResult(toolCall.id, undefined, errorMessage);
|
1743
|
+
// Add error response
|
1744
|
+
messages.push({
|
1745
|
+
__typename: "ConversationMessage",
|
1746
|
+
role: Types.ConversationRoleTypes.Tool,
|
1747
|
+
message: `Error: ${errorMessage}`,
|
1748
|
+
toolCallId: toolCall.id,
|
1749
|
+
timestamp: new Date().toISOString(),
|
1750
|
+
});
|
1751
|
+
}
|
1752
|
+
}
|
1753
|
+
}
|
1754
|
+
currentRound++;
|
1755
|
+
}
|
1756
|
+
// Complete the conversation
|
1757
|
+
if (fullMessage) {
|
1758
|
+
await this.completeConversation(fullMessage.trim(), conversationId, correlationId);
|
1759
|
+
}
|
1760
|
+
// Emit completion event
|
1761
|
+
uiAdapter.handleEvent({
|
1762
|
+
type: "complete",
|
1763
|
+
conversationId,
|
1764
|
+
});
|
1765
|
+
}
|
1766
|
+
/**
|
1767
|
+
* Build message array for LLM from conversation history
|
1768
|
+
*/
|
1769
|
+
async buildMessageArray(conversationId, specification, currentPrompt) {
|
1770
|
+
const messages = [];
|
1771
|
+
// Add system prompt if present
|
1772
|
+
if (specification.systemPrompt) {
|
1773
|
+
const systemMessage = {
|
1774
|
+
__typename: "ConversationMessage",
|
1775
|
+
role: Types.ConversationRoleTypes.System,
|
1776
|
+
message: specification.systemPrompt,
|
1777
|
+
timestamp: new Date().toISOString(),
|
1778
|
+
};
|
1779
|
+
messages.push(systemMessage);
|
1780
|
+
}
|
1781
|
+
// Get conversation history
|
1782
|
+
const conversationResponse = await this.getConversation(conversationId);
|
1783
|
+
const conversation = conversationResponse.conversation;
|
1784
|
+
if (conversation?.messages && conversation.messages.length > 0) {
|
1785
|
+
// Add previous messages (excluding the current one)
|
1786
|
+
const previousMessages = conversation.messages.slice(0, -1);
|
1787
|
+
messages.push(...previousMessages);
|
1788
|
+
}
|
1789
|
+
// Add current user message
|
1790
|
+
const currentMessage = {
|
1791
|
+
__typename: "ConversationMessage",
|
1792
|
+
role: Types.ConversationRoleTypes.User, // Current prompt is from the user
|
1793
|
+
message: currentPrompt,
|
1794
|
+
timestamp: new Date().toISOString(),
|
1795
|
+
};
|
1796
|
+
messages.push(currentMessage);
|
1797
|
+
return messages;
|
1798
|
+
}
|
1799
|
+
/**
|
1800
|
+
* Execute tools during streaming with proper event emission
|
1801
|
+
*/
|
1802
|
+
async executeToolsInStream(toolCalls, toolHandlers, uiAdapter, abortSignal) {
|
1803
|
+
const toolPromises = toolCalls.map(async (toolCall) => {
|
1804
|
+
if (abortSignal?.aborted)
|
1805
|
+
return;
|
1806
|
+
const handler = toolHandlers[toolCall.name];
|
1807
|
+
if (!handler) {
|
1808
|
+
uiAdapter.setToolResult(toolCall.id, null, `No handler for tool: ${toolCall.name}`);
|
1809
|
+
return;
|
1810
|
+
}
|
1811
|
+
try {
|
1812
|
+
const args = toolCall.arguments ? JSON.parse(toolCall.arguments) : {};
|
1813
|
+
const result = await handler(args);
|
1814
|
+
uiAdapter.setToolResult(toolCall.id, result);
|
1815
|
+
}
|
1816
|
+
catch (error) {
|
1817
|
+
const errorMessage = error instanceof Error ? error.message : "Tool execution failed";
|
1818
|
+
uiAdapter.setToolResult(toolCall.id, null, errorMessage);
|
1819
|
+
}
|
1874
1820
|
});
|
1821
|
+
await Promise.all(toolPromises);
|
1822
|
+
}
|
1823
|
+
/**
|
1824
|
+
* Format tool results for API
|
1825
|
+
*/
|
1826
|
+
async formatToolResults(toolCalls, toolHandlers) {
|
1827
|
+
const results = [];
|
1828
|
+
for (const toolCall of toolCalls) {
|
1829
|
+
const handler = toolHandlers[toolCall.name];
|
1830
|
+
if (handler) {
|
1831
|
+
try {
|
1832
|
+
const args = toolCall.arguments ? JSON.parse(toolCall.arguments) : {};
|
1833
|
+
const result = await handler(args);
|
1834
|
+
results.push({
|
1835
|
+
id: toolCall.id,
|
1836
|
+
content: JSON.stringify(result),
|
1837
|
+
});
|
1838
|
+
}
|
1839
|
+
catch (error) {
|
1840
|
+
results.push({
|
1841
|
+
id: toolCall.id,
|
1842
|
+
content: JSON.stringify({
|
1843
|
+
error: error instanceof Error
|
1844
|
+
? error.message
|
1845
|
+
: "Tool execution failed",
|
1846
|
+
}),
|
1847
|
+
});
|
1848
|
+
}
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
return results;
|
1852
|
+
}
|
1853
|
+
/**
|
1854
|
+
* Fallback to non-streaming when streaming is not available
|
1855
|
+
*/
|
1856
|
+
async fallbackToNonStreaming(prompt, conversationId, specification, tools, mimeType, data, uiAdapter, correlationId) {
|
1857
|
+
const response = await this.promptConversation(prompt, conversationId, { id: specification.id }, mimeType, data, tools, false, false, correlationId);
|
1858
|
+
const message = response.promptConversation?.message;
|
1859
|
+
if (message?.message) {
|
1860
|
+
// Simulate streaming by emitting tokens
|
1861
|
+
const words = message.message.split(" ");
|
1862
|
+
for (let i = 0; i < words.length; i++) {
|
1863
|
+
const token = i === 0 ? words[i] : " " + words[i];
|
1864
|
+
uiAdapter.handleEvent({ type: "token", token });
|
1865
|
+
}
|
1866
|
+
uiAdapter.handleEvent({ type: "message", message: message.message });
|
1867
|
+
}
|
1875
1868
|
}
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1869
|
+
/**
|
1870
|
+
* Stream with OpenAI client
|
1871
|
+
*/
|
1872
|
+
async streamWithOpenAI(specification, messages, tools, uiAdapter, onComplete) {
|
1873
|
+
if (!OpenAI) {
|
1874
|
+
throw new Error("OpenAI client not available");
|
1875
|
+
}
|
1876
|
+
// Use provided client or create a new one
|
1877
|
+
const openaiClient = this.openaiClient ||
|
1878
|
+
new OpenAI({
|
1879
|
+
apiKey: process.env.OPENAI_API_KEY || "",
|
1880
|
+
});
|
1881
|
+
await streamWithOpenAI(specification, messages, tools, openaiClient, (event) => uiAdapter.handleEvent(event), onComplete);
|
1882
|
+
}
|
1883
|
+
/**
|
1884
|
+
* Stream with Anthropic client
|
1885
|
+
*/
|
1886
|
+
async streamWithAnthropic(specification, messages, systemPrompt, tools, uiAdapter, onComplete) {
|
1887
|
+
if (!Anthropic) {
|
1888
|
+
throw new Error("Anthropic client not available");
|
1889
|
+
}
|
1890
|
+
// Use provided client or create a new one
|
1891
|
+
const anthropicClient = this.anthropicClient ||
|
1892
|
+
new Anthropic({
|
1893
|
+
apiKey: process.env.ANTHROPIC_API_KEY || "",
|
1894
|
+
});
|
1895
|
+
await streamWithAnthropic(specification, messages, systemPrompt, tools, anthropicClient, (event) => uiAdapter.handleEvent(event), onComplete);
|
1896
|
+
}
|
1897
|
+
/**
|
1898
|
+
* Stream with Google client
|
1899
|
+
*/
|
1900
|
+
async streamWithGoogle(specification, messages, systemPrompt, tools, uiAdapter, onComplete) {
|
1901
|
+
if (!GoogleGenerativeAI) {
|
1902
|
+
throw new Error("Google GenerativeAI client not available");
|
1903
|
+
}
|
1904
|
+
// Use provided client or create a new one
|
1905
|
+
const googleClient = this.googleClient ||
|
1906
|
+
new GoogleGenerativeAI(process.env.GOOGLE_API_KEY || "");
|
1907
|
+
await streamWithGoogle(specification, messages, systemPrompt, tools, googleClient, (event) => uiAdapter.handleEvent(event), onComplete);
|
1908
|
+
}
|
1909
|
+
// Helper method to execute tools for promptAgent
|
1910
|
+
async executeToolsForPromptAgent(toolCalls, toolHandlers, allToolCalls, signal) {
|
1911
|
+
const responses = [];
|
1912
|
+
// Execute tools in parallel for better performance
|
1913
|
+
const toolPromises = toolCalls.map(async (toolCall) => {
|
1914
|
+
if (!toolCall || signal.aborted)
|
1915
|
+
return null;
|
1916
|
+
const startTime = Date.now();
|
1917
|
+
const handler = toolHandlers[toolCall.name || ""];
|
1918
|
+
let result;
|
1919
|
+
let error;
|
1920
|
+
try {
|
1921
|
+
if (!handler) {
|
1922
|
+
throw new Error(`No handler found for tool: ${toolCall.name}`);
|
1923
|
+
}
|
1924
|
+
const args = toolCall.arguments ? JSON.parse(toolCall.arguments) : {};
|
1925
|
+
// Add timeout for individual tool calls (30 seconds)
|
1926
|
+
const toolTimeout = new Promise((_, reject) => setTimeout(() => reject(new Error("Tool execution timeout")), 30000));
|
1927
|
+
result = await Promise.race([handler(args), toolTimeout]);
|
1928
|
+
}
|
1929
|
+
catch (e) {
|
1930
|
+
error = e.message || "Tool execution failed";
|
1931
|
+
console.error(`Tool ${toolCall.name} failed:`, e);
|
1932
|
+
}
|
1933
|
+
// Record for result
|
1934
|
+
const toolResult = {
|
1935
|
+
id: toolCall.id,
|
1936
|
+
name: toolCall.name || "",
|
1937
|
+
arguments: toolCall.arguments ? JSON.parse(toolCall.arguments) : {},
|
1938
|
+
result,
|
1939
|
+
error,
|
1940
|
+
duration: Date.now() - startTime,
|
1941
|
+
};
|
1942
|
+
allToolCalls.push(toolResult);
|
1943
|
+
// Response for API
|
1944
|
+
return {
|
1945
|
+
id: toolCall.id,
|
1946
|
+
content: error ? error : result ? JSON.stringify(result) : "",
|
1947
|
+
};
|
1948
|
+
});
|
1949
|
+
const results = await Promise.all(toolPromises);
|
1950
|
+
return results.filter((r) => r !== null);
|
1900
1951
|
}
|
1901
1952
|
// helper functions
|
1902
1953
|
prettyPrintGraphQLError(err) {
|
@@ -1915,82 +1966,80 @@ class Graphlit {
|
|
1915
1966
|
}
|
1916
1967
|
return parts.join(" ");
|
1917
1968
|
}
|
1918
|
-
mutateAndCheckError(mutation, variables) {
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
throw new Error(errorMessage);
|
1932
|
-
}
|
1933
|
-
if (!result.data) {
|
1934
|
-
throw new Error("No data returned from mutation.");
|
1935
|
-
}
|
1936
|
-
return result.data;
|
1969
|
+
async mutateAndCheckError(mutation, variables) {
|
1970
|
+
if (this.client === undefined)
|
1971
|
+
throw new Error("Apollo Client not configured.");
|
1972
|
+
try {
|
1973
|
+
const result = await this.client.mutate({
|
1974
|
+
mutation,
|
1975
|
+
variables: variables || {},
|
1976
|
+
});
|
1977
|
+
if (result.errors) {
|
1978
|
+
const errorMessage = result.errors
|
1979
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
1980
|
+
.join("\n");
|
1981
|
+
throw new Error(errorMessage);
|
1937
1982
|
}
|
1938
|
-
|
1939
|
-
|
1940
|
-
const errorMessage = error.graphQLErrors
|
1941
|
-
.map((err) => this.prettyPrintGraphQLError(err))
|
1942
|
-
.join("\n");
|
1943
|
-
console.error(errorMessage);
|
1944
|
-
throw new Error(errorMessage);
|
1945
|
-
}
|
1946
|
-
if (error instanceof Error) {
|
1947
|
-
console.error(error.message);
|
1948
|
-
throw error;
|
1949
|
-
}
|
1950
|
-
else {
|
1951
|
-
throw error;
|
1952
|
-
}
|
1983
|
+
if (!result.data) {
|
1984
|
+
throw new Error("No data returned from mutation.");
|
1953
1985
|
}
|
1954
|
-
|
1986
|
+
return result.data;
|
1987
|
+
}
|
1988
|
+
catch (error) {
|
1989
|
+
if (error instanceof ApolloError && error.graphQLErrors.length > 0) {
|
1990
|
+
const errorMessage = error.graphQLErrors
|
1991
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
1992
|
+
.join("\n");
|
1993
|
+
console.error(errorMessage);
|
1994
|
+
throw new Error(errorMessage);
|
1995
|
+
}
|
1996
|
+
if (error instanceof Error) {
|
1997
|
+
console.error(error.message);
|
1998
|
+
throw error;
|
1999
|
+
}
|
2000
|
+
else {
|
2001
|
+
throw error;
|
2002
|
+
}
|
2003
|
+
}
|
1955
2004
|
}
|
1956
|
-
queryAndCheckError(query, variables) {
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
throw new Error(errorMessage);
|
1970
|
-
}
|
1971
|
-
if (!result.data) {
|
1972
|
-
throw new Error("No data returned from query.");
|
1973
|
-
}
|
1974
|
-
return result.data;
|
2005
|
+
async queryAndCheckError(query, variables) {
|
2006
|
+
if (this.client === undefined)
|
2007
|
+
throw new Error("Apollo Client not configured.");
|
2008
|
+
try {
|
2009
|
+
const result = await this.client.query({
|
2010
|
+
query,
|
2011
|
+
variables: variables || {},
|
2012
|
+
});
|
2013
|
+
if (result.errors) {
|
2014
|
+
const errorMessage = result.errors
|
2015
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
2016
|
+
.join("\n");
|
2017
|
+
throw new Error(errorMessage);
|
1975
2018
|
}
|
1976
|
-
|
1977
|
-
|
1978
|
-
const errorMessage = error.graphQLErrors
|
1979
|
-
.map((err) => this.prettyPrintGraphQLError(err))
|
1980
|
-
.join("\n");
|
1981
|
-
console.error(errorMessage);
|
1982
|
-
throw new Error(errorMessage);
|
1983
|
-
}
|
1984
|
-
if (error instanceof Error) {
|
1985
|
-
console.error(error.message);
|
1986
|
-
throw error;
|
1987
|
-
}
|
1988
|
-
else {
|
1989
|
-
throw error;
|
1990
|
-
}
|
2019
|
+
if (!result.data) {
|
2020
|
+
throw new Error("No data returned from query.");
|
1991
2021
|
}
|
1992
|
-
|
2022
|
+
return result.data;
|
2023
|
+
}
|
2024
|
+
catch (error) {
|
2025
|
+
if (error instanceof ApolloError && error.graphQLErrors.length > 0) {
|
2026
|
+
const errorMessage = error.graphQLErrors
|
2027
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
2028
|
+
.join("\n");
|
2029
|
+
console.error(errorMessage);
|
2030
|
+
throw new Error(errorMessage);
|
2031
|
+
}
|
2032
|
+
if (error instanceof Error) {
|
2033
|
+
console.error(error.message);
|
2034
|
+
throw error;
|
2035
|
+
}
|
2036
|
+
else {
|
2037
|
+
throw error;
|
2038
|
+
}
|
2039
|
+
}
|
1993
2040
|
}
|
1994
2041
|
}
|
1995
|
-
|
1996
|
-
|
2042
|
+
export { Graphlit };
|
2043
|
+
export * as Types from "./generated/graphql-types.js";
|
2044
|
+
// Export streaming helpers
|
2045
|
+
export { StreamEventAggregator, formatSSEEvent, createSSEStream, wrapToolHandlers, enhanceToolCalls, ConversationMetrics, } from "./stream-helpers.js";
|