New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@azure/storage-file

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/storage-file - npm Package Compare versions

Comparing version 12.0.0-preview.1 to 12.0.0-preview.2

11

BreakingChanges.md
# Breaking Changes
2019.07 Version 12.0.0-preview.1
### 2019.08 Version 12.0.0-preview.2
- [Breaking] Aborter class is no longer exposed from the package. Use the package [@azure/abort-controller](https://www.npmjs.com/package/@azure/abort-controller) to pass an abort signal to any of the async operations.
`AbortController.timeout(<milliseconds>)` can be utitlized as an abort signal.
### 2019.07 Version 12.0.0-preview.1
- Client types are renamed from *URL to *Client.

@@ -19,6 +24,6 @@ - ServiceURL, ShareURL, DirectoryURL and FileURL to ServiceClient to FileServiceClient, ShareClient, DirectoryClient and FileClient respectively.

- `uploadFileToAzureFile()`, `uploadStreamToAzureFile()`, `downloadAzureFileToBuffer()` and `uploadBrowserDataToAzureFile()` -> `FileClient.uploadFile()`,
`FileClient.uploadStream()`, `FileClient.downloadToBuffer()` and `FileClient.uploadBrowserData()` respectively.
`FileClient.uploadStream()`, `FileClient.downloadToBuffer()` and `FileClient.uploadBrowserData()` respectively.
- `StorageClient` is no longer exposed. `StorageClient.newPipeline()` static method is moved to the top level exported function `newPipeline()`.
2019.01 Version 10.1.0
### 2019.01 Version 10.1.0

@@ -25,0 +30,0 @@ - Updated convenience layer methods enum type parameters into typescript union types, this will help reducing bundle footprint.

# Changelog
2019.07 Version 12.0.0-preview.1
### 2019.08 Version 12.0.0-preview.2
- [Breaking] Aborter class is no longer exposed from the package. Use the package [@azure/abort-controller](https://www.npmjs.com/package/@azure/abort-controller) to pass an abort signal to any of the async operations.
`AbortController.timeout(<milliseconds>)` can be utitlized as an abort signal.
- Storage service allows SAS connection string with SAS string and endpoints along with the Account connection string(account name, key and endpoint).
In this preview, SAS connection string support is added to the existing connection string client constructors and static methods.
- Account connection string example - `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
- SAS connection string example - `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
- SAS connection string is supported in both NodeJS and browser runtimes unlike the Account Connection String which is supported only in the NodeJS runtime.
### 2019.07 Version 12.0.0-preview.1
- [Breaking] Client types are renamed from *URL to *Client.

@@ -22,3 +32,3 @@ - ServiceURL, ShareURL, DirectoryURL and FileURL to FileServiceClient, ShareClient, DirectoryClient and FileClient respectively.

- `uploadFileToAzureFile()`, `uploadStreamToAzureFile()`, `downloadAzureFileToBuffer()` and `uploadBrowserDataToAzureFile()` -> `FileClient.uploadFile()`,
`FileClient.uploadStream()`, `FileClient.downloadToBuffer()` and `FileClient.uploadBrowserData()` respectively.
`FileClient.uploadStream()`, `FileClient.downloadToBuffer()` and `FileClient.uploadBrowserData()` respectively.
- [Breaking] `StorageClient` is no longer exposed. `StorageClient.newPipeline()` static method is moved to the top level exported function `newPipeline()`.

@@ -39,3 +49,3 @@ - Updated dependency `@azure/ms-rest-js` to `@azure/core-http`.

2019.01 Version 10.1.0
### 2019.01 Version 10.1.0

@@ -53,4 +63,4 @@ - [Breaking] Updated convenience layer methods enum type parameters into typescript union types, this will help reducing bundle footprint.

2018.12 Version 10.0.0-preview
### 2018.12 Version 10.0.0-preview
- Initial Release. API version 2018-03-28 supported. Please see the README for information on the new design.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import * as tslib_1 from "tslib";
import { Aborter } from "./Aborter";
import { AbortSignal } from "@azure/abort-controller";
import { Directory } from "./generated/lib/operations";

@@ -52,3 +52,3 @@ import { newPipeline, Pipeline } from "./Pipeline";

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.create(tslib_1.__assign({}, options, { abortSignal: aborter }))];

@@ -203,3 +203,3 @@ });

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.getProperties({

@@ -225,3 +225,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.deleteMethod({

@@ -247,3 +247,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.setMetadata({

@@ -493,3 +493,3 @@ abortSignal: aborter,

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.listFilesAndDirectoriesSegment(tslib_1.__assign({ abortSignal: aborter, marker: marker }, options))];

@@ -496,0 +496,0 @@ });

@@ -6,3 +6,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { isNode } from "@azure/core-http";
import { Aborter } from "./Aborter";
import { AbortSignal } from "@azure/abort-controller";
import { FileDownloadResponse } from "./FileDownloadResponse";

@@ -59,3 +59,3 @@ import { File } from "./generated/lib/operations";

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (size < 0 || size > FILE_MAX_SIZE_BYTES) {

@@ -92,3 +92,3 @@ throw new RangeError("File size must >= 0 and < " + FILE_MAX_SIZE_BYTES + ".");

case 0:
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (options.rangeGetContentMD5 && offset === 0 && count === undefined) {

@@ -167,3 +167,3 @@ throw new RangeError("rangeGetContentMD5 only works with partial data downloading");

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.getProperties({

@@ -198,3 +198,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.deleteMethod({

@@ -225,3 +225,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.setHTTPHeaders(tslib_1.__assign({ abortSignal: aborter }, fileHTTPHeaders))];

@@ -248,3 +248,3 @@ });

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (length < 0) {

@@ -278,3 +278,3 @@ throw new RangeError("Size cannot less than 0 when resizing file.");

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.setMetadata({

@@ -305,3 +305,3 @@ abortSignal: aborter,

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (offset < 0 || contentLength <= 0) {

@@ -337,3 +337,3 @@ throw new RangeError("offset must >= 0 and contentLength must be > 0");

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (offset < 0 || contentLength <= 0) {

@@ -362,3 +362,3 @@ throw new RangeError("offset must >= 0 and contentLength must be > 0");

case 0:
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [4 /*yield*/, this.context.getRangeList({

@@ -406,3 +406,3 @@ abortSignal: aborter,

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.startCopy(copySource, {

@@ -430,3 +430,3 @@ abortSignal: aborter,

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.abortCopy(copyId, {

@@ -479,3 +479,3 @@ abortSignal: aborter

case 0:
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (!options.rangeSize) {

@@ -589,3 +589,3 @@ options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;

case 0:
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (!options.rangeSize) {

@@ -670,3 +670,3 @@ options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;

case 0:
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (!options.rangeSize) {

@@ -775,3 +775,3 @@ options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;

case 0:
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (!options.fileHTTPHeaders) {

@@ -831,14 +831,14 @@ options.fileHTTPHeaders = {};

* Fails if the the given file path already exits.
* Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
*
* @param {string} filePath
* @param {number} [offset] From which position of the block blob to download.
* @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined.
* @param {BlobDownloadOptions} [options] Options to Blob download options.
* @returns {Promise<Models.FileDownloadResponse>} The response data for blob download operation,
* but with readableStreamBody set to undefined since its
* content is already read and written into a local file
* at the specified path.
* @memberof BlobClient
*/
* Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
*
* @param {string} filePath
* @param {number} [offset] From which position of the block blob to download.
* @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined.
* @param {BlobDownloadOptions} [options] Options to Blob download options.
* @returns {Promise<Models.FileDownloadResponse>} The response data for blob download operation,
* but with readableStreamBody set to undefined since its
* content is already read and written into a local file
* at the specified path.
* @memberof BlobClient
*/
FileClient.prototype.downloadToFile = function (filePath, offset, count, options) {

@@ -845,0 +845,0 @@ if (offset === void 0) { offset = 0; }

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import * as tslib_1 from "tslib";
import { Aborter } from "./Aborter";
import { AbortSignal } from "@azure/abort-controller";
import { Service } from "./generated/lib/operations";

@@ -42,7 +42,11 @@ import { newPipeline, Pipeline } from "./Pipeline";

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Creates an instance of FileServiceClient from connection string.
*
* @param {string} connectionString Connection string for an Azure storage account.
* @param {string} connectionString Account connection string or a SAS connection string of an Azure storage account.
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
* Account connection string example -
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
* SAS connection string example -
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
* @param {NewPipelineOptions} [options] Options to configure the HTTP pipeline.

@@ -53,10 +57,19 @@ * @returns {FileServiceClient} A new FileServiceClient from the given connection string.

FileServiceClient.fromConnectionString = function (connectionString, options) {
if (isNode) {
var extractedCreds = extractConnectionStringParts(connectionString);
var sharedKeyCredential = new SharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
var pipeline = newPipeline(sharedKeyCredential, options);
return new FileServiceClient(extractedCreds.url, pipeline);
var extractedCreds = extractConnectionStringParts(connectionString);
if (extractedCreds.kind === "AccountConnString") {
if (isNode) {
var sharedKeyCredential = new SharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
var pipeline = newPipeline(sharedKeyCredential, options);
return new FileServiceClient(extractedCreds.url, pipeline);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
var pipeline = newPipeline(new AnonymousCredential(), options);
return new FileServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
}
else {
throw new Error("Connection string is only supported in Node.js environment");
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
}

@@ -135,3 +148,3 @@ };

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.serviceContext.getProperties({

@@ -158,3 +171,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.serviceContext.setProperties(properties, {

@@ -366,3 +379,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.serviceContext.listSharesSegment(tslib_1.__assign({ abortSignal: aborter, marker: marker }, options))];

@@ -369,0 +382,0 @@ });

@@ -5,3 +5,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import * as Models from "../src/generated/lib/models";
export * from "./Aborter";
export * from "./ShareClient";

@@ -8,0 +7,0 @@ export * from "./DirectoryClient";

@@ -5,3 +5,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import * as Models from "../src/generated/lib/models";
export * from "./Aborter";
export * from "./AccountSASPermissions";

@@ -8,0 +7,0 @@ export * from "./AccountSASResourceTypes";

@@ -5,3 +5,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { isNode } from "@azure/core-http";
import { Aborter } from "./Aborter";
import { AbortSignal } from "@azure/abort-controller";
import { Share } from "./generated/lib/operations";

@@ -40,11 +40,21 @@ import { newPipeline, Pipeline } from "./Pipeline";

typeof credentialOrPipelineOrShareName === "string") {
if (isNode) {
var shareName = credentialOrPipelineOrShareName;
var extractedCreds = extractConnectionStringParts(urlOrConnectionString);
var sharedKeyCredential = new SharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
urlOrConnectionString = extractedCreds.url + "/" + shareName;
pipeline = newPipeline(sharedKeyCredential, options);
var extractedCreds = extractConnectionStringParts(urlOrConnectionString);
var shareName = credentialOrPipelineOrShareName;
if (extractedCreds.kind === "AccountConnString") {
if (isNode) {
var sharedKeyCredential = new SharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
urlOrConnectionString = extractedCreds.url + "/" + shareName;
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
urlOrConnectionString =
extractedCreds.url + "/" + shareName + "?" + extractedCreds.accountSas;
pipeline = newPipeline(new AnonymousCredential(), options);
}
else {
throw new Error("Connection string is only supported in Node.js environment");
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
}

@@ -84,3 +94,3 @@ }

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.create(tslib_1.__assign({}, options, { abortSignal: aborter }))];

@@ -242,3 +252,3 @@ });

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.getProperties({

@@ -264,3 +274,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.deleteMethod(tslib_1.__assign({ abortSignal: aborter }, options))];

@@ -287,3 +297,3 @@ });

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.setMetadata({

@@ -316,3 +326,3 @@ abortSignal: aborter,

case 0:
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [4 /*yield*/, this.context.getAccessPolicy({

@@ -367,3 +377,3 @@ abortSignal: aborter

return tslib_1.__generator(this, function (_b) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
acl = [];

@@ -400,3 +410,3 @@ for (_i = 0, _a = shareAcl || []; _i < _a.length; _i++) {

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.createSnapshot(tslib_1.__assign({ abortSignal: aborter }, options))];

@@ -419,3 +429,3 @@ });

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
if (quotaInGB <= 0 || quotaInGB > 5120) {

@@ -443,3 +453,3 @@ throw new RangeError("Share quota must be greater than 0, and less than or equal to 5Tib (5120GB)");

return tslib_1.__generator(this, function (_a) {
aborter = options.abortSignal || Aborter.none;
aborter = options.abortSignal || AbortSignal.none;
return [2 /*return*/, this.context.getStatistics({

@@ -446,0 +456,0 @@ abortSignal: aborter

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export var SDK_VERSION = "12.0.0-preview.1";
export var SDK_VERSION = "12.0.0-preview.2";
export var SERVICE_VERSION = "2018-03-28";

@@ -5,0 +5,0 @@ export var FILE_MAX_SIZE_BYTES = 1024 * 1024 * 1024 * 1024; // 1TB

@@ -6,3 +6,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { Readable } from "stream";
import { Aborter } from "../Aborter";
import { AbortSignal } from "@azure/abort-controller";
/**

@@ -33,3 +33,3 @@ * ONLY AVAILABLE IN NODE.JS RUNTIME.

_this.retries = 0;
var aborter = options.abortSignal || Aborter.none;
var aborter = options.abortSignal || AbortSignal.none;
_this.aborter = aborter;

@@ -36,0 +36,0 @@ _this.getter = getter;

@@ -70,4 +70,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Extracts the parts of an Azure Storage account connection string.

@@ -77,38 +75,63 @@ *

* @param {string} connectionString Connection string.
* @returns {{ [key: string]: any }} String key value pairs of the storage account's base url for File, account name, and account key.
* @returns {{ kind: "AccountConnString" | "SASConnString", url: string, [key: string]: any }} String key value pairs of the storage account's url and credentials.
*/
export function extractConnectionStringParts(connectionString) {
var matchCredentials = connectionString.match("DefaultEndpointsProtocol=(.*);AccountName=(.*);AccountKey=(.*);EndpointSuffix=(.*)");
var defaultEndpointsProtocol;
var accountName;
var accountKey;
var endpointSuffix;
try {
defaultEndpointsProtocol = matchCredentials[1] || "";
accountName = matchCredentials[2] || "";
accountKey = Buffer.from(matchCredentials[3], "base64");
endpointSuffix = matchCredentials[4] || "";
// Account connection string
if (connectionString.search("DefaultEndpointsProtocol=") !== -1 &&
connectionString.search("AccountKey=") !== -1) {
var matchCredentials = connectionString.match("DefaultEndpointsProtocol=(.*);AccountName=(.*);AccountKey=(.*);EndpointSuffix=(.*)");
var defaultEndpointsProtocol = void 0;
var accountName = void 0;
var accountKey = void 0;
var endpointSuffix = void 0;
try {
defaultEndpointsProtocol = matchCredentials[1] || "";
accountName = matchCredentials[2] || "";
accountKey = Buffer.from(matchCredentials[3], "base64");
endpointSuffix = matchCredentials[4] || "";
}
catch (err) {
throw new Error("Invalid Account Connection String");
}
var protocol = defaultEndpointsProtocol.toLowerCase();
if (protocol !== "https" && protocol !== "http") {
throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
}
else if (!accountName) {
throw new Error("Invalid AccountName in the provided Connection String");
}
else if (accountKey.length === 0) {
throw new Error("Invalid AccountKey in the provided Connection String");
}
else if (!endpointSuffix) {
throw new Error("Invalid EndpointSuffix in the provided Connection String");
}
var url = defaultEndpointsProtocol + "://" + accountName + ".file." + endpointSuffix;
return {
kind: "AccountConnString",
url: url,
accountName: accountName,
accountKey: accountKey
};
}
catch (err) {
throw new Error("Invalid Connection String");
else {
// SAS connection string
var matchCredentials = connectionString.match("BlobEndpoint=(.*)/;QueueEndpoint=(.*)/;FileEndpoint=(.*)/;TableEndpoint=(.*)/;SharedAccessSignature=(.*)");
var endpoint = void 0;
var accountSas = void 0;
try {
endpoint = matchCredentials[3] || "";
accountSas = matchCredentials[5] || "";
}
catch (error) {
throw new Error("Invalid SAS Connection String");
}
if (!endpoint) {
throw new Error("Invalid QueueEndpoint in the provided SAS Connection String");
}
else if (!accountSas) {
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
}
return { kind: "SASConnString", url: endpoint, accountSas: accountSas };
}
var protocol = defaultEndpointsProtocol.toLowerCase();
if (protocol !== "https" && protocol !== "http") {
throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
}
else if (!accountName) {
throw new Error("Invalid AccountName in the provided Connection String");
}
else if (accountKey.length === 0) {
throw new Error("Invalid AccountKey in the provided Connection String");
}
else if (!endpointSuffix) {
throw new Error("Invalid EndpointSuffix in the provided Connection String");
}
var url = defaultEndpointsProtocol + "://" + accountName + ".file." + endpointSuffix;
return {
url: url,
accountName: accountName,
accountKey: accountKey
};
}

@@ -115,0 +138,0 @@ /**

{
"name": "@azure/storage-file",
"sdk-type": "client",
"version": "12.0.0-preview.1",
"version": "12.0.0-preview.2",
"description": "Microsoft Azure Storage SDK for JavaScript - File",

@@ -81,4 +81,5 @@ "main": "./dist/index.js",

"dependencies": {
"@azure/core-http": "^1.0.0-preview.1",
"@azure/core-paging": "^1.0.0-preview.1",
"@azure/abort-controller": "1.0.0-preview.1",
"@azure/core-http": "1.0.0-preview.2",
"@azure/core-paging": "1.0.0-preview.1",
"events": "^3.0.0",

@@ -135,3 +136,3 @@ "tslib": "^1.9.3"

"rimraf": "^2.6.2",
"rollup": "~1.13.1",
"rollup": "^1.16.3",
"rollup-plugin-commonjs": "^10.0.0",

@@ -143,4 +144,4 @@ "rollup-plugin-multi-entry": "^2.1.0",

"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-uglify": "^6.0.0",
"rollup-plugin-visualizer": "^1.0.0",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^2.0.0",
"source-map-support": "^0.5.9",

@@ -147,0 +148,0 @@ "ts-node": "^7.0.1",

@@ -7,3 +7,3 @@ # Azure Storage client library for JavaScript - File

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/feature/storage/sdk/storage/storage-file) | [Package (npm)](https://www.npmjs.com/package/@azure/storage-file) | [API Reference Documentation](https://azure.github.io/azure-sdk-for-js/storage-file/index.html) | [Product documentation](https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction) | [Samples](https://github.com/Azure/azure-sdk-for-js/tree/feature/storage/sdk/storage/storage-file/samples) | [Azure Storage File REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-rest-api)
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/feature/storage/sdk/storage/storage-file) | [Package (npm)](https://www.npmjs.com/package/@azure/storage-blob/v/12.0.0-preview.2) | [API Reference Documentation](https://azure.github.io/azure-sdk-for-js/storage-file/index.html) | [Product documentation](https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction) | [Samples](https://github.com/Azure/azure-sdk-for-js/tree/feature/storage/sdk/storage/storage-file/samples) | [Azure Storage File REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-rest-api)

@@ -73,3 +73,3 @@ ## Key concepts

```bash
npm install @azure/storage-file@12.0.0-preview.1
npm install @azure/storage-file@12.0.0-preview.2
```

@@ -103,6 +103,4 @@

Download latest released JS bundles from links in the [GitHub release page](https://github.com/Azure/azure-storage-js/releases). Or from following links directly:
Download latest released JS bundles from links in the [GitHub release page](https://github.com/Azure/azure-storage-js/releases).
- File [https://aka.ms/downloadazurestoragejsfile](https://aka.ms/downloadazurestoragejsfile)
### CORS

@@ -109,0 +107,0 @@

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { Aborter } from "./Aborter";
import { AbortSignalLike, AbortSignal } from "@azure/abort-controller";
import * as Models from "./generated/lib/models";

@@ -25,10 +25,9 @@ import { Directory } from "./generated/lib/operations";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -50,10 +49,9 @@ * A collection of key-value string pair to associate with the file storage object.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -87,10 +85,9 @@ * Filters the results to return only entries whose

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof DirectoryListFilesAndDirectoriesOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -114,10 +111,9 @@ * Filters the results to return only entries whose

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -133,10 +129,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -152,10 +147,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -242,3 +236,3 @@

): Promise<Models.DirectoryCreateResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.create({

@@ -380,3 +374,3 @@ ...options,

): Promise<Models.DirectoryGetPropertiesResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.getProperties({

@@ -399,3 +393,3 @@ abortSignal: aborter

): Promise<Models.DirectoryDeleteResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.deleteMethod({

@@ -419,3 +413,3 @@ abortSignal: aborter

): Promise<Models.DirectorySetMetadataResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.setMetadata({

@@ -602,3 +596,3 @@ abortSignal: aborter,

): Promise<Models.DirectoryListFilesAndDirectoriesSegmentResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.listFilesAndDirectoriesSegment({

@@ -605,0 +599,0 @@ abortSignal: aborter,

@@ -6,3 +6,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { HttpRequestBody, HttpResponse, isNode, TransferProgressEvent } from "@azure/core-http";
import { Aborter } from "./Aborter";
import { AbortSignal, AbortSignalLike } from "@azure/abort-controller";
import { FileDownloadResponse } from "./FileDownloadResponse";

@@ -37,10 +37,9 @@ import * as Models from "./generated/lib/models";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -71,10 +70,9 @@ * File HTTP headers like Content-Type.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -90,10 +88,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -142,10 +139,9 @@ * Optional. ONLY AVAILABLE IN NODE.JS.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -180,10 +176,9 @@ * An MD5 hash of the content. This hash is

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -206,10 +201,9 @@ * Optional. Specifies the range of bytes over which to list ranges, inclusively.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -254,4 +248,11 @@

export interface FileStartCopyOptions {
abortSignal?: Aborter;
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {AbortSignalLike}
* @memberof FileStartCopyOptions
*/
abortSignal?: AbortSignalLike;
/**
* A collection of key-value string pair to associate with the file storage object.

@@ -273,10 +274,9 @@ *

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileSetMetadataOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -292,10 +292,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileSetHTTPHeadersOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -311,10 +310,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileAbortCopyFromURLOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -330,10 +328,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileResizeOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -349,10 +346,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileClearRangeOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -367,4 +363,11 @@

export interface UploadStreamToAzureFileOptions {
abortSignal?: Aborter;
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {AbortSignalLike}
* @memberof UploadStreamToAzureFileOptions
*/
abortSignal?: AbortSignalLike;
/**
* Azure File HTTP Headers.

@@ -401,10 +404,9 @@ *

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof UploadToAzureFileOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -460,10 +462,9 @@ * RangeSize specifies the range size to use in each parallel upload,

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof DownloadFromAzureFileOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -596,3 +597,3 @@ * When downloading Azure files, download method will try to split large file into small ranges.

): Promise<Models.FileCreateResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (size < 0 || size > FILE_MAX_SIZE_BYTES) {

@@ -629,3 +630,3 @@ throw new RangeError(`File size must >= 0 and < ${FILE_MAX_SIZE_BYTES}.`);

): Promise<Models.FileDownloadResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (options.rangeGetContentMD5 && offset === 0 && count === undefined) {

@@ -706,3 +707,3 @@ throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);

): Promise<Models.FileGetPropertiesResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.getProperties({

@@ -732,3 +733,3 @@ abortSignal: aborter

public async delete(options: FileDeleteOptions = {}): Promise<Models.FileDeleteResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.deleteMethod({

@@ -756,3 +757,3 @@ abortSignal: aborter

): Promise<Models.FileSetHTTPHeadersResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.setHTTPHeaders({

@@ -780,3 +781,3 @@ abortSignal: aborter,

): Promise<Models.FileSetHTTPHeadersResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (length < 0) {

@@ -807,3 +808,3 @@ throw new RangeError(`Size cannot less than 0 when resizing file.`);

): Promise<Models.FileSetMetadataResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.setMetadata({

@@ -834,3 +835,3 @@ abortSignal: aborter,

): Promise<Models.FileUploadRangeResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (offset < 0 || contentLength <= 0) {

@@ -872,3 +873,3 @@ throw new RangeError(`offset must >= 0 and contentLength must be > 0`);

): Promise<Models.FileUploadRangeResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (offset < 0 || contentLength <= 0) {

@@ -893,3 +894,3 @@ throw new RangeError(`offset must >= 0 and contentLength must be > 0`);

): Promise<FileGetRangeListResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
const originalResponse = await this.context.getRangeList({

@@ -932,3 +933,3 @@ abortSignal: aborter,

): Promise<Models.FileStartCopyResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.startCopy(copySource, {

@@ -954,3 +955,3 @@ abortSignal: aborter,

): Promise<Models.FileAbortCopyResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.abortCopy(copyId, {

@@ -1002,3 +1003,3 @@ abortSignal: aborter

): Promise<void> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (!options.rangeSize) {

@@ -1098,3 +1099,3 @@ options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;

): Promise<void> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (!options.rangeSize) {

@@ -1167,3 +1168,3 @@ options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;

): Promise<void> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (!options.rangeSize) {

@@ -1260,3 +1261,3 @@ options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;

): Promise<void> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (!options.fileHTTPHeaders) {

@@ -1290,3 +1291,3 @@ options.fileHTTPHeaders = {};

`Stream size is larger than file size ${size} bytes, uploading failed. ` +
`Please make sure stream length is less or equal than file size.`
`Please make sure stream length is less or equal than file size.`
);

@@ -1312,7 +1313,7 @@ }

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Downloads an Azure Blob to a local file.
* Fails if the the given file path already exits.
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Downloads an Azure Blob to a local file.
* Fails if the the given file path already exits.
* Offset and count are optional, pass 0 and undefined respectively to download the entire blob.

@@ -1319,0 +1320,0 @@ *

@@ -5,3 +5,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import * as Models from "./generated/lib/models";
import { Aborter } from "./Aborter";
import { AbortSignal, AbortSignalLike } from "@azure/abort-controller";
import { Service } from "./generated/lib/operations";

@@ -26,10 +26,9 @@ import { newPipeline, NewPipelineOptions, Pipeline } from "./Pipeline";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ServiceListSharesSegmentOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -72,10 +71,9 @@ * Filters the results to return only entries whose

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ServiceListSharesOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -107,10 +105,9 @@ * Filters the results to return only entries whose

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -126,10 +123,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -155,7 +151,11 @@

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Creates an instance of FileServiceClient from connection string.
*
* @param {string} connectionString Connection string for an Azure storage account.
* @param {string} connectionString Account connection string or a SAS connection string of an Azure storage account.
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
* Account connection string example -
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
* SAS connection string example -
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
* @param {NewPipelineOptions} [options] Options to configure the HTTP pipeline.

@@ -169,12 +169,21 @@ * @returns {FileServiceClient} A new FileServiceClient from the given connection string.

): FileServiceClient {
if (isNode) {
const extractedCreds = extractConnectionStringParts(connectionString);
const sharedKeyCredential = new SharedKeyCredential(
extractedCreds.accountName,
extractedCreds.accountKey
const extractedCreds = extractConnectionStringParts(connectionString);
if (extractedCreds.kind === "AccountConnString") {
if (isNode) {
const sharedKeyCredential = new SharedKeyCredential(
extractedCreds.accountName,
extractedCreds.accountKey
);
const pipeline = newPipeline(sharedKeyCredential, options);
return new FileServiceClient(extractedCreds.url, pipeline);
} else {
throw new Error("Account connection string is only supported in Node.js environment");
}
} else if (extractedCreds.kind === "SASConnString") {
const pipeline = newPipeline(new AnonymousCredential(), options);
return new FileServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
} else {
throw new Error(
"Connection string must be either an Account connection string or a SAS connection string"
);
const pipeline = newPipeline(sharedKeyCredential, options);
return new FileServiceClient(extractedCreds.url, pipeline);
} else {
throw new Error("Connection string is only supported in Node.js environment");
}

@@ -284,3 +293,3 @@ }

): Promise<Models.ServiceGetPropertiesResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.serviceContext.getProperties({

@@ -305,3 +314,3 @@ abortSignal: aborter

): Promise<Models.ServiceSetPropertiesResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.serviceContext.setProperties(properties, {

@@ -466,3 +475,3 @@ abortSignal: aborter

): Promise<Models.ServiceListSharesSegmentResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.serviceContext.listSharesSegment({

@@ -469,0 +478,0 @@ abortSignal: aborter,

@@ -8,3 +8,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

export * from "./Aborter";
export * from "./ShareClient";

@@ -15,3 +14,3 @@ export * from "./DirectoryClient";

export * from "./credentials/Credential";
export { IPRange as IPRange } from "./IPRange";
export { IPRange } from "./IPRange";
export { Range } from "./Range";

@@ -18,0 +17,0 @@ export * from "./Pipeline";

@@ -8,3 +8,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

export * from "./Aborter";
export * from "./AccountSASPermissions";

@@ -23,3 +22,3 @@ export * from "./AccountSASResourceTypes";

export * from "./credentials/SharedKeyCredential";
export { IPRange as IPRange } from "./IPRange";
export { IPRange } from "./IPRange";
export { Range } from "./Range";

@@ -26,0 +25,0 @@ export * from "./Pipeline";

@@ -5,4 +5,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { HttpResponse, isNode } from "@azure/core-http";
import { Aborter } from "./Aborter";
import { AbortSignal, AbortSignalLike } from "@azure/abort-controller";
import * as Models from "./generated/lib/models";

@@ -34,10 +33,9 @@ import { Share } from "./generated/lib/operations";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -69,10 +67,9 @@ * A name-value pair to associate with a file storage object.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareDeleteMethodOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -97,10 +94,9 @@ * Specifies the option

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareSetMetadataOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -116,10 +112,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareSetAccessPolicyOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -135,10 +130,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareGetAccessPolicyOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -154,10 +148,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareGetPropertiesOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -173,10 +166,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareSetQuotaOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -192,10 +184,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareGetStatisticsOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -264,10 +255,9 @@

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareCreateSnapshotOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -299,7 +289,8 @@ * A name-value pair to associate with a file storage object.

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Creates an instance of ShareClient.
*
* @param {string} connectionString Connection string for an Azure storage account.
* @param {string} connectionString Account connection string or a SAS connection string of an Azure storage account.
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
* Account connection string example -
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
* SAS connection string example -
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
* @param {string} shareName Share name.

@@ -355,13 +346,23 @@ * @param {NewPipelineOptions} [options] Optional. Options to configure the HTTP pipeline.

) {
if (isNode) {
const shareName = credentialOrPipelineOrShareName;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
const sharedKeyCredential = new SharedKeyCredential(
extractedCreds.accountName,
extractedCreds.accountKey
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
const shareName = credentialOrPipelineOrShareName;
if (extractedCreds.kind === "AccountConnString") {
if (isNode) {
const sharedKeyCredential = new SharedKeyCredential(
extractedCreds.accountName,
extractedCreds.accountKey
);
urlOrConnectionString = extractedCreds.url + "/" + shareName;
pipeline = newPipeline(sharedKeyCredential, options);
} else {
throw new Error("Account connection string is only supported in Node.js environment");
}
} else if (extractedCreds.kind === "SASConnString") {
urlOrConnectionString =
extractedCreds.url + "/" + shareName + "?" + extractedCreds.accountSas;
pipeline = newPipeline(new AnonymousCredential(), options);
} else {
throw new Error(
"Connection string must be either an Account connection string or a SAS connection string"
);
urlOrConnectionString = extractedCreds.url + "/" + shareName;
pipeline = newPipeline(sharedKeyCredential, options);
} else {
throw new Error("Connection string is only supported in Node.js environment");
}

@@ -404,3 +405,3 @@ } else {

public async create(options: ShareCreateOptions = {}): Promise<Models.ShareCreateResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.create({

@@ -545,3 +546,3 @@ ...options,

): Promise<Models.ShareGetPropertiesResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.getProperties({

@@ -562,3 +563,3 @@ abortSignal: aborter

public async delete(options: ShareDeleteMethodOptions = {}): Promise<Models.ShareDeleteResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.deleteMethod({

@@ -586,3 +587,3 @@ abortSignal: aborter,

): Promise<Models.ShareSetMetadataResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.setMetadata({

@@ -610,3 +611,3 @@ abortSignal: aborter,

): Promise<ShareGetAccessPolicyResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
const response = await this.context.getAccessPolicy({

@@ -658,3 +659,3 @@ abortSignal: aborter

): Promise<Models.ShareSetAccessPolicyResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
const acl: Models.SignedIdentifier[] = [];

@@ -688,3 +689,3 @@ for (const identifier of shareAcl || []) {

): Promise<Models.ShareCreateSnapshotResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.createSnapshot({

@@ -708,3 +709,3 @@ abortSignal: aborter,

): Promise<Models.ShareSetQuotaResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
if (quotaInGB <= 0 || quotaInGB > 5120) {

@@ -731,3 +732,3 @@ throw new RangeError(

): Promise<Models.ShareGetStatisticsResponse> {
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
return this.context.getStatistics({

@@ -734,0 +735,0 @@ abortSignal: aborter

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export const SDK_VERSION: string = "12.0.0-preview.1";
export const SDK_VERSION: string = "12.0.0-preview.2";
export const SERVICE_VERSION: string = "2018-03-28";

@@ -6,0 +6,0 @@

@@ -6,3 +6,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { Readable } from "stream";
import { Aborter } from "../Aborter";
import { AbortSignal, AbortSignalLike } from "@azure/abort-controller";

@@ -12,3 +12,3 @@ export type ReadableStreamGetter = (offset: number) => Promise<NodeJS.ReadableStream>;

export interface RetriableReadableStreamOptions {
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -53,3 +53,3 @@ * Max retry count (>=0), undefined or invalid value means no retry

export class RetriableReadableStream extends Readable {
private aborter: Aborter;
private aborter: AbortSignalLike;
private start: number;

@@ -84,3 +84,3 @@ private offset: number;

super();
const aborter = options.abortSignal || Aborter.none;
const aborter = options.abortSignal || AbortSignal.none;
this.aborter = aborter;

@@ -168,3 +168,3 @@ this.getter = getter;

.offset - 1}, data needed offset: ${this.end}, retries: ${
this.retries
this.retries
}, max retries: ${this.maxRetryRequests}`

@@ -179,3 +179,3 @@ )

`Data corruption failure: Received more data than original request, data needed offset is ${
this.end
this.end
}, received offset: ${this.offset - 1}`

@@ -182,0 +182,0 @@ )

@@ -75,4 +75,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Extracts the parts of an Azure Storage account connection string.

@@ -82,43 +80,73 @@ *

* @param {string} connectionString Connection string.
* @returns {{ [key: string]: any }} String key value pairs of the storage account's base url for File, account name, and account key.
* @returns {{ kind: "AccountConnString" | "SASConnString", url: string, [key: string]: any }} String key value pairs of the storage account's url and credentials.
*/
export function extractConnectionStringParts(connectionString: string): { [key: string]: any } {
const matchCredentials = connectionString.match(
"DefaultEndpointsProtocol=(.*);AccountName=(.*);AccountKey=(.*);EndpointSuffix=(.*)"
);
export function extractConnectionStringParts(
connectionString: string
): { kind: "AccountConnString" | "SASConnString"; url: string; [key: string]: any } {
// Account connection string
if (
connectionString.search("DefaultEndpointsProtocol=") !== -1 &&
connectionString.search("AccountKey=") !== -1
) {
const matchCredentials = connectionString.match(
"DefaultEndpointsProtocol=(.*);AccountName=(.*);AccountKey=(.*);EndpointSuffix=(.*)"
);
let defaultEndpointsProtocol;
let accountName;
let accountKey;
let endpointSuffix;
let defaultEndpointsProtocol;
let accountName;
let accountKey;
let endpointSuffix;
try {
defaultEndpointsProtocol = matchCredentials![1] || "";
accountName = matchCredentials![2] || "";
accountKey = Buffer.from(matchCredentials![3], "base64");
endpointSuffix = matchCredentials![4] || "";
} catch (err) {
throw new Error("Invalid Connection String");
}
try {
defaultEndpointsProtocol = matchCredentials![1] || "";
accountName = matchCredentials![2] || "";
accountKey = Buffer.from(matchCredentials![3], "base64");
endpointSuffix = matchCredentials![4] || "";
} catch (err) {
throw new Error("Invalid Account Connection String");
}
const protocol = defaultEndpointsProtocol.toLowerCase();
if (protocol !== "https" && protocol !== "http") {
throw new Error(
"Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"
const protocol = defaultEndpointsProtocol.toLowerCase();
if (protocol !== "https" && protocol !== "http") {
throw new Error(
"Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"
);
} else if (!accountName) {
throw new Error("Invalid AccountName in the provided Connection String");
} else if (accountKey.length === 0) {
throw new Error("Invalid AccountKey in the provided Connection String");
} else if (!endpointSuffix) {
throw new Error("Invalid EndpointSuffix in the provided Connection String");
}
const url = `${defaultEndpointsProtocol}://${accountName}.file.${endpointSuffix}`;
return {
kind: "AccountConnString",
url,
accountName,
accountKey
};
} else {
// SAS connection string
const matchCredentials = connectionString.match(
"BlobEndpoint=(.*)/;QueueEndpoint=(.*)/;FileEndpoint=(.*)/;TableEndpoint=(.*)/;SharedAccessSignature=(.*)"
);
} else if (!accountName) {
throw new Error("Invalid AccountName in the provided Connection String");
} else if (accountKey.length === 0) {
throw new Error("Invalid AccountKey in the provided Connection String");
} else if (!endpointSuffix) {
throw new Error("Invalid EndpointSuffix in the provided Connection String");
}
let endpoint;
let accountSas;
try {
endpoint = matchCredentials![3] || "";
accountSas = matchCredentials![5] || "";
} catch (error) {
throw new Error("Invalid SAS Connection String");
}
const url = `${defaultEndpointsProtocol}://${accountName}.file.${endpointSuffix}`;
if (!endpoint) {
throw new Error("Invalid QueueEndpoint in the provided SAS Connection String");
} else if (!accountSas) {
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
}
return {
url,
accountName,
accountKey
};
return { kind: "SASConnString", url: endpoint, accountSas };
}
}

@@ -125,0 +153,0 @@

@@ -1,2 +0,2 @@

import { Aborter } from "./Aborter";
import { AbortSignalLike } from "@azure/abort-controller";
import * as Models from "./generated/lib/models";

@@ -18,10 +18,9 @@ import { Metadata } from "./models";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -43,10 +42,9 @@ * A collection of key-value string pair to associate with the file storage object.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof DirectoryListFilesAndDirectoriesOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -69,10 +67,9 @@ * Filters the results to return only entries whose

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -87,10 +84,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -105,10 +101,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -115,0 +110,0 @@ /**

/// <reference types="node" />
import { HttpRequestBody, HttpResponse, TransferProgressEvent } from "@azure/core-http";
import { Aborter } from "./Aborter";
import { AbortSignalLike } from "@azure/abort-controller";
import * as Models from "./generated/lib/models";

@@ -19,10 +19,9 @@ import { Range } from "./Range";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -51,10 +50,9 @@ * File HTTP headers like Content-Type.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -69,10 +67,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -118,10 +115,9 @@ * Optional. ONLY AVAILABLE IN NODE.JS.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -154,10 +150,9 @@ * An MD5 hash of the content. This hash is

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -179,10 +174,9 @@ * Optional. Specifies the range of bytes over which to list ranges, inclusively.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -224,4 +218,11 @@ /**

export interface FileStartCopyOptions {
abortSignal?: Aborter;
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {AbortSignalLike}
* @memberof FileStartCopyOptions
*/
abortSignal?: AbortSignalLike;
/**
* A collection of key-value string pair to associate with the file storage object.

@@ -242,10 +243,9 @@ *

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileSetMetadataOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -260,10 +260,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileSetHTTPHeadersOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -278,10 +277,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileAbortCopyFromURLOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -296,10 +294,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileResizeOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -314,10 +311,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof FileClearRangeOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -331,4 +327,11 @@ /**

export interface UploadStreamToAzureFileOptions {
abortSignal?: Aborter;
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {AbortSignalLike}
* @memberof UploadStreamToAzureFileOptions
*/
abortSignal?: AbortSignalLike;
/**
* Azure File HTTP Headers.

@@ -362,10 +365,9 @@ *

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof UploadToAzureFileOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -416,10 +418,9 @@ * RangeSize specifies the range size to use in each parallel upload,

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @memberof AppendBlobCreateOptions
* @type {AbortSignalLike}
* @memberof DownloadFromAzureFileOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -758,16 +759,16 @@ * When downloading Azure files, download method will try to split large file into small ranges.

* Fails if the the given file path already exits.
* Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
*
* @param {string} filePath
* @param {number} [offset] From which position of the block blob to download.
* @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined.
* @param {BlobDownloadOptions} [options] Options to Blob download options.
* @returns {Promise<Models.FileDownloadResponse>} The response data for blob download operation,
* but with readableStreamBody set to undefined since its
* content is already read and written into a local file
* at the specified path.
* @memberof BlobClient
*/
* Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
*
* @param {string} filePath
* @param {number} [offset] From which position of the block blob to download.
* @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined.
* @param {BlobDownloadOptions} [options] Options to Blob download options.
* @returns {Promise<Models.FileDownloadResponse>} The response data for blob download operation,
* but with readableStreamBody set to undefined since its
* content is already read and written into a local file
* at the specified path.
* @memberof BlobClient
*/
downloadToFile(filePath: string, offset?: number, count?: number, options?: FileDownloadOptions): Promise<Models.FileDownloadResponse>;
}
//# sourceMappingURL=FileClient.d.ts.map
import * as Models from "./generated/lib/models";
import { Aborter } from "./Aborter";
import { AbortSignalLike } from "@azure/abort-controller";
import { NewPipelineOptions, Pipeline } from "./Pipeline";

@@ -17,10 +17,9 @@ import { StorageClient } from "./StorageClient";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ServiceListSharesOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -51,10 +50,9 @@ * Filters the results to return only entries whose

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -69,10 +67,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof AppendBlobCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -96,7 +93,11 @@ /**

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Creates an instance of FileServiceClient from connection string.
*
* @param {string} connectionString Connection string for an Azure storage account.
* @param {string} connectionString Account connection string or a SAS connection string of an Azure storage account.
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
* Account connection string example -
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
* SAS connection string example -
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
* @param {NewPipelineOptions} [options] Options to configure the HTTP pipeline.

@@ -103,0 +104,0 @@ * @returns {FileServiceClient} A new FileServiceClient from the given connection string.

import { RestError } from "@azure/core-http";
import * as Models from "../src/generated/lib/models";
export * from "./Aborter";
export * from "./ShareClient";

@@ -9,3 +8,3 @@ export * from "./DirectoryClient";

export * from "./credentials/Credential";
export { IPRange as IPRange } from "./IPRange";
export { IPRange } from "./IPRange";
export { Range } from "./Range";

@@ -12,0 +11,0 @@ export * from "./Pipeline";

import { RestError } from "@azure/core-http";
import * as Models from "../src/generated/lib/models";
export * from "./Aborter";
export * from "./AccountSASPermissions";

@@ -17,3 +16,3 @@ export * from "./AccountSASResourceTypes";

export * from "./credentials/SharedKeyCredential";
export { IPRange as IPRange } from "./IPRange";
export { IPRange } from "./IPRange";
export { Range } from "./Range";

@@ -20,0 +19,0 @@ export * from "./Pipeline";

import { HttpResponse } from "@azure/core-http";
import { Aborter } from "./Aborter";
import { AbortSignalLike } from "@azure/abort-controller";
import * as Models from "./generated/lib/models";

@@ -18,10 +18,9 @@ import { Metadata } from "./models";

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareCreateOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -53,10 +52,9 @@ * A name-value pair to associate with a file storage object.

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareDeleteMethodOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -80,10 +78,9 @@ * Specifies the option

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareSetMetadataOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -98,10 +95,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareSetAccessPolicyOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -116,10 +112,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareGetAccessPolicyOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -134,10 +129,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareGetPropertiesOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -152,10 +146,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareSetQuotaOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -170,10 +163,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareGetStatisticsOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
}

@@ -239,10 +231,9 @@ /**

/**
* Aborter instance to cancel request. It can be created with Aborter.none
* or Aborter.timeout(). Go to documents of {@link Aborter} for more examples
* about request cancellation.
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
*
* @type {Aborter}
* @type {AbortSignalLike}
* @memberof ShareCreateSnapshotOptions
*/
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -274,7 +265,8 @@ * A name-value pair to associate with a file storage object.

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Creates an instance of ShareClient.
*
* @param {string} connectionString Connection string for an Azure storage account.
* @param {string} connectionString Account connection string or a SAS connection string of an Azure storage account.
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
* Account connection string example -
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
* SAS connection string example -
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
* @param {string} shareName Share name.

@@ -281,0 +273,0 @@ * @param {NewPipelineOptions} [options] Optional. Options to configure the HTTP pipeline.

/// <reference types="node" />
import { TransferProgressEvent } from "@azure/core-http";
import { Readable } from "stream";
import { Aborter } from "../Aborter";
import { AbortSignalLike } from "@azure/abort-controller";
export declare type ReadableStreamGetter = (offset: number) => Promise<NodeJS.ReadableStream>;
export interface RetriableReadableStreamOptions {
abortSignal?: Aborter;
abortSignal?: AbortSignalLike;
/**

@@ -9,0 +9,0 @@ * Max retry count (>=0), undefined or invalid value means no retry

@@ -59,4 +59,2 @@ /// <reference types="node" />

/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Extracts the parts of an Azure Storage account connection string.

@@ -66,5 +64,7 @@ *

* @param {string} connectionString Connection string.
* @returns {{ [key: string]: any }} String key value pairs of the storage account's base url for File, account name, and account key.
* @returns {{ kind: "AccountConnString" | "SASConnString", url: string, [key: string]: any }} String key value pairs of the storage account's url and credentials.
*/
export declare function extractConnectionStringParts(connectionString: string): {
kind: "AccountConnString" | "SASConnString";
url: string;
[key: string]: any;

@@ -71,0 +71,0 @@ };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc