Skip to content

Commit 90b50d4

Browse files
authored
feat: re-export auth types and ConnectorOptions (fixes #555) (#556)
1 parent ba9a1e8 commit 90b50d4

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

src/connector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class CloudSQLInstanceMap extends Map<string, CacheEntry> {
176176
}
177177
}
178178

179-
interface ConnectorOptions {
179+
export interface ConnectorOptions {
180180
auth?: GoogleAuth<AuthClient> | AuthClient;
181181
sqlAdminAPIEndpoint?: string;
182182
/**

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import {
1616
Connector,
17+
ConnectorOptions,
1718
ConnectionOptions,
1819
DriverOptions,
1920
UnixSocketOptions,
@@ -23,9 +24,11 @@ import {AuthTypes} from './auth-types';
2324

2425
export {
2526
Connector,
27+
type ConnectorOptions,
2628
type ConnectionOptions,
2729
type DriverOptions,
2830
type UnixSocketOptions,
2931
};
3032
export {IpAddressTypes};
3133
export {AuthTypes};
34+
export {GoogleAuth, AuthClient} from 'google-auth-library';

test/exports.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2026 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import t from 'tap';
16+
import {GoogleAuth, AuthClient} from '../src/index';
17+
18+
t.test('should export GoogleAuth and AuthClient', t => {
19+
t.ok(GoogleAuth, 'GoogleAuth should be exported');
20+
t.ok(AuthClient, 'AuthClient should be exported');
21+
t.equal(
22+
typeof GoogleAuth,
23+
'function',
24+
'GoogleAuth should be a constructor function'
25+
);
26+
t.end();
27+
});

0 commit comments

Comments
 (0)