@azure/arm-oep 1.0.0-beta.1 → 1.0.0-beta.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/CHANGELOG.md +6 -0
- package/README.md +11 -0
- package/dist/index.js +63 -10
- 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/energyServicesCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesCreateSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesGetSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.js +44 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.js +43 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.d.ts +2 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.d.ts.map +1 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.js +33 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.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 +29 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.d.ts.map +1 -1
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.js +20 -2
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.js.map +1 -1
- package/dist-esm/src/operations/energyServices.d.ts.map +1 -1
- package/dist-esm/src/operations/energyServices.js +6 -2
- package/dist-esm/src/operations/energyServices.js.map +1 -1
- package/package.json +27 -15
- package/rollup.config.js +6 -72
- package/src/openEnergyPlatformManagementServiceAPIs.ts +27 -2
- package/src/operations/energyServices.ts +6 -2
- package/tsconfig.json +18 -5
- package/types/tsdoc-metadata.json +1 -1
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];
|
|
@@ -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 {
|
|
12
13
|
LocationsImpl,
|
|
@@ -48,7 +49,7 @@ export class OpenEnergyPlatformManagementServiceAPIs extends coreClient.ServiceC
|
|
|
48
49
|
credential: credentials
|
|
49
50
|
};
|
|
50
51
|
|
|
51
|
-
const packageDetails = `azsdk-js-arm-oep/1.0.0-beta.
|
|
52
|
+
const packageDetails = `azsdk-js-arm-oep/1.0.0-beta.2`;
|
|
52
53
|
const userAgentPrefix =
|
|
53
54
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
54
55
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
@@ -63,9 +64,33 @@ export class OpenEnergyPlatformManagementServiceAPIs extends coreClient.ServiceC
|
|
|
63
64
|
userAgentOptions: {
|
|
64
65
|
userAgentPrefix
|
|
65
66
|
},
|
|
66
|
-
baseUri:
|
|
67
|
+
baseUri:
|
|
68
|
+
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
67
69
|
};
|
|
68
70
|
super(optionsWithDefaults);
|
|
71
|
+
|
|
72
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
73
|
+
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
74
|
+
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
75
|
+
(pipelinePolicy) =>
|
|
76
|
+
pipelinePolicy.name ===
|
|
77
|
+
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
78
|
+
);
|
|
79
|
+
if (!bearerTokenAuthenticationPolicyFound) {
|
|
80
|
+
this.pipeline.removePolicy({
|
|
81
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
82
|
+
});
|
|
83
|
+
this.pipeline.addPolicy(
|
|
84
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
85
|
+
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
|
86
|
+
challengeCallbacks: {
|
|
87
|
+
authorizeRequestOnChallenge:
|
|
88
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
69
94
|
// Parameter assignments
|
|
70
95
|
this.subscriptionId = subscriptionId;
|
|
71
96
|
|
|
@@ -246,11 +246,13 @@ export class EnergyServicesImpl implements EnergyServices {
|
|
|
246
246
|
{ resourceGroupName, resourceName, options },
|
|
247
247
|
createOperationSpec
|
|
248
248
|
);
|
|
249
|
-
|
|
249
|
+
const poller = new LroEngine(lro, {
|
|
250
250
|
resumeFrom: options?.resumeFrom,
|
|
251
251
|
intervalInMs: options?.updateIntervalInMs,
|
|
252
252
|
lroResourceLocationConfig: "azure-async-operation"
|
|
253
253
|
});
|
|
254
|
+
await poller.poll();
|
|
255
|
+
return poller;
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
/**
|
|
@@ -343,10 +345,12 @@ export class EnergyServicesImpl implements EnergyServices {
|
|
|
343
345
|
{ resourceGroupName, resourceName, options },
|
|
344
346
|
deleteOperationSpec
|
|
345
347
|
);
|
|
346
|
-
|
|
348
|
+
const poller = new LroEngine(lro, {
|
|
347
349
|
resumeFrom: options?.resumeFrom,
|
|
348
350
|
intervalInMs: options?.updateIntervalInMs
|
|
349
351
|
});
|
|
352
|
+
await poller.poll();
|
|
353
|
+
return poller;
|
|
350
354
|
}
|
|
351
355
|
|
|
352
356
|
/**
|
package/tsconfig.json
CHANGED
|
@@ -9,12 +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
18
|
"importHelpers": true,
|
|
16
|
-
"paths": {
|
|
19
|
+
"paths": {
|
|
20
|
+
"@azure/arm-oep": [
|
|
21
|
+
"./src/index"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
17
24
|
},
|
|
18
|
-
"include": [
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
"include": [
|
|
26
|
+
"./src/**/*.ts",
|
|
27
|
+
"./test/**/*.ts",
|
|
28
|
+
"samples-dev/**/*.ts"
|
|
29
|
+
],
|
|
30
|
+
"exclude": [
|
|
31
|
+
"node_modules"
|
|
32
|
+
]
|
|
33
|
+
}
|