Compare commits

..

4 Commits

8 changed files with 5857 additions and 5527 deletions

View File

@ -1,5 +1,18 @@
# Changelog
## 2024-11-18 - 3.0.24 - fix(metadata)
Fix metadata handling to address type assertion and data retrieval.
- Fixed type assertion issues in `MetaData` class properties with type non-null assertions.
- Corrected the handling of JSON data retrieval in `MetaData.storeCustomMetaData` function.
## 2024-10-16 - 3.0.23 - fix(dependencies)
Update package dependencies for improved functionality and security.
- Updated @aws-sdk/client-s3 to version ^3.670.0 for enhanced S3 client capabilities.
- Updated @push.rocks/smartstream to version ^3.2.4.
- Updated the dev dependency @push.rocks/tapbundle to version ^5.3.0.
## 2024-07-28 - 3.0.22 - fix(dependencies)
Update dependencies and improve bucket retrieval logging

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@push.rocks/smartbucket",
"version": "3.0.22",
"version": "3.0.24",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@push.rocks/smartbucket",
"version": "3.0.22",
"version": "3.0.24",
"license": "UNLICENSED",
"dependencies": {
"@push.rocks/smartpath": "^5.0.18",

View File

@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartbucket",
"version": "3.0.22",
"version": "3.0.24",
"description": "A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
@ -16,15 +16,15 @@
"@git.zone/tsrun": "^1.2.49",
"@git.zone/tstest": "^1.0.90",
"@push.rocks/qenv": "^6.0.5",
"@push.rocks/tapbundle": "^5.0.23"
"@push.rocks/tapbundle": "^5.3.0"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.620.0",
"@aws-sdk/client-s3": "^3.670.0",
"@push.rocks/smartmime": "^2.0.2",
"@push.rocks/smartpath": "^5.0.18",
"@push.rocks/smartpromise": "^4.0.4",
"@push.rocks/smartrx": "^3.0.7",
"@push.rocks/smartstream": "^3.0.44",
"@push.rocks/smartstream": "^3.2.4",
"@push.rocks/smartstring": "^4.0.15",
"@push.rocks/smartunique": "^3.0.9",
"@tsclass/tsclass": "^4.1.2"

11342
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -21,4 +21,8 @@ tap.test('should create a valid smartbucket', async () => {
expect(myBucket.name).toEqual('testzone');
});
tap.test('', async () => {
})
export default tap.start();

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartbucket',
version: '3.0.22',
version: '3.0.24',
description: 'A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.'
}

View File

@ -21,12 +21,12 @@ export class MetaData {
/**
* the file that contains the metadata
*/
metadataFile: File;
metadataFile!: File;
/**
* the file that the metadata is for
*/
fileRef: File;
fileRef!: File;
public async getFileType(optionsArg?: {
useFileExtension?: boolean;
@ -44,13 +44,13 @@ export class MetaData {
const stat = await this.fileRef.parentDirectoryRef.bucketRef.fastStat({
path: this.fileRef.getBasePath(),
});
return stat.ContentLength;
return stat.ContentLength!;
}
private prefixCustomMetaData = 'custom_';
public async storeCustomMetaData<T = any>(optionsArg: { key: string; value: T }) {
const data = await this.metadataFile.getContentsAsString();
const data = await this.metadataFile.getJsonData();
data[this.prefixCustomMetaData + optionsArg.key] = optionsArg.value;
await this.metadataFile.writeJsonData(data);
}

View File

@ -6,7 +6,8 @@
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
"verbatimModuleSyntax": true,
"strict": true
},
"exclude": [
"dist_*/**/*.d.ts"