From 223cd49e328ca2a34929190fb4c773d6193c87c3 Mon Sep 17 00:00:00 2001 From: Richard Screene Date: Mon, 10 Oct 2016 09:57:09 +0100 Subject: [PATCH 1/3] Prevent a blockId from being generated with a decimal point. Fixes #205 --- ChangeLog.md | 5 +++++ lib/services/blob/blobservice.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 4da561dc..631c2d97 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,11 @@ Note: This is an Azure Storage only package. The all up Azure node sdk still has the old storage bits in there. In a future release, those storage bits will be removed and an npm dependency to this storage node sdk will be taken. This is a GA release and the changes described below indicate the changes from the Azure node SDK 0.9.8 available here - https://github.com/Azure/azure-sdk-for-node. +2016.10 Version 1.3.2 + +BLOB +* Prevent a blockId from being generated with a decimal point. + 2016.09 Version 1.3.1 ALL diff --git a/lib/services/blob/blobservice.js b/lib/services/blob/blobservice.js index ac0d657d..b5a9a783 100644 --- a/lib/services/blob/blobservice.js +++ b/lib/services/blob/blobservice.js @@ -3463,7 +3463,7 @@ BlobService.prototype.listBlocks = function (container, blob, blocklisttype, opt * Generate a random block id prefix */ BlobService.prototype.generateBlockIdPrefix = function () { - var prefix = Math.random().toString(16); + var prefix = Math.floor(Math.random() * 0x100000000).toString(16); return azureutil.zeroPaddingString(prefix, 8); }; From 4501695a0cadea4b7ea21f260208b6a20f321e9f Mon Sep 17 00:00:00 2001 From: HaiBo Song Date: Tue, 25 Oct 2016 09:34:22 +0800 Subject: [PATCH 2/3] Remove the dependency of node-uuid from the type script definition file --- typings/azure-storage/azure-storage.d.ts | 4 ++-- typings/globals/node-uuid/index.d.ts | 24 ------------------------ typings/globals/node-uuid/typings.json | 8 -------- typings/index.d.ts | 1 - 4 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 typings/globals/node-uuid/index.d.ts delete mode 100644 typings/globals/node-uuid/typings.json diff --git a/typings/azure-storage/azure-storage.d.ts b/typings/azure-storage/azure-storage.d.ts index 6b001c48..d040ae32 100644 --- a/typings/azure-storage/azure-storage.d.ts +++ b/typings/azure-storage/azure-storage.d.ts @@ -5163,7 +5163,7 @@ declare module azurestorage { function Binary(value: Buffer|string): EntityProperty; function Boolean(value: boolean|string): EntityProperty; function String(value: string): EntityProperty; - function Guid(value: UUID|string|Buffer): EntityProperty; + function Guid(value: string|Buffer|any): EntityProperty; function Double(value: number|string): EntityProperty; function DateTime(value: Date|string): EntityProperty; } @@ -5340,7 +5340,7 @@ declare module azurestorage { * @example * var query = TableQuery.guidFilter('GuidField', QueryComparisons.EQUAL, guid.v1()); */ - guidFilter(propertyName: string, operation: string, value: UUID | string): string; + guidFilter(propertyName: string, operation: string, value: string | any): string; /** * Generates a property filter condition string for a 'binary' value. diff --git a/typings/globals/node-uuid/index.d.ts b/typings/globals/node-uuid/index.d.ts deleted file mode 100644 index 110e29cc..00000000 --- a/typings/globals/node-uuid/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Generated by typings -// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/node-uuid/node-uuid.d.ts -declare module __NodeUUID { - /** - * Overloads for node environment - * We need to duplicate some declarations because - * interface merging doesn't work with overloads - */ - interface UUID { - v1(options?: UUIDOptions): string; - v1(options?: UUIDOptions, buffer?: number[], offset?: number): number[]; - v1(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer; - - v4(options?: UUIDOptions): string; - v4(options?: UUIDOptions, buffer?: number[], offset?: number): number[]; - v4(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer; - - parse(id: string, buffer?: number[], offset?: number): number[]; - parse(id: string, buffer?: Buffer, offset?: number): Buffer; - - unparse(buffer: number[], offset?: number): string; - unparse(buffer: Buffer, offset?: number): string; - } -} diff --git a/typings/globals/node-uuid/typings.json b/typings/globals/node-uuid/typings.json deleted file mode 100644 index afa42b5b..00000000 --- a/typings/globals/node-uuid/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/node-uuid/node-uuid.d.ts", - "raw": "registry:dt/node-uuid#0.0.0+20160316155526", - "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/node-uuid/node-uuid.d.ts" - } -} diff --git a/typings/index.d.ts b/typings/index.d.ts index 03c2e54f..22e4de57 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1,2 +1 @@ -/// /// From d9cf9810451c03758d4ecba41ffd5cfdcb82c0f3 Mon Sep 17 00:00:00 2001 From: HaiBo Song Date: Tue, 25 Oct 2016 09:35:11 +0800 Subject: [PATCH 3/3] Update the version numer to 1.3.2 --- lib/common/util/constants.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common/util/constants.js b/lib/common/util/constants.js index b8aa7a59..ad890dda 100644 --- a/lib/common/util/constants.js +++ b/lib/common/util/constants.js @@ -31,7 +31,7 @@ var Constants = { /* * Specifies the value to use for UserAgent header. */ - USER_AGENT_PRODUCT_VERSION: '1.3.1', + USER_AGENT_PRODUCT_VERSION: '1.3.2', /** * The number of default concurrent requests for parallel operation. diff --git a/package.json b/package.json index 5c3d4555..87e4b3c8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "azure-storage", "author": "Microsoft Corporation", - "version": "1.3.1", + "version": "1.3.2", "description": "Microsoft Azure Storage Client Library for Node.js", "typings": "typings/azure-storage/azure-storage.d.ts", "tags": [