Skip to content

docs(tsdoc): add release tags to smithy-client #4513

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

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions packages/smithy-client/src/NoOpLogger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Logger } from "@aws-sdk/types";

/**
* @internal
*/
export class NoOpLogger implements Logger {
public trace() {}
public debug() {}
Expand Down
9 changes: 9 additions & 0 deletions packages/smithy-client/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { constructStack } from "@aws-sdk/middleware-stack";
import { Client as IClient, Command, MetadataBearer, MiddlewareStack, RequestHandler } from "@aws-sdk/types";

/**
* @internal
*/
export interface SmithyConfiguration<HandlerOptions> {
requestHandler: RequestHandler<any, any, HandlerOptions>;
/**
Expand All @@ -11,8 +14,14 @@ export interface SmithyConfiguration<HandlerOptions> {
readonly apiVersion: string;
}

/**
* @internal
*/
export type SmithyResolvedConfiguration<HandlerOptions> = SmithyConfiguration<HandlerOptions>;

/**
* @internal
*/
export class Client<
HandlerOptions,
ClientInput extends object,
Expand Down
3 changes: 3 additions & 0 deletions packages/smithy-client/src/command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { constructStack } from "@aws-sdk/middleware-stack";
import { Command as ICommand, Handler, MetadataBearer, MiddlewareStack as IMiddlewareStack } from "@aws-sdk/types";

/**
* @internal
*/
export abstract class Command<
Input extends ClientInput,
Output extends ClientOutput,
Expand Down
3 changes: 3 additions & 0 deletions packages/smithy-client/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/**
* @internal
*/
export const SENSITIVE_STRING = "***SensitiveInformation***";
10 changes: 10 additions & 0 deletions packages/smithy-client/src/date-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const DAYS: Array<String> = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
const MONTHS: Array<String> = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

/**
* @internal
*
* Builds a proper UTC HttpDate timestamp from a Date object
* since not all environments will have this as the expected
* format.
Expand Down Expand Up @@ -40,6 +42,8 @@ export function dateToUtcString(date: Date): string {
const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);

/**
* @internal
*
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 3339 date.
Expand Down Expand Up @@ -78,6 +82,8 @@ const RFC3339_WITH_OFFSET = new RegExp(
);

/**
* @internal
*
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 3339 date.
Expand Down Expand Up @@ -128,6 +134,8 @@ const ASC_TIME = new RegExp(
);

/**
* @internal
*
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 7231 IMF-fixdate or obs-date.
Expand Down Expand Up @@ -189,6 +197,8 @@ export const parseRfc7231DateTime = (value: unknown): Date | undefined => {
};

/**
* @internal
*
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a number or a parseable string.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/smithy-client/src/default-error-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { decorateServiceException } from "./exceptions";
/**
* Always throws an error with the given {@param exceptionCtor} and other arguments.
* This is only called from an error handling code path.
* @private
*
* @internal
*/
export const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }: any) => {
Expand Down
2 changes: 2 additions & 0 deletions packages/smithy-client/src/defaults-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const loadConfigsForDefaultMode = (mode: ResolvedDefaultsMode): DefaultsM
};

/**
* @internal
*
* Option determining how certain default configuration options are resolved in the SDK. It can be one of the value listed below:
* * `"standard"`: <p>The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
* * `"in-region"`: <p>The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
let warningEmitted = false;

/**
* @internal
*
* Emits warning if the provided Node.js version string is pending deprecation.
*
* @param {string} version - The Node.js version string.
Expand Down
5 changes: 5 additions & 0 deletions packages/smithy-client/src/exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ export type ExceptionOptionType<ExceptionType extends Error, BaseExceptionType e
Exclude<keyof BaseExceptionType, "$metadata" | "message">
>;

/**
* @internal
*/
export interface ServiceExceptionOptions extends SmithyException, MetadataBearer {
message?: string;
}

/**
* @internal
*
* Base exception class for the exceptions from the server-side.
*/
export class ServiceException extends Error implements SmithyException, MetadataBearer {
Expand Down
2 changes: 2 additions & 0 deletions packages/smithy-client/src/extended-encode-uri-component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* @internal
*
* Function that wraps encodeURIComponent to encode additional characters
* to fully adhere to RFC 3986.
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/smithy-client/src/get-array-if-single-item.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* @internal
*
* The XML parser will set one K:V for a member that could
* return multiple entries but only has one.
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/smithy-client/src/get-value-from-text-node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* @internal
*
* Recursively parses object and populates value is node from
* "#text" key if it's available
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/smithy-client/src/lazy-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface StringWrapper {
* TS 'extends' shim doesn't support extending native types like String.
* So here we create StringWrapper that duplicate everything from String
* class including its prototype chain. So we can extend from here.
*
* @internal
*/
// @ts-ignore StringWrapper implementation is not a simple constructor
export const StringWrapper: StringWrapper = function () {
Expand All @@ -32,6 +34,9 @@ StringWrapper.prototype = Object.create(String.prototype, {
});
Object.setPrototypeOf(StringWrapper, String);

/**
* @internal
*/
export class LazyJsonString extends StringWrapper {
deserializeJSON(): any {
return JSON.parse(super.toString());
Expand Down
42 changes: 38 additions & 4 deletions packages/smithy-client/src/object-mapping.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* @internal
*
* A set of instructions for multiple keys.
* The aim is to provide a concise yet readable way to map and filter values
* onto a target object.
Expand Down Expand Up @@ -45,6 +47,8 @@
export type ObjectMappingInstructions = Record<string, ObjectMappingInstruction>;

/**
* @internal
*
* An instruction set for assigning a value to a target object.
*/
export type ObjectMappingInstruction =
Expand All @@ -55,15 +59,31 @@ export type ObjectMappingInstruction =
| UnfilteredValue;

/**
* @internal
*
* non-array
*/
export type UnfilteredValue = any;
/**
* @internal
*/
export type LazyValueInstruction = [FilterStatus, ValueSupplier];
/**
* @internal
*/
export type ConditionalLazyValueInstruction = [FilterStatusSupplier, ValueSupplier];
/**
* @internal
*/
export type SimpleValueInstruction = [FilterStatus, Value];
/**
* @internal
*/
export type ConditionalValueInstruction = [ValueFilteringFunction, Value];

/**
* @internal
*
* Filter is considered passed if
* 1. It is a boolean true.
* 2. It is not undefined and is itself truthy.
Expand All @@ -72,26 +92,35 @@ export type ConditionalValueInstruction = [ValueFilteringFunction, Value];
export type FilterStatus = boolean | unknown | void;

/**
* @internal
*
* Supplies the filter check but not against any value as input.
*/
export type FilterStatusSupplier = () => boolean;

/**
* @internal
*
* Filter check with the given value.
*/
export type ValueFilteringFunction = (value: any) => boolean;

/**
* @internal
*
* Supplies the value for lazy evaluation.
*/
export type ValueSupplier = () => any;

/**
* @internal
*
* A non-function value.
*/
export type Value = any;

/**
* @internal
* Internal/Private, for codegen use only.
*
* Transfer a set of keys from [instructions] to [target].
Expand All @@ -101,16 +130,23 @@ export type Value = any;
* The target assigned value will be supplied by the instructions as an evaluable function or non-function value.
*
* @see ObjectMappingInstructions for an example.
* @private
* @internal
*/
export function map(
target: any,
filter: (value: any) => boolean,
instructions: Record<string, ValueSupplier | Value>
): typeof target;
/**
* @internal
*/
export function map(instructions: Record<string, ObjectMappingInstruction>): any;
/**
* @internal
*/
export function map(target: any, instructions: Record<string, ObjectMappingInstruction>): typeof target;
/**
* @internal
*/
export function map(arg0: any, arg1?: any, arg2?: any): any {
let target: any;
let filter: (value?: any) => boolean;
Expand Down Expand Up @@ -167,7 +203,6 @@ export function map(arg0: any, arg1?: any, arg2?: any): any {
* Convert a regular object { k: v } to { k: [, v] } mapping instruction set with default
* filter.
*
* @private
* @internal
*/
export const convertMap = (target: any): Record<string, any> => {
Expand All @@ -185,7 +220,6 @@ export const convertMap = (target: any): Record<string, any> => {
* @param filter - uniform filter function to apply to all values
* @param instructions - map of keys and values/suppliers (will be evaluated)
*
* @private
* @internal
*/
const mapWithFilter = (
Expand Down
Loading