@dremio/js-sdk 0.46.0 → 0.47.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/dist/cloud/ai/AIResource.d.ts +68 -13
- package/dist/cloud/ai/AIResource.js +2 -1
- package/dist/cloud/ai/AIResource.js.map +1 -1
- package/dist/cloud/users/CloudUser.js +1 -1
- package/dist/cloud/users/CloudUser.js.map +1 -1
- package/dist/cloud/users/User.d.ts +3 -3
- package/dist/cloud/users/User.js +2 -2
- package/dist/cloud/users/User.js.map +1 -1
- package/dist/cloud/users/UsersResource.d.ts +33 -19
- package/dist/cloud/users/UsersResource.js +86 -24
- package/dist/cloud/users/UsersResource.js.map +1 -1
- package/dist/cloud/users/userPropertiesCodec.d.ts +19 -29
- package/dist/cloud/users/userPropertiesCodec.js +23 -23
- package/dist/cloud/users/userPropertiesCodec.js.map +1 -1
- package/dist/enterprise/ai/AIResource.d.ts +68 -22
- package/dist/enterprise/ai/AIResource.js +2 -2
- package/dist/enterprise/ai/AIResource.js.map +1 -1
- package/dist/enterprise/ai/conversations/AgentConversation.js +1 -1
- package/dist/enterprise/ai/conversations/AgentConversation.js.map +1 -1
- package/dist/enterprise/ai/conversations/createConversationMachine.d.ts +60 -7
- package/dist/enterprise/ai/conversations/methods/createConversation.d.ts +10 -2
- package/dist/enterprise/ai/conversations/methods/createConversation.js +1 -2
- package/dist/enterprise/ai/conversations/methods/createConversation.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/listConversations.d.ts +6 -3
- package/dist/enterprise/ai/conversations/methods/listConversations.js +6 -8
- package/dist/enterprise/ai/conversations/methods/listConversations.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/retrieveConversation.d.ts +2 -4
- package/dist/enterprise/ai/conversations/methods/retrieveConversation.js +2 -10
- package/dist/enterprise/ai/conversations/methods/retrieveConversation.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.d.ts +4 -0
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.js +4 -0
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.js.map +1 -1
- package/dist-iife/cloud.js +1257 -11586
- package/dist-iife/enterprise.js +4400 -14727
- package/package.json +1 -1
|
@@ -16,20 +16,18 @@
|
|
|
16
16
|
import * as z from "zod/mini";
|
|
17
17
|
import { AgentConversation } from "../AgentConversation.js";
|
|
18
18
|
import { conversationPropertiesCodec, } from "../conversationPropertiesCodec.js";
|
|
19
|
-
import {
|
|
19
|
+
import { safeParseResultToResult } from "../../../../common/safeParseResultToResult.js";
|
|
20
20
|
export const listConversations = (config) => function listConversations(params, { signal } = {}) {
|
|
21
21
|
return config
|
|
22
22
|
.sonarV4Request(`agent/conversations?${new URLSearchParams({ maxResults: String(params.maxResults) }).toString()}`, { signal })
|
|
23
23
|
.map((res) => res.json())
|
|
24
24
|
.map((response) => ({
|
|
25
25
|
...response,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return Ok(new AgentConversation(config, decodeResult.data));
|
|
32
|
-
}),
|
|
26
|
+
/**
|
|
27
|
+
* Safe parse individual list items so that the consumer has the option to still display and of the
|
|
28
|
+
* conversations that parsed successfully, while ignoring others that failed to parse.
|
|
29
|
+
*/
|
|
30
|
+
data: response.data.map((entity) => safeParseResultToResult(z.safeDecode(conversationPropertiesCodec, entity)).map((properties) => new AgentConversation(config, properties))),
|
|
33
31
|
}));
|
|
34
32
|
};
|
|
35
33
|
//# sourceMappingURL=listConversations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listConversations.js","sourceRoot":"","sources":["../../../../../src/enterprise/ai/conversations/methods/listConversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAG9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,2BAA2B,GAE5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"listConversations.js","sourceRoot":"","sources":["../../../../../src/enterprise/ai/conversations/methods/listConversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAG9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,2BAA2B,GAE5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAExF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAqB,EAAE,EAAE,CACzD,SAAS,iBAAiB,CAAC,MAA8B,EAAE,EAAE,MAAM,KAAkB,EAAE;IACrF,OAAO,MAAM;SACV,cAAc,CACb,uBAAuB,IAAI,eAAe,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,EAClG,EAAE,MAAM,EAAE,CACX;SACA,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAA6C,CAAC;SACnE,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClB,GAAG,QAAQ;QACX;;;WAGG;QACH,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACjC,uBAAuB,CAAC,CAAC,CAAC,UAAU,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAC5E,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC,CAC1D,CACF;KACF,CAAC,CAAC,CAAC;AACR,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\nimport type { SonarV4Config } from \"../../../../common/Config.ts\";\nimport type { SignalParam } from \"../../../../common/Params.ts\";\nimport { AgentConversation } from \"../AgentConversation.ts\";\nimport {\n conversationPropertiesCodec,\n type ConversationEntity,\n} from \"../conversationPropertiesCodec.ts\";\nimport { safeParseResultToResult } from \"../../../../common/safeParseResultToResult.ts\";\n\nexport const listConversations = (config: SonarV4Config) =>\n function listConversations(params: { maxResults: number }, { signal }: SignalParam = {}) {\n return config\n .sonarV4Request(\n `agent/conversations?${new URLSearchParams({ maxResults: String(params.maxResults) }).toString()}`,\n { signal },\n )\n .map((res) => res.json() as Promise<{ data: ConversationEntity[] }>)\n .map((response) => ({\n ...response,\n /**\n * Safe parse individual list items so that the consumer has the option to still display and of the\n * conversations that parsed successfully, while ignoring others that failed to parse.\n */\n data: response.data.map((entity) =>\n safeParseResultToResult(z.safeDecode(conversationPropertiesCodec, entity)).map(\n (properties) => new AgentConversation(config, properties),\n ),\n ),\n }));\n };\n"]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
1
|
import type { SonarV4Config } from "../../../../common/Config.ts";
|
|
3
2
|
import type { SignalParam } from "../../../../common/Params.ts";
|
|
4
|
-
|
|
5
|
-
export declare const retrieveConversation: (config: SonarV4Config) => (id: string, { signal }?: SignalParam) => import("ts-results-es").AsyncResult<AgentConversation, import("../../../index.ts").HttpError | z.ZodError<{
|
|
3
|
+
export declare const retrieveConversation: (config: SonarV4Config) => (id: string, { signal }?: SignalParam) => import("ts-results-es").AsyncResult<{
|
|
6
4
|
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
7
5
|
currentRunId: string | null;
|
|
8
6
|
id: string;
|
|
@@ -11,4 +9,4 @@ export declare const retrieveConversation: (config: SonarV4Config) => (id: strin
|
|
|
11
9
|
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
12
10
|
tag: string;
|
|
13
11
|
title: string | null;
|
|
14
|
-
}
|
|
12
|
+
}, import("../../../index.ts").HttpError>;
|
|
@@ -13,10 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import z from "zod";
|
|
16
|
+
import * as z from "zod/mini";
|
|
17
17
|
import { conversationPropertiesCodec } from "../conversationPropertiesCodec.js";
|
|
18
|
-
import { Err, Ok } from "ts-results-es";
|
|
19
|
-
import { AgentConversation } from "../AgentConversation.js";
|
|
20
18
|
export const retrieveConversation = (config) => function retrieveConversation(id, { signal } = {}) {
|
|
21
19
|
return config
|
|
22
20
|
.sonarV4Request(`agent/conversations/${id}`, {
|
|
@@ -26,12 +24,6 @@ export const retrieveConversation = (config) => function retrieveConversation(id
|
|
|
26
24
|
signal,
|
|
27
25
|
})
|
|
28
26
|
.map((res) => res.json())
|
|
29
|
-
.
|
|
30
|
-
const decodeResult = z.safeDecode(conversationPropertiesCodec, entity);
|
|
31
|
-
if (!decodeResult.success) {
|
|
32
|
-
return Err(decodeResult.error);
|
|
33
|
-
}
|
|
34
|
-
return Ok(new AgentConversation(config, decodeResult.data));
|
|
35
|
-
});
|
|
27
|
+
.map((entity) => z.decode(conversationPropertiesCodec, entity));
|
|
36
28
|
};
|
|
37
29
|
//# sourceMappingURL=retrieveConversation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieveConversation.js","sourceRoot":"","sources":["../../../../../src/enterprise/ai/conversations/methods/retrieveConversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"retrieveConversation.js","sourceRoot":"","sources":["../../../../../src/enterprise/ai/conversations/methods/retrieveConversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAG9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAqB,EAAE,EAAE,CAC5D,SAAS,oBAAoB,CAAC,EAAU,EAAE,EAAE,MAAM,KAAkB,EAAE;IACpE,OAAO,MAAM;SACV,cAAc,CAAC,uBAAuB,EAAE,EAAE,EAAE;QAC3C,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;SAC3B;QACD,MAAM;KACP,CAAC;SACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAA0D,CAAC;SAChF,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\nimport type { SonarV4Config } from \"../../../../common/Config.ts\";\nimport type { SignalParam } from \"../../../../common/Params.ts\";\nimport { conversationPropertiesCodec } from \"../conversationPropertiesCodec.ts\";\n\nexport const retrieveConversation = (config: SonarV4Config) =>\n function retrieveConversation(id: string, { signal }: SignalParam = {}) {\n return config\n .sonarV4Request(`agent/conversations/${id}`, {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map((res) => res.json() as Promise<z.input<typeof conversationPropertiesCodec>>)\n .map((entity) => z.decode(conversationPropertiesCodec, entity));\n };\n"]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { SonarV4Config } from "../../../../common/Config.ts";
|
|
2
2
|
import type { SignalParam } from "../../../../common/Params.ts";
|
|
3
3
|
export declare const retrieveConversationHistory: (config: SonarV4Config) => (id: string, { signal }?: SignalParam) => import("ts-results-es").AsyncResult<{
|
|
4
|
+
/**
|
|
5
|
+
* Intentionally throw when parsing chat events (rather than using safeDecode)
|
|
6
|
+
* because the chat history may fail to reconstruct without one of these items.
|
|
7
|
+
*/
|
|
4
8
|
data: ({
|
|
5
9
|
conversationId: string;
|
|
6
10
|
modelName: string;
|
|
@@ -26,6 +26,10 @@ export const retrieveConversationHistory = (config) => function retrieveConversa
|
|
|
26
26
|
.map((res) => res.json())
|
|
27
27
|
.map((response) => ({
|
|
28
28
|
...response,
|
|
29
|
+
/**
|
|
30
|
+
* Intentionally throw when parsing chat events (rather than using safeDecode)
|
|
31
|
+
* because the chat history may fail to reconstruct without one of these items.
|
|
32
|
+
*/
|
|
29
33
|
data: response.data.map((chatEvent) => z.decode(chatEventCodec, chatEvent)),
|
|
30
34
|
}));
|
|
31
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieveConversationHistory.js","sourceRoot":"","sources":["../../../../../src/enterprise/ai/conversations/methods/retrieveConversationHistory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAqB,EAAE,EAAE,CACnE,SAAS,2BAA2B,CAAC,EAAU,EAAE,EAAE,MAAM,KAAkB,EAAE;IAC3E,OAAO,MAAM;SACV,cAAc,CAAC,uBAAuB,EAAE,WAAW,EAAE;QACpD,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;SAC3B;QACD,MAAM;KACP,CAAC;SACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAyD,CAAC;SAC/E,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClB,GAAG,QAAQ;QACX,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;KAC5E,CAAC,CAAC,CAAC;AACR,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SonarV4Config } from \"../../../../common/Config.ts\";\nimport type { SignalParam } from \"../../../../common/Params.ts\";\nimport { chatEventCodec } from \"../../chat/chatEventSchema.
|
|
1
|
+
{"version":3,"file":"retrieveConversationHistory.js","sourceRoot":"","sources":["../../../../../src/enterprise/ai/conversations/methods/retrieveConversationHistory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAqB,EAAE,EAAE,CACnE,SAAS,2BAA2B,CAAC,EAAU,EAAE,EAAE,MAAM,KAAkB,EAAE;IAC3E,OAAO,MAAM;SACV,cAAc,CAAC,uBAAuB,EAAE,WAAW,EAAE;QACpD,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;SAC3B;QACD,MAAM;KACP,CAAC;SACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAyD,CAAC;SAC/E,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClB,GAAG,QAAQ;QACX;;;WAGG;QACH,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;KAC5E,CAAC,CAAC,CAAC;AACR,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SonarV4Config } from \"../../../../common/Config.ts\";\nimport type { SignalParam } from \"../../../../common/Params.ts\";\nimport { chatEventCodec } from \"../../chat/chatEventSchema.ts\";\nimport * as z from \"zod/mini\";\n\nexport const retrieveConversationHistory = (config: SonarV4Config) =>\n function retrieveConversationHistory(id: string, { signal }: SignalParam = {}) {\n return config\n .sonarV4Request(`agent/conversations/${id}/messages`, {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map((res) => res.json() as Promise<{ data: z.input<typeof chatEventCodec>[] }>)\n .map((response) => ({\n ...response,\n /**\n * Intentionally throw when parsing chat events (rather than using safeDecode)\n * because the chat history may fail to reconstruct without one of these items.\n */\n data: response.data.map((chatEvent) => z.decode(chatEventCodec, chatEvent)),\n }));\n };\n"]}
|