Skip to content

Commit

Permalink
Merge branch 'next/release' into next-api-v6
Browse files Browse the repository at this point in the history
  • Loading branch information
david-mcafee committed Sep 11, 2023
2 parents 27e17d2 + 8aafdd1 commit eb6e0c1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: ['*']
pull_request:
branches: ['main', 'next']
branches: ['main', 'next/main', 'next/release']
schedule:
# Run every Tuesday at midnight GMT
- cron: '0 0 * * 2'
Expand Down
6 changes: 3 additions & 3 deletions packages/storage/__tests__/providers/s3/apis/remove.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ describe('remove API', () => {
it('Should remove object with protected accessLevel', async () => {
expect.assertions(3);
const accessLevel = 'protected';
expect(
await remove({ key, options: { accessLevel, targetIdentityId } })
).toEqual(removeResult);
expect(await remove({ key, options: { accessLevel } })).toEqual(
removeResult
);
expect(deleteObject).toBeCalledTimes(1);
expect(deleteObject).toHaveBeenCalledWith(deleteObjectClientConfig, {
Bucket: bucket,
Expand Down
9 changes: 6 additions & 3 deletions packages/storage/src/providers/s3/apis/getUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ import { S3GetUrlOptions, S3GetUrlResult } from '../types';
import { getUrl as getUrlInternal } from './internal/getUrl';

/**
* Get Presigned url of the object
* Get a temporary presigned URL to download the specified S3 object.
* The presigned URL expires when the associated role used to sign the request expires or
* the option `expiresIn` is reached. The `expiresAt` property in the output object indicates when the URL MAY expire.
* By default, it will not validate the object that exists in S3. If you set the `options.validateObjectExistence`
* to true, this method will verify the given object already exists in S3 before returning a presigned
* URL, and will throw {@link StorageError} if the object does not exist.
*
* @param {StorageDownloadDataRequest<S3GetUrlOptions>} The request object
* @return {Promise<S3GetUrlResult>} url of the object
* @throws service: {@link S3Exception} - thrown when checking for existence of the object
* @throws validation: {@link StorageValidationErrorCode } - Validation errors
* thrown either username or key are not defined.
*
* TODO: add config errors
*
*/
export const getUrl = (
req: StorageDownloadDataRequest<S3GetUrlOptions>
Expand Down
6 changes: 3 additions & 3 deletions packages/storage/src/providers/s3/apis/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ import { list as listInternal } from './internal/list';

type S3ListApi = {
/**
* Lists bucket objects with pagination.
* List files with given prefix in pages
* pageSize defaulted to 1000. Additionally, the result will include a nextToken if there are more items to retrieve.
* @param {StorageListRequest<StorageListPaginateOptions>} req - The request object
* @return {Promise<S3ListPaginateResult>} - Promise resolves to list of keys and metadata with
* pageSize defaulting to 1000. Additionally the result will include a nextToken if there are more items to retrieve
* @throws service: {@link S3Exception} - S3 service errors thrown when checking for existence of bucket
* @throws validation: {@link StorageValidationErrorCode } - thrown when there are issues with credentials
*/
(
req?: StorageListRequest<StorageListPaginateOptions>
): Promise<S3ListPaginateResult>;
/**
* Lists all bucket objects.
* List all files from S3. You can set `listAll` to true in `options` to get all the files from S3.
* @param {StorageListRequest<StorageListAllOptions>} req - The request object
* @return {Promise<S3ListAllResult>} - Promise resolves to list of keys and metadata for all objects in path
* @throws service: {@link S3Exception} - S3 service errors thrown when checking for existence of bucket
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/src/providers/s3/apis/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { remove as removeInternal } from './internal/remove';

/**
* Remove the object that is specified by the `req`.
* Remove a file from your S3 bucket.
* @param {StorageOperationRequest<StorageRemoveOptions>} req - The request object
* @return {Promise<StorageRemoveResult>} - Promise resolves upon successful removal of the object
* @throws service: {@link S3Exception} - S3 service errors thrown while getting properties
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/src/providers/s3/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type S3GetUrlOptions = S3Options & {
expiresIn?: number;
};

export type S3UploadOptions = S3TransferOptions & {
export type S3UploadOptions = Omit<S3TransferOptions, 'targetIdentityId'> & {
/**
* The default content-disposition header value of the file when downloading it.
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/src/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type StorageListPaginateOptions = StorageOptions & {
nextToken?: string;
};

export type StorageRemoveOptions = StorageOptions;
export type StorageRemoveOptions = Omit<StorageOptions, 'targetIdentityId'>;

export type StorageCopySourceOptions = {
key: string;
Expand Down

0 comments on commit eb6e0c1

Please sign in to comment.