Skip to main content
Glama
detailed-august-costs.cjsโ€ข4.4 kB
const { UmbrellaDualAuth } = require('./dist/dual-auth.js'); const axios = require('axios'); async function getDetailedAugustCosts() { console.log(`๐Ÿ” DETAILED AUGUST 2025 ANALYSIS FOR SAOLA ACCOUNT`); console.log(`๐Ÿ‘ค User: david+saola@umbrellacost.com`); console.log('โ•'.repeat(80)); try { const auth = new UmbrellaDualAuth('https://api.umbrellacost.io/api/v1'); await auth.authenticate({ username: 'david+saola@umbrellacost.com', password: 'Dsamsung1!' }); console.log('โœ… Authentication successful'); const authHeaders = auth.getAuthHeaders(); // Test different scenarios to match UI behavior const scenarios = [ { name: 'UI Default (cost+discount, Aug 1-31, monthly)', params: { startDate: '2025-08-01', endDate: '2025-08-31', costType: ['cost', 'discount'], groupBy: 'service', periodGranLevel: 'month', isUnblended: true } }, { name: 'Cost Only (Aug 1-31, monthly)', params: { startDate: '2025-08-01', endDate: '2025-08-31', costType: ['cost'], groupBy: 'service', periodGranLevel: 'month', isUnblended: true } }, { name: 'Daily Granularity (cost+discount, Aug 1-31)', params: { startDate: '2025-08-01', endDate: '2025-08-31', costType: ['cost', 'discount'], groupBy: 'service', periodGranLevel: 'day', isUnblended: true } }, { name: 'Total by Account (Aug 1-31)', params: { startDate: '2025-08-01', endDate: '2025-08-31', costType: ['cost', 'discount'], groupBy: 'account', periodGranLevel: 'month', isUnblended: true } } ]; for (const scenario of scenarios) { try { console.log(`\n๐Ÿ“Š ${scenario.name}:`); console.log(` Params: ${JSON.stringify(scenario.params, null, 2).replace(/\n/g, '\n ')}`); const response = await axios.get('https://api.umbrellacost.io/api/v1/invoices/caui', { headers: { 'Authorization': authHeaders.Authorization, 'apikey': authHeaders.apikey, 'Content-Type': 'application/json' }, params: scenario.params, timeout: 30000 }); const totalCost = response.data.reduce((sum, item) => sum + (item.total_cost || 0), 0); console.log(` ๐Ÿ’ต Total: $${totalCost.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2})}`); console.log(` ๐Ÿ“ˆ Entries: ${response.data.length}`); // Show sample data structure if (response.data.length > 0) { const sample = response.data[0]; console.log(` ๐Ÿ“ Sample entry: ${sample.service_name || sample.group_by || sample.account_name} - $${(sample.total_cost || 0).toFixed(2)}`); } } catch (error) { console.log(` โŒ Error: ${error.response?.status} - ${error.response?.data?.message || error.message}`); } } // Test what the main dashboard might use console.log(`\n๐Ÿ  Testing Main Dashboard Pattern:`); try { const response = await axios.get('https://api.umbrellacost.io/api/v1/invoices/caui', { headers: { 'Authorization': authHeaders.Authorization, 'apikey': authHeaders.apikey, 'Content-Type': 'application/json' }, params: { startDate: '2025-08-01', endDate: '2025-08-31', costType: ['cost', 'discount'], isUnblended: true }, timeout: 30000 }); const totalCost = response.data.reduce((sum, item) => sum + (item.total_cost || 0), 0); console.log(` ๐Ÿ’ต Dashboard Total: $${totalCost.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2})}`); console.log(` ๐Ÿ“ˆ Entries: ${response.data.length}`); } catch (error) { console.log(` โŒ Dashboard Error: ${error.response?.status} - ${error.response?.data?.message || error.message}`); } } catch (error) { console.error(`โŒ Authentication failed:`, error.message); } } getDetailedAugustCosts().catch(console.error);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/daviddraiumbrella/invoice-monitoring'

If you have feedback or need assistance with the MCP directory API, please join our Discord server