updated jshint
This commit is contained in:
Родитель
678583294c
Коммит
50ee5a8bb2
|
@ -1,25 +1,4 @@
|
|||
lib/common/node_modules/*
|
||||
lib/services/legacyStorage/node_modules/*
|
||||
lib/services/computeManagement/node_modules/*
|
||||
lib/services/management/node_modules/*
|
||||
lib/services/networkManagement/node_modules/*
|
||||
lib/services/monitoring/node_modules/*
|
||||
lib/services/scheduler/node_modules/*
|
||||
lib/services/schedulerManagement/node_modules/*
|
||||
lib/services/serviceBusManagement/node_modules/*
|
||||
lib/services/sqlManagement/node_modules/*
|
||||
lib/services/storageManagement/node_modules/*
|
||||
lib/services/storeManagement/node_modules/*
|
||||
lib/services/subscriptionManagement/node_modules/*
|
||||
lib/services/webSiteManagement/node_modules/*
|
||||
lib/services/resourceManagement/node_modules/*
|
||||
lib/services/gallery/node_modules/*
|
||||
lib/services/authorizationManagement/node_modules/*
|
||||
lib/services/extra/node_modules/*
|
||||
lib/services/webSiteManagement2/node_modules/*
|
||||
lib/services/serviceBus/node_modules/*
|
||||
lib/services/hdinsight/node_modules/*
|
||||
lib/services/keyVault/node_modules/*
|
||||
lib/services/keyVaultManagement/node_modules/*
|
||||
lib/services/*/node_modules/*
|
||||
packages
|
||||
.git
|
|
@ -47,33 +47,33 @@ exports.createKeyVaultClient = function (credentials, baseUri, filters) {
|
|||
* @param {object[]} [filters] Extra filters to attach to the client
|
||||
*/
|
||||
function KeyVaultClient(credentials, baseUri, filters) {
|
||||
this.internalClient = new InternalClient.KeyVaultInternalClient(credentials, baseUri, filters);
|
||||
|
||||
/**
|
||||
* An object that performs operations on keys.
|
||||
* @type {KeyVaultKeys}
|
||||
*/
|
||||
this.keys = new KeyVaultKeys(this);
|
||||
this.internalClient = new InternalClient.KeyVaultInternalClient(credentials, baseUri, filters);
|
||||
|
||||
/**
|
||||
* An object that performs operations on secrets.
|
||||
* @type {KeyVaultSecrets}
|
||||
*/
|
||||
this.secrets = new KeyVaultSecrets(this);
|
||||
/**
|
||||
* An object that performs operations on keys.
|
||||
* @type {KeyVaultKeys}
|
||||
*/
|
||||
this.keys = new KeyVaultKeys(this);
|
||||
|
||||
/**
|
||||
* An object that performs operations on secrets.
|
||||
* @type {KeyVaultSecrets}
|
||||
*/
|
||||
this.secrets = new KeyVaultSecrets(this);
|
||||
}
|
||||
|
||||
/** Wrapper for withFilter() of Service class.
|
||||
* Allows late binding of filters.
|
||||
*/
|
||||
KeyVaultClient.prototype.withFilter = function(newFilter) {
|
||||
this.internalClient = this.internalClient.withFilter(newFilter);
|
||||
return this;
|
||||
KeyVaultClient.prototype.withFilter = function (newFilter) {
|
||||
this.internalClient = this.internalClient.withFilter(newFilter);
|
||||
return this;
|
||||
};
|
||||
|
||||
/** A class that performs operations on vault keys.
|
||||
*/
|
||||
function KeyVaultKeys(client) {
|
||||
this.keys = client.internalClient.keys;
|
||||
this.keys = client.internalClient.keys;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -82,8 +82,8 @@ function KeyVaultKeys(client) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.backup = function(keyIdentifier, callback) {
|
||||
return this.keys.backup(keyIdentifier, keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.backup = function (keyIdentifier, callback) {
|
||||
return this.keys.backup(keyIdentifier, keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -94,8 +94,8 @@ KeyVaultKeys.prototype.backup = function(keyIdentifier, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.create = function(vault, keyName, keyOpRequest, callback) {
|
||||
return this.keys.create(vault, keyName, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.create = function (vault, keyName, keyOpRequest, callback) {
|
||||
return this.keys.create(vault, keyName, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -105,8 +105,8 @@ KeyVaultKeys.prototype.create = function(vault, keyName, keyOpRequest, callback)
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.decryptData = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.decryptData(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.decryptData = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.decryptData(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -116,8 +116,8 @@ KeyVaultKeys.prototype.decryptData = function(keyIdentifier, keyOpRequest, callb
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.deleteKey = function(vault, keyName, callback) {
|
||||
return this.keys.deleteKey(vault, keyName, keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.deleteKey = function (vault, keyName, callback) {
|
||||
return this.keys.deleteKey(vault, keyName, keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -127,8 +127,8 @@ KeyVaultKeys.prototype.deleteKey = function(vault, keyName, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.encryptData = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.encryptData(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.encryptData = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.encryptData(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -137,8 +137,8 @@ KeyVaultKeys.prototype.encryptData = function(keyIdentifier, keyOpRequest, callb
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.get = function(keyIdentifier, callback) {
|
||||
return this.keys.get(keyIdentifier, keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.get = function (keyIdentifier, callback) {
|
||||
return this.keys.get(keyIdentifier, keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -148,8 +148,8 @@ KeyVaultKeys.prototype.get = function(keyIdentifier, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.importMethod = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.importMethod(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.importMethod = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.importMethod(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -159,8 +159,8 @@ KeyVaultKeys.prototype.importMethod = function(keyIdentifier, keyOpRequest, call
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.list = function(vault, top, callback) {
|
||||
return this.keys.list(vault, top, keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.list = function (vault, top, callback) {
|
||||
return this.keys.list(vault, top, keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -169,8 +169,8 @@ KeyVaultKeys.prototype.list = function(vault, top, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.listNext = function(nextLink, callback) {
|
||||
return this.keys.listNext(nextLink, keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.listNext = function (nextLink, callback) {
|
||||
return this.keys.listNext(nextLink, keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -181,8 +181,8 @@ KeyVaultKeys.prototype.listNext = function(nextLink, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.listVersions = function(vault, keyName, top, callback) {
|
||||
return this.keys.listVersions(vault, keyName, top, keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.listVersions = function (vault, keyName, top, callback) {
|
||||
return this.keys.listVersions(vault, keyName, top, keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -191,8 +191,8 @@ KeyVaultKeys.prototype.listVersions = function(vault, keyName, top, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.listVersionsNext = function(nextLink, callback) {
|
||||
return this.keys.listVersionsNext(nextLink, keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.listVersionsNext = function (nextLink, callback) {
|
||||
return this.keys.listVersionsNext(nextLink, keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -202,8 +202,8 @@ KeyVaultKeys.prototype.listVersionsNext = function(nextLink, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.restore = function(vault, keyOpRequest, callback) {
|
||||
return this.keys.restore(vault, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.restore = function (vault, keyOpRequest, callback) {
|
||||
return this.keys.restore(vault, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -213,8 +213,8 @@ KeyVaultKeys.prototype.restore = function(vault, keyOpRequest, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.sign = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.sign(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.sign = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.sign(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -224,8 +224,8 @@ KeyVaultKeys.prototype.sign = function(keyIdentifier, keyOpRequest, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.unwrapKey = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.unwrapKey(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.unwrapKey = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.unwrapKey(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -235,8 +235,8 @@ KeyVaultKeys.prototype.unwrapKey = function(keyIdentifier, keyOpRequest, callbac
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.update = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.update(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.update = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.update(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -246,8 +246,8 @@ KeyVaultKeys.prototype.update = function(keyIdentifier, keyOpRequest, callback)
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.verify = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.verify(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.verify = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.verify(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -257,32 +257,32 @@ KeyVaultKeys.prototype.verify = function(keyIdentifier, keyOpRequest, callback)
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultKeys.prototype.wrapKey = function(keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.wrapKey(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
KeyVaultKeys.prototype.wrapKey = function (keyIdentifier, keyOpRequest, callback) {
|
||||
return this.keys.wrapKey(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
function serializeKeyRequest(request) {
|
||||
return {
|
||||
rawJsonRequest: JSON.stringify(request)
|
||||
};
|
||||
return {
|
||||
rawJsonRequest: JSON.stringify(request)
|
||||
};
|
||||
}
|
||||
|
||||
function keyResponseDeserializer(callback) {
|
||||
return function(err, response) {
|
||||
if (err) {
|
||||
return callback(err, null, response);
|
||||
}
|
||||
if (response.keyOpResponse) {
|
||||
return callback(null, JSON.parse(response.keyOpResponse), response);
|
||||
}
|
||||
return callback(new Error('Unrecognized response'), null, response);
|
||||
};
|
||||
return function (err, response) {
|
||||
if (err) {
|
||||
return callback(err, null, response);
|
||||
}
|
||||
if (response.keyOpResponse) {
|
||||
return callback(null, JSON.parse(response.keyOpResponse), response);
|
||||
}
|
||||
return callback(new Error('Unrecognized response'), null, response);
|
||||
};
|
||||
}
|
||||
|
||||
/** A class that performs operations on vault secrets.
|
||||
*/
|
||||
function KeyVaultSecrets(client) {
|
||||
this.secrets = client.internalClient.secrets;
|
||||
this.secrets = client.internalClient.secrets;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -291,8 +291,8 @@ function KeyVaultSecrets(client) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.deleteMethod = function(secretIdentifier, callback) {
|
||||
return this.secrets.deleteMethod(secretIdentifier, secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.deleteMethod = function (secretIdentifier, callback) {
|
||||
return this.secrets.deleteMethod(secretIdentifier, secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -301,8 +301,8 @@ KeyVaultSecrets.prototype.deleteMethod = function(secretIdentifier, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.get = function(secretIdentifier, callback) {
|
||||
return this.secrets.get(secretIdentifier, secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.get = function (secretIdentifier, callback) {
|
||||
return this.secrets.get(secretIdentifier, secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -312,8 +312,8 @@ KeyVaultSecrets.prototype.get = function(secretIdentifier, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.list = function(vault, top, callback) {
|
||||
return this.secrets.list(vault, top, secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.list = function (vault, top, callback) {
|
||||
return this.secrets.list(vault, top, secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -322,8 +322,8 @@ KeyVaultSecrets.prototype.list = function(vault, top, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.listNext = function(nextLink, callback) {
|
||||
return this.secrets.listNext(nextLink, secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.listNext = function (nextLink, callback) {
|
||||
return this.secrets.listNext(nextLink, secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -334,8 +334,8 @@ KeyVaultSecrets.prototype.listNext = function(nextLink, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.listVersions = function(vault, secretName, top, callback) {
|
||||
return this.secrets.listVersions(vault, secretName, top, secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.listVersions = function (vault, secretName, top, callback) {
|
||||
return this.secrets.listVersions(vault, secretName, top, secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -344,8 +344,8 @@ KeyVaultSecrets.prototype.listVersions = function(vault, secretName, top, callba
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.listVersionsNext = function(nextLink, callback) {
|
||||
return this.secrets.listVersionsNext(nextLink, secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.listVersionsNext = function (nextLink, callback) {
|
||||
return this.secrets.listVersionsNext(nextLink, secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -355,8 +355,8 @@ KeyVaultSecrets.prototype.listVersionsNext = function(nextLink, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.set = function(secretIdentifier, request, callback) {
|
||||
return this.secrets.set(secretIdentifier, serializeSecretRequest(request), secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.set = function (secretIdentifier, request, callback) {
|
||||
return this.secrets.set(secretIdentifier, serializeSecretRequest(request), secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -366,27 +366,27 @@ KeyVaultSecrets.prototype.set = function(secretIdentifier, request, callback) {
|
|||
* @param {function} callback
|
||||
* @returns {Stream} The response stream.
|
||||
*/
|
||||
KeyVaultSecrets.prototype.update = function(secretIdentifier, request, callback) {
|
||||
return this.secrets.update(secretIdentifier, serializeSecretRequest(request), secretResponseDeserializer(callback));
|
||||
KeyVaultSecrets.prototype.update = function (secretIdentifier, request, callback) {
|
||||
return this.secrets.update(secretIdentifier, serializeSecretRequest(request), secretResponseDeserializer(callback));
|
||||
};
|
||||
|
||||
function serializeSecretRequest(request) {
|
||||
return {
|
||||
rawJsonRequest: JSON.stringify(request)
|
||||
};
|
||||
return {
|
||||
rawJsonRequest: JSON.stringify(request)
|
||||
};
|
||||
}
|
||||
|
||||
function secretResponseDeserializer(callback) {
|
||||
return function(err, response) {
|
||||
if (err) {
|
||||
return callback(err, null, response);
|
||||
return function (err, response) {
|
||||
if (err) {
|
||||
return callback(err, null, response);
|
||||
|
||||
}
|
||||
if (response.response) {
|
||||
return callback(null, JSON.parse(response.response), response);
|
||||
}
|
||||
return callback(new Error('Unrecognized response'), null, response);
|
||||
};
|
||||
}
|
||||
if (response.response) {
|
||||
return callback(null, JSON.parse(response.response), response);
|
||||
}
|
||||
return callback(new Error('Unrecognized response'), null, response);
|
||||
};
|
||||
}
|
||||
|
||||
exports.KeyVaultClient = KeyVaultClient;
|
||||
|
|
Загрузка…
Ссылка в новой задаче