Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
8085033de4 | |||
75dd1d43a9 | |||
8ba7cdc873 | |||
ed8db4536b |
10
changelog.md
10
changelog.md
@ -1,5 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-11-25 - 3.3.5 - fix(test)
|
||||||
|
Refactor trash test to improve metadata validation
|
||||||
|
|
||||||
|
- Added new checks in trash tests to ensure metadata files are correctly moved to trash.
|
||||||
|
- Validated the presence and integrity of metadata within trashed files.
|
||||||
|
|
||||||
|
## 2024-11-25 - 3.3.4 - fix(core)
|
||||||
|
Minor refactoring and cleanup of TypeScript source files for improved readability and maintainability.
|
||||||
|
|
||||||
|
|
||||||
## 2024-11-24 - 3.3.3 - fix(documentation)
|
## 2024-11-24 - 3.3.3 - fix(documentation)
|
||||||
Improved documentation accuracy and consistency
|
Improved documentation accuracy and consistency
|
||||||
|
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartbucket",
|
"name": "@push.rocks/smartbucket",
|
||||||
"version": "3.3.3",
|
"version": "3.3.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@push.rocks/smartbucket",
|
"name": "@push.rocks/smartbucket",
|
||||||
"version": "3.3.3",
|
"version": "3.3.5",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/smartpath": "^5.0.18",
|
"@push.rocks/smartpath": "^5.0.18",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartbucket",
|
"name": "@push.rocks/smartbucket",
|
||||||
"version": "3.3.3",
|
"version": "3.3.5",
|
||||||
"description": "A TypeScript library providing a cloud-agnostic interface for managing object storage with functionalities like bucket management, file and directory operations, and advanced features such as metadata handling and file locking.",
|
"description": "A TypeScript library providing a cloud-agnostic interface for managing object storage with functionalities like bucket management, file and directory operations, and advanced features such as metadata handling and file locking.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
@ -52,7 +52,21 @@ tap.test('should put a file into the trash', async () => {
|
|||||||
console.log(fileMetadata.toString());
|
console.log(fileMetadata.toString());
|
||||||
expect(await file.getMetaData().then((meta) => meta.metadataFile.getJsonData())).toEqual({});
|
expect(await file.getMetaData().then((meta) => meta.metadataFile.getJsonData())).toEqual({});
|
||||||
await file.delete({ mode: 'trash' });
|
await file.delete({ mode: 'trash' });
|
||||||
jestExpect(await file.getMetaData().then((meta) => meta.metadataFile.getJsonData())).toEqual({
|
|
||||||
|
const getTrashContents = async () => {
|
||||||
|
const trash = await myBucket.getTrash();
|
||||||
|
const trashDir = await trash.getTrashDir();
|
||||||
|
return await trashDir.listFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
const trashedFiles = await getTrashContents();
|
||||||
|
expect(trashedFiles.length).toEqual(2);
|
||||||
|
|
||||||
|
const trashedMetaFile = trashedFiles.find(file => file.name.endsWith('.metadata'));
|
||||||
|
expect(trashedMetaFile).toBeDefined();
|
||||||
|
expect(trashedMetaFile).toBeInstanceOf(smartbucket.File);
|
||||||
|
|
||||||
|
jestExpect(await trashedMetaFile!.getJsonData()).toEqual({
|
||||||
custom_recycle: {
|
custom_recycle: {
|
||||||
deletedAt: jestExpect.any(Number),
|
deletedAt: jestExpect.any(Number),
|
||||||
originalPath: "trashtest/trashme.txt",
|
originalPath: "trashtest/trashme.txt",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartbucket',
|
name: '@push.rocks/smartbucket',
|
||||||
version: '3.3.3',
|
version: '3.3.5',
|
||||||
description: 'A TypeScript library providing a cloud-agnostic interface for managing object storage with functionalities like bucket management, file and directory operations, and advanced features such as metadata handling and file locking.'
|
description: 'A TypeScript library providing a cloud-agnostic interface for managing object storage with functionalities like bucket management, file and directory operations, and advanced features such as metadata handling and file locking.'
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user