@fgv/ts-res 5.1.0-2 → 5.1.0-20
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.browser.js.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
- package/dist/packlets/bundle/bundleLoader.js.map +1 -0
- package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
- package/dist/packlets/bundle/bundleUtils.js.map +1 -0
- package/dist/packlets/bundle/convert.js.map +1 -0
- package/dist/packlets/bundle/index.js.map +1 -0
- package/dist/packlets/bundle/model.js.map +1 -0
- package/dist/packlets/common/conditions.js.map +1 -0
- package/dist/packlets/common/convert.js.map +1 -0
- package/dist/packlets/common/helpers/conditions.js.map +1 -0
- package/dist/packlets/common/helpers/context.js.map +1 -0
- package/dist/packlets/common/helpers/index.js.map +1 -0
- package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
- package/dist/packlets/common/helpers/resources.js +2 -4
- package/dist/packlets/common/helpers/resources.js.map +1 -0
- package/dist/packlets/common/index.js.map +1 -0
- package/dist/packlets/common/resources.js.map +1 -0
- package/dist/packlets/common/validate/conditions.js +4 -4
- package/dist/packlets/common/validate/conditions.js.map +1 -0
- package/dist/packlets/common/validate/index.js.map +1 -0
- package/dist/packlets/common/validate/regularExpressions.js +2 -2
- package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
- package/dist/packlets/common/validate/resources.js +1 -1
- package/dist/packlets/common/validate/resources.js.map +1 -0
- package/dist/packlets/conditions/condition.js +3 -7
- package/dist/packlets/conditions/condition.js.map +1 -0
- package/dist/packlets/conditions/conditionCollector.js.map +1 -0
- package/dist/packlets/conditions/conditionDecls.js.map +1 -0
- package/dist/packlets/conditions/conditionSet.js.map +1 -0
- package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
- package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
- package/dist/packlets/conditions/conditionToken.js.map +1 -0
- package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
- package/dist/packlets/conditions/convert/decls.js.map +1 -0
- package/dist/packlets/conditions/convert/index.js.map +1 -0
- package/dist/packlets/conditions/index.js.map +1 -0
- package/dist/packlets/config/common.js +78 -0
- package/dist/packlets/config/common.js.map +1 -0
- package/dist/packlets/config/configInitFactory.js +258 -0
- package/dist/packlets/config/configInitFactory.js.map +1 -0
- package/dist/packlets/config/convert.js +56 -0
- package/dist/packlets/config/convert.js.map +1 -0
- package/dist/packlets/config/index.browser.js +34 -0
- package/dist/packlets/config/index.browser.js.map +1 -0
- package/dist/packlets/config/index.js +28 -0
- package/dist/packlets/config/index.js.map +1 -0
- package/dist/packlets/config/json.js +23 -0
- package/dist/packlets/config/json.js.map +1 -0
- package/dist/packlets/config/predefined/default.js +138 -0
- package/dist/packlets/config/predefined/default.js.map +1 -0
- package/dist/packlets/config/predefined/extended.js +190 -0
- package/dist/packlets/config/predefined/extended.js.map +1 -0
- package/dist/packlets/config/predefined/index.js +25 -0
- package/dist/packlets/config/predefined/index.js.map +1 -0
- package/dist/packlets/config/systemConfiguration.js +147 -0
- package/dist/packlets/config/systemConfiguration.js.map +1 -0
- package/dist/packlets/context/contextDecls.js.map +1 -0
- package/dist/packlets/context/contextToken.js.map +1 -0
- package/dist/packlets/context/convert/decls.js.map +1 -0
- package/dist/packlets/context/convert/index.js.map +1 -0
- package/dist/packlets/context/index.js.map +1 -0
- package/dist/packlets/decisions/abstractDecision.js.map +1 -0
- package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
- package/dist/packlets/decisions/candidate.js.map +1 -0
- package/dist/packlets/decisions/common.js.map +1 -0
- package/dist/packlets/decisions/concreteDecision.js.map +1 -0
- package/dist/packlets/decisions/decision.js +1 -1
- package/dist/packlets/decisions/decision.js.map +1 -0
- package/dist/packlets/decisions/index.js.map +1 -0
- package/dist/packlets/import/fsItem.js +1 -4
- package/dist/packlets/import/fsItem.js.map +1 -0
- package/dist/packlets/import/importContext.js +3 -3
- package/dist/packlets/import/importContext.js.map +1 -0
- package/dist/packlets/import/importManager.js +7 -3
- package/dist/packlets/import/importManager.js.map +1 -0
- package/dist/packlets/import/importable.js.map +1 -0
- package/dist/packlets/import/importers/collectionImporter.js +2 -2
- package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
- package/dist/packlets/import/importers/fsItemImporter.js +30 -14
- package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
- package/dist/packlets/import/importers/importer.js.map +1 -0
- package/dist/packlets/import/importers/index.browser.js.map +1 -0
- package/dist/packlets/import/importers/index.js.map +1 -0
- package/dist/packlets/import/importers/jsonImporter.js +2 -2
- package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
- package/dist/packlets/import/importers/pathImporter.js +1 -1
- package/dist/packlets/import/importers/pathImporter.js.map +1 -0
- package/dist/packlets/import/index.browser.js.map +1 -0
- package/dist/packlets/import/index.js.map +1 -0
- package/dist/packlets/qualifier-types/config/convert.js +124 -0
- package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
- package/dist/packlets/qualifier-types/config/index.js +25 -0
- package/dist/packlets/qualifier-types/config/index.js.map +1 -0
- package/dist/packlets/qualifier-types/config/json.js +32 -0
- package/dist/packlets/qualifier-types/config/json.js.map +1 -0
- package/dist/packlets/qualifier-types/convert.js.map +1 -0
- package/dist/packlets/qualifier-types/helpers.js.map +1 -0
- package/dist/packlets/qualifier-types/index.js.map +1 -0
- package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
- package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
- package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
- package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
- package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
- package/dist/packlets/qualifier-types/qualifierType.js +12 -13
- package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
- package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
- package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
- package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
- package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
- package/dist/packlets/qualifiers/convert/index.js.map +1 -0
- package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
- package/dist/packlets/qualifiers/index.js.map +1 -0
- package/dist/packlets/qualifiers/qualifier.js +6 -7
- package/dist/packlets/qualifiers/qualifier.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierCollector.js +2 -2
- package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
- package/dist/packlets/resource-json/compiled/common.js.map +1 -0
- package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
- package/dist/packlets/resource-json/compiled/index.js.map +1 -0
- package/dist/packlets/resource-json/compiled/json.js.map +1 -0
- package/dist/packlets/resource-json/convert.js.map +1 -0
- package/dist/packlets/resource-json/helpers.js.map +1 -0
- package/dist/packlets/resource-json/index.js.map +1 -0
- package/dist/packlets/resource-json/json.js.map +1 -0
- package/dist/packlets/resource-json/normalized.js.map +1 -0
- package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
- package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
- package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
- package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
- package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
- package/dist/packlets/resource-types/config/convert.js +35 -0
- package/dist/packlets/resource-types/config/convert.js.map +1 -0
- package/dist/packlets/resource-types/config/index.js +25 -0
- package/dist/packlets/resource-types/config/index.js.map +1 -0
- package/dist/packlets/resource-types/config/json.js +23 -0
- package/dist/packlets/resource-types/config/json.js.map +1 -0
- package/dist/packlets/resource-types/helpers.js.map +1 -0
- package/dist/packlets/resource-types/index.js.map +1 -0
- package/dist/packlets/resource-types/jsonResourceType.js +2 -2
- package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
- package/dist/packlets/resource-types/resourceType.js +2 -2
- package/dist/packlets/resource-types/resourceType.js.map +1 -0
- package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
- package/dist/packlets/resources/candidateReducer.js.map +1 -0
- package/dist/packlets/resources/candidateValue.js.map +1 -0
- package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
- package/dist/packlets/resources/common.js.map +1 -0
- package/dist/packlets/resources/deltaGenerator.js.map +1 -0
- package/dist/packlets/resources/index.js.map +1 -0
- package/dist/packlets/resources/resource.js.map +1 -0
- package/dist/packlets/resources/resourceBuilder.js +2 -2
- package/dist/packlets/resources/resourceBuilder.js.map +1 -0
- package/dist/packlets/resources/resourceCandidate.js.map +1 -0
- package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
- package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
- package/dist/packlets/runtime/cacheListener.js.map +1 -0
- package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
- package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
- package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
- package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
- package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
- package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
- package/dist/packlets/runtime/context/index.js.map +1 -0
- package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
- package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
- package/dist/packlets/runtime/iResourceManager.js.map +1 -0
- package/dist/packlets/runtime/index.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
- package/dist/packlets/runtime/resourceResolver.js.map +1 -0
- package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
- package/dist/packlets/runtime/validate.js.map +1 -0
- package/dist/packlets/zip-archive/convert.js.map +1 -0
- package/dist/packlets/zip-archive/index.browser.js.map +1 -0
- package/dist/packlets/zip-archive/index.js.map +1 -0
- package/dist/packlets/zip-archive/json.js.map +1 -0
- package/dist/packlets/zip-archive/types.js.map +1 -0
- package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
- package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
- package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
- package/dist/ts-res.d.ts +134 -112
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.browser.d.ts.map +1 -0
- package/lib/index.browser.js.map +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
- package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleLoader.js.map +1 -0
- package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
- package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleUtils.js.map +1 -0
- package/lib/packlets/bundle/convert.d.ts.map +1 -0
- package/lib/packlets/bundle/convert.js.map +1 -0
- package/lib/packlets/bundle/index.d.ts.map +1 -0
- package/lib/packlets/bundle/index.js.map +1 -0
- package/lib/packlets/bundle/model.d.ts.map +1 -0
- package/lib/packlets/bundle/model.js.map +1 -0
- package/lib/packlets/common/conditions.d.ts.map +1 -0
- package/lib/packlets/common/conditions.js.map +1 -0
- package/lib/packlets/common/convert.d.ts.map +1 -0
- package/lib/packlets/common/convert.js.map +1 -0
- package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
- package/lib/packlets/common/helpers/conditions.js.map +1 -0
- package/lib/packlets/common/helpers/context.d.ts.map +1 -0
- package/lib/packlets/common/helpers/context.js.map +1 -0
- package/lib/packlets/common/helpers/index.d.ts.map +1 -0
- package/lib/packlets/common/helpers/index.js.map +1 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
- package/lib/packlets/common/helpers/resources.d.ts +2 -4
- package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
- package/lib/packlets/common/helpers/resources.js +2 -4
- package/lib/packlets/common/helpers/resources.js.map +1 -0
- package/lib/packlets/common/index.d.ts.map +1 -0
- package/lib/packlets/common/index.js.map +1 -0
- package/lib/packlets/common/resources.d.ts.map +1 -0
- package/lib/packlets/common/resources.js.map +1 -0
- package/lib/packlets/common/validate/conditions.d.ts +4 -4
- package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
- package/lib/packlets/common/validate/conditions.js +4 -4
- package/lib/packlets/common/validate/conditions.js.map +1 -0
- package/lib/packlets/common/validate/index.d.ts.map +1 -0
- package/lib/packlets/common/validate/index.js.map +1 -0
- package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
- package/lib/packlets/common/validate/regularExpressions.js +2 -2
- package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
- package/lib/packlets/common/validate/resources.d.ts +1 -1
- package/lib/packlets/common/validate/resources.d.ts.map +1 -0
- package/lib/packlets/common/validate/resources.js +1 -1
- package/lib/packlets/common/validate/resources.js.map +1 -0
- package/lib/packlets/conditions/condition.d.ts +3 -7
- package/lib/packlets/conditions/condition.d.ts.map +1 -0
- package/lib/packlets/conditions/condition.js +3 -7
- package/lib/packlets/conditions/condition.js.map +1 -0
- package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionCollector.js.map +1 -0
- package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionDecls.js.map +1 -0
- package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSet.js.map +1 -0
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
- package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionToken.js.map +1 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
- package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/decls.js.map +1 -0
- package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/index.js.map +1 -0
- package/lib/packlets/conditions/index.d.ts.map +1 -0
- package/lib/packlets/conditions/index.js.map +1 -0
- package/lib/packlets/config/common.d.ts +35 -0
- package/lib/packlets/config/common.d.ts.map +1 -0
- package/lib/packlets/config/common.js +97 -0
- package/lib/packlets/config/common.js.map +1 -0
- package/lib/packlets/config/configInitFactory.d.ts +217 -0
- package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
- package/lib/packlets/config/configInitFactory.js +303 -0
- package/lib/packlets/config/configInitFactory.js.map +1 -0
- package/lib/packlets/config/convert.d.ts +23 -0
- package/lib/packlets/config/convert.d.ts.map +1 -0
- package/lib/packlets/config/convert.js +93 -0
- package/lib/packlets/config/convert.js.map +1 -0
- package/lib/packlets/config/index.browser.d.ts +7 -0
- package/lib/packlets/config/index.browser.d.ts.map +1 -0
- package/lib/packlets/config/index.browser.js +74 -0
- package/lib/packlets/config/index.browser.js.map +1 -0
- package/lib/packlets/config/index.d.ts +7 -0
- package/lib/packlets/config/index.d.ts.map +1 -0
- package/lib/packlets/config/index.js +68 -0
- package/lib/packlets/config/index.js.map +1 -0
- package/lib/packlets/config/json.d.ts +20 -0
- package/lib/packlets/config/json.d.ts.map +1 -0
- package/lib/packlets/config/json.js +24 -0
- package/lib/packlets/config/json.js.map +1 -0
- package/lib/packlets/config/predefined/default.d.ts +57 -0
- package/lib/packlets/config/predefined/default.d.ts.map +1 -0
- package/lib/packlets/config/predefined/default.js +141 -0
- package/lib/packlets/config/predefined/default.js.map +1 -0
- package/lib/packlets/config/predefined/extended.d.ts +25 -0
- package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
- package/lib/packlets/config/predefined/extended.js +193 -0
- package/lib/packlets/config/predefined/extended.js.map +1 -0
- package/lib/packlets/config/predefined/index.d.ts +4 -0
- package/lib/packlets/config/predefined/index.d.ts.map +1 -0
- package/lib/packlets/config/predefined/index.js +62 -0
- package/lib/packlets/config/predefined/index.js.map +1 -0
- package/lib/packlets/config/systemConfiguration.d.ts +94 -0
- package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
- package/lib/packlets/config/systemConfiguration.js +152 -0
- package/lib/packlets/config/systemConfiguration.js.map +1 -0
- package/lib/packlets/context/contextDecls.d.ts.map +1 -0
- package/lib/packlets/context/contextDecls.js.map +1 -0
- package/lib/packlets/context/contextToken.d.ts.map +1 -0
- package/lib/packlets/context/contextToken.js.map +1 -0
- package/lib/packlets/context/convert/decls.d.ts.map +1 -0
- package/lib/packlets/context/convert/decls.js.map +1 -0
- package/lib/packlets/context/convert/index.d.ts.map +1 -0
- package/lib/packlets/context/convert/index.js.map +1 -0
- package/lib/packlets/context/index.d.ts.map +1 -0
- package/lib/packlets/context/index.js.map +1 -0
- package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
- package/lib/packlets/decisions/abstractDecision.js.map +1 -0
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
- package/lib/packlets/decisions/candidate.d.ts.map +1 -0
- package/lib/packlets/decisions/candidate.js.map +1 -0
- package/lib/packlets/decisions/common.d.ts.map +1 -0
- package/lib/packlets/decisions/common.js.map +1 -0
- package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
- package/lib/packlets/decisions/concreteDecision.js.map +1 -0
- package/lib/packlets/decisions/decision.d.ts +1 -1
- package/lib/packlets/decisions/decision.d.ts.map +1 -0
- package/lib/packlets/decisions/decision.js +1 -1
- package/lib/packlets/decisions/decision.js.map +1 -0
- package/lib/packlets/decisions/index.d.ts.map +1 -0
- package/lib/packlets/decisions/index.js.map +1 -0
- package/lib/packlets/import/fsItem.d.ts +1 -4
- package/lib/packlets/import/fsItem.d.ts.map +1 -0
- package/lib/packlets/import/fsItem.js +1 -4
- package/lib/packlets/import/fsItem.js.map +1 -0
- package/lib/packlets/import/importContext.d.ts +5 -5
- package/lib/packlets/import/importContext.d.ts.map +1 -0
- package/lib/packlets/import/importContext.js +3 -3
- package/lib/packlets/import/importContext.js.map +1 -0
- package/lib/packlets/import/importManager.d.ts +15 -1
- package/lib/packlets/import/importManager.d.ts.map +1 -0
- package/lib/packlets/import/importManager.js +7 -3
- package/lib/packlets/import/importManager.js.map +1 -0
- package/lib/packlets/import/importable.d.ts.map +1 -0
- package/lib/packlets/import/importable.js.map +1 -0
- package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/collectionImporter.js +2 -2
- package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.js +29 -13
- package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
- package/lib/packlets/import/importers/importer.d.ts.map +1 -0
- package/lib/packlets/import/importers/importer.js.map +1 -0
- package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
- package/lib/packlets/import/importers/index.browser.js.map +1 -0
- package/lib/packlets/import/importers/index.d.ts.map +1 -0
- package/lib/packlets/import/importers/index.js.map +1 -0
- package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/jsonImporter.js +2 -2
- package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
- package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
- package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/pathImporter.js +1 -1
- package/lib/packlets/import/importers/pathImporter.js.map +1 -0
- package/lib/packlets/import/index.browser.d.ts.map +1 -0
- package/lib/packlets/import/index.browser.js.map +1 -0
- package/lib/packlets/import/index.d.ts.map +1 -0
- package/lib/packlets/import/index.js.map +1 -0
- package/lib/packlets/qualifier-types/config/convert.d.ts +65 -0
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/convert.js +161 -0
- package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
- package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
- package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/index.js +64 -0
- package/lib/packlets/qualifier-types/config/index.js.map +1 -0
- package/lib/packlets/qualifier-types/config/json.d.ts +91 -0
- package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/json.js +35 -0
- package/lib/packlets/qualifier-types/config/json.js.map +1 -0
- package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/convert.js.map +1 -0
- package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/helpers.js.map +1 -0
- package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/index.js.map +1 -0
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.js +12 -13
- package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
- package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/index.js.map +1 -0
- package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
- package/lib/packlets/qualifiers/index.d.ts.map +1 -0
- package/lib/packlets/qualifiers/index.js.map +1 -0
- package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
- package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifier.js +6 -7
- package/lib/packlets/qualifiers/qualifier.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.d.ts +3 -3
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.js +2 -2
- package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
- package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/common.js.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
- package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/index.js.map +1 -0
- package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/json.js.map +1 -0
- package/lib/packlets/resource-json/convert.d.ts.map +1 -0
- package/lib/packlets/resource-json/convert.js.map +1 -0
- package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
- package/lib/packlets/resource-json/helpers.js.map +1 -0
- package/lib/packlets/resource-json/index.d.ts.map +1 -0
- package/lib/packlets/resource-json/index.js.map +1 -0
- package/lib/packlets/resource-json/json.d.ts.map +1 -0
- package/lib/packlets/resource-json/json.js.map +1 -0
- package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
- package/lib/packlets/resource-json/normalized.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
- package/lib/packlets/resource-types/config/convert.d.ts +8 -0
- package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/convert.js +38 -0
- package/lib/packlets/resource-types/config/convert.js.map +1 -0
- package/lib/packlets/resource-types/config/index.d.ts +4 -0
- package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/index.js +64 -0
- package/lib/packlets/resource-types/config/index.js.map +1 -0
- package/lib/packlets/resource-types/config/json.d.ts +11 -0
- package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/json.js +24 -0
- package/lib/packlets/resource-types/config/json.js.map +1 -0
- package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
- package/lib/packlets/resource-types/helpers.js.map +1 -0
- package/lib/packlets/resource-types/index.d.ts.map +1 -0
- package/lib/packlets/resource-types/index.js.map +1 -0
- package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/jsonResourceType.js +2 -2
- package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
- package/lib/packlets/resource-types/resourceType.d.ts +5 -5
- package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/resourceType.js +2 -2
- package/lib/packlets/resource-types/resourceType.js.map +1 -0
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
- package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
- package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
- package/lib/packlets/resources/candidateReducer.js.map +1 -0
- package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
- package/lib/packlets/resources/candidateValue.js.map +1 -0
- package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
- package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
- package/lib/packlets/resources/common.d.ts.map +1 -0
- package/lib/packlets/resources/common.js.map +1 -0
- package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
- package/lib/packlets/resources/deltaGenerator.js.map +1 -0
- package/lib/packlets/resources/index.d.ts.map +1 -0
- package/lib/packlets/resources/index.js.map +1 -0
- package/lib/packlets/resources/resource.d.ts.map +1 -0
- package/lib/packlets/resources/resource.js.map +1 -0
- package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
- package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceBuilder.js +2 -2
- package/lib/packlets/resources/resourceBuilder.js.map +1 -0
- package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
- package/lib/packlets/resources/resourceCandidate.js.map +1 -0
- package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
- package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
- package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheListener.js.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
- package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
- package/lib/packlets/runtime/context/index.d.ts.map +1 -0
- package/lib/packlets/runtime/context/index.js.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
- package/lib/packlets/runtime/iResourceManager.js.map +1 -0
- package/lib/packlets/runtime/index.d.ts.map +1 -0
- package/lib/packlets/runtime/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
- package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
- package/lib/packlets/runtime/resourceResolver.js.map +1 -0
- package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
- package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
- package/lib/packlets/runtime/validate.d.ts.map +1 -0
- package/lib/packlets/runtime/validate.js.map +1 -0
- package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
- package/lib/packlets/zip-archive/convert.js.map +1 -0
- package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
- package/lib/packlets/zip-archive/index.browser.js.map +1 -0
- package/lib/packlets/zip-archive/index.d.ts.map +1 -0
- package/lib/packlets/zip-archive/index.js.map +1 -0
- package/lib/packlets/zip-archive/json.d.ts.map +1 -0
- package/lib/packlets/zip-archive/json.js.map +1 -0
- package/lib/packlets/zip-archive/types.d.ts.map +1 -0
- package/lib/packlets/zip-archive/types.js.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
- package/package.json +28 -26
- package/dist/test/data/sample.json +0 -32
- package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
- package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
- package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
|
@@ -93,7 +93,7 @@ class QualifierCollector extends ts_utils_1.ValidatingConvertingCollector {
|
|
|
93
93
|
return (0, ts_utils_1.captureResult)(() => new QualifierCollector(params));
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
|
-
* {@
|
|
96
|
+
* {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
|
|
97
97
|
*/
|
|
98
98
|
getByNameOrToken(nameOrToken) {
|
|
99
99
|
return this.validating.get(nameOrToken).onFailure((message) => {
|
|
@@ -106,7 +106,7 @@ class QualifierCollector extends ts_utils_1.ValidatingConvertingCollector {
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* {@
|
|
109
|
+
* {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
|
|
110
110
|
*/
|
|
111
111
|
hasNameOrToken(nameOrToken) {
|
|
112
112
|
/* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifierCollector.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAoC;AACpC,4CASuB;AAGvB,2CAAwC;AACxC,uCAAgG;AA8ChG;;;;;GAKG;AACH,MAAa,kBACX,SAAQ,wCAAwD;IAQhE;;;;OAIG;IACH,YAAsB,MAAuC;;QAC3D,KAAK,CAAC;YACJ,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACrD,UAAU,EAAE,IAAI,sBAAW,CAAC,kBAAkB,CAAC;gBAC7C,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa;gBACjC,KAAK,EAAE,uBAAa;aACrB,CAAC;SACH,CAAC,CAAC;QACH,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,kEAAkE;QAClE,MAAA,MAAM,CAAC,UAAU,0CAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,MAAuC;QAC1D,O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SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;YACvB,kEAAkE;YAClE,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzC,OAAO,IAAA,eAAI,EACT,oBAAoB,SAAS,CAAC,KAAK,uCAAuC,CAC3E,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/C,OAAO,IAAA,eAAI,EACT,mBAAmB,SAAS,CAAC,IAAI,wCAAwC,CAC1E,CAAC;YACJ,CAAC;YACD,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC;aACD,SAAS,CAAC,qBAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF;AAzGD,gDAyGC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Common from '../common';\nimport {\n captureResult,\n Collections,\n failWithDetail,\n Result,\n fail,\n succeed,\n succeedWithDetail,\n ValidatingConvertingCollector\n} from '@fgv/ts-utils';\nimport { IQualifierDecl, IValidatedQualifierDecl } from './qualifierDecl';\nimport { QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\nimport { IQualifierDeclConvertContext, qualifierDecl, validatedQualifierDecl } from './convert';\nimport { ReadOnlyQualifierTypeCollector } from '../qualifier-types';\n\n/**\n * Readonly version of {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @public\n */\nexport interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {\n /**\n * {@inheritDoc Qualifiers.QualifierCollector.qualifierTypes}\n */\n readonly qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Gets a {@link Qualifiers.Qualifier | qualifier} by name or token.\n * @param nameOrToken - The name or token of the qualifier to retrieve.\n * @returns `Success` with the qualifier if found, or `Failure` if not.\n */\n getByNameOrToken(nameOrToken: string): Result<Qualifier>;\n\n /**\n * Checks if a qualifier with a given name or token is in the collection.\n * @param nameOrToken - The name or token of the qualifier to check.\n * @returns `true` if the qualifier is in the collection, `false` if not.\n */\n hasNameOrToken(nameOrToken: string): boolean;\n}\n\n/**\n * Parameters for creating a new {@link Qualifiers.QualifierCollector}.\n * @public\n */\nexport interface IQualifierCollectorCreateParams {\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} used to\n * create {@link Qualifiers.Qualifier | qualifiers} from {@link Qualifiers.IQualifierDecl | declarations}.\n */\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Optional list of {@link Qualifiers.IQualifierDecl | declarations} for the qualifiers to add to the collection\n * upon creation.\n */\n qualifiers?: IQualifierDecl[];\n}\n\n/**\n * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},\n * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key\n * and index.\n * @public\n */\nexport class QualifierCollector\n extends ValidatingConvertingCollector<Qualifier, IQualifierDecl>\n implements IReadOnlyQualifierCollector\n{\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} that this collector uses.\n */\n public qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param params - Parameters for creating the collector.\n * @public\n */\n protected constructor(params: IQualifierCollectorCreateParams) {\n super({\n factory: (k, i, v) => this._qualifierFactory(k, i, v),\n converters: new Collections.KeyValueConverters({\n key: Common.Convert.qualifierName,\n value: qualifierDecl\n })\n });\n this.qualifierTypes = params.qualifierTypes;\n /* c8 ignore next 1 - coverage misses the branch intermittently */\n params.qualifiers?.forEach((q) => this.validating.add(q.name, q).orThrow());\n }\n\n /**\n * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @returns `Success` with the new collector if successful, or `Failure` if not.\n */\n public static create(params: IQualifierCollectorCreateParams): Result<QualifierCollector> {\n return captureResult(() => new QualifierCollector(params));\n }\n\n /**\n * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}\n */\n public getByNameOrToken(nameOrToken: string): Result<Qualifier> {\n return this.validating.get(nameOrToken).onFailure((message) => {\n for (const q of this.values()) {\n if (q.token === nameOrToken) {\n return succeedWithDetail(q, 'success');\n }\n }\n return failWithDetail(`Qualifier token '${nameOrToken}' not found`, 'not-found');\n });\n }\n\n /**\n * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}\n */\n public hasNameOrToken(nameOrToken: string): boolean {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (this.validating.has(nameOrToken)) {\n return true;\n }\n for (const q of this.values()) {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (q.token === nameOrToken) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets a read-only view of this collector.\n * @returns A read-only view of this collector.\n */\n public toReadOnly(): IReadOnlyQualifierCollector {\n return this;\n }\n\n /**\n * Factory method for creating a {@link Qualifiers.Qualifier | Qualifier} from a {@link Qualifiers.IQualifierDecl | declaration}.\n * @param __key - The key for the qualifier.\n * @param index - The index of the qualifier.\n * @param decl - The {@link Qualifiers.IQualifierDecl | declaration} for the qualifier.\n * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful, or `Failure` if not.\n * @public\n */\n protected _qualifierFactory(__key: QualifierName, index: number, decl: IQualifierDecl): Result<Qualifier> {\n const convertContext: IQualifierDeclConvertContext = {\n qualifierTypes: this.qualifierTypes,\n qualifierIndex: index\n };\n return validatedQualifierDecl\n .convert(decl, convertContext)\n .onSuccess((validated) => {\n /* c8 ignore next 9 - coverage intermittently misses this block */\n if (this.hasNameOrToken(validated.token)) {\n return fail<IValidatedQualifierDecl>(\n `Qualifier token '${validated.token}' is not unique or collides with name`\n );\n } else if (this.hasNameOrToken(validated.name)) {\n return fail<IValidatedQualifierDecl>(\n `Qualifier name '${validated.name}' is not unique or collides with token`\n );\n }\n return succeed(validated);\n })\n .onSuccess(Qualifier.create);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifierDecl.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDecl.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,eAAe,EAAE,iBAAiB,CAAC;IAEnC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;OAEG;IACH,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifierDecl.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDecl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { ConditionPriority, QualifierContextValue, QualifierIndex, QualifierName } from '../common';\nimport { QualifierType } from '../qualifier-types';\n\n/**\n * Simple declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IQualifierDecl {\n name: string;\n typeName: string;\n defaultPriority: number;\n token?: string;\n tokenIsOptional?: boolean;\n defaultValue?: string;\n}\n\n/**\n * Validated declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IValidatedQualifierDecl {\n /**\n * The name of the qualifier.\n */\n name: QualifierName;\n\n /**\n * The token used to identify the qualifier in the name or\n * path of a resource being imported.\n */\n token: QualifierName;\n\n /**\n * The {@link QualifierTypes.QualifierType | type} of the qualifier.\n */\n type: QualifierType;\n\n /**\n * The default {@link ConditionPriority | priority} of conditions\n * that depend on this qualifier.\n */\n defaultPriority: ConditionPriority;\n\n /**\n * Indicates whether the token is optional when parsing a resource token.\n */\n tokenIsOptional: boolean;\n\n /**\n * Optional default value for the qualifier.\n */\n defaultValue?: QualifierContextValue;\n\n /**\n * Index of the qualifier.\n */\n index: QualifierIndex | undefined;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifierDefaultValueDecls.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueDecls.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG,MAAM,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifierDefaultValueDecls.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueDecls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { QualifierContextValue, QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\n\n/**\n * Non-validated declaration of a single qualifier default value.\n * @public\n */\nexport interface IQualifierDefaultValueDecl {\n qualifier: string;\n value: string;\n}\n\n/**\n * Non-validated declaration of qualifier default values, consisting of named\n * default values.\n * @public\n */\nexport type IQualifierDefaultValuesDecl = Record<string, string>;\n\n/**\n * Validated declaration of a single qualifier default value.\n * @public\n */\nexport interface IValidatedQualifierDefaultValueDecl {\n qualifier: Qualifier;\n value: QualifierContextValue;\n}\n\n/**\n * Validated declaration of qualifier default values, a record with strongly-typed\n * {@link QualifierName | qualifier names} as keys and\n * {@link QualifierContextValue | qualifier context values} as values.\n * @public\n */\nexport type IValidatedQualifierDefaultValuesDecl = Record<QualifierName, QualifierContextValue>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifierDefaultValueToken.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueToken.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAwC,MAAM,WAAW,CAAC;AAC3F,OAAO,EACL,mCAAmC,EACnC,oCAAoC,EACrC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;GAGG;AACH,qBAAa,2BAA2B;IACtC;;;OAGG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;;OAGG;gBACgB,UAAU,EAAE,2BAA2B;IAI1D;;;;;;OAMG;IACI,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,mCAAmC,CAAC;IAIlG;;;;;;OAMG;IACI,gCAAgC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,mCAAmC,EAAE,CAAC;IAIrG;;;;OAIG;IACI,uCAAuC,CAC5C,KAAK,EAAE,aAAa,CAAC,gCAAgC,GACpD,MAAM,CAAC,mCAAmC,CAAC;IAI9C;;;;OAIG;IACI,iCAAiC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,oCAAoC,CAAC;IAIrG;;;;OAIG;IACI,iCAAiC,CAAC,IAAI,EAAE,oCAAoC,GAAG,MAAM,CAAC,MAAM,CAAC;IAIpG;;;;;;;OAOG;WACW,+BAA+B,CAC3C,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,mCAAmC,CAAC;IAM9C;;;;;;;OAOG;WACW,gCAAgC,CAC5C,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,mCAAmC,EAAE,CAAC;IAUhD;;;;;;;;OAQG;WACW,uCAAuC,CACnD,KAAK,EAAE,aAAa,CAAC,gCAAgC,EACrD,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,mCAAmC,CAAC;IAgB9C;;;;;OAKG;WACW,iCAAiC,CAC7C,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,oCAAoC,CAAC;IAyB/C;;;;OAIG;WACW,iCAAiC,CAC7C,IAAI,EAAE,oCAAoC,GACzC,MAAM,CAAC,MAAM,CAAC;CAsBlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifierDefaultValueToken.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,sCAA2F;AAO3F;;;GAGG;AACH,MAAa,2BAA2B;IAOtC;;;OAGG;IACH,YAAmB,UAAuC;QACxD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,+BAA+B,CAAC,KAAa;QAClD,OAAO,2BAA2B,CAAC,+BAA+B,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;OAMG;IACI,gCAAgC,CAAC,KAAa;QACnD,OAAO,2BAA2B,CAAC,gCAAgC,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9F,CAAC;IAED;;;;OAIG;IACI,uCAAuC,CAC5C,KAAqD;QAErD,OAAO,2BAA2B,CAAC,u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C,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACjE,mCAAmC;YACnC,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,IAAI,YAAY,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAErC,+BAA+B;QAC/B,OAAO,gBAAa,CAAC,gCAAgC,CACnD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC9B,CAAC,CAAC,CACH,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AAnMD,kEAmMC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { Helpers as CommonHelpers, QualifierName, QualifierContextValue } from '../common';\nimport {\n IValidatedQualifierDefaultValueDecl,\n IValidatedQualifierDefaultValuesDecl\n} from './qualifierDefaultValueDecls';\nimport { IReadOnlyQualifierCollector } from './qualifierCollector';\n\n/**\n * Helper class to parse and validate qualifier default value tokens.\n * @public\n */\nexport class QualifierDefaultValueTokens {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate\n * qualifier names and values.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructs a new {@link Qualifiers.QualifierDefaultValueTokens | QualifierDefaultValueTokens } instance.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n */\n public constructor(qualifiers: IReadOnlyQualifierCollector) {\n this.qualifiers = qualifiers;\n }\n\n /**\n * Parses a {@link QualifierDefaultValueToken | qualifier default value token} string and validates the parts\n * against the qualifiers present in the {@link Qualifiers.QualifierDefaultValueTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseQualifierDefaultValueToken(token: string): Result<IValidatedQualifierDefaultValueDecl> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValueToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link QualifierDefaultValuesToken | qualifier default values token} string and validates the parts\n * against the qualifiers present in the {@link Qualifiers.QualifierDefaultValueTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseQualifierDefaultValuesToken(token: string): Result<IValidatedQualifierDefaultValueDecl[]> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValuesToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IQualifierDefaultValueTokenParts | parts} of a {@link QualifierDefaultValueToken | qualifier default value token}.\n * @param parts - the parts to validate\n * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.\n */\n public validateQualifierDefaultValueTokenParts(\n parts: CommonHelpers.IQualifierDefaultValueTokenParts\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(parts, this.qualifiers);\n }\n\n /**\n * Converts a {@link QualifierDefaultValuesToken | qualifier default values token} to a validated qualifier default values declaration.\n * @param token - the qualifier default values token to convert\n * @returns `Success` with the validated qualifier default values declaration if successful, `Failure` with an error message if not.\n */\n public qualifierDefaultValuesTokenToDecl(token: string): Result<IValidatedQualifierDefaultValuesDecl> {\n return QualifierDefaultValueTokens.qualifierDefaultValuesTokenToDecl(token, this.qualifiers);\n }\n\n /**\n * Converts a validated qualifier default values declaration to a {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param decl - the validated qualifier default values declaration to convert\n * @returns `Success` with the qualifier default values token if successful, `Failure` with an error message if not.\n */\n public declToQualifierDefaultValuesToken(decl: IValidatedQualifierDefaultValuesDecl): Result<string> {\n return QualifierDefaultValueTokens.declToQualifierDefaultValuesToken(decl);\n }\n\n /**\n * Parses a {@link QualifierDefaultValueToken | qualifier default value token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with a {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseQualifierDefaultValueToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return CommonHelpers.parseQualifierDefaultValueTokenParts(token).onSuccess((parts) => {\n return QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link QualifierDefaultValuesToken | qualifier default values token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with an array of {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseQualifierDefaultValuesToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl[]> {\n return CommonHelpers.parseQualifierDefaultValuesTokenParts(token).onSuccess((parts) => {\n return mapResults(\n parts.map((part) =>\n QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(part, qualifiers)\n )\n );\n });\n }\n\n /**\n * Validates the parts of a qualifier default value token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts} to validate.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to\n * validate qualifier names and values.\n * @returns `Success` with a {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateQualifierDefaultValueTokenParts(\n parts: CommonHelpers.IQualifierDefaultValueTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return qualifiers.getByNameOrToken(parts.qualifier).onSuccess((qualifier) => {\n // Allow empty values to remove defaults\n if (parts.value === '') {\n return succeed({ qualifier, value: '' as QualifierContextValue });\n }\n\n return qualifier.type\n .validateContextValue(parts.value)\n .onSuccess((value) => {\n return succeed({ qualifier, value });\n })\n .withDetail('failure', 'success');\n });\n }\n\n /**\n * Converts a {@link QualifierDefaultValuesToken | qualifier default values token} to a validated qualifier default values declaration.\n * @param token - the qualifier default values token to convert\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with the validated qualifier default values declaration if successful, `Failure` with an error message if not.\n */\n public static qualifierDefaultValuesTokenToDecl(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValuesDecl> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValuesToken(token, qualifiers).onSuccess(\n (qualifierDefaultValues) => {\n const defaultValues: IValidatedQualifierDefaultValuesDecl = {};\n\n for (const { qualifier, value } of qualifierDefaultValues) {\n const qualifierName = qualifier.name as QualifierName;\n const contextValue = value as QualifierContextValue;\n\n // Check for duplicate qualifiers\n if (qualifierName in defaultValues) {\n return fail(`${qualifier.name}: duplicate qualifier in default values token`);\n }\n\n // Only add non-empty values (empty values remove defaults)\n if (contextValue !== '') {\n defaultValues[qualifierName] = contextValue;\n }\n }\n\n return succeed(defaultValues);\n }\n );\n }\n\n /**\n * Converts a validated qualifier default values declaration to a {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param decl - the validated qualifier default values declaration to convert\n * @returns `Success` with the qualifier default values token if successful, `Failure` with an error message if not.\n */\n public static declToQualifierDefaultValuesToken(\n decl: IValidatedQualifierDefaultValuesDecl\n ): Result<string> {\n const tokens: string[] = [];\n\n for (const [qualifierName, contextValue] of Object.entries(decl)) {\n // Build token as \"qualifier=value\"\n tokens.push(`${qualifierName}=${contextValue}`);\n }\n\n if (tokens.length === 0) {\n return succeed('');\n }\n\n const tokenString = tokens.join('|');\n\n // Validate the generated token\n return CommonHelpers.buildQualifierDefaultValuesToken(\n tokens.map((token) => {\n const [qualifier, value] = token.split('=');\n return { qualifier, value };\n })\n ).onSuccess(() => succeed(tokenString));\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/common.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Options for controlling the compilation of resource objects.\n * @public\n */\nexport interface ICompiledResourceOptions {\n /**\n * Whether to include metadata in the compiled objects.\n * Metadata includes human-readable information like semantic keys\n * that can be useful for debugging or tooling.\n * @defaultValue false\n */\n includeMetadata?: boolean;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/convert.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAIhC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,oFAEpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B,uFAEvC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,mFAEnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,gFAEhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,4EAI5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+EAE/B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,4EAO5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+EAG/B,CAAC;AACH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,mFAGnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,4EAI5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,2EAK3B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qFASrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/convert.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qDAAuC;AACvC,4CAA2C;AAC3C,oDAAiE;AAGjE,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,yBAAyB,GAAG,qBAAU,CAAC,YAAY,CAAmC;IACjG,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY;CACjC,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA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SAAS,EAAE,qBAAU,CAAC,OAAO,CAAC,gCAAwB,CAAC;IACvD,eAAe,EAAE,qBAAU,CAAC,OAAO,CAAC,yBAAc,CAAC,SAAS,CAAC;IAC7D,SAAS,EAAE,qBAAU,CAAC,OAAO,CAAC,wBAAgB,CAAC;CAChD,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport * as Common from '../../common';\nimport { Converters } from '@fgv/ts-utils';\nimport { Converters as JsonConverters } from '@fgv/ts-json-base';\nimport * as Model from './json';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionMetadata | compiled condition metadata}.\n * @public\n */\nexport const compiledConditionMetadata = Converters.strictObject<Model.ICompiledConditionMetadata>({\n key: Common.Convert.conditionKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSetMetadata | compiled condition set metadata}.\n * @public\n */\nexport const compiledConditionSetMetadata = Converters.strictObject<Model.ICompiledConditionSetMetadata>({\n key: Common.Convert.conditionSetKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledDecisionMetadata | compiled decision metadata}.\n * @public\n */\nexport const compiledDecisionMetadata = Converters.strictObject<Model.ICompiledDecisionMetadata>({\n key: Common.Convert.decisionKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledQualifierType | compiled qualifier type}.\n * @public\n */\nexport const compiledQualifierType = Converters.strictObject<Model.ICompiledQualifierType>({\n name: Common.Convert.qualifierTypeName\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledQualifier | compiled qualifier}.\n * @public\n */\nexport const compiledQualifier = Converters.strictObject<Model.ICompiledQualifier>({\n name: Common.Convert.qualifierName,\n type: Common.Convert.qualifierTypeIndex,\n defaultPriority: Common.Convert.conditionPriority\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResourceType | compiled resource type}.\n * @public\n */\nexport const compiledResourceType = Converters.strictObject<Model.ICompiledResourceType>({\n name: Common.Convert.resourceTypeName\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledCondition | compiled condition}.\n * @public\n */\nexport const compiledCondition = Converters.strictObject<Model.ICompiledCondition>({\n qualifierIndex: Common.Convert.qualifierIndex,\n operator: Common.Convert.conditionOperator.optional(),\n value: Converters.string,\n priority: Common.Convert.conditionPriority,\n scoreAsDefault: Common.Convert.qualifierMatchScore.optional(),\n metadata: compiledConditionMetadata.optional()\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSet | compiled condition set}.\n * @public\n */\nexport const compiledConditionSet = Converters.strictObject<Model.ICompiledConditionSet>({\n conditions: Converters.arrayOf(Common.Convert.conditionIndex),\n metadata: compiledConditionSetMetadata.optional()\n});\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledAbstractDecision | compiled abstract decision}.\n * @public\n */\nexport const compiledAbstractDecision = Converters.strictObject<Model.ICompiledAbstractDecision>({\n conditionSets: Converters.arrayOf(Common.Convert.conditionSetIndex),\n metadata: compiledDecisionMetadata.optional()\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledCandidate | compiled candidate}.\n * @public\n */\nexport const compiledCandidate = Converters.strictObject<Model.ICompiledCandidate>({\n valueIndex: Common.Convert.candidateValueIndex,\n isPartial: Converters.boolean,\n mergeMethod: Common.Convert.resourceValueMergeMethod\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResource | compiled resource}.\n * @public\n */\nexport const compiledResource = Converters.strictObject<Model.ICompiledResource>({\n id: Common.Convert.resourceId,\n type: Common.Convert.resourceTypeIndex,\n decision: Common.Convert.decisionIndex,\n candidates: Converters.arrayOf(compiledCandidate)\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.\n * This combines all the individual converters into a single converter for the entire resource collection.\n * @public\n */\nexport const compiledResourceCollection = Converters.strictObject<Model.ICompiledResourceCollection>({\n qualifiers: Converters.arrayOf(compiledQualifier),\n qualifierTypes: Converters.arrayOf(compiledQualifierType),\n resourceTypes: Converters.arrayOf(compiledResourceType),\n conditions: Converters.arrayOf(compiledCondition),\n conditionSets: Converters.arrayOf(compiledConditionSet),\n decisions: Converters.arrayOf(compiledAbstractDecision),\n candidateValues: Converters.arrayOf(JsonConverters.jsonValue),\n resources: Converters.arrayOf(compiledResource)\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,2CAAyB;AACzB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './common';\nexport * from './json';\nexport { Convert };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/json.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,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iB,CAAC,CAAC;IACvD;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,mBAAmB,CAAC;IACvC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC,wBAAwB,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAE/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC;IAC/B;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,cAAc,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IACtD;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC9C;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACpD;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC9C;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACpD;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACpD;;OAEG;IACH,eAAe,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAC1C;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/json.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport * as Common from '../../common';\nimport { JsonValue } from '@fgv/ts-json-base';\n\n/**\n * Metadata for a compiled condition, containing human-readable information.\n * @public\n */\nexport interface ICompiledConditionMetadata {\n /**\n * The semantic key of the condition (e.g., \"language=en-US\").\n */\n key: Common.ConditionKey;\n}\n\n/**\n * Metadata for a compiled condition set, containing human-readable information.\n * @public\n */\nexport interface ICompiledConditionSetMetadata {\n /**\n * The semantic key of the condition set (e.g., \"language=en-US,territory=US\").\n */\n key: Common.ConditionSetKey;\n}\n\n/**\n * Metadata for a compiled decision, containing human-readable information.\n * @public\n */\nexport interface ICompiledDecisionMetadata {\n /**\n * The semantic key of the decision (e.g., \"language=en-US,territory=US OR language=fr,territory=CA\").\n */\n key: Common.DecisionKey;\n}\n\n/**\n * Represents a compiled qualifier type with a name.\n * @public\n */\nexport interface ICompiledQualifierType {\n /**\n * The name of the qualifier type.\n */\n name: Common.QualifierTypeName;\n}\n\n/**\n * Represents a compiled qualifier with a name and type reference.\n * @public\n */\nexport interface ICompiledQualifier {\n /**\n * The name of the qualifier.\n */\n name: Common.QualifierName;\n /**\n * Index reference to the qualifier type.\n */\n type: Common.QualifierTypeIndex;\n\n /**\n * The token used to identify the qualifier in resource names or paths.\n */\n defaultPriority: Common.ConditionPriority;\n}\n\n/**\n * Represents a compiled resource type with a name.\n * @public\n */\nexport interface ICompiledResourceType {\n /**\n * The name of the resource type.\n */\n name: Common.ResourceTypeName;\n}\n\n/**\n * Represents a compiled condition used for resource selection.\n * @public\n */\nexport interface ICompiledCondition {\n /**\n * Index reference to the qualifier being evaluated.\n */\n qualifierIndex: Common.QualifierIndex;\n /**\n * Optional operator to apply in the condition evaluation.\n */\n operator?: Common.ConditionOperator;\n /**\n * The value to compare against when evaluating the condition.\n */\n value: string;\n /**\n * The priority of the condition when multiple conditions match.\n */\n priority: Common.ConditionPriority;\n /**\n * Optional score to use when treating this condition as a default.\n */\n scoreAsDefault?: Common.QualifierMatchScore;\n /**\n * Optional metadata containing human-readable information about this condition.\n */\n metadata?: ICompiledConditionMetadata;\n}\n\n/**\n * Represents a compiled set of conditions that must be satisfied together.\n * @public\n */\nexport interface ICompiledConditionSet {\n /**\n * Array of indices referencing the conditions in this set.\n */\n conditions: ReadonlyArray<Common.ConditionIndex>;\n /**\n * Optional metadata containing human-readable information about this condition set.\n */\n metadata?: ICompiledConditionSetMetadata;\n}\n\n/**\n * Represents a compiled abstract decision with condition sets.\n * @public\n */\nexport interface ICompiledAbstractDecision {\n /**\n * Array of indices referencing the condition sets for this decision.\n */\n conditionSets: ReadonlyArray<Common.ConditionSetIndex>;\n /**\n * Optional metadata containing human-readable information about this decision.\n */\n metadata?: ICompiledDecisionMetadata;\n}\n\n/**\n * Represents a compiled resource candidate with JSON value and merge properties.\n * @public\n */\nexport interface ICompiledCandidate {\n /**\n * The global index of the JSON value of the candidate.\n */\n valueIndex: Common.CandidateValueIndex;\n /**\n * Indicates if this is a partial resource that needs to be merged.\n */\n isPartial: boolean;\n /**\n * The method to use when merging this candidate with others.\n */\n mergeMethod: Common.ResourceValueMergeMethod;\n}\n\n/**\n * Represents a compiled resource with an identifier and associated candidates.\n * @public\n */\nexport interface ICompiledResource {\n /**\n * The unique identifier of the resource.\n */\n id: Common.ResourceId;\n\n /**\n * Index reference to the resource type of this resource.\n */\n type: Common.ResourceTypeIndex;\n\n /**\n * Index reference to the decision that determines when this resource applies.\n */\n decision: Common.DecisionIndex;\n /**\n * Array of candidate values for this resource.\n */\n candidates: ReadonlyArray<ICompiledCandidate>;\n}\n\n/**\n * Represents a complete compiled collection of resources with their associated\n * qualifiers, types, conditions, and decisions.\n * @public\n */\nexport interface ICompiledResourceCollection {\n /**\n * Array of all qualifier types in the collection.\n */\n qualifierTypes: ReadonlyArray<ICompiledQualifierType>;\n /**\n * Array of all qualifiers in the collection.\n */\n qualifiers: ReadonlyArray<ICompiledQualifier>;\n /**\n * Array of all resource types in the collection.\n */\n resourceTypes: ReadonlyArray<ICompiledResourceType>;\n /**\n * Array of all conditions in the collection.\n */\n conditions: ReadonlyArray<ICompiledCondition>;\n /**\n * Array of all condition sets in the collection.\n */\n conditionSets: ReadonlyArray<ICompiledConditionSet>;\n /**\n * Array of all decisions in the collection.\n */\n decisions: ReadonlyArray<ICompiledAbstractDecision>;\n /**\n * Array of all candidate values in the collection.\n */\n candidateValues: ReadonlyArray<JsonValue>;\n /**\n * Array of all resources in the collection.\n */\n resources: ReadonlyArray<ICompiledResource>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/convert.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAwC,MAAM,eAAe,CAAC;AAGhF,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,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ACmC,EAAE;IACtD,OAAO,qBAAU,CAAC,YAAY,CAA6C;QACzE,OAAO,EAAE,4BAAoB,CAAC,QAAQ,EAAE;QACxC,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,qCAA6B,CAAC,CAAC,QAAQ,EAAE;QACxE,SAAS,EAAE,qBAAU,CAAC,OAAO,CAAC,qBAAU,CAAC,KAAK,CAAC,CAAC,yBAAiB,EAAE,yBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QAClG,WAAW,EAAE,qBAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QAChD,QAAQ,EAAE,yBAAc,CAAC,UAAU,CAAC,QAAQ,EAAE;KAC/C,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, mapResults, Result, fail } from '@fgv/ts-utils';\nimport { Convert as CommonConvert } from '../common';\nimport { isJsonObject, Converters as JsonConverters } from '@fgv/ts-json-base';\nimport * as Json from './json';\nimport * as Normalized from './normalized';\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.\n * @public\n */\nexport const looseConditionDecl: Converter<Json.ILooseConditionDecl> =\n Converters.strictObject<Json.ILooseConditionDecl>({\n qualifierName: CommonConvert.qualifierName,\n value: Converters.string,\n operator: CommonConvert.conditionOperator.optional(),\n priority: CommonConvert.conditionPriority.optional(),\n scoreAsDefault: Converters.number.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.\n * @public\n */\nexport const childConditionDecl: Converter<Json.IChildConditionDecl> =\n Converters.strictObject<Json.IChildConditionDecl>({\n value: Converters.string,\n operator: CommonConvert.conditionOperator.optional(),\n priority: CommonConvert.conditionPriority.optional(),\n scoreAsDefault: Converters.number.optional()\n });\n\nfunction _isConditionSetRecord(from: unknown): from is Record<string, string | Json.IChildConditionDecl> {\n return isJsonObject(from);\n}\n\nconst conditionSetDeclFromArray: Converter<Normalized.ConditionSetDecl> =\n Converters.arrayOf(looseConditionDecl);\nconst conditionSetDeclFromRecord: Converter<Normalized.ConditionSetDecl> = Converters.generic<\n Normalized.ConditionSetDecl,\n unknown\n>(\n (\n from: unknown,\n __self: Converter<Normalized.ConditionSetDecl, unknown>,\n context?: unknown\n ): Result<Normalized.ConditionSetDecl> => {\n /* c8 ignore next 3 - this is tested but coverage is confused */\n if (!_isConditionSetRecord(from)) {\n return fail('Expected an object');\n }\n return mapResults(\n Array.from(Object.entries(from)).map(([qualifierName, value]) => {\n const toConvert: Json.ILooseConditionDecl =\n typeof value === 'string' ? { qualifierName, value } : { qualifierName, ...value };\n return looseConditionDecl.convert(toConvert, context);\n })\n );\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration}.\n * @public\n */\nexport const conditionSetDecl: Converter<Normalized.ConditionSetDecl> =\n Converters.oneOf<Normalized.ConditionSetDecl>([conditionSetDeclFromArray, conditionSetDeclFromRecord]);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration}.\n * @public\n */\nexport const looseResourceCandidateDecl: Converter<Normalized.ILooseResourceCandidateDecl> =\n Converters.strictObject<Normalized.ILooseResourceCandidateDecl>({\n id: CommonConvert.resourceId,\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.\n * @public\n */\nexport const importerResourceCandidateDecl: Converter<Normalized.IImporterResourceCandidateDecl> =\n Converters.strictObject<Normalized.IImporterResourceCandidateDecl>({\n id: CommonConvert.resourceId.optional(),\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}.\n * @public\n */\nexport const childResourceCandidateDecl: Converter<Normalized.IChildResourceCandidateDecl> =\n Converters.strictObject<Normalized.IChildResourceCandidateDecl>({\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n isPartial: Converters.boolean.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declaration}.\n * @public\n */\nexport const looseResourceDecl: Converter<Normalized.ILooseResourceDecl> =\n Converters.strictObject<Normalized.ILooseResourceDecl>({\n id: CommonConvert.resourceId,\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(childResourceCandidateDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IChildResourceDecl | child resource declaration}.\n * @public\n */\nexport const childResourceDecl: Converter<Normalized.IChildResourceDecl> =\n Converters.strictObject<Normalized.IChildResourceDecl>({\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(childResourceCandidateDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IContainerContextDecl | resource context declaration}.\n * @public\n */\nexport const containerContextDecl: Converter<Normalized.IContainerContextDecl> =\n Converters.strictObject<Normalized.IContainerContextDecl>({\n baseId: Converters.oneOf([CommonConvert.resourceId, Converters.literal('')]).optional(),\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeChildNodeDecl | resource tree child node declaration}.\n * @public\n */\nexport const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChildNodeDecl> = Converters.generic<\n Normalized.IResourceTreeChildNodeDecl,\n unknown\n>(\n (\n from: unknown,\n self: Converter<Normalized.IResourceTreeChildNodeDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IResourceTreeChildNodeDecl> => {\n return Converters.strictObject<Normalized.IResourceTreeChildNodeDecl>({\n resources: Converters.recordOf(childResourceDecl).optional(),\n children: Converters.recordOf(self).optional()\n }).convert(from, context);\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.\n * @public\n */\nexport const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl> =\n Converters.strictObject<Normalized.IResourceTreeRootDecl>({\n context: containerContextDecl.optional(),\n resources: Converters.recordOf(childResourceDecl).optional(),\n children: Converters.recordOf(resourceTreeChildNodeDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}.\n * @public\n */\nexport const resourceCollectionDecl: Converter<Normalized.IResourceCollectionDecl> = Converters.generic<\n Normalized.IResourceCollectionDecl,\n unknown\n>(\n (\n from: unknown,\n self: Converter<Normalized.IResourceCollectionDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IResourceCollectionDecl> => {\n return Converters.strictObject<Normalized.IResourceCollectionDecl>({\n context: containerContextDecl.optional(),\n candidates: Converters.arrayOf(looseResourceCandidateDecl).optional(),\n resources: Converters.arrayOf(looseResourceDecl).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCollectionDecl | importer resource collection declaration}.\n * This allows for a mix of loose and child resource declarations.\n * @public\n */\nexport const importerResourceCollectionDecl: Converter<Normalized.IImporterResourceCollectionDecl> =\n Converters.generic<Normalized.IImporterResourceCollectionDecl, unknown>(\n (\n from: unknown,\n self: Converter<Normalized.IImporterResourceCollectionDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IImporterResourceCollectionDecl> => {\n return Converters.strictObject<Normalized.IImporterResourceCollectionDecl>({\n context: containerContextDecl.optional(),\n candidates: Converters.arrayOf(importerResourceCandidateDecl).optional(),\n resources: Converters.arrayOf(Converters.oneOf([looseResourceDecl, childResourceDecl])).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n );\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAI/B;;;GAGG;AACH,MAAM,WAAW,mBAAmB;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;;;;;;GASG;AACH,SAAgB,kBAAkB,CAChC,QAAuC,EACvC,IAAY,EACZ,UAAmB,EACnB,gBAA0D;IAE1D,OAAO,gBAAa,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE;;QACtE,OAAO,IAAA,qBAAU;QACf,yCAAyC;QACzC,CAAC,MAAA,QAAQ,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CACjG,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACzB,OAAO,IAAA,kBAAO,kCAAM,QAAQ,KAAE,EAAE,EAAE,UAAU,IAAG,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { Helpers as CommonHelpers } from '../common';\nimport { sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Common options when creating or displaying declarations.\n * @public\n */\nexport interface IDeclarationOptions {\n /**\n * If `true`, properties with default values will be included in the\n * output. If omitted or `false`, properties with default values will be omitted.\n */\n showDefaults?: boolean;\n\n /**\n * If `true`, the output will be normalized using hash-based ordering for consistent structure.\n * If omitted or `false`, no normalization will be applied. Defaults to `false`.\n */\n normalized?: boolean;\n}\n\n/**\n * Helper method to merge a resource context declaration with a parent name and conditions.\n * @param decl - The resource context declaration to merge.\n * @param parentName - The name of the parent resource.\n * @param parentConditions - The conditions of the parent resource.\n * @returns `Success` with the merged resource context declaration if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeContextDecl(\n decl?: Normalized.IContainerContextDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IContainerContextDecl> {\n if (!decl) {\n return sanitizeJsonObject({ baseId: parentName, conditions: parentConditions });\n } else if (!parentName && !parentConditions) {\n return succeed(decl);\n }\n switch (decl.mergeMethod ?? 'augment') {\n case 'augment':\n return CommonHelpers.joinResourceIds(parentName, decl.baseId).onSuccess((baseId) => {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(parentConditions ?? []), ...(decl.conditions ?? [])];\n return sanitizeJsonObject({ baseId, conditions });\n });\n case 'replace': {\n const baseId = decl.baseId ?? parentName;\n const conditions = decl.conditions ?? parentConditions;\n return sanitizeJsonObject({ baseId, conditions });\n }\n case 'delete': {\n return sanitizeJsonObject({});\n }\n }\n}\n\n/**\n * Helper method to merge a loose candidate with a base name and conditions.\n * @param candidate - The candidate to merge.\n * @param baseName - The base name to merge with the candidate.\n * @param baseConditions - The base conditions to merge with the candidate.\n * @returns `Success` with the merged candidate if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeLooseCandidate(\n candidate: Normalized.IImporterResourceCandidateDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.ILooseResourceCandidateDecl> {\n const candidateId = Json.isLooseResourceCandidateDecl(candidate) ? candidate.id : '';\n if (!Json.isLooseResourceCandidateDecl(candidate) && !baseName) {\n return fail('id is required in mergeLooseCandidate');\n }\n\n /* c8 ignore next 7 - functional code tested but coverage intermittently missed */\n return CommonHelpers.joinResourceIds(baseName, candidateId).onSuccess((id) => {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, id, conditions });\n });\n}\n\n/**\n * Helper method to merge a resource candidate with a base name and conditions from import context.\n * This function enables name inheritance for resource candidates, similar to resources.\n *\n * @param candidate - The candidate to merge. Can have an optional ID that will be joined with baseName.\n * @param baseName - The base name from import context to merge with the candidate.\n * When provided, this will be used as the parent component of the candidate ID.\n * @param baseConditions - The base conditions from import context to merge with the candidate's conditions.\n * @returns `Success` with the merged candidate if successful, otherwise `Failure`.\n *\n * @remarks\n * This function supports name inheritance for candidates:\n * - Joins baseName with candidate's existing ID using dot notation\n * - If candidate has no ID, uses baseName as the full ID\n * - Always merges base conditions with candidate's existing conditions\n *\n * @example\n * ```typescript\n * // Candidate inherits full name from import context\n * const candidate = { value: \"Hello\", conditions: [...] }; // No id field\n * const result = mergeImporterCandidate(candidate, \"pages.home.greeting\", []);\n * // Result: { id: \"pages.home.greeting\", value: \"Hello\", conditions: [...] }\n * ```\n *\n * @public\n */\nexport function mergeImporterCandidate(\n candidate: Normalized.IImporterResourceCandidateDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IImporterResourceCandidateDecl> {\n if (baseName || Json.isLooseResourceCandidateDecl(candidate)) {\n const candidateId = 'id' in candidate ? candidate.id : '';\n return CommonHelpers.joinResourceIds(baseName, candidateId).onSuccess((id) => {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, id, conditions });\n });\n } else {\n /* c8 ignore next 5 - functional code tested but coverage intermittently missed */\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, conditions });\n }\n}\n\n/**\n * Helper method to merge a child candidate with base conditions.\n * @param candidate - The candidate to merge.\n * @param baseConditions - The base conditions to merge with the candidate.\n * @returns `Success` with the merged candidate if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeChildCandidate(\n candidate: Normalized.IChildResourceCandidateDecl,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IChildResourceCandidateDecl> {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, conditions });\n}\n\n/**\n * Helper method to merge a loose resource with a base name and conditions.\n * @param resource - The resource to merge.\n * @param baseName - The base name to merge with the resource.\n * @param baseConditions - The base conditions to merge with the resource.\n * @returns `Success` with the merged resource if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeLooseResource(\n resource: Normalized.IImporterResourceDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.ILooseResourceDecl> {\n /* c8 ignore next 1 - defense in depth */\n const resourceId = Json.isLooseResourceDecl(resource) ? resource.id : '';\n if (!baseName && !Json.isLooseResourceDecl(resource)) {\n return fail('id is required in mergeLooseResource');\n }\n\n /* c8 ignore next 10 - functional code tested but coverage intermittently missed */\n return CommonHelpers.joinResourceIds(baseName, resourceId).onSuccess((id) => {\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, baseConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, id, candidates });\n });\n });\n}\n\n/**\n * Helper method to merge a resource with a base name and conditions from import context.\n * This function enables name inheritance where resources can automatically inherit their\n * resource ID from the import context when no explicit ID is provided in the resource declaration.\n *\n * @param resource - The resource to merge. Can be either a loose resource (with optional ID)\n * or a child resource (without ID).\n * @param baseName - The base name from import context to merge with the resource.\n * When provided, this will be used as the parent component of the resource ID.\n * @param baseConditions - The base conditions from import context to merge with the resource's conditions.\n * @returns `Success` with the merged resource if successful, otherwise `Failure`.\n *\n * @remarks\n * This function supports several scenarios for name inheritance:\n * - **Explicit ID + Base Name**: Joins baseName.resourceId (e.g., \"pages.home\" + \"greeting\" = \"pages.home.greeting\")\n * - **No ID + Base Name**: Uses baseName as the resource ID (enables name inheritance from import context)\n * - **Explicit ID + No Base Name**: Uses the resource's existing ID\n * - **No ID + No Base Name**: Returns resource without ID (for child resources)\n *\n * Base conditions are always merged with the resource's existing conditions.\n *\n * @example\n * ```typescript\n * // Resource without ID inherits name from import context\n * const resource = { candidates: [...] }; // No id field\n * const result = mergeImporterResource(resource, \"pages.home\", []);\n * // Result: { id: \"pages.home\", candidates: [...] }\n *\n * // Resource with ID gets joined with base name\n * const resource = { id: \"greeting\", candidates: [...] };\n * const result = mergeImporterResource(resource, \"pages.home\", []);\n * // Result: { id: \"pages.home.greeting\", candidates: [...] }\n * ```\n *\n * @public\n */\nexport function mergeImporterResource(\n resource: Normalized.IImporterResourceDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IImporterResourceDecl> {\n if (baseName || `id` in resource) {\n const resourceId = 'id' in resource ? resource.id : '';\n // If we have a base name or the resource has no id, we can just\n return CommonHelpers.joinResourceIds(baseName, resourceId).onSuccess((id) => {\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, baseConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, id, candidates });\n });\n });\n } else {\n /* c8 ignore next 8 - functional code tested but coverage intermittently missed */\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, baseConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, candidates });\n });\n }\n}\n\n/**\n * Helper method to merge a child resource with a parent name and conditions.\n * @param resource - The resource to merge.\n * @param name - The name of the resource.\n *\n * @param parentName - The name of the parent resource.\n * @param parentConditions - The conditions of the parent resource.\n * @returns `Success` with the merged resource if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeChildResource(\n resource: Normalized.IChildResourceDecl,\n name: string,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.ILooseResourceDecl> {\n return CommonHelpers.joinResourceIds(parentName, name).onSuccess((id) => {\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, parentConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, id, candidates });\n });\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAExD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qDAAuC;AAM9B,4BAAQ;AALjB,mDAAqC;AAKlB,0BAAO;AAJ1B,mDAAqC;AAIT,0BAAO;AAHnC,6CAA+B;AAGM,oBAAI;AAFzC,yDAA2C;AAEA,gCAAU;AAErD,0DAAwC;AACxC,2DAAyC;AACzC,qDAAmC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Compiled from './compiled';\nimport * as Convert from './convert';\nimport * as Helpers from './helpers';\nimport * as Json from './json';\nimport * as Normalized from './normalized';\n\nexport { Compiled, Convert, Helpers, Json, Normalized };\n\nexport * from './resourceDeclContainer';\nexport * from './resourceDeclCollection';\nexport * from './resourceDeclTree';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/json.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAA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,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,8BAA8B,GACnC,IAAI,IAAI,2BAA2B,CAErC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,kBAAkB,CAE3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAsQH,oEAIC;AAMD,kDAEC;AAhBD;;;GAGG;AACH,SAAgB,4BAA4B,CAC1C,IAAoC;IAEpC,OAAO,IAAI,IAAI,IAAI,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,IAA2B;IAC7D,OAAO,IAAI,IAAI,IAAI,CAAC;AACtB,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { ConditionOperator, ResourceValueMergeMethod } from '../common';\n\n/**\n * Non-validated loose declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport interface ILooseConditionDecl {\n /**\n * The name of the {@link Qualifiers.Qualifier | qualifier} to be compared.\n */\n qualifierName: string;\n /**\n * The value to be compared.\n */\n value: string;\n /**\n * The operator to be used in the comparison.\n * Default is 'matches'.\n */\n operator?: ConditionOperator;\n\n /**\n * The priority of the condition. Default is the default priority for the qualifier.\n */\n priority?: number;\n\n /**\n * The score to be used if the condition is used as a default.\n */\n scoreAsDefault?: number;\n}\n\n/**\n * Non-validated child declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport interface IChildConditionDecl {\n /**\n * The value to be compared.\n */\n value: string;\n /**\n * The operator to be used in the comparison.\n * Default is 'matches'.\n */\n operator?: ConditionOperator;\n\n /**\n * The priority of the condition. Default is the default priority for the qualifier.\n */\n priority?: number;\n\n /**\n * The score to be used if the condition is used as a default.\n */\n scoreAsDefault?: number;\n}\n\n/**\n * Non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDeclAsArray = ReadonlyArray<ILooseConditionDecl>;\n\n/**\n * Non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDeclAsRecord = Record<string, string | IChildConditionDecl>;\n\n/**\n * Non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDecl = ConditionSetDeclAsArray | ConditionSetDeclAsRecord;\n\n/**\n * Non-validated child declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface IChildResourceCandidateDecl {\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Non-validated declaration of a resource candidate for import,\n * which can be either a loose or child resource candidate.\n * @public\n */\nexport interface IImporterResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id?: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Non-validated loose declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface ILooseResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id: string;\n\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n\n /**\n * The type of the resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Non-validated child declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface IChildResourceDecl {\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Non-validated loose declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface ILooseResourceDecl extends IChildResourceDecl {\n /**\n * The id of the resource.\n */\n readonly id: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree node.\n * @public\n */\nexport interface IResourceTreeChildNodeDecl {\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n}\n\n/**\n * Declared context for a resource container.\n * @public\n */\nexport interface IContainerContextDecl {\n readonly baseId?: string;\n readonly conditions?: ConditionSetDecl;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree root.\n * @public\n */\nexport interface IResourceTreeRootDecl extends IResourceTreeChildNodeDecl {\n readonly context?: IContainerContextDecl;\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Non-validated declaration of a collection of resources.\n * @public\n */\nexport interface IResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<ILooseResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<ILooseResourceDecl>;\n readonly collections?: ReadonlyArray<IResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Non-validated declaration of a resource for import,\n * which can be either a loose or child resource.\n * @public\n */\nexport type IImporterResourceDecl = ILooseResourceDecl | IChildResourceDecl;\n\n/**\n * Non-validated declaration of a collection of resources for an importer.\n * @public\n */\nexport interface IImporterResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<IImporterResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<IImporterResourceDecl>;\n readonly collections?: ReadonlyArray<IImporterResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Type guard function to check if a resource candidate declaration is a loose resource candidate declaration.\n * @public\n */\nexport function isLooseResourceCandidateDecl(\n decl: IImporterResourceCandidateDecl\n): decl is ILooseResourceCandidateDecl {\n return 'id' in decl;\n}\n\n/**\n * Type guard function to check if a resource declaration is a loose resource declaration.\n * @public\n */\nexport function isLooseResourceDecl(decl: IImporterResourceDecl): decl is ILooseResourceDecl {\n return 'id' in decl;\n}\n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AAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,2BAA2B,CAAC,CAAC;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACvD,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IAC9D,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,8BAA8B,CAAC,CAAC;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC1D,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,+BAA+B,CAAC,CAAC;IACtE,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalized.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/normalized.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { ResourceValueMergeMethod } from '../common';\nimport { ILooseConditionDecl } from './json';\n\n/**\n * Normalized non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDecl = ReadonlyArray<ILooseConditionDecl>;\n\n/**\n * Normalized non-validated child declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface IChildResourceCandidateDecl {\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Normalized non-validated declaration of a resource candidate for import,\n * which can be either a loose or child resource candidate.\n * @public\n */\nexport interface IImporterResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id?: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Normalized non-validated loose declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface ILooseResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id: string;\n\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n\n /**\n * The type of the resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Normalized non-validated child declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface IChildResourceDecl {\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Normalized non-validated loose declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface ILooseResourceDecl extends IChildResourceDecl {\n /**\n * The id of the resource.\n */\n readonly id: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree node.\n * @public\n */\nexport interface IResourceTreeChildNodeDecl {\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n}\n\n/**\n * Declared context for a resource container.\n * @public\n */\nexport interface IContainerContextDecl {\n readonly baseId?: string;\n readonly conditions?: ConditionSetDecl;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree root.\n * @public\n */\nexport interface IResourceTreeRootDecl extends IResourceTreeChildNodeDecl {\n readonly context?: IContainerContextDecl;\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Normalized non-validated declaration of a collection of resources.\n * @public\n */\nexport interface IResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<ILooseResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<ILooseResourceDecl>;\n readonly collections?: ReadonlyArray<IResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Normalized non-validated declaration of a resource for import,\n * which can be either a loose or child resource.\n * @public\n */\nexport type IImporterResourceDecl = ILooseResourceDecl | IChildResourceDecl;\n\n/**\n * Normalized non-validated declaration of a collection of resources for importers.\n * This allows for a mix of loose and child resource declarations.\n * @public\n */\nexport interface IImporterResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<IImporterResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<IImporterResourceDecl>;\n readonly collections?: ReadonlyArray<IImporterResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export declare class ResourceDeclCollection implements IResourceDeclContainer {
|
|
|
13
13
|
*/
|
|
14
14
|
readonly collection: Normalized.IImporterResourceCollectionDecl;
|
|
15
15
|
/**
|
|
16
|
-
* {@
|
|
16
|
+
* {@inheritDoc ResourceJson.IResourceDeclContainer.context}
|
|
17
17
|
*/
|
|
18
18
|
get context(): Normalized.IContainerContextDecl | undefined;
|
|
19
19
|
protected _resources: Normalized.IImporterResourceDecl[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceDeclCollection.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgD,MAAM,EAAW,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAI3C;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;IACnE;;;OAGG;IACH,SAAgB,UAAU,EAAE,UAAU,CAAC,+BAA+B,CAAC;IAEvE;;OAEG;IACH,IAAW,OAAO,IAAI,UAAU,CAAC,qBAAqB,GAAG,SAAS,CAEjE;IAED,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,qBAAqB,EAAE,CAAM;IAC9D,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,8BAA8B,EAAE,CAAM;IAExE,SAAS,aAAa,UAAU,EAAE,UAAU,CAAC,+BAA+B;IAK5E;;;;;OAKG;WACW,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC;IASnE;;;;OAIG;IACI,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAI9E;;;;OAIG;IACI,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,8BAA8B,CAAC;IAIxF,OAAO,CAAC,QAAQ;CA2BjB"}
|
|
@@ -65,7 +65,7 @@ const helpers_1 = require("./helpers");
|
|
|
65
65
|
*/
|
|
66
66
|
class ResourceDeclCollection {
|
|
67
67
|
/**
|
|
68
|
-
* {@
|
|
68
|
+
* {@inheritDoc ResourceJson.IResourceDeclContainer.context}
|
|
69
69
|
*/
|
|
70
70
|
get context() {
|
|
71
71
|
return this.collection.context;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceDeclCollection.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8F;AAE9F,mDAAqC;AAGrC,uCAA4F;AAE5F;;;;GAIG;AACH,MAAa,sBAAsB;IAOjC;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IACjC,CAAC;IAKD,YAAsB,UAAsD;QAHlE,eAAU,GAAuC,EAAE,CAAC;QACpD,gBAAW,GAAgD,E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,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;YAE5F,MAAM,eAAe,GACnB,MAAA,MAAA,UAAU,CAAC,SAAS,0CAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACrC,IAAA,+BAAqB,EAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,CAC1D,mCAAI,EAAE,CAAC;YACV,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAU,EAAC,eAAe,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;YAE1F,MAAA,UAAU,CAAC,WAAW,0CAAE,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBAChD,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlFD,wDAkFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { mergeContextDecl, mergeImporterCandidate, mergeImporterResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @public\n */\nexport class ResourceDeclCollection implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}\n * being processed.\n */\n public readonly collection: Normalized.IImporterResourceCollectionDecl;\n\n /**\n * {@inheritDoc ResourceJson.IResourceDeclContainer.context}\n */\n public get context(): Normalized.IContainerContextDecl | undefined {\n return this.collection.context;\n }\n\n protected _resources: Normalized.IImporterResourceDecl[] = [];\n protected _candidates: Normalized.IImporterResourceCandidateDecl[] = [];\n\n protected constructor(collection: Normalized.IImporterResourceCollectionDecl) {\n this.collection = collection;\n this._extract(collection).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclCollection | ResourceDeclCollection} from an\n * untyped {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new collection if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclCollection> {\n return Convert.importerResourceCollectionDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource collection: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclCollection(decl));\n });\n }\n\n /**\n * Gets the importer resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource declarations}\n * extracted from the collection.\n */\n public getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the importer candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declarations}\n * extracted from the collection.\n */\n public getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n collection: Normalized.IImporterResourceCollectionDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n return mergeContextDecl(collection.context, parentName, parentConditions).onSuccess(\n ({ baseId: baseName, conditions: baseConditions }) => {\n const mergedCandidates =\n collection.candidates?.map((candidate) =>\n mergeImporterCandidate(candidate, baseName, baseConditions)\n ) ?? [];\n this._candidates.push(...mapResults(mergedCandidates).aggregateError(errors).orDefault([]));\n\n const mergedResources =\n collection.resources?.map((resource) =>\n mergeImporterResource(resource, baseName, baseConditions)\n ) ?? [];\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n collection.collections?.forEach((subCollection) => {\n this._extract(subCollection, baseName, baseConditions).aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n }\n );\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceDeclContainer.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAEpD;;;OAGG;IACH,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAExE;;;OAGG;IACH,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;CACnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceDeclContainer.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Normalized from './normalized';\n\n/**\n * Generic container for resource and resource candidate\n * declarations.\n * @public\n */\nexport interface IResourceDeclContainer {\n /**\n * Optional initial {@link ResourceJson.Normalized.IContainerContextDecl | resource context}\n * declaration for the container.\n */\n readonly context?: Normalized.IContainerContextDecl;\n\n /**\n * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource}\n * declarations for all resources in the container, including children.\n */\n getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl>;\n\n /**\n * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate}\n * declarations for all resources in the container, including children.\n */\n getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl>;\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export declare class ResourceDeclTree implements IResourceDeclContainer {
|
|
|
13
13
|
*/
|
|
14
14
|
readonly tree: Normalized.IResourceTreeRootDecl;
|
|
15
15
|
/**
|
|
16
|
-
* {@
|
|
16
|
+
* {@inheritDoc ResourceJson.IResourceDeclContainer.context}
|
|
17
17
|
*/
|
|
18
18
|
get context(): Normalized.IContainerContextDecl | undefined;
|
|
19
19
|
protected _resources: Normalized.ILooseResourceDecl[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceDeclTree.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclTree.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgD,MAAM,EAAW,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAK3C;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,sBAAsB;IAC7D;;;OAGG;IACH,SAAgB,IAAI,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAEvD;;OAEG;IACH,IAAW,OAAO,IAAI,UAAU,CAAC,qBAAqB,GAAG,SAAS,CAEjE;IAED,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,kBAAkB,EAAE,CAAM;IAC3D,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,2BAA2B,EAAE,CAAM;IAErE,SAAS,aAAa,IAAI,EAAE,UAAU,CAAC,qBAAqB;IAO5D;;;;;OAKG;WACW,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAS7D;;;;OAIG;IACI,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAI3E;;;;OAIG;IACI,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAIrF,OAAO,CAAC,QAAQ;CAuBjB"}
|
|
@@ -66,7 +66,7 @@ const helpers_1 = require("./helpers");
|
|
|
66
66
|
*/
|
|
67
67
|
class ResourceDeclTree {
|
|
68
68
|
/**
|
|
69
|
-
* {@
|
|
69
|
+
* {@inheritDoc ResourceJson.IResourceDeclContainer.context}
|
|
70
70
|
*/
|
|
71
71
|
get context() {
|
|
72
72
|
return this.tree.context;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceDeclTree.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8F;AAE9F,mDAAqC;AAGrC,sCAAqD;AACrD,uCAA+C;AAE/C;;;;GAIG;AACH,MAAa,gBAAgB;IAO3B;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAKD,YAAsB,IAAsC;;QAHlD,eAAU,GAAoC,EAAE,CAAC;QACjD,gBAAW,GAA6C,EAAE,CAAC;QAGnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,EAAE,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,CAAC;QAChC,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,IAAa;QAChC,OAAO,OAAO,CAAC,oBAAoB;aAChC,OAAO,CAAC,IAAI,CAAC;aACb,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,0BAA0B,GAAG,EAAE,CAAC;aACzD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QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACtF,CAAC,CAAC;iBACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAhFD,4CAgFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { Helpers as CommonHelpers } from '../common';\nimport { mergeChildResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root}.\n * @public\n */\nexport class ResourceDeclTree implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}\n * being processed.\n */\n public readonly tree: Normalized.IResourceTreeRootDecl;\n\n /**\n * {@inheritDoc ResourceJson.IResourceDeclContainer.context}\n */\n public get context(): Normalized.IContainerContextDecl | undefined {\n return this.tree.context;\n }\n\n protected _resources: Normalized.ILooseResourceDecl[] = [];\n protected _candidates: Normalized.ILooseResourceCandidateDecl[] = [];\n\n protected constructor(tree: Normalized.IResourceTreeRootDecl) {\n this.tree = tree;\n const id = tree.context?.baseId;\n const conditions = tree.context?.conditions;\n this._extract(tree, id, conditions).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclTree | ResourceDeclTree} from an\n * untyped {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new tree if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclTree> {\n return Convert.resourceTreeRootDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource tree: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclTree(decl));\n });\n }\n\n /**\n * Gets the loose resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}\n * extracted from the collection.\n */\n public getImporterResources(): ReadonlyArray<Normalized.ILooseResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the loose candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}\n * extracted from the collection.\n */\n public getImporterCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n node: Normalized.IResourceTreeChildNodeDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n\n const resourceEntries = Array.from(Object.entries(node.resources ?? {}));\n const mergedResources = resourceEntries.map(([name, resource]) =>\n mergeChildResource(resource, name, parentName, parentConditions)\n );\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n const children = Array.from(Object.entries(node.children ?? {}));\n children.forEach(([name, childNode]) => {\n CommonHelpers.joinResourceIds(parentName, name)\n .onSuccess((childName) => {\n return this._extract(childNode, childName, parentConditions).aggregateError(errors);\n })\n .aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IResourceTypeConfig } from './json';
|
|
2
|
+
/**
|
|
3
|
+
* A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
4
|
+
* @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const resourceTypeConfig: import("@fgv/ts-utils").ObjectConverter<IResourceTypeConfig<import("@fgv/ts-json-base").JsonObject>, unknown>;
|
|
8
|
+
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/convert.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,+GAI7B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.resourceTypeConfig = void 0;
|
|
25
|
+
/* eslint-disable @rushstack/typedef-var */
|
|
26
|
+
const ts_utils_1 = require("@fgv/ts-utils");
|
|
27
|
+
const ts_json_base_1 = require("@fgv/ts-json-base");
|
|
28
|
+
/**
|
|
29
|
+
* A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
30
|
+
* @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
exports.resourceTypeConfig = ts_utils_1.Converters.strictObject({
|
|
34
|
+
name: ts_utils_1.Converters.string,
|
|
35
|
+
typeName: ts_utils_1.Converters.string,
|
|
36
|
+
template: ts_json_base_1.Converters.jsonObject.optional()
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=convert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,2CAA2C;AAE3C,4CAA2C;AAC3C,oDAAiE;AAGjE;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,qBAAU,CAAC,YAAY,CAAsB;IAC7E,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,QAAQ,EAAE,qBAAU,CAAC,MAAM;IAC3B,QAAQ,EAAE,yBAAc,CAAC,UAAU,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converters } from '@fgv/ts-utils';\nimport { Converters as JsonConverters } from '@fgv/ts-json-base';\nimport { IResourceTypeConfig } from './json';\n\n/**\n * A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.\n * @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.\n * @public\n */\nexport const resourceTypeConfig = Converters.strictObject<IResourceTypeConfig>({\n name: Converters.string,\n typeName: Converters.string,\n template: JsonConverters.jsonObject.optional()\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|