@deepnote/database-integrations 1.3.3 → 1.3.5

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
@@ -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",
@@ -62,7 +62,7 @@ function isFederatedAuthMethod(authMethod) {
62
62
  return federatedAuthMethods.includes(authMethod);
63
63
  }
64
64
  function isFederatedAuthMetadata(metadata) {
65
- return isFederatedAuthMethod(metadata.authMethod);
65
+ return metadata.authMethod !== void 0 && isFederatedAuthMethod(metadata.authMethod);
66
66
  }
67
67
 
68
68
  //#endregion
@@ -75,7 +75,7 @@ const athenaMetadataSchema = zod.z.object({
75
75
  workgroup: zod.z.string().optional()
76
76
  });
77
77
  const bigqueryMetadataSchema = zod.z.discriminatedUnion("authMethod", [zod.z.object({
78
- authMethod: zod.z.literal(BigQueryAuthMethods.ServiceAccount),
78
+ authMethod: zod.z.literal(BigQueryAuthMethods.ServiceAccount).optional(),
79
79
  service_account: zod.z.string()
80
80
  }), zod.z.object({
81
81
  authMethod: zod.z.literal(BigQueryAuthMethods.GoogleOauth),
@@ -229,6 +229,7 @@ const trinoBaseMetadataSchema = zod.z.object({
229
229
  caCertificateText: zod.z.string().optional()
230
230
  });
231
231
  const trinoUsernamePasswordMetadataSchema = trinoBaseMetadataSchema.extend({
232
+ authMethod: zod.z.literal(TrinoAuthMethods.Password).nullish(),
232
233
  user: zod.z.string(),
233
234
  password: zod.z.string()
234
235
  });
@@ -239,11 +240,7 @@ const trinoOAuthMetadataSchema = trinoBaseMetadataSchema.extend({
239
240
  authUrl: zod.z.string().url(),
240
241
  tokenUrl: zod.z.string().url()
241
242
  });
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
- ]);
243
+ const trinoMetadataSchema = zod.z.discriminatedUnion("authMethod", [trinoUsernamePasswordMetadataSchema, trinoOAuthMetadataSchema]);
247
244
  const commonDatabaseSchema = zod.z.object({
248
245
  host: zod.z.string(),
249
246
  user: zod.z.string(),
package/dist/index.d.cts CHANGED
@@ -152,14 +152,14 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
152
152
  } & {
153
153
  type: z$1.ZodLiteral<"big-query">;
154
154
  metadata: z$1.ZodDiscriminatedUnion<"authMethod", [z$1.ZodObject<{
155
- authMethod: z$1.ZodLiteral<"service-account">;
155
+ authMethod: z$1.ZodOptional<z$1.ZodLiteral<"service-account">>;
156
156
  service_account: z$1.ZodString;
157
157
  }, "strip", z$1.ZodTypeAny, {
158
- authMethod: "service-account";
159
158
  service_account: string;
159
+ authMethod?: "service-account" | undefined;
160
160
  }, {
161
- authMethod: "service-account";
162
161
  service_account: string;
162
+ authMethod?: "service-account" | undefined;
163
163
  }>, z$1.ZodObject<{
164
164
  authMethod: z$1.ZodLiteral<"google-oauth">;
165
165
  project: z$1.ZodString;
@@ -182,8 +182,8 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
182
182
  id: string;
183
183
  name: string;
184
184
  metadata: {
185
- authMethod: "service-account";
186
185
  service_account: string;
186
+ authMethod?: "service-account" | undefined;
187
187
  } | {
188
188
  authMethod: "google-oauth";
189
189
  project: string;
@@ -196,8 +196,8 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
196
196
  id: string;
197
197
  name: string;
198
198
  metadata: {
199
- authMethod: "service-account";
200
199
  service_account: string;
200
+ authMethod?: "service-account" | undefined;
201
201
  } | {
202
202
  authMethod: "google-oauth";
203
203
  project: string;
@@ -1624,16 +1624,14 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1624
1624
  caCertificateName: z$1.ZodOptional<z$1.ZodString>;
1625
1625
  caCertificateText: z$1.ZodOptional<z$1.ZodString>;
1626
1626
  } & {
1627
+ authMethod: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodLiteral<"password">>>;
1627
1628
  user: z$1.ZodString;
1628
1629
  password: z$1.ZodString;
1629
- } & {
1630
- authMethod: z$1.ZodLiteral<null>;
1631
1630
  }, "strip", z$1.ZodTypeAny, {
1632
1631
  host: string;
1633
1632
  user: string;
1634
1633
  password: string;
1635
1634
  database: string;
1636
- authMethod: null;
1637
1635
  sshEnabled?: boolean | undefined;
1638
1636
  sshHost?: string | undefined;
1639
1637
  sshPort?: string | undefined;
@@ -1642,12 +1640,12 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1642
1640
  sslEnabled?: boolean | undefined;
1643
1641
  caCertificateName?: string | undefined;
1644
1642
  caCertificateText?: string | undefined;
1643
+ authMethod?: "password" | null | undefined;
1645
1644
  }, {
1646
1645
  host: string;
1647
1646
  user: string;
1648
1647
  password: string;
1649
1648
  database: string;
1650
- authMethod: null;
1651
1649
  sshEnabled?: boolean | undefined;
1652
1650
  sshHost?: string | undefined;
1653
1651
  sshPort?: string | undefined;
@@ -1656,6 +1654,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1656
1654
  sslEnabled?: boolean | undefined;
1657
1655
  caCertificateName?: string | undefined;
1658
1656
  caCertificateText?: string | undefined;
1657
+ authMethod?: "password" | null | undefined;
1659
1658
  }>, z$1.ZodObject<{
1660
1659
  host: z$1.ZodString;
1661
1660
  port: z$1.ZodOptional<z$1.ZodString>;
@@ -1668,51 +1667,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1668
1667
  caCertificateName: z$1.ZodOptional<z$1.ZodString>;
1669
1668
  caCertificateText: z$1.ZodOptional<z$1.ZodString>;
1670
1669
  } & {
1671
- user: z$1.ZodString;
1672
- password: z$1.ZodString;
1673
- } & {
1674
- authMethod: z$1.ZodLiteral<"password">;
1675
- }, "strip", z$1.ZodTypeAny, {
1676
- host: string;
1677
- user: string;
1678
- password: string;
1679
- database: string;
1680
- authMethod: "password";
1681
- sshEnabled?: boolean | undefined;
1682
- sshHost?: string | undefined;
1683
- sshPort?: string | undefined;
1684
- sshUser?: string | undefined;
1685
- port?: string | undefined;
1686
- sslEnabled?: boolean | undefined;
1687
- caCertificateName?: string | undefined;
1688
- caCertificateText?: string | undefined;
1689
- }, {
1690
- host: string;
1691
- user: string;
1692
- password: string;
1693
- database: string;
1694
- authMethod: "password";
1695
- sshEnabled?: boolean | undefined;
1696
- sshHost?: string | undefined;
1697
- sshPort?: string | undefined;
1698
- sshUser?: string | undefined;
1699
- port?: string | undefined;
1700
- sslEnabled?: boolean | undefined;
1701
- caCertificateName?: string | undefined;
1702
- caCertificateText?: string | undefined;
1703
- }>, z$1.ZodObject<{
1704
- host: z$1.ZodString;
1705
- port: z$1.ZodOptional<z$1.ZodString>;
1706
- database: z$1.ZodString;
1707
- sshEnabled: z$1.ZodOptional<z$1.ZodBoolean>;
1708
- sshHost: z$1.ZodOptional<z$1.ZodString>;
1709
- sshPort: z$1.ZodOptional<z$1.ZodString>;
1710
- sshUser: z$1.ZodOptional<z$1.ZodString>;
1711
- sslEnabled: z$1.ZodOptional<z$1.ZodBoolean>;
1712
- caCertificateName: z$1.ZodOptional<z$1.ZodString>;
1713
- caCertificateText: z$1.ZodOptional<z$1.ZodString>;
1714
- } & {
1715
- authMethod: z$1.ZodLiteral<"oauth">;
1670
+ authMethod: z$1.ZodLiteral<"trino-oauth">;
1716
1671
  clientId: z$1.ZodString;
1717
1672
  clientSecret: z$1.ZodString;
1718
1673
  authUrl: z$1.ZodString;
@@ -1720,7 +1675,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1720
1675
  }, "strip", z$1.ZodTypeAny, {
1721
1676
  host: string;
1722
1677
  database: string;
1723
- authMethod: "oauth";
1678
+ authMethod: "trino-oauth";
1724
1679
  clientId: string;
1725
1680
  clientSecret: string;
1726
1681
  authUrl: string;
@@ -1736,7 +1691,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1736
1691
  }, {
1737
1692
  host: string;
1738
1693
  database: string;
1739
- authMethod: "oauth";
1694
+ authMethod: "trino-oauth";
1740
1695
  clientId: string;
1741
1696
  clientSecret: string;
1742
1697
  authUrl: string;
@@ -1760,21 +1715,6 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1760
1715
  user: string;
1761
1716
  password: string;
1762
1717
  database: string;
1763
- authMethod: null;
1764
- sshEnabled?: boolean | undefined;
1765
- sshHost?: string | undefined;
1766
- sshPort?: string | undefined;
1767
- sshUser?: string | undefined;
1768
- port?: string | undefined;
1769
- sslEnabled?: boolean | undefined;
1770
- caCertificateName?: string | undefined;
1771
- caCertificateText?: string | undefined;
1772
- } | {
1773
- host: string;
1774
- user: string;
1775
- password: string;
1776
- database: string;
1777
- authMethod: "password";
1778
1718
  sshEnabled?: boolean | undefined;
1779
1719
  sshHost?: string | undefined;
1780
1720
  sshPort?: string | undefined;
@@ -1783,10 +1723,11 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1783
1723
  sslEnabled?: boolean | undefined;
1784
1724
  caCertificateName?: string | undefined;
1785
1725
  caCertificateText?: string | undefined;
1726
+ authMethod?: "password" | null | undefined;
1786
1727
  } | {
1787
1728
  host: string;
1788
1729
  database: string;
1789
- authMethod: "oauth";
1730
+ authMethod: "trino-oauth";
1790
1731
  clientId: string;
1791
1732
  clientSecret: string;
1792
1733
  authUrl: string;
@@ -1810,7 +1751,6 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1810
1751
  user: string;
1811
1752
  password: string;
1812
1753
  database: string;
1813
- authMethod: null;
1814
1754
  sshEnabled?: boolean | undefined;
1815
1755
  sshHost?: string | undefined;
1816
1756
  sshPort?: string | undefined;
@@ -1819,24 +1759,11 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1819
1759
  sslEnabled?: boolean | undefined;
1820
1760
  caCertificateName?: string | undefined;
1821
1761
  caCertificateText?: string | undefined;
1762
+ authMethod?: "password" | null | undefined;
1822
1763
  } | {
1823
1764
  host: string;
1824
- user: string;
1825
- password: string;
1826
1765
  database: string;
1827
- authMethod: "password";
1828
- sshEnabled?: boolean | undefined;
1829
- sshHost?: string | undefined;
1830
- sshPort?: string | undefined;
1831
- sshUser?: string | undefined;
1832
- port?: string | undefined;
1833
- sslEnabled?: boolean | undefined;
1834
- caCertificateName?: string | undefined;
1835
- caCertificateText?: string | undefined;
1836
- } | {
1837
- host: string;
1838
- database: string;
1839
- authMethod: "oauth";
1766
+ authMethod: "trino-oauth";
1840
1767
  clientId: string;
1841
1768
  clientSecret: string;
1842
1769
  authUrl: string;
@@ -1920,14 +1847,14 @@ declare const databaseMetadataSchemasByType: {
1920
1847
  workgroup?: string | undefined;
1921
1848
  }>;
1922
1849
  readonly 'big-query': z.ZodDiscriminatedUnion<"authMethod", [z.ZodObject<{
1923
- authMethod: z.ZodLiteral<"service-account">;
1850
+ authMethod: z.ZodOptional<z.ZodLiteral<"service-account">>;
1924
1851
  service_account: z.ZodString;
1925
1852
  }, "strip", z.ZodTypeAny, {
1926
- authMethod: "service-account";
1927
1853
  service_account: string;
1854
+ authMethod?: "service-account" | undefined;
1928
1855
  }, {
1929
- authMethod: "service-account";
1930
1856
  service_account: string;
1857
+ authMethod?: "service-account" | undefined;
1931
1858
  }>, z.ZodObject<{
1932
1859
  authMethod: z.ZodLiteral<"google-oauth">;
1933
1860
  project: z.ZodString;
@@ -2699,16 +2626,14 @@ declare const databaseMetadataSchemasByType: {
2699
2626
  caCertificateName: z.ZodOptional<z.ZodString>;
2700
2627
  caCertificateText: z.ZodOptional<z.ZodString>;
2701
2628
  } & {
2629
+ authMethod: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"password">>>;
2702
2630
  user: z.ZodString;
2703
2631
  password: z.ZodString;
2704
- } & {
2705
- authMethod: z.ZodLiteral<null>;
2706
2632
  }, "strip", z.ZodTypeAny, {
2707
2633
  host: string;
2708
2634
  user: string;
2709
2635
  password: string;
2710
2636
  database: string;
2711
- authMethod: null;
2712
2637
  sshEnabled?: boolean | undefined;
2713
2638
  sshHost?: string | undefined;
2714
2639
  sshPort?: string | undefined;
@@ -2717,56 +2642,12 @@ declare const databaseMetadataSchemasByType: {
2717
2642
  sslEnabled?: boolean | undefined;
2718
2643
  caCertificateName?: string | undefined;
2719
2644
  caCertificateText?: string | undefined;
2645
+ authMethod?: "password" | null | undefined;
2720
2646
  }, {
2721
2647
  host: string;
2722
2648
  user: string;
2723
2649
  password: string;
2724
2650
  database: string;
2725
- authMethod: null;
2726
- sshEnabled?: boolean | undefined;
2727
- sshHost?: string | undefined;
2728
- sshPort?: string | undefined;
2729
- sshUser?: string | undefined;
2730
- port?: string | undefined;
2731
- sslEnabled?: boolean | undefined;
2732
- caCertificateName?: string | undefined;
2733
- caCertificateText?: string | undefined;
2734
- }>, z.ZodObject<{
2735
- host: z.ZodString;
2736
- port: z.ZodOptional<z.ZodString>;
2737
- database: z.ZodString;
2738
- sshEnabled: z.ZodOptional<z.ZodBoolean>;
2739
- sshHost: z.ZodOptional<z.ZodString>;
2740
- sshPort: z.ZodOptional<z.ZodString>;
2741
- sshUser: z.ZodOptional<z.ZodString>;
2742
- sslEnabled: z.ZodOptional<z.ZodBoolean>;
2743
- caCertificateName: z.ZodOptional<z.ZodString>;
2744
- caCertificateText: z.ZodOptional<z.ZodString>;
2745
- } & {
2746
- user: z.ZodString;
2747
- password: z.ZodString;
2748
- } & {
2749
- authMethod: z.ZodLiteral<"password">;
2750
- }, "strip", z.ZodTypeAny, {
2751
- host: string;
2752
- user: string;
2753
- password: string;
2754
- database: string;
2755
- authMethod: "password";
2756
- sshEnabled?: boolean | undefined;
2757
- sshHost?: string | undefined;
2758
- sshPort?: string | undefined;
2759
- sshUser?: string | undefined;
2760
- port?: string | undefined;
2761
- sslEnabled?: boolean | undefined;
2762
- caCertificateName?: string | undefined;
2763
- caCertificateText?: string | undefined;
2764
- }, {
2765
- host: string;
2766
- user: string;
2767
- password: string;
2768
- database: string;
2769
- authMethod: "password";
2770
2651
  sshEnabled?: boolean | undefined;
2771
2652
  sshHost?: string | undefined;
2772
2653
  sshPort?: string | undefined;
@@ -2775,6 +2656,7 @@ declare const databaseMetadataSchemasByType: {
2775
2656
  sslEnabled?: boolean | undefined;
2776
2657
  caCertificateName?: string | undefined;
2777
2658
  caCertificateText?: string | undefined;
2659
+ authMethod?: "password" | null | undefined;
2778
2660
  }>, z.ZodObject<{
2779
2661
  host: z.ZodString;
2780
2662
  port: z.ZodOptional<z.ZodString>;
@@ -2787,7 +2669,7 @@ declare const databaseMetadataSchemasByType: {
2787
2669
  caCertificateName: z.ZodOptional<z.ZodString>;
2788
2670
  caCertificateText: z.ZodOptional<z.ZodString>;
2789
2671
  } & {
2790
- authMethod: z.ZodLiteral<"oauth">;
2672
+ authMethod: z.ZodLiteral<"trino-oauth">;
2791
2673
  clientId: z.ZodString;
2792
2674
  clientSecret: z.ZodString;
2793
2675
  authUrl: z.ZodString;
@@ -2795,7 +2677,7 @@ declare const databaseMetadataSchemasByType: {
2795
2677
  }, "strip", z.ZodTypeAny, {
2796
2678
  host: string;
2797
2679
  database: string;
2798
- authMethod: "oauth";
2680
+ authMethod: "trino-oauth";
2799
2681
  clientId: string;
2800
2682
  clientSecret: string;
2801
2683
  authUrl: string;
@@ -2811,7 +2693,7 @@ declare const databaseMetadataSchemasByType: {
2811
2693
  }, {
2812
2694
  host: string;
2813
2695
  database: string;
2814
- authMethod: "oauth";
2696
+ authMethod: "trino-oauth";
2815
2697
  clientId: string;
2816
2698
  clientSecret: string;
2817
2699
  authUrl: string;
@@ -2912,7 +2794,7 @@ declare const BigQueryAuthMethods: {
2912
2794
  type BigQueryAuthMethod = (typeof BigQueryAuthMethods)[keyof typeof BigQueryAuthMethods];
2913
2795
  declare const TrinoAuthMethods: {
2914
2796
  readonly Password: "password";
2915
- readonly Oauth: "oauth";
2797
+ readonly Oauth: "trino-oauth";
2916
2798
  };
2917
2799
  type TrinoAuthMethod = (typeof TrinoAuthMethods)[keyof typeof TrinoAuthMethods];
2918
2800
  declare const DatabaseAuthMethods: {
@@ -2920,11 +2802,11 @@ declare const DatabaseAuthMethods: {
2920
2802
  readonly IndividualCredentials: "individual-credentials";
2921
2803
  };
2922
2804
  type DatabaseAuthMethod = (typeof DatabaseAuthMethods)[keyof typeof DatabaseAuthMethods];
2923
- declare const federatedAuthMethods: readonly ["okta", "snowflake", "azure", "key-pair", "google-oauth", "individual-credentials", "oauth"];
2805
+ declare const federatedAuthMethods: readonly ["okta", "snowflake", "azure", "key-pair", "google-oauth", "individual-credentials", "trino-oauth"];
2924
2806
  type FederatedAuthMethod = (typeof federatedAuthMethods)[number];
2925
2807
  declare function isFederatedAuthMethod(authMethod: string): authMethod is FederatedAuthMethod;
2926
2808
  declare function isFederatedAuthMetadata<M extends {
2927
- authMethod: string;
2809
+ authMethod?: string;
2928
2810
  }>(metadata: M): metadata is Extract<M, {
2929
2811
  authMethod: FederatedAuthMethod;
2930
2812
  }>;
package/dist/index.d.ts CHANGED
@@ -152,14 +152,14 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
152
152
  } & {
153
153
  type: z$1.ZodLiteral<"big-query">;
154
154
  metadata: z$1.ZodDiscriminatedUnion<"authMethod", [z$1.ZodObject<{
155
- authMethod: z$1.ZodLiteral<"service-account">;
155
+ authMethod: z$1.ZodOptional<z$1.ZodLiteral<"service-account">>;
156
156
  service_account: z$1.ZodString;
157
157
  }, "strip", z$1.ZodTypeAny, {
158
- authMethod: "service-account";
159
158
  service_account: string;
159
+ authMethod?: "service-account" | undefined;
160
160
  }, {
161
- authMethod: "service-account";
162
161
  service_account: string;
162
+ authMethod?: "service-account" | undefined;
163
163
  }>, z$1.ZodObject<{
164
164
  authMethod: z$1.ZodLiteral<"google-oauth">;
165
165
  project: z$1.ZodString;
@@ -182,8 +182,8 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
182
182
  id: string;
183
183
  name: string;
184
184
  metadata: {
185
- authMethod: "service-account";
186
185
  service_account: string;
186
+ authMethod?: "service-account" | undefined;
187
187
  } | {
188
188
  authMethod: "google-oauth";
189
189
  project: string;
@@ -196,8 +196,8 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
196
196
  id: string;
197
197
  name: string;
198
198
  metadata: {
199
- authMethod: "service-account";
200
199
  service_account: string;
200
+ authMethod?: "service-account" | undefined;
201
201
  } | {
202
202
  authMethod: "google-oauth";
203
203
  project: string;
@@ -1624,16 +1624,14 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1624
1624
  caCertificateName: z$1.ZodOptional<z$1.ZodString>;
1625
1625
  caCertificateText: z$1.ZodOptional<z$1.ZodString>;
1626
1626
  } & {
1627
+ authMethod: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodLiteral<"password">>>;
1627
1628
  user: z$1.ZodString;
1628
1629
  password: z$1.ZodString;
1629
- } & {
1630
- authMethod: z$1.ZodLiteral<null>;
1631
1630
  }, "strip", z$1.ZodTypeAny, {
1632
1631
  host: string;
1633
1632
  user: string;
1634
1633
  password: string;
1635
1634
  database: string;
1636
- authMethod: null;
1637
1635
  sshEnabled?: boolean | undefined;
1638
1636
  sshHost?: string | undefined;
1639
1637
  sshPort?: string | undefined;
@@ -1642,12 +1640,12 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1642
1640
  sslEnabled?: boolean | undefined;
1643
1641
  caCertificateName?: string | undefined;
1644
1642
  caCertificateText?: string | undefined;
1643
+ authMethod?: "password" | null | undefined;
1645
1644
  }, {
1646
1645
  host: string;
1647
1646
  user: string;
1648
1647
  password: string;
1649
1648
  database: string;
1650
- authMethod: null;
1651
1649
  sshEnabled?: boolean | undefined;
1652
1650
  sshHost?: string | undefined;
1653
1651
  sshPort?: string | undefined;
@@ -1656,6 +1654,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1656
1654
  sslEnabled?: boolean | undefined;
1657
1655
  caCertificateName?: string | undefined;
1658
1656
  caCertificateText?: string | undefined;
1657
+ authMethod?: "password" | null | undefined;
1659
1658
  }>, z$1.ZodObject<{
1660
1659
  host: z$1.ZodString;
1661
1660
  port: z$1.ZodOptional<z$1.ZodString>;
@@ -1668,51 +1667,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1668
1667
  caCertificateName: z$1.ZodOptional<z$1.ZodString>;
1669
1668
  caCertificateText: z$1.ZodOptional<z$1.ZodString>;
1670
1669
  } & {
1671
- user: z$1.ZodString;
1672
- password: z$1.ZodString;
1673
- } & {
1674
- authMethod: z$1.ZodLiteral<"password">;
1675
- }, "strip", z$1.ZodTypeAny, {
1676
- host: string;
1677
- user: string;
1678
- password: string;
1679
- database: string;
1680
- authMethod: "password";
1681
- sshEnabled?: boolean | undefined;
1682
- sshHost?: string | undefined;
1683
- sshPort?: string | undefined;
1684
- sshUser?: string | undefined;
1685
- port?: string | undefined;
1686
- sslEnabled?: boolean | undefined;
1687
- caCertificateName?: string | undefined;
1688
- caCertificateText?: string | undefined;
1689
- }, {
1690
- host: string;
1691
- user: string;
1692
- password: string;
1693
- database: string;
1694
- authMethod: "password";
1695
- sshEnabled?: boolean | undefined;
1696
- sshHost?: string | undefined;
1697
- sshPort?: string | undefined;
1698
- sshUser?: string | undefined;
1699
- port?: string | undefined;
1700
- sslEnabled?: boolean | undefined;
1701
- caCertificateName?: string | undefined;
1702
- caCertificateText?: string | undefined;
1703
- }>, z$1.ZodObject<{
1704
- host: z$1.ZodString;
1705
- port: z$1.ZodOptional<z$1.ZodString>;
1706
- database: z$1.ZodString;
1707
- sshEnabled: z$1.ZodOptional<z$1.ZodBoolean>;
1708
- sshHost: z$1.ZodOptional<z$1.ZodString>;
1709
- sshPort: z$1.ZodOptional<z$1.ZodString>;
1710
- sshUser: z$1.ZodOptional<z$1.ZodString>;
1711
- sslEnabled: z$1.ZodOptional<z$1.ZodBoolean>;
1712
- caCertificateName: z$1.ZodOptional<z$1.ZodString>;
1713
- caCertificateText: z$1.ZodOptional<z$1.ZodString>;
1714
- } & {
1715
- authMethod: z$1.ZodLiteral<"oauth">;
1670
+ authMethod: z$1.ZodLiteral<"trino-oauth">;
1716
1671
  clientId: z$1.ZodString;
1717
1672
  clientSecret: z$1.ZodString;
1718
1673
  authUrl: z$1.ZodString;
@@ -1720,7 +1675,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1720
1675
  }, "strip", z$1.ZodTypeAny, {
1721
1676
  host: string;
1722
1677
  database: string;
1723
- authMethod: "oauth";
1678
+ authMethod: "trino-oauth";
1724
1679
  clientId: string;
1725
1680
  clientSecret: string;
1726
1681
  authUrl: string;
@@ -1736,7 +1691,7 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1736
1691
  }, {
1737
1692
  host: string;
1738
1693
  database: string;
1739
- authMethod: "oauth";
1694
+ authMethod: "trino-oauth";
1740
1695
  clientId: string;
1741
1696
  clientSecret: string;
1742
1697
  authUrl: string;
@@ -1760,21 +1715,6 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1760
1715
  user: string;
1761
1716
  password: string;
1762
1717
  database: string;
1763
- authMethod: null;
1764
- sshEnabled?: boolean | undefined;
1765
- sshHost?: string | undefined;
1766
- sshPort?: string | undefined;
1767
- sshUser?: string | undefined;
1768
- port?: string | undefined;
1769
- sslEnabled?: boolean | undefined;
1770
- caCertificateName?: string | undefined;
1771
- caCertificateText?: string | undefined;
1772
- } | {
1773
- host: string;
1774
- user: string;
1775
- password: string;
1776
- database: string;
1777
- authMethod: "password";
1778
1718
  sshEnabled?: boolean | undefined;
1779
1719
  sshHost?: string | undefined;
1780
1720
  sshPort?: string | undefined;
@@ -1783,10 +1723,11 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1783
1723
  sslEnabled?: boolean | undefined;
1784
1724
  caCertificateName?: string | undefined;
1785
1725
  caCertificateText?: string | undefined;
1726
+ authMethod?: "password" | null | undefined;
1786
1727
  } | {
1787
1728
  host: string;
1788
1729
  database: string;
1789
- authMethod: "oauth";
1730
+ authMethod: "trino-oauth";
1790
1731
  clientId: string;
1791
1732
  clientSecret: string;
1792
1733
  authUrl: string;
@@ -1810,7 +1751,6 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1810
1751
  user: string;
1811
1752
  password: string;
1812
1753
  database: string;
1813
- authMethod: null;
1814
1754
  sshEnabled?: boolean | undefined;
1815
1755
  sshHost?: string | undefined;
1816
1756
  sshPort?: string | undefined;
@@ -1819,24 +1759,11 @@ declare const databaseIntegrationConfigSchema: z$1.ZodDiscriminatedUnion<"type",
1819
1759
  sslEnabled?: boolean | undefined;
1820
1760
  caCertificateName?: string | undefined;
1821
1761
  caCertificateText?: string | undefined;
1762
+ authMethod?: "password" | null | undefined;
1822
1763
  } | {
1823
1764
  host: string;
1824
- user: string;
1825
- password: string;
1826
1765
  database: string;
1827
- authMethod: "password";
1828
- sshEnabled?: boolean | undefined;
1829
- sshHost?: string | undefined;
1830
- sshPort?: string | undefined;
1831
- sshUser?: string | undefined;
1832
- port?: string | undefined;
1833
- sslEnabled?: boolean | undefined;
1834
- caCertificateName?: string | undefined;
1835
- caCertificateText?: string | undefined;
1836
- } | {
1837
- host: string;
1838
- database: string;
1839
- authMethod: "oauth";
1766
+ authMethod: "trino-oauth";
1840
1767
  clientId: string;
1841
1768
  clientSecret: string;
1842
1769
  authUrl: string;
@@ -1920,14 +1847,14 @@ declare const databaseMetadataSchemasByType: {
1920
1847
  workgroup?: string | undefined;
1921
1848
  }>;
1922
1849
  readonly 'big-query': z.ZodDiscriminatedUnion<"authMethod", [z.ZodObject<{
1923
- authMethod: z.ZodLiteral<"service-account">;
1850
+ authMethod: z.ZodOptional<z.ZodLiteral<"service-account">>;
1924
1851
  service_account: z.ZodString;
1925
1852
  }, "strip", z.ZodTypeAny, {
1926
- authMethod: "service-account";
1927
1853
  service_account: string;
1854
+ authMethod?: "service-account" | undefined;
1928
1855
  }, {
1929
- authMethod: "service-account";
1930
1856
  service_account: string;
1857
+ authMethod?: "service-account" | undefined;
1931
1858
  }>, z.ZodObject<{
1932
1859
  authMethod: z.ZodLiteral<"google-oauth">;
1933
1860
  project: z.ZodString;
@@ -2699,16 +2626,14 @@ declare const databaseMetadataSchemasByType: {
2699
2626
  caCertificateName: z.ZodOptional<z.ZodString>;
2700
2627
  caCertificateText: z.ZodOptional<z.ZodString>;
2701
2628
  } & {
2629
+ authMethod: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"password">>>;
2702
2630
  user: z.ZodString;
2703
2631
  password: z.ZodString;
2704
- } & {
2705
- authMethod: z.ZodLiteral<null>;
2706
2632
  }, "strip", z.ZodTypeAny, {
2707
2633
  host: string;
2708
2634
  user: string;
2709
2635
  password: string;
2710
2636
  database: string;
2711
- authMethod: null;
2712
2637
  sshEnabled?: boolean | undefined;
2713
2638
  sshHost?: string | undefined;
2714
2639
  sshPort?: string | undefined;
@@ -2717,56 +2642,12 @@ declare const databaseMetadataSchemasByType: {
2717
2642
  sslEnabled?: boolean | undefined;
2718
2643
  caCertificateName?: string | undefined;
2719
2644
  caCertificateText?: string | undefined;
2645
+ authMethod?: "password" | null | undefined;
2720
2646
  }, {
2721
2647
  host: string;
2722
2648
  user: string;
2723
2649
  password: string;
2724
2650
  database: string;
2725
- authMethod: null;
2726
- sshEnabled?: boolean | undefined;
2727
- sshHost?: string | undefined;
2728
- sshPort?: string | undefined;
2729
- sshUser?: string | undefined;
2730
- port?: string | undefined;
2731
- sslEnabled?: boolean | undefined;
2732
- caCertificateName?: string | undefined;
2733
- caCertificateText?: string | undefined;
2734
- }>, z.ZodObject<{
2735
- host: z.ZodString;
2736
- port: z.ZodOptional<z.ZodString>;
2737
- database: z.ZodString;
2738
- sshEnabled: z.ZodOptional<z.ZodBoolean>;
2739
- sshHost: z.ZodOptional<z.ZodString>;
2740
- sshPort: z.ZodOptional<z.ZodString>;
2741
- sshUser: z.ZodOptional<z.ZodString>;
2742
- sslEnabled: z.ZodOptional<z.ZodBoolean>;
2743
- caCertificateName: z.ZodOptional<z.ZodString>;
2744
- caCertificateText: z.ZodOptional<z.ZodString>;
2745
- } & {
2746
- user: z.ZodString;
2747
- password: z.ZodString;
2748
- } & {
2749
- authMethod: z.ZodLiteral<"password">;
2750
- }, "strip", z.ZodTypeAny, {
2751
- host: string;
2752
- user: string;
2753
- password: string;
2754
- database: string;
2755
- authMethod: "password";
2756
- sshEnabled?: boolean | undefined;
2757
- sshHost?: string | undefined;
2758
- sshPort?: string | undefined;
2759
- sshUser?: string | undefined;
2760
- port?: string | undefined;
2761
- sslEnabled?: boolean | undefined;
2762
- caCertificateName?: string | undefined;
2763
- caCertificateText?: string | undefined;
2764
- }, {
2765
- host: string;
2766
- user: string;
2767
- password: string;
2768
- database: string;
2769
- authMethod: "password";
2770
2651
  sshEnabled?: boolean | undefined;
2771
2652
  sshHost?: string | undefined;
2772
2653
  sshPort?: string | undefined;
@@ -2775,6 +2656,7 @@ declare const databaseMetadataSchemasByType: {
2775
2656
  sslEnabled?: boolean | undefined;
2776
2657
  caCertificateName?: string | undefined;
2777
2658
  caCertificateText?: string | undefined;
2659
+ authMethod?: "password" | null | undefined;
2778
2660
  }>, z.ZodObject<{
2779
2661
  host: z.ZodString;
2780
2662
  port: z.ZodOptional<z.ZodString>;
@@ -2787,7 +2669,7 @@ declare const databaseMetadataSchemasByType: {
2787
2669
  caCertificateName: z.ZodOptional<z.ZodString>;
2788
2670
  caCertificateText: z.ZodOptional<z.ZodString>;
2789
2671
  } & {
2790
- authMethod: z.ZodLiteral<"oauth">;
2672
+ authMethod: z.ZodLiteral<"trino-oauth">;
2791
2673
  clientId: z.ZodString;
2792
2674
  clientSecret: z.ZodString;
2793
2675
  authUrl: z.ZodString;
@@ -2795,7 +2677,7 @@ declare const databaseMetadataSchemasByType: {
2795
2677
  }, "strip", z.ZodTypeAny, {
2796
2678
  host: string;
2797
2679
  database: string;
2798
- authMethod: "oauth";
2680
+ authMethod: "trino-oauth";
2799
2681
  clientId: string;
2800
2682
  clientSecret: string;
2801
2683
  authUrl: string;
@@ -2811,7 +2693,7 @@ declare const databaseMetadataSchemasByType: {
2811
2693
  }, {
2812
2694
  host: string;
2813
2695
  database: string;
2814
- authMethod: "oauth";
2696
+ authMethod: "trino-oauth";
2815
2697
  clientId: string;
2816
2698
  clientSecret: string;
2817
2699
  authUrl: string;
@@ -2912,7 +2794,7 @@ declare const BigQueryAuthMethods: {
2912
2794
  type BigQueryAuthMethod = (typeof BigQueryAuthMethods)[keyof typeof BigQueryAuthMethods];
2913
2795
  declare const TrinoAuthMethods: {
2914
2796
  readonly Password: "password";
2915
- readonly Oauth: "oauth";
2797
+ readonly Oauth: "trino-oauth";
2916
2798
  };
2917
2799
  type TrinoAuthMethod = (typeof TrinoAuthMethods)[keyof typeof TrinoAuthMethods];
2918
2800
  declare const DatabaseAuthMethods: {
@@ -2920,11 +2802,11 @@ declare const DatabaseAuthMethods: {
2920
2802
  readonly IndividualCredentials: "individual-credentials";
2921
2803
  };
2922
2804
  type DatabaseAuthMethod = (typeof DatabaseAuthMethods)[keyof typeof DatabaseAuthMethods];
2923
- declare const federatedAuthMethods: readonly ["okta", "snowflake", "azure", "key-pair", "google-oauth", "individual-credentials", "oauth"];
2805
+ declare const federatedAuthMethods: readonly ["okta", "snowflake", "azure", "key-pair", "google-oauth", "individual-credentials", "trino-oauth"];
2924
2806
  type FederatedAuthMethod = (typeof federatedAuthMethods)[number];
2925
2807
  declare function isFederatedAuthMethod(authMethod: string): authMethod is FederatedAuthMethod;
2926
2808
  declare function isFederatedAuthMetadata<M extends {
2927
- authMethod: string;
2809
+ authMethod?: string;
2928
2810
  }>(metadata: M): metadata is Extract<M, {
2929
2811
  authMethod: FederatedAuthMethod;
2930
2812
  }>;
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ const BigQueryAuthMethods = {
19
19
  };
20
20
  const TrinoAuthMethods = {
21
21
  Password: "password",
22
- Oauth: "oauth"
22
+ Oauth: "trino-oauth"
23
23
  };
24
24
  const DatabaseAuthMethods = {
25
25
  UsernameAndPassword: "username-and-password",
@@ -38,7 +38,7 @@ function isFederatedAuthMethod(authMethod) {
38
38
  return federatedAuthMethods.includes(authMethod);
39
39
  }
40
40
  function isFederatedAuthMetadata(metadata) {
41
- return isFederatedAuthMethod(metadata.authMethod);
41
+ return metadata.authMethod !== void 0 && isFederatedAuthMethod(metadata.authMethod);
42
42
  }
43
43
 
44
44
  //#endregion
@@ -51,7 +51,7 @@ const athenaMetadataSchema = z.object({
51
51
  workgroup: z.string().optional()
52
52
  });
53
53
  const bigqueryMetadataSchema = z.discriminatedUnion("authMethod", [z.object({
54
- authMethod: z.literal(BigQueryAuthMethods.ServiceAccount),
54
+ authMethod: z.literal(BigQueryAuthMethods.ServiceAccount).optional(),
55
55
  service_account: z.string()
56
56
  }), z.object({
57
57
  authMethod: z.literal(BigQueryAuthMethods.GoogleOauth),
@@ -205,6 +205,7 @@ const trinoBaseMetadataSchema = z.object({
205
205
  caCertificateText: z.string().optional()
206
206
  });
207
207
  const trinoUsernamePasswordMetadataSchema = trinoBaseMetadataSchema.extend({
208
+ authMethod: z.literal(TrinoAuthMethods.Password).nullish(),
208
209
  user: z.string(),
209
210
  password: z.string()
210
211
  });
@@ -215,11 +216,7 @@ const trinoOAuthMetadataSchema = trinoBaseMetadataSchema.extend({
215
216
  authUrl: z.string().url(),
216
217
  tokenUrl: z.string().url()
217
218
  });
218
- const trinoMetadataSchema = z.discriminatedUnion("authMethod", [
219
- trinoUsernamePasswordMetadataSchema.extend({ authMethod: z.literal(null) }),
220
- trinoUsernamePasswordMetadataSchema.extend({ authMethod: z.literal(TrinoAuthMethods.Password) }),
221
- trinoOAuthMetadataSchema
222
- ]);
219
+ const trinoMetadataSchema = z.discriminatedUnion("authMethod", [trinoUsernamePasswordMetadataSchema, trinoOAuthMetadataSchema]);
223
220
  const commonDatabaseSchema = z.object({
224
221
  host: z.string(),
225
222
  user: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnote/database-integrations",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "Deepnote database integration definitions",
5
5
  "keywords": [],
6
6
  "repository": {