@ifc-lite/export 4.14.0 → 6.0.0
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/anonymize-placement.d.ts.map +1 -1
- package/dist/anonymize-placement.js +2 -2
- package/dist/anonymize-placement.js.map +1 -1
- package/dist/attribute-slot-types.d.ts.map +1 -1
- package/dist/attribute-slot-types.js +3 -1
- package/dist/attribute-slot-types.js.map +1 -1
- package/dist/effective-index-created-rows.d.ts +3 -0
- package/dist/effective-index-created-rows.d.ts.map +1 -1
- package/dist/effective-index-created-rows.js +16 -5
- package/dist/effective-index-created-rows.js.map +1 -1
- package/dist/effective-index.d.ts.map +1 -1
- package/dist/effective-index.js +2 -1
- package/dist/effective-index.js.map +1 -1
- package/dist/entity-iteration.d.ts +1 -1
- package/dist/entity-iteration.d.ts.map +1 -1
- package/dist/entity-iteration.js.map +1 -1
- package/dist/generated/ifc2x3-typed-properties.d.ts +11 -0
- package/dist/generated/ifc2x3-typed-properties.d.ts.map +1 -0
- package/dist/generated/ifc2x3-typed-properties.js +49 -0
- package/dist/generated/ifc2x3-typed-properties.js.map +1 -0
- package/dist/georef-closure.d.ts +12 -0
- package/dist/georef-closure.d.ts.map +1 -1
- package/dist/georef-closure.js +3 -1
- package/dist/georef-closure.js.map +1 -1
- package/dist/ifc5-exporter.d.ts.map +1 -1
- package/dist/ifc5-exporter.js +3 -10
- package/dist/ifc5-exporter.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/merged-bake.d.ts +32 -0
- package/dist/merged-bake.d.ts.map +1 -0
- package/dist/merged-bake.js +120 -0
- package/dist/merged-bake.js.map +1 -0
- package/dist/merged-context.d.ts +49 -6
- package/dist/merged-context.d.ts.map +1 -1
- package/dist/merged-context.js +165 -53
- package/dist/merged-context.js.map +1 -1
- package/dist/merged-exporter.d.ts +7 -14
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +112 -178
- package/dist/merged-exporter.js.map +1 -1
- package/dist/merged-georef-normalize.d.ts +54 -0
- package/dist/merged-georef-normalize.d.ts.map +1 -0
- package/dist/merged-georef-normalize.js +260 -0
- package/dist/merged-georef-normalize.js.map +1 -0
- package/dist/merged-guid.d.ts +5 -7
- package/dist/merged-guid.d.ts.map +1 -1
- package/dist/merged-guid.js +37 -42
- package/dist/merged-guid.js.map +1 -1
- package/dist/merged-header.d.ts +6 -0
- package/dist/merged-header.d.ts.map +1 -1
- package/dist/merged-header.js +6 -0
- package/dist/merged-header.js.map +1 -1
- package/dist/merged-inverse-claims.d.ts.map +1 -1
- package/dist/merged-inverse-claims.js +3 -2
- package/dist/merged-inverse-claims.js.map +1 -1
- package/dist/merged-planner-guids.d.ts +1 -0
- package/dist/merged-planner-guids.d.ts.map +1 -1
- package/dist/merged-planner-guids.js +5 -6
- package/dist/merged-planner-guids.js.map +1 -1
- package/dist/merged-project-contexts.d.ts +12 -0
- package/dist/merged-project-contexts.d.ts.map +1 -0
- package/dist/merged-project-contexts.js +56 -0
- package/dist/merged-project-contexts.js.map +1 -0
- package/dist/merged-remap.d.ts +3 -1
- package/dist/merged-remap.d.ts.map +1 -1
- package/dist/merged-remap.js +15 -1
- package/dist/merged-remap.js.map +1 -1
- package/dist/merged-subcontext.d.ts +22 -0
- package/dist/merged-subcontext.d.ts.map +1 -1
- package/dist/merged-subcontext.js +14 -18
- package/dist/merged-subcontext.js.map +1 -1
- package/dist/schema-calendar-date-values.d.ts +15 -0
- package/dist/schema-calendar-date-values.d.ts.map +1 -0
- package/dist/schema-calendar-date-values.js +107 -0
- package/dist/schema-calendar-date-values.js.map +1 -0
- package/dist/schema-calendar-dates.d.ts +11 -0
- package/dist/schema-calendar-dates.d.ts.map +1 -0
- package/dist/schema-calendar-dates.js +127 -0
- package/dist/schema-calendar-dates.js.map +1 -0
- package/dist/schema-conversion-loss-description.d.ts +3 -0
- package/dist/schema-conversion-loss-description.d.ts.map +1 -0
- package/dist/schema-conversion-loss-description.js +23 -0
- package/dist/schema-conversion-loss-description.js.map +1 -0
- package/dist/schema-conversion-loss-report.d.ts +22 -19
- package/dist/schema-conversion-loss-report.d.ts.map +1 -1
- package/dist/schema-conversion-loss-report.js +223 -61
- package/dist/schema-conversion-loss-report.js.map +1 -1
- package/dist/schema-converter-attr-maps.d.ts +63 -0
- package/dist/schema-converter-attr-maps.d.ts.map +1 -0
- package/dist/schema-converter-attr-maps.js +186 -0
- package/dist/schema-converter-attr-maps.js.map +1 -0
- package/dist/schema-converter-attr-remap.d.ts +2 -2
- package/dist/schema-converter-attr-remap.d.ts.map +1 -1
- package/dist/schema-converter-attr-remap.js +9 -5
- package/dist/schema-converter-attr-remap.js.map +1 -1
- package/dist/schema-converter-document-links.d.ts +23 -0
- package/dist/schema-converter-document-links.d.ts.map +1 -0
- package/dist/schema-converter-document-links.js +146 -0
- package/dist/schema-converter-document-links.js.map +1 -0
- package/dist/schema-converter-durations.d.ts +9 -0
- package/dist/schema-converter-durations.d.ts.map +1 -0
- package/dist/schema-converter-durations.js +60 -0
- package/dist/schema-converter-durations.js.map +1 -0
- package/dist/schema-converter-enums.d.ts +18 -2
- package/dist/schema-converter-enums.d.ts.map +1 -1
- package/dist/schema-converter-enums.js +39 -6
- package/dist/schema-converter-enums.js.map +1 -1
- package/dist/schema-converter-ifc2x3-slots.d.ts +1 -1
- package/dist/schema-converter-ifc2x3-slots.d.ts.map +1 -1
- package/dist/schema-converter-ifc2x3-slots.js +6 -5
- package/dist/schema-converter-ifc2x3-slots.js.map +1 -1
- package/dist/schema-converter-ifc4-slots.d.ts +4 -3
- package/dist/schema-converter-ifc4-slots.d.ts.map +1 -1
- package/dist/schema-converter-ifc4-slots.js +4 -3
- package/dist/schema-converter-ifc4-slots.js.map +1 -1
- package/dist/schema-converter-ifc4x3-upgrade.d.ts +5 -0
- package/dist/schema-converter-ifc4x3-upgrade.d.ts.map +1 -0
- package/dist/schema-converter-ifc4x3-upgrade.js +41 -0
- package/dist/schema-converter-ifc4x3-upgrade.js.map +1 -0
- package/dist/schema-converter-material-referent.d.ts +55 -0
- package/dist/schema-converter-material-referent.d.ts.map +1 -0
- package/dist/schema-converter-material-referent.js +184 -0
- package/dist/schema-converter-material-referent.js.map +1 -0
- package/dist/schema-converter-owner-history.d.ts +1 -1
- package/dist/schema-converter-owner-history.d.ts.map +1 -1
- package/dist/schema-converter-owner-history.js +4 -3
- package/dist/schema-converter-owner-history.js.map +1 -1
- package/dist/schema-converter-product-proxy.d.ts +0 -23
- package/dist/schema-converter-product-proxy.d.ts.map +1 -1
- package/dist/schema-converter-product-proxy.js +2 -1
- package/dist/schema-converter-product-proxy.js.map +1 -1
- package/dist/schema-converter-renames.d.ts +17 -0
- package/dist/schema-converter-renames.d.ts.map +1 -1
- package/dist/schema-converter-renames.js +34 -2
- package/dist/schema-converter-renames.js.map +1 -1
- package/dist/schema-converter-retyped.d.ts +17 -0
- package/dist/schema-converter-retyped.d.ts.map +1 -0
- package/dist/schema-converter-retyped.js +68 -0
- package/dist/schema-converter-retyped.js.map +1 -0
- package/dist/schema-converter-step-finish.d.ts +4 -0
- package/dist/schema-converter-step-finish.d.ts.map +1 -0
- package/dist/schema-converter-step-finish.js +27 -0
- package/dist/schema-converter-step-finish.js.map +1 -0
- package/dist/schema-converter-structural-axes.d.ts +48 -4
- package/dist/schema-converter-structural-axes.d.ts.map +1 -1
- package/dist/schema-converter-structural-axes.js +350 -31
- package/dist/schema-converter-structural-axes.js.map +1 -1
- package/dist/schema-converter-structural-carriers.d.ts +78 -0
- package/dist/schema-converter-structural-carriers.d.ts.map +1 -0
- package/dist/schema-converter-structural-carriers.js +336 -0
- package/dist/schema-converter-structural-carriers.js.map +1 -0
- package/dist/schema-converter-structural-diagnostics.d.ts +56 -9
- package/dist/schema-converter-structural-diagnostics.d.ts.map +1 -1
- package/dist/schema-converter-structural-diagnostics.js +170 -17
- package/dist/schema-converter-structural-diagnostics.js.map +1 -1
- package/dist/schema-converter-structural-links.d.ts +2 -2
- package/dist/schema-converter-structural-links.d.ts.map +1 -1
- package/dist/schema-converter-structural-links.js +3 -28
- package/dist/schema-converter-structural-links.js.map +1 -1
- package/dist/schema-converter-structural-source.d.ts +83 -0
- package/dist/schema-converter-structural-source.d.ts.map +1 -0
- package/dist/schema-converter-structural-source.js +207 -0
- package/dist/schema-converter-structural-source.js.map +1 -0
- package/dist/schema-converter-structural-thickness.d.ts +33 -0
- package/dist/schema-converter-structural-thickness.d.ts.map +1 -0
- package/dist/schema-converter-structural-thickness.js +155 -0
- package/dist/schema-converter-structural-thickness.js.map +1 -0
- package/dist/schema-converter-structural-varying.d.ts +21 -9
- package/dist/schema-converter-structural-varying.d.ts.map +1 -1
- package/dist/schema-converter-structural-varying.js +83 -54
- package/dist/schema-converter-structural-varying.js.map +1 -1
- package/dist/schema-converter-structural.d.ts +2 -2
- package/dist/schema-converter-structural.d.ts.map +1 -1
- package/dist/schema-converter-structural.js +9 -6
- package/dist/schema-converter-structural.js.map +1 -1
- package/dist/schema-converter-typed-properties.d.ts +30 -0
- package/dist/schema-converter-typed-properties.d.ts.map +1 -0
- package/dist/schema-converter-typed-properties.js +173 -0
- package/dist/schema-converter-typed-properties.js.map +1 -0
- package/dist/schema-converter-unrooted-upgrade.d.ts +14 -0
- package/dist/schema-converter-unrooted-upgrade.d.ts.map +1 -0
- package/dist/schema-converter-unrooted-upgrade.js +228 -0
- package/dist/schema-converter-unrooted-upgrade.js.map +1 -0
- package/dist/schema-converter-userdefined-label.d.ts +8 -0
- package/dist/schema-converter-userdefined-label.d.ts.map +1 -0
- package/dist/schema-converter-userdefined-label.js +61 -0
- package/dist/schema-converter-userdefined-label.js.map +1 -0
- package/dist/schema-converter-userdefined.d.ts +15 -0
- package/dist/schema-converter-userdefined.d.ts.map +1 -0
- package/dist/schema-converter-userdefined.js +59 -0
- package/dist/schema-converter-userdefined.js.map +1 -0
- package/dist/schema-converter-value-forms.d.ts +20 -0
- package/dist/schema-converter-value-forms.d.ts.map +1 -0
- package/dist/schema-converter-value-forms.js +225 -0
- package/dist/schema-converter-value-forms.js.map +1 -0
- package/dist/schema-converter.d.ts +10 -15
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +87 -83
- package/dist/schema-converter.js.map +1 -1
- package/dist/schema-enum-policy.d.ts +5 -1
- package/dist/schema-enum-policy.d.ts.map +1 -1
- package/dist/schema-enum-policy.js +21 -1
- package/dist/schema-enum-policy.js.map +1 -1
- package/dist/schema-ifc2x3-placements.d.ts.map +1 -1
- package/dist/schema-ifc2x3-placements.js +20 -31
- package/dist/schema-ifc2x3-placements.js.map +1 -1
- package/dist/schema-ifc2x3-records.d.ts.map +1 -1
- package/dist/schema-ifc2x3-records.js +3 -2
- package/dist/schema-ifc2x3-records.js.map +1 -1
- package/dist/schema-ifc2x3-style-assignments.d.ts +4 -0
- package/dist/schema-ifc2x3-style-assignments.d.ts.map +1 -0
- package/dist/schema-ifc2x3-style-assignments.js +33 -0
- package/dist/schema-ifc2x3-style-assignments.js.map +1 -0
- package/dist/schema-structural-varying-effective.d.ts +2 -0
- package/dist/schema-structural-varying-effective.d.ts.map +1 -0
- package/dist/schema-structural-varying-effective.js +95 -0
- package/dist/schema-structural-varying-effective.js.map +1 -0
- package/dist/schema-untranslatable.d.ts +22 -13
- package/dist/schema-untranslatable.d.ts.map +1 -1
- package/dist/schema-untranslatable.js +84 -6
- package/dist/schema-untranslatable.js.map +1 -1
- package/dist/schema-value-form-policy.d.ts +129 -0
- package/dist/schema-value-form-policy.d.ts.map +1 -0
- package/dist/schema-value-form-policy.js +255 -0
- package/dist/schema-value-form-policy.js.map +1 -0
- package/dist/step-argument-parser.d.ts +3 -3
- package/dist/step-argument-parser.d.ts.map +1 -1
- package/dist/step-argument-parser.js +6 -6
- package/dist/step-argument-parser.js.map +1 -1
- package/dist/step-collection.d.ts.map +1 -1
- package/dist/step-collection.js +2 -0
- package/dist/step-collection.js.map +1 -1
- package/dist/step-comment-skip.d.ts +8 -0
- package/dist/step-comment-skip.d.ts.map +1 -1
- package/dist/step-comment-skip.js +30 -0
- package/dist/step-comment-skip.js.map +1 -1
- package/dist/step-coordinate-options.d.ts +15 -0
- package/dist/step-coordinate-options.d.ts.map +1 -1
- package/dist/step-coordinate-options.js +13 -1
- package/dist/step-coordinate-options.js.map +1 -1
- package/dist/step-export-types.d.ts +5 -7
- package/dist/step-export-types.d.ts.map +1 -1
- package/dist/step-export-types.js.map +1 -1
- package/dist/step-exporter.d.ts +0 -6
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +19 -12
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-georeferencing.d.ts +2 -0
- package/dist/step-georeferencing.d.ts.map +1 -1
- package/dist/step-georeferencing.js +126 -63
- package/dist/step-georeferencing.js.map +1 -1
- package/dist/step-header.d.ts.map +1 -1
- package/dist/step-header.js +1 -0
- package/dist/step-header.js.map +1 -1
- package/dist/step-internal-pset-ids.js +1 -1
- package/dist/step-internal-pset-ids.js.map +1 -1
- package/dist/step-map-unit-normalization.d.ts.map +1 -1
- package/dist/step-map-unit-normalization.js +5 -4
- package/dist/step-map-unit-normalization.js.map +1 -1
- package/dist/step-map-unit.d.ts +8 -1
- package/dist/step-map-unit.d.ts.map +1 -1
- package/dist/step-map-unit.js +13 -5
- package/dist/step-map-unit.js.map +1 -1
- package/dist/step-omission-predicates.d.ts.map +1 -1
- package/dist/step-omission-predicates.js +1 -0
- package/dist/step-omission-predicates.js.map +1 -1
- package/dist/step-overlay-entities.d.ts +0 -35
- package/dist/step-overlay-entities.d.ts.map +1 -1
- package/dist/step-overlay-entities.js +38 -2
- package/dist/step-overlay-entities.js.map +1 -1
- package/dist/step-pass-builder.d.ts.map +1 -1
- package/dist/step-pass-builder.js +59 -7
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-record-frame.d.ts +5 -3
- package/dist/step-record-frame.d.ts.map +1 -1
- package/dist/step-record-frame.js +12 -8
- package/dist/step-record-frame.js.map +1 -1
- package/dist/step-ref-scan.d.ts +12 -0
- package/dist/step-ref-scan.d.ts.map +1 -1
- package/dist/step-ref-scan.js +24 -3
- package/dist/step-ref-scan.js.map +1 -1
- package/dist/step-serialization.d.ts +12 -0
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +15 -0
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-slot-grammar.d.ts +3 -2
- package/dist/step-slot-grammar.d.ts.map +1 -1
- package/dist/step-slot-grammar.js +5 -5
- package/dist/step-slot-grammar.js.map +1 -1
- package/dist/step-source-iteration.d.ts.map +1 -1
- package/dist/step-source-iteration.js +6 -9
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/unit-normalize.d.ts +2 -2
- package/dist/unit-normalize.d.ts.map +1 -1
- package/dist/unit-normalize.js +23 -13
- package/dist/unit-normalize.js.map +1 -1
- package/dist/viewer-georef-scale.d.ts +14 -0
- package/dist/viewer-georef-scale.d.ts.map +1 -0
- package/dist/viewer-georef-scale.js +20 -0
- package/dist/viewer-georef-scale.js.map +1 -0
- package/package.json +41 -8
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { list } from './schema-ifc2x3-records.js';
|
|
5
|
+
import { stepRecordHead } from './step-record-frame.js';
|
|
6
|
+
import { holdsValue, withoutComments } from './step-comment-skip.js';
|
|
7
|
+
function map(ifc2x3, ifc4, extra = {}) {
|
|
8
|
+
return { ifc2x3, ifc4, renamed: [], retyped: [], upOnly: [], setOfOne: null, ...extra };
|
|
9
|
+
}
|
|
10
|
+
const same = (type, extra = {}) => map(type, type, extra);
|
|
11
|
+
/** IfcResource gained `Identification` and `LongDescription` (the renamed
|
|
12
|
+
* `ResourceGroup`); `BaseQuantity` became an IfcPhysicalQuantity. */
|
|
13
|
+
function resource(type) {
|
|
14
|
+
return same(type, { renamed: [['ResourceIdentifier', 'Identification'], ['ResourceGroup', 'LongDescription']], retyped: ['BaseQuantity'] });
|
|
15
|
+
}
|
|
16
|
+
let attrMapIndex;
|
|
17
|
+
function getAttrMapIndex() {
|
|
18
|
+
if (attrMapIndex)
|
|
19
|
+
return attrMapIndex;
|
|
20
|
+
const maps = [
|
|
21
|
+
same('IFCAPPROVAL', { renamed: [['ApprovalStatus', 'Status'], ['ApprovalLevel', 'Level'], ['ApprovalQualifier', 'Qualifier']] }),
|
|
22
|
+
same('IFCAPPROVALRELATIONSHIP', { setOfOne: ['RelatedApproval', 'RelatedApprovals'] }),
|
|
23
|
+
// IFC4 replaced IfcSurfaceTexture's `TextureType` enum with a `Mode` string of another meaning.
|
|
24
|
+
same('IFCBLOBTEXTURE', { retyped: ['RasterCode'] }),
|
|
25
|
+
same('IFCIMAGETEXTURE', { renamed: [['UrlReference', 'URLReference']] }),
|
|
26
|
+
same('IFCPIXELTEXTURE'),
|
|
27
|
+
same('IFCTEXTURECOORDINATEGENERATOR', { retyped: ['Parameter'] }),
|
|
28
|
+
same('IFCTEXTUREMAP'),
|
|
29
|
+
resource('IFCCONSTRUCTIONEQUIPMENTRESOURCE'),
|
|
30
|
+
resource('IFCCONSTRUCTIONMATERIALRESOURCE'),
|
|
31
|
+
resource('IFCCONSTRUCTIONPRODUCTRESOURCE'),
|
|
32
|
+
resource('IFCCREWRESOURCE'),
|
|
33
|
+
resource('IFCLABORRESOURCE'),
|
|
34
|
+
resource('IFCSUBCONTRACTRESOURCE'),
|
|
35
|
+
same('IFCCOSTSCHEDULE', { renamed: [['ID', 'Identification']], retyped: ['SubmittedOn', 'UpdateDate'] }),
|
|
36
|
+
same('IFCCURRENCYRELATIONSHIP', { retyped: ['RateDateTime'] }),
|
|
37
|
+
same('IFCDOCUMENTINFORMATIONRELATIONSHIP'),
|
|
38
|
+
same('IFCLIBRARYINFORMATION', { retyped: ['VersionDate'], upOnly: ['Publisher'] }),
|
|
39
|
+
// IFC4 deleted these IFC2X3 subtypes for its now-concrete supertype. A
|
|
40
|
+
// downgrade writes IfcGeneralProfileProperties or IfcExtendedMaterialProperties.
|
|
41
|
+
// The material downgrade resolves its Material referent before remapping. An
|
|
42
|
+
// upgrade writes every one as its IFC4 supertype (#10777).
|
|
43
|
+
// The typed subtypes keep only Material or ProfileDefinition; their measures are dropped.
|
|
44
|
+
map('IFCEXTENDEDMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES', { renamed: [['ExtendedProperties', 'Properties']] }),
|
|
45
|
+
map('IFCGENERALPROFILEPROPERTIES', 'IFCPROFILEPROPERTIES'),
|
|
46
|
+
map('IFCMECHANICALMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
47
|
+
map('IFCMECHANICALCONCRETEMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
48
|
+
map('IFCMECHANICALSTEELMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
49
|
+
map('IFCTHERMALMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
50
|
+
map('IFCHYGROSCOPICMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
51
|
+
map('IFCGENERALMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
52
|
+
map('IFCOPTICALMATERIALPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
53
|
+
map('IFCWATERPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
54
|
+
map('IFCFUELPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
55
|
+
map('IFCPRODUCTSOFCOMBUSTIONPROPERTIES', 'IFCMATERIALPROPERTIES'),
|
|
56
|
+
map('IFCSTRUCTURALPROFILEPROPERTIES', 'IFCPROFILEPROPERTIES'),
|
|
57
|
+
map('IFCSTRUCTURALSTEELPROFILEPROPERTIES', 'IFCPROFILEPROPERTIES'),
|
|
58
|
+
map('IFCRIBPLATEPROFILEPROPERTIES', 'IFCPROFILEPROPERTIES'),
|
|
59
|
+
same('IFCPERFORMANCEHISTORY'),
|
|
60
|
+
same('IFCTASK', { renamed: [['TaskId', 'Identification']] }),
|
|
61
|
+
// IFC4 deleted both subtypes for IfcTask: an upgrade writes them as IfcTask
|
|
62
|
+
// (`DELETED_SUBTYPES`), losing MoveFrom, MoveTo, PunchList and ActionID (#10902).
|
|
63
|
+
map('IFCMOVE', 'IFCTASK', { renamed: [['TaskId', 'Identification']] }),
|
|
64
|
+
map('IFCORDERACTION', 'IFCTASK', { renamed: [['TaskId', 'Identification']] }),
|
|
65
|
+
same('IFCPROPERTYDEPENDENCYRELATIONSHIP'),
|
|
66
|
+
// #10824: renamed both ways (IFC2X3_TO_IFC4, the MEP table); the IFC2X3
|
|
67
|
+
// label is carried through ObjectType (`schema-converter-userdefined-label.ts`).
|
|
68
|
+
map('IFCELECTRICDISTRIBUTIONPOINT', 'IFCELECTRICDISTRIBUTIONBOARD', { renamed: [['DistributionPointFunction', 'PredefinedType']] }),
|
|
69
|
+
// #10807: same arity as IFC2X3, so the source layout shifted unnoticed.
|
|
70
|
+
same('IFCPROCEDURE', { renamed: [['ProcedureID', 'Identification'], ['ProcedureType', 'PredefinedType']] }),
|
|
71
|
+
same('IFCOBJECTIVE', { retyped: ['CreationTime'], upOnly: ['BenchmarkValues'], setOfOne: ['BenchmarkValues', 'BenchmarkValues'] }),
|
|
72
|
+
same('IFCDOCUMENTINFORMATION', { renamed: [['DocumentId', 'Identification']], retyped: ['CreationTime', 'LastRevisionTime', 'ElectronicFormat', 'ValidFrom', 'ValidUntil'] }),
|
|
73
|
+
];
|
|
74
|
+
attrMapIndex = {
|
|
75
|
+
maps,
|
|
76
|
+
byIfc2x3: new Map(maps.map((m) => [m.ifc2x3, m])),
|
|
77
|
+
byIfc4: new Map(maps.map((m) => [m.ifc4, m])),
|
|
78
|
+
};
|
|
79
|
+
return attrMapIndex;
|
|
80
|
+
}
|
|
81
|
+
/** The reviewed supertype of an IFC2X3 property subtype (#10777). */
|
|
82
|
+
export function upgradeRename(type, fromSchema, toSchema) {
|
|
83
|
+
if (fromSchema !== 'IFC2X3' || (toSchema !== 'IFC4' && toSchema !== 'IFC4X3'))
|
|
84
|
+
return undefined;
|
|
85
|
+
const target = getAttrMapIndex().byIfc2x3.get(type)?.ifc4;
|
|
86
|
+
return target === type ? undefined : target;
|
|
87
|
+
}
|
|
88
|
+
export function getAttrMaps() {
|
|
89
|
+
return getAttrMapIndex().maps;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* IFC2X3 subtypes IFC4 deleted, written as their IFC4 supertype on an upgrade
|
|
93
|
+
* to IFC4 or IFC4X3 (#10902): IfcMove and IfcOrderAction through their map
|
|
94
|
+
* above, the relationships by the prefix trim (identical lists, or TimeForTask
|
|
95
|
+
* lost and reported). Not IfcRelOverridesProperties, which as
|
|
96
|
+
* IfcRelDefinesByProperties would attach the values it overrides, nor IFC5,
|
|
97
|
+
* which has no table to reconcile the attributes in. Twin of Rust
|
|
98
|
+
* `schema_attr_maps::upgrade_type`.
|
|
99
|
+
*/
|
|
100
|
+
export const DELETED_SUBTYPES = new Map([
|
|
101
|
+
['IFCMOVE', 'IFCTASK'], ['IFCORDERACTION', 'IFCTASK'],
|
|
102
|
+
['IFCRELOCCUPIESSPACES', 'IFCRELASSIGNSTOACTOR'],
|
|
103
|
+
['IFCRELASSIGNSTASKS', 'IFCRELASSIGNSTOCONTROL'], ['IFCRELASSIGNSTOPROJECTORDER', 'IFCRELASSIGNSTOCONTROL'],
|
|
104
|
+
['IFCRELSCHEDULESCOSTITEMS', 'IFCRELASSIGNSTOCONTROL'],
|
|
105
|
+
]);
|
|
106
|
+
/** True when an IFC4 `line` upgraded from IFC2X3 gets its required slots
|
|
107
|
+
* counted: a structural record, or one a map wrote, which can leave a
|
|
108
|
+
* required slot with no source value (#10763). The type is read from the
|
|
109
|
+
* record head. Twin of Rust `upgrade_counts_ifc4_slots`. */
|
|
110
|
+
export function upgradeCountsIfc4Slots(line) {
|
|
111
|
+
const head = stepRecordHead(line);
|
|
112
|
+
const type = head ? line.slice(head.typeStart, head.typeEnd) : '';
|
|
113
|
+
return type.startsWith('IFCSTRUCTURAL') || getAttrMapIndex().byIfc4.has(type);
|
|
114
|
+
}
|
|
115
|
+
/** The map for writing `entityType` as `newType`, and whether it runs upward. */
|
|
116
|
+
export function attrMapFor(entityType, newType, fromSchema, toSchema) {
|
|
117
|
+
if (fromSchema === 'IFC2X3' && (toSchema === 'IFC4' || toSchema === 'IFC4X3')) {
|
|
118
|
+
const found = getAttrMapIndex().byIfc2x3.get(entityType);
|
|
119
|
+
const target = toSchema === 'IFC4X3' && newType === 'IFCDISTRIBUTIONBOARD'
|
|
120
|
+
? 'IFCELECTRICDISTRIBUTIONBOARD' : newType;
|
|
121
|
+
return found?.ifc4 === target ? { map: found, up: true } : undefined;
|
|
122
|
+
}
|
|
123
|
+
if (toSchema === 'IFC2X3' && (fromSchema === 'IFC4' || fromSchema === 'IFC4X3')) {
|
|
124
|
+
// IFC4X3 also declares the renamed IfcDistributionBoard with the same carried slots (#11021).
|
|
125
|
+
const source = fromSchema === 'IFC4X3' && entityType === 'IFCDISTRIBUTIONBOARD'
|
|
126
|
+
? 'IFCELECTRICDISTRIBUTIONBOARD' : entityType;
|
|
127
|
+
// Different IFC2X3 types can share the same IFC4 type.
|
|
128
|
+
const found = getAttrMapIndex().byIfc2x3.get(newType);
|
|
129
|
+
return found?.ifc4 === source ? { map: found, up: false } : undefined;
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
/** The source attribute (in the source list `src`) that fills target `name`. */
|
|
134
|
+
function sourceOf(map, up, name, src) {
|
|
135
|
+
// An up-only attribute fills no IFC2X3 slot, however it would be reached.
|
|
136
|
+
if (!up && map.upOnly.includes(name))
|
|
137
|
+
return undefined;
|
|
138
|
+
// Pairs are [IFC2X3 name, IFC4 name]; the target's side is the second on an upgrade.
|
|
139
|
+
const [target, source] = up ? [1, 0] : [0, 1];
|
|
140
|
+
const renamed = map.renamed.find((pair) => pair[target] === name);
|
|
141
|
+
if (renamed)
|
|
142
|
+
return { name: renamed[source], how: 'value' };
|
|
143
|
+
if (map.setOfOne?.[target] === name)
|
|
144
|
+
return { name: map.setOfOne[source], how: up ? 'wrap' : 'unwrap' };
|
|
145
|
+
const carried = !map.retyped.includes(name);
|
|
146
|
+
return carried && src.includes(name) ? { name, how: 'value' } : undefined;
|
|
147
|
+
}
|
|
148
|
+
/** The first member of a STEP list, or the value itself when it is not one. */
|
|
149
|
+
function firstMember(value) {
|
|
150
|
+
const members = list(value);
|
|
151
|
+
if (members === null)
|
|
152
|
+
return value;
|
|
153
|
+
return members.find(holdsValue)?.trim() ?? '$';
|
|
154
|
+
}
|
|
155
|
+
/** `values` (in the source layout `src`) written in the target layout `tgt`.
|
|
156
|
+
* Same output as Rust `schema_attr_maps::remap`. */
|
|
157
|
+
export function remapByAttrMap(map, up, values, src, tgt) {
|
|
158
|
+
return tgt.map((name) => {
|
|
159
|
+
const from = sourceOf(map, up, name, src);
|
|
160
|
+
const i = from ? src.indexOf(from.name) : -1;
|
|
161
|
+
const value = i >= 0 && i < values.length ? values[i] : '$';
|
|
162
|
+
if (!from)
|
|
163
|
+
return '$';
|
|
164
|
+
// A SET is rebuilt, so comments around it or its members go.
|
|
165
|
+
const bare = from.how === 'value' ? value : withoutComments(value);
|
|
166
|
+
if (!holdsValue(bare))
|
|
167
|
+
return '$';
|
|
168
|
+
if (from.how === 'value')
|
|
169
|
+
return bare;
|
|
170
|
+
if (from.how === 'unwrap')
|
|
171
|
+
return firstMember(bare);
|
|
172
|
+
return bare.startsWith('(') ? bare : `(${bare})`;
|
|
173
|
+
}).join(',');
|
|
174
|
+
}
|
|
175
|
+
/** Whether narrowing this SET to one value discards any held member. */
|
|
176
|
+
export function dropsSetMembers(value) {
|
|
177
|
+
const members = list(withoutComments(value));
|
|
178
|
+
return members !== null && members.filter(holdsValue).length > 1;
|
|
179
|
+
}
|
|
180
|
+
/** Source attributes with no target slot for their values, including a SET
|
|
181
|
+
* that could lose members. The model report checks that SET per record. */
|
|
182
|
+
export function attrsDroppedByMap(map, up, src, tgt) {
|
|
183
|
+
const used = new Set(tgt.flatMap((name) => sourceOf(map, up, name, src)?.name ?? []));
|
|
184
|
+
return src.filter((name) => !used.has(name) || (!up && name === map.setOfOne?.[1]));
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=schema-converter-attr-maps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-attr-maps.js","sourceRoot":"","sources":["../src/schema-converter-attr-maps.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmB/D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAkBrE,SAAS,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,QAA0B,EAAE;IACrE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;AAC1F,CAAC;AAED,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,QAA0B,EAAE,EAAW,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAE7F;sEACsE;AACtE,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;AAC9I,CAAC;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O,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACnE,CAAC;AAED;4EAC4E;AAC5E,MAAM,UAAU,iBAAiB,CAAC,GAAY,EAAE,EAAW,EAAE,GAAsB,EAAE,GAAsB;IACzG,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IACtF,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,IAAI,KAAK,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* `splitTopLevelStepArguments("'a' , $ , #3 ")` returns
|
|
21
21
|
* `["'a' ", " $ ", " #3 "]`, and no test pinned the trimming half.
|
|
22
22
|
*/
|
|
23
|
-
export declare function splitTopLevelAttributes(attrsRaw: string): string[] | null;
|
|
23
|
+
export declare function splitTopLevelAttributes(attrsRaw: string, maxReferenceId?: number): string[] | null;
|
|
24
24
|
/**
|
|
25
25
|
* Renamed entity types whose attribute lists are safe to reconcile BY NAME
|
|
26
26
|
* (`remapRenamedAttributesByName`) instead of leaving the line's attributes
|
|
@@ -85,5 +85,5 @@ export declare function isGridPlacementInSourceLayout(entityType: string, argCou
|
|
|
85
85
|
* argument or not — because this output carries exactly the target's
|
|
86
86
|
* attribute count. Same policy and shape as the Rust `remap_attrs_by_name`.
|
|
87
87
|
*/
|
|
88
|
-
export declare function remapRenamedAttributesByName(attrsRaw: string, srcNames: readonly string[], tgtNames: readonly string[]): string | null;
|
|
88
|
+
export declare function remapRenamedAttributesByName(attrsRaw: string, srcNames: readonly string[], tgtNames: readonly string[], maxReferenceId?: number): string | null;
|
|
89
89
|
//# sourceMappingURL=schema-converter-attr-remap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-attr-remap.d.ts","sourceRoot":"","sources":["../src/schema-converter-attr-remap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-converter-attr-remap.d.ts","sourceRoot":"","sources":["../src/schema-converter-attr-remap.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAElG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,wBAAwB,aAKnC,CAAC;AAEH;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAEhH;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,GAAG,IAAI,CAWf"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { withoutComments } from './step-comment-skip.js';
|
|
4
5
|
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
5
6
|
/**
|
|
6
7
|
* Attribute-list reconciliation for a genuine cross-schema entity RENAME
|
|
@@ -24,8 +25,8 @@ import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
|
24
25
|
* `splitTopLevelStepArguments("'a' , $ , #3 ")` returns
|
|
25
26
|
* `["'a' ", " $ ", " #3 "]`, and no test pinned the trimming half.
|
|
26
27
|
*/
|
|
27
|
-
export function splitTopLevelAttributes(attrsRaw) {
|
|
28
|
-
return splitTopLevelStepArguments(attrsRaw);
|
|
28
|
+
export function splitTopLevelAttributes(attrsRaw, maxReferenceId) {
|
|
29
|
+
return splitTopLevelStepArguments(attrsRaw, maxReferenceId);
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Renamed entity types whose attribute lists are safe to reconcile BY NAME
|
|
@@ -98,14 +99,17 @@ export function isGridPlacementInSourceLayout(entityType, argCount, targetCount)
|
|
|
98
99
|
* argument or not — because this output carries exactly the target's
|
|
99
100
|
* attribute count. Same policy and shape as the Rust `remap_attrs_by_name`.
|
|
100
101
|
*/
|
|
101
|
-
export function remapRenamedAttributesByName(attrsRaw, srcNames, tgtNames) {
|
|
102
|
-
const values = splitTopLevelAttributes(attrsRaw);
|
|
102
|
+
export function remapRenamedAttributesByName(attrsRaw, srcNames, tgtNames, maxReferenceId) {
|
|
103
|
+
const values = splitTopLevelAttributes(attrsRaw, maxReferenceId);
|
|
103
104
|
if (values === null)
|
|
104
105
|
return null;
|
|
105
106
|
const byName = new Map();
|
|
106
107
|
for (let i = 0; i < srcNames.length && i < values.length; i++) {
|
|
107
108
|
byName.set(srcNames[i], values[i]);
|
|
108
109
|
}
|
|
109
|
-
return tgtNames.map((name) =>
|
|
110
|
+
return tgtNames.map((name) => {
|
|
111
|
+
const value = byName.get(name) ?? '$';
|
|
112
|
+
return withoutComments(value) === '$' ? '$' : value;
|
|
113
|
+
}).join(',');
|
|
110
114
|
}
|
|
111
115
|
//# sourceMappingURL=schema-converter-attr-remap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-attr-remap.js","sourceRoot":"","sources":["../src/schema-converter-attr-remap.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB;
|
|
1
|
+
{"version":3,"file":"schema-converter-attr-remap.js","sourceRoot":"","sources":["../src/schema-converter-attr-remap.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB,EAAE,cAAuB;IAC/E,OAAO,0BAA0B,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IAC9C,aAAa;IACb,eAAe;IACf,0BAA0B;IAC1B,4BAA4B;CAC7B,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAAC,UAAkB,EAAE,QAAgB,EAAE,WAAmB;IACrG,OAAO,UAAU,KAAK,kBAAkB,IAAI,QAAQ,KAAK,WAAW,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAgB,EAChB,QAA2B,EAC3B,QAA2B,EAC3B,cAAuB;IAEvB,MAAM,MAAM,GAAG,uBAAuB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACjE,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;QACtC,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type SourceRecords } from './schema-converter-structural-source.js';
|
|
2
|
+
/** Whether a conversion between the schemas can move the link. */
|
|
3
|
+
export declare const documentLinksApply: (from: string, to: string) => boolean;
|
|
4
|
+
export declare class DocumentLinks {
|
|
5
|
+
/** The index of the link slot in the converted record; -1 until armed. */
|
|
6
|
+
private at;
|
|
7
|
+
/** The converted reference's Name slot on an upgrade; -1 otherwise. */
|
|
8
|
+
private nameAt;
|
|
9
|
+
/** Source references whose Name an upgrade drops for WR1 (the loss report). */
|
|
10
|
+
readonly unnamed: Set<number>;
|
|
11
|
+
/** Listed source references an upgrade leaves unlinked: a Name is all that identifies them. */
|
|
12
|
+
private readonly nameOnly;
|
|
13
|
+
/** Converted record id -> the value its link slot takes. */
|
|
14
|
+
private readonly fill;
|
|
15
|
+
/** Source records whose link attribute this writes on the other side, by that attribute (the loss report). */
|
|
16
|
+
readonly restored: Map<number, ReadonlySet<string>>;
|
|
17
|
+
private listedAgain;
|
|
18
|
+
fromSource(source: SourceRecords, from: string, to: string): void;
|
|
19
|
+
/** `line`, already converted, with its link slot written. */
|
|
20
|
+
apply(line: string, maxReferenceId?: number): string;
|
|
21
|
+
warnings(): string[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=schema-converter-document-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-document-links.d.ts","sourceRoot":"","sources":["../src/schema-converter-document-links.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAOjG,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM,KAAG,OACc,CAAC;AAE7E,qBAAa,aAAa;IACxB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAM;IAChB,uEAAuE;IACvE,OAAO,CAAC,MAAM,CAAM;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,cAAqB;IACrC,+FAA+F;IAC/F,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;IAClD,8GAA8G;IAC9G,QAAQ,CAAC,QAAQ,mCAA0C;IAC3D,OAAO,CAAC,WAAW,CAAK;IAExB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAsDjE,6DAA6D;IAC7D,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM;IAYpD,QAAQ,IAAI,MAAM,EAAE;CAarB"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
/**
|
|
3
|
+
* IfcDocumentInformation <-> IfcDocumentReference: the link IFC4 moved to the
|
|
4
|
+
* other record (#10846). IFC2X3 lists a document's references in
|
|
5
|
+
* `IfcDocumentInformation.DocumentReferences`; IFC4 made that an inverse and
|
|
6
|
+
* points each reference at its document with
|
|
7
|
+
* `IfcDocumentReference.ReferencedDocument`. A line converter can only write
|
|
8
|
+
* `$` for the slot on the other record, so this prepass reads the links from
|
|
9
|
+
* the source and `apply` writes them: on an upgrade, ReferencedDocument on
|
|
10
|
+
* each listed reference; on a downgrade, DocumentReferences on each document
|
|
11
|
+
* a reference names.
|
|
12
|
+
*
|
|
13
|
+
* IFC2X3 lets one document list a reference (`ReferenceToDocument : SET
|
|
14
|
+
* [0:1]`), so a reference listed again keeps its first document and the
|
|
15
|
+
* extra listing is reported. WR1 (`EXISTS(Name) XOR EXISTS(the document)`,
|
|
16
|
+
* in both schemas) leaves the name to the document, so a listed reference with
|
|
17
|
+
* a Name already breaks IFC2X3 WR1; the upgrade drops that Name, reported. One
|
|
18
|
+
* whose Name is all that identifies it (IfcExternalReference.WR1 needs
|
|
19
|
+
* Location, Identification or Name) keeps the Name and is not linked,
|
|
20
|
+
* reported. Types come from the source, so only an unedited full export arms
|
|
21
|
+
* it. Twin of Rust `schema_document_links.rs`.
|
|
22
|
+
*/
|
|
23
|
+
import { attrNameTable } from './schema-converter.js';
|
|
24
|
+
import { listItems } from './schema-converter-structural-axes.js';
|
|
25
|
+
import { slotRef, slotUnset } from './schema-converter-structural-source.js';
|
|
26
|
+
import { readStepSlots } from './step-argument-parser.js';
|
|
27
|
+
const DOC = 'IFCDOCUMENTINFORMATION';
|
|
28
|
+
const REF = 'IFCDOCUMENTREFERENCE';
|
|
29
|
+
const ifc4Like = (s) => s === 'IFC4' || s === 'IFC4X3';
|
|
30
|
+
/** Whether a conversion between the schemas can move the link. */
|
|
31
|
+
export const documentLinksApply = (from, to) => (from === 'IFC2X3' && ifc4Like(to)) || (to === 'IFC2X3' && ifc4Like(from));
|
|
32
|
+
export class DocumentLinks {
|
|
33
|
+
/** The index of the link slot in the converted record; -1 until armed. */
|
|
34
|
+
at = -1;
|
|
35
|
+
/** The converted reference's Name slot on an upgrade; -1 otherwise. */
|
|
36
|
+
nameAt = -1;
|
|
37
|
+
/** Source references whose Name an upgrade drops for WR1 (the loss report). */
|
|
38
|
+
unnamed = new Set();
|
|
39
|
+
/** Listed source references an upgrade leaves unlinked: a Name is all that identifies them. */
|
|
40
|
+
nameOnly = new Set();
|
|
41
|
+
/** Converted record id -> the value its link slot takes. */
|
|
42
|
+
fill = new Map();
|
|
43
|
+
/** Source records whose link attribute this writes on the other side, by that attribute (the loss report). */
|
|
44
|
+
restored = new Map();
|
|
45
|
+
listedAgain = 0;
|
|
46
|
+
fromSource(source, from, to) {
|
|
47
|
+
if (!documentLinksApply(from, to))
|
|
48
|
+
return;
|
|
49
|
+
const names = (schema, type) => attrNameTable(schema)?.get(type);
|
|
50
|
+
const up = from === 'IFC2X3';
|
|
51
|
+
// The side that holds the link in the source, its slot, and the slot it moves to.
|
|
52
|
+
const [holder, target] = up ? [DOC, REF] : [REF, DOC];
|
|
53
|
+
const readAt = names(from, holder)?.indexOf(up ? 'DocumentReferences' : 'ReferencedDocument') ?? -1;
|
|
54
|
+
const at = names(to, target)?.indexOf(up ? 'ReferencedDocument' : 'DocumentReferences') ?? -1;
|
|
55
|
+
if (readAt < 0 || at < 0)
|
|
56
|
+
return;
|
|
57
|
+
const targets = new Set(source.ids(target));
|
|
58
|
+
// A holder whose slot count is not the source schema's is not read.
|
|
59
|
+
const holders = source.ids(holder).flatMap((id) => {
|
|
60
|
+
const slots = source.slots(id);
|
|
61
|
+
return slots && slots.length === names(from, holder).length ? [{ id, link: slots[readAt] }] : [];
|
|
62
|
+
});
|
|
63
|
+
const link = new Set([up ? 'DocumentReferences' : 'ReferencedDocument']);
|
|
64
|
+
if (up) {
|
|
65
|
+
// IFC2X3 IfcDocumentReference: Location, ItemReference, Name.
|
|
66
|
+
const set = (ref, i) => { const slot = source.slots(ref)?.[i]; return slot !== undefined && !slotUnset(slot); };
|
|
67
|
+
const named = new Set([...targets].filter((ref) => set(ref, 2)));
|
|
68
|
+
for (const ref of named)
|
|
69
|
+
if (!set(ref, 0) && !set(ref, 1))
|
|
70
|
+
targets.delete(ref);
|
|
71
|
+
for (const { id: doc, link: listed } of holders) {
|
|
72
|
+
const members = listItems(listed) ?? [];
|
|
73
|
+
const tag = `#${doc}`;
|
|
74
|
+
let whole = members.length > 0;
|
|
75
|
+
for (const member of members) {
|
|
76
|
+
const ref = slotRef(member);
|
|
77
|
+
const first = ref === null ? undefined : this.fill.get(ref);
|
|
78
|
+
if (ref !== null && named.has(ref) && !targets.has(ref))
|
|
79
|
+
this.nameOnly.add(ref);
|
|
80
|
+
if (ref === null || !targets.has(ref))
|
|
81
|
+
whole = false;
|
|
82
|
+
else if (first === undefined)
|
|
83
|
+
this.fill.set(ref, tag);
|
|
84
|
+
// A repeat inside one list is not a second document.
|
|
85
|
+
else if (first !== tag) {
|
|
86
|
+
this.listedAgain++;
|
|
87
|
+
whole = false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (whole)
|
|
91
|
+
this.restored.set(doc, link);
|
|
92
|
+
}
|
|
93
|
+
for (const ref of this.fill.keys())
|
|
94
|
+
if (named.has(ref))
|
|
95
|
+
this.unnamed.add(ref);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
const lists = new Map();
|
|
99
|
+
for (const { id: ref, link: named } of holders) {
|
|
100
|
+
const doc = slotRef(named);
|
|
101
|
+
if (doc === null || !targets.has(doc))
|
|
102
|
+
continue;
|
|
103
|
+
this.restored.set(ref, link);
|
|
104
|
+
const list = lists.get(doc) ?? [];
|
|
105
|
+
list.push(`#${ref}`);
|
|
106
|
+
lists.set(doc, list);
|
|
107
|
+
}
|
|
108
|
+
for (const [doc, members] of lists)
|
|
109
|
+
this.fill.set(doc, `(${members.join(',')})`);
|
|
110
|
+
}
|
|
111
|
+
if (this.fill.size === 0)
|
|
112
|
+
return;
|
|
113
|
+
this.at = at;
|
|
114
|
+
if (up)
|
|
115
|
+
this.nameAt = names(to, REF)?.indexOf('Name') ?? -1;
|
|
116
|
+
}
|
|
117
|
+
/** `line`, already converted, with its link slot written. */
|
|
118
|
+
apply(line, maxReferenceId) {
|
|
119
|
+
if (this.at < 0)
|
|
120
|
+
return line;
|
|
121
|
+
const id = Number(/^\s*#(\d+)/.exec(line)?.[1]);
|
|
122
|
+
const value = this.fill.get(id);
|
|
123
|
+
const record = value ? readStepSlots(line, maxReferenceId) : null;
|
|
124
|
+
if (!record || !slotUnset(record.slots[this.at]))
|
|
125
|
+
return line;
|
|
126
|
+
const slots = [...record.slots];
|
|
127
|
+
slots[this.at] = value;
|
|
128
|
+
if (this.nameAt >= 0 && this.nameAt < slots.length && this.unnamed.has(id))
|
|
129
|
+
slots[this.nameAt] = '$';
|
|
130
|
+
return `${record.prefix}${slots.join(',')}${record.suffix}`;
|
|
131
|
+
}
|
|
132
|
+
warnings() {
|
|
133
|
+
return [
|
|
134
|
+
...(this.listedAgain > 0
|
|
135
|
+
? [`${this.listedAgain} IfcDocumentReference listing(s) past a reference's first IfcDocumentInformation were dropped: IFC4 ReferencedDocument names one document (#10846).`]
|
|
136
|
+
: []),
|
|
137
|
+
...(this.unnamed.size > 0
|
|
138
|
+
? [`${this.unnamed.size} IfcDocumentReference Name(s) were dropped (the source breaks IFC2X3 WR1 too): IFC4 WR1 gives a reference a Name only when it has no ReferencedDocument, whose Name stands (#10846).`]
|
|
139
|
+
: []),
|
|
140
|
+
...(this.nameOnly.size > 0
|
|
141
|
+
? [`${this.nameOnly.size} IfcDocumentReference(s) identified only by Name keep it and lose their IfcDocumentInformation link (the source breaks IFC2X3 WR1): IFC4 WR1 forbids Name beside ReferencedDocument, and IfcExternalReference.WR1 needs Location, Identification or Name (#10846).`]
|
|
142
|
+
: []),
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=schema-converter-document-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-document-links.js","sourceRoot":"","sources":["../src/schema-converter-document-links.ts"],"names":[],"mappings":"A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C;YAAE,OAAO,IAAI,CAAC;QAC9D,MAAM,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,KAAM,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;QACrG,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;IAC9D,CAAC;IAED,QAAQ;QACN,OAAO;YACL,GAAG,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC;gBACtB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,qJAAqJ,CAAC;gBAC5K,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC;gBACvB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,sLAAsL,CAAC;gBAC9M,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC;gBACxB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,oQAAoQ,CAAC;gBAC7R,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SourceStore } from './schema-converter-structural-source.js';
|
|
2
|
+
/** Expand the STEP decimal without rounding it. */
|
|
3
|
+
export declare function decimalSeconds(token: string): string | null;
|
|
4
|
+
export declare function durationFromSeconds(token: string): string | null;
|
|
5
|
+
/** Weeks, days and clock units are fixed in seconds. Calendar years and months need a date. */
|
|
6
|
+
export declare function durationToSeconds(token: string): string | null;
|
|
7
|
+
export declare const DURATION_TIME_UNIT_WARNING = "Work-control duration conversion assumed seconds despite a non-second project TIMEUNIT. The exported duration or total float may have changed (#11192).";
|
|
8
|
+
export declare function hasNonSecondProjectTimeUnit(store: SourceStore): boolean;
|
|
9
|
+
//# sourceMappingURL=schema-converter-durations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-durations.d.ts","sourceRoot":"","sources":["../src/schema-converter-durations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAI9G,mDAAmD;AACnD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc3D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIhE;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS9D;AAED,eAAO,MAAM,0BAA0B,4JAA4J,CAAC;AAEpM,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAYvE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
import { toStepReal } from './step-serialization.js';
|
|
3
|
+
import { parseStepNumber } from './step-slot-grammar.js';
|
|
4
|
+
import { SourceRecords, slotRef, slotUnset } from './schema-converter-structural-source.js';
|
|
5
|
+
import { listItems } from './schema-converter-structural-axes.js';
|
|
6
|
+
import { withoutComments } from './step-comment-skip.js';
|
|
7
|
+
/** Expand the STEP decimal without rounding it. */
|
|
8
|
+
export function decimalSeconds(token) {
|
|
9
|
+
if (!Number.isFinite(parseStepNumber(token)))
|
|
10
|
+
return null;
|
|
11
|
+
const m = /^([+-]?)(\d+)(?:\.(\d*))?(?:[eE]([+-]?\d+))?$/.exec(token);
|
|
12
|
+
if (!m)
|
|
13
|
+
return null;
|
|
14
|
+
const [, sign, integer, fraction = '', power = '0'] = m;
|
|
15
|
+
const exponent = Number(power);
|
|
16
|
+
if (Math.abs(exponent) > 324)
|
|
17
|
+
return null;
|
|
18
|
+
const digits = integer + fraction;
|
|
19
|
+
const point = integer.length + exponent;
|
|
20
|
+
const whole = point <= 0 ? '0' : digits.slice(0, point).padEnd(point, '0');
|
|
21
|
+
const tail = point <= 0 ? '0'.repeat(-point) + digits : digits.slice(point);
|
|
22
|
+
const trimmed = tail.replace(/0+$/, '');
|
|
23
|
+
const decimal = whole.replace(/^0+(?=\d)/, '') + (trimmed ? '.' + trimmed : '');
|
|
24
|
+
return (sign === '-' && decimal !== '0' ? '-' : '') + decimal;
|
|
25
|
+
}
|
|
26
|
+
export function durationFromSeconds(token) {
|
|
27
|
+
const decimal = decimalSeconds(token);
|
|
28
|
+
if (decimal === null)
|
|
29
|
+
return null;
|
|
30
|
+
return decimal.startsWith('-') ? "'-PT" + decimal.slice(1) + "S'" : "'PT" + decimal + "S'";
|
|
31
|
+
}
|
|
32
|
+
/** Weeks, days and clock units are fixed in seconds. Calendar years and months need a date. */
|
|
33
|
+
export function durationToSeconds(token) {
|
|
34
|
+
const m = /^'(-)?P(?:(\d+(?:\.\d+)?)W|(?:(\d+(?:\.\d+)?)D)?(?:T(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?)'$/.exec(token);
|
|
35
|
+
if (!m || m[0].endsWith("T'"))
|
|
36
|
+
return null;
|
|
37
|
+
const fields = m.slice(2);
|
|
38
|
+
const supplied = fields.filter((part) => part !== undefined);
|
|
39
|
+
if (!supplied.length || supplied.slice(0, -1).some((part) => part.includes('.')))
|
|
40
|
+
return null;
|
|
41
|
+
const scales = [604800, 86400, 3600, 60, 1];
|
|
42
|
+
const seconds = fields.reduce((total, part, index) => total + Number(part ?? 0) * scales[index], 0);
|
|
43
|
+
return Number.isFinite(seconds) ? toStepReal(m[1] ? -seconds : seconds) : null;
|
|
44
|
+
}
|
|
45
|
+
export const DURATION_TIME_UNIT_WARNING = 'Work-control duration conversion assumed seconds despite a non-second project TIMEUNIT. The exported duration or total float may have changed (#11192).';
|
|
46
|
+
export function hasNonSecondProjectTimeUnit(store) {
|
|
47
|
+
const records = new SourceRecords(store);
|
|
48
|
+
return records.ids('IFCPROJECT').some((project) => {
|
|
49
|
+
const assignment = slotRef(records.slots(project)?.[8]); // IfcProject.UnitsInContext
|
|
50
|
+
if (records.type(assignment) !== 'IFCUNITASSIGNMENT')
|
|
51
|
+
return false;
|
|
52
|
+
return (listItems(records.slots(assignment)?.[0] ?? '') ?? []).some((ref) => {
|
|
53
|
+
const id = slotRef(ref);
|
|
54
|
+
const slots = records.slots(id);
|
|
55
|
+
return slots !== undefined && withoutComments(slots[1] ?? '').toUpperCase() === '.TIMEUNIT.'
|
|
56
|
+
&& !(records.type(id) === 'IFCSIUNIT' && slotUnset(slots[2]) && withoutComments(slots[3] ?? '').toUpperCase() === '.SECOND.');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=schema-converter-durations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-durations.js","sourceRoot":"","sources":["../src/schema-converter-durations.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAC9G,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,mDAAmD;AACnD,MAAM,UAAU,cAAc,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AAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,WAAW,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,CAAC;QAClI,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -14,15 +14,31 @@
|
|
|
14
14
|
* record whose arity is not the target's is left alone, the same guard the
|
|
15
15
|
* required-slot passes use (position `i` need not be attribute `i`).
|
|
16
16
|
*/
|
|
17
|
+
import { TypedPropertyUpgrade } from './schema-converter-typed-properties.js';
|
|
17
18
|
import { StructuralDiagnostics } from './schema-converter-structural-diagnostics.js';
|
|
19
|
+
import { DocumentLinks } from './schema-converter-document-links.js';
|
|
20
|
+
import type { SourceStore } from './schema-converter-structural-source.js';
|
|
21
|
+
import { ValueForms } from './schema-converter-value-forms.js';
|
|
22
|
+
import { MaterialReferents } from './schema-converter-material-referent.js';
|
|
18
23
|
import { type SchemaVersionWithRegistry } from '@ifc-lite/parser';
|
|
19
24
|
/** Enum reconciliation for one export: rewrites, and counts what it lost. */
|
|
20
25
|
export declare class EnumReconciliation {
|
|
26
|
+
readonly typedProperties: TypedPropertyUpgrade;
|
|
21
27
|
/** Reuses this per-export collector so both STEP writers forward structural losses. */
|
|
22
28
|
readonly structural: StructuralDiagnostics;
|
|
29
|
+
/** The IfcDocumentInformation <-> IfcDocumentReference link (#10846). */
|
|
30
|
+
readonly documents: DocumentLinks;
|
|
31
|
+
/** Values a target slot's type cannot hold (#10847). */
|
|
32
|
+
readonly forms: ValueForms;
|
|
33
|
+
/** The IfcMaterial a downgraded IfcMaterialProperties names (#10763). */
|
|
34
|
+
readonly materials: MaterialReferents;
|
|
35
|
+
constructor(deferConversions?: boolean, timeUnitSources?: readonly SourceStore[]);
|
|
23
36
|
private readonly losses;
|
|
24
|
-
/**
|
|
25
|
-
|
|
37
|
+
/** Records written `.USERDEFINED.` with the label their rule needs unset, per type (#10780). */
|
|
38
|
+
private readonly unlabelled;
|
|
39
|
+
/** Reconcile `line`, already converted to `toSchema`, then report a broken USERDEFINED rule (#10780). */
|
|
40
|
+
apply(line: string, toSchema: SchemaVersionWithRegistry, maxReferenceId?: number): string;
|
|
41
|
+
private reconcile;
|
|
26
42
|
/** One warning per loss kind, naming what it happened to (#5365). */
|
|
27
43
|
warnings(): string[];
|
|
28
44
|
private record;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-enums.d.ts","sourceRoot":"","sources":["../src/schema-converter-enums.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAA+B,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-converter-enums.d.ts","sourceRoot":"","sources":["../src/schema-converter-enums.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAA+B,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AA6C/F,6EAA6E;AAC7E,qBAAa,kBAAkB;IAC7B,QAAQ,CAAC,eAAe,EAAE,oBAAoB,CAAC;IAE/C,uFAAuF;IACvF,QAAQ,CAAC,UAAU,wBAA+B;IAClD,yEAAyE;IACzE,QAAQ,CAAC,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