@azure/arm-datamigration 3.0.0-beta.2 → 3.0.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2 -2
- package/README.md +1 -1
- package/dist/index.js +630 -110
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/databaseMigrationsSqlMiCreateOrUpdateSample.js +2 -2
- package/dist-esm/samples-dev/databaseMigrationsSqlMiCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/databaseMigrationsSqlVMCreateOrUpdateSample.js +2 -2
- package/dist-esm/samples-dev/databaseMigrationsSqlVMCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/src/dataMigrationManagementClient.d.ts +2 -0
- package/dist-esm/src/dataMigrationManagementClient.d.ts.map +1 -1
- package/dist-esm/src/dataMigrationManagementClient.js +49 -18
- package/dist-esm/src/dataMigrationManagementClient.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +556 -240
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +314 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/operations/files.d.ts.map +1 -1
- package/dist-esm/src/operations/files.js +19 -7
- package/dist-esm/src/operations/files.js.map +1 -1
- package/dist-esm/src/operations/operations.d.ts.map +1 -1
- package/dist-esm/src/operations/operations.js +19 -7
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/projects.d.ts.map +1 -1
- package/dist-esm/src/operations/projects.js +19 -7
- package/dist-esm/src/operations/projects.js.map +1 -1
- package/dist-esm/src/operations/resourceSkus.d.ts.map +1 -1
- package/dist-esm/src/operations/resourceSkus.js +19 -7
- package/dist-esm/src/operations/resourceSkus.js.map +1 -1
- package/dist-esm/src/operations/serviceTasks.d.ts.map +1 -1
- package/dist-esm/src/operations/serviceTasks.js +19 -7
- package/dist-esm/src/operations/serviceTasks.js.map +1 -1
- package/dist-esm/src/operations/services.d.ts.map +1 -1
- package/dist-esm/src/operations/services.js +55 -21
- package/dist-esm/src/operations/services.js.map +1 -1
- package/dist-esm/src/operations/sqlMigrationServices.d.ts.map +1 -1
- package/dist-esm/src/operations/sqlMigrationServices.js +55 -21
- package/dist-esm/src/operations/sqlMigrationServices.js.map +1 -1
- package/dist-esm/src/operations/tasks.d.ts.map +1 -1
- package/dist-esm/src/operations/tasks.js +19 -7
- package/dist-esm/src/operations/tasks.js.map +1 -1
- package/dist-esm/src/operations/usages.d.ts.map +1 -1
- package/dist-esm/src/operations/usages.js +19 -7
- package/dist-esm/src/operations/usages.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +14 -10
- package/review/arm-datamigration.api.md +564 -872
- package/src/dataMigrationManagementClient.ts +60 -20
- package/src/index.ts +1 -0
- package/src/models/index.ts +646 -246
- package/src/operations/files.ts +22 -8
- package/src/operations/operations.ts +21 -8
- package/src/operations/projects.ts +21 -8
- package/src/operations/resourceSkus.ts +21 -8
- package/src/operations/serviceTasks.ts +21 -8
- package/src/operations/services.ts +67 -25
- package/src/operations/sqlMigrationServices.ts +71 -29
- package/src/operations/tasks.ts +22 -8
- package/src/operations/usages.ts +21 -8
- package/src/pagingHelper.ts +39 -0
- package/types/arm-datamigration.d.ts +567 -240
- package/types/tsdoc-metadata.json +1 -1
@@ -8,6 +8,11 @@
|
|
8
8
|
|
9
9
|
import * as coreClient from "@azure/core-client";
|
10
10
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
11
|
+
import {
|
12
|
+
PipelineRequest,
|
13
|
+
PipelineResponse,
|
14
|
+
SendRequest
|
15
|
+
} from "@azure/core-rest-pipeline";
|
11
16
|
import * as coreAuth from "@azure/core-auth";
|
12
17
|
import {
|
13
18
|
DatabaseMigrationsSqlMiImpl,
|
@@ -69,47 +74,53 @@ export class DataMigrationManagementClient extends coreClient.ServiceClient {
|
|
69
74
|
credential: credentials
|
70
75
|
};
|
71
76
|
|
72
|
-
const packageDetails = `azsdk-js-arm-datamigration/3.0.0-beta.
|
77
|
+
const packageDetails = `azsdk-js-arm-datamigration/3.0.0-beta.3`;
|
73
78
|
const userAgentPrefix =
|
74
79
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
75
80
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
76
81
|
: `${packageDetails}`;
|
77
82
|
|
78
|
-
if (!options.credentialScopes) {
|
79
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
80
|
-
}
|
81
83
|
const optionsWithDefaults = {
|
82
84
|
...defaults,
|
83
85
|
...options,
|
84
86
|
userAgentOptions: {
|
85
87
|
userAgentPrefix
|
86
88
|
},
|
87
|
-
|
89
|
+
endpoint:
|
88
90
|
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
89
91
|
};
|
90
92
|
super(optionsWithDefaults);
|
91
93
|
|
94
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
92
95
|
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
93
96
|
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
94
|
-
|
97
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
95
98
|
(pipelinePolicy) =>
|
96
99
|
pipelinePolicy.name ===
|
97
100
|
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
98
101
|
);
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
102
|
+
}
|
103
|
+
if (
|
104
|
+
!options ||
|
105
|
+
!options.pipeline ||
|
106
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
107
|
+
!bearerTokenAuthenticationPolicyFound
|
108
|
+
) {
|
109
|
+
this.pipeline.removePolicy({
|
110
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
111
|
+
});
|
112
|
+
this.pipeline.addPolicy(
|
113
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
114
|
+
credential: credentials,
|
115
|
+
scopes:
|
116
|
+
optionsWithDefaults.credentialScopes ??
|
117
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
118
|
+
challengeCallbacks: {
|
119
|
+
authorizeRequestOnChallenge:
|
120
|
+
coreClient.authorizeRequestOnClaimChallenge
|
121
|
+
}
|
122
|
+
})
|
123
|
+
);
|
113
124
|
}
|
114
125
|
// Parameter assignments
|
115
126
|
this.subscriptionId = subscriptionId;
|
@@ -128,6 +139,35 @@ export class DataMigrationManagementClient extends coreClient.ServiceClient {
|
|
128
139
|
this.projects = new ProjectsImpl(this);
|
129
140
|
this.usages = new UsagesImpl(this);
|
130
141
|
this.files = new FilesImpl(this);
|
142
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
143
|
+
}
|
144
|
+
|
145
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
146
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
147
|
+
if (!apiVersion) {
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
const apiVersionPolicy = {
|
151
|
+
name: "CustomApiVersionPolicy",
|
152
|
+
async sendRequest(
|
153
|
+
request: PipelineRequest,
|
154
|
+
next: SendRequest
|
155
|
+
): Promise<PipelineResponse> {
|
156
|
+
const param = request.url.split("?");
|
157
|
+
if (param.length > 1) {
|
158
|
+
const newParams = param[1].split("&").map((item) => {
|
159
|
+
if (item.indexOf("api-version") > -1) {
|
160
|
+
return "api-version=" + apiVersion;
|
161
|
+
} else {
|
162
|
+
return item;
|
163
|
+
}
|
164
|
+
});
|
165
|
+
request.url = param[0] + "?" + newParams.join("&");
|
166
|
+
}
|
167
|
+
return next(request);
|
168
|
+
}
|
169
|
+
};
|
170
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
131
171
|
}
|
132
172
|
|
133
173
|
databaseMigrationsSqlMi: DatabaseMigrationsSqlMi;
|
package/src/index.ts
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
*/
|
8
8
|
|
9
9
|
/// <reference lib="esnext.asynciterable" />
|
10
|
+
export { getContinuationToken } from "./pagingHelper";
|
10
11
|
export * from "./models";
|
11
12
|
export { DataMigrationManagementClient } from "./dataMigrationManagementClient";
|
12
13
|
export * from "./operationsInterfaces";
|