@aspan-corporation/ac-shared 1.2.32 → 1.2.33

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.
@@ -29,6 +29,7 @@ export type AcServices = {
29
29
  stsService?: STSService;
30
30
  sourceS3Service?: S3Service;
31
31
  destinationS3Service?: S3Service;
32
+ localS3Service?: S3Service;
32
33
  };
33
34
  export type AcContext = Context & {
34
35
  logger: Logger;
@@ -19,6 +19,13 @@ export declare class S3Service {
19
19
  listObjectsV2(listObjectsV2CommandInput: ListObjectsV2CommandInput): Promise<import("@aws-sdk/client-s3").ListObjectsV2CommandOutput>;
20
20
  getObject(getObjectCommandInput: GetObjectCommandInput): Promise<Buffer>;
21
21
  getSignedUrl(getObjectCommandInput: GetObjectCommandInput): Promise<string>;
22
+ /**
23
+ * Presigned PUT URL — lets a browser upload a single object directly to S3
24
+ * without the bytes passing through the API/Lambda. Sign without locking a
25
+ * ContentType so the client may send any Content-Type header; the object's
26
+ * extension (not its stored MIME type) drives downstream processing.
27
+ */
28
+ getSignedUploadUrl(putObjectCommandInput: PutObjectCommandInput, expiresIn?: number): Promise<string>;
22
29
  putObject(putObjectCommandInput: PutObjectCommandInput): Promise<PutObjectCommandOutput>;
23
30
  headObject(headObjectCommandInput: HeadObjectCommandInput): Promise<import("@aws-sdk/client-s3").HeadObjectCommandOutput>;
24
31
  checkIfObjectExists(headObjectCommandInput: HeadObjectCommandInput): Promise<boolean>;
@@ -60,6 +60,17 @@ export class S3Service {
60
60
  const signedUrl = await getSignedUrl(this.client, new GetObjectCommand(getObjectCommandInput), { expiresIn: 3600 });
61
61
  return signedUrl;
62
62
  }
63
+ /**
64
+ * Presigned PUT URL — lets a browser upload a single object directly to S3
65
+ * without the bytes passing through the API/Lambda. Sign without locking a
66
+ * ContentType so the client may send any Content-Type header; the object's
67
+ * extension (not its stored MIME type) drives downstream processing.
68
+ */
69
+ async getSignedUploadUrl(putObjectCommandInput, expiresIn = 3600) {
70
+ this.logger.debug("getSignedUploadUrl", { putObjectCommandInput });
71
+ const signedUrl = await getSignedUrl(this.client, new PutObjectCommand(putObjectCommandInput), { expiresIn });
72
+ return signedUrl;
73
+ }
63
74
  async putObject(putObjectCommandInput) {
64
75
  this.logger.debug("putObject", { putObjectCommandInput });
65
76
  return await this.client.send(new PutObjectCommand(putObjectCommandInput));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspan-corporation/ac-shared",
3
- "version": "1.2.32",
3
+ "version": "1.2.33",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "exports": {