Skip to content

Commit 4376e7c

Browse files
committed
fix: expose token manager from core code as a module
1 parent 7fd6471 commit 4376e7c

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

iam-token-manager/v1.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright 2019 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* @module iam-token-manager-v1
19+
*/
20+
21+
import { IamTokenManagerV1 } from 'ibm-cloud-sdk-core/iam-token-manager/v1';
22+
export = IamTokenManagerV1;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
const TokenManagerV1 = require('../../iam-token-manager/v1');
3+
4+
describe('iam token manager', () => {
5+
it('should correctly export the token manager from the core module', () => {
6+
const tokenManager = new TokenManagerV1({});
7+
expect(tokenManager).toBeDefined();
8+
expect(tokenManager.iamUrl).toBeDefined();
9+
expect(tokenManager.tokenInfo).toBeDefined();
10+
expect(tokenManager.getToken).toBeInstanceOf(Function);
11+
expect(tokenManager.setAccessToken).toBeInstanceOf(Function);
12+
});
13+
});

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"./authorization/*.ts",
7272
"./dialog/*.ts",
7373
"./compare-comply/*.ts",
74+
"./iam-token-manager/*.ts",
7475
"index.ts"
7576
]
7677
}

0 commit comments

Comments
 (0)