@azure/ms-rest-azure-js
Advanced tools
Comparing version 1.3.8 to 1.4.0
# Changelog | ||
## 1.4.0 - 2021-02-02 | ||
- Added support for @azure/identity's TokenCredential. For more information, see https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md#credentials | ||
## 1.3.8 - 2019-06-06 | ||
- Fixed tests to pass when -preview suffix set in version. | ||
## 1.3.7 - 2019-06-04 | ||
@@ -3,0 +10,0 @@ - Updated `@azure/ms-rest-js` to `^1.8.10` |
@@ -12,14 +12,14 @@ /** @license ms-rest-azure-js | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Copyright (c) Microsoft Corporation. | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
@@ -53,6 +53,7 @@ /* global Reflect, Promise */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -153,3 +154,3 @@ }); | ||
response = this._pollState.mostRecentResponse; | ||
result = __assign({}, response, { headers: response.headers.clone() }); | ||
result = __assign(__assign({}, response), { headers: response.headers.clone() }); | ||
resource = this._pollState.resource; | ||
@@ -824,3 +825,3 @@ if (!resource) { | ||
*/ | ||
var msRestAzureVersion = "1.3.7"; | ||
var msRestAzureVersion = "1.4.0"; | ||
@@ -840,2 +841,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
function AzureServiceClient(credentials, options) { | ||
var _a; | ||
var _this = _super.call(this, credentials, options = updateOptionsWithDefaultValues(options)) || this; | ||
@@ -845,3 +847,3 @@ _this.acceptLanguage = DEFAULT_LANGUAGE; | ||
// automatically use the baseUri from that environment. | ||
var env = credentials.environment; | ||
var env = (_a = credentials) === null || _a === void 0 ? void 0 : _a.environment; | ||
if (env && !_this.baseUri) { | ||
@@ -848,0 +850,0 @@ _this.baseUri = env.resourceManagerEndpointUrl; |
@@ -5,2 +5,2 @@ /** @license ms-rest-azure-js | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@azure/ms-rest-js")):"function"==typeof define&&define.amd?define(["exports","@azure/ms-rest-js"],t):t(e.msRestAzure={},e.msRest)}(this,function(e,p){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(s,i,a,u){return new(a=a||Promise)(function(e,t){function r(e){try{o(u.next(e))}catch(e){t(e)}}function n(e){try{o(u.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((u=u.apply(s,i||[])).next())})}function s(r,n){var o,s,i,e,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(i=2&t[0]?s.return:t[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,t[1])).done)return i;switch(s=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,s=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3])){a.label=t[1];break}if(6===t[0]&&a.label<i[1]){a.label=i[1],i=t;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(t);break}i[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],s=0}finally{o=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var i=(a.prototype.getOperationStatus=function(){return this._pollState.state},a.prototype.isFinished=function(){return f(this._pollState.state)},a.prototype.pollUntilFinished=function(){return r(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return this.isFinished()?[3,3]:(t=function(e,t){var r=30;if(null!=e.longRunningOperationRetryTimeout)r=e.longRunningOperationRetryTimeout;else{var n=t.headers.get("retry-after");if(n){var o=parseInt(n);Number.isNaN(o)||(r=o)}}return r}(this._azureServiceClient,this._pollState.mostRecentResponse),[4,p.delay(1e3*t)]);case 1:return e.sent(),[4,this.sendPollRequest()];case 2:return e.sent(),[3,0];case 3:return[2,this.isFinalStatusAcceptable()]}})})},a.prototype.shouldDoFinalGetResourceRequest=function(){var e=this._pollState.initialResponse.request.method;return!this._pollState.resource&&("PUT"===e||"PATCH"===e||"POST"===e)},a.prototype.getMostRecentResponse=function(){return this._pollState.mostRecentResponse},a.prototype.getOperationResponse=function(){return r(this,void 0,void 0,function(){var t,r,n;return s(this,function(e){switch(e.label){case 0:return this.shouldDoFinalGetResourceRequest()?[4,this.doFinalGetResourceRequest()]:[3,2];case 1:e.sent(),e.label=2;case 2:return t=this._pollState.mostRecentResponse,r=o({},t,{headers:t.headers.clone()}),(n=this._pollState.resource)?"string"==typeof n.valueOf()?(r.bodyAsText=n,r.parsedBody=JSON.parse(n)):(r.bodyAsText=JSON.stringify(n),r.parsedBody=n):(r.bodyAsText=t.bodyAsText,r.parsedBody=t.parsedBody),[2,r]}})})},a.prototype.getRestError=function(){var e=new p.RestError("");if(e.request=p.stripRequest(this._pollState.mostRecentRequest),e.response=this._pollState.mostRecentResponse,e.message='Long running operation failed with status: "'+this._pollState.state+'".',e.body=this._pollState.resource,e.body){var t=e.body.error;t&&(t.message&&(e.message='Long running operation failed with error: "'+t.message+'".'),t.code&&(e.code=t.code))}return e},a.prototype.updateState=function(e,t){var r=this;return this.updateOperationStatus(e,t).then(function(e){r._pollState.state=u(e.parsedBody)||"Succeeded",r._pollState.mostRecentResponse=e,r._pollState.mostRecentRequest=e.request,r._pollState.resource=l(e)}).catch(function(e){var t;if(!e.response||!e.response.status)throw e;if(t=e.response.status,"DELETE"!==r._pollState.initialResponse.request.method||t<400||499<t)throw e})},a.prototype.updateOperationStatus=function(e,t){var r=e.replace(" ","%20"),n=new p.WebResource(r,"GET"),o=this._pollState;n.operationSpec=o.mostRecentRequest.operationSpec,n.shouldDeserialize=t,n.operationResponseGetter=c;var s=o.options;if(s&&s.customHeaders)for(var i=s.customHeaders,a=0,u=Object.keys(i);a<u.length;a++){var l=u[a];n.headers.set(l,i[l])}return this._azureServiceClient.sendRequest(n)},a.prototype.getPollState=function(){return this._pollState},a);function a(e,t){this._azureServiceClient=e,this._pollState=t}function c(e,t){var r=t.status,n=e.responses,o=n[r];return o||(200===r?o=n[201]||n[202]:201<=r&&r<=299&&(o={})),o}function u(e){var t;return e&&(e.provisioningState?t=e.provisioningState:e.properties&&(t=e.properties.provisioningState)),t}function l(t){var e;try{t.parsedBody?e=t.parsedBody:t.bodyAsText&&0<t.bodyAsText.length&&(e=JSON.parse(t.bodyAsText))}catch(e){var r=new p.RestError('Error "'+e+'" occurred in parsing the responseBody " +\n "while creating the PollingState for Long Running Operation- "'+t.bodyAsText+'"');throw r.request=t.request,r.response=t,r}return e}function d(e,t){var r;switch(null==t&&(t=l(e)),e.status){case 202:r="InProgress";break;case 204:r="Succeeded";break;case 201:r=u(t)||"InProgress";break;case 200:var n=u(t);r=n||(b(e)||g(e)?"InProgress":"Succeeded");break;default:r="Failed"}return r}var h=["Succeeded","Failed","Canceled","Cancelled"];function f(e){for(var t=!1,r=0,n=h;r<n.length;r++){if(y(e,n[r])){t=!0;break}}return t}function y(e,t){return(e&&e.toLowerCase())===(t&&t.toLowerCase())}function R(e,t){var r;switch(t.pollStrategyType){case"AzureAsyncOperation":r=new P(e,t);break;case"Location":r=new v(e,t);break;case"GetResource":r=new O(e,t);break;default:throw new Error('Unrecognized LRO poll strategy type: "'+t.pollStrategyType+'"')}return r}function g(e){return e.headers.get("location")}var S,v=(t(m,S=i),m.prototype.locationStrategyShouldDeserialize=function(e){var t=!1,r=this._pollState.initialResponse.request.method,n=e.status;return 200!==n&&(201!==n||"PUT"!==r&&"PATCH"!==r)&&(204!==n||"DELETE"!==r&&"POST"!==r)||(t=!0),t},m.prototype.sendPollRequest=function(){var u=this._pollState;return this.updateOperationStatus(u.locationHeaderValue,this.locationStrategyShouldDeserialize.bind(this)).then(function(e){var t=g(e);t&&(u.locationHeaderValue=t),u.mostRecentResponse=e,u.mostRecentRequest=e.request;var r=u.initialResponse,n=r.request.method,o=r.status,s=e.status;if(202===s)u.state="InProgress";else if(200===s||201===s&&("PUT"===n||"PATCH"===n)||204===s&&("DELETE"===n||"POST"===n))u.state="Succeeded",u.resource=l(e);else{if(404!==s||"POST"!==n||200!==o&&201!==o&&202!==o){if(400<=s&&s<=499){var i=e.bodyAsText,a=i;try{a=JSON.parse(i).message}catch(e){}throw new p.RestError(a,void 0,s,p.stripRequest(e.request),e,i)}throw new Error("The response with status code "+s+' from polling for long running operation url "'+u.locationHeaderValue+'" is not valid.')}u.state="Failed",u.resource=l(e)}})},m.prototype.isFinalStatusAcceptable=function(){var e=this._pollState,t=e.initialResponse,r=t.status;return y(e.state,"Succeeded")||"POST"===t.request.method&&404===e.mostRecentResponse.status&&(200===r||201===r||202===r)},m.prototype.shouldDoFinalGetResourceRequest=function(){var e=this._pollState,t=e.initialResponse,r=t.request.method,n=t.status;return("POST"!==r||404!==e.mostRecentResponse.status||200!==n&&201!==n&&202!==n)&&(S.prototype.shouldDoFinalGetResourceRequest.call(this)||"POST"===r&&201===n)},m.prototype.doFinalGetResourceRequest=function(){var e,t=this._pollState,r=t.initialResponse,n=r.status,o=r.request;return e="POST"!==o.method||200!==n&&201!==n&&202!==n?o.url:t.locationHeaderValue,this.updateState(e,!0)},m);function m(){return null!==S&&S.apply(this,arguments)||this}function b(e){return e.headers.get("azure-asyncoperation")}var q,P=(t(_,q=i),_.prototype.sendPollRequest=function(){var s=this._pollState;return this.updateOperationStatus(s.azureAsyncOperationHeaderValue,!1).then(function(e){var t=e.status,r=e.parsedBody;if(200!==t&&201!==t&&202!==t&&204!==t){var n=new p.RestError("Invalid status code ("+t+') with response body "'+e.bodyAsText+'" occurred when polling for operation status.');throw n.statusCode=t,n.request=p.stripRequest(e.request),n.response=e,n.body=r,n}if(!r)throw new Error("The response from long running operation does not contain a body.");if(!r.status)throw new Error('The response "'+e.bodyAsText+'" from long running operation does not contain the status property.');var o=b(e);o&&(s.azureAsyncOperationHeaderValue=o),s.state=r.status,s.mostRecentResponse=e,s.mostRecentRequest=e.request,s.resource=l(e)})},_.prototype.shouldDoFinalGetResourceRequest=function(){var e=this._pollState,t=e.initialResponse,r=t.request.method,n=!1;if("PUT"===r||"PATCH"===r)n=!0;else if(e.locationHeaderValue){var o=t.status;"POST"===r?n=200===o||201===o:"DELETE"===r&&(n=200===o||202===o)}return n},_.prototype.doFinalGetResourceRequest=function(){var e=this._pollState,t=e.locationHeaderValue,r=e.initialResponse,n=r.request,o=n.url;if(t){var s=n.method,i=r.status;("POST"!==s||200!==i&&201!==i&&202!==i)&&("DELETE"!==s||200!==i&&202!==i)||(o=t)}return this.updateState(o,!0)},_.prototype.isFinalStatusAcceptable=function(){var e=this._pollState,t=e.initialResponse,r=t.status;return y(e.state,"Succeeded")||"POST"===t.request.method&&(200===r||201===r)},_);function _(){return null!==q&&q.apply(this,arguments)||this}var w,O=(t(T,w=i),T.prototype.sendPollRequest=function(){var o=this._pollState;return this.updateOperationStatus(o.initialResponse.request.url,!1).then(function(e){var t=e.status,r=e.parsedBody;if(200!==t&&201!==t&&202!==t&&204!==t){var n=new p.RestError('Invalid status code with response body "'+e.bodyAsText+'" occurred when polling for operation status.');throw n.statusCode=t,n.request=p.stripRequest(e.request),n.response=e,n.body=r,n}if(!e.parsedBody)throw new Error("The response from long running operation does not contain a body.");o.state=u(e.parsedBody)||"Succeeded",o.mostRecentResponse=e,o.mostRecentRequest=e.request,o.resource=l(e)})},T.prototype.isFinalStatusAcceptable=function(){return y(this._pollState.state,"Succeeded")},T.prototype.doFinalGetResourceRequest=function(){return this.sendPollRequest()},T);function T(){return null!==w&&w.apply(this,arguments)||this}var A=(E.prototype.getInitialResponse=function(){return this._initialResponse},E.prototype.getMostRecentResponse=function(){var e=this._lroPollStrategy;return e?e.getMostRecentResponse():this._initialResponse},E.prototype.isFinished=function(){var e=this._lroPollStrategy;return!e||e.isFinished()},E.prototype.isFinalStatusAcceptable=function(){var e,t=this._lroPollStrategy;return t?t.isFinished()&&(e=t.isFinalStatusAcceptable()):e=!0,e},E.prototype.getOperationStatus=function(){var e=this._lroPollStrategy;return e?e.getOperationStatus():"Succeeded"},E.prototype.getOperationResponse=function(){var e,t=this._lroPollStrategy;if(t)if(t.isFinished()){if(!t.isFinalStatusAcceptable())throw t.getRestError();e=t.getOperationResponse()}else e=Promise.resolve(void 0);else e=Promise.resolve(this._initialResponse);return e},E.prototype.poll=function(){var e=this._lroPollStrategy;return e?e.sendPollRequest().then(function(){return e.getOperationStatus()}):Promise.resolve("Succeeded")},E.prototype.pollUntilFinished=function(){return r(this,void 0,void 0,function(){var t;return s(this,function(e){return[2,(t=this._lroPollStrategy)?t.pollUntilFinished().then(function(e){if(e)return t.getOperationResponse().then(z);throw t.getRestError()}):Promise.resolve(z(this._initialResponse))]})})},E.prototype.getPollState=function(){var e=this._lroPollStrategy;return e?e.getPollState():void 0},E);function E(e,t){this._lroPollStrategy=e,this._initialResponse=t}function C(e,t,r){var n=function(e,t,r){var n,o,s=e.request.method,i=e.status;if(b(e))n="AzureAsyncOperation";else if(g(e))n="Location";else if("PUT"===s||"PATCH"===s)n="GetResource";else if(201!==i&&202!==i&&!f(d(e)))throw new Error("Can't determine long running operation polling strategy.");if(n){var a=l(e);o=R(t,{pollStrategyType:n,options:r,initialResponse:e,mostRecentResponse:e,mostRecentRequest:e.request,azureAsyncOperationHeaderValue:b(e),locationHeaderValue:g(e),resource:a,state:d(e,a)})}else o=void 0;return o}(t,e,r);return new A(n,t)}function F(e,t){var r=R(e,t);return new A(r,t.initialResponse)}function z(e){var t=e.request,r=t.operationResponseGetter,n=t.operationSpec;return p.flattenResponse(e,r&&n&&r(n,e))}var L,N="en-us",x="1.3.7",H=(t(D,L=p.ServiceClient),D.prototype.sendLRORequest=function(e,t,r){var n=this;return this.sendOperationRequest(e,t).then(function(e){return C(n,e._response,r)})},D.prototype.sendLongRunningRequest=function(e,t){return this.beginLongRunningRequest(e,t).then(function(e){return e.pollUntilFinished()}).then(function(e){return e._response})},D.prototype.beginLongRunningRequest=function(e,t){var r=this;return this.sendRequest(e).then(function(e){return C(r,e,t)})},D.prototype.restoreLROPoller=function(e){return F(this,e)},D);function D(e,t){var r=L.call(this,e,t=function(e){e=e||{};null==e.generateClientRequestIdHeader&&(e.generateClientRequestIdHeader=!0);e.userAgent||(e.userAgent=G());return e}(t))||this;r.acceptLanguage=N;var n=e.environment;return n&&!r.baseUri&&(r.baseUri=n.resourceManagerEndpointUrl),null!=t.acceptLanguage&&(r.acceptLanguage=t.acceptLanguage),null!=t.longRunningOperationRetryTimeout&&(r.longRunningOperationRetryTimeout=t.longRunningOperationRetryTimeout),r}function G(){var e=p.getDefaultUserAgentValue();return"ms-rest-azure-js/"+x+" "+e}var U,B=(t(I,U=p.ApiKeyCredentials),I);function I(e){if(!e||e&&"string"!=typeof e.valueOf())throw new Error("subscriptionKey cannot be null or undefined and must be of type string.");var t={inHeader:{"Ocp-Apim-Subscription-Key":e,"X-BingApis-SDK-Client":"node-SDK"}};return U.call(this,t)||this}e.AzureServiceClient=H,e.getDefaultUserAgentValue=G,e.BaseResourceMapper={serializedName:"BaseResource",type:{name:"Composite",className:"BaseResource",modelProperties:{}}},e.CloudErrorMapper={serializedName:"CloudError",type:{name:"Composite",className:"CloudError",modelProperties:{code:{required:!0,serializedName:"code",type:{name:"String"}},message:{required:!0,serializedName:"message",type:{name:"String"}},target:{serializedName:"target",type:{name:"String"}},details:{serializedName:"details",type:{name:"Sequence",element:{serializedName:"CloudErrorElementType",type:{name:"Composite",className:"CloudError"}}}},innerError:{required:!1,serializedName:"innererror",type:{name:"Object"}},additionalInfo:{required:!1,serializedName:"additionalInfo",type:{name:"Composite",className:"AdditionalInfoElement",modelProperties:{type:{required:!0,serializedName:"type",type:{name:"String"}},info:{required:!1,serializedName:"info",type:{name:"Object"}}}}}}}},e.CognitiveServicesCredentials=B,e.createLROPollerFromInitialResponse=C,e.createLROPollerFromPollState=F,e.LROPoller=A,e.DEFAULT_LANGUAGE=N,e.msRestAzureVersion=x,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@azure/ms-rest-js")):"function"==typeof define&&define.amd?define(["exports","@azure/ms-rest-js"],t):t(e.msRestAzure={},e.msRest)}(this,function(e,a){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,i,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{s(u.next(e))}catch(e){t(e)}}function o(e){try{s(u.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}s((u=u.apply(e,i||[])).next())})}function s(r,n){var o,s,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(i=2&t[0]?s.return:t[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,t[1])).done)return i;switch(s=0,(t=i?[2&t[0],i.value]:t)[0]){case 0:case 1:i=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,s=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3])){a.label=t[1];break}if(6===t[0]&&a.label<i[1]){a.label=i[1],i=t;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(t);break}i[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],s=0}finally{o=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var i=(u.prototype.getOperationStatus=function(){return this._pollState.state},u.prototype.isFinished=function(){return f(this._pollState.state)},u.prototype.pollUntilFinished=function(){return r(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return this.isFinished()?[3,3]:(t=function(e,t){var r=30;null!=e.longRunningOperationRetryTimeout?r=e.longRunningOperationRetryTimeout:(t=t.headers.get("retry-after"))&&(t=parseInt(t),Number.isNaN(t)||(r=t));return r}(this._azureServiceClient,this._pollState.mostRecentResponse),[4,a.delay(1e3*t)]);case 1:return e.sent(),[4,this.sendPollRequest()];case 2:return e.sent(),[3,0];case 3:return[2,this.isFinalStatusAcceptable()]}})})},u.prototype.shouldDoFinalGetResourceRequest=function(){var e=this._pollState.initialResponse.request.method;return!this._pollState.resource&&("PUT"===e||"PATCH"===e||"POST"===e)},u.prototype.getMostRecentResponse=function(){return this._pollState.mostRecentResponse},u.prototype.getOperationResponse=function(){return r(this,void 0,void 0,function(){var t,r,n;return s(this,function(e){switch(e.label){case 0:return this.shouldDoFinalGetResourceRequest()?[4,this.doFinalGetResourceRequest()]:[3,2];case 1:e.sent(),e.label=2;case 2:return t=this._pollState.mostRecentResponse,r=o(o({},t),{headers:t.headers.clone()}),(n=this._pollState.resource)?"string"==typeof n.valueOf()?(r.bodyAsText=n,r.parsedBody=JSON.parse(n)):(r.bodyAsText=JSON.stringify(n),r.parsedBody=n):(r.bodyAsText=t.bodyAsText,r.parsedBody=t.parsedBody),[2,r]}})})},u.prototype.getRestError=function(){var e,t=new a.RestError("");return t.request=a.stripRequest(this._pollState.mostRecentRequest),t.response=this._pollState.mostRecentResponse,t.message='Long running operation failed with status: "'+this._pollState.state+'".',t.body=this._pollState.resource,!t.body||(e=t.body.error)&&(e.message&&(t.message='Long running operation failed with error: "'+e.message+'".'),e.code&&(t.code=e.code)),t},u.prototype.updateState=function(e,t){var r=this;return this.updateOperationStatus(e,t).then(function(e){r._pollState.state=p(e.parsedBody)||"Succeeded",r._pollState.mostRecentResponse=e,r._pollState.mostRecentRequest=e.request,r._pollState.resource=c(e)}).catch(function(e){var t;if(!e.response||!e.response.status)throw e;if(t=e.response.status,"DELETE"!==r._pollState.initialResponse.request.method||t<400||499<t)throw e})},u.prototype.updateOperationStatus=function(e,t){var e=e.replace(" ","%20"),r=new a.WebResource(e,"GET"),e=this._pollState;r.operationSpec=e.mostRecentRequest.operationSpec,r.shouldDeserialize=t,r.operationResponseGetter=l;e=e.options;if(e&&e.customHeaders)for(var n=e.customHeaders,o=0,s=Object.keys(n);o<s.length;o++){var i=s[o];r.headers.set(i,n[i])}return this._azureServiceClient.sendRequest(r)},u.prototype.getPollState=function(){return this._pollState},u);function u(e,t){this._azureServiceClient=e,this._pollState=t}function l(e,t){var r=t.status,t=e.responses,e=t[r];return e||(200===r?e=t[201]||t[202]:201<=r&&r<=299&&(e={})),e}function p(e){var t;return e&&(e.provisioningState?t=e.provisioningState:e.properties&&(t=e.properties.provisioningState)),t}function c(t){var e;try{t.parsedBody?e=t.parsedBody:t.bodyAsText&&0<t.bodyAsText.length&&(e=JSON.parse(t.bodyAsText))}catch(e){var r=new a.RestError('Error "'+e+'" occurred in parsing the responseBody " +\n "while creating the PollingState for Long Running Operation- "'+t.bodyAsText+'"');throw r.request=t.request,r.response=t,r}return e}function d(e,t){switch(null==t&&(t=c(e)),e.status){case 202:n="InProgress";break;case 204:n="Succeeded";break;case 201:n=p(t)||"InProgress";break;case 200:var r=p(t),n=r||(b(e)||g(e)?"InProgress":"Succeeded");break;default:n="Failed"}return n}var h=["Succeeded","Failed","Canceled","Cancelled"];function f(e){for(var t=!1,r=0,n=h;r<n.length;r++)if(y(e,n[r])){t=!0;break}return t}function y(e,t){return(e&&e.toLowerCase())===(t&&t.toLowerCase())}function R(e,t){var r;switch(t.pollStrategyType){case"AzureAsyncOperation":r=new P(e,t);break;case"Location":r=new m(e,t);break;case"GetResource":r=new O(e,t);break;default:throw new Error('Unrecognized LRO poll strategy type: "'+t.pollStrategyType+'"')}return r}function g(e){return e.headers.get("location")}var S,m=(t(v,S=i),v.prototype.locationStrategyShouldDeserialize=function(e){var t=!1,r=this._pollState.initialResponse.request.method,e=e.status;return t=200===e||201===e&&("PUT"===r||"PATCH"===r)||204===e&&("DELETE"===r||"POST"===r)?!0:t},v.prototype.sendPollRequest=function(){var i=this._pollState;return this.updateOperationStatus(i.locationHeaderValue,this.locationStrategyShouldDeserialize.bind(this)).then(function(e){var t=g(e);t&&(i.locationHeaderValue=t),i.mostRecentResponse=e,i.mostRecentRequest=e.request;var r=i.initialResponse,n=r.request.method,t=r.status,r=e.status;if(202===r)i.state="InProgress";else if(200===r||201===r&&("PUT"===n||"PATCH"===n)||204===r&&("DELETE"===n||"POST"===n))i.state="Succeeded",i.resource=c(e);else{if(404!==r||"POST"!==n||200!==t&&201!==t&&202!==t){if(400<=r&&r<=499){var o=e.bodyAsText,s=o;try{s=JSON.parse(o).message}catch(e){}throw new a.RestError(s,void 0,r,a.stripRequest(e.request),e,o)}throw new Error("The response with status code "+r+' from polling for long running operation url "'+i.locationHeaderValue+'" is not valid.')}i.state="Failed",i.resource=c(e)}})},v.prototype.isFinalStatusAcceptable=function(){var e=this._pollState,t=e.initialResponse,r=t.status;return y(e.state,"Succeeded")||"POST"===t.request.method&&404===e.mostRecentResponse.status&&(200===r||201===r||202===r)},v.prototype.shouldDoFinalGetResourceRequest=function(){var e=this._pollState,t=e.initialResponse,r=t.request.method,t=t.status,t=("POST"!==r||404!==e.mostRecentResponse.status||200!==t&&201!==t&&202!==t)&&(S.prototype.shouldDoFinalGetResourceRequest.call(this)||"POST"===r&&201===t);return t},v.prototype.doFinalGetResourceRequest=function(){var e=this._pollState,t=e.initialResponse,r=t.status,t=t.request,e="POST"!==t.method||200!==r&&201!==r&&202!==r?t.url:e.locationHeaderValue;return this.updateState(e,!0)},v);function v(){return null!==S&&S.apply(this,arguments)||this}function b(e){return e.headers.get("azure-asyncoperation")}var q,P=(t(_,q=i),_.prototype.sendPollRequest=function(){var o=this._pollState;return this.updateOperationStatus(o.azureAsyncOperationHeaderValue,!1).then(function(e){var t=e.status,r=e.parsedBody;if(200!==t&&201!==t&&202!==t&&204!==t){var n=new a.RestError("Invalid status code ("+t+') with response body "'+e.bodyAsText+'" occurred when polling for operation status.');throw n.statusCode=t,n.request=a.stripRequest(e.request),n.response=e,n.body=r,n}if(!r)throw new Error("The response from long running operation does not contain a body.");if(!r.status)throw new Error('The response "'+e.bodyAsText+'" from long running operation does not contain the status property.');n=b(e);n&&(o.azureAsyncOperationHeaderValue=n),o.state=r.status,o.mostRecentResponse=e,o.mostRecentRequest=e.request,o.resource=c(e)})},_.prototype.shouldDoFinalGetResourceRequest=function(){var e=this._pollState,t=e.initialResponse,r=t.request.method,n=!1;return"PUT"===r||"PATCH"===r?n=!0:e.locationHeaderValue&&(t=t.status,"POST"===r?n=200===t||201===t:"DELETE"===r&&(n=200===t||202===t)),n},_.prototype.doFinalGetResourceRequest=function(){var e=this._pollState,t=e.locationHeaderValue,r=e.initialResponse,n=r.request,e=n.url;return t&&(n=n.method,r=r.status,("POST"!==n||200!==r&&201!==r&&202!==r)&&("DELETE"!==n||200!==r&&202!==r)||(e=t)),this.updateState(e,!0)},_.prototype.isFinalStatusAcceptable=function(){var e=this._pollState,t=e.initialResponse,r=t.status;return y(e.state,"Succeeded")||"POST"===t.request.method&&(200===r||201===r)},_);function _(){return null!==q&&q.apply(this,arguments)||this}var w,O=(t(T,w=i),T.prototype.sendPollRequest=function(){var o=this._pollState;return this.updateOperationStatus(o.initialResponse.request.url,!1).then(function(e){var t=e.status,r=e.parsedBody;if(200!==t&&201!==t&&202!==t&&204!==t){var n=new a.RestError('Invalid status code with response body "'+e.bodyAsText+'" occurred when polling for operation status.');throw n.statusCode=t,n.request=a.stripRequest(e.request),n.response=e,n.body=r,n}if(!e.parsedBody)throw new Error("The response from long running operation does not contain a body.");o.state=p(e.parsedBody)||"Succeeded",o.mostRecentResponse=e,o.mostRecentRequest=e.request,o.resource=c(e)})},T.prototype.isFinalStatusAcceptable=function(){return y(this._pollState.state,"Succeeded")},T.prototype.doFinalGetResourceRequest=function(){return this.sendPollRequest()},T);function T(){return null!==w&&w.apply(this,arguments)||this}var A=(E.prototype.getInitialResponse=function(){return this._initialResponse},E.prototype.getMostRecentResponse=function(){var e=this._lroPollStrategy;return e?e.getMostRecentResponse():this._initialResponse},E.prototype.isFinished=function(){var e=this._lroPollStrategy;return!e||e.isFinished()},E.prototype.isFinalStatusAcceptable=function(){var e,t=this._lroPollStrategy;return t?t.isFinished()&&(e=t.isFinalStatusAcceptable()):e=!0,e},E.prototype.getOperationStatus=function(){var e=this._lroPollStrategy;return e?e.getOperationStatus():"Succeeded"},E.prototype.getOperationResponse=function(){var e,t=this._lroPollStrategy;if(t)if(t.isFinished()){if(!t.isFinalStatusAcceptable())throw t.getRestError();e=t.getOperationResponse()}else e=Promise.resolve(void 0);else e=Promise.resolve(this._initialResponse);return e},E.prototype.poll=function(){var e=this._lroPollStrategy,t=e?e.sendPollRequest().then(function(){return e.getOperationStatus()}):Promise.resolve("Succeeded");return t},E.prototype.pollUntilFinished=function(){return r(this,void 0,void 0,function(){var t;return s(this,function(e){return t=this._lroPollStrategy,[2,t?t.pollUntilFinished().then(function(e){if(e)return t.getOperationResponse().then(z);throw t.getRestError()}):Promise.resolve(z(this._initialResponse))]})})},E.prototype.getPollState=function(){var e=this._lroPollStrategy;return e?e.getPollState():void 0},E);function E(e,t){this._lroPollStrategy=e,this._initialResponse=t}function C(e,t,r){r=function(e,t,r){var n,o=e.request.method,s=e.status;if(b(e))n="AzureAsyncOperation";else if(g(e))n="Location";else if("PUT"===o||"PATCH"===o)n="GetResource";else if(201!==s&&202!==s&&!f(d(e)))throw new Error("Can't determine long running operation polling strategy.");return n?(s=c(e),R(t,{pollStrategyType:n,options:r,initialResponse:e,mostRecentResponse:e,mostRecentRequest:e.request,azureAsyncOperationHeaderValue:b(e),locationHeaderValue:g(e),resource:s,state:d(e,s)})):void 0}(t,e,r);return new A(r,t)}function F(e,t){e=R(e,t);return new A(e,t.initialResponse)}function z(e){var t=e.request,r=t.operationResponseGetter,t=t.operationSpec;return a.flattenResponse(e,r&&t&&r(t,e))}var L,N="en-us",x="1.4.0",H=(t(D,L=a.ServiceClient),D.prototype.sendLRORequest=function(e,t,r){var n=this;return this.sendOperationRequest(e,t).then(function(e){return C(n,e._response,r)})},D.prototype.sendLongRunningRequest=function(e,t){return this.beginLongRunningRequest(e,t).then(function(e){return e.pollUntilFinished()}).then(function(e){return e._response})},D.prototype.beginLongRunningRequest=function(e,t){var r=this;return this.sendRequest(e).then(function(e){return C(r,e,t)})},D.prototype.restoreLROPoller=function(e){return F(this,e)},D);function D(e,t){var r=L.call(this,e,t=function(e){e=e||{};null==e.generateClientRequestIdHeader&&(e.generateClientRequestIdHeader=!0);e.userAgent||(e.userAgent=G());return e}(t))||this;r.acceptLanguage=N;e=null===e||void 0===e?void 0:e.environment;return e&&!r.baseUri&&(r.baseUri=e.resourceManagerEndpointUrl),null!=t.acceptLanguage&&(r.acceptLanguage=t.acceptLanguage),null!=t.longRunningOperationRetryTimeout&&(r.longRunningOperationRetryTimeout=t.longRunningOperationRetryTimeout),r}function G(){var e=a.getDefaultUserAgentValue();return"ms-rest-azure-js/"+x+" "+e}var U,i=(t(B,U=a.ApiKeyCredentials),B);function B(e){if(!e||e&&"string"!=typeof e.valueOf())throw new Error("subscriptionKey cannot be null or undefined and must be of type string.");e={inHeader:{"Ocp-Apim-Subscription-Key":e,"X-BingApis-SDK-Client":"node-SDK"}};return U.call(this,e)||this}e.AzureServiceClient=H,e.getDefaultUserAgentValue=G,e.BaseResourceMapper={serializedName:"BaseResource",type:{name:"Composite",className:"BaseResource",modelProperties:{}}},e.CloudErrorMapper={serializedName:"CloudError",type:{name:"Composite",className:"CloudError",modelProperties:{code:{required:!0,serializedName:"code",type:{name:"String"}},message:{required:!0,serializedName:"message",type:{name:"String"}},target:{serializedName:"target",type:{name:"String"}},details:{serializedName:"details",type:{name:"Sequence",element:{serializedName:"CloudErrorElementType",type:{name:"Composite",className:"CloudError"}}}},innerError:{required:!1,serializedName:"innererror",type:{name:"Object"}},additionalInfo:{required:!1,serializedName:"additionalInfo",type:{name:"Composite",className:"AdditionalInfoElement",modelProperties:{type:{required:!0,serializedName:"type",type:{name:"String"}},info:{required:!1,serializedName:"info",type:{name:"Object"}}}}}}}},e.CognitiveServicesCredentials=i,e.createLROPollerFromInitialResponse=C,e.createLROPollerFromPollState=F,e.LROPoller=A,e.DEFAULT_LANGUAGE=N,e.msRestAzureVersion=x,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -0,1 +1,2 @@ | ||
import { TokenCredential } from "@azure/core-auth"; | ||
import { HttpOperationResponse, OperationArguments, OperationSpec, RequestOptionsBase, RequestPrepareOptions, ServiceClient, ServiceClientCredentials, ServiceClientOptions, WebResource } from "@azure/ms-rest-js"; | ||
@@ -33,3 +34,3 @@ import { LROPoller } from "./lroPoller"; | ||
longRunningOperationRetryTimeout?: number; | ||
constructor(credentials: ServiceClientCredentials, options?: AzureServiceClientOptions); | ||
constructor(credentials: ServiceClientCredentials | TokenCredential, options?: AzureServiceClientOptions); | ||
/** | ||
@@ -36,0 +37,0 @@ * Send the initial request of a LRO (long running operation) and get back an |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
import * as tslib_1 from "tslib"; | ||
import { __extends } from "tslib"; | ||
import { ServiceClient, getDefaultUserAgentValue as getDefaultUserAgentValueFromMsRest } from "@azure/ms-rest-js"; | ||
@@ -17,4 +17,5 @@ import { createLROPollerFromInitialResponse, createLROPollerFromPollState } from "./lroPoller"; | ||
var AzureServiceClient = /** @class */ (function (_super) { | ||
tslib_1.__extends(AzureServiceClient, _super); | ||
__extends(AzureServiceClient, _super); | ||
function AzureServiceClient(credentials, options) { | ||
var _a; | ||
var _this = _super.call(this, credentials, options = updateOptionsWithDefaultValues(options)) || this; | ||
@@ -24,3 +25,3 @@ _this.acceptLanguage = Constants.DEFAULT_LANGUAGE; | ||
// automatically use the baseUri from that environment. | ||
var env = credentials.environment; | ||
var env = (_a = credentials) === null || _a === void 0 ? void 0 : _a.environment; | ||
if (env && !_this.baseUri) { | ||
@@ -27,0 +28,0 @@ _this.baseUri = env.resourceManagerEndpointUrl; |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
import * as tslib_1 from "tslib"; | ||
import { __extends } from "tslib"; | ||
import { ApiKeyCredentials } from "@azure/ms-rest-js"; | ||
@@ -12,3 +12,3 @@ /** | ||
var CognitiveServicesCredentials = /** @class */ (function (_super) { | ||
tslib_1.__extends(CognitiveServicesCredentials, _super); | ||
__extends(CognitiveServicesCredentials, _super); | ||
function CognitiveServicesCredentials(subscriptionKey) { | ||
@@ -15,0 +15,0 @@ var _this = this; |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
import * as tslib_1 from "tslib"; | ||
import { __awaiter, __generator } from "tslib"; | ||
import { flattenResponse } from "@azure/ms-rest-js"; | ||
@@ -105,5 +105,5 @@ import { createLROPollStrategyFromInitialResponse, createLROPollStrategyFromPollState } from "./lroPollStrategy"; | ||
LROPoller.prototype.pollUntilFinished = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var result, lroPollStrategy; | ||
return tslib_1.__generator(this, function (_a) { | ||
return __generator(this, function (_a) { | ||
lroPollStrategy = this._lroPollStrategy; | ||
@@ -110,0 +110,0 @@ if (!lroPollStrategy) { |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
import * as tslib_1 from "tslib"; | ||
import { __assign, __awaiter, __extends, __generator } from "tslib"; | ||
import { delay, RestError, stripRequest, WebResource } from "@azure/ms-rest-js"; | ||
@@ -28,5 +28,5 @@ /** | ||
LROPollStrategy.prototype.pollUntilFinished = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var delayInSeconds; | ||
return tslib_1.__generator(this, function (_a) { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -56,5 +56,5 @@ case 0: | ||
LROPollStrategy.prototype.getOperationResponse = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var response, result, resource; | ||
return tslib_1.__generator(this, function (_a) { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -69,3 +69,3 @@ case 0: | ||
response = this._pollState.mostRecentResponse; | ||
result = tslib_1.__assign({}, response, { headers: response.headers.clone() }); | ||
result = __assign(__assign({}, response), { headers: response.headers.clone() }); | ||
resource = this._pollState.resource; | ||
@@ -338,3 +338,3 @@ if (!resource) { | ||
var LocationLROPollStrategy = /** @class */ (function (_super) { | ||
tslib_1.__extends(LocationLROPollStrategy, _super); | ||
__extends(LocationLROPollStrategy, _super); | ||
function LocationLROPollStrategy() { | ||
@@ -458,3 +458,3 @@ return _super !== null && _super.apply(this, arguments) || this; | ||
var AzureAsyncOperationLROPollStrategy = /** @class */ (function (_super) { | ||
tslib_1.__extends(AzureAsyncOperationLROPollStrategy, _super); | ||
__extends(AzureAsyncOperationLROPollStrategy, _super); | ||
function AzureAsyncOperationLROPollStrategy() { | ||
@@ -549,3 +549,3 @@ return _super !== null && _super.apply(this, arguments) || this; | ||
var GetResourceLROPollStrategy = /** @class */ (function (_super) { | ||
tslib_1.__extends(GetResourceLROPollStrategy, _super); | ||
__extends(GetResourceLROPollStrategy, _super); | ||
function GetResourceLROPollStrategy() { | ||
@@ -552,0 +552,0 @@ return _super !== null && _super.apply(this, arguments) || this; |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
export declare const msRestAzureVersion = "1.3.7"; | ||
export declare const msRestAzureVersion = "1.4.0"; | ||
//# sourceMappingURL=constants.d.ts.map |
@@ -15,3 +15,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
*/ | ||
export var msRestAzureVersion = "1.3.7"; | ||
export var msRestAzureVersion = "1.4.0"; | ||
//# sourceMappingURL=constants.js.map |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
import { TokenCredential } from "@azure/core-auth"; | ||
import { HttpOperationResponse, OperationArguments, OperationSpec, RequestOptionsBase, RequestPrepareOptions, ServiceClient, ServiceClientCredentials, ServiceClientOptions, WebResource, getDefaultUserAgentValue as getDefaultUserAgentValueFromMsRest } from "@azure/ms-rest-js"; | ||
@@ -41,3 +42,3 @@ import { createLROPollerFromInitialResponse, createLROPollerFromPollState, LROPoller } from "./lroPoller"; | ||
constructor(credentials: ServiceClientCredentials, options?: AzureServiceClientOptions) { | ||
constructor(credentials: ServiceClientCredentials | TokenCredential, options?: AzureServiceClientOptions) { | ||
super(credentials, options = updateOptionsWithDefaultValues(options)); | ||
@@ -47,3 +48,3 @@ | ||
// automatically use the baseUri from that environment. | ||
const env = (credentials as any).environment; | ||
const env = (credentials as any)?.environment; | ||
if (env && !this.baseUri) { | ||
@@ -50,0 +51,0 @@ this.baseUri = env.resourceManagerEndpointUrl; |
@@ -30,2 +30,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
*/ | ||
export const msRestAzureVersion = "1.3.7"; | ||
export const msRestAzureVersion = "1.4.0"; |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.3.8", | ||
"version": "1.4.0", | ||
"description": "Isomorphic Azure client runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest", | ||
@@ -45,3 +45,4 @@ "tags": [ | ||
"dependencies": { | ||
"@azure/ms-rest-js": "^1.8.10", | ||
"@azure/core-auth": "^1.1.4", | ||
"@azure/ms-rest-js": "^1.10.0", | ||
"tslib": "^1.9.3" | ||
@@ -48,0 +49,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
308911
0
3253
3
+ Added@azure/core-auth@^1.1.4
Updated@azure/ms-rest-js@^1.10.0