@azure/storage-queue package

Classes

Aborter

An aborter instance implements AbortSignal interface, can abort HTTP requests.

  • Call Aborter.none to create a new Aborter instance without timeout.
  • Call Aborter.timeout() to create a new Aborter instance with timeout.

For an existing instance aborter:

  • Call aborter.withTimeout() to create and return a child Aborter instance with timeout.
  • Call aborter.withValue(key, value) to create and return a child Aborter instance with key/value pair.
  • Call aborter.abort() to abort current instance and all children instances.
  • Call aborter.getValue(key) to search and get value with corresponding key from current aborter to all parents.
AccountSASPermissions

ONLY AVAILABLE IN NODE.JS RUNTIME.

This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the values are set, this should be serialized with toString and set as the permissions field on an IAccountSASSignatureValues object. It is possible to construct the permissions string without this class, but the order of the permissions is particular and this class guarantees correctness.

AccountSASResourceTypes

ONLY AVAILABLE IN NODE.JS RUNTIME.

This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value to true means that any SAS which uses these permissions will grant access to that resource type. Once all the values are set, this should be serialized with toString and set as the resources field on an IAccountSASSignatureValues object. It is possible to construct the resources string without this class, but the order of the resources is particular and this class guarantees correctness.

AccountSASServices

ONLY AVAILABLE IN NODE.JS RUNTIME.

This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value to true means that any SAS which uses these permissions will grant access to that service. Once all the values are set, this should be serialized with toString and set as the services field on an IAccountSASSignatureValues object. It is possible to construct the services string without this class, but the order of the services is particular and this class guarantees correctness.

AnonymousCredential

AnonymousCredential provides a credentialPolicyCreator member used to create AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources or for use with Shared Access Signatures (SAS).

AnonymousCredentialPolicy

AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources or for use with Shared Access Signatures (SAS).

BaseRequestPolicy
Credential

Credential is an abstract class for Azure Storage HTTP requests signing. This class will host an credentialPolicyCreator factory which generates CredentialPolicy.

CredentialPolicy

Credential policy used to sign HTTP(S) requests before sending. This is an abstract class.

HttpHeaders

A collection of HTTP header key/value pairs.

LoggingPolicyFactory

LoggingPolicyFactory is a factory class helping generating LoggingPolicy objects.

MessageIdURL

A MessageIdURL represents a URL to a specific Azure Storage Queue message allowing you to manipulate the message.

MessagesURL

A MessagesURL represents a URL to an Azure Storage Queue's messages allowing you to manipulate its messages.

Pipeline

A Pipeline class containing HTTP request policies. You can create a default Pipeline by calling StorageURL.newPipeline(). Or you can create a Pipeline with your own policies by the constructor of Pipeline. Refer to StorageURL.newPipeline() and provided policies as reference before implementing your customized Pipeline.

QueueSASPermissions

ONLY AVAILABLE IN NODE.JS RUNTIME.

This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a Queue. Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the values are set, this should be serialized with toString and set as the permissions field on a IQueueSASSignatureValues object. It is possible to construct the permissions string without this class, but the order of the permissions is particular and this class guarantees correctness.

QueueURL

A QueueURL represents a URL to the Azure Storage queue.

RequestPolicyOptions

Optional properties that can be used when creating a RequestPolicy.

RestError
RetryPolicyFactory

RetryPolicyFactory is a factory class helping generating RetryPolicy objects.

SASQueryParameters

Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly by the user; it is only generated by the IAccountSASSignatureValues and IQueueSASSignatureValues types. Once generated, it can be encoded into a {@code String} and appended to a URL directly (though caution should be taken here in case there are existing query parameters, which might affect the appropriate means of appending these query parameters).

NOTE: Instances of this class are immutable.

ServiceURL

A ServiceURL represents a URL to the Azure Storage Queue service allowing you to manipulate queues.

SharedKeyCredential

ONLY AVAILABLE IN NODE.JS RUNTIME.

SharedKeyCredential for account key authorization of Azure Storage service.

SharedKeyCredentialPolicy

SharedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key.

StorageURL

A ServiceURL represents a based URL class for ServiceURL, QueueURL and etc.

TelemetryPolicyFactory

TelemetryPolicyFactory is a factory class helping generating TelemetryPolicy objects.

TokenCredential

TokenCredential is a Credential used to generate a TokenCredentialPolicy. Renew token by setting a new token string value to token property.

Example

const tokenCredential = new TokenCredential("token");
 const pipeline = StorageURL.newPipeline(tokenCredential);

 const serviceURL = new ServiceURL("https://mystorageaccount.queue.core.windows.net", pipeline);

 // Set up a timer to refresh the token
 const timerID = setInterval(() => {
   // Update token by accessing to public tokenCredential.token
   tokenCredential.token = "updatedToken";
   // WARNING: Timer must be manually stopped! It will forbid GC of tokenCredential
   if (shouldStop()) {
     clearInterval(timerID);
   }
 }, 60 * 60 * 1000); // Set an interval time before your token expired
TokenCredentialPolicy

TokenCredentialPolicy is a policy used to sign HTTP request with a token. Such as an OAuth bearer token.

UniqueRequestIDPolicyFactory

UniqueRequestIDPolicyFactory is a factory class helping generating UniqueRequestIDPolicy objects.

WebResource

Creates a new WebResource object.

This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary properties to initiate a request.

Interfaces

AccessPolicy
CorsRule
DequeuedMessageItem
EnqueuedMessage
GeoReplication
ListQueuesSegmentResponse
Logging
MessageIdDeleteHeaders
MessageIdDeleteMethodOptionalParams
MessageIdUpdateHeaders
MessageIdUpdateOptionalParams
MessagesClearHeaders
MessagesClearOptionalParams
MessagesDequeueHeaders
MessagesDequeueOptionalParams
MessagesEnqueueHeaders
MessagesEnqueueOptionalParams
MessagesPeekHeaders
MessagesPeekOptionalParams
Metrics
PeekedMessageItem
QueueCreateHeaders
QueueCreateOptionalParams
QueueDeleteHeaders
QueueDeleteMethodOptionalParams
QueueGetAccessPolicyHeaders
QueueGetAccessPolicyOptionalParams
QueueGetPropertiesHeaders
QueueGetPropertiesOptionalParams
QueueItem
QueueMessage
QueueSetAccessPolicyHeaders
QueueSetAccessPolicyOptionalParams
QueueSetMetadataHeaders
QueueSetMetadataOptionalParams
RetentionPolicy
ServiceGetPropertiesHeaders
ServiceGetPropertiesOptionalParams
ServiceGetStatisticsHeaders
ServiceGetStatisticsOptionalParams
ServiceListQueuesSegmentHeaders
ServiceListQueuesSegmentOptionalParams
ServiceSetPropertiesHeaders
ServiceSetPropertiesOptionalParams
SignedIdentifier
StorageError
StorageServiceProperties
StorageServiceStats
HttpOperationResponse

Wrapper object for http request and response. Deserialized object is stored in the parsedBody property when the response body is received in JSON or XML.

IAccountSASSignatureValues

ONLY AVAILABLE IN NODE.JS RUNTIME.

IAccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS which can actually be applied to queue urls. Note: that both this class and SASQueryParameters exist because the former is mutable and a logical representation while the latter is immutable and used to generate actual REST requests.

See https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 for more conceptual information on SAS See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas for descriptions of the parameters, including which are required

IHttpClient

An interface that can send HttpRequests and receive promised HttpResponses.

IHttpPipelineLogger

A Logger that can be added to a HttpPipeline. This enables each RequestPolicy to log messages that can be used for debugging purposes.

IIPRange

Allowed IP range for a SAS.

INewPipelineOptions

Option interface for Pipeline.newPipeline method.

IPipelineOptions

Option interface for Pipeline constructor.

IQueueCreateOptions
IQueueSASSignatureValues

ONLY AVAILABLE IN NODE.JS RUNTIME.

IQueueSASSignatureValues is used to help generating Queue service SAS tokens for queues.

IRequestLogOptions

RequestLogOptions configures the retry policy's behavior.

IRetryOptions

Retry options interface.

IServiceListQueuesSegmentOptions
ISignedIdentifier
ITelemetryOptions

Interface of TelemetryPolicy options.

RequestPolicy

Type Aliases

GeoReplicationStatusType

Defines values for GeoReplicationStatusType. Possible values include: 'live', 'bootstrap', 'unavailable'

ListQueuesIncludeType

Defines values for ListQueuesIncludeType. Possible values include: 'metadata'

MessageIdDeleteResponse

Contains response data for the deleteMethod operation.

MessageIdUpdateResponse

Contains response data for the update operation.

MessagesClearResponse

Contains response data for the clear operation.

MessagesDequeueResponse

Contains response data for the dequeue operation.

MessagesEnqueueResponse

Contains response data for the enqueue operation.

MessagesPeekResponse

Contains response data for the peek operation.

QueueCreateResponse

Contains response data for the create operation.

QueueDeleteResponse

Contains response data for the deleteMethod operation.

QueueGetAccessPolicyResponse

Contains response data for the getAccessPolicy operation.

QueueGetPropertiesResponse

Contains response data for the getProperties operation.

QueueSetAccessPolicyResponse

Contains response data for the setAccessPolicy operation.

QueueSetMetadataResponse

Contains response data for the setMetadata operation.

ServiceGetPropertiesResponse

Contains response data for the getProperties operation.

ServiceGetStatisticsResponse

Contains response data for the getStatistics operation.

ServiceListQueuesSegmentResponse

Contains response data for the listQueuesSegment operation.

ServiceSetPropertiesResponse

Contains response data for the setProperties operation.

StorageErrorCode

Defines values for StorageErrorCode. Possible values include: 'AccountAlreadyExists', 'AccountBeingCreated', 'AccountIsDisabled', 'AuthenticationFailed', 'AuthorizationFailure', 'ConditionHeadersNotSupported', 'ConditionNotMet', 'EmptyMetadataKey', 'InsufficientAccountPermissions', 'InternalError', 'InvalidAuthenticationInfo', 'InvalidHeaderValue', 'InvalidHttpVerb', 'InvalidInput', 'InvalidMd5', 'InvalidMetadata', 'InvalidQueryParameterValue', 'InvalidRange', 'InvalidResourceName', 'InvalidUri', 'InvalidXmlDocument', 'InvalidXmlNodeValue', 'Md5Mismatch', 'MetadataTooLarge', 'MissingContentLengthHeader', 'MissingRequiredQueryParameter', 'MissingRequiredHeader', 'MissingRequiredXmlNode', 'MultipleConditionHeadersNotSupported', 'OperationTimedOut', 'OutOfRangeInput', 'OutOfRangeQueryParameterValue', 'RequestBodyTooLarge', 'ResourceTypeMismatch', 'RequestUrlFailedToParse', 'ResourceAlreadyExists', 'ResourceNotFound', 'ServerBusy', 'UnsupportedHeader', 'UnsupportedXmlNode', 'UnsupportedQueryParameter', 'UnsupportedHttpVerb', 'InvalidMarker', 'MessageNotFound', 'MessageTooLarge', 'PopReceiptMismatch', 'QueueAlreadyExists', 'QueueBeingDeleted', 'QueueDisabled', 'QueueNotEmpty', 'QueueNotFound'

CredentialPolicyCreator

A factory function that creates a new CredentialPolicy that uses the provided nextPolicy.

HttpRequestBody
MessagesDequeueResponse
MessagesEnqueueResponse
MessagesPeekResponse
QueueGetAccessPolicyResponse
RequestPolicyFactory

Creates a new RequestPolicy per-request that uses the provided nextPolicy.

Enums

HttpPipelineLogLevel

The different levels of logs that can be used with the HttpPipelineLogger.

RetryPolicyType

RetryPolicy types.

SASProtocol

Protocols for generated SAS.

Functions

deserializationPolicy(DeserializationContentTypes)

Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they pass through the HTTP pipeline.

generateAccountSASQueryParameters(IAccountSASSignatureValues, SharedKeyCredential)

ONLY AVAILABLE IN NODE.JS RUNTIME.

Generates a SASQueryParameters object which contains all SAS query parameters needed to make an actual REST request.

See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas

generateQueueSASQueryParameters(IQueueSASSignatureValues, SharedKeyCredential)

ONLY AVAILABLE IN NODE.JS RUNTIME.

Creates an instance of SASQueryParameters.

Only accepts required settings needed to create a SAS. For optional settings please set corresponding properties directly, such as permissions, startTime and identifier.

WARNING: When identifier is not provided, permissions and expiryTime are required. You MUST assign value to identifier or expiryTime & permissions manually if you initial with this constructor.

Function Details

deserializationPolicy(DeserializationContentTypes)

Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they pass through the HTTP pipeline.

function deserializationPolicy(deserializationContentTypes?: DeserializationContentTypes): RequestPolicyFactory

Parameters

deserializationContentTypes
DeserializationContentTypes

Returns

generateAccountSASQueryParameters(IAccountSASSignatureValues, SharedKeyCredential)

ONLY AVAILABLE IN NODE.JS RUNTIME.

Generates a SASQueryParameters object which contains all SAS query parameters needed to make an actual REST request.

See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas

function generateAccountSASQueryParameters(accountSASSignatureValues: IAccountSASSignatureValues, sharedKeyCredential: SharedKeyCredential): SASQueryParameters

Parameters

accountSASSignatureValues
IAccountSASSignatureValues
sharedKeyCredential
SharedKeyCredential

Returns

generateQueueSASQueryParameters(IQueueSASSignatureValues, SharedKeyCredential)

ONLY AVAILABLE IN NODE.JS RUNTIME.

Creates an instance of SASQueryParameters.

Only accepts required settings needed to create a SAS. For optional settings please set corresponding properties directly, such as permissions, startTime and identifier.

WARNING: When identifier is not provided, permissions and expiryTime are required. You MUST assign value to identifier or expiryTime & permissions manually if you initial with this constructor.

function generateQueueSASQueryParameters(queueSASSignatureValues: IQueueSASSignatureValues, sharedKeyCredential: SharedKeyCredential): SASQueryParameters

Parameters

queueSASSignatureValues
IQueueSASSignatureValues
sharedKeyCredential
SharedKeyCredential

Returns