Skip to content

Commit

Permalink
chore(storage-browser): export store and credentials related types, u…
Browse files Browse the repository at this point in the history
…pdate createListLocationsHandler (#13660)
  • Loading branch information
calebpollman authored Jul 30, 2024
1 parent 9ba6782 commit a17ed4d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
15 changes: 13 additions & 2 deletions packages/storage/src/storageBrowser/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

export { LocationCredentialsProvider } from '../providers/s3/types/options';
export { StorageSubpathStrategy } from '../types/options';

export { createLocationCredentialsStore } from './locationCredentialsStore';
export { createManagedAuthConfigAdapter } from './managedAuthConfigAdapter/createManagedAuthConfigAdapter';
export { GetLocationCredentials, ListLocations } from './types';
export {
AuthConfigAdapter,
createManagedAuthConfigAdapter,
CreateManagedAuthConfigAdapterInput,
} from './managedAuthConfigAdapter';
export {
GetLocationCredentials,
ListLocations,
LocationCredentialsStore,
} from './types';
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,9 @@ interface CreateListLocationsHandlerInput {
export const createListLocationsHandler = (
handlerInput: CreateListLocationsHandlerInput,
): ListLocations => {
return async (input = {}) => {
const { nextToken, pageSize } = input;
const { locations, nextToken: newNextToken } = await listCallerAccessGrants(
{
accountId: handlerInput.accountId,
credentialsProvider: handlerInput.credentialsProvider,
region: handlerInput.region,
pageSize,
nextToken,
},
);
return async function listLocations(input = {}) {
const result = await listCallerAccessGrants({ ...input, ...handlerInput });

return {
locations,
nextToken: newNextToken || undefined,
};
return result;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
import { createListLocationsHandler } from './createListLocationsHandler';
import { createLocationCredentialsHandler } from './createLocationCredentialsHandler';

interface CreateManagedAuthConfigAdapterInput {
export interface CreateManagedAuthConfigAdapterInput {
accountId: string;
region: string;
credentialsProvider: CredentialsProvider;
}

interface AuthConfigAdapter {
export interface AuthConfigAdapter {
listLocations: ListLocations;
getLocationCredentials: GetLocationCredentials;
region: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

export { createManagedAuthConfigAdapter } from './createManagedAuthConfigAdapter';
export {
AuthConfigAdapter,
createManagedAuthConfigAdapter,
CreateManagedAuthConfigAdapterInput,
} from './createManagedAuthConfigAdapter';

0 comments on commit a17ed4d

Please sign in to comment.