graphlit-client 1.0.20240418002 → 1.0.20240418004

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 CHANGED
@@ -10,79 +10,65 @@ declare class Graphlit {
10
10
  private correlationId;
11
11
  private token;
12
12
  constructor(organizationId?: string, environmentId?: string, jwtSecret?: string, ownerId?: string, apiUri?: string, correlationId?: string);
13
- alert(): {
14
- create: (alert: Types.AlertInput) => Promise<any>;
15
- update: (alert: Types.AlertUpdateInput) => Promise<any>;
16
- delete: (id: string) => Promise<any>;
17
- deleteAll: (mutation?: any) => Promise<any>;
18
- enable: (id: string) => Promise<any>;
19
- disable: (id: string) => Promise<any>;
20
- get: (id: string) => Promise<any>;
21
- query: (filter: Types.AlertFilter) => Promise<any>;
22
- };
23
- collection(): {
24
- create: (collection: Types.CollectionInput) => Promise<any>;
25
- update: (collection: Types.CollectionUpdateInput) => Promise<any>;
26
- delete: (id: string) => Promise<any>;
27
- add: (contents: Types.EntityReferenceInput[], collections: Types.EntityReferenceInput[]) => Promise<any>;
28
- remove: (contents: Types.EntityReferenceInput[], collection: Types.EntityReferenceInput) => Promise<any>;
29
- get: (id: string) => Promise<any>;
30
- query: (filter: Types.CollectionFilter) => Promise<any>;
31
- };
32
- content(): {
33
- ingestUri: (uri: string, name?: string, id?: string, isSynchronous?: boolean, workflow?: Types.EntityReferenceInput) => Promise<any>;
34
- ingestText: (name: string, text: string, textType?: Types.TextTypes, uri?: string, id?: string, isSynchronous?: boolean, workflow?: Types.EntityReferenceInput) => Promise<any>;
35
- ingestEncodedFile: (name: string, data: string, mimeType: string, id?: string, isSynchronous?: boolean, workflow?: Types.EntityReferenceInput) => Promise<any>;
36
- update: (content: Types.ContentUpdateInput) => Promise<any>;
37
- delete: (id: string) => Promise<any>;
38
- deleteAll: (mutation?: any) => Promise<any>;
39
- summarize: (summarizations: [Types.SummarizationStrategyInput], filter?: Types.ContentFilter) => Promise<any>;
40
- extract: (prompt: string, filter?: Types.ContentFilter, specification?: Types.EntityReferenceInput) => Promise<any>;
41
- publish: (summaryPrompt: string, summarySpecification: Types.EntityReferenceInput, connector: Types.ContentPublishingConnectorInput, publishPrompt?: string, publishSpecification?: Types.EntityReferenceInput, name?: string, filter?: Types.ContentFilter, workflow?: Types.EntityReferenceInput) => Promise<any>;
42
- get: (id: string) => Promise<any>;
43
- query: (filter: Types.ContentFilter) => Promise<any>;
44
- };
45
- conversation(): {
46
- create: (conversation: Types.ConversationInput) => Promise<any>;
47
- update: (conversation: Types.ConversationUpdateInput) => Promise<any>;
48
- delete: (id: string) => Promise<any>;
49
- deleteAll: (mutation?: any) => Promise<any>;
50
- clear: (id: string) => Promise<any>;
51
- close: (id: string) => Promise<any>;
52
- prompt: (prompt: string, id?: string) => Promise<any>;
53
- publish: (id: string, connector: Types.ContentPublishingConnectorInput, name?: string, workflow?: Types.EntityReferenceInput) => Promise<any>;
54
- suggest: (id: string, count?: number) => Promise<any>;
55
- get: (id: string) => Promise<any>;
56
- query: (filter: Types.ConversationFilter) => Promise<any>;
57
- };
58
- feed(): {
59
- create: (feed: Types.FeedInput) => Promise<any>;
60
- update: (feed: Types.FeedUpdateInput) => Promise<any>;
61
- delete: (id: string) => Promise<any>;
62
- deleteAll: (mutation?: any) => Promise<any>;
63
- enable: (id: string) => Promise<any>;
64
- disable: (id: string) => Promise<any>;
65
- get: (id: string) => Promise<any>;
66
- query: (filter: Types.FeedFilter) => Promise<any>;
67
- };
68
- project(): void;
69
- specification(): {
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
- };
13
+ createAlert(alert: Types.AlertInput): Promise<any>;
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
73
  export { Graphlit };
74
+ export * as Types from './generated/graphql-types';
package/dist/client.js CHANGED
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  });
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.Graphlit = void 0;
35
+ exports.Types = exports.Graphlit = void 0;
36
36
  const client_1 = require("@apollo/client");
37
37
  const Documents = __importStar(require("./generated/graphql-documents"));
38
38
  const jwt = __importStar(require("jsonwebtoken"));
@@ -78,218 +78,303 @@ class Graphlit {
78
78
  cache: new client_1.InMemoryCache(),
79
79
  });
80
80
  }
81
- alert() {
82
- return {
83
- create: (alert) => __awaiter(this, void 0, void 0, function* () {
84
- return this.mutateAndCheckError(Documents.CreateAlert, { alert: alert, correlationId: this.correlationId });
85
- }),
86
- update: (alert) => __awaiter(this, void 0, void 0, function* () {
87
- return this.mutateAndCheckError(Documents.UpdateAlert, { alert: alert });
88
- }),
89
- delete: (id) => __awaiter(this, void 0, void 0, function* () {
90
- return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
91
- }),
92
- deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
93
- return this.mutateAndCheckError(Documents.DeleteAllAlerts);
94
- }),
95
- enable: (id) => __awaiter(this, void 0, void 0, function* () {
96
- return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
97
- }),
98
- disable: (id) => __awaiter(this, void 0, void 0, function* () {
99
- return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
100
- }),
101
- get: (id) => __awaiter(this, void 0, void 0, function* () {
102
- return this.queryAndCheckError(Documents.GetAlert, { id: id });
103
- }),
104
- query: (filter) => __awaiter(this, void 0, void 0, function* () {
105
- return this.queryAndCheckError(Documents.QueryAlerts, { filter: filter });
106
- }),
107
- };
81
+ createAlert(alert) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ return this.mutateAndCheckError(Documents.CreateAlert, { alert: alert, correlationId: this.correlationId });
84
+ });
108
85
  }
109
- collection() {
110
- return {
111
- create: (collection) => __awaiter(this, void 0, void 0, function* () {
112
- return this.mutateAndCheckError(Documents.CreateCollection, { collection: collection });
113
- }),
114
- update: (collection) => __awaiter(this, void 0, void 0, function* () {
115
- return this.mutateAndCheckError(Documents.UpdateCollection, { collection: collection });
116
- }),
117
- delete: (id) => __awaiter(this, void 0, void 0, function* () {
118
- return this.mutateAndCheckError(Documents.DeleteCollection, { id: id });
119
- }),
120
- /*
121
- deleteAll: async (mutation?: any) => {
122
- return this.mutateAndCheckError(Documents.DeleteAllCollections);
123
- },
124
- */
125
- add: (contents, collections) => __awaiter(this, void 0, void 0, function* () {
126
- return this.mutateAndCheckError(Documents.AddContentsToCollections, { contents: contents, collections: collections });
127
- }),
128
- remove: (contents, collection) => __awaiter(this, void 0, void 0, function* () {
129
- return this.mutateAndCheckError(Documents.RemoveContentsFromCollection, { contents: contents, collection: collection });
130
- }),
131
- get: (id) => __awaiter(this, void 0, void 0, function* () {
132
- return this.queryAndCheckError(Documents.GetCollection, { id: id });
133
- }),
134
- query: (filter) => __awaiter(this, void 0, void 0, function* () {
135
- return this.queryAndCheckError(Documents.QueryCollections, { filter: filter });
136
- }),
137
- };
86
+ updateAlert(alert) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ return this.mutateAndCheckError(Documents.UpdateAlert, { alert: alert });
89
+ });
138
90
  }
139
- content() {
140
- return {
141
- ingestUri: (uri, name, id, isSynchronous, workflow) => __awaiter(this, void 0, void 0, function* () {
142
- return this.mutateAndCheckError(Documents.IngestUri, { uri: uri, name: name, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
143
- }),
144
- ingestText: (name, text, textType, uri, id, isSynchronous, workflow) => __awaiter(this, void 0, void 0, function* () {
145
- return this.mutateAndCheckError(Documents.IngestText, { name: name, text: text, textType: textType, uri: uri, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
146
- }),
147
- ingestEncodedFile: (name, data, mimeType, id, isSynchronous, workflow) => __awaiter(this, void 0, void 0, function* () {
148
- return this.mutateAndCheckError(Documents.IngestEncodedFile, { name: name, data: data, mimeType: mimeType, id: id, isSynchronous: isSynchronous, workflow: workflow, correlationId: this.correlationId });
149
- }),
150
- update: (content) => __awaiter(this, void 0, void 0, function* () {
151
- return this.mutateAndCheckError(Documents.UpdateContent, { content: content });
152
- }),
153
- delete: (id) => __awaiter(this, void 0, void 0, function* () {
154
- return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
155
- }),
156
- deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
157
- return this.mutateAndCheckError(Documents.DeleteAllContents);
158
- }),
159
- summarize: (summarizations, filter) => __awaiter(this, void 0, void 0, function* () {
160
- return this.mutateAndCheckError(Documents.SummarizeContents, { summarizations: summarizations, filter: filter, correlationId: this.correlationId });
161
- }),
162
- extract: (prompt, filter, specification) => __awaiter(this, void 0, void 0, function* () {
163
- return this.mutateAndCheckError(Documents.ExtractContents, { prompt: prompt, filter: filter, specification: specification, correlationId: this.correlationId });
164
- }),
165
- publish: (summaryPrompt, summarySpecification, connector, publishPrompt, publishSpecification, name, filter, workflow) => __awaiter(this, void 0, void 0, function* () {
166
- return this.mutateAndCheckError(Documents.PublishContents, { summaryPrompt: summaryPrompt, summarySpecification: summarySpecification, connector: connector, publishPrompt: publishPrompt, publishSpecification: publishSpecification, name: name, filter: filter, workflow: workflow, correlationId: this.correlationId });
167
- }),
168
- get: (id) => __awaiter(this, void 0, void 0, function* () {
169
- return this.queryAndCheckError(Documents.GetContent, { id: id });
170
- }),
171
- query: (filter) => __awaiter(this, void 0, void 0, function* () {
172
- return this.queryAndCheckError(Documents.QueryContents, { filter: filter });
173
- }),
174
- };
91
+ deleteAlert(id) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
94
+ });
175
95
  }
176
- conversation() {
177
- return {
178
- create: (conversation) => __awaiter(this, void 0, void 0, function* () {
179
- return this.mutateAndCheckError(Documents.CreateConversation, { conversation: conversation, correlationId: this.correlationId });
180
- }),
181
- update: (conversation) => __awaiter(this, void 0, void 0, function* () {
182
- return this.mutateAndCheckError(Documents.UpdateConversation, { conversation: conversation });
183
- }),
184
- delete: (id) => __awaiter(this, void 0, void 0, function* () {
185
- return this.mutateAndCheckError(Documents.DeleteConversation, { id: id });
186
- }),
187
- deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
188
- return this.mutateAndCheckError(Documents.DeleteAllConversations);
189
- }),
190
- clear: (id) => __awaiter(this, void 0, void 0, function* () {
191
- return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
192
- }),
193
- close: (id) => __awaiter(this, void 0, void 0, function* () {
194
- return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
195
- }),
196
- prompt: (prompt, id) => __awaiter(this, void 0, void 0, function* () {
197
- return this.mutateAndCheckError(Documents.PromptConversation, { prompt: prompt, id: id, correlationId: this.correlationId });
198
- }),
199
- publish: (id, connector, name, workflow) => __awaiter(this, void 0, void 0, function* () {
200
- return this.mutateAndCheckError(Documents.PublishConversation, { id: id, connector: connector, name: name, workflow: workflow, correlationId: this.correlationId });
201
- }),
202
- suggest: (id, count) => __awaiter(this, void 0, void 0, function* () {
203
- return this.mutateAndCheckError(Documents.SuggestConversation, { id: id, count: count, correlationId: this.correlationId });
204
- }),
205
- get: (id) => __awaiter(this, void 0, void 0, function* () {
206
- return this.queryAndCheckError(Documents.GetConversation, { id: id });
207
- }),
208
- query: (filter) => __awaiter(this, void 0, void 0, function* () {
209
- return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
210
- }),
211
- };
96
+ deleteAllAlerts() {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ return this.mutateAndCheckError(Documents.DeleteAllAlerts);
99
+ });
212
100
  }
213
- feed() {
214
- return {
215
- create: (feed) => __awaiter(this, void 0, void 0, function* () {
216
- return this.mutateAndCheckError(Documents.CreateFeed, { feed: feed, correlationId: this.correlationId });
217
- }),
218
- update: (feed) => __awaiter(this, void 0, void 0, function* () {
219
- return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
220
- }),
221
- delete: (id) => __awaiter(this, void 0, void 0, function* () {
222
- return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
223
- }),
224
- deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
225
- return this.mutateAndCheckError(Documents.DeleteAllFeeds);
226
- }),
227
- enable: (id) => __awaiter(this, void 0, void 0, function* () {
228
- return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
229
- }),
230
- disable: (id) => __awaiter(this, void 0, void 0, function* () {
231
- return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
232
- }),
233
- get: (id) => __awaiter(this, void 0, void 0, function* () {
234
- return this.queryAndCheckError(Documents.GetFeed, { id: id });
235
- }),
236
- query: (filter) => __awaiter(this, void 0, void 0, function* () {
237
- return this.queryAndCheckError(Documents.QueryFeeds, { filter: filter });
238
- }),
239
- };
101
+ enableAlert(id) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
104
+ });
240
105
  }
241
- project() {
242
- // TODO: credits, usage, etc.
243
- }
244
- specification() {
245
- return {
246
- create: (specification) => __awaiter(this, void 0, void 0, function* () {
247
- return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
248
- }),
249
- update: (specification) => __awaiter(this, void 0, void 0, function* () {
250
- return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
251
- }),
252
- delete: (id) => __awaiter(this, void 0, void 0, function* () {
253
- return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
254
- }),
255
- /*
256
- deleteAll: async (mutation?: any) => {
257
- return this.mutateAndCheckError(Documents.DeleteAllSpecifications);
258
- },
259
- */
260
- prompt: (prompt, ids) => __awaiter(this, void 0, void 0, function* () {
261
- return this.mutateAndCheckError(Documents.PromptSpecifications, { prompt: prompt, ids: ids });
262
- }),
263
- get: (id) => __awaiter(this, void 0, void 0, function* () {
264
- return this.queryAndCheckError(Documents.GetSpecification, { id: id });
265
- }),
266
- query: (filter) => __awaiter(this, void 0, void 0, function* () {
267
- return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
268
- }),
269
- };
106
+ disableAlert(id) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
109
+ });
270
110
  }
271
- workflow() {
272
- return {
273
- create: (workflow) => __awaiter(this, void 0, void 0, function* () {
274
- return this.mutateAndCheckError(Documents.CreateWorkflow, { workflow: workflow });
275
- }),
276
- update: (workflow) => __awaiter(this, void 0, void 0, function* () {
277
- return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
278
- }),
279
- delete: (id) => __awaiter(this, void 0, void 0, function* () {
280
- return this.mutateAndCheckError(Documents.DeleteWorkflow, { id: id });
281
- }),
282
- deleteAll: (mutation) => __awaiter(this, void 0, void 0, function* () {
283
- return this.mutateAndCheckError(Documents.DeleteAllWorkflows);
284
- }),
285
- get: (id) => __awaiter(this, void 0, void 0, function* () {
286
- return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
287
- }),
288
- query: (filter) => __awaiter(this, void 0, void 0, function* () {
289
- return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
290
- }),
291
- };
111
+ getAlert(id) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ return this.queryAndCheckError(Documents.GetAlert, { id: id });
114
+ });
115
+ }
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
+ });
292
376
  }
377
+ // helper functions
293
378
  mutateAndCheckError(mutation, variables) {
294
379
  return __awaiter(this, void 0, void 0, function* () {
295
380
  const result = yield this.client.mutate({
@@ -318,3 +403,4 @@ class Graphlit {
318
403
  }
319
404
  }
320
405
  exports.Graphlit = Graphlit;
406
+ exports.Types = __importStar(require("./generated/graphql-types"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphlit-client",
3
- "version": "1.0.20240418002",
3
+ "version": "1.0.20240418004",
4
4
  "description": "Graphlit API TypeScript Client",
5
5
  "main": "dist/client.js",
6
6
  "types": "dist/client.d.ts",