6654 serverless functions add a deploy button disable deploy when autosave (#6715)
- improvements on serverless function behavior (autosave performances, deploy on execution only) - add versioning to serverless functions - add a publish endpoint to create a new version of a serverless function - add deploy and reset to lastVersion button in the settings section: <img width="736" alt="image" src="https://github.com/user-attachments/assets/2001f8d2-07a4-4f79-84dd-ec74b6f301d3">
This commit is contained in:
@ -187,6 +187,42 @@ export class S3Driver implements StorageDriver {
|
||||
}
|
||||
}
|
||||
|
||||
async copy(params: {
|
||||
from: { folderPath: string; filename?: string };
|
||||
to: { folderPath: string; filename?: string };
|
||||
}): Promise<void> {
|
||||
const fromKey = `${params.from.folderPath}/${params.from.filename || ''}`;
|
||||
const toKey = `${params.to.folderPath}/${params.to.filename || ''}`;
|
||||
|
||||
try {
|
||||
// Check if the source file exists
|
||||
await this.s3Client.send(
|
||||
new HeadObjectCommand({
|
||||
Bucket: this.bucketName,
|
||||
Key: fromKey,
|
||||
}),
|
||||
);
|
||||
|
||||
// Copy the object to the new location
|
||||
await this.s3Client.send(
|
||||
new CopyObjectCommand({
|
||||
CopySource: `${this.bucketName}/${fromKey}`,
|
||||
Bucket: this.bucketName,
|
||||
Key: toKey,
|
||||
}),
|
||||
);
|
||||
} catch (error) {
|
||||
if (error.name === 'NotFound') {
|
||||
throw new FileStorageException(
|
||||
'File not found',
|
||||
FileStorageExceptionCode.FILE_NOT_FOUND,
|
||||
);
|
||||
}
|
||||
// For other errors, throw the original error
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async checkBucketExists(args: HeadBucketCommandInput) {
|
||||
try {
|
||||
await this.s3Client.headBucket(args);
|
||||
|
||||
Reference in New Issue
Block a user