@azure/arm-cognitiveservices 6.0.0 → 7.0.0-alpha.20211220.3
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 +11 -0
- package/{LICENSE.txt → LICENSE} +1 -1
- package/README.md +70 -95
- package/dist/index.js +4800 -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/src/cognitiveServicesManagementClient.d.ts +42 -0
- package/dist-esm/src/cognitiveServicesManagementClient.d.ts.map +1 -0
- package/dist-esm/src/cognitiveServicesManagementClient.js +133 -0
- package/dist-esm/src/cognitiveServicesManagementClient.js.map +1 -0
- package/dist-esm/src/index.d.ts +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +1310 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +128 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +68 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +1017 -713
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +26 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +199 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/accounts.d.ts +138 -0
- package/dist-esm/src/operations/accounts.d.ts.map +1 -0
- package/dist-esm/src/operations/accounts.js +628 -0
- package/dist-esm/src/operations/accounts.js.map +1 -0
- package/dist-esm/src/operations/commitmentPlans.d.ts +76 -0
- package/dist-esm/src/operations/commitmentPlans.d.ts.map +1 -0
- package/dist-esm/src/operations/commitmentPlans.js +293 -0
- package/dist-esm/src/operations/commitmentPlans.js.map +1 -0
- package/dist-esm/src/operations/commitmentTiers.d.ts +35 -0
- package/dist-esm/src/operations/commitmentTiers.d.ts.map +1 -0
- package/dist-esm/src/operations/commitmentTiers.js +132 -0
- package/dist-esm/src/operations/commitmentTiers.js.map +1 -0
- package/dist-esm/src/operations/deletedAccounts.d.ts +57 -0
- package/dist-esm/src/operations/deletedAccounts.d.ts.map +1 -0
- package/dist-esm/src/operations/deletedAccounts.js +232 -0
- package/dist-esm/src/operations/deletedAccounts.js.map +1 -0
- package/dist-esm/src/operations/deployments.d.ts +81 -0
- package/dist-esm/src/operations/deployments.d.ts.map +1 -0
- package/dist-esm/src/operations/deployments.js +331 -0
- package/dist-esm/src/operations/deployments.js.map +1 -0
- package/{esm → 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 +17 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +32 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +120 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/privateEndpointConnections.d.ts +70 -0
- package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
- package/dist-esm/src/operations/privateEndpointConnections.js +271 -0
- package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
- package/dist-esm/src/operations/privateLinkResources.d.ts +20 -0
- package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
- package/dist-esm/src/operations/privateLinkResources.js +53 -0
- package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
- package/dist-esm/src/operations/resourceSkus.d.ts +32 -0
- package/dist-esm/src/operations/resourceSkus.d.ts.map +1 -0
- package/dist-esm/src/operations/resourceSkus.js +124 -0
- package/dist-esm/src/operations/resourceSkus.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/accounts.d.ts +102 -0
- package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
- package/{esm/models/index.js → dist-esm/src/operationsInterfaces/accounts.js} +2 -1
- package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts +51 -0
- package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts.map +1 -0
- package/{src/models/operationsMappers.ts → dist-esm/src/operationsInterfaces/commitmentPlans.js} +2 -9
- package/dist-esm/src/operationsInterfaces/commitmentPlans.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentTiers.d.ts +12 -0
- package/dist-esm/src/operationsInterfaces/commitmentTiers.d.ts.map +1 -0
- package/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/commitmentTiers.js} +2 -2
- package/dist-esm/src/operationsInterfaces/commitmentTiers.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/deletedAccounts.d.ts +36 -0
- package/dist-esm/src/operationsInterfaces/deletedAccounts.d.ts.map +1 -0
- package/{src/models/resourceSkusMappers.ts → dist-esm/src/operationsInterfaces/deletedAccounts.js} +2 -10
- package/dist-esm/src/operationsInterfaces/deletedAccounts.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/deployments.d.ts +56 -0
- package/dist-esm/src/operationsInterfaces/deployments.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/deployments.js +9 -0
- package/dist-esm/src/operationsInterfaces/deployments.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +10 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +17 -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/operationsInterfaces/privateEndpointConnections.d.ts +62 -0
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +12 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.js +9 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.js.map +1 -0
- package/dist-esm/test/cognitiveservices_examples.d.ts +4 -0
- package/dist-esm/test/cognitiveservices_examples.d.ts.map +1 -0
- package/dist-esm/test/cognitiveservices_examples.js +127 -0
- package/dist-esm/test/cognitiveservices_examples.js.map +1 -0
- package/package.json +65 -22
- package/review/arm-cognitiveservices.api.md +1150 -0
- package/rollup.config.js +181 -24
- package/src/cognitiveServicesManagementClient.ts +148 -172
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +1122 -1415
- package/src/models/mappers.ts +1161 -835
- package/src/models/parameters.ts +159 -40
- package/src/operations/accounts.ts +587 -574
- package/src/operations/commitmentPlans.ts +394 -0
- package/src/operations/commitmentTiers.ts +158 -0
- package/src/operations/deletedAccounts.ts +197 -185
- package/src/operations/deployments.ts +464 -0
- package/src/operations/index.ts +4 -2
- package/src/operations/operations.ts +85 -85
- package/src/operations/privateEndpointConnections.ts +232 -202
- package/src/operations/privateLinkResources.ts +34 -62
- package/src/operations/resourceSkus.ts +90 -86
- package/src/operationsInterfaces/accounts.ts +195 -0
- package/src/operationsInterfaces/commitmentPlans.ts +93 -0
- package/src/operationsInterfaces/commitmentTiers.ts +24 -0
- package/src/operationsInterfaces/deletedAccounts.ts +68 -0
- package/src/operationsInterfaces/deployments.ts +109 -0
- package/{esm/operations/index.js → src/operationsInterfaces/index.ts} +5 -3
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/privateEndpointConnections.ts +115 -0
- package/src/operationsInterfaces/privateLinkResources.ts +27 -0
- package/src/operationsInterfaces/resourceSkus.ts +22 -0
- package/tsconfig.json +3 -3
- package/types/arm-cognitiveservices.d.ts +1860 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-cognitiveservices.js +0 -3385
- package/dist/arm-cognitiveservices.js.map +0 -1
- package/dist/arm-cognitiveservices.min.js +0 -1
- package/dist/arm-cognitiveservices.min.js.map +0 -1
- package/esm/cognitiveServicesManagementClient.d.ts +0 -77
- package/esm/cognitiveServicesManagementClient.d.ts.map +0 -1
- package/esm/cognitiveServicesManagementClient.js +0 -108
- package/esm/cognitiveServicesManagementClient.js.map +0 -1
- package/esm/cognitiveServicesManagementClientContext.d.ts +0 -22
- package/esm/cognitiveServicesManagementClientContext.d.ts.map +0 -1
- package/esm/cognitiveServicesManagementClientContext.js +0 -61
- package/esm/cognitiveServicesManagementClientContext.js.map +0 -1
- package/esm/models/accountsMappers.d.ts +0 -2
- package/esm/models/accountsMappers.d.ts.map +0 -1
- package/esm/models/accountsMappers.js +0 -9
- package/esm/models/accountsMappers.js.map +0 -1
- package/esm/models/deletedAccountsMappers.d.ts +0 -2
- package/esm/models/deletedAccountsMappers.d.ts.map +0 -1
- package/esm/models/deletedAccountsMappers.js +0 -9
- package/esm/models/deletedAccountsMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -1645
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -58
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/operationsMappers.d.ts +0 -2
- package/esm/models/operationsMappers.d.ts.map +0 -1
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -11
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -115
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/privateEndpointConnectionsMappers.d.ts +0 -2
- package/esm/models/privateEndpointConnectionsMappers.d.ts.map +0 -1
- package/esm/models/privateEndpointConnectionsMappers.js +0 -9
- package/esm/models/privateEndpointConnectionsMappers.js.map +0 -1
- package/esm/models/privateLinkResourcesMappers.d.ts +0 -2
- package/esm/models/privateLinkResourcesMappers.d.ts.map +0 -1
- package/esm/models/privateLinkResourcesMappers.js +0 -9
- package/esm/models/privateLinkResourcesMappers.js.map +0 -1
- package/esm/models/resourceSkusMappers.d.ts +0 -2
- package/esm/models/resourceSkusMappers.d.ts.map +0 -1
- package/esm/models/resourceSkusMappers.js +0 -9
- package/esm/models/resourceSkusMappers.js.map +0 -1
- package/esm/operations/accounts.d.ts +0 -245
- package/esm/operations/accounts.d.ts.map +0 -1
- package/esm/operations/accounts.js +0 -389
- package/esm/operations/accounts.js.map +0 -1
- package/esm/operations/deletedAccounts.d.ts +0 -89
- package/esm/operations/deletedAccounts.d.ts.map +0 -1
- package/esm/operations/deletedAccounts.js +0 -149
- package/esm/operations/deletedAccounts.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -46
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -69
- package/esm/operations/operations.js.map +0 -1
- package/esm/operations/privateEndpointConnections.d.ts +0 -108
- package/esm/operations/privateEndpointConnections.d.ts.map +0 -1
- package/esm/operations/privateEndpointConnections.js +0 -193
- package/esm/operations/privateEndpointConnections.js.map +0 -1
- package/esm/operations/privateLinkResources.d.ts +0 -34
- package/esm/operations/privateLinkResources.d.ts.map +0 -1
- package/esm/operations/privateLinkResources.js +0 -49
- package/esm/operations/privateLinkResources.js.map +0 -1
- package/esm/operations/resourceSkus.d.ts +0 -46
- package/esm/operations/resourceSkus.d.ts.map +0 -1
- package/esm/operations/resourceSkus.js +0 -70
- package/esm/operations/resourceSkus.js.map +0 -1
- package/src/cognitiveServicesManagementClientContext.ts +0 -74
- package/src/models/accountsMappers.ts +0 -51
- package/src/models/deletedAccountsMappers.ts +0 -44
- package/src/models/privateEndpointConnectionsMappers.ts +0 -44
- package/src/models/privateLinkResourcesMappers.ts +0 -44
package/rollup.config.js
CHANGED
|
@@ -1,31 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
import nodeResolve from "rollup-plugin-node-resolve";
|
|
3
|
-
import sourcemaps from "rollup-plugin-sourcemaps";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @type {rollup.RollupFileOptions}
|
|
7
|
-
*/
|
|
8
|
-
const config = {
|
|
9
|
-
input: "./esm/cognitiveServicesManagementClient.js",
|
|
10
|
-
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
|
|
11
|
-
output: {
|
|
12
|
-
file: "./dist/arm-cognitiveservices.js",
|
|
13
|
-
format: "umd",
|
|
14
|
-
name: "Azure.ArmCognitiveservices",
|
|
15
|
-
sourcemap: true,
|
|
16
|
-
globals: {
|
|
17
|
-
"@azure/ms-rest-js": "msRest",
|
|
18
|
-
"@azure/ms-rest-azure-js": "msRestAzure"
|
|
19
|
-
},
|
|
20
|
-
banner: `/*
|
|
1
|
+
/*
|
|
21
2
|
* Copyright (c) Microsoft Corporation.
|
|
22
3
|
* Licensed under the MIT License.
|
|
23
4
|
*
|
|
24
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
25
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
+
/**
|
|
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
|
+
// #region Warning Handler
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A function that can determine whether a rollupwarning should be ignored. If
|
|
69
|
+
* the function returns `true`, then the warning will not be displayed.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
function ignoreNiseSinonEvalWarnings(warning) {
|
|
73
|
+
return (
|
|
74
|
+
warning.code === "EVAL" &&
|
|
75
|
+
warning.id &&
|
|
76
|
+
(warning.id.includes("node_modules/nise") ||
|
|
77
|
+
warning.id.includes("node_modules/sinon")) === true
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function ignoreChaiCircularDependencyWarnings(warning) {
|
|
82
|
+
return (
|
|
83
|
+
warning.code === "CIRCULAR_DEPENDENCY" &&
|
|
84
|
+
warning.importer && warning.importer.includes("node_modules/chai") === true
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const warningInhibitors = [
|
|
89
|
+
ignoreChaiCircularDependencyWarnings,
|
|
90
|
+
ignoreNiseSinonEvalWarnings
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Construct a warning handler for the shared rollup configuration
|
|
95
|
+
* that ignores certain warnings that are not relevant to testing.
|
|
96
|
+
*/
|
|
97
|
+
function makeOnWarnForTesting() {
|
|
98
|
+
return (warning, warn) => {
|
|
99
|
+
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
|
|
100
|
+
if (warningInhibitors.every((inhib) => !inhib(warning))) {
|
|
101
|
+
warn(warning);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// #endregion
|
|
107
|
+
|
|
108
|
+
function makeBrowserTestConfig() {
|
|
109
|
+
const config = {
|
|
110
|
+
input: {
|
|
111
|
+
include: ["dist-esm/test/**/*.spec.js"],
|
|
112
|
+
exclude: ["dist-esm/test/**/node/**"]
|
|
113
|
+
},
|
|
114
|
+
output: {
|
|
115
|
+
file: `dist-test/index.browser.js`,
|
|
116
|
+
format: "umd",
|
|
117
|
+
sourcemap: true
|
|
118
|
+
},
|
|
119
|
+
preserveSymlinks: false,
|
|
120
|
+
plugins: [
|
|
121
|
+
multiEntry({ exports: false }),
|
|
122
|
+
nodeResolve({
|
|
123
|
+
mainFields: ["module", "browser"]
|
|
124
|
+
}),
|
|
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
|
+
}),
|
|
141
|
+
json(),
|
|
142
|
+
sourcemaps()
|
|
143
|
+
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
|
144
|
+
],
|
|
145
|
+
onwarn: makeOnWarnForTesting(),
|
|
146
|
+
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
|
|
147
|
+
// rollup started respecting the "sideEffects" field in package.json. Since
|
|
148
|
+
// our package.json sets "sideEffects=false", this also applies to test
|
|
149
|
+
// code, which causes all tests to be removed by tree-shaking.
|
|
150
|
+
treeshake: false
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return config;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const defaultConfigurationOptions = {
|
|
157
|
+
disableBrowserBundle: false
|
|
29
158
|
};
|
|
30
159
|
|
|
31
|
-
export
|
|
160
|
+
export function makeConfig(pkg, options) {
|
|
161
|
+
options = {
|
|
162
|
+
...defaultConfigurationOptions,
|
|
163
|
+
...(options || {})
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const baseConfig = {
|
|
167
|
+
// Use the package's module field if it has one
|
|
168
|
+
input: pkg["module"] || "dist-esm/src/index.js",
|
|
169
|
+
external: [
|
|
170
|
+
...nodeBuiltins,
|
|
171
|
+
...Object.keys(pkg.dependencies),
|
|
172
|
+
...Object.keys(pkg.devDependencies)
|
|
173
|
+
],
|
|
174
|
+
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
|
175
|
+
preserveSymlinks: false,
|
|
176
|
+
plugins: [sourcemaps(), nodeResolve(), cjs()]
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const config = [baseConfig];
|
|
180
|
+
|
|
181
|
+
if (!options.disableBrowserBundle) {
|
|
182
|
+
config.push(makeBrowserTestConfig());
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return config;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export default makeConfig(require("./package.json"));
|
|
@@ -3,50 +3,108 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
7
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
9
|
+
import * as coreClient from "@azure/core-client";
|
|
10
|
+
import * as coreAuth from "@azure/core-auth";
|
|
11
|
+
import {
|
|
12
|
+
AccountsImpl,
|
|
13
|
+
DeletedAccountsImpl,
|
|
14
|
+
ResourceSkusImpl,
|
|
15
|
+
OperationsImpl,
|
|
16
|
+
CommitmentTiersImpl,
|
|
17
|
+
PrivateEndpointConnectionsImpl,
|
|
18
|
+
PrivateLinkResourcesImpl,
|
|
19
|
+
DeploymentsImpl,
|
|
20
|
+
CommitmentPlansImpl
|
|
21
|
+
} from "./operations";
|
|
22
|
+
import {
|
|
23
|
+
Accounts,
|
|
24
|
+
DeletedAccounts,
|
|
25
|
+
ResourceSkus,
|
|
26
|
+
Operations,
|
|
27
|
+
CommitmentTiers,
|
|
28
|
+
PrivateEndpointConnections,
|
|
29
|
+
PrivateLinkResources,
|
|
30
|
+
Deployments,
|
|
31
|
+
CommitmentPlans
|
|
32
|
+
} from "./operationsInterfaces";
|
|
14
33
|
import * as Parameters from "./models/parameters";
|
|
15
|
-
import * as
|
|
16
|
-
import {
|
|
34
|
+
import * as Mappers from "./models/mappers";
|
|
35
|
+
import {
|
|
36
|
+
CognitiveServicesManagementClientOptionalParams,
|
|
37
|
+
CheckSkuAvailabilityOptionalParams,
|
|
38
|
+
CheckSkuAvailabilityResponse,
|
|
39
|
+
CheckDomainAvailabilityOptionalParams,
|
|
40
|
+
CheckDomainAvailabilityResponse
|
|
41
|
+
} from "./models";
|
|
17
42
|
|
|
18
|
-
class CognitiveServicesManagementClient extends
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
resourceSkus: operations.ResourceSkus;
|
|
23
|
-
operations: operations.Operations;
|
|
24
|
-
privateEndpointConnections: operations.PrivateEndpointConnections;
|
|
25
|
-
privateLinkResources: operations.PrivateLinkResources;
|
|
43
|
+
export class CognitiveServicesManagementClient extends coreClient.ServiceClient {
|
|
44
|
+
$host: string;
|
|
45
|
+
apiVersion: string;
|
|
46
|
+
subscriptionId: string;
|
|
26
47
|
|
|
27
48
|
/**
|
|
28
49
|
* Initializes a new instance of the CognitiveServicesManagementClient class.
|
|
29
|
-
* @param credentials
|
|
30
|
-
* implementing the TokenCredential interface from the @azure/identity package are recommended. For
|
|
31
|
-
* more information about these credentials, see
|
|
32
|
-
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
|
|
33
|
-
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
|
|
34
|
-
* @azure/ms-rest-browserauth are also supported.
|
|
50
|
+
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
35
51
|
* @param subscriptionId The ID of the target subscription.
|
|
36
|
-
* @param
|
|
52
|
+
* @param options The parameter options
|
|
37
53
|
*/
|
|
38
54
|
constructor(
|
|
39
|
-
credentials:
|
|
55
|
+
credentials: coreAuth.TokenCredential,
|
|
40
56
|
subscriptionId: string,
|
|
41
|
-
options?:
|
|
57
|
+
options?: CognitiveServicesManagementClientOptionalParams
|
|
42
58
|
) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
if (credentials === undefined) {
|
|
60
|
+
throw new Error("'credentials' cannot be null");
|
|
61
|
+
}
|
|
62
|
+
if (subscriptionId === undefined) {
|
|
63
|
+
throw new Error("'subscriptionId' cannot be null");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Initializing default values for options
|
|
67
|
+
if (!options) {
|
|
68
|
+
options = {};
|
|
69
|
+
}
|
|
70
|
+
const defaults: CognitiveServicesManagementClientOptionalParams = {
|
|
71
|
+
requestContentType: "application/json; charset=utf-8",
|
|
72
|
+
credential: credentials
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const packageDetails = `azsdk-js-arm-cognitiveservices/7.0.0`;
|
|
76
|
+
const userAgentPrefix =
|
|
77
|
+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
78
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
79
|
+
: `${packageDetails}`;
|
|
80
|
+
|
|
81
|
+
if (!options.credentialScopes) {
|
|
82
|
+
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
83
|
+
}
|
|
84
|
+
const optionsWithDefaults = {
|
|
85
|
+
...defaults,
|
|
86
|
+
...options,
|
|
87
|
+
userAgentOptions: {
|
|
88
|
+
userAgentPrefix
|
|
89
|
+
},
|
|
90
|
+
baseUri: options.endpoint || "https://management.azure.com"
|
|
91
|
+
};
|
|
92
|
+
super(optionsWithDefaults);
|
|
93
|
+
// Parameter assignments
|
|
94
|
+
this.subscriptionId = subscriptionId;
|
|
95
|
+
|
|
96
|
+
// Assigning values to Constant parameters
|
|
97
|
+
this.$host = options.$host || "https://management.azure.com";
|
|
98
|
+
this.apiVersion = options.apiVersion || "2021-10-01";
|
|
99
|
+
this.accounts = new AccountsImpl(this);
|
|
100
|
+
this.deletedAccounts = new DeletedAccountsImpl(this);
|
|
101
|
+
this.resourceSkus = new ResourceSkusImpl(this);
|
|
102
|
+
this.operations = new OperationsImpl(this);
|
|
103
|
+
this.commitmentTiers = new CommitmentTiersImpl(this);
|
|
104
|
+
this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
|
|
105
|
+
this.privateLinkResources = new PrivateLinkResourcesImpl(this);
|
|
106
|
+
this.deployments = new DeploymentsImpl(this);
|
|
107
|
+
this.commitmentPlans = new CommitmentPlansImpl(this);
|
|
50
108
|
}
|
|
51
109
|
|
|
52
110
|
/**
|
|
@@ -54,140 +112,56 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien
|
|
|
54
112
|
* @param location Resource location.
|
|
55
113
|
* @param skus The SKU of the resource.
|
|
56
114
|
* @param kind The Kind of the resource.
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @returns Promise<Models.CheckSkuAvailabilityResponse>
|
|
60
|
-
*/
|
|
61
|
-
checkSkuAvailability(
|
|
62
|
-
location: string,
|
|
63
|
-
skus: string[],
|
|
64
|
-
kind: string,
|
|
65
|
-
type: string,
|
|
66
|
-
options?: msRest.RequestOptionsBase
|
|
67
|
-
): Promise<Models.CheckSkuAvailabilityResponse>;
|
|
68
|
-
/**
|
|
69
|
-
* @param location Resource location.
|
|
70
|
-
* @param skus The SKU of the resource.
|
|
71
|
-
* @param kind The Kind of the resource.
|
|
72
|
-
* @param type The Type of the resource.
|
|
73
|
-
* @param callback The callback
|
|
115
|
+
* @param typeParam The Type of the resource.
|
|
116
|
+
* @param options The options parameters.
|
|
74
117
|
*/
|
|
75
118
|
checkSkuAvailability(
|
|
76
119
|
location: string,
|
|
77
120
|
skus: string[],
|
|
78
121
|
kind: string,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
):
|
|
82
|
-
/**
|
|
83
|
-
* @param location Resource location.
|
|
84
|
-
* @param skus The SKU of the resource.
|
|
85
|
-
* @param kind The Kind of the resource.
|
|
86
|
-
* @param type The Type of the resource.
|
|
87
|
-
* @param options The optional parameters
|
|
88
|
-
* @param callback The callback
|
|
89
|
-
*/
|
|
90
|
-
checkSkuAvailability(
|
|
91
|
-
location: string,
|
|
92
|
-
skus: string[],
|
|
93
|
-
kind: string,
|
|
94
|
-
type: string,
|
|
95
|
-
options: msRest.RequestOptionsBase,
|
|
96
|
-
callback: msRest.ServiceCallback<Models.SkuAvailabilityListResult>
|
|
97
|
-
): void;
|
|
98
|
-
checkSkuAvailability(
|
|
99
|
-
location: string,
|
|
100
|
-
skus: string[],
|
|
101
|
-
kind: string,
|
|
102
|
-
type: string,
|
|
103
|
-
options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SkuAvailabilityListResult>,
|
|
104
|
-
callback?: msRest.ServiceCallback<Models.SkuAvailabilityListResult>
|
|
105
|
-
): Promise<Models.CheckSkuAvailabilityResponse> {
|
|
122
|
+
typeParam: string,
|
|
123
|
+
options?: CheckSkuAvailabilityOptionalParams
|
|
124
|
+
): Promise<CheckSkuAvailabilityResponse> {
|
|
106
125
|
return this.sendOperationRequest(
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
kind,
|
|
111
|
-
type,
|
|
112
|
-
options
|
|
113
|
-
},
|
|
114
|
-
checkSkuAvailabilityOperationSpec,
|
|
115
|
-
callback
|
|
116
|
-
) as Promise<Models.CheckSkuAvailabilityResponse>;
|
|
126
|
+
{ location, skus, kind, typeParam, options },
|
|
127
|
+
checkSkuAvailabilityOperationSpec
|
|
128
|
+
);
|
|
117
129
|
}
|
|
118
130
|
|
|
119
131
|
/**
|
|
120
132
|
* Check whether a domain is available.
|
|
121
133
|
* @param subdomainName The subdomain name to use.
|
|
122
|
-
* @param
|
|
123
|
-
* @param
|
|
124
|
-
* @returns Promise<Models.CheckDomainAvailabilityResponse>
|
|
125
|
-
*/
|
|
126
|
-
checkDomainAvailability(
|
|
127
|
-
subdomainName: string,
|
|
128
|
-
type: string,
|
|
129
|
-
options?: msRest.RequestOptionsBase
|
|
130
|
-
): Promise<Models.CheckDomainAvailabilityResponse>;
|
|
131
|
-
/**
|
|
132
|
-
* @param subdomainName The subdomain name to use.
|
|
133
|
-
* @param type The Type of the resource.
|
|
134
|
-
* @param callback The callback
|
|
134
|
+
* @param typeParam The Type of the resource.
|
|
135
|
+
* @param options The options parameters.
|
|
135
136
|
*/
|
|
136
137
|
checkDomainAvailability(
|
|
137
138
|
subdomainName: string,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
):
|
|
141
|
-
/**
|
|
142
|
-
* @param subdomainName The subdomain name to use.
|
|
143
|
-
* @param type The Type of the resource.
|
|
144
|
-
* @param options The optional parameters
|
|
145
|
-
* @param callback The callback
|
|
146
|
-
*/
|
|
147
|
-
checkDomainAvailability(
|
|
148
|
-
subdomainName: string,
|
|
149
|
-
type: string,
|
|
150
|
-
options: msRest.RequestOptionsBase,
|
|
151
|
-
callback: msRest.ServiceCallback<Models.DomainAvailability>
|
|
152
|
-
): void;
|
|
153
|
-
checkDomainAvailability(
|
|
154
|
-
subdomainName: string,
|
|
155
|
-
type: string,
|
|
156
|
-
options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.DomainAvailability>,
|
|
157
|
-
callback?: msRest.ServiceCallback<Models.DomainAvailability>
|
|
158
|
-
): Promise<Models.CheckDomainAvailabilityResponse> {
|
|
139
|
+
typeParam: string,
|
|
140
|
+
options?: CheckDomainAvailabilityOptionalParams
|
|
141
|
+
): Promise<CheckDomainAvailabilityResponse> {
|
|
159
142
|
return this.sendOperationRequest(
|
|
160
|
-
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
options
|
|
164
|
-
},
|
|
165
|
-
checkDomainAvailabilityOperationSpec,
|
|
166
|
-
callback
|
|
167
|
-
) as Promise<Models.CheckDomainAvailabilityResponse>;
|
|
143
|
+
{ subdomainName, typeParam, options },
|
|
144
|
+
checkDomainAvailabilityOperationSpec
|
|
145
|
+
);
|
|
168
146
|
}
|
|
169
|
-
}
|
|
170
147
|
|
|
148
|
+
accounts: Accounts;
|
|
149
|
+
deletedAccounts: DeletedAccounts;
|
|
150
|
+
resourceSkus: ResourceSkus;
|
|
151
|
+
operations: Operations;
|
|
152
|
+
commitmentTiers: CommitmentTiers;
|
|
153
|
+
privateEndpointConnections: PrivateEndpointConnections;
|
|
154
|
+
privateLinkResources: PrivateLinkResources;
|
|
155
|
+
deployments: Deployments;
|
|
156
|
+
commitmentPlans: CommitmentPlans;
|
|
157
|
+
}
|
|
171
158
|
// Operation Specifications
|
|
172
|
-
const serializer =
|
|
173
|
-
|
|
174
|
-
|
|
159
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
160
|
+
|
|
161
|
+
const checkSkuAvailabilityOperationSpec: coreClient.OperationSpec = {
|
|
175
162
|
path:
|
|
176
|
-
"subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability",
|
|
177
|
-
|
|
178
|
-
queryParameters: [Parameters.apiVersion],
|
|
179
|
-
headerParameters: [Parameters.acceptLanguage],
|
|
180
|
-
requestBody: {
|
|
181
|
-
parameterPath: {
|
|
182
|
-
skus: "skus",
|
|
183
|
-
kind: "kind",
|
|
184
|
-
type: "type"
|
|
185
|
-
},
|
|
186
|
-
mapper: {
|
|
187
|
-
...Mappers.CheckSkuAvailabilityParameter,
|
|
188
|
-
required: true
|
|
189
|
-
}
|
|
190
|
-
},
|
|
163
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability",
|
|
164
|
+
httpMethod: "POST",
|
|
191
165
|
responses: {
|
|
192
166
|
200: {
|
|
193
167
|
bodyMapper: Mappers.SkuAvailabilityListResult
|
|
@@ -196,26 +170,24 @@ const checkSkuAvailabilityOperationSpec: msRest.OperationSpec = {
|
|
|
196
170
|
bodyMapper: Mappers.ErrorResponse
|
|
197
171
|
}
|
|
198
172
|
},
|
|
173
|
+
requestBody: {
|
|
174
|
+
parameterPath: { skus: ["skus"], kind: ["kind"], typeParam: ["typeParam"] },
|
|
175
|
+
mapper: { ...Mappers.CheckSkuAvailabilityParameter, required: true }
|
|
176
|
+
},
|
|
177
|
+
queryParameters: [Parameters.apiVersion],
|
|
178
|
+
urlParameters: [
|
|
179
|
+
Parameters.$host,
|
|
180
|
+
Parameters.subscriptionId,
|
|
181
|
+
Parameters.location
|
|
182
|
+
],
|
|
183
|
+
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
184
|
+
mediaType: "json",
|
|
199
185
|
serializer
|
|
200
186
|
};
|
|
201
|
-
|
|
202
|
-
const checkDomainAvailabilityOperationSpec: msRest.OperationSpec = {
|
|
203
|
-
httpMethod: "POST",
|
|
187
|
+
const checkDomainAvailabilityOperationSpec: coreClient.OperationSpec = {
|
|
204
188
|
path:
|
|
205
|
-
"subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability",
|
|
206
|
-
|
|
207
|
-
queryParameters: [Parameters.apiVersion],
|
|
208
|
-
headerParameters: [Parameters.acceptLanguage],
|
|
209
|
-
requestBody: {
|
|
210
|
-
parameterPath: {
|
|
211
|
-
subdomainName: "subdomainName",
|
|
212
|
-
type: "type"
|
|
213
|
-
},
|
|
214
|
-
mapper: {
|
|
215
|
-
...Mappers.CheckDomainAvailabilityParameter,
|
|
216
|
-
required: true
|
|
217
|
-
}
|
|
218
|
-
},
|
|
189
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability",
|
|
190
|
+
httpMethod: "POST",
|
|
219
191
|
responses: {
|
|
220
192
|
200: {
|
|
221
193
|
bodyMapper: Mappers.DomainAvailability
|
|
@@ -224,13 +196,17 @@ const checkDomainAvailabilityOperationSpec: msRest.OperationSpec = {
|
|
|
224
196
|
bodyMapper: Mappers.ErrorResponse
|
|
225
197
|
}
|
|
226
198
|
},
|
|
199
|
+
requestBody: {
|
|
200
|
+
parameterPath: {
|
|
201
|
+
subdomainName: ["subdomainName"],
|
|
202
|
+
typeParam: ["typeParam"],
|
|
203
|
+
kind: ["options", "kind"]
|
|
204
|
+
},
|
|
205
|
+
mapper: { ...Mappers.CheckDomainAvailabilityParameter, required: true }
|
|
206
|
+
},
|
|
207
|
+
queryParameters: [Parameters.apiVersion],
|
|
208
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
209
|
+
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
210
|
+
mediaType: "json",
|
|
227
211
|
serializer
|
|
228
212
|
};
|
|
229
|
-
|
|
230
|
-
export {
|
|
231
|
-
CognitiveServicesManagementClient,
|
|
232
|
-
CognitiveServicesManagementClientContext,
|
|
233
|
-
Models as CognitiveServicesManagementModels,
|
|
234
|
-
Mappers as CognitiveServicesManagementMappers
|
|
235
|
-
};
|
|
236
|
-
export * from "./operations";
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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 * from "./models";
|
|
11
|
+
export { CognitiveServicesManagementClient } from "./cognitiveServicesManagementClient";
|
|
12
|
+
export * from "./operationsInterfaces";
|
package/src/lroImpl.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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 { LongRunningOperation, LroResponse } from "@azure/core-lro";
|
|
10
|
+
|
|
11
|
+
export class LroImpl<T> implements LongRunningOperation<T> {
|
|
12
|
+
constructor(
|
|
13
|
+
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
|
|
14
|
+
private args: Record<string, unknown>,
|
|
15
|
+
private spec: {
|
|
16
|
+
readonly requestBody?: unknown;
|
|
17
|
+
readonly path?: string;
|
|
18
|
+
readonly httpMethod: string;
|
|
19
|
+
} & Record<string, any>,
|
|
20
|
+
public requestPath: string = spec.path!,
|
|
21
|
+
public requestMethod: string = spec.httpMethod
|
|
22
|
+
) {}
|
|
23
|
+
public async sendInitialRequest(): Promise<LroResponse<T>> {
|
|
24
|
+
return this.sendOperationFn(this.args, this.spec);
|
|
25
|
+
}
|
|
26
|
+
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
|
|
27
|
+
const { requestBody, ...restSpec } = this.spec;
|
|
28
|
+
return this.sendOperationFn(this.args, {
|
|
29
|
+
...restSpec,
|
|
30
|
+
path,
|
|
31
|
+
httpMethod: "GET"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|