lemma-sdk 0.2.23 → 0.2.25
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 +156 -511
- package/dist/auth.js +0 -1
- package/dist/browser/lemma-client.js +196 -112
- 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 +7 -7
- package/dist/openapi_client/index.js +2 -4
- package/dist/openapi_client/models/ColumnSchema.d.ts +4 -0
- 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/CreateTableRequest.d.ts +1 -1
- 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/PodCreateRequest.d.ts +0 -4
- package/dist/openapi_client/models/PodMemberDetailResponse.d.ts +14 -0
- package/dist/openapi_client/models/PodMemberDetailResponse.js +1 -0
- package/dist/openapi_client/models/PodMemberResponse.d.ts +3 -3
- package/dist/openapi_client/models/PodResponse.d.ts +0 -5
- package/dist/openapi_client/models/PodUpdateRequest.d.ts +0 -4
- 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/PodMembersService.d.ts +14 -4
- package/dist/openapi_client/services/PodMembersService.js +29 -8
- 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/index.d.ts +0 -2
- package/dist/react/index.js +0 -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/react/useTaskSession.js +145 -73
- package/dist/task-events.d.ts +2 -1
- package/dist/task-events.js +38 -1
- package/dist/types.d.ts +10 -4
- package/package.json +1 -1
- package/dist/openapi_client/models/PodStatus.d.ts +0 -4
- package/dist/openapi_client/models/PodStatus.js +0 -9
- package/dist/openapi_client/models/PodType.d.ts +0 -6
- package/dist/openapi_client/models/PodType.js +0 -11
- 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/react/useAgentRun.d.ts +0 -17
- package/dist/react/useAgentRun.js +0 -66
- /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
package/dist/auth.js
CHANGED
|
@@ -462,7 +462,6 @@ class AuthManager {
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
applyUnauthenticatedState() {
|
|
465
|
-
this.clearFrontendSessionMarkers();
|
|
466
465
|
const next = { status: "unauthenticated", user: null };
|
|
467
466
|
this.setState(next);
|
|
468
467
|
return next;
|
|
@@ -1639,32 +1638,38 @@ class ConversationsNamespace {
|
|
|
1639
1638
|
list(options = {}) {
|
|
1640
1639
|
return this.http.request("GET", "/conversations", {
|
|
1641
1640
|
params: {
|
|
1642
|
-
|
|
1641
|
+
assistant_name: options.assistant_name ?? options.assistant_id,
|
|
1643
1642
|
pod_id: this.resolvePodId(options.pod_id),
|
|
1644
1643
|
organization_id: options.organization_id,
|
|
1644
|
+
global_only: options.global_only ?? false,
|
|
1645
1645
|
limit: options.limit ?? 20,
|
|
1646
1646
|
page_token: options.page_token,
|
|
1647
1647
|
},
|
|
1648
1648
|
});
|
|
1649
1649
|
}
|
|
1650
|
-
listByAssistant(
|
|
1651
|
-
return this.list({ ...options,
|
|
1650
|
+
listByAssistant(assistantName, options = {}) {
|
|
1651
|
+
return this.list({ ...options, assistant_name: assistantName });
|
|
1652
|
+
}
|
|
1653
|
+
listByAssistantName(assistantName, options = {}) {
|
|
1654
|
+
return this.listByAssistant(assistantName, options);
|
|
1652
1655
|
}
|
|
1653
1656
|
listModels() {
|
|
1654
1657
|
return this.http.request("GET", "/models");
|
|
1655
1658
|
}
|
|
1656
1659
|
create(payload) {
|
|
1660
|
+
const { assistant_id, ...requestBody } = payload;
|
|
1657
1661
|
return this.http.request("POST", "/conversations", {
|
|
1658
1662
|
body: {
|
|
1659
|
-
...
|
|
1660
|
-
pod_id: this.resolvePodId(
|
|
1663
|
+
...requestBody,
|
|
1664
|
+
pod_id: this.resolvePodId(requestBody.pod_id),
|
|
1665
|
+
assistant_name: requestBody.assistant_name ?? assistant_id,
|
|
1661
1666
|
},
|
|
1662
1667
|
});
|
|
1663
1668
|
}
|
|
1664
|
-
createForAssistant(
|
|
1669
|
+
createForAssistant(assistantName, payload = {}) {
|
|
1665
1670
|
return this.create({
|
|
1666
1671
|
...payload,
|
|
1667
|
-
|
|
1672
|
+
assistant_name: assistantName,
|
|
1668
1673
|
});
|
|
1669
1674
|
}
|
|
1670
1675
|
get(conversationId, options = {}) {
|
|
@@ -1950,6 +1955,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
1950
1955
|
exports.FilesNamespace = void 0;
|
|
1951
1956
|
const SearchMethod_js_1 = require("./openapi_client/models/SearchMethod.js");
|
|
1952
1957
|
const FilesService_js_1 = require("./openapi_client/services/FilesService.js");
|
|
1958
|
+
function joinDatastorePath(basePath, leaf) {
|
|
1959
|
+
const normalizedLeaf = leaf.replace(/^\/+/, "");
|
|
1960
|
+
const trimmedBase = (basePath ?? "/").trim();
|
|
1961
|
+
const normalizedBase = trimmedBase.length > 0 ? trimmedBase : "/";
|
|
1962
|
+
if (normalizedBase === "/") {
|
|
1963
|
+
return `/${normalizedLeaf}`;
|
|
1964
|
+
}
|
|
1965
|
+
return `${normalizedBase.replace(/\/+$/, "")}/${normalizedLeaf}`;
|
|
1966
|
+
}
|
|
1967
|
+
function getDirectoryPath(path) {
|
|
1968
|
+
const normalized = path.trim();
|
|
1969
|
+
if (!normalized || normalized === "/") {
|
|
1970
|
+
return "/";
|
|
1971
|
+
}
|
|
1972
|
+
const withoutTrailing = normalized.replace(/\/+$/, "");
|
|
1973
|
+
const index = withoutTrailing.lastIndexOf("/");
|
|
1974
|
+
if (index <= 0) {
|
|
1975
|
+
return "/";
|
|
1976
|
+
}
|
|
1977
|
+
return withoutTrailing.slice(0, index);
|
|
1978
|
+
}
|
|
1979
|
+
function getBaseName(path) {
|
|
1980
|
+
const normalized = path.trim().replace(/\/+$/, "");
|
|
1981
|
+
const index = normalized.lastIndexOf("/");
|
|
1982
|
+
if (index === -1) {
|
|
1983
|
+
return normalized;
|
|
1984
|
+
}
|
|
1985
|
+
return normalized.slice(index + 1);
|
|
1986
|
+
}
|
|
1953
1987
|
class FilesNamespace {
|
|
1954
1988
|
constructor(client, http, podId) {
|
|
1955
1989
|
this.client = client;
|
|
@@ -1958,22 +1992,22 @@ class FilesNamespace {
|
|
|
1958
1992
|
this.folder = {
|
|
1959
1993
|
create: (name, options = {}) => {
|
|
1960
1994
|
const payload = {
|
|
1961
|
-
name,
|
|
1995
|
+
path: joinDatastorePath(options.directoryPath ?? options.parentId, name),
|
|
1962
1996
|
description: options.description,
|
|
1963
|
-
parent_id: options.parentId,
|
|
1964
1997
|
};
|
|
1965
1998
|
return this.client.request(() => FilesService_js_1.FilesService.fileFolderCreate(this.podId(), payload));
|
|
1966
1999
|
},
|
|
1967
2000
|
};
|
|
1968
2001
|
}
|
|
1969
2002
|
list(options = {}) {
|
|
1970
|
-
|
|
2003
|
+
const directoryPath = options.directoryPath ?? options.parentId ?? "/";
|
|
2004
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileList(this.podId(), directoryPath, options.limit ?? 100, options.pageToken));
|
|
1971
2005
|
}
|
|
1972
|
-
get(
|
|
1973
|
-
return this.client.request(() => FilesService_js_1.FilesService.fileGet(this.podId(),
|
|
2006
|
+
get(path) {
|
|
2007
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileGet(this.podId(), path));
|
|
1974
2008
|
}
|
|
1975
|
-
delete(
|
|
1976
|
-
return this.client.request(() => FilesService_js_1.FilesService.fileDelete(this.podId(),
|
|
2009
|
+
delete(path) {
|
|
2010
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileDelete(this.podId(), path));
|
|
1977
2011
|
}
|
|
1978
2012
|
search(query, options = {}) {
|
|
1979
2013
|
return this.client.request(() => FilesService_js_1.FilesService.fileSearch(this.podId(), {
|
|
@@ -1982,28 +2016,37 @@ class FilesNamespace {
|
|
|
1982
2016
|
search_method: options.searchMethod ?? SearchMethod_js_1.SearchMethod.HYBRID,
|
|
1983
2017
|
}));
|
|
1984
2018
|
}
|
|
1985
|
-
download(
|
|
1986
|
-
|
|
2019
|
+
download(path) {
|
|
2020
|
+
const encodedPath = encodeURIComponent(path);
|
|
2021
|
+
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/download?path=${encodedPath}`);
|
|
1987
2022
|
}
|
|
1988
2023
|
upload(file, options = {}) {
|
|
1989
2024
|
const payload = {
|
|
1990
2025
|
data: file,
|
|
1991
2026
|
name: options.name ?? (file instanceof File ? file.name : undefined),
|
|
1992
2027
|
description: options.description,
|
|
1993
|
-
|
|
2028
|
+
directory_path: options.directoryPath ?? options.parentId ?? "/",
|
|
1994
2029
|
search_enabled: options.searchEnabled ?? true,
|
|
1995
2030
|
};
|
|
1996
2031
|
return this.client.request(() => FilesService_js_1.FilesService.fileUpload(this.podId(), payload));
|
|
1997
2032
|
}
|
|
1998
|
-
update(
|
|
2033
|
+
update(path, options = {}) {
|
|
2034
|
+
const targetDirectory = options.directoryPath ?? options.parentId;
|
|
2035
|
+
const resolvedNewPath = options.newPath
|
|
2036
|
+
?? (options.name
|
|
2037
|
+
? joinDatastorePath(targetDirectory ?? getDirectoryPath(path), options.name)
|
|
2038
|
+
: undefined)
|
|
2039
|
+
?? (targetDirectory
|
|
2040
|
+
? joinDatastorePath(targetDirectory, getBaseName(path))
|
|
2041
|
+
: undefined);
|
|
1999
2042
|
const payload = {
|
|
2043
|
+
path,
|
|
2000
2044
|
data: options.file,
|
|
2001
|
-
name: options.name,
|
|
2002
2045
|
description: options.description,
|
|
2003
|
-
|
|
2046
|
+
new_path: resolvedNewPath,
|
|
2004
2047
|
search_enabled: options.searchEnabled,
|
|
2005
2048
|
};
|
|
2006
|
-
return this.client.request(() => FilesService_js_1.FilesService.fileUpdate(this.podId(),
|
|
2049
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileUpdate(this.podId(), payload));
|
|
2007
2050
|
}
|
|
2008
2051
|
}
|
|
2009
2052
|
exports.FilesNamespace = FilesNamespace;
|
|
@@ -2035,13 +2078,13 @@ class FilesService {
|
|
|
2035
2078
|
/**
|
|
2036
2079
|
* List Files
|
|
2037
2080
|
* @param podId
|
|
2038
|
-
* @param
|
|
2081
|
+
* @param directoryPath
|
|
2039
2082
|
* @param limit
|
|
2040
2083
|
* @param pageToken
|
|
2041
2084
|
* @returns FileListResponse Successful Response
|
|
2042
2085
|
* @throws ApiError
|
|
2043
2086
|
*/
|
|
2044
|
-
static fileList(podId,
|
|
2087
|
+
static fileList(podId, directoryPath = '/', limit = 100, pageToken) {
|
|
2045
2088
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2046
2089
|
method: 'GET',
|
|
2047
2090
|
url: '/pods/{pod_id}/datastore/files',
|
|
@@ -2049,7 +2092,7 @@ class FilesService {
|
|
|
2049
2092
|
'pod_id': podId,
|
|
2050
2093
|
},
|
|
2051
2094
|
query: {
|
|
2052
|
-
'
|
|
2095
|
+
'directory_path': directoryPath,
|
|
2053
2096
|
'limit': limit,
|
|
2054
2097
|
'page_token': pageToken,
|
|
2055
2098
|
},
|
|
@@ -2080,81 +2123,86 @@ class FilesService {
|
|
|
2080
2123
|
});
|
|
2081
2124
|
}
|
|
2082
2125
|
/**
|
|
2083
|
-
*
|
|
2126
|
+
* Delete File
|
|
2084
2127
|
* @param podId
|
|
2085
|
-
* @param
|
|
2086
|
-
* @returns
|
|
2128
|
+
* @param path
|
|
2129
|
+
* @returns DatastoreMessageResponse Successful Response
|
|
2087
2130
|
* @throws ApiError
|
|
2088
2131
|
*/
|
|
2089
|
-
static
|
|
2132
|
+
static fileDelete(podId, path) {
|
|
2090
2133
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2091
|
-
method: '
|
|
2092
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
2134
|
+
method: 'DELETE',
|
|
2135
|
+
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
2093
2136
|
path: {
|
|
2094
2137
|
'pod_id': podId,
|
|
2095
2138
|
},
|
|
2096
|
-
|
|
2097
|
-
|
|
2139
|
+
query: {
|
|
2140
|
+
'path': path,
|
|
2141
|
+
},
|
|
2098
2142
|
errors: {
|
|
2099
2143
|
422: `Validation Error`,
|
|
2100
2144
|
},
|
|
2101
2145
|
});
|
|
2102
2146
|
}
|
|
2103
2147
|
/**
|
|
2104
|
-
*
|
|
2148
|
+
* Get File
|
|
2105
2149
|
* @param podId
|
|
2106
|
-
* @param
|
|
2107
|
-
* @returns
|
|
2150
|
+
* @param path
|
|
2151
|
+
* @returns FileResponse Successful Response
|
|
2108
2152
|
* @throws ApiError
|
|
2109
2153
|
*/
|
|
2110
|
-
static
|
|
2154
|
+
static fileGet(podId, path) {
|
|
2111
2155
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2112
|
-
method: '
|
|
2113
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
2156
|
+
method: 'GET',
|
|
2157
|
+
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
2114
2158
|
path: {
|
|
2115
2159
|
'pod_id': podId,
|
|
2116
2160
|
},
|
|
2117
|
-
|
|
2118
|
-
|
|
2161
|
+
query: {
|
|
2162
|
+
'path': path,
|
|
2163
|
+
},
|
|
2119
2164
|
errors: {
|
|
2120
2165
|
422: `Validation Error`,
|
|
2121
2166
|
},
|
|
2122
2167
|
});
|
|
2123
2168
|
}
|
|
2124
2169
|
/**
|
|
2125
|
-
*
|
|
2170
|
+
* Update File
|
|
2126
2171
|
* @param podId
|
|
2127
|
-
* @param
|
|
2128
|
-
* @returns
|
|
2172
|
+
* @param formData
|
|
2173
|
+
* @returns FileResponse Successful Response
|
|
2129
2174
|
* @throws ApiError
|
|
2130
2175
|
*/
|
|
2131
|
-
static
|
|
2176
|
+
static fileUpdate(podId, formData) {
|
|
2132
2177
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2133
|
-
method: '
|
|
2134
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
2178
|
+
method: 'PATCH',
|
|
2179
|
+
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
2135
2180
|
path: {
|
|
2136
2181
|
'pod_id': podId,
|
|
2137
|
-
'file_id': fileId,
|
|
2138
2182
|
},
|
|
2183
|
+
formData: formData,
|
|
2184
|
+
mediaType: 'multipart/form-data',
|
|
2139
2185
|
errors: {
|
|
2140
2186
|
422: `Validation Error`,
|
|
2141
2187
|
},
|
|
2142
2188
|
});
|
|
2143
2189
|
}
|
|
2144
2190
|
/**
|
|
2145
|
-
*
|
|
2191
|
+
* Download File
|
|
2146
2192
|
* @param podId
|
|
2147
|
-
* @param
|
|
2148
|
-
* @returns
|
|
2193
|
+
* @param path
|
|
2194
|
+
* @returns any Successful Response
|
|
2149
2195
|
* @throws ApiError
|
|
2150
2196
|
*/
|
|
2151
|
-
static
|
|
2197
|
+
static fileDownload(podId, path) {
|
|
2152
2198
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2153
2199
|
method: 'GET',
|
|
2154
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
2200
|
+
url: '/pods/{pod_id}/datastore/files/download',
|
|
2155
2201
|
path: {
|
|
2156
2202
|
'pod_id': podId,
|
|
2157
|
-
|
|
2203
|
+
},
|
|
2204
|
+
query: {
|
|
2205
|
+
'path': path,
|
|
2158
2206
|
},
|
|
2159
2207
|
errors: {
|
|
2160
2208
|
422: `Validation Error`,
|
|
@@ -2162,42 +2210,65 @@ class FilesService {
|
|
|
2162
2210
|
});
|
|
2163
2211
|
}
|
|
2164
2212
|
/**
|
|
2165
|
-
*
|
|
2213
|
+
* Create Folder
|
|
2166
2214
|
* @param podId
|
|
2167
|
-
* @param
|
|
2168
|
-
* @param formData
|
|
2215
|
+
* @param requestBody
|
|
2169
2216
|
* @returns FileResponse Successful Response
|
|
2170
2217
|
* @throws ApiError
|
|
2171
2218
|
*/
|
|
2172
|
-
static
|
|
2219
|
+
static fileFolderCreate(podId, requestBody) {
|
|
2173
2220
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2174
|
-
method: '
|
|
2175
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
2221
|
+
method: 'POST',
|
|
2222
|
+
url: '/pods/{pod_id}/datastore/files/folders',
|
|
2176
2223
|
path: {
|
|
2177
2224
|
'pod_id': podId,
|
|
2178
|
-
'file_id': fileId,
|
|
2179
2225
|
},
|
|
2180
|
-
|
|
2181
|
-
mediaType: '
|
|
2226
|
+
body: requestBody,
|
|
2227
|
+
mediaType: 'application/json',
|
|
2182
2228
|
errors: {
|
|
2183
2229
|
422: `Validation Error`,
|
|
2184
2230
|
},
|
|
2185
2231
|
});
|
|
2186
2232
|
}
|
|
2187
2233
|
/**
|
|
2188
|
-
*
|
|
2234
|
+
* Search Files
|
|
2189
2235
|
* @param podId
|
|
2190
|
-
* @param
|
|
2191
|
-
* @returns
|
|
2236
|
+
* @param requestBody
|
|
2237
|
+
* @returns FileSearchResponse Successful Response
|
|
2192
2238
|
* @throws ApiError
|
|
2193
2239
|
*/
|
|
2194
|
-
static
|
|
2240
|
+
static fileSearch(podId, requestBody) {
|
|
2241
|
+
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2242
|
+
method: 'POST',
|
|
2243
|
+
url: '/pods/{pod_id}/datastore/files/search',
|
|
2244
|
+
path: {
|
|
2245
|
+
'pod_id': podId,
|
|
2246
|
+
},
|
|
2247
|
+
body: requestBody,
|
|
2248
|
+
mediaType: 'application/json',
|
|
2249
|
+
errors: {
|
|
2250
|
+
422: `Validation Error`,
|
|
2251
|
+
},
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
/**
|
|
2255
|
+
* Get Directory Tree
|
|
2256
|
+
* @param podId
|
|
2257
|
+
* @param rootPath
|
|
2258
|
+
* @param filesPerDirectory
|
|
2259
|
+
* @returns DirectoryTreeResponse Successful Response
|
|
2260
|
+
* @throws ApiError
|
|
2261
|
+
*/
|
|
2262
|
+
static fileTree(podId, rootPath = '/', filesPerDirectory = 3) {
|
|
2195
2263
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2196
2264
|
method: 'GET',
|
|
2197
|
-
url: '/pods/{pod_id}/datastore/files/
|
|
2265
|
+
url: '/pods/{pod_id}/datastore/files/tree',
|
|
2198
2266
|
path: {
|
|
2199
2267
|
'pod_id': podId,
|
|
2200
|
-
|
|
2268
|
+
},
|
|
2269
|
+
query: {
|
|
2270
|
+
'root_path': rootPath,
|
|
2271
|
+
'files_per_directory': filesPerDirectory,
|
|
2201
2272
|
},
|
|
2202
2273
|
errors: {
|
|
2203
2274
|
422: `Validation Error`,
|
|
@@ -3294,17 +3365,38 @@ class PodMembersService {
|
|
|
3294
3365
|
* Remove Pod Member
|
|
3295
3366
|
* Remove a member from a pod
|
|
3296
3367
|
* @param podId
|
|
3297
|
-
* @param
|
|
3368
|
+
* @param userId
|
|
3298
3369
|
* @returns void
|
|
3299
3370
|
* @throws ApiError
|
|
3300
3371
|
*/
|
|
3301
|
-
static podMemberRemove(podId,
|
|
3372
|
+
static podMemberRemove(podId, userId) {
|
|
3302
3373
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
3303
3374
|
method: 'DELETE',
|
|
3304
|
-
url: '/pods/{pod_id}/members/{
|
|
3375
|
+
url: '/pods/{pod_id}/members/{user_id}',
|
|
3305
3376
|
path: {
|
|
3306
3377
|
'pod_id': podId,
|
|
3307
|
-
'
|
|
3378
|
+
'user_id': userId,
|
|
3379
|
+
},
|
|
3380
|
+
errors: {
|
|
3381
|
+
422: `Validation Error`,
|
|
3382
|
+
},
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
/**
|
|
3386
|
+
* Get Pod Member
|
|
3387
|
+
* Get a pod member by user id
|
|
3388
|
+
* @param podId
|
|
3389
|
+
* @param userId
|
|
3390
|
+
* @returns PodMemberDetailResponse Successful Response
|
|
3391
|
+
* @throws ApiError
|
|
3392
|
+
*/
|
|
3393
|
+
static podMemberGet(podId, userId) {
|
|
3394
|
+
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
3395
|
+
method: 'GET',
|
|
3396
|
+
url: '/pods/{pod_id}/members/{user_id}',
|
|
3397
|
+
path: {
|
|
3398
|
+
'pod_id': podId,
|
|
3399
|
+
'user_id': userId,
|
|
3308
3400
|
},
|
|
3309
3401
|
errors: {
|
|
3310
3402
|
422: `Validation Error`,
|
|
@@ -3315,18 +3407,18 @@ class PodMembersService {
|
|
|
3315
3407
|
* Update Member Role
|
|
3316
3408
|
* Update a pod member's role
|
|
3317
3409
|
* @param podId
|
|
3318
|
-
* @param
|
|
3410
|
+
* @param userId
|
|
3319
3411
|
* @param requestBody
|
|
3320
3412
|
* @returns PodMemberResponse Successful Response
|
|
3321
3413
|
* @throws ApiError
|
|
3322
3414
|
*/
|
|
3323
|
-
static podMemberUpdateRole(podId,
|
|
3415
|
+
static podMemberUpdateRole(podId, userId, requestBody) {
|
|
3324
3416
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
3325
3417
|
method: 'PATCH',
|
|
3326
|
-
url: '/pods/{pod_id}/members/{
|
|
3418
|
+
url: '/pods/{pod_id}/members/{user_id}/role',
|
|
3327
3419
|
path: {
|
|
3328
3420
|
'pod_id': podId,
|
|
3329
|
-
'
|
|
3421
|
+
'user_id': userId,
|
|
3330
3422
|
},
|
|
3331
3423
|
body: requestBody,
|
|
3332
3424
|
mediaType: 'application/json',
|
|
@@ -3681,6 +3773,18 @@ const RecordsService_js_1 = require("./openapi_client/services/RecordsService.js
|
|
|
3681
3773
|
function getRecordsPath(podId, table) {
|
|
3682
3774
|
return `/pods/${encodeURIComponent(podId)}/datastore/tables/${encodeURIComponent(table)}/records`;
|
|
3683
3775
|
}
|
|
3776
|
+
function serializeFilters(filters) {
|
|
3777
|
+
if (!filters || filters.length === 0) {
|
|
3778
|
+
return undefined;
|
|
3779
|
+
}
|
|
3780
|
+
return filters.map((filter) => JSON.stringify(filter));
|
|
3781
|
+
}
|
|
3782
|
+
function serializeSort(sort) {
|
|
3783
|
+
if (!sort || sort.length === 0) {
|
|
3784
|
+
return undefined;
|
|
3785
|
+
}
|
|
3786
|
+
return sort.map((entry) => JSON.stringify(entry));
|
|
3787
|
+
}
|
|
3684
3788
|
class RecordsNamespace {
|
|
3685
3789
|
constructor(client, http, podId) {
|
|
3686
3790
|
this.client = client;
|
|
@@ -3704,13 +3808,7 @@ class RecordsNamespace {
|
|
|
3704
3808
|
list(table, options = {}) {
|
|
3705
3809
|
const { filters, sort, limit, pageToken, offset, sortBy, order, params } = options;
|
|
3706
3810
|
if (filters || sort) {
|
|
3707
|
-
|
|
3708
|
-
filters,
|
|
3709
|
-
sort,
|
|
3710
|
-
limit,
|
|
3711
|
-
page_token: pageToken,
|
|
3712
|
-
};
|
|
3713
|
-
return this.client.request(() => RecordsService_js_1.RecordsService.recordQuery(this.podId(), table, payload));
|
|
3811
|
+
return this.client.request(() => RecordsService_js_1.RecordsService.recordList(this.podId(), table, limit ?? 20, offset, sortBy ?? undefined, order ?? "asc", serializeFilters(filters), serializeSort(sort), pageToken));
|
|
3714
3812
|
}
|
|
3715
3813
|
const hasCustomParams = typeof offset === "number" ||
|
|
3716
3814
|
typeof sortBy === "string" ||
|
|
@@ -3728,7 +3826,7 @@ class RecordsNamespace {
|
|
|
3728
3826
|
},
|
|
3729
3827
|
});
|
|
3730
3828
|
}
|
|
3731
|
-
return this.client.request(() => RecordsService_js_1.RecordsService.recordList(this.podId(), table, limit ?? 20, pageToken));
|
|
3829
|
+
return this.client.request(() => RecordsService_js_1.RecordsService.recordList(this.podId(), table, limit ?? 20, offset, sortBy ?? undefined, order ?? "asc", undefined, undefined, pageToken));
|
|
3732
3830
|
}
|
|
3733
3831
|
listWithParams(table, params) {
|
|
3734
3832
|
return this.http.request("GET", getRecordsPath(this.podId(), table), {
|
|
@@ -3748,7 +3846,7 @@ class RecordsNamespace {
|
|
|
3748
3846
|
return this.client.request(() => RecordsService_js_1.RecordsService.recordDelete(this.podId(), table, recordId));
|
|
3749
3847
|
}
|
|
3750
3848
|
query(table, payload) {
|
|
3751
|
-
return this.client.request(() => RecordsService_js_1.RecordsService.
|
|
3849
|
+
return this.client.request(() => RecordsService_js_1.RecordsService.recordList(this.podId(), table, payload.limit ?? 20, payload.offset, payload.sort_by ?? undefined, payload.order ?? "asc", serializeFilters(payload.filters), serializeSort(payload.sort), payload.page_token));
|
|
3752
3850
|
}
|
|
3753
3851
|
}
|
|
3754
3852
|
exports.RecordsNamespace = RecordsNamespace;
|
|
@@ -3763,15 +3861,20 @@ const request_js_1 = require("./openapi_client/core/request.js");
|
|
|
3763
3861
|
class RecordsService {
|
|
3764
3862
|
/**
|
|
3765
3863
|
* List Records
|
|
3766
|
-
* List table records with token pagination only. Use
|
|
3864
|
+
* List table records with token pagination only. Use the datastore query endpoint for joins, aggregates, or custom read-only SQL.
|
|
3767
3865
|
* @param podId
|
|
3768
3866
|
* @param tableName
|
|
3769
3867
|
* @param limit Max number of rows to return.
|
|
3868
|
+
* @param offset Row offset for direct pagination.
|
|
3869
|
+
* @param sortBy Optional column name to sort by.
|
|
3870
|
+
* @param order Sort direction for `sort_by`: `asc` or `desc`.
|
|
3871
|
+
* @param filter Optional repeated JSON filters for advanced comparisons. Each `filter` value must be a JSON object with shape `{"field":"<column_name>","op":"<operator>","value":<comparison_value>}`. Allowed operators are: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `like`, `ilike`. Repeat the query parameter to combine multiple filters with AND semantics. Examples: `filter={"field":"amount","op":"gt","value":100}` and `filter={"field":"status","op":"eq","value":"OPEN"}`.
|
|
3872
|
+
* @param sort Optional repeated JSON sort clauses. Each `sort` value must be a JSON object with shape `{"field":"<column_name>","direction":"<direction>"}`. Allowed directions are: `asc`, `desc`. Repeat the query parameter to provide multi-column sorting in priority order. Example: `sort={"field":"created_at","direction":"desc"}`.
|
|
3770
3873
|
* @param pageToken Opaque token from a previous response page.
|
|
3771
3874
|
* @returns RecordListResponse Successful Response
|
|
3772
3875
|
* @throws ApiError
|
|
3773
3876
|
*/
|
|
3774
|
-
static recordList(podId, tableName, limit = 20, pageToken) {
|
|
3877
|
+
static recordList(podId, tableName, limit = 20, offset, sortBy, order = 'asc', filter, sort, pageToken) {
|
|
3775
3878
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
3776
3879
|
method: 'GET',
|
|
3777
3880
|
url: '/pods/{pod_id}/datastore/tables/{table_name}/records',
|
|
@@ -3781,6 +3884,11 @@ class RecordsService {
|
|
|
3781
3884
|
},
|
|
3782
3885
|
query: {
|
|
3783
3886
|
'limit': limit,
|
|
3887
|
+
'offset': offset,
|
|
3888
|
+
'sort_by': sortBy,
|
|
3889
|
+
'order': order,
|
|
3890
|
+
'filter': filter,
|
|
3891
|
+
'sort': sort,
|
|
3784
3892
|
'page_token': pageToken,
|
|
3785
3893
|
},
|
|
3786
3894
|
errors: {
|
|
@@ -3884,30 +3992,6 @@ class RecordsService {
|
|
|
3884
3992
|
},
|
|
3885
3993
|
});
|
|
3886
3994
|
}
|
|
3887
|
-
/**
|
|
3888
|
-
* Query Records
|
|
3889
|
-
* 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"}]`.
|
|
3890
|
-
* @param podId
|
|
3891
|
-
* @param tableName
|
|
3892
|
-
* @param requestBody
|
|
3893
|
-
* @returns RecordListResponse Successful Response
|
|
3894
|
-
* @throws ApiError
|
|
3895
|
-
*/
|
|
3896
|
-
static recordQuery(podId, tableName, requestBody) {
|
|
3897
|
-
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
3898
|
-
method: 'POST',
|
|
3899
|
-
url: '/pods/{pod_id}/datastore/tables/{table_name}/records/query',
|
|
3900
|
-
path: {
|
|
3901
|
-
'pod_id': podId,
|
|
3902
|
-
'table_name': tableName,
|
|
3903
|
-
},
|
|
3904
|
-
body: requestBody,
|
|
3905
|
-
mediaType: 'application/json',
|
|
3906
|
-
errors: {
|
|
3907
|
-
422: `Validation Error`,
|
|
3908
|
-
},
|
|
3909
|
-
});
|
|
3910
|
-
}
|
|
3911
3995
|
/**
|
|
3912
3996
|
* Delete Record
|
|
3913
3997
|
* Delete a record by primary key.
|
|
@@ -30,21 +30,39 @@ export declare class ConversationsNamespace {
|
|
|
30
30
|
private resolvePodId;
|
|
31
31
|
private requirePodId;
|
|
32
32
|
list(options?: {
|
|
33
|
+
assistant_name?: string;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use assistant_name instead.
|
|
36
|
+
*/
|
|
33
37
|
assistant_id?: string;
|
|
34
38
|
pod_id?: string;
|
|
35
39
|
organization_id?: string;
|
|
40
|
+
global_only?: boolean;
|
|
36
41
|
limit?: number;
|
|
37
42
|
page_token?: string;
|
|
38
43
|
}): Promise<ConversationListResponse>;
|
|
39
|
-
listByAssistant(
|
|
44
|
+
listByAssistant(assistantName: string, options?: {
|
|
40
45
|
pod_id?: string;
|
|
41
46
|
organization_id?: string;
|
|
47
|
+
global_only?: boolean;
|
|
48
|
+
limit?: number;
|
|
49
|
+
page_token?: string;
|
|
50
|
+
}): Promise<ConversationListResponse>;
|
|
51
|
+
listByAssistantName(assistantName: string, options?: {
|
|
52
|
+
pod_id?: string;
|
|
53
|
+
organization_id?: string;
|
|
54
|
+
global_only?: boolean;
|
|
42
55
|
limit?: number;
|
|
43
56
|
page_token?: string;
|
|
44
57
|
}): Promise<ConversationListResponse>;
|
|
45
58
|
listModels(): Promise<AvailableModelsListResponse>;
|
|
46
|
-
create(payload: CreateConversationRequest
|
|
47
|
-
|
|
59
|
+
create(payload: CreateConversationRequest & {
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated Use assistant_name instead.
|
|
62
|
+
*/
|
|
63
|
+
assistant_id?: string | null;
|
|
64
|
+
}): Promise<ConversationResponse>;
|
|
65
|
+
createForAssistant(assistantName: string, payload?: Omit<CreateConversationRequest, "assistant_name">): Promise<ConversationResponse>;
|
|
48
66
|
get(conversationId: string, options?: {
|
|
49
67
|
pod_id?: string;
|
|
50
68
|
}): Promise<ConversationResponse>;
|
|
@@ -56,32 +56,38 @@ export class ConversationsNamespace {
|
|
|
56
56
|
list(options = {}) {
|
|
57
57
|
return this.http.request("GET", "/conversations", {
|
|
58
58
|
params: {
|
|
59
|
-
|
|
59
|
+
assistant_name: options.assistant_name ?? options.assistant_id,
|
|
60
60
|
pod_id: this.resolvePodId(options.pod_id),
|
|
61
61
|
organization_id: options.organization_id,
|
|
62
|
+
global_only: options.global_only ?? false,
|
|
62
63
|
limit: options.limit ?? 20,
|
|
63
64
|
page_token: options.page_token,
|
|
64
65
|
},
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
|
-
listByAssistant(
|
|
68
|
-
return this.list({ ...options,
|
|
68
|
+
listByAssistant(assistantName, options = {}) {
|
|
69
|
+
return this.list({ ...options, assistant_name: assistantName });
|
|
70
|
+
}
|
|
71
|
+
listByAssistantName(assistantName, options = {}) {
|
|
72
|
+
return this.listByAssistant(assistantName, options);
|
|
69
73
|
}
|
|
70
74
|
listModels() {
|
|
71
75
|
return this.http.request("GET", "/models");
|
|
72
76
|
}
|
|
73
77
|
create(payload) {
|
|
78
|
+
const { assistant_id, ...requestBody } = payload;
|
|
74
79
|
return this.http.request("POST", "/conversations", {
|
|
75
80
|
body: {
|
|
76
|
-
...
|
|
77
|
-
pod_id: this.resolvePodId(
|
|
81
|
+
...requestBody,
|
|
82
|
+
pod_id: this.resolvePodId(requestBody.pod_id),
|
|
83
|
+
assistant_name: requestBody.assistant_name ?? assistant_id,
|
|
78
84
|
},
|
|
79
85
|
});
|
|
80
86
|
}
|
|
81
|
-
createForAssistant(
|
|
87
|
+
createForAssistant(assistantName, payload = {}) {
|
|
82
88
|
return this.create({
|
|
83
89
|
...payload,
|
|
84
|
-
|
|
90
|
+
assistant_name: assistantName,
|
|
85
91
|
});
|
|
86
92
|
}
|
|
87
93
|
get(conversationId, options = {}) {
|