declarations
Version:
[](https://www.npmjs.com/package/declarations)
1,104 lines (895 loc) • 76.3 kB
TypeScript
// Type definitions for Azure SDK for Node v0.9.16
// Project: https://github.com/WindowsAzure/azure-sdk-for-node
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar>,
// Anti Veeranna <https://github.com/antiveeranna>,
// Maxime LUCE <https://github.com/SomaticIT>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/**
* TODO
*/
declare module "azure" {
import events = require("events");
import stream = require("stream");
import url = require("url");
//#region Services
export class TableService extends BatchServiceClient {
static incorrectTableNameErr: string;
static incorrectCallbackErr: string;
static incorrectTableQuery: string;
static incorrectPartitionErr: string;
//#region Constructors
/**
* Creates a new TableService object.
* Uses the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables.
*
* @constructor
* @extends {ServiceClient}
*/
constructor();
/**
* Creates a new TableService object.
* Uses a connectionString to connect
*
* @constructor
* @extends {ServiceClient}
* @param {string} connectionString The connection string.
*/
constructor(connectionString: string);
/**
* Creates a new TableService object.
* Uses a storage account and an access key.
*
* @constructor
* @extends {ServiceClient}
* @param {string} storageAccount The storage account or the connection string.
* @param {string} storageAccessKey The storage access key.
* @param {string} host The host address.
* @param {object} authenticationProvider The authentication provider.
*/
constructor(storageAccount: string, storageAccessKey: string, host?: string, authenticationProvider?: string);
//#endregion
//#region Service Methods
getServiceProperties(callback: StorageServicePropertiesCallback): void;
getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void;
setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void;
setServiceProperties(serviceProperties: StorageServiceProperties, options: TimeoutIntervalOptions, callback: StorageCallbackVoid): void;
//#endregion
//#region Table Methods
getTable(table: string, callback?: TableRequestCallback): void;
getTable(table: string, options: TimeoutIntervalOptions, callback?: TableRequestCallback): void;
createTable(table: string, callback?: TableRequestCallback): void;
createTable(table: string, options: TimeoutIntervalOptions, callback?: TableRequestCallback): void;
createTableIfNotExists(table: string, callback?: CreateTableIfNotExistsCallback): void;
createTableIfNotExists(table: string, options: TimeoutIntervalOptions, callback?: CreateTableIfNotExistsCallback): void;
deleteTable(table: string, callback?: DeleteTableCallback): void;
deleteTable(table: string, options: TimeoutIntervalOptions, callback?: DeleteTableCallback): void;
queryTables(callback?: QueryTablesCallback): void;
queryTables(options: QueryTablesOptions, callback?: QueryTablesCallback): void;
//#endregion
//#region Entities Methods
queryEntity(table: string, partitionKey: string, rowKey: string, callback?: QueryEntityCallback): void;
queryEntity(table: string, partitionKey: string, rowKey: string, options: TimeoutIntervalOptions, callback?: QueryEntityCallback): void;
queryEntities(tableQuery: TableQuery, callback?: QueryEntitiesCallback): void;
queryEntities(tableQuery: TableQuery, options: TimeoutIntervalOptions, callback?: QueryEntitiesCallback): void;
insertEntity(tableName: string, entityDescriptor: Entity, callback?: ModifyEntityCallback): void;
insertEntity(tableName: string, entityDescriptor: Entity, options: TimeoutIntervalOptions, callback?: ModifyEntityCallback): void;
insertOrReplaceEntity(tableName: string, entityDescriptor: Entity, callback?: ModifyEntityCallback): void;
insertOrReplaceEntity(tableName: string, entityDescriptor: Entity, options: TimeoutIntervalOptions, callback?: ModifyEntityCallback): void;
updateEntity(tableName: string, entityDescriptor: Entity, callback?: ModifyEntityCallback): void;
updateEntity(tableName: string, entityDescriptor: Entity, options: UpdateEntityOptions, callback?: ModifyEntityCallback): void;
mergeEntity(tableName: string, entityDescriptor: Entity, callback?: ModifyEntityCallback): void;
mergeEntity(tableName: string, entityDescriptor: Entity, options: UpdateEntityOptions, callback?: ModifyEntityCallback): void;
insertOrMergeEntity(tableName: string, entityDescriptor: Entity, callback?: ModifyEntityCallback): void;
insertOrMergeEntity(tableName: string, entityDescriptor: Entity, options: UpdateEntityOptions, callback?: ModifyEntityCallback): void;
deleteEntity(tableName: string, entityDescriptor: Entity, callback?: DeleteEntityCallback): void;
deleteEntity(tableName: string, entityDescriptor: Entity, options: UpdateEntityOptions, callback?: DeleteEntityCallback): void;
//#endregion
}
export class BlobService extends StorageServiceClient {
singleBlobPutThresholdInBytes: number;
parallelOperationThreadCount: number;
SpeedSummary: typeof SpeedSummary;
//#region Constructors
/**
* Creates a new BlobService object.
* Uses the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables.
*
* @constructor
* @extends {StorageServiceClient}
*/
constructor();
/**
* Creates a new BlobService object.
* Uses a connectionString to connect
*
* @constructor
* @extends {StorageServiceClient}
* @param {string} connectionString The connection string.
*/
constructor(connectionString: string);
/**
* Creates a new BlobService object.
* Uses a storage account and an access key.
*
* @constructor
* @extends {StorageServiceClient}
* @param {string} storageAccount The storage account or the connection string.
* @param {string} storageAccessKey The storage access key.
* @param {string} host The host address.
* @param {object} sasToken The Shared Access Signature token.
*/
constructor(storageAccount: string, storageAccessKey: string, host?: string, sasToken?: string);
//#endregion
//#region Service Methods
/**
* Gets the properties of a storage account�s Blob service, including Azure Storage Analytics.
*/
getServiceProperties(callback: StorageServicePropertiesCallback): void;
getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void;
/**
* Sets the properties of a storage account�s Blob service, including Azure Storage Analytics.
* You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
*/
setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void;
setServiceProperties(serviceProperties: StorageServiceProperties, options: TimeoutIntervalOptions, callback: StorageCallbackVoid): void;
//#endregion
//#region Containers Methods
/**
* Lists a segment containing a collection of container items under the specified account.
*/
listContainers(callback: ListContainersCallback): void;
listContainers(options: ListContainersOptions, callback: ListContainersCallback): void;
/**
* Creates a new container under the specified account.
* If a container with the same name already exists, the operation fails.
*/
createContainer(container: string, callback: StorageCallback<ContainerResult>): void;
createContainer(container: string, options: CreateContainerOptions, callback: StorageCallback<ContainerResult>): void;
/**
* Creates a new container under the specified account if the container does not exists.
*/
createContainerIfNotExists(container: string, callback: StorageCallback<boolean>): void;
createContainerIfNotExists(container: string, options: CreateContainerOptions, callback: StorageCallback<boolean>): void;
/**
* Retrieves a container and its properties from a specified account.
*/
getContainerProperties(container: string, callback: StorageCallback<ContainerResult>): void;
getContainerProperties(container: string, options: GetContainerPropertiesOptions, callback: StorageCallback<ContainerResult>): void;
/**
* Returns all user-defined metadata for the container.
*/
getContainerMetadata(container: string, callback: StorageCallback<ContainerResult>): void;
getContainerMetadata(container: string, options: GetContainerPropertiesOptions, callback: StorageCallback<ContainerResult>): void;
/**
* Sets the container's metadata.
*/
setContainerMetadata(container: string, metadata: StorageMetadata, callback: StorageCallback<ContainerResult>): void;
setContainerMetadata(container: string, metadata: StorageMetadata, options: AccessConditionsOptions, callback: StorageCallback<ContainerResult>): void;
/**
* Gets the container's ACL.
*/
getContainerAcl(container: string, callback: StorageCallback<ContainerResult>): void;
getContainerAcl(container: string, options: GetContainerPropertiesOptions, callback: StorageCallback<ContainerResult>): void;
/**
* Updates the container's ACL.
*/
setContainerAcl(container: string, publicAccessLevel: string, callback: StorageCallback<ContainerResult>): void;
setContainerAcl(container: string, publicAccessLevel: string, options: StorageAclOptions, callback: StorageCallback<ContainerResult>): void;
/**
* Marks the specified container for deletion.
* The container and any blobs contained within it are later deleted during garbage collection.
*/
deleteContainer(container: string, callback: StorageCallbackVoid): void;
deleteContainer(container: string, options: LeaseIdOptions, callback: StorageCallbackVoid): void;
//#endregion
//#region Blob Methods
/**
* Lists all of the blobs in the given container.
*/
listBlobs(container: string, callback: ListBlobsCallback): void;
listBlobs(container: string, options: ListBlobsOptions, callback: ListBlobsCallback): void;
/**
* Returns all user-defined metadata, standard HTTP properties, and system properties for the blob.
* It does not return or modify the content of the blob.
*/
getBlobProperties(container: string, blob: string, callback: StorageCallback<BlobResult>): void;
getBlobProperties(container: string, blob: string, options: GetBlobPropertiesOptions, callback: StorageCallback<BlobResult>): void;
/**
* Sets user-defined properties for the specified blob or snapshot.
* It does not return or modify the content of the blob.
*/
setBlobProperties(container: string, blob: string, callback: StorageCallback<BlobResult>): void;
setBlobProperties(container: string, blob: string, options: SetBlobPropertiesOptions, callback: StorageCallback<BlobResult>): void;
/**
* Sets user-defined metadata for the specified blob or snapshot as one or more name-value pairs
* It does not return or modify the content of the blob.
*/
setBlobMetadata(container: string, blob: string, metadata: StorageMetadata, callback: StorageCallback<BlobResult>): void;
setBlobMetadata(container: string, blob: string, metadata: StorageMetadata, options: GetBlobPropertiesOptions, callback: StorageCallback<BlobResult>): void;
/**
* Provides a stream to read from a blob.
*/
getBlob(container: string, blob: string, callback: StorageCallback<BlobResult>): stream.Readable;
getBlob(container: string, blob: string, options: ReadBlobOptions, callback: StorageCallback<BlobResult>): stream.Readable;
/**
* Downloads a blob into a file.
*/
getBlobToFile(container: string, blob: string, localFileName: string, callback: StorageCallback<BlobResult>): void;
getBlobToFile(container: string, blob: string, localFileName: string, options: ReadBlobOptions, callback: StorageCallback<BlobResult>): void;
/**
* Downloads a blob into a stream.
*/
getBlobToStream(container: string, blob: string, stream: stream.Writable, callback: StorageCallback<BlobResult>): void;
getBlobToStream(container: string, blob: string, stream: stream.Writable, options: ReadBlobOptions, callback: StorageCallback<BlobResult>): void;
/**
* Downloads a blob into a text string.
*/
getBlobToText(container: string, blob: string, callback: GetBlobToTextCallback): void;
getBlobToText(container: string, blob: string, options: ReadBlobOptions, callback: GetBlobToTextCallback): void;
/**
* Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection.
* If a blob has snapshots, you must delete them when deleting the blob. Using the deleteSnapshots option, you can choose either to delete both the blob and its snapshots,
* or to delete only the snapshots but not the blob itself. If the blob has snapshots, you must include the deleteSnapshots option or the blob service will return an error
* and nothing will be deleted.
* If you are deleting a specific snapshot using the snapshotId option, the deleteSnapshots option must NOT be included.
*/
deleteBlob(container: string, blob: string, callback: StorageCallback<boolean>): void;
deleteBlob(container: string, blob: string, options: DeleteBlobOptions, callback: StorageCallback<boolean>): void;
/**
* Creates a read-only snapshot of a blob.
*/
createBlobSnapshot(container: string, blob: string, callback: StorageCallback<string>): void;
createBlobSnapshot(container: string, blob: string, options: BlobSnapshotOptions, callback: StorageCallback<string>): void;
/**
* Starts to copy a blob to a destination within the storage account. The Copy Blob operation copies the entire committed blob.
*/
copyBlob(sourceUri: string, targetContainer: string, targetBlob: string, callback: StorageCallback<BlobResult>): void;
copyBlob(sourceUri: string, targetContainer: string, targetBlob: string, options: CopyBlobOptions, callback: StorageCallback<BlobResult>): void;
/**
* Creates a read-only snapshot of a blob.
*/
abortCopyBlob(container: string, blob: string, copyId: string, callback: StorageCallbackVoid): void;
abortCopyBlob(container: string, blob: string, copyId: string, options: LeaseIdOptions, callback: StorageCallbackVoid): void;
/**
* Retrieves a shared access signature token.
*/
generateSharedAccessSignature(container: string, blob: string, sharedAccessPolicy: SharedAccessPolicy): SharedAccessSignatureResult;
/**
* Retrieves a blob or container URL.
*/
getBlobUrl(container: string): string;
getBlobUrl(container: string, blob: string): string;
getBlobUrl(container: string, blob: string, sharedAccessPolicy: SharedAccessPolicy): string;
/**
* Uploads a blob.
*/
createBlob(container: string, blob: string, blobType: string, callback: StorageCallback<string>): stream.Writable;
createBlob(container: string, blob: string, blobType: string, options: UploadBlockBlobOptions, callback: StorageCallback<string>): stream.Writable;
//#endregion
//#region Page Blob Methods
/**
* Creates a page blob of the specified length.
*/
createPageBlob(container: string, blob: string, length: number, callback: StorageCallbackVoid): void;
createPageBlob(container: string, blob: string, length: number, options: SetBlobPropertiesOptions, callback: StorageCallbackVoid): void;
/**
* Updates a page blob from a stream.
*/
createBlobPagesFromStream(container: string, blob: string, readStream: stream.Readable, rangeStart: number, rangeEnd: number, callback: StorageCallback<BlobResult>): void;
createBlobPagesFromStream(container: string, blob: string, readStream: stream.Readable, rangeStart: number, rangeEnd: number, options: CreatePagesOptions, callback: StorageCallback<BlobResult>): void;
/**
* Updates a page blob from a text string.
*/
createBlobPagesFromText(container: string, blob: string, text: string, rangeStart: number, rangeEnd: number, callback: StorageCallback<BlobResult>): void;
createBlobPagesFromText(container: string, blob: string, text: string, rangeStart: number, rangeEnd: number, options: CreatePagesOptions, callback: StorageCallback<BlobResult>): void;
/**
* Lists page ranges.
* Lists all of the page ranges by default, or only the page ranges over a specific range of bytes if rangeStart and rangeEnd are specified.
*/
listBlobRegions(container: string, blob: string, callback: StorageCallback<PageRange[]>): void;
listBlobRegions(container: string, blob: string, options: PageRangeOptions, callback: StorageCallback<PageRange[]>): void;
/**
* Clears a range of pages.
*/
clearBlobPages(container: string, blob: string, rangeStart: number, rangeEnd: number, callback: StorageCallbackVoid): void;
clearBlobPages(container: string, blob: string, rangeStart: number, rangeEnd: number, options: LeaseAccessConditionsOptions, callback: StorageCallbackVoid): void;
/**
* Resizes a page blob.
*/
resizePageBlob(container: string, blob: string, size: number, callback: StorageCallback<BlobResult>): void;
resizePageBlob(container: string, blob: string, size: number, options: LeaseAccessConditionsOptions, callback: StorageCallback<BlobResult>): void;
/**
* Sets the page blob's sequence number.
*/
setPageBlobSequenceNumber(container: string, blob: string, sequenceNumberAction: string, sequenceNumber: string, callback: StorageCallback<BlobResult>): void;
setPageBlobSequenceNumber(container: string, blob: string, sequenceNumberAction: string, sequenceNumber: string, options: AccessConditionsOptions, callback: StorageCallback<BlobResult>): void;
//#endregion
//#region Block Blob Methods
/**
* Uploads a block blob from file.
*/
putBlockBlobFromFile(container: string, blob: string, localFileName: string, callback: StorageCallback<BlobResult>): SpeedSummary;
putBlockBlobFromFile(container: string, blob: string, localFileName: string, options: UploadBlockBlobOptions, callback: StorageCallback<BlobResult>): SpeedSummary;
createBlockBlobFromFile(container: string, blob: string, localFileName: string, callback: StorageCallback<BlobResult>): SpeedSummary;
createBlockBlobFromFile(container: string, blob: string, localFileName: string, options: UploadBlockBlobOptions, callback: StorageCallback<BlobResult>): SpeedSummary;
/**
* Uploads a block blob from a stream.
*/
putBlockBlobFromStream(container: string, blob: string, stream: stream.Stream, streamLength: number, callback: StorageCallback<BlobResult>): SpeedSummary;
putBlockBlobFromStream(container: string, blob: string, stream: stream.Stream, streamLength: number, options: UploadBlockBlobOptions, callback: StorageCallback<BlobResult>): SpeedSummary;
createBlockBlobFromStream(container: string, blob: string, stream: stream.Stream, streamLength: number, callback: StorageCallback<BlobResult>): SpeedSummary;
createBlockBlobFromStream(container: string, blob: string, stream: stream.Stream, streamLength: number, options: UploadBlockBlobOptions, callback: StorageCallback<BlobResult>): SpeedSummary;
/**
* Uploads a block blob from a text string.
*/
createBlockBlobFromText(container: string, blob: string, text: string, callback: StorageCallback<BlobResult>): SpeedSummary;
createBlockBlobFromText(container: string, blob: string, text: string, options: UploadBlockBlobOptions, callback: StorageCallback<BlobResult>): SpeedSummary;
/**
* Creates a new block to be committed as part of a blob.
*/
createBlobBlockFromStream(blockId: string, container: string, blob: string, readStream: stream.Stream, streamLength: number, callback: StorageCallbackVoid): void;
createBlobBlockFromStream(blockId: string, container: string, blob: string, readStream: stream.Stream, streamLength: number, options: CreateBlockOptions, callback: StorageCallbackVoid): void;
/**
* Creates a new block to be committed as part of a blob.
*/
createBlobBlockFromText(blockId: string, container: string, blob: string, text: string, callback: StorageCallbackVoid): void;
createBlobBlockFromText(blockId: string, container: string, blob: string, text: string, options: CreateBlockOptions, callback: StorageCallbackVoid): void;
/**
* Writes a blob by specifying the list of block IDs that make up the blob.
* In order to be written as part of a blob, a block must have been successfully written to the server in a prior
* createBlock operation.
*/
commitBlobBlocks(container: string, blob: string, blockList: BlockList, callback: StorageCallback<BlockList>): void;
commitBlobBlocks(container: string, blob: string, blockList: BlockList, options: CreateBlockOptions, callback: StorageCallback<BlockList>): void;
/**
* Retrieves the list of blocks that have been uploaded as part of a block blob.
*/
listBlobBlocks(container: string, blob: string, blockListType: string, callback: StorageCallback<BlockList>): void;
listBlobBlocks(container: string, blob: string, blockListType: string, options: GetBlobPropertiesOptions, callback: StorageCallback<BlockList>): void;
/**
* Generate a random block id prefix.
*/
generateBlockIdPrefix(): string;
/**
* Get a block id according to prefix and block number.
*/
getBlockId(prefix: string, number: number): string;
//#endregion
//#region Lease Methods
/**
* Acquires a new lease.
* If container and blob are specified, acquires a blob lease.
* Otherwise, if only container is specified and blob is null, acquires a container lease.
*/
acquireLease(container: string, blob: string, callback: StorageCallback<LeaseResult>): void;
acquireLease(container: string, blob: string, options: LeaseOptions, callback: StorageCallback<LeaseResult>): void;
/**
* Renews an existing lease.
* If container and blob are specified, renews the blob lease.
* Otherwise, if only container is specified and blob is null, renews the container lease.
*/
renewLease(container: string, blob: string, leaseId: string, callback: StorageCallback<LeaseResult>): void;
renewLease(container: string, blob: string, leaseId: string, options: AccessConditionsOptions, callback: StorageCallback<LeaseResult>): void;
/**
* Releases the lease.
* If container and blob are specified, releases the blob lease.
* Otherwise, if only container is specified and blob is null, releases the container lease.
*/
releaseLease(container: string, blob: string, leaseId: string, callback: StorageCallback<LeaseResult>): void;
releaseLease(container: string, blob: string, leaseId: string, options: AccessConditionsOptions, callback: StorageCallback<LeaseResult>): void;
/**
* Breaks the lease but ensures that another client cannot acquire a new lease until the current lease period has expired.
* If container and blob are specified, breaks the blob lease.
* Otherwise, if only container is specified and blob is null, breaks the container lease.
*/
breakLease(container: string, blob: string, leaseId: string, callback: StorageCallback<LeaseResult>): void;
breakLease(container: string, blob: string, leaseId: string, options: BreakLeaseOptions, callback: StorageCallback<LeaseResult>): void;
//#endregion
}
export class QueueService extends StorageServiceClient {
authenticationProvider: SharedKey;
//#region Constructors
/**
* Creates a new BlobService object.
* Uses the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables.
*
* @constructor
* @extends {StorageServiceClient}
*/
constructor();
/**
* Creates a new BlobService object.
* Uses a connectionString to connect
*
* @constructor
* @extends {StorageServiceClient}
* @param {string} connectionString The connection string.
*/
constructor(connectionString: string);
/**
* Creates a new BlobService object.
* Uses a storage account and an access key.
*
* @constructor
* @extends {StorageServiceClient}
* @param {string} storageAccount The storage account or the connection string.
* @param {string} storageAccessKey The storage access key.
* @param {string} host The host address.
* @param {object} sasToken The Shared Access Signature token.
*/
constructor(storageAccount: string, storageAccessKey: string, host?: string, sasToken?: string);
//#endregion
//#region Service Methods
/**
* Gets the properties of a storage account�s Blob service, including Azure Storage Analytics.
*/
getServiceProperties(callback: StorageServicePropertiesCallback): void;
getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void;
/**
* Sets the properties of a storage account�s Blob service, including Azure Storage Analytics.
* You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
*/
setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void;
setServiceProperties(serviceProperties: StorageServiceProperties, options: TimeoutIntervalOptions, callback: StorageCallbackVoid): void;
//#endregion
//#region Queue Methods
/**
* Lists all queues under the given account.
*/
listQueues(callback: ListQueuesCallback): void;
listQueues(options: ListQueuesOptions, callback: ListQueuesCallback): void;
/**
* Creates a new queue under the given account.
*/
createQueue(queue: string, callback: StorageCallback<QueueResult>): void;
createQueue(queue: string, options: MetadataOptions, callback: StorageCallback<QueueResult>): void;
/**
* Creates a new queue under the given account if it doesn't exist.
*/
createQueueIfNotExists(queue: string, callback: StorageCallback<boolean>): void;
createQueueIfNotExists(queue: string, options: MetadataOptions, callback: StorageCallback<boolean>): void;
/**
* Permanently deletes the specified queue.
*/
deleteQueue(queue: string, callback: StorageCallback<boolean>): void;
deleteQueue(queue: string, options: TimeoutIntervalOptions, callback: StorageCallback<boolean>): void;
/**
* Returns queue properties, including user-defined metadata.
*/
getQueueMetadata(queue: string, callback: StorageCallback<QueueResult>): void;
getQueueMetadata(queue: string, options: TimeoutIntervalOptions, callback: StorageCallback<QueueResult>): void;
/**
* Sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.
*/
setQueueMetadata(queue: string, metadata: StorageMetadata, callback: StorageCallback<QueueResult>): void;
setQueueMetadata(queue: string, metadata: StorageMetadata, options: TimeoutIntervalOptions, callback: StorageCallback<QueueResult>): void;
//#endregion
//#region Message Methods
/**
* Adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message
* invisible until the visibility timeout expires. A message must be in a format that can be included in an XML request
* with UTF-8 encoding. The encoded message can be up to 64KB in size for versions 2011-08-18 and newer, or 8KB in size
* for previous versions.
*/
createMessage(queue: string, messageText: string, callback: StorageCallback<QueueMessageResult>): void
createMessage(queue: string, messageText: string, options: CreateQueueMessageOptions, callback: StorageCallback<QueueMessageResult>): void
/**
* Retrieves a message from the queue and makes it invisible to other consumers.
*/
getMessages(queue: string, callback: StorageCallback<QueueMessageResult[]>): void;
getMessages(queue: string, options: GetQueueMessagesOptions, callback: StorageCallback<QueueMessageResult[]>): void;
/**
* Retrieves a message from the front of the queue, without changing the message visibility.
*/
peekMessages(queue: string, callback: StorageCallback<QueueMessageResult[]>): void;
peekMessages(queue: string, options: PeekQueueMessagesOptions, callback: StorageCallback<QueueMessageResult[]>): void;
/**
* Deletes a specified message from the queue.
*/
deleteMessage(queue: string, messageId: string, popreceipt: string, callback: StorageCallback<boolean>): void
deleteMessage(queue: string, messageId: string, popreceipt: string, options: TimeoutIntervalOptions, callback: StorageCallback<boolean>): void
/**
* Clears all messages from the queue.
*/
clearMessages(queue: string, callback: StorageCallbackVoid): void;
clearMessages(queue: string, options: TimeoutIntervalOptions, callback: StorageCallbackVoid): void;
/**
* Deletes a specified message from the queue.
*/
updateMessage(queue: string, messageId: string, popreceipt: string, visibilitytimeout: number, callback: StorageCallback<QueueMessageResult>): void
updateMessage(queue: string, messageId: string, popreceipt: string, visibilitytimeout: number, options: UpdateQueueMessagesOptions, callback: StorageCallback<QueueMessageResult>): void
//#endregion
}
export class ServiceBusService {
}
export class SqlService {
}
export class ServiceManagementService {
}
export class SqlManagementService {
}
//#endregion
//#region Service Creators
export function createTableService(): TableService;
export function createTableService(connectionString: string): TableService;
export function createTableService(storageAccount: string, storageAccessKey: string, host?: string, authenticationProvider?: string): TableService;
export function createBlobService(): BlobService;
export function createBlobService(connectionString: string): BlobService;
export function createBlobService(storageAccount: string, storageAccessKey: string, host?: string, authenticationProvider?: string): BlobService;
export function createQueueService(): QueueService;
export function createQueueService(connectionString: string): QueueService;
export function createQueueService(storageAccount: string, storageAccessKey: string, host?: string, authenticationProvider?: string): QueueService;
export function createServiceBusService(): ServiceBusService;
export function createServiceBusService(connectionString: string): ServiceBusService;
export function createServiceBusService(namespace: string, accessKey?: string, issuer?: string, acsNamespace?: string, host?: string, authenticationProvider?: string): ServiceBusService;
export function createSqlService(serverName: string, administratorLogin: string, administratorLoginPassword: string, host?: string, acsHost?: string, authenticationProvider?: string): SqlService;
export function createServiceManagementService(subscriptionId: string, authentication: string, hostOptions: string): ServiceManagementService;
export function createSqlManagementService(subscriptionId: string, authentication: string, hostOptions: string): SqlManagementService;
//#endregion
//#region RoleEnvironment
interface RoleEnvironmentInterface extends events.EventEmitter {
incorrectCallbackErr: string;
clientId: string;
VersionEndpointFixedPath: string;
EnvironmentVariables: {
[key: string]: string;
VersionEndpointEnvironmentName: string;
};
/**
* Returns a RoleInstance object that represents the role instance
* in which this code is currently executing.
*/
getCurrentRoleInstance(callback: SimpleCallback<RoleInstance>): void;
/**
* Returns the deployment ID that uniquely identifies the deployment in
* which this role instance is running.
*/
getDeploymentId(callback: SimpleCallback<string>): void;
/**
* Indicates whether the role instance is running in the Microsoft Azure
* environment. It is good practice to enclose any code that uses
* service runtime in the isAvailable callback.
*/
isAvailable(callback: SimpleCallback<boolean>): void;
/**
* Indicates whether the role instance is running in the development fabric.
*/
isEmulated(callback: SimpleCallback<boolean>): void;
/**
* Returns the set of Role objects defined for your service.
* Roles are defined in the service definition file.
*/
getRoles(callback: SimpleCallback<Dictionary<Role>>): void;
/**
* Retrieves the settings in the service configuration file.
*
* A role's configuration settings are defined in the service definition file.
* Values for configuration settings are set in the service configuration file.
* For more information on configuration settings, see the [Service Definition Schema](http://msdn.microsoft.com/en-us/library/windowsazure/ee758711.aspx)
* and [Service Configuration Schema](http://msdn.microsoft.com/en-us/library/windowsazure/ee758710.aspx).
*/
getConfigurationSettings(callback: SimpleCallback<Dictionary<string>>): void;
/**
* Retrieves the set of named local storage resources, along with the path.
* For example, the DiagnosticStore resource which is defined for every role
* provides a location for runtime diagnostics and logs.
*/
getLocalResources(callback: SimpleCallback<Dictionary<RoleLocalResource>>): void;
/**
* Requests that the current role instance be stopped and restarted.
*
* Before the role instance is recycled, the Microsoft Azure load balancer takes the role instance out of rotation.
* This ensures that no new requests are routed to the instance while it is restarting.
*
* A call to `RequestRecycle` initiates the normal shutdown cycle. Microsoft Azure raises the
* `Stopping` event and calls the `OnStop` method so that you can run the necessary code to
* prepare the instance to be recycled.
*/
requestRecycle(callback: ErrorCallback): void;
/**
* Sets the status of the role instance.
*
* An instance may indicate that it is in one of two states: Ready or Busy. If an instance's state is Ready, it is
* prepared to receive requests from the load balancer. If the instance's state is Busy, it will not receive
* requests from the load balancer.
*/
setStatus(roleInstanceStatus: string, expirationUtc: Date, callback: ErrorCallback): void;
/**
* Clears the status of the role instance.
* An instance may indicate that it has completed communicating status by calling this method.
*/
clearStatus(callback: ErrorCallback): void;
}
export var RoleEnvironment: RoleEnvironmentInterface;
//#endregion
//#region Export of internal classes
export class WebResource {
rawResponse: boolean;
queryString: Dictionary<string>;
constructor();
get(path: string): WebResource;
put(path: string): WebResource;
post(path: string): WebResource;
merge(path: string): WebResource;
head(path: string): WebResource;
del(path: string): WebResource;
withProperty(name: string, value: string): WebResource;
withRawResponse(rawResponse: boolean): WebResource;
withHeadersOnly(headersOnly: boolean): WebResource;
withQueryOption(name: string, value: string, defaultValue: string): WebResource;
withQueryOptions(queryOptions: Dictionary<string>): WebResource;
withHeader(name: string, value: string): WebResource;
withHeaders(headers: Dictionary<string>): WebResource;
withBody(body: any): WebResource;
addOptionalMetadataHeaders(metadata: StorageMetadata): WebResource;
validResponse(statusCode: number): boolean;
pipeInput(inputStream: stream.Stream, destStream: stream.Stream): stream.Stream;
}
export class ServiceClient extends events.EventEmitter {
static EnvironmentVariables: any;
static DEVSTORE_STORAGE_ACCOUNT: string;
static DEVSTORE_STORAGE_ACCESS_KEY: string;
static DEVSTORE_BLOB_HOST: string;
static DEVSTORE_QUEUE_HOST: string;
static DEVSTORE_TABLE_HOST: string;
static CLOUD_BLOB_HOST: string;
static CLOUD_QUEUE_HOST: string;
static CLOUD_TABLE_HOST: string;
static CLOUD_SERVICEBUS_HOST: string;
static CLOUD_ACCESS_CONTROL_HOST: string;
static CLOUD_SERVICE_MANAGEMENT_HOST: string;
static CLOUD_DATABASE_HOST: string;
static DEFAULT_SERVICEBUS_ISSUER: string;
static DEFAULT_WRAP_NAMESPACE_SUFFIX: string;
static DEFAULT_PROTOCOL: string;
constructor(host: string, authenticationProvider: any);
setHost(host: string): void;
performRequest(webResource: WebResource, outputData: string, options: any, callback: Function): void;
performRequestOutputStream(webResource: WebResource, outputStream: any, options: any, callback: Function): void;
performRequestInputStream(webResource: WebResource, outputData: string, inputStream: any, options: any, callback: Function): void;
withFilter(newFilter: Filter): ServiceClient;
parseMetadataHeaders(headers: any): any;
isEmulated(): boolean;
setProxy(proxyUrl: string, proxyPort: number): void;
}
export class BatchServiceClient extends StorageServiceClient {
operations: any[];
constructor(storageAccount: string, storageAccessKey: string, host: string, usePathstyleUri: boolean, authenticationProvider: any);
beginBatch(): void;
isInBatch(): boolean;
rollback(): void;
hasOperations(): boolean;
addOperation(webResource: WebResource, outputData: any): void;
commitBatch(callback: (error: any, operationResponses: any[], response: any) => void): void;
commitBatch(options: any, callback: (error: any, operationResponses: any[], response: any) => void): void;
processResponse(responseObject: any, requestOperations: any[]): any[];
processOperation(webResource: WebResource, rawResponse: string): any;
}
export class ServiceManagementClient {
}
export class TableQuery {
static select(...fields: string[]): TableQuery;
from(table: string): TableQuery;
whereKeys(partitionKey: string, rowKey: string): TableQuery;
whereNextKeys(partitionKey: string, rowKey: string): TableQuery;
where(condition: string, ...values: string[]): TableQuery;
and(condition: string, ...args: string[]): TableQuery;
or(condition: string, ...args: string[]): TableQuery;
top(integer: number): TableQuery;
toQueryObject(): any;
toPath(): string;
}
export class BlobResult {
blob: string;
container: string;
etag: string;
lastModified: string;
contentType: string;
contentEncoding: string;
contentLanguage: string;
contentMD5: string;
cacheControl: string;
contentRange: string;
contentTypeHeader: string;
contentEncodingHeader: string;
contentLanguageHeader: string;
contentMD5Header: string;
cacheControlHeader: string;
contentLength: number;
contentLengthHeader: number;
contentDisposition: string;
contentDispositionHeader: string;
range: string;
rangeHeader: string;
getContentMd5: string;
acceptRanges: string;
blobType: string;
leaseStatus: string;
leaseId: string;
leaseDuration: string;
leaseState: string;
sequenceNumber: string;
copyStatus: string;
copyCompletionTime: string;
copyStatusDescription: string;
copyId: string;
copyProgress: number;
requestId: string;
metadata: StorageMetadata;
constructor();
constructor(container: string);
constructor(container: string, blob: string);
static parse(blobXml: any): BlobResult;
static setHeadersFromBlob(webResource: WebResource, blob: BlobResult): void;
getPropertiesFromHeaders(headers: any): void;
}
export class ContainerResult {
name: string;
publicAccessLevel: string;
etag: string;
lastModified: string;
leaseStatus: string;
leaseDuration: string;
leaseState: string;
requestId: string;
metadata: StorageMetadata;
signedIdentifiers: SignedIdentifier[];
constructor();
constructor(name: string);
constructor(name: string, publicAccessLevel: string);
static parse(containerXml: any): ContainerResult;
getPropertiesFromHeaders(headers: any): void;
}
export class LeaseResult {
container: string;
blob: string;
id: string;
time: string;
etag: string;
lastModified: string;
constructor();
constructor(container: string);
constructor(container: string, blob: string);
constructor(container: string, blob: string, id: string);
constructor(container: string, blob: string, id: string, time: string);
getPropertiesFromHeaders(header: any): void;
}
export class QueueResult {
name: string;
metadata: StorageMetadata;
approximatemessagecount: number;
constructor();
constructor(name: string);
constructor(name: string, metadata: StorageMetadata);
static parse(messageXml: any): QueueResult;
getPropertiesFromHeaders(headers: any): void;
}
export class QueueMessageResult {
queue: string;
insertiontime: string;
expirationtime: string;
timenextvisible: string;
messagetext: string;
dequeuecount: string;
messageid: string;
popreceipt: string;
metadata: StorageMetadata;
constructor();
constructor(queue: string);
constructor(queue: string, messageid: string);
constructor(queue: string, messageid: string, popreceipt: string);
constructor(queue: string, messageid: string, popreceipt: string, metadata: StorageMetadata);
static serialize(messageJs: string): string;
static parse(messageXml: any): QueueMessageResult;
getPropertiesFromHeaders(headers: any): void;
}
export class SpeedSummary {
name: string;
totalSize: number;
completeSize: number;
_startTime: Date;
_timeWindowInSeconds: number;
_timeWindow: number;
_totalWindowSize: number;
_speedTracks: number[];
_speedTrackPtr: number;
constructor(name: string);
/**
* Get running seconds
*/
getElapsedSeconds(): string;
getElapsedSeconds(humanReadable: boolean): number;
/**
* Get complete percentage
*/
getCompletePercent(): number;
getCompletePercent(len: number): number;
/**
* Get average upload/download speed
*/
getAverageSpeed(): string;
getAverageSpeed(humanReadable: boolean): number;
/**
* Get internal speed
*/
getSpeed(): string;
getSpeed(humanReadable: boolean): number;
/**
* Get auto increment function
*/
getSpeed(size: number): (error: Error, value: any) => void;
/**
* Get total size
*/
getTotalSize(): string;
getTotalSize(humanReadable: boolean): number;
/**
* Get completed data size
*/
getCompleteSize(): string;
getCompleteSize(humanReadable: boolean): number;
}
export module Constants {
}
export interface Filter {
handle(requestOptions: any, next: Function): void;
}
export class LinearRetryPolicyFilter implements Filter {
constructor(retryCount?: number, retryInterval?: number);
retryCount: number;
retryInterval: number;
handle(requestOptions: any, next: Function): void;
}
export class ExponentialRetryPolicyFilter implements Filter {
constructor(retryCount?: number, retryInterval?: number, minRetryInterval?: number, maxRetryInterval?: number);
retryCount: number;
retryInterval: number;
minRetryInterval: number;
maxRetryInterval: number;
handle(requestOptions: any, next: Function): void;
}
export class HmacSha256Sign {
}
export class SharedAccessSignature {
storageAccount: string;
storageAccessKey: string;
permissionSet: string[];
signer: HmacSha256Sign;
constructor(storageAccount: string, storageAccessKey: string, permissionSet: string[])
/**
* Generates the query string for a shared access signature signing.
*/
generateSignedQueryString(path: string, queryString: Dictionary<string>, resourceType: string, sharedAccessPolicy: SharedAccessPolicy): Dictionary<string>;
/**
* Signs a request with the signature header.
*/
signRequest(webResource: WebResource, callback: ErrorCallback): void;
/**
* Generates the shared access signature for a resource.
*/
_generateSignature(path: string, resourceType: string, sharedAccessPolicy: SharedAccessPolicy): string;
/**
* Generates the query string for a shared access signature signing.
*/
_permissionMatchesRequest(sharedAccessSignature: string, webResource: WebResource, resourceType: string, requiredPermissions: string[]): string;
}
export class SharedKey {
storageAccount: string;
storageAccessKey: string;
usePathStyleUri: string;
signer: HmacSha256Sign;
constructor(storageAccount: string, storageAccessKey: string, usePathStyleUri: boolean);
/**
* Signs a request with the Authentication header.
*/
signRequest(webResource: WebResource, callback: ErrorCallback): void;
/**
* Retrieves the webresource's canonicalized resource string.
*/
_getCanonicalizedResource(webResource: WebResource): string;
/**
* Constructs the Canonicalized Headers string.
*
* To construct the CanonicalizedHeaders portion of the signature string,
*