@dremio/js-sdk 0.31.8 → 0.33.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 (125) 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/eventWrappers/AgentChatExchange.d.ts +21 -0
  87. package/dist/enterprise/ai/chat/eventWrappers/AgentChatExchange.js +58 -0
  88. package/dist/enterprise/ai/chat/eventWrappers/AgentChatExchange.js.map +1 -0
  89. package/dist/enterprise/ai/chat/eventWrappers/AgentEndTurn.d.ts +42 -0
  90. package/dist/enterprise/ai/chat/eventWrappers/AgentEndTurn.js +56 -0
  91. package/dist/enterprise/ai/chat/eventWrappers/AgentEndTurn.js.map +1 -0
  92. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCall.d.ts +18 -0
  93. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCall.js +67 -0
  94. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCall.js.map +1 -0
  95. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCallGroup.d.ts +18 -0
  96. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCallGroup.js +54 -0
  97. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCallGroup.js.map +1 -0
  98. package/dist/enterprise/ai/chat/index.d.ts +9 -0
  99. package/dist/enterprise/ai/chat/index.js +25 -0
  100. package/dist/enterprise/ai/chat/index.js.map +1 -0
  101. package/dist/enterprise/ai/index.d.ts +3 -0
  102. package/dist/enterprise/ai/index.js +19 -0
  103. package/dist/enterprise/ai/index.js.map +1 -0
  104. package/dist/enterprise/ai/modelProviderCodec.d.ts +465 -0
  105. package/dist/enterprise/ai/modelProviderCodec.js +154 -0
  106. package/dist/enterprise/ai/modelProviderCodec.js.map +1 -0
  107. package/dist/enterprise/ai/modelProviderConfigSchemas.d.ts +296 -0
  108. package/dist/enterprise/ai/modelProviderConfigSchemas.js +159 -0
  109. package/dist/enterprise/ai/modelProviderConfigSchemas.js.map +1 -0
  110. package/dist/enterprise/interfaces.d.ts +1 -0
  111. package/dist/enterprise/interfaces.js +1 -0
  112. package/dist/enterprise/interfaces.js.map +1 -1
  113. package/dist/enterprise/users/EnterpriseUsersResource.d.ts +7 -0
  114. package/dist/enterprise/users/EnterpriseUsersResource.js +31 -0
  115. package/dist/enterprise/users/EnterpriseUsersResource.js.map +1 -1
  116. package/dist/enterprise/users/ServiceUser.d.ts +85 -0
  117. package/dist/enterprise/users/ServiceUser.js +79 -0
  118. package/dist/enterprise/users/ServiceUser.js.map +1 -0
  119. package/dist/enterprise/users/serviceUserOauthCredentialsCodec.d.ts +43 -0
  120. package/dist/enterprise/users/serviceUserOauthCredentialsCodec.js +110 -0
  121. package/dist/enterprise/users/serviceUserOauthCredentialsCodec.js.map +1 -0
  122. package/package.json +1 -1
  123. package/dist/cloud/ai/AiResource.d.ts +0 -12
  124. package/dist/cloud/ai/AiResource.js +0 -52
  125. package/dist/cloud/ai/AiResource.js.map +0 -1
@@ -0,0 +1,465 @@
1
+ import * as z from "zod/mini";
2
+ import { Temporal } from "temporal-polyfill";
3
+ export declare const modelProviderRetrieveCodec: z.ZodMiniCodec<z.ZodMiniObject<{
4
+ createdAt: z.ZodMiniString<string>;
5
+ createdBy: z.ZodMiniString<string>;
6
+ defaultModelName: z.ZodMiniString<string>;
7
+ id: z.ZodMiniString<string>;
8
+ isDefault: z.ZodMiniBoolean<boolean>;
9
+ modifiedAt: z.ZodMiniString<string>;
10
+ modifiedBy: z.ZodMiniString<string>;
11
+ name: z.ZodMiniString<string>;
12
+ sqlModelNames: z.ZodMiniArray<z.ZodMiniString<string>>;
13
+ tag: z.ZodMiniString<string>;
14
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
15
+ amazonBedrock: z.ZodMiniObject<{
16
+ auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
17
+ accessKey: z.ZodMiniObject<{
18
+ accessKeyId: z.ZodMiniString<string>;
19
+ }, z.core.$strict>;
20
+ }, z.core.$strict>, z.ZodMiniObject<{
21
+ role: z.ZodMiniObject<{
22
+ roleArn: z.ZodMiniString<string>;
23
+ }, z.core.$strict>;
24
+ }, z.core.$strict>]>;
25
+ region: z.ZodMiniEnum<{
26
+ "ap-east-2": "ap-east-2";
27
+ "ap-northeast-1": "ap-northeast-1";
28
+ "ap-northeast-2": "ap-northeast-2";
29
+ "ap-northeast-3": "ap-northeast-3";
30
+ "ap-south-1": "ap-south-1";
31
+ "ap-south-2": "ap-south-2";
32
+ "ap-southeast-1": "ap-southeast-1";
33
+ "ap-southeast-2": "ap-southeast-2";
34
+ "ap-southeast-3": "ap-southeast-3";
35
+ "ap-southeast-4": "ap-southeast-4";
36
+ "ap-southeast-5": "ap-southeast-5";
37
+ "ap-southeast-7": "ap-southeast-7";
38
+ "ca-central-1": "ca-central-1";
39
+ "eu-central-1": "eu-central-1";
40
+ "eu-central-2": "eu-central-2";
41
+ "eu-north-1": "eu-north-1";
42
+ "eu-south-1": "eu-south-1";
43
+ "eu-south-2": "eu-south-2";
44
+ "eu-west-1": "eu-west-1";
45
+ "eu-west-2": "eu-west-2";
46
+ "eu-west-3": "eu-west-3";
47
+ "il-central-1": "il-central-1";
48
+ "me-central-1": "me-central-1";
49
+ "sa-east-1": "sa-east-1";
50
+ "us-east-1": "us-east-1";
51
+ "us-east-2": "us-east-2";
52
+ "us-gov-east-1": "us-gov-east-1";
53
+ "us-gov-west-1": "us-gov-west-1";
54
+ "us-west-1": "us-west-1";
55
+ "us-west-2": "us-west-2";
56
+ }>;
57
+ }, z.core.$strict>;
58
+ }, z.core.$strict>, z.ZodMiniObject<{
59
+ anthropic: z.ZodMiniObject<{}, z.core.$strict>;
60
+ }, z.core.$strict>, z.ZodMiniObject<{
61
+ azureOpenAi: z.ZodMiniObject<{
62
+ auth: z.ZodMiniObject<{
63
+ clientSecretAuth: z.ZodMiniObject<{
64
+ azureClientId: z.ZodMiniString<string>;
65
+ azureTenantId: z.ZodMiniString<string>;
66
+ }, z.core.$strict>;
67
+ }, z.core.$strict>;
68
+ resourceName: z.ZodMiniString<string>;
69
+ }, z.core.$strict>;
70
+ }, z.core.$strict>, z.ZodMiniObject<{
71
+ googleGemini: z.ZodMiniObject<{}, z.core.$strict>;
72
+ }, z.core.$strict>, z.ZodMiniObject<{
73
+ openAi: z.ZodMiniObject<{
74
+ organizationId: z.ZodMiniString<string>;
75
+ }, z.core.$strict>;
76
+ }, z.core.$strict>]>;
77
+ }, z.core.$strip>, z.ZodMiniObject<{
78
+ name: z.ZodMiniString<string>;
79
+ id: z.ZodMiniString<string>;
80
+ tag: z.ZodMiniString<string>;
81
+ createdBy: z.ZodMiniString<string>;
82
+ modifiedBy: z.ZodMiniString<string>;
83
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
84
+ amazonBedrock: z.ZodMiniObject<{
85
+ auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
86
+ accessKey: z.ZodMiniObject<{
87
+ accessKeyId: z.ZodMiniString<string>;
88
+ }, z.core.$strict>;
89
+ }, z.core.$strict>, z.ZodMiniObject<{
90
+ role: z.ZodMiniObject<{
91
+ roleArn: z.ZodMiniString<string>;
92
+ }, z.core.$strict>;
93
+ }, z.core.$strict>]>;
94
+ region: z.ZodMiniEnum<{
95
+ "ap-east-2": "ap-east-2";
96
+ "ap-northeast-1": "ap-northeast-1";
97
+ "ap-northeast-2": "ap-northeast-2";
98
+ "ap-northeast-3": "ap-northeast-3";
99
+ "ap-south-1": "ap-south-1";
100
+ "ap-south-2": "ap-south-2";
101
+ "ap-southeast-1": "ap-southeast-1";
102
+ "ap-southeast-2": "ap-southeast-2";
103
+ "ap-southeast-3": "ap-southeast-3";
104
+ "ap-southeast-4": "ap-southeast-4";
105
+ "ap-southeast-5": "ap-southeast-5";
106
+ "ap-southeast-7": "ap-southeast-7";
107
+ "ca-central-1": "ca-central-1";
108
+ "eu-central-1": "eu-central-1";
109
+ "eu-central-2": "eu-central-2";
110
+ "eu-north-1": "eu-north-1";
111
+ "eu-south-1": "eu-south-1";
112
+ "eu-south-2": "eu-south-2";
113
+ "eu-west-1": "eu-west-1";
114
+ "eu-west-2": "eu-west-2";
115
+ "eu-west-3": "eu-west-3";
116
+ "il-central-1": "il-central-1";
117
+ "me-central-1": "me-central-1";
118
+ "sa-east-1": "sa-east-1";
119
+ "us-east-1": "us-east-1";
120
+ "us-east-2": "us-east-2";
121
+ "us-gov-east-1": "us-gov-east-1";
122
+ "us-gov-west-1": "us-gov-west-1";
123
+ "us-west-1": "us-west-1";
124
+ "us-west-2": "us-west-2";
125
+ }>;
126
+ }, z.core.$strict>;
127
+ }, z.core.$strict>, z.ZodMiniObject<{
128
+ anthropic: z.ZodMiniObject<{}, z.core.$strict>;
129
+ }, z.core.$strict>, z.ZodMiniObject<{
130
+ azureOpenAi: z.ZodMiniObject<{
131
+ auth: z.ZodMiniObject<{
132
+ clientSecretAuth: z.ZodMiniObject<{
133
+ azureClientId: z.ZodMiniString<string>;
134
+ azureTenantId: z.ZodMiniString<string>;
135
+ }, z.core.$strict>;
136
+ }, z.core.$strict>;
137
+ resourceName: z.ZodMiniString<string>;
138
+ }, z.core.$strict>;
139
+ }, z.core.$strict>, z.ZodMiniObject<{
140
+ googleGemini: z.ZodMiniObject<{}, z.core.$strict>;
141
+ }, z.core.$strict>, z.ZodMiniObject<{
142
+ openAi: z.ZodMiniObject<{
143
+ organizationId: z.ZodMiniString<string>;
144
+ }, z.core.$strict>;
145
+ }, z.core.$strict>]>;
146
+ defaultModelName: z.ZodMiniString<string>;
147
+ isDefault: z.ZodMiniBoolean<boolean>;
148
+ createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
149
+ modifiedAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
150
+ sqlModelNames: z.ZodMiniSet<z.ZodMiniString<string>>;
151
+ }, z.core.$strip>>;
152
+ export declare const modelProviderCreateCodec: z.ZodMiniCodec<z.ZodMiniObject<{
153
+ name: z.ZodMiniString<string>;
154
+ defaultModelName: z.ZodMiniString<string>;
155
+ isDefault: z.ZodMiniBoolean<boolean>;
156
+ sqlModelNames: z.ZodMiniArray<z.ZodMiniString<string>>;
157
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
158
+ amazonBedrock: z.ZodMiniObject<{
159
+ auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
160
+ accessKey: z.ZodMiniObject<{
161
+ accessKeyId: z.ZodMiniString<string>;
162
+ secretAccessKey: z.ZodMiniString<string>;
163
+ }, z.core.$strict>;
164
+ }, z.core.$strict>, z.ZodMiniObject<{
165
+ role: z.ZodMiniObject<{
166
+ roleArn: z.ZodMiniString<string>;
167
+ }, z.core.$strict>;
168
+ }, z.core.$strict>]>;
169
+ region: z.ZodMiniEnum<{
170
+ "ap-east-2": "ap-east-2";
171
+ "ap-northeast-1": "ap-northeast-1";
172
+ "ap-northeast-2": "ap-northeast-2";
173
+ "ap-northeast-3": "ap-northeast-3";
174
+ "ap-south-1": "ap-south-1";
175
+ "ap-south-2": "ap-south-2";
176
+ "ap-southeast-1": "ap-southeast-1";
177
+ "ap-southeast-2": "ap-southeast-2";
178
+ "ap-southeast-3": "ap-southeast-3";
179
+ "ap-southeast-4": "ap-southeast-4";
180
+ "ap-southeast-5": "ap-southeast-5";
181
+ "ap-southeast-7": "ap-southeast-7";
182
+ "ca-central-1": "ca-central-1";
183
+ "eu-central-1": "eu-central-1";
184
+ "eu-central-2": "eu-central-2";
185
+ "eu-north-1": "eu-north-1";
186
+ "eu-south-1": "eu-south-1";
187
+ "eu-south-2": "eu-south-2";
188
+ "eu-west-1": "eu-west-1";
189
+ "eu-west-2": "eu-west-2";
190
+ "eu-west-3": "eu-west-3";
191
+ "il-central-1": "il-central-1";
192
+ "me-central-1": "me-central-1";
193
+ "sa-east-1": "sa-east-1";
194
+ "us-east-1": "us-east-1";
195
+ "us-east-2": "us-east-2";
196
+ "us-gov-east-1": "us-gov-east-1";
197
+ "us-gov-west-1": "us-gov-west-1";
198
+ "us-west-1": "us-west-1";
199
+ "us-west-2": "us-west-2";
200
+ }>;
201
+ }, z.core.$strict>;
202
+ }, z.core.$strict>, z.ZodMiniObject<{
203
+ anthropic: z.ZodMiniObject<{
204
+ accessKey: z.ZodMiniString<string>;
205
+ }, z.core.$strict>;
206
+ }, z.core.$strict>, z.ZodMiniObject<{
207
+ azureOpenAi: z.ZodMiniObject<{
208
+ auth: z.ZodMiniObject<{
209
+ clientSecretAuth: z.ZodMiniObject<{
210
+ azureClientId: z.ZodMiniString<string>;
211
+ azureClientSecret: z.ZodMiniString<string>;
212
+ azureTenantId: z.ZodMiniString<string>;
213
+ }, z.core.$strict>;
214
+ }, z.core.$strict>;
215
+ resourceName: z.ZodMiniString<string>;
216
+ }, z.core.$strict>;
217
+ }, z.core.$strict>, z.ZodMiniObject<{
218
+ googleGemini: z.ZodMiniObject<{
219
+ accessKey: z.ZodMiniString<string>;
220
+ }, z.core.$strict>;
221
+ }, z.core.$strict>, z.ZodMiniObject<{
222
+ openAi: z.ZodMiniObject<{
223
+ accessKey: z.ZodMiniString<string>;
224
+ organizationId: z.ZodMiniString<string>;
225
+ }, z.core.$strict>;
226
+ }, z.core.$strict>]>;
227
+ }, z.core.$strip>, z.ZodMiniObject<{
228
+ name: z.ZodMiniString<string>;
229
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
230
+ amazonBedrock: z.ZodMiniObject<{
231
+ auth: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
232
+ accessKey: z.ZodMiniObject<{
233
+ accessKeyId: z.ZodMiniString<string>;
234
+ secretAccessKey: z.ZodMiniString<string>;
235
+ }, z.core.$strict>;
236
+ }, z.core.$strict>, z.ZodMiniObject<{
237
+ role: z.ZodMiniObject<{
238
+ roleArn: z.ZodMiniString<string>;
239
+ }, z.core.$strict>;
240
+ }, z.core.$strict>]>;
241
+ region: z.ZodMiniEnum<{
242
+ "ap-east-2": "ap-east-2";
243
+ "ap-northeast-1": "ap-northeast-1";
244
+ "ap-northeast-2": "ap-northeast-2";
245
+ "ap-northeast-3": "ap-northeast-3";
246
+ "ap-south-1": "ap-south-1";
247
+ "ap-south-2": "ap-south-2";
248
+ "ap-southeast-1": "ap-southeast-1";
249
+ "ap-southeast-2": "ap-southeast-2";
250
+ "ap-southeast-3": "ap-southeast-3";
251
+ "ap-southeast-4": "ap-southeast-4";
252
+ "ap-southeast-5": "ap-southeast-5";
253
+ "ap-southeast-7": "ap-southeast-7";
254
+ "ca-central-1": "ca-central-1";
255
+ "eu-central-1": "eu-central-1";
256
+ "eu-central-2": "eu-central-2";
257
+ "eu-north-1": "eu-north-1";
258
+ "eu-south-1": "eu-south-1";
259
+ "eu-south-2": "eu-south-2";
260
+ "eu-west-1": "eu-west-1";
261
+ "eu-west-2": "eu-west-2";
262
+ "eu-west-3": "eu-west-3";
263
+ "il-central-1": "il-central-1";
264
+ "me-central-1": "me-central-1";
265
+ "sa-east-1": "sa-east-1";
266
+ "us-east-1": "us-east-1";
267
+ "us-east-2": "us-east-2";
268
+ "us-gov-east-1": "us-gov-east-1";
269
+ "us-gov-west-1": "us-gov-west-1";
270
+ "us-west-1": "us-west-1";
271
+ "us-west-2": "us-west-2";
272
+ }>;
273
+ }, z.core.$strict>;
274
+ }, z.core.$strict>, z.ZodMiniObject<{
275
+ anthropic: z.ZodMiniObject<{
276
+ accessKey: z.ZodMiniString<string>;
277
+ }, z.core.$strict>;
278
+ }, z.core.$strict>, z.ZodMiniObject<{
279
+ azureOpenAi: z.ZodMiniObject<{
280
+ auth: z.ZodMiniObject<{
281
+ clientSecretAuth: z.ZodMiniObject<{
282
+ azureClientId: z.ZodMiniString<string>;
283
+ azureClientSecret: z.ZodMiniString<string>;
284
+ azureTenantId: z.ZodMiniString<string>;
285
+ }, z.core.$strict>;
286
+ }, z.core.$strict>;
287
+ resourceName: z.ZodMiniString<string>;
288
+ }, z.core.$strict>;
289
+ }, z.core.$strict>, z.ZodMiniObject<{
290
+ googleGemini: z.ZodMiniObject<{
291
+ accessKey: z.ZodMiniString<string>;
292
+ }, z.core.$strict>;
293
+ }, z.core.$strict>, z.ZodMiniObject<{
294
+ openAi: z.ZodMiniObject<{
295
+ accessKey: z.ZodMiniString<string>;
296
+ organizationId: z.ZodMiniString<string>;
297
+ }, z.core.$strict>;
298
+ }, z.core.$strict>]>;
299
+ defaultModelName: z.ZodMiniString<string>;
300
+ isDefault: z.ZodMiniBoolean<boolean>;
301
+ sqlModelNames: z.ZodMiniSet<z.ZodMiniString<string>>;
302
+ }, z.core.$strip>>;
303
+ export declare const modelProviderUpdateCodec: z.ZodMiniCodec<z.ZodMiniObject<{
304
+ name: z.ZodMiniString<string>;
305
+ defaultModelName: z.ZodMiniString<string>;
306
+ isDefault: z.ZodMiniBoolean<boolean>;
307
+ sqlModelNames: z.ZodMiniArray<z.ZodMiniString<string>>;
308
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
309
+ amazonBedrock: z.ZodMiniObject<{
310
+ auth: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
311
+ accessKey: z.ZodMiniObject<{
312
+ accessKeyId: z.ZodMiniString<string>;
313
+ secretAccessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
314
+ }, z.core.$strict>;
315
+ }, z.core.$strict>, z.ZodMiniObject<{
316
+ role: z.ZodMiniObject<{
317
+ roleArn: z.ZodMiniString<string>;
318
+ }, z.core.$strict>;
319
+ }, z.core.$strict>]>>;
320
+ region: z.ZodMiniOptional<z.ZodMiniEnum<{
321
+ "ap-east-2": "ap-east-2";
322
+ "ap-northeast-1": "ap-northeast-1";
323
+ "ap-northeast-2": "ap-northeast-2";
324
+ "ap-northeast-3": "ap-northeast-3";
325
+ "ap-south-1": "ap-south-1";
326
+ "ap-south-2": "ap-south-2";
327
+ "ap-southeast-1": "ap-southeast-1";
328
+ "ap-southeast-2": "ap-southeast-2";
329
+ "ap-southeast-3": "ap-southeast-3";
330
+ "ap-southeast-4": "ap-southeast-4";
331
+ "ap-southeast-5": "ap-southeast-5";
332
+ "ap-southeast-7": "ap-southeast-7";
333
+ "ca-central-1": "ca-central-1";
334
+ "eu-central-1": "eu-central-1";
335
+ "eu-central-2": "eu-central-2";
336
+ "eu-north-1": "eu-north-1";
337
+ "eu-south-1": "eu-south-1";
338
+ "eu-south-2": "eu-south-2";
339
+ "eu-west-1": "eu-west-1";
340
+ "eu-west-2": "eu-west-2";
341
+ "eu-west-3": "eu-west-3";
342
+ "il-central-1": "il-central-1";
343
+ "me-central-1": "me-central-1";
344
+ "sa-east-1": "sa-east-1";
345
+ "us-east-1": "us-east-1";
346
+ "us-east-2": "us-east-2";
347
+ "us-gov-east-1": "us-gov-east-1";
348
+ "us-gov-west-1": "us-gov-west-1";
349
+ "us-west-1": "us-west-1";
350
+ "us-west-2": "us-west-2";
351
+ }>>;
352
+ }, z.core.$strict>;
353
+ }, z.core.$strict>, z.ZodMiniObject<{
354
+ anthropic: z.ZodMiniObject<{
355
+ accessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
356
+ }, z.core.$strict>;
357
+ }, z.core.$strict>, z.ZodMiniObject<{
358
+ azureOpenAi: z.ZodMiniObject<{
359
+ auth: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
360
+ clientSecretAuth: z.ZodMiniObject<{
361
+ azureClientId: z.ZodMiniString<string>;
362
+ azureClientSecret: z.ZodMiniString<string>;
363
+ azureTenantId: z.ZodMiniString<string>;
364
+ }, z.core.$strict>;
365
+ }, z.core.$strict>, z.ZodMiniObject<{
366
+ clientSecretAuth: z.ZodMiniObject<{
367
+ azureClientId: z.ZodMiniString<string>;
368
+ azureTenantId: z.ZodMiniString<string>;
369
+ azureClientSecret: z.ZodMiniOptional<z.ZodMiniString<string>>;
370
+ }, z.core.$strict>;
371
+ }, z.core.$strict>]>>;
372
+ resourceName: z.ZodMiniString<string>;
373
+ }, z.core.$strict>;
374
+ }, z.core.$strict>, z.ZodMiniObject<{
375
+ googleGemini: z.ZodMiniObject<{
376
+ accessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
377
+ }, z.core.$strict>;
378
+ }, z.core.$strict>, z.ZodMiniObject<{
379
+ openAi: z.ZodMiniObject<{
380
+ accessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
381
+ organizationId: z.ZodMiniOptional<z.ZodMiniString<string>>;
382
+ }, z.core.$strict>;
383
+ }, z.core.$strict>]>;
384
+ }, z.core.$strip>, z.ZodMiniObject<{
385
+ name: z.ZodMiniString<string>;
386
+ config: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
387
+ amazonBedrock: z.ZodMiniObject<{
388
+ auth: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
389
+ accessKey: z.ZodMiniObject<{
390
+ accessKeyId: z.ZodMiniString<string>;
391
+ secretAccessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
392
+ }, z.core.$strict>;
393
+ }, z.core.$strict>, z.ZodMiniObject<{
394
+ role: z.ZodMiniObject<{
395
+ roleArn: z.ZodMiniString<string>;
396
+ }, z.core.$strict>;
397
+ }, z.core.$strict>]>>;
398
+ region: z.ZodMiniOptional<z.ZodMiniEnum<{
399
+ "ap-east-2": "ap-east-2";
400
+ "ap-northeast-1": "ap-northeast-1";
401
+ "ap-northeast-2": "ap-northeast-2";
402
+ "ap-northeast-3": "ap-northeast-3";
403
+ "ap-south-1": "ap-south-1";
404
+ "ap-south-2": "ap-south-2";
405
+ "ap-southeast-1": "ap-southeast-1";
406
+ "ap-southeast-2": "ap-southeast-2";
407
+ "ap-southeast-3": "ap-southeast-3";
408
+ "ap-southeast-4": "ap-southeast-4";
409
+ "ap-southeast-5": "ap-southeast-5";
410
+ "ap-southeast-7": "ap-southeast-7";
411
+ "ca-central-1": "ca-central-1";
412
+ "eu-central-1": "eu-central-1";
413
+ "eu-central-2": "eu-central-2";
414
+ "eu-north-1": "eu-north-1";
415
+ "eu-south-1": "eu-south-1";
416
+ "eu-south-2": "eu-south-2";
417
+ "eu-west-1": "eu-west-1";
418
+ "eu-west-2": "eu-west-2";
419
+ "eu-west-3": "eu-west-3";
420
+ "il-central-1": "il-central-1";
421
+ "me-central-1": "me-central-1";
422
+ "sa-east-1": "sa-east-1";
423
+ "us-east-1": "us-east-1";
424
+ "us-east-2": "us-east-2";
425
+ "us-gov-east-1": "us-gov-east-1";
426
+ "us-gov-west-1": "us-gov-west-1";
427
+ "us-west-1": "us-west-1";
428
+ "us-west-2": "us-west-2";
429
+ }>>;
430
+ }, z.core.$strict>;
431
+ }, z.core.$strict>, z.ZodMiniObject<{
432
+ anthropic: z.ZodMiniObject<{
433
+ accessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
434
+ }, z.core.$strict>;
435
+ }, z.core.$strict>, z.ZodMiniObject<{
436
+ azureOpenAi: z.ZodMiniObject<{
437
+ auth: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
438
+ clientSecretAuth: z.ZodMiniObject<{
439
+ azureClientId: z.ZodMiniString<string>;
440
+ azureClientSecret: z.ZodMiniString<string>;
441
+ azureTenantId: z.ZodMiniString<string>;
442
+ }, z.core.$strict>;
443
+ }, z.core.$strict>, z.ZodMiniObject<{
444
+ clientSecretAuth: z.ZodMiniObject<{
445
+ azureClientId: z.ZodMiniString<string>;
446
+ azureTenantId: z.ZodMiniString<string>;
447
+ azureClientSecret: z.ZodMiniOptional<z.ZodMiniString<string>>;
448
+ }, z.core.$strict>;
449
+ }, z.core.$strict>]>>;
450
+ resourceName: z.ZodMiniString<string>;
451
+ }, z.core.$strict>;
452
+ }, z.core.$strict>, z.ZodMiniObject<{
453
+ googleGemini: z.ZodMiniObject<{
454
+ accessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
455
+ }, z.core.$strict>;
456
+ }, z.core.$strict>, z.ZodMiniObject<{
457
+ openAi: z.ZodMiniObject<{
458
+ accessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
459
+ organizationId: z.ZodMiniOptional<z.ZodMiniString<string>>;
460
+ }, z.core.$strict>;
461
+ }, z.core.$strict>]>;
462
+ defaultModelName: z.ZodMiniString<string>;
463
+ isDefault: z.ZodMiniBoolean<boolean>;
464
+ sqlModelNames: z.ZodMiniSet<z.ZodMiniString<string>>;
465
+ }, z.core.$strip>>;
@@ -0,0 +1,154 @@
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 { amazonBedrockModelProviderConfigRetrieveSchema, amazonBedrockModelProviderConfigSchema, amazonBedrockModelProviderConfigUpdateSchema, anthropicModelProviderConfigRetrieveSchema, anthropicModelProviderConfigSchema, azureOpenAiModelProviderConfigRetrieveSchema, azureOpenAiModelProviderConfigSchema, azureOpenAiModelProviderConfigUpdateSchema, googleGeminiModelProviderConfigRetrieveSchema, googleGeminiModelProviderConfigSchema, openAiModelProviderConfigRetrieveSchema, openAiModelProviderConfigSchema, } from "./modelProviderConfigSchemas.js";
18
+ import { Temporal } from "temporal-polyfill";
19
+ const modelProviderBaseSchema = z.object({
20
+ createdAt: z.string().check(z.iso.datetime()),
21
+ createdBy: z.string(),
22
+ defaultModelName: z.string(),
23
+ id: z.string(),
24
+ isDefault: z.boolean(),
25
+ modifiedAt: z.string().check(z.iso.datetime()),
26
+ modifiedBy: z.string(),
27
+ // eslint-disable-next-line regexp/prefer-w, regexp/use-ignore-case
28
+ name: z.string().check(z.regex(/^[a-zA-Z0-9_-]+$/)),
29
+ sqlModelNames: z.array(z.string()),
30
+ tag: z.string(),
31
+ });
32
+ const modelProviderRetrieveInSchema = z.extend(modelProviderBaseSchema, {
33
+ config: z.union([
34
+ z.strictObject({
35
+ amazonBedrock: amazonBedrockModelProviderConfigRetrieveSchema,
36
+ }),
37
+ z.strictObject({
38
+ anthropic: anthropicModelProviderConfigRetrieveSchema,
39
+ }),
40
+ z.strictObject({
41
+ azureOpenAi: azureOpenAiModelProviderConfigRetrieveSchema,
42
+ }),
43
+ z.strictObject({
44
+ googleGemini: googleGeminiModelProviderConfigRetrieveSchema,
45
+ }),
46
+ z.strictObject({
47
+ openAi: openAiModelProviderConfigRetrieveSchema,
48
+ }),
49
+ ]),
50
+ });
51
+ const modelProviderCreateInSchema = z.extend(z.pick(modelProviderBaseSchema, {
52
+ defaultModelName: true,
53
+ isDefault: true,
54
+ name: true,
55
+ sqlModelNames: true,
56
+ }), {
57
+ config: z.union([
58
+ z.strictObject({
59
+ amazonBedrock: amazonBedrockModelProviderConfigSchema,
60
+ }),
61
+ z.strictObject({
62
+ anthropic: anthropicModelProviderConfigSchema,
63
+ }),
64
+ z.strictObject({
65
+ azureOpenAi: azureOpenAiModelProviderConfigSchema,
66
+ }),
67
+ z.strictObject({
68
+ googleGemini: googleGeminiModelProviderConfigSchema,
69
+ }),
70
+ z.strictObject({
71
+ openAi: openAiModelProviderConfigSchema,
72
+ }),
73
+ ]),
74
+ });
75
+ const modelProviderUpdateInSchema = z.extend(z.omit(modelProviderCreateInSchema, { config: true }), {
76
+ config: z.union([
77
+ z.strictObject({
78
+ amazonBedrock: amazonBedrockModelProviderConfigUpdateSchema,
79
+ }),
80
+ z.strictObject({
81
+ anthropic: z.partial(anthropicModelProviderConfigSchema),
82
+ }),
83
+ z.strictObject({
84
+ azureOpenAi: azureOpenAiModelProviderConfigUpdateSchema,
85
+ }),
86
+ z.strictObject({
87
+ googleGemini: z.partial(googleGeminiModelProviderConfigSchema),
88
+ }),
89
+ z.strictObject({
90
+ openAi: z.partial(openAiModelProviderConfigSchema),
91
+ }),
92
+ ]),
93
+ });
94
+ export const modelProviderRetrieveCodec = z.codec(modelProviderRetrieveInSchema, z.extend(z.omit(modelProviderRetrieveInSchema, {
95
+ createdAt: true,
96
+ modifiedAt: true,
97
+ sqlModelNames: true,
98
+ }), {
99
+ createdAt: z.instanceof(Temporal.Instant),
100
+ modifiedAt: z.instanceof(Temporal.Instant),
101
+ sqlModelNames: z.set(z.string()),
102
+ }), {
103
+ decode(v) {
104
+ return {
105
+ ...v,
106
+ createdAt: Temporal.Instant.from(v.createdAt),
107
+ modifiedAt: Temporal.Instant.from(v.modifiedAt),
108
+ sqlModelNames: new Set(v.sqlModelNames),
109
+ };
110
+ },
111
+ encode(v) {
112
+ return {
113
+ ...v,
114
+ createdAt: v.createdAt.toString(),
115
+ modifiedAt: v.modifiedAt.toString(),
116
+ sqlModelNames: Array.from(v.sqlModelNames),
117
+ };
118
+ },
119
+ });
120
+ export const modelProviderCreateCodec = z.codec(modelProviderCreateInSchema, z.extend(z.omit(modelProviderCreateInSchema, {
121
+ sqlModelNames: true,
122
+ }), {
123
+ sqlModelNames: z.set(z.string()),
124
+ }), {
125
+ decode(v) {
126
+ return {
127
+ ...v,
128
+ sqlModelNames: new Set(v.sqlModelNames),
129
+ };
130
+ },
131
+ encode(v) {
132
+ return {
133
+ ...v,
134
+ sqlModelNames: Array.from(v.sqlModelNames),
135
+ };
136
+ },
137
+ });
138
+ export const modelProviderUpdateCodec = z.codec(modelProviderUpdateInSchema, z.extend(z.omit(modelProviderUpdateInSchema, { sqlModelNames: true }), {
139
+ sqlModelNames: z.set(z.string()),
140
+ }), {
141
+ decode(v) {
142
+ return {
143
+ ...v,
144
+ sqlModelNames: new Set(v.sqlModelNames),
145
+ };
146
+ },
147
+ encode(v) {
148
+ return {
149
+ ...v,
150
+ sqlModelNames: Array.from(v.sqlModelNames),
151
+ };
152
+ },
153
+ });
154
+ //# sourceMappingURL=modelProviderCodec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelProviderCodec.js","sourceRoot":"","sources":["../../../src/enterprise/ai/modelProviderCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,8CAA8C,EAC9C,sCAAsC,EACtC,4CAA4C,EAC5C,0CAA0C,EAC1C,kCAAkC,EAClC,4CAA4C,EAC5C,oCAAoC,EACpC,0CAA0C,EAC1C,6CAA6C,EAC7C,qCAAqC,EACrC,uCAAuC,EACvC,+BAA+B,GAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAA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ACJ,aAAa,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC;SACxC,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,CAAC;QACN,OAAO;YACL,GAAG,CAAC;YACJ,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;SAC3C,CAAC;IACJ,CAAC;CACF,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC7C,2BAA2B,EAC3B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE;IACrE,aAAa,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACjC,CAAC,EACF;IACE,MAAM,CAAC,CAAC;QACN,OAAO;YACL,GAAG,CAAC;YACJ,aAAa,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC;SACxC,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,CAAC;QACN,OAAO;YACL,GAAG,CAAC;YACJ,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;SAC3C,CAAC;IACJ,CAAC;CACF,CACF,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 {\n amazonBedrockModelProviderConfigRetrieveSchema,\n amazonBedrockModelProviderConfigSchema,\n amazonBedrockModelProviderConfigUpdateSchema,\n anthropicModelProviderConfigRetrieveSchema,\n anthropicModelProviderConfigSchema,\n azureOpenAiModelProviderConfigRetrieveSchema,\n azureOpenAiModelProviderConfigSchema,\n azureOpenAiModelProviderConfigUpdateSchema,\n googleGeminiModelProviderConfigRetrieveSchema,\n googleGeminiModelProviderConfigSchema,\n openAiModelProviderConfigRetrieveSchema,\n openAiModelProviderConfigSchema,\n} from \"./modelProviderConfigSchemas.ts\";\nimport { Temporal } from \"temporal-polyfill\";\n\nconst modelProviderBaseSchema = z.object({\n createdAt: z.string().check(z.iso.datetime()),\n createdBy: z.string(),\n defaultModelName: z.string(),\n id: z.string(),\n isDefault: z.boolean(),\n modifiedAt: z.string().check(z.iso.datetime()),\n modifiedBy: z.string(),\n // eslint-disable-next-line regexp/prefer-w, regexp/use-ignore-case\n name: z.string().check(z.regex(/^[a-zA-Z0-9_-]+$/)),\n sqlModelNames: z.array(z.string()),\n tag: z.string(),\n});\n\nconst modelProviderRetrieveInSchema = z.extend(modelProviderBaseSchema, {\n config: z.union([\n z.strictObject({\n amazonBedrock: amazonBedrockModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n anthropic: anthropicModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n azureOpenAi: azureOpenAiModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n googleGemini: googleGeminiModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n openAi: openAiModelProviderConfigRetrieveSchema,\n }),\n ]),\n});\n\nconst modelProviderCreateInSchema = z.extend(\n z.pick(modelProviderBaseSchema, {\n defaultModelName: true,\n isDefault: true,\n name: true,\n sqlModelNames: true,\n }),\n {\n config: z.union([\n z.strictObject({\n amazonBedrock: amazonBedrockModelProviderConfigSchema,\n }),\n z.strictObject({\n anthropic: anthropicModelProviderConfigSchema,\n }),\n z.strictObject({\n azureOpenAi: azureOpenAiModelProviderConfigSchema,\n }),\n z.strictObject({\n googleGemini: googleGeminiModelProviderConfigSchema,\n }),\n z.strictObject({\n openAi: openAiModelProviderConfigSchema,\n }),\n ]),\n },\n);\n\nconst modelProviderUpdateInSchema = z.extend(\n z.omit(modelProviderCreateInSchema, { config: true }),\n {\n config: z.union([\n z.strictObject({\n amazonBedrock: amazonBedrockModelProviderConfigUpdateSchema,\n }),\n z.strictObject({\n anthropic: z.partial(anthropicModelProviderConfigSchema),\n }),\n z.strictObject({\n azureOpenAi: azureOpenAiModelProviderConfigUpdateSchema,\n }),\n z.strictObject({\n googleGemini: z.partial(googleGeminiModelProviderConfigSchema),\n }),\n z.strictObject({\n openAi: z.partial(openAiModelProviderConfigSchema),\n }),\n ]),\n },\n);\n\nexport const modelProviderRetrieveCodec = z.codec(\n modelProviderRetrieveInSchema,\n z.extend(\n z.omit(modelProviderRetrieveInSchema, {\n createdAt: true,\n modifiedAt: true,\n sqlModelNames: true,\n }),\n {\n createdAt: z.instanceof(Temporal.Instant),\n modifiedAt: z.instanceof(Temporal.Instant),\n sqlModelNames: z.set(z.string()),\n },\n ),\n {\n decode(v) {\n return {\n ...v,\n createdAt: Temporal.Instant.from(v.createdAt),\n modifiedAt: Temporal.Instant.from(v.modifiedAt),\n sqlModelNames: new Set(v.sqlModelNames),\n };\n },\n encode(v) {\n return {\n ...v,\n createdAt: v.createdAt.toString(),\n modifiedAt: v.modifiedAt.toString(),\n sqlModelNames: Array.from(v.sqlModelNames),\n };\n },\n },\n);\n\nexport const modelProviderCreateCodec = z.codec(\n modelProviderCreateInSchema,\n z.extend(\n z.omit(modelProviderCreateInSchema, {\n sqlModelNames: true,\n }),\n {\n sqlModelNames: z.set(z.string()),\n },\n ),\n {\n decode(v) {\n return {\n ...v,\n sqlModelNames: new Set(v.sqlModelNames),\n };\n },\n encode(v) {\n return {\n ...v,\n sqlModelNames: Array.from(v.sqlModelNames),\n };\n },\n },\n);\n\nexport const modelProviderUpdateCodec = z.codec(\n modelProviderUpdateInSchema,\n z.extend(z.omit(modelProviderUpdateInSchema, { sqlModelNames: true }), {\n sqlModelNames: z.set(z.string()),\n }),\n {\n decode(v) {\n return {\n ...v,\n sqlModelNames: new Set(v.sqlModelNames),\n };\n },\n encode(v) {\n return {\n ...v,\n sqlModelNames: Array.from(v.sqlModelNames),\n };\n },\n },\n);\n"]}