feat(registrystorage): Add deleteMavenMetadata to RegistryStorage and update Maven DELETE test to expect 204 No Content

This commit is contained in:
2025-11-21 09:25:19 +00:00
parent 4d13fac9f1
commit 9039613f7a
4 changed files with 19 additions and 2 deletions

View File

@@ -1,5 +1,11 @@
# Changelog # Changelog
## 2025-11-21 - 1.4.0 - feat(registrystorage)
Add deleteMavenMetadata to RegistryStorage and update Maven DELETE test to expect 204 No Content
- Add deleteMavenMetadata(groupId, artifactId) to RegistryStorage to remove maven-metadata.xml.
- Update Maven test to assert 204 No Content for DELETE responses (previously expected 200).
## 2025-11-21 - 1.3.1 - fix(maven) ## 2025-11-21 - 1.3.1 - fix(maven)
Pass request path to Maven checksum handler so checksum files are resolved correctly Pass request path to Maven checksum handler so checksum files are resolved correctly

View File

@@ -344,7 +344,7 @@ tap.test('Maven: should delete an artifact (DELETE)', async () => {
query: {}, query: {},
}); });
expect(response.status).toEqual(200); expect(response.status).toEqual(204); // 204 No Content is correct for DELETE
// Verify artifact was deleted // Verify artifact was deleted
const getResponse = await registry.handleRequest({ const getResponse = await registry.handleRequest({

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartregistry', name: '@push.rocks/smartregistry',
version: '1.3.1', version: '1.4.0',
description: 'a registry for npm modules and oci images' description: 'a registry for npm modules and oci images'
} }

View File

@@ -348,6 +348,17 @@ export class RegistryStorage implements IStorageBackend {
return this.putObject(path, data); return this.putObject(path, data);
} }
/**
* Delete Maven metadata (maven-metadata.xml)
*/
public async deleteMavenMetadata(
groupId: string,
artifactId: string
): Promise<void> {
const path = this.getMavenMetadataPath(groupId, artifactId);
return this.deleteObject(path);
}
/** /**
* List Maven versions for an artifact * List Maven versions for an artifact
* Returns all version directories under the artifact path * Returns all version directories under the artifact path