@fgv/ts-res 4.5.0-3 → 5.0.0-2
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/CHANGELOG.json +26 -0
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +186 -0
- package/EXAMPLE_INIT_PARAMS.md +88 -0
- package/PROGRESS_SUMMARY.md +48 -0
- package/README.md +535 -14
- package/dist/ts-res.d.ts +4241 -318
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/packlets/common/conditions.d.ts +30 -0
- package/lib/packlets/common/conditions.d.ts.map +1 -1
- package/lib/packlets/common/conditions.js.map +1 -1
- package/lib/packlets/common/convert.d.ts +22 -2
- package/lib/packlets/common/convert.d.ts.map +1 -1
- package/lib/packlets/common/convert.js +21 -1
- package/lib/packlets/common/convert.js.map +1 -1
- package/lib/packlets/common/helpers/context.d.ts +39 -0
- package/lib/packlets/common/helpers/context.d.ts.map +1 -0
- package/lib/packlets/common/helpers/context.js +108 -0
- package/lib/packlets/common/helpers/context.js.map +1 -0
- package/lib/packlets/common/helpers/index.d.ts +2 -0
- package/lib/packlets/common/helpers/index.d.ts.map +1 -1
- package/lib/packlets/common/helpers/index.js +2 -0
- package/lib/packlets/common/helpers/index.js.map +1 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts +39 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.js +105 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
- package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
- package/lib/packlets/common/helpers/resources.js +6 -2
- package/lib/packlets/common/helpers/resources.js.map +1 -1
- package/lib/packlets/common/validate/conditions.d.ts +69 -1
- package/lib/packlets/common/validate/conditions.d.ts.map +1 -1
- package/lib/packlets/common/validate/conditions.js +126 -0
- package/lib/packlets/common/validate/conditions.js.map +1 -1
- package/lib/packlets/common/validate/regularExpressions.d.ts +20 -0
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -1
- package/lib/packlets/common/validate/regularExpressions.js +21 -1
- package/lib/packlets/common/validate/regularExpressions.js.map +1 -1
- package/lib/packlets/conditions/condition.d.ts +37 -0
- package/lib/packlets/conditions/condition.d.ts.map +1 -1
- package/lib/packlets/conditions/condition.js +67 -1
- package/lib/packlets/conditions/condition.js.map +1 -1
- package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionCollector.js +1 -0
- package/lib/packlets/conditions/conditionCollector.js.map +1 -1
- package/lib/packlets/conditions/conditionSet.d.ts +34 -3
- package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionSet.js +31 -3
- package/lib/packlets/conditions/conditionSet.js.map +1 -1
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionSetCollector.js +3 -0
- package/lib/packlets/conditions/conditionSetCollector.js.map +1 -1
- package/lib/packlets/conditions/conditionToken.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionToken.js +2 -1
- package/lib/packlets/conditions/conditionToken.js.map +1 -1
- package/lib/packlets/conditions/convert/decls.js +1 -1
- package/lib/packlets/conditions/convert/decls.js.map +1 -1
- 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 +96 -0
- package/lib/packlets/config/common.js.map +1 -0
- package/lib/packlets/config/convert.d.ts +14 -0
- package/lib/packlets/config/convert.d.ts.map +1 -0
- package/lib/packlets/config/convert.js +82 -0
- package/lib/packlets/config/convert.js.map +1 -0
- package/lib/packlets/config/index.d.ts +6 -0
- package/lib/packlets/config/index.d.ts.map +1 -0
- package/lib/packlets/config/index.js +67 -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 +81 -0
- package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
- package/lib/packlets/config/systemConfiguration.js +172 -0
- package/lib/packlets/config/systemConfiguration.js.map +1 -0
- package/lib/packlets/context/contextDecls.d.ts +49 -0
- package/lib/packlets/context/contextDecls.d.ts.map +1 -0
- package/lib/packlets/context/contextDecls.js +24 -0
- package/lib/packlets/context/contextDecls.js.map +1 -0
- package/lib/packlets/context/contextToken.d.ts +111 -0
- package/lib/packlets/context/contextToken.d.ts.map +1 -0
- package/lib/packlets/context/contextToken.js +206 -0
- package/lib/packlets/context/contextToken.js.map +1 -0
- package/lib/packlets/context/convert/decls.d.ts +37 -0
- package/lib/packlets/context/convert/decls.d.ts.map +1 -0
- package/lib/packlets/context/convert/decls.js +94 -0
- package/lib/packlets/context/convert/decls.js.map +1 -0
- package/lib/packlets/context/convert/index.d.ts +2 -0
- package/lib/packlets/context/convert/index.d.ts.map +1 -0
- package/lib/packlets/context/convert/index.js +39 -0
- package/lib/packlets/context/convert/index.js.map +1 -0
- package/lib/packlets/context/index.d.ts +5 -0
- package/lib/packlets/context/index.d.ts.map +1 -0
- package/lib/packlets/context/index.js +65 -0
- package/lib/packlets/context/index.js.map +1 -0
- package/lib/packlets/decisions/abstractDecision.d.ts +8 -0
- package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -1
- package/lib/packlets/decisions/abstractDecision.js +9 -0
- package/lib/packlets/decisions/abstractDecision.js.map +1 -1
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -1
- package/lib/packlets/decisions/abstractDecisionCollector.js +2 -0
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -1
- package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -1
- package/lib/packlets/decisions/concreteDecision.js +1 -0
- package/lib/packlets/decisions/concreteDecision.js.map +1 -1
- package/lib/packlets/decisions/decision.d.ts.map +1 -1
- package/lib/packlets/decisions/decision.js +4 -0
- package/lib/packlets/decisions/decision.js.map +1 -1
- package/lib/packlets/import/fsItem.d.ts.map +1 -1
- package/lib/packlets/import/fsItem.js +1 -0
- package/lib/packlets/import/fsItem.js.map +1 -1
- package/lib/packlets/import/importContext.d.ts +19 -0
- package/lib/packlets/import/importContext.d.ts.map +1 -1
- package/lib/packlets/import/importContext.js +39 -0
- package/lib/packlets/import/importContext.js.map +1 -1
- package/lib/packlets/import/importManager.d.ts +5 -5
- package/lib/packlets/import/importManager.d.ts.map +1 -1
- package/lib/packlets/import/importManager.js.map +1 -1
- package/lib/packlets/import/importers/collectionImporter.d.ts +11 -13
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/collectionImporter.js +29 -20
- package/lib/packlets/import/importers/collectionImporter.js.map +1 -1
- package/lib/packlets/import/importers/fsItemImporter.d.ts +2 -2
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/fsItemImporter.js +2 -2
- package/lib/packlets/import/importers/fsItemImporter.js.map +1 -1
- package/lib/packlets/import/importers/importer.d.ts +3 -3
- package/lib/packlets/import/importers/importer.d.ts.map +1 -1
- package/lib/packlets/import/importers/importer.js.map +1 -1
- package/lib/packlets/import/importers/jsonImporter.d.ts +2 -3
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/jsonImporter.js +10 -20
- package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
- package/lib/packlets/import/importers/pathImporter.d.ts +2 -2
- package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/pathImporter.js.map +1 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts +44 -0
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/convert.js +96 -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 +69 -0
- package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/json.js +24 -0
- package/lib/packlets/qualifier-types/config/json.js.map +1 -0
- package/lib/packlets/qualifier-types/convert.d.ts +10 -2
- package/lib/packlets/qualifier-types/convert.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/convert.js +15 -0
- package/lib/packlets/qualifier-types/convert.js.map +1 -1
- package/lib/packlets/qualifier-types/helpers.d.ts +27 -0
- package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/helpers.js +118 -0
- package/lib/packlets/qualifier-types/helpers.js.map +1 -0
- package/lib/packlets/qualifier-types/index.d.ts +4 -1
- package/lib/packlets/qualifier-types/index.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/index.js +5 -1
- package/lib/packlets/qualifier-types/index.js.map +1 -1
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts +19 -8
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/languageQualifierType.js +28 -9
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -1
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +42 -13
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/literalQualifierType.js +58 -10
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +114 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js +228 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.d.ts +33 -18
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/qualifierType.js +18 -4
- package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +4 -2
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js +2 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +47 -11
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.js +61 -17
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -1
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -1
- package/lib/packlets/qualifiers/convert/decls.js +17 -15
- package/lib/packlets/qualifiers/convert/decls.js.map +1 -1
- package/lib/packlets/qualifiers/index.d.ts +2 -0
- package/lib/packlets/qualifiers/index.d.ts.map +1 -1
- package/lib/packlets/qualifiers/index.js +2 -0
- package/lib/packlets/qualifiers/index.js.map +1 -1
- package/lib/packlets/qualifiers/qualifier.d.ts +22 -2
- package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -1
- package/lib/packlets/qualifiers/qualifier.js +26 -1
- package/lib/packlets/qualifiers/qualifier.js.map +1 -1
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
- package/lib/packlets/qualifiers/qualifierCollector.js +4 -0
- package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts +6 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -1
- package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts +32 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js +24 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts +96 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js +179 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
- package/lib/packlets/resource-json/compiled/common.d.ts +14 -0
- package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/common.js +24 -0
- package/lib/packlets/resource-json/compiled/common.js.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.d.ts +63 -0
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.js +167 -0
- package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
- package/lib/packlets/resource-json/compiled/index.d.ts +5 -0
- package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/index.js +65 -0
- package/lib/packlets/resource-json/compiled/index.js.map +1 -0
- package/lib/packlets/resource-json/compiled/json.d.ts +204 -0
- package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/json.js +3 -0
- package/lib/packlets/resource-json/compiled/json.js.map +1 -0
- package/lib/packlets/resource-json/convert.d.ts +16 -0
- package/lib/packlets/resource-json/convert.d.ts.map +1 -1
- package/lib/packlets/resource-json/convert.js +41 -6
- package/lib/packlets/resource-json/convert.js.map +1 -1
- package/lib/packlets/resource-json/helpers.d.ts +82 -3
- package/lib/packlets/resource-json/helpers.d.ts.map +1 -1
- package/lib/packlets/resource-json/helpers.js +185 -2
- package/lib/packlets/resource-json/helpers.js.map +1 -1
- package/lib/packlets/resource-json/index.d.ts +2 -1
- package/lib/packlets/resource-json/index.d.ts.map +1 -1
- package/lib/packlets/resource-json/index.js +3 -1
- package/lib/packlets/resource-json/index.js.map +1 -1
- package/lib/packlets/resource-json/json.d.ts +55 -3
- package/lib/packlets/resource-json/json.d.ts.map +1 -1
- package/lib/packlets/resource-json/json.js +16 -0
- package/lib/packlets/resource-json/json.js.map +1 -1
- package/lib/packlets/resource-json/normalized.d.ts +46 -3
- package/lib/packlets/resource-json/normalized.d.ts.map +1 -1
- package/lib/packlets/resource-json/normalized.js.map +1 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts +14 -10
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -1
- package/lib/packlets/resource-json/resourceDeclCollection.js +18 -14
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -1
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts +15 -2
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -1
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts +6 -2
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.js +12 -3
- package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -1
- 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 +36 -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 +9 -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 +13 -0
- package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
- package/lib/packlets/resource-types/helpers.js +44 -0
- package/lib/packlets/resource-types/helpers.js.map +1 -0
- package/lib/packlets/resource-types/index.d.ts +3 -0
- package/lib/packlets/resource-types/index.d.ts.map +1 -1
- package/lib/packlets/resource-types/index.js +26 -0
- package/lib/packlets/resource-types/index.js.map +1 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts +5 -13
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
- package/lib/packlets/resource-types/jsonResourceType.js +5 -2
- package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
- package/lib/packlets/resource-types/resourceType.d.ts +31 -30
- package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
- package/lib/packlets/resource-types/resourceType.js.map +1 -1
- package/lib/packlets/resources/candidateReducer.d.ts +98 -0
- package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
- package/lib/packlets/resources/candidateReducer.js +247 -0
- package/lib/packlets/resources/candidateReducer.js.map +1 -0
- package/lib/packlets/resources/common.d.ts +60 -0
- package/lib/packlets/resources/common.d.ts.map +1 -0
- package/lib/packlets/resources/common.js +24 -0
- package/lib/packlets/resources/common.js.map +1 -0
- package/lib/packlets/resources/index.d.ts +3 -1
- package/lib/packlets/resources/index.d.ts.map +1 -1
- package/lib/packlets/resources/index.js +3 -1
- package/lib/packlets/resources/index.js.map +1 -1
- package/lib/packlets/resources/resource.d.ts +57 -5
- package/lib/packlets/resources/resource.d.ts.map +1 -1
- package/lib/packlets/resources/resource.js +96 -6
- package/lib/packlets/resources/resource.js.map +1 -1
- package/lib/packlets/resources/resourceBuilder.d.ts +14 -0
- package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -1
- package/lib/packlets/resources/resourceBuilder.js +19 -1
- package/lib/packlets/resources/resourceBuilder.js.map +1 -1
- package/lib/packlets/resources/resourceCandidate.d.ts +42 -6
- package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
- package/lib/packlets/resources/resourceCandidate.js +40 -1
- package/lib/packlets/resources/resourceCandidate.js.map +1 -1
- package/lib/packlets/resources/resourceManagerBuilder.d.ts +220 -0
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceManagerBuilder.js +451 -0
- package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
- package/lib/packlets/runtime/cacheListener.d.ts +62 -0
- package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheListener.js +56 -0
- package/lib/packlets/runtime/cacheListener.js.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts +82 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.js +143 -0
- package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +167 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.js +466 -0
- package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts +70 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.js +135 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +80 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.js +33 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +165 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +179 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
- package/lib/packlets/runtime/context/index.d.ts +5 -0
- package/lib/packlets/runtime/context/index.d.ts.map +1 -0
- package/lib/packlets/runtime/context/index.js +42 -0
- package/lib/packlets/runtime/context/index.js.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +111 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +177 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +47 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +64 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/iResourceManager.d.ts +88 -0
- package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
- package/lib/packlets/runtime/iResourceManager.js +24 -0
- package/lib/packlets/runtime/iResourceManager.js.map +1 -0
- package/lib/packlets/runtime/index.d.ts +12 -0
- package/lib/packlets/runtime/index.d.ts.map +1 -0
- package/lib/packlets/runtime/index.js +73 -0
- package/lib/packlets/runtime/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts +91 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.js +24 -0
- package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.d.ts +5 -0
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.js +42 -0
- package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts +141 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js +224 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts +24 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +98 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +99 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +165 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
- package/lib/packlets/runtime/resourceResolver.d.ts +196 -0
- package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
- package/lib/packlets/runtime/resourceResolver.js +437 -0
- package/lib/packlets/runtime/resourceResolver.js.map +1 -0
- package/lib/packlets/runtime/validate.d.ts +13 -0
- package/lib/packlets/runtime/validate.d.ts.map +1 -0
- package/lib/packlets/runtime/validate.js +49 -0
- package/lib/packlets/runtime/validate.js.map +1 -0
- package/package.json +76 -75
- package/lib/packlets/resources/resourceManager.d.ts +0 -104
- package/lib/packlets/resources/resourceManager.d.ts.map +0 -1
- package/lib/packlets/resources/resourceManager.js +0 -201
- package/lib/packlets/resources/resourceManager.js.map +0 -1
|
@@ -0,0 +1,224 @@
|
|
|
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.ReadOnlyResourceTreeRoot = exports.ReadOnlyResourceTreeBranch = exports.ReadOnlyResourceTreeLeaf = void 0;
|
|
25
|
+
exports.isResourceTreeRootOrNodeInit = isResourceTreeRootOrNodeInit;
|
|
26
|
+
exports.isResourceTreeLeafInit = isResourceTreeLeafInit;
|
|
27
|
+
const ts_utils_1 = require("@fgv/ts-utils");
|
|
28
|
+
const common_1 = require("../../common");
|
|
29
|
+
const resourceTreeChildren_1 = require("./resourceTreeChildren");
|
|
30
|
+
// Type guards
|
|
31
|
+
/**
|
|
32
|
+
* Type guard to determine if an init object represents a branch or root with children.
|
|
33
|
+
* @param init - The initialization object to test
|
|
34
|
+
* @returns True if the init object has children property
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
function isResourceTreeRootOrNodeInit(init) {
|
|
38
|
+
return 'children' in init;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Type guard to determine if an init object represents a leaf node with a resource.
|
|
42
|
+
* @param init - The initialization object to test
|
|
43
|
+
* @returns True if the init object has a resource but no children
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
function isResourceTreeLeafInit(init) {
|
|
47
|
+
return 'resource' in init && !('children' in init);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Implementation of a read-only resource tree leaf node that contains a resource value.
|
|
51
|
+
* Leaf nodes represent the actual resources in the tree and cannot have children.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
class ReadOnlyResourceTreeLeaf {
|
|
55
|
+
get isRoot() {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
get isBranch() {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
get isLeaf() {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates a new leaf node. Use the static create method instead.
|
|
66
|
+
* @param name - The name of this node (last segment of the path)
|
|
67
|
+
* @param parentPath - The path to the parent node (undefined for root-level nodes)
|
|
68
|
+
* @param resource - The resource value stored in this leaf
|
|
69
|
+
*/
|
|
70
|
+
constructor(name, parentPath, resource) {
|
|
71
|
+
this.name = name;
|
|
72
|
+
this.id = common_1.Helpers.joinResourceIds(parentPath, name).orThrow();
|
|
73
|
+
this.resource = resource;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Creates a new ReadOnlyResourceTreeLeaf instance.
|
|
77
|
+
* @param name - The name of this node (last segment of the path)
|
|
78
|
+
* @param parentPath - The path to the parent node (undefined for root-level nodes)
|
|
79
|
+
* @param resource - The resource value to store in this leaf
|
|
80
|
+
* @returns Result containing the new leaf node or failure if construction fails
|
|
81
|
+
*/
|
|
82
|
+
static create(name, parentPath, resource) {
|
|
83
|
+
return (0, ts_utils_1.captureResult)(() => new ReadOnlyResourceTreeLeaf(name, parentPath, resource));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.ReadOnlyResourceTreeLeaf = ReadOnlyResourceTreeLeaf;
|
|
87
|
+
/**
|
|
88
|
+
* Implementation of a read-only resource tree branch node that contains child nodes.
|
|
89
|
+
* Branch nodes organize other nodes in a hierarchical structure and may optionally contain a resource value.
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
class ReadOnlyResourceTreeBranch {
|
|
93
|
+
get isRoot() {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
get isBranch() {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
get isLeaf() {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Creates a new branch node. Use the static create method instead.
|
|
104
|
+
* @param name - The name of this node (last segment of the path)
|
|
105
|
+
* @param parentPath - The path to the parent node (undefined for root-level nodes)
|
|
106
|
+
* @param init - Initialization data containing child nodes
|
|
107
|
+
*/
|
|
108
|
+
constructor(name, parentPath, init) {
|
|
109
|
+
this.name = name;
|
|
110
|
+
this.id = common_1.Helpers.joinResourceIds(parentPath, name).orThrow();
|
|
111
|
+
const children = (0, ts_utils_1.mapResults)(Array.from(Object.entries(init.children)).map(([childName, childInit]) => {
|
|
112
|
+
if (isResourceTreeLeafInit(childInit)) {
|
|
113
|
+
return ReadOnlyResourceTreeLeaf.create(childName, this.id, childInit.resource);
|
|
114
|
+
}
|
|
115
|
+
return ReadOnlyResourceTreeBranch.create(childName, this.id, childInit);
|
|
116
|
+
})).orThrow();
|
|
117
|
+
this.children = new resourceTreeChildren_1.ReadOnlyResourceTreeChildren(this.id, children.map((c) => [c.name, c]));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Creates a new ReadOnlyResourceTreeBranch instance.
|
|
121
|
+
* @param childName - The name of this node (last segment of the path)
|
|
122
|
+
* @param path - The path to the parent node (undefined for root-level nodes)
|
|
123
|
+
* @param childInit - Initialization data containing child nodes
|
|
124
|
+
* @returns Result containing the new branch node or failure if construction fails
|
|
125
|
+
*/
|
|
126
|
+
static create(childName, path, childInit) {
|
|
127
|
+
return (0, ts_utils_1.captureResult)(() => new ReadOnlyResourceTreeBranch(childName, path, childInit));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.ReadOnlyResourceTreeBranch = ReadOnlyResourceTreeBranch;
|
|
131
|
+
/**
|
|
132
|
+
* Implementation of a read-only resource tree root that organizes resources hierarchically.
|
|
133
|
+
* The root provides the entry point for tree navigation and resource access by ResourceId paths.
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
class ReadOnlyResourceTreeRoot {
|
|
137
|
+
get isRoot() {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
get isBranch() {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
get isLeaf() {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Creates a new root node. Use the static create method instead.
|
|
148
|
+
* @param init - Initialization data containing child nodes
|
|
149
|
+
*/
|
|
150
|
+
constructor(init) {
|
|
151
|
+
const children = (0, ts_utils_1.mapResults)(Array.from(Object.entries(init.children)).map(([childName, childInit]) => {
|
|
152
|
+
if (isResourceTreeLeafInit(childInit)) {
|
|
153
|
+
return ReadOnlyResourceTreeLeaf.create(childName, undefined, childInit.resource);
|
|
154
|
+
}
|
|
155
|
+
return ReadOnlyResourceTreeBranch.create(childName, undefined, childInit);
|
|
156
|
+
})).orThrow();
|
|
157
|
+
this.children = new resourceTreeChildren_1.ReadOnlyResourceTreeChildren(undefined, children.map((c) => [c.name, c]));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Creates a new ReadOnlyResourceTreeRoot from either resources or initialization data.
|
|
161
|
+
* @param init - Either an array of [ResourceId, resource] pairs or tree initialization structure
|
|
162
|
+
* @returns Result containing the new root or failure if construction fails
|
|
163
|
+
*/
|
|
164
|
+
static create(init) {
|
|
165
|
+
if (Array.isArray(init)) {
|
|
166
|
+
return ReadOnlyResourceTreeRoot.createResourceTreeInit(init).onSuccess((treeInit) => (0, ts_utils_1.captureResult)(() => new ReadOnlyResourceTreeRoot(treeInit)));
|
|
167
|
+
}
|
|
168
|
+
return (0, ts_utils_1.captureResult)(() => new ReadOnlyResourceTreeRoot(init));
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Converts an array of resources into tree initialization data.
|
|
172
|
+
* Validates that resource paths do not conflict - if a path has child resources,
|
|
173
|
+
* it cannot itself be a resource (e.g., if 'app.messages.welcome' exists, then 'app' cannot be a resource).
|
|
174
|
+
* @param resources - Array of [ResourceId, resource] pairs to convert
|
|
175
|
+
* @returns Result containing the initialization structure or failure if validation fails
|
|
176
|
+
*/
|
|
177
|
+
static createResourceTreeInit(resources) {
|
|
178
|
+
const errors = new ts_utils_1.MessageAggregator();
|
|
179
|
+
const root = { children: {} };
|
|
180
|
+
for (const [id, resource] of resources) {
|
|
181
|
+
common_1.Helpers.splitResourceId(id)
|
|
182
|
+
.onSuccess((pathComponents) => {
|
|
183
|
+
let currentNode = root;
|
|
184
|
+
const resourceName = pathComponents.pop();
|
|
185
|
+
for (const nodeName of pathComponents) {
|
|
186
|
+
if (isResourceTreeRootOrNodeInit(currentNode)) {
|
|
187
|
+
if (!(nodeName in currentNode.children)) {
|
|
188
|
+
currentNode.children[nodeName] = { children: {} };
|
|
189
|
+
}
|
|
190
|
+
if (isResourceTreeLeafInit(currentNode.children[nodeName])) {
|
|
191
|
+
errors.addMessage(`${id}: Expected a branch but found a leaf at ${nodeName}.`);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
currentNode = currentNode.children[nodeName];
|
|
195
|
+
}
|
|
196
|
+
} /* c8 ignore next 4 - defense in depth, not reachable without chicanery */
|
|
197
|
+
else if (isResourceTreeLeafInit(currentNode)) {
|
|
198
|
+
errors.addMessage(`${id}: Expected a branch but found a leaf.`);
|
|
199
|
+
break;
|
|
200
|
+
} /* c8 ignore next 3 - defense in depth, not reachable without chicanery */
|
|
201
|
+
else {
|
|
202
|
+
errors.addMessage(`${id}: Unexpected structure in resource tree`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (isResourceTreeRootOrNodeInit(currentNode)) {
|
|
206
|
+
if (resourceName in currentNode.children) {
|
|
207
|
+
errors.addMessage(`${id}: Duplicate resource at path.`);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
currentNode.children[resourceName] = { resource };
|
|
211
|
+
} /* c8 ignore next 3 - defense in depth, not reachable without chicanery */
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
errors.addMessage(`${id}: Expected a branch but found a leaf.`);
|
|
215
|
+
}
|
|
216
|
+
return (0, ts_utils_1.succeed)(currentNode.children[resourceName]);
|
|
217
|
+
})
|
|
218
|
+
.aggregateError(errors);
|
|
219
|
+
}
|
|
220
|
+
return errors.returnOrReport((0, ts_utils_1.succeed)(root));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
exports.ReadOnlyResourceTreeRoot = ReadOnlyResourceTreeRoot;
|
|
224
|
+
//# sourceMappingURL=readOnlyResourceTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readOnlyResourceTree.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/readOnlyResourceTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAkDH,oEAIC;AAQD,wDAEC;AA9DD,4CAA8F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,CAAC;oBAC9C,IAAI,YAAY,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;wBACzC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC;oBAC1D,CAAC;yBAAM,CAAC;wBACN,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;oBACpD,CAAC,CAAC,0EAA0E;gBAC9E,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,uCAAuC,CAAC,CAAC;gBAClE,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;YACrD,CAAC,CAAC;iBACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA1HD,4DA0HC","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 { MessageAggregator, Result, captureResult, mapResults, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName, Helpers } from '../../common';\nimport {\n IReadOnlyResourceTreeNode,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeRoot,\n IReadOnlyValidatingResourceTreeChildren\n} from './common';\nimport { ReadOnlyResourceTreeChildren } from './resourceTreeChildren';\n\n/**\n * Interface for initializing a resource tree root with child nodes.\n * @public\n */\nexport interface IResourceTreeRootInit<T> {\n readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;\n}\n\n/**\n * Interface for initializing a leaf node with a resource value.\n * @public\n */\nexport interface IResourceTreeLeafInit<T> {\n readonly resource: T;\n}\n\n/**\n * Interface for initializing a branch node with child nodes.\n * @public\n */\nexport interface IResourceTreeBranchInit<T> {\n readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;\n}\n\n/**\n * Union type for tree node initialization data.\n * @public\n */\nexport type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;\n\n// Type guards\n/**\n * Type guard to determine if an init object represents a branch or root with children.\n * @param init - The initialization object to test\n * @returns True if the init object has children property\n * @public\n */\nexport function isResourceTreeRootOrNodeInit<T>(\n init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>\n): init is IResourceTreeBranchInit<T> {\n return 'children' in init;\n}\n\n/**\n * Type guard to determine if an init object represents a leaf node with a resource.\n * @param init - The initialization object to test\n * @returns True if the init object has a resource but no children\n * @public\n */\nexport function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init is IResourceTreeLeafInit<T> {\n return 'resource' in init && !('children' in init);\n}\n\n/**\n * Implementation of a read-only resource tree leaf node that contains a resource value.\n * Leaf nodes represent the actual resources in the tree and cannot have children.\n * @public\n */\nexport class ReadOnlyResourceTreeLeaf<T> implements IReadOnlyResourceTreeLeaf<T> {\n public readonly name: ResourceName;\n public readonly id: ResourceId;\n public readonly resource: T;\n\n public get isRoot(): false {\n return false;\n }\n\n public get isBranch(): false {\n return false;\n }\n\n public get isLeaf(): true {\n return true;\n }\n\n /**\n * Creates a new leaf node. Use the static create method instead.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param resource - The resource value stored in this leaf\n */\n protected constructor(name: ResourceName, parentPath: ResourceId | undefined, resource: T) {\n this.name = name;\n this.id = Helpers.joinResourceIds(parentPath, name).orThrow();\n this.resource = resource;\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeLeaf instance.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param resource - The resource value to store in this leaf\n * @returns Result containing the new leaf node or failure if construction fails\n */\n public static create<T>(\n name: ResourceName,\n parentPath: ResourceId | undefined,\n resource: T\n ): Result<ReadOnlyResourceTreeLeaf<T>> {\n return captureResult(() => new ReadOnlyResourceTreeLeaf(name, parentPath, resource));\n }\n}\n\n/**\n * Implementation of a read-only resource tree branch node that contains child nodes.\n * Branch nodes organize other nodes in a hierarchical structure and may optionally contain a resource value.\n * @public\n */\nexport class ReadOnlyResourceTreeBranch<T> implements IReadOnlyResourceTreeBranch<T> {\n public readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n public readonly name: ResourceName;\n public readonly id: ResourceId;\n\n public get isRoot(): false {\n return false;\n }\n\n public get isBranch(): true {\n return true;\n }\n\n public get isLeaf(): false {\n return false;\n }\n\n /**\n * Creates a new branch node. Use the static create method instead.\n * @param name - The name of this node (last segment of the path)\n * @param parentPath - The path to the parent node (undefined for root-level nodes)\n * @param init - Initialization data containing child nodes\n */\n private constructor(\n name: ResourceName,\n parentPath: ResourceId | undefined,\n init: IResourceTreeBranchInit<T>\n ) {\n this.name = name;\n this.id = Helpers.joinResourceIds(parentPath, name).orThrow();\n\n const children = mapResults<IReadOnlyResourceTreeNode<T>>(\n (\n Array.from(Object.entries(init.children)) as [\n ResourceName,\n IResourceTreeBranchInit<T> | IResourceTreeLeafInit<T>\n ][]\n ).map(([childName, childInit]) => {\n if (isResourceTreeLeafInit(childInit)) {\n return ReadOnlyResourceTreeLeaf.create(childName, this.id, childInit.resource);\n }\n return ReadOnlyResourceTreeBranch.create(childName, this.id, childInit);\n })\n ).orThrow();\n\n this.children = new ReadOnlyResourceTreeChildren(\n this.id,\n children.map((c): [ResourceName, IReadOnlyResourceTreeNode<T>] => [c.name, c])\n );\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeBranch instance.\n * @param childName - The name of this node (last segment of the path)\n * @param path - The path to the parent node (undefined for root-level nodes)\n * @param childInit - Initialization data containing child nodes\n * @returns Result containing the new branch node or failure if construction fails\n */\n public static create<T>(\n childName: ResourceName,\n path: ResourceId | undefined,\n childInit: IResourceTreeBranchInit<T>\n ): Result<ReadOnlyResourceTreeBranch<T>> {\n return captureResult(() => new ReadOnlyResourceTreeBranch(childName, path, childInit));\n }\n}\n\n/**\n * Union type representing any node in a read-only resource tree.\n * @public\n */\nexport type ReadOnlyResourceTreeNode<T> = ReadOnlyResourceTreeBranch<T> | ReadOnlyResourceTreeLeaf<T>;\n\n/**\n * Implementation of a read-only resource tree root that organizes resources hierarchically.\n * The root provides the entry point for tree navigation and resource access by ResourceId paths.\n * @public\n */\nexport class ReadOnlyResourceTreeRoot<T> implements IReadOnlyResourceTreeRoot<T> {\n public readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n\n public get isRoot(): true {\n return true;\n }\n\n public get isBranch(): false {\n return false;\n }\n\n public get isLeaf(): false {\n return false;\n }\n\n /**\n * Creates a new root node. Use the static create method instead.\n * @param init - Initialization data containing child nodes\n */\n protected constructor(init: IResourceTreeRootInit<T>) {\n const children = mapResults<ReadOnlyResourceTreeBranch<T> | ReadOnlyResourceTreeLeaf<T>>(\n (\n Array.from(Object.entries(init.children)) as [\n ResourceName,\n IResourceTreeBranchInit<T> | IResourceTreeLeafInit<T>\n ][]\n ).map(([childName, childInit]) => {\n if (isResourceTreeLeafInit(childInit)) {\n return ReadOnlyResourceTreeLeaf.create(childName, undefined, childInit.resource);\n }\n return ReadOnlyResourceTreeBranch.create(childName, undefined, childInit);\n })\n ).orThrow();\n\n this.children = new ReadOnlyResourceTreeChildren(\n undefined,\n children.map((c): [ResourceName, IReadOnlyResourceTreeNode<T>] => [c.name, c])\n );\n }\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from an array of resources.\n * @param resources - Array of [ResourceId, resource] pairs to build the tree from\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(resources: [ResourceId, T][]): Result<ReadOnlyResourceTreeRoot<T>>;\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from initialization data.\n * @param init - Tree initialization structure\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(init: IResourceTreeRootInit<T>): Result<ReadOnlyResourceTreeRoot<T>>;\n\n /**\n * Creates a new ReadOnlyResourceTreeRoot from either resources or initialization data.\n * @param init - Either an array of [ResourceId, resource] pairs or tree initialization structure\n * @returns Result containing the new root or failure if construction fails\n */\n public static create<T>(\n init: IResourceTreeRootInit<T> | [ResourceId, T][]\n ): Result<ReadOnlyResourceTreeRoot<T>> {\n if (Array.isArray(init)) {\n return ReadOnlyResourceTreeRoot.createResourceTreeInit(init).onSuccess((treeInit) =>\n captureResult(() => new ReadOnlyResourceTreeRoot(treeInit))\n );\n }\n return captureResult(() => new ReadOnlyResourceTreeRoot(init));\n }\n\n /**\n * Converts an array of resources into tree initialization data.\n * Validates that resource paths do not conflict - if a path has child resources,\n * it cannot itself be a resource (e.g., if 'app.messages.welcome' exists, then 'app' cannot be a resource).\n * @param resources - Array of [ResourceId, resource] pairs to convert\n * @returns Result containing the initialization structure or failure if validation fails\n */\n public static createResourceTreeInit<T>(resources: [ResourceId, T][]): Result<IResourceTreeRootInit<T>> {\n const errors: MessageAggregator = new MessageAggregator();\n const root: IResourceTreeRootInit<T> = { children: {} };\n\n for (const [id, resource] of resources) {\n Helpers.splitResourceId(id)\n .onSuccess((pathComponents) => {\n let currentNode: IResourceTreeBranchInit<T> | IResourceTreeRootInit<T> = root;\n const resourceName = pathComponents.pop()!;\n\n for (const nodeName of pathComponents) {\n if (isResourceTreeRootOrNodeInit(currentNode)) {\n if (!(nodeName in currentNode.children)) {\n currentNode.children[nodeName] = { children: {} };\n }\n if (isResourceTreeLeafInit(currentNode.children[nodeName])) {\n errors.addMessage(`${id}: Expected a branch but found a leaf at ${nodeName}.`);\n } else {\n currentNode = currentNode.children[nodeName];\n }\n } /* c8 ignore next 4 - defense in depth, not reachable without chicanery */ else if (\n isResourceTreeLeafInit(currentNode)\n ) {\n errors.addMessage(`${id}: Expected a branch but found a leaf.`);\n break;\n } /* c8 ignore next 3 - defense in depth, not reachable without chicanery */ else {\n errors.addMessage(`${id}: Unexpected structure in resource tree`);\n }\n }\n\n if (isResourceTreeRootOrNodeInit(currentNode)) {\n if (resourceName in currentNode.children) {\n errors.addMessage(`${id}: Duplicate resource at path.`);\n } else {\n currentNode.children[resourceName] = { resource };\n } /* c8 ignore next 3 - defense in depth, not reachable without chicanery */\n } else {\n errors.addMessage(`${id}: Expected a branch but found a leaf.`);\n }\n return succeed(currentNode.children[resourceName]);\n })\n .aggregateError(errors);\n }\n return errors.returnOrReport(succeed(root));\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Result, ResultMap } from '@fgv/ts-utils';
|
|
2
|
+
import { ResourceId, ResourceName } from '../../common';
|
|
3
|
+
import { IReadOnlyResourceTreeBranch, IReadOnlyResourceTreeChildren, IReadOnlyResourceTreeLeaf, IReadOnlyResourceTreeNode, IReadOnlyValidatingResourceTreeChildren } from './common';
|
|
4
|
+
/**
|
|
5
|
+
* Implementation of a result-based resource tree that provides hierarchical access to resources.
|
|
6
|
+
* Extends ResultMap to provide collection-like access while adding tree-specific navigation methods.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare class ReadOnlyResourceTreeChildren<T> extends ResultMap<ResourceName, IReadOnlyResourceTreeNode<T>> implements IReadOnlyValidatingResourceTreeChildren<T> {
|
|
10
|
+
protected path: ResourceId | undefined;
|
|
11
|
+
validating: IReadOnlyResourceTreeChildren<T, string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new ReadOnlyResourceTreeChildren instance.
|
|
14
|
+
* @param path - The path to this tree node (undefined for root)
|
|
15
|
+
* @param entries - Array of [name, node] tuples to populate the tree
|
|
16
|
+
*/
|
|
17
|
+
constructor(path: ResourceId | undefined, entries: [ResourceName, IReadOnlyResourceTreeNode<T>][]);
|
|
18
|
+
getResource(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>>;
|
|
19
|
+
getBranch(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>>;
|
|
20
|
+
getById(id: ResourceId): Result<IReadOnlyResourceTreeNode<T>>;
|
|
21
|
+
getResourceById(id: ResourceId): Result<IReadOnlyResourceTreeLeaf<T>>;
|
|
22
|
+
getBranchById(id: ResourceId): Result<IReadOnlyResourceTreeBranch<T>>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=resourceTreeChildren.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceTreeChildren.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildren.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAe,MAAM,EAAE,SAAS,EAAiB,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAW,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,uCAAuC,EACxC,MAAM,UAAU,CAAC;AAGlB;;;;GAIG;AACH,qBAAa,4BAA4B,CAAC,CAAC,CACzC,SAAQ,SAAS,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAC5D,YAAW,uCAAuC,CAAC,CAAC,CAAC;IAErD,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpE;;;;OAIG;gBACgB,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC,EAAE;IAMjG,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAWrE,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAWnE,OAAO,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAqB7D,eAAe,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAarE,aAAa,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;CAY7E"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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.ReadOnlyResourceTreeChildren = void 0;
|
|
25
|
+
const ts_utils_1 = require("@fgv/ts-utils");
|
|
26
|
+
const common_1 = require("../../common");
|
|
27
|
+
const resourceTreeChildrenValidator_1 = require("./resourceTreeChildrenValidator");
|
|
28
|
+
/**
|
|
29
|
+
* Implementation of a result-based resource tree that provides hierarchical access to resources.
|
|
30
|
+
* Extends ResultMap to provide collection-like access while adding tree-specific navigation methods.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
class ReadOnlyResourceTreeChildren extends ts_utils_1.ResultMap {
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new ReadOnlyResourceTreeChildren instance.
|
|
36
|
+
* @param path - The path to this tree node (undefined for root)
|
|
37
|
+
* @param entries - Array of [name, node] tuples to populate the tree
|
|
38
|
+
*/
|
|
39
|
+
constructor(path, entries) {
|
|
40
|
+
super(entries);
|
|
41
|
+
this.path = path;
|
|
42
|
+
this.validating = new resourceTreeChildrenValidator_1.ResourceTreeChildrenValidator(this);
|
|
43
|
+
}
|
|
44
|
+
getResource(name) {
|
|
45
|
+
return this.get(name).onSuccess((node) => {
|
|
46
|
+
if (node.isLeaf) {
|
|
47
|
+
return (0, ts_utils_1.succeed)(node).withDetail('success');
|
|
48
|
+
}
|
|
49
|
+
return (0, ts_utils_1.fail)(`${name}: not a resource${this.path ? ` in ${this.path}` : ''}.`).withDetail('failure');
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
getBranch(name) {
|
|
53
|
+
return this.get(name).onSuccess((node) => {
|
|
54
|
+
if (node.isBranch) {
|
|
55
|
+
return (0, ts_utils_1.succeed)(node).withDetail('success');
|
|
56
|
+
}
|
|
57
|
+
return (0, ts_utils_1.fail)(`${name}: not a branch${this.path ? ` in ${this.path}` : ''}.`).withDetail('failure');
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
getById(id) {
|
|
61
|
+
return common_1.Helpers.splitResourceId(id).onSuccess((names) => {
|
|
62
|
+
let name = names.shift();
|
|
63
|
+
if (name !== undefined) {
|
|
64
|
+
let node = this.get(name).orDefault();
|
|
65
|
+
while (node) {
|
|
66
|
+
name = names.shift();
|
|
67
|
+
if (name === undefined) {
|
|
68
|
+
return (0, ts_utils_1.succeed)(node);
|
|
69
|
+
}
|
|
70
|
+
if (node.isLeaf) {
|
|
71
|
+
/* c8 ignore next 1 - defense in depth */
|
|
72
|
+
return (0, ts_utils_1.fail)(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);
|
|
73
|
+
}
|
|
74
|
+
node = node.children.get(name).orDefault();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return (0, ts_utils_1.fail)(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
getResourceById(id) {
|
|
81
|
+
return this.getById(id).onSuccess((node) => {
|
|
82
|
+
if (node.isLeaf) {
|
|
83
|
+
return (0, ts_utils_1.succeed)(node).withDetail('success');
|
|
84
|
+
}
|
|
85
|
+
return (0, ts_utils_1.fail)(`${id}: not a resource${this.path ? ` in ${this.path}` : ''}.`).withDetail('failure');
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
getBranchById(id) {
|
|
89
|
+
return this.getById(id).onSuccess((node) => {
|
|
90
|
+
if (node.isBranch) {
|
|
91
|
+
return (0, ts_utils_1.succeed)(node).withDetail('success');
|
|
92
|
+
}
|
|
93
|
+
return (0, ts_utils_1.fail)(`${id}: not a branch${this.path ? ` in ${this.path}` : ''}.`).withDetail('failure');
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.ReadOnlyResourceTreeChildren = ReadOnlyResourceTreeChildren;
|
|
98
|
+
//# sourceMappingURL=resourceTreeChildren.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceTreeChildren.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildren.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAA8E;AAC9E,yCAAiE;AAQjE,mFAAgF;AAEhF;;;;GAIG;AACH,MAAa,4BACX,SAAQ,oBAAqD;IAM7D;;;;OAIG;IACH,YAAmB,IAA4B,EAAE,OAAuD;QACtG,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,IAAI,6DAA6B,CAAI,IAAI,CAAC,CAAC;IAC/D,CAAC;IAEM,WAAW,CAAC,IAAkB;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YACvC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,UAAU,CAAoC,SAAS,CAAC,CAAC;YAChF,CAAC;YACD,OAAO,IAAA,eAAI,EACT,GAAG,IAAI,mBAAmB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CA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GAAG,CAC7D,CAAC,UAAU,CAAoC,SAAS,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtFD,oEAsFC","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 { Collections, Result, ResultMap, fail, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName, Helpers } from '../../common';\nimport {\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeChildren,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeNode,\n IReadOnlyValidatingResourceTreeChildren\n} from './common';\nimport { ResourceTreeChildrenValidator } from './resourceTreeChildrenValidator';\n\n/**\n * Implementation of a result-based resource tree that provides hierarchical access to resources.\n * Extends ResultMap to provide collection-like access while adding tree-specific navigation methods.\n * @public\n */\nexport class ReadOnlyResourceTreeChildren<T>\n extends ResultMap<ResourceName, IReadOnlyResourceTreeNode<T>>\n implements IReadOnlyValidatingResourceTreeChildren<T>\n{\n protected path: ResourceId | undefined;\n public validating: IReadOnlyResourceTreeChildren<T, string, string>;\n\n /**\n * Creates a new ReadOnlyResourceTreeChildren instance.\n * @param path - The path to this tree node (undefined for root)\n * @param entries - Array of [name, node] tuples to populate the tree\n */\n public constructor(path: ResourceId | undefined, entries: [ResourceName, IReadOnlyResourceTreeNode<T>][]) {\n super(entries);\n this.path = path;\n this.validating = new ResourceTreeChildrenValidator<T>(this);\n }\n\n public getResource(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>> {\n return this.get(name).onSuccess((node) => {\n if (node.isLeaf) {\n return succeed(node).withDetail<Collections.ResultMapResultDetail>('success');\n }\n return fail<IReadOnlyResourceTreeNode<T>>(\n `${name}: not a resource${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getBranch(name: ResourceName): Result<IReadOnlyResourceTreeNode<T>> {\n return this.get(name).onSuccess((node) => {\n if (node.isBranch) {\n return succeed(node).withDetail<Collections.ResultMapResultDetail>('success');\n }\n return fail<IReadOnlyResourceTreeNode<T>>(\n `${name}: not a branch${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getById(id: ResourceId): Result<IReadOnlyResourceTreeNode<T>> {\n return Helpers.splitResourceId(id).onSuccess((names) => {\n let name = names.shift();\n if (name !== undefined) {\n let node = this.get(name).orDefault();\n while (node) {\n name = names.shift();\n if (name === undefined) {\n return succeed(node);\n }\n if (node.isLeaf) {\n /* c8 ignore next 1 - defense in depth */\n return fail(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);\n }\n node = (node as IReadOnlyResourceTreeBranch<T>).children.get(name).orDefault();\n }\n }\n return fail(`${id}: resource not found${this.path ? ` in ${this.path}` : ''}.`);\n });\n }\n\n public getResourceById(id: ResourceId): Result<IReadOnlyResourceTreeLeaf<T>> {\n return this.getById(id).onSuccess((node) => {\n if (node.isLeaf) {\n return succeed(node as IReadOnlyResourceTreeLeaf<T>).withDetail<Collections.ResultMapResultDetail>(\n 'success'\n );\n }\n return fail<IReadOnlyResourceTreeLeaf<T>>(\n `${id}: not a resource${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n\n public getBranchById(id: ResourceId): Result<IReadOnlyResourceTreeBranch<T>> {\n return this.getById(id).onSuccess((node) => {\n if (node.isBranch) {\n return succeed(node as IReadOnlyResourceTreeBranch<T>).withDetail<Collections.ResultMapResultDetail>(\n 'success'\n );\n }\n return fail<IReadOnlyResourceTreeBranch<T>>(\n `${id}: not a branch${this.path ? ` in ${this.path}` : ''}.`\n ).withDetail<Collections.ResultMapResultDetail>('failure');\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Result, IReadOnlyResultMap, DetailedResult, Collections } from '@fgv/ts-utils';
|
|
2
|
+
import { ResourceName } from '../../common';
|
|
3
|
+
import { IReadOnlyResourceTreeBranch, IReadOnlyResourceTreeChildren, IReadOnlyResourceTreeLeaf, IReadOnlyResourceTreeNode } from './common';
|
|
4
|
+
/**
|
|
5
|
+
* A validator wrapper for resource tree children that validates string inputs before
|
|
6
|
+
* delegating to the underlying tree children collection.
|
|
7
|
+
*
|
|
8
|
+
* This class implements {@link Runtime.ResourceTree.IReadOnlyValidatingResourceTreeChildren | IReadOnlyValidatingResourceTreeChildren}
|
|
9
|
+
* by wrapping an {@link Runtime.ResourceTree.IReadOnlyResourceTreeChildren | IReadOnlyResourceTreeChildren} instance and
|
|
10
|
+
* providing string-based access to all tree operations. All string inputs are validated using the library's
|
|
11
|
+
* validation utilities before being passed to the underlying collection.
|
|
12
|
+
*
|
|
13
|
+
* The validator acts as a bridge between string-based external APIs and the
|
|
14
|
+
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
15
|
+
* error handling throughout the resource tree navigation.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {
|
|
20
|
+
private readonly _inner;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new validator wrapper for resource tree children.
|
|
23
|
+
* @param inner - The underlying resource tree children collection to wrap with validation
|
|
24
|
+
*/
|
|
25
|
+
constructor(inner: IReadOnlyResourceTreeChildren<T>);
|
|
26
|
+
/**
|
|
27
|
+
* Gets a tree node by its string ResourceId path, validating the input.
|
|
28
|
+
* @param id - The string ResourceId path to validate and look up
|
|
29
|
+
* @returns Result containing the node if found, or failure if validation fails or not found
|
|
30
|
+
*/
|
|
31
|
+
getById(id: string): Result<IReadOnlyResourceTreeNode<T>>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets a resource node by its string name (single component), validating the input.
|
|
34
|
+
* @param name - The string ResourceName to validate and look up
|
|
35
|
+
* @returns Result containing the node if it's a resource, or failure if validation fails or not found
|
|
36
|
+
*/
|
|
37
|
+
getResource(name: string): Result<IReadOnlyResourceTreeNode<T>>;
|
|
38
|
+
/**
|
|
39
|
+
* Gets a branch node by its string name (single component), validating the input.
|
|
40
|
+
* @param name - The string ResourceName to validate and look up
|
|
41
|
+
* @returns Result containing the node if it's a branch, or failure if validation fails or not found
|
|
42
|
+
*/
|
|
43
|
+
getBranch(name: string): Result<IReadOnlyResourceTreeNode<T>>;
|
|
44
|
+
/**
|
|
45
|
+
* Gets a resource leaf node by its string ResourceId path, validating the input.
|
|
46
|
+
* @param id - The string ResourceId path to validate and look up
|
|
47
|
+
* @returns Result containing the leaf if found and is a resource, or failure otherwise
|
|
48
|
+
*/
|
|
49
|
+
getResourceById(id: string): Result<IReadOnlyResourceTreeLeaf<T>>;
|
|
50
|
+
/**
|
|
51
|
+
* Gets a branch node by its string ResourceId path, validating the input.
|
|
52
|
+
* @param id - The string ResourceId path to validate and look up
|
|
53
|
+
* @returns Result containing the branch if found and has children, or failure otherwise
|
|
54
|
+
*/
|
|
55
|
+
getBranchById(id: string): Result<IReadOnlyResourceTreeBranch<T>>;
|
|
56
|
+
/**
|
|
57
|
+
* The number of direct child nodes in this collection.
|
|
58
|
+
*/
|
|
59
|
+
get size(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Returns an iterator of [ResourceName, node] pairs for all child nodes.
|
|
62
|
+
* @returns Map iterator for all child nodes
|
|
63
|
+
*/
|
|
64
|
+
entries(): IterableIterator<[ResourceName, IReadOnlyResourceTreeNode<T>]>;
|
|
65
|
+
/**
|
|
66
|
+
* Executes a callback function for each child node in the collection.
|
|
67
|
+
* @param cb - The callback function to execute for each child node
|
|
68
|
+
* @param arg - Optional argument to pass to the callback
|
|
69
|
+
*/
|
|
70
|
+
forEach(cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void, arg?: unknown): void;
|
|
71
|
+
/**
|
|
72
|
+
* Gets a child node by its ResourceName key with detailed error information.
|
|
73
|
+
* @param key - The ResourceName key to look up
|
|
74
|
+
* @returns DetailedResult containing the node if found, or failure with details
|
|
75
|
+
*/
|
|
76
|
+
get(key: ResourceName): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
|
|
77
|
+
/**
|
|
78
|
+
* Checks if a child node exists at the given ResourceName key.
|
|
79
|
+
* @param key - The ResourceName key to check
|
|
80
|
+
* @returns True if a child node exists at the key, false otherwise
|
|
81
|
+
*/
|
|
82
|
+
has(key: ResourceName): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Returns an iterator of ResourceName keys for all child nodes.
|
|
85
|
+
* @returns Map iterator for all child node keys
|
|
86
|
+
*/
|
|
87
|
+
keys(): IterableIterator<ResourceName>;
|
|
88
|
+
/**
|
|
89
|
+
* Returns an iterator of child node values.
|
|
90
|
+
* @returns Map iterator for all child node values
|
|
91
|
+
*/
|
|
92
|
+
values(): IterableIterator<IReadOnlyResourceTreeNode<T>>;
|
|
93
|
+
/**
|
|
94
|
+
* Returns an iterator for [ResourceName, node] pairs, enabling for...of iteration.
|
|
95
|
+
* @returns Iterable iterator for all child nodes
|
|
96
|
+
*/
|
|
97
|
+
[Symbol.iterator](): IterableIterator<[ResourceName, IReadOnlyResourceTreeNode<T>]>;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=resourceTreeChildrenValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceTreeChildrenValidator.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildrenValidator.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAkB,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;GAcG;AACH,qBAAa,6BAA6B,CAAC,CAAC,CAAE,YAAW,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC;IACvG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAE1D;;;OAGG;gBACgB,KAAK,EAAE,6BAA6B,CAAC,CAAC,CAAC;IAI1D;;;;OAIG;IACI,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAMhE;;;;OAIG;IACI,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAMtE;;;;OAIG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAMpE;;;;OAIG;IACI,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAMxE;;;;OAIG;IACI,aAAa,CAAC,EAA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