@azure/arm-baremetalinfrastructure 1.0.0-beta.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 +5 -0
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/index.js +1378 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.js +39 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.js +59 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.js +58 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.js +60 -0
- package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.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 +58 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/src/bareMetalInfrastructureClient.d.ts +21 -0
- package/dist-esm/src/bareMetalInfrastructureClient.d.ts.map +1 -0
- package/dist-esm/src/bareMetalInfrastructureClient.js +101 -0
- package/dist-esm/src/bareMetalInfrastructureClient.js.map +1 -0
- package/dist-esm/src/index.d.ts +6 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +13 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +519 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +152 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +20 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +513 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +11 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +105 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/azureBareMetalInstances.d.ts +73 -0
- package/dist-esm/src/operations/azureBareMetalInstances.d.ts.map +1 -0
- package/dist-esm/src/operations/azureBareMetalInstances.js +334 -0
- package/dist-esm/src/operations/azureBareMetalInstances.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +3 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +10 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +26 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +101 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.d.ts +35 -0
- package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.js +9 -0
- package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +10 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- 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/baremetalinfrastructure_operations_test.spec.d.ts +4 -0
- package/dist-esm/test/baremetalinfrastructure_operations_test.spec.d.ts.map +1 -0
- package/dist-esm/test/baremetalinfrastructure_operations_test.spec.js +78 -0
- package/dist-esm/test/baremetalinfrastructure_operations_test.spec.js.map +1 -0
- package/package.json +121 -0
- package/review/arm-baremetalinfrastructure.api.md +325 -0
- package/rollup.config.js +122 -0
- package/src/bareMetalInfrastructureClient.ts +142 -0
- package/src/index.ts +13 -0
- package/src/models/index.ts +566 -0
- package/src/models/mappers.ts +549 -0
- package/src/models/parameters.ts +119 -0
- package/src/operations/azureBareMetalInstances.ts +395 -0
- package/src/operations/index.ts +10 -0
- package/src/operations/operations.ts +103 -0
- package/src/operationsInterfaces/azureBareMetalInstances.ts +67 -0
- package/src/operationsInterfaces/index.ts +10 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/pagingHelper.ts +39 -0
- package/tsconfig.json +33 -0
- package/types/arm-baremetalinfrastructure.d.ts +633 -0
- package/types/tsdoc-metadata.json +11 -0
package/rollup.config.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
10
|
+
import cjs from "@rollup/plugin-commonjs";
|
|
11
|
+
import sourcemaps from "rollup-plugin-sourcemaps";
|
|
12
|
+
import multiEntry from "@rollup/plugin-multi-entry";
|
|
13
|
+
import json from "@rollup/plugin-json";
|
|
14
|
+
|
|
15
|
+
import nodeBuiltins from "builtin-modules";
|
|
16
|
+
|
|
17
|
+
// #region Warning Handler
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A function that can determine whether a rollup warning should be ignored. If
|
|
21
|
+
* the function returns `true`, then the warning will not be displayed.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
function ignoreNiseSinonEval(warning) {
|
|
25
|
+
return (
|
|
26
|
+
warning.code === "EVAL" &&
|
|
27
|
+
warning.id &&
|
|
28
|
+
(warning.id.includes("node_modules/nise") ||
|
|
29
|
+
warning.id.includes("node_modules/sinon")) === true
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ignoreChaiCircularDependency(warning) {
|
|
34
|
+
return (
|
|
35
|
+
warning.code === "CIRCULAR_DEPENDENCY" &&
|
|
36
|
+
warning.importer && warning.importer.includes("node_modules/chai") === true
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Construct a warning handler for the shared rollup configuration
|
|
44
|
+
* that ignores certain warnings that are not relevant to testing.
|
|
45
|
+
*/
|
|
46
|
+
function makeOnWarnForTesting() {
|
|
47
|
+
return (warning, warn) => {
|
|
48
|
+
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
|
|
49
|
+
if (warningInhibitors.every((inhib) => !inhib(warning))) {
|
|
50
|
+
warn(warning);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// #endregion
|
|
56
|
+
|
|
57
|
+
function makeBrowserTestConfig() {
|
|
58
|
+
const config = {
|
|
59
|
+
input: {
|
|
60
|
+
include: ["dist-esm/test/**/*.spec.js"],
|
|
61
|
+
exclude: ["dist-esm/test/**/node/**"]
|
|
62
|
+
},
|
|
63
|
+
output: {
|
|
64
|
+
file: `dist-test/index.browser.js`,
|
|
65
|
+
format: "umd",
|
|
66
|
+
sourcemap: true
|
|
67
|
+
},
|
|
68
|
+
preserveSymlinks: false,
|
|
69
|
+
plugins: [
|
|
70
|
+
multiEntry({ exports: false }),
|
|
71
|
+
nodeResolve({
|
|
72
|
+
mainFields: ["module", "browser"]
|
|
73
|
+
}),
|
|
74
|
+
cjs(),
|
|
75
|
+
json(),
|
|
76
|
+
sourcemaps()
|
|
77
|
+
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
|
78
|
+
],
|
|
79
|
+
onwarn: makeOnWarnForTesting(),
|
|
80
|
+
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
|
|
81
|
+
// rollup started respecting the "sideEffects" field in package.json. Since
|
|
82
|
+
// our package.json sets "sideEffects=false", this also applies to test
|
|
83
|
+
// code, which causes all tests to be removed by tree-shaking.
|
|
84
|
+
treeshake: false
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return config;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const defaultConfigurationOptions = {
|
|
91
|
+
disableBrowserBundle: false
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export function makeConfig(pkg, options) {
|
|
95
|
+
options = {
|
|
96
|
+
...defaultConfigurationOptions,
|
|
97
|
+
...(options || {})
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const baseConfig = {
|
|
101
|
+
// Use the package's module field if it has one
|
|
102
|
+
input: pkg["module"] || "dist-esm/src/index.js",
|
|
103
|
+
external: [
|
|
104
|
+
...nodeBuiltins,
|
|
105
|
+
...Object.keys(pkg.dependencies),
|
|
106
|
+
...Object.keys(pkg.devDependencies)
|
|
107
|
+
],
|
|
108
|
+
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
|
109
|
+
preserveSymlinks: false,
|
|
110
|
+
plugins: [sourcemaps(), nodeResolve()]
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const config = [baseConfig];
|
|
114
|
+
|
|
115
|
+
if (!options.disableBrowserBundle) {
|
|
116
|
+
config.push(makeBrowserTestConfig());
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return config;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export default makeConfig(require("./package.json"));
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as coreClient from "@azure/core-client";
|
|
10
|
+
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
11
|
+
import {
|
|
12
|
+
PipelineRequest,
|
|
13
|
+
PipelineResponse,
|
|
14
|
+
SendRequest
|
|
15
|
+
} from "@azure/core-rest-pipeline";
|
|
16
|
+
import * as coreAuth from "@azure/core-auth";
|
|
17
|
+
import { AzureBareMetalInstancesImpl, OperationsImpl } from "./operations";
|
|
18
|
+
import { AzureBareMetalInstances, Operations } from "./operationsInterfaces";
|
|
19
|
+
import { BareMetalInfrastructureClientOptionalParams } from "./models";
|
|
20
|
+
|
|
21
|
+
export class BareMetalInfrastructureClient extends coreClient.ServiceClient {
|
|
22
|
+
$host: string;
|
|
23
|
+
apiVersion: string;
|
|
24
|
+
subscriptionId: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Initializes a new instance of the BareMetalInfrastructureClient class.
|
|
28
|
+
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
29
|
+
* @param subscriptionId The ID of the target subscription.
|
|
30
|
+
* @param options The parameter options
|
|
31
|
+
*/
|
|
32
|
+
constructor(
|
|
33
|
+
credentials: coreAuth.TokenCredential,
|
|
34
|
+
subscriptionId: string,
|
|
35
|
+
options?: BareMetalInfrastructureClientOptionalParams
|
|
36
|
+
) {
|
|
37
|
+
if (credentials === undefined) {
|
|
38
|
+
throw new Error("'credentials' cannot be null");
|
|
39
|
+
}
|
|
40
|
+
if (subscriptionId === undefined) {
|
|
41
|
+
throw new Error("'subscriptionId' cannot be null");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Initializing default values for options
|
|
45
|
+
if (!options) {
|
|
46
|
+
options = {};
|
|
47
|
+
}
|
|
48
|
+
const defaults: BareMetalInfrastructureClientOptionalParams = {
|
|
49
|
+
requestContentType: "application/json; charset=utf-8",
|
|
50
|
+
credential: credentials
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const packageDetails = `azsdk-js-arm-baremetalinfrastructure/1.0.0-beta.1`;
|
|
54
|
+
const userAgentPrefix =
|
|
55
|
+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
56
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
57
|
+
: `${packageDetails}`;
|
|
58
|
+
|
|
59
|
+
const optionsWithDefaults = {
|
|
60
|
+
...defaults,
|
|
61
|
+
...options,
|
|
62
|
+
userAgentOptions: {
|
|
63
|
+
userAgentPrefix
|
|
64
|
+
},
|
|
65
|
+
endpoint:
|
|
66
|
+
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
67
|
+
};
|
|
68
|
+
super(optionsWithDefaults);
|
|
69
|
+
|
|
70
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
71
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
72
|
+
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
73
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
74
|
+
(pipelinePolicy) =>
|
|
75
|
+
pipelinePolicy.name ===
|
|
76
|
+
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (
|
|
80
|
+
!options ||
|
|
81
|
+
!options.pipeline ||
|
|
82
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
83
|
+
!bearerTokenAuthenticationPolicyFound
|
|
84
|
+
) {
|
|
85
|
+
this.pipeline.removePolicy({
|
|
86
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
87
|
+
});
|
|
88
|
+
this.pipeline.addPolicy(
|
|
89
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
90
|
+
credential: credentials,
|
|
91
|
+
scopes:
|
|
92
|
+
optionsWithDefaults.credentialScopes ??
|
|
93
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
94
|
+
challengeCallbacks: {
|
|
95
|
+
authorizeRequestOnChallenge:
|
|
96
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
// Parameter assignments
|
|
102
|
+
this.subscriptionId = subscriptionId;
|
|
103
|
+
|
|
104
|
+
// Assigning values to Constant parameters
|
|
105
|
+
this.$host = options.$host || "https://management.azure.com";
|
|
106
|
+
this.apiVersion = options.apiVersion || "2021-08-09";
|
|
107
|
+
this.azureBareMetalInstances = new AzureBareMetalInstancesImpl(this);
|
|
108
|
+
this.operations = new OperationsImpl(this);
|
|
109
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
113
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
114
|
+
if (!apiVersion) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const apiVersionPolicy = {
|
|
118
|
+
name: "CustomApiVersionPolicy",
|
|
119
|
+
async sendRequest(
|
|
120
|
+
request: PipelineRequest,
|
|
121
|
+
next: SendRequest
|
|
122
|
+
): Promise<PipelineResponse> {
|
|
123
|
+
const param = request.url.split("?");
|
|
124
|
+
if (param.length > 1) {
|
|
125
|
+
const newParams = param[1].split("&").map((item) => {
|
|
126
|
+
if (item.indexOf("api-version") > -1) {
|
|
127
|
+
return "api-version=" + apiVersion;
|
|
128
|
+
} else {
|
|
129
|
+
return item;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
133
|
+
}
|
|
134
|
+
return next(request);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
azureBareMetalInstances: AzureBareMetalInstances;
|
|
141
|
+
operations: Operations;
|
|
142
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/// <reference lib="esnext.asynciterable" />
|
|
10
|
+
export { getContinuationToken } from "./pagingHelper";
|
|
11
|
+
export * from "./models";
|
|
12
|
+
export { BareMetalInfrastructureClient } from "./bareMetalInfrastructureClient";
|
|
13
|
+
export * from "./operationsInterfaces";
|