@azure/arm-healthbot 2.0.1-alpha.20220412.1 → 2.0.1-alpha.20220427.1
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/CHANGELOG.md +3 -7
- package/README.md +11 -0
- package/dist/index.js +70 -25
- 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/botsCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/botsCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/botsCreateSample.js +42 -0
- package/dist-esm/samples-dev/botsCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/botsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/botsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/botsDeleteSample.js +31 -0
- package/dist-esm/samples-dev/botsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/botsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/botsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/botsGetSample.js +31 -0
- package/dist-esm/samples-dev/botsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/botsListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/botsListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/botsListByResourceGroupSample.js +44 -0
- package/dist-esm/samples-dev/botsListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/botsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/botsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/botsListSample.js +43 -0
- package/dist-esm/samples-dev/botsListSample.js.map +1 -0
- package/dist-esm/samples-dev/botsUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/botsUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/botsUpdateSample.js +32 -0
- package/dist-esm/samples-dev/botsUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +43 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/src/healthbotClient.d.ts.map +1 -1
- package/dist-esm/src/healthbotClient.js +20 -2
- package/dist-esm/src/healthbotClient.js.map +1 -1
- package/dist-esm/src/operations/bots.d.ts.map +1 -1
- package/dist-esm/src/operations/bots.js +6 -2
- package/dist-esm/src/operations/bots.js.map +1 -1
- package/package.json +27 -11
- package/rollup.config.js +6 -72
- package/src/healthbotClient.ts +27 -2
- package/src/operations/bots.ts +6 -2
- package/tsconfig.json +19 -5
- package/types/tsdoc-metadata.json +1 -1
- package/LICENSE.txt +0 -21
package/rollup.config.js
CHANGED
|
@@ -14,62 +14,14 @@ import json from "@rollup/plugin-json";
|
|
|
14
14
|
|
|
15
15
|
import nodeBuiltins from "builtin-modules";
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
|
|
19
|
-
*
|
|
20
|
-
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
|
|
21
|
-
* __exportStar downleveled helper function to declare its exports which confuses
|
|
22
|
-
* rollup's automatic discovery mechanism.
|
|
23
|
-
*
|
|
24
|
-
* @returns an object reference that can be `...`'d into your cjs() configuration.
|
|
25
|
-
*/
|
|
26
|
-
export function openTelemetryCommonJs() {
|
|
27
|
-
const namedExports = {};
|
|
28
|
-
|
|
29
|
-
for (const key of [
|
|
30
|
-
"@opentelemetry/api",
|
|
31
|
-
"@azure/core-tracing/node_modules/@opentelemetry/api"
|
|
32
|
-
]) {
|
|
33
|
-
namedExports[key] = [
|
|
34
|
-
"SpanKind",
|
|
35
|
-
"TraceFlags",
|
|
36
|
-
"getSpan",
|
|
37
|
-
"setSpan",
|
|
38
|
-
"SpanStatusCode",
|
|
39
|
-
"getSpanContext",
|
|
40
|
-
"setSpanContext"
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
|
|
45
|
-
|
|
46
|
-
for (const version of releasedOpenTelemetryVersions) {
|
|
47
|
-
namedExports[
|
|
48
|
-
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
|
|
49
|
-
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
|
|
50
|
-
] = [
|
|
51
|
-
"SpanKind",
|
|
52
|
-
"TraceFlags",
|
|
53
|
-
"getSpan",
|
|
54
|
-
"setSpan",
|
|
55
|
-
"StatusCode",
|
|
56
|
-
"CanonicalCode",
|
|
57
|
-
"getSpanContext",
|
|
58
|
-
"setSpanContext"
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return namedExports;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
17
|
// #region Warning Handler
|
|
66
18
|
|
|
67
19
|
/**
|
|
68
|
-
* A function that can determine whether a
|
|
20
|
+
* A function that can determine whether a rollup warning should be ignored. If
|
|
69
21
|
* the function returns `true`, then the warning will not be displayed.
|
|
70
22
|
*/
|
|
71
23
|
|
|
72
|
-
function
|
|
24
|
+
function ignoreNiseSinonEval(warning) {
|
|
73
25
|
return (
|
|
74
26
|
warning.code === "EVAL" &&
|
|
75
27
|
warning.id &&
|
|
@@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) {
|
|
|
78
30
|
);
|
|
79
31
|
}
|
|
80
32
|
|
|
81
|
-
function
|
|
33
|
+
function ignoreChaiCircularDependency(warning) {
|
|
82
34
|
return (
|
|
83
35
|
warning.code === "CIRCULAR_DEPENDENCY" &&
|
|
84
36
|
warning.importer && warning.importer.includes("node_modules/chai") === true
|
|
85
37
|
);
|
|
86
38
|
}
|
|
87
39
|
|
|
88
|
-
const warningInhibitors = [
|
|
89
|
-
ignoreChaiCircularDependencyWarnings,
|
|
90
|
-
ignoreNiseSinonEvalWarnings
|
|
91
|
-
];
|
|
40
|
+
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
|
|
92
41
|
|
|
93
42
|
/**
|
|
94
43
|
* Construct a warning handler for the shared rollup configuration
|
|
@@ -122,22 +71,7 @@ function makeBrowserTestConfig() {
|
|
|
122
71
|
nodeResolve({
|
|
123
72
|
mainFields: ["module", "browser"]
|
|
124
73
|
}),
|
|
125
|
-
cjs(
|
|
126
|
-
namedExports: {
|
|
127
|
-
// Chai's strange internal architecture makes it impossible to statically
|
|
128
|
-
// analyze its exports.
|
|
129
|
-
chai: [
|
|
130
|
-
"version",
|
|
131
|
-
"use",
|
|
132
|
-
"util",
|
|
133
|
-
"config",
|
|
134
|
-
"expect",
|
|
135
|
-
"should",
|
|
136
|
-
"assert"
|
|
137
|
-
],
|
|
138
|
-
...openTelemetryCommonJs()
|
|
139
|
-
}
|
|
140
|
-
}),
|
|
74
|
+
cjs(),
|
|
141
75
|
json(),
|
|
142
76
|
sourcemaps()
|
|
143
77
|
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
|
@@ -173,7 +107,7 @@ export function makeConfig(pkg, options) {
|
|
|
173
107
|
],
|
|
174
108
|
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
|
175
109
|
preserveSymlinks: false,
|
|
176
|
-
plugins: [sourcemaps(), nodeResolve()
|
|
110
|
+
plugins: [sourcemaps(), nodeResolve()]
|
|
177
111
|
};
|
|
178
112
|
|
|
179
113
|
const config = [baseConfig];
|
package/src/healthbotClient.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as coreClient from "@azure/core-client";
|
|
10
|
+
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
10
11
|
import * as coreAuth from "@azure/core-auth";
|
|
11
12
|
import { BotsImpl, OperationsImpl } from "./operations";
|
|
12
13
|
import { Bots, Operations } from "./operationsInterfaces";
|
|
@@ -44,7 +45,7 @@ export class HealthbotClient extends coreClient.ServiceClient {
|
|
|
44
45
|
credential: credentials
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
const packageDetails = `azsdk-js-arm-healthbot/2.0.
|
|
48
|
+
const packageDetails = `azsdk-js-arm-healthbot/2.0.1`;
|
|
48
49
|
const userAgentPrefix =
|
|
49
50
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
50
51
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
@@ -59,9 +60,33 @@ export class HealthbotClient extends coreClient.ServiceClient {
|
|
|
59
60
|
userAgentOptions: {
|
|
60
61
|
userAgentPrefix
|
|
61
62
|
},
|
|
62
|
-
baseUri:
|
|
63
|
+
baseUri:
|
|
64
|
+
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
63
65
|
};
|
|
64
66
|
super(optionsWithDefaults);
|
|
67
|
+
|
|
68
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
69
|
+
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
70
|
+
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
71
|
+
(pipelinePolicy) =>
|
|
72
|
+
pipelinePolicy.name ===
|
|
73
|
+
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
74
|
+
);
|
|
75
|
+
if (!bearerTokenAuthenticationPolicyFound) {
|
|
76
|
+
this.pipeline.removePolicy({
|
|
77
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
78
|
+
});
|
|
79
|
+
this.pipeline.addPolicy(
|
|
80
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
81
|
+
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
|
82
|
+
challengeCallbacks: {
|
|
83
|
+
authorizeRequestOnChallenge:
|
|
84
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
65
90
|
// Parameter assignments
|
|
66
91
|
this.subscriptionId = subscriptionId;
|
|
67
92
|
|
package/src/operations/bots.ts
CHANGED
|
@@ -201,11 +201,13 @@ export class BotsImpl implements Bots {
|
|
|
201
201
|
{ resourceGroupName, botName, parameters, options },
|
|
202
202
|
createOperationSpec
|
|
203
203
|
);
|
|
204
|
-
|
|
204
|
+
const poller = new LroEngine(lro, {
|
|
205
205
|
resumeFrom: options?.resumeFrom,
|
|
206
206
|
intervalInMs: options?.updateIntervalInMs,
|
|
207
207
|
lroResourceLocationConfig: "azure-async-operation"
|
|
208
208
|
});
|
|
209
|
+
await poller.poll();
|
|
210
|
+
return poller;
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
/**
|
|
@@ -321,10 +323,12 @@ export class BotsImpl implements Bots {
|
|
|
321
323
|
{ resourceGroupName, botName, options },
|
|
322
324
|
deleteOperationSpec
|
|
323
325
|
);
|
|
324
|
-
|
|
326
|
+
const poller = new LroEngine(lro, {
|
|
325
327
|
resumeFrom: options?.resumeFrom,
|
|
326
328
|
intervalInMs: options?.updateIntervalInMs
|
|
327
329
|
});
|
|
330
|
+
await poller.poll();
|
|
331
|
+
return poller;
|
|
328
332
|
}
|
|
329
333
|
|
|
330
334
|
/**
|
package/tsconfig.json
CHANGED
|
@@ -9,11 +9,25 @@
|
|
|
9
9
|
"esModuleInterop": true,
|
|
10
10
|
"allowSyntheticDefaultImports": true,
|
|
11
11
|
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"lib": [
|
|
12
|
+
"lib": [
|
|
13
|
+
"es6",
|
|
14
|
+
"dom"
|
|
15
|
+
],
|
|
13
16
|
"declaration": true,
|
|
14
17
|
"outDir": "./dist-esm",
|
|
15
|
-
"importHelpers": true
|
|
18
|
+
"importHelpers": true,
|
|
19
|
+
"paths": {
|
|
20
|
+
"@azure/arm-healthbot": [
|
|
21
|
+
"./src/index"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
16
24
|
},
|
|
17
|
-
"include": [
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
"include": [
|
|
26
|
+
"./src/**/*.ts",
|
|
27
|
+
"./test/**/*.ts",
|
|
28
|
+
"samples-dev/**/*.ts"
|
|
29
|
+
],
|
|
30
|
+
"exclude": [
|
|
31
|
+
"node_modules"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/LICENSE.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Microsoft
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|