Skip to content

Commit 2567e9c

Browse files
committed
consolidate snowflake types
1 parent 8960026 commit 2567e9c

File tree

3 files changed

+34
-44
lines changed

3 files changed

+34
-44
lines changed

src/platform/notebooks/deepnote/integrationTypes.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,9 @@ export interface BigQueryIntegrationConfig extends BaseIntegrationConfig {
6464
credentials: string; // JSON string of service account credentials
6565
}
6666

67-
/**
68-
* Snowflake authentication methods
69-
*/
70-
export const SnowflakeAuthMethods = {
71-
PASSWORD: 'PASSWORD',
72-
OKTA: 'OKTA',
73-
NATIVE_SNOWFLAKE: 'NATIVE_SNOWFLAKE',
74-
AZURE_AD: 'AZURE_AD',
75-
KEY_PAIR: 'KEY_PAIR',
76-
SERVICE_ACCOUNT_KEY_PAIR: 'SERVICE_ACCOUNT_KEY_PAIR'
77-
} as const;
78-
79-
export type SnowflakeAuthMethod = (typeof SnowflakeAuthMethods)[keyof typeof SnowflakeAuthMethods] | null;
80-
81-
/**
82-
* Supported auth methods that we can configure in VSCode
83-
*/
84-
export const SUPPORTED_SNOWFLAKE_AUTH_METHODS = [
85-
null, // Legacy username+password (no authMethod field)
86-
SnowflakeAuthMethods.PASSWORD,
87-
SnowflakeAuthMethods.SERVICE_ACCOUNT_KEY_PAIR
88-
] as const;
67+
// Import and re-export Snowflake auth constants from shared module
68+
import { SnowflakeAuthMethod, SnowflakeAuthMethods, SUPPORTED_SNOWFLAKE_AUTH_METHODS } from './snowflakeAuthConstants';
69+
export { SnowflakeAuthMethod, SnowflakeAuthMethods, SUPPORTED_SNOWFLAKE_AUTH_METHODS };
8970

9071
/**
9172
* Base Snowflake configuration with common fields
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Snowflake authentication methods
3+
*/
4+
export const SnowflakeAuthMethods = {
5+
PASSWORD: 'PASSWORD',
6+
OKTA: 'OKTA',
7+
NATIVE_SNOWFLAKE: 'NATIVE_SNOWFLAKE',
8+
AZURE_AD: 'AZURE_AD',
9+
KEY_PAIR: 'KEY_PAIR',
10+
SERVICE_ACCOUNT_KEY_PAIR: 'SERVICE_ACCOUNT_KEY_PAIR'
11+
} as const;
12+
13+
export type SnowflakeAuthMethod = (typeof SnowflakeAuthMethods)[keyof typeof SnowflakeAuthMethods] | null;
14+
15+
/**
16+
* Supported auth methods that we can configure in VSCode
17+
*/
18+
export const SUPPORTED_SNOWFLAKE_AUTH_METHODS = [
19+
null, // Legacy username+password (no authMethod field)
20+
SnowflakeAuthMethods.PASSWORD,
21+
SnowflakeAuthMethods.SERVICE_ACCOUNT_KEY_PAIR
22+
] as const;
23+

src/webviews/webview-side/integrations/types.ts

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
1+
import {
2+
SnowflakeAuthMethod,
3+
SnowflakeAuthMethods,
4+
SUPPORTED_SNOWFLAKE_AUTH_METHODS
5+
} from '../../../platform/notebooks/deepnote/snowflakeAuthConstants';
6+
17
export type IntegrationType = 'postgres' | 'bigquery' | 'snowflake';
28

39
export type IntegrationStatus = 'connected' | 'disconnected' | 'error';
410

5-
/**
6-
* Snowflake authentication methods
7-
*/
8-
export const SnowflakeAuthMethods = {
9-
PASSWORD: 'PASSWORD',
10-
OKTA: 'OKTA',
11-
NATIVE_SNOWFLAKE: 'NATIVE_SNOWFLAKE',
12-
AZURE_AD: 'AZURE_AD',
13-
KEY_PAIR: 'KEY_PAIR',
14-
SERVICE_ACCOUNT_KEY_PAIR: 'SERVICE_ACCOUNT_KEY_PAIR'
15-
} as const;
16-
17-
export type SnowflakeAuthMethod = (typeof SnowflakeAuthMethods)[keyof typeof SnowflakeAuthMethods] | null;
18-
19-
/**
20-
* Supported auth methods that we can configure in VSCode
21-
*/
22-
export const SUPPORTED_SNOWFLAKE_AUTH_METHODS = [
23-
null, // Legacy username+password (no authMethod field)
24-
SnowflakeAuthMethods.PASSWORD,
25-
SnowflakeAuthMethods.SERVICE_ACCOUNT_KEY_PAIR
26-
] as const;
11+
// Re-export Snowflake auth constants for convenience
12+
export { SnowflakeAuthMethod, SnowflakeAuthMethods, SUPPORTED_SNOWFLAKE_AUTH_METHODS };
2713

2814
export interface BaseIntegrationConfig {
2915
id: string;

0 commit comments

Comments
 (0)