Edit D:\xinhaisoft\crisis_new\api\node_modules\@azure\core-auth\dist\index.js
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** * A static-key-based credential that supports updating * the underlying key value. */ var AzureKeyCredential = /** @class */ (function () { /** * Create an instance of an AzureKeyCredential for use * with a service client. * * @param key - The initial value of the key to use in authentication */ function AzureKeyCredential(key) { if (!key) { throw new Error("key must be a non-empty string"); } this._key = key; } Object.defineProperty(AzureKeyCredential.prototype, "key", { /** * The value of the key to be used in authentication */ get: function () { return this._key; }, enumerable: false, configurable: true }); /** * Change the value of the key. * * Updates will take effect upon the next request after * updating the key value. * * @param newKey - The new key value to be used */ AzureKeyCredential.prototype.update = function (newKey) { this._key = newKey; }; return AzureKeyCredential; }()); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** * Helper TypeGuard that checks if something is defined or not. * @param thing - Anything * @internal */ function isDefined(thing) { return typeof thing !== "undefined" && thing !== null; } /** * Helper TypeGuard that checks if the input is an object with the specified properties. * Note: The properties may be inherited. * @param thing - Anything. * @param properties - The name of the properties that should appear in the object. * @internal */ function isObjectWithProperties(thing, properties) { if (!isDefined(thing) || typeof thing !== "object") { return false; } for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) { var property = properties_1[_i]; if (!objectHasProperty(thing, property)) { return false; } } return true; } /** * Helper TypeGuard that checks if the input is an object with the specified property. * Note: The property may be inherited. * @param thing - Any object. * @param property - The name of the property that should appear in the object. * @internal */ function objectHasProperty(thing, property) { return typeof thing === "object" && property in thing; } // Copyright (c) Microsoft Corporation. /** * A static name/key-based credential that supports updating * the underlying name and key values. */ var AzureNamedKeyCredential = /** @class */ (function () { /** * Create an instance of an AzureNamedKeyCredential for use * with a service client. * * @param name - The initial value of the name to use in authentication. * @param key - The initial value of the key to use in authentication. */ function AzureNamedKeyCredential(name, key) { if (!name || !key) { throw new TypeError("name and key must be non-empty strings"); } this._name = name; this._key = key; } Object.defineProperty(AzureNamedKeyCredential.prototype, "key", { /** * The value of the key to be used in authentication. */ get: function () { return this._key; }, enumerable: false, configurable: true }); Object.defineProperty(AzureNamedKeyCredential.prototype, "name", { /** * The value of the name to be used in authentication. */ get: function () { return this._name; }, enumerable: false, configurable: true }); /** * Change the value of the key. * * Updates will take effect upon the next request after * updating the key value. * * @param newName - The new name value to be used. * @param newKey - The new key value to be used. */ AzureNamedKeyCredential.prototype.update = function (newName, newKey) { if (!newName || !newKey) { throw new TypeError("newName and newKey must be non-empty strings"); } this._name = newName; this._key = newKey; }; return AzureNamedKeyCredential; }()); /** * Tests an object to determine whether it implements NamedKeyCredential. * * @param credential - The assumed NamedKeyCredential to be tested. */ function isNamedKeyCredential(credential) { return (isObjectWithProperties(credential, ["name", "key"]) && typeof credential.key === "string" && typeof credential.name === "string"); } // Copyright (c) Microsoft Corporation. /** * A static-signature-based credential that supports updating * the underlying signature value. */ var AzureSASCredential = /** @class */ (function () { /** * Create an instance of an AzureSASCredential for use * with a service client. * * @param signature - The initial value of the shared access signature to use in authentication */ function AzureSASCredential(signature) { if (!signature) { throw new Error("shared access signature must be a non-empty string"); } this._signature = signature; } Object.defineProperty(AzureSASCredential.prototype, "signature", { /** * The value of the shared access signature to be used in authentication */ get: function () { return this._signature; }, enumerable: false, configurable: true }); /** * Change the value of the signature. * * Updates will take effect upon the next request after * updating the signature value. * * @param newSignature - The new shared access signature value to be used */ AzureSASCredential.prototype.update = function (newSignature) { if (!newSignature) { throw new Error("shared access signature must be a non-empty string"); } this._signature = newSignature; }; return AzureSASCredential; }()); /** * Tests an object to determine whether it implements SASCredential. * * @param credential - The assumed SASCredential to be tested. */ function isSASCredential(credential) { return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); } // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** * Tests an object to determine whether it implements TokenCredential. * * @param credential - The assumed TokenCredential to be tested. */ function isTokenCredential(credential) { // Check for an object with a 'getToken' function and possibly with // a 'signRequest' function. We do this check to make sure that // a ServiceClientCredentials implementor (like TokenClientCredentials // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if // it doesn't actually implement TokenCredential also. var castCredential = credential; return (castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); } exports.AzureKeyCredential = AzureKeyCredential; exports.AzureNamedKeyCredential = AzureNamedKeyCredential; exports.AzureSASCredential = AzureSASCredential; exports.isNamedKeyCredential = isNamedKeyCredential; exports.isSASCredential = isSASCredential; exports.isTokenCredential = isTokenCredential; //# sourceMappingURL=index.js.map
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de