Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove ms-rest package #4523

Merged
merged 8 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/framework/suite-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var sinon = require('sinon');
var _ = require('underscore');
var util = require('util');
var uuid = require('uuid');
var msRest = require('ms-rest');
var msRest = require('@azure/ms-rest-js');
var identity = require("@azure/identity");
var {Environment} = require("@azure/ms-rest-azure-env")
var MicrosoftAppCredentials = require('botframework-connector/lib/auth/microsoftAppCredentials');
Expand Down
1 change: 0 additions & 1 deletion tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"botframework-connector": "4.1.6",
"dotenv": "^4.0.0",
"mime": "^1.4.1",
"ms-rest": "^2.3.6",
"underscore": "^1.13.1",
"uuid": "^3.3.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

'use strict';

/**
* Wrapper object for http request and response. Deserialized object is stored in
* the `body` property.
* @class
* Initializes a new instance of the HttpOperationResponse class.
* @constructor
*/
class HttpOperationResponse {
constructor(request, response) {
/**
* Reference to the original request object.
* [WebResource] object.
* @type {object}
*/
this.request = request;

/**
* Reference to the original response object.
* [ServerResponse] object.
* @type {object}
*/
this.response = response;

/**
* The response object.
* @type {object}
*/
this.body = null;
}
}

module.exports = HttpOperationResponse;
1 change: 1 addition & 0 deletions tools/resourceManagement/lib/resource/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ exports.ResourceListResult = require('./resourceListResult');
exports.ResourceGroupListResult = require('./resourceGroupListResult');
exports.TagsListResult = require('./tagsListResult');
exports.DeploymentOperationsListResult = require('./deploymentOperationsListResult');
exports.HttpOperationResponse = require("./HttpOperationResponse");
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

const msRest = require('ms-rest');
const msRest = require('@azure/ms-rest-js');
const uuid = require('uuid');
const WebResource = msRest.WebResource;

Expand Down Expand Up @@ -546,7 +546,7 @@ class DeploymentOperations {
let self = this;
return new Promise((resolve, reject) => {
self._get(resourceGroupName, deploymentName, operationId, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -639,7 +639,7 @@ class DeploymentOperations {
let self = this;
return new Promise((resolve, reject) => {
self._list(resourceGroupName, deploymentName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -729,7 +729,7 @@ class DeploymentOperations {
let self = this;
return new Promise((resolve, reject) => {
self._listNext(nextPageLink, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down
28 changes: 14 additions & 14 deletions tools/resourceManagement/lib/resource/operations/deployments.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

const msRest = require('ms-rest');
const msRest = require('@azure/ms-rest-js');
const uuid = require('uuid');
const WebResource = msRest.WebResource;

Expand Down Expand Up @@ -67,7 +67,7 @@ function _deleteMethod(resourceGroupName, deploymentName, options, callback) {
this.beginDeleteMethod(resourceGroupName, deploymentName, options, (err, parsedResult, httpRequest, response) => {
if (err) return callback(err);

let initialResult = new msRest.HttpOperationResponse();
let initialResult = new client.models['HttpOperationResponse']();
initialResult.request = httpRequest;
initialResult.response = response;
initialResult.body = response.body;
Expand Down Expand Up @@ -351,7 +351,7 @@ function _createOrUpdate(resourceGroupName, deploymentName, parameters, options,
this.beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, parsedResult, httpRequest, response) => {
if (err) return callback(err);

let initialResult = new msRest.HttpOperationResponse();
let initialResult = new client.models['HttpOperationResponse']();
initialResult.request = httpRequest;
initialResult.response = response;
initialResult.body = response.body;
Expand Down Expand Up @@ -1960,7 +1960,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._deleteMethod(resourceGroupName, deploymentName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2058,7 +2058,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._checkExistence(resourceGroupName, deploymentName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2207,7 +2207,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._createOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2357,7 +2357,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._get(resourceGroupName, deploymentName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2450,7 +2450,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._cancel(resourceGroupName, deploymentName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2601,7 +2601,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._validate(resourceGroupName, deploymentName, parameters, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2750,7 +2750,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._exportTemplate(resourceGroupName, deploymentName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2844,7 +2844,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -2947,7 +2947,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._beginDeleteMethod(resourceGroupName, deploymentName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -3107,7 +3107,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down Expand Up @@ -3255,7 +3255,7 @@ class Deployments {
let self = this;
return new Promise((resolve, reject) => {
self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
let httpOperationResponse = new client.models['HttpOperationResponse'](request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
Expand Down
Loading
Loading