@superatomai/sdk-web 0.0.13 → 0.0.15
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 +755 -755
- package/dist/index.cjs +459 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +538 -9
- package/dist/index.d.ts +538 -9
- package/dist/index.js +454 -13
- package/dist/index.js.map +1 -1
- package/package.json +43 -41
package/dist/index.js
CHANGED
|
@@ -318,7 +318,9 @@ var UserPromptSuggestionsResponseMessageSchema = z.object({
|
|
|
318
318
|
to: MessageParticipantSchema.optional(),
|
|
319
319
|
payload: UserPromptSuggestionsResponsePayloadSchema
|
|
320
320
|
});
|
|
321
|
-
var BundleRequestPayloadSchema = z.object({
|
|
321
|
+
var BundleRequestPayloadSchema = z.object({
|
|
322
|
+
devbundlereq: z.boolean().optional().default(false)
|
|
323
|
+
});
|
|
322
324
|
var BundleRequestMessageSchema = z.object({
|
|
323
325
|
id: z.string(),
|
|
324
326
|
type: z.literal("BUNDLE_REQ"),
|
|
@@ -702,6 +704,82 @@ z.object({
|
|
|
702
704
|
to: MessageParticipantSchema.optional(),
|
|
703
705
|
payload: BookmarksResponsePayloadSchema
|
|
704
706
|
});
|
|
707
|
+
var KbNodeDataSchema = z.object({
|
|
708
|
+
id: z.number().optional(),
|
|
709
|
+
title: z.string(),
|
|
710
|
+
content: z.string(),
|
|
711
|
+
category: z.string().nullable().optional(),
|
|
712
|
+
tags: z.array(z.string()).nullable().optional(),
|
|
713
|
+
createdBy: z.number(),
|
|
714
|
+
updatedBy: z.number().optional(),
|
|
715
|
+
createdAt: z.string().optional(),
|
|
716
|
+
updatedAt: z.string().optional()
|
|
717
|
+
});
|
|
718
|
+
var KbNodesQueryFiltersSchema = z.object({
|
|
719
|
+
query: z.string().optional(),
|
|
720
|
+
category: z.string().optional(),
|
|
721
|
+
tags: z.array(z.string()).optional(),
|
|
722
|
+
createdBy: z.number().optional()
|
|
723
|
+
});
|
|
724
|
+
var KbNodesRequestPayloadSchema = z.object({
|
|
725
|
+
operation: z.enum(["create", "update", "delete", "getAll", "getOne", "search", "getByCategory", "getByUser", "getCategories", "getTags"]),
|
|
726
|
+
data: z.object({
|
|
727
|
+
id: z.number().optional(),
|
|
728
|
+
title: z.string().optional(),
|
|
729
|
+
content: z.string().optional(),
|
|
730
|
+
category: z.string().optional(),
|
|
731
|
+
tags: z.array(z.string()).optional(),
|
|
732
|
+
createdBy: z.number().optional(),
|
|
733
|
+
updatedBy: z.number().optional(),
|
|
734
|
+
userId: z.number().optional(),
|
|
735
|
+
// Query/search operation fields
|
|
736
|
+
query: z.string().optional(),
|
|
737
|
+
filters: KbNodesQueryFiltersSchema.optional(),
|
|
738
|
+
limit: z.number().optional(),
|
|
739
|
+
offset: z.number().optional()
|
|
740
|
+
}).optional()
|
|
741
|
+
});
|
|
742
|
+
var KbNodesRequestMessageSchema = z.object({
|
|
743
|
+
id: z.string(),
|
|
744
|
+
type: z.literal("KB_NODES"),
|
|
745
|
+
from: MessageParticipantSchema,
|
|
746
|
+
to: MessageParticipantSchema.optional(),
|
|
747
|
+
payload: KbNodesRequestPayloadSchema
|
|
748
|
+
});
|
|
749
|
+
var KbNodesResponsePayloadSchema = z.object({
|
|
750
|
+
success: z.boolean(),
|
|
751
|
+
error: z.string().optional(),
|
|
752
|
+
data: z.object({
|
|
753
|
+
// Single node operations
|
|
754
|
+
id: z.number().optional(),
|
|
755
|
+
title: z.string().optional(),
|
|
756
|
+
content: z.string().optional(),
|
|
757
|
+
category: z.string().nullable().optional(),
|
|
758
|
+
tags: z.array(z.string()).nullable().optional(),
|
|
759
|
+
createdBy: z.number().optional(),
|
|
760
|
+
updatedBy: z.number().optional(),
|
|
761
|
+
createdAt: z.string().optional(),
|
|
762
|
+
updatedAt: z.string().optional(),
|
|
763
|
+
message: z.string().optional(),
|
|
764
|
+
// GetOne response
|
|
765
|
+
node: KbNodeDataSchema.optional(),
|
|
766
|
+
// List operations
|
|
767
|
+
nodes: z.array(KbNodeDataSchema).optional(),
|
|
768
|
+
count: z.number().optional(),
|
|
769
|
+
// getByCategory/getByUser
|
|
770
|
+
userId: z.number().optional(),
|
|
771
|
+
// getCategories
|
|
772
|
+
categories: z.array(z.string()).optional()
|
|
773
|
+
// getTags
|
|
774
|
+
}).optional()
|
|
775
|
+
});
|
|
776
|
+
var KbNodesResponseMessageSchema = z.object({
|
|
777
|
+
id: z.string(),
|
|
778
|
+
type: z.literal("KB_NODES_RES"),
|
|
779
|
+
from: MessageParticipantSchema,
|
|
780
|
+
to: MessageParticipantSchema.optional(),
|
|
781
|
+
payload: KbNodesResponsePayloadSchema
|
|
782
|
+
});
|
|
705
783
|
var ClientConfigSchema = z.object({
|
|
706
784
|
userId: z.string(),
|
|
707
785
|
projectId: z.string(),
|
|
@@ -726,23 +804,31 @@ __export(services_exports, {
|
|
|
726
804
|
UIElementSchema: () => UIElementSchema,
|
|
727
805
|
createBookmark: () => createBookmark,
|
|
728
806
|
createDashboard: () => createDashboard,
|
|
807
|
+
createKbNode: () => createKbNode,
|
|
729
808
|
createReport: () => createReport,
|
|
730
809
|
createUI: () => createUI,
|
|
731
810
|
createUser: () => createUser,
|
|
732
811
|
deleteBookmark: () => deleteBookmark,
|
|
733
812
|
deleteDashboard: () => deleteDashboard,
|
|
813
|
+
deleteKbNode: () => deleteKbNode,
|
|
734
814
|
deleteReport: () => deleteReport,
|
|
735
815
|
deleteUI: () => deleteUI,
|
|
736
816
|
deleteUser: () => deleteUser,
|
|
737
817
|
getActions: () => getActions,
|
|
738
818
|
getAllBookmarks: () => getAllBookmarks,
|
|
739
819
|
getAllDashboards: () => getAllDashboards,
|
|
820
|
+
getAllKbNodes: () => getAllKbNodes,
|
|
740
821
|
getAllReports: () => getAllReports,
|
|
741
822
|
getAllUIs: () => getAllUIs,
|
|
742
823
|
getAllUsers: () => getAllUsers,
|
|
743
824
|
getBookmark: () => getBookmark,
|
|
744
825
|
getComponentSuggestions: () => getComponentSuggestions,
|
|
745
826
|
getDashboard: () => getDashboard,
|
|
827
|
+
getKbNode: () => getKbNode,
|
|
828
|
+
getKbNodeCategories: () => getKbNodeCategories,
|
|
829
|
+
getKbNodeTags: () => getKbNodeTags,
|
|
830
|
+
getKbNodesByCategory: () => getKbNodesByCategory,
|
|
831
|
+
getKbNodesByUser: () => getKbNodesByUser,
|
|
746
832
|
getReport: () => getReport,
|
|
747
833
|
getUI: () => getUI,
|
|
748
834
|
getUser: () => getUser,
|
|
@@ -753,6 +839,7 @@ __export(services_exports, {
|
|
|
753
839
|
queryUsers: () => queryUsers,
|
|
754
840
|
requestBundle: () => requestBundle,
|
|
755
841
|
requestData: () => requestData,
|
|
842
|
+
searchKbNodes: () => searchKbNodes,
|
|
756
843
|
sendAuthLoginRequest: () => sendAuthLoginRequest,
|
|
757
844
|
sendAuthVerifyRequest: () => sendAuthVerifyRequest,
|
|
758
845
|
sendComponents: () => sendComponents,
|
|
@@ -760,6 +847,7 @@ __export(services_exports, {
|
|
|
760
847
|
sendUserPromptSuggestionsRequest: () => sendUserPromptSuggestionsRequest,
|
|
761
848
|
updateBookmark: () => updateBookmark,
|
|
762
849
|
updateDashboard: () => updateDashboard,
|
|
850
|
+
updateKbNode: () => updateKbNode,
|
|
763
851
|
updateReport: () => updateReport,
|
|
764
852
|
updateUI: () => updateUI,
|
|
765
853
|
updateUser: () => updateUser
|
|
@@ -876,7 +964,7 @@ async function requestBundle(client, options) {
|
|
|
876
964
|
type: "BUNDLE_REQ",
|
|
877
965
|
from: { type: client.type },
|
|
878
966
|
to: { type: "data-agent" },
|
|
879
|
-
payload: {}
|
|
967
|
+
payload: { devbundlereq: options?.devbundlereq ?? false }
|
|
880
968
|
});
|
|
881
969
|
const chunks = [];
|
|
882
970
|
let totalChunks = 0;
|
|
@@ -1007,7 +1095,7 @@ async function createUser(client, username, password, email, fullname, role, tim
|
|
|
1007
1095
|
role: payload.data?.role
|
|
1008
1096
|
};
|
|
1009
1097
|
}
|
|
1010
|
-
async function updateUser(client,
|
|
1098
|
+
async function updateUser(client, id, updates, timeout) {
|
|
1011
1099
|
const messageId = `users_update_${Date.now()}`;
|
|
1012
1100
|
const message = UsersRequestMessageSchema.parse({
|
|
1013
1101
|
id: messageId,
|
|
@@ -1017,7 +1105,7 @@ async function updateUser(client, username, updates, timeout) {
|
|
|
1017
1105
|
payload: {
|
|
1018
1106
|
operation: "update",
|
|
1019
1107
|
data: {
|
|
1020
|
-
|
|
1108
|
+
id,
|
|
1021
1109
|
...updates
|
|
1022
1110
|
}
|
|
1023
1111
|
}
|
|
@@ -1034,7 +1122,7 @@ async function updateUser(client, username, updates, timeout) {
|
|
|
1034
1122
|
role: payload.data?.role
|
|
1035
1123
|
};
|
|
1036
1124
|
}
|
|
1037
|
-
async function deleteUser(client,
|
|
1125
|
+
async function deleteUser(client, id, timeout) {
|
|
1038
1126
|
const messageId = `users_delete_${Date.now()}`;
|
|
1039
1127
|
const message = UsersRequestMessageSchema.parse({
|
|
1040
1128
|
id: messageId,
|
|
@@ -1044,7 +1132,7 @@ async function deleteUser(client, username, timeout) {
|
|
|
1044
1132
|
payload: {
|
|
1045
1133
|
operation: "delete",
|
|
1046
1134
|
data: {
|
|
1047
|
-
|
|
1135
|
+
id
|
|
1048
1136
|
}
|
|
1049
1137
|
}
|
|
1050
1138
|
});
|
|
@@ -1785,6 +1873,277 @@ async function queryUIs(client, options = {}, timeout) {
|
|
|
1785
1873
|
};
|
|
1786
1874
|
}
|
|
1787
1875
|
|
|
1876
|
+
// src/services/kb-nodes.ts
|
|
1877
|
+
async function createKbNode(client, title, content, createdBy, category, tags, timeout) {
|
|
1878
|
+
const messageId = `kb_nodes_create_${Date.now()}`;
|
|
1879
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
1880
|
+
id: messageId,
|
|
1881
|
+
type: "KB_NODES",
|
|
1882
|
+
from: { type: client.type },
|
|
1883
|
+
to: { type: "data-agent" },
|
|
1884
|
+
payload: {
|
|
1885
|
+
operation: "create",
|
|
1886
|
+
data: {
|
|
1887
|
+
title,
|
|
1888
|
+
content,
|
|
1889
|
+
createdBy,
|
|
1890
|
+
category,
|
|
1891
|
+
tags
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
1896
|
+
const payload = response.payload;
|
|
1897
|
+
return {
|
|
1898
|
+
success: payload.success,
|
|
1899
|
+
error: payload.error,
|
|
1900
|
+
message: payload.data?.message,
|
|
1901
|
+
node: payload.data ? {
|
|
1902
|
+
id: payload.data.id,
|
|
1903
|
+
title: payload.data.title || title,
|
|
1904
|
+
content: payload.data.content || content,
|
|
1905
|
+
category: payload.data.category,
|
|
1906
|
+
tags: payload.data.tags,
|
|
1907
|
+
createdBy: payload.data.createdBy || createdBy,
|
|
1908
|
+
updatedBy: payload.data.updatedBy,
|
|
1909
|
+
createdAt: payload.data.createdAt,
|
|
1910
|
+
updatedAt: payload.data.updatedAt
|
|
1911
|
+
} : void 0
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
async function updateKbNode(client, id, updatedBy, updates, timeout) {
|
|
1915
|
+
const messageId = `kb_nodes_update_${Date.now()}`;
|
|
1916
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
1917
|
+
id: messageId,
|
|
1918
|
+
type: "KB_NODES",
|
|
1919
|
+
from: { type: client.type },
|
|
1920
|
+
to: { type: "data-agent" },
|
|
1921
|
+
payload: {
|
|
1922
|
+
operation: "update",
|
|
1923
|
+
data: {
|
|
1924
|
+
id,
|
|
1925
|
+
updatedBy,
|
|
1926
|
+
...updates
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
});
|
|
1930
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
1931
|
+
const payload = response.payload;
|
|
1932
|
+
return {
|
|
1933
|
+
success: payload.success,
|
|
1934
|
+
error: payload.error,
|
|
1935
|
+
message: payload.data?.message,
|
|
1936
|
+
node: payload.data ? {
|
|
1937
|
+
id: payload.data.id,
|
|
1938
|
+
title: payload.data.title || "",
|
|
1939
|
+
content: payload.data.content || "",
|
|
1940
|
+
category: payload.data.category,
|
|
1941
|
+
tags: payload.data.tags,
|
|
1942
|
+
createdBy: payload.data.createdBy || 0,
|
|
1943
|
+
updatedBy: payload.data.updatedBy,
|
|
1944
|
+
createdAt: payload.data.createdAt,
|
|
1945
|
+
updatedAt: payload.data.updatedAt
|
|
1946
|
+
} : void 0
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
async function deleteKbNode(client, id, timeout) {
|
|
1950
|
+
const messageId = `kb_nodes_delete_${Date.now()}`;
|
|
1951
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
1952
|
+
id: messageId,
|
|
1953
|
+
type: "KB_NODES",
|
|
1954
|
+
from: { type: client.type },
|
|
1955
|
+
to: { type: "data-agent" },
|
|
1956
|
+
payload: {
|
|
1957
|
+
operation: "delete",
|
|
1958
|
+
data: {
|
|
1959
|
+
id
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
});
|
|
1963
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
1964
|
+
const payload = response.payload;
|
|
1965
|
+
return {
|
|
1966
|
+
success: payload.success,
|
|
1967
|
+
error: payload.error,
|
|
1968
|
+
message: payload.data?.message
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
async function getAllKbNodes(client, limit, offset, timeout) {
|
|
1972
|
+
const messageId = `kb_nodes_getall_${Date.now()}`;
|
|
1973
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
1974
|
+
id: messageId,
|
|
1975
|
+
type: "KB_NODES",
|
|
1976
|
+
from: { type: client.type },
|
|
1977
|
+
to: { type: "data-agent" },
|
|
1978
|
+
payload: {
|
|
1979
|
+
operation: "getAll",
|
|
1980
|
+
data: {
|
|
1981
|
+
limit,
|
|
1982
|
+
offset
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
});
|
|
1986
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
1987
|
+
const payload = response.payload;
|
|
1988
|
+
return {
|
|
1989
|
+
success: payload.success,
|
|
1990
|
+
error: payload.error,
|
|
1991
|
+
nodes: payload.data?.nodes,
|
|
1992
|
+
count: payload.data?.count,
|
|
1993
|
+
message: payload.data?.message
|
|
1994
|
+
};
|
|
1995
|
+
}
|
|
1996
|
+
async function getKbNode(client, id, timeout) {
|
|
1997
|
+
const messageId = `kb_nodes_getone_${Date.now()}`;
|
|
1998
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
1999
|
+
id: messageId,
|
|
2000
|
+
type: "KB_NODES",
|
|
2001
|
+
from: { type: client.type },
|
|
2002
|
+
to: { type: "data-agent" },
|
|
2003
|
+
payload: {
|
|
2004
|
+
operation: "getOne",
|
|
2005
|
+
data: {
|
|
2006
|
+
id
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
2011
|
+
const payload = response.payload;
|
|
2012
|
+
return {
|
|
2013
|
+
success: payload.success,
|
|
2014
|
+
error: payload.error,
|
|
2015
|
+
node: payload.data?.node,
|
|
2016
|
+
message: payload.data?.message
|
|
2017
|
+
};
|
|
2018
|
+
}
|
|
2019
|
+
async function searchKbNodes(client, options = {}, timeout) {
|
|
2020
|
+
const { query, category, tags, createdBy, limit, offset } = options;
|
|
2021
|
+
const messageId = `kb_nodes_search_${Date.now()}`;
|
|
2022
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
2023
|
+
id: messageId,
|
|
2024
|
+
type: "KB_NODES",
|
|
2025
|
+
from: { type: client.type },
|
|
2026
|
+
to: { type: "data-agent" },
|
|
2027
|
+
payload: {
|
|
2028
|
+
operation: "search",
|
|
2029
|
+
data: {
|
|
2030
|
+
query,
|
|
2031
|
+
category,
|
|
2032
|
+
tags,
|
|
2033
|
+
createdBy,
|
|
2034
|
+
limit,
|
|
2035
|
+
offset
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
});
|
|
2039
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
2040
|
+
const payload = response.payload;
|
|
2041
|
+
return {
|
|
2042
|
+
success: payload.success,
|
|
2043
|
+
error: payload.error,
|
|
2044
|
+
nodes: payload.data?.nodes,
|
|
2045
|
+
count: payload.data?.count,
|
|
2046
|
+
message: payload.data?.message
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
async function getKbNodesByCategory(client, category, limit, offset, timeout) {
|
|
2050
|
+
const messageId = `kb_nodes_getbycategory_${Date.now()}`;
|
|
2051
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
2052
|
+
id: messageId,
|
|
2053
|
+
type: "KB_NODES",
|
|
2054
|
+
from: { type: client.type },
|
|
2055
|
+
to: { type: "data-agent" },
|
|
2056
|
+
payload: {
|
|
2057
|
+
operation: "getByCategory",
|
|
2058
|
+
data: {
|
|
2059
|
+
category,
|
|
2060
|
+
limit,
|
|
2061
|
+
offset
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
2066
|
+
const payload = response.payload;
|
|
2067
|
+
return {
|
|
2068
|
+
success: payload.success,
|
|
2069
|
+
error: payload.error,
|
|
2070
|
+
nodes: payload.data?.nodes,
|
|
2071
|
+
count: payload.data?.count,
|
|
2072
|
+
category: payload.data?.category || category,
|
|
2073
|
+
message: payload.data?.message
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
async function getKbNodesByUser(client, userId, limit, offset, timeout) {
|
|
2077
|
+
const messageId = `kb_nodes_getbyuser_${Date.now()}`;
|
|
2078
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
2079
|
+
id: messageId,
|
|
2080
|
+
type: "KB_NODES",
|
|
2081
|
+
from: { type: client.type },
|
|
2082
|
+
to: { type: "data-agent" },
|
|
2083
|
+
payload: {
|
|
2084
|
+
operation: "getByUser",
|
|
2085
|
+
data: {
|
|
2086
|
+
userId,
|
|
2087
|
+
limit,
|
|
2088
|
+
offset
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
});
|
|
2092
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
2093
|
+
const payload = response.payload;
|
|
2094
|
+
return {
|
|
2095
|
+
success: payload.success,
|
|
2096
|
+
error: payload.error,
|
|
2097
|
+
nodes: payload.data?.nodes,
|
|
2098
|
+
count: payload.data?.count,
|
|
2099
|
+
userId: payload.data?.userId || userId,
|
|
2100
|
+
message: payload.data?.message
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
async function getKbNodeCategories(client, timeout) {
|
|
2104
|
+
const messageId = `kb_nodes_getcategories_${Date.now()}`;
|
|
2105
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
2106
|
+
id: messageId,
|
|
2107
|
+
type: "KB_NODES",
|
|
2108
|
+
from: { type: client.type },
|
|
2109
|
+
to: { type: "data-agent" },
|
|
2110
|
+
payload: {
|
|
2111
|
+
operation: "getCategories"
|
|
2112
|
+
}
|
|
2113
|
+
});
|
|
2114
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
2115
|
+
const payload = response.payload;
|
|
2116
|
+
return {
|
|
2117
|
+
success: payload.success,
|
|
2118
|
+
error: payload.error,
|
|
2119
|
+
categories: payload.data?.categories,
|
|
2120
|
+
count: payload.data?.count,
|
|
2121
|
+
message: payload.data?.message
|
|
2122
|
+
};
|
|
2123
|
+
}
|
|
2124
|
+
async function getKbNodeTags(client, timeout) {
|
|
2125
|
+
const messageId = `kb_nodes_gettags_${Date.now()}`;
|
|
2126
|
+
const message = KbNodesRequestMessageSchema.parse({
|
|
2127
|
+
id: messageId,
|
|
2128
|
+
type: "KB_NODES",
|
|
2129
|
+
from: { type: client.type },
|
|
2130
|
+
to: { type: "data-agent" },
|
|
2131
|
+
payload: {
|
|
2132
|
+
operation: "getTags"
|
|
2133
|
+
}
|
|
2134
|
+
});
|
|
2135
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
2136
|
+
const payload = response.payload;
|
|
2137
|
+
const responseData = payload.data;
|
|
2138
|
+
return {
|
|
2139
|
+
success: payload.success,
|
|
2140
|
+
error: payload.error,
|
|
2141
|
+
tags: responseData?.tags,
|
|
2142
|
+
count: payload.data?.count,
|
|
2143
|
+
message: payload.data?.message
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
|
|
1788
2147
|
// src/client.ts
|
|
1789
2148
|
var SuperatomClient = class {
|
|
1790
2149
|
constructor(config) {
|
|
@@ -2134,17 +2493,17 @@ var SuperatomClient = class {
|
|
|
2134
2493
|
* Update an existing user
|
|
2135
2494
|
* Delegates to users service
|
|
2136
2495
|
*/
|
|
2137
|
-
async updateUser(
|
|
2138
|
-
this.log("info", "Updating user:",
|
|
2139
|
-
return updateUser(this,
|
|
2496
|
+
async updateUser(id, updates, timeout) {
|
|
2497
|
+
this.log("info", "Updating user:", id);
|
|
2498
|
+
return updateUser(this, id, updates, timeout);
|
|
2140
2499
|
}
|
|
2141
2500
|
/**
|
|
2142
2501
|
* Delete a user
|
|
2143
2502
|
* Delegates to users service
|
|
2144
2503
|
*/
|
|
2145
|
-
async deleteUser(
|
|
2146
|
-
this.log("info", "Deleting user:",
|
|
2147
|
-
return deleteUser(this,
|
|
2504
|
+
async deleteUser(id, timeout) {
|
|
2505
|
+
this.log("info", "Deleting user:", id);
|
|
2506
|
+
return deleteUser(this, id, timeout);
|
|
2148
2507
|
}
|
|
2149
2508
|
/**
|
|
2150
2509
|
* Get all users
|
|
@@ -2370,6 +2729,88 @@ var SuperatomClient = class {
|
|
|
2370
2729
|
this.log("info", "Querying UIs with filters:", options?.filters);
|
|
2371
2730
|
return queryUIs(this, options, timeout);
|
|
2372
2731
|
}
|
|
2732
|
+
// ==================== KB Nodes (Knowledge Base) Management Methods ====================
|
|
2733
|
+
// These methods delegate to kb-nodes service for knowledge base CRUD operations
|
|
2734
|
+
/**
|
|
2735
|
+
* Create a new knowledge base node
|
|
2736
|
+
* Delegates to kb-nodes service
|
|
2737
|
+
*/
|
|
2738
|
+
async createKbNode(title, content, createdBy, category, tags, timeout) {
|
|
2739
|
+
this.log("info", "Creating KB node:", title);
|
|
2740
|
+
return createKbNode(this, title, content, createdBy, category, tags, timeout);
|
|
2741
|
+
}
|
|
2742
|
+
/**
|
|
2743
|
+
* Update an existing knowledge base node
|
|
2744
|
+
* Delegates to kb-nodes service
|
|
2745
|
+
*/
|
|
2746
|
+
async updateKbNode(id, updatedBy, updates, timeout) {
|
|
2747
|
+
this.log("info", "Updating KB node:", id);
|
|
2748
|
+
return updateKbNode(this, id, updatedBy, updates, timeout);
|
|
2749
|
+
}
|
|
2750
|
+
/**
|
|
2751
|
+
* Delete a knowledge base node
|
|
2752
|
+
* Delegates to kb-nodes service
|
|
2753
|
+
*/
|
|
2754
|
+
async deleteKbNode(id, timeout) {
|
|
2755
|
+
this.log("info", "Deleting KB node:", id);
|
|
2756
|
+
return deleteKbNode(this, id, timeout);
|
|
2757
|
+
}
|
|
2758
|
+
/**
|
|
2759
|
+
* Get all knowledge base nodes
|
|
2760
|
+
* Delegates to kb-nodes service
|
|
2761
|
+
*/
|
|
2762
|
+
async getAllKbNodes(limit, offset, timeout) {
|
|
2763
|
+
this.log("info", "Fetching all KB nodes");
|
|
2764
|
+
return getAllKbNodes(this, limit, offset, timeout);
|
|
2765
|
+
}
|
|
2766
|
+
/**
|
|
2767
|
+
* Get a specific knowledge base node by ID
|
|
2768
|
+
* Delegates to kb-nodes service
|
|
2769
|
+
*/
|
|
2770
|
+
async getKbNode(id, timeout) {
|
|
2771
|
+
this.log("info", "Fetching KB node:", id);
|
|
2772
|
+
return getKbNode(this, id, timeout);
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* Search knowledge base nodes with full-text search and filters
|
|
2776
|
+
* Delegates to kb-nodes service
|
|
2777
|
+
*/
|
|
2778
|
+
async searchKbNodes(options = {}, timeout) {
|
|
2779
|
+
this.log("info", "Searching KB nodes with query:", options.query);
|
|
2780
|
+
return searchKbNodes(this, options, timeout);
|
|
2781
|
+
}
|
|
2782
|
+
/**
|
|
2783
|
+
* Get knowledge base nodes by category
|
|
2784
|
+
* Delegates to kb-nodes service
|
|
2785
|
+
*/
|
|
2786
|
+
async getKbNodesByCategory(category, limit, offset, timeout) {
|
|
2787
|
+
this.log("info", "Fetching KB nodes by category:", category);
|
|
2788
|
+
return getKbNodesByCategory(this, category, limit, offset, timeout);
|
|
2789
|
+
}
|
|
2790
|
+
/**
|
|
2791
|
+
* Get knowledge base nodes by user (creator)
|
|
2792
|
+
* Delegates to kb-nodes service
|
|
2793
|
+
*/
|
|
2794
|
+
async getKbNodesByUser(userId, limit, offset, timeout) {
|
|
2795
|
+
this.log("info", "Fetching KB nodes by user:", userId);
|
|
2796
|
+
return getKbNodesByUser(this, userId, limit, offset, timeout);
|
|
2797
|
+
}
|
|
2798
|
+
/**
|
|
2799
|
+
* Get all unique categories from knowledge base nodes
|
|
2800
|
+
* Delegates to kb-nodes service
|
|
2801
|
+
*/
|
|
2802
|
+
async getKbNodeCategories(timeout) {
|
|
2803
|
+
this.log("info", "Fetching KB node categories");
|
|
2804
|
+
return getKbNodeCategories(this, timeout);
|
|
2805
|
+
}
|
|
2806
|
+
/**
|
|
2807
|
+
* Get all unique tags from knowledge base nodes
|
|
2808
|
+
* Delegates to kb-nodes service
|
|
2809
|
+
*/
|
|
2810
|
+
async getKbNodeTags(timeout) {
|
|
2811
|
+
this.log("info", "Fetching KB node tags");
|
|
2812
|
+
return getKbNodeTags(this, timeout);
|
|
2813
|
+
}
|
|
2373
2814
|
/**
|
|
2374
2815
|
* Internal logging
|
|
2375
2816
|
*/
|
|
@@ -2415,6 +2856,6 @@ function hasComponents() {
|
|
|
2415
2856
|
// src/index.ts
|
|
2416
2857
|
var SDK_VERSION = "0.1.0";
|
|
2417
2858
|
|
|
2418
|
-
export { ActionsRequestMessageSchema, ActionsRequestPayloadSchema, ActionsResponseMessageSchema, ActionsResponsePayloadSchema, AuthLoginPayloadSchema, AuthLoginRequestMessageSchema, AuthLoginResponseMessageSchema, AuthLoginResponsePayloadSchema, AuthVerifyPayloadSchema, AuthVerifyRequestMessageSchema, AuthVerifyResponseMessageSchema, AuthVerifyResponsePayloadSchema, BundleChunkMessageSchema, BundleChunkPayloadSchema, BundleErrorMessageSchema, BundleErrorPayloadSchema, BundleRequestMessageSchema, BundleRequestPayloadSchema, ClientConfigSchema, ComponentSchema, ComponentsSendMessageSchema, ComponentsSendPayloadSchema, DataRequestMessageSchema, DataRequestPayloadSchema, DataResponseMessageSchema, DataResponsePayloadSchema, MessageParticipantSchema, MessageSchema, SDK_VERSION, SuperatomClient, UILogEntrySchema, UILogsMessageSchema, UILogsPayloadSchema, UserPromptRequestMessageSchema, UserPromptRequestPayloadSchema, UserPromptResponseMessageSchema, UserPromptResponsePayloadSchema, UserPromptSuggestionsRequestMessageSchema, UserPromptSuggestionsRequestPayloadSchema, UserPromptSuggestionsResponseMessageSchema, UserPromptSuggestionsResponsePayloadSchema, getComponent, getComponents, hasComponents, services_exports as services, setup };
|
|
2859
|
+
export { ActionsRequestMessageSchema, ActionsRequestPayloadSchema, ActionsResponseMessageSchema, ActionsResponsePayloadSchema, AuthLoginPayloadSchema, AuthLoginRequestMessageSchema, AuthLoginResponseMessageSchema, AuthLoginResponsePayloadSchema, AuthVerifyPayloadSchema, AuthVerifyRequestMessageSchema, AuthVerifyResponseMessageSchema, AuthVerifyResponsePayloadSchema, BundleChunkMessageSchema, BundleChunkPayloadSchema, BundleErrorMessageSchema, BundleErrorPayloadSchema, BundleRequestMessageSchema, BundleRequestPayloadSchema, ClientConfigSchema, ComponentSchema, ComponentsSendMessageSchema, ComponentsSendPayloadSchema, DataRequestMessageSchema, DataRequestPayloadSchema, DataResponseMessageSchema, DataResponsePayloadSchema, KbNodeDataSchema, KbNodesQueryFiltersSchema, KbNodesRequestMessageSchema, KbNodesRequestPayloadSchema, KbNodesResponseMessageSchema, KbNodesResponsePayloadSchema, MessageParticipantSchema, MessageSchema, SDK_VERSION, SuperatomClient, UILogEntrySchema, UILogsMessageSchema, UILogsPayloadSchema, UserPromptRequestMessageSchema, UserPromptRequestPayloadSchema, UserPromptResponseMessageSchema, UserPromptResponsePayloadSchema, UserPromptSuggestionsRequestMessageSchema, UserPromptSuggestionsRequestPayloadSchema, UserPromptSuggestionsResponseMessageSchema, UserPromptSuggestionsResponsePayloadSchema, getComponent, getComponents, hasComponents, services_exports as services, setup };
|
|
2419
2860
|
//# sourceMappingURL=index.js.map
|
|
2420
2861
|
//# sourceMappingURL=index.js.map
|