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/dist/client.js CHANGED
@@ -1,56 +1,83 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
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 = apiUri || "https://data-scus.graphlit.io/api/v1/graphql";
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 = (0, core_1.createHttpLink)({
113
+ const httpLink = createHttpLink({
87
114
  uri: this.apiUri,
88
115
  });
89
- const authLink = new core_1.ApolloLink((operation, forward) => {
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 core_1.ApolloClient({
124
+ this.client = new ApolloClient({
98
125
  link: authLink.concat(httpLink),
99
- cache: new core_1.InMemoryCache(),
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": Object.assign(Object.assign(Object.assign({ "x-graphlit-organization-id": this.organizationId, "x-graphlit-environment-id": this.environmentId }, (this.ownerId && { "x-graphlit-owner-id": this.ownerId })), (this.userId && { "x-graphlit-user-id": this.userId })), { "x-graphlit-role": "Owner" }),
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 __awaiter(this, void 0, void 0, function* () {
131
- return this.queryAndCheckError(Documents.GetProject, {});
132
- });
183
+ async getProject() {
184
+ return this.queryAndCheckError(Documents.GetProject, {});
133
185
  }
134
- updateProject(project) {
135
- return __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
156
- return this.queryAndCheckError(Documents.QueryUsage, {
157
- startDate: startDate,
158
- duration: duration,
159
- names: names,
160
- excludedNames: excludedNames,
161
- offset: offset,
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
173
- return this.mutateAndCheckError(Documents.SendNotification, {
174
- connector: connector,
175
- text: text,
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 __awaiter(this, void 0, void 0, function* () {
182
- return this.queryAndCheckError(Documents.MapWeb, {
183
- uri: uri,
184
- allowedPaths: allowedPaths,
185
- excludedPaths: excludedPaths,
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 __awaiter(this, void 0, void 0, function* () {
192
- return this.queryAndCheckError(Documents.SearchWeb, {
193
- text: text,
194
- service: service,
195
- limit: limit,
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
222
- return this.mutateAndCheckError(Documents.DeleteAllAlerts, {
223
- filter: filter,
224
- isSynchronous: isSynchronous,
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
276
- return this.mutateAndCheckError(Documents.DeleteAllCollections, {
277
- filter: filter,
278
- isSynchronous: isSynchronous,
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 __awaiter(this, void 0, void 0, function* () {
285
- return this.mutateAndCheckError(Documents.AddContentsToCollections, {
286
- contents: contents,
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 __awaiter(this, void 0, void 0, function* () {
293
- return this.mutateAndCheckError(Documents.RemoveContentsFromCollection, {
294
- contents: contents,
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
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 __awaiter(this, void 0, void 0, function* () {
316
- return this.mutateAndCheckError(Documents.DescribeImage, {
317
- prompt: prompt,
318
- uri: uri,
319
- specification: specification,
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 __awaiter(this, void 0, void 0, function* () {
326
- return this.mutateAndCheckError(Documents.DescribeEncodedImage, {
327
- prompt: prompt,
328
- mimeType: mimeType,
329
- data: data,
330
- specification: specification,
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 __awaiter(this, void 0, void 0, function* () {
337
- return this.mutateAndCheckError(Documents.ScreenshotPage, {
338
- uri: uri,
339
- maximumHeight: maximumHeight,
340
- isSynchronous: isSynchronous,
341
- workflow: workflow,
342
- collections: collections,
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 __awaiter(this, void 0, void 0, function* () {
349
- return this.mutateAndCheckError(Documents.IngestTextBatch, {
350
- batch: batch,
351
- textType: textType,
352
- collections: collections,
353
- observations: observations,
354
- correlationId: correlationId,
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
- ingestBatch(uris, workflow, collections, observations, correlationId) {
359
- return __awaiter(this, void 0, void 0, function* () {
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
- ingestUri(uri, name, id, isSynchronous, workflow, collections, observations, correlationId) {
370
- return __awaiter(this, void 0, void 0, function* () {
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
- ingestText(text, name, textType, uri, id, isSynchronous, workflow, collections, observations, correlationId) {
384
- return __awaiter(this, void 0, void 0, function* () {
385
- return this.mutateAndCheckError(Documents.IngestText, {
386
- name: name,
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
- ingestMemory(text, name, textType, collections, correlationId) {
400
- return __awaiter(this, void 0, void 0, function* () {
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
- ingestEvent(markdown, name, description, eventDate, collections, correlationId) {
411
- return __awaiter(this, void 0, void 0, function* () {
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
- ingestEncodedFile(name, data, mimeType, fileCreationDate, fileModifiedDate, id, isSynchronous, workflow, collections, observations, correlationId) {
423
- return __awaiter(this, void 0, void 0, function* () {
424
- return this.mutateAndCheckError(Documents.IngestEncodedFile, {
425
- name: name,
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
- updateContent(content) {
440
- return __awaiter(this, void 0, void 0, function* () {
441
- return this.mutateAndCheckError(Documents.UpdateContent, { content: content });
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
- deleteContent(id) {
445
- return __awaiter(this, void 0, void 0, function* () {
446
- return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
447
- });
539
+ async clearConversation(id) {
540
+ return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
448
541
  }
449
- deleteContents(ids, isSynchronous) {
450
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllContents(filter, isSynchronous, correlationId) {
455
- return __awaiter(this, void 0, void 0, function* () {
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
- summarizeText(summarization, text, textType, correlationId) {
464
- return __awaiter(this, void 0, void 0, function* () {
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
- summarizeContents(summarizations, filter, correlationId) {
474
- return __awaiter(this, void 0, void 0, function* () {
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
- extractText(prompt, text, tools, specification, textType, correlationId) {
483
- return __awaiter(this, void 0, void 0, function* () {
484
- return this.mutateAndCheckError(Documents.ExtractText, {
485
- prompt: prompt,
486
- text: text,
487
- textType: textType,
488
- specification: specification,
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
- extractContents(prompt, tools, specification, filter, correlationId) {
495
- return __awaiter(this, void 0, void 0, function* () {
496
- return this.mutateAndCheckError(Documents.ExtractContents, {
497
- prompt: prompt,
498
- filter: filter,
499
- specification: specification,
500
- tools: tools,
501
- correlationId: correlationId,
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
- publishContents(publishPrompt, connector, summaryPrompt, summarySpecification, publishSpecification, name, filter, workflow, isSynchronous, includeDetails, correlationId) {
506
- return __awaiter(this, void 0, void 0, function* () {
507
- return this.mutateAndCheckError(Documents.PublishContents, {
508
- summaryPrompt: summaryPrompt,
509
- summarySpecification: summarySpecification,
510
- connector: connector,
511
- publishPrompt: publishPrompt,
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
- publishText(text, textType, connector, name, workflow, isSynchronous, correlationId) {
523
- return __awaiter(this, void 0, void 0, function* () {
524
- return this.mutateAndCheckError(Documents.PublishText, {
525
- text: text,
526
- textType: textType,
527
- connector: connector,
528
- name: name,
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
- getContent(id) {
536
- return __awaiter(this, void 0, void 0, function* () {
537
- return this.queryAndCheckError(Documents.GetContent, { id: id });
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
- queryContents(filter) {
541
- return __awaiter(this, void 0, void 0, function* () {
542
- return this.queryAndCheckError(Documents.QueryContents, { filter: filter });
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
- queryContentsFacets(filter) {
546
- return __awaiter(this, void 0, void 0, function* () {
547
- return this.queryAndCheckError(Documents.QueryContentsFacets, { filter: filter });
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
- queryContentsGraph(filter) {
551
- return __awaiter(this, void 0, void 0, function* () {
552
- return this.queryAndCheckError(Documents.QueryContentsGraph, {
553
- filter: filter,
554
- graph: {
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
- countContents(filter) {
561
- return __awaiter(this, void 0, void 0, function* () {
562
- return this.queryAndCheckError(Documents.CountContents, { filter: filter });
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
- isContentDone(id) {
566
- return __awaiter(this, void 0, void 0, function* () {
567
- return this.queryAndCheckError(Documents.IsContentDone, { id: id });
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
- createConversation(conversation, correlationId) {
571
- return __awaiter(this, void 0, void 0, function* () {
572
- return this.mutateAndCheckError(Documents.CreateConversation, {
573
- conversation: conversation,
574
- correlationId: correlationId,
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
- updateConversation(conversation) {
579
- return __awaiter(this, void 0, void 0, function* () {
580
- return this.mutateAndCheckError(Documents.UpdateConversation, { conversation: conversation });
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
- deleteConversation(id) {
584
- return __awaiter(this, void 0, void 0, function* () {
585
- return this.mutateAndCheckError(Documents.DeleteConversation, { id: id });
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
- deleteConversations(ids, isSynchronous) {
589
- return __awaiter(this, void 0, void 0, function* () {
590
- return this.mutateAndCheckError(Documents.DeleteConversations, {
591
- ids: ids,
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
- deleteAllConversations(filter, isSynchronous, correlationId) {
597
- return __awaiter(this, void 0, void 0, function* () {
598
- return this.mutateAndCheckError(Documents.DeleteAllConversations, {
599
- filter: filter,
600
- isSynchronous: isSynchronous,
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
- clearConversation(id) {
606
- return __awaiter(this, void 0, void 0, function* () {
607
- return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
608
- });
687
+ async querySharePointLibraries(properties) {
688
+ return this.queryAndCheckError(Documents.QuerySharePointLibraries, { properties: properties });
609
689
  }
610
- closeConversation(id) {
611
- return __awaiter(this, void 0, void 0, function* () {
612
- return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
613
- });
690
+ async queryMicrosoftTeamsTeams(properties) {
691
+ return this.queryAndCheckError(Documents.QueryMicrosoftTeamsTeams, { properties: properties });
614
692
  }
615
- getConversation(id) {
616
- return __awaiter(this, void 0, void 0, function* () {
617
- return this.queryAndCheckError(Documents.GetConversation, { id: id });
693
+ async queryMicrosoftTeamsChannels(properties, teamId) {
694
+ return this.queryAndCheckError(Documents.QueryMicrosoftTeamsChannels, {
695
+ properties: properties,
696
+ teamId: teamId,
618
697
  });
619
698
  }
620
- queryConversations(filter) {
621
- return __awaiter(this, void 0, void 0, function* () {
622
- return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
623
- });
699
+ async querySlackChannels(properties) {
700
+ return this.queryAndCheckError(Documents.QuerySlackChannels, { properties: properties });
624
701
  }
625
- countConversations(filter) {
626
- return __awaiter(this, void 0, void 0, function* () {
627
- return this.queryAndCheckError(Documents.CountConversations, { filter: filter });
628
- });
702
+ async queryLinearProjects(properties) {
703
+ return this.queryAndCheckError(Documents.QueryLinearProjects, { properties: properties });
629
704
  }
630
- reviseImage(prompt, uri, id, specification, correlationId) {
631
- return __awaiter(this, void 0, void 0, function* () {
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
- reviseEncodedImage(prompt, mimeType, data, id, specification, correlationId) {
642
- return __awaiter(this, void 0, void 0, function* () {
643
- return this.mutateAndCheckError(Documents.ReviseEncodedImage, {
644
- prompt: prompt,
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
- reviseText(prompt, text, id, specification, correlationId) {
654
- return __awaiter(this, void 0, void 0, function* () {
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
- reviseContent(prompt, content, id, specification, correlationId) {
665
- return __awaiter(this, void 0, void 0, function* () {
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
- prompt(prompt, mimeType, data, specification, messages, correlationId) {
676
- return __awaiter(this, void 0, void 0, function* () {
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
- retrieveSources(prompt, filter, augmentedFilter, retrievalStrategy, rerankingStrategy, correlationId) {
688
- return __awaiter(this, void 0, void 0, function* () {
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
- formatConversation(prompt, id, specification, includeDetails, correlationId) {
700
- return __awaiter(this, void 0, void 0, function* () {
701
- return this.mutateAndCheckError(Documents.FormatConversation, {
702
- prompt: prompt,
703
- id: id,
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
- completeConversation(completion, id, correlationId) {
711
- return __awaiter(this, void 0, void 0, function* () {
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
- askGraphlit(prompt, type, id, specification, correlationId) {
720
- return __awaiter(this, void 0, void 0, function* () {
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
- promptConversation(prompt, id, specification, mimeType, data, tools, requireTool, includeDetails, correlationId) {
731
- return __awaiter(this, void 0, void 0, function* () {
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
- continueConversation(id, responses, correlationId) {
746
- return __awaiter(this, void 0, void 0, function* () {
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
- publishConversation(id, connector, name, workflow, isSynchronous, correlationId) {
755
- return __awaiter(this, void 0, void 0, function* () {
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
- suggestConversation(id, count, correlationId) {
767
- return __awaiter(this, void 0, void 0, function* () {
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
- queryOneDriveFolders(properties, folderId) {
776
- return __awaiter(this, void 0, void 0, function* () {
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
- querySharePointFolders(properties, libraryId, folderId) {
784
- return __awaiter(this, void 0, void 0, function* () {
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
- querySharePointLibraries(properties) {
793
- return __awaiter(this, void 0, void 0, function* () {
794
- return this.queryAndCheckError(Documents.QuerySharePointLibraries, { properties: properties });
795
- });
757
+ async createSpecification(specification) {
758
+ return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
796
759
  }
797
- queryMicrosoftTeamsTeams(properties) {
798
- return __awaiter(this, void 0, void 0, function* () {
799
- return this.queryAndCheckError(Documents.QueryMicrosoftTeamsTeams, { properties: properties });
800
- });
760
+ async updateSpecification(specification) {
761
+ return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
801
762
  }
802
- queryMicrosoftTeamsChannels(properties, teamId) {
803
- return __awaiter(this, void 0, void 0, function* () {
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
- querySlackChannels(properties) {
811
- return __awaiter(this, void 0, void 0, function* () {
812
- return this.queryAndCheckError(Documents.QuerySlackChannels, { properties: properties });
813
- });
766
+ async deleteSpecification(id) {
767
+ return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
814
768
  }
815
- queryLinearProjects(properties) {
816
- return __awaiter(this, void 0, void 0, function* () {
817
- return this.queryAndCheckError(Documents.QueryLinearProjects, { properties: properties });
769
+ async deleteSpecifications(ids, isSynchronous) {
770
+ return this.mutateAndCheckError(Documents.DeleteSpecifications, {
771
+ ids: ids,
772
+ isSynchronous: isSynchronous,
818
773
  });
819
774
  }
820
- queryNotionDatabases(properties) {
821
- return __awaiter(this, void 0, void 0, function* () {
822
- return this.queryAndCheckError(Documents.QueryNotionDatabases, { properties: properties });
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
- queryNotionPages(properties, identifier) {
826
- return __awaiter(this, void 0, void 0, function* () {
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
- createFeed(feed, correlationId) {
834
- return __awaiter(this, void 0, void 0, function* () {
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
- updateFeed(feed) {
839
- return __awaiter(this, void 0, void 0, function* () {
840
- return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
841
- });
788
+ async countSpecifications(filter) {
789
+ return this.queryAndCheckError(Documents.CountSpecifications, { filter: filter });
842
790
  }
843
- deleteFeed(id) {
844
- return __awaiter(this, void 0, void 0, function* () {
845
- return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
846
- });
791
+ async specificationExists(filter) {
792
+ return this.queryAndCheckError(Documents.SpecificationExists, { filter: filter });
847
793
  }
848
- deleteFeeds(ids, isSynchronous) {
849
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllFeeds(filter, isSynchronous, correlationId) {
854
- return __awaiter(this, void 0, void 0, function* () {
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
- enableFeed(id) {
863
- return __awaiter(this, void 0, void 0, function* () {
864
- return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
865
- });
800
+ async updateWorkflow(workflow) {
801
+ return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
866
802
  }
867
- disableFeed(id) {
868
- return __awaiter(this, void 0, void 0, function* () {
869
- return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
870
- });
803
+ async upsertWorkflow(workflow) {
804
+ return this.mutateAndCheckError(Documents.UpsertWorkflow, { workflow: workflow });
871
805
  }
872
- getFeed(id) {
873
- return __awaiter(this, void 0, void 0, function* () {
874
- return this.queryAndCheckError(Documents.GetFeed, { id: id });
875
- });
806
+ async deleteWorkflow(id) {
807
+ return this.mutateAndCheckError(Documents.DeleteWorkflow, { id: id });
876
808
  }
877
- queryFeeds(filter) {
878
- return __awaiter(this, void 0, void 0, function* () {
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
- countFeeds(filter) {
883
- return __awaiter(this, void 0, void 0, function* () {
884
- return this.queryAndCheckError(Documents.CountFeeds, { filter: filter });
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
- feedExists(filter) {
888
- return __awaiter(this, void 0, void 0, function* () {
889
- return this.queryAndCheckError(Documents.FeedExists, { filter: filter });
890
- });
819
+ async getWorkflow(id) {
820
+ return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
891
821
  }
892
- isFeedDone(id) {
893
- return __awaiter(this, void 0, void 0, function* () {
894
- return this.queryAndCheckError(Documents.IsFeedDone, { id: id });
895
- });
822
+ async queryWorkflows(filter) {
823
+ return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
896
824
  }
897
- promptSpecifications(prompt, ids) {
898
- return __awaiter(this, void 0, void 0, function* () {
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
- createSpecification(specification) {
903
- return __awaiter(this, void 0, void 0, function* () {
904
- return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
905
- });
828
+ async workflowExists(filter) {
829
+ return this.queryAndCheckError(Documents.WorkflowExists, { filter: filter });
906
830
  }
907
- updateSpecification(specification) {
908
- return __awaiter(this, void 0, void 0, function* () {
909
- return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
910
- });
831
+ async createUser(user) {
832
+ return this.mutateAndCheckError(Documents.CreateUser, { user: user });
911
833
  }
912
- upsertSpecification(specification) {
913
- return __awaiter(this, void 0, void 0, function* () {
914
- return this.mutateAndCheckError(Documents.UpsertSpecification, { specification: specification });
915
- });
834
+ async updateUser(user) {
835
+ return this.mutateAndCheckError(Documents.UpdateUser, { user: user });
916
836
  }
917
- deleteSpecification(id) {
918
- return __awaiter(this, void 0, void 0, function* () {
919
- return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
920
- });
837
+ async deleteUser(id) {
838
+ return this.mutateAndCheckError(Documents.DeleteUser, { id: id });
921
839
  }
922
- deleteSpecifications(ids, isSynchronous) {
923
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllSpecifications(filter, isSynchronous, correlationId) {
931
- return __awaiter(this, void 0, void 0, function* () {
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
- getSpecification(id) {
940
- return __awaiter(this, void 0, void 0, function* () {
941
- return this.queryAndCheckError(Documents.GetSpecification, { id: id });
942
- });
846
+ async countUsers(filter) {
847
+ return this.queryAndCheckError(Documents.CountUsers, { filter: filter });
943
848
  }
944
- querySpecifications(filter) {
945
- return __awaiter(this, void 0, void 0, function* () {
946
- return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
947
- });
849
+ async enableUser(id) {
850
+ return this.mutateAndCheckError(Documents.EnableUser, { id: id });
948
851
  }
949
- countSpecifications(filter) {
950
- return __awaiter(this, void 0, void 0, function* () {
951
- return this.queryAndCheckError(Documents.CountSpecifications, { filter: filter });
952
- });
852
+ async disableUser(id) {
853
+ return this.mutateAndCheckError(Documents.DisableUser, { id: id });
953
854
  }
954
- specificationExists(filter) {
955
- return __awaiter(this, void 0, void 0, function* () {
956
- return this.queryAndCheckError(Documents.SpecificationExists, { filter: filter });
957
- });
855
+ async createCategory(category) {
856
+ return this.mutateAndCheckError(Documents.CreateCategory, { category: category });
958
857
  }
959
- queryModels(filter) {
960
- return __awaiter(this, void 0, void 0, function* () {
961
- return this.queryAndCheckError(Documents.QueryModels, { filter: filter });
962
- });
858
+ async updateCategory(category) {
859
+ return this.mutateAndCheckError(Documents.UpdateCategory, { category: category });
963
860
  }
964
- createWorkflow(workflow) {
965
- return __awaiter(this, void 0, void 0, function* () {
966
- return this.mutateAndCheckError(Documents.CreateWorkflow, { workflow: workflow });
967
- });
861
+ async upsertCategory(category) {
862
+ return this.mutateAndCheckError(Documents.UpsertCategory, { category: category });
968
863
  }
969
- updateWorkflow(workflow) {
970
- return __awaiter(this, void 0, void 0, function* () {
971
- return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
972
- });
864
+ async deleteCategory(id) {
865
+ return this.mutateAndCheckError(Documents.DeleteCategory, { id: id });
973
866
  }
974
- upsertWorkflow(workflow) {
975
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteWorkflow(id) {
980
- return __awaiter(this, void 0, void 0, function* () {
981
- return this.mutateAndCheckError(Documents.DeleteWorkflow, { id: id });
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
- deleteWorkflows(ids, isSynchronous) {
985
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllWorkflows(filter, isSynchronous, correlationId) {
990
- return __awaiter(this, void 0, void 0, function* () {
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
- getWorkflow(id) {
999
- return __awaiter(this, void 0, void 0, function* () {
1000
- return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
1001
- });
883
+ async createLabel(label) {
884
+ return this.mutateAndCheckError(Documents.CreateLabel, { label: label });
1002
885
  }
1003
- queryWorkflows(filter) {
1004
- return __awaiter(this, void 0, void 0, function* () {
1005
- return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
1006
- });
886
+ async updateLabel(label) {
887
+ return this.mutateAndCheckError(Documents.UpdateLabel, { label: label });
1007
888
  }
1008
- countWorkflows(filter) {
1009
- return __awaiter(this, void 0, void 0, function* () {
1010
- return this.queryAndCheckError(Documents.CountWorkflows, { filter: filter });
1011
- });
889
+ async upsertLabel(label) {
890
+ return this.mutateAndCheckError(Documents.UpsertLabel, { label: label });
1012
891
  }
1013
- workflowExists(filter) {
1014
- return __awaiter(this, void 0, void 0, function* () {
1015
- return this.queryAndCheckError(Documents.WorkflowExists, { filter: filter });
1016
- });
892
+ async deleteLabel(id) {
893
+ return this.mutateAndCheckError(Documents.DeleteLabel, { id: id });
1017
894
  }
1018
- createUser(user) {
1019
- return __awaiter(this, void 0, void 0, function* () {
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
- updateUser(user) {
1024
- return __awaiter(this, void 0, void 0, function* () {
1025
- return this.mutateAndCheckError(Documents.UpdateUser, { user: user });
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
- deleteUser(id) {
1029
- return __awaiter(this, void 0, void 0, function* () {
1030
- return this.mutateAndCheckError(Documents.DeleteUser, { id: id });
1031
- });
905
+ async getLabel(id) {
906
+ return this.queryAndCheckError(Documents.GetLabel, { id: id });
1032
907
  }
1033
- getUser() {
1034
- return __awaiter(this, void 0, void 0, function* () {
1035
- return this.queryAndCheckError(Documents.GetUser, {});
1036
- });
908
+ async queryLabels(filter) {
909
+ return this.queryAndCheckError(Documents.QueryLabels, { filter: filter });
1037
910
  }
1038
- queryUsers(filter) {
1039
- return __awaiter(this, void 0, void 0, function* () {
1040
- return this.queryAndCheckError(Documents.QueryUsers, { filter: filter });
1041
- });
911
+ async createPerson(person) {
912
+ return this.mutateAndCheckError(Documents.CreatePerson, { person: person });
1042
913
  }
1043
- countUsers(filter) {
1044
- return __awaiter(this, void 0, void 0, function* () {
1045
- return this.queryAndCheckError(Documents.CountUsers, { filter: filter });
1046
- });
914
+ async updatePerson(person) {
915
+ return this.mutateAndCheckError(Documents.UpdatePerson, { person: person });
1047
916
  }
1048
- enableUser(id) {
1049
- return __awaiter(this, void 0, void 0, function* () {
1050
- return this.mutateAndCheckError(Documents.EnableUser, { id: id });
1051
- });
917
+ async deletePerson(id) {
918
+ return this.mutateAndCheckError(Documents.DeletePerson, { id: id });
1052
919
  }
1053
- disableUser(id) {
1054
- return __awaiter(this, void 0, void 0, function* () {
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
- createCategory(category) {
1059
- return __awaiter(this, void 0, void 0, function* () {
1060
- return this.mutateAndCheckError(Documents.CreateCategory, { category: category });
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
- updateCategory(category) {
1064
- return __awaiter(this, void 0, void 0, function* () {
1065
- return this.mutateAndCheckError(Documents.UpdateCategory, { category: category });
1066
- });
930
+ async getPerson(id) {
931
+ return this.queryAndCheckError(Documents.GetPerson, { id: id });
1067
932
  }
1068
- upsertCategory(category) {
1069
- return __awaiter(this, void 0, void 0, function* () {
1070
- return this.mutateAndCheckError(Documents.UpsertCategory, { category: category });
1071
- });
933
+ async queryPersons(filter) {
934
+ return this.queryAndCheckError(Documents.QueryPersons, { filter: filter });
1072
935
  }
1073
- deleteCategory(id) {
1074
- return __awaiter(this, void 0, void 0, function* () {
1075
- return this.mutateAndCheckError(Documents.DeleteCategory, { id: id });
1076
- });
936
+ async createOrganization(organization) {
937
+ return this.mutateAndCheckError(Documents.CreateOrganization, { organization: organization });
1077
938
  }
1078
- deleteCategories(ids, isSynchronous) {
1079
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllCategories(filter, isSynchronous, correlationId) {
1084
- return __awaiter(this, void 0, void 0, function* () {
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
- getCategory(id) {
1093
- return __awaiter(this, void 0, void 0, function* () {
1094
- return this.queryAndCheckError(Documents.GetCategory, { id: id });
945
+ async deleteOrganizations(ids, isSynchronous) {
946
+ return this.mutateAndCheckError(Documents.DeleteOrganizations, {
947
+ ids: ids,
948
+ isSynchronous: isSynchronous,
1095
949
  });
1096
950
  }
1097
- queryCategories(filter) {
1098
- return __awaiter(this, void 0, void 0, function* () {
1099
- return this.queryAndCheckError(Documents.QueryCategories, { filter: filter });
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
- createLabel(label) {
1103
- return __awaiter(this, void 0, void 0, function* () {
1104
- return this.mutateAndCheckError(Documents.CreateLabel, { label: label });
1105
- });
958
+ async getOrganization(id) {
959
+ return this.queryAndCheckError(Documents.GetOrganization, { id: id });
1106
960
  }
1107
- updateLabel(label) {
1108
- return __awaiter(this, void 0, void 0, function* () {
1109
- return this.mutateAndCheckError(Documents.UpdateLabel, { label: label });
1110
- });
961
+ async queryOrganizations(filter) {
962
+ return this.queryAndCheckError(Documents.QueryOrganizations, { filter: filter });
1111
963
  }
1112
- upsertLabel(label) {
1113
- return __awaiter(this, void 0, void 0, function* () {
1114
- return this.mutateAndCheckError(Documents.UpsertLabel, { label: label });
1115
- });
964
+ async createPlace(place) {
965
+ return this.mutateAndCheckError(Documents.CreatePlace, { place: place });
1116
966
  }
1117
- deleteLabel(id) {
1118
- return __awaiter(this, void 0, void 0, function* () {
1119
- return this.mutateAndCheckError(Documents.DeleteLabel, { id: id });
1120
- });
967
+ async updatePlace(place) {
968
+ return this.mutateAndCheckError(Documents.UpdatePlace, { place: place });
1121
969
  }
1122
- deleteLabels(ids, isSynchronous) {
1123
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllLabels(filter, isSynchronous, correlationId) {
1128
- return __awaiter(this, void 0, void 0, function* () {
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
- getLabel(id) {
1137
- return __awaiter(this, void 0, void 0, function* () {
1138
- return this.queryAndCheckError(Documents.GetLabel, { id: id });
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
- queryLabels(filter) {
1142
- return __awaiter(this, void 0, void 0, function* () {
1143
- return this.queryAndCheckError(Documents.QueryLabels, { filter: filter });
1144
- });
983
+ async getPlace(id) {
984
+ return this.queryAndCheckError(Documents.GetPlace, { id: id });
1145
985
  }
1146
- createPerson(person) {
1147
- return __awaiter(this, void 0, void 0, function* () {
1148
- return this.mutateAndCheckError(Documents.CreatePerson, { person: person });
1149
- });
986
+ async queryPlaces(filter) {
987
+ return this.queryAndCheckError(Documents.QueryPlaces, { filter: filter });
1150
988
  }
1151
- updatePerson(person) {
1152
- return __awaiter(this, void 0, void 0, function* () {
1153
- return this.mutateAndCheckError(Documents.UpdatePerson, { person: person });
1154
- });
989
+ async createEvent(event) {
990
+ return this.mutateAndCheckError(Documents.CreateEvent, { event: event });
1155
991
  }
1156
- deletePerson(id) {
1157
- return __awaiter(this, void 0, void 0, function* () {
1158
- return this.mutateAndCheckError(Documents.DeletePerson, { id: id });
1159
- });
992
+ async updateEvent(event) {
993
+ return this.mutateAndCheckError(Documents.UpdateEvent, { event: event });
1160
994
  }
1161
- deletePersons(ids, isSynchronous) {
1162
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllPersons(filter, isSynchronous, correlationId) {
1167
- return __awaiter(this, void 0, void 0, function* () {
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
- getPerson(id) {
1176
- return __awaiter(this, void 0, void 0, function* () {
1177
- return this.queryAndCheckError(Documents.GetPerson, { id: id });
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
- queryPersons(filter) {
1181
- return __awaiter(this, void 0, void 0, function* () {
1182
- return this.queryAndCheckError(Documents.QueryPersons, { filter: filter });
1183
- });
1008
+ async getEvent(id) {
1009
+ return this.queryAndCheckError(Documents.GetEvent, { id: id });
1184
1010
  }
1185
- createOrganization(organization) {
1186
- return __awaiter(this, void 0, void 0, function* () {
1187
- return this.mutateAndCheckError(Documents.CreateOrganization, { organization: organization });
1188
- });
1011
+ async queryEvents(filter) {
1012
+ return this.queryAndCheckError(Documents.QueryEvents, { filter: filter });
1189
1013
  }
1190
- updateOrganization(organization) {
1191
- return __awaiter(this, void 0, void 0, function* () {
1192
- return this.mutateAndCheckError(Documents.UpdateOrganization, { organization: organization });
1193
- });
1014
+ async createProduct(product) {
1015
+ return this.mutateAndCheckError(Documents.CreateProduct, { product: product });
1194
1016
  }
1195
- deleteOrganization(id) {
1196
- return __awaiter(this, void 0, void 0, function* () {
1197
- return this.mutateAndCheckError(Documents.DeleteOrganization, { id: id });
1198
- });
1017
+ async updateProduct(product) {
1018
+ return this.mutateAndCheckError(Documents.UpdateProduct, { product: product });
1199
1019
  }
1200
- deleteOrganizations(ids, isSynchronous) {
1201
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllOrganizations(filter, isSynchronous, correlationId) {
1209
- return __awaiter(this, void 0, void 0, function* () {
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
- getOrganization(id) {
1218
- return __awaiter(this, void 0, void 0, function* () {
1219
- return this.queryAndCheckError(Documents.GetOrganization, { id: id });
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
- queryOrganizations(filter) {
1223
- return __awaiter(this, void 0, void 0, function* () {
1224
- return this.queryAndCheckError(Documents.QueryOrganizations, { filter: filter });
1225
- });
1033
+ async getProduct(id) {
1034
+ return this.queryAndCheckError(Documents.GetProduct, { id: id });
1226
1035
  }
1227
- createPlace(place) {
1228
- return __awaiter(this, void 0, void 0, function* () {
1229
- return this.mutateAndCheckError(Documents.CreatePlace, { place: place });
1230
- });
1036
+ async queryProducts(filter) {
1037
+ return this.queryAndCheckError(Documents.QueryProducts, { filter: filter });
1231
1038
  }
1232
- updatePlace(place) {
1233
- return __awaiter(this, void 0, void 0, function* () {
1234
- return this.mutateAndCheckError(Documents.UpdatePlace, { place: place });
1235
- });
1039
+ async createRepo(repo) {
1040
+ return this.mutateAndCheckError(Documents.CreateRepo, { repo: repo });
1236
1041
  }
1237
- deletePlace(id) {
1238
- return __awaiter(this, void 0, void 0, function* () {
1239
- return this.mutateAndCheckError(Documents.DeletePlace, { id: id });
1240
- });
1042
+ async updateRepo(repo) {
1043
+ return this.mutateAndCheckError(Documents.UpdateRepo, { repo: repo });
1241
1044
  }
1242
- deletePlaces(ids, isSynchronous) {
1243
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllPlaces(filter, isSynchronous, correlationId) {
1248
- return __awaiter(this, void 0, void 0, function* () {
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
- getPlace(id) {
1257
- return __awaiter(this, void 0, void 0, function* () {
1258
- return this.queryAndCheckError(Documents.GetPlace, { id: id });
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
- queryPlaces(filter) {
1262
- return __awaiter(this, void 0, void 0, function* () {
1263
- return this.queryAndCheckError(Documents.QueryPlaces, { filter: filter });
1264
- });
1058
+ async getRepo(id) {
1059
+ return this.queryAndCheckError(Documents.GetRepo, { id: id });
1265
1060
  }
1266
- createEvent(event) {
1267
- return __awaiter(this, void 0, void 0, function* () {
1268
- return this.mutateAndCheckError(Documents.CreateEvent, { event: event });
1269
- });
1061
+ async queryRepos(filter) {
1062
+ return this.queryAndCheckError(Documents.QueryRepos, { filter: filter });
1270
1063
  }
1271
- updateEvent(event) {
1272
- return __awaiter(this, void 0, void 0, function* () {
1273
- return this.mutateAndCheckError(Documents.UpdateEvent, { event: event });
1274
- });
1064
+ async createSoftware(software) {
1065
+ return this.mutateAndCheckError(Documents.CreateSoftware, { software: software });
1275
1066
  }
1276
- deleteEvent(id) {
1277
- return __awaiter(this, void 0, void 0, function* () {
1278
- return this.mutateAndCheckError(Documents.DeleteEvent, { id: id });
1279
- });
1067
+ async updateSoftware(software) {
1068
+ return this.mutateAndCheckError(Documents.UpdateSoftware, { software: software });
1280
1069
  }
1281
- deleteEvents(ids, isSynchronous) {
1282
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllEvents(filter, isSynchronous, correlationId) {
1287
- return __awaiter(this, void 0, void 0, function* () {
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
- getEvent(id) {
1296
- return __awaiter(this, void 0, void 0, function* () {
1297
- return this.queryAndCheckError(Documents.GetEvent, { id: id });
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
- queryEvents(filter) {
1301
- return __awaiter(this, void 0, void 0, function* () {
1302
- return this.queryAndCheckError(Documents.QueryEvents, { filter: filter });
1303
- });
1083
+ async getSoftware(id) {
1084
+ return this.queryAndCheckError(Documents.GetSoftware, { id: id });
1304
1085
  }
1305
- createProduct(product) {
1306
- return __awaiter(this, void 0, void 0, function* () {
1307
- return this.mutateAndCheckError(Documents.CreateProduct, { product: product });
1308
- });
1086
+ async querySoftwares(filter) {
1087
+ return this.queryAndCheckError(Documents.QuerySoftwares, { filter: filter });
1309
1088
  }
1310
- updateProduct(product) {
1311
- return __awaiter(this, void 0, void 0, function* () {
1312
- return this.mutateAndCheckError(Documents.UpdateProduct, { product: product });
1313
- });
1089
+ async createMedicalCondition(MedicalCondition) {
1090
+ return this.mutateAndCheckError(Documents.CreateMedicalCondition, { MedicalCondition: MedicalCondition });
1314
1091
  }
1315
- deleteProduct(id) {
1316
- return __awaiter(this, void 0, void 0, function* () {
1317
- return this.mutateAndCheckError(Documents.DeleteProduct, { id: id });
1318
- });
1092
+ async updateMedicalCondition(MedicalCondition) {
1093
+ return this.mutateAndCheckError(Documents.UpdateMedicalCondition, { MedicalCondition: MedicalCondition });
1319
1094
  }
1320
- deleteProducts(ids, isSynchronous) {
1321
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllProducts(filter, isSynchronous, correlationId) {
1326
- return __awaiter(this, void 0, void 0, function* () {
1327
- return this.mutateAndCheckError(Documents.DeleteAllProducts, {
1328
- filter: filter,
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
- getProduct(id) {
1335
- return __awaiter(this, void 0, void 0, function* () {
1336
- return this.queryAndCheckError(Documents.GetProduct, { id: id });
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
- queryProducts(filter) {
1340
- return __awaiter(this, void 0, void 0, function* () {
1341
- return this.queryAndCheckError(Documents.QueryProducts, { filter: filter });
1342
- });
1111
+ async getMedicalCondition(id) {
1112
+ return this.queryAndCheckError(Documents.GetMedicalCondition, { id: id });
1343
1113
  }
1344
- createRepo(repo) {
1345
- return __awaiter(this, void 0, void 0, function* () {
1346
- return this.mutateAndCheckError(Documents.CreateRepo, { repo: repo });
1347
- });
1114
+ async queryMedicalConditions(filter) {
1115
+ return this.queryAndCheckError(Documents.QueryMedicalConditions, { filter: filter });
1348
1116
  }
1349
- updateRepo(repo) {
1350
- return __awaiter(this, void 0, void 0, function* () {
1351
- return this.mutateAndCheckError(Documents.UpdateRepo, { repo: repo });
1352
- });
1117
+ async createMedicalGuideline(MedicalGuideline) {
1118
+ return this.mutateAndCheckError(Documents.CreateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
1353
1119
  }
1354
- deleteRepo(id) {
1355
- return __awaiter(this, void 0, void 0, function* () {
1356
- return this.mutateAndCheckError(Documents.DeleteRepo, { id: id });
1357
- });
1120
+ async updateMedicalGuideline(MedicalGuideline) {
1121
+ return this.mutateAndCheckError(Documents.UpdateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
1358
1122
  }
1359
- deleteRepos(ids, isSynchronous) {
1360
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllRepos(filter, isSynchronous, correlationId) {
1365
- return __awaiter(this, void 0, void 0, function* () {
1366
- return this.mutateAndCheckError(Documents.DeleteAllRepos, {
1367
- filter: filter,
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
- getRepo(id) {
1374
- return __awaiter(this, void 0, void 0, function* () {
1375
- return this.queryAndCheckError(Documents.GetRepo, { id: id });
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
- queryRepos(filter) {
1379
- return __awaiter(this, void 0, void 0, function* () {
1380
- return this.queryAndCheckError(Documents.QueryRepos, { filter: filter });
1381
- });
1139
+ async getMedicalGuideline(id) {
1140
+ return this.queryAndCheckError(Documents.GetMedicalGuideline, { id: id });
1382
1141
  }
1383
- createSoftware(software) {
1384
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteSoftware(id) {
1394
- return __awaiter(this, void 0, void 0, function* () {
1395
- return this.mutateAndCheckError(Documents.DeleteSoftware, { id: id });
1396
- });
1145
+ async createMedicalDrug(MedicalDrug) {
1146
+ return this.mutateAndCheckError(Documents.CreateMedicalDrug, { MedicalDrug: MedicalDrug });
1397
1147
  }
1398
- deleteSoftwares(ids, isSynchronous) {
1399
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllSoftwares(filter, isSynchronous, correlationId) {
1404
- return __awaiter(this, void 0, void 0, function* () {
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
- getSoftware(id) {
1413
- return __awaiter(this, void 0, void 0, function* () {
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
- querySoftwares(filter) {
1418
- return __awaiter(this, void 0, void 0, function* () {
1419
- return this.queryAndCheckError(Documents.QuerySoftwares, { filter: filter });
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
- createMedicalCondition(MedicalCondition) {
1423
- return __awaiter(this, void 0, void 0, function* () {
1424
- return this.mutateAndCheckError(Documents.CreateMedicalCondition, { MedicalCondition: MedicalCondition });
1425
- });
1164
+ async getMedicalDrug(id) {
1165
+ return this.queryAndCheckError(Documents.GetMedicalDrug, { id: id });
1426
1166
  }
1427
- updateMedicalCondition(MedicalCondition) {
1428
- return __awaiter(this, void 0, void 0, function* () {
1429
- return this.mutateAndCheckError(Documents.UpdateMedicalCondition, { MedicalCondition: MedicalCondition });
1430
- });
1167
+ async queryMedicalDrugs(filter) {
1168
+ return this.queryAndCheckError(Documents.QueryMedicalDrugs, { filter: filter });
1431
1169
  }
1432
- deleteMedicalCondition(id) {
1433
- return __awaiter(this, void 0, void 0, function* () {
1434
- return this.mutateAndCheckError(Documents.DeleteMedicalCondition, { id: id });
1170
+ async createMedicalIndication(MedicalIndication) {
1171
+ return this.mutateAndCheckError(Documents.CreateMedicalIndication, {
1172
+ MedicalIndication: MedicalIndication,
1435
1173
  });
1436
1174
  }
1437
- deleteMedicalConditions(ids, isSynchronous) {
1438
- return __awaiter(this, void 0, void 0, function* () {
1439
- return this.mutateAndCheckError(Documents.DeleteMedicalConditions, {
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
- deleteAllMedicalConditions(filter, isSynchronous, correlationId) {
1446
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalCondition(id) {
1455
- return __awaiter(this, void 0, void 0, function* () {
1456
- return this.queryAndCheckError(Documents.GetMedicalCondition, { id: id });
1183
+ async deleteMedicalIndications(ids, isSynchronous) {
1184
+ return this.mutateAndCheckError(Documents.DeleteMedicalIndications, {
1185
+ ids: ids,
1186
+ isSynchronous: isSynchronous,
1457
1187
  });
1458
1188
  }
1459
- queryMedicalConditions(filter) {
1460
- return __awaiter(this, void 0, void 0, function* () {
1461
- return this.queryAndCheckError(Documents.QueryMedicalConditions, { filter: filter });
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
- createMedicalGuideline(MedicalGuideline) {
1465
- return __awaiter(this, void 0, void 0, function* () {
1466
- return this.mutateAndCheckError(Documents.CreateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
1467
- });
1196
+ async getMedicalIndication(id) {
1197
+ return this.queryAndCheckError(Documents.GetMedicalIndication, { id: id });
1468
1198
  }
1469
- updateMedicalGuideline(MedicalGuideline) {
1470
- return __awaiter(this, void 0, void 0, function* () {
1471
- return this.mutateAndCheckError(Documents.UpdateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
1472
- });
1199
+ async queryMedicalIndications(filter) {
1200
+ return this.queryAndCheckError(Documents.QueryMedicalIndications, { filter: filter });
1473
1201
  }
1474
- deleteMedicalGuideline(id) {
1475
- return __awaiter(this, void 0, void 0, function* () {
1476
- return this.mutateAndCheckError(Documents.DeleteMedicalGuideline, { id: id });
1202
+ async createMedicalContraindication(MedicalContraindication) {
1203
+ return this.mutateAndCheckError(Documents.CreateMedicalContraindication, {
1204
+ MedicalContraindication: MedicalContraindication,
1477
1205
  });
1478
1206
  }
1479
- deleteMedicalGuidelines(ids, isSynchronous) {
1480
- return __awaiter(this, void 0, void 0, function* () {
1481
- return this.mutateAndCheckError(Documents.DeleteMedicalGuidelines, {
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
- deleteAllMedicalGuidelines(filter, isSynchronous, correlationId) {
1488
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalGuideline(id) {
1497
- return __awaiter(this, void 0, void 0, function* () {
1498
- return this.queryAndCheckError(Documents.GetMedicalGuideline, { id: id });
1215
+ async deleteMedicalContraindications(ids, isSynchronous) {
1216
+ return this.mutateAndCheckError(Documents.DeleteMedicalContraindications, {
1217
+ ids: ids,
1218
+ isSynchronous: isSynchronous,
1499
1219
  });
1500
1220
  }
1501
- queryMedicalGuidelines(filter) {
1502
- return __awaiter(this, void 0, void 0, function* () {
1503
- return this.queryAndCheckError(Documents.QueryMedicalGuidelines, { filter: filter });
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
- createMedicalDrug(MedicalDrug) {
1507
- return __awaiter(this, void 0, void 0, function* () {
1508
- return this.mutateAndCheckError(Documents.CreateMedicalDrug, { MedicalDrug: MedicalDrug });
1509
- });
1228
+ async getMedicalContraindication(id) {
1229
+ return this.queryAndCheckError(Documents.GetMedicalContraindication, { id: id });
1510
1230
  }
1511
- updateMedicalDrug(MedicalDrug) {
1512
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalIndication(id) {
1582
- return __awaiter(this, void 0, void 0, function* () {
1583
- return this.queryAndCheckError(Documents.GetMedicalIndication, { id: id });
1584
- });
1234
+ async createMedicalTest(MedicalTest) {
1235
+ return this.mutateAndCheckError(Documents.CreateMedicalTest, { MedicalTest: MedicalTest });
1585
1236
  }
1586
- queryMedicalIndications(filter) {
1587
- return __awaiter(this, void 0, void 0, function* () {
1588
- return this.queryAndCheckError(Documents.QueryMedicalIndications, { filter: filter });
1589
- });
1237
+ async updateMedicalTest(MedicalTest) {
1238
+ return this.mutateAndCheckError(Documents.UpdateMedicalTest, { MedicalTest: MedicalTest });
1590
1239
  }
1591
- createMedicalContraindication(MedicalContraindication) {
1592
- return __awaiter(this, void 0, void 0, function* () {
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
- updateMedicalContraindication(MedicalContraindication) {
1599
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteMedicalContraindication(id) {
1606
- return __awaiter(this, void 0, void 0, function* () {
1607
- return this.mutateAndCheckError(Documents.DeleteMedicalContraindication, { id: id });
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
- deleteMedicalContraindications(ids, isSynchronous) {
1611
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllMedicalContraindications(filter, isSynchronous, correlationId) {
1619
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalContraindication(id) {
1628
- return __awaiter(this, void 0, void 0, function* () {
1629
- return this.queryAndCheckError(Documents.GetMedicalContraindication, { id: id });
1630
- });
1259
+ async createMedicalDevice(MedicalDevice) {
1260
+ return this.mutateAndCheckError(Documents.CreateMedicalDevice, { MedicalDevice: MedicalDevice });
1631
1261
  }
1632
- queryMedicalContraindications(filter) {
1633
- return __awaiter(this, void 0, void 0, function* () {
1634
- return this.queryAndCheckError(Documents.QueryMedicalContraindications, { filter: filter });
1635
- });
1262
+ async updateMedicalDevice(MedicalDevice) {
1263
+ return this.mutateAndCheckError(Documents.UpdateMedicalDevice, { MedicalDevice: MedicalDevice });
1636
1264
  }
1637
- createMedicalTest(MedicalTest) {
1638
- return __awaiter(this, void 0, void 0, function* () {
1639
- return this.mutateAndCheckError(Documents.CreateMedicalTest, { MedicalTest: MedicalTest });
1640
- });
1265
+ async deleteMedicalDevice(id) {
1266
+ return this.mutateAndCheckError(Documents.DeleteMedicalDevice, { id: id });
1641
1267
  }
1642
- updateMedicalTest(MedicalTest) {
1643
- return __awaiter(this, void 0, void 0, function* () {
1644
- return this.mutateAndCheckError(Documents.UpdateMedicalTest, { MedicalTest: MedicalTest });
1268
+ async deleteMedicalDevices(ids, isSynchronous) {
1269
+ return this.mutateAndCheckError(Documents.DeleteMedicalDevices, {
1270
+ ids: ids,
1271
+ isSynchronous: isSynchronous,
1645
1272
  });
1646
1273
  }
1647
- deleteMedicalTest(id) {
1648
- return __awaiter(this, void 0, void 0, function* () {
1649
- return this.mutateAndCheckError(Documents.DeleteMedicalTest, { id: id });
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
- deleteMedicalTests(ids, isSynchronous) {
1653
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllMedicalTests(filter, isSynchronous, correlationId) {
1658
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalTest(id) {
1667
- return __awaiter(this, void 0, void 0, function* () {
1668
- return this.queryAndCheckError(Documents.GetMedicalTest, { id: id });
1669
- });
1287
+ async createMedicalProcedure(MedicalProcedure) {
1288
+ return this.mutateAndCheckError(Documents.CreateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
1670
1289
  }
1671
- queryMedicalTests(filter) {
1672
- return __awaiter(this, void 0, void 0, function* () {
1673
- return this.queryAndCheckError(Documents.QueryMedicalTests, { filter: filter });
1674
- });
1290
+ async updateMedicalProcedure(MedicalProcedure) {
1291
+ return this.mutateAndCheckError(Documents.UpdateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
1675
1292
  }
1676
- createMedicalDevice(MedicalDevice) {
1677
- return __awaiter(this, void 0, void 0, function* () {
1678
- return this.mutateAndCheckError(Documents.CreateMedicalDevice, { MedicalDevice: MedicalDevice });
1679
- });
1293
+ async deleteMedicalProcedure(id) {
1294
+ return this.mutateAndCheckError(Documents.DeleteMedicalProcedure, { id: id });
1680
1295
  }
1681
- updateMedicalDevice(MedicalDevice) {
1682
- return __awaiter(this, void 0, void 0, function* () {
1683
- return this.mutateAndCheckError(Documents.UpdateMedicalDevice, { MedicalDevice: MedicalDevice });
1296
+ async deleteMedicalProcedures(ids, isSynchronous) {
1297
+ return this.mutateAndCheckError(Documents.DeleteMedicalProcedures, {
1298
+ ids: ids,
1299
+ isSynchronous: isSynchronous,
1684
1300
  });
1685
1301
  }
1686
- deleteMedicalDevice(id) {
1687
- return __awaiter(this, void 0, void 0, function* () {
1688
- return this.mutateAndCheckError(Documents.DeleteMedicalDevice, { id: id });
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
- deleteMedicalDevices(ids, isSynchronous) {
1692
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllMedicalDevices(filter, isSynchronous, correlationId) {
1700
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalDevice(id) {
1709
- return __awaiter(this, void 0, void 0, function* () {
1710
- return this.queryAndCheckError(Documents.GetMedicalDevice, { id: id });
1711
- });
1315
+ async createMedicalStudy(MedicalStudy) {
1316
+ return this.mutateAndCheckError(Documents.CreateMedicalStudy, { MedicalStudy: MedicalStudy });
1712
1317
  }
1713
- queryMedicalDevices(filter) {
1714
- return __awaiter(this, void 0, void 0, function* () {
1715
- return this.queryAndCheckError(Documents.QueryMedicalDevices, { filter: filter });
1716
- });
1318
+ async updateMedicalStudy(MedicalStudy) {
1319
+ return this.mutateAndCheckError(Documents.UpdateMedicalStudy, { MedicalStudy: MedicalStudy });
1717
1320
  }
1718
- createMedicalProcedure(MedicalProcedure) {
1719
- return __awaiter(this, void 0, void 0, function* () {
1720
- return this.mutateAndCheckError(Documents.CreateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
1721
- });
1321
+ async deleteMedicalStudy(id) {
1322
+ return this.mutateAndCheckError(Documents.DeleteMedicalStudy, { id: id });
1722
1323
  }
1723
- updateMedicalProcedure(MedicalProcedure) {
1724
- return __awaiter(this, void 0, void 0, function* () {
1725
- return this.mutateAndCheckError(Documents.UpdateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
1324
+ async deleteMedicalStudies(ids, isSynchronous) {
1325
+ return this.mutateAndCheckError(Documents.DeleteMedicalStudies, {
1326
+ ids: ids,
1327
+ isSynchronous: isSynchronous,
1726
1328
  });
1727
1329
  }
1728
- deleteMedicalProcedure(id) {
1729
- return __awaiter(this, void 0, void 0, function* () {
1730
- return this.mutateAndCheckError(Documents.DeleteMedicalProcedure, { id: id });
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
- deleteMedicalProcedures(ids, isSynchronous) {
1734
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllMedicalProcedures(filter, isSynchronous, correlationId) {
1742
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalProcedure(id) {
1751
- return __awaiter(this, void 0, void 0, function* () {
1752
- return this.queryAndCheckError(Documents.GetMedicalProcedure, { id: id });
1753
- });
1343
+ async createMedicalDrugClass(MedicalDrugClass) {
1344
+ return this.mutateAndCheckError(Documents.CreateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
1754
1345
  }
1755
- queryMedicalProcedures(filter) {
1756
- return __awaiter(this, void 0, void 0, function* () {
1757
- return this.queryAndCheckError(Documents.QueryMedicalProcedures, { filter: filter });
1758
- });
1346
+ async updateMedicalDrugClass(MedicalDrugClass) {
1347
+ return this.mutateAndCheckError(Documents.UpdateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
1759
1348
  }
1760
- createMedicalStudy(MedicalStudy) {
1761
- return __awaiter(this, void 0, void 0, function* () {
1762
- return this.mutateAndCheckError(Documents.CreateMedicalStudy, { MedicalStudy: MedicalStudy });
1763
- });
1349
+ async deleteMedicalDrugClass(id) {
1350
+ return this.mutateAndCheckError(Documents.DeleteMedicalDrugClass, { id: id });
1764
1351
  }
1765
- updateMedicalStudy(MedicalStudy) {
1766
- return __awaiter(this, void 0, void 0, function* () {
1767
- return this.mutateAndCheckError(Documents.UpdateMedicalStudy, { MedicalStudy: MedicalStudy });
1352
+ async deleteMedicalDrugClasses(ids, isSynchronous) {
1353
+ return this.mutateAndCheckError(Documents.DeleteMedicalDrugClasses, {
1354
+ ids: ids,
1355
+ isSynchronous: isSynchronous,
1768
1356
  });
1769
1357
  }
1770
- deleteMedicalStudy(id) {
1771
- return __awaiter(this, void 0, void 0, function* () {
1772
- return this.mutateAndCheckError(Documents.DeleteMedicalStudy, { id: id });
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
- deleteMedicalStudies(ids, isSynchronous) {
1776
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllMedicalStudies(filter, isSynchronous, correlationId) {
1784
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalStudy(id) {
1793
- return __awaiter(this, void 0, void 0, function* () {
1794
- return this.queryAndCheckError(Documents.GetMedicalStudy, { id: id });
1795
- });
1371
+ async createMedicalTherapy(MedicalTherapy) {
1372
+ return this.mutateAndCheckError(Documents.CreateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
1796
1373
  }
1797
- queryMedicalStudies(filter) {
1798
- return __awaiter(this, void 0, void 0, function* () {
1799
- return this.queryAndCheckError(Documents.QueryMedicalStudies, { filter: filter });
1800
- });
1374
+ async updateMedicalTherapy(MedicalTherapy) {
1375
+ return this.mutateAndCheckError(Documents.UpdateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
1801
1376
  }
1802
- createMedicalDrugClass(MedicalDrugClass) {
1803
- return __awaiter(this, void 0, void 0, function* () {
1804
- return this.mutateAndCheckError(Documents.CreateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
1805
- });
1377
+ async deleteMedicalTherapy(id) {
1378
+ return this.mutateAndCheckError(Documents.DeleteMedicalTherapy, { id: id });
1806
1379
  }
1807
- updateMedicalDrugClass(MedicalDrugClass) {
1808
- return __awaiter(this, void 0, void 0, function* () {
1809
- return this.mutateAndCheckError(Documents.UpdateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
1380
+ async deleteMedicalTherapies(ids, isSynchronous) {
1381
+ return this.mutateAndCheckError(Documents.DeleteMedicalTherapies, {
1382
+ ids: ids,
1383
+ isSynchronous: isSynchronous,
1810
1384
  });
1811
1385
  }
1812
- deleteMedicalDrugClass(id) {
1813
- return __awaiter(this, void 0, void 0, function* () {
1814
- return this.mutateAndCheckError(Documents.DeleteMedicalDrugClass, { id: id });
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
- deleteMedicalDrugClasses(ids, isSynchronous) {
1818
- return __awaiter(this, void 0, void 0, function* () {
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
- deleteAllMedicalDrugClasses(filter, isSynchronous, correlationId) {
1826
- return __awaiter(this, void 0, void 0, function* () {
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
- getMedicalDrugClass(id) {
1835
- return __awaiter(this, void 0, void 0, function* () {
1836
- return this.queryAndCheckError(Documents.GetMedicalDrugClass, { id: id });
1837
- });
1399
+ async createObservation(observation) {
1400
+ return this.mutateAndCheckError(Documents.CreateObservation, { observation: observation });
1838
1401
  }
1839
- queryMedicalDrugClasses(filter) {
1840
- return __awaiter(this, void 0, void 0, function* () {
1841
- return this.queryAndCheckError(Documents.QueryMedicalDrugClasses, { filter: filter });
1842
- });
1402
+ async updateObservation(observation) {
1403
+ return this.mutateAndCheckError(Documents.UpdateObservation, { observation: observation });
1843
1404
  }
1844
- createMedicalTherapy(MedicalTherapy) {
1845
- return __awaiter(this, void 0, void 0, function* () {
1846
- return this.mutateAndCheckError(Documents.CreateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
1847
- });
1405
+ async deleteObservation(id) {
1406
+ return this.mutateAndCheckError(Documents.DeleteObservation, { id: id });
1848
1407
  }
1849
- updateMedicalTherapy(MedicalTherapy) {
1850
- return __awaiter(this, void 0, void 0, function* () {
1851
- return this.mutateAndCheckError(Documents.UpdateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
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
- deleteMedicalTherapy(id) {
1855
- return __awaiter(this, void 0, void 0, function* () {
1856
- return this.mutateAndCheckError(Documents.DeleteMedicalTherapy, { id: id });
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
- deleteMedicalTherapies(ids, isSynchronous) {
1860
- return __awaiter(this, void 0, void 0, function* () {
1861
- return this.mutateAndCheckError(Documents.DeleteMedicalTherapies, {
1862
- ids: ids,
1863
- isSynchronous: isSynchronous,
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
- deleteAllMedicalTherapies(filter, isSynchronous, correlationId) {
1868
- return __awaiter(this, void 0, void 0, function* () {
1869
- return this.mutateAndCheckError(Documents.DeleteAllMedicalTherapies, {
1870
- filter: filter,
1871
- isSynchronous: isSynchronous,
1872
- correlationId: correlationId,
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
- getMedicalTherapy(id) {
1877
- return __awaiter(this, void 0, void 0, function* () {
1878
- return this.queryAndCheckError(Documents.GetMedicalTherapy, { id: id });
1879
- });
1880
- }
1881
- queryMedicalTherapies(filter) {
1882
- return __awaiter(this, void 0, void 0, function* () {
1883
- return this.queryAndCheckError(Documents.QueryMedicalTherapies, { filter: filter });
1884
- });
1885
- }
1886
- createObservation(observation) {
1887
- return __awaiter(this, void 0, void 0, function* () {
1888
- return this.mutateAndCheckError(Documents.CreateObservation, { observation: observation });
1889
- });
1890
- }
1891
- updateObservation(observation) {
1892
- return __awaiter(this, void 0, void 0, function* () {
1893
- return this.mutateAndCheckError(Documents.UpdateObservation, { observation: observation });
1894
- });
1895
- }
1896
- deleteObservation(id) {
1897
- return __awaiter(this, void 0, void 0, function* () {
1898
- return this.mutateAndCheckError(Documents.DeleteObservation, { id: id });
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
- return __awaiter(this, void 0, void 0, function* () {
1920
- if (this.client === undefined)
1921
- throw new Error("Apollo Client not configured.");
1922
- try {
1923
- const result = yield this.client.mutate({
1924
- mutation,
1925
- variables: variables || {},
1926
- });
1927
- if (result.errors) {
1928
- const errorMessage = result.errors
1929
- .map((err) => this.prettyPrintGraphQLError(err))
1930
- .join("\n");
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
- catch (error) {
1939
- if (error instanceof core_1.ApolloError && error.graphQLErrors.length > 0) {
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
- return __awaiter(this, void 0, void 0, function* () {
1958
- if (this.client === undefined)
1959
- throw new Error("Apollo Client not configured.");
1960
- try {
1961
- const result = yield this.client.query({
1962
- query,
1963
- variables: variables || {},
1964
- });
1965
- if (result.errors) {
1966
- const errorMessage = result.errors
1967
- .map((err) => this.prettyPrintGraphQLError(err))
1968
- .join("\n");
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
- catch (error) {
1977
- if (error instanceof core_1.ApolloError && error.graphQLErrors.length > 0) {
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
- exports.Graphlit = Graphlit;
1996
- exports.Types = __importStar(require("./generated/graphql-types.js"));
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";