graphlit-client 1.0.20240418003 → 1.0.20240418005
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.d.ts +58 -72
- package/dist/client.js +286 -204
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
@@ -11,78 +11,64 @@ declare class Graphlit {
|
|
11
11
|
private token;
|
12
12
|
constructor(organizationId?: string, environmentId?: string, jwtSecret?: string, ownerId?: string, apiUri?: string, correlationId?: string);
|
13
13
|
createAlert(alert: Types.AlertInput): Promise<any>;
|
14
|
-
alert
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
create: (specification: Types.SpecificationInput) => Promise<any>;
|
71
|
-
update: (specification: Types.SpecificationUpdateInput) => Promise<any>;
|
72
|
-
delete: (id: string) => Promise<any>;
|
73
|
-
prompt: (prompt: string, ids: [string]) => Promise<any>;
|
74
|
-
get: (id: string) => Promise<any>;
|
75
|
-
query: (filter: Types.SpecificationFilter) => Promise<any>;
|
76
|
-
};
|
77
|
-
workflow(): {
|
78
|
-
create: (workflow: Types.WorkflowInput) => Promise<any>;
|
79
|
-
update: (workflow: Types.WorkflowUpdateInput) => Promise<any>;
|
80
|
-
delete: (id: string) => Promise<any>;
|
81
|
-
deleteAll: (mutation?: any) => Promise<any>;
|
82
|
-
get: (id: string) => Promise<any>;
|
83
|
-
query: (filter: Types.WorkflowFilter) => Promise<any>;
|
84
|
-
};
|
14
|
+
updateAlert(alert: Types.AlertUpdateInput): Promise<any>;
|
15
|
+
deleteAlert(id: string): Promise<any>;
|
16
|
+
deleteAllAlerts(): Promise<any>;
|
17
|
+
enableAlert(id: string): Promise<any>;
|
18
|
+
disableAlert(id: string): Promise<any>;
|
19
|
+
getAlert(id: string): Promise<any>;
|
20
|
+
queryAlerts(filter: Types.AlertFilter): Promise<any>;
|
21
|
+
createCollection(collection: Types.CollectionInput): Promise<any>;
|
22
|
+
updateCollection(collection: Types.CollectionUpdateInput): Promise<any>;
|
23
|
+
deleteCollection(id: string): Promise<any>;
|
24
|
+
addContentsToCollections(contents: Types.EntityReferenceInput[], collections: Types.EntityReferenceInput[]): Promise<any>;
|
25
|
+
removeContentsFromCollection(contents: Types.EntityReferenceInput[], collection: Types.EntityReferenceInput): Promise<any>;
|
26
|
+
getCollection(id: string): Promise<any>;
|
27
|
+
queryCollections(filter: Types.CollectionFilter): Promise<any>;
|
28
|
+
ingestUri(uri: string, name?: string, id?: string, isSynchronous?: boolean, workflow?: Types.EntityReferenceInput): Promise<any>;
|
29
|
+
ingestText(name: string, text: string, textType?: Types.TextTypes, uri?: string, id?: string, isSynchronous?: boolean, workflow?: Types.EntityReferenceInput): Promise<any>;
|
30
|
+
ingestEncodedFile(name: string, data: string, mimeType: string, id?: string, isSynchronous?: boolean, workflow?: Types.EntityReferenceInput): Promise<any>;
|
31
|
+
updateContent(content: Types.ContentUpdateInput): Promise<any>;
|
32
|
+
deleteContent(id: string): Promise<any>;
|
33
|
+
deleteAllContents(): Promise<any>;
|
34
|
+
summarizeContents(summarizations: [Types.SummarizationStrategyInput], filter?: Types.ContentFilter): Promise<any>;
|
35
|
+
extractContents(prompt: string, filter?: Types.ContentFilter, specification?: Types.EntityReferenceInput): Promise<any>;
|
36
|
+
publishContents(summaryPrompt: string, summarySpecification: Types.EntityReferenceInput, connector: Types.ContentPublishingConnectorInput, publishPrompt?: string, publishSpecification?: Types.EntityReferenceInput, name?: string, filter?: Types.ContentFilter, workflow?: Types.EntityReferenceInput): Promise<any>;
|
37
|
+
getContent(id: string): Promise<any>;
|
38
|
+
queryContents(filter: Types.ContentFilter): Promise<any>;
|
39
|
+
createConversation(conversation: Types.ConversationInput): Promise<any>;
|
40
|
+
updateConversation(conversation: Types.ConversationUpdateInput): Promise<any>;
|
41
|
+
deleteConversation(id: string): Promise<any>;
|
42
|
+
deleteAllConversations(): Promise<any>;
|
43
|
+
clearConversation(id: string): Promise<any>;
|
44
|
+
closeConversation(id: string): Promise<any>;
|
45
|
+
promptConversation(prompt: string, id?: string): Promise<any>;
|
46
|
+
publishConversation(id: string, connector: Types.ContentPublishingConnectorInput, name?: string, workflow?: Types.EntityReferenceInput): Promise<any>;
|
47
|
+
suggestConversation(id: string, count?: number): Promise<any>;
|
48
|
+
getConversation(id: string): Promise<any>;
|
49
|
+
queryConversations(filter: Types.ConversationFilter): Promise<any>;
|
50
|
+
createFeed(feed: Types.FeedInput): Promise<any>;
|
51
|
+
updateFeed(feed: Types.FeedUpdateInput): Promise<any>;
|
52
|
+
deleteFeed(id: string): Promise<any>;
|
53
|
+
deleteAllFeeds(): Promise<any>;
|
54
|
+
enableFeed(id: string): Promise<any>;
|
55
|
+
disableFeed(id: string): Promise<any>;
|
56
|
+
getFeed(id: string): Promise<any>;
|
57
|
+
queryFeeds(filter: Types.FeedFilter): Promise<any>;
|
58
|
+
createSpecification(specification: Types.SpecificationInput): Promise<any>;
|
59
|
+
updateSpecification(specification: Types.SpecificationUpdateInput): Promise<any>;
|
60
|
+
deleteSpecification(id: string): Promise<any>;
|
61
|
+
promptSpecifications(prompt: string, ids: [string]): Promise<any>;
|
62
|
+
getSpecification(id: string): Promise<any>;
|
63
|
+
querySpecifications(filter: Types.SpecificationFilter): Promise<any>;
|
64
|
+
createWorkflow(workflow: Types.WorkflowInput): Promise<any>;
|
65
|
+
updateWorkflow(workflow: Types.WorkflowUpdateInput): Promise<any>;
|
66
|
+
deleteWorkflow(id: string): Promise<any>;
|
67
|
+
deleteAllWorkflows(): Promise<any>;
|
68
|
+
getWorkflow(id: string): Promise<any>;
|
69
|
+
queryWorkflows(filter: Types.WorkflowFilter): Promise<any>;
|
85
70
|
private mutateAndCheckError;
|
86
71
|
private queryAndCheckError;
|
87
72
|
}
|
88
|
-
export { Graphlit
|
73
|
+
export { Graphlit };
|
74
|
+
export * as Types from './generated/graphql-types';
|
package/dist/client.js
CHANGED
@@ -34,8 +34,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
35
35
|
exports.Types = exports.Graphlit = void 0;
|
36
36
|
const client_1 = require("@apollo/client");
|
37
|
-
const Types = __importStar(require("./generated/graphql-types"));
|
38
|
-
exports.Types = Types;
|
39
37
|
const Documents = __importStar(require("./generated/graphql-documents"));
|
40
38
|
const jwt = __importStar(require("jsonwebtoken"));
|
41
39
|
const dotenv = __importStar(require("dotenv"));
|
@@ -85,215 +83,298 @@ class Graphlit {
|
|
85
83
|
return this.mutateAndCheckError(Documents.CreateAlert, { alert: alert, correlationId: this.correlationId });
|
86
84
|
});
|
87
85
|
}
|
88
|
-
alert
|
89
|
-
return {
|
90
|
-
|
91
|
-
|
92
|
-
}),
|
93
|
-
delete: (id) => __awaiter(this, void 0, void 0, function* () {
|
94
|
-
return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
|
95
|
-
}),
|
96
|
-
deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
|
97
|
-
return this.mutateAndCheckError(Documents.DeleteAllAlerts);
|
98
|
-
}),
|
99
|
-
enable: (id) => __awaiter(this, void 0, void 0, function* () {
|
100
|
-
return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
|
101
|
-
}),
|
102
|
-
disable: (id) => __awaiter(this, void 0, void 0, function* () {
|
103
|
-
return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
|
104
|
-
}),
|
105
|
-
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
106
|
-
return this.queryAndCheckError(Documents.GetAlert, { id: id });
|
107
|
-
}),
|
108
|
-
query: (filter) => __awaiter(this, void 0, void 0, function* () {
|
109
|
-
return this.queryAndCheckError(Documents.QueryAlerts, { filter: filter });
|
110
|
-
}),
|
111
|
-
};
|
86
|
+
updateAlert(alert) {
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
88
|
+
return this.mutateAndCheckError(Documents.UpdateAlert, { alert: alert });
|
89
|
+
});
|
112
90
|
}
|
113
|
-
|
114
|
-
return {
|
115
|
-
|
116
|
-
|
117
|
-
}),
|
118
|
-
update: (collection) => __awaiter(this, void 0, void 0, function* () {
|
119
|
-
return this.mutateAndCheckError(Documents.UpdateCollection, { collection: collection });
|
120
|
-
}),
|
121
|
-
delete: (id) => __awaiter(this, void 0, void 0, function* () {
|
122
|
-
return this.mutateAndCheckError(Documents.DeleteCollection, { id: id });
|
123
|
-
}),
|
124
|
-
/*
|
125
|
-
deleteAll: async (mutation?: any) => {
|
126
|
-
return this.mutateAndCheckError(Documents.DeleteAllCollections);
|
127
|
-
},
|
128
|
-
*/
|
129
|
-
add: (contents, collections) => __awaiter(this, void 0, void 0, function* () {
|
130
|
-
return this.mutateAndCheckError(Documents.AddContentsToCollections, { contents: contents, collections: collections });
|
131
|
-
}),
|
132
|
-
remove: (contents, collection) => __awaiter(this, void 0, void 0, function* () {
|
133
|
-
return this.mutateAndCheckError(Documents.RemoveContentsFromCollection, { contents: contents, collection: collection });
|
134
|
-
}),
|
135
|
-
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
136
|
-
return this.queryAndCheckError(Documents.GetCollection, { id: id });
|
137
|
-
}),
|
138
|
-
query: (filter) => __awaiter(this, void 0, void 0, function* () {
|
139
|
-
return this.queryAndCheckError(Documents.QueryCollections, { filter: filter });
|
140
|
-
}),
|
141
|
-
};
|
91
|
+
deleteAlert(id) {
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
93
|
+
return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
|
94
|
+
});
|
142
95
|
}
|
143
|
-
|
144
|
-
return {
|
145
|
-
|
146
|
-
|
147
|
-
}),
|
148
|
-
ingestText: (name, text, textType, uri, id, isSynchronous, workflow) => __awaiter(this, void 0, void 0, function* () {
|
149
|
-
return this.mutateAndCheckError(Documents.IngestText, { name: name, text: text, textType: textType, uri: uri, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
|
150
|
-
}),
|
151
|
-
ingestEncodedFile: (name, data, mimeType, id, isSynchronous, workflow) => __awaiter(this, void 0, void 0, function* () {
|
152
|
-
return this.mutateAndCheckError(Documents.IngestEncodedFile, { name: name, data: data, mimeType: mimeType, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
|
153
|
-
}),
|
154
|
-
update: (content) => __awaiter(this, void 0, void 0, function* () {
|
155
|
-
return this.mutateAndCheckError(Documents.UpdateContent, { content: content });
|
156
|
-
}),
|
157
|
-
delete: (id) => __awaiter(this, void 0, void 0, function* () {
|
158
|
-
return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
|
159
|
-
}),
|
160
|
-
deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
|
161
|
-
return this.mutateAndCheckError(Documents.DeleteAllContents);
|
162
|
-
}),
|
163
|
-
summarize: (summarizations, filter) => __awaiter(this, void 0, void 0, function* () {
|
164
|
-
return this.mutateAndCheckError(Documents.SummarizeContents, { summarizations: summarizations, filter: filter, correlationId: this.correlationId });
|
165
|
-
}),
|
166
|
-
extract: (prompt, filter, specification) => __awaiter(this, void 0, void 0, function* () {
|
167
|
-
return this.mutateAndCheckError(Documents.ExtractContents, { prompt: prompt, filter: filter, specification: specification, correlationId: this.correlationId });
|
168
|
-
}),
|
169
|
-
publish: (summaryPrompt, summarySpecification, connector, publishPrompt, publishSpecification, name, filter, workflow) => __awaiter(this, void 0, void 0, function* () {
|
170
|
-
return this.mutateAndCheckError(Documents.PublishContents, { summaryPrompt: summaryPrompt, summarySpecification: summarySpecification, connector: connector, publishPrompt: publishPrompt, publishSpecification: publishSpecification, name: name, filter: filter, workflow: workflow, correlationId: this.correlationId });
|
171
|
-
}),
|
172
|
-
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
173
|
-
return this.queryAndCheckError(Documents.GetContent, { id: id });
|
174
|
-
}),
|
175
|
-
query: (filter) => __awaiter(this, void 0, void 0, function* () {
|
176
|
-
return this.queryAndCheckError(Documents.QueryContents, { filter: filter });
|
177
|
-
}),
|
178
|
-
};
|
96
|
+
deleteAllAlerts() {
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
98
|
+
return this.mutateAndCheckError(Documents.DeleteAllAlerts);
|
99
|
+
});
|
179
100
|
}
|
180
|
-
|
181
|
-
return {
|
182
|
-
|
183
|
-
|
184
|
-
}),
|
185
|
-
update: (conversation) => __awaiter(this, void 0, void 0, function* () {
|
186
|
-
return this.mutateAndCheckError(Documents.UpdateConversation, { conversation: conversation });
|
187
|
-
}),
|
188
|
-
delete: (id) => __awaiter(this, void 0, void 0, function* () {
|
189
|
-
return this.mutateAndCheckError(Documents.DeleteConversation, { id: id });
|
190
|
-
}),
|
191
|
-
deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
|
192
|
-
return this.mutateAndCheckError(Documents.DeleteAllConversations);
|
193
|
-
}),
|
194
|
-
clear: (id) => __awaiter(this, void 0, void 0, function* () {
|
195
|
-
return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
|
196
|
-
}),
|
197
|
-
close: (id) => __awaiter(this, void 0, void 0, function* () {
|
198
|
-
return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
|
199
|
-
}),
|
200
|
-
prompt: (prompt, id) => __awaiter(this, void 0, void 0, function* () {
|
201
|
-
return this.mutateAndCheckError(Documents.PromptConversation, { prompt: prompt, id: id, correlationId: this.correlationId });
|
202
|
-
}),
|
203
|
-
publish: (id, connector, name, workflow) => __awaiter(this, void 0, void 0, function* () {
|
204
|
-
return this.mutateAndCheckError(Documents.PublishConversation, { id: id, connector: connector, name: name, workflow: workflow, correlationId: this.correlationId });
|
205
|
-
}),
|
206
|
-
suggest: (id, count) => __awaiter(this, void 0, void 0, function* () {
|
207
|
-
return this.mutateAndCheckError(Documents.SuggestConversation, { id: id, count: count, correlationId: this.correlationId });
|
208
|
-
}),
|
209
|
-
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
210
|
-
return this.queryAndCheckError(Documents.GetConversation, { id: id });
|
211
|
-
}),
|
212
|
-
query: (filter) => __awaiter(this, void 0, void 0, function* () {
|
213
|
-
return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
|
214
|
-
}),
|
215
|
-
};
|
101
|
+
enableAlert(id) {
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
103
|
+
return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
|
104
|
+
});
|
216
105
|
}
|
217
|
-
|
218
|
-
return {
|
219
|
-
|
220
|
-
|
221
|
-
}),
|
222
|
-
update: (feed) => __awaiter(this, void 0, void 0, function* () {
|
223
|
-
return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
|
224
|
-
}),
|
225
|
-
delete: (id) => __awaiter(this, void 0, void 0, function* () {
|
226
|
-
return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
|
227
|
-
}),
|
228
|
-
deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
|
229
|
-
return this.mutateAndCheckError(Documents.DeleteAllFeeds);
|
230
|
-
}),
|
231
|
-
enable: (id) => __awaiter(this, void 0, void 0, function* () {
|
232
|
-
return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
|
233
|
-
}),
|
234
|
-
disable: (id) => __awaiter(this, void 0, void 0, function* () {
|
235
|
-
return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
|
236
|
-
}),
|
237
|
-
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
238
|
-
return this.queryAndCheckError(Documents.GetFeed, { id: id });
|
239
|
-
}),
|
240
|
-
query: (filter) => __awaiter(this, void 0, void 0, function* () {
|
241
|
-
return this.queryAndCheckError(Documents.QueryFeeds, { filter: filter });
|
242
|
-
}),
|
243
|
-
};
|
106
|
+
disableAlert(id) {
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
108
|
+
return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
|
109
|
+
});
|
244
110
|
}
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
return {
|
250
|
-
create: (specification) => __awaiter(this, void 0, void 0, function* () {
|
251
|
-
return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
|
252
|
-
}),
|
253
|
-
update: (specification) => __awaiter(this, void 0, void 0, function* () {
|
254
|
-
return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
|
255
|
-
}),
|
256
|
-
delete: (id) => __awaiter(this, void 0, void 0, function* () {
|
257
|
-
return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
|
258
|
-
}),
|
259
|
-
/*
|
260
|
-
deleteAll: async (mutation?: any) => {
|
261
|
-
return this.mutateAndCheckError(Documents.DeleteAllSpecifications);
|
262
|
-
},
|
263
|
-
*/
|
264
|
-
prompt: (prompt, ids) => __awaiter(this, void 0, void 0, function* () {
|
265
|
-
return this.mutateAndCheckError(Documents.PromptSpecifications, { prompt: prompt, ids: ids });
|
266
|
-
}),
|
267
|
-
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
268
|
-
return this.queryAndCheckError(Documents.GetSpecification, { id: id });
|
269
|
-
}),
|
270
|
-
query: (filter) => __awaiter(this, void 0, void 0, function* () {
|
271
|
-
return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
|
272
|
-
}),
|
273
|
-
};
|
111
|
+
getAlert(id) {
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
113
|
+
return this.queryAndCheckError(Documents.GetAlert, { id: id });
|
114
|
+
});
|
274
115
|
}
|
275
|
-
|
276
|
-
return {
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
})
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
116
|
+
queryAlerts(filter) {
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
118
|
+
return this.queryAndCheckError(Documents.QueryAlerts, { filter: filter });
|
119
|
+
});
|
120
|
+
}
|
121
|
+
createCollection(collection) {
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
123
|
+
return this.mutateAndCheckError(Documents.CreateCollection, { collection: collection });
|
124
|
+
});
|
125
|
+
}
|
126
|
+
updateCollection(collection) {
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
128
|
+
return this.mutateAndCheckError(Documents.UpdateCollection, { collection: collection });
|
129
|
+
});
|
130
|
+
}
|
131
|
+
deleteCollection(id) {
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
133
|
+
return this.mutateAndCheckError(Documents.DeleteCollection, { id: id });
|
134
|
+
});
|
135
|
+
}
|
136
|
+
/*
|
137
|
+
public async deleteAllCollections() {
|
138
|
+
return this.mutateAndCheckError(Documents.DeleteAllCollections);
|
139
|
+
}
|
140
|
+
*/
|
141
|
+
addContentsToCollections(contents, collections) {
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
143
|
+
return this.mutateAndCheckError(Documents.AddContentsToCollections, { contents: contents, collections: collections });
|
144
|
+
});
|
145
|
+
}
|
146
|
+
removeContentsFromCollection(contents, collection) {
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
148
|
+
return this.mutateAndCheckError(Documents.RemoveContentsFromCollection, { contents: contents, collection: collection });
|
149
|
+
});
|
150
|
+
}
|
151
|
+
getCollection(id) {
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
153
|
+
return this.queryAndCheckError(Documents.GetCollection, { id: id });
|
154
|
+
});
|
155
|
+
}
|
156
|
+
queryCollections(filter) {
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
158
|
+
return this.queryAndCheckError(Documents.QueryCollections, { filter: filter });
|
159
|
+
});
|
160
|
+
}
|
161
|
+
ingestUri(uri, name, id, isSynchronous, workflow) {
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
163
|
+
return this.mutateAndCheckError(Documents.IngestUri, { uri: uri, name: name, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
|
164
|
+
});
|
165
|
+
}
|
166
|
+
ingestText(name, text, textType, uri, id, isSynchronous, workflow) {
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
168
|
+
return this.mutateAndCheckError(Documents.IngestText, { name: name, text: text, textType: textType, uri: uri, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
|
169
|
+
});
|
170
|
+
}
|
171
|
+
ingestEncodedFile(name, data, mimeType, id, isSynchronous, workflow) {
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
173
|
+
return this.mutateAndCheckError(Documents.IngestEncodedFile, { name: name, data: data, mimeType: mimeType, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
|
174
|
+
});
|
175
|
+
}
|
176
|
+
updateContent(content) {
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
178
|
+
return this.mutateAndCheckError(Documents.UpdateContent, { content: content });
|
179
|
+
});
|
180
|
+
}
|
181
|
+
deleteContent(id) {
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
183
|
+
return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
|
184
|
+
});
|
185
|
+
}
|
186
|
+
deleteAllContents() {
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
188
|
+
return this.mutateAndCheckError(Documents.DeleteAllContents);
|
189
|
+
});
|
190
|
+
}
|
191
|
+
summarizeContents(summarizations, filter) {
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
193
|
+
return this.mutateAndCheckError(Documents.SummarizeContents, { summarizations: summarizations, filter: filter, correlationId: this.correlationId });
|
194
|
+
});
|
195
|
+
}
|
196
|
+
extractContents(prompt, filter, specification) {
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
198
|
+
return this.mutateAndCheckError(Documents.ExtractContents, { prompt: prompt, filter: filter, specification: specification, correlationId: this.correlationId });
|
199
|
+
});
|
200
|
+
}
|
201
|
+
publishContents(summaryPrompt, summarySpecification, connector, publishPrompt, publishSpecification, name, filter, workflow) {
|
202
|
+
return __awaiter(this, void 0, void 0, function* () {
|
203
|
+
return this.mutateAndCheckError(Documents.PublishContents, { summaryPrompt: summaryPrompt, summarySpecification: summarySpecification, connector: connector, publishPrompt: publishPrompt, publishSpecification: publishSpecification, name: name, filter: filter, workflow: workflow, correlationId: this.correlationId });
|
204
|
+
});
|
205
|
+
}
|
206
|
+
getContent(id) {
|
207
|
+
return __awaiter(this, void 0, void 0, function* () {
|
208
|
+
return this.queryAndCheckError(Documents.GetContent, { id: id });
|
209
|
+
});
|
210
|
+
}
|
211
|
+
queryContents(filter) {
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
213
|
+
return this.queryAndCheckError(Documents.QueryContents, { filter: filter });
|
214
|
+
});
|
215
|
+
}
|
216
|
+
createConversation(conversation) {
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
218
|
+
return this.mutateAndCheckError(Documents.CreateConversation, { conversation: conversation, correlationId: this.correlationId });
|
219
|
+
});
|
220
|
+
}
|
221
|
+
updateConversation(conversation) {
|
222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
223
|
+
return this.mutateAndCheckError(Documents.UpdateConversation, { conversation: conversation });
|
224
|
+
});
|
225
|
+
}
|
226
|
+
deleteConversation(id) {
|
227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
228
|
+
return this.mutateAndCheckError(Documents.DeleteConversation, { id: id });
|
229
|
+
});
|
230
|
+
}
|
231
|
+
deleteAllConversations() {
|
232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
233
|
+
return this.mutateAndCheckError(Documents.DeleteAllConversations);
|
234
|
+
});
|
235
|
+
}
|
236
|
+
clearConversation(id) {
|
237
|
+
return __awaiter(this, void 0, void 0, function* () {
|
238
|
+
return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
|
239
|
+
});
|
240
|
+
}
|
241
|
+
closeConversation(id) {
|
242
|
+
return __awaiter(this, void 0, void 0, function* () {
|
243
|
+
return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
|
244
|
+
});
|
245
|
+
}
|
246
|
+
promptConversation(prompt, id) {
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
248
|
+
return this.mutateAndCheckError(Documents.PromptConversation, { prompt: prompt, id: id, correlationId: this.correlationId });
|
249
|
+
});
|
250
|
+
}
|
251
|
+
publishConversation(id, connector, name, workflow) {
|
252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
253
|
+
return this.mutateAndCheckError(Documents.PublishConversation, { id: id, connector: connector, name: name, workflow: workflow, correlationId: this.correlationId });
|
254
|
+
});
|
255
|
+
}
|
256
|
+
suggestConversation(id, count) {
|
257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
258
|
+
return this.mutateAndCheckError(Documents.SuggestConversation, { id: id, count: count, correlationId: this.correlationId });
|
259
|
+
});
|
260
|
+
}
|
261
|
+
getConversation(id) {
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
263
|
+
return this.queryAndCheckError(Documents.GetConversation, { id: id });
|
264
|
+
});
|
265
|
+
}
|
266
|
+
queryConversations(filter) {
|
267
|
+
return __awaiter(this, void 0, void 0, function* () {
|
268
|
+
return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
|
269
|
+
});
|
270
|
+
}
|
271
|
+
createFeed(feed) {
|
272
|
+
return __awaiter(this, void 0, void 0, function* () {
|
273
|
+
return this.mutateAndCheckError(Documents.CreateFeed, { feed: feed, correlationId: this.correlationId });
|
274
|
+
});
|
275
|
+
}
|
276
|
+
updateFeed(feed) {
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
278
|
+
return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
|
279
|
+
});
|
280
|
+
}
|
281
|
+
deleteFeed(id) {
|
282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
283
|
+
return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
|
284
|
+
});
|
285
|
+
}
|
286
|
+
deleteAllFeeds() {
|
287
|
+
return __awaiter(this, void 0, void 0, function* () {
|
288
|
+
return this.mutateAndCheckError(Documents.DeleteAllFeeds);
|
289
|
+
});
|
290
|
+
}
|
291
|
+
enableFeed(id) {
|
292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
293
|
+
return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
|
294
|
+
});
|
295
|
+
}
|
296
|
+
disableFeed(id) {
|
297
|
+
return __awaiter(this, void 0, void 0, function* () {
|
298
|
+
return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
|
299
|
+
});
|
300
|
+
}
|
301
|
+
getFeed(id) {
|
302
|
+
return __awaiter(this, void 0, void 0, function* () {
|
303
|
+
return this.queryAndCheckError(Documents.GetFeed, { id: id });
|
304
|
+
});
|
305
|
+
}
|
306
|
+
queryFeeds(filter) {
|
307
|
+
return __awaiter(this, void 0, void 0, function* () {
|
308
|
+
return this.queryAndCheckError(Documents.QueryFeeds, { filter: filter });
|
309
|
+
});
|
310
|
+
}
|
311
|
+
// TODO: project credits, usage, etc.
|
312
|
+
createSpecification(specification) {
|
313
|
+
return __awaiter(this, void 0, void 0, function* () {
|
314
|
+
return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
|
315
|
+
});
|
316
|
+
}
|
317
|
+
updateSpecification(specification) {
|
318
|
+
return __awaiter(this, void 0, void 0, function* () {
|
319
|
+
return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
|
320
|
+
});
|
321
|
+
}
|
322
|
+
deleteSpecification(id) {
|
323
|
+
return __awaiter(this, void 0, void 0, function* () {
|
324
|
+
return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
|
325
|
+
});
|
326
|
+
}
|
327
|
+
/*
|
328
|
+
public async deleteAllSpecifications() {
|
329
|
+
return this.mutateAndCheckError(Documents.DeleteAllSpecifications);
|
330
|
+
}
|
331
|
+
*/
|
332
|
+
promptSpecifications(prompt, ids) {
|
333
|
+
return __awaiter(this, void 0, void 0, function* () {
|
334
|
+
return this.mutateAndCheckError(Documents.PromptSpecifications, { prompt: prompt, ids: ids });
|
335
|
+
});
|
336
|
+
}
|
337
|
+
getSpecification(id) {
|
338
|
+
return __awaiter(this, void 0, void 0, function* () {
|
339
|
+
return this.queryAndCheckError(Documents.GetSpecification, { id: id });
|
340
|
+
});
|
341
|
+
}
|
342
|
+
querySpecifications(filter) {
|
343
|
+
return __awaiter(this, void 0, void 0, function* () {
|
344
|
+
return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
|
345
|
+
});
|
346
|
+
}
|
347
|
+
createWorkflow(workflow) {
|
348
|
+
return __awaiter(this, void 0, void 0, function* () {
|
349
|
+
return this.mutateAndCheckError(Documents.CreateWorkflow, { workflow: workflow });
|
350
|
+
});
|
351
|
+
}
|
352
|
+
updateWorkflow(workflow) {
|
353
|
+
return __awaiter(this, void 0, void 0, function* () {
|
354
|
+
return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
|
355
|
+
});
|
356
|
+
}
|
357
|
+
deleteWorkflow(id) {
|
358
|
+
return __awaiter(this, void 0, void 0, function* () {
|
359
|
+
return this.mutateAndCheckError(Documents.DeleteWorkflow, { id: id });
|
360
|
+
});
|
361
|
+
}
|
362
|
+
deleteAllWorkflows() {
|
363
|
+
return __awaiter(this, void 0, void 0, function* () {
|
364
|
+
return this.mutateAndCheckError(Documents.DeleteAllWorkflows);
|
365
|
+
});
|
366
|
+
}
|
367
|
+
getWorkflow(id) {
|
368
|
+
return __awaiter(this, void 0, void 0, function* () {
|
369
|
+
return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
|
370
|
+
});
|
371
|
+
}
|
372
|
+
queryWorkflows(filter) {
|
373
|
+
return __awaiter(this, void 0, void 0, function* () {
|
374
|
+
return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
|
375
|
+
});
|
296
376
|
}
|
377
|
+
// helper functions
|
297
378
|
mutateAndCheckError(mutation, variables) {
|
298
379
|
return __awaiter(this, void 0, void 0, function* () {
|
299
380
|
const result = yield this.client.mutate({
|
@@ -322,3 +403,4 @@ class Graphlit {
|
|
322
403
|
}
|
323
404
|
}
|
324
405
|
exports.Graphlit = Graphlit;
|
406
|
+
exports.Types = __importStar(require("./generated/graphql-types"));
|