File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed
platform/notebooks/deepnote Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ export class IntegrationDetector implements IIntegrationDetector {
5353 logger . debug ( `IntegrationDetector: Found integration: ${ integrationId } (${ projectIntegration . type } )` ) ;
5454
5555 // Map the Deepnote integration type to our IntegrationType
56- const integrationType = DEEPNOTE_TO_INTEGRATION_TYPE [ projectIntegration . type ] ;
56+ const integrationType =
57+ DEEPNOTE_TO_INTEGRATION_TYPE [ projectIntegration . type as keyof typeof DEEPNOTE_TO_INTEGRATION_TYPE ] ;
5758
5859 // Skip unknown integration types
5960 if ( ! integrationType ) {
Original file line number Diff line number Diff line change @@ -334,7 +334,8 @@ export class SqlCellStatusBarProvider implements NotebookCellStatusBarItemProvid
334334 continue ;
335335 }
336336
337- const integrationType = DEEPNOTE_TO_INTEGRATION_TYPE [ projectIntegration . type ] ;
337+ const integrationType =
338+ DEEPNOTE_TO_INTEGRATION_TYPE [ projectIntegration . type as keyof typeof DEEPNOTE_TO_INTEGRATION_TYPE ] ;
338339 const typeLabel = integrationType ? this . getIntegrationTypeLabel ( integrationType ) : projectIntegration . type ;
339340
340341 const item : LocalQuickPickItem = {
Original file line number Diff line number Diff line change @@ -12,20 +12,22 @@ export enum IntegrationType {
1212 BigQuery = 'bigquery'
1313}
1414
15- /**
16- * Map Deepnote integration type strings to our IntegrationType enum
17- */
18- export const DEEPNOTE_TO_INTEGRATION_TYPE : { [ type : string ] : IntegrationType } = {
19- pgsql : IntegrationType . Postgres ,
20- 'big-query' : IntegrationType . BigQuery
21- } ;
22-
2315/**
2416 * Map our IntegrationType enum to Deepnote integration type strings
2517 */
26- export const INTEGRATION_TYPE_TO_DEEPNOTE : { [ type in IntegrationType ] : string } = {
18+ export const INTEGRATION_TYPE_TO_DEEPNOTE = {
2719 [ IntegrationType . Postgres ] : 'pgsql' ,
2820 [ IntegrationType . BigQuery ] : 'big-query'
21+ } as const satisfies { [ type in IntegrationType ] : string } ;
22+
23+ type RawIntegrationType = ( typeof INTEGRATION_TYPE_TO_DEEPNOTE ) [ keyof typeof INTEGRATION_TYPE_TO_DEEPNOTE ] ;
24+
25+ /**
26+ * Map Deepnote integration type strings to our IntegrationType enum
27+ */
28+ export const DEEPNOTE_TO_INTEGRATION_TYPE : Record < RawIntegrationType , IntegrationType > = {
29+ pgsql : IntegrationType . Postgres ,
30+ 'big-query' : IntegrationType . BigQuery
2931} ;
3032
3133/**
You can’t perform that action at this time.
0 commit comments