@fgv/ts-res 5.1.0-2 → 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 +2 -4
- 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 +4 -4
- 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 +2 -2
- package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
- package/dist/packlets/common/validate/resources.js +1 -1
- package/dist/packlets/common/validate/resources.js.map +1 -0
- package/dist/packlets/conditions/condition.js +3 -7
- 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 +78 -0
- package/dist/packlets/config/common.js.map +1 -0
- package/dist/packlets/config/configInitFactory.js +258 -0
- package/dist/packlets/config/configInitFactory.js.map +1 -0
- package/dist/packlets/config/convert.js +56 -0
- package/dist/packlets/config/convert.js.map +1 -0
- package/dist/packlets/config/index.browser.js +34 -0
- package/dist/packlets/config/index.browser.js.map +1 -0
- package/dist/packlets/config/index.js +28 -0
- package/dist/packlets/config/index.js.map +1 -0
- package/dist/packlets/config/json.js +23 -0
- package/dist/packlets/config/json.js.map +1 -0
- package/dist/packlets/config/predefined/default.js +138 -0
- package/dist/packlets/config/predefined/default.js.map +1 -0
- package/dist/packlets/config/predefined/extended.js +190 -0
- package/dist/packlets/config/predefined/extended.js.map +1 -0
- package/dist/packlets/config/predefined/index.js +25 -0
- package/dist/packlets/config/predefined/index.js.map +1 -0
- package/dist/packlets/config/systemConfiguration.js +147 -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 +1 -1
- package/dist/packlets/decisions/decision.js.map +1 -0
- package/dist/packlets/decisions/index.js.map +1 -0
- package/dist/packlets/import/fsItem.js +1 -4
- package/dist/packlets/import/fsItem.js.map +1 -0
- package/dist/packlets/import/importContext.js +3 -3
- package/dist/packlets/import/importContext.js.map +1 -0
- package/dist/packlets/import/importManager.js +7 -3
- 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 +2 -2
- package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
- package/dist/packlets/import/importers/fsItemImporter.js +30 -14
- 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 +2 -2
- package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
- package/dist/packlets/import/importers/pathImporter.js +1 -1
- 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 +124 -0
- package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
- package/dist/packlets/qualifier-types/config/index.js +25 -0
- package/dist/packlets/qualifier-types/config/index.js.map +1 -0
- package/dist/packlets/qualifier-types/config/json.js +32 -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 +6 -7
- package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
- package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
- 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 +12 -13
- 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 +5 -5
- 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 +6 -7
- package/dist/packlets/qualifiers/qualifier.js.map +1 -0
- package/dist/packlets/qualifiers/qualifierCollector.js +2 -2
- 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 +1 -1
- 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 +1 -1
- package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
- package/dist/packlets/resource-types/config/convert.js +35 -0
- package/dist/packlets/resource-types/config/convert.js.map +1 -0
- package/dist/packlets/resource-types/config/index.js +25 -0
- package/dist/packlets/resource-types/config/index.js.map +1 -0
- package/dist/packlets/resource-types/config/json.js +23 -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 +2 -2
- package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
- package/dist/packlets/resource-types/resourceType.js +2 -2
- 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 +2 -2
- package/dist/packlets/resources/resourceBuilder.js.map +1 -0
- package/dist/packlets/resources/resourceCandidate.js.map +1 -0
- package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
- 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 +5 -5
- 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/dist/ts-res.d.ts +134 -112
- package/dist/tsdoc-metadata.json +1 -1
- 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 +2 -4
- package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
- package/lib/packlets/common/helpers/resources.js +2 -4
- 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 +4 -4
- package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
- package/lib/packlets/common/validate/conditions.js +4 -4
- 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 +2 -2
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
- package/lib/packlets/common/validate/regularExpressions.js +2 -2
- package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
- package/lib/packlets/common/validate/resources.d.ts +1 -1
- package/lib/packlets/common/validate/resources.d.ts.map +1 -0
- package/lib/packlets/common/validate/resources.js +1 -1
- package/lib/packlets/common/validate/resources.js.map +1 -0
- package/lib/packlets/conditions/condition.d.ts +3 -7
- package/lib/packlets/conditions/condition.d.ts.map +1 -0
- package/lib/packlets/conditions/condition.js +3 -7
- 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 +35 -0
- package/lib/packlets/config/common.d.ts.map +1 -0
- package/lib/packlets/config/common.js +97 -0
- package/lib/packlets/config/common.js.map +1 -0
- package/lib/packlets/config/configInitFactory.d.ts +217 -0
- package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
- package/lib/packlets/config/configInitFactory.js +303 -0
- package/lib/packlets/config/configInitFactory.js.map +1 -0
- package/lib/packlets/config/convert.d.ts +23 -0
- package/lib/packlets/config/convert.d.ts.map +1 -0
- package/lib/packlets/config/convert.js +93 -0
- package/lib/packlets/config/convert.js.map +1 -0
- package/lib/packlets/config/index.browser.d.ts +7 -0
- package/lib/packlets/config/index.browser.d.ts.map +1 -0
- package/lib/packlets/config/index.browser.js +74 -0
- package/lib/packlets/config/index.browser.js.map +1 -0
- package/lib/packlets/config/index.d.ts +7 -0
- package/lib/packlets/config/index.d.ts.map +1 -0
- package/lib/packlets/config/index.js +68 -0
- package/lib/packlets/config/index.js.map +1 -0
- package/lib/packlets/config/json.d.ts +20 -0
- package/lib/packlets/config/json.d.ts.map +1 -0
- package/lib/packlets/config/json.js +24 -0
- package/lib/packlets/config/json.js.map +1 -0
- package/lib/packlets/config/predefined/default.d.ts +57 -0
- package/lib/packlets/config/predefined/default.d.ts.map +1 -0
- package/lib/packlets/config/predefined/default.js +141 -0
- package/lib/packlets/config/predefined/default.js.map +1 -0
- package/lib/packlets/config/predefined/extended.d.ts +25 -0
- package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
- package/lib/packlets/config/predefined/extended.js +193 -0
- package/lib/packlets/config/predefined/extended.js.map +1 -0
- package/lib/packlets/config/predefined/index.d.ts +4 -0
- package/lib/packlets/config/predefined/index.d.ts.map +1 -0
- package/lib/packlets/config/predefined/index.js +62 -0
- package/lib/packlets/config/predefined/index.js.map +1 -0
- package/lib/packlets/config/systemConfiguration.d.ts +94 -0
- package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
- package/lib/packlets/config/systemConfiguration.js +152 -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 +1 -1
- package/lib/packlets/decisions/decision.d.ts.map +1 -0
- package/lib/packlets/decisions/decision.js +1 -1
- 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 +1 -4
- package/lib/packlets/import/fsItem.d.ts.map +1 -0
- package/lib/packlets/import/fsItem.js +1 -4
- package/lib/packlets/import/fsItem.js.map +1 -0
- package/lib/packlets/import/importContext.d.ts +5 -5
- package/lib/packlets/import/importContext.d.ts.map +1 -0
- package/lib/packlets/import/importContext.js +3 -3
- package/lib/packlets/import/importContext.js.map +1 -0
- package/lib/packlets/import/importManager.d.ts +15 -1
- package/lib/packlets/import/importManager.d.ts.map +1 -0
- package/lib/packlets/import/importManager.js +7 -3
- 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 +2 -2
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/collectionImporter.js +2 -2
- package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.js +29 -13
- 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 +2 -2
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/jsonImporter.js +2 -2
- package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
- package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
- package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/pathImporter.js +1 -1
- 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 +65 -0
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/convert.js +161 -0
- package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
- package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
- package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/index.js +64 -0
- package/lib/packlets/qualifier-types/config/index.js.map +1 -0
- package/lib/packlets/qualifier-types/config/json.d.ts +91 -0
- package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/json.js +35 -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 +6 -7
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
- 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 +17 -18
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.js +12 -13
- 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 +8 -8
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
- 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 +6 -7
- package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifier.js +6 -7
- package/lib/packlets/qualifiers/qualifier.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.d.ts +3 -3
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.js +2 -2
- 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 +1 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
- 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 +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
- package/lib/packlets/resource-types/config/convert.d.ts +8 -0
- package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/convert.js +38 -0
- package/lib/packlets/resource-types/config/convert.js.map +1 -0
- package/lib/packlets/resource-types/config/index.d.ts +4 -0
- package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/index.js +64 -0
- package/lib/packlets/resource-types/config/index.js.map +1 -0
- package/lib/packlets/resource-types/config/json.d.ts +11 -0
- package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/json.js +24 -0
- package/lib/packlets/resource-types/config/json.js.map +1 -0
- package/lib/packlets/resource-types/helpers.d.ts.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 +17 -5
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/jsonResourceType.js +2 -2
- package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
- package/lib/packlets/resource-types/resourceType.d.ts +5 -5
- package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/resourceType.js +2 -2
- 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 +2 -2
- package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceBuilder.js +2 -2
- 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 +5 -5
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
- 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 +5 -5
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
- 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 +28 -26
- 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":"index.browser.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAEzB,4EAA4E;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAgBtD,mBAAmB;AACnB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACV,MAAM,oBAAoB,CAAC;AAE5B,YAAY;AACZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,+EAA+E;AAC/E,iEAAiE;AACjE,6EAA6E","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/**\n * Browser-safe ZIP archive functionality for ts-res source file archives\n *\n * This packlet provides consolidated ZIP archive creation and loading functionality\n * for source files, compatible with browsers using fflate.\n *\n * @remarks\n * ZIP archives contain source files for resource ingestion with directory\n * structure preserved and optional validation but no processing or transformation.\n * This is distinct from ZIP bundles which contain processed resource output.\n *\n * ZipArchiveCreator supports browser usage when FileTreeItems are provided directly.\n * Methods accepting file paths require Node.js fs access and should not be called in browser.\n *\n * ZipArchiveLoader is fully browser-compatible and works with File API or ArrayBuffer.\n *\n * @packageDocumentation\n */\n\nimport * as Json from './json';\nimport * as Convert from './convert';\n\n// Namespaces\nexport { Json, Convert };\n\n// Core classes (browser-compatible when used with FileTreeItems or buffers)\nexport { ZipArchiveCreator } from './zipArchiveCreator';\nexport { ZipArchiveLoader } from './zipArchiveLoader';\n\n// Types and interfaces\nexport type {\n IZipArchivePathOptions,\n IZipArchiveFileTreeOptions,\n ZipArchiveOptions,\n IZipArchiveResult,\n IZipArchiveManifest,\n IZipArchiveLoadOptions,\n IZipArchiveLoadResult,\n IImportedFile,\n IImportedDirectory,\n ZipArchiveProgressCallback\n} from './types';\n\n// Format utilities\nexport {\n createZipArchiveManifest,\n parseZipArchiveManifest,\n validateZipArchiveManifest,\n parseZipArchiveConfiguration,\n generateZipArchiveFilename,\n normalizePath,\n getDirectoryName,\n sanitizeFilename,\n isZipFile\n} from './zipArchiveFormat';\n\n// Constants\nexport { ZipArchiveConstants } from './types';\n\n// Note: ZipArchiveCreator._getInputFileTreeItem() and _getConfigFileTreeItem()\n// use FileTree.forFilesystem() internally when given file paths.\n// In browser, provide FileTreeItems directly via IZipArchiveFileTreeOptions.\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAEzB,eAAe;AACf,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAgBtD,mBAAmB;AACnB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACV,MAAM,oBAAoB,CAAC;AAE5B,YAAY;AACZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,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/**\n * ZIP archive functionality for ts-res source file archives\n *\n * This packlet provides consolidated ZIP archive creation and loading functionality\n * for source files, compatible with existing tools while using fflate for\n * universal browser compatibility.\n *\n * @remarks\n * ZIP archives contain source files for resource ingestion with directory\n * structure preserved and optional validation but no processing or transformation.\n * This is distinct from ZIP bundles which contain processed resource output.\n *\n * @packageDocumentation\n */\n\nimport * as Json from './json';\nimport * as Convert from './convert';\n\n// Namespaces\nexport { Json, Convert };\n\n// Core classes\nexport { ZipArchiveCreator } from './zipArchiveCreator';\nexport { ZipArchiveLoader } from './zipArchiveLoader';\n\n// Types and interfaces\nexport type {\n IZipArchivePathOptions,\n IZipArchiveFileTreeOptions,\n ZipArchiveOptions,\n IZipArchiveResult,\n IZipArchiveManifest,\n IZipArchiveLoadOptions,\n IZipArchiveLoadResult,\n IImportedFile,\n IImportedDirectory,\n ZipArchiveProgressCallback\n} from './types';\n\n// Format utilities\nexport {\n createZipArchiveManifest,\n parseZipArchiveManifest,\n validateZipArchiveManifest,\n parseZipArchiveConfiguration,\n generateZipArchiveFilename,\n normalizePath,\n getDirectoryName,\n sanitizeFilename,\n isZipFile\n} from './zipArchiveFormat';\n\n// Constants\nexport { ZipArchiveConstants } from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/json.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\n/**\n * JSON representation of ZIP archive input information\n * @public\n */\nexport interface IZipArchiveInputInfo {\n /** Type of input (file or directory) */\n type: 'file' | 'directory';\n /** Original file/directory path */\n originalPath: string;\n /** Path within the archive (e.g., \"input/mydir\") */\n archivePath: string;\n}\n\n/**\n * JSON representation of ZIP archive config information\n * @public\n */\nexport interface IZipArchiveConfigInfo {\n /** Type of config (always 'file') */\n type: 'file';\n /** Original config file path */\n originalPath: string;\n /** Path within the archive (e.g., \"config.json\") */\n archivePath: string;\n}\n\n/**\n * JSON representation of a ZIP archive manifest\n * Compatible with existing tools from ts-res-browser-cli\n * @public\n */\nexport interface IZipArchiveManifest {\n /** Archive creation timestamp */\n timestamp: string;\n\n /** Optional input source information */\n input?: IZipArchiveInputInfo;\n\n /** Optional configuration file information */\n config?: IZipArchiveConfigInfo;\n}\n\n/**\n * JSON representation of an imported file\n * @public\n */\nexport interface IImportedFile {\n /** File name */\n name: string;\n /** Full path within archive */\n path: string;\n /** File content as string */\n content: string;\n /** MIME type */\n type: string;\n}\n\n/**\n * JSON representation of an imported directory structure\n * @public\n */\nexport interface IImportedDirectory {\n /** Directory name */\n name: string;\n /** Files in this directory */\n files: IImportedFile[];\n /** Subdirectories */\n subdirectories: IImportedDirectory[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA2GH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,yBAAyB;IACzB,aAAa,EAAE,eAAe;IAC9B,8BAA8B;IAC9B,WAAW,EAAE,aAAa;IAC1B,4BAA4B;IAC5B,SAAS,EAAE,OAAO;IAClB,oCAAoC;IACpC,UAAU,EAAE,QAAQ;CACZ,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 { Model as ConfigModel } from '../config';\nimport * as Json from './json';\nimport {} from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\n\n/**\n * Options for creating a ZIP archive buffer\n * @public\n */\nexport interface IZipArchivePathOptions {\n /** File or directory path to include in the archive */\n inputPath?: string;\n /** Optional configuration file path */\n configPath?: string;\n}\n\n/**\n * Options for creating a ZIP archive buffer from a file tree\n * @public\n */\nexport interface IZipArchiveFileTreeOptions {\n /** Input file or directory */\n inputItem?: FileTree.FileTreeItem;\n /** Optional configuration file */\n configItem?: FileTree.IFileTreeFileItem;\n}\n\n/**\n * Options for creating a ZIP archive buffer\n * @public\n */\nexport type ZipArchiveOptions = IZipArchivePathOptions | IZipArchiveFileTreeOptions;\n\n/**\n * Standardized ZIP archive manifest format (compatible with existing tools)\n * @public\n */\nexport type IZipArchiveManifest = Json.IZipArchiveManifest;\n\n/**\n * Result of ZIP archive buffer creation\n * @public\n */\nexport interface IZipArchiveResult {\n /** Raw ZIP data buffer */\n zipBuffer: Uint8Array;\n /** Archive manifest with metadata */\n manifest: IZipArchiveManifest;\n /** Total ZIP size in bytes */\n size: number;\n}\n\n/**\n * Options for loading a ZIP archive\n * @public\n */\nexport interface IZipArchiveLoadOptions {\n /** Validate manifest strictly */\n strictManifestValidation?: boolean;\n}\n\n/**\n * Result of ZIP archive loading\n * @public\n */\nexport interface IZipArchiveLoadResult {\n /** Parsed archive manifest */\n manifest: IZipArchiveManifest | undefined;\n /** Loaded configuration */\n config: ConfigModel.ISystemConfiguration | undefined;\n /** All files extracted from the archive */\n files: IImportedFile[];\n /** Directory structure if available */\n directory: IImportedDirectory | undefined;\n}\n\n/**\n * Imported file representation\n * @public\n */\nexport type IImportedFile = Json.IImportedFile;\n\n/**\n * Imported directory structure\n * @public\n */\nexport type IImportedDirectory = Json.IImportedDirectory;\n\n/**\n * Progress callback for ZIP operations\n * @public\n */\nexport type ZipArchiveProgressCallback = (\n stage:\n | 'reading-file'\n | 'parsing-zip'\n | 'loading-manifest'\n | 'loading-config'\n | 'extracting-files'\n | 'processing-resources'\n | 'creating-zip',\n progress: number, // 0-100\n details: string\n) => void;\n\n/**\n * Constants for ZIP archive structure\n * @public\n */\nexport const ZipArchiveConstants = {\n /** Manifest file name */\n MANIFEST_FILE: 'manifest.json',\n /** Configuration file name */\n CONFIG_FILE: 'config.json',\n /** Input files directory */\n INPUT_DIR: 'input',\n /** Configuration files directory */\n CONFIG_DIR: 'config'\n} as const;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipArchiveCreator.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/zipArchiveCreator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAU,OAAO,E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CAAC,OAAO,CAAC,OAAO,CAAC,UAAW,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,8BAA8B,GAAG,EAAE,CAAC,CACpG,CAAC;QACN,CAAC;aAAM,IAAI,YAAY,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACvE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;CACF","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 { zipSync } from 'fflate';\nimport { Result, succeed, fail } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport type { IZipArchiveResult, ZipArchiveOptions, ZipArchiveProgressCallback } from './types';\nimport { normalizePath } from './zipArchiveFormat';\nimport * as Json from './json';\n\n/**\n * ZIP archive creator using fflate for universal compatibility\n * @public\n */\nexport class ZipArchiveCreator {\n /**\n * Create a ZIP archive buffer from a supplied buffer\n * @param options - Input paths and configuration\n * @param onProgress - Optional progress callback\n * @returns Result containing ZIP buffer and manifest\n */\n public async createFromBuffer(\n options: ZipArchiveOptions,\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<IZipArchiveResult>> {\n try {\n onProgress?.('creating-zip', 0, 'Starting ZIP archive creation');\n\n const files: Record<string, Uint8Array> = {};\n const manifest: Json.IZipArchiveManifest = {\n timestamp: new Date().toISOString()\n };\n\n const { value: inputItem, message: inputItemError } = this._getInputFileTreeItem(options);\n if (inputItemError !== undefined) {\n return fail(inputItemError);\n }\n\n if (inputItem !== undefined) {\n onProgress?.('reading-file', 10, `Processing input: ${inputItem.absolutePath}`);\n\n if (inputItem.type === 'directory') {\n // Add entire directory recursively, preserving structure\n const archivePath = `input/${inputItem.name}`;\n\n const addDirResult = await this._addDirectoryTreeToZip(files, inputItem, archivePath, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addDirResult.isFailure()) {\n return fail(addDirResult.message);\n }\n\n manifest.input = {\n type: 'directory',\n originalPath: inputItem.absolutePath,\n archivePath\n };\n } else if (inputItem.type === 'file') {\n // Add single file\n const archivePath = `input/${inputItem.name}`;\n\n const addFileResult = await this._addFileTreeItemToZip(files, inputItem, archivePath);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addFileResult.isFailure()) {\n return fail(addFileResult.message);\n }\n\n manifest.input = {\n type: 'file',\n originalPath: inputItem.absolutePath,\n archivePath\n };\n }\n }\n\n const { value: configItem, message: configItemError } = this._getConfigFileTreeItem(options);\n if (configItemError !== undefined) {\n return fail(configItemError);\n }\n\n if (configItem !== undefined) {\n onProgress?.('reading-file', 40, `Processing config: ${configItem.absolutePath}`);\n\n const archivePath = `config/${configItem.name}`;\n\n const addConfigResult = await this._addFileTreeItemToZip(files, configItem, archivePath);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addConfigResult.isFailure()) {\n return fail(addConfigResult.message);\n }\n\n // Update manifest with config info\n manifest.config = {\n type: 'file',\n originalPath: configItem.absolutePath,\n archivePath\n };\n }\n\n // Add manifest to ZIP\n onProgress?.('creating-zip', 70, 'Adding manifest');\n const manifestJson = JSON.stringify(manifest, null, 2);\n files['manifest.json'] = new TextEncoder().encode(manifestJson);\n\n // Create ZIP buffer using fflate\n onProgress?.('creating-zip', 80, 'Compressing files');\n const zipBuffer = zipSync(files, { level: 6 });\n\n const result: IZipArchiveResult = {\n zipBuffer,\n manifest,\n size: zipBuffer.length\n };\n\n onProgress?.('creating-zip', 100, 'ZIP archive buffer created');\n\n return succeed(result);\n /* c8 ignore next 3 - defense in depth against internal error */\n } catch (error) {\n return fail(`Failed to create ZIP archive: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Add a single FileTree item to the ZIP archive\n * @param files - ZIP files collection\n * @param fileItem - FileTree file item to add\n * @param archivePath - Path within the archive\n * @returns Result indicating success or failure\n */\n private async _addFileTreeItemToZip(\n files: Record<string, Uint8Array>,\n fileItem: FileTree.IFileTreeFileItem,\n archivePath: string\n ): Promise<Result<void>> {\n return fileItem.getRawContents().onSuccess((content) => {\n const contentBuffer = new TextEncoder().encode(content);\n files[normalizePath(archivePath)] = contentBuffer;\n return succeed(undefined);\n });\n }\n\n /**\n * Add a directory recursively to the ZIP archive using FileTree\n * @param files - ZIP files collection\n * @param directoryItem - FileTree directory item to add\n * @param archivePrefix - Prefix path within the archive\n * @param onProgress - Optional progress callback\n * @returns Result indicating success or failure\n */\n private async _addDirectoryTreeToZip(\n files: Record<string, Uint8Array>,\n directoryItem: FileTree.IFileTreeDirectoryItem,\n archivePrefix: string,\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<void>> {\n const childrenResult = directoryItem.getChildren();\n /* c8 ignore next 3 - defense in depth against internal error */\n if (childrenResult.isFailure()) {\n return fail(`Failed to read directory ${directoryItem.absolutePath}: ${childrenResult.message}`);\n }\n\n for (const child of childrenResult.value) {\n const itemArchivePath = normalizePath(`${archivePrefix}/${child.name}`);\n\n if (child.type === 'directory') {\n // Recursively add subdirectory\n const addDirResult = await this._addDirectoryTreeToZip(files, child, itemArchivePath, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addDirResult.isFailure()) {\n return fail(addDirResult.message);\n }\n } else if (child.type === 'file') {\n // Add file\n const addFileResult = await this._addFileTreeItemToZip(files, child, itemArchivePath);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addFileResult.isFailure()) {\n return fail(addFileResult.message);\n }\n onProgress?.('reading-file', 0, `Added file: ${itemArchivePath}`);\n }\n }\n\n return succeed(undefined);\n }\n\n private _getInputFileTreeItem(options: ZipArchiveOptions): Result<FileTree.FileTreeItem | undefined> {\n if ('inputPath' in options && options.inputPath !== undefined) {\n return FileTree.forFilesystem()\n .withErrorFormat((msg) => `Failed to create file tree: ${msg}`)\n .onSuccess((fileTree) =>\n fileTree.getItem(options.inputPath!).withErrorFormat((msg) => `Failed to get item: ${msg}`)\n );\n } else if ('inputItem' in options) {\n return succeed(options.inputItem);\n }\n return succeed(undefined);\n }\n\n private _getConfigFileTreeItem(options: ZipArchiveOptions): Result<FileTree.IFileTreeFileItem | undefined> {\n if ('configPath' in options && options.configPath !== undefined) {\n return FileTree.forFilesystem()\n .withErrorFormat((msg) => `Failed to create file tree: ${msg}`)\n .onSuccess((fileTree) =>\n fileTree.getFile(options.configPath!).withErrorFormat((msg) => `Failed to get config file: ${msg}`)\n );\n } else if ('configItem' in options && options.configItem !== undefined) {\n return succeed(options.configItem);\n }\n return succeed(undefined);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipArchiveFormat.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/zipArchiveFormat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,aAAa,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,KAAK,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AC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,QAAgB;IACxC,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACjD,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 { Result, captureResult } from '@fgv/ts-utils';\nimport { Model as ConfigModel } from '../config';\nimport * as Json from './json';\nimport * as Convert from './convert';\n\n/**\n * Create a ZIP archive manifest object\n * @param inputType - Type of input (file or directory)\n * @param originalPath - Original file/directory path\n * @param archivePath - Path within the archive\n * @param configPath - Optional configuration file path\n * @returns ZIP archive manifest\n * @public\n */\nexport function createZipArchiveManifest(\n inputType: 'file' | 'directory',\n originalPath: string,\n archivePath: string,\n configPath?: string\n): Json.IZipArchiveManifest {\n const manifest: Json.IZipArchiveManifest = {\n timestamp: new Date().toISOString(),\n input: {\n type: inputType,\n originalPath,\n archivePath\n }\n };\n\n if (configPath) {\n manifest.config = {\n type: 'file',\n originalPath: configPath,\n archivePath: 'config.json'\n };\n }\n\n return manifest;\n}\n\n/**\n * Parse and validate a ZIP archive manifest\n * @param manifestData - JSON string containing manifest data\n * @returns Result containing validated manifest\n * @public\n */\nexport function parseZipArchiveManifest(manifestData: string): Result<Json.IZipArchiveManifest> {\n return captureResult(() => {\n const parsed = JSON.parse(manifestData);\n return parsed;\n })\n .onSuccess((parsed) => Convert.zipArchiveManifest.validate(parsed))\n .withErrorFormat((e) => `Failed to parse ZIP archive manifest: ${e}`);\n}\n\n/**\n * Validate a ZIP archive manifest object\n * @param manifest - Object to validate as manifest\n * @returns Result containing validated manifest\n * @public\n */\nexport function validateZipArchiveManifest(manifest: unknown): Result<Json.IZipArchiveManifest> {\n return Convert.zipArchiveManifest.validate(manifest);\n}\n\n/**\n * Parse and validate configuration JSON\n * @param configData - JSON string containing configuration\n * @returns Result containing validated configuration\n * @public\n */\nexport function parseZipArchiveConfiguration(configData: string): Result<ConfigModel.ISystemConfiguration> {\n return captureResult(() => {\n const parsed = JSON.parse(configData);\n return parsed;\n })\n .onSuccess((parsed) => Convert.systemConfiguration.validate(parsed))\n .withErrorFormat((e) => `Failed to parse ZIP archive configuration: ${e}`);\n}\n\n/**\n * Generate a timestamp-based filename for ZIP archives\n * @param customName - Optional custom name prefix\n * @returns Generated filename\n * @public\n */\nexport function generateZipArchiveFilename(customName?: string): string {\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-').replace('T', '_').slice(0, -5);\n return customName ? `${customName}-${timestamp}.zip` : `ts-res-archive-${timestamp}.zip`;\n}\n\n/**\n * Normalize path separators for cross-platform compatibility\n * @param path - Path to normalize\n * @returns Normalized path\n * @public\n */\nexport function normalizePath(path: string): string {\n return path.replace(/\\\\/g, '/').replace(/\\/+/g, '/');\n}\n\n/**\n * Extract directory name from a file path\n * @param path - File path\n * @returns Directory name\n * @public\n */\nexport function getDirectoryName(path: string): string {\n const normalized = normalizePath(path);\n const parts = normalized.split('/');\n return parts[parts.length - 1] || 'archive';\n}\n\n/**\n * Create a safe filename by removing invalid characters\n * @param filename - Original filename\n * @returns Sanitized filename\n * @public\n */\nexport function sanitizeFilename(filename: string): string {\n return filename\n .replace(/[<>:\"/\\\\|?*]/g, '_')\n .replace(/\\s+/g, '_')\n .replace(/_+/g, '_')\n .trim();\n}\n\n/**\n * Validate ZIP file extension\n * @param filename - Filename to validate\n * @returns True if filename has .zip extension\n * @public\n */\nexport function isZipFile(filename: string): boolean {\n return filename.toLowerCase().endsWith('.zip');\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipArchiveLoader.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/zipArchiveLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEtD,4EAA4E;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAU7C,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEtG;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;;;;OAMG;IACI,KAAK,CAAC,YAAY,CACvB,IAAU,EACV,UAAkC,EAAE,EACpC,UAAuC;QAEvC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,cAAc,EAAE,CAAC,EAAE,iBAAiB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAE9D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,oBAAoB,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;YACxC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,cAAc,EAAE,G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,CAAC,CAAC;QAC9B,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACK,YAAY,CAAC,QAAgB;QACnC,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACpD,mDAAmD;QACnD,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,MAAM;gBACT,OAAO,kBAAkB,CAAC;YAC5B,KAAK,MAAM,CAAC;YACZ,KAAK,KAAK;gBACR,OAAO,kBAAkB,CAAC;YAC5B,KAAK,KAAK;gBACR,OAAO,iBAAiB,CAAC;YAC3B,KAAK,KAAK;gBACR,OAAO,YAAY,CAAC;YACtB,KAAK,IAAI;gBACP,OAAO,eAAe,CAAC;YACzB,KAAK,IAAI;gBACP,OAAO,wBAAwB,CAAC;YAClC,KAAK,IAAI;gBACP,OAAO,wBAAwB,CAAC;YAClC;gBACE,OAAO,0BAA0B,CAAC;QACtC,CAAC;IACH,CAAC;CACF","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 { Result, succeed, fail } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\n// ZipFileTree is browser-safe - doesn't depend on Node.js crypto/fs modules\nimport { ZipFileTree } from '@fgv/ts-extras';\nimport type {\n IZipArchiveLoadOptions,\n IZipArchiveLoadResult,\n ZipArchiveProgressCallback,\n IImportedFile,\n IImportedDirectory\n} from './types';\nimport { Model as ConfigModel } from '../config';\nimport * as Json from './json';\nimport { parseZipArchiveManifest, parseZipArchiveConfiguration, isZipFile } from './zipArchiveFormat';\n\n/**\n * ZIP archive loader extending ts-extras foundation\n * @public\n */\nexport class ZipArchiveLoader {\n /**\n * Load ZIP archive from File object (Browser)\n * @param file - File object from file input\n * @param options - Loading options\n * @param onProgress - Optional progress callback\n * @returns Result containing loaded archive data\n */\n public async loadFromFile(\n file: File,\n options: IZipArchiveLoadOptions = {},\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<IZipArchiveLoadResult>> {\n onProgress?.('reading-file', 0, `Reading file: ${file.name}`);\n\n if (!isZipFile(file.name)) {\n return fail(`File ${file.name} is not a ZIP file`);\n }\n\n try {\n const buffer = await file.arrayBuffer();\n onProgress?.('reading-file', 100, 'File read complete');\n\n return await this.loadFromBuffer(buffer, options, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n } catch (error) {\n return fail(`Failed to read file: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Load ZIP archive from ArrayBuffer (Universal)\n * @param buffer - ZIP data buffer\n * @param options - Loading options\n * @param onProgress - Optional progress callback\n * @returns Result containing loaded archive data\n */\n public async loadFromBuffer(\n buffer: ArrayBuffer,\n options: IZipArchiveLoadOptions = {},\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<IZipArchiveLoadResult>> {\n onProgress?.('parsing-zip', 0, 'Parsing ZIP archive');\n\n const zipAccessorsResult = ZipFileTree.ZipFileTreeAccessors.fromBuffer(buffer);\n if (zipAccessorsResult.isFailure()) {\n return fail(`Failed to parse ZIP: ${zipAccessorsResult.message}`);\n }\n\n const zipAccessors = zipAccessorsResult.value;\n onProgress?.('parsing-zip', 100, 'ZIP archive parsed');\n\n // Load manifest\n onProgress?.('loading-manifest', 0, 'Loading manifest');\n const manifestResult = this._loadManifestFromAccessors(zipAccessors);\n if (manifestResult.isFailure()) {\n return fail(manifestResult.message);\n }\n const manifest = manifestResult.value;\n onProgress?.('loading-manifest', 100, 'Manifest loaded');\n\n // Load configuration\n onProgress?.('loading-config', 0, 'Loading configuration');\n const configResult = this._loadConfigurationFromAccessors(zipAccessors, manifest, options);\n if (configResult.isFailure()) {\n return fail(configResult.message);\n }\n const config = configResult.value;\n onProgress?.('loading-config', 100, 'Configuration loaded');\n\n // Extract files and directory structure\n onProgress?.('extracting-files', 0, 'Extracting files');\n const filesResult = await this._extractFilesFromAccessors(zipAccessors, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (filesResult.isFailure()) {\n return fail(filesResult.message);\n }\n\n const { files, directory } = filesResult.value;\n onProgress?.('extracting-files', 100, `Extracted ${files.length} files`);\n\n onProgress?.('extracting-files', 100, 'ZIP loading complete');\n\n return succeed({\n manifest,\n config,\n files,\n directory\n });\n }\n\n /**\n * Load manifest from ZIP using ZipFileTreeAccessors\n * @param zipAccessors - ZIP file tree accessors\n * @returns Result containing parsed manifest\n */\n private _loadManifestFromAccessors(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors\n ): Result<Json.IZipArchiveManifest | undefined> {\n const manifestResult = zipAccessors.getFileContents('manifest.json');\n if (manifestResult.isFailure()) {\n // Manifest is optional - return success with undefined\n return succeed(undefined);\n }\n\n const parseResult = parseZipArchiveManifest(manifestResult.value);\n if (parseResult.isFailure()) {\n return fail(`Failed to parse manifest.json: ${parseResult.message}`);\n }\n\n return succeed(parseResult.value);\n }\n\n /**\n * Load configuration from ZIP using ZipFileTreeAccessors\n * @param zipAccessors - ZIP file tree accessors\n * @param manifest - Parsed manifest (may be undefined)\n * @param options - Loading options\n * @returns Result containing parsed configuration\n */\n private _loadConfigurationFromAccessors(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors,\n manifest: Json.IZipArchiveManifest | undefined,\n options: IZipArchiveLoadOptions\n ): Result<ConfigModel.ISystemConfiguration | undefined> {\n // Check if manifest specifies a config file\n const manifestSpecifiesConfig = manifest?.config !== undefined;\n\n if (!manifestSpecifiesConfig) {\n // If no config specified in manifest, config is optional\n return succeed(undefined);\n }\n\n // Get the config path from the manifest\n const configPath = manifest!.config!.archivePath;\n return zipAccessors\n .getFileContents(configPath)\n .withErrorFormat(\n () => `Manifest specifies config file at '${configPath}' but it was not found in archive`\n )\n .onSuccess((configContent) => parseZipArchiveConfiguration(configContent))\n .withErrorFormat((e) => `Failed to parse config file '${configPath}': ${e}`);\n }\n\n /**\n * Extract files and directory structure from ZIP\n * @param zipAccessors - ZIP file tree accessors\n * @param onProgress - Optional progress callback\n * @returns Result containing files and directory structure\n */\n private async _extractFilesFromAccessors(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors,\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<{ files: IImportedFile[]; directory: IImportedDirectory | undefined }>> {\n try {\n const files: IImportedFile[] = [];\n const directories = new Map<string, IImportedDirectory>();\n\n // Get all children from root\n const rootChildrenResult = zipAccessors.getChildren('/');\n /* c8 ignore next 3 - defense in depth against internal error */\n if (rootChildrenResult.isFailure()) {\n return fail(`Failed to read ZIP contents: ${rootChildrenResult.message}`);\n }\n\n // Process all items recursively\n await this._processFileTreeItems(\n zipAccessors,\n '/',\n rootChildrenResult.value,\n files,\n directories,\n onProgress\n );\n\n // Build directory structure\n const directory = this._buildDirectoryStructure(files, directories);\n\n return succeed({ files, directory });\n /* c8 ignore next 3 - defense in depth against internal error */\n } catch (error) {\n return fail(`Failed to extract files: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Recursively process file tree items\n * @param zipAccessors - ZIP file tree accessors\n * @param currentPath - Current directory path\n * @param items - Items to process\n * @param files - Files collection\n * @param directories - Directories collection\n * @param onProgress - Optional progress callback\n * @param processed - Processing counter\n */\n private async _processFileTreeItems(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors,\n currentPath: string,\n items: readonly FileTree.FileTreeItem[],\n files: IImportedFile[],\n directories: Map<string, IImportedDirectory>,\n onProgress?: ZipArchiveProgressCallback,\n processed: { count: number } = { count: 0 }\n ): Promise<void> {\n for (const item of items) {\n /* c8 ignore next 1 - defense in depth */\n const itemPath = item.absolutePath.startsWith('/') ? item.absolutePath.substring(1) : item.absolutePath;\n\n if (item.type === 'directory') {\n // Track directory\n if (!directories.has(itemPath)) {\n directories.set(itemPath, {\n name: item.name,\n files: [],\n subdirectories: []\n });\n }\n\n // Recursively process children\n const childrenResult = zipAccessors.getChildren(item.absolutePath);\n if (childrenResult.isSuccess()) {\n await this._processFileTreeItems(\n zipAccessors,\n item.absolutePath,\n childrenResult.value,\n files,\n directories,\n onProgress,\n processed\n );\n }\n } else if (item.type === 'file') {\n // Get file content\n const contentResult = item.getRawContents();\n const content = contentResult.orDefault('');\n\n files.push({\n name: item.name,\n path: itemPath,\n content,\n type: this._getFileType(item.name)\n });\n }\n\n processed.count++;\n onProgress?.('extracting-files', 0, `Processing ${itemPath}`);\n }\n }\n\n /**\n * Build directory structure from files\n * @param files - Extracted files\n * @param directories - Directories map\n * @returns Root directory structure or null\n */\n private _buildDirectoryStructure(\n files: IImportedFile[],\n directories: Map<string, IImportedDirectory>\n ): IImportedDirectory | undefined {\n /* c8 ignore next 3 - should never happen with fflate */\n if (files.length === 0) {\n return undefined;\n }\n\n const rootDir: IImportedDirectory = {\n name: 'root',\n files: [],\n subdirectories: []\n };\n\n // Process files to build directory structure\n for (const file of files) {\n const pathParts = file.path.split('/').filter((part: string) => part.length > 0);\n\n /* c8 ignore next 1 - defense in depth should never happen */\n if (pathParts.length === 0) continue;\n\n // Ensure all parent directories exist\n let currentDir = rootDir;\n for (let i = 0; i < pathParts.length - 1; i++) {\n const dirName = pathParts[i];\n let foundDir = currentDir.subdirectories.find((d) => d.name === dirName);\n\n if (!foundDir) {\n foundDir = {\n name: dirName,\n files: [],\n subdirectories: []\n };\n currentDir.subdirectories.push(foundDir);\n }\n\n currentDir = foundDir;\n }\n\n // Add file to its parent directory\n currentDir.files.push(file);\n }\n\n return rootDir;\n }\n\n /**\n * Get file MIME type based on extension\n * @param filename - Filename\n * @returns MIME type\n */\n private _getFileType(filename: string): string {\n const ext = filename.toLowerCase().split('.').pop();\n /* c8 ignore next 20 - no need to test every one */\n switch (ext) {\n case 'json':\n return 'application/json';\n case 'yaml':\n case 'yml':\n return 'application/yaml';\n case 'xml':\n return 'application/xml';\n case 'txt':\n return 'text/plain';\n case 'md':\n return 'text/markdown';\n case 'js':\n return 'application/javascript';\n case 'ts':\n return 'application/typescript';\n default:\n return 'application/octet-stream';\n }\n }\n}\n"]}
|