@deepnote/database-integrations 1.3.4 → 1.4.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/index.cjs +17 -10
- package/dist/index.d.cts +373 -223
- package/dist/index.d.ts +373 -223
- package/dist/index.js +17 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@ const BigQueryAuthMethods = {
|
|
|
43
43
|
};
|
|
44
44
|
const TrinoAuthMethods = {
|
|
45
45
|
Password: "password",
|
|
46
|
-
Oauth: "oauth"
|
|
46
|
+
Oauth: "trino-oauth"
|
|
47
47
|
};
|
|
48
48
|
const DatabaseAuthMethods = {
|
|
49
49
|
UsernameAndPassword: "username-and-password",
|
|
@@ -174,11 +174,21 @@ const commonSnowflakeMetadataSchema = zod.z.object({
|
|
|
174
174
|
accountName: zod.z.string(),
|
|
175
175
|
warehouse: zod.z.string().optional(),
|
|
176
176
|
database: zod.z.string().optional(),
|
|
177
|
-
role: zod.z.string().optional()
|
|
177
|
+
role: zod.z.string().optional(),
|
|
178
|
+
dbt: zod.z.boolean().optional(),
|
|
179
|
+
dbtServiceToken: zod.z.string().optional(),
|
|
180
|
+
dbtPrimaryJobId: zod.z.string().optional(),
|
|
181
|
+
dbtProxyServerUrl: zod.z.string().optional()
|
|
178
182
|
});
|
|
179
|
-
const snowflakeMetadataSchema = zod.z.
|
|
183
|
+
const snowflakeMetadataSchema = zod.z.preprocess((data) => {
|
|
184
|
+
if (typeof data === "object" && data !== null && (!("authMethod" in data) || !data.authMethod)) return {
|
|
185
|
+
...data,
|
|
186
|
+
authMethod: SnowflakeAuthMethods.Password
|
|
187
|
+
};
|
|
188
|
+
return data;
|
|
189
|
+
}, zod.z.discriminatedUnion("authMethod", [
|
|
180
190
|
commonSnowflakeMetadataSchema.extend({
|
|
181
|
-
authMethod: zod.z.literal(SnowflakeAuthMethods.Password),
|
|
191
|
+
authMethod: zod.z.literal(SnowflakeAuthMethods.Password).optional(),
|
|
182
192
|
username: zod.z.string(),
|
|
183
193
|
password: zod.z.string()
|
|
184
194
|
}),
|
|
@@ -209,7 +219,7 @@ const snowflakeMetadataSchema = zod.z.discriminatedUnion("authMethod", [
|
|
|
209
219
|
privateKey: zod.z.string(),
|
|
210
220
|
privateKeyPassphrase: zod.z.string().optional()
|
|
211
221
|
})
|
|
212
|
-
]);
|
|
222
|
+
]));
|
|
213
223
|
const spannerMetadataSchema = zod.z.object({
|
|
214
224
|
service_account: zod.z.string(),
|
|
215
225
|
dataBoostEnabled: zod.z.boolean(),
|
|
@@ -229,6 +239,7 @@ const trinoBaseMetadataSchema = zod.z.object({
|
|
|
229
239
|
caCertificateText: zod.z.string().optional()
|
|
230
240
|
});
|
|
231
241
|
const trinoUsernamePasswordMetadataSchema = trinoBaseMetadataSchema.extend({
|
|
242
|
+
authMethod: zod.z.literal(TrinoAuthMethods.Password).nullish(),
|
|
232
243
|
user: zod.z.string(),
|
|
233
244
|
password: zod.z.string()
|
|
234
245
|
});
|
|
@@ -239,11 +250,7 @@ const trinoOAuthMetadataSchema = trinoBaseMetadataSchema.extend({
|
|
|
239
250
|
authUrl: zod.z.string().url(),
|
|
240
251
|
tokenUrl: zod.z.string().url()
|
|
241
252
|
});
|
|
242
|
-
const trinoMetadataSchema = zod.z.discriminatedUnion("authMethod", [
|
|
243
|
-
trinoUsernamePasswordMetadataSchema.extend({ authMethod: zod.z.literal(null) }),
|
|
244
|
-
trinoUsernamePasswordMetadataSchema.extend({ authMethod: zod.z.literal(TrinoAuthMethods.Password) }),
|
|
245
|
-
trinoOAuthMetadataSchema
|
|
246
|
-
]);
|
|
253
|
+
const trinoMetadataSchema = zod.z.discriminatedUnion("authMethod", [trinoUsernamePasswordMetadataSchema, trinoOAuthMetadataSchema]);
|
|
247
254
|
const commonDatabaseSchema = zod.z.object({
|
|
248
255
|
host: zod.z.string(),
|
|
249
256
|
user: zod.z.string(),
|