Skip to content

Commit

Permalink
docs(add-private): add @internal tags to all internal packages (#4593)
Browse files Browse the repository at this point in the history
  • Loading branch information
MYoung25 authored Mar 30, 2023
1 parent 4bef620 commit d077067
Show file tree
Hide file tree
Showing 190 changed files with 1,010 additions and 5 deletions.
3 changes: 3 additions & 0 deletions packages/body-checksum-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { toUint8Array } from "@aws-sdk/util-utf8";

const MiB = 1024 * 1024;

/**
* @internal
*/
export async function bodyChecksumGenerator(
request: HttpRequest,
options: {
Expand Down
3 changes: 3 additions & 0 deletions packages/body-checksum-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { toHex } from "@aws-sdk/util-hex-encoding";
import { toUint8Array } from "@aws-sdk/util-utf8";
import { createReadStream } from "fs";

/**
* @internal
*/
export async function bodyChecksumGenerator(
request: HttpRequest,
options: {
Expand Down
3 changes: 3 additions & 0 deletions packages/chunked-blob-reader-native/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { fromBase64 } from "@aws-sdk/util-base64";
/**
* @internal
*/
export function blobReader(
blob: Blob,
onChunk: (chunk: Uint8Array) => void,
Expand Down
3 changes: 3 additions & 0 deletions packages/chunked-blob-reader/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @internal
*/
export function blobReader(
blob: Blob,
onChunk: (chunk: Uint8Array) => void,
Expand Down
3 changes: 3 additions & 0 deletions packages/chunked-stream-reader-node/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Readable } from "stream";
/**
* @internal
*/
export function streamReader(
stream: Readable,
onChunk: (chunk: Uint8Array) => void,
Expand Down
6 changes: 6 additions & 0 deletions packages/chunked-stream-reader-node/src/readable.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { Readable, ReadableOptions } from "stream";

/**
* @internal
*/
export interface ReadFromBuffersOptions extends ReadableOptions {
buffers: Buffer[];
errorAfter?: number;
}

/**
* @internal
*/
export class ReadFromBuffers extends Readable {
private buffersToRead: Buffer[];
private numBuffersRead = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider";
import { booleanSelector, SelectorType } from "@aws-sdk/util-config-provider";

/**
* @internal
*/
export const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
/**
* @internal
*/
export const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
/**
* @internal
*/
export const DEFAULT_USE_DUALSTACK_ENDPOINT = false;

/**
* @internal
*/
export const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<boolean> = {
environmentVariableSelector: (env: NodeJS.ProcessEnv) =>
booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider";
import { booleanSelector, SelectorType } from "@aws-sdk/util-config-provider";

/**
* @internal
*/
export const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
/**
* @internal
*/
export const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
/**
* @internal
*/
export const DEFAULT_USE_FIPS_ENDPOINT = false;

/**
* @internal
*/
export const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<boolean> = {
environmentVariableSelector: (env: NodeJS.ProcessEnv) =>
booleanSelector(env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV),
Expand Down
12 changes: 12 additions & 0 deletions packages/config-resolver/src/endpointsConfig/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
/**
* @internal
*/
export * from "./NodeUseDualstackEndpointConfigOptions";
/**
* @internal
*/
export * from "./NodeUseFipsEndpointConfigOptions";
/**
* @internal
*/
export * from "./resolveCustomEndpointsConfig";
/**
* @internal
*/
export * from "./resolveEndpointsConfig";
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { normalizeProvider } from "@aws-sdk/util-middleware";

import { EndpointsInputConfig, EndpointsResolvedConfig } from "./resolveEndpointsConfig";

/**
* @internal
*/
export interface CustomEndpointsInputConfig extends EndpointsInputConfig {
/**
* The fully qualified endpoint of the webservice.
Expand All @@ -14,6 +17,9 @@ interface PreviouslyResolved {
urlParser: UrlParser;
}

/**
* @internal
*/
export interface CustomEndpointsResolvedConfig extends EndpointsResolvedConfig {
/**
* Whether the endpoint is specified by caller.
Expand All @@ -22,6 +28,9 @@ export interface CustomEndpointsResolvedConfig extends EndpointsResolvedConfig {
isCustomEndpoint: true;
}

/**
* @internal
*/
export const resolveCustomEndpointsConfig = <T>(
input: T & CustomEndpointsInputConfig & PreviouslyResolved
): T & CustomEndpointsResolvedConfig => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { normalizeProvider } from "@aws-sdk/util-middleware";

import { getEndpointFromRegion } from "./utils/getEndpointFromRegion";

/**
* @internal
*/
export interface EndpointsInputConfig {
/**
* The fully qualified endpoint of the webservice. This is only required when using
Expand All @@ -28,6 +31,9 @@ interface PreviouslyResolved {
useFipsEndpoint: Provider<boolean>;
}

/**
* @internal
*/
export interface EndpointsResolvedConfig extends Required<EndpointsInputConfig> {
/**
* Resolved value for input {@link EndpointsInputConfig.endpoint}
Expand All @@ -47,6 +53,8 @@ export interface EndpointsResolvedConfig extends Required<EndpointsInputConfig>
}

/**
* @internal
*
* @deprecated endpoints rulesets use @aws-sdk/middleware-endpoint resolveEndpointConfig.
* All generated clients should migrate to Endpoints 2.0 endpointRuleSet traits.
*/
Expand Down
9 changes: 9 additions & 0 deletions packages/config-resolver/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @internal
*/
export * from "./endpointsConfig";
/**
* @internal
*/
export * from "./regionConfig";
/**
* @internal
*/
export * from "./regionInfo";
12 changes: 12 additions & 0 deletions packages/config-resolver/src/regionConfig/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { LoadedConfigSelectors, LocalConfigOptions } from "@aws-sdk/node-config-provider";

/**
* @internal
*/
export const REGION_ENV_NAME = "AWS_REGION";
/**
* @internal
*/
export const REGION_INI_NAME = "region";

/**
* @internal
*/
export const NODE_REGION_CONFIG_OPTIONS: LoadedConfigSelectors<string> = {
environmentVariableSelector: (env) => env[REGION_ENV_NAME],
configFileSelector: (profile) => profile[REGION_INI_NAME],
Expand All @@ -11,6 +20,9 @@ export const NODE_REGION_CONFIG_OPTIONS: LoadedConfigSelectors<string> = {
},
};

/**
* @internal
*/
export const NODE_REGION_CONFIG_FILE_OPTIONS: LocalConfigOptions = {
preferredFile: "credentials",
};
3 changes: 3 additions & 0 deletions packages/config-resolver/src/regionConfig/getRealRegion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { isFipsRegion } from "./isFipsRegion";

/**
* @internal
*/
export const getRealRegion = (region: string) =>
isFipsRegion(region)
? ["fips-aws-global", "aws-fips"].includes(region)
Expand Down
6 changes: 6 additions & 0 deletions packages/config-resolver/src/regionConfig/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/**
* @internal
*/
export * from "./config";
/**
* @internal
*/
export * from "./resolveRegionConfig";
3 changes: 3 additions & 0 deletions packages/config-resolver/src/regionConfig/isFipsRegion.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/**
* @internal
*/
export const isFipsRegion = (region: string) =>
typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips"));
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { Provider } from "@aws-sdk/types";
import { getRealRegion } from "./getRealRegion";
import { isFipsRegion } from "./isFipsRegion";

/**
* @internal
*/
export interface RegionInputConfig {
/**
* The AWS region to which this client will send requests
Expand All @@ -17,6 +20,9 @@ export interface RegionInputConfig {

interface PreviouslyResolved {}

/**
* @internal
*/
export interface RegionResolvedConfig {
/**
* Resolved value for input config {@link RegionInputConfig.region}
Expand All @@ -29,6 +35,9 @@ export interface RegionResolvedConfig {
useFipsEndpoint: Provider<boolean>;
}

/**
* @internal
*/
export const resolveRegionConfig = <T>(input: T & RegionInputConfig & PreviouslyResolved): T & RegionResolvedConfig => {
const { region, useFipsEndpoint } = input;

Expand Down
2 changes: 2 additions & 0 deletions packages/config-resolver/src/regionInfo/EndpointVariant.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { EndpointVariantTag } from "./EndpointVariantTag";

/**
* @internal
*
* Provides hostname information for specific host label.
*/
export type EndpointVariant = {
Expand Down
2 changes: 2 additions & 0 deletions packages/config-resolver/src/regionInfo/EndpointVariantTag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* @internal
*
* The tag which mentions which area variant is providing information for.
* Can be either "fips" or "dualstack".
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/config-resolver/src/regionInfo/PartitionHash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { EndpointVariant } from "./EndpointVariant";

/**
* @internal
*
* The hash of partition with the information specific to that partition.
* The information includes the list of regions belonging to that partition,
* and the hostname to be used for the partition.
Expand Down
2 changes: 2 additions & 0 deletions packages/config-resolver/src/regionInfo/RegionHash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { EndpointVariant } from "./EndpointVariant";

/**
* @internal
*
* The hash of region with the information specific to that region.
* The information can include hostname, signingService and signingRegion.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { EndpointVariant } from "./EndpointVariant";

/**
* @internal
*/
export interface GetHostnameFromVariantsOptions {
useFipsEndpoint: boolean;
useDualstackEndpoint: boolean;
}

/**
* @internal
*/
export const getHostnameFromVariants = (
variants: EndpointVariant[] = [],
{ useFipsEndpoint, useDualstackEndpoint }: GetHostnameFromVariantsOptions
Expand Down
6 changes: 6 additions & 0 deletions packages/config-resolver/src/regionInfo/getRegionInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { getResolvedSigningRegion } from "./getResolvedSigningRegion";
import { PartitionHash } from "./PartitionHash";
import { RegionHash } from "./RegionHash";

/**
* @internal
*/
export interface GetRegionInfoOptions {
useFipsEndpoint?: boolean;
useDualstackEndpoint?: boolean;
Expand All @@ -15,6 +18,9 @@ export interface GetRegionInfoOptions {
partitionHash: PartitionHash;
}

/**
* @internal
*/
export const getRegionInfo = (
region: string,
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/**
* @internal
*/
export interface GetResolvedHostnameOptions {
regionHostname?: string;
partitionHostname?: string;
}

/**
* @internal
*/
export const getResolvedHostname = (
resolvedRegion: string,
{ regionHostname, partitionHostname }: GetResolvedHostnameOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { PartitionHash } from "./PartitionHash";

/**
* @internal
*/
export interface GetResolvedPartitionOptions {
partitionHash: PartitionHash;
}

/**
* @internal
*/
export const getResolvedPartition = (region: string, { partitionHash }: GetResolvedPartitionOptions) =>
Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws";
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/**
* @internal
*/
export interface GetResolvedSigningRegionOptions {
regionRegex: string;
signingRegion?: string;
useFipsEndpoint: boolean;
}

/**
* @internal
*/
export const getResolvedSigningRegion = (
hostname: string,
{ signingRegion, regionRegex, useFipsEndpoint }: GetResolvedSigningRegionOptions
Expand Down
Loading

0 comments on commit d077067

Please sign in to comment.