triangle-utils 1.4.152 → 1.4.153
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.
- package/dist/src/UtilsS3.d.ts +3 -1
- package/dist/src/UtilsS3.js +6 -2
- package/package.json +1 -1
- package/src/UtilsS3.ts +6 -2
package/dist/src/UtilsS3.d.ts
CHANGED
|
@@ -71,7 +71,9 @@ export declare class UtilsS3 {
|
|
|
71
71
|
part_size?: number;
|
|
72
72
|
}): Promise<void>;
|
|
73
73
|
delete(s3_id: string): Promise<void>;
|
|
74
|
-
get_download_url(s3_id: string
|
|
74
|
+
get_download_url(s3_id: string, options?: {
|
|
75
|
+
name?: string;
|
|
76
|
+
}): Promise<string | undefined>;
|
|
75
77
|
get_upload_url(s3_id: string, options?: {
|
|
76
78
|
content_type_id?: string;
|
|
77
79
|
}): Promise<string | undefined>;
|
package/dist/src/UtilsS3.js
CHANGED
|
@@ -175,7 +175,8 @@ export class UtilsS3 {
|
|
|
175
175
|
}
|
|
176
176
|
await this.s3.deleteObject(s3_input);
|
|
177
177
|
}
|
|
178
|
-
async get_download_url(s3_id) {
|
|
178
|
+
async get_download_url(s3_id, options = {}) {
|
|
179
|
+
const name = options.name || undefined;
|
|
179
180
|
const headers = await this.get_headers(s3_id);
|
|
180
181
|
if (headers === undefined) {
|
|
181
182
|
return undefined;
|
|
@@ -184,7 +185,10 @@ export class UtilsS3 {
|
|
|
184
185
|
if (s3_input === undefined) {
|
|
185
186
|
return undefined;
|
|
186
187
|
}
|
|
187
|
-
const command = new GetObjectCommand(
|
|
188
|
+
const command = new GetObjectCommand({
|
|
189
|
+
...s3_input,
|
|
190
|
+
ResponseContentDisposition: name !== undefined ? ("attachment; filename = \"" + name + "\"") : undefined
|
|
191
|
+
});
|
|
188
192
|
const url = await getSignedUrl(this.s3, command);
|
|
189
193
|
return url;
|
|
190
194
|
}
|
package/package.json
CHANGED
package/src/UtilsS3.ts
CHANGED
|
@@ -196,7 +196,8 @@ export class UtilsS3 {
|
|
|
196
196
|
await this.s3.deleteObject(s3_input)
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
async get_download_url(s3_id : string) : Promise<string | undefined> {
|
|
199
|
+
async get_download_url(s3_id : string, options : { name? : string } = {}) : Promise<string | undefined> {
|
|
200
|
+
const name = options.name || undefined
|
|
200
201
|
const headers = await this.get_headers(s3_id)
|
|
201
202
|
if (headers === undefined) {
|
|
202
203
|
return undefined
|
|
@@ -205,7 +206,10 @@ export class UtilsS3 {
|
|
|
205
206
|
if (s3_input === undefined) {
|
|
206
207
|
return undefined
|
|
207
208
|
}
|
|
208
|
-
const command = new GetObjectCommand(
|
|
209
|
+
const command = new GetObjectCommand({
|
|
210
|
+
...s3_input,
|
|
211
|
+
ResponseContentDisposition: name !== undefined ? ("attachment; filename = \"" + name + "\"") : undefined
|
|
212
|
+
})
|
|
209
213
|
const url = await getSignedUrl(this.s3, command)
|
|
210
214
|
return url
|
|
211
215
|
}
|