@dremio/js-sdk 0.31.6 → 0.32.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.
Files changed (113) hide show
  1. package/dist/cloud/Dremio.d.ts +3 -2
  2. package/dist/cloud/Dremio.js +2 -2
  3. package/dist/cloud/Dremio.js.map +1 -1
  4. package/dist/cloud/ai/AIResource.d.ts +125 -0
  5. package/dist/cloud/ai/AIResource.js +113 -0
  6. package/dist/cloud/ai/AIResource.js.map +1 -0
  7. package/dist/cloud/ai/DremioModelProvider.d.ts +12 -0
  8. package/dist/cloud/ai/DremioModelProvider.js +49 -0
  9. package/dist/cloud/ai/DremioModelProvider.js.map +1 -0
  10. package/dist/cloud/ai/index.d.ts +4 -0
  11. package/dist/cloud/ai/index.js +20 -0
  12. package/dist/cloud/ai/index.js.map +1 -0
  13. package/dist/cloud/ai/modelProviderCodec.d.ts +180 -0
  14. package/dist/cloud/ai/modelProviderCodec.js +54 -0
  15. package/dist/cloud/ai/modelProviderCodec.js.map +1 -0
  16. package/dist/cloud/catalog/EnterpriseCatalogResource.d.ts +10 -3
  17. package/dist/cloud/catalog/EnterpriseCatalogResource.js +38 -0
  18. package/dist/cloud/catalog/EnterpriseCatalogResource.js.map +1 -1
  19. package/dist/cloud/catalog/FileUpload.d.ts +117 -0
  20. package/dist/cloud/catalog/FileUpload.js +103 -0
  21. package/dist/cloud/catalog/FileUpload.js.map +1 -0
  22. package/dist/cloud/getResourceConfig.d.ts +1 -0
  23. package/dist/cloud/getResourceConfig.js +3 -0
  24. package/dist/cloud/getResourceConfig.js.map +1 -1
  25. package/dist/cloud/interfaces.d.ts +3 -1
  26. package/dist/cloud/interfaces.js +3 -1
  27. package/dist/cloud/interfaces.js.map +1 -1
  28. package/dist/cloud/organizations/Organization.d.ts +10 -0
  29. package/dist/cloud/organizations/Organization.js +12 -0
  30. package/dist/cloud/organizations/Organization.js.map +1 -1
  31. package/dist/cloud/projects/Project.d.ts +1 -0
  32. package/dist/cloud/projects/Project.js +2 -0
  33. package/dist/cloud/projects/Project.js.map +1 -1
  34. package/dist/cloud/projects/projectPropertiesCodec.d.ts +6 -0
  35. package/dist/cloud/projects/projectPropertiesCodec.js +1 -0
  36. package/dist/cloud/projects/projectPropertiesCodec.js.map +1 -1
  37. package/dist/cloud/replaceOriginResource.js +6 -1
  38. package/dist/cloud/replaceOriginResource.js.map +1 -1
  39. package/dist/common/Config.d.ts +14 -0
  40. package/dist/common/Config.js.map +1 -1
  41. package/dist/common/createRequest.d.ts +1 -0
  42. package/dist/common/createRequest.js +1 -1
  43. package/dist/common/createRequest.js.map +1 -1
  44. package/dist/common/createXHR.d.ts +2 -0
  45. package/dist/common/createXHR.js +58 -0
  46. package/dist/common/createXHR.js.map +1 -0
  47. package/dist/enterprise/Dremio.d.ts +3 -1
  48. package/dist/enterprise/Dremio.js +3 -0
  49. package/dist/enterprise/Dremio.js.map +1 -1
  50. package/dist/enterprise/ai/AIResource.d.ts +118 -0
  51. package/dist/enterprise/ai/AIResource.js +123 -0
  52. package/dist/enterprise/ai/AIResource.js.map +1 -0
  53. package/dist/enterprise/ai/ModelProvider.d.ts +181 -0
  54. package/dist/enterprise/ai/ModelProvider.js +87 -0
  55. package/dist/enterprise/ai/ModelProvider.js.map +1 -0
  56. package/dist/enterprise/ai/chat/AgentChatPartialResponse.d.ts +42 -0
  57. package/dist/enterprise/ai/chat/AgentChatPartialResponse.js +65 -0
  58. package/dist/enterprise/ai/chat/AgentChatPartialResponse.js.map +1 -0
  59. package/dist/enterprise/ai/chat/AgentChatResponse.d.ts +87 -0
  60. package/dist/enterprise/ai/chat/AgentChatResponse.js +138 -0
  61. package/dist/enterprise/ai/chat/AgentChatResponse.js.map +1 -0
  62. package/dist/enterprise/ai/chat/AgentErrorResponseContent.d.ts +4 -0
  63. package/dist/enterprise/ai/chat/AgentErrorResponseContent.js +22 -0
  64. package/dist/enterprise/ai/chat/AgentErrorResponseContent.js.map +1 -0
  65. package/dist/enterprise/ai/chat/AgentModelResponseContent.d.ts +6 -0
  66. package/dist/enterprise/ai/chat/AgentModelResponseContent.js +24 -0
  67. package/dist/enterprise/ai/chat/AgentModelResponseContent.js.map +1 -0
  68. package/dist/enterprise/ai/chat/AgentToolRequestResponseContent.d.ts +9 -0
  69. package/dist/enterprise/ai/chat/AgentToolRequestResponseContent.js +35 -0
  70. package/dist/enterprise/ai/chat/AgentToolRequestResponseContent.js.map +1 -0
  71. package/dist/enterprise/ai/chat/AgentToolResultResponseContent.d.ts +8 -0
  72. package/dist/enterprise/ai/chat/AgentToolResultResponseContent.js +31 -0
  73. package/dist/enterprise/ai/chat/AgentToolResultResponseContent.js.map +1 -0
  74. package/dist/enterprise/ai/chat/ChatSession.d.ts +32 -0
  75. package/dist/enterprise/ai/chat/ChatSession.js +77 -0
  76. package/dist/enterprise/ai/chat/ChatSession.js.map +1 -0
  77. package/dist/enterprise/ai/chat/UserChatMessage.d.ts +30 -0
  78. package/dist/enterprise/ai/chat/UserChatMessage.js +68 -0
  79. package/dist/enterprise/ai/chat/UserChatMessage.js.map +1 -0
  80. package/dist/enterprise/ai/chat/UserChatMessageContent.d.ts +19 -0
  81. package/dist/enterprise/ai/chat/UserChatMessageContent.js +44 -0
  82. package/dist/enterprise/ai/chat/UserChatMessageContent.js.map +1 -0
  83. package/dist/enterprise/ai/chat/chatEventSchema.d.ts +35 -0
  84. package/dist/enterprise/ai/chat/chatEventSchema.js +52 -0
  85. package/dist/enterprise/ai/chat/chatEventSchema.js.map +1 -0
  86. package/dist/enterprise/ai/chat/index.d.ts +9 -0
  87. package/dist/enterprise/ai/chat/index.js +25 -0
  88. package/dist/enterprise/ai/chat/index.js.map +1 -0
  89. package/dist/enterprise/ai/index.d.ts +3 -0
  90. package/dist/enterprise/ai/index.js +19 -0
  91. package/dist/enterprise/ai/index.js.map +1 -0
  92. package/dist/enterprise/ai/modelProviderCodec.d.ts +465 -0
  93. package/dist/enterprise/ai/modelProviderCodec.js +154 -0
  94. package/dist/enterprise/ai/modelProviderCodec.js.map +1 -0
  95. package/dist/enterprise/ai/modelProviderConfigSchemas.d.ts +296 -0
  96. package/dist/enterprise/ai/modelProviderConfigSchemas.js +159 -0
  97. package/dist/enterprise/ai/modelProviderConfigSchemas.js.map +1 -0
  98. package/dist/enterprise/interfaces.d.ts +1 -0
  99. package/dist/enterprise/interfaces.js +1 -0
  100. package/dist/enterprise/interfaces.js.map +1 -1
  101. package/dist/enterprise/users/EnterpriseUsersResource.d.ts +7 -0
  102. package/dist/enterprise/users/EnterpriseUsersResource.js +31 -0
  103. package/dist/enterprise/users/EnterpriseUsersResource.js.map +1 -1
  104. package/dist/enterprise/users/ServiceUser.d.ts +85 -0
  105. package/dist/enterprise/users/ServiceUser.js +79 -0
  106. package/dist/enterprise/users/ServiceUser.js.map +1 -0
  107. package/dist/enterprise/users/serviceUserOauthCredentialsCodec.d.ts +43 -0
  108. package/dist/enterprise/users/serviceUserOauthCredentialsCodec.js +110 -0
  109. package/dist/enterprise/users/serviceUserOauthCredentialsCodec.js.map +1 -0
  110. package/package.json +5 -2
  111. package/dist/cloud/ai/AiResource.d.ts +0 -12
  112. package/dist/cloud/ai/AiResource.js +0 -52
  113. package/dist/cloud/ai/AiResource.js.map +0 -1
@@ -3,7 +3,6 @@ import { EnterpriseCatalogResource } from "./catalog/EnterpriseCatalogResource.j
3
3
  import { RolesResource } from "../enterprise/roles/RolesResource.js";
4
4
  import { EnterpriseScriptsResource } from "../enterprise/scripts/EnterpriseScriptsResource.js";
5
5
  import { SqlResource } from "../oss/sql/SqlResource.js";
6
- import { AiResource } from "./ai/AiResource.ts";
7
6
  import { ArcticResource } from "./arctic/ArcticResource.js";
8
7
  import { EnginesResource } from "./engines/EnginesResource.js";
9
8
  import { OrganizationsResource } from "./organizations/OrganizationsResource.js";
@@ -14,9 +13,10 @@ import { OAuthApplicationsResource } from "./oauth/OAuthApplicationsResource.ts"
14
13
  import { CloudsResource } from "./clouds/CloudsResource.js";
15
14
  import { UsersResource } from "./users/UsersResource.js";
16
15
  import { EngineRulesResource } from "./engineRules/EngineRulesResource.ts";
16
+ import { AIResource } from "../enterprise/ai/AIResource.js";
17
17
  export declare class Dremio {
18
18
  #private;
19
- readonly ai: AiResource;
19
+ readonly ai: (projectId?: string) => AIResource;
20
20
  readonly arctic: (projectId: string) => ArcticResource;
21
21
  readonly catalog: (projectId: string) => EnterpriseCatalogResource;
22
22
  readonly clouds: CloudsResource;
@@ -53,5 +53,6 @@ export declare class Dremio {
53
53
  v3URL: (path: string) => URL;
54
54
  v4Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
55
55
  v4URL: (path: string) => URL;
56
+ xhr: (method: string, input: string, headers?: Record<string, string>, body?: XMLHttpRequestBodyInit, modifyXHR?: (xhr: XMLHttpRequest) => void) => import("ts-results-es").AsyncResult<XMLHttpRequest, unknown>;
56
57
  };
57
58
  }
@@ -18,7 +18,6 @@ import { EnterpriseCatalogResource } from "./catalog/EnterpriseCatalogResource.j
18
18
  import { RolesResource } from "../enterprise/roles/RolesResource.js";
19
19
  import { EnterpriseScriptsResource } from "../enterprise/scripts/EnterpriseScriptsResource.js";
20
20
  import { SqlResource } from "../oss/sql/SqlResource.js";
21
- import { AiResource } from "./ai/AiResource.js";
22
21
  import { ArcticResource } from "./arctic/ArcticResource.js";
23
22
  import { EnginesResource } from "./engines/EnginesResource.js";
24
23
  import { getResourceConfig } from "./getResourceConfig.js";
@@ -30,6 +29,7 @@ import { OAuthApplicationsResource } from "./oauth/OAuthApplicationsResource.js"
30
29
  import { CloudsResource } from "./clouds/CloudsResource.js";
31
30
  import { UsersResource } from "./users/UsersResource.js";
32
31
  import { EngineRulesResource } from "./engineRules/EngineRulesResource.js";
32
+ import { AIResource } from "../enterprise/ai/AIResource.js";
33
33
  export class Dremio {
34
34
  ai;
35
35
  arctic;
@@ -49,7 +49,7 @@ export class Dremio {
49
49
  #resourceConfig;
50
50
  constructor(config) {
51
51
  this.#resourceConfig = getResourceConfig(config);
52
- this.ai = new AiResource(this.#resourceConfig());
52
+ this.ai = (projectId) => new AIResource(this.#resourceConfig(projectId));
53
53
  this.arctic = moize.default((projectId) => new ArcticResource(this.#resourceConfig(projectId)));
54
54
  this.catalog = moize.default((projectId) => new EnterpriseCatalogResource(this.#resourceConfig(projectId)));
55
55
  this.clouds = new CloudsResource(this.#resourceConfig());
@@ -1 +1 @@
1
- {"version":3,"file":"Dremio.js","sourceRoot":"","sources":["../../src/cloud/Dremio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,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yright (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 moize from \"moize\";\nimport type { Config } from \"../common/Config.ts\";\nimport { EnterpriseCatalogResource } from \"./catalog/EnterpriseCatalogResource.js\";\nimport { RolesResource } from \"../enterprise/roles/RolesResource.js\";\nimport { EnterpriseScriptsResource } from \"../enterprise/scripts/EnterpriseScriptsResource.js\";\nimport { SqlResource } from \"../oss/sql/SqlResource.js\";\nimport { AiResource } from \"./ai/AiResource.ts\";\nimport { ArcticResource } from \"./arctic/ArcticResource.js\";\nimport { EnginesResource } from \"./engines/EnginesResource.js\";\nimport { getResourceConfig } from \"./getResourceConfig.ts\";\nimport { OrganizationsResource } from \"./organizations/OrganizationsResource.js\";\nimport { ProjectsResource } from \"./projects/ProjectsResource.js\";\nimport { CloudUsersResource } from \"./users/CloudUsersResource.js\";\nimport { JobsResource } from \"../oss/jobs/JobsResource.ts\";\nimport { OAuthApplicationsResource } from \"./oauth/OAuthApplicationsResource.ts\";\nimport { CloudsResource } from \"./clouds/CloudsResource.js\";\nimport { UsersResource } from \"./users/UsersResource.js\";\nimport { EngineRulesResource } from \"./engineRules/EngineRulesResource.ts\";\n\nexport class Dremio {\n readonly ai: AiResource;\n readonly arctic: (projectId: string) => ArcticResource;\n readonly catalog: (projectId: string) => EnterpriseCatalogResource;\n readonly clouds: CloudsResource;\n readonly engines: (projectId: string) => EnginesResource;\n readonly engineRules: (projectId: string) => EngineRulesResource;\n readonly jobs: (projectId: string) => JobsResource;\n readonly oauthApplications: OAuthApplicationsResource;\n readonly organizations: OrganizationsResource;\n readonly projects: ProjectsResource;\n readonly roles: (projectId: string) => RolesResource;\n readonly scripts: (projectId: string) => EnterpriseScriptsResource;\n readonly sql: (projectId: string) => SqlResource;\n readonly _users: UsersResource;\n readonly users: (projectId: string) => CloudUsersResource;\n readonly #resourceConfig: ReturnType<typeof getResourceConfig>;\n\n constructor(config: Config) {\n this.#resourceConfig = getResourceConfig(config);\n this.ai = new AiResource(this.#resourceConfig());\n this.arctic = moize.default(\n (projectId: string) => new ArcticResource(this.#resourceConfig(projectId)),\n );\n this.catalog = moize.default(\n (projectId: string) => new EnterpriseCatalogResource(this.#resourceConfig(projectId)),\n );\n this.clouds = new CloudsResource(this.#resourceConfig());\n this.engines = moize.default(\n (projectId: string) => new EnginesResource(this.#resourceConfig(projectId)),\n );\n this.engineRules = moize.default(\n (projectId: string) => new EngineRulesResource(this.#resourceConfig(projectId)),\n );\n this.jobs = moize.default(\n (projectId: string) => new JobsResource(this.#resourceConfig(projectId)),\n );\n this.oauthApplications = new OAuthApplicationsResource(this.#resourceConfig());\n this.organizations = new OrganizationsResource(this.#resourceConfig());\n this.projects = new ProjectsResource(this.#resourceConfig());\n this.roles = moize.default(\n (projectId: string) => new RolesResource(this.#resourceConfig(projectId)),\n );\n this.scripts = moize.default(\n (projectId: string) => new EnterpriseScriptsResource(this.#resourceConfig(projectId)),\n );\n this.sql = moize.default(\n (projectId: string) => new SqlResource(this.#resourceConfig(projectId)),\n );\n this._users = new UsersResource(this.#resourceConfig());\n this.users = moize.default(\n (projectId: string) => new CloudUsersResource(this.#resourceConfig(projectId)),\n );\n }\n\n get _resourceConfig() {\n return this.#resourceConfig;\n }\n}\n"]}
1
+ {"version":3,"file":"Dremio.js","sourceRoot":"","sources":["../../src/cloud/Dremio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,sC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GAAG,KAAK,CAAC,OAAO,CACxB,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAC1E,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAC1B,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CACtF,CAAC;QACF,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,CACtB,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CACxE,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CACxB,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAC/E,CAAC;IACJ,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;CACF","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 moize from \"moize\";\nimport type { Config } from \"../common/Config.ts\";\nimport { EnterpriseCatalogResource } from \"./catalog/EnterpriseCatalogResource.js\";\nimport { RolesResource } from \"../enterprise/roles/RolesResource.js\";\nimport { EnterpriseScriptsResource } from \"../enterprise/scripts/EnterpriseScriptsResource.js\";\nimport { SqlResource } from \"../oss/sql/SqlResource.js\";\nimport { ArcticResource } from \"./arctic/ArcticResource.js\";\nimport { EnginesResource } from \"./engines/EnginesResource.js\";\nimport { getResourceConfig } from \"./getResourceConfig.js\";\nimport { OrganizationsResource } from \"./organizations/OrganizationsResource.js\";\nimport { ProjectsResource } from \"./projects/ProjectsResource.js\";\nimport { CloudUsersResource } from \"./users/CloudUsersResource.js\";\nimport { JobsResource } from \"../oss/jobs/JobsResource.ts\";\nimport { OAuthApplicationsResource } from \"./oauth/OAuthApplicationsResource.ts\";\nimport { CloudsResource } from \"./clouds/CloudsResource.js\";\nimport { UsersResource } from \"./users/UsersResource.js\";\nimport { EngineRulesResource } from \"./engineRules/EngineRulesResource.ts\";\nimport { AIResource } from \"../enterprise/ai/AIResource.js\";\n\nexport class Dremio {\n readonly ai: (projectId?: string) => AIResource;\n readonly arctic: (projectId: string) => ArcticResource;\n readonly catalog: (projectId: string) => EnterpriseCatalogResource;\n readonly clouds: CloudsResource;\n readonly engines: (projectId: string) => EnginesResource;\n readonly engineRules: (projectId: string) => EngineRulesResource;\n readonly jobs: (projectId: string) => JobsResource;\n readonly oauthApplications: OAuthApplicationsResource;\n readonly organizations: OrganizationsResource;\n readonly projects: ProjectsResource;\n readonly roles: (projectId: string) => RolesResource;\n readonly scripts: (projectId: string) => EnterpriseScriptsResource;\n readonly sql: (projectId: string) => SqlResource;\n readonly _users: UsersResource;\n readonly users: (projectId: string) => CloudUsersResource;\n readonly #resourceConfig: ReturnType<typeof getResourceConfig>;\n\n constructor(config: Config) {\n this.#resourceConfig = getResourceConfig(config);\n this.ai = (projectId) => new AIResource(this.#resourceConfig(projectId));\n this.arctic = moize.default(\n (projectId: string) => new ArcticResource(this.#resourceConfig(projectId)),\n );\n this.catalog = moize.default(\n (projectId: string) => new EnterpriseCatalogResource(this.#resourceConfig(projectId)),\n );\n this.clouds = new CloudsResource(this.#resourceConfig());\n this.engines = moize.default(\n (projectId: string) => new EnginesResource(this.#resourceConfig(projectId)),\n );\n this.engineRules = moize.default(\n (projectId: string) => new EngineRulesResource(this.#resourceConfig(projectId)),\n );\n this.jobs = moize.default(\n (projectId: string) => new JobsResource(this.#resourceConfig(projectId)),\n );\n this.oauthApplications = new OAuthApplicationsResource(this.#resourceConfig());\n this.organizations = new OrganizationsResource(this.#resourceConfig());\n this.projects = new ProjectsResource(this.#resourceConfig());\n this.roles = moize.default(\n (projectId: string) => new RolesResource(this.#resourceConfig(projectId)),\n );\n this.scripts = moize.default(\n (projectId: string) => new EnterpriseScriptsResource(this.#resourceConfig(projectId)),\n );\n this.sql = moize.default(\n (projectId: string) => new SqlResource(this.#resourceConfig(projectId)),\n );\n this._users = new UsersResource(this.#resourceConfig());\n this.users = moize.default(\n (projectId: string) => new CloudUsersResource(this.#resourceConfig(projectId)),\n );\n }\n\n get _resourceConfig() {\n return this.#resourceConfig;\n }\n}\n"]}
@@ -0,0 +1,125 @@
1
+ import { ChatSession } from "../../enterprise/ai/chat/ChatSession.ts";
2
+ import type { UserChatMessage } from "../../enterprise/ai/chat/UserChatMessage.ts";
3
+ import { AgentChatResponse } from "../../enterprise/ai/chat/AgentChatResponse.ts";
4
+ import type { Logger, SonarV4Config, V4Config } from "../../common/Config.ts";
5
+ import { ModelProvider } from "../../enterprise/ai/ModelProvider.ts";
6
+ import * as z from "zod/mini";
7
+ import { modelProviderCreateCodec } from "./modelProviderCodec.js";
8
+ import { DremioModelProvider } from "./DremioModelProvider.ts";
9
+ export declare class AIResource {
10
+ #private;
11
+ constructor(config: Logger & V4Config & SonarV4Config);
12
+ createModelProvider(properties: z.output<typeof modelProviderCreateCodec>): import("ts-results-es").AsyncResult<ModelProvider, import("../index.ts").HttpError | z.core.$ZodError<{
13
+ name: string;
14
+ id: string;
15
+ tag: string;
16
+ createdBy: string;
17
+ modifiedBy: string;
18
+ config: {
19
+ amazonBedrock: {
20
+ auth: {
21
+ role: {
22
+ roleArn: string;
23
+ };
24
+ } | {
25
+ accessKey: {
26
+ accessKeyId: string;
27
+ };
28
+ };
29
+ region: "ap-east-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-south-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-3" | "ap-southeast-4" | "ap-southeast-5" | "ap-southeast-7" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-south-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "il-central-1" | "me-central-1" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-gov-east-1" | "us-gov-west-1" | "us-west-1" | "us-west-2";
30
+ };
31
+ } | {
32
+ anthropic: Record<string, never>;
33
+ } | {
34
+ azureOpenAi: {
35
+ auth: {
36
+ clientSecretAuth: {
37
+ azureClientId: string;
38
+ azureTenantId: string;
39
+ };
40
+ };
41
+ resourceName: string;
42
+ };
43
+ } | {
44
+ googleGemini: Record<string, never>;
45
+ } | {
46
+ openAi: {
47
+ organizationId: string;
48
+ };
49
+ };
50
+ defaultModelName: string;
51
+ isDefault: boolean;
52
+ createdAt: import("temporal-polyfill").Temporal.Instant;
53
+ modifiedAt: import("temporal-polyfill").Temporal.Instant;
54
+ sqlModelNames: Set<string>;
55
+ } | {
56
+ config: {
57
+ dremioProvided: Record<string, never>;
58
+ };
59
+ id: string;
60
+ isDefault: boolean;
61
+ name: string;
62
+ }> | undefined>;
63
+ listModelProviders(): {
64
+ data(): AsyncGenerator<ModelProvider | DremioModelProvider, void, unknown>;
65
+ getPage: () => import("ts-results-es").AsyncResult<{
66
+ data: (ModelProvider | DremioModelProvider)[];
67
+ }, import("../index.ts").HttpError>;
68
+ };
69
+ retrieveModelProvider(id: string): import("ts-results-es").AsyncResult<ModelProvider | DremioModelProvider, import("../index.ts").HttpError | z.core.$ZodError<{
70
+ name: string;
71
+ id: string;
72
+ tag: string;
73
+ createdBy: string;
74
+ modifiedBy: string;
75
+ config: {
76
+ amazonBedrock: {
77
+ auth: {
78
+ role: {
79
+ roleArn: string;
80
+ };
81
+ } | {
82
+ accessKey: {
83
+ accessKeyId: string;
84
+ };
85
+ };
86
+ region: "ap-east-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-south-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-3" | "ap-southeast-4" | "ap-southeast-5" | "ap-southeast-7" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-south-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "il-central-1" | "me-central-1" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-gov-east-1" | "us-gov-west-1" | "us-west-1" | "us-west-2";
87
+ };
88
+ } | {
89
+ anthropic: Record<string, never>;
90
+ } | {
91
+ azureOpenAi: {
92
+ auth: {
93
+ clientSecretAuth: {
94
+ azureClientId: string;
95
+ azureTenantId: string;
96
+ };
97
+ };
98
+ resourceName: string;
99
+ };
100
+ } | {
101
+ googleGemini: Record<string, never>;
102
+ } | {
103
+ openAi: {
104
+ organizationId: string;
105
+ };
106
+ };
107
+ defaultModelName: string;
108
+ isDefault: boolean;
109
+ createdAt: import("temporal-polyfill").Temporal.Instant;
110
+ modifiedAt: import("temporal-polyfill").Temporal.Instant;
111
+ sqlModelNames: Set<string>;
112
+ } | {
113
+ config: {
114
+ dremioProvided: Record<string, never>;
115
+ };
116
+ id: string;
117
+ isDefault: boolean;
118
+ name: string;
119
+ }> | undefined>;
120
+ /**
121
+ * Sends a chat message to the Dremio AI Agent and returns an Observable containing
122
+ * Agent replies.
123
+ */
124
+ sendChatMessage(chatSession: ChatSession): (chatMessage: UserChatMessage) => import("rxjs").Observable<AgentChatResponse<import("../../enterprise/ai/chat/AgentChatResponse.ts").AgentResponseContent>>;
125
+ }
@@ -0,0 +1,113 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { map } from "rxjs";
17
+ import { ChatSession } from "../../enterprise/ai/chat/ChatSession.js";
18
+ import { AgentChatResponse } from "../../enterprise/ai/chat/AgentChatResponse.js";
19
+ import { fromTextEventStream } from "../../common/fromTextEventStream.js";
20
+ import { ModelProvider } from "../../enterprise/ai/ModelProvider.js";
21
+ import * as z from "zod/mini";
22
+ import { dremioProvidedSchema, modelProviderCreateCodec, modelProviderRetrieveCodec, safeDecodeModelProvider, } from "./modelProviderCodec.js";
23
+ import { modelProviderRetrieveCodec as baseModelProviderRetrieveCodec } from "../../enterprise/ai/modelProviderCodec.js";
24
+ import { DremioModelProvider } from "./DremioModelProvider.js";
25
+ export class AIResource {
26
+ #config;
27
+ constructor(config) {
28
+ this.#config = config;
29
+ }
30
+ createModelProvider(properties) {
31
+ const body = z.encode(modelProviderCreateCodec, properties);
32
+ return this.#config
33
+ .v4Request(`model-provider/config`, {
34
+ body: JSON.stringify(body),
35
+ headers: {
36
+ Accept: "application/json",
37
+ "Content-Type": "application/json",
38
+ },
39
+ keepalive: true,
40
+ method: "POST",
41
+ })
42
+ .map((res) => res.json())
43
+ .andThen((entity) => safeDecodeModelProvider(this.#config, entity));
44
+ }
45
+ listModelProviders() {
46
+ const getPage = () => {
47
+ return this.#config
48
+ .v4Request("model-provider/config", {
49
+ headers: {
50
+ Accept: "application/json",
51
+ },
52
+ })
53
+ .map((res) => res.json())
54
+ .map((response) => ({
55
+ data: response.configs.reduce((accum, curr) => {
56
+ const parseResult = z.safeDecode(modelProviderRetrieveCodec, curr);
57
+ if (!parseResult.success) {
58
+ this.#config.logger?.error(new Error(`Failed to parse model provider`, { cause: parseResult.error }));
59
+ }
60
+ else {
61
+ if ("dremioProvided" in parseResult.data.config) {
62
+ accum.push(new DremioModelProvider(this.#config, parseResult.data));
63
+ }
64
+ accum.push(new ModelProvider(this.#config, parseResult.data));
65
+ }
66
+ return accum;
67
+ }, []),
68
+ }));
69
+ };
70
+ return {
71
+ async *data() {
72
+ yield* (await getPage().promise).map((response) => response.data).unwrap();
73
+ },
74
+ getPage,
75
+ };
76
+ }
77
+ retrieveModelProvider(id) {
78
+ return this.#config
79
+ .v4Request(`model-provider/config/${id}`, {
80
+ headers: {
81
+ Accept: "application/json",
82
+ },
83
+ })
84
+ .map((res) => res.json())
85
+ .andThen((entity) => safeDecodeModelProvider(this.#config, entity));
86
+ }
87
+ /**
88
+ * Sends a chat message to the Dremio AI Agent and returns an Observable containing
89
+ * Agent replies.
90
+ */
91
+ sendChatMessage(chatSession) {
92
+ return (chatMessage) => fromTextEventStream(({ signal }) => this.#config
93
+ .sonarV4Request("agent", {
94
+ body: JSON.stringify({
95
+ message: chatMessage.toString(),
96
+ sessionId: chatSession.sessionId,
97
+ }),
98
+ headers: {
99
+ Accept: "text/event-stream",
100
+ "Content-Type": "application/json",
101
+ },
102
+ method: "POST",
103
+ signal,
104
+ })
105
+ .promise.then((result) => {
106
+ if (result.isErr()) {
107
+ throw result.error;
108
+ }
109
+ return result.value;
110
+ })).pipe(map((event) => AgentChatResponse.fromJSON(JSON.parse(event.data))));
111
+ }
112
+ }
113
+ //# sourceMappingURL=AIResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIResource.js","sourceRoot":"","sources":["../../../src/cloud/ai/AIResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C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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 { map } from \"rxjs\";\nimport { ChatSession } from \"../../enterprise/ai/chat/ChatSession.ts\";\nimport type { UserChatMessage } from \"../../enterprise/ai/chat/UserChatMessage.ts\";\nimport { AgentChatResponse } from \"../../enterprise/ai/chat/AgentChatResponse.ts\";\nimport type { Logger, SonarV4Config, V4Config } from \"../../common/Config.ts\";\nimport { fromTextEventStream } from \"../../common/fromTextEventStream.ts\";\nimport { ModelProvider } from \"../../enterprise/ai/ModelProvider.ts\";\nimport * as z from \"zod/mini\";\nimport {\n dremioProvidedSchema,\n modelProviderCreateCodec,\n modelProviderRetrieveCodec,\n safeDecodeModelProvider,\n type SafeDecodeResultWithoutDremioLLM,\n} from \"./modelProviderCodec.js\";\nimport { modelProviderRetrieveCodec as baseModelProviderRetrieveCodec } from \"../../enterprise/ai/modelProviderCodec.ts\";\nimport { DremioModelProvider } from \"./DremioModelProvider.ts\";\n\nexport class AIResource {\n #config: Logger & V4Config & SonarV4Config;\n\n constructor(config: Logger & V4Config & SonarV4Config) {\n this.#config = config;\n }\n\n createModelProvider(properties: z.output<typeof modelProviderCreateCodec>) {\n const body = z.encode(modelProviderCreateCodec, properties);\n return this.#config\n .v4Request(`model-provider/config`, {\n body: JSON.stringify(body),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen(\n (entity) =>\n safeDecodeModelProvider(this.#config, entity) as SafeDecodeResultWithoutDremioLLM,\n );\n }\n\n listModelProviders() {\n const getPage = () => {\n return this.#config\n .v4Request(\"model-provider/config\", {\n headers: {\n Accept: \"application/json\",\n },\n })\n .map(\n (res) => res.json() as Promise<{ configs: z.input<typeof modelProviderRetrieveCodec>[] }>,\n )\n .map((response) => ({\n data: response.configs.reduce(\n (accum, curr) => {\n const parseResult = z.safeDecode(modelProviderRetrieveCodec, curr);\n if (!parseResult.success) {\n this.#config.logger?.error(\n new Error(`Failed to parse model provider`, { cause: parseResult.error }),\n );\n } else {\n if (\"dremioProvided\" in parseResult.data.config) {\n accum.push(\n new DremioModelProvider(\n this.#config,\n parseResult.data as z.infer<typeof dremioProvidedSchema>,\n ),\n );\n }\n\n accum.push(\n new ModelProvider(\n this.#config,\n parseResult.data as z.output<typeof baseModelProviderRetrieveCodec>,\n ),\n );\n }\n return accum;\n },\n [] as (DremioModelProvider | ModelProvider)[],\n ),\n }));\n };\n return {\n async *data() {\n yield* (await getPage().promise).map((response) => response.data).unwrap();\n },\n getPage,\n };\n }\n\n retrieveModelProvider(id: string) {\n return this.#config\n .v4Request(`model-provider/config/${id}`, {\n headers: {\n Accept: \"application/json\",\n },\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen((entity) => safeDecodeModelProvider(this.#config, entity));\n }\n\n /**\n * Sends a chat message to the Dremio AI Agent and returns an Observable containing\n * Agent replies.\n */\n sendChatMessage(chatSession: ChatSession) {\n return (chatMessage: UserChatMessage) =>\n fromTextEventStream(({ signal }) =>\n this.#config\n .sonarV4Request(\"agent\", {\n body: JSON.stringify({\n message: chatMessage.toString(),\n sessionId: chatSession.sessionId,\n } satisfies {\n message: string;\n modelProviderId?: string;\n sessionId?: string;\n }),\n headers: {\n Accept: \"text/event-stream\",\n \"Content-Type\": \"application/json\",\n },\n method: \"POST\",\n signal,\n })\n .promise.then((result) => {\n if (result.isErr()) {\n throw result.error;\n }\n return result.value;\n }),\n ).pipe(map((event) => AgentChatResponse.fromJSON(JSON.parse(event.data))));\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import * as z from "zod/mini";
2
+ import type { V4Config } from "../../common/Config.ts";
3
+ import { dremioProvidedSchema } from "./modelProviderCodec.js";
4
+ export declare class DremioModelProvider implements DremioModelProviderProperties {
5
+ #private;
6
+ id: DremioModelProviderProperties["id"];
7
+ isDefault: DremioModelProviderProperties["isDefault"];
8
+ constructor(config: V4Config, properties: DremioModelProviderProperties);
9
+ setDefault(): import("ts-results-es").AsyncResult<DremioModelProvider, import("../index.ts").HttpError>;
10
+ }
11
+ type DremioModelProviderProperties = Pick<z.infer<typeof dremioProvidedSchema>, "id" | "isDefault">;
12
+ export {};
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import * as z from "zod/mini";
17
+ import { dremioProvidedSchema } from "./modelProviderCodec.js";
18
+ export class DremioModelProvider {
19
+ id;
20
+ isDefault;
21
+ #config;
22
+ constructor(config, properties) {
23
+ this.id = properties.id;
24
+ this.isDefault = properties.isDefault;
25
+ this.#config = config;
26
+ }
27
+ setDefault() {
28
+ return this.#config
29
+ .v4Request(`model-provider/config/${this.id}`, {
30
+ body: JSON.stringify({
31
+ config: {
32
+ dremioProvided: {},
33
+ },
34
+ id: this.id,
35
+ isDefault: true,
36
+ name: "Dremio",
37
+ }),
38
+ headers: {
39
+ Accept: "application/json",
40
+ "Content-Type": "application/json",
41
+ },
42
+ keepalive: true,
43
+ method: "POST",
44
+ })
45
+ .map((res) => res.json())
46
+ .map((entity) => new DremioModelProvider(this.#config, z.parse(dremioProvidedSchema, entity)));
47
+ }
48
+ }
49
+ //# sourceMappingURL=DremioModelProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DremioModelProvider.js","sourceRoot":"","sources":["../../../src/cloud/ai/DremioModelProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,OAAO,mBAAmB;IAC9B,EAAE,CAAsC;IACxC,SAAS,CAA6C;IAEtD,OAAO,CAAW;IAElB,YAAY,MAAgB,EAAE,UAAyC;QACrE,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QAEtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,yBAAyB,IAAI,CAAC,EAAE,EAAE,EAAE;YAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,MAAM,EAAE;oBACN,cAAc,EAAE,EAAE;iBACnB;gBACD,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,SAAS,EAAE,IAAI;gBACf,IAAI,EAAE,QAAQ;aACf,CAAC;YACF,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACnC;YACD,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,MAAM;SACf,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAmD,CAAC;aACzE,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CACzF,CAAC;IACN,CAAC;CACF","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 { V4Config } from \"../../common/Config.ts\";\nimport { dremioProvidedSchema } from \"./modelProviderCodec.js\";\n\nexport class DremioModelProvider implements DremioModelProviderProperties {\n id: DremioModelProviderProperties[\"id\"];\n isDefault: DremioModelProviderProperties[\"isDefault\"];\n\n #config: V4Config;\n\n constructor(config: V4Config, properties: DremioModelProviderProperties) {\n this.id = properties.id;\n this.isDefault = properties.isDefault;\n\n this.#config = config;\n }\n\n setDefault() {\n return this.#config\n .v4Request(`model-provider/config/${this.id}`, {\n body: JSON.stringify({\n config: {\n dremioProvided: {},\n },\n id: this.id,\n isDefault: true,\n name: \"Dremio\",\n }),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json() as Promise<z.infer<typeof dremioProvidedSchema>>)\n .map(\n (entity) => new DremioModelProvider(this.#config, z.parse(dremioProvidedSchema, entity)),\n );\n }\n}\n\ntype DremioModelProviderProperties = Pick<z.infer<typeof dremioProvidedSchema>, \"id\" | \"isDefault\">;\n"]}
@@ -0,0 +1,4 @@
1
+ import { DremioModelProvider } from "./DremioModelProvider.ts";
2
+ import { ModelProvider } from "../../enterprise/ai/ModelProvider.ts";
3
+ export { ModelProvider, DremioModelProvider };
4
+ export * from "../../enterprise/ai/chat/index.ts";
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { DremioModelProvider } from "./DremioModelProvider.js";
17
+ import { ModelProvider } from "../../enterprise/ai/ModelProvider.js";
18
+ export { ModelProvider, DremioModelProvider };
19
+ export * from "../../enterprise/ai/chat/index.js";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cloud/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC;AAC9C,cAAc,mCAAmC,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 { DremioModelProvider } from \"./DremioModelProvider.ts\";\nimport { ModelProvider } from \"../../enterprise/ai/ModelProvider.ts\";\nexport { ModelProvider, DremioModelProvider };\nexport * from \"../../enterprise/ai/chat/index.ts\";\n"]}
@@ -0,0 +1,180 @@
1
+ import * as z from "zod/mini";
2
+ import { modelProviderCreateCodec, modelProviderUpdateCodec } from "../../enterprise/ai/modelProviderCodec.ts";
3
+ import { Result } from "ts-results-es";
4
+ import { DremioModelProvider } from "./DremioModelProvider.ts";
5
+ import type { V4Config } from "../../common/Config.ts";
6
+ import { ModelProvider } from "../interfaces.ts";
7
+ export { modelProviderCreateCodec, modelProviderUpdateCodec };
8
+ export declare const dremioProvidedSchema: z.ZodMiniObject<{
9
+ config: z.ZodMiniObject<{
10
+ dremioProvided: z.ZodMiniObject<Record<never, z.core.SomeType>, z.core.$strip>;
11
+ }, z.core.$strict>;
12
+ id: z.ZodMiniString<string>;
13
+ isDefault: z.ZodMiniBoolean<boolean>;
14
+ name: z.ZodMiniString<string>;
15
+ }, z.core.$strip>;
16
+ export declare const modelProviderRetrieveCodec: z.ZodMiniCodec<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
17
+ createdAt: z.ZodMiniString<string>;
18
+ createdBy: z.ZodMiniString<string>;
19
+ defaultModelName: z.ZodMiniString<string>;
20
+ id: z.ZodMiniString<string>;
21
+ isDefault: z.ZodMiniBoolean<boolean>;
22
+ modifiedAt: z.ZodMiniString<string>;
23
+ modifiedBy: z.ZodMiniString<string>;
24
+ name: z.ZodMiniString<string>;
25
+ sqlModelNames: z.ZodMiniArray<z.ZodMiniString<string>>;
26
+ tag: z.ZodMiniString<string>;
27
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
28
+ amazonBedrock: z.ZodMiniObject<{
29
+ auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
30
+ accessKey: z.ZodMiniObject<{
31
+ accessKeyId: z.ZodMiniString<string>;
32
+ }, z.core.$strict>;
33
+ }, z.core.$strict>, z.ZodMiniObject<{
34
+ role: z.ZodMiniObject<{
35
+ roleArn: z.ZodMiniString<string>;
36
+ }, z.core.$strict>;
37
+ }, z.core.$strict>]>;
38
+ region: z.ZodMiniEnum<{
39
+ "ap-east-2": "ap-east-2";
40
+ "ap-northeast-1": "ap-northeast-1";
41
+ "ap-northeast-2": "ap-northeast-2";
42
+ "ap-northeast-3": "ap-northeast-3";
43
+ "ap-south-1": "ap-south-1";
44
+ "ap-south-2": "ap-south-2";
45
+ "ap-southeast-1": "ap-southeast-1";
46
+ "ap-southeast-2": "ap-southeast-2";
47
+ "ap-southeast-3": "ap-southeast-3";
48
+ "ap-southeast-4": "ap-southeast-4";
49
+ "ap-southeast-5": "ap-southeast-5";
50
+ "ap-southeast-7": "ap-southeast-7";
51
+ "ca-central-1": "ca-central-1";
52
+ "eu-central-1": "eu-central-1";
53
+ "eu-central-2": "eu-central-2";
54
+ "eu-north-1": "eu-north-1";
55
+ "eu-south-1": "eu-south-1";
56
+ "eu-south-2": "eu-south-2";
57
+ "eu-west-1": "eu-west-1";
58
+ "eu-west-2": "eu-west-2";
59
+ "eu-west-3": "eu-west-3";
60
+ "il-central-1": "il-central-1";
61
+ "me-central-1": "me-central-1";
62
+ "sa-east-1": "sa-east-1";
63
+ "us-east-1": "us-east-1";
64
+ "us-east-2": "us-east-2";
65
+ "us-gov-east-1": "us-gov-east-1";
66
+ "us-gov-west-1": "us-gov-west-1";
67
+ "us-west-1": "us-west-1";
68
+ "us-west-2": "us-west-2";
69
+ }>;
70
+ }, z.core.$strict>;
71
+ }, z.core.$strict>, z.ZodMiniObject<{
72
+ anthropic: z.ZodMiniObject<{}, z.core.$strict>;
73
+ }, z.core.$strict>, z.ZodMiniObject<{
74
+ azureOpenAi: z.ZodMiniObject<{
75
+ auth: z.ZodMiniObject<{
76
+ clientSecretAuth: z.ZodMiniObject<{
77
+ azureClientId: z.ZodMiniString<string>;
78
+ azureTenantId: z.ZodMiniString<string>;
79
+ }, z.core.$strict>;
80
+ }, z.core.$strict>;
81
+ resourceName: z.ZodMiniString<string>;
82
+ }, z.core.$strict>;
83
+ }, z.core.$strict>, z.ZodMiniObject<{
84
+ googleGemini: z.ZodMiniObject<{}, z.core.$strict>;
85
+ }, z.core.$strict>, z.ZodMiniObject<{
86
+ openAi: z.ZodMiniObject<{
87
+ organizationId: z.ZodMiniString<string>;
88
+ }, z.core.$strict>;
89
+ }, z.core.$strict>]>;
90
+ }, z.core.$strip>, z.ZodMiniObject<{
91
+ config: z.ZodMiniObject<{
92
+ dremioProvided: z.ZodMiniObject<Record<never, z.core.SomeType>, z.core.$strip>;
93
+ }, z.core.$strict>;
94
+ id: z.ZodMiniString<string>;
95
+ isDefault: z.ZodMiniBoolean<boolean>;
96
+ name: z.ZodMiniString<string>;
97
+ }, z.core.$strip>]>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
98
+ name: z.ZodMiniString<string>;
99
+ id: z.ZodMiniString<string>;
100
+ tag: z.ZodMiniString<string>;
101
+ createdBy: z.ZodMiniString<string>;
102
+ modifiedBy: z.ZodMiniString<string>;
103
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
104
+ amazonBedrock: z.ZodMiniObject<{
105
+ auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
106
+ accessKey: z.ZodMiniObject<{
107
+ accessKeyId: z.ZodMiniString<string>;
108
+ }, z.core.$strict>;
109
+ }, z.core.$strict>, z.ZodMiniObject<{
110
+ role: z.ZodMiniObject<{
111
+ roleArn: z.ZodMiniString<string>;
112
+ }, z.core.$strict>;
113
+ }, z.core.$strict>]>;
114
+ region: z.ZodMiniEnum<{
115
+ "ap-east-2": "ap-east-2";
116
+ "ap-northeast-1": "ap-northeast-1";
117
+ "ap-northeast-2": "ap-northeast-2";
118
+ "ap-northeast-3": "ap-northeast-3";
119
+ "ap-south-1": "ap-south-1";
120
+ "ap-south-2": "ap-south-2";
121
+ "ap-southeast-1": "ap-southeast-1";
122
+ "ap-southeast-2": "ap-southeast-2";
123
+ "ap-southeast-3": "ap-southeast-3";
124
+ "ap-southeast-4": "ap-southeast-4";
125
+ "ap-southeast-5": "ap-southeast-5";
126
+ "ap-southeast-7": "ap-southeast-7";
127
+ "ca-central-1": "ca-central-1";
128
+ "eu-central-1": "eu-central-1";
129
+ "eu-central-2": "eu-central-2";
130
+ "eu-north-1": "eu-north-1";
131
+ "eu-south-1": "eu-south-1";
132
+ "eu-south-2": "eu-south-2";
133
+ "eu-west-1": "eu-west-1";
134
+ "eu-west-2": "eu-west-2";
135
+ "eu-west-3": "eu-west-3";
136
+ "il-central-1": "il-central-1";
137
+ "me-central-1": "me-central-1";
138
+ "sa-east-1": "sa-east-1";
139
+ "us-east-1": "us-east-1";
140
+ "us-east-2": "us-east-2";
141
+ "us-gov-east-1": "us-gov-east-1";
142
+ "us-gov-west-1": "us-gov-west-1";
143
+ "us-west-1": "us-west-1";
144
+ "us-west-2": "us-west-2";
145
+ }>;
146
+ }, z.core.$strict>;
147
+ }, z.core.$strict>, z.ZodMiniObject<{
148
+ anthropic: z.ZodMiniObject<{}, z.core.$strict>;
149
+ }, z.core.$strict>, z.ZodMiniObject<{
150
+ azureOpenAi: z.ZodMiniObject<{
151
+ auth: z.ZodMiniObject<{
152
+ clientSecretAuth: z.ZodMiniObject<{
153
+ azureClientId: z.ZodMiniString<string>;
154
+ azureTenantId: z.ZodMiniString<string>;
155
+ }, z.core.$strict>;
156
+ }, z.core.$strict>;
157
+ resourceName: z.ZodMiniString<string>;
158
+ }, z.core.$strict>;
159
+ }, z.core.$strict>, z.ZodMiniObject<{
160
+ googleGemini: z.ZodMiniObject<{}, z.core.$strict>;
161
+ }, z.core.$strict>, z.ZodMiniObject<{
162
+ openAi: z.ZodMiniObject<{
163
+ organizationId: z.ZodMiniString<string>;
164
+ }, z.core.$strict>;
165
+ }, z.core.$strict>]>;
166
+ defaultModelName: z.ZodMiniString<string>;
167
+ isDefault: z.ZodMiniBoolean<boolean>;
168
+ createdAt: z.ZodMiniCustom<import("temporal-polyfill").Temporal.Instant, import("temporal-polyfill").Temporal.Instant>;
169
+ modifiedAt: z.ZodMiniCustom<import("temporal-polyfill").Temporal.Instant, import("temporal-polyfill").Temporal.Instant>;
170
+ sqlModelNames: z.ZodMiniSet<z.ZodMiniString<string>>;
171
+ }, z.core.$strip>, z.ZodMiniObject<{
172
+ config: z.ZodMiniObject<{
173
+ dremioProvided: z.ZodMiniObject<Record<never, z.core.SomeType>, z.core.$strip>;
174
+ }, z.core.$strict>;
175
+ id: z.ZodMiniString<string>;
176
+ isDefault: z.ZodMiniBoolean<boolean>;
177
+ name: z.ZodMiniString<string>;
178
+ }, z.core.$strip>]>>;
179
+ export declare function safeDecodeModelProvider(config: V4Config, entity: z.input<typeof modelProviderRetrieveCodec>): Result<DremioModelProvider | ModelProvider, z.core.util.SafeParseResult<z.output<typeof modelProviderRetrieveCodec>>["error"]>;
180
+ export type SafeDecodeResultWithoutDremioLLM = Result<ModelProvider, z.core.util.SafeParseResult<z.output<typeof modelProviderRetrieveCodec>>["error"]>;