@smithy/smithy-client
Advanced tools
Comparing version 3.5.2 to 3.6.0
@@ -816,2 +816,14 @@ var __defProp = Object.defineProperty; | ||
} | ||
/** | ||
* Checks if a value is an instance of ServiceException (duck typed) | ||
*/ | ||
static isInstance(value) { | ||
if (!value) | ||
return false; | ||
const candidate = value; | ||
return Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server"); | ||
} | ||
static [Symbol.hasInstance](instance) { | ||
return _ServiceException.isInstance(instance); | ||
} | ||
}; | ||
@@ -818,0 +830,0 @@ __name(_ServiceException, "ServiceException"); |
@@ -9,2 +9,13 @@ export class ServiceException extends Error { | ||
} | ||
static isInstance(value) { | ||
if (!value) | ||
return false; | ||
const candidate = value; | ||
return (Boolean(candidate.$fault) && | ||
Boolean(candidate.$metadata) && | ||
(candidate.$fault === "client" || candidate.$fault === "server")); | ||
} | ||
static [Symbol.hasInstance](instance) { | ||
return ServiceException.isInstance(instance); | ||
} | ||
} | ||
@@ -11,0 +22,0 @@ export const decorateServiceException = (exception, additions = {}) => { |
@@ -26,2 +26,7 @@ import { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from "@smithy/types"; | ||
constructor(options: ServiceExceptionOptions); | ||
/** | ||
* Checks if a value is an instance of ServiceException (duck typed) | ||
*/ | ||
static isInstance(value: unknown): value is ServiceException; | ||
static [Symbol.hasInstance](instance: unknown): boolean; | ||
} | ||
@@ -28,0 +33,0 @@ /** |
import { Provider, RetryStrategy, RetryStrategyConfiguration, RetryStrategyV2 } from "@smithy/types"; | ||
/** | ||
* @internal | ||
*/ | ||
export type PartialRetryRuntimeConfigType = Partial<{ | ||
@@ -3,0 +6,0 @@ retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>; |
@@ -11,2 +11,3 @@ /** | ||
/** | ||
* @internal | ||
* @param date - to be serialized. | ||
@@ -13,0 +14,0 @@ * @returns https://smithy.io/2.0/spec/protocol-traits.html#timestampformat-trait date-time format. |
@@ -26,2 +26,7 @@ import { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from "@smithy/types"; | ||
constructor(options: ServiceExceptionOptions); | ||
/** | ||
* Checks if a value is an instance of ServiceException (duck typed) | ||
*/ | ||
static isInstance(value: unknown): value is ServiceException; | ||
static [Symbol.hasInstance](instance: unknown): boolean; | ||
} | ||
@@ -28,0 +33,0 @@ /** |
import { Provider, RetryStrategy, RetryStrategyConfiguration, RetryStrategyV2 } from "@smithy/types"; | ||
/** | ||
* @internal | ||
*/ | ||
export type PartialRetryRuntimeConfigType = Partial<{ | ||
@@ -3,0 +6,0 @@ retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>; |
@@ -11,2 +11,3 @@ /** | ||
/** | ||
* @internal | ||
* @param date - to be serialized. | ||
@@ -13,0 +14,0 @@ * @returns https://smithy.io/2.0/spec/protocol-traits.html#timestampformat-trait date-time format. |
{ | ||
"name": "@smithy/smithy-client", | ||
"version": "3.5.2", | ||
"version": "3.6.0", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'", |
174254
4359