Skip to content

Commit

Permalink
Storage/stg87 preview (#25404)
Browse files Browse the repository at this point in the history
[Storage] upgrade version for STG87 preview features
Work around the issue caused by a bug in Date when initializing from a
miliseconds number.
  • Loading branch information
EmmaZhu authored Mar 29, 2023
1 parent 91f71cc commit 86cadc5
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 38 deletions.
8 changes: 2 additions & 6 deletions sdk/storage/storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Release History

## 12.13.1 (Unreleased)
## 12.14.0-beta.1 (2023-03-29)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Added support for service version 2022-11-02.

## 12.13.0 (2023-02-23)

Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-blob/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@azure/storage-blob",
"sdk-type": "client",
"version": "12.13.1",
"version": "12.14.0-beta.1",
"description": "Microsoft Azure Storage SDK for JavaScript - Blob",
"main": "./dist/index.js",
"module": "./dist-esm/storage-blob/src/index.js",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/storage/storage-blob/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export const SDK_VERSION: string = "12.13.1";
export const SERVICE_VERSION: string = "2021-12-02";
export const SDK_VERSION: string = "12.14.0-beta.1";
export const SERVICE_VERSION: string = "2022-11-02";

export const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES: number = 256 * 1024 * 1024; // 256MB
export const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES: number = 4000 * 1024 * 1024; // 4000MB
Expand Down
11 changes: 10 additions & 1 deletion sdk/storage/storage-blob/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ disable-async-iterators: true
add-credentials: false
use-extension:
"@autorest/typescript": "6.0.0-dev.20210218.1"
package-version: 12.13.1
package-version: 12.14.0-beta.1
```
## Customizations for Track 2 Generator
Expand Down Expand Up @@ -1463,4 +1463,13 @@ directive:
];
```

### Update service version from "2021-12-02" to "2022-11-02"

```yaml
directive:
- from: swagger-document
where: $.parameters.ApiVersionParameter
transform: $.enum = [ "2022-11-02" ];
```

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-blob%2Fswagger%2FREADME.png)
8 changes: 1 addition & 7 deletions sdk/storage/storage-file-datalake/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Release History

## 12.12.1 (Unreleased)
## 12.13.0-beta.1 (2023-03-29)

### Features Added

- Added support for service version 2022-11-02.
- Added support for Encryption Context.

### Breaking Changes

### Bugs Fixed

### Other Changes

## 12.12.0 (2023-02-23)

### Features Added
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/storage-file-datalake/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/storage-file-datalake",
"version": "12.12.1",
"version": "12.13.0-beta.1",
"description": "Microsoft Azure Storage SDK for JavaScript - DataLake",
"sdk-type": "client",
"main": "./dist/index.js",
Expand Down Expand Up @@ -122,7 +122,7 @@
"@azure/core-paging": "^1.1.1",
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/logger": "^1.0.0",
"@azure/storage-blob": "^12.13.0",
"@azure/storage-blob": "^12.14.0-beta.1",
"events": "^3.0.0",
"tslib": "^2.2.0"
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/storage/storage-file-datalake/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export const SDK_VERSION: string = "12.12.1";
export const SERVICE_VERSION: string = "2021-12-02";
export const SDK_VERSION: string = "12.13.0-beta.1";
export const SERVICE_VERSION: string = "2022-11-02";

export const KB: number = 1024;
export const MB: number = KB * 1024;
Expand Down
12 changes: 11 additions & 1 deletion sdk/storage/storage-file-datalake/src/utils/utils.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ export function isIpEndpointStyle(parsedUrl: URLBuilder): boolean {
);
}

const BugTimeBeginningInMS = 13322188800000;

/**
* This is to convert a Windows File Time ticks to a Date object.
*/
Expand All @@ -595,7 +597,15 @@ export function windowsFileTimeTicksToTime(timeNumber: string | undefined): Date
// since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).
// Date accepts a value that represents miliseconds from 12:00 A.M. January 1, 1970
// Here should correct the year number after converting.
const date = new Date(timeNumberInternal / 10000);
const timeNumerInMs = timeNumberInternal / 10000;
const date = new Date(timeNumerInMs);

// When initializing date from a miliseconds number the day after 2023-03-01 is still 2023-03-01.
// For example, 13322188799999 is 2023-03-01T23:59:59.999Z, while 13322188800000 is 2023-03-01T00:00:00.000Z
// Here is to work around the bug.
if (timeNumerInMs >= BugTimeBeginningInMS) {
date.setUTCDate(date.getUTCDate() + 1);
}
date.setUTCFullYear(date.getUTCFullYear() - 369);
return date;
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-datalake/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ disable-async-iterators: true
add-credentials: false
use-extension:
"@autorest/typescript": "6.0.0-dev.20210223.1"
package-version: 12.12.1
package-version: 12.13.0-beta.1
```
## Customizations for Track 2 Generator
Expand Down
8 changes: 1 addition & 7 deletions sdk/storage/storage-file-share/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# Release History

## 12.13.1 (Unreleased)
## 12.14.0-beta.1 (2023-03-29)

### Features Added

- Added support for service version 2022-11-02.
- Added support OAuth.
- Added support for Trailing Dot.

### Breaking Changes

### Bugs Fixed

### Other Changes

## 12.13.0 (2023-02-23)

### Features Added
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/storage-file-share/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@azure/storage-file-share",
"sdk-type": "client",
"version": "12.13.1",
"version": "12.14.0-beta.1",
"description": "Microsoft Azure Storage SDK for JavaScript - File",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
Expand Down Expand Up @@ -132,7 +132,7 @@
"tslib": "^2.2.0"
},
"devDependencies": {
"@azure/storage-blob": "^12.13.0",
"@azure/storage-blob": "^12.14.0-beta.1",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^2.0.1",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/storage/storage-file-share/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export const SDK_VERSION: string = "12.13.1";
export const SDK_VERSION: string = "12.14.0-beta.1";
export const SERVICE_VERSION: string = "2022-11-02";

export const FILE_MAX_SIZE_BYTES: number = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
Expand Down

0 comments on commit 86cadc5

Please sign in to comment.