BREAKING CHANGE(core): Make API strict-by-default: remove *Strict variants, throw on not-found/exists conflicts, add explicit exists() methods, update docs/tests and bump deps

This commit is contained in:
2025-11-20 13:20:19 +00:00
parent 0c631383e1
commit 5889396134
15 changed files with 2644 additions and 1562 deletions

View File

@@ -16,7 +16,7 @@ tap.test('should create a valid smartbucket', async () => {
endpoint: await testQenv.getEnvVarOnDemandStrict('S3_ENDPOINT'),
});
expect(testSmartbucket).toBeInstanceOf(smartbucket.SmartBucket);
myBucket = await testSmartbucket.getBucketByNameStrict(await testQenv.getEnvVarOnDemandStrict('S3_BUCKET'),);
myBucket = await testSmartbucket.getBucketByName(await testQenv.getEnvVarOnDemandStrict('S3_BUCKET'),);
expect(myBucket).toBeInstanceOf(smartbucket.Bucket);
expect(myBucket.name).toEqual('test-pushrocks-smartbucket');
});

View File

@@ -17,7 +17,7 @@ tap.test('should create a valid smartbucket', async () => {
endpoint: await testQenv.getEnvVarOnDemandStrict('S3_ENDPOINT'),
});
expect(testSmartbucket).toBeInstanceOf(smartbucket.SmartBucket);
myBucket = await testSmartbucket.getBucketByNameStrict(await testQenv.getEnvVarOnDemandStrict('S3_BUCKET'),);
myBucket = await testSmartbucket.getBucketByName(await testQenv.getEnvVarOnDemandStrict('S3_BUCKET'),);
expect(myBucket).toBeInstanceOf(smartbucket.Bucket);
expect(myBucket.name).toEqual('test-pushrocks-smartbucket');
});
@@ -30,7 +30,7 @@ tap.test('should clean all contents', async () => {
tap.test('should delete a file into the normally', async () => {
const path = 'trashtest/trashme.txt';
const file = await myBucket.fastPutStrict({
const file = await myBucket.fastPut({
path,
contents: 'I\'m in the trash test content!',
});
@@ -44,7 +44,7 @@ tap.test('should delete a file into the normally', async () => {
tap.test('should put a file into the trash', async () => {
const path = 'trashtest/trashme.txt';
const file = await myBucket.fastPutStrict({
const file = await myBucket.fastPut({
path,
contents: 'I\'m in the trash test content!',
});
@@ -76,7 +76,7 @@ tap.test('should put a file into the trash', async () => {
tap.test('should restore a file from trash', async () => {
const baseDirectory = await myBucket.getBaseDirectory();
const file = await baseDirectory.getFileStrict({
const file = await baseDirectory.getFile({
path: 'trashtest/trashme.txt',
getFromTrash: true
});