@azure/arm-support 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "mgmt",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "A generated SDK for MicrosoftSupport.",
6
- "version": "2.0.1",
6
+ "version": "2.0.2",
7
7
  "engines": {
8
8
  "node": ">=12.0.0"
9
9
  },
@@ -40,9 +40,13 @@
40
40
  "uglify-js": "^3.4.9",
41
41
  "rimraf": "^3.0.0",
42
42
  "@azure/identity": "^2.0.1",
43
- "@azure-tools/test-recorder": "^1.0.0",
43
+ "@azure-tools/test-recorder": "^2.0.0",
44
+ "@azure-tools/test-credential": "^1.0.0",
44
45
  "mocha": "^7.1.1",
45
- "cross-env": "^7.0.2"
46
+ "@types/chai": "^4.2.8",
47
+ "chai": "^4.2.0",
48
+ "cross-env": "^7.0.2",
49
+ "@azure/dev-tool": "^1.0.0"
46
50
  },
47
51
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support",
48
52
  "repository": {
@@ -93,9 +97,8 @@
93
97
  "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
94
98
  "unit-test:browser": "echo skipped",
95
99
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
96
- "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
97
- "integration-test:browser": "echo skipped",
98
- "docs": "echo skipped"
100
+ "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
101
+ "integration-test:browser": "echo skipped"
99
102
  },
100
103
  "sideEffects": false,
101
104
  "//metadata": {
@@ -115,4 +118,4 @@
115
118
  "disableDocsMs": true,
116
119
  "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-support?view=azure-node-preview"
117
120
  }
118
- }
121
+ }
@@ -118,45 +118,33 @@ export interface ExceptionResponse {
118
118
 
119
119
  // @public
120
120
  export enum KnownCommunicationDirection {
121
- // (undocumented)
122
121
  Inbound = "inbound",
123
- // (undocumented)
124
122
  Outbound = "outbound"
125
123
  }
126
124
 
127
125
  // @public
128
126
  export enum KnownCommunicationType {
129
- // (undocumented)
130
127
  Phone = "phone",
131
- // (undocumented)
132
128
  Web = "web"
133
129
  }
134
130
 
135
131
  // @public
136
132
  export enum KnownPreferredContactMethod {
137
- // (undocumented)
138
133
  Email = "email",
139
- // (undocumented)
140
134
  Phone = "phone"
141
135
  }
142
136
 
143
137
  // @public
144
138
  export enum KnownSeverityLevel {
145
- // (undocumented)
146
139
  Critical = "critical",
147
- // (undocumented)
148
140
  Highestcriticalimpact = "highestcriticalimpact",
149
- // (undocumented)
150
141
  Minimal = "minimal",
151
- // (undocumented)
152
142
  Moderate = "moderate"
153
143
  }
154
144
 
155
145
  // @public
156
146
  export enum KnownStatus {
157
- // (undocumented)
158
147
  Closed = "closed",
159
- // (undocumented)
160
148
  Open = "open"
161
149
  }
162
150
 
@@ -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
  OperationsImpl,
@@ -57,7 +62,7 @@ export class MicrosoftSupport extends coreClient.ServiceClient {
57
62
  credential: credentials
58
63
  };
59
64
 
60
- const packageDetails = `azsdk-js-arm-support/2.0.1`;
65
+ const packageDetails = `azsdk-js-arm-support/2.0.2`;
61
66
  const userAgentPrefix =
62
67
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
63
68
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
@@ -110,6 +115,35 @@ export class MicrosoftSupport extends coreClient.ServiceClient {
110
115
  this.problemClassifications = new ProblemClassificationsImpl(this);
111
116
  this.supportTickets = new SupportTicketsImpl(this);
112
117
  this.communications = new CommunicationsImpl(this);
118
+ this.addCustomApiVersionPolicy(options.apiVersion);
119
+ }
120
+
121
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
122
+ private addCustomApiVersionPolicy(apiVersion?: string) {
123
+ if (!apiVersion) {
124
+ return;
125
+ }
126
+ const apiVersionPolicy = {
127
+ name: "CustomApiVersionPolicy",
128
+ async sendRequest(
129
+ request: PipelineRequest,
130
+ next: SendRequest
131
+ ): Promise<PipelineResponse> {
132
+ const param = request.url.split("?");
133
+ if (param.length > 1) {
134
+ const newParams = param[1].split("&").map((item) => {
135
+ if (item.indexOf("api-version") > -1) {
136
+ return "api-version=" + apiVersion;
137
+ } else {
138
+ return item;
139
+ }
140
+ });
141
+ request.url = param[0] + "?" + newParams.join("&");
142
+ }
143
+ return next(request);
144
+ }
145
+ };
146
+ this.pipeline.addPolicy(apiVersionPolicy);
113
147
  }
114
148
 
115
149
  operations: Operations;
@@ -413,9 +413,13 @@ export interface CommunicationDetails {
413
413
 
414
414
  /** Known values of {@link SeverityLevel} that the service accepts. */
415
415
  export enum KnownSeverityLevel {
416
+ /** Minimal */
416
417
  Minimal = "minimal",
418
+ /** Moderate */
417
419
  Moderate = "moderate",
420
+ /** Critical */
418
421
  Critical = "critical",
422
+ /** Highestcriticalimpact */
419
423
  Highestcriticalimpact = "highestcriticalimpact"
420
424
  }
421
425
 
@@ -433,7 +437,9 @@ export type SeverityLevel = string;
433
437
 
434
438
  /** Known values of {@link PreferredContactMethod} that the service accepts. */
435
439
  export enum KnownPreferredContactMethod {
440
+ /** Email */
436
441
  Email = "email",
442
+ /** Phone */
437
443
  Phone = "phone"
438
444
  }
439
445
 
@@ -449,7 +455,9 @@ export type PreferredContactMethod = string;
449
455
 
450
456
  /** Known values of {@link Status} that the service accepts. */
451
457
  export enum KnownStatus {
458
+ /** Open */
452
459
  Open = "open",
460
+ /** Closed */
453
461
  Closed = "closed"
454
462
  }
455
463
 
@@ -465,7 +473,9 @@ export type Status = string;
465
473
 
466
474
  /** Known values of {@link CommunicationType} that the service accepts. */
467
475
  export enum KnownCommunicationType {
476
+ /** Web */
468
477
  Web = "web",
478
+ /** Phone */
469
479
  Phone = "phone"
470
480
  }
471
481
 
@@ -481,7 +491,9 @@ export type CommunicationType = string;
481
491
 
482
492
  /** Known values of {@link CommunicationDirection} that the service accepts. */
483
493
  export enum KnownCommunicationDirection {
494
+ /** Inbound */
484
495
  Inbound = "inbound",
496
+ /** Outbound */
485
497
  Outbound = "outbound"
486
498
  }
487
499
 
@@ -222,33 +222,45 @@ export declare interface ExceptionResponse {
222
222
 
223
223
  /** Known values of {@link CommunicationDirection} that the service accepts. */
224
224
  export declare enum KnownCommunicationDirection {
225
+ /** Inbound */
225
226
  Inbound = "inbound",
227
+ /** Outbound */
226
228
  Outbound = "outbound"
227
229
  }
228
230
 
229
231
  /** Known values of {@link CommunicationType} that the service accepts. */
230
232
  export declare enum KnownCommunicationType {
233
+ /** Web */
231
234
  Web = "web",
235
+ /** Phone */
232
236
  Phone = "phone"
233
237
  }
234
238
 
235
239
  /** Known values of {@link PreferredContactMethod} that the service accepts. */
236
240
  export declare enum KnownPreferredContactMethod {
241
+ /** Email */
237
242
  Email = "email",
243
+ /** Phone */
238
244
  Phone = "phone"
239
245
  }
240
246
 
241
247
  /** Known values of {@link SeverityLevel} that the service accepts. */
242
248
  export declare enum KnownSeverityLevel {
249
+ /** Minimal */
243
250
  Minimal = "minimal",
251
+ /** Moderate */
244
252
  Moderate = "moderate",
253
+ /** Critical */
245
254
  Critical = "critical",
255
+ /** Highestcriticalimpact */
246
256
  Highestcriticalimpact = "highestcriticalimpact"
247
257
  }
248
258
 
249
259
  /** Known values of {@link Status} that the service accepts. */
250
260
  export declare enum KnownStatus {
261
+ /** Open */
251
262
  Open = "open",
263
+ /** Closed */
252
264
  Closed = "closed"
253
265
  }
254
266
 
@@ -263,6 +275,8 @@ export declare class MicrosoftSupport extends coreClient.ServiceClient {
263
275
  * @param options The parameter options
264
276
  */
265
277
  constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftSupportOptionalParams);
278
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
279
+ private addCustomApiVersionPolicy;
266
280
  operations: Operations;
267
281
  services: Services;
268
282
  problemClassifications: ProblemClassifications;