Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] Migrate open PRs for azure-storage-js to the central repo #2317

Merged
merged 16 commits into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.

If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).

If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-node/issues) section of the project.
If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-js/issues) section of the project.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Documentation of the supported SDKs can be found here:
- data plane SDKs like `@azure/batch`, `@azure/graph`, etc.

## Authentication

- For Node.js-based authentication, look at [@azure/ms-rest-nodeauth](https://npmjs.com/package/@azure/ms-rest-nodeauth).
- For browser-based authentication, look at [@azure/ms-rest-browserauth](https://npmjs.com/package/@azure/ms-rest-browserauth).
- The browser authentication storage is a little more complicated, so we encourage you to [read about how it works](https://github.com/Azure/ms-rest-browserauth/blob/master/README.md) before putting it in your application.
Expand Down Expand Up @@ -71,8 +72,8 @@ get your code included into the project.

Currently, the tests for client libraries in this repository are running against:

| | Linux (Ubuntu 16.04) | MacOS 10.13 | Windows Server 2016 |
|----------------------|----------------------|-------------|---------------------|
| **Node 8** | x | x | x |
| **Node 10** | x | x | x |
| **Node 11** | x | x | x |
| | Linux (Ubuntu 16.04) | MacOS 10.13 | Windows Server 2016 |
| ----------- | -------------------- | ----------- | ------------------- |
| **Node 8** | x | x | x |
| **Node 10** | x | x | x |
| **Node 11** | x | x | x |
10 changes: 5 additions & 5 deletions sdk/storage/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contribution Guideline
# Contribute Code or Provide Feedback

Hello! Thank you for being interested in contributing to our project!
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

Please make sure you've followed the instructions provided in the [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Project Setup
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).

The Azure Storage development team uses Visual Studio Code. However, any preferred IDE or other toolset should be usable.

Expand Down Expand Up @@ -62,7 +62,7 @@ Run tests in Browsers. After installed Chrome, the default testing browser:
```bash
npm install
npm run build
npm test:browser
npm run test:browser
```

Browser testing is based on Karma, you can change default testing browser by modifying karma.conf.js file.
Expand Down
141 changes: 71 additions & 70 deletions sdk/storage/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# Azure Storage SDK V10 for JavaScript

* @azure/storage-blob [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-blob.svg)](https://badge.fury.io/js/%40azure%2Fstorage-blob)
* @azure/storage-file [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-file.svg)](https://badge.fury.io/js/%40azure%2Fstorage-file)
* @azure/storage-queue [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-queue.svg)](https://badge.fury.io/js/%40azure%2Fstorage-queue)
* [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/overview/azure/storage/client?view=azure-node-preview)
- @azure/storage-blob [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-blob.svg)](https://badge.fury.io/js/%40azure%2Fstorage-blob)
- @azure/storage-file [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-file.svg)](https://badge.fury.io/js/%40azure%2Fstorage-file)
- @azure/storage-queue [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-queue.svg)](https://badge.fury.io/js/%40azure%2Fstorage-queue)
- [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/overview/azure/storage/client?view=azure-node-preview)
- [Advanced Examples in Wiki](https://github.com/Azure/azure-storage-js/wiki)
Copy link
Member Author

@HarshaNalluru HarshaNalluru Apr 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pointing to the old repo!
Let's merge the PR for now, will track this in another issue - #2420


## Introduction

This project provides a SDK in JavaScript that makes it easy to consume Microsoft Azure Storage services.
This project provides a JavaScript SDK that makes it easy to consume Microsoft Azure Storage services from your Node.js and browser-based client applications. This respository contains the source for the latest version of the JavaScript SDK, v10.

Please note that this version of the SDK is a compete overhaul of the current [Azure Storage SDK for Node.js and JavaScript in Browsers](https://github.com/azure/azure-storage-node), and is based on the new Storage SDK architecture.
Note that this version of the SDK is based on the new Storage SDK architecture and replaces the [legacy SDK for Node.js and JavaScript in Browsers](https://github.com/azure/azure-storage-node).

### Features

* Blob Storage
* Get/Set Blob Service Properties
* Create/List/Delete Containers
* Create/Read/List/Update/Delete Block Blobs
* Create/Read/List/Update/Delete Page Blobs
* Create/Read/List/Update/Delete Append Blobs
* File Storage
* Get/Set File Service Properties
* Create/List/Delete File Shares
* Create/List/Delete File Directories
* Create/Read/List/Update/Delete Files
* Queue Storage
* Get/Set Queue Service Properties
* Create/List/Delete Queues
* Enqueue/Dequeue/Peek/Clear/Update/Delete Queue Messages
* Features new
* Asynchronous I/O for all operations using the async methods
* HttpPipeline which enables a high degree of per-request configurability
* 1-to-1 correlation with the Storage REST API for clarity and simplicity
- Blob Storage
- Get/Set Blob Service Properties
- Create/List/Delete Containers
- Create/Read/List/Update/Delete Block Blobs
- Create/Read/List/Update/Delete Page Blobs
- Create/Read/List/Update/Delete Append Blobs
- File Storage
- Get/Set File Service Properties
- Create/List/Delete File Shares
- Create/List/Delete File Directories
- Create/Read/List/Update/Delete Files
- Queue Storage
- Get/Set Queue Service Properties
- Create/List/Delete Queues
- Enqueue/Dequeue/Peek/Clear/Update/Delete Queue Messages
- Features new
- Asynchronous I/O for all operations using the async methods
- HttpPipeline which enables a high degree of per-request configurability
- 1-to-1 correlation with the Storage REST API for clarity and simplicity

### Compatibility

Expand All @@ -43,49 +44,48 @@ You need polyfills to make this library work with IE11. The easiest way is to us
Or you can load separate polyfills for missed ES feature(s).
This library depends on following ES features which need external polyfills loaded.

* `Promise`
* `String.prototype.startsWith`
* `String.prototype.endsWith`
* `String.prototype.repeat`
* `String.prototype.includes`
* `Array.prototype.includes`
* `Object.keys` (Override IE11's `Object.keys` with ES6 polyfill forcely to enable [ES6 behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys#Notes))

- `Promise`
- `String.prototype.startsWith`
- `String.prototype.endsWith`
- `String.prototype.repeat`
- `String.prototype.includes`
- `Array.prototype.includes`
- `Object.keys` (Override IE11's `Object.keys` with ES6 polyfill forcely to enable [ES6 behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys#Notes))

#### Differences between Node.js and browsers

There are differences between Node.js and browsers runtime. When getting start with this SDK, pay attention to APIs or classes marked with _"ONLY AVAILABLE IN NODE.JS RUNTIME"_ or _"ONLY AVAILABLE IN BROWSERS"_.

##### Following features, interfaces, classes or functions are only available in Node.js

* Shared Key Authorization based on account name and account key
* `SharedKeyCredential`
* Shared Access Signature(SAS) generation
* `generateAccountSASQueryParameters()`
* `generateBlobSASQueryParameters()`
* `generateFileSASQueryParameters()`
* `generateQueueSASQueryParameters()`
* Parallel uploading and downloading
* `uploadFileToBlockBlob()`
* `uploadStreamToBlockBlob()`
* `downloadBlobToBuffer()`
* `uploadFileToAzureFile()`
* `uploadStreamToAzureFile()`
* `downloadAzureFileToBuffer()`
- Shared Key Authorization based on account name and account key
- `SharedKeyCredential`
- Shared Access Signature(SAS) generation
- `generateAccountSASQueryParameters()`
- `generateBlobSASQueryParameters()`
- `generateFileSASQueryParameters()`
- `generateQueueSASQueryParameters()`
- Parallel uploading and downloading
- `uploadFileToBlockBlob()`
- `uploadStreamToBlockBlob()`
- `downloadBlobToBuffer()`
- `uploadFileToAzureFile()`
- `uploadStreamToAzureFile()`
- `downloadAzureFileToBuffer()`

##### Following features, interfaces, classes or functions are only available in browsers

* Parallel uploading and downloading
* `uploadBrowserDataToBlockBlob()`
* `uploadBrowserDataToAzureFile()`
- Parallel uploading and downloading
- `uploadBrowserDataToBlockBlob()`
- `uploadBrowserDataToAzureFile()`

## Getting Started

### NPM

The preferred way to install the Azure Storage SDK for JavaScript is to use the npm package manager. Take "@azure/storage-blob" for example.

Simply type the following into a terminal window:
Simply type the following into a terminal window:

```bash
npm install @azure/storage-blob
Expand Down Expand Up @@ -115,37 +115,37 @@ To use the SDK with JS bundle in the browsers, simply add a script tag to your H

The JS bundled file is compatible with [UMD](https://github.com/umdjs/umd) standard, if no module system found, following global variable(s) will be exported:

* `azblob`
* `azfile`
* `azqueue`
- `azblob`
- `azfile`
- `azqueue`

#### Download

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:

* Blob [https://aka.ms/downloadazurestoragejsblob](https://aka.ms/downloadazurestoragejsblob)
* File [https://aka.ms/downloadazurestoragejsfile](https://aka.ms/downloadazurestoragejsfile)
* Queue [https://aka.ms/downloadazurestoragejsqueue](https://aka.ms/downloadazurestoragejsqueue)
- Blob [https://aka.ms/downloadazurestoragejsblob](https://aka.ms/downloadazurestoragejsblob)
- File [https://aka.ms/downloadazurestoragejsfile](https://aka.ms/downloadazurestoragejsfile)
- Queue [https://aka.ms/downloadazurestoragejsqueue](https://aka.ms/downloadazurestoragejsqueue)

### CORS

You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/zh-cn/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s).

For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment.

* Allowed origins: \*
* Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT
* Allowed headers: \*
* Exposed headers: \*
* Maximum age (seconds): 86400
- Allowed origins: \*
- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT
- Allowed headers: \*
- Exposed headers: \*
- Maximum age (seconds): 86400

## SDK Architecture

The Azure Storage SDK for JavaScript provides low-level and high-level APIs. Take Blob SDK as example:

* ServiceURL, ContainerURL and BlobURL objects provide the low-level API functionality and map one-to-one to the [Azure Storage Blob REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api).
- ServiceURL, ContainerURL and BlobURL objects provide the low-level API functionality and map one-to-one to the [Azure Storage Blob REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api).

* The high-level APIs provide convenience abstractions such as uploading a large stream to a block blob (using multiple PutBlock requests).
- The high-level APIs provide convenience abstractions such as uploading a large stream to a block blob (using multiple PutBlock requests).

## Code Samples

Expand Down Expand Up @@ -280,12 +280,13 @@ main()

## More Samples

* [Blob Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-blob/samples)
* [Blob Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-blob/test/)
* [File Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-file/samples)
* [File Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-file/test/)
* [Queue Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/samples)
* [Queue Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/test/)
- [Advanced Examples in Wiki](https://github.com/Azure/azure-storage-js/wiki)
- [Blob Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-blob/samples)
- [Blob Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-blob/test/)
- [File Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-file/samples)
- [File Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-file/test/)
- [Queue Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/samples)
- [Queue Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/test/)

## License

Expand Down
3 changes: 3 additions & 0 deletions sdk/storage/storage-blob/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

* Improved comments for `BlockBlobURL.upload()`.
* Exported `HttpRequestBody` type for who wants to implement a customized HTTP client.

2018.12 10.3.0

* [Breaking] Updated convenience layer methods enum type parameters into typescript union types, this will help reducing bundle footprint.
Expand Down
Loading