SHIELD - TypeScript SDK
This SDK provides a convenient TypeScript client for interacting with the SHI SHIELD service. It is automatically generated from the OpenAPI specification located at SHIELD.json using Kiota.
All typing data is included in the package.
Installation
Install the SDK using npm:
npm install @shi-corp/sdk-shield
Usage
Here's a basic example of how to use the SDK:
import { DefaultAzureCredential } from '@azure/identity'
import { shieldClientFactory } from '@shi-corp/sdk-shield';
const credential = new DefaultAzureCredential();
const baseUrl = new URL('https://shield.example.com');
const shieldClient = shieldClientFactory(credential, baseUrl, ['b9689d4e-0036-4f2f-8430-07adedb9ae7c/.default']);
const results = await shieldClient.api.discover.status.get();
if (results?.running === true) {
}
Advanced Usage
You can optionally configure the SDK client with a custom base URL, including support for it being nested deep in a L7 load balancer:
const customBaseUrl = debugMode ? new URL('http://localhost:3000') : new URL('https://custom-host.example.com/Ballance/Instance1/');
const customConfiguredClient = shieldClientFactory(credential, customBaseUrl);
and/or scope (permission) list:
const customScopes = ['your-custom-scope/something.read.all', 'your-custom-scope/everything.readwrite.all'];
const customConfiguredClient = shieldClientFactory(credential, void 0, customScopes);
Project Structure
bin/: Compiled JavaScript files and type definitions.
sdk/: Source TypeScript files generated by Kiota.
api/: API endpoint definitions.
models/: Data models used by the SDK.
Development
Prerequisites
Generating the SDK
To regenerate the SDK from the OpenAPI specification, run:
npm run generate:Sdk
Building the SDK
To build the SDK for production, run:
npm run build:Prod
License
This SDK is licensed under the MIT License.
Support
For issues or feature requests, please visit the GitHub Issues page.
For more information, visit the official documentation.