@zerocarbon/erp-config-sdk 1.0.20 → 1.0.22
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 +42 -2
- package/dist/index.esm.js +298 -1023
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +300 -1022
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1209,6 +1209,46 @@ declare const createEmissionSourceGenerator: (billManager: BillManager) => Emiss
|
|
|
1209
1209
|
declare const INDUSTRY_MAPPING: Record<string, IndustryType>;
|
|
1210
1210
|
declare const getApiIndustryType: (erpIndustry: string) => IndustryType;
|
|
1211
1211
|
|
|
1212
|
+
type JsonResponse<T> = {
|
|
1213
|
+
json: () => Promise<T>;
|
|
1214
|
+
};
|
|
1215
|
+
type UserConfigApiClient = {
|
|
1216
|
+
get: <T = any>(path: string) => JsonResponse<T>;
|
|
1217
|
+
post: <T = any>(path: string, options: {
|
|
1218
|
+
json: unknown;
|
|
1219
|
+
}) => JsonResponse<T>;
|
|
1220
|
+
};
|
|
1221
|
+
type UserConfigItem = {
|
|
1222
|
+
id?: string;
|
|
1223
|
+
industry: string;
|
|
1224
|
+
scope: "scope1" | "scope2" | "scope3" | string;
|
|
1225
|
+
category: string;
|
|
1226
|
+
subCategory: string;
|
|
1227
|
+
itemName: string;
|
|
1228
|
+
unit: string;
|
|
1229
|
+
emissionFactor: number;
|
|
1230
|
+
emissionFactorSource?: {
|
|
1231
|
+
name?: string;
|
|
1232
|
+
url?: string;
|
|
1233
|
+
unit?: string;
|
|
1234
|
+
confidence?: number;
|
|
1235
|
+
notes?: string;
|
|
1236
|
+
};
|
|
1237
|
+
requiresMassData?: boolean;
|
|
1238
|
+
aliases?: string[];
|
|
1239
|
+
source?: string;
|
|
1240
|
+
};
|
|
1241
|
+
declare const getItemsForUser: (apiClient: UserConfigApiClient, options?: {
|
|
1242
|
+
industry?: string;
|
|
1243
|
+
}) => Promise<UserConfigItem[]>;
|
|
1244
|
+
declare const addItemForUser: (apiClient: UserConfigApiClient, options: {
|
|
1245
|
+
industry: string;
|
|
1246
|
+
scope: string;
|
|
1247
|
+
category: string;
|
|
1248
|
+
items: Partial<UserConfigItem>[];
|
|
1249
|
+
}) => Promise<UserConfigItem[]>;
|
|
1250
|
+
declare const mergeUserItemsIntoIndustryConfig: <T extends BackendIndustryConfig>(baseConfig: T, userItems?: UserConfigItem[]) => T;
|
|
1251
|
+
|
|
1212
1252
|
interface MappingRules {
|
|
1213
1253
|
includeIfCategoryContains?: string[];
|
|
1214
1254
|
includeIfSubCategoryContains?: string[];
|
|
@@ -4208,5 +4248,5 @@ declare namespace index {
|
|
|
4208
4248
|
};
|
|
4209
4249
|
}
|
|
4210
4250
|
|
|
4211
|
-
export { ALL_SCOPES_3_RCO, 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, getRCOConfigByName, getScope3ConfigByName, getUserNameBackendConfig, getUserNameScopeConfig, hasIntensities, isUIFeatureEnabled, mapIndustryToApiType, sanitizeNumber, supportsIntensityCalculations, validateCarbonIntensityData };
|
|
4212
|
-
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$1 as 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 };
|
|
4251
|
+
export { ALL_SCOPES_3_RCO, 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, addItemForUser, 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, getItemsForUser, getPlantNameConfig, getRCOConfigByName, getScope3ConfigByName, getUserNameBackendConfig, getUserNameScopeConfig, hasIntensities, isUIFeatureEnabled, mapIndustryToApiType, mergeUserItemsIntoIndustryConfig, sanitizeNumber, supportsIntensityCalculations, validateCarbonIntensityData };
|
|
4252
|
+
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$1 as 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, UserConfigApiClient, UserConfigItem, UserData, UtilitiesRequest, UtilitiesResponse, ValidationError, VehicleEmission, VehicleEmissionAttributes, VehicleEmissionsResponse };
|