myio-js-library 0.1.214 → 0.1.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1103 -6
- package/dist/index.d.cts +160 -3
- package/dist/index.js +1096 -6
- package/dist/myio-js-library.umd.js +1096 -6
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2178,7 +2178,7 @@ interface OpenDashboardPopupSettingsParams {
|
|
|
2178
2178
|
};
|
|
2179
2179
|
fetcher?: SettingsFetcher;
|
|
2180
2180
|
persister?: SettingsPersister;
|
|
2181
|
-
onSaved?: (result: PersistResult) => void;
|
|
2181
|
+
onSaved?: (result: PersistResult$1) => void;
|
|
2182
2182
|
onClose?: () => void;
|
|
2183
2183
|
onError?: (error: SettingsError) => void;
|
|
2184
2184
|
onEvent?: (evt: SettingsEvent) => void;
|
|
@@ -2206,7 +2206,7 @@ interface OpenDashboardPopupSettingsParams {
|
|
|
2206
2206
|
maxWaterLevel?: number;
|
|
2207
2207
|
};
|
|
2208
2208
|
}
|
|
2209
|
-
interface PersistResult {
|
|
2209
|
+
interface PersistResult$1 {
|
|
2210
2210
|
ok: boolean;
|
|
2211
2211
|
entity?: {
|
|
2212
2212
|
ok: boolean;
|
|
@@ -5175,4 +5175,161 @@ declare const DEVICE_COUNT_KEYS: DeviceCountKeys;
|
|
|
5175
5175
|
*/
|
|
5176
5176
|
declare function openContractDevicesModal(params: OpenContractDevicesModalParams): Promise<void>;
|
|
5177
5177
|
|
|
5178
|
-
|
|
5178
|
+
type WaterUnit = 'm3' | 'liters';
|
|
5179
|
+
type EnergyUnit = 'kwh' | 'mwh' | 'auto';
|
|
5180
|
+
type TemperatureUnit = 'celsius' | 'fahrenheit';
|
|
5181
|
+
interface WaterDisplaySettings {
|
|
5182
|
+
unit: WaterUnit;
|
|
5183
|
+
decimalPlaces: number;
|
|
5184
|
+
autoScale: boolean;
|
|
5185
|
+
}
|
|
5186
|
+
interface EnergyDisplaySettings {
|
|
5187
|
+
unit: EnergyUnit;
|
|
5188
|
+
decimalPlaces: number;
|
|
5189
|
+
forceUnit: boolean;
|
|
5190
|
+
}
|
|
5191
|
+
interface TemperatureDisplaySettings {
|
|
5192
|
+
unit: TemperatureUnit;
|
|
5193
|
+
decimalPlaces: number;
|
|
5194
|
+
}
|
|
5195
|
+
interface MeasurementDisplaySettings {
|
|
5196
|
+
version: string;
|
|
5197
|
+
updatedAt: string;
|
|
5198
|
+
updatedBy?: string;
|
|
5199
|
+
water: WaterDisplaySettings;
|
|
5200
|
+
energy: EnergyDisplaySettings;
|
|
5201
|
+
temperature: TemperatureDisplaySettings;
|
|
5202
|
+
}
|
|
5203
|
+
interface MeasurementSetupFormData {
|
|
5204
|
+
water: WaterDisplaySettings;
|
|
5205
|
+
energy: EnergyDisplaySettings;
|
|
5206
|
+
temperature: TemperatureDisplaySettings;
|
|
5207
|
+
}
|
|
5208
|
+
interface MeasurementSetupModalStyles {
|
|
5209
|
+
primaryColor?: string;
|
|
5210
|
+
successColor?: string;
|
|
5211
|
+
warningColor?: string;
|
|
5212
|
+
dangerColor?: string;
|
|
5213
|
+
textPrimary?: string;
|
|
5214
|
+
textSecondary?: string;
|
|
5215
|
+
backgroundColor?: string;
|
|
5216
|
+
overlayColor?: string;
|
|
5217
|
+
borderRadius?: string;
|
|
5218
|
+
buttonRadius?: string;
|
|
5219
|
+
zIndex?: number;
|
|
5220
|
+
fontFamily?: string;
|
|
5221
|
+
}
|
|
5222
|
+
interface MeasurementSetupModalParams {
|
|
5223
|
+
token: string;
|
|
5224
|
+
customerId: string;
|
|
5225
|
+
tbBaseUrl?: string;
|
|
5226
|
+
existingSettings?: MeasurementDisplaySettings | null;
|
|
5227
|
+
container?: HTMLElement | string;
|
|
5228
|
+
onSave?: (settings: MeasurementDisplaySettings) => void;
|
|
5229
|
+
onClose?: () => void;
|
|
5230
|
+
styles?: MeasurementSetupModalStyles;
|
|
5231
|
+
}
|
|
5232
|
+
interface MeasurementSetupModalInstance {
|
|
5233
|
+
destroy(): void;
|
|
5234
|
+
getFormData(): MeasurementSetupFormData;
|
|
5235
|
+
setFormData(data: Partial<MeasurementSetupFormData>): void;
|
|
5236
|
+
}
|
|
5237
|
+
interface MeasurementSetupError {
|
|
5238
|
+
code: 'VALIDATION_ERROR' | 'NETWORK_ERROR' | 'AUTH_ERROR' | 'TOKEN_EXPIRED' | 'UNKNOWN_ERROR';
|
|
5239
|
+
message: string;
|
|
5240
|
+
field?: string;
|
|
5241
|
+
cause?: unknown;
|
|
5242
|
+
}
|
|
5243
|
+
interface PersistResult {
|
|
5244
|
+
ok: boolean;
|
|
5245
|
+
error?: MeasurementSetupError;
|
|
5246
|
+
settings?: MeasurementDisplaySettings;
|
|
5247
|
+
}
|
|
5248
|
+
declare const WATER_UNITS: readonly [{
|
|
5249
|
+
readonly value: "m3";
|
|
5250
|
+
readonly label: "Metros Cúbicos (m³)";
|
|
5251
|
+
}, {
|
|
5252
|
+
readonly value: "liters";
|
|
5253
|
+
readonly label: "Litros (L)";
|
|
5254
|
+
}];
|
|
5255
|
+
declare const ENERGY_UNITS: readonly [{
|
|
5256
|
+
readonly value: "auto";
|
|
5257
|
+
readonly label: "Automático (kWh/MWh)";
|
|
5258
|
+
}, {
|
|
5259
|
+
readonly value: "kwh";
|
|
5260
|
+
readonly label: "Quilowatt-hora (kWh)";
|
|
5261
|
+
}, {
|
|
5262
|
+
readonly value: "mwh";
|
|
5263
|
+
readonly label: "Megawatt-hora (MWh)";
|
|
5264
|
+
}];
|
|
5265
|
+
declare const TEMPERATURE_UNITS: readonly [{
|
|
5266
|
+
readonly value: "celsius";
|
|
5267
|
+
readonly label: "Celsius (°C)";
|
|
5268
|
+
}, {
|
|
5269
|
+
readonly value: "fahrenheit";
|
|
5270
|
+
readonly label: "Fahrenheit (°F)";
|
|
5271
|
+
}];
|
|
5272
|
+
declare const DECIMAL_OPTIONS: readonly [{
|
|
5273
|
+
readonly value: 0;
|
|
5274
|
+
readonly label: "0 casas";
|
|
5275
|
+
}, {
|
|
5276
|
+
readonly value: 1;
|
|
5277
|
+
readonly label: "1 casa";
|
|
5278
|
+
}, {
|
|
5279
|
+
readonly value: 2;
|
|
5280
|
+
readonly label: "2 casas";
|
|
5281
|
+
}, {
|
|
5282
|
+
readonly value: 3;
|
|
5283
|
+
readonly label: "3 casas";
|
|
5284
|
+
}, {
|
|
5285
|
+
readonly value: 4;
|
|
5286
|
+
readonly label: "4 casas";
|
|
5287
|
+
}, {
|
|
5288
|
+
readonly value: 5;
|
|
5289
|
+
readonly label: "5 casas";
|
|
5290
|
+
}, {
|
|
5291
|
+
readonly value: 6;
|
|
5292
|
+
readonly label: "6 casas";
|
|
5293
|
+
}];
|
|
5294
|
+
declare const DOMAIN_CONFIG: {
|
|
5295
|
+
readonly water: {
|
|
5296
|
+
readonly icon: "💧";
|
|
5297
|
+
readonly label: "Água";
|
|
5298
|
+
readonly color: "#3b82f6";
|
|
5299
|
+
readonly bgColor: "rgba(59, 130, 246, 0.1)";
|
|
5300
|
+
};
|
|
5301
|
+
readonly energy: {
|
|
5302
|
+
readonly icon: "⚡";
|
|
5303
|
+
readonly label: "Energia";
|
|
5304
|
+
readonly color: "#f59e0b";
|
|
5305
|
+
readonly bgColor: "rgba(245, 158, 11, 0.1)";
|
|
5306
|
+
};
|
|
5307
|
+
readonly temperature: {
|
|
5308
|
+
readonly icon: "🌡️";
|
|
5309
|
+
readonly label: "Temperatura";
|
|
5310
|
+
readonly color: "#ef4444";
|
|
5311
|
+
readonly bgColor: "rgba(239, 68, 68, 0.1)";
|
|
5312
|
+
};
|
|
5313
|
+
};
|
|
5314
|
+
declare const DEFAULT_SETTINGS: MeasurementDisplaySettings;
|
|
5315
|
+
|
|
5316
|
+
/**
|
|
5317
|
+
* Opens a modal for configuring measurement display settings stored in customer server_scope attributes.
|
|
5318
|
+
*
|
|
5319
|
+
* @example
|
|
5320
|
+
* ```typescript
|
|
5321
|
+
* const modal = await openMeasurementSetupModal({
|
|
5322
|
+
* token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
|
|
5323
|
+
* customerId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
|
|
5324
|
+
* tbBaseUrl: 'https://tb.myio-bas.com',
|
|
5325
|
+
* onSave: (settings) => console.log('Saved:', settings),
|
|
5326
|
+
* onClose: () => console.log('Modal closed')
|
|
5327
|
+
* });
|
|
5328
|
+
*
|
|
5329
|
+
* // Clean up when needed
|
|
5330
|
+
* modal.destroy();
|
|
5331
|
+
* ```
|
|
5332
|
+
*/
|
|
5333
|
+
declare function openMeasurementSetupModal(params: MeasurementSetupModalParams): Promise<MeasurementSetupModalInstance>;
|
|
5334
|
+
|
|
5335
|
+
export { ANNOTATION_TYPE_COLORS, ANNOTATION_TYPE_LABELS, ANNOTATION_TYPE_LABELS_EN, type Annotation, type AnnotationFilterState, AnnotationIndicator, type AnnotationIndicatorConfig, type AnnotationIndicatorTheme, type AnnotationStatus, type AnnotationSummary, type AnnotationType, type AuditAction, type AuditEntry, type BuildTemplateExportParams, CHART_COLORS, DEFAULT_COLORS as CONSUMPTION_CHART_COLORS, DEFAULT_CONFIG as CONSUMPTION_CHART_DEFAULTS, THEME_COLORS as CONSUMPTION_THEME_COLORS, type CategorySummary, type ChartDomain, type ClampRange, ConnectionStatusType, type Consumption7DaysColors, type Consumption7DaysConfig, type Consumption7DaysData, type Consumption7DaysInstance, type ChartType as ConsumptionChartType, type ConsumptionDataPoint, type IdealRangeConfig as ConsumptionIdealRangeConfig, type ConsumptionModalConfig, type ConsumptionModalInstance, type TemperatureConfig as ConsumptionTemperatureConfig, type TemperatureReferenceLine as ConsumptionTemperatureReferenceLine, type ThemeColors as ConsumptionThemeColors, type ThemeMode$1 as ConsumptionThemeMode, type VizMode as ConsumptionVizMode, type ConsumptionWidgetConfig, type ConsumptionWidgetInstance, type ContractDeviceCounts, type ContractDevicesError, type ContractDevicesPersistResult, type ContractDomain, type ContractDomainCounts, type ContractSummaryData, ContractSummaryTooltip, type ContractTemperatureCounts, type CreateDateRangePickerOptions, type CreateInputDateRangePickerInsideDIVParams, DECIMAL_OPTIONS, DEFAULT_CLAMP_RANGE, DEFAULT_ENERGY_GROUP_COLORS, DEFAULT_GAS_GROUP_COLORS, DEFAULT_SETTINGS as DEFAULT_MEASUREMENT_SETTINGS, DEFAULT_SHOPPING_COLORS, DEFAULT_WATER_GROUP_COLORS, DEVICE_COUNT_KEYS, type DashboardEnergySummary, type DashboardWaterSummary, type DateRangeControl, type DateRangeInputController, type DateRangeResult, type DemandModalInstance, type DemandModalParams, type DemandModalPdfConfig, type DemandModalStyles, type DeviceComparisonData, DeviceComparisonTooltip, type DeviceCountKeys, type DeviceInfo$1 as DeviceInfo, type DeviceStatusName, DeviceStatusType, type DeviceTypeLimits, type DistributionChartConfig, type DistributionChartInstance, type DistributionData, type DistributionDomain, type DistributionMode, type DistributionThemeColors, ENERGY_UNITS, EXPORT_DEFAULT_COLORS, EXPORT_DOMAIN_ICONS, EXPORT_DOMAIN_LABELS, EXPORT_DOMAIN_UNITS, type EnergyDisplaySettings, type EnergyEntityData, type EnergyModalContext, type EnergyModalError, type EnergyModalI18n, type EnergyModalStyleOverrides, EnergyRangeTooltip, type EnergyStatus, type EnergyStatusResult, EnergySummaryTooltip, type EnergyUnit, type ExportColorsPallet, type ExportComparisonData, type ExportConfigTemplate, type ExportCustomerData, type ExportCustomerInfo, type ExportData, type ExportDataInput, type ExportDataInstance, type ExportDataPoint, type ExportDeviceInfo, type ExportDomain, type ExportFormat, type ExportGroupData, type ExportOptions, type ExportProgressCallback, type ExportResult, type ExportStats, type ExportType, type GroupColors, IMPORTANCE_COLORS, IMPORTANCE_LABELS, IMPORTANCE_LABELS_EN, type ImportanceLevel, InfoTooltip, type InstantaneousPowerLimits, type LogAnnotationsAttribute, DOMAIN_CONFIG as MEASUREMENT_DOMAIN_CONFIG, type MeasurementDisplaySettings, type MeasurementSetupError, type MeasurementSetupFormData, type MeasurementSetupModalInstance, type MeasurementSetupModalParams, type MeasurementSetupModalStyles, type PersistResult as MeasurementSetupPersistResult, type ExportFormat$1 as ModalExportFormat, type ModalHeaderConfig, type ModalHeaderInstance, type ModalTheme, type MyIOAuthConfig, type MyIOAuthInstance, MyIOChartModal, MyIODraggableCard, MyIOSelectionStore, MyIOSelectionStoreClass, MyIOToast, type NewAnnotationData, type OpenContractDevicesModalParams, type OpenDashboardPopupEnergyOptions, type OpenDashboardPopupSettingsParams, type OpenDashboardPopupWaterTankOptions, DEVICE_TYPES as POWER_LIMITS_DEVICE_TYPES, STATUS_CONFIG as POWER_LIMITS_STATUS_CONFIG, TELEMETRY_TYPES as POWER_LIMITS_TELEMETRY_TYPES, type PaginationState, type PermissionSet, type PersistResult$1 as PersistResult, type PowerLimitsError, type PowerLimitsFormData, type PowerLimitsModalInstance, type PowerLimitsModalParams, type PowerLimitsModalStyles, type PowerRange, type PowerRanges, type RealTimeTelemetryInstance, type RealTimeTelemetryParams, STATUS_COLORS, STATUS_LABELS, STATUS_LABELS_EN, type SettingsError, type SettingsEvent, type ShoppingColors, type ShoppingDataPoint, type StatusLimits, type StatusSummary$1 as StatusSummary, type StoreRow, TEMPERATURE_UNITS, type TbScope, type TelemetryFetcher, type TelemetryTypeLimits, type TempComparisonData, TempComparisonTooltip, type TempEntityData, TempRangeTooltip, type TempSensorDevice, type TempSensorSummaryData, TempSensorSummaryTooltip, type TempStatus, type TempStatusResult, type TemperatureComparisonModalInstance, type TemperatureComparisonModalParams, type TemperatureDevice, type TemperatureDisplaySettings, type TemperatureGranularity, type TemperatureModalInstance, type TemperatureModalParams, type TemperatureSettingsInstance, type TemperatureSettingsParams, type TemperatureStats, type TemperatureTelemetry, type TemperatureUnit, type ThingsboardCustomerAttrsConfig, type TimedValue, type UserInfo, WATER_UNITS, type WaterCategorySummary, type WaterDisplaySettings, type WaterRow, WaterSummaryTooltip, type WaterTankDataPoint, type WaterTankModalContext, type WaterTankModalError, type WaterTankModalI18n, type WaterTankModalStyleOverrides, type WaterTankTelemetryData, type WaterUnit, addDetectionContext, addNamespace, aggregateByDay, assignShoppingColors, averageByDay, buildListItemsThingsboardByUniqueDatasource, buildMyioIngestionAuth, buildTemplateExport, buildWaterReportCSV, buildWaterStoresCSV, calcDeltaPercent, calculateDeviceStatus, calculateDeviceStatusWithRanges, calculateStats as calculateExportStats, calculateStats$1 as calculateStats, canModifyAnnotation, clampTemperature, classify, classifyWaterLabel, classifyWaterLabels, clearAllAuthCaches, connectionStatusIcons, createAnnotationIndicator, createConsumption7DaysChart, createConsumptionChartWidget, createConsumptionModal, createDateRangePicker, createDistributionChartWidget, createInputDateRangePickerInsideDIV, createModalHeader, decodePayload, decodePayloadBase64Xor, detectDeviceType, detectSuperAdminHolding, detectSuperAdminMyio, determineInterval, deviceStatusIcons, exportTemperatureCSV, exportToCSV, exportToCSVAll, extractMyIOCredentials, fetchCurrentUserInfo, fetchTemperatureData, fetchThingsboardCustomerAttrsFromStorage, fetchThingsboardCustomerServerScopeAttrs, findValue, findValueWithDefault, fmtPerc$1 as fmtPerc, fmtPerc as fmtPercLegacy, formatAllInSameUnit, formatAllInSameWaterUnit, formatDateForInput, formatDateToYMD, formatDateWithTimezoneOffset, formatDuration, formatEnergy, formatNumberReadable, formatRelativeTime, formatTankHeadFromCm, formatTemperature, formatWater, formatWaterByGroup, formatWaterVolumeM3, formatarDuracao, generateFilename as generateExportFilename, getAnnotationPermissions, getAuthCacheStats, getAvailableContexts, getConnectionStatusIcon, getDateRangeArray, getDefaultGroupColors, getDeviceStatusIcon, getDeviceStatusInfo, getThemeColors as getDistributionThemeColors, getGroupColor, getHashColor, getModalHeaderStyles, getSaoPauloISOString, getSaoPauloISOStringFixed, getShoppingColor, getValueByDatakey, getValueByDatakeyLegacy, getWaterCategories, groupByDay, interpolateTemperature, isDeviceOffline, isValidConnectionStatus, isValidDeviceStatus, isWaterCategory, mapConnectionStatus, mapDeviceStatusToCardStatus, mapDeviceToConnectionStatus, myioExportData, normalizeRecipients, numbers, openContractDevicesModal, openDashboardPopup, openDashboardPopupAllReport, openDashboardPopupEnergy, openDashboardPopupReport, openDashboardPopupSettings, openDashboardPopupWaterTank, openDemandModal, openGoalsPanel, openMeasurementSetupModal, openPowerLimitsSetupModal, openRealTimeTelemetryModal, openTemperatureComparisonModal, openTemperatureModal, openTemperatureSettingsModal, parseInputDateToDate, renderCardComponent$2 as renderCardComponent, renderCardComponent$1 as renderCardComponentEnhanced, renderCardComponentHeadOffice, renderCardComponentLegacy, renderCardComponentV2, renderCardComponent as renderCardComponentV5, renderCardComponentV5 as renderCardV5, shouldFlashIcon, strings, timeWindowFromInputYMD, toCSV, toFixedSafe, waterDeviceStatusIcons };
|