@fgv/ts-res 5.0.0-9 → 5.0.1-1
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 +21 -0
- package/CHANGELOG.md +14 -1
- package/README.md +794 -137
- package/dist/ts-res.d.ts +2257 -268
- package/dist/tsdoc-metadata.json +1 -1
- package/eslint.config.js +16 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/lib/packlets/bundle/bundleBuilder.js +7 -4
- package/lib/packlets/bundle/bundleLoader.js +1 -0
- package/lib/packlets/bundle/bundleUtils.js +14 -16
- package/lib/packlets/bundle/index.d.ts +3 -1
- package/lib/packlets/bundle/index.js +14 -3
- package/lib/packlets/common/convert.d.ts +15 -0
- package/lib/packlets/common/convert.js +16 -1
- package/lib/packlets/common/helpers/context.js +1 -0
- package/lib/packlets/common/helpers/resources.d.ts +7 -0
- package/lib/packlets/common/helpers/resources.js +13 -0
- package/lib/packlets/common/resources.d.ts +44 -1
- package/lib/packlets/common/validate/conditions.d.ts +17 -1
- package/lib/packlets/common/validate/conditions.js +32 -6
- 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 +55 -0
- package/lib/packlets/conditions/condition.js +1 -0
- package/lib/packlets/conditions/conditionSet.d.ts +9 -0
- package/lib/packlets/conditions/conditionSet.js +75 -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.d.ts +2 -1
- package/lib/packlets/import/fsItem.js +9 -13
- package/lib/packlets/import/importManager.d.ts +2 -1
- package/lib/packlets/import/importers/jsonImporter.js +1 -0
- package/lib/packlets/import/importers/pathImporter.d.ts +2 -1
- package/lib/packlets/import/importers/pathImporter.js +2 -1
- 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 +12 -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 +80 -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 +10 -1
- package/lib/packlets/resource-types/jsonResourceType.js +7 -3
- package/lib/packlets/resource-types/resourceType.d.ts +100 -8
- package/lib/packlets/resource-types/resourceType.js +39 -3
- package/lib/packlets/resources/candidateReducer.js +3 -0
- 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 +14 -0
- package/lib/packlets/resources/deltaGenerator.d.ts +189 -0
- package/lib/packlets/resources/deltaGenerator.js +344 -0
- package/lib/packlets/resources/index.d.ts +3 -0
- package/lib/packlets/resources/index.js +3 -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 +4 -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 +131 -10
- package/lib/packlets/resources/resourceManagerBuilder.js +289 -45
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +27 -11
- package/lib/packlets/runtime/compiledResourceCollection.js +71 -28
- package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
- package/lib/packlets/runtime/iResourceManager.d.ts +17 -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 +43 -1
- package/lib/packlets/runtime/resourceResolver.js +56 -28
- 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 +195 -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 +286 -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/bundle/bundleBuilder.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleBuilder.js.map +0 -1
- package/lib/packlets/bundle/bundleLoader.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleLoader.js.map +0 -1
- package/lib/packlets/bundle/bundleNormalizer.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleNormalizer.js.map +0 -1
- package/lib/packlets/bundle/bundleUtils.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleUtils.js.map +0 -1
- package/lib/packlets/bundle/convert.d.ts.map +0 -1
- package/lib/packlets/bundle/convert.js.map +0 -1
- package/lib/packlets/bundle/index.d.ts.map +0 -1
- package/lib/packlets/bundle/index.js.map +0 -1
- package/lib/packlets/bundle/model.d.ts.map +0 -1
- package/lib/packlets/bundle/model.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
package/dist/tsdoc-metadata.json
CHANGED
package/eslint.config.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// ESLint 9 flat config
|
|
2
|
+
const nodeProfile = require('@rushstack/eslint-config/flat/profile/node');
|
|
3
|
+
const packletsPlugin = require('@rushstack/eslint-config/flat/mixins/packlets');
|
|
4
|
+
const tsdocPlugin = require('@rushstack/eslint-config/flat/mixins/tsdoc');
|
|
5
|
+
|
|
6
|
+
module.exports = [
|
|
7
|
+
...nodeProfile,
|
|
8
|
+
packletsPlugin,
|
|
9
|
+
...tsdocPlugin,
|
|
10
|
+
{
|
|
11
|
+
// Override specific rules if needed
|
|
12
|
+
rules: {
|
|
13
|
+
'@rushstack/packlets/mechanics': 'warn'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
];
|
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import * as Resources from './packlets/resources';
|
|
|
10
10
|
import * as ResourceTypes from './packlets/resource-types';
|
|
11
11
|
import * as Import from './packlets/import';
|
|
12
12
|
import * as Runtime from './packlets/runtime';
|
|
13
|
+
import * as ZipArchive from './packlets/zip-archive';
|
|
13
14
|
export * from './packlets/common';
|
|
14
15
|
import { Condition, ConditionSet } from './packlets/conditions';
|
|
15
16
|
import { Decision } from './packlets/decisions';
|
|
@@ -19,5 +20,5 @@ import { ResourceType } from './packlets/resource-types';
|
|
|
19
20
|
import { Resource, ResourceCandidate, ResourceManagerBuilder } from './packlets/resources';
|
|
20
21
|
import { IResourceManager, ResourceResolver } from './packlets/runtime';
|
|
21
22
|
import { BundleBuilder, BundleLoader } from './packlets/bundle';
|
|
22
|
-
export { Bundle, BundleBuilder, BundleLoader, Condition, Conditions, ConditionSet, Config, Context, Decision, Decisions, Import, IResourceManager, Qualifier, QualifierType, QualifierTypes, Qualifiers, Resource, ResourceCandidate, ResourceJson, ResourceResolver, ResourceManagerBuilder, ResourceType, ResourceTypes, Resources, Runtime };
|
|
23
|
+
export { Bundle, BundleBuilder, BundleLoader, Condition, Conditions, ConditionSet, Config, Context, Decision, Decisions, Import, IResourceManager, Qualifier, QualifierType, QualifierTypes, Qualifiers, Resource, ResourceCandidate, ResourceJson, ResourceResolver, ResourceManagerBuilder, ResourceType, ResourceTypes, Resources, Runtime, ZipArchive };
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
57
57
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
58
58
|
};
|
|
59
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
exports.Runtime = exports.Resources = exports.ResourceTypes = exports.ResourceType = exports.ResourceManagerBuilder = exports.ResourceResolver = exports.ResourceJson = exports.ResourceCandidate = exports.Resource = exports.Qualifiers = exports.QualifierTypes = exports.QualifierType = exports.Qualifier = exports.Import = exports.Decisions = exports.Decision = exports.Context = exports.Config = exports.ConditionSet = exports.Conditions = exports.Condition = exports.BundleLoader = exports.BundleBuilder = exports.Bundle = void 0;
|
|
60
|
+
exports.ZipArchive = exports.Runtime = exports.Resources = exports.ResourceTypes = exports.ResourceType = exports.ResourceManagerBuilder = exports.ResourceResolver = exports.ResourceJson = exports.ResourceCandidate = exports.Resource = exports.Qualifiers = exports.QualifierTypes = exports.QualifierType = exports.Qualifier = exports.Import = exports.Decisions = exports.Decision = exports.Context = exports.Config = exports.ConditionSet = exports.Conditions = exports.Condition = exports.BundleLoader = exports.BundleBuilder = exports.Bundle = void 0;
|
|
61
61
|
const Bundle = __importStar(require("./packlets/bundle"));
|
|
62
62
|
exports.Bundle = Bundle;
|
|
63
63
|
const QualifierTypes = __importStar(require("./packlets/qualifier-types"));
|
|
@@ -82,6 +82,8 @@ const Import = __importStar(require("./packlets/import"));
|
|
|
82
82
|
exports.Import = Import;
|
|
83
83
|
const Runtime = __importStar(require("./packlets/runtime"));
|
|
84
84
|
exports.Runtime = Runtime;
|
|
85
|
+
const ZipArchive = __importStar(require("./packlets/zip-archive"));
|
|
86
|
+
exports.ZipArchive = ZipArchive;
|
|
85
87
|
__exportStar(require("./packlets/common"), exports);
|
|
86
88
|
const conditions_1 = require("./packlets/conditions");
|
|
87
89
|
Object.defineProperty(exports, "Condition", { enumerable: true, get: function () { return conditions_1.Condition; } });
|
|
@@ -42,18 +42,19 @@ class BundleBuilder {
|
|
|
42
42
|
*/
|
|
43
43
|
static create(builder, systemConfig, params) {
|
|
44
44
|
var _a;
|
|
45
|
-
/* c8 ignore next
|
|
45
|
+
/* c8 ignore next 2 - defense in depth */
|
|
46
46
|
params = params !== null && params !== void 0 ? params : {};
|
|
47
47
|
const hashNormalizer = (_a = params.hashNormalizer) !== null && _a !== void 0 ? _a : new ts_utils_1.Hash.Crc32Normalizer();
|
|
48
|
-
|
|
49
|
-
const builderToUse = params.normalize
|
|
48
|
+
const builderToUse = params.normalize === true
|
|
50
49
|
? bundleNormalizer_1.BundleNormalizer.normalize(builder, systemConfig)
|
|
51
|
-
:
|
|
50
|
+
: /* c8 ignore next 1 - is tested but coverage gets confused */
|
|
51
|
+
(0, ts_utils_1.succeed)(builder);
|
|
52
52
|
return builderToUse.onSuccess((targetBuilder) => {
|
|
53
53
|
return systemConfig.getConfig().onSuccess((config) => {
|
|
54
54
|
return targetBuilder.getCompiledResourceCollection().onSuccess((compiledCollection) => {
|
|
55
55
|
return BundleBuilder._generateChecksum(compiledCollection, hashNormalizer).onSuccess((checksum) => {
|
|
56
56
|
var _a;
|
|
57
|
+
/* c8 ignore next 1 - defense in depth */
|
|
57
58
|
const dateBuilt = (_a = params.dateBuilt) !== null && _a !== void 0 ? _a : new Date().toISOString();
|
|
58
59
|
const metadata = {
|
|
59
60
|
dateBuilt,
|
|
@@ -96,11 +97,13 @@ class BundleBuilder {
|
|
|
96
97
|
return targetBuilder.getCompiledResourceCollection().onSuccess((compiledCollection) => {
|
|
97
98
|
return BundleBuilder._generateChecksum(compiledCollection, hashNormalizer).onSuccess((checksum) => {
|
|
98
99
|
var _a;
|
|
100
|
+
/* c8 ignore next 1 - defense in depth */
|
|
99
101
|
const dateBuilt = (_a = params.dateBuilt) !== null && _a !== void 0 ? _a : new Date().toISOString();
|
|
100
102
|
const metadata = {
|
|
101
103
|
dateBuilt,
|
|
102
104
|
checksum,
|
|
103
105
|
version: params.version,
|
|
106
|
+
/* c8 ignore next 1 - defense in depth */
|
|
104
107
|
description: params === null || params === void 0 ? void 0 : params.description
|
|
105
108
|
};
|
|
106
109
|
const bundle = {
|
|
@@ -39,6 +39,7 @@ class BundleLoader {
|
|
|
39
39
|
*/
|
|
40
40
|
static createManagerFromBundle(params) {
|
|
41
41
|
var _a, _b;
|
|
42
|
+
/* c8 ignore next 1 - defense in depth */
|
|
42
43
|
const hashNormalizer = (_a = params.hashNormalizer) !== null && _a !== void 0 ? _a : new ts_utils_1.Hash.Crc32Normalizer();
|
|
43
44
|
return BundleLoader._verifyBundleIntegrity(params.bundle, (_b = params.skipChecksumVerification) !== null && _b !== void 0 ? _b : false, hashNormalizer).onSuccess(() => {
|
|
44
45
|
return BundleLoader._createSystemConfiguration(params.bundle).onSuccess((systemConfig) => {
|
|
@@ -49,22 +49,19 @@ class BundleUtils {
|
|
|
49
49
|
* @public
|
|
50
50
|
*/
|
|
51
51
|
static extractBundleComponents(bundleData) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
systemConfiguration,
|
|
66
|
-
compiledCollection: bundle.compiledCollection,
|
|
67
|
-
metadata: bundle.metadata
|
|
52
|
+
return convert_1.bundle
|
|
53
|
+
.convert(bundleData)
|
|
54
|
+
.withErrorFormat((err) => `Invalid bundle structure: ${err}`)
|
|
55
|
+
.onSuccess((bundle) => {
|
|
56
|
+
return config_1.SystemConfiguration.create(bundle.config)
|
|
57
|
+
.withErrorFormat((err) => `Invalid system configuration in bundle: ${err}`)
|
|
58
|
+
.onSuccess((systemConfiguration) => {
|
|
59
|
+
return (0, ts_utils_1.succeed)({
|
|
60
|
+
systemConfiguration,
|
|
61
|
+
compiledCollection: bundle.compiledCollection,
|
|
62
|
+
metadata: bundle.metadata
|
|
63
|
+
});
|
|
64
|
+
});
|
|
68
65
|
});
|
|
69
66
|
}
|
|
70
67
|
/**
|
|
@@ -97,6 +94,7 @@ class BundleUtils {
|
|
|
97
94
|
return BundleUtils.extractBundleComponents(data);
|
|
98
95
|
}
|
|
99
96
|
catch (error) {
|
|
97
|
+
/* c8 ignore next 1 - defense in depth */
|
|
100
98
|
return (0, ts_utils_1.fail)(`Failed to parse JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
101
99
|
}
|
|
102
100
|
}
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
+
import * as Model from './model';
|
|
11
|
+
import * as Convert from './convert';
|
|
10
12
|
export type { IBundleMetadata, IBundleExportMetadata, IBundle, IBundleCreateParams } from './model';
|
|
11
13
|
export { BundleBuilder } from './bundleBuilder';
|
|
12
14
|
export { BundleLoader } from './bundleLoader';
|
|
13
15
|
export type { IBundleLoaderCreateParams } from './bundleLoader';
|
|
14
16
|
export { BundleUtils } from './bundleUtils';
|
|
15
17
|
export type { IBundleComponents } from './bundleUtils';
|
|
16
|
-
export
|
|
18
|
+
export { Model, Convert };
|
|
17
19
|
/** @internal */
|
|
18
20
|
export { BundleNormalizer } from './bundleNormalizer';
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -54,7 +54,20 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
54
54
|
};
|
|
55
55
|
})();
|
|
56
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.BundleNormalizer = exports.Convert = exports.BundleUtils = exports.BundleLoader = exports.BundleBuilder = void 0;
|
|
57
|
+
exports.BundleNormalizer = exports.Convert = exports.Model = exports.BundleUtils = exports.BundleLoader = exports.BundleBuilder = void 0;
|
|
58
|
+
/**
|
|
59
|
+
* Bundle packlet providing functionality for creating and loading resource bundles.
|
|
60
|
+
*
|
|
61
|
+
* Resource bundles encapsulate compiled resources, configuration, and metadata with
|
|
62
|
+
* integrity verification. They provide a portable way to distribute pre-compiled
|
|
63
|
+
* resource collections.
|
|
64
|
+
*
|
|
65
|
+
* @packageDocumentation
|
|
66
|
+
*/
|
|
67
|
+
const Model = __importStar(require("./model"));
|
|
68
|
+
exports.Model = Model;
|
|
69
|
+
const Convert = __importStar(require("./convert"));
|
|
70
|
+
exports.Convert = Convert;
|
|
58
71
|
// Builder and loader classes
|
|
59
72
|
var bundleBuilder_1 = require("./bundleBuilder");
|
|
60
73
|
Object.defineProperty(exports, "BundleBuilder", { enumerable: true, get: function () { return bundleBuilder_1.BundleBuilder; } });
|
|
@@ -63,8 +76,6 @@ Object.defineProperty(exports, "BundleLoader", { enumerable: true, get: function
|
|
|
63
76
|
// Utilities
|
|
64
77
|
var bundleUtils_1 = require("./bundleUtils");
|
|
65
78
|
Object.defineProperty(exports, "BundleUtils", { enumerable: true, get: function () { return bundleUtils_1.BundleUtils; } });
|
|
66
|
-
// Converters
|
|
67
|
-
exports.Convert = __importStar(require("./convert"));
|
|
68
79
|
// Internal utilities (not part of public API)
|
|
69
80
|
/** @internal */
|
|
70
81
|
var bundleNormalizer_1 = require("./bundleNormalizer");
|
|
@@ -18,6 +18,11 @@ export declare const qualifierTypeName: import("@fgv/ts-utils").Converter<import
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare const qualifierTypeIndex: import("@fgv/ts-utils").Converter<import("./conditions").QualifierTypeIndex, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* `Converter` which validates an `unknown` value as a {@link QualifierContextValue | QualifierContextValue}.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare const qualifierContextValue: import("@fgv/ts-utils").Converter<import("./conditions").QualifierContextValue, unknown>;
|
|
21
26
|
/**
|
|
22
27
|
* `Converter` which validates an `unknown` value as a {@link QualifierConditionValue | QualifierConditionValue}.
|
|
23
28
|
* @public
|
|
@@ -103,6 +108,16 @@ export declare const resourceTypeName: import("@fgv/ts-utils").Converter<import(
|
|
|
103
108
|
* @public
|
|
104
109
|
*/
|
|
105
110
|
export declare const resourceTypeIndex: import("@fgv/ts-utils").Converter<import("./resources").ResourceTypeIndex, unknown>;
|
|
111
|
+
/**
|
|
112
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueKey | CandidateValueKey}.
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
export declare const candidateValueKey: import("@fgv/ts-utils").Converter<import("./resources").CandidateValueKey, unknown>;
|
|
116
|
+
/**
|
|
117
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueIndex | CandidateValueIndex}.
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
export declare const candidateValueIndex: import("@fgv/ts-utils").Converter<import("./resources").CandidateValueIndex, unknown>;
|
|
106
121
|
/**
|
|
107
122
|
* `Converter` for a resource value merge method.
|
|
108
123
|
* @public
|
|
@@ -54,7 +54,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
54
54
|
};
|
|
55
55
|
})();
|
|
56
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.qualifierDefaultValuesToken = exports.qualifierDefaultValueToken = exports.contextToken = exports.contextQualifierToken = exports.resourceValueMergeMethod = exports.resourceTypeIndex = exports.resourceTypeName = exports.resourceIndex = exports.resourceName = exports.resourceId = exports.decisionKey = exports.decisionIndex = exports.conditionSetHash = exports.conditionSetToken = exports.conditionSetKey = exports.conditionSetIndex = exports.conditionToken = exports.conditionKey = exports.conditionIndex = exports.conditionOperator = exports.conditionPriority = exports.qualifierMatchScore = exports.qualifierTypeIndex = exports.qualifierTypeName = exports.qualifierIndex = exports.qualifierName = void 0;
|
|
57
|
+
exports.qualifierDefaultValuesToken = exports.qualifierDefaultValueToken = exports.contextToken = exports.contextQualifierToken = exports.resourceValueMergeMethod = exports.candidateValueIndex = exports.candidateValueKey = exports.resourceTypeIndex = exports.resourceTypeName = exports.resourceIndex = exports.resourceName = exports.resourceId = exports.decisionKey = exports.decisionIndex = exports.conditionSetHash = exports.conditionSetToken = exports.conditionSetKey = exports.conditionSetIndex = exports.conditionToken = exports.conditionKey = exports.conditionIndex = exports.conditionOperator = exports.conditionPriority = exports.qualifierMatchScore = exports.qualifierContextValue = exports.qualifierTypeIndex = exports.qualifierTypeName = exports.qualifierIndex = exports.qualifierName = void 0;
|
|
58
58
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
59
59
|
const Validate = __importStar(require("./validate"));
|
|
60
60
|
const conditions_1 = require("./conditions");
|
|
@@ -80,6 +80,11 @@ exports.qualifierTypeName = ts_utils_1.Converters.string.map(Validate.toQualifie
|
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
82
|
exports.qualifierTypeIndex = ts_utils_1.Converters.number.map(Validate.toQualifierTypeIndex);
|
|
83
|
+
/**
|
|
84
|
+
* `Converter` which validates an `unknown` value as a {@link QualifierContextValue | QualifierContextValue}.
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
exports.qualifierContextValue = ts_utils_1.Converters.string.map(Validate.toQualifierContextValue);
|
|
83
88
|
/**
|
|
84
89
|
* `Converter` which validates an `unknown` value as a {@link QualifierConditionValue | QualifierConditionValue}.
|
|
85
90
|
* @public
|
|
@@ -165,6 +170,16 @@ exports.resourceTypeName = ts_utils_1.Converters.string.map(Validate.toResourceT
|
|
|
165
170
|
* @public
|
|
166
171
|
*/
|
|
167
172
|
exports.resourceTypeIndex = ts_utils_1.Converters.number.map(Validate.toResourceTypeIndex);
|
|
173
|
+
/**
|
|
174
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueKey | CandidateValueKey}.
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
exports.candidateValueKey = ts_utils_1.Converters.string.map(Validate.toCandidateValueKey);
|
|
178
|
+
/**
|
|
179
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueIndex | CandidateValueIndex}.
|
|
180
|
+
* @public
|
|
181
|
+
*/
|
|
182
|
+
exports.candidateValueIndex = ts_utils_1.Converters.number.map(Validate.toCandidateValueIndex);
|
|
168
183
|
/**
|
|
169
184
|
* `Converter` for a resource value merge method.
|
|
170
185
|
* @public
|
|
@@ -67,6 +67,7 @@ const Validate = __importStar(require("../validate"));
|
|
|
67
67
|
* @public
|
|
68
68
|
*/
|
|
69
69
|
function buildContextQualifierToken({ qualifier, value }) {
|
|
70
|
+
/* c8 ignore next 1 - edge case: ternary expression alternate branch rarely hit */
|
|
70
71
|
return Validate.toContextQualifierToken(qualifier ? `${qualifier}=${value}` : value);
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
@@ -31,4 +31,11 @@ export declare function joinResourceIds(...ids: (string | undefined)[]): Result<
|
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
33
|
export declare function joinOptionalResourceIds(...ids: (string | undefined)[]): Result<ResourceId | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the name for a resource ID.
|
|
36
|
+
* @param id - The resource ID to get the name for.
|
|
37
|
+
* @returns The resource name if found, or undefined if not.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
|
|
34
41
|
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -24,6 +24,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
24
24
|
exports.splitResourceId = splitResourceId;
|
|
25
25
|
exports.joinResourceIds = joinResourceIds;
|
|
26
26
|
exports.joinOptionalResourceIds = joinOptionalResourceIds;
|
|
27
|
+
exports.getNameForResourceId = getNameForResourceId;
|
|
27
28
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
28
29
|
const resources_1 = require("../validate/resources");
|
|
29
30
|
/**
|
|
@@ -35,6 +36,7 @@ const resources_1 = require("../validate/resources");
|
|
|
35
36
|
* @public
|
|
36
37
|
*/
|
|
37
38
|
function splitResourceId(id) {
|
|
39
|
+
/* c8 ignore next 3 - edge case: undefined resource ID should not occur in normal operation */
|
|
38
40
|
if (id === undefined) {
|
|
39
41
|
return (0, ts_utils_1.succeed)([]);
|
|
40
42
|
}
|
|
@@ -82,4 +84,15 @@ function joinOptionalResourceIds(...ids) {
|
|
|
82
84
|
const id = parts.join('.');
|
|
83
85
|
return errors.returnOrReport(id ? (0, resources_1.toResourceId)(id) : (0, ts_utils_1.succeed)(undefined));
|
|
84
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Gets the name for a resource ID.
|
|
89
|
+
* @param id - The resource ID to get the name for.
|
|
90
|
+
* @returns The resource name if found, or undefined if not.
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
function getNameForResourceId(id) {
|
|
94
|
+
return splitResourceId(id).onSuccess((parts) => {
|
|
95
|
+
return parts.length > 0 ? (0, ts_utils_1.succeed)(parts[parts.length - 1]) : fail('Empty id has no name');
|
|
96
|
+
});
|
|
97
|
+
}
|
|
85
98
|
//# sourceMappingURL=resources.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonValue } from '@fgv/ts-json-base';
|
|
2
|
+
import { Brand, Result } from '@fgv/ts-utils';
|
|
2
3
|
/**
|
|
3
4
|
* Branded string representing a validated resource id. A resource ID
|
|
4
5
|
* is a dot-separated sequence of resource names.
|
|
@@ -46,4 +47,46 @@ export declare const allResourceValueMergeMethods: ResourceValueMergeMethod[];
|
|
|
46
47
|
* @public
|
|
47
48
|
*/
|
|
48
49
|
export type CandidateCompleteness = 'full' | 'partial';
|
|
50
|
+
/**
|
|
51
|
+
* Branded number representing a validated candidate value index.
|
|
52
|
+
* Candidate value indices are used to identify candidate values
|
|
53
|
+
* within a resource set and to enable sharing of like values.
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export type CandidateValueIndex = Brand<number, 'CandidateValueIndex'>;
|
|
57
|
+
/**
|
|
58
|
+
* Branded string representing a validated candidate value key.
|
|
59
|
+
* Candidate value keys are used to identify candidate values
|
|
60
|
+
* within a resource set and to enable sharing of like values.
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export type CandidateValueKey = Brand<string, 'CandidateValueKey'>;
|
|
64
|
+
/**
|
|
65
|
+
* Minimal resource resolver
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export interface IResourceResolver {
|
|
69
|
+
/**
|
|
70
|
+
* The resource IDs that this resolver can resolve.
|
|
71
|
+
*/
|
|
72
|
+
readonly resourceIds: ReadonlyArray<ResourceId>;
|
|
73
|
+
/**
|
|
74
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
75
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
76
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
77
|
+
* @param resource - The string id of the resource to resolve.
|
|
78
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
79
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new {@link IResourceResolver | resource resolver} with the given context.
|
|
85
|
+
* @param context - The context to use for the new resource resolver.
|
|
86
|
+
* @returns `Success` with the new resource resolver if successful,
|
|
87
|
+
* or `Failure` with an error message if the context is invalid.
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
withContext(context: Record<string, string>): Result<IResourceResolver>;
|
|
91
|
+
}
|
|
49
92
|
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Result } from '@fgv/ts-utils';
|
|
2
|
-
import { ConditionPriority, QualifierName, QualifierTypeName, QualifierIndex, QualifierTypeIndex, ConditionIndex, ConditionSetIndex, QualifierMatchScore, ConditionKey, ConditionSetKey, DecisionKey, DecisionIndex, ConditionSetHash, ConditionOperator, ConditionToken, ConditionSetToken, ContextQualifierToken, ContextToken, QualifierDefaultValueToken, QualifierDefaultValuesToken } from '../conditions';
|
|
2
|
+
import { ConditionPriority, QualifierName, QualifierTypeName, QualifierIndex, QualifierTypeIndex, ConditionIndex, ConditionSetIndex, QualifierMatchScore, QualifierContextValue, ConditionKey, ConditionSetKey, DecisionKey, DecisionIndex, ConditionSetHash, ConditionOperator, ConditionToken, ConditionSetToken, ContextQualifierToken, ContextToken, QualifierDefaultValueToken, QualifierDefaultValuesToken } from '../conditions';
|
|
3
3
|
/**
|
|
4
4
|
* Determines whether a string is a valid qualifier name.
|
|
5
5
|
* @param name - the string to validate
|
|
@@ -117,6 +117,14 @@ export declare function isValidDecisionKey(key: string): key is DecisionKey;
|
|
|
117
117
|
* @public
|
|
118
118
|
*/
|
|
119
119
|
export declare function isValidDecisionIndex(index: number): index is DecisionIndex;
|
|
120
|
+
/**
|
|
121
|
+
* Determines whether a string is a valid qualifier context value.
|
|
122
|
+
* For now, any non-empty string is considered a valid context value.
|
|
123
|
+
* @param value - the string to validate
|
|
124
|
+
* @returns true if the string is a valid qualifier context value, false otherwise.
|
|
125
|
+
* @public
|
|
126
|
+
*/
|
|
127
|
+
export declare function isValidQualifierContextValue(value: string): value is QualifierContextValue;
|
|
120
128
|
/**
|
|
121
129
|
* Converts a string to a {@link QualifierName} if it is a valid qualifier name.
|
|
122
130
|
* @param name - the string to convert
|
|
@@ -125,6 +133,14 @@ export declare function isValidDecisionIndex(index: number): index is DecisionIn
|
|
|
125
133
|
* @public
|
|
126
134
|
*/
|
|
127
135
|
export declare function toQualifierName(name: string): Result<QualifierName>;
|
|
136
|
+
/**
|
|
137
|
+
* Converts a string to a {@link QualifierContextValue} if it is a valid qualifier context value.
|
|
138
|
+
* @param value - the string to convert
|
|
139
|
+
* @returns `Success` with the converted {@link QualifierContextValue} if successful, or `Failure` with an
|
|
140
|
+
* error message if not.
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
export declare function toQualifierContextValue(value: string): Result<QualifierContextValue>;
|
|
128
144
|
/**
|
|
129
145
|
* Converts a number to a {@link QualifierIndex} if it is a valid qualifier index.
|
|
130
146
|
* @param index - the number to convert
|
|
@@ -37,7 +37,9 @@ exports.isValidConditionSetToken = isValidConditionSetToken;
|
|
|
37
37
|
exports.isValidConditionSetHash = isValidConditionSetHash;
|
|
38
38
|
exports.isValidDecisionKey = isValidDecisionKey;
|
|
39
39
|
exports.isValidDecisionIndex = isValidDecisionIndex;
|
|
40
|
+
exports.isValidQualifierContextValue = isValidQualifierContextValue;
|
|
40
41
|
exports.toQualifierName = toQualifierName;
|
|
42
|
+
exports.toQualifierContextValue = toQualifierContextValue;
|
|
41
43
|
exports.toQualifierIndex = toQualifierIndex;
|
|
42
44
|
exports.toQualifierTypeName = toQualifierTypeName;
|
|
43
45
|
exports.toQualifierTypeIndex = toQualifierTypeIndex;
|
|
@@ -182,6 +184,7 @@ function isValidConditionSetKey(key) {
|
|
|
182
184
|
if (key === '') {
|
|
183
185
|
return true;
|
|
184
186
|
}
|
|
187
|
+
/* c8 ignore next 2 - edge case: condition set key validation rarely fails */
|
|
185
188
|
// a condition set key is a `+` separated list of condition keys
|
|
186
189
|
return key.split('+').every(isValidConditionKey);
|
|
187
190
|
}
|
|
@@ -224,6 +227,16 @@ function isValidDecisionKey(key) {
|
|
|
224
227
|
function isValidDecisionIndex(index) {
|
|
225
228
|
return index >= 0;
|
|
226
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Determines whether a string is a valid qualifier context value.
|
|
232
|
+
* For now, any non-empty string is considered a valid context value.
|
|
233
|
+
* @param value - the string to validate
|
|
234
|
+
* @returns true if the string is a valid qualifier context value, false otherwise.
|
|
235
|
+
* @public
|
|
236
|
+
*/
|
|
237
|
+
function isValidQualifierContextValue(value) {
|
|
238
|
+
return typeof value === 'string' && value.length > 0;
|
|
239
|
+
}
|
|
227
240
|
/**
|
|
228
241
|
* Converts a string to a {@link QualifierName} if it is a valid qualifier name.
|
|
229
242
|
* @param name - the string to convert
|
|
@@ -234,10 +247,23 @@ function isValidDecisionIndex(index) {
|
|
|
234
247
|
function toQualifierName(name) {
|
|
235
248
|
/* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
|
|
236
249
|
if (!isValidQualifierName(name)) {
|
|
237
|
-
return (0, ts_utils_1.fail)(`${name}:
|
|
250
|
+
return (0, ts_utils_1.fail)(`${name}: invalid qualifier name`);
|
|
238
251
|
}
|
|
239
252
|
return (0, ts_utils_1.succeed)(name);
|
|
240
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Converts a string to a {@link QualifierContextValue} if it is a valid qualifier context value.
|
|
256
|
+
* @param value - the string to convert
|
|
257
|
+
* @returns `Success` with the converted {@link QualifierContextValue} if successful, or `Failure` with an
|
|
258
|
+
* error message if not.
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
function toQualifierContextValue(value) {
|
|
262
|
+
if (!isValidQualifierContextValue(value)) {
|
|
263
|
+
return (0, ts_utils_1.fail)(`${value}: invalid qualifier context value`);
|
|
264
|
+
}
|
|
265
|
+
return (0, ts_utils_1.succeed)(value);
|
|
266
|
+
}
|
|
241
267
|
/**
|
|
242
268
|
* Converts a number to a {@link QualifierIndex} if it is a valid qualifier index.
|
|
243
269
|
* @param index - the number to convert
|
|
@@ -248,7 +274,7 @@ function toQualifierName(name) {
|
|
|
248
274
|
function toQualifierIndex(index) {
|
|
249
275
|
/* c8 ignore next 3 - coverage is having a bad day */
|
|
250
276
|
if (!isValidQualifierIndex(index)) {
|
|
251
|
-
return (0, ts_utils_1.fail)(`${index}:
|
|
277
|
+
return (0, ts_utils_1.fail)(`${index}: invalid qualifier index`);
|
|
252
278
|
}
|
|
253
279
|
return (0, ts_utils_1.succeed)(index);
|
|
254
280
|
}
|
|
@@ -262,7 +288,7 @@ function toQualifierIndex(index) {
|
|
|
262
288
|
function toQualifierTypeName(name) {
|
|
263
289
|
/* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
|
|
264
290
|
if (!isValidQualifierTypeName(name)) {
|
|
265
|
-
return (0, ts_utils_1.fail)(`${name}:
|
|
291
|
+
return (0, ts_utils_1.fail)(`${name}: invalid qualifier type name`);
|
|
266
292
|
}
|
|
267
293
|
return (0, ts_utils_1.succeed)(name);
|
|
268
294
|
}
|
|
@@ -276,7 +302,7 @@ function toQualifierTypeName(name) {
|
|
|
276
302
|
function toQualifierTypeIndex(index) {
|
|
277
303
|
/* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
|
|
278
304
|
if (!isValidQualifierTypeIndex(index)) {
|
|
279
|
-
return (0, ts_utils_1.fail)(`${index}:
|
|
305
|
+
return (0, ts_utils_1.fail)(`${index}: invalid qualifier type index`);
|
|
280
306
|
}
|
|
281
307
|
return (0, ts_utils_1.succeed)(index);
|
|
282
308
|
}
|
|
@@ -541,7 +567,7 @@ function isValidQualifierDefaultValuesToken(token) {
|
|
|
541
567
|
function toQualifierDefaultValueToken(token) {
|
|
542
568
|
/* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
|
|
543
569
|
if (!isValidQualifierDefaultValueToken(token)) {
|
|
544
|
-
return (0, ts_utils_1.fail)(`${token}:
|
|
570
|
+
return (0, ts_utils_1.fail)(`${token}: invalid qualifier default value token`);
|
|
545
571
|
}
|
|
546
572
|
return (0, ts_utils_1.succeed)(token);
|
|
547
573
|
}
|
|
@@ -555,7 +581,7 @@ function toQualifierDefaultValueToken(token) {
|
|
|
555
581
|
function toQualifierDefaultValuesToken(token) {
|
|
556
582
|
/* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
|
|
557
583
|
if (!isValidQualifierDefaultValuesToken(token)) {
|
|
558
|
-
return (0, ts_utils_1.fail)(`${token}:
|
|
584
|
+
return (0, ts_utils_1.fail)(`${token}: invalid qualifier default values token`);
|
|
559
585
|
}
|
|
560
586
|
return (0, ts_utils_1.succeed)(token);
|
|
561
587
|
}
|
|
@@ -38,6 +38,10 @@ export declare const conditionSetHash: RegExp;
|
|
|
38
38
|
* @internal
|
|
39
39
|
*/
|
|
40
40
|
export declare const decisionKey: RegExp;
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare const candidateValueKey: RegExp;
|
|
41
45
|
/**
|
|
42
46
|
* A {@link QualifierDefaultValueToken | qualifier default value token} has the form
|
|
43
47
|
* `<qualifierName>=<value>` or `<qualifierName>=` (to remove default).
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.territoryCode = exports.qualifierDefaultValuesToken = exports.qualifierDefaultValueToken = exports.decisionKey = exports.conditionSetHash = exports.contextToken = exports.conditionToken = exports.conditionKey = exports.identifierList = exports.segmentedIdentifier = exports.identifier = void 0;
|
|
24
|
+
exports.territoryCode = exports.qualifierDefaultValuesToken = exports.qualifierDefaultValueToken = exports.candidateValueKey = exports.decisionKey = exports.conditionSetHash = exports.contextToken = exports.conditionToken = exports.conditionKey = exports.identifierList = exports.segmentedIdentifier = exports.identifier = void 0;
|
|
25
25
|
/**
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
@@ -62,6 +62,10 @@ exports.conditionSetHash = /^[a-zA-Z0-9]{8}$/;
|
|
|
62
62
|
* @internal
|
|
63
63
|
*/
|
|
64
64
|
exports.decisionKey = /^[a-zA-Z0-9]{8}(?:\+[a-zA-Z0-9]{8})*(?:\|[a-zA-Z0-9]{8})?$/;
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
exports.candidateValueKey = /^[a-zA-Z0-9]+$/;
|
|
65
69
|
/**
|
|
66
70
|
* A {@link QualifierDefaultValueToken | qualifier default value token} has the form
|
|
67
71
|
* `<qualifierName>=<value>` or `<qualifierName>=` (to remove default).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Result } from '@fgv/ts-utils';
|
|
2
|
-
import { ResourceId, ResourceIndex, ResourceName, ResourceTypeIndex, ResourceTypeName } from '../resources';
|
|
2
|
+
import { CandidateValueIndex, CandidateValueKey, ResourceId, ResourceIndex, ResourceName, ResourceTypeIndex, ResourceTypeName } from '../resources';
|
|
3
3
|
/**
|
|
4
4
|
* Checks if the given name is a valid resource name.
|
|
5
5
|
*
|
|
@@ -40,6 +40,22 @@ export declare function isValidResourceTypeName(name: string): name is ResourceT
|
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
42
|
export declare function isValidResourceTypeIndex(index: number): index is ResourceTypeIndex;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if the given index is a valid candidate value index.
|
|
45
|
+
*
|
|
46
|
+
* @param index - The index to validate.
|
|
47
|
+
* @returns `true` if the index is a valid candidate value index, otherwise `false`.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
export declare function isValidCandidateValueIndex(index: number): index is CandidateValueIndex;
|
|
51
|
+
/**
|
|
52
|
+
* Checks if the given key is a valid candidate value key.
|
|
53
|
+
*
|
|
54
|
+
* @param key - The key to validate.
|
|
55
|
+
* @returns `true` if the key is a valid candidate value key, otherwise `false`.
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export declare function isValidCandidateValueKey(key: string): key is CandidateValueKey;
|
|
43
59
|
/**
|
|
44
60
|
* Converts a string to a {@link ResourceName | resource name}.
|
|
45
61
|
*
|
|
@@ -94,4 +110,22 @@ export declare function toResourceTypeName(name: string): Result<ResourceTypeNam
|
|
|
94
110
|
* @public
|
|
95
111
|
*/
|
|
96
112
|
export declare function toResourceTypeIndex(index: number): Result<ResourceTypeIndex>;
|
|
113
|
+
/**
|
|
114
|
+
* Converts a string to a {@link CandidateValueKey | candidate value key}.
|
|
115
|
+
*
|
|
116
|
+
* @param key - The key to convert.
|
|
117
|
+
* @returns `Success` with the converted key if valid, or `Failure` with an error message
|
|
118
|
+
* if not.
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
export declare function toCandidateValueKey(key: string): Result<CandidateValueKey>;
|
|
122
|
+
/**
|
|
123
|
+
* Converts a number to a {@link CandidateValueIndex | candidate value index}.
|
|
124
|
+
*
|
|
125
|
+
* @param index - The number to convert.
|
|
126
|
+
* @returns `Success` with the converted index if valid, or `Failure` with an error message
|
|
127
|
+
* if not.
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
export declare function toCandidateValueIndex(index: number): Result<CandidateValueIndex>;
|
|
97
131
|
//# sourceMappingURL=resources.d.ts.map
|