Skip to content

Commit 9563470

Browse files
Polish
Sort imports for future linting integration. Mark default exports for ease of use. Add input validation to data gateway client factory for the token credential.
1 parent 2e00da4 commit 9563470

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/dataGateway/TypeScript/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import type { TokenCredential } from "@azure/core-auth";
21
import { AzureIdentityAuthenticationProvider } from "@microsoft/kiota-authentication-azure";
32
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
3+
import type { TokenCredential } from "@azure/core-auth";
4+
import { assert } from 'typia';
45
import { createDataGatewayClient } from "./sdk/dataGatewayClient.js";
56

67
// Export all of the SDK's types
@@ -11,7 +12,11 @@ export type * from './sdk/models/index.js';
1112
* @param credential Configured authentication session.
1213
* @returns Configured API client that is able to make requests against SHI Data Gateway.
1314
*/
14-
export function dataGatewayClientFactory(credential: TokenCredential) {
15+
export default function dataGatewayClientFactory(credential: TokenCredential) {
16+
// #region Input Validation
17+
assert(credential);
18+
// #endregion Input Validation
19+
1520
/** List of hosts that are allowed when making API calls, this is used to prevent token leaks to threat actors. */
1621
const allowedHostList = new Set(['https://api.shilab.com']);
1722

src/shield/TypeScript/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { TokenCredential } from "@azure/core-auth";
1+
import { assert, assertGuardEquals, tags } from 'typia';
22
import { AzureIdentityAuthenticationProvider } from "@microsoft/kiota-authentication-azure";
33
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
4+
import type { TokenCredential } from "@azure/core-auth";
45
import { createShieldClient } from "./sdk/shieldClient.js";
5-
import { assert, assertGuardEquals, tags } from 'typia';
66

77
// Export all of the SDK's types
88
export type * from './sdk/models/index.js';
@@ -12,7 +12,7 @@ export type * from './sdk/models/index.js';
1212
* @param credential Configured authentication session from Entra ID.
1313
* @returns Configured API client that is able to make requests against the specified SHIELD instance.
1414
*/
15-
export function shieldClientFactory(credential: TokenCredential, baseUrl: string & tags.Format<'hostname'>) {
15+
export default function shieldClientFactory(credential: TokenCredential, baseUrl: string & tags.Format<'hostname'>) {
1616
// #region Input Validation
1717
assert(credential);
1818

0 commit comments

Comments
 (0)