- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
19 lines
1.4 KiB
JavaScript
19 lines
1.4 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const assert_1 = __importDefault(require("assert"));
|
|
function computeNextBackoffInterval(initialBackoff, previousRetryCount, { multiplier = 1.5, randomizationFactor = 0.25, minBackoff = initialBackoff, maxBackoff = Infinity, } = {}) {
|
|
assert_1.default(initialBackoff > 0, `The initial backoff interval must be positive`);
|
|
assert_1.default(previousRetryCount >= 0, `The previous retry count must not be negative`);
|
|
assert_1.default(multiplier >= 1, `The backoff multiplier must be greater than or equal to 1`);
|
|
assert_1.default(0 <= randomizationFactor && randomizationFactor <= 1, `The randomization factor must be between 0 and 1, inclusive`);
|
|
assert_1.default(minBackoff >= 0, `The minimum backoff interval must be positive`);
|
|
let nextBackoff = initialBackoff * multiplier ** previousRetryCount;
|
|
// Apply jitter within the negative to positive range of the randomization factor
|
|
let jitterFactor = 1 - randomizationFactor + 2 * randomizationFactor * Math.random();
|
|
return Math.min(Math.max(nextBackoff * jitterFactor, minBackoff), maxBackoff);
|
|
}
|
|
exports.computeNextBackoffInterval = computeNextBackoffInterval;
|
|
//# sourceMappingURL=backoff.js.map
|