UNPKG

@apistudio/apim-cli

Version:

CLI for API Management Products

39 lines (31 loc) 1.62 kB
// Test importing from the package import { RuntimeInventory, runtimeInventory } from './dist/index.js'; console.log('=== Testing imports from @apic/smith-inventory ==='); // Check if RuntimeInventory class is available console.log('RuntimeInventory class imported:', typeof RuntimeInventory === 'function' ? 'Yes' : 'No'); // Check if runtimeInventory instance is available console.log('runtimeInventory instance imported:', runtimeInventory ? 'Yes' : 'No'); console.log('runtimeInventory is instance of RuntimeInventory:', runtimeInventory instanceof RuntimeInventory ? 'Yes' : 'No'); // Check if the embedded JSON data is available console.log('\nChecking if embedded JSON data is available:'); console.log('- Default versions available:', Object.keys(runtimeInventory['defaultVersionMap']).length > 0 ? 'Yes' : 'No'); console.log('- Schema definitions available:', Object.keys(runtimeInventory['schemaDefinitions']).length > 0 ? 'Yes' : 'No'); console.log('- Master content available:', Object.keys(runtimeInventory['masterContent']).length > 0 ? 'Yes' : 'No'); // Check if the interface methods are available on the instance const methods = [ 'getSchema', 'getSchemaFromDestination', 'getTypescript', 'getLintRuleset', 'getPolicySequenceType', 'getStagedPolicies', 'getFreeFlowPolicies', 'getPolicyDefaultVersion', 'getMasterContents', 'getPolicyInfo' ]; console.log('\nChecking if all interface methods are available on runtimeInventory:'); methods.forEach(method => { console.log(`- ${method}: ${typeof runtimeInventory[method] === 'function' ? 'Yes' : 'No'}`); }); // Made with Bob