manifest 4.17.5 → 4.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,7 @@ declare const _default: () => {
26
26
  s3Region: string;
27
27
  s3AccessKeyId: string;
28
28
  s3SecretAccessKey: string;
29
+ s3FolderPrefix?: string;
29
30
  };
30
31
  };
31
32
  export default _default;
@@ -41,7 +41,8 @@ exports.default = () => {
41
41
  s3Endpoint: process.env.S3_ENDPOINT,
42
42
  s3Region: process.env.S3_REGION,
43
43
  s3AccessKeyId: process.env.S3_ACCESS_KEY_ID,
44
- s3SecretAccessKey: process.env.S3_SECRET_ACCESS_KEY
44
+ s3SecretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
45
+ s3FolderPrefix: process.env.S3_FOLDER_PREFIX
45
46
  }
46
47
  };
47
48
  };
@@ -10,6 +10,7 @@ export declare class StorageService {
10
10
  private s3AccessKeyId;
11
11
  private s3SecretAccessKey;
12
12
  private s3provider;
13
+ private s3FolderPrefix;
13
14
  constructor(configService: ConfigService);
14
15
  store(entity: string, property: string, file: {
15
16
  buffer: Buffer;
@@ -72,6 +72,7 @@ let StorageService = class StorageService {
72
72
  : this.s3Endpoint?.includes('digitalocean')
73
73
  ? 'digitalocean'
74
74
  : 'other';
75
+ this.s3FolderPrefix = this.configService.get('storage.s3FolderPrefix') || '';
75
76
  if (this.isS3Enabled) {
76
77
  this.s3Client = new client_s3_1.S3Client({
77
78
  region: this.s3Region,
@@ -141,14 +142,15 @@ let StorageService = class StorageService {
141
142
  return `${this.configService.get('baseUrl')}/${constants_1.STORAGE_PATH}/${value}`;
142
143
  }
143
144
  async uploadToS3(key, buffer) {
145
+ const path = `${this.s3FolderPrefix}/${key}`;
144
146
  await this.s3Client.send(new client_s3_1.PutObjectCommand({
145
147
  Bucket: this.s3Bucket,
146
- Key: `${constants_1.STORAGE_PATH}/${key}`,
148
+ Key: path,
147
149
  Body: buffer,
148
150
  ChecksumAlgorithm: undefined,
149
151
  ACL: this.s3provider === 'digitalocean' ? 'public-read' : undefined
150
152
  }));
151
- return `${this.s3Endpoint}/${this.s3Bucket}/${constants_1.STORAGE_PATH}/${key}`;
153
+ return `${this.s3Endpoint}/${this.s3Bucket}/${path}`;
152
154
  }
153
155
  };
154
156
  exports.StorageService = StorageService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "manifest",
3
- "version": "4.17.5",
3
+ "version": "4.17.6",
4
4
  "description": "The backend for AI code editors",
5
5
  "author": "Manifest",
6
6
  "license": "MIT",