@fgv/ts-res 5.0.0-8 → 5.0.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +21 -0
- package/CHANGELOG.md +14 -1
- package/README.md +794 -137
- package/dist/ts-res.d.ts +2533 -334
- package/dist/tsdoc-metadata.json +1 -1
- package/eslint.config.js +16 -0
- package/lib/index.d.ts +4 -1
- package/lib/index.js +8 -1
- package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
- package/lib/packlets/bundle/bundleBuilder.js +134 -0
- package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
- package/lib/packlets/bundle/bundleLoader.js +105 -0
- package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
- package/lib/packlets/bundle/bundleNormalizer.js +142 -0
- package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
- package/lib/packlets/bundle/bundleUtils.js +117 -0
- package/lib/packlets/bundle/convert.d.ts +33 -0
- package/lib/packlets/bundle/convert.js +78 -0
- package/lib/packlets/bundle/index.d.ts +21 -0
- package/lib/packlets/bundle/index.js +83 -0
- package/lib/packlets/bundle/model.d.ts +100 -0
- package/lib/packlets/bundle/model.js +24 -0
- package/lib/packlets/common/convert.d.ts +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 +40 -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/index.d.ts +2 -0
- package/lib/packlets/resources/index.js +2 -0
- package/lib/packlets/resources/resource.d.ts +6 -6
- package/lib/packlets/resources/resource.js +5 -10
- package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
- package/lib/packlets/resources/resourceBuilder.js +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 +142 -11
- package/lib/packlets/resources/resourceManagerBuilder.js +314 -45
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +23 -11
- package/lib/packlets/runtime/compiledResourceCollection.js +65 -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 +13 -5
- package/lib/packlets/runtime/index.d.ts +1 -0
- package/lib/packlets/runtime/index.js +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
- package/lib/packlets/runtime/resourceResolver.d.ts +39 -1
- package/lib/packlets/runtime/resourceResolver.js +50 -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/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
|
@@ -20,50 +20,16 @@
|
|
|
20
20
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
* SOFTWARE.
|
|
22
22
|
*/
|
|
23
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
-
}
|
|
29
|
-
Object.defineProperty(o, k2, desc);
|
|
30
|
-
}) : (function(o, m, k, k2) {
|
|
31
|
-
if (k2 === undefined) k2 = k;
|
|
32
|
-
o[k2] = m[k];
|
|
33
|
-
}));
|
|
34
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
-
}) : function(o, v) {
|
|
37
|
-
o["default"] = v;
|
|
38
|
-
});
|
|
39
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
-
var ownKeys = function(o) {
|
|
41
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
-
var ar = [];
|
|
43
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
-
return ar;
|
|
45
|
-
};
|
|
46
|
-
return ownKeys(o);
|
|
47
|
-
};
|
|
48
|
-
return function (mod) {
|
|
49
|
-
if (mod && mod.__esModule) return mod;
|
|
50
|
-
var result = {};
|
|
51
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
-
__setModuleDefault(result, mod);
|
|
53
|
-
return result;
|
|
54
|
-
};
|
|
55
|
-
})();
|
|
56
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
24
|
exports.SystemConfiguration = void 0;
|
|
58
25
|
exports.updateSystemConfigurationQualifierDefaultValues = updateSystemConfigurationQualifierDefaultValues;
|
|
59
26
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
60
|
-
const QualifierTypes = __importStar(require("../qualifier-types"));
|
|
61
|
-
const ResourceTypes = __importStar(require("../resource-types"));
|
|
62
27
|
const qualifier_types_1 = require("../qualifier-types");
|
|
63
28
|
const qualifiers_1 = require("../qualifiers");
|
|
64
29
|
const resource_types_1 = require("../resource-types");
|
|
65
30
|
const convert_1 = require("./convert");
|
|
66
31
|
const ts_json_base_1 = require("@fgv/ts-json-base");
|
|
32
|
+
const configInitFactory_1 = require("./configInitFactory");
|
|
67
33
|
/**
|
|
68
34
|
* Creates a copy of the provided {@link Config.Model.ISystemConfiguration | system configuration}
|
|
69
35
|
* with updated qualifier default values.
|
|
@@ -129,17 +95,20 @@ class SystemConfiguration {
|
|
|
129
95
|
* @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
|
|
130
96
|
* @public
|
|
131
97
|
*/
|
|
132
|
-
constructor(config) {
|
|
98
|
+
constructor(config, initParams) {
|
|
99
|
+
var _a, _b;
|
|
133
100
|
this._config = config;
|
|
101
|
+
const qualifierTypeFactory = (_a = initParams === null || initParams === void 0 ? void 0 : initParams.qualifierTypeFactory) !== null && _a !== void 0 ? _a : new configInitFactory_1.BuiltInQualifierTypeFactory();
|
|
102
|
+
const resourceTypeFactory = (_b = initParams === null || initParams === void 0 ? void 0 : initParams.resourceTypeFactory) !== null && _b !== void 0 ? _b : new configInitFactory_1.BuiltInResourceTypeFactory();
|
|
134
103
|
this.qualifierTypes = qualifier_types_1.QualifierTypeCollector.create({
|
|
135
|
-
qualifierTypes: (0, ts_utils_1.mapResults)(config.qualifierTypes.map(
|
|
104
|
+
qualifierTypes: (0, ts_utils_1.mapResults)(config.qualifierTypes.map((tc) => qualifierTypeFactory.create(tc))).orThrow()
|
|
136
105
|
}).orThrow();
|
|
137
106
|
this.qualifiers = qualifiers_1.QualifierCollector.create({
|
|
138
107
|
qualifierTypes: this.qualifierTypes,
|
|
139
108
|
qualifiers: config.qualifiers
|
|
140
109
|
}).orThrow();
|
|
141
110
|
this.resourceTypes = resource_types_1.ResourceTypeCollector.create({
|
|
142
|
-
resourceTypes: (0, ts_utils_1.mapResults)(config.resourceTypes.map(
|
|
111
|
+
resourceTypes: (0, ts_utils_1.mapResults)(config.resourceTypes.map((rt) => resourceTypeFactory.create(rt))).orThrow()
|
|
143
112
|
}).orThrow();
|
|
144
113
|
}
|
|
145
114
|
/**
|
|
@@ -153,9 +122,19 @@ class SystemConfiguration {
|
|
|
153
122
|
*/
|
|
154
123
|
static create(config, initParams) {
|
|
155
124
|
if (initParams === null || initParams === void 0 ? void 0 : initParams.qualifierDefaultValues) {
|
|
156
|
-
return updateSystemConfigurationQualifierDefaultValues(config, initParams.qualifierDefaultValues).onSuccess((updatedConfig) => (0, ts_utils_1.captureResult)(() => new SystemConfiguration(updatedConfig)));
|
|
125
|
+
return updateSystemConfigurationQualifierDefaultValues(config, initParams.qualifierDefaultValues).onSuccess((updatedConfig) => (0, ts_utils_1.captureResult)(() => new SystemConfiguration(updatedConfig, (0, ts_utils_1.omit)(initParams, ['qualifierDefaultValues']))));
|
|
157
126
|
}
|
|
158
|
-
return (0, ts_utils_1.captureResult)(() => new SystemConfiguration(config));
|
|
127
|
+
return (0, ts_utils_1.captureResult)(() => new SystemConfiguration(config, initParams));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Loads a {@link Config.SystemConfiguration | SystemConfiguration} from a file.
|
|
131
|
+
* @param path - The path to the file to load.
|
|
132
|
+
* @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
|
|
133
|
+
* if successful, `Failure` with an error message otherwise.
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
static loadFromFile(path, initParams) {
|
|
137
|
+
return ts_json_base_1.JsonFile.convertJsonFileSync(path, convert_1.systemConfiguration).onSuccess((config) => SystemConfiguration.create(config, initParams));
|
|
159
138
|
}
|
|
160
139
|
/**
|
|
161
140
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} that this
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DetailedResult,
|
|
1
|
+
import { DetailedResult, Result } from '@fgv/ts-utils';
|
|
2
|
+
import { FileTree } from '@fgv/ts-json-base';
|
|
2
3
|
import * as Conditions from '../conditions';
|
|
3
4
|
import { IReadOnlyQualifierCollector } from '../qualifiers';
|
|
4
5
|
import { ImportContext } from './importContext';
|
|
@@ -56,6 +56,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
56
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
57
|
exports.FsItem = void 0;
|
|
58
58
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
59
|
+
const ts_json_base_1 = require("@fgv/ts-json-base");
|
|
59
60
|
const common_1 = require("../common");
|
|
60
61
|
const Conditions = __importStar(require("../conditions"));
|
|
61
62
|
const importContext_1 = require("./importContext");
|
|
@@ -110,19 +111,14 @@ class FsItem {
|
|
|
110
111
|
* that should be silently ignored.
|
|
111
112
|
*/
|
|
112
113
|
static createForPath(importPath, qualifiers, tree) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
return tree
|
|
123
|
-
.getItem(importPath)
|
|
124
|
-
.withDetail('failed')
|
|
125
|
-
.onSuccess((item) => FsItem.createForItem(item, qualifiers));
|
|
114
|
+
return (0, ts_utils_1.useOrInitialize)(tree, () => ts_json_base_1.FileTree.forFilesystem())
|
|
115
|
+
.withDetail('failed', 'succeeded')
|
|
116
|
+
.onSuccess((tree) => {
|
|
117
|
+
return tree
|
|
118
|
+
.getItem(importPath)
|
|
119
|
+
.withDetail('failed')
|
|
120
|
+
.onSuccess((item) => FsItem.createForItem(item, qualifiers));
|
|
121
|
+
});
|
|
126
122
|
}
|
|
127
123
|
/**
|
|
128
124
|
* Tries to parse a base name into a base name and a set of conditions.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { FileTree } from '@fgv/ts-json-base';
|
|
2
3
|
import { ResourceManagerBuilder } from '../resources';
|
|
3
4
|
import { ImportContext } from './importContext';
|
|
4
5
|
import { IImportable } from './importable';
|
|
@@ -85,6 +85,7 @@ class JsonImporter {
|
|
|
85
85
|
*/
|
|
86
86
|
import(item, manager) {
|
|
87
87
|
var _a, _b;
|
|
88
|
+
/* c8 ignore next 1 - coverage intermittently misses the next line */
|
|
88
89
|
if (!(0, importable_1.isImportable)(item) || item.type !== 'json') {
|
|
89
90
|
/* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
|
|
90
91
|
const name = (_b = (_a = item.context) === null || _a === void 0 ? void 0 : _a.baseId) !== null && _b !== void 0 ? _b : 'unknown';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DetailedResult, Result
|
|
1
|
+
import { DetailedResult, Result } from '@fgv/ts-utils';
|
|
2
|
+
import { FileTree } from '@fgv/ts-json-base';
|
|
2
3
|
import { ResourceManagerBuilder } from '../../resources';
|
|
3
4
|
import { IImportable } from '../importable';
|
|
4
5
|
import { IImporter, ImporterResultDetail } from './importer';
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.PathImporter = void 0;
|
|
25
25
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
26
|
+
const ts_json_base_1 = require("@fgv/ts-json-base");
|
|
26
27
|
const fsItem_1 = require("../fsItem");
|
|
27
28
|
/**
|
|
28
29
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`
|
|
@@ -41,7 +42,7 @@ class PathImporter {
|
|
|
41
42
|
*/
|
|
42
43
|
this.types = ['path'];
|
|
43
44
|
this.qualifiers = params.qualifiers;
|
|
44
|
-
this.tree = (_a = params.tree) !== null && _a !== void 0 ? _a :
|
|
45
|
+
this.tree = (_a = params.tree) !== null && _a !== void 0 ? _a : ts_json_base_1.FileTree.forFilesystem().orThrow();
|
|
45
46
|
this.ignoreFileTypes = (_b = params.ignoreFileTypes) !== null && _b !== void 0 ? _b : [];
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Converter } from '@fgv/ts-utils';
|
|
1
2
|
import * as Model from './json';
|
|
3
|
+
import { Converters as JsonConverters } from '@fgv/ts-json-base';
|
|
2
4
|
/**
|
|
3
5
|
* A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
|
|
4
6
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
|
|
@@ -40,5 +42,24 @@ export declare const systemLiteralQualifierTypeConfig: import("@fgv/ts-utils").O
|
|
|
40
42
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
41
43
|
* @public
|
|
42
44
|
*/
|
|
43
|
-
export declare const systemQualifierTypeConfig:
|
|
45
|
+
export declare const systemQualifierTypeConfig: Converter<Model.ISystemQualifierTypeConfig, unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
48
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
49
|
+
* @param config - A `Converter` for the configuration object.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare function qualifierTypeConfig<T, TD = unknown>(config: Converter<T, TD>): Converter<Model.IQualifierTypeConfig<T>, TD>;
|
|
53
|
+
/**
|
|
54
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
55
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export declare const jsonQualifierTypeConfig: Converter<Model.IQualifierTypeConfig<import("@fgv/ts-json-base").JsonObject>, JsonConverters.IJsonConverterContext>;
|
|
59
|
+
/**
|
|
60
|
+
* A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
61
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export declare const anyQualifierTypeConfig: Converter<Model.IAnyQualifierTypeConfig, unknown>;
|
|
44
65
|
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -20,10 +20,46 @@
|
|
|
20
20
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
* SOFTWARE.
|
|
22
22
|
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
23
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.systemQualifierTypeConfig = exports.systemLiteralQualifierTypeConfig = exports.systemTerritoryQualifierTypeConfig = exports.systemLanguageQualifierTypeConfig = exports.literalQualifierTypeConfig = exports.territoryQualifierTypeConfig = exports.languageQualifierTypeConfig = void 0;
|
|
57
|
+
exports.anyQualifierTypeConfig = exports.jsonQualifierTypeConfig = exports.systemQualifierTypeConfig = exports.systemLiteralQualifierTypeConfig = exports.systemTerritoryQualifierTypeConfig = exports.systemLanguageQualifierTypeConfig = exports.literalQualifierTypeConfig = exports.territoryQualifierTypeConfig = exports.languageQualifierTypeConfig = void 0;
|
|
58
|
+
exports.qualifierTypeConfig = qualifierTypeConfig;
|
|
25
59
|
/* eslint-disable @rushstack/typedef-var */
|
|
26
60
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
61
|
+
const Common = __importStar(require("../../common"));
|
|
62
|
+
const ts_json_base_1 = require("@fgv/ts-json-base");
|
|
27
63
|
/**
|
|
28
64
|
* A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
|
|
29
65
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
|
|
@@ -40,7 +76,8 @@ exports.languageQualifierTypeConfig = ts_utils_1.Converters.strictObject({
|
|
|
40
76
|
exports.territoryQualifierTypeConfig = ts_utils_1.Converters.strictObject({
|
|
41
77
|
allowContextList: ts_utils_1.Converters.boolean,
|
|
42
78
|
acceptLowercase: ts_utils_1.Converters.boolean.optional(),
|
|
43
|
-
allowedTerritories: ts_utils_1.Converters.arrayOf(ts_utils_1.Converters.string).optional()
|
|
79
|
+
allowedTerritories: ts_utils_1.Converters.arrayOf(ts_utils_1.Converters.string).optional(),
|
|
80
|
+
hierarchy: ts_utils_1.Converters.recordOf(ts_utils_1.Converters.string).optional()
|
|
44
81
|
});
|
|
45
82
|
/**
|
|
46
83
|
* A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
|
|
@@ -93,4 +130,32 @@ exports.systemQualifierTypeConfig = ts_utils_1.Converters.discriminatedObject('s
|
|
|
93
130
|
territory: exports.systemTerritoryQualifierTypeConfig,
|
|
94
131
|
literal: exports.systemLiteralQualifierTypeConfig
|
|
95
132
|
});
|
|
133
|
+
/**
|
|
134
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
135
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
136
|
+
* @param config - A `Converter` for the configuration object.
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
function qualifierTypeConfig(config) {
|
|
140
|
+
return ts_utils_1.Converters.strictObject({
|
|
141
|
+
name: Common.Convert.qualifierTypeName,
|
|
142
|
+
systemType: Common.Convert.qualifierTypeName,
|
|
143
|
+
configuration: config.optional()
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
148
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
exports.jsonQualifierTypeConfig = qualifierTypeConfig(ts_json_base_1.Converters.jsonObject);
|
|
152
|
+
/**
|
|
153
|
+
* A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
154
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
exports.anyQualifierTypeConfig = ts_utils_1.Converters.oneOf([
|
|
158
|
+
exports.jsonQualifierTypeConfig,
|
|
159
|
+
exports.systemQualifierTypeConfig
|
|
160
|
+
]);
|
|
96
161
|
//# sourceMappingURL=convert.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JsonObject } from '@fgv/ts-json-base';
|
|
2
|
-
import { LiteralValueHierarchyDecl } from '../literalValueHierarchy';
|
|
3
2
|
/**
|
|
4
3
|
* Templated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.
|
|
5
4
|
* @public
|
|
@@ -16,6 +15,16 @@ export interface IQualifierTypeConfig<T = JsonObject> {
|
|
|
16
15
|
export interface ILanguageQualifierTypeConfig {
|
|
17
16
|
allowContextList?: boolean;
|
|
18
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Declares a hierarchy of literal values. The keys are the names of the values, and the
|
|
20
|
+
* values are the names of their parents.
|
|
21
|
+
* @remarks
|
|
22
|
+
* The hierarchy is defined as a tree, where each value can have multiple children but
|
|
23
|
+
* only one parent. The root of the tree has no parent. The hierarchy is used to
|
|
24
|
+
* determine the relationship between values when matching conditions and contexts.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;
|
|
19
28
|
/**
|
|
20
29
|
* Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
|
|
21
30
|
* @public
|
|
@@ -25,7 +34,7 @@ export interface ITerritoryQualifierTypeConfig {
|
|
|
25
34
|
acceptLowercase?: boolean;
|
|
26
35
|
allowedTerritories?: string[];
|
|
27
36
|
/**
|
|
28
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
37
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
29
38
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
30
39
|
*/
|
|
31
40
|
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
@@ -66,4 +75,17 @@ export interface ISystemLiteralQualifierTypeConfig extends IQualifierTypeConfig<
|
|
|
66
75
|
* @public
|
|
67
76
|
*/
|
|
68
77
|
export type ISystemQualifierTypeConfig = ISystemLanguageQualifierTypeConfig | ISystemTerritoryQualifierTypeConfig | ISystemLiteralQualifierTypeConfig;
|
|
78
|
+
/**
|
|
79
|
+
* A union of all qualifier type configurations.
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;
|
|
83
|
+
/**
|
|
84
|
+
* Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
|
|
85
|
+
* {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
|
|
86
|
+
* @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
|
|
87
|
+
* @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export declare function isSystemQualifierTypeConfig(config: IAnyQualifierTypeConfig): config is ISystemQualifierTypeConfig;
|
|
69
91
|
//# sourceMappingURL=json.d.ts.map
|
|
@@ -21,4 +21,15 @@
|
|
|
21
21
|
* SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.isSystemQualifierTypeConfig = isSystemQualifierTypeConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
|
|
27
|
+
* {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
|
|
28
|
+
* @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
|
|
29
|
+
* @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
function isSystemQualifierTypeConfig(config) {
|
|
33
|
+
return (config.systemType === 'language' || config.systemType === 'territory' || config.systemType === 'literal');
|
|
34
|
+
}
|
|
24
35
|
//# sourceMappingURL=json.js.map
|
|
@@ -16,7 +16,7 @@ export interface IQualifierTypeConvertContext {
|
|
|
16
16
|
* index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
|
-
export declare const qualifierType: Converter<QualifierType
|
|
19
|
+
export declare const qualifierType: Converter<QualifierType<import("@fgv/ts-json-base").JsonObject>, IQualifierTypeConvertContext>;
|
|
20
20
|
/**
|
|
21
21
|
* Gets a converter for {@link QualifierTypes.ILiteralValueHierarchyCreateParams | ILiteralValueHierarchyCreateParams}
|
|
22
22
|
* objects with values validated by a supplied value converter.
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { Result } from '@fgv/ts-utils';
|
|
2
2
|
import * as Config from './config';
|
|
3
3
|
import { QualifierType } from './qualifierType';
|
|
4
|
-
import {
|
|
4
|
+
import { LanguageQualifierType } from './languageQualifierType';
|
|
5
|
+
import { TerritoryQualifierType } from './territoryQualifierType';
|
|
6
|
+
import { LiteralQualifierType } from './literalQualifierType';
|
|
7
|
+
/**
|
|
8
|
+
* A discriminated union of all system qualifier types.
|
|
9
|
+
* This allows TypeScript to properly discriminate between specific qualifier type implementations
|
|
10
|
+
* and access their specific methods like getConfiguration().
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;
|
|
5
14
|
/**
|
|
6
15
|
* Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.
|
|
7
16
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
@@ -12,16 +21,16 @@ import { JsonObject } from '@fgv/ts-json-base';
|
|
|
12
21
|
* if successful, `Failure` with an error message otherwise.
|
|
13
22
|
* @public
|
|
14
23
|
*/
|
|
15
|
-
export declare function createQualifierTypeFromConfig(typeConfig: Config.
|
|
24
|
+
export declare function createQualifierTypeFromConfig(typeConfig: Config.IAnyQualifierTypeConfig): Result<QualifierType>;
|
|
16
25
|
/**
|
|
17
|
-
* Creates a {@link QualifierTypes.
|
|
26
|
+
* Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.
|
|
18
27
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
19
28
|
* and delegates to the appropriate type-specific createFromConfig method.
|
|
20
29
|
* @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}
|
|
21
30
|
* containing the name, systemType, and optional type-specific configuration.
|
|
22
|
-
* @returns `Success` with the new {@link QualifierTypes.
|
|
31
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
23
32
|
* if successful, `Failure` with an error message otherwise.
|
|
24
33
|
* @public
|
|
25
34
|
*/
|
|
26
|
-
export declare function createQualifierTypeFromSystemConfig(typeConfig: Config.ISystemQualifierTypeConfig): Result<
|
|
35
|
+
export declare function createQualifierTypeFromSystemConfig(typeConfig: Config.ISystemQualifierTypeConfig): Result<SystemQualifierType>;
|
|
27
36
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -93,12 +93,12 @@ function createQualifierTypeFromConfig(typeConfig) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
|
-
* Creates a {@link QualifierTypes.
|
|
96
|
+
* Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.
|
|
97
97
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
98
98
|
* and delegates to the appropriate type-specific createFromConfig method.
|
|
99
99
|
* @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}
|
|
100
100
|
* containing the name, systemType, and optional type-specific configuration.
|
|
101
|
-
* @returns `Success` with the new {@link QualifierTypes.
|
|
101
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
102
102
|
* if successful, `Failure` with an error message otherwise.
|
|
103
103
|
* @public
|
|
104
104
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Result } from '@fgv/ts-utils';
|
|
2
|
-
import { ConditionOperator, QualifierConditionValue, QualifierContextValue, QualifierMatchScore } from '../common';
|
|
2
|
+
import { ConditionOperator, QualifierConditionValue, QualifierContextValue, QualifierMatchScore, QualifierTypeName } from '../common';
|
|
3
3
|
import { IQualifierTypeCreateParams, QualifierType } from './qualifierType';
|
|
4
4
|
import * as Config from './config';
|
|
5
|
+
import { JsonCompatible } from '@fgv/ts-json-base';
|
|
5
6
|
/**
|
|
6
7
|
* Interface defining the parameters that can be used to create a new
|
|
7
8
|
* {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType}.
|
|
@@ -24,7 +25,11 @@ export interface ILanguageQualifierTypeCreateParams extends Partial<IQualifierTy
|
|
|
24
25
|
* Accepts a list of language tags in the context by default.
|
|
25
26
|
* @public
|
|
26
27
|
*/
|
|
27
|
-
export declare class LanguageQualifierType extends QualifierType {
|
|
28
|
+
export declare class LanguageQualifierType extends QualifierType<JsonCompatible<Config.ILanguageQualifierTypeConfig>> {
|
|
29
|
+
/**
|
|
30
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
31
|
+
*/
|
|
32
|
+
readonly systemTypeName: QualifierTypeName;
|
|
28
33
|
/**
|
|
29
34
|
* Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
|
|
30
35
|
* @param name - Optional name for the qualifier type. Defaults to 'language'.
|
|
@@ -54,6 +59,27 @@ export declare class LanguageQualifierType extends QualifierType {
|
|
|
54
59
|
* {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
|
|
55
60
|
*/
|
|
56
61
|
isValidConditionValue(value: string): value is QualifierConditionValue;
|
|
62
|
+
/**
|
|
63
|
+
* Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
64
|
+
* for this qualifier type.
|
|
65
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
66
|
+
*/
|
|
67
|
+
getConfiguration(): Result<Config.ISystemLanguageQualifierTypeConfig>;
|
|
68
|
+
/**
|
|
69
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
70
|
+
*/
|
|
71
|
+
getConfigurationJson(): Result<JsonCompatible<Config.ISystemLanguageQualifierTypeConfig>>;
|
|
72
|
+
/**
|
|
73
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
74
|
+
*/
|
|
75
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config.ISystemLanguageQualifierTypeConfig>>;
|
|
76
|
+
/**
|
|
77
|
+
* Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
78
|
+
* for this qualifier type.
|
|
79
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
80
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
81
|
+
*/
|
|
82
|
+
validateConfiguration(from: unknown): Result<Config.ISystemLanguageQualifierTypeConfig>;
|
|
57
83
|
/**
|
|
58
84
|
* Matches a single language condition against a single language context value using
|
|
59
85
|
* {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.
|
|
@@ -20,12 +20,46 @@
|
|
|
20
20
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
* SOFTWARE.
|
|
22
22
|
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
23
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
57
|
exports.LanguageQualifierType = void 0;
|
|
25
58
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
26
59
|
const ts_bcp47_1 = require("@fgv/ts-bcp47");
|
|
27
60
|
const common_1 = require("../common");
|
|
28
61
|
const qualifierType_1 = require("./qualifierType");
|
|
62
|
+
const Config = __importStar(require("./config"));
|
|
29
63
|
const ts_json_base_1 = require("@fgv/ts-json-base");
|
|
30
64
|
/**
|
|
31
65
|
* {@link QualifierTypes.QualifierType | Qualifier type} which matches BCP-47 language tags
|
|
@@ -48,6 +82,10 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
|
|
|
48
82
|
const validated = index ? { index: common_1.Convert.qualifierTypeIndex.convert(index).orThrow() } : {};
|
|
49
83
|
super(Object.assign({ name,
|
|
50
84
|
allowContextList }, validated));
|
|
85
|
+
/**
|
|
86
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
87
|
+
*/
|
|
88
|
+
this.systemTypeName = common_1.Convert.qualifierTypeName.convert('language').orThrow();
|
|
51
89
|
}
|
|
52
90
|
/**
|
|
53
91
|
* Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
|
|
@@ -84,6 +122,41 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
|
|
|
84
122
|
.onSuccess((tag) => (0, ts_utils_1.succeed)(tag.isValid))
|
|
85
123
|
.orDefault(false);
|
|
86
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
127
|
+
* for this qualifier type.
|
|
128
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
129
|
+
*/
|
|
130
|
+
getConfiguration() {
|
|
131
|
+
return this.getConfigurationJson().onSuccess((json) => Config.Convert.systemLanguageQualifierTypeConfig.convert(json));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
135
|
+
*/
|
|
136
|
+
getConfigurationJson() {
|
|
137
|
+
return (0, ts_utils_1.succeed)({
|
|
138
|
+
name: this.name,
|
|
139
|
+
systemType: 'language',
|
|
140
|
+
configuration: {
|
|
141
|
+
allowContextList: this.allowContextList
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
147
|
+
*/
|
|
148
|
+
validateConfigurationJson(from) {
|
|
149
|
+
return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
153
|
+
* for this qualifier type.
|
|
154
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
155
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
156
|
+
*/
|
|
157
|
+
validateConfiguration(from) {
|
|
158
|
+
return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);
|
|
159
|
+
}
|
|
87
160
|
/**
|
|
88
161
|
* Matches a single language condition against a single language context value using
|
|
89
162
|
* {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.
|