@mod-construction/mod-dlm
Version:
mod-dlm is an open source project designed to create a domain-specific language (DSL) for describing prefab elements in the Architecture, Engineering, and Construction (AEC) industry. This project provides tools for defining entity models and automaticall
2 lines • 23.4 kB
JavaScript
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var Ae=Object.defineProperty,Ie=Object.defineProperties;var Re=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var Me=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable;var R=(e,i,o)=>i in e?Ae(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,M=(e,i)=>{for(var o in i||(i={}))Me.call(i,o)&&R(e,o,i[o]);if(I)for(var o of I(i))Te.call(i,o)&&R(e,o,i[o]);return e},T=(e,i)=>Ie(e,Re(i));var _zod = require('zod');function O(e){if(typeof e.ZodType.prototype.openapi!="undefined")return;e.ZodType.prototype.openapi=function(s){return new this.constructor(T(M({},this._def),{openapi:s}))};let i=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...s){let n=i.apply(this,s);return n._def.extendMetadata={extends:this},delete n._def.openapi,n};let o=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...s){let n=o.apply(this,s);return delete n._def.extendMetadata,delete n._def.openapi,n};let Pe=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...s){let n=Pe.apply(this,s);return delete n._def.extendMetadata,delete n._def.openapi,n}}O(_zod.z);var F=_zod.z.object({weightedSoundReductionIndex:_zod.z.number().describe("Rw value in dB (ISO 717-1)"),spectrumAdaptationTerm:_zod.z.number().optional().describe("Ctr value in dB (optional, ISO 717-1)")});var D=_zod.z.object({colorOptions:_zod.z.string().array().optional(),texture:_zod.z.string().optional(),modularAdaptability:_zod.z.string().optional()});var v=_zod.z.object({width:_zod.z.number().gt(0,"Width must be greater than 0"),height:_zod.z.number().gt(0,"Height must be greater than 0"),depth:_zod.z.number().gt(0,"Depth must be greater than 0")}).openapi({description:"The bounding box of an element in millimeters."});var L=_zod.z.object({certificationTypes:_zod.z.array(_zod.z.string()),regulatoryApprovals:_zod.z.array(_zod.z.string())});var y=_zod.z.object({min:_zod.z.number().gt(0,"Minimum value must be greater than 0"),max:_zod.z.number().gt(0,"Maximum value must be greater than 0")}).openapi({description:"A range of dimensions in millimeters",example:{min:10,max:20}});var z=_zod.z.object({width:y,height:y,length:y});var U=_zod.z.object({technicalSpecifications:_zod.z.string(),certifications:L});var w=_zod.z.enum(["1","2","3","4","5"]).openapi({description:"Quantified ease of disassembly based on ISO 20887:2020: 1 = not disassemblable without destruction, 2 = destructive tools required, 3 = partial with tools, 4 = full with tools, 5 = tool-free or designed-for-disassembly.",example:"3"}),W= exports.ReusePotentialEnum =_zod.z.enum(["single-use","multi-use","recyclable","remanufacturable"]).openapi({description:"Potential for reuse of the product: 'single-use' means one-time use, 'multi-use' indicates multiple uses, 'recyclable' means material can be recycled, and 'remanufacturable' means product can be refurbished and remanufactured.",example:"recyclable"}),j= exports.RefurbishmentScopeEnum =_zod.z.enum(["none","surface-only","partial","full"]).openapi({description:"Scope of refurbishment possible: 'none' means no refurbishment, 'surface-only' indicates minor surface work, 'partial' means moderate refurbishment, and 'full' means complete refurbishment.",example:"partial"}),N= exports.CircularityCertificationEnum =_zod.z.enum(["none","C2C_basic","C2C_bronze","C2C_silver","C2C_gold","C2C_platinum"]).openapi({description:"Certification levels for circularity according to Cradle to Cradle (C2C) standards, ranging from 'none' to 'C2C_platinum'.",example:"C2C_gold"}),u= exports.ProductMaterialEnum =_zod.z.enum(["Timber","Steel","Concrete","Hybrid","Other"]).openapi({description:"Primary material of the product element.",example:"Steel"}),_= exports.BuildingSystemEnum =_zod.z.enum(["Wall","Balcony","Pod","Frame","Facade","Floors","Modules","Plants","Roofs","Stairs"]).openapi({description:"Building system category to which the product element belongs.",example:"Facade"}),k= exports.ProductCategoryEnum =_zod.z.enum(["Boarding","Solid Wall Panels","Closed Wall Panels","Twinwall","Open Wall Panels","Structural Insulated Panels (SIPs)","Insulated Concrete Panels","Prefabricated Balcony","Pod","Whole Building System","Structural Frame","Facade System","Hollowcore Floor","Concrete Lattice Floor","Floor Cassettes","Solid Floor Panels","Volumetric module","Prefabricated Plant","Roof Panel","Roof Truss","Prefabricated Stairs"]).openapi({description:"Specific product category within building systems.",example:"Structural Insulated Panels (SIPs)"}),V= exports.SeismicResistance =_zod.z.enum(["SDS \u2264 0.167g","0.167g < SDS \u2264 0.33g","0.33g < SDS \u2264 0.50g","SDS > 0.50g"]).openapi({description:"Seismic Design Spectral Acceleration at short period (SDS), as defined by ASCE 7 or Eurocode 8 hazard maps.",example:"0.167g < SDS \u2264 0.33g"}),q= exports.WindLoadResistance =_zod.z.enum(["\u2264 1.0 kPa","1.0\u20132.5 kPa","2.5\u20134.0 kPa","> 4.0 kPa"]).openapi({description:"Wind pressure resistance in kilopascals (kPa), typically calculated per EN 1991-1-4 or ASCE 7-16.",example:"2.5\u20134.0 kPa"}),G= exports.SustainabilityClassification =_zod.z.enum(["A+","A","B","C","D"]).openapi({description:"Simplified sustainability score, where A+ indicates highest performance. Define based on EPD or lifecycle impact benchmarks.",example:"A"}),H= exports.VOCEmissions =_zod.z.enum(["None (<0.01 mg/m\xB3)","Very Low (<0.1 mg/m\xB3)","Low (0.1\u20130.3 mg/m\xB3)","Moderate (0.3\u20131.0 mg/m\xB3)","High (>1.0 mg/m\xB3)"]).openapi({description:"Qualitative VOC emissions categories with indicative thresholds based on ISO 16000 or GREENGUARD standards.",example:"Low (0.1\u20130.3 mg/m\xB3)"}),ct= exports.Recyclability =_zod.z.number().min(0).max(100).describe("Percentage of the element's mass that is recyclable, based on EN 45555 or similar assessment."),Z= exports.EnergyEfficiency =_zod.z.enum(["R-1","R-2","R-5","Energy Star","LEED Certified","LEED Silver","LEED Gold","LEED Platinum","BREEAM Good","BREEAM Very Good","BREEAM Excellent","BREEAM Outstanding","Passive House","DGNB Gold"]).openapi({description:"Energy performance classification, combining insulation tiers and certifications (LEED, BREEAM, etc.).",example:"LEED Gold"}),Q= exports.ConnectionType =_zod.z.enum(["Bolt-on","Welded","Clip-on","Adhesive","Mortar","Snap-fit","Plug-and-Play","Dry Joint"]).openapi({description:"Type of connection used for assembly, including mechanical, chemical, and modular methods.",example:"Bolt-on"}),J= exports.LoadBearingTestStandardEnum =_zod.z.enum(["EN 1991-1-1","ASTM E72","ISO 4355"]).openapi({description:"Structural load testing standard used to determine maximum load.",example:"ASTM E72"}),Y= exports.CompatibilityEnum =_zod.z.enum(["Steel Frame","Wood Frame","Concrete Structure","Brickwork","Modular Systems","Glass Facades","Composite Materials","CLT","Light Gauge Steel","Masonry Infill"]).openapi({description:"Structural systems compatible with the prefab element, supporting integration into various construction assemblies.",example:"Concrete Structure"}),$= exports.LoadDistributionEnum =_zod.z.enum(["point","uniform","triangular","trapezoidal","eccentric","custom"]).openapi({description:"The type of load distribution applied to the element.",example:"point"}),K= exports.IfcBuildingElementEnum =_zod.z.enum(["IfcBeam","IfcChimney","IfcColumn","IfcCovering","IfcCurtainWall","IfcDoor","IfcFooting","IfcMember","IfcPile","IfcPlate","IfcRailing","IfcRamp","IfcRampFlight","IfcRoof","IfcShadingDevice","IfcSlab","IfcStair","IfcStairFlight","IfcWall","IfcWallStandardCase","IfcWindow","IfcBuildingElementProxy"]).openapi({description:"Enumeration of IFC Building Element types based on IFC 4.3.",example:"IfcWall"}),X= exports.CurrencyEnum =_zod.z.enum(["EUR","USD","GBP","CHF","JPY","CNY"]).openapi({description:"Currency of the cost estimate, using ISO 4217 codes.",example:"EUR"}),ee= exports.FireResistanceEnum =_zod.z.enum(["A1","A2","B","C","D","E","F"]).openapi({description:"Fire resistance classification based on Euroclass standards (EN 13501-1).",example:"A1"}),te= exports.FireResistanceDurationEnum =_zod.z.enum(["30min","60min","90min","120min","180min","240min"]).openapi({description:"Fire resistance duration in minutes (EN 1363-1 / ASTM E119).",example:"30min"});var ie=_zod.z.object({costPerUnit:_zod.z.number().optional().describe("Estimated cost per unit of the prefab element, in selected currency.").openapi({description:"Estimated cost per unit of the prefab element.",example:180.5}),currency:X.optional().describe("Currency of the cost estimate, using ISO 4217 codes.").openapi({description:"Currency used for the cost estimate (e.g., EUR, USD).",example:"EUR"}),manufacturingLeadTime:_zod.z.number().optional().describe("Typical time required to manufacture one unit in days.").openapi({description:"Estimated manufacturing lead time in days.",example:21})});var oe=_zod.z.object({reactionToFireClassification:ee,fireResistanceDuration:te}).openapi({description:"Fire resistance classification of the material, based on Euroclass standards (EN 13501-1).",example:{reactionToFireClassification:"A1",fireResistanceDuration:"30min"}});var ae=_zod.z.object({connectionType:Q.optional(),installationTime:_zod.z.number().min(0).describe("Estimated installation time in minutes"),compatibility:Y.optional()}).openapi({description:"Describes how the prefab element is installed and what structural systems it is compatible with.",ref:"InstallationAndConnectivity"});var re=_zod.z.object({expectedLifespan:_zod.z.number().optional().describe("Expected lifespan of the prefab element in years.").openapi({description:"Expected lifespan of the prefab element in years.",example:50}),maintenanceRequirements:_zod.z.string().optional().describe("Maintenance requirements of the prefab element.").openapi({description:"Maintenance requirements of the prefab element.",example:"Regular cleaning and inspection."}),warranty:_zod.z.string().optional().describe("Warranty information of the prefab element.").openapi({description:"Warranty information of the prefab element.",example:"10 years warranty."})});var _convertunits = require('convert-units'); var _convertunits2 = _interopRequireDefault(_convertunits);var _all = require('convert-units/definitions/all'); var _all2 = _interopRequireDefault(_all);var c=_convertunits2.default.call(void 0, _all2.default),se=c().possibilities("force"),ce=c().possibilities("mass"),me=c().possibilities("length"),le=c().possibilities("area"),pe=c().possibilities("volume"),de=c().possibilities("torque"),ue=c().possibilities("temperature"),r=e=>e;var fe=_zod.z.enum(r(se)),Ot= exports.MassUnits =_zod.z.enum(r(ce)),Ft= exports.LengthUnits =_zod.z.enum(r(me)),Dt= exports.AreaUnits =_zod.z.enum(r(le)),vt= exports.VolumeUnits =_zod.z.enum(r(pe)),Lt= exports.TorqueUnits =_zod.z.enum(r(de)),zt= exports.TempratureUnits =_zod.z.enum(r(ue));var ye=_zod.z.object({maximumLoad:_zod.z.number().positive("Maximum load must be a positive number").describe("The maximum load the element can bear, expressed as a positive number (e.g., 5.0)"),forceUnit:fe.describe("Unit of force measurement, e.g., 'kN' for kilonewtons or 'N' for newtons"),loadDistribution:$.describe("The type of load distribution applied to the element"),testStandard:J.optional()}).openapi({description:"The maximum load the element can bear, expressed as a positive number (e.g., 5.0)",example:{maximumLoad:5,forceUnit:"kN",loadDistribution:"point",testStandard:"EN 1991-1-1"}});var ze=_zod.z.object({type:u,grade:_zod.z.string()}),kt= exports.MaterialCompositionSchema =_zod.z.object({materials:_zod.z.array(ze)});var ge=_zod.z.object({fireResistance:oe,thermalTransmittance:_zod.z.number().min(0).max(2).describe("Thermal transmittance (U-value) in W/m\xB2K, typically between 0 and 2"),acousticProperties:F.optional(),airTightness:_zod.z.number().min(0).describe("Air permeability (e.g., n50 value in 1/h or q50 in m\xB3/h\xB7m\xB2) - lower values indicate better airtightness"),vaporPermeability:_zod.z.number().min(0).describe("Vapor permeability in \xB5 or Sd value in meters (ISO 12572) - measures resistance to water vapor diffusion")});var Ue=_zod.z.object({category:k,buildingSystem:_}),we= exports.productCategoryValues =[{category:"Boarding",buildingSystem:"Wall"},{category:"Solid Wall Panels",buildingSystem:"Wall"},{category:"Closed Wall Panels",buildingSystem:"Wall"},{category:"Twinwall",buildingSystem:"Wall"},{category:"Open Wall Panels",buildingSystem:"Wall"},{category:"Structural Insulated Panels (SIPs)",buildingSystem:"Wall"},{category:"Insulated Concrete Panels",buildingSystem:"Wall"},{category:"Whole Building System",buildingSystem:"Frame"},{category:"Structural Frame",buildingSystem:"Frame"},{category:"Hollowcore Floor",buildingSystem:"Floors"},{category:"Concrete Lattice Floor",buildingSystem:"Floors"},{category:"Floor Cassettes",buildingSystem:"Floors"},{category:"Solid Floor Panels",buildingSystem:"Floors"},{category:"Roof Panel",buildingSystem:"Roofs"},{category:"Roof Truss",buildingSystem:"Roofs"},{category:"Prefabricated Balcony",buildingSystem:"Balcony"},{category:"Pod",buildingSystem:"Pod"},{category:"Facade System",buildingSystem:"Facade"},{category:"Volumetric module",buildingSystem:"Modules"},{category:"Prefabricated Plant",buildingSystem:"Plants"},{category:"Prefabricated Stairs",buildingSystem:"Stairs"}],he= exports.ProductCategorySchema =Ue.refine(e=>we.some(i=>i.category===e.category&&i.buildingSystem===e.buildingSystem),{message:"Invalid product category or building system",path:["productCategory"]}).openapi({description:"Product Category",example:{category:"Solid Wall Panels",buildingSystem:"Wall"},ref:"ProductCategory"});var Se=_zod.z.object({finishMaterial:u,structuralMaterial:u});var xe=_zod.z.object({loadBearingCapacity:ye.optional(),seismicResistance:_zod.z.union([V,_zod.z.string().describe("Custom seismic classification (e.g., Eurocode 8, ASCE 7 zone)")]).optional(),windLoadResistance:_zod.z.union([q,_zod.z.string().describe("Custom wind classification or rating (e.g., EN 1991-1-4)")]).optional(),deflectionLimit:_zod.z.union([_zod.z.number().describe("Maximum deflection under load in mm"),_zod.z.string().regex(/^L\/\d+$/,"Use format like 'L/250'").describe("Deflection limit as a span ratio (e.g., 'L/250')")]).optional().describe("Deflection control criteria under load: either fixed displacement in mm or span ratio like L/250"),safetyFactor:_zod.z.number().min(1).optional().describe("Applied safety factor for structural design, typically 1.0\u20132.0")});var Ee=_zod.z.object({environmentalImpact:_zod.z.object({classification:G.describe("Sustainability classification rating (e.g., A+, A, B...)").openapi({description:"Overall sustainability score based on environmental impact (e.g., A+, A, B).",example:"A+"}),VOCEmissions:H.optional().describe("Volatile Organic Compounds emissions level.").openapi({description:"VOC emissions category: None, Low, Medium, or High.",example:"Low (0.1\u20130.3 mg/m\xB3)"}),recyclability:_zod.z.number().min(0).max(100).optional().describe("Percentage of the element that is recyclable.").openapi({description:"Recyclability rate of the product from 0 to 100%.",example:85}),energyEfficiency:Z.describe("Energy performance certification, e.g., LEED or Energy Star.").openapi({description:"Energy certification level or standard.",example:"LEED Certified"})}),circularity:_zod.z.object({disassemblyRating:w.describe("Ease of disassembly based on ISO 20887:2020.").openapi({description:"Rating from 1 (not disassemblable) to 5 (tool-free disassembly).",example:"3"}),reusePotential:W.describe("End-of-life reuse potential: single-use, recyclable, etc.").openapi({description:"Primary reuse potential of the element after its service life.",example:"recyclable"}),refurbishmentScope:j.describe("Extent to which the element can be refurbished.").openapi({description:"Refurbishment level: none, surface-only, partial, or full.",example:"partial"}),circularityCertification:N.describe("Cradle to Cradle or similar certification.").openapi({description:"Level of circularity certification (e.g., C2C_gold).",example:"C2C_gold"})}),origin:_zod.z.object({countryOfManufacturing:_zod.z.string().describe("Country where the element is manufactured.").openapi({description:"Country of production for lifecycle and logistics assessment.",example:"Germany"})})}).openapi({description:"Sustainability attributes of the element.",ref:"Sustainability"});var ci=_zod.z.object({uValue:_zod.z.number(),insulationType:_zod.z.string()});var Ce=_zod.z.object({version:_zod.z.string().regex(/^\d+\.\d+\.\d+$/,"Version must follow semantic versioning (e.g., 1.0.0)").describe("Semantic version of the prefab element, e.g., '1.0.0'"),status:_zod.z.enum(["draft","published","deprecated"]).describe("Publishing status of the element"),lastUpdated:_zod.z.string().datetime().describe("ISO 8601 timestamp of the last update")});var je=_zod.z.string().uuid().openapi({description:"A unique identifier for an element",example:"4dd643ff-7ec7-4666-9c88-50b7d3da34e4",ref:"ElementId",param:{in:"path",name:"id"}}),Mi= exports.PrefabElementSchema =_zod.z.object({id:je.describe("Unique identifier for the prefab element (UUID).").openapi({description:"A unique identifier for the prefab element (UUID).",example:"4dd643ff-7ec7-4666-9c88-50b7d3da34e4"}),versionMetadata:Ce.describe("Versioning and publishing status metadata of the element.").openapi({description:"Versioning and publishing status metadata of the element."}),name:_zod.z.string().min(1,"Name is required").describe("Name of the prefab element").openapi({description:"Human-readable name of the prefab element.",example:"Cross-Laminated Timber Wall Panel"}),description:_zod.z.string().min(1,"Description is required").describe("Detailed description of the element").openapi({description:"Detailed description of the prefab element, including its intended use or application.",example:"This CLT wall panel is suitable for multi-story residential buildings and meets fire resistance standards."}),boundingBox:v.describe("3D bounding dimensions of the prefab element.").openapi({description:"3D bounding dimensions of the prefab element, defining its spatial envelope."}),images:_zod.z.array(_zod.z.string()).min(1,"At least one image is required").describe("Image URLs of the element").openapi({description:"List of image URLs showing the prefab element from various angles.",example:["https://example.com/images/clt-wall-front.png"]}),productCategory:he.describe("Product category classification used for filtering and recommendation.").openapi({description:"Product category classification (e.g., Wall Panels, Stairs, Facade Elements)."}),material:Se.describe("Material composition and technical attributes.").openapi({description:"Material and physical properties of the prefab element."}),dimensional:z.describe("Dimensional specifications like height, width, thickness, etc.").openapi({description:"Dimensional characteristics of the prefab element."}),structuralProperties:xe.optional().describe("Load-bearing and performance data relevant to structural design.").openapi({description:"Optional structural performance details like capacity, stiffness, or seismic resistance."}),performance:ge.optional().describe("Optional mechanical, thermal, and acoustic performance data.").openapi({description:"Optional performance metrics related to strength, insulation, or soundproofing."}),sustainability:Ee.optional().describe("Optional environmental attributes including embodied carbon or certifications.").openapi({description:"Environmental and sustainability performance such as EPDs or recyclability."}),documentationAndCompliance:U.optional().describe("Optional links to technical documents, certificates, and compliance data.").openapi({description:"Optional metadata linking to certificates, spec sheets, or regulatory documents."}),installationAndConnectivity:ae.optional().describe("Optional installation and interface information for compatibility checks.").openapi({description:"Optional installation guidelines and connectivity interface descriptions."}),lifecycleAndMaintenance:re.optional().describe("Optional data for durability, service intervals, and maintenance needs.").openapi({description:"Optional data describing maintenance schedules or expected lifecycle."}),aestheticAndCustomizationOptions:D.optional().describe("Optional fields related to colors, textures, and customization.").openapi({description:"Optional aesthetic options like finishes or material variations."}),economicFactors:ie.optional().describe("Optional fields describing cost, lead time, and economic implications.").openapi({description:"Optional cost estimation, lead time, and supply constraints."}),ifcType:K.optional().describe("Optional IFC classification type for BIM model integration.").openapi({description:"IFC Building Element types based on IFC 4.3 used in BIM tools for semantic classification. (e.g., IfcWall, IfcSlab).",example:"IfcWallStandardCase"}),bimModelUrl:_zod.z.string().url().optional().describe("Optional URL linking to the BIM model (e.g., IFC file or 3D viewer link) for the prefab element.").openapi({description:"Optional URL pointing to a downloadable BIM model or online viewer for the element.",example:"https://example.com/models/clt-wall.ifc"})}).openapi({description:"Prefab Element",ref:"PrefabElement"});exports.AcousticPropertiesSchema = F; exports.AestheticAndCustomizationOptionsSchema = D; exports.AreaUnits = Dt; exports.BoundingBoxSchema = v; exports.BuildingSystemEnum = _; exports.CertificationsSchema = L; exports.CircularityCertificationEnum = N; exports.CompatibilityEnum = Y; exports.ConnectionType = Q; exports.CurrencyEnum = X; exports.DimensionalAttributesSchema = z; exports.DisassemblyRatingEnum = w; exports.DocumentationAndComplianceSchema = U; exports.EconomicFactorsSchema = ie; exports.ElementIdSchema = je; exports.EnergyEfficiency = Z; exports.FireResistanceDurationEnum = te; exports.FireResistanceEnum = ee; exports.FireResistanceSchema = oe; exports.ForceUnitsEnum = fe; exports.IfcBuildingElementEnum = K; exports.InstallationAndConnectivitySchema = ae; exports.LengthUnits = Ft; exports.LifecycleAndMaintenanceSchema = re; exports.LoadBearingCapacitySchema = ye; exports.LoadBearingTestStandardEnum = J; exports.LoadDistributionEnum = $; exports.MassUnits = Ot; exports.MaterialCompositionSchema = kt; exports.MaterialSchema = ze; exports.PerformanceAttributesSchema = ge; exports.PrefabElementSchema = Mi; exports.ProductCategoryEnum = k; exports.ProductCategorySchema = he; exports.ProductMaterialAttributesSchema = Se; exports.ProductMaterialEnum = u; exports.RangeSchema = y; exports.Recyclability = ct; exports.RefurbishmentScopeEnum = j; exports.ReusePotentialEnum = W; exports.SeismicResistance = V; exports.StructuralPropertiesSchema = xe; exports.SustainabilityClassification = G; exports.SustainabilitySchema = Ee; exports.TempratureUnits = zt; exports.ThermalPropertiesSchema = ci; exports.TorqueUnits = Lt; exports.VOCEmissions = H; exports.VersionMetadataSchema = Ce; exports.VolumeUnits = vt; exports.WindLoadResistance = q; exports.productCategoryValues = we;
//# sourceMappingURL=index.js.map