Options
All
  • Public
  • Public/Protected
  • All
Menu

@azure/core-rest-pipeline

Package version

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

AccessTokenGetter

AccessTokenGetter: (scopes: string | string[], options: GetTokenOptions) => Promise<AccessToken>

A function that gets a promise of an access token and allows providing options.

param

the options to pass to the underlying token provider

Type declaration

    • (scopes: string | string[], options: GetTokenOptions): Promise<AccessToken>
    • Parameters

      • scopes: string | string[]
      • options: GetTokenOptions

      Returns Promise<AccessToken>

FormDataMap

FormDataMap: {}

A simple object that provides form data, as if from a browser form.

Type declaration

FormDataValue

FormDataValue: string | Blob

Each form data entry can be a string or (in the browser) a Blob.

HttpMethods

HttpMethods: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "TRACE"

Supported HTTP methods to use when making requests.

PipelinePhase

PipelinePhase: "Deserialize" | "Serialize" | "Retry"

Policies are executed in phases. The execution order is:

  1. Serialize Phase
  2. Policies not in a phase
  3. Deserialize Phase
  4. Retry Phase

RawHttpHeaders

RawHttpHeaders: {}

A HttpHeaders collection represented as a simple JSON object.

Type declaration

  • [headerName: string]: string

RequestBodyType

RequestBodyType: NodeJS.ReadableStream | Blob | ArrayBuffer | ArrayBufferView | FormData | string | null

Types of bodies supported on the request. NodeJS.ReadableStream is Node only. Blob is browser only.

SendRequest

SendRequest: (request: PipelineRequest) => Promise<PipelineResponse>

A simple interface for making a pipeline request and receiving a response.

Type declaration

TransferProgressEvent

TransferProgressEvent: { loadedBytes: number }

Fired in response to upload or download progress.

Type declaration

  • loadedBytes: number

    The number of bytes loaded so far.

Variables

Const ALL_PROXY

ALL_PROXY: "ALL_PROXY" = "ALL_PROXY"

Const DEFAULT_CLIENT_MAX_RETRY_INTERVAL

DEFAULT_CLIENT_MAX_RETRY_INTERVAL: number = 1000 * 64

Const DEFAULT_CLIENT_RETRY_COUNT

DEFAULT_CLIENT_RETRY_COUNT: 10 = 10

Const DEFAULT_CLIENT_RETRY_INTERVAL

DEFAULT_CLIENT_RETRY_INTERVAL: 1000 = 1000

Const DefaultTokenRefreshBufferMs

DefaultTokenRefreshBufferMs: number = 2 * 60 * 1000

Defines the default token refresh buffer duration.

Const HTTPS_PROXY

HTTPS_PROXY: "HTTPS_PROXY" = "HTTPS_PROXY"

Const HTTP_PROXY

HTTP_PROXY: "HTTP_PROXY" = "HTTP_PROXY"

Const NO_PROXY

NO_PROXY: "NO_PROXY" = "NO_PROXY"

Const NotSupported

NotSupported: any = new Error("proxyPolicy is not supported in browser environment")

Const RedactedString

RedactedString: "REDACTED" = "REDACTED"

Const SDK_VERSION

SDK_VERSION: string = "1.1.0-beta.3"

Const UserAgentHeaderName

UserAgentHeaderName: string = getUserAgentHeaderName()

Const ValidPhaseNames

ValidPhaseNames: any = new Set<PipelinePhase>(["Deserialize", "Serialize", "Retry"])

Const allowedRedirect

allowedRedirect: Object = ["GET", "HEAD"]

Methods that are allowed to follow redirects 301 and 302

Const bearerTokenAuthenticationPolicyName

bearerTokenAuthenticationPolicyName: "bearerTokenAuthenticationPolicy" = "bearerTokenAuthenticationPolicy"

The programmatic identifier of the bearerTokenAuthenticationPolicy.

Const byPassedList

byPassedList: Map<string, boolean> = new Map()

Const createSpan

createSpan: any = createSpanFunction({packagePrefix: "",namespace: ""})

Const custom

custom: {} = inspect.custom

Type declaration

Const decompressResponsePolicyName

decompressResponsePolicyName: "decompressResponsePolicy" = "decompressResponsePolicy"

The programmatic identifier of the decompressResponsePolicy.

Const defaultAllowedHeaderNames

defaultAllowedHeaderNames: Object = ["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent"]

Const defaultAllowedQueryParameters

defaultAllowedQueryParameters: string[] = ["api-version"]

Const errorSanitizer

errorSanitizer: Sanitizer = new Sanitizer()

Const exponentialRetryPolicyName

exponentialRetryPolicyName: "exponentialRetryPolicy" = "exponentialRetryPolicy"

The programmatic identifier of the exponentialRetryPolicy.

Const formDataPolicyName

formDataPolicyName: "formDataPolicy" = "formDataPolicy"

The programmatic identifier of the formDataPolicy. The programmatic identifier of the formDataPolicy.

Let httpProxyAgent

httpProxyAgent: http.Agent | undefined

Let httpsProxyAgent

httpsProxyAgent: https.Agent | undefined

Const logPolicyName

logPolicyName: "logPolicy" = "logPolicy"

The programmatic identifier of the logPolicy.

Const logger

logger: any = createClientLogger("core-rest-pipeline")

Const ndJsonPolicyName

ndJsonPolicyName: "ndJsonPolicy" = "ndJsonPolicy"

The programmatic identifier of the ndJsonPolicy.

Const noProxyList

noProxyList: string[] = []

Let noProxyListLoaded

noProxyListLoaded: boolean = false

Const proxyPolicyName

proxyPolicyName: "proxyPolicy" = "proxyPolicy"

The programmatic identifier of the proxyPolicy.

Const redirectPolicyName

redirectPolicyName: "redirectPolicy" = "redirectPolicy"

The programmatic identifier of the redirectPolicy.

Const setClientRequestIdPolicyName

setClientRequestIdPolicyName: "setClientRequestIdPolicy" = "setClientRequestIdPolicy"

The programmatic identifier of the setClientRequestIdPolicy.

Const systemErrorRetryPolicyName

systemErrorRetryPolicyName: "systemErrorRetryPolicy" = "systemErrorRetryPolicy"

The programmatic identifier of the systemErrorRetryPolicy.

Const throttlingRetryPolicyName

throttlingRetryPolicyName: "throttlingRetryPolicy" = "throttlingRetryPolicy"

The programmatic identifier of the throttlingRetryPolicy.

Const tracingPolicyName

tracingPolicyName: "tracingPolicy" = "tracingPolicy"

The programmatic identifier of the tracingPolicy.

Const url

url: { constructor: any; prototype: __type; createObjectURL: any; revokeObjectURL: any } = URL

Type declaration

  • constructor: function
    • Parameters

      • url: string
      • Optional base: string | __type

      Returns __type

  • prototype: __type
  • createObjectURL: function
    • createObjectURL(object: any): string
    • Parameters

      • object: any

      Returns string

  • revokeObjectURL: function
    • revokeObjectURL(url: string): void
    • Parameters

      • url: string

      Returns void

Const urlSearchParams

urlSearchParams: { constructor: any; prototype: __type } = URLSearchParams

Type declaration

  • constructor: function
    • new __type(init?: string[][] | Record<string, string> | string | __type): __type
    • Parameters

      • Optional init: string[][] | Record<string, string> | string | __type

      Returns __type

  • prototype: __type

Const userAgentPolicyName

userAgentPolicyName: "userAgentPolicy" = "userAgentPolicy"

The programmatic identifier of the userAgentPolicy.

Functions

addProgressListener

  • addProgressListener(xhr: XMLHttpRequestEventTarget, listener?: undefined | ((progress: TransferProgressEvent) => void)): void

bearerTokenAuthenticationPolicy

beginRefresh

  • beginRefresh(getAccessToken: () => Promise<AccessToken | null>, retryIntervalInMs: number, refreshTimeout: number): Promise<AccessToken>
  • Converts an an unreliable access token getter (which may resolve with null) into an AccessTokenGetter by retrying the unreliable getter in a regular interval.

    Parameters

    • getAccessToken: () => Promise<AccessToken | null>

      A function that produces a promise of an access token that may fail by returning null.

        • (): Promise<AccessToken | null>
        • Returns Promise<AccessToken | null>

    • retryIntervalInMs: number

      The time (in milliseconds) to wait between retry attempts.

    • refreshTimeout: number

      The timestamp after which the refresh attempt will fail, throwing an exception.

    Returns Promise<AccessToken>

    • A promise that, if it resolves, will resolve with an access token.

createDefaultHttpClient

createEmptyPipeline

createHttpHeaders

createPipelineFromOptions

createPipelineRequest

createTokenCycler

  • Creates a token cycler from a credential, scopes, and optional settings.

    A token cycler represents a way to reliably retrieve a valid access token from a TokenCredential. It will handle initializing the token, refreshing it when it nears expiration, and synchronizes refresh attempts to avoid concurrency hazards.

    Parameters

    • credential: TokenCredential

      the underlying TokenCredential that provides the access token

    • Optional tokenCyclerOptions: Partial<TokenCyclerOptions>

      optionally override default settings for the cycler

    Returns AccessTokenGetter

    • a function that reliably produces a valid access token

decompressResponsePolicy

defaultAuthorizeRequest

exponentialRetryPolicy

formDataPolicy

getChallenge

getDecodedResponseStream

  • getDecodedResponseStream(stream: IncomingMessage, headers: HttpHeaders): NodeJS.ReadableStream

getDefaultProxySettings

  • getDefaultProxySettings(proxyUrl?: undefined | string): ProxySettings | undefined

getEnvironmentValue

  • getEnvironmentValue(name: string): string | undefined

getProxyAgentOptions

getResponseHeaders

  • getResponseHeaders(res: IncomingMessage): HttpHeaders

getUserAgentString

  • getUserAgentString(telemetryInfo: Map<string, string>): string

handleBlobResponse

handleRedirect

isArrayBuffer

  • isArrayBuffer(body: any): body is ArrayBuffer | ArrayBufferView

isBypassed

  • isBypassed(uri: string): boolean | undefined

isReadableStream

  • isReadableStream(body: any): body is NodeJS.ReadableStream

isStreamComplete

  • isStreamComplete(stream: NodeJS.ReadableStream): Promise<void>

isSystemError

loadEnvironmentProxyValue

  • loadEnvironmentProxyValue(): string | undefined

loadNoProxy

  • loadNoProxy(): string[]

logPolicy

ndJsonPolicy

normalizeName

  • normalizeName(name: string): string

parseHeaders

parseRetryAfterHeader

  • parseRetryAfterHeader(headerValue: string): number | undefined

prepareFormData

proxyPolicy

redirectPolicy

rejectOnTerminalEvent

  • rejectOnTerminalEvent(request: PipelineRequest, xhr: XMLHttpRequest, reject: (err: any) => void): void

setClientRequestIdPolicy

  • setClientRequestIdPolicy(requestIdHeaderName?: string): PipelinePolicy

setProxyAgentOnRequest

streamToText

  • streamToText(stream: NodeJS.ReadableStream): Promise<string>

systemErrorRetryPolicy

throttlingRetryPolicy

tracingPolicy

userAgentPolicy

Object literals

Const DEFAULT_CYCLER_OPTIONS

DEFAULT_CYCLER_OPTIONS: object

forcedRefreshWindowInMs

forcedRefreshWindowInMs: number = 1000

refreshWindowInMs

refreshWindowInMs: number = 1000 * 60 * 2

retryIntervalInMs

retryIntervalInMs: number = 3000

Generated using TypeDoc