lemma-sdk 0.2.22 → 0.2.24
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/README.md +3 -3
- package/dist/auth.d.ts +1 -0
- package/dist/auth.js +12 -12
- package/dist/browser/lemma-client.js +179 -115
- package/dist/namespaces/assistants.d.ts +21 -3
- package/dist/namespaces/assistants.js +13 -7
- package/dist/namespaces/files.d.ts +9 -4
- package/dist/namespaces/files.js +52 -14
- package/dist/namespaces/records.d.ts +10 -2
- package/dist/namespaces/records.js +15 -9
- package/dist/openapi_client/index.d.ts +6 -5
- package/dist/openapi_client/index.js +2 -2
- package/dist/openapi_client/models/CreateConversationRequest.d.ts +1 -1
- package/dist/openapi_client/models/CreateFolderRequest.d.ts +1 -2
- package/dist/openapi_client/models/CreateTriggerRequest.d.ts +0 -1
- package/dist/openapi_client/models/DatastoreFileUploadRequest.d.ts +1 -1
- package/dist/openapi_client/models/DatastoreQueryRequest.d.ts +9 -0
- package/dist/openapi_client/models/DatastoreQueryResponse.d.ts +7 -0
- package/dist/openapi_client/models/DirectoryTreeNode.d.ts +7 -0
- package/dist/openapi_client/models/DirectoryTreeResponse.d.ts +6 -0
- package/dist/openapi_client/models/DirectoryTreeResponse.js +1 -0
- package/dist/openapi_client/models/FileResponse.d.ts +4 -6
- package/dist/openapi_client/models/FileSearchRequest.d.ts +5 -3
- package/dist/openapi_client/models/FileSearchResultSchema.d.ts +1 -0
- package/dist/openapi_client/models/FileSearchScopeMode.d.ts +4 -0
- package/dist/openapi_client/models/FileSearchScopeMode.js +9 -0
- package/dist/openapi_client/models/TableResponse.d.ts +1 -1
- package/dist/openapi_client/models/TriggerResponse.d.ts +0 -1
- package/dist/openapi_client/models/update.d.ts +2 -2
- package/dist/openapi_client/services/ConversationsService.d.ts +3 -2
- package/dist/openapi_client/services/ConversationsService.js +5 -3
- package/dist/openapi_client/services/FilesService.d.ts +34 -25
- package/dist/openapi_client/services/FilesService.js +75 -47
- package/dist/openapi_client/services/QueryService.d.ts +14 -0
- package/dist/openapi_client/services/QueryService.js +26 -0
- package/dist/openapi_client/services/RecordsService.d.ts +7 -13
- package/dist/openapi_client/services/RecordsService.js +12 -26
- package/dist/react/components/AssistantEmbedded.d.ts +1 -1
- package/dist/react/components/AssistantEmbedded.js +2 -1
- package/dist/react/useAssistantController.d.ts +5 -1
- package/dist/react/useAssistantController.js +7 -3
- package/dist/react/useAssistantSession.d.ts +12 -0
- package/dist/react/useAssistantSession.js +24 -5
- package/dist/types.d.ts +10 -4
- package/package.json +1 -1
- package/dist/openapi_client/models/RecordFilter.d.ts +0 -15
- package/dist/openapi_client/models/RecordFilterOperator.d.ts +0 -10
- package/dist/openapi_client/models/RecordFilterOperator.js +0 -15
- package/dist/openapi_client/models/RecordQueryRequest.d.ts +0 -20
- package/dist/openapi_client/models/RecordSort.d.ts +0 -11
- package/dist/openapi_client/models/RecordSortDirection.d.ts +0 -4
- package/dist/openapi_client/models/RecordSortDirection.js +0 -9
- /package/dist/openapi_client/models/{RecordFilter.js → DatastoreQueryRequest.js} +0 -0
- /package/dist/openapi_client/models/{RecordQueryRequest.js → DatastoreQueryResponse.js} +0 -0
- /package/dist/openapi_client/models/{RecordSort.js → DirectoryTreeNode.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CreateFolderRequest } from '../models/CreateFolderRequest.js';
|
|
2
2
|
import type { DatastoreFileUploadRequest } from '../models/DatastoreFileUploadRequest.js';
|
|
3
3
|
import type { DatastoreMessageResponse } from '../models/DatastoreMessageResponse.js';
|
|
4
|
+
import type { DirectoryTreeResponse } from '../models/DirectoryTreeResponse.js';
|
|
4
5
|
import type { FileListResponse } from '../models/FileListResponse.js';
|
|
5
6
|
import type { FileResponse } from '../models/FileResponse.js';
|
|
6
7
|
import type { FileSearchRequest } from '../models/FileSearchRequest.js';
|
|
@@ -11,13 +12,13 @@ export declare class FilesService {
|
|
|
11
12
|
/**
|
|
12
13
|
* List Files
|
|
13
14
|
* @param podId
|
|
14
|
-
* @param
|
|
15
|
+
* @param directoryPath
|
|
15
16
|
* @param limit
|
|
16
17
|
* @param pageToken
|
|
17
18
|
* @returns FileListResponse Successful Response
|
|
18
19
|
* @throws ApiError
|
|
19
20
|
*/
|
|
20
|
-
static fileList(podId: string,
|
|
21
|
+
static fileList(podId: string, directoryPath?: string, limit?: number, pageToken?: (string | null)): CancelablePromise<FileListResponse>;
|
|
21
22
|
/**
|
|
22
23
|
* Upload File
|
|
23
24
|
* @param podId
|
|
@@ -27,52 +28,60 @@ export declare class FilesService {
|
|
|
27
28
|
*/
|
|
28
29
|
static fileUpload(podId: string, formData: DatastoreFileUploadRequest): CancelablePromise<FileResponse>;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* Delete File
|
|
31
32
|
* @param podId
|
|
32
|
-
* @param
|
|
33
|
+
* @param path
|
|
34
|
+
* @returns DatastoreMessageResponse Successful Response
|
|
35
|
+
* @throws ApiError
|
|
36
|
+
*/
|
|
37
|
+
static fileDelete(podId: string, path: string): CancelablePromise<DatastoreMessageResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Get File
|
|
40
|
+
* @param podId
|
|
41
|
+
* @param path
|
|
33
42
|
* @returns FileResponse Successful Response
|
|
34
43
|
* @throws ApiError
|
|
35
44
|
*/
|
|
36
|
-
static
|
|
45
|
+
static fileGet(podId: string, path: string): CancelablePromise<FileResponse>;
|
|
37
46
|
/**
|
|
38
|
-
*
|
|
47
|
+
* Update File
|
|
39
48
|
* @param podId
|
|
40
|
-
* @param
|
|
41
|
-
* @returns
|
|
49
|
+
* @param formData
|
|
50
|
+
* @returns FileResponse Successful Response
|
|
42
51
|
* @throws ApiError
|
|
43
52
|
*/
|
|
44
|
-
static
|
|
53
|
+
static fileUpdate(podId: string, formData: update): CancelablePromise<FileResponse>;
|
|
45
54
|
/**
|
|
46
|
-
*
|
|
55
|
+
* Download File
|
|
47
56
|
* @param podId
|
|
48
|
-
* @param
|
|
49
|
-
* @returns
|
|
57
|
+
* @param path
|
|
58
|
+
* @returns any Successful Response
|
|
50
59
|
* @throws ApiError
|
|
51
60
|
*/
|
|
52
|
-
static
|
|
61
|
+
static fileDownload(podId: string, path: string): CancelablePromise<any>;
|
|
53
62
|
/**
|
|
54
|
-
*
|
|
63
|
+
* Create Folder
|
|
55
64
|
* @param podId
|
|
56
|
-
* @param
|
|
65
|
+
* @param requestBody
|
|
57
66
|
* @returns FileResponse Successful Response
|
|
58
67
|
* @throws ApiError
|
|
59
68
|
*/
|
|
60
|
-
static
|
|
69
|
+
static fileFolderCreate(podId: string, requestBody: CreateFolderRequest): CancelablePromise<FileResponse>;
|
|
61
70
|
/**
|
|
62
|
-
*
|
|
71
|
+
* Search Files
|
|
63
72
|
* @param podId
|
|
64
|
-
* @param
|
|
65
|
-
* @
|
|
66
|
-
* @returns FileResponse Successful Response
|
|
73
|
+
* @param requestBody
|
|
74
|
+
* @returns FileSearchResponse Successful Response
|
|
67
75
|
* @throws ApiError
|
|
68
76
|
*/
|
|
69
|
-
static
|
|
77
|
+
static fileSearch(podId: string, requestBody: FileSearchRequest): CancelablePromise<FileSearchResponse>;
|
|
70
78
|
/**
|
|
71
|
-
*
|
|
79
|
+
* Get Directory Tree
|
|
72
80
|
* @param podId
|
|
73
|
-
* @param
|
|
74
|
-
* @
|
|
81
|
+
* @param rootPath
|
|
82
|
+
* @param filesPerDirectory
|
|
83
|
+
* @returns DirectoryTreeResponse Successful Response
|
|
75
84
|
* @throws ApiError
|
|
76
85
|
*/
|
|
77
|
-
static
|
|
86
|
+
static fileTree(podId: string, rootPath?: string, filesPerDirectory?: number): CancelablePromise<DirectoryTreeResponse>;
|
|
78
87
|
}
|
|
@@ -4,13 +4,13 @@ export class FilesService {
|
|
|
4
4
|
/**
|
|
5
5
|
* List Files
|
|
6
6
|
* @param podId
|
|
7
|
-
* @param
|
|
7
|
+
* @param directoryPath
|
|
8
8
|
* @param limit
|
|
9
9
|
* @param pageToken
|
|
10
10
|
* @returns FileListResponse Successful Response
|
|
11
11
|
* @throws ApiError
|
|
12
12
|
*/
|
|
13
|
-
static fileList(podId,
|
|
13
|
+
static fileList(podId, directoryPath = '/', limit = 100, pageToken) {
|
|
14
14
|
return __request(OpenAPI, {
|
|
15
15
|
method: 'GET',
|
|
16
16
|
url: '/pods/{pod_id}/datastore/files',
|
|
@@ -18,7 +18,7 @@ export class FilesService {
|
|
|
18
18
|
'pod_id': podId,
|
|
19
19
|
},
|
|
20
20
|
query: {
|
|
21
|
-
'
|
|
21
|
+
'directory_path': directoryPath,
|
|
22
22
|
'limit': limit,
|
|
23
23
|
'page_token': pageToken,
|
|
24
24
|
},
|
|
@@ -49,81 +49,86 @@ export class FilesService {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Delete File
|
|
53
53
|
* @param podId
|
|
54
|
-
* @param
|
|
55
|
-
* @returns
|
|
54
|
+
* @param path
|
|
55
|
+
* @returns DatastoreMessageResponse Successful Response
|
|
56
56
|
* @throws ApiError
|
|
57
57
|
*/
|
|
58
|
-
static
|
|
58
|
+
static fileDelete(podId, path) {
|
|
59
59
|
return __request(OpenAPI, {
|
|
60
|
-
method: '
|
|
61
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
60
|
+
method: 'DELETE',
|
|
61
|
+
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
62
62
|
path: {
|
|
63
63
|
'pod_id': podId,
|
|
64
64
|
},
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
query: {
|
|
66
|
+
'path': path,
|
|
67
|
+
},
|
|
67
68
|
errors: {
|
|
68
69
|
422: `Validation Error`,
|
|
69
70
|
},
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
73
|
-
*
|
|
74
|
+
* Get File
|
|
74
75
|
* @param podId
|
|
75
|
-
* @param
|
|
76
|
-
* @returns
|
|
76
|
+
* @param path
|
|
77
|
+
* @returns FileResponse Successful Response
|
|
77
78
|
* @throws ApiError
|
|
78
79
|
*/
|
|
79
|
-
static
|
|
80
|
+
static fileGet(podId, path) {
|
|
80
81
|
return __request(OpenAPI, {
|
|
81
|
-
method: '
|
|
82
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
82
|
+
method: 'GET',
|
|
83
|
+
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
83
84
|
path: {
|
|
84
85
|
'pod_id': podId,
|
|
85
86
|
},
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
query: {
|
|
88
|
+
'path': path,
|
|
89
|
+
},
|
|
88
90
|
errors: {
|
|
89
91
|
422: `Validation Error`,
|
|
90
92
|
},
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
/**
|
|
94
|
-
*
|
|
96
|
+
* Update File
|
|
95
97
|
* @param podId
|
|
96
|
-
* @param
|
|
97
|
-
* @returns
|
|
98
|
+
* @param formData
|
|
99
|
+
* @returns FileResponse Successful Response
|
|
98
100
|
* @throws ApiError
|
|
99
101
|
*/
|
|
100
|
-
static
|
|
102
|
+
static fileUpdate(podId, formData) {
|
|
101
103
|
return __request(OpenAPI, {
|
|
102
|
-
method: '
|
|
103
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
104
|
+
method: 'PATCH',
|
|
105
|
+
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
104
106
|
path: {
|
|
105
107
|
'pod_id': podId,
|
|
106
|
-
'file_id': fileId,
|
|
107
108
|
},
|
|
109
|
+
formData: formData,
|
|
110
|
+
mediaType: 'multipart/form-data',
|
|
108
111
|
errors: {
|
|
109
112
|
422: `Validation Error`,
|
|
110
113
|
},
|
|
111
114
|
});
|
|
112
115
|
}
|
|
113
116
|
/**
|
|
114
|
-
*
|
|
117
|
+
* Download File
|
|
115
118
|
* @param podId
|
|
116
|
-
* @param
|
|
117
|
-
* @returns
|
|
119
|
+
* @param path
|
|
120
|
+
* @returns any Successful Response
|
|
118
121
|
* @throws ApiError
|
|
119
122
|
*/
|
|
120
|
-
static
|
|
123
|
+
static fileDownload(podId, path) {
|
|
121
124
|
return __request(OpenAPI, {
|
|
122
125
|
method: 'GET',
|
|
123
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
126
|
+
url: '/pods/{pod_id}/datastore/files/download',
|
|
124
127
|
path: {
|
|
125
128
|
'pod_id': podId,
|
|
126
|
-
|
|
129
|
+
},
|
|
130
|
+
query: {
|
|
131
|
+
'path': path,
|
|
127
132
|
},
|
|
128
133
|
errors: {
|
|
129
134
|
422: `Validation Error`,
|
|
@@ -131,42 +136,65 @@ export class FilesService {
|
|
|
131
136
|
});
|
|
132
137
|
}
|
|
133
138
|
/**
|
|
134
|
-
*
|
|
139
|
+
* Create Folder
|
|
135
140
|
* @param podId
|
|
136
|
-
* @param
|
|
137
|
-
* @param formData
|
|
141
|
+
* @param requestBody
|
|
138
142
|
* @returns FileResponse Successful Response
|
|
139
143
|
* @throws ApiError
|
|
140
144
|
*/
|
|
141
|
-
static
|
|
145
|
+
static fileFolderCreate(podId, requestBody) {
|
|
142
146
|
return __request(OpenAPI, {
|
|
143
|
-
method: '
|
|
144
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
147
|
+
method: 'POST',
|
|
148
|
+
url: '/pods/{pod_id}/datastore/files/folders',
|
|
145
149
|
path: {
|
|
146
150
|
'pod_id': podId,
|
|
147
|
-
'file_id': fileId,
|
|
148
151
|
},
|
|
149
|
-
|
|
150
|
-
mediaType: '
|
|
152
|
+
body: requestBody,
|
|
153
|
+
mediaType: 'application/json',
|
|
151
154
|
errors: {
|
|
152
155
|
422: `Validation Error`,
|
|
153
156
|
},
|
|
154
157
|
});
|
|
155
158
|
}
|
|
156
159
|
/**
|
|
157
|
-
*
|
|
160
|
+
* Search Files
|
|
158
161
|
* @param podId
|
|
159
|
-
* @param
|
|
160
|
-
* @returns
|
|
162
|
+
* @param requestBody
|
|
163
|
+
* @returns FileSearchResponse Successful Response
|
|
161
164
|
* @throws ApiError
|
|
162
165
|
*/
|
|
163
|
-
static
|
|
166
|
+
static fileSearch(podId, requestBody) {
|
|
167
|
+
return __request(OpenAPI, {
|
|
168
|
+
method: 'POST',
|
|
169
|
+
url: '/pods/{pod_id}/datastore/files/search',
|
|
170
|
+
path: {
|
|
171
|
+
'pod_id': podId,
|
|
172
|
+
},
|
|
173
|
+
body: requestBody,
|
|
174
|
+
mediaType: 'application/json',
|
|
175
|
+
errors: {
|
|
176
|
+
422: `Validation Error`,
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get Directory Tree
|
|
182
|
+
* @param podId
|
|
183
|
+
* @param rootPath
|
|
184
|
+
* @param filesPerDirectory
|
|
185
|
+
* @returns DirectoryTreeResponse Successful Response
|
|
186
|
+
* @throws ApiError
|
|
187
|
+
*/
|
|
188
|
+
static fileTree(podId, rootPath = '/', filesPerDirectory = 3) {
|
|
164
189
|
return __request(OpenAPI, {
|
|
165
190
|
method: 'GET',
|
|
166
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
191
|
+
url: '/pods/{pod_id}/datastore/files/tree',
|
|
167
192
|
path: {
|
|
168
193
|
'pod_id': podId,
|
|
169
|
-
|
|
194
|
+
},
|
|
195
|
+
query: {
|
|
196
|
+
'root_path': rootPath,
|
|
197
|
+
'files_per_directory': filesPerDirectory,
|
|
170
198
|
},
|
|
171
199
|
errors: {
|
|
172
200
|
422: `Validation Error`,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DatastoreQueryRequest } from '../models/DatastoreQueryRequest.js';
|
|
2
|
+
import type { DatastoreQueryResponse } from '../models/DatastoreQueryResponse.js';
|
|
3
|
+
import type { CancelablePromise } from '../core/CancelablePromise.js';
|
|
4
|
+
export declare class QueryService {
|
|
5
|
+
/**
|
|
6
|
+
* Execute Query
|
|
7
|
+
* Execute a read-only SQL query inside the datastore schema. Joins, aggregates, subqueries, and cross-table reads are allowed as long as the statement is read only.
|
|
8
|
+
* @param podId
|
|
9
|
+
* @param requestBody
|
|
10
|
+
* @returns DatastoreQueryResponse Successful Response
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static queryExecute(podId: string, requestBody: DatastoreQueryRequest): CancelablePromise<DatastoreQueryResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OpenAPI } from '../core/OpenAPI.js';
|
|
2
|
+
import { request as __request } from '../core/request.js';
|
|
3
|
+
export class QueryService {
|
|
4
|
+
/**
|
|
5
|
+
* Execute Query
|
|
6
|
+
* Execute a read-only SQL query inside the datastore schema. Joins, aggregates, subqueries, and cross-table reads are allowed as long as the statement is read only.
|
|
7
|
+
* @param podId
|
|
8
|
+
* @param requestBody
|
|
9
|
+
* @returns DatastoreQueryResponse Successful Response
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static queryExecute(podId, requestBody) {
|
|
13
|
+
return __request(OpenAPI, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
url: '/pods/{pod_id}/datastore/query',
|
|
16
|
+
path: {
|
|
17
|
+
'pod_id': podId,
|
|
18
|
+
},
|
|
19
|
+
body: requestBody,
|
|
20
|
+
mediaType: 'application/json',
|
|
21
|
+
errors: {
|
|
22
|
+
422: `Validation Error`,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -4,22 +4,26 @@ import type { BulkUpdateRecordsRequest } from '../models/BulkUpdateRecordsReques
|
|
|
4
4
|
import type { CreateRecordRequest } from '../models/CreateRecordRequest.js';
|
|
5
5
|
import type { DatastoreMessageResponse } from '../models/DatastoreMessageResponse.js';
|
|
6
6
|
import type { RecordListResponse } from '../models/RecordListResponse.js';
|
|
7
|
-
import type { RecordQueryRequest } from '../models/RecordQueryRequest.js';
|
|
8
7
|
import type { RecordResponse } from '../models/RecordResponse.js';
|
|
9
8
|
import type { UpdateRecordRequest } from '../models/UpdateRecordRequest.js';
|
|
10
9
|
import type { CancelablePromise } from '../core/CancelablePromise.js';
|
|
11
10
|
export declare class RecordsService {
|
|
12
11
|
/**
|
|
13
12
|
* List Records
|
|
14
|
-
* List table records with token pagination only. Use
|
|
13
|
+
* List table records with token pagination only. Use the datastore query endpoint for joins, aggregates, or custom read-only SQL.
|
|
15
14
|
* @param podId
|
|
16
15
|
* @param tableName
|
|
17
16
|
* @param limit Max number of rows to return.
|
|
17
|
+
* @param offset Row offset for direct pagination.
|
|
18
|
+
* @param sortBy Optional column name to sort by.
|
|
19
|
+
* @param order Sort direction for `sort_by`: `asc` or `desc`.
|
|
20
|
+
* @param filter Optional repeated JSON filters for advanced comparisons. Example: `filter={"field":"amount","op":"gt","value":100}`
|
|
21
|
+
* @param sort Optional repeated JSON sort clauses. Example: `sort={"field":"created_at","direction":"desc"}`
|
|
18
22
|
* @param pageToken Opaque token from a previous response page.
|
|
19
23
|
* @returns RecordListResponse Successful Response
|
|
20
24
|
* @throws ApiError
|
|
21
25
|
*/
|
|
22
|
-
static recordList(podId: string, tableName: string, limit?: number, pageToken?: (string | null)): CancelablePromise<RecordListResponse>;
|
|
26
|
+
static recordList(podId: string, tableName: string, limit?: number, offset?: number, sortBy?: (string | null), order?: string, filter?: (Array<string> | null), sort?: (Array<string> | null), pageToken?: (string | null)): CancelablePromise<RecordListResponse>;
|
|
23
27
|
/**
|
|
24
28
|
* Create Record
|
|
25
29
|
* Insert a record into a table. Reserved tables (`reserved_*`) are system-managed and cannot be mutated through record write endpoints.
|
|
@@ -60,16 +64,6 @@ export declare class RecordsService {
|
|
|
60
64
|
* @throws ApiError
|
|
61
65
|
*/
|
|
62
66
|
static recordBulkUpdate(podId: string, tableName: string, requestBody: BulkUpdateRecordsRequest): CancelablePromise<DatastoreMessageResponse>;
|
|
63
|
-
/**
|
|
64
|
-
* Query Records
|
|
65
|
-
* Query one table with structured filters and sorting. Use this instead of dynamic query parameters when you need filtering. Example filters: `[{"field": "status", "op": "eq", "value": "OPEN"}]`.
|
|
66
|
-
* @param podId
|
|
67
|
-
* @param tableName
|
|
68
|
-
* @param requestBody
|
|
69
|
-
* @returns RecordListResponse Successful Response
|
|
70
|
-
* @throws ApiError
|
|
71
|
-
*/
|
|
72
|
-
static recordQuery(podId: string, tableName: string, requestBody: RecordQueryRequest): CancelablePromise<RecordListResponse>;
|
|
73
67
|
/**
|
|
74
68
|
* Delete Record
|
|
75
69
|
* Delete a record by primary key.
|
|
@@ -3,15 +3,20 @@ import { request as __request } from '../core/request.js';
|
|
|
3
3
|
export class RecordsService {
|
|
4
4
|
/**
|
|
5
5
|
* List Records
|
|
6
|
-
* List table records with token pagination only. Use
|
|
6
|
+
* List table records with token pagination only. Use the datastore query endpoint for joins, aggregates, or custom read-only SQL.
|
|
7
7
|
* @param podId
|
|
8
8
|
* @param tableName
|
|
9
9
|
* @param limit Max number of rows to return.
|
|
10
|
+
* @param offset Row offset for direct pagination.
|
|
11
|
+
* @param sortBy Optional column name to sort by.
|
|
12
|
+
* @param order Sort direction for `sort_by`: `asc` or `desc`.
|
|
13
|
+
* @param filter Optional repeated JSON filters for advanced comparisons. Example: `filter={"field":"amount","op":"gt","value":100}`
|
|
14
|
+
* @param sort Optional repeated JSON sort clauses. Example: `sort={"field":"created_at","direction":"desc"}`
|
|
10
15
|
* @param pageToken Opaque token from a previous response page.
|
|
11
16
|
* @returns RecordListResponse Successful Response
|
|
12
17
|
* @throws ApiError
|
|
13
18
|
*/
|
|
14
|
-
static recordList(podId, tableName, limit = 20, pageToken) {
|
|
19
|
+
static recordList(podId, tableName, limit = 20, offset, sortBy, order = 'asc', filter, sort, pageToken) {
|
|
15
20
|
return __request(OpenAPI, {
|
|
16
21
|
method: 'GET',
|
|
17
22
|
url: '/pods/{pod_id}/datastore/tables/{table_name}/records',
|
|
@@ -21,6 +26,11 @@ export class RecordsService {
|
|
|
21
26
|
},
|
|
22
27
|
query: {
|
|
23
28
|
'limit': limit,
|
|
29
|
+
'offset': offset,
|
|
30
|
+
'sort_by': sortBy,
|
|
31
|
+
'order': order,
|
|
32
|
+
'filter': filter,
|
|
33
|
+
'sort': sort,
|
|
24
34
|
'page_token': pageToken,
|
|
25
35
|
},
|
|
26
36
|
errors: {
|
|
@@ -124,30 +134,6 @@ export class RecordsService {
|
|
|
124
134
|
},
|
|
125
135
|
});
|
|
126
136
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Query Records
|
|
129
|
-
* Query one table with structured filters and sorting. Use this instead of dynamic query parameters when you need filtering. Example filters: `[{"field": "status", "op": "eq", "value": "OPEN"}]`.
|
|
130
|
-
* @param podId
|
|
131
|
-
* @param tableName
|
|
132
|
-
* @param requestBody
|
|
133
|
-
* @returns RecordListResponse Successful Response
|
|
134
|
-
* @throws ApiError
|
|
135
|
-
*/
|
|
136
|
-
static recordQuery(podId, tableName, requestBody) {
|
|
137
|
-
return __request(OpenAPI, {
|
|
138
|
-
method: 'POST',
|
|
139
|
-
url: '/pods/{pod_id}/datastore/tables/{table_name}/records/query',
|
|
140
|
-
path: {
|
|
141
|
-
'pod_id': podId,
|
|
142
|
-
'table_name': tableName,
|
|
143
|
-
},
|
|
144
|
-
body: requestBody,
|
|
145
|
-
mediaType: 'application/json',
|
|
146
|
-
errors: {
|
|
147
|
-
422: `Validation Error`,
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
137
|
/**
|
|
152
138
|
* Delete Record
|
|
153
139
|
* Delete a record by primary key.
|
|
@@ -7,4 +7,4 @@ export interface AssistantEmbeddedProps extends Omit<AssistantExperienceViewProp
|
|
|
7
7
|
enabled?: boolean;
|
|
8
8
|
theme?: AssistantThemeMode;
|
|
9
9
|
}
|
|
10
|
-
export declare function AssistantEmbedded({ client, podId, assistantId, organizationId, enabled, theme, ...props }: AssistantEmbeddedProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function AssistantEmbedded({ client, podId, assistantName, assistantId, organizationId, enabled, theme, ...props }: AssistantEmbeddedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,10 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useAssistantController } from "../useAssistantController.js";
|
|
3
3
|
import { AssistantThemeScope } from "./AssistantChrome.js";
|
|
4
4
|
import { AssistantExperienceView } from "./AssistantExperience.js";
|
|
5
|
-
export function AssistantEmbedded({ client, podId, assistantId, organizationId, enabled = true, theme = "auto", ...props }) {
|
|
5
|
+
export function AssistantEmbedded({ client, podId, assistantName, assistantId, organizationId, enabled = true, theme = "auto", ...props }) {
|
|
6
6
|
const controller = useAssistantController({
|
|
7
7
|
client,
|
|
8
8
|
podId: podId ?? undefined,
|
|
9
|
+
assistantName: assistantName ?? undefined,
|
|
9
10
|
assistantId: assistantId ?? undefined,
|
|
10
11
|
organizationId: organizationId ?? undefined,
|
|
11
12
|
enabled,
|
|
@@ -2,6 +2,10 @@ import type { LemmaClient } from "../client.js";
|
|
|
2
2
|
import type { AvailableModelInfo, Conversation, ConversationModel } from "../types.js";
|
|
3
3
|
export interface AssistantConversationScope {
|
|
4
4
|
podId?: string | null;
|
|
5
|
+
assistantName?: string | null;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use assistantName instead.
|
|
8
|
+
*/
|
|
5
9
|
assistantId?: string | null;
|
|
6
10
|
organizationId?: string | null;
|
|
7
11
|
}
|
|
@@ -81,4 +85,4 @@ export interface UseAssistantControllerResult {
|
|
|
81
85
|
clearMessages: () => void;
|
|
82
86
|
stop: () => void;
|
|
83
87
|
}
|
|
84
|
-
export declare function useAssistantController({ client, podId, assistantId, organizationId, enabled, }: UseAssistantControllerOptions): UseAssistantControllerResult;
|
|
88
|
+
export declare function useAssistantController({ client, podId, assistantName, assistantId, organizationId, enabled, }: UseAssistantControllerOptions): UseAssistantControllerResult;
|
|
@@ -3,6 +3,7 @@ import { useAssistantRuntime } from "./useAssistantRuntime.js";
|
|
|
3
3
|
import { useAssistantSession } from "./useAssistantSession.js";
|
|
4
4
|
const EMPTY_SCOPE_KEY = JSON.stringify({
|
|
5
5
|
podId: null,
|
|
6
|
+
assistantName: null,
|
|
6
7
|
assistantId: null,
|
|
7
8
|
organizationId: null,
|
|
8
9
|
});
|
|
@@ -538,7 +539,7 @@ function isConversationRunning(status) {
|
|
|
538
539
|
}
|
|
539
540
|
return true;
|
|
540
541
|
}
|
|
541
|
-
export function useAssistantController({ client, podId, assistantId, organizationId, enabled = true, }) {
|
|
542
|
+
export function useAssistantController({ client, podId, assistantName, assistantId, organizationId, enabled = true, }) {
|
|
542
543
|
const [localError, setLocalError] = useState(null);
|
|
543
544
|
const [messages, setMessages] = useState([]);
|
|
544
545
|
const [conversations, setConversations] = useState([]);
|
|
@@ -560,20 +561,23 @@ export function useAssistantController({ client, podId, assistantId, organizatio
|
|
|
560
561
|
const skipInitialLoadConversationIdsRef = useRef(new Set());
|
|
561
562
|
const scope = useMemo(() => ({
|
|
562
563
|
podId: podId ?? null,
|
|
564
|
+
assistantName: assistantName ?? assistantId ?? null,
|
|
563
565
|
assistantId: assistantId ?? null,
|
|
564
566
|
organizationId: organizationId ?? null,
|
|
565
|
-
}), [assistantId, organizationId, podId]);
|
|
567
|
+
}), [assistantId, assistantName, organizationId, podId]);
|
|
566
568
|
const scopeKey = useMemo(() => JSON.stringify({
|
|
567
569
|
podId: scope.podId ?? null,
|
|
570
|
+
assistantName: scope.assistantName ?? null,
|
|
568
571
|
assistantId: scope.assistantId ?? null,
|
|
569
572
|
organizationId: scope.organizationId ?? null,
|
|
570
|
-
}), [scope.assistantId, scope.organizationId, scope.podId]);
|
|
573
|
+
}), [scope.assistantId, scope.assistantName, scope.organizationId, scope.podId]);
|
|
571
574
|
const handleAssistantSessionError = useCallback((sessionError) => {
|
|
572
575
|
setLocalError((prev) => prev || (sessionError instanceof Error ? sessionError.message : "Assistant session failed"));
|
|
573
576
|
}, []);
|
|
574
577
|
const assistantSession = useAssistantSession({
|
|
575
578
|
client,
|
|
576
579
|
podId: scope.podId ?? undefined,
|
|
580
|
+
assistantName: scope.assistantName ?? undefined,
|
|
577
581
|
assistantId: scope.assistantId ?? undefined,
|
|
578
582
|
organizationId: scope.organizationId ?? undefined,
|
|
579
583
|
conversationId: activeConversationId ?? undefined,
|
|
@@ -3,12 +3,20 @@ import { type SseRawEvent } from "../streams.js";
|
|
|
3
3
|
import type { Conversation, ConversationMessage, ConversationModel, CursorPage } from "../types.js";
|
|
4
4
|
interface ConversationScope {
|
|
5
5
|
podId?: string | null;
|
|
6
|
+
assistantName?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use assistantName instead.
|
|
9
|
+
*/
|
|
6
10
|
assistantId?: string | null;
|
|
7
11
|
organizationId?: string | null;
|
|
8
12
|
}
|
|
9
13
|
export interface UseAssistantSessionOptions {
|
|
10
14
|
client: LemmaClient;
|
|
11
15
|
podId?: string;
|
|
16
|
+
assistantName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use assistantName instead.
|
|
19
|
+
*/
|
|
12
20
|
assistantId?: string;
|
|
13
21
|
organizationId?: string;
|
|
14
22
|
conversationId?: string | null;
|
|
@@ -24,6 +32,10 @@ export interface CreateConversationInput {
|
|
|
24
32
|
title?: string | null;
|
|
25
33
|
model?: ConversationModel | null;
|
|
26
34
|
podId?: string | null;
|
|
35
|
+
assistantName?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use assistantName instead.
|
|
38
|
+
*/
|
|
27
39
|
assistantId?: string | null;
|
|
28
40
|
organizationId?: string | null;
|
|
29
41
|
setActive?: boolean;
|