@fgv/ts-res 5.0.0-3 → 5.0.0-30
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/README.md +794 -137
- package/dist/ts-res.d.ts +2344 -187
- package/dist/tsdoc-metadata.json +1 -1
- package/eslint.config.js +16 -0
- package/lib/index.d.ts +11 -2
- package/lib/index.js +25 -2
- package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
- package/lib/packlets/bundle/bundleBuilder.js +134 -0
- package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
- package/lib/packlets/bundle/bundleLoader.js +105 -0
- package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
- package/lib/packlets/bundle/bundleNormalizer.js +142 -0
- package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
- package/lib/packlets/bundle/bundleUtils.js +117 -0
- package/lib/packlets/bundle/convert.d.ts +33 -0
- package/lib/packlets/bundle/convert.js +78 -0
- package/lib/packlets/bundle/index.d.ts +21 -0
- package/lib/packlets/bundle/index.js +83 -0
- package/lib/packlets/bundle/model.d.ts +100 -0
- package/lib/packlets/bundle/model.js +24 -0
- package/lib/packlets/common/convert.d.ts +10 -0
- package/lib/packlets/common/convert.js +11 -1
- package/lib/packlets/common/helpers/resources.d.ts +7 -0
- package/lib/packlets/common/helpers/resources.js +12 -0
- package/lib/packlets/common/resources.d.ts +48 -1
- package/lib/packlets/common/validate/regularExpressions.d.ts +4 -0
- package/lib/packlets/common/validate/regularExpressions.js +5 -1
- package/lib/packlets/common/validate/resources.d.ts +35 -1
- package/lib/packlets/common/validate/resources.js +54 -0
- package/lib/packlets/conditions/conditionSet.d.ts +9 -0
- package/lib/packlets/conditions/conditionSet.js +74 -1
- package/lib/packlets/config/configInitFactory.d.ts +217 -0
- package/lib/packlets/config/configInitFactory.js +302 -0
- package/lib/packlets/config/convert.d.ts +9 -0
- package/lib/packlets/config/convert.js +12 -1
- package/lib/packlets/config/index.d.ts +1 -0
- package/lib/packlets/config/index.js +1 -0
- package/lib/packlets/config/json.d.ts +1 -1
- package/lib/packlets/config/systemConfiguration.d.ts +16 -3
- package/lib/packlets/config/systemConfiguration.js +19 -40
- package/lib/packlets/import/fsItem.js +8 -13
- package/lib/packlets/import/importers/jsonImporter.js +1 -0
- package/lib/packlets/qualifier-types/config/convert.d.ts +22 -1
- package/lib/packlets/qualifier-types/config/convert.js +67 -2
- package/lib/packlets/qualifier-types/config/json.d.ts +24 -2
- package/lib/packlets/qualifier-types/config/json.js +11 -0
- package/lib/packlets/qualifier-types/convert.d.ts +1 -1
- package/lib/packlets/qualifier-types/helpers.d.ts +14 -5
- package/lib/packlets/qualifier-types/helpers.js +2 -2
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts +28 -2
- package/lib/packlets/qualifier-types/languageQualifierType.js +73 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +31 -5
- package/lib/packlets/qualifier-types/literalQualifierType.js +75 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -11
- package/lib/packlets/qualifier-types/literalValueHierarchy.js +11 -1
- package/lib/packlets/qualifier-types/qualifierType.d.ts +31 -2
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +31 -5
- package/lib/packlets/qualifier-types/territoryQualifierType.js +77 -0
- package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
- package/lib/packlets/resource-json/compiled/convert.js +2 -1
- package/lib/packlets/resource-json/compiled/json.d.ts +6 -2
- package/lib/packlets/resource-types/config/convert.d.ts +1 -1
- package/lib/packlets/resource-types/config/convert.js +3 -1
- package/lib/packlets/resource-types/config/json.d.ts +3 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts +14 -5
- package/lib/packlets/resource-types/jsonResourceType.js +8 -4
- package/lib/packlets/resource-types/resourceType.d.ts +115 -14
- package/lib/packlets/resource-types/resourceType.js +39 -3
- package/lib/packlets/resources/candidateValue.d.ts +92 -0
- package/lib/packlets/resources/candidateValue.js +128 -0
- package/lib/packlets/resources/candidateValueCollector.d.ts +55 -0
- package/lib/packlets/resources/candidateValueCollector.js +96 -0
- package/lib/packlets/resources/common.d.ts +26 -0
- package/lib/packlets/resources/index.d.ts +2 -0
- package/lib/packlets/resources/index.js +2 -0
- package/lib/packlets/resources/resource.d.ts +6 -6
- package/lib/packlets/resources/resource.js +5 -10
- package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
- package/lib/packlets/resources/resourceBuilder.js +3 -1
- package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
- package/lib/packlets/resources/resourceCandidate.js +17 -5
- package/lib/packlets/resources/resourceManagerBuilder.d.ts +189 -11
- package/lib/packlets/resources/resourceManagerBuilder.js +478 -17
- package/lib/packlets/runtime/cacheListener.d.ts +9 -0
- package/lib/packlets/runtime/cacheListener.js +6 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts +6 -0
- package/lib/packlets/runtime/cacheMetrics.js +11 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +23 -11
- package/lib/packlets/runtime/compiledResourceCollection.js +32 -4
- package/lib/packlets/runtime/iResourceManager.d.ts +13 -5
- package/lib/packlets/runtime/index.d.ts +1 -0
- package/lib/packlets/runtime/index.js +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
- package/lib/packlets/runtime/resourceResolver.d.ts +60 -1
- package/lib/packlets/runtime/resourceResolver.js +84 -45
- package/lib/packlets/runtime/resourceTreeResolver.d.ts +152 -0
- package/lib/packlets/runtime/resourceTreeResolver.js +222 -0
- package/lib/packlets/runtime/validate.js +1 -0
- package/lib/packlets/zip-archive/convert.d.ts +52 -0
- package/lib/packlets/zip-archive/convert.js +103 -0
- package/lib/packlets/zip-archive/index.d.ts +23 -0
- package/lib/packlets/zip-archive/index.js +95 -0
- package/lib/packlets/zip-archive/json.d.ts +64 -0
- package/lib/packlets/zip-archive/json.js +24 -0
- package/lib/packlets/zip-archive/types.d.ts +98 -0
- package/lib/packlets/zip-archive/types.js +39 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.js +194 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.js +285 -0
- package/package.json +26 -32
- package/CLAUDE.md +0 -186
- package/EXAMPLE_INIT_PARAMS.md +0 -88
- package/PROGRESS_SUMMARY.md +0 -48
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/packlets/common/conditions.d.ts.map +0 -1
- package/lib/packlets/common/conditions.js.map +0 -1
- package/lib/packlets/common/convert.d.ts.map +0 -1
- package/lib/packlets/common/convert.js.map +0 -1
- package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
- package/lib/packlets/common/helpers/conditions.js.map +0 -1
- package/lib/packlets/common/helpers/context.d.ts.map +0 -1
- package/lib/packlets/common/helpers/context.js.map +0 -1
- package/lib/packlets/common/helpers/index.d.ts.map +0 -1
- package/lib/packlets/common/helpers/index.js.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
- package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
- package/lib/packlets/common/helpers/resources.js.map +0 -1
- package/lib/packlets/common/index.d.ts.map +0 -1
- package/lib/packlets/common/index.js.map +0 -1
- package/lib/packlets/common/resources.d.ts.map +0 -1
- package/lib/packlets/common/resources.js.map +0 -1
- package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
- package/lib/packlets/common/validate/conditions.js.map +0 -1
- package/lib/packlets/common/validate/index.d.ts.map +0 -1
- package/lib/packlets/common/validate/index.js.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
- package/lib/packlets/common/validate/resources.d.ts.map +0 -1
- package/lib/packlets/common/validate/resources.js.map +0 -1
- package/lib/packlets/conditions/condition.d.ts.map +0 -1
- package/lib/packlets/conditions/condition.js.map +0 -1
- package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSet.js.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionToken.js.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/decls.js.map +0 -1
- package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/index.js.map +0 -1
- package/lib/packlets/conditions/index.d.ts.map +0 -1
- package/lib/packlets/conditions/index.js.map +0 -1
- package/lib/packlets/config/common.d.ts.map +0 -1
- package/lib/packlets/config/common.js.map +0 -1
- package/lib/packlets/config/convert.d.ts.map +0 -1
- package/lib/packlets/config/convert.js.map +0 -1
- package/lib/packlets/config/index.d.ts.map +0 -1
- package/lib/packlets/config/index.js.map +0 -1
- package/lib/packlets/config/json.d.ts.map +0 -1
- package/lib/packlets/config/json.js.map +0 -1
- package/lib/packlets/config/predefined/default.d.ts.map +0 -1
- package/lib/packlets/config/predefined/default.js.map +0 -1
- package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
- package/lib/packlets/config/predefined/extended.js.map +0 -1
- package/lib/packlets/config/predefined/index.d.ts.map +0 -1
- package/lib/packlets/config/predefined/index.js.map +0 -1
- package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
- package/lib/packlets/config/systemConfiguration.js.map +0 -1
- package/lib/packlets/context/contextDecls.d.ts.map +0 -1
- package/lib/packlets/context/contextDecls.js.map +0 -1
- package/lib/packlets/context/contextToken.d.ts.map +0 -1
- package/lib/packlets/context/contextToken.js.map +0 -1
- package/lib/packlets/context/convert/decls.d.ts.map +0 -1
- package/lib/packlets/context/convert/decls.js.map +0 -1
- package/lib/packlets/context/convert/index.d.ts.map +0 -1
- package/lib/packlets/context/convert/index.js.map +0 -1
- package/lib/packlets/context/index.d.ts.map +0 -1
- package/lib/packlets/context/index.js.map +0 -1
- package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecision.js.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
- package/lib/packlets/decisions/candidate.d.ts.map +0 -1
- package/lib/packlets/decisions/candidate.js.map +0 -1
- package/lib/packlets/decisions/common.d.ts.map +0 -1
- package/lib/packlets/decisions/common.js.map +0 -1
- package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/concreteDecision.js.map +0 -1
- package/lib/packlets/decisions/decision.d.ts.map +0 -1
- package/lib/packlets/decisions/decision.js.map +0 -1
- package/lib/packlets/decisions/index.d.ts.map +0 -1
- package/lib/packlets/decisions/index.js.map +0 -1
- package/lib/packlets/import/fsItem.d.ts.map +0 -1
- package/lib/packlets/import/fsItem.js.map +0 -1
- package/lib/packlets/import/importContext.d.ts.map +0 -1
- package/lib/packlets/import/importContext.js.map +0 -1
- package/lib/packlets/import/importManager.d.ts.map +0 -1
- package/lib/packlets/import/importManager.js.map +0 -1
- package/lib/packlets/import/importable.d.ts.map +0 -1
- package/lib/packlets/import/importable.js.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
- package/lib/packlets/import/importers/importer.d.ts.map +0 -1
- package/lib/packlets/import/importers/importer.js.map +0 -1
- package/lib/packlets/import/importers/index.d.ts.map +0 -1
- package/lib/packlets/import/importers/index.js.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
- package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/pathImporter.js.map +0 -1
- package/lib/packlets/import/index.d.ts.map +0 -1
- package/lib/packlets/import/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/json.js.map +0 -1
- package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/helpers.js.map +0 -1
- package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/index.js.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
- package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/index.js.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/index.js.map +0 -1
- package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
- package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/common.js.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
- package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/index.js.map +0 -1
- package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/json.js.map +0 -1
- package/lib/packlets/resource-json/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/convert.js.map +0 -1
- package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-json/helpers.js.map +0 -1
- package/lib/packlets/resource-json/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/index.js.map +0 -1
- package/lib/packlets/resource-json/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/json.js.map +0 -1
- package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
- package/lib/packlets/resource-json/normalized.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
- package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/convert.js.map +0 -1
- package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/index.js.map +0 -1
- package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/json.js.map +0 -1
- package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-types/helpers.js.map +0 -1
- package/lib/packlets/resource-types/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/index.js.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
- package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
- package/lib/packlets/resources/candidateReducer.js.map +0 -1
- package/lib/packlets/resources/common.d.ts.map +0 -1
- package/lib/packlets/resources/common.js.map +0 -1
- package/lib/packlets/resources/index.d.ts.map +0 -1
- package/lib/packlets/resources/index.js.map +0 -1
- package/lib/packlets/resources/resource.d.ts.map +0 -1
- package/lib/packlets/resources/resource.js.map +0 -1
- package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceBuilder.js.map +0 -1
- package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
- package/lib/packlets/resources/resourceCandidate.js.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
- package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheListener.js.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
- package/lib/packlets/runtime/context/index.d.ts.map +0 -1
- package/lib/packlets/runtime/context/index.js.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
- package/lib/packlets/runtime/iResourceManager.js.map +0 -1
- package/lib/packlets/runtime/index.d.ts.map +0 -1
- package/lib/packlets/runtime/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
- package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
- package/lib/packlets/runtime/resourceResolver.js.map +0 -1
- package/lib/packlets/runtime/validate.d.ts.map +0 -1
- package/lib/packlets/runtime/validate.js.map +0 -1
|
@@ -87,6 +87,9 @@ exports.AggregateCacheMetrics = AggregateCacheMetrics;
|
|
|
87
87
|
* @public
|
|
88
88
|
*/
|
|
89
89
|
class ResourceResolverCacheMetricsListener {
|
|
90
|
+
get numContextErrors() {
|
|
91
|
+
return this._contextErrors;
|
|
92
|
+
}
|
|
90
93
|
constructor(factoryOrMetrics) {
|
|
91
94
|
if (typeof factoryOrMetrics === 'function') {
|
|
92
95
|
this._metrics = {
|
|
@@ -98,6 +101,7 @@ class ResourceResolverCacheMetricsListener {
|
|
|
98
101
|
else {
|
|
99
102
|
this._metrics = factoryOrMetrics;
|
|
100
103
|
}
|
|
104
|
+
this._contextErrors = 0;
|
|
101
105
|
}
|
|
102
106
|
/**
|
|
103
107
|
* Get the metrics for all cache types.
|
|
@@ -124,6 +128,12 @@ class ResourceResolverCacheMetricsListener {
|
|
|
124
128
|
onCacheError(cache, index) {
|
|
125
129
|
this._metrics[cache].onError(index);
|
|
126
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
|
|
133
|
+
*/
|
|
134
|
+
onContextError(qualifier, error) {
|
|
135
|
+
this._contextErrors++;
|
|
136
|
+
}
|
|
127
137
|
/**
|
|
128
138
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}
|
|
129
139
|
*/
|
|
@@ -137,6 +147,7 @@ class ResourceResolverCacheMetricsListener {
|
|
|
137
147
|
this._metrics.condition.reset();
|
|
138
148
|
this._metrics.conditionSet.reset();
|
|
139
149
|
this._metrics.decision.reset();
|
|
150
|
+
this._contextErrors = 0;
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
exports.ResourceResolverCacheMetricsListener = ResourceResolverCacheMetricsListener;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Collections, Result } from '@fgv/ts-utils';
|
|
2
2
|
import { ReadOnlyConditionCollector, ReadOnlyConditionSetCollector } from '../conditions';
|
|
3
3
|
import { ReadOnlyAbstractDecisionCollector } from '../decisions';
|
|
4
|
-
import {
|
|
5
|
-
import { ResourceType,
|
|
6
|
-
import { QualifierType,
|
|
4
|
+
import { IReadOnlyQualifierCollector } from '../qualifiers';
|
|
5
|
+
import { ResourceType, ReadOnlyResourceTypeCollector } from '../resource-types';
|
|
6
|
+
import { QualifierType, ReadOnlyQualifierTypeCollector } from '../qualifier-types';
|
|
7
7
|
import { ResourceId } from '../common';
|
|
8
|
+
import { JsonValue } from '@fgv/ts-json-base';
|
|
8
9
|
import { IResourceManager, IResource } from './iResourceManager';
|
|
9
10
|
import * as ResourceJson from '../resource-json';
|
|
10
|
-
import {
|
|
11
|
+
import { ReadOnlyResourceTreeRoot } from './resource-tree';
|
|
11
12
|
import * as Context from '../context';
|
|
12
13
|
/**
|
|
13
14
|
* Interface for parameters to create a {@link Runtime.CompiledResourceCollection | CompiledResourceCollection}.
|
|
@@ -33,30 +34,35 @@ export interface ICompiledResourceCollectionCreateParams {
|
|
|
33
34
|
* and use pre-compiled resource collections without rebuilding them from scratch.
|
|
34
35
|
* @public
|
|
35
36
|
*/
|
|
36
|
-
export declare class CompiledResourceCollection implements IResourceManager {
|
|
37
|
+
export declare class CompiledResourceCollection implements IResourceManager<IResource> {
|
|
37
38
|
readonly conditions: ReadOnlyConditionCollector;
|
|
38
39
|
readonly conditionSets: ReadOnlyConditionSetCollector;
|
|
39
40
|
readonly decisions: ReadOnlyAbstractDecisionCollector;
|
|
40
41
|
private readonly _qualifierTypes;
|
|
41
42
|
private readonly _qualifiers;
|
|
42
43
|
private readonly _resourceTypes;
|
|
44
|
+
private readonly _candidateValues;
|
|
43
45
|
private readonly _builtResources;
|
|
44
46
|
private _cachedResourceTree?;
|
|
45
47
|
/**
|
|
46
|
-
* A {@link QualifierTypes.
|
|
48
|
+
* A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which
|
|
47
49
|
* contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.
|
|
48
50
|
*/
|
|
49
|
-
get qualifierTypes():
|
|
51
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
50
52
|
/**
|
|
51
|
-
* A {@link Qualifiers.
|
|
53
|
+
* A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which
|
|
52
54
|
* contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
|
|
53
55
|
*/
|
|
54
|
-
get qualifiers():
|
|
56
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
55
57
|
/**
|
|
56
58
|
* A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which
|
|
57
59
|
* contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.
|
|
58
60
|
*/
|
|
59
|
-
get resourceTypes():
|
|
61
|
+
get resourceTypes(): ReadOnlyResourceTypeCollector;
|
|
62
|
+
/**
|
|
63
|
+
* The candidate values in the collection.
|
|
64
|
+
*/
|
|
65
|
+
get candidateValues(): ReadonlyArray<JsonValue>;
|
|
60
66
|
/**
|
|
61
67
|
* {@inheritdoc Runtime.IResourceManager.builtResources}
|
|
62
68
|
*/
|
|
@@ -105,7 +111,7 @@ export declare class CompiledResourceCollection implements IResourceManager {
|
|
|
105
111
|
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
106
112
|
* @public
|
|
107
113
|
*/
|
|
108
|
-
getBuiltResourceTree(): Result<
|
|
114
|
+
getBuiltResourceTree(): Result<ReadOnlyResourceTreeRoot<IResource>>;
|
|
109
115
|
/**
|
|
110
116
|
* Reconstructs a QualifierTypeCollector from compiled data.
|
|
111
117
|
* @param compiled - The compiled resource collection
|
|
@@ -154,6 +160,12 @@ export declare class CompiledResourceCollection implements IResourceManager {
|
|
|
154
160
|
* @internal
|
|
155
161
|
*/
|
|
156
162
|
private _buildDecisions;
|
|
163
|
+
/**
|
|
164
|
+
* Gets a candidate value from the collection.
|
|
165
|
+
* @param valueIndex - The index of the candidate value to get.
|
|
166
|
+
* @returns
|
|
167
|
+
*/
|
|
168
|
+
private _getCandidateValue;
|
|
157
169
|
/**
|
|
158
170
|
* Reconstructs a ValidatingResultMap of resources from compiled data.
|
|
159
171
|
* @param compiled - The compiled resource collection
|
|
@@ -75,14 +75,14 @@ const Context = __importStar(require("../context"));
|
|
|
75
75
|
*/
|
|
76
76
|
class CompiledResourceCollection {
|
|
77
77
|
/**
|
|
78
|
-
* A {@link QualifierTypes.
|
|
78
|
+
* A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which
|
|
79
79
|
* contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.
|
|
80
80
|
*/
|
|
81
81
|
get qualifierTypes() {
|
|
82
82
|
return this._qualifierTypes;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* A {@link Qualifiers.
|
|
85
|
+
* A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which
|
|
86
86
|
* contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
|
|
87
87
|
*/
|
|
88
88
|
get qualifiers() {
|
|
@@ -95,6 +95,12 @@ class CompiledResourceCollection {
|
|
|
95
95
|
get resourceTypes() {
|
|
96
96
|
return this._resourceTypes;
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* The candidate values in the collection.
|
|
100
|
+
*/
|
|
101
|
+
get candidateValues() {
|
|
102
|
+
return this._candidateValues;
|
|
103
|
+
}
|
|
98
104
|
/**
|
|
99
105
|
* {@inheritdoc Runtime.IResourceManager.builtResources}
|
|
100
106
|
*/
|
|
@@ -133,6 +139,7 @@ class CompiledResourceCollection {
|
|
|
133
139
|
this.conditions = conditionCollector;
|
|
134
140
|
this.conditionSets = conditionSetCollector;
|
|
135
141
|
this.decisions = decisionCollector;
|
|
142
|
+
this._candidateValues = [...params.compiledCollection.candidateValues];
|
|
136
143
|
// Build resources from compiled data
|
|
137
144
|
this._builtResources = this._buildResources(params.compiledCollection, this._resourceTypes, decisionCollector).orThrow();
|
|
138
145
|
}
|
|
@@ -381,6 +388,21 @@ class CompiledResourceCollection {
|
|
|
381
388
|
}
|
|
382
389
|
return errors.hasMessages ? (0, ts_utils_1.fail)(errors.toString()) : (0, ts_utils_1.succeed)(decisionCollector);
|
|
383
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* Gets a candidate value from the collection.
|
|
393
|
+
* @param valueIndex - The index of the candidate value to get.
|
|
394
|
+
* @returns
|
|
395
|
+
*/
|
|
396
|
+
_getCandidateValue(valueIndex) {
|
|
397
|
+
if (valueIndex < 0 || valueIndex >= this._candidateValues.length) {
|
|
398
|
+
return (0, ts_utils_1.fail)(`Invalid candidate value index ${valueIndex}`);
|
|
399
|
+
}
|
|
400
|
+
/* c8 ignore next 3 - defensive coding for invalid candidate value conversion */
|
|
401
|
+
if (!(0, ts_json_base_1.isJsonObject)(this._candidateValues[valueIndex])) {
|
|
402
|
+
return (0, ts_utils_1.fail)(`${valueIndex}: candidate value not a JSON object.`);
|
|
403
|
+
}
|
|
404
|
+
return (0, ts_utils_1.succeed)(this._candidateValues[valueIndex]);
|
|
405
|
+
}
|
|
384
406
|
/**
|
|
385
407
|
* Reconstructs a ValidatingResultMap of resources from compiled data.
|
|
386
408
|
* @param compiled - The compiled resource collection
|
|
@@ -413,7 +435,7 @@ class CompiledResourceCollection {
|
|
|
413
435
|
}
|
|
414
436
|
const decision = decisionResult.value;
|
|
415
437
|
// Build candidates from compiled data
|
|
416
|
-
const candidateDeclsResult = (0, ts_utils_1.mapResults)(compiledResource.candidates.map((compiledCandidate) =>
|
|
438
|
+
const candidateDeclsResult = (0, ts_utils_1.mapResults)(compiledResource.candidates.map((compiledCandidate) => this._getCandidateValue(compiledCandidate.valueIndex).onSuccess((json) => {
|
|
417
439
|
return (0, ts_utils_1.succeed)({
|
|
418
440
|
json,
|
|
419
441
|
isPartial: compiledCandidate.isPartial,
|
|
@@ -431,7 +453,6 @@ class CompiledResourceCollection {
|
|
|
431
453
|
isPartial: candidateDecl.isPartial,
|
|
432
454
|
mergeMethod: candidateDecl.mergeMethod
|
|
433
455
|
}));
|
|
434
|
-
// Create a ConcreteDecision from the abstract decision and candidate values
|
|
435
456
|
const candidatesWithConditionSets = decision.candidates.map((baseCandidate, idx) => ({
|
|
436
457
|
conditionSet: baseCandidate.conditionSet,
|
|
437
458
|
value: candidates[idx].json
|
|
@@ -446,9 +467,16 @@ class CompiledResourceCollection {
|
|
|
446
467
|
continue;
|
|
447
468
|
}
|
|
448
469
|
const concreteDecision = concreteDecisionResult.value;
|
|
470
|
+
const { value: name, message: nameError } = common_1.Helpers.getNameForResourceId(compiledResource.id);
|
|
471
|
+
/* c8 ignore next 4 - defense in depth nearly impossible to reproduce */
|
|
472
|
+
if (nameError !== undefined) {
|
|
473
|
+
errors.addMessage(`Failed to get name for resource ${compiledResource.id}: ${nameError}`);
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
449
476
|
// Create minimal resource that implements IResource
|
|
450
477
|
const resource = {
|
|
451
478
|
id: compiledResource.id,
|
|
479
|
+
name,
|
|
452
480
|
resourceType,
|
|
453
481
|
decision: concreteDecision,
|
|
454
482
|
candidates
|
|
@@ -3,8 +3,9 @@ import { JsonObject } from '@fgv/ts-json-base';
|
|
|
3
3
|
import { ReadOnlyConditionCollector, ReadOnlyConditionSetCollector } from '../conditions';
|
|
4
4
|
import { ReadOnlyAbstractDecisionCollector, ConcreteDecision } from '../decisions';
|
|
5
5
|
import { ResourceId, ResourceValueMergeMethod } from '../common';
|
|
6
|
-
import {
|
|
6
|
+
import { IResourceType } from '../resource-types';
|
|
7
7
|
import { IContextDecl, IValidatedContextDecl } from '../context';
|
|
8
|
+
import { IReadOnlyResourceTreeRoot } from './resource-tree';
|
|
8
9
|
/**
|
|
9
10
|
* Runtime representation of a resource candidate with the minimal data needed for resolution.
|
|
10
11
|
* @public
|
|
@@ -30,8 +31,10 @@ export interface IResourceCandidate {
|
|
|
30
31
|
export interface IResource {
|
|
31
32
|
/** The resource identifier */
|
|
32
33
|
readonly id: string;
|
|
34
|
+
/** The resource name */
|
|
35
|
+
readonly name: string;
|
|
33
36
|
/** The resource type */
|
|
34
|
-
readonly resourceType:
|
|
37
|
+
readonly resourceType: IResourceType;
|
|
35
38
|
/** The decision used to select candidates */
|
|
36
39
|
readonly decision: ConcreteDecision;
|
|
37
40
|
/** The available candidates for this resource */
|
|
@@ -43,7 +46,7 @@ export interface IResource {
|
|
|
43
46
|
* implementations without requiring the full ResourceManagerBuilder build mechanics.
|
|
44
47
|
* @public
|
|
45
48
|
*/
|
|
46
|
-
export interface IResourceManager {
|
|
49
|
+
export interface IResourceManager<TR extends IResource = IResource> {
|
|
47
50
|
/**
|
|
48
51
|
* A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
|
|
49
52
|
* contains the {@link Conditions.Condition | conditions} used by resource candidates.
|
|
@@ -64,12 +67,17 @@ export interface IResourceManager {
|
|
|
64
67
|
* @param id - The resource identifier
|
|
65
68
|
* @returns Success with the runtime resource if found, Failure otherwise
|
|
66
69
|
*/
|
|
67
|
-
getBuiltResource(id: string): Result<
|
|
70
|
+
getBuiltResource(id: string): Result<TR>;
|
|
71
|
+
/**
|
|
72
|
+
* Gets a resource tree built from the resources in this resource manager.
|
|
73
|
+
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
74
|
+
*/
|
|
75
|
+
getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<TR>>;
|
|
68
76
|
/**
|
|
69
77
|
* A read-only result map of all built resources, keyed by resource ID.
|
|
70
78
|
* Resources are built on-demand when accessed and returns Results for error handling.
|
|
71
79
|
*/
|
|
72
|
-
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId,
|
|
80
|
+
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, TR>;
|
|
73
81
|
/**
|
|
74
82
|
* The number of resources in this resource manager.
|
|
75
83
|
*/
|
|
@@ -3,6 +3,7 @@ export * from './iResourceManager';
|
|
|
3
3
|
export * from './context/simpleContextQualifierProvider';
|
|
4
4
|
export * from './context/validatingSimpleContextQualifierProvider';
|
|
5
5
|
export * from './resourceResolver';
|
|
6
|
+
export * from './resourceTreeResolver';
|
|
6
7
|
export * from './conditionSetResolutionResult';
|
|
7
8
|
export * from './cacheListener';
|
|
8
9
|
export * from './cacheMetrics';
|
|
@@ -63,6 +63,7 @@ __exportStar(require("./iResourceManager"), exports);
|
|
|
63
63
|
__exportStar(require("./context/simpleContextQualifierProvider"), exports);
|
|
64
64
|
__exportStar(require("./context/validatingSimpleContextQualifierProvider"), exports);
|
|
65
65
|
__exportStar(require("./resourceResolver"), exports);
|
|
66
|
+
__exportStar(require("./resourceTreeResolver"), exports);
|
|
66
67
|
__exportStar(require("./conditionSetResolutionResult"), exports);
|
|
67
68
|
__exportStar(require("./cacheListener"), exports);
|
|
68
69
|
__exportStar(require("./cacheMetrics"), exports);
|
|
@@ -49,7 +49,7 @@ export type IReadOnlyResourceTreeNode<T> = IReadOnlyResourceTreeLeaf<T> | IReadO
|
|
|
49
49
|
* Interface for a read-only result-based resource tree with navigation methods.
|
|
50
50
|
* @public
|
|
51
51
|
*/
|
|
52
|
-
export interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<
|
|
52
|
+
export interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<TNAME, IReadOnlyResourceTreeNode<T>> {
|
|
53
53
|
/**
|
|
54
54
|
* Gets a tree node by its full ResourceId path.
|
|
55
55
|
* @param id - The ResourceId path to look up
|
|
@@ -14,7 +14,7 @@ import { IReadOnlyResourceTreeBranch, IReadOnlyResourceTreeChildren, IReadOnlyRe
|
|
|
14
14
|
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
15
15
|
* error handling throughout the resource tree navigation.
|
|
16
16
|
*
|
|
17
|
-
* @
|
|
17
|
+
* @public
|
|
18
18
|
*/
|
|
19
19
|
export declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {
|
|
20
20
|
private readonly _inner;
|
|
@@ -69,17 +69,17 @@ export declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResour
|
|
|
69
69
|
*/
|
|
70
70
|
forEach(cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void, arg?: unknown): void;
|
|
71
71
|
/**
|
|
72
|
-
* Gets a child node by its
|
|
73
|
-
* @param key - The
|
|
72
|
+
* Gets a child node by its string key with detailed error information.
|
|
73
|
+
* @param key - The string key to look up
|
|
74
74
|
* @returns DetailedResult containing the node if found, or failure with details
|
|
75
75
|
*/
|
|
76
|
-
get(key:
|
|
76
|
+
get(key: string): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
|
|
77
77
|
/**
|
|
78
|
-
* Checks if a child node exists at the given
|
|
79
|
-
* @param key - The
|
|
78
|
+
* Checks if a child node exists at the given string key.
|
|
79
|
+
* @param key - The string key to check
|
|
80
80
|
* @returns True if a child node exists at the key, false otherwise
|
|
81
81
|
*/
|
|
82
|
-
has(key:
|
|
82
|
+
has(key: string): boolean;
|
|
83
83
|
/**
|
|
84
84
|
* Returns an iterator of ResourceName keys for all child nodes.
|
|
85
85
|
* @returns Map iterator for all child node keys
|
|
@@ -37,7 +37,7 @@ const ts_utils_1 = require("@fgv/ts-utils");
|
|
|
37
37
|
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
38
38
|
* error handling throughout the resource tree navigation.
|
|
39
39
|
*
|
|
40
|
-
* @
|
|
40
|
+
* @public
|
|
41
41
|
*/
|
|
42
42
|
class ResourceTreeChildrenValidator {
|
|
43
43
|
/**
|
|
@@ -121,8 +121,8 @@ class ResourceTreeChildrenValidator {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* Gets a child node by its
|
|
125
|
-
* @param key - The
|
|
124
|
+
* Gets a child node by its string key with detailed error information.
|
|
125
|
+
* @param key - The string key to look up
|
|
126
126
|
* @returns DetailedResult containing the node if found, or failure with details
|
|
127
127
|
*/
|
|
128
128
|
get(key) {
|
|
@@ -132,8 +132,8 @@ class ResourceTreeChildrenValidator {
|
|
|
132
132
|
return (0, ts_utils_1.failWithDetail)(`${key}: invalid resource name.`, 'invalid-key');
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Checks if a child node exists at the given
|
|
136
|
-
* @param key - The
|
|
135
|
+
* Checks if a child node exists at the given string key.
|
|
136
|
+
* @param key - The string key to check
|
|
137
137
|
* @returns True if a child node exists at the key, false otherwise
|
|
138
138
|
*/
|
|
139
139
|
has(key) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Result } from '@fgv/ts-utils';
|
|
2
2
|
import { JsonValue } from '@fgv/ts-json-base';
|
|
3
|
+
import { IResourceResolver } from '../common';
|
|
3
4
|
import { Condition, ConditionSet } from '../conditions';
|
|
4
5
|
import { AbstractDecision } from '../decisions';
|
|
5
6
|
import { ReadOnlyQualifierTypeCollector } from '../qualifier-types';
|
|
@@ -7,6 +8,7 @@ import { IContextQualifierProvider } from './context';
|
|
|
7
8
|
import { IResourceManager, IResource, IResourceCandidate } from './iResourceManager';
|
|
8
9
|
import { ConditionSetResolutionResult, IConditionMatchResult } from './conditionSetResolutionResult';
|
|
9
10
|
import { IResourceResolverCacheListener } from './cacheListener';
|
|
11
|
+
import { IReadOnlyQualifierCollector } from '../qualifiers';
|
|
10
12
|
/**
|
|
11
13
|
* Represents the cached result of resolving a decision.
|
|
12
14
|
* Contains either a failure indicator or a list of instance indices for matching condition sets,
|
|
@@ -20,6 +22,19 @@ export type DecisionResolutionResult = {
|
|
|
20
22
|
instanceIndices: ReadonlyArray<number>;
|
|
21
23
|
defaultInstanceIndices: ReadonlyArray<number>;
|
|
22
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Options for configuring a {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export interface IResourceResolverOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Controls whether null values in resource composition should suppress properties
|
|
32
|
+
* instead of setting them to null. When true, properties with null values from
|
|
33
|
+
* higher-priority partial candidates will be omitted from the final composed resource.
|
|
34
|
+
* @defaultValue false
|
|
35
|
+
*/
|
|
36
|
+
suppressNullAsDelete?: boolean;
|
|
37
|
+
}
|
|
23
38
|
/**
|
|
24
39
|
* Parameters for creating a {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
25
40
|
* @public
|
|
@@ -44,6 +59,10 @@ export interface IResourceResolverCreateParams {
|
|
|
44
59
|
* An optional listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
|
|
45
60
|
*/
|
|
46
61
|
listener?: IResourceResolverCacheListener;
|
|
62
|
+
/**
|
|
63
|
+
* Optional configuration options for the {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
64
|
+
*/
|
|
65
|
+
options?: IResourceResolverOptions;
|
|
47
66
|
}
|
|
48
67
|
/**
|
|
49
68
|
* High-performance runtime resource resolver with O(1) condition caching.
|
|
@@ -51,7 +70,7 @@ export interface IResourceResolverCreateParams {
|
|
|
51
70
|
* and caching results for optimal performance.
|
|
52
71
|
* @public
|
|
53
72
|
*/
|
|
54
|
-
export declare class ResourceResolver {
|
|
73
|
+
export declare class ResourceResolver implements IResourceResolver {
|
|
55
74
|
/**
|
|
56
75
|
* The resource manager that defines available resources and provides condition access.
|
|
57
76
|
*/
|
|
@@ -64,6 +83,14 @@ export declare class ResourceResolver {
|
|
|
64
83
|
* The context qualifier provider that resolves qualifier values.
|
|
65
84
|
*/
|
|
66
85
|
readonly contextQualifierProvider: IContextQualifierProvider;
|
|
86
|
+
/**
|
|
87
|
+
* The configuration options for this resource resolver.
|
|
88
|
+
*/
|
|
89
|
+
readonly options: IResourceResolverOptions;
|
|
90
|
+
/**
|
|
91
|
+
* The readonly qualifier collector that provides qualifier implementations.
|
|
92
|
+
*/
|
|
93
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
67
94
|
/**
|
|
68
95
|
* The cache array for resolved conditions, indexed by condition index for O(1) lookup.
|
|
69
96
|
* Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
|
|
@@ -148,6 +175,15 @@ export declare class ResourceResolver {
|
|
|
148
175
|
* @public
|
|
149
176
|
*/
|
|
150
177
|
resolveResource(resource: IResource): Result<IResourceCandidate>;
|
|
178
|
+
/**
|
|
179
|
+
* Resolves a resource by finding the best matching candidate.
|
|
180
|
+
* Uses the resource's associated decision to determine the best match based on the current context.
|
|
181
|
+
* @param resource - The string id of the resource to resolve.
|
|
182
|
+
* @returns `Success` with the best matching candidate if successful,
|
|
183
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
184
|
+
* @public
|
|
185
|
+
*/
|
|
186
|
+
resolveResource(resource: string): Result<IResourceCandidate>;
|
|
151
187
|
/**
|
|
152
188
|
* Resolves all matching resource candidates in priority order.
|
|
153
189
|
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
@@ -157,6 +193,15 @@ export declare class ResourceResolver {
|
|
|
157
193
|
* @public
|
|
158
194
|
*/
|
|
159
195
|
resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;
|
|
196
|
+
/**
|
|
197
|
+
* Resolves all matching resource candidates in priority order.
|
|
198
|
+
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
199
|
+
* @param resource - The string id of the resource to resolve.
|
|
200
|
+
* @returns `Success` with an array of all matching candidates in priority order if successful,
|
|
201
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
resolveAllResourceCandidates(resource: string): Result<ReadonlyArray<IResourceCandidate>>;
|
|
160
205
|
/**
|
|
161
206
|
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
162
207
|
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
@@ -167,6 +212,20 @@ export declare class ResourceResolver {
|
|
|
167
212
|
* @public
|
|
168
213
|
*/
|
|
169
214
|
resolveComposedResourceValue(resource: IResource): Result<JsonValue>;
|
|
215
|
+
/**
|
|
216
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
217
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
218
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
219
|
+
* @param resource - The string id of the resource to resolve.
|
|
220
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
221
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
222
|
+
* @public
|
|
223
|
+
*/
|
|
224
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
225
|
+
/**
|
|
226
|
+
* {@inheritDoc IResourceResolver.withContext}
|
|
227
|
+
*/
|
|
228
|
+
withContext(context: Record<string, string>): Result<ResourceResolver>;
|
|
170
229
|
/**
|
|
171
230
|
* Clears all caches (condition, condition set, and decision), forcing all cached items
|
|
172
231
|
* to be re-evaluated on next access. This should be called when the context changes and cached
|