Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: Amplify JS release #13612

Merged
merged 6 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"peerDependencies": {
"react-native": ">=0.70",
"react-native-get-random-values": ">=1.9.0"
"react-native-get-random-values": ">=1.8.0"
},
"devDependencies": {
"@aws-amplify/rtn-push-notification": "1.2.30",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class AmplifyRTNPushNotificationManager {
let completionHandlerId = UUID().uuidString
var userInfoCopy = userInfo

remoteNotificationCompletionHandlers[completionHandlerIdKey] = completionHandler
remoteNotificationCompletionHandlers[completionHandlerId] = completionHandler
userInfoCopy[completionHandlerIdKey] = completionHandlerId

sharedEventManager.sendEventToJS(
Expand Down
16 changes: 10 additions & 6 deletions packages/storage/src/providers/s3/apis/internal/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ import {
resolveS3ConfigAndInput,
validateStorageOperationInputWithPrefix,
} from '../../utils';
import { ResolvedS3Config } from '../../types/options';
import {
ListAllOptionsWithPath,
ListPaginateOptionsWithPath,
ResolvedS3Config,
} from '../../types/options';
import {
ListObjectsV2Input,
ListObjectsV2Output,
Expand All @@ -30,7 +34,6 @@ import { getStorageUserAgentValue } from '../../utils/userAgent';
import { logger } from '../../../../utils';
import { DEFAULT_DELIMITER, STORAGE_INPUT_PREFIX } from '../../utils/constants';
import { CommonPrefix } from '../../utils/client/types';
import { StorageSubpathStrategy } from '../../../../types';

const MAX_PAGE_SIZE = 1000;

Expand Down Expand Up @@ -76,12 +79,13 @@ export const list = async (
} ${anyOptions?.nextToken ? `nextToken: ${anyOptions?.nextToken}` : ''}.`,
);
}

const listParams = {
Bucket: bucket,
Prefix: isInputWithPrefix ? `${generatedPrefix}${objectKey}` : objectKey,
MaxKeys: options?.listAll ? undefined : options?.pageSize,
ContinuationToken: options?.listAll ? undefined : options?.nextToken,
Delimiter: getDelimiter(options.subpathStrategy),
Delimiter: getDelimiter(options),
};
logger.debug(`listing items from "${listParams.Prefix}"`);

Expand Down Expand Up @@ -263,9 +267,9 @@ const mapCommonPrefixesToExcludedSubpaths = (
};

const getDelimiter = (
subpathStrategy?: StorageSubpathStrategy,
options?: ListAllOptionsWithPath | ListPaginateOptionsWithPath,
): string | undefined => {
if (subpathStrategy?.strategy === 'exclude') {
return subpathStrategy?.delimiter ?? DEFAULT_DELIMITER;
if (options?.subpathStrategy?.strategy === 'exclude') {
return options?.subpathStrategy?.delimiter ?? DEFAULT_DELIMITER;
}
};
14 changes: 8 additions & 6 deletions packages/storage/src/providers/s3/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,19 @@ export type RemoveOptions = WriteOptions & CommonOptions;
* @deprecated Use {@link ListAllOptionsWithPath} instead.
* Input options type with prefix for S3 list all API.
*/
export type ListAllOptionsWithPrefix = StorageListAllOptions &
ReadOptions &
CommonOptions;
export type ListAllOptionsWithPrefix = Omit<
StorageListAllOptions & ReadOptions & CommonOptions,
'subpathStrategy'
>;

/**
* @deprecated Use {@link ListPaginateOptionsWithPath} instead.
* Input options type with prefix for S3 list API to paginate items.
*/
export type ListPaginateOptionsWithPrefix = StorageListPaginateOptions &
ReadOptions &
CommonOptions;
export type ListPaginateOptionsWithPrefix = Omit<
StorageListPaginateOptions & ReadOptions & CommonOptions,
'subpathStrategy'
>;

/**
* Input options type with path for S3 list all API.
Expand Down
10 changes: 8 additions & 2 deletions packages/storage/src/providers/s3/types/outputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ export type GetPropertiesWithPathOutput = ItemBase & StorageItemWithPath;
* @deprecated Use {@link ListAllWithPathOutput} instead.
* Output type for S3 list API. Lists all bucket objects.
*/
export type ListAllOutput = StorageListOutput<ListOutputItem>;
export type ListAllOutput = Omit<
StorageListOutput<ListOutputItem>,
'excludedSubpaths'
>;

/**
* Output type with path for S3 list API. Lists all bucket objects.
Expand All @@ -105,7 +108,10 @@ export type ListAllWithPathOutput = StorageListOutput<ListOutputItemWithPath>;
* @deprecated Use {@link ListPaginateWithPathOutput} instead.
* Output type for S3 list API. Lists bucket objects with pagination.
*/
export type ListPaginateOutput = StorageListOutput<ListOutputItem> & {
export type ListPaginateOutput = Omit<
StorageListOutput<ListOutputItem>,
'excludedSubpaths'
> & {
nextToken?: string;
};

Expand Down
Loading