@fgv/ts-res 5.1.0-19 → 5.1.0-20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.js.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
- package/dist/packlets/bundle/bundleLoader.js.map +1 -0
- package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
- package/dist/packlets/bundle/bundleUtils.js.map +1 -0
- package/dist/packlets/bundle/convert.js.map +1 -0
- package/dist/packlets/bundle/index.js.map +1 -0
- package/dist/packlets/bundle/model.js.map +1 -0
- package/dist/packlets/common/conditions.js.map +1 -0
- package/dist/packlets/common/convert.js.map +1 -0
- package/dist/packlets/common/helpers/conditions.js.map +1 -0
- package/dist/packlets/common/helpers/context.js.map +1 -0
- package/dist/packlets/common/helpers/index.js.map +1 -0
- package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
- package/dist/packlets/common/helpers/resources.js.map +1 -0
- package/dist/packlets/common/index.js.map +1 -0
- package/dist/packlets/common/resources.js.map +1 -0
- package/dist/packlets/common/validate/conditions.js.map +1 -0
- package/dist/packlets/common/validate/index.js.map +1 -0
- package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
- package/dist/packlets/common/validate/resources.js.map +1 -0
- package/dist/packlets/conditions/condition.js.map +1 -0
- package/dist/packlets/conditions/conditionCollector.js.map +1 -0
- package/dist/packlets/conditions/conditionDecls.js.map +1 -0
- package/dist/packlets/conditions/conditionSet.js.map +1 -0
- package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
- package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
- package/dist/packlets/conditions/conditionToken.js.map +1 -0
- package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
- package/dist/packlets/conditions/convert/decls.js.map +1 -0
- package/dist/packlets/conditions/convert/index.js.map +1 -0
- package/dist/packlets/conditions/index.js.map +1 -0
- package/dist/packlets/config/common.js.map +1 -0
- package/dist/packlets/config/configInitFactory.js.map +1 -0
- package/dist/packlets/config/convert.js.map +1 -0
- package/dist/packlets/config/index.browser.js.map +1 -0
- package/dist/packlets/config/index.js.map +1 -0
- package/dist/packlets/config/json.js.map +1 -0
- package/dist/packlets/config/predefined/default.js.map +1 -0
- package/dist/packlets/config/predefined/extended.js.map +1 -0
- package/dist/packlets/config/predefined/index.js.map +1 -0
- package/dist/packlets/config/systemConfiguration.js.map +1 -0
- package/dist/packlets/context/contextDecls.js.map +1 -0
- package/dist/packlets/context/contextToken.js.map +1 -0
- package/dist/packlets/context/convert/decls.js.map +1 -0
- package/dist/packlets/context/convert/index.js.map +1 -0
- package/dist/packlets/context/index.js.map +1 -0
- package/dist/packlets/decisions/abstractDecision.js.map +1 -0
- package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
- package/dist/packlets/decisions/candidate.js.map +1 -0
- package/dist/packlets/decisions/common.js.map +1 -0
- package/dist/packlets/decisions/concreteDecision.js.map +1 -0
- package/dist/packlets/decisions/decision.js.map +1 -0
- package/dist/packlets/decisions/index.js.map +1 -0
- package/dist/packlets/import/fsItem.js.map +1 -0
- package/dist/packlets/import/importContext.js.map +1 -0
- package/dist/packlets/import/importManager.js.map +1 -0
- package/dist/packlets/import/importable.js.map +1 -0
- package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
- package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
- package/dist/packlets/import/importers/importer.js.map +1 -0
- package/dist/packlets/import/importers/index.browser.js.map +1 -0
- package/dist/packlets/import/importers/index.js.map +1 -0
- package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
- package/dist/packlets/import/importers/pathImporter.js.map +1 -0
- package/dist/packlets/import/index.browser.js.map +1 -0
- package/dist/packlets/import/index.js.map +1 -0
- package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
- package/dist/packlets/qualifier-types/config/index.js.map +1 -0
- package/dist/packlets/qualifier-types/config/json.js.map +1 -0
- package/dist/packlets/qualifier-types/convert.js.map +1 -0
- package/dist/packlets/qualifier-types/helpers.js.map +1 -0
- package/dist/packlets/qualifier-types/index.js.map +1 -0
- package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
- package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
- package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
- package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
- package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
- package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
- package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
- package/dist/packlets/qualifiers/convert/index.js.map +1 -0
- package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
- package/dist/packlets/qualifiers/index.js.map +1 -0
- package/dist/packlets/qualifiers/qualifier.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
- package/dist/packlets/resource-json/compiled/common.js.map +1 -0
- package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
- package/dist/packlets/resource-json/compiled/index.js.map +1 -0
- package/dist/packlets/resource-json/compiled/json.js.map +1 -0
- package/dist/packlets/resource-json/convert.js.map +1 -0
- package/dist/packlets/resource-json/helpers.js.map +1 -0
- package/dist/packlets/resource-json/index.js.map +1 -0
- package/dist/packlets/resource-json/json.js.map +1 -0
- package/dist/packlets/resource-json/normalized.js.map +1 -0
- package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
- package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
- package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
- package/dist/packlets/resource-types/config/convert.js.map +1 -0
- package/dist/packlets/resource-types/config/index.js.map +1 -0
- package/dist/packlets/resource-types/config/json.js.map +1 -0
- package/dist/packlets/resource-types/helpers.js.map +1 -0
- package/dist/packlets/resource-types/index.js.map +1 -0
- package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
- package/dist/packlets/resource-types/resourceType.js.map +1 -0
- package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
- package/dist/packlets/resources/candidateReducer.js.map +1 -0
- package/dist/packlets/resources/candidateValue.js.map +1 -0
- package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
- package/dist/packlets/resources/common.js.map +1 -0
- package/dist/packlets/resources/deltaGenerator.js.map +1 -0
- package/dist/packlets/resources/index.js.map +1 -0
- package/dist/packlets/resources/resource.js.map +1 -0
- package/dist/packlets/resources/resourceBuilder.js.map +1 -0
- package/dist/packlets/resources/resourceCandidate.js.map +1 -0
- package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
- package/dist/packlets/runtime/cacheListener.js.map +1 -0
- package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
- package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
- package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
- package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
- package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
- package/dist/packlets/runtime/context/index.js.map +1 -0
- package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
- package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
- package/dist/packlets/runtime/iResourceManager.js.map +1 -0
- package/dist/packlets/runtime/index.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
- package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
- package/dist/packlets/runtime/resourceResolver.js.map +1 -0
- package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
- package/dist/packlets/runtime/validate.js.map +1 -0
- package/dist/packlets/zip-archive/convert.js.map +1 -0
- package/dist/packlets/zip-archive/index.browser.js.map +1 -0
- package/dist/packlets/zip-archive/index.js.map +1 -0
- package/dist/packlets/zip-archive/json.js.map +1 -0
- package/dist/packlets/zip-archive/types.js.map +1 -0
- package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
- package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
- package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
- package/lib/index.browser.d.ts.map +1 -0
- package/lib/index.browser.js.map +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
- package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleLoader.js.map +1 -0
- package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
- package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
- package/lib/packlets/bundle/bundleUtils.js.map +1 -0
- package/lib/packlets/bundle/convert.d.ts.map +1 -0
- package/lib/packlets/bundle/convert.js.map +1 -0
- package/lib/packlets/bundle/index.d.ts.map +1 -0
- package/lib/packlets/bundle/index.js.map +1 -0
- package/lib/packlets/bundle/model.d.ts.map +1 -0
- package/lib/packlets/bundle/model.js.map +1 -0
- package/lib/packlets/common/conditions.d.ts.map +1 -0
- package/lib/packlets/common/conditions.js.map +1 -0
- package/lib/packlets/common/convert.d.ts.map +1 -0
- package/lib/packlets/common/convert.js.map +1 -0
- package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
- package/lib/packlets/common/helpers/conditions.js.map +1 -0
- package/lib/packlets/common/helpers/context.d.ts.map +1 -0
- package/lib/packlets/common/helpers/context.js.map +1 -0
- package/lib/packlets/common/helpers/index.d.ts.map +1 -0
- package/lib/packlets/common/helpers/index.js.map +1 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
- package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
- package/lib/packlets/common/helpers/resources.js.map +1 -0
- package/lib/packlets/common/index.d.ts.map +1 -0
- package/lib/packlets/common/index.js.map +1 -0
- package/lib/packlets/common/resources.d.ts.map +1 -0
- package/lib/packlets/common/resources.js.map +1 -0
- package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
- package/lib/packlets/common/validate/conditions.js.map +1 -0
- package/lib/packlets/common/validate/index.d.ts.map +1 -0
- package/lib/packlets/common/validate/index.js.map +1 -0
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
- package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
- package/lib/packlets/common/validate/resources.d.ts.map +1 -0
- package/lib/packlets/common/validate/resources.js.map +1 -0
- package/lib/packlets/conditions/condition.d.ts.map +1 -0
- package/lib/packlets/conditions/condition.js.map +1 -0
- package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionCollector.js.map +1 -0
- package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionDecls.js.map +1 -0
- package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSet.js.map +1 -0
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
- package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionToken.js.map +1 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
- package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/decls.js.map +1 -0
- package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/index.js.map +1 -0
- package/lib/packlets/conditions/index.d.ts.map +1 -0
- package/lib/packlets/conditions/index.js.map +1 -0
- package/lib/packlets/config/common.d.ts.map +1 -0
- package/lib/packlets/config/common.js.map +1 -0
- package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
- package/lib/packlets/config/configInitFactory.js.map +1 -0
- package/lib/packlets/config/convert.d.ts.map +1 -0
- package/lib/packlets/config/convert.js.map +1 -0
- package/lib/packlets/config/index.browser.d.ts.map +1 -0
- package/lib/packlets/config/index.browser.js.map +1 -0
- package/lib/packlets/config/index.d.ts.map +1 -0
- package/lib/packlets/config/index.js.map +1 -0
- package/lib/packlets/config/json.d.ts.map +1 -0
- package/lib/packlets/config/json.js.map +1 -0
- package/lib/packlets/config/predefined/default.d.ts.map +1 -0
- package/lib/packlets/config/predefined/default.js.map +1 -0
- package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
- package/lib/packlets/config/predefined/extended.js.map +1 -0
- package/lib/packlets/config/predefined/index.d.ts.map +1 -0
- package/lib/packlets/config/predefined/index.js.map +1 -0
- package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
- package/lib/packlets/config/systemConfiguration.js.map +1 -0
- package/lib/packlets/context/contextDecls.d.ts.map +1 -0
- package/lib/packlets/context/contextDecls.js.map +1 -0
- package/lib/packlets/context/contextToken.d.ts.map +1 -0
- package/lib/packlets/context/contextToken.js.map +1 -0
- package/lib/packlets/context/convert/decls.d.ts.map +1 -0
- package/lib/packlets/context/convert/decls.js.map +1 -0
- package/lib/packlets/context/convert/index.d.ts.map +1 -0
- package/lib/packlets/context/convert/index.js.map +1 -0
- package/lib/packlets/context/index.d.ts.map +1 -0
- package/lib/packlets/context/index.js.map +1 -0
- package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
- package/lib/packlets/decisions/abstractDecision.js.map +1 -0
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
- package/lib/packlets/decisions/candidate.d.ts.map +1 -0
- package/lib/packlets/decisions/candidate.js.map +1 -0
- package/lib/packlets/decisions/common.d.ts.map +1 -0
- package/lib/packlets/decisions/common.js.map +1 -0
- package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
- package/lib/packlets/decisions/concreteDecision.js.map +1 -0
- package/lib/packlets/decisions/decision.d.ts.map +1 -0
- package/lib/packlets/decisions/decision.js.map +1 -0
- package/lib/packlets/decisions/index.d.ts.map +1 -0
- package/lib/packlets/decisions/index.js.map +1 -0
- package/lib/packlets/import/fsItem.d.ts.map +1 -0
- package/lib/packlets/import/fsItem.js.map +1 -0
- package/lib/packlets/import/importContext.d.ts.map +1 -0
- package/lib/packlets/import/importContext.js.map +1 -0
- package/lib/packlets/import/importManager.d.ts.map +1 -0
- package/lib/packlets/import/importManager.js.map +1 -0
- package/lib/packlets/import/importable.d.ts.map +1 -0
- package/lib/packlets/import/importable.js.map +1 -0
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
- package/lib/packlets/import/importers/importer.d.ts.map +1 -0
- package/lib/packlets/import/importers/importer.js.map +1 -0
- package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
- package/lib/packlets/import/importers/index.browser.js.map +1 -0
- package/lib/packlets/import/importers/index.d.ts.map +1 -0
- package/lib/packlets/import/importers/index.js.map +1 -0
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
- package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/pathImporter.js.map +1 -0
- package/lib/packlets/import/index.browser.d.ts.map +1 -0
- package/lib/packlets/import/index.browser.js.map +1 -0
- package/lib/packlets/import/index.d.ts.map +1 -0
- package/lib/packlets/import/index.js.map +1 -0
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
- package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/index.js.map +1 -0
- package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/json.js.map +1 -0
- package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/convert.js.map +1 -0
- package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/helpers.js.map +1 -0
- package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/index.js.map +1 -0
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
- package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/index.js.map +1 -0
- package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
- package/lib/packlets/qualifiers/index.d.ts.map +1 -0
- package/lib/packlets/qualifiers/index.js.map +1 -0
- package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifier.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
- package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/common.js.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
- package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/index.js.map +1 -0
- package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/json.js.map +1 -0
- package/lib/packlets/resource-json/convert.d.ts.map +1 -0
- package/lib/packlets/resource-json/convert.js.map +1 -0
- package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
- package/lib/packlets/resource-json/helpers.js.map +1 -0
- package/lib/packlets/resource-json/index.d.ts.map +1 -0
- package/lib/packlets/resource-json/index.js.map +1 -0
- package/lib/packlets/resource-json/json.d.ts.map +1 -0
- package/lib/packlets/resource-json/json.js.map +1 -0
- package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
- package/lib/packlets/resource-json/normalized.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
- package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/convert.js.map +1 -0
- package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/index.js.map +1 -0
- package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/json.js.map +1 -0
- package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
- package/lib/packlets/resource-types/helpers.js.map +1 -0
- package/lib/packlets/resource-types/index.d.ts.map +1 -0
- package/lib/packlets/resource-types/index.js.map +1 -0
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
- package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/resourceType.js.map +1 -0
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
- package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
- package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
- package/lib/packlets/resources/candidateReducer.js.map +1 -0
- package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
- package/lib/packlets/resources/candidateValue.js.map +1 -0
- package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
- package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
- package/lib/packlets/resources/common.d.ts.map +1 -0
- package/lib/packlets/resources/common.js.map +1 -0
- package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
- package/lib/packlets/resources/deltaGenerator.js.map +1 -0
- package/lib/packlets/resources/index.d.ts.map +1 -0
- package/lib/packlets/resources/index.js.map +1 -0
- package/lib/packlets/resources/resource.d.ts.map +1 -0
- package/lib/packlets/resources/resource.js.map +1 -0
- package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceBuilder.js.map +1 -0
- package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
- package/lib/packlets/resources/resourceCandidate.js.map +1 -0
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
- package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheListener.js.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
- package/lib/packlets/runtime/context/index.d.ts.map +1 -0
- package/lib/packlets/runtime/context/index.js.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
- package/lib/packlets/runtime/iResourceManager.js.map +1 -0
- package/lib/packlets/runtime/index.d.ts.map +1 -0
- package/lib/packlets/runtime/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
- package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
- package/lib/packlets/runtime/resourceResolver.js.map +1 -0
- package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
- package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
- package/lib/packlets/runtime/validate.d.ts.map +1 -0
- package/lib/packlets/runtime/validate.js.map +1 -0
- package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
- package/lib/packlets/zip-archive/convert.js.map +1 -0
- package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
- package/lib/packlets/zip-archive/index.browser.js.map +1 -0
- package/lib/packlets/zip-archive/index.d.ts.map +1 -0
- package/lib/packlets/zip-archive/index.js.map +1 -0
- package/lib/packlets/zip-archive/json.d.ts.map +1 -0
- package/lib/packlets/zip-archive/json.js.map +1 -0
- package/lib/packlets/zip-archive/types.d.ts.map +1 -0
- package/lib/packlets/zip-archive/types.js.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
- package/package.json +9 -9
- package/dist/test/data/sample.json +0 -32
- package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
- package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
- package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractDecision.js","sourceRoot":"","sources":["../../../src/packlets/decisions/abstractDecision.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAEtD,2CAAwC;AACxC,yCAAsC;AAYtC;;;;;;;;GAQG;AACH,MAAa,gBAAiB,SAAQ,mBAAgB;IACpD;;;;;OAKG;IACH,YAAsB,MAAqC;QACzD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;aAChD,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,qBAAS,CAAC,eAAe,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC1F,IAAI,CAAC,qBAAS,CAAC,OAAO,CAAC,CAAC;QAC3B,KAAK,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,sBAAsB,CAAC,MAAqC;QACxE,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACI,UAAU,CACf,OAAwD;QAExD,uBACE,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,KAAM,CAAC,IAC7D,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,MAAK,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7E;IACJ,CAAC;CACF;AAxCD,4CAwCC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Result } from '@fgv/ts-utils';\nimport { ConditionSet } from '../conditions';\nimport { Candidate } from './candidate';\nimport { Decision } from './decision';\nimport * as ResourceJson from '../resource-json';\n\n/**\n * Parameters to create an {@link Decisions.AbstractDecision | AbstractDecision}.\n * @public\n */\nexport interface IAbstractDecisionCreateParams {\n conditionSets: ConditionSet[];\n index?: number;\n}\n\n/**\n * An abstract decision represents a class of decisions with candidates\n * that differ only in value. It is a {@link Decisions.Decision | IDecision<number>}\n * in which the `number` values are sequentially assigned indexes.\n * This allows us to represent each related {@link Decisions.IDecision | decision} as an\n * {@link Decisions.AbstractDecision | abstract decision} and a matching array containing\n * the corresponding value for each candidate. This representation is highly cacheable.\n * @public\n */\nexport class AbstractDecision extends Decision<number> {\n /**\n * Constructor for an {@link Decisions.AbstractDecision | AbstractDecision} object.\n * @param params - {@link Decisions.IAbstractDecisionCreateParams | Parameters}\n * used to create the decision.\n * @public\n */\n protected constructor(params: IAbstractDecisionCreateParams) {\n const candidates = Array.from(params.conditionSets)\n .map((conditionSet, value) => Candidate.createCandidate({ conditionSet, value }).orThrow())\n .sort(Candidate.compare);\n super({ candidates, index: params.index, isAbstract: true });\n }\n\n /**\n * Creates a new {@link Decisions.AbstractDecision | AbstractDecision} object.\n * @param params - {@link Decisions.IAbstractDecisionCreateParams | Parameters}\n * used to create the decision.\n * @returns `Success` with the new decision if successful, or `Failure` with an\n * error message if not.\n * @public\n */\n public static createAbstractDecision(params: IAbstractDecisionCreateParams): Result<AbstractDecision> {\n return captureResult(() => new AbstractDecision(params));\n }\n\n /**\n * Converts this abstract decision to a compiled abstract decision representation.\n * @param options - Optional compilation options controlling the output format.\n * @returns A compiled abstract decision object that can be used for serialization or runtime processing.\n * @public\n */\n public toCompiled(\n options?: ResourceJson.Compiled.ICompiledResourceOptions\n ): ResourceJson.Compiled.ICompiledAbstractDecision {\n return {\n conditionSets: this.candidates.map((c) => c.conditionSet.index!),\n ...(options?.includeMetadata === true ? { metadata: { key: this.key } } : {})\n };\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractDecisionCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/abstractDecisionCollector.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAE,MAAM,EAAiB,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA4B,aAAa,EAAyB,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAgB,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD;;;OAGG;IACH,aAAa,EAAE,6BAA6B,CAAC;CAC9C;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IAClF;;;OAGG;IACH,SAAgB,aAAa,EAAE,6BAA6B,CAAC;IAE7D;;OAEG;IACH,IAAW,aAAa,IAAI,gBAAgB,CAE3C;IAED;;OAEG;IACH,IAAW,mBAAmB,IAAI,gBAAgB,CAEjD;IAED;;OAEG;IACH,gBAAuB,kBAAkB,EAAE,aAAa,CAAyC;IAEjG;;OAEG;IACH,gBAAuB,wBAAwB,EAAE,aAAa,CAAyC;IAEvG;;OAEG;IACH,SAAS,aAAa,MAAM,EAAE,sCAAsC;IAapE;;;OAGG;WACW,MAAM,CAAC,MAAM,EAAE,sCAAsC,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAIvG,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,oBAAoB;CAG7B;AAED;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,WAAW,CAAC,4BAA4B,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractDecisionCollector.js","sourceRoot":"","sources":["../../../src/packlets/decisions/abstractDecisionCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAuG;AACvG,yDAAsD;AACtD,sCAA2F;AAC3F,8CAA4E;AAc5E;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,8BAAqC;IAOlF;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC;IAC5E,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,CAAC;YACpC,OAAO,mCAAgB,CAAC,sBAAsB,CAAC;gBAC7C,aAAa,EAAE,IAAI;aACpB,CAAC,CAAC;QACL,CAAC;QACD,uFAAuF;QACvF,OAAO,IAAA,eAAI,EAAC,2DAA2D,CAAC,CAAC;IAC3E,CAAC;IAEO,oBAAoB,CAAC,IAAa;QACxC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,yBAAY,CAAC,CAAC;IAC7E,CAAC;;AAvEH,8DAwEC;AAnDC;;GAEG;AACoB,4CAAkB,GAAkB,iBAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AAEjG;;GAEG;AACoB,kDAAwB,GAAkB,iBAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Collections, Result, fail, succeed, ValidatingCollector } from '@fgv/ts-utils';\nimport { AbstractDecision } from './abstractDecision';\nimport { Convert as CommonConvert, DecisionIndex, DecisionKey, Validate } from '../common';\nimport { ConditionSet, ReadOnlyConditionSetCollector } from '../conditions';\n\n/**\n * Parameters for creating a {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n * @public\n */\nexport interface IAbstractDecisionCollectorCreateParams {\n /**\n * {@link Conditions.ReadOnlyConditionSetCollector | ConditionSetCollector} used to create conditions\n * sets for decisions in this collector.\n */\n conditionSets: ReadOnlyConditionSetCollector;\n}\n\n/**\n * A `ValidatingCollector` for {@link Decisions.AbstractDecision | AbstractDecisions}.\n * @public\n */\nexport class AbstractDecisionCollector extends ValidatingCollector<AbstractDecision> {\n /**\n * The {@link Conditions.ReadOnlyConditionSetCollector | ConditionSetCollector} used to create conditions\n * sets for decisions in this collector.\n */\n public readonly conditionSets: ReadOnlyConditionSetCollector;\n\n /**\n * The empty decision (no condition sets) for this collector.\n */\n public get emptyDecision(): AbstractDecision {\n return this.getAt(AbstractDecisionCollector.EmptyDecisionIndex).orThrow();\n }\n\n /**\n * The default-only decision (one condition set with no conditions) for this collector.\n */\n public get defaultOnlyDecision(): AbstractDecision {\n return this.getAt(AbstractDecisionCollector.DefaultOnlyDecisionIndex).orThrow();\n }\n\n /**\n * The index for the empty decision.\n */\n public static readonly EmptyDecisionIndex: DecisionIndex = Validate.toDecisionIndex(0).orThrow();\n\n /**\n * The index for the default-only decision.\n */\n public static readonly DefaultOnlyDecisionIndex: DecisionIndex = Validate.toDecisionIndex(1).orThrow();\n\n /**\n * Creates a new instance of {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n */\n protected constructor(params: IAbstractDecisionCollectorCreateParams) {\n super({\n converters: new Collections.KeyValueConverters<DecisionKey, AbstractDecision>({\n key: CommonConvert.decisionKey,\n value: (from: unknown) => this._toAbstractDecision(from)\n })\n });\n this.conditionSets = params.conditionSets;\n this.add(AbstractDecision.createAbstractDecision({ conditionSets: [] }).orThrow()).orThrow();\n const cs = this.conditionSets.validating.get('').orThrow();\n this.add(AbstractDecision.createAbstractDecision({ conditionSets: [cs] }).orThrow()).orThrow();\n }\n\n /**\n * Creates a new instance of {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n * @returns `Success` with the new instance, or `Failure` with an error if the instance could not be created.\n */\n public static create(params: IAbstractDecisionCollectorCreateParams): Result<AbstractDecisionCollector> {\n return captureResult(() => new AbstractDecisionCollector(params));\n }\n\n private _toAbstractDecision(from: unknown): Result<AbstractDecision> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (from instanceof AbstractDecision) {\n return succeed(from);\n }\n if (this._isConditionSetArray(from)) {\n return AbstractDecision.createAbstractDecision({\n conditionSets: from\n });\n }\n /* c8 ignore next 2 - functional code path tested but coverage intermittently missed */\n return fail('invalid value: not an abstract decision or condition sets');\n }\n\n private _isConditionSetArray(from: unknown): from is ConditionSet[] {\n return Array.isArray(from) && from.every((e) => e instanceof ConditionSet);\n }\n}\n\n/**\n * A read-only {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n * @public\n */\nexport type ReadOnlyAbstractDecisionCollector = Collections.IReadOnlyValidatingCollector<AbstractDecision>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/candidate.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IAC9D,QAAQ,CAAC,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xC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,MAAA,MAAM,CAAC,WAAW,mCAAI,SAAS,CAAC;IACrD,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,eAAe,CAC3B,MAA0B;QAE1B,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,OAAO,CAAC,EAAc,EAAE,EAAc;QAClD,OAAO,yBAAY,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACtD,CAAC;CACF;AAxDD,8BAwDC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { ConditionSet } from '../conditions';\nimport { captureResult, Result } from '@fgv/ts-utils';\nimport { ResourceValueMergeMethod } from '../common';\n\n/**\n * A {@link Decisions.ICandidate | resource candidate} represents a single\n * possible value for some resource, with the conditions under which it is valid.\n * @public\n */\nexport interface ICandidate<TVALUE extends JsonValue = JsonValue> {\n readonly conditionSet: ConditionSet;\n readonly value: TVALUE;\n readonly isPartial?: boolean;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Simple implementation of {@link Decisions.ICandidate | ICandidate} with\n * helper methods for sorting and presentation.\n * @public\n */\nexport class Candidate<TVALUE extends JsonValue = JsonValue> implements ICandidate<TVALUE> {\n public readonly conditionSet: ConditionSet;\n public readonly value: TVALUE;\n public readonly isPartial: boolean;\n public readonly mergeMethod: ResourceValueMergeMethod;\n\n /**\n * Key of the condition set for this candidate.\n */\n public get key(): string {\n return this.conditionSet.key;\n }\n\n /**\n * Construct a new {@link Decisions.Candidate | Candidate}.\n * @param params - The {@link Decisions.ICandidate | parameters} to use to create the\n * new candidate.\n */\n protected constructor(params: ICandidate<TVALUE>) {\n this.conditionSet = params.conditionSet;\n this.value = params.value;\n this.isPartial = params.isPartial === true;\n this.mergeMethod = params.mergeMethod ?? 'augment';\n }\n\n /**\n * Create a new {@link Decisions.Candidate | candidate}.\n * @param params - The {@link Decisions.ICandidate | parameters} to use to create the\n * new candidate.\n * @returns `Success` with the new candidate if successful, or `Failure` if the\n * candidate could not be created.\n */\n public static createCandidate<TVALUE extends JsonValue>(\n params: ICandidate<TVALUE>\n ): Result<Candidate<TVALUE>> {\n return captureResult(() => new Candidate(params));\n }\n\n /**\n * Compare two {@link Decisions.ICandidate | candidates} for sorting purposes.\n * @param c1 - The first candidate to compare.\n * @param c2 - The second candidate to compare.\n * @returns A negative number if c1 should come before c2, a positive number if c1 should\n * come after c2, or zero if they are equivalent.\n */\n public static compare(c1: ICandidate, c2: ICandidate): number {\n return ConditionSet.compare(c1.conditionSet, c2.conditionSet);\n }\n\n /**\n * Returns a string representation of the {@link Decisions.Candidate | candidate}.\n * @returns A string representation of this candidate.\n */\n public toString(): string {\n return `${this.key}: ${JSON.stringify(this.value)}`;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/common.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,SAAS,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IAC7D,GAAG,EAAE,WAAW,CAAC;IACjB,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/packlets/decisions/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { DecisionIndex, DecisionKey } from '../common';\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { ICandidate } from './candidate';\n\n/**\n * Represents a decision, which is comprised of zero or more\n * {@link Decisions.Candidate | candidates}, each of which represents a possible\n * value for some resource, along with the conditions under which that value is valid.\n * @public\n */\nexport interface IDecision<TVALUE extends JsonValue = JsonValue> {\n key: DecisionKey;\n candidates: ReadonlyArray<ICandidate<TVALUE>>;\n index?: DecisionIndex;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concreteDecision.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/concreteDecision.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAa,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA0C,MAAM,EAAiB,MAAM,eAAe,CAAC;AAE9F,OAAO,EAA4B,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGjF;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IAC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CAAC;QAC7E,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF;AA7FD,4CA6FC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { Candidate, ICandidate } from './candidate';\nimport { IDecision } from './common';\nimport { AbstractDecisionCollector } from './abstractDecisionCollector';\nimport { AbstractDecision } from './abstractDecision';\nimport { captureResult, Collections, mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { ConditionSet } from '../conditions';\nimport { Convert as CommonConvert, DecisionIndex, DecisionKey } from '../common';\nimport { Decision } from './decision';\n\n/**\n * Parameters used to create a new {@link Decisions.ConcreteDecision | ConcreteDecision},\n * given an {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} and a\n * list of {@link Decisions.ICandidate | candidates}.\n * @public\n */\nexport interface IConcreteDecisionCreateParams<TVALUE extends JsonValue = JsonValue> {\n decisions: AbstractDecisionCollector;\n candidates: ReadonlyArray<ICandidate<TVALUE>>;\n index?: number;\n}\n\n/**\n * Protected constructor parameters for {@link Decisions.ConcreteDecision | ConcreteDecision},\n * used to create a new concrete decision from an existing {@link Decisions.AbstractDecision | AbstractDecision}\n * and a list of values.\n * @public\n */\nexport interface IConcreteDecisionConstructorParams<TVALUE extends JsonValue = JsonValue> {\n baseDecision: AbstractDecision;\n values: TVALUE[];\n index?: DecisionIndex;\n}\n\n/**\n * A {@link Decisions.ConcreteDecision | concrete decision} is a {@link Decisions.IDecision | decision}\n * implemented as a reference to a common {@link Decisions.AbstractDecision | abstract decision} and a list of\n * values that correspond to the candidates in the abstract decision. This allows us to represent a large\n * number of related decisions with a single abstract decision and a list of values.\n * @public\n */\nexport class ConcreteDecision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {\n public readonly baseDecision: AbstractDecision;\n public readonly values: TVALUE[];\n public readonly candidates: ReadonlyArray<ICandidate<TVALUE>>;\n\n /**\n * Unique global key for this decision, derived from the condition set and\n * candidate values.\n */\n public get key(): DecisionKey {\n return this._collectible.key;\n }\n\n /**\n * Unique global index for this decision.\n */\n public get index(): DecisionIndex | undefined {\n return this._collectible.index;\n }\n\n private _collectible: Collections.Collectible<DecisionKey, DecisionIndex>;\n\n /**\n * Constructor for a {@link Decisions.ConcreteDecision | ConcreteDecision} object.\n * @param params - {@link Decisions.IConcreteDecisionConstructorParams | Parameters}\n * used to create the decision.\n * @public\n */\n protected constructor(params: IConcreteDecisionConstructorParams<TVALUE>) {\n this.baseDecision = params.baseDecision;\n this.values = params.values;\n this.candidates = this.baseDecision.candidates.map((candidate) => {\n const value = this.values[candidate.value];\n return Candidate.createCandidate({ conditionSet: candidate.conditionSet, value }).orThrow();\n });\n this._collectible = new Collections.Collectible({\n key: Decision.getKey(this.candidates),\n index: params.index,\n indexConverter: CommonConvert.decisionIndex\n });\n }\n\n /**\n * Creates a new {@link Decisions.ConcreteDecision | ConcreteDecision} object.\n * @param params - {@link Decisions.IConcreteDecisionCreateParams | Parameters}\n * used to create the decision.\n * @returns `Success` with the new decision if successful, or `Failure` with an\n * error message if not.\n * @public\n */\n public static create<TVALUE extends JsonValue = JsonValue>(\n params: IConcreteDecisionCreateParams<TVALUE>\n ): Result<ConcreteDecision<TVALUE>> {\n const conditionSets = params.candidates\n .map((candidate) => candidate.conditionSet)\n .sort(ConditionSet.compare)\n .reverse();\n\n const getBase = params.decisions.validating.getOrAdd(conditionSets);\n /* c8 ignore next 3 - defense in depth against internal error hard to repro */\n if (getBase.isFailure()) {\n return fail<ConcreteDecision<TVALUE>>(getBase.message);\n }\n const baseDecision = getBase.value;\n return mapResults(\n params.candidates.map((candidate, index) => {\n /* c8 ignore next 5 - defense in depth against internal error hard to repro */\n if (candidate.conditionSet.key !== baseDecision.candidates[index].conditionSet.key) {\n return fail<TVALUE>(\n `${candidate.conditionSet.key}: Candidate does not match base decision ${candidate.conditionSet.key}`\n );\n }\n return succeed(candidate.value);\n })\n ).onSuccess((values) => {\n /* c8 ignore next 5 - defense in depth against invalid index conversion */\n if (params.index) {\n return CommonConvert.decisionIndex.convert(params.index).onSuccess((index) => {\n return captureResult(() => new ConcreteDecision({ baseDecision, values, index }));\n });\n }\n return captureResult(() => new ConcreteDecision({ baseDecision, values }));\n });\n }\n\n /**\n * Sets the index for this decision. Once set, index is immutable.\n * @param index - The index to set.\n * @returns `Success` with the new index if successful, or `Failure` with an error message if not.\n */\n public setIndex(index: number): Result<DecisionIndex> {\n return this._collectible.setIndex(index);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/decision.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAoC,MAAM,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAA4B,aA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AAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChG,OAAO,gBAAa,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW,IAAI,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IACnF,CAAC;;AApHH,4BAqHC;AA/FC;;GAEG;AACoB,yBAAgB,GAAgB,gBAAa,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;AAEvG;;GAEG;AACoB,+BAAsB,GAAgB,gBAAa,CAAC,WAAW;KACnF,OAAO,CAAC,UAAU,CAAC;KACnB,OAAO,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Collections, Hash, Result } from '@fgv/ts-utils';\nimport { Convert as CommonConvert, DecisionIndex, DecisionKey } from '../common';\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { Candidate, ICandidate } from './candidate';\nimport { IDecision } from './common';\nimport { ConditionSet } from '../conditions';\n\n/**\n * Parameters used to create a new {@link Decisions.Decision | Decision}\n * with the {@link Decisions.Decision.createDecision | createDecision}\n * static method.\n * @public\n */\nexport interface IDecisionCreateParams<TVALUE extends JsonValue = JsonValue> {\n candidates: ReadonlyArray<ICandidate<TVALUE>>;\n index?: number;\n}\n\n/**\n * Parameters used to construct a new {@link Decisions.Decision | Decision} with\n * the protected constructor.\n * @public\n */\nexport interface IDecisionConstructorParams<TVALUE extends JsonValue = JsonValue>\n extends IDecisionCreateParams<TVALUE> {\n isAbstract: boolean;\n}\n\n/**\n * Simple collectible implementation of {@link Decisions.IDecision | IDecision}.\n * @public\n */\nexport class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {\n /**\n * The sorted {@link Conditions.ConditionSet | ConditionSets} that make up this decision.\n * @public\n */\n public readonly candidates: ReadonlyArray<Candidate<TVALUE>>;\n\n /**\n * Unique global key for this decision, derived from the contents\n * of the decision.\n */\n public get key(): DecisionKey {\n return this._collectible.key;\n }\n\n /**\n * Unique global index for this decision.\n */\n public get index(): DecisionIndex | undefined {\n return this._collectible.index;\n }\n\n /**\n * Key for the empty decision (no condition sets).\n */\n public static readonly EmptyDecisionKey: DecisionKey = CommonConvert.decisionKey.convert('').orThrow();\n\n /**\n * Key for the default-only decision (single condition set with no conditions).\n */\n public static readonly DefaultOnlyDecisionKey: DecisionKey = CommonConvert.decisionKey\n .convert('00000000')\n .orThrow();\n\n private _collectible: Collections.Collectible<DecisionKey, DecisionIndex>;\n\n /**\n * Constructor for a {@link Decisions.Decision | Decision} object.\n * @param params - {@link Decisions.IDecisionConstructorParams | Parameters} used to create the decision.\n * @public\n */\n protected constructor(params: IDecisionConstructorParams<TVALUE>) {\n this.candidates = Array.from(params.candidates)\n .map((c) => Candidate.createCandidate(c).orThrow())\n .sort(Candidate.compare)\n .reverse();\n\n /* c8 ignore next 3 - coverage having a rough time */\n const key = params.isAbstract\n ? Decision.getAbstractKey(this.candidates.map((c) => c.conditionSet))\n : Decision.getKey(this.candidates);\n\n this._collectible = new Collections.Collectible<DecisionKey, DecisionIndex>({\n key,\n index: params.index,\n indexConverter: CommonConvert.decisionIndex\n });\n }\n\n /**\n * Creates a new {@link Decisions.Decision | Decision} object.\n * @param params - {@link Decisions.IDecisionCreateParams | Parameters} used to create the decision.\n * @returns `Success` with the new decision if successful, or `Failure` with an error message if not.\n * @public\n */\n public static createDecision(params: IDecisionCreateParams): Result<Decision> {\n return captureResult(() => new Decision({ ...params, isAbstract: false }));\n }\n\n /**\n * Sets the index for this decision. Once set, index is immutable.\n * @param index - The index to set.\n * @returns `Success` with the new index if successful, or `Failure` with an error message if not.\n * @public\n */\n public setIndex(index: number): Result<DecisionIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * Helper function to return a stable key for a the condition sets that\n * make up a {@link Decisions.Decision | decision}. The abstract\n * key is a `+`-separated list of the hashes of the sorted condition sets\n * that make up the decision.\n * @param conditionSets - The condition sets to use to create the key.\n * @returns A key derived from the condition set hashes.\n * @public\n */\n public static getAbstractKey(conditionSets: ReadonlyArray<ConditionSet>): DecisionKey {\n return CommonConvert.decisionKey\n .convert(\n Array.from(conditionSets)\n .sort(ConditionSet.compare)\n .reverse()\n .map((c) => c.toHash())\n .join('+')\n )\n .orThrow();\n }\n\n /**\n * Helper function to return a stable key for a set of condition sets.\n * @param candidates - The candidates whose condition sets are used to create the key.\n * @returns A key derived from the condition set hashes.\n * @public\n */\n public static getKey<TVALUE extends JsonValue = JsonValue>(\n candidates: ReadonlyArray<ICandidate<TVALUE>>\n ): DecisionKey {\n if (candidates.length === 0) {\n /* c8 ignore next 2 - functional code path tested but coverage intermittently missed */\n return Decision.EmptyDecisionKey;\n }\n const abstractKey = Decision.getAbstractKey(candidates.map((c) => c.conditionSet));\n const valueKey = Hash.Crc32Normalizer.crc32Hash(candidates.map((c) => JSON.stringify(c.value)));\n return CommonConvert.decisionKey.convert(`${abstractKey}|${valueKey}`).orThrow();\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/index.ts"],"names":[],"mappings":"AAsBA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/decisions/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,qDAAmC;AACnC,8DAA4C;AAC5C,qDAAmC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './common';\nexport * from './candidate';\nexport * from './decision';\nexport * from './abstractDecision';\nexport * from './abstractDecisionCollector';\nexport * from './concreteDecision';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsItem.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/fsItem.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAEd,MAAM,EAIP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;CAC3D;AAED;;;GAGG;AACH,qBAAa,MAAO,YAAW,YAAY;IACzC;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,SAAgB,UAAU,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;IAEjE;;OAEG;IACH,SAAgB,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC;IAE5C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;;;;OAKG;IACH,SAAS,aAAa,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,2BAA2B;IAQlF;;;;;;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B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACvE,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC3C,OAAO;oBACL,aAAa,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI;oBAC/B,KAAK,EAAE,CAAC,CAAC,KAAK;oBACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;oBACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;iBACrB,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,OAAO,6BAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1ID,wBA0IC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n captureResult,\n DetailedResult,\n mapResults,\n Result,\n fail,\n succeed,\n useOrInitialize\n} from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { Helpers as CommonHelpers, Validate } from '../common';\nimport * as Conditions from '../conditions';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\nimport { ImportContext } from './importContext';\n\n/**\n * Result details for {@link Import.FsItem | FsItem} operations.\n * @public\n */\nexport type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';\n\n/**\n * Interface describing some single file system item.\n * @public\n */\nexport interface IFsItemProps {\n /**\n * The underlying `FileTreeItem` for this item.\n */\n readonly item: FileTree.FileTreeItem;\n\n /**\n * The base name of the file system item, once\n * any conditions set tokens have been removed.\n */\n readonly baseName: string;\n\n /**\n * {@link Conditions.IValidatedConditionDecl | Conditions} extracted\n * from the base name of the {@link Import.FsItem | FsItem}.\n */\n readonly conditions: Conditions.IValidatedConditionDecl[];\n}\n\n/**\n * Class describing some file system item to be imported.\n * @public\n */\nexport class FsItem implements IFsItemProps {\n /**\n * {@inheritDoc Import.IFsItemProps.baseName}\n */\n public readonly baseName: string;\n\n /**\n * {@inheritDoc Import.IFsItemProps.conditions}\n */\n public readonly conditions: Conditions.IValidatedConditionDecl[];\n\n /**\n * {@inheritDoc Import.IFsItemProps.item}\n */\n public readonly item: FileTree.FileTreeItem;\n\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} to use for this item.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Protected constructor creates a new {@link Import.FsItem | FsItem}.\n * @param props - The {@link Import.IFsItemProps | file system item properties} to use for this item.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n */\n protected constructor(props: IFsItemProps, qualifiers: IReadOnlyQualifierCollector) {\n const { baseName, conditions, item } = props;\n this.baseName = baseName;\n this.conditions = conditions;\n this.item = item;\n this.qualifiers = qualifiers;\n }\n\n /**\n * Creates a new {@link Import.FsItem | FsItem} from a `FileTreeItem`.\n * @param item - The `FileTreeItem` to import.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n * @returns `Success` containing the new {@link Import.FsItem | FsItem} if successful, or a `Failure`\n * containing an error message if not. Note that the result detail `skipped` indicates that the item\n * was not created because it is not relevant - this is a soft error that should be silently ignored.\n */\n public static createForItem(\n item: FileTree.FileTreeItem,\n qualifiers: IReadOnlyQualifierCollector\n ): DetailedResult<FsItem, FsItemResultDetail> {\n const baseName: string = item.type === 'file' ? item.baseName : item.name;\n\n return FsItem.tryParseBaseName(baseName, qualifiers)\n .withErrorFormat((msg) => `${baseName}: error extracting conditions - ${msg}`)\n .onSuccess(({ baseName: newBaseName, conditions }) => {\n return captureResult(() => new FsItem({ baseName: newBaseName, conditions, item }, qualifiers));\n })\n .withDetail('failed', 'succeeded');\n }\n\n /**\n * Creates a new {@link Import.FsItem | FsItem} from a file system path.\n * @param importPath - The path to the file system item to import.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n * @param tree - An optional {@link FileTree.FileTree | file tree} to use for this item.\n * @returns `Success` containing the new {@link Import.FsItem | FsItem} if an item is created\n * successfully, or a `Failure` containing an error message if it is not. Note that the result detail\n * `skipped` indicates that the item was not created because it is not relevant - this is a soft error\n * that should be silently ignored.\n */\n public static createForPath(\n importPath: string,\n qualifiers: IReadOnlyQualifierCollector,\n tree?: FileTree.FileTree\n ): DetailedResult<FsItem, FsItemResultDetail> {\n return useOrInitialize(tree, () => FileTree.forFilesystem())\n .withDetail<FsItemResultDetail>('failed', 'succeeded')\n .onSuccess((tree) => {\n return tree\n .getItem(importPath)\n .withDetail<FsItemResultDetail>('failed')\n .onSuccess((item) => FsItem.createForItem(item, qualifiers));\n });\n }\n\n /**\n * Tries to parse a base name into a base name and a set of conditions.\n * @param baseName - The base name to parse.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n * @returns `Success` containing the parsed base name and conditions on success, or `Failure` containing\n * an error message if it is not.\n */\n public static tryParseBaseName(\n baseName: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<Omit<IFsItemProps, 'item'>> {\n const nameParts = baseName.split('.');\n const segmentToTest = nameParts.length > 1 ? nameParts[nameParts.length - 1] : nameParts[0];\n const validatedConditions = CommonHelpers.parseConditionSetTokenParts(segmentToTest).onSuccess(\n (parts) => {\n return mapResults(\n parts.map((part) => Conditions.ConditionTokens.validateConditionTokenParts(part, qualifiers))\n ).onFailure((msg) => {\n if (parts.length === 1 && parts[0].qualifier === undefined) {\n return succeed([]);\n }\n return fail(msg);\n });\n }\n );\n if (validatedConditions.isFailure()) {\n return fail(validatedConditions.message);\n }\n const conditions = validatedConditions.value;\n if (conditions.length > 0) {\n baseName = nameParts.filter((s) => s !== segmentToTest).join('.');\n }\n return succeed({ baseName, conditions });\n }\n\n /**\n * Gets the context for this file system item.\n * @returns `Success` containing the {@link Import.ImportContext | import context} for this item\n * if successful, or a `Failure` containing an error message if an error occurs.\n */\n public getContext(): Result<ImportContext> {\n return Validate.toOptionalResourceId(this.baseName).onSuccess((baseId) => {\n const conditions = this.conditions.map((c) => {\n return {\n qualifierName: c.qualifier.name,\n value: c.value,\n operator: c.operator,\n priority: c.priority\n };\n });\n return ImportContext.create({ baseId, conditions });\n });\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importContext.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/importContext.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAiB,MAAM,EAAW,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG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ACD,KAAK,QAAQ;gBACX,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;CACF;AAtHD,sCAsHC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Helpers } from '../common';\nimport { captureResult, Result, succeed } from '@fgv/ts-utils';\nimport { IConditionDecl } from '../conditions';\nimport { ResourceId } from '../common';\nimport * as ResourceJson from '../resource-json';\n\n/**\n * Accumulated context of a resource import operation.\n * @public\n */\nexport interface IImportContext {\n /**\n * Base ID for the import context for resources imported\n * in this context.\n */\n readonly baseId?: string;\n /**\n * Conditions to be applied to resources imported in this context.\n */\n readonly conditions?: ReadonlyArray<IConditionDecl>;\n}\n\n/**\n * Accumulated context of a resource import operation.\n * @public\n */\nexport interface IValidatedImportContext {\n /**\n * Base ID for the import context for resources imported\n * in this context.\n */\n readonly baseId?: ResourceId;\n /**\n * Conditions to be applied to resources imported in this context.\n */\n readonly conditions: ReadonlyArray<IConditionDecl>;\n}\n\n/**\n * Class to accumulate context for a resource import operation.\n * @public\n */\nexport class ImportContext implements IValidatedImportContext {\n /**\n * {@inheritDoc Import.IImportContext.baseId}\n */\n public readonly baseId: ResourceId | undefined;\n\n /**\n * {@inheritDoc Import.IImportContext.conditions}\n */\n public readonly conditions: ReadonlyArray<IConditionDecl>;\n\n /**\n * Protected {@link Import.ImportContext | import context} for derived classes.\n * Public consumers use {@link Import.ImportContext.create | create} to create new instances.\n * @param params - The {@link Import.IImportContext | import context} parameters including\n * the base ID and conditions to be applied to resources imported in this context.\n */\n protected constructor({ baseId, conditions }: IImportContext) {\n this.baseId = Helpers.joinOptionalResourceIds(baseId).orThrow();\n this.conditions = Array.from(conditions ?? []);\n }\n\n /**\n * Factory method to create a new {@link Import.ImportContext | import context}.\n * @param context - The {@link Import.IImportContext | import context} to create\n * the new context from.\n * @returns `Success` with the new {@link Import.ImportContext | import context}\n * if successful, or `Failure` with an error message if creation fails.\n */\n public static create(context?: IImportContext): Result<ImportContext> {\n /* c8 ignore next */\n context = context ?? { conditions: [] };\n return captureResult(() => new ImportContext(context));\n }\n\n /**\n * Adds conditions to the import context.\n * @param conditions - Conditions to be added to the import context.\n * @returns `Success` with a new {@link Import.ImportContext | import context} containing the added conditions\n * if successful, or `Failure` with an error message if the operation fails.\n */\n public withConditions(conditions: IConditionDecl[]): Result<ImportContext> {\n return ImportContext.create({\n baseId: this.baseId,\n conditions: [...this.conditions, ...conditions]\n });\n }\n\n /**\n * Appends names to the base ID of the import context.\n * @param names - The name segments to append to the base ID.\n * @returns `Success` with a new {@link Import.ImportContext | import context} containing the new base ID\n * if successful, or `Failure` with an error message if the operation fails.\n */\n public withName(...names: string[]): Result<ImportContext> {\n return Helpers.joinResourceIds(this.baseId, ...names).onSuccess((baseId) => {\n return ImportContext.create({ baseId, conditions: this.conditions });\n });\n }\n\n /**\n * Extends the import context with additional name segments and conditions.\n * @param context - The {@link Import.IImportContext | import context} to extend this context with.\n * @returns `Success` with a new {@link Import.ImportContext | import context}\n * containing the extended context if successful, or `Failure` with an error\n * message if the operation fails.\n */\n public extend(context?: IValidatedImportContext): Result<ImportContext> {\n /* c8 ignore next 1 */\n context = context ?? { conditions: [] };\n const conditions = [...this.conditions, ...context.conditions];\n return Helpers.joinOptionalResourceIds(this.baseId, context.baseId).onSuccess((baseId) => {\n return ImportContext.create({ baseId, conditions });\n });\n }\n\n /**\n * Creates a new {@link Import.ImportContext | import context} to import resources from a\n * container with the specified {@link ResourceJson.Normalized.IContainerContextDecl | container context declaration}e\n * @param container - The {@link ResourceJson.Normalized.IContainerContextDecl | container context declaration}\n * to consider when creating the new context.\n * @param importer - The base {@link Import.ImportContext | import context} to adjust for the container\n * context.\n * @returns `Success` with the new {@link Import.ImportContext | import context} if successful,\n * or `Failure` with an error message if the operation fails.\n * @remarks\n * A container context declaration may specify a merge method, which determines how the\n * container context is merged with the base context. The merge method can be one of the following:\n * - `augment`: The base context is augmented with the container context. This is the default behavior.\n * - `replace`: The base context is selectively replaced with the container context. If the container context\n * specifies a base ID or conditions, the corresponding values in the base context are ignored.\n * - `delete`: The base context is deleted. This means that the container context is not used at all.\n */\n public static forContainerImport(\n container?: ResourceJson.Normalized.IContainerContextDecl,\n importer?: ImportContext\n ): Result<ImportContext | undefined> {\n if (!importer) {\n return succeed(undefined);\n }\n /* c8 ignore next 1 */\n container = container ?? {};\n const mergeMethod = container.mergeMethod ?? 'augment';\n\n switch (mergeMethod) {\n case 'augment':\n return succeed(importer);\n case 'replace': {\n // if the container defines baseId or conditions, then we ignore\n // the corresponding values in the importer\n const baseId = container.baseId ? undefined : importer.baseId;\n const conditions = container.conditions ? undefined : importer.conditions;\n return ImportContext.create({ baseId, conditions });\n }\n case 'delete':\n return succeed(undefined);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importManager.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/importManager.ts"],"names":[],"mappings":"AA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":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { Converter } from '@fgv/ts-utils';\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { ResourceManagerBuilder } from '../resources';\nimport { ImportContext } from './importContext';\nimport { IImportable, IImportablePath } from './importable';\nimport { FsItemImporter } from './importers/fsItemImporter';\nimport { CollectionImporter, IImporter, JsonImporter, PathImporter } from './importers';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\n\n/**\n * Parameters for creating an {@link Import.ImportManager | ImportManager}.\n * @public\n */\nexport interface IImporterCreateParams {\n /**\n * The {@link Resources.ResourceManagerBuilder | resource manager builder} into which resources\n * will be imported.\n */\n resources: ResourceManagerBuilder;\n\n /**\n * An optional initial {@link Import.ImportContext | import context} for the import operation.\n */\n initialContext?: ImportContext;\n\n /**\n * An optional `FileTree` for importing path items.\n */\n fileTree?: FileTree.FileTree;\n\n /**\n * An optional list of {@link Import.Importers.IImporter | importers} to use for the import.\n */\n importers?: IImporter[];\n\n /**\n * An optional converter used to pre-process file contents before JSON import validation.\n */\n fileContentConverter?: Converter<JsonValue>;\n\n /**\n * Optional file extensions which should be parsed using the supplied file content converter.\n */\n fileContentExtensions?: ReadonlyArray<string>;\n}\n\n/**\n * Class to manage the import of resources from various sources.\n * @public\n */\nexport class ImportManager {\n /**\n * The {@link Resources.ResourceManagerBuilder | resource manager builder} into which resources\n * will be imported.\n */\n public readonly resources: ResourceManagerBuilder;\n\n /**\n * The list of {@link Import.Importers.IImporter | importers} to use for the\n * import operations.\n */\n public get importers(): ReadonlyArray<IImporter> {\n return this._importers;\n }\n\n /**\n * The initial {@link Import.ImportContext | import context} for the import operation.\n */\n public initialContext: ImportContext;\n\n protected _stack: IImportable[] = [];\n protected _importers: IImporter[] = [];\n\n /**\n * Protected constructor for the {@link Import.ImportManager | ImportManager}.\n * @param params - Parameters for creating the {@link Import.ImportManager | ImportManager}.\n */\n protected constructor(params: IImporterCreateParams) {\n this.resources = params.resources;\n this.initialContext = params.initialContext ?? ImportContext.create().orThrow();\n this._importers = Array.from(\n params.importers ??\n ImportManager.getDefaultImporters(\n this.resources.qualifiers,\n params.fileTree,\n params.fileContentConverter,\n params.fileContentExtensions\n )\n );\n }\n\n /**\n * Factory method to create a new {@link Import.ImportManager | ImportManager}.\n * @param params - Parameters for creating the {@link Import.ImportManager | ImportManager}.\n * @returns `Success` with the new {@link Import.ImportManager | ImportManager}\n * if successful, or `Failure` with an error message if creation fails.\n */\n public static create(params: IImporterCreateParams): Result<ImportManager> {\n return captureResult(() => new ImportManager(params));\n }\n\n /**\n * Imports resources from an {@link Import.IImportable | importable} object.\n * @param importable - The {@link Import.IImportable | importable} object to import.\n * @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,\n * or `Failure` with an error message if the import fails.\n */\n public import(importable: IImportable): Result<ImportManager> {\n this._stack.push(importable);\n return this._import();\n }\n\n /**\n * Imports resources from a file system path.\n * @param filePath - The path to import resources from.\n * @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,\n * or `Failure` with an error message if the import fails.\n */\n public importFromFileSystem(filePath: string): Result<ImportManager> {\n const importable: IImportablePath = { type: 'path', path: filePath };\n return this.import(importable);\n }\n\n /**\n * Gets the default importers using supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers}\n * and optional `FileTree`.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} to use for the import.\n * @param tree - An optional `FileTree` for importing path items.\n * @param fileContentConverter - An optional converter used to pre-process raw file contents before JSON import\n * validation.\n * @param fileContentExtensions - Optional file extensions which should be parsed using the supplied file\n * content converter.\n * @returns A read-only array of {@link Import.Importers.IImporter | importers}.\n */\n public static getDefaultImporters(\n qualifiers: IReadOnlyQualifierCollector,\n tree?: FileTree.FileTree,\n fileContentConverter?: Converter<JsonValue>,\n fileContentExtensions?: ReadonlyArray<string>\n ): ReadonlyArray<IImporter> {\n return [\n PathImporter.create({ qualifiers, tree }).orThrow(),\n FsItemImporter.create({ qualifiers, fileContentConverter, fileContentExtensions }).orThrow(),\n JsonImporter.create().orThrow(),\n CollectionImporter.create().orThrow()\n ];\n }\n\n /**\n * Imports any items on the import stack.\n * @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,\n * or `Failure` with an error message if the import fails.\n * @public\n */\n protected _import(): Result<ImportManager> {\n const errors: MessageAggregator = new MessageAggregator();\n\n while (this._stack.length > 0) {\n const item = this._stack.pop();\n if (item !== undefined) {\n let processed: boolean = false;\n let consumed: boolean = false;\n\n for (const importer of this._importers) {\n if (consumed || !importer.types.includes(item.type)) {\n continue;\n }\n\n const result = importer.import(item, this.resources).aggregateError(errors);\n processed = processed || result.detail !== 'skipped';\n consumed = consumed || result.detail === 'consumed';\n\n if (result.isSuccess()) {\n this._stack.push(...result.value);\n } else if (result.detail !== 'skipped') {\n errors.addMessage(`${item.type}: ${result.message}`);\n }\n }\n\n if (!processed) {\n errors.addMessage(`${item.type}: No matching importer found`);\n }\n }\n }\n\n return errors.returnOrReport(succeed(this));\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importable.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/importable.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,YAAY,CAAC,sBAAsB,CAAC;IAChD,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,YAAY,CAAC,gBAAgB,CAAC;IACpC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,6BAA6B,GAC7B,uBAAuB,CAAC;AAE5B;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,UAAU,CAE5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importable.js","sourceRoot":"","sources":["../../../src/packlets/import/importable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAoFH,oCAEC;AATD;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,CAAc;IACzC,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonValue } from '@fgv/ts-json-base';\nimport * as ResourceJson from '../resource-json';\nimport { ImportContext } from './importContext';\nimport { FsItem } from './fsItem';\n\n/**\n * Base interface for importable entities.\n * @public\n */\nexport interface IImportable {\n type: string;\n context?: ImportContext;\n}\n\n/**\n * Represents a filesystem path to be imported.\n * @public\n */\nexport interface IImportablePath extends IImportable {\n type: 'path';\n path: string;\n context?: ImportContext;\n}\n\n/**\n * Represents a filesystem item to be imported.\n * @public\n */\nexport interface IImportableFsItem extends IImportable {\n type: 'fsItem';\n item: FsItem;\n context?: ImportContext;\n}\n\n/**\n * Represents some JSON to be imported.\n * @public\n */\nexport interface IImportableJson extends IImportable {\n type: 'json';\n json: JsonValue;\n context?: ImportContext;\n}\n\n/**\n * Represents a resource collection to be imported.\n * @public\n */\nexport interface IImportableResourceCollection extends IImportable {\n type: 'resourceCollection';\n collection: ResourceJson.ResourceDeclCollection;\n context?: ImportContext;\n}\n\n/**\n * Represents a resource tree to be imported.\n * @public\n */\nexport interface IImportableResourceTree extends IImportable {\n type: 'resourceTree';\n tree: ResourceJson.ResourceDeclTree;\n context?: ImportContext;\n}\n\n/**\n * Type of importable entities.\n * @public\n */\nexport type Importable =\n | IImportablePath\n | IImportableFsItem\n | IImportableJson\n | IImportableResourceCollection\n | IImportableResourceTree;\n\n/**\n * Type guard for {@link Import.Importable | importables}.\n * @param i - The entity to check.\n * @returns `true` if the supplied {@link Import.IImportable | IImportable} is a\n * {@link Import.Importable | known importable}, `false` otherwise.\n * @public\n */\nexport function isImportable(i: IImportable): i is Importable {\n return ['path', 'fsItem', 'json', 'resourceCollection', 'resourceTree'].includes(i.type);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/collectionImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAGd,MAAM,EAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsC,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAI7D;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAClD;;OAEG;IACH,SAAgB,KAAK,EAAE,MAAM,EAAE,CAA0C;IAEzE;;OAEG;IACH,SAAS;IAET;;;;OAIG;WACW,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC;IAIlD;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAwBtD;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,YAAY;IAiBpB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,aAAa;CAkBtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/collectionImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAOuB;AAEvB,8CAA0D;AAE1D,kEAAoD;AACpD,oDAAiD;AAEjD;;;;;GAKG;AACH,MAAa,kBAAkB;IAM7B;;OAEG;IACH;QARA;;WAEG;QACa,UAAK,GAAa,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;IAKhD,CAAC;IAE1B;;;;OAIG;IACI,MAAM,CAAC,MAAM;QAClB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACI,MAAM,CACX,IAAiB,EACjB,OAA+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AYG;IACK,YAAY,CAClB,OAA+B,EAC/B,QAAuD,EACvD,OAAuB;QAEvB,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,SAAS,CACpG,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CACxC,CAAC;QACJ,CAAC,CAAC,sEAAsE;aAAM,IAC5E,CAAC,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAChD,CAAC;YACD,OAAO,IAAI,CAAC,sCAAsC,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;OAWG;IACK,aAAa,CACnB,OAA+B,EAC/B,SAAiE,EACjE,OAAuB;QAEvB,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAC7C,SAAS,EACT,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,UAAU,CACnB,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,sEAAsE;aAAM,IAC5E,CAAC,YAAY,CAAC,IAAI,CAAC,4BAA4B,CAAC,SAAS,CAAC,EAC1D,CAAC;YACD,OAAO,IAAI,CAAC,gDAAgD,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;CACF;AA9GD,gDA8GC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n captureResult,\n DetailedResult,\n failWithDetail,\n MessageAggregator,\n Result,\n succeed\n} from '@fgv/ts-utils';\nimport { ResourceBuilder, ResourceCandidate, ResourceManagerBuilder } from '../../resources';\nimport { IImportable, isImportable } from '../importable';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport * as ResourceJson from '../../resource-json';\nimport { ImportContext } from '../importContext';\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports\n * a {@link ResourceJson.ResourceDeclCollection | resource collection} or\n * {@link ResourceJson.ResourceDeclTree | resource tree} from an importable item.\n * @public\n */\nexport class CollectionImporter implements IImporter {\n /**\n * {@inheritDoc Import.Importers.IImporter.types}\n */\n public readonly types: string[] = ['resourceCollection', 'resourceTree'];\n\n /**\n * Protected {@link Import.Importers.CollectionImporter | CollectionImporter} constructor for derived classes\n */\n protected constructor() {}\n\n /**\n * Creates a new {@link Import.Importers.CollectionImporter | CollectionImporter} instance.\n * @returns `Success` with the new {@link Import.Importers.CollectionImporter | CollectionImporter} if successful,\n * `Failure` otherwise.\n */\n public static create(): Result<CollectionImporter> {\n return captureResult(() => new CollectionImporter());\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n if (!isImportable(item) || (item.type !== 'resourceCollection' && item.type !== 'resourceTree')) {\n /* c8 ignore next 1 - defense in depth */\n const name = item.context?.baseId ?? 'unknown';\n return failWithDetail(`${name}: invalid resource collection importable (${item.type})`, 'skipped');\n }\n\n const container = item.type === 'resourceCollection' ? item.collection : item.tree;\n\n return ImportContext.forContainerImport(container.context, item.context)\n .onSuccess((context) => {\n const errors: MessageAggregator = new MessageAggregator();\n for (const resource of container.getImporterResources()) {\n this._addResource(manager, resource, context).aggregateError(errors);\n }\n\n for (const candidate of container.getImporterCandidates()) {\n this._addCandidate(manager, candidate, context).aggregateError(errors);\n }\n return errors.returnOrReport(succeed([]));\n })\n .withDetail('failed', 'consumed');\n }\n\n /**\n * Adds a {@link ResourceJson.Normalized.IImporterResourceDecl | declared resource} to\n * the supplied {@link Resources.ResourceManagerBuilder | resource manager builder}, merging an\n * optional {@link Import.ImportContext | import context} if provided.\n * @param manager - The {@link Resources.ResourceManagerBuilder | resource manager builder} to which\n * the resource will be added.\n * @param resource - The {@link ResourceJson.Normalized.IImporterResourceDecl | resource}\n * to add.\n * @param context - Optional {@link Import.ImportContext | import context} to merge\n * with the resource.\n * @returns `Success` with the {@link Resources.ResourceBuilder | resource builder}\n * for the resource if successful, `Failure` with an error message if not.\n */\n private _addResource(\n manager: ResourceManagerBuilder,\n resource: ResourceJson.Normalized.IImporterResourceDecl,\n context?: ImportContext\n ): Result<ResourceBuilder> {\n if (context) {\n return ResourceJson.Helpers.mergeLooseResource(resource, context.baseId, context.conditions).onSuccess(\n (merged) => manager.addResource(merged)\n );\n } /* c8 ignore next 4 - defense in depth, should be guarded elsewhere */ else if (\n !ResourceJson.Json.isLooseResourceDecl(resource)\n ) {\n return fail('cannot add child resource to manager');\n }\n return manager.addResource(resource);\n }\n\n /**\n * Adds a {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | declared resource candidate}\n * to the supplied {@link Resources.ResourceManagerBuilder | resource manager builder}, merging an optional\n * {@link Import.ImportContext | import context} if provided.\n * @param manager - The {@link Resources.ResourceManagerBuilder | resource manager builder} to which the\n * candidate will be added.\n * @param candidate - The {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | candidate}\n * to add.\n * @param context - Optional {@link Import.ImportContext | import context} to merge with the candidate.\n * @returns `Success` with the {@link Resources.ResourceCandidate | resource candidate} if successful,\n * `Failure` with an error message if not.\n */\n private _addCandidate(\n manager: ResourceManagerBuilder,\n candidate: ResourceJson.Normalized.IImporterResourceCandidateDecl,\n context?: ImportContext\n ): Result<ResourceCandidate> {\n if (context) {\n return ResourceJson.Helpers.mergeLooseCandidate(\n candidate,\n context.baseId,\n context.conditions\n ).onSuccess((merged) => manager.addLooseCandidate(merged));\n } /* c8 ignore next 4 - defense in depth, should be guarded elsewhere */ else if (\n !ResourceJson.Json.isLooseResourceCandidateDecl(candidate)\n ) {\n return fail('cannot add child resource candidate to manager');\n }\n return manager.addLooseCandidate(candidate);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsItemImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/fsItemImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAGd,MAAM,EAGN,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAA0C,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAA+B,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,2BAA2B,CAAC;IACxC,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,qBAAqB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,qBAAa,cAAe,YAAW,SAAS;IAC9C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,SAAgB,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE5D;;OAEG;IACH,SAAgB,qBAAqB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9D;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAc;IAE1D;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,2BAA2B;IAMzD;;;;OAIG;WACW,MAAM,CAAC,MAAM,EAAE,2BAA2B,GAAG,MAAM,CAAC,cAAc,CAAC;IAIjF;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,sBAAsB,GAChC,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAwDtD,OAAO,CAAC,yBAAyB;IAIjC,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,wBAAwB;IAMhC;;;;OAIG;IACH,SAAS,CAAC,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC;CASxG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsItemImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/fsItemImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CASuB;AACvB,oDAAsF;AAKtF,sCAAuD;AAYvD;;;GAGG;AACH,MAAa,cAAc;IAqBzB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BAAc,EAAC,2DAA2D,EAAE,QAAQ,CAAC,CAAC;QAC/F,CAAC;QACD,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,CAAC,IAAI,iDAAiD,EAAE,SAAS,CAAC,CAAC;IAClG,CAAC;CACF;AAvID,wCAuIC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n captureResult,\n DetailedResult,\n failWithDetail,\n MessageAggregator,\n Result,\n succeed,\n succeedWithDetail,\n Converter\n} from '@fgv/ts-utils';\nimport { Converters as JsonConverters, FileTree, JsonValue } from '@fgv/ts-json-base';\nimport { ResourceManagerBuilder } from '../../resources';\nimport { IImportable, IImportableJson, Importable } from '../importable';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { FsItem, FsItemResultDetail } from '../fsItem';\n\n/**\n * Parameters for creating a {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @public\n */\nexport interface IFsItemImporterCreateParams {\n qualifiers: IReadOnlyQualifierCollector;\n fileContentConverter?: Converter<JsonValue>;\n fileContentExtensions?: ReadonlyArray<string>;\n}\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`.\n * @public\n */\nexport class FsItemImporter implements IImporter {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use for this importer.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Optional converter used to parse raw file contents before they are exposed as JSON importables.\n */\n public readonly fileContentConverter?: Converter<JsonValue>;\n\n /**\n * Optional list of file extensions which should be parsed using the file content converter.\n */\n public readonly fileContentExtensions?: ReadonlyArray<string>;\n\n /**\n * The types of {@link Import.IImportable | importables} that this importer can handle.\n */\n public readonly types: ReadonlyArray<string> = ['fsItem'];\n\n /**\n * Protected constructor for the {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.FsItemImporter | FsItemImporter}.\n */\n protected constructor(params: IFsItemImporterCreateParams) {\n this.qualifiers = params.qualifiers;\n this.fileContentConverter = params.fileContentConverter;\n this.fileContentExtensions = params.fileContentExtensions;\n }\n\n /**\n * Creates a new {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @returns `Success` with the new `FsItemImporter` if successful, `Failure` with an error message if not.\n */\n public static create(params: IFsItemImporterCreateParams): Result<FsItemImporter> {\n return captureResult(() => new FsItemImporter(params));\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n __manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n const {\n value: fsItem,\n message: getTreeMessage,\n detail: getTreeDetail\n } = this._getFileTreeItemFromImportable(item);\n if (getTreeMessage !== undefined) {\n return failWithDetail(getTreeMessage, getTreeDetail === 'skipped' ? 'skipped' : 'failed');\n }\n\n const { value: context, message: getContextMessage } = fsItem.getContext().onSuccess((fsItemContext) => {\n return item.context ? item.context.extend(fsItemContext) : succeed(fsItemContext);\n });\n\n /* c8 ignore next 3 - defensive coding: getContext failure is extremely rare in practice */\n if (getContextMessage) {\n return failWithDetail(getContextMessage, 'failed');\n }\n\n if (fsItem.item.type === 'directory') {\n return fsItem.item\n .getChildren()\n .onSuccess((children) => {\n const errors = new MessageAggregator();\n const items: Importable[] = [];\n for (const child of children) {\n const { value: item, message, detail } = FsItem.createForItem(child, this.qualifiers);\n if (item) {\n items.push({ type: 'fsItem', item, context });\n } else if (detail !== 'skipped') {\n errors.addMessage(message);\n }\n }\n return errors.returnOrReport(succeed(items));\n })\n .withDetail('failed', 'processed');\n } else if (fsItem.item.type === 'file') {\n if (!this._isSupportedFileExtension(fsItem.item.extension)) {\n return succeedWithDetail([], 'skipped');\n }\n\n return this._getJsonContents(fsItem.item)\n .onSuccess((json) => {\n const jsonItem: IImportableJson = {\n type: 'json',\n json,\n context\n };\n return succeed([jsonItem]);\n })\n .withDetail('failed', 'processed');\n }\n /* c8 ignore next 2 - defensive coding: fallback case for unsupported file types */\n return succeedWithDetail([], 'skipped');\n }\n\n private _isSupportedFileExtension(extension: string): boolean {\n return extension === '.json' || this._canConvertFileExtension(extension);\n }\n\n private _getJsonContents(file: FileTree.IFileTreeFileItem): Result<JsonValue> {\n const converter = this.fileContentConverter;\n if (converter !== undefined) {\n return file.getRawContents().onSuccess((contents) => converter.convert(contents));\n }\n\n return file.getContents(JsonConverters.jsonValue);\n }\n\n private _canConvertFileExtension(extension: string): boolean {\n return (\n this.fileContentConverter !== undefined && this.fileContentExtensions?.includes(extension) === true\n );\n }\n\n /**\n * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.\n * @param item - The importable to convert.\n * @returns `Success` containing the `FsItem` if successful, `Failure` with an error message if not.\n */\n protected _getFileTreeItemFromImportable(item: IImportable): DetailedResult<FsItem, FsItemResultDetail> {\n if (item.type === 'fsItem') {\n if ('item' in item && item.item instanceof FsItem) {\n return succeedWithDetail(item.item, 'succeeded');\n }\n return failWithDetail(`malformed fsItem importable does not contain a valid item`, 'failed');\n }\n return failWithDetail(`${item.type}: invalid importable type for an FsItemImporter`, 'skipped');\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importer.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/importer.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtC;;;;;;;OAOG;IACH,MAAM,CACJ,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC,CAAC;CACxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importer.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/importer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { DetailedResult } from '@fgv/ts-utils';\nimport { IImportable } from '../importable';\nimport { ResourceManagerBuilder } from '../../resources';\n\n/**\n * Possible results of an import operation.\n * @public\n */\nexport type ImporterResultDetail = 'consumed' | 'processed' | 'skipped' | 'failed';\n\n/**\n * Generic interface for an importer than accepts a typed\n * {@link Import.IImportable | importable} item, extracts any resources\n * or candidates from it, and returns an optional list of\n * additional importable items derived from the original.\n * @public\n */\nexport interface IImporter {\n /**\n * The types of {@link Import.Importable | importable} items that this importer can process.\n */\n readonly types: ReadonlyArray<string>;\n\n /**\n * Imports an item, extracting any resources or candidates from it and returns an optional\n * list of additional importable items derived from it.\n * @param item - The {@link Import.IImportable | importable} item to import.\n * @param manager - The {@link Resources.ResourceManagerBuilder | resource manager builder} to use for the import.\n * @returns `Success` with a list of additional importable items derived from the original, or\n * `Failure` with an error message and a {@link Import.Importers.ImporterResultDetail | result detail}.\n */\n import(\n item: IImportable,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.browser.ts"],"names":[],"mappings":"AAwBA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,oEAAoE;AAEpE,6CAA2B;AAC3B,uDAAqC;AACrC,iDAA+B;AAE/B,yBAAyB;AACzB,gDAAgD;AAChD,oEAAoE","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n// Browser-safe importers - excludes Node.js filesystem dependencies\n\nexport * from './importer';\nexport * from './collectionImporter';\nexport * from './jsonImporter';\n\n// Excluded from browser:\n// - fsItemImporter (processes filesystem items)\n// - pathImporter (requires Node.js fs via FileTree.forFilesystem())\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.ts"],"names":[],"mappings":"AAsBA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,uDAAqC;AACrC,mDAAiC;AACjC,iDAA+B;AAC/B,iDAA+B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './importer';\nexport * from './collectionImporter';\nexport * from './fsItemImporter';\nexport * from './jsonImporter';\nexport * from './pathImporter';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/jsonImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,cAAc,EAAkB,MAAM,EAAW,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAA6C,MAAM,eAAe,CAAC;AAGvF;;;GAGG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAY;IAExD;;OAEG;IACH,SAAS;IAET;;;;OAIG;WACW,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;IAI5C;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAsBtD,OAAO,CAAC,4BAA4B;IAepC,OAAO,CAAC,sBAAsB;CAqC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/jsonImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA+F;AAG/F,8CAAuF;AACvF,kEAAoD;AAEpD;;;GAGG;AACH,MAAa,YAAY;IAMvB;;OAEG;IACH;QARA;;WAEG;QACa,UAAK,GAA0B,CAAC,MAAM,CAAC,CAAC;IAK/B,CAAC;IAE1B;;;;OAIG;IACI,MAAM,CAAC,MAAM;QAClB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACI,MAAM,CACX,IAAiB,EACjB,OAA+B;;QAE/B,qEAAqE;QACrE,IAAI,CAAC,IAAA,yBAAY,EAAC,IAAI,CAAC,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,UAAU,GAAe;gBAC7B,IAAI,EAAE,cAAc;gBACpB,IAAI;gBACJ,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;YACF,OAAO,IAAA,kBAAO,EAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC;aACD,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;CA0BF;AApGD,oCAoGC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, DetailedResult, failWithDetail, Result, succeed } from '@fgv/ts-utils';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { ResourceManagerBuilder } from '../../resources';\nimport { IImportable, IImportableJson, Importable, isImportable } from '../importable';\nimport * as ResourceJson from '../../resource-json';\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.\n * @public\n */\nexport class JsonImporter implements IImporter {\n /**\n * {@inheritDoc Import.Importers.IImporter.types}\n */\n public readonly types: ReadonlyArray<string> = ['json'];\n\n /**\n * Protected {@link Import.Importers.JsonImporter | JsonImporter} constructor for derived classes.\n */\n protected constructor() {}\n\n /**\n * Creates a new {@link Import.Importers.JsonImporter | JsonImporter} instance.\n * @returns `Success` with the new {@link Import.Importers.JsonImporter | JsonImporter} if successful,\n * `Failure` otherwise.\n */\n public static create(): Result<JsonImporter> {\n return captureResult(() => new JsonImporter());\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n /* c8 ignore next 1 - coverage intermittently misses the next line */\n if (!isImportable(item) || item.type !== 'json') {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n const name = item.context?.baseId ?? 'unknown';\n return failWithDetail(`${name}: invalid JSON importable (${item.type})`, 'skipped');\n }\n return (\n this._tryImportResourceCollection(item)\n .onFailure(() => this._tryImportResourceTree(item))\n // experimenting with this, accepting any JSON object here makes it\n // very hard to distinguish a collection or tree with a typo from a\n // legitimate single loose resource, which yields extremely confusing\n // error messages. Disabled until/unless we come up with a better plan.\n //.onFailure(() => this._tryImportResource(item, manager));\n .onFailure(() =>\n /* c8 ignore next 1 - defense in depth */\n failWithDetail(`${item.context?.baseId ?? 'unknown'}: unrecognized JSON format.`, 'failed')\n )\n );\n }\n\n private _tryImportResourceCollection(\n item: IImportableJson\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n return ResourceJson.ResourceDeclCollection.create(item.json)\n .onSuccess((collection) => {\n const importable: Importable = {\n type: 'resourceCollection',\n collection,\n context: item.context\n };\n return succeed([importable]);\n })\n .withDetail('skipped', 'consumed');\n }\n\n private _tryImportResourceTree(item: IImportableJson): DetailedResult<IImportable[], ImporterResultDetail> {\n return ResourceJson.ResourceDeclTree.create(item.json)\n .onSuccess((tree) => {\n const importable: Importable = {\n type: 'resourceTree',\n tree,\n context: item.context\n };\n return succeed([importable]);\n })\n .withDetail('skipped', 'consumed');\n }\n\n /* \n * This is disabled for now because it's too easy to accidentally import\n * a single loose resource as a collection or tree, which yields extremely\n * confusing error messages.\n\n private _tryImportResource(\n item: IImportableJson,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n return JsonConverters.jsonObject\n .convert(item.json)\n .onSuccess((json) => {\n // c8 ignore next 2 - defense in depth\n const id = item.context?.baseId ?? '';\n const conditions = item.context?.conditions;\n const candidate: ResourceJson.Json.ILooseResourceCandidateDecl = { id, conditions, json };\n return manager.addLooseCandidate(candidate);\n })\n .onSuccess(() => {\n return succeed([]);\n })\n .withDetail('failed', 'consumed');\n }\n */\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,cAAc,EAAkB,MAAM,EAAqB,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,2BAA2B,CAAC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,SAAgB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAExC;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAY;IAExD;;;OAGG;IACH,SAAgB,eAAe,EAAE,MAAM,EAAE,CAAC;IAE1C;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,yBAAyB;IAMvD;;;;OAIG;WACW,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAAC,YAAY,CAAC;IAI7E;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,sBAAsB,GAChC,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAqBtD;;;;OAIG;IACH,SAAS,CAAC,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC;CASxG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAyG;AACzG,oDAA6C;AAK7C,sCAAuD;AAYvD;;;;GAIG;AACH,MAAa,YAAY;IAsBvB;;;OAGG;IACH,YAAsB,MAAiC;;QAfvD;;WAEG;QACa,UAAK,GAA0B,CAAC,MAAM,CAAC,CAAC;QAatD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,uBAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAI,CAAC,eAAe,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,EAAE,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,MAAiC;QACpD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE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Q,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,CAAC,IAAI,8CAA8C,EAAE,SAAS,CAAC,CAAC;IAC/F,CAAC;CACF;AAlFD,oCAkFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, DetailedResult, failWithDetail, Result, succeedWithDetail } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { ResourceManagerBuilder } from '../../resources';\nimport { IImportable } from '../importable';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { FsItem, FsItemResultDetail } from '../fsItem';\n\n/**\n * Parameters for creating a {@link Import.Importers.PathImporter | PathImporter}.\n * @public\n */\nexport interface IPathImporterCreateParams {\n qualifiers: IReadOnlyQualifierCollector;\n tree?: FileTree.FileTree;\n ignoreFileTypes?: string[];\n}\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`\n * given a path.\n * @public\n */\nexport class PathImporter implements IImporter {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use for this importer.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * The `FileTree` from which resources will be imported.\n */\n public readonly tree: FileTree.FileTree;\n\n /**\n * The types of {@link Import.IImportable | importables} that this importer can handle.\n */\n public readonly types: ReadonlyArray<string> = ['path'];\n\n /**\n * The types of files to ignore when importing. Any file not ignored is converted\n * to an {@link Import.IImportableFsItem | IImportableFsItem}.\n */\n public readonly ignoreFileTypes: string[];\n\n /**\n * Protected constructor for the {@link Import.Importers.PathImporter | PathImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.PathImporter | PathImporter}.\n */\n protected constructor(params: IPathImporterCreateParams) {\n this.qualifiers = params.qualifiers;\n this.tree = params.tree ?? FileTree.forFilesystem().orThrow();\n this.ignoreFileTypes = params.ignoreFileTypes ?? [];\n }\n\n /**\n * Creates a new {@link Import.Importers.PathImporter | PathImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.PathImporter | dirPathImporter}.\n * @returns `Success` with the new `PathImporter` if successful, `Failure` with an error message if not.\n */\n public static create(params: IPathImporterCreateParams): Result<PathImporter> {\n return captureResult(() => new PathImporter(params));\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n __manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n const {\n value: fsItem,\n message: getTreeMessage,\n detail: getTreeDetail\n } = this._getFileTreeItemFromImportable(item);\n if (getTreeMessage !== undefined) {\n return failWithDetail(getTreeMessage, getTreeDetail === 'skipped' ? 'skipped' : 'failed');\n }\n\n if (fsItem.item.type === 'file' && this.ignoreFileTypes.includes(fsItem.item.extension)) {\n return succeedWithDetail([], 'processed');\n }\n\n // extracted characteristics are in the fsItem so add them to the context when\n // that is imported instead of now.\n const context = item.context;\n\n return succeedWithDetail([{ type: 'fsItem', item: fsItem, context }], 'processed');\n }\n\n /**\n * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.\n * @param item - The importable to convert.\n * @returns `Success` containing the `FsItem` if successful, `Failure` with an error message if not.\n */\n protected _getFileTreeItemFromImportable(item: IImportable): DetailedResult<FsItem, FsItemResultDetail> {\n if (item.type === 'path') {\n if ('path' in item && typeof item.path === 'string') {\n return FsItem.createForPath(item.path, this.qualifiers, this.tree);\n }\n return failWithDetail(`malformed path importable does not contain a string path`, 'failed');\n }\n return failWithDetail(`${item.type}: invalid importable type for a PathImporter`, 'skipped');\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/index.browser.ts"],"names":[],"mappings":"AAwBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/packlets/import/index.browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yEAAyE;AAEzE,kDAAgC;AAChC,+CAA6B;AAC7B,kDAAgC;AAEhC,kEAAkE;AAClE,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,mCAAmC;AACnC,qEAAuD;AAC9C,8BAAS;AAElB,yBAAyB;AACzB,4FAA4F;AAC5F,qEAAqE","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n// Browser-safe import exports - excludes Node.js filesystem dependencies\n\nexport * from './importContext';\nexport * from './importable';\nexport * from './importManager';\n\n// Export FsItem class (browser-safe for in-memory FileTree usage)\nexport { FsItem } from './fsItem';\n\n// Use browser-safe importers index\nimport * as Importers from './importers/index.browser';\nexport { Importers };\n\n// Excluded from browser:\n// - FsItem.createForPath() static method (requires Node.js fs via FileTree.forFilesystem())\n// - PathImporter and FsItemImporter (via importers/index.browser.ts)\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/index.ts"],"names":[],"mappings":"AAsBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAEhC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/import/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAgC;AAChC,+CAA6B;AAC7B,2CAAyB;AACzB,kDAAgC;AAEhC,uDAAyC;AAChC,8BAAS","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './importContext';\nexport * from './importable';\nexport * from './fsItem';\nexport * from './importManager';\n\nimport * as Importers from './importers';\nexport { Importers };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/convert.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA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AO,CAAC,SAAS,CAAC;IACzC,aAAa,EAAE,kCAA0B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC;AAEL;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,qBAAU,CAAC,mBAAmB,CACrE,YAAY,EACZ;IACE,QAAQ,EAAE,yCAAiC;IAC3C,SAAS,EAAE,0CAAkC;IAC7C,OAAO,EAAE,wCAAgC;CAC1C,CACF,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,MAAwB;IAExB,OAAO,qBAAU,CAAC,YAAY,CAAoC;QAChE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;QACtC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;QAC5C,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE;KACjC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,mBAAmB,CAAC,yBAAc,CAAC,UAAU,CAAC,CAAC;AAEtF;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,qBAAU,CAAC,KAAK,CAAgC;IACpF,+BAAuB;IACvB,iCAAyB;CAC1B,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converter, Converters } from '@fgv/ts-utils';\nimport * as Model from './json';\nimport * as Common from '../../common';\nimport { Converters as JsonConverters } from '@fgv/ts-json-base';\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.\n * @public\n */\nexport const languageQualifierTypeConfig = Converters.strictObject<Model.ILanguageQualifierTypeConfig>({\n allowContextList: Converters.boolean.optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.\n * @public\n */\nexport const territoryQualifierTypeConfig = Converters.strictObject<Model.ITerritoryQualifierTypeConfig>({\n allowContextList: Converters.boolean,\n acceptLowercase: Converters.boolean.optional(),\n allowedTerritories: Converters.arrayOf(Converters.string).optional(),\n hierarchy: Converters.recordOf(Converters.string).optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.\n * @public\n */\nexport const literalQualifierTypeConfig = Converters.strictObject<Model.ILiteralQualifierTypeConfig>({\n allowContextList: Converters.boolean.optional(),\n caseSensitive: Converters.boolean.optional(),\n enumeratedValues: Converters.arrayOf(Converters.string).optional(),\n hierarchy: Converters.recordOf(Converters.string).optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.\n * @public\n */\nexport const systemLanguageQualifierTypeConfig =\n Converters.strictObject<Model.ISystemLanguageQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('language'),\n configuration: languageQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.\n * @public\n */\nexport const systemTerritoryQualifierTypeConfig =\n Converters.strictObject<Model.ISystemTerritoryQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('territory'),\n configuration: territoryQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.\n * @public\n */\nexport const systemLiteralQualifierTypeConfig =\n Converters.strictObject<Model.ISystemLiteralQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('literal'),\n configuration: literalQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.\n * @public\n */\nexport const systemQualifierTypeConfig = Converters.discriminatedObject<Model.ISystemQualifierTypeConfig>(\n 'systemType',\n {\n language: systemLanguageQualifierTypeConfig,\n territory: systemTerritoryQualifierTypeConfig,\n literal: systemLiteralQualifierTypeConfig\n }\n);\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @param config - A `Converter` for the configuration object.\n * @public\n */\nexport function qualifierTypeConfig<T, TD = unknown>(\n config: Converter<T, TD>\n): Converter<Model.IQualifierTypeConfig<T>, TD> {\n return Converters.strictObject<Model.IQualifierTypeConfig<T>, TD>({\n name: Common.Convert.qualifierTypeName,\n systemType: Common.Convert.qualifierTypeName,\n configuration: config.optional()\n });\n}\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @public\n */\nexport const jsonQualifierTypeConfig = qualifierTypeConfig(JsonConverters.jsonObject);\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.\n * @public\n */\nexport const anyQualifierTypeConfig = Converters.oneOf<Model.IAnyQualifierTypeConfig>([\n jsonQualifierTypeConfig,\n systemQualifierTypeConfig\n]);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './json';\n\nexport { Convert };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/json.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,UAAU;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CAAC,C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],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AA6GH,kEAMC;AAbD;;;;;;GAMG;AACH,SAAgB,2BAA2B,CACzC,MAA+B;IAE/B,OAAO,CACL,MAAM,CAAC,UAAU,KAAK,UAAU,IAAI,MAAM,CAAC,UAAU,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,CACzG,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\n\n/**\n * Templated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport interface IQualifierTypeConfig<T = JsonObject> {\n name: string;\n systemType: string;\n configuration?: T;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ILanguageQualifierTypeConfig {\n allowContextList?: boolean;\n}\n\n/**\n * Declares a hierarchy of literal values. The keys are the names of the values, and the\n * values are the names of their parents.\n * @remarks\n * The hierarchy is defined as a tree, where each value can have multiple children but\n * only one parent. The root of the tree has no parent. The hierarchy is used to\n * determine the relationship between values when matching conditions and contexts.\n * @public\n */\nexport type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;\n\n/**\n * Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ITerritoryQualifierTypeConfig {\n allowContextList?: boolean;\n\n acceptLowercase?: boolean;\n allowedTerritories?: string[];\n\n /**\n * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}\n * of territory values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ILiteralQualifierTypeConfig {\n allowContextList?: boolean;\n caseSensitive?: boolean;\n enumeratedValues?: string[];\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ISystemLanguageQualifierTypeConfig\n extends IQualifierTypeConfig<ILanguageQualifierTypeConfig> {\n systemType: 'language';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ISystemTerritoryQualifierTypeConfig\n extends IQualifierTypeConfig<ITerritoryQualifierTypeConfig> {\n systemType: 'territory';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ISystemLiteralQualifierTypeConfig extends IQualifierTypeConfig<ILiteralQualifierTypeConfig> {\n systemType: 'literal';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport type ISystemQualifierTypeConfig =\n | ISystemLanguageQualifierTypeConfig\n | ISystemTerritoryQualifierTypeConfig\n | ISystemLiteralQualifierTypeConfig;\n\n/**\n * A union of all qualifier type configurations.\n * @public\n */\nexport type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;\n\n/**\n * Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a\n * {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.\n * @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.\n * @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.\n * @public\n */\nexport function isSystemQualifierTypeConfig(\n config: IAnyQualifierTypeConfig\n): config is ISystemQualifierTypeConfig {\n return (\n config.systemType === 'language' || config.systemType === 'territory' || config.systemType === 'literal'\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/convert.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,8BAA8B,CAAC;CAChD;AAED;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,gGAgBzB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,SAAS,MAAM,EAChE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC,GAC3B,SAAS,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAOlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA+CH,8EASC;AAtDD,4CAAoE;AAcpE;;;;;GAKG;AACH,kDAAkD;AACrC,QAAA,aAAa,GAAG,qBAAU,CAAC,OAAO,CAC7C,CACE,IAAa,EACb,MAA8D,EAC9D,OAAsC,EACf,EAAE;IACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAA,eAAI,EAAC,4CAA4C,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,IAAA,eAAI,EAAC,qDAAqD,CAAC,CAAC;AACrE,CAAC,CACF,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,iCAAiC,CAC/C,cAA4B;IAE5B,OAAO,qBAAU,CAAC,MAAM,CAAwC;QAC9D,MAAM,EAAE,qBAAU,CAAC,OAAO,CAAC,cAAc,CAAC;QAC1C,SAAS,EAAE,qBAAU,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC7C,YAAY,EAAE,cAAc;SAC7B,CAAC;KACH,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, Result, fail } from '@fgv/ts-utils';\nimport { QualifierType } from './qualifierType';\nimport { ReadOnlyQualifierTypeCollector } from './qualifierTypeCollector';\nimport { ILiteralValueHierarchyCreateParams } from './literalValueHierarchy';\n\n/**\n * Context necessary to convert a qualifier name or number to an instantiated\n * {@link QualifierTypes.QualifierType}.\n * @public\n */\nexport interface IQualifierTypeConvertContext {\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n}\n\n/**\n * Converter for {@link QualifierTypes.QualifierType | QualifierType} objects,\n * retrieves a {@link QualifierTypes.QualifierType | QualifierType} by name or\n * index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.\n * @public\n */\n// eslint-disable-next-line @rushstack/typedef-var\nexport const qualifierType = Converters.generic<QualifierType, IQualifierTypeConvertContext>(\n (\n from: unknown,\n __self: Converter<QualifierType, IQualifierTypeConvertContext>,\n context?: IQualifierTypeConvertContext\n ): Result<QualifierType> => {\n if (!context) {\n return fail('qualifierType converter requires a context');\n }\n if (typeof from === 'string') {\n return context.qualifierTypes.validating.get(from);\n } else if (typeof from === 'number') {\n return context.qualifierTypes.getAt(from);\n }\n return fail('qualifierType converter requires a string or number');\n }\n);\n\n/**\n * Gets a converter for {@link QualifierTypes.ILiteralValueHierarchyCreateParams | ILiteralValueHierarchyCreateParams}\n * objects with values validated by a supplied value converter.\n * @param valueConverter - Converter for the literal value type.\n * @public\n */\nexport function literalValueHierarchyCreateParams<T extends string>(\n valueConverter: Converter<T>\n): Converter<ILiteralValueHierarchyCreateParams<T>> {\n return Converters.object<ILiteralValueHierarchyCreateParams<T>>({\n values: Converters.arrayOf(valueConverter),\n hierarchy: Converters.recordOf(valueConverter, {\n keyConverter: valueConverter\n })\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAQ,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAExG;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,CAAC,uBAAuB,GACzC,MAAM,CAAC,aAAa,CAAC,CAyBvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,MAAM,CAAC,0BAA0B,GAC5C,MAAM,CAAC,mBAAmB,CAAC,CAa7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,sEA2BC;AAYD,kFAeC;AA/ED,4CAA6C;AAC7C,iDAAmC;AAEnC,mEAAgE;AAChE,qE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C;QAC7D,KAAK,SAAS;YACZ,OAAO,2CAAoB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC7D,CAAC;IACD,0CAA0C;IAC1C,mBAAmB;IACnB,OAAO,IAAA,eAAI,EAAC,GAAG,UAAU,kCAAkC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, Result } from '@fgv/ts-utils';\nimport * as Config from './config';\nimport { QualifierType } from './qualifierType';\nimport { LanguageQualifierType } from './languageQualifierType';\nimport { TerritoryQualifierType } from './territoryQualifierType';\nimport { LiteralQualifierType } from './literalQualifierType';\n\n/**\n * A discriminated union of all system qualifier types.\n * This allows TypeScript to properly discriminate between specific qualifier type implementations\n * and access their specific methods like getConfiguration().\n * @public\n */\nexport type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;\n\n/**\n * Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.QualifierType | QualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromConfig(\n typeConfig: Config.IAnyQualifierTypeConfig\n): Result<QualifierType> {\n /* c8 ignore next 1 - defense in depth */\n const childConfig = typeConfig.configuration ?? {};\n switch (typeConfig.systemType) {\n case 'language':\n return Config.Convert.languageQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LanguageQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'territory':\n return Config.Convert.territoryQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n TerritoryQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'literal':\n return Config.Convert.literalQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LiteralQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n }\n /* c8 ignore next 1 - defense in depth */\n return fail(`Unknown qualifier type: ${typeConfig.systemType}`);\n}\n\n/**\n * Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromSystemConfig(\n typeConfig: Config.ISystemQualifierTypeConfig\n): Result<SystemQualifierType> {\n const { systemType } = typeConfig;\n switch (systemType) {\n case 'language':\n return LanguageQualifierType.createFromConfig(typeConfig);\n case 'territory':\n return TerritoryQualifierType.createFromConfig(typeConfig);\n case 'literal':\n return LiteralQualifierType.createFromConfig(typeConfig);\n }\n /* c8 ignore next 3 - should not happen */\n // @ts-expect-error\n return fail(`${systemType}: Unknown system qualifier type.`);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAmC;AAW1B,wBAAM;AAVf,mDAAqC;AAUpB,0BAAO;AARxB,kDAAgC;AAChC,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,2DAAyC;AACzC,4CAA0B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Config from './config';\nimport * as Convert from './convert';\n\nexport * from './qualifierType';\nexport * from './languageQualifierType';\nexport * from './literalQualifierType';\nexport * from './literalValueHierarchy';\nexport * from './territoryQualifierType';\nexport * from './qualifierTypeCollector';\nexport * from './helpers';\n\nexport { Config, Convert };\n"]}
|