@trustgraph/client 0.2.0
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/LICENSE +176 -0
- package/README.md +319 -0
- package/dist/__tests__/flows-api.test.d.ts +2 -0
- package/dist/__tests__/flows-api.test.d.ts.map +1 -0
- package/dist/__tests__/messages.test.d.ts +2 -0
- package/dist/__tests__/messages.test.d.ts.map +1 -0
- package/dist/__tests__/service-call-multi.test.d.ts +2 -0
- package/dist/__tests__/service-call-multi.test.d.ts.map +1 -0
- package/dist/__tests__/service-call.test.d.ts +2 -0
- package/dist/__tests__/service-call.test.d.ts.map +1 -0
- package/dist/api/authenticated-fetch.d.ts +18 -0
- package/dist/api/authenticated-fetch.d.ts.map +1 -0
- package/dist/api/trustgraph/SocketContext.d.ts +2 -0
- package/dist/api/trustgraph/SocketContext.d.ts.map +1 -0
- package/dist/api/trustgraph/SocketProvider.d.ts +21 -0
- package/dist/api/trustgraph/SocketProvider.d.ts.map +1 -0
- package/dist/api/trustgraph/Triple.d.ts +17 -0
- package/dist/api/trustgraph/Triple.d.ts.map +1 -0
- package/dist/api/trustgraph/messages.d.ts +205 -0
- package/dist/api/trustgraph/messages.d.ts.map +1 -0
- package/dist/api/trustgraph/service-call-multi.d.ts +17 -0
- package/dist/api/trustgraph/service-call-multi.d.ts.map +1 -0
- package/dist/api/trustgraph/service-call.d.ts +57 -0
- package/dist/api/trustgraph/service-call.d.ts.map +1 -0
- package/dist/api/trustgraph/socket.d.ts +2 -0
- package/dist/api/trustgraph/socket.d.ts.map +1 -0
- package/dist/api/trustgraph/trustgraph-socket.d.ts +429 -0
- package/dist/api/trustgraph/trustgraph-socket.d.ts.map +1 -0
- package/dist/index.cjs +1370 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +1361 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +1375 -0
- package/dist/index.js.map +1 -0
- package/dist/models/Triple.d.ts +17 -0
- package/dist/models/Triple.d.ts.map +1 -0
- package/dist/models/messages.d.ts +215 -0
- package/dist/models/messages.d.ts.map +1 -0
- package/dist/socket/service-call-multi.d.ts +30 -0
- package/dist/socket/service-call-multi.d.ts.map +1 -0
- package/dist/socket/service-call.d.ts +69 -0
- package/dist/socket/service-call.d.ts.map +1 -0
- package/dist/socket/trustgraph-socket.d.ts +433 -0
- package/dist/socket/trustgraph-socket.d.ts.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { Triple, Value } from "./Triple";
|
|
2
|
+
import { ServiceCall } from "./service-call";
|
|
3
|
+
export interface GraphRagOptions {
|
|
4
|
+
entityLimit?: number;
|
|
5
|
+
tripleLimit?: number;
|
|
6
|
+
maxSubgraphSize?: number;
|
|
7
|
+
pathLength?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Socket interface defining all available operations for the TrustGraph API
|
|
11
|
+
* This provides a unified interface for various AI/ML and knowledge graph
|
|
12
|
+
* operations
|
|
13
|
+
*/
|
|
14
|
+
export interface Socket {
|
|
15
|
+
close: () => void;
|
|
16
|
+
textCompletion: (system: string, text: string) => Promise<string>;
|
|
17
|
+
graphRag: (text: string, options?: GraphRagOptions) => Promise<string>;
|
|
18
|
+
agent: (question: string, think: (t: string) => void, // Called when agent is thinking
|
|
19
|
+
observe: (t: string) => void, // Called when agent makes observations
|
|
20
|
+
answer: (t: string) => void, // Called when agent provides final answer
|
|
21
|
+
error: (e: string) => void) => void;
|
|
22
|
+
embeddings: (text: string) => Promise<number[][]>;
|
|
23
|
+
graphEmbeddingsQuery: (vecs: number[][], limit: number) => Promise<Value[]>;
|
|
24
|
+
triplesQuery: (s?: Value, // Subject (optional)
|
|
25
|
+
p?: Value, // Predicate (optional)
|
|
26
|
+
o?: Value, // Object (optional)
|
|
27
|
+
limit?: number) => Promise<Triple[]>;
|
|
28
|
+
loadDocument: (document: string, // Base64-encoded document
|
|
29
|
+
id?: string, // Optional document ID
|
|
30
|
+
metadata?: Triple[]) => Promise<void>;
|
|
31
|
+
loadText: (text: string, id?: string, metadata?: Triple[]) => Promise<void>;
|
|
32
|
+
loadLibraryDocument: (document: string, id?: string, metadata?: Triple[], mimeType: string) => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* BaseApi - Core WebSocket client for TrustGraph API
|
|
36
|
+
* Manages connection lifecycle, message routing, and provides base request
|
|
37
|
+
* functionality
|
|
38
|
+
*/
|
|
39
|
+
export interface ConnectionState {
|
|
40
|
+
status: "connecting" | "connected" | "reconnecting" | "failed" | "authenticated" | "unauthenticated";
|
|
41
|
+
hasApiKey: boolean;
|
|
42
|
+
reconnectAttempt?: number;
|
|
43
|
+
maxAttempts?: number;
|
|
44
|
+
nextRetryIn?: number;
|
|
45
|
+
lastError?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare class BaseApi {
|
|
48
|
+
ws?: WebSocket;
|
|
49
|
+
tag: string;
|
|
50
|
+
id: number;
|
|
51
|
+
token?: string;
|
|
52
|
+
user: string;
|
|
53
|
+
inflight: {
|
|
54
|
+
[key: string]: ServiceCall;
|
|
55
|
+
};
|
|
56
|
+
reconnectAttempts: number;
|
|
57
|
+
maxReconnectAttempts: number;
|
|
58
|
+
reconnectTimer?: number;
|
|
59
|
+
reconnectionState: "idle" | "reconnecting" | "failed";
|
|
60
|
+
private connectionStateListeners;
|
|
61
|
+
private lastError?;
|
|
62
|
+
constructor(user: string, token?: string);
|
|
63
|
+
/**
|
|
64
|
+
* Subscribe to connection state changes for UI updates
|
|
65
|
+
*/
|
|
66
|
+
onConnectionStateChange(listener: (state: ConnectionState) => void): () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Get current connection state
|
|
69
|
+
*/
|
|
70
|
+
private getConnectionState;
|
|
71
|
+
/**
|
|
72
|
+
* Notify all listeners of connection state changes
|
|
73
|
+
*/
|
|
74
|
+
private notifyStateChange;
|
|
75
|
+
/**
|
|
76
|
+
* Establishes WebSocket connection and sets up event handlers
|
|
77
|
+
*/
|
|
78
|
+
openSocket(): void;
|
|
79
|
+
onMessage(message: MessageEvent): void;
|
|
80
|
+
onClose(event: CloseEvent): void;
|
|
81
|
+
onOpen(): void;
|
|
82
|
+
onError(event: Event): void;
|
|
83
|
+
/**
|
|
84
|
+
* Schedules a reconnection attempt with exponential backoff
|
|
85
|
+
*/
|
|
86
|
+
scheduleReconnect(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Reopens the WebSocket connection (used after connection failures)
|
|
89
|
+
*/
|
|
90
|
+
reopen(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Closes the WebSocket connection and cleans up
|
|
93
|
+
*/
|
|
94
|
+
close(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Generates the next unique message ID for requests
|
|
97
|
+
* Format: {clientTag}-{incrementingNumber}
|
|
98
|
+
*/
|
|
99
|
+
getNextId(): string;
|
|
100
|
+
/**
|
|
101
|
+
* Core method for making service requests over WebSocket
|
|
102
|
+
* @param service - Name of the service to call
|
|
103
|
+
* @param request - Request payload
|
|
104
|
+
* @param timeout - Request timeout in milliseconds (default: 10000)
|
|
105
|
+
* @param retries - Number of retry attempts (default: 3)
|
|
106
|
+
* @param flow - Optional flow identifier
|
|
107
|
+
* @returns Promise resolving to the service response
|
|
108
|
+
*/
|
|
109
|
+
makeRequest<RequestType, ResponseType>(service: string, request: RequestType, timeout?: number, retries?: number, flow?: string): Promise<ResponseType>;
|
|
110
|
+
/**
|
|
111
|
+
* Makes a request that can receive multiple responses (streaming)
|
|
112
|
+
* Used for operations that return data in chunks
|
|
113
|
+
*/
|
|
114
|
+
makeRequestMulti<RequestType, ResponseType>(service: string, request: RequestType, receiver: any, // Callback to handle each response chunk
|
|
115
|
+
timeout?: number, retries?: number, flow?: string): Promise<ResponseType>;
|
|
116
|
+
/**
|
|
117
|
+
* Convenience method for making flow-specific requests
|
|
118
|
+
* Defaults to "default" flow if none specified
|
|
119
|
+
*/
|
|
120
|
+
makeFlowRequest<RequestType, ResponseType>(service: string, request: RequestType, timeout?: number, retries?: number, flow?: string): Promise<ResponseType>;
|
|
121
|
+
librarian(): LibrarianApi;
|
|
122
|
+
flows(): FlowsApi;
|
|
123
|
+
flow(id: any): FlowApi;
|
|
124
|
+
knowledge(): KnowledgeApi;
|
|
125
|
+
config(): ConfigApi;
|
|
126
|
+
collectionManagement(): CollectionManagementApi;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* LibrarianApi - Manages document storage and retrieval
|
|
130
|
+
* Handles document lifecycle including upload, processing, and removal
|
|
131
|
+
*/
|
|
132
|
+
export declare class LibrarianApi {
|
|
133
|
+
constructor(api: any);
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves list of all documents in the system
|
|
136
|
+
*/
|
|
137
|
+
getDocuments(): any;
|
|
138
|
+
/**
|
|
139
|
+
* Retrieves list of documents currently being processed
|
|
140
|
+
*/
|
|
141
|
+
getProcessing(): any;
|
|
142
|
+
/**
|
|
143
|
+
* Uploads a document to the library with full metadata
|
|
144
|
+
* @param document - Base64-encoded document content
|
|
145
|
+
* @param id - Optional document identifier
|
|
146
|
+
* @param metadata - Optional metadata as triples
|
|
147
|
+
* @param mimeType - Document MIME type
|
|
148
|
+
* @param title - Document title
|
|
149
|
+
* @param comments - Additional comments
|
|
150
|
+
* @param tags - Document tags for categorization
|
|
151
|
+
* @param user - User identifier
|
|
152
|
+
*/
|
|
153
|
+
loadDocument(document: string, // base64-encoded doc
|
|
154
|
+
id?: string, metadata?: Triple[], mimeType: string, title: string, comments: string, tags: string[], user: string): any;
|
|
155
|
+
/**
|
|
156
|
+
* Removes a document from the library
|
|
157
|
+
*/
|
|
158
|
+
removeDocument(id: string, collection?: string): any;
|
|
159
|
+
/**
|
|
160
|
+
* Adds a document to the processing queue
|
|
161
|
+
* @param id - Processing job identifier
|
|
162
|
+
* @param doc_id - Document to process
|
|
163
|
+
* @param flow - Processing flow to use
|
|
164
|
+
* @param user - User identifier
|
|
165
|
+
* @param collection - Collection to add processed data to
|
|
166
|
+
* @param tags - Tags for the processing job
|
|
167
|
+
*/
|
|
168
|
+
addProcessing(id: string, doc_id: string, flow: string, user?: string, collection?: string, tags?: string[]): any;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* FlowsApi - Manages processing flows and configuration
|
|
172
|
+
* Flows define how documents and data are processed through the system
|
|
173
|
+
*/
|
|
174
|
+
export declare class FlowsApi {
|
|
175
|
+
constructor(api: any);
|
|
176
|
+
/**
|
|
177
|
+
* Retrieves list of available flows
|
|
178
|
+
*/
|
|
179
|
+
getFlows(): any;
|
|
180
|
+
/**
|
|
181
|
+
* Retrieves definition of a specific flow
|
|
182
|
+
*/
|
|
183
|
+
getFlow(id: string): any;
|
|
184
|
+
/**
|
|
185
|
+
* Retrieves all configuration settings
|
|
186
|
+
*/
|
|
187
|
+
getConfigAll(): any;
|
|
188
|
+
/**
|
|
189
|
+
* Retrieves specific configuration values by key
|
|
190
|
+
*/
|
|
191
|
+
getConfig(keys: {
|
|
192
|
+
type: string;
|
|
193
|
+
key: string;
|
|
194
|
+
}[]): any;
|
|
195
|
+
/**
|
|
196
|
+
* Updates configuration values
|
|
197
|
+
*/
|
|
198
|
+
putConfig(values: {
|
|
199
|
+
type: string;
|
|
200
|
+
key: string;
|
|
201
|
+
value: string;
|
|
202
|
+
}[]): any;
|
|
203
|
+
/**
|
|
204
|
+
* Deletes configuration entries
|
|
205
|
+
*/
|
|
206
|
+
deleteConfig(keys: {
|
|
207
|
+
type: string;
|
|
208
|
+
key: string;
|
|
209
|
+
}): any;
|
|
210
|
+
/**
|
|
211
|
+
* Retrieves list of available prompt templates
|
|
212
|
+
*/
|
|
213
|
+
getPrompts(): any;
|
|
214
|
+
/**
|
|
215
|
+
* Retrieves a specific prompt template
|
|
216
|
+
*/
|
|
217
|
+
getPrompt(id: string): any;
|
|
218
|
+
/**
|
|
219
|
+
* Retrieves the system prompt configuration
|
|
220
|
+
*/
|
|
221
|
+
getSystemPrompt(): any;
|
|
222
|
+
/**
|
|
223
|
+
* Retrieves list of available flow classes (templates)
|
|
224
|
+
*/
|
|
225
|
+
getFlowClasses(): any;
|
|
226
|
+
/**
|
|
227
|
+
* Retrieves definition of a specific flow class
|
|
228
|
+
*/
|
|
229
|
+
getFlowClass(name: string): any;
|
|
230
|
+
/**
|
|
231
|
+
* Deletes a flow class
|
|
232
|
+
*/
|
|
233
|
+
deleteFlowClass(name: string): any;
|
|
234
|
+
/**
|
|
235
|
+
* Starts a new flow instance
|
|
236
|
+
*/
|
|
237
|
+
startFlow(id: string, class_name: string, description: string, parameters?: {
|
|
238
|
+
[key: string]: any;
|
|
239
|
+
}): any;
|
|
240
|
+
/**
|
|
241
|
+
* Stops a running flow instance
|
|
242
|
+
*/
|
|
243
|
+
stopFlow(id: string): any;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* FlowApi - Interface for interacting with a specific flow instance
|
|
247
|
+
* Provides flow-specific versions of core AI/ML operations
|
|
248
|
+
*/
|
|
249
|
+
export declare class FlowApi {
|
|
250
|
+
constructor(api: any, flowId: any);
|
|
251
|
+
/**
|
|
252
|
+
* Performs text completion using AI models within this flow
|
|
253
|
+
*/
|
|
254
|
+
textCompletion(system: string, text: string): Promise<string>;
|
|
255
|
+
/**
|
|
256
|
+
* Performs Graph RAG (Retrieval Augmented Generation) query
|
|
257
|
+
*/
|
|
258
|
+
graphRag(text: string, options?: GraphRagOptions, collection?: string): any;
|
|
259
|
+
/**
|
|
260
|
+
* Performs Document RAG (Retrieval Augmented Generation) query
|
|
261
|
+
*/
|
|
262
|
+
documentRag(text: string, docLimit?: number, collection?: string): any;
|
|
263
|
+
/**
|
|
264
|
+
* Interacts with an AI agent that provides streaming responses
|
|
265
|
+
*/
|
|
266
|
+
agent(question: string, think: (s: string) => void, // Called when agent is thinking
|
|
267
|
+
observe: (s: string) => void, // Called when agent observes something
|
|
268
|
+
answer: (s: string) => void, // Called when agent provides answer
|
|
269
|
+
error: (s: string) => void): any;
|
|
270
|
+
/**
|
|
271
|
+
* Generates embeddings for text within this flow
|
|
272
|
+
*/
|
|
273
|
+
embeddings(text: string): any;
|
|
274
|
+
/**
|
|
275
|
+
* Queries the knowledge graph using embedding vectors
|
|
276
|
+
*/
|
|
277
|
+
graphEmbeddingsQuery(vecs: number[][], limit: number | undefined, collection?: string): any;
|
|
278
|
+
/**
|
|
279
|
+
* Queries knowledge graph triples (subject-predicate-object relationships)
|
|
280
|
+
* All parameters are optional - omitted parameters act as wildcards
|
|
281
|
+
*/
|
|
282
|
+
triplesQuery(s?: Value, p?: Value, o?: Value, limit?: number, collection?: string): any;
|
|
283
|
+
/**
|
|
284
|
+
* Loads a document into this flow for processing
|
|
285
|
+
*/
|
|
286
|
+
loadDocument(document: string, // base64-encoded document
|
|
287
|
+
id?: string, metadata?: Triple[]): any;
|
|
288
|
+
/**
|
|
289
|
+
* Loads plain text into this flow for processing
|
|
290
|
+
*/
|
|
291
|
+
loadText(text: string, // Text content
|
|
292
|
+
id?: string, metadata?: Triple[], charset?: string): any;
|
|
293
|
+
/**
|
|
294
|
+
* Executes a GraphQL query against structured data objects
|
|
295
|
+
*/
|
|
296
|
+
objectsQuery(query: string, collection?: string, variables?: Record<string, unknown>, operationName?: string): any;
|
|
297
|
+
/**
|
|
298
|
+
* Converts a natural language question to a GraphQL query
|
|
299
|
+
*/
|
|
300
|
+
nlpQuery(question: string, maxResults?: number): any;
|
|
301
|
+
/**
|
|
302
|
+
* Executes a natural language question against structured data
|
|
303
|
+
* Combines NLP query conversion and GraphQL execution
|
|
304
|
+
*/
|
|
305
|
+
structuredQuery(question: string, collection?: string): any;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* ConfigApi - Dedicated configuration management interface
|
|
309
|
+
* Handles system configuration, prompts, and token cost tracking
|
|
310
|
+
*/
|
|
311
|
+
export declare class ConfigApi {
|
|
312
|
+
constructor(api: any);
|
|
313
|
+
/**
|
|
314
|
+
* Retrieves complete configuration
|
|
315
|
+
*/
|
|
316
|
+
getConfigAll(): any;
|
|
317
|
+
/**
|
|
318
|
+
* Retrieves specific configuration entries
|
|
319
|
+
*/
|
|
320
|
+
getConfig(keys: {
|
|
321
|
+
type: string;
|
|
322
|
+
key: string;
|
|
323
|
+
}[]): any;
|
|
324
|
+
/**
|
|
325
|
+
* Updates configuration values
|
|
326
|
+
*/
|
|
327
|
+
putConfig(values: {
|
|
328
|
+
type: string;
|
|
329
|
+
key: string;
|
|
330
|
+
value: string;
|
|
331
|
+
}[]): any;
|
|
332
|
+
/**
|
|
333
|
+
* Deletes configuration entries
|
|
334
|
+
*/
|
|
335
|
+
deleteConfig(keys: {
|
|
336
|
+
type: string;
|
|
337
|
+
key: string;
|
|
338
|
+
}): any;
|
|
339
|
+
/**
|
|
340
|
+
* Retrieves available prompt templates
|
|
341
|
+
*/
|
|
342
|
+
getPrompts(): any;
|
|
343
|
+
/**
|
|
344
|
+
* Retrieves a specific prompt template
|
|
345
|
+
*/
|
|
346
|
+
getPrompt(id: string): any;
|
|
347
|
+
/**
|
|
348
|
+
* Retrieves system prompt configuration
|
|
349
|
+
*/
|
|
350
|
+
getSystemPrompt(): any;
|
|
351
|
+
/**
|
|
352
|
+
* Lists available configuration types
|
|
353
|
+
*/
|
|
354
|
+
list(type: string): any;
|
|
355
|
+
/**
|
|
356
|
+
* Retrieves all key/values for a specific type
|
|
357
|
+
*/
|
|
358
|
+
getValues(type: string): any;
|
|
359
|
+
/**
|
|
360
|
+
* Retrieves token cost information for different AI models
|
|
361
|
+
* Useful for cost tracking and optimization
|
|
362
|
+
*/
|
|
363
|
+
getTokenCosts(): any;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* KnowledgeApi - Manages knowledge graph cores and data
|
|
367
|
+
* Knowledge cores appear to be collections of processed knowledge graph data
|
|
368
|
+
*/
|
|
369
|
+
export declare class KnowledgeApi {
|
|
370
|
+
constructor(api: any);
|
|
371
|
+
/**
|
|
372
|
+
* Retrieves list of available knowledge graph cores
|
|
373
|
+
*/
|
|
374
|
+
getKnowledgeCores(): any;
|
|
375
|
+
/**
|
|
376
|
+
* Deletes a knowledge graph core
|
|
377
|
+
*/
|
|
378
|
+
deleteKgCore(id: string, collection?: string): any;
|
|
379
|
+
/**
|
|
380
|
+
* Deletes a knowledge graph core
|
|
381
|
+
*/
|
|
382
|
+
loadKgCore(id: string, flow: string, collection?: string): any;
|
|
383
|
+
/**
|
|
384
|
+
* Retrieves a knowledge graph core with streaming data
|
|
385
|
+
* Uses multi-request pattern for large datasets
|
|
386
|
+
* @param receiver - Callback function to handle streaming data chunks
|
|
387
|
+
*/
|
|
388
|
+
getKgCore(id: string, collection: string | undefined, receiver: any): any;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* CollectionManagementApi - Manages collections for organizing documents
|
|
392
|
+
* Provides operations for listing, creating, updating, and deleting collections
|
|
393
|
+
*/
|
|
394
|
+
export declare class CollectionManagementApi {
|
|
395
|
+
api: BaseApi;
|
|
396
|
+
constructor(api: BaseApi);
|
|
397
|
+
/**
|
|
398
|
+
* Lists all collections for a user with optional tag filtering
|
|
399
|
+
* @param user - User identifier
|
|
400
|
+
* @param tagFilter - Optional array of tags to filter collections
|
|
401
|
+
* @returns Promise resolving to array of collection metadata
|
|
402
|
+
*/
|
|
403
|
+
listCollections(user: string, tagFilter?: string[]): Promise<{}>;
|
|
404
|
+
/**
|
|
405
|
+
* Creates or updates a collection
|
|
406
|
+
* @param user - User identifier
|
|
407
|
+
* @param collection - Collection ID (unique identifier)
|
|
408
|
+
* @param name - Display name for the collection
|
|
409
|
+
* @param description - Description of the collection
|
|
410
|
+
* @param tags - Array of tags for categorization
|
|
411
|
+
* @returns Promise resolving to updated collection metadata
|
|
412
|
+
*/
|
|
413
|
+
updateCollection(user: string, collection: string, name?: string, description?: string, tags?: string[]): Promise<any>;
|
|
414
|
+
/**
|
|
415
|
+
* Deletes a collection and all its data
|
|
416
|
+
* @param user - User identifier
|
|
417
|
+
* @param collection - Collection ID to delete
|
|
418
|
+
* @returns Promise resolving when deletion is complete
|
|
419
|
+
*/
|
|
420
|
+
deleteCollection(user: string, collection: string): Promise<Record<string, unknown>>;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Factory function to create a new TrustGraph WebSocket connection
|
|
424
|
+
* This is the main entry point for using the TrustGraph API
|
|
425
|
+
* @param user - User identifier for API requests
|
|
426
|
+
* @param token - Optional authentication token for secure connections
|
|
427
|
+
*/
|
|
428
|
+
export declare const createTrustGraphSocket: (user: string, token?: string) => Socket;
|
|
429
|
+
//# sourceMappingURL=trustgraph-socket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustgraph-socket.d.ts","sourceRoot":"","sources":["../../../src/api/trustgraph/trustgraph-socket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA+C7C,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;IAGlB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGlE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGvE,KAAK,EAAE,CACL,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,CAAC,CAA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