@zerocarbon/erp-config-sdk 1.0.13 → 1.0.15

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.d.ts CHANGED
@@ -900,6 +900,7 @@ interface ErrorResponse {
900
900
  declare function hasIntensities(response: any): response is DetailedCarbonIntensityResponse;
901
901
  declare const INTENSITY_FIELD_LABELS: Record<string, string>;
902
902
 
903
+ declare const getUserNameScopeConfig: <T = any>(scopeKey: "scope1" | "scope2" | "scope3" | "waterManagement", username?: string, defaultScope?: T) => T;
903
904
  declare const INDUSTRIES_CONFIG: {
904
905
  [key: string]: {
905
906
  scope1: Scope[];
@@ -915,7 +916,6 @@ declare const INDUSTRIES_CONFIG: {
915
916
  };
916
917
  };
917
918
  };
918
- declare const getUserNameWaterManagementConfig: (username?: string, defaultWaterManagement?: any) => any;
919
919
  declare const getIndustryConfig$1: (industry: string, username?: string) => {
920
920
  scope1: Scope[];
921
921
  scope2: Scope[];
@@ -966,6 +966,99 @@ type Scope3Item$2 = {
966
966
  subProducts: Emissions$i;
967
967
  desc: string;
968
968
  };
969
+ type BackendProduct = {
970
+ name: string;
971
+ unit: string;
972
+ type: string;
973
+ calorificValue: number;
974
+ emissionFactor: number;
975
+ energyConversionFactor?: number;
976
+ };
977
+ type BackendEmissionItem = {
978
+ item: string;
979
+ emissionFactor: number;
980
+ unit: string;
981
+ };
982
+ type BackendEquipmentCategory = {
983
+ category: string;
984
+ items: BackendEmissionItem[];
985
+ };
986
+ type BackendEmissions = BackendEquipmentCategory[];
987
+ type BackendScope = {
988
+ name: string;
989
+ icon?: string;
990
+ scope: string;
991
+ unit: string;
992
+ subProducts: BackendProduct[];
993
+ desc: string;
994
+ group?: string;
995
+ className?: string;
996
+ };
997
+ type BackendScope3Item = {
998
+ name: string;
999
+ displayName: string;
1000
+ icon?: string;
1001
+ scope: string;
1002
+ unit: string;
1003
+ subProducts: BackendEmissions;
1004
+ desc: string;
1005
+ };
1006
+ type BackendAdditionalScopeItem = {
1007
+ type: "scope1" | "scope2" | "scope3";
1008
+ route: string;
1009
+ name: string;
1010
+ scope: BackendScope | BackendScope3Item;
1011
+ };
1012
+ type BackendIndustryConfig = {
1013
+ scope1: BackendScope[];
1014
+ scope2: BackendScope[];
1015
+ scope3: BackendScope3Item[];
1016
+ additionalScopes?: {
1017
+ [key: string]: BackendAdditionalScopeItem[];
1018
+ };
1019
+ };
1020
+ type BackendUserConfig = {
1021
+ scope1?: BackendScope[];
1022
+ scope2?: BackendScope[];
1023
+ scope3?: BackendScope3Item[];
1024
+ waterManagement?: BackendScope;
1025
+ };
1026
+ type BackendUserConfigs = {
1027
+ [username: string]: BackendUserConfig;
1028
+ };
1029
+ type BackendIndustries = {
1030
+ [industryName: string]: BackendIndustryConfig;
1031
+ };
1032
+ type AllConfigurations = {
1033
+ industries: BackendIndustries;
1034
+ userConfigs: BackendUserConfigs;
1035
+ };
1036
+ /**
1037
+ * Get all configurations for backend consumption without React icons
1038
+ * This function returns all industry configurations and user configurations
1039
+ * in a format that can be safely consumed by backend applications
1040
+ */
1041
+ declare function getAllConfig(): AllConfigurations;
1042
+ /**
1043
+ * Get user-specific backend configuration by username
1044
+ * @param username - The username to get configuration for
1045
+ * @returns Backend-compatible user configuration or undefined if not found
1046
+ */
1047
+ declare function getUserNameBackendConfig(username: string): BackendUserConfig | undefined;
1048
+ /**
1049
+ * Get industry-specific backend configuration by industry name
1050
+ * @param industryName - The industry name to get configuration for
1051
+ * @returns Backend-compatible industry configuration or undefined if not found
1052
+ */
1053
+ declare function getIndustryBackendConfig(industryName: string): BackendIndustryConfig | undefined;
1054
+ /**
1055
+ * Get combined industry and user configuration for backend consumption
1056
+ * This applies user-specific overrides to industry configuration when available
1057
+ * @param industryName - The industry name
1058
+ * @param username - Optional username for user-specific customizations
1059
+ * @returns Backend-compatible combined configuration
1060
+ */
1061
+ declare function getCombinedBackendConfig(industryName: string, username?: string): BackendIndustryConfig | undefined;
969
1062
 
970
1063
  interface BillFilterOptions {
971
1064
  category?: string;
@@ -2418,9 +2511,6 @@ type Scope3Item$1 = {
2418
2511
  desc: string;
2419
2512
  };
2420
2513
  declare const ALL_SCOPES_3_CEMENT: Scope3Item$1[];
2421
- declare const getUserNameScope1Config: (username?: string, defaultScope1?: any[]) => any[];
2422
- declare const getUserNameScope2Config: (username?: string, defaultScope2?: any[]) => any[];
2423
- declare const getUserNameScope3Config: (username?: string, defaultScope3?: Scope3Item$1[]) => Scope3Item$1[];
2424
2514
  declare const FUEL_PRODUCTS: {
2425
2515
  name: string;
2426
2516
  unit: string;
@@ -3852,9 +3942,6 @@ declare const index_WATER_USAGE_PRODUCTS: typeof WATER_USAGE_PRODUCTS;
3852
3942
  declare const index_WELDING_PRODUCTS_GAS_LAB: typeof WELDING_PRODUCTS_GAS_LAB;
3853
3943
  declare const index_getEndpointConfig: typeof getEndpointConfig;
3854
3944
  declare const index_getIndustryConfig: typeof getIndustryConfig;
3855
- declare const index_getUserNameScope1Config: typeof getUserNameScope1Config;
3856
- declare const index_getUserNameScope2Config: typeof getUserNameScope2Config;
3857
- declare const index_getUserNameScope3Config: typeof getUserNameScope3Config;
3858
3945
  declare namespace index {
3859
3946
  export {
3860
3947
  index_ALLSCOPES_ALLOY as ALLSCOPES_ALLOY,
@@ -4018,11 +4105,8 @@ declare namespace index {
4018
4105
  index_WELDING_PRODUCTS_GAS_LAB as WELDING_PRODUCTS_GAS_LAB,
4019
4106
  index_getEndpointConfig as getEndpointConfig,
4020
4107
  index_getIndustryConfig as getIndustryConfig,
4021
- index_getUserNameScope1Config as getUserNameScope1Config,
4022
- index_getUserNameScope2Config as getUserNameScope2Config,
4023
- index_getUserNameScope3Config as getUserNameScope3Config,
4024
4108
  };
4025
4109
  }
4026
4110
 
4027
- export { API_ENDPOINTS, API_SCOPE3_CEMENT_CONFIG, BILL_CALCULATION_CONFIGS, BillManager, CCTS_ALLSCOPES_CEMENT, CCTS_CALCINATION_PRODUCTS, CCTS_ELECTRICITY_PRODUCTS, CCTS_FIRE_EXTINGUISHER_PRODUCTS, CCTS_FUEL_COMBUSTION_PRODUCTS, CCTS_LPG_PRODUCTS, CCTS_MINING_OPERATIONS_PRODUCTS, CCTS_ONSITE_POWER_PRODUCTS, CCTS_PURCHASED_ELECTRICITY, CCTS_REFRIGERANTS, CCTS_SCOPE1_CEMENT, CCTS_SCOPE2_CEMENT, CCTS_SF6_PRODUCTS, CCTS_TABLE_COLUMNS, DEFAULT_BILL_MATCHING_CONFIG, EmissionSourceGenerator, FRONTEND_INDUSTRY_CONFIGS, HTTP_STATUS, INDUSTRIES_CONFIG, INDUSTRY_MAPPING, INDUSTRY_SPECIFIC_FIELDS, INTENSITY_FIELD_LABELS, ISO_CATEGORIES_PACKAGING, index as Industries, UI_FEATURES, WATER_PRODUCTS, calculateCCTSEmission, calculateIntensityMetrics, categorizeApiItem, cleanValue, createBillManager, createCapitalizedMonthMapping, createEmissionSourceGenerator, createMonthMapping, debugCarbonIntensityMapping, extractCarbonIntensityData, formatEmissionValue, formatIntensityValue, formatKPIEmission, formatMonthlyEmission, formatPercentage, getApiIndustryType, getAvailableFieldsForIndustry, getIndustryConfig$1 as getIndustryConfig, getIndustryFieldConfig, getIntensityFormulas, getPlantNameConfig, getScope3ConfigByName, getUserNameWaterManagementConfig, hasIntensities, isUIFeatureEnabled, mapIndustryToApiType, sanitizeNumber, supportsIntensityCalculations, validateCarbonIntensityData };
4028
- export type { AlloyRequest, AlloyResponse, AluminiumRequest, AluminiumResponse, ApiEndpointConfig, ApiResponse, AutomobileRequest, AutomobileResponse, AviationRequest, AviationResponse, BaseRequest, BaseResponse, Bill, BillCalculationConfig, BillFilterOptions, BillMatchingConfig, BusinessTravelEmission, BusinessTravelEmissionAttributes, BusinessTravelEmissionsResponse, BillsAnalyzed$1 as CarbonIntensityBillsAnalyzed, Calculations$1 as CarbonIntensityCalculations, EmissionData$2 as CarbonIntensityEmissionData, ErrorResponse$1 as CarbonIntensityErrorResponse, CarbonIntensityRequest, CarbonIntensityResponse, ChemicalRequest, ChemicalResponse, DetailedCarbonIntensityResponse, EditableItem, EmissionData$3 as EmissionData, EmissionSource, Emissions$j as Emissions, EmissionsDataAttributes, EmissionsDataResponse, FieldConfig, FoodBeveragesRequest, FoodBeveragesResponse, FormData, FormValidationResult, FrontendIndustryConfig, HospitalityRequest, HospitalityResponse, IndustryConfig, EmissionData as IndustryEmissionData, IndustryFieldConfig, IndustryFieldSection, ProductionData as IndustryProductionData, IndustryType, IntensityCalculation, IntensityValue, LogisticsRequest, LogisticsResponse, ManufacturingRequest, ManufacturingResponse, Meta, MetalEnergyRequest, MetalEnergyResponse, PackagingRequest, PackagingResponse, Pagination, PetrochemicalRequest, PetrochemicalResponse, PharmaRequest, PharmaResponse, PlantNameConfig, ProcessedEmissionCategory, ProcessedEmissionItem, ProcessedScope3Data, RealEstateRequest, RealEstateResponse, BillsAnalyzed as ResponseBillsAnalyzed, Calculations as ResponseCalculations, EmissionData$1 as ResponseEmissionData, ErrorResponse as ResponseErrorResponse, ScopeConfig, ScopeProduct, ShippingRequest, ShippingResponse, SteelRequest, SteelResponse, StrapiItem, StrapiResponse, TelecommunicationRequest, TelecommunicationResponse, TextileRequest, TextileResponse, TransportationEmission, TransportationEmissionAttributes, TransportationEmissionsResponse, UserData, UtilitiesRequest, UtilitiesResponse, ValidationError, VehicleEmission, VehicleEmissionAttributes, VehicleEmissionsResponse };
4111
+ export { API_ENDPOINTS, API_SCOPE3_CEMENT_CONFIG, BILL_CALCULATION_CONFIGS, BillManager, CCTS_ALLSCOPES_CEMENT, CCTS_CALCINATION_PRODUCTS, CCTS_ELECTRICITY_PRODUCTS, CCTS_FIRE_EXTINGUISHER_PRODUCTS, CCTS_FUEL_COMBUSTION_PRODUCTS, CCTS_LPG_PRODUCTS, CCTS_MINING_OPERATIONS_PRODUCTS, CCTS_ONSITE_POWER_PRODUCTS, CCTS_PURCHASED_ELECTRICITY, CCTS_REFRIGERANTS, CCTS_SCOPE1_CEMENT, CCTS_SCOPE2_CEMENT, CCTS_SF6_PRODUCTS, CCTS_TABLE_COLUMNS, DEFAULT_BILL_MATCHING_CONFIG, EmissionSourceGenerator, FRONTEND_INDUSTRY_CONFIGS, HTTP_STATUS, INDUSTRIES_CONFIG, INDUSTRY_MAPPING, INDUSTRY_SPECIFIC_FIELDS, INTENSITY_FIELD_LABELS, ISO_CATEGORIES_PACKAGING, index as Industries, UI_FEATURES, WATER_PRODUCTS, calculateCCTSEmission, calculateIntensityMetrics, categorizeApiItem, cleanValue, createBillManager, createCapitalizedMonthMapping, createEmissionSourceGenerator, createMonthMapping, debugCarbonIntensityMapping, extractCarbonIntensityData, formatEmissionValue, formatIntensityValue, formatKPIEmission, formatMonthlyEmission, formatPercentage, getAllConfig, getApiIndustryType, getAvailableFieldsForIndustry, getCombinedBackendConfig, getIndustryBackendConfig, getIndustryConfig$1 as getIndustryConfig, getIndustryFieldConfig, getIntensityFormulas, getPlantNameConfig, getScope3ConfigByName, getUserNameBackendConfig, getUserNameScopeConfig, hasIntensities, isUIFeatureEnabled, mapIndustryToApiType, sanitizeNumber, supportsIntensityCalculations, validateCarbonIntensityData };
4112
+ export type { AllConfigurations, AlloyRequest, AlloyResponse, AluminiumRequest, AluminiumResponse, ApiEndpointConfig, ApiResponse, AutomobileRequest, AutomobileResponse, AviationRequest, AviationResponse, BackendAdditionalScopeItem, BackendEmissionItem, BackendEmissions, BackendEquipmentCategory, BackendIndustries, BackendIndustryConfig, BackendProduct, BackendScope, BackendScope3Item, BackendUserConfig, BackendUserConfigs, BaseRequest, BaseResponse, Bill, BillCalculationConfig, BillFilterOptions, BillMatchingConfig, BusinessTravelEmission, BusinessTravelEmissionAttributes, BusinessTravelEmissionsResponse, BillsAnalyzed$1 as CarbonIntensityBillsAnalyzed, Calculations$1 as CarbonIntensityCalculations, EmissionData$2 as CarbonIntensityEmissionData, ErrorResponse$1 as CarbonIntensityErrorResponse, CarbonIntensityRequest, CarbonIntensityResponse, ChemicalRequest, ChemicalResponse, DetailedCarbonIntensityResponse, EditableItem, EmissionData$3 as EmissionData, EmissionSource, Emissions$j as Emissions, EmissionsDataAttributes, EmissionsDataResponse, FieldConfig, FoodBeveragesRequest, FoodBeveragesResponse, FormData, FormValidationResult, FrontendIndustryConfig, HospitalityRequest, HospitalityResponse, IndustryConfig, EmissionData as IndustryEmissionData, IndustryFieldConfig, IndustryFieldSection, ProductionData as IndustryProductionData, IndustryType, IntensityCalculation, IntensityValue, LogisticsRequest, LogisticsResponse, ManufacturingRequest, ManufacturingResponse, Meta, MetalEnergyRequest, MetalEnergyResponse, PackagingRequest, PackagingResponse, Pagination, PetrochemicalRequest, PetrochemicalResponse, PharmaRequest, PharmaResponse, PlantNameConfig, ProcessedEmissionCategory, ProcessedEmissionItem, ProcessedScope3Data, RealEstateRequest, RealEstateResponse, BillsAnalyzed as ResponseBillsAnalyzed, Calculations as ResponseCalculations, EmissionData$1 as ResponseEmissionData, ErrorResponse as ResponseErrorResponse, ScopeConfig, ScopeProduct, ShippingRequest, ShippingResponse, SteelRequest, SteelResponse, StrapiItem, StrapiResponse, TelecommunicationRequest, TelecommunicationResponse, TextileRequest, TextileResponse, TransportationEmission, TransportationEmissionAttributes, TransportationEmissionsResponse, UserData, UtilitiesRequest, UtilitiesResponse, ValidationError, VehicleEmission, VehicleEmissionAttributes, VehicleEmissionsResponse };