@deepnote/database-integrations 1.4.2 → 1.4.3

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 CHANGED
@@ -323,12 +323,12 @@ const commonIntegrationConfig = zod.default.object({
323
323
  const databaseIntegrationConfigSchema = zod.default.discriminatedUnion("type", [
324
324
  commonIntegrationConfig.extend({
325
325
  type: zod.default.literal("alloydb"),
326
- metadata: databaseMetadataSchemasByType["alloydb"],
326
+ metadata: databaseMetadataSchemasByType.alloydb,
327
327
  federated_auth_method: zod.default.null().optional()
328
328
  }),
329
329
  commonIntegrationConfig.extend({
330
330
  type: zod.default.literal("athena"),
331
- metadata: databaseMetadataSchemasByType["athena"],
331
+ metadata: databaseMetadataSchemasByType.athena,
332
332
  federated_auth_method: zod.default.null().optional()
333
333
  }),
334
334
  commonIntegrationConfig.extend({
@@ -338,42 +338,42 @@ const databaseIntegrationConfigSchema = zod.default.discriminatedUnion("type", [
338
338
  }),
339
339
  commonIntegrationConfig.extend({
340
340
  type: zod.default.literal("clickhouse"),
341
- metadata: databaseMetadataSchemasByType["clickhouse"],
341
+ metadata: databaseMetadataSchemasByType.clickhouse,
342
342
  federated_auth_method: zod.default.null().optional()
343
343
  }),
344
344
  commonIntegrationConfig.extend({
345
345
  type: zod.default.literal("databricks"),
346
- metadata: databaseMetadataSchemasByType["databricks"],
346
+ metadata: databaseMetadataSchemasByType.databricks,
347
347
  federated_auth_method: zod.default.null().optional()
348
348
  }),
349
349
  commonIntegrationConfig.extend({
350
350
  type: zod.default.literal("dremio"),
351
- metadata: databaseMetadataSchemasByType["dremio"],
351
+ metadata: databaseMetadataSchemasByType.dremio,
352
352
  federated_auth_method: zod.default.null().optional()
353
353
  }),
354
354
  commonIntegrationConfig.extend({
355
355
  type: zod.default.literal("mariadb"),
356
- metadata: databaseMetadataSchemasByType["mariadb"],
356
+ metadata: databaseMetadataSchemasByType.mariadb,
357
357
  federated_auth_method: zod.default.null().optional()
358
358
  }),
359
359
  commonIntegrationConfig.extend({
360
360
  type: zod.default.literal("materialize"),
361
- metadata: databaseMetadataSchemasByType["materialize"],
361
+ metadata: databaseMetadataSchemasByType.materialize,
362
362
  federated_auth_method: zod.default.null().optional()
363
363
  }),
364
364
  commonIntegrationConfig.extend({
365
365
  type: zod.default.literal("mindsdb"),
366
- metadata: databaseMetadataSchemasByType["mindsdb"],
366
+ metadata: databaseMetadataSchemasByType.mindsdb,
367
367
  federated_auth_method: zod.default.null().optional()
368
368
  }),
369
369
  commonIntegrationConfig.extend({
370
370
  type: zod.default.literal("mongodb"),
371
- metadata: databaseMetadataSchemasByType["mongodb"],
371
+ metadata: databaseMetadataSchemasByType.mongodb,
372
372
  federated_auth_method: zod.default.null().optional()
373
373
  }),
374
374
  commonIntegrationConfig.extend({
375
375
  type: zod.default.literal("mysql"),
376
- metadata: databaseMetadataSchemasByType["mysql"],
376
+ metadata: databaseMetadataSchemasByType.mysql,
377
377
  federated_auth_method: zod.default.null().optional()
378
378
  }),
379
379
  commonIntegrationConfig.extend({
@@ -383,12 +383,12 @@ const databaseIntegrationConfigSchema = zod.default.discriminatedUnion("type", [
383
383
  }),
384
384
  commonIntegrationConfig.extend({
385
385
  type: zod.default.literal("pgsql"),
386
- metadata: databaseMetadataSchemasByType["pgsql"],
386
+ metadata: databaseMetadataSchemasByType.pgsql,
387
387
  federated_auth_method: zod.default.null().optional()
388
388
  }),
389
389
  commonIntegrationConfig.extend({
390
390
  type: zod.default.literal("redshift"),
391
- metadata: databaseMetadataSchemasByType["redshift"],
391
+ metadata: databaseMetadataSchemasByType.redshift,
392
392
  federated_auth_method: zod.default.enum([
393
393
  "username-and-password",
394
394
  "iam-role",
@@ -397,7 +397,7 @@ const databaseIntegrationConfigSchema = zod.default.discriminatedUnion("type", [
397
397
  }),
398
398
  commonIntegrationConfig.extend({
399
399
  type: zod.default.literal("snowflake"),
400
- metadata: databaseMetadataSchemasByType["snowflake"],
400
+ metadata: databaseMetadataSchemasByType.snowflake,
401
401
  federated_auth_method: zod.default.enum([
402
402
  "okta",
403
403
  "snowflake",
@@ -409,7 +409,7 @@ const databaseIntegrationConfigSchema = zod.default.discriminatedUnion("type", [
409
409
  }),
410
410
  commonIntegrationConfig.extend({
411
411
  type: zod.default.literal("spanner"),
412
- metadata: databaseMetadataSchemasByType["spanner"],
412
+ metadata: databaseMetadataSchemasByType.spanner,
413
413
  federated_auth_method: zod.default.null().optional()
414
414
  }),
415
415
  commonIntegrationConfig.extend({
@@ -419,7 +419,7 @@ const databaseIntegrationConfigSchema = zod.default.discriminatedUnion("type", [
419
419
  }),
420
420
  commonIntegrationConfig.extend({
421
421
  type: zod.default.literal("trino"),
422
- metadata: databaseMetadataSchemasByType["trino"],
422
+ metadata: databaseMetadataSchemasByType.trino,
423
423
  federated_auth_method: zod.default.enum(["trino-oauth", "password"]).optional().nullable()
424
424
  })
425
425
  ]);
@@ -898,6 +898,63 @@ function isDatabaseIntegrationTypeWithSslSupport(type) {
898
898
  return databaseIntegrationTypesWithSslSupport.includes(type);
899
899
  }
900
900
 
901
+ //#endregion
902
+ //#region src/secret-field-paths.ts
903
+ /**
904
+ * All secret fields for each integration type.
905
+ * This includes all possible secret fields regardless of auth method.
906
+ *
907
+ * Note: For integrations with multiple auth methods (e.g., snowflake, bigquery),
908
+ * this includes all secret fields from all auth variants.
909
+ */
910
+ const SECRET_PATHS = {
911
+ alloydb: ["password", "caCertificateText"],
912
+ mariadb: ["password", "caCertificateText"],
913
+ materialize: ["password", "caCertificateText"],
914
+ mindsdb: ["password", "caCertificateText"],
915
+ mysql: ["password", "caCertificateText"],
916
+ pgsql: ["password", "caCertificateText"],
917
+ "sql-server": ["password"],
918
+ clickhouse: ["password", "caCertificateText"],
919
+ databricks: ["token"],
920
+ dremio: ["token"],
921
+ athena: ["secret_access_key"],
922
+ spanner: ["service_account"],
923
+ mongodb: [
924
+ "password",
925
+ "connection_string",
926
+ "rawConnectionString",
927
+ "caCertificateText"
928
+ ],
929
+ "pandas-dataframe": [],
930
+ "big-query": ["service_account", "clientSecret"],
931
+ snowflake: [
932
+ "password",
933
+ "clientSecret",
934
+ "privateKey",
935
+ "privateKeyPassphrase"
936
+ ],
937
+ redshift: ["password", "caCertificateText"],
938
+ trino: [
939
+ "password",
940
+ "clientSecret",
941
+ "caCertificateText"
942
+ ]
943
+ };
944
+ /**
945
+ * Get the list of secret field paths for a given integration type.
946
+ *
947
+ * @param type - The integration type (e.g., 'pgsql', 'snowflake')
948
+ * @returns Array of field names that contain secrets
949
+ *
950
+ * @example
951
+ * getSecretFieldPaths('pgsql') // => ['password', 'caCertificateText']
952
+ * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase']
953
+ */
954
+ function getSecretFieldPaths(type) {
955
+ return SECRET_PATHS[type] ?? [];
956
+ }
957
+
901
958
  //#endregion
902
959
  exports.AwsAuthMethods = AwsAuthMethods;
903
960
  exports.BigQueryAuthMethods = BigQueryAuthMethods;
@@ -912,6 +969,7 @@ exports.databaseIntegrationTypesWithSslSupport = databaseIntegrationTypesWithSsl
912
969
  exports.databaseMetadataSchemasByType = databaseMetadataSchemasByType;
913
970
  exports.federatedAuthMethods = federatedAuthMethods;
914
971
  exports.getEnvironmentVariablesForIntegrations = getEnvironmentVariablesForIntegrations;
972
+ exports.getSecretFieldPaths = getSecretFieldPaths;
915
973
  exports.getSnowflakeFederatedAuthSqlAlchemyInput = getSnowflakeFederatedAuthSqlAlchemyInput;
916
974
  exports.getSqlAlchemyInput = getSqlAlchemyInput;
917
975
  exports.isDatabaseIntegrationType = isDatabaseIntegrationType;