@azure/arm-hybridcompute 2.1.1 → 3.0.0

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.
Files changed (247) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +69 -85
  4. package/dist/index.js +3565 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/approveOrRejectAPrivateEndpointConnectionWithAGivenName.d.ts +2 -0
  9. package/dist-esm/samples-dev/approveOrRejectAPrivateEndpointConnectionWithAGivenName.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/approveOrRejectAPrivateEndpointConnectionWithAGivenName.js +40 -0
  11. package/dist-esm/samples-dev/approveOrRejectAPrivateEndpointConnectionWithAGivenName.js.map +1 -0
  12. package/dist-esm/samples-dev/createOrUpdateAMachineExtension.d.ts +2 -0
  13. package/dist-esm/samples-dev/createOrUpdateAMachineExtension.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/createOrUpdateAMachineExtension.js +42 -0
  15. package/dist-esm/samples-dev/createOrUpdateAMachineExtension.js.map +1 -0
  16. package/dist-esm/samples-dev/deleteAMachine.d.ts +2 -0
  17. package/dist-esm/samples-dev/deleteAMachine.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/deleteAMachine.js +31 -0
  19. package/dist-esm/samples-dev/deleteAMachine.js.map +1 -0
  20. package/dist-esm/samples-dev/deleteAMachineExtension.d.ts +2 -0
  21. package/dist-esm/samples-dev/deleteAMachineExtension.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/deleteAMachineExtension.js +32 -0
  23. package/dist-esm/samples-dev/deleteAMachineExtension.js.map +1 -0
  24. package/dist-esm/samples-dev/deletesAPrivateEndpointConnectionWithAGivenName.d.ts +2 -0
  25. package/dist-esm/samples-dev/deletesAPrivateEndpointConnectionWithAGivenName.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/deletesAPrivateEndpointConnectionWithAGivenName.js +32 -0
  27. package/dist-esm/samples-dev/deletesAPrivateEndpointConnectionWithAGivenName.js.map +1 -0
  28. package/dist-esm/samples-dev/getAllMachineExtensions.d.ts +2 -0
  29. package/dist-esm/samples-dev/getAllMachineExtensions.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/getAllMachineExtensions.js +45 -0
  31. package/dist-esm/samples-dev/getAllMachineExtensions.js.map +1 -0
  32. package/dist-esm/samples-dev/getMachine.d.ts +2 -0
  33. package/dist-esm/samples-dev/getMachine.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/getMachine.js +31 -0
  35. package/dist-esm/samples-dev/getMachine.js.map +1 -0
  36. package/dist-esm/samples-dev/getMachineExtension.d.ts +2 -0
  37. package/dist-esm/samples-dev/getMachineExtension.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/getMachineExtension.js +32 -0
  39. package/dist-esm/samples-dev/getMachineExtension.js.map +1 -0
  40. package/dist-esm/samples-dev/getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope.d.ts +2 -0
  41. package/dist-esm/samples-dev/getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope.js +45 -0
  43. package/dist-esm/samples-dev/getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope.js.map +1 -0
  44. package/dist-esm/samples-dev/getsPrivateEndpointConnection.d.ts +2 -0
  45. package/dist-esm/samples-dev/getsPrivateEndpointConnection.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/getsPrivateEndpointConnection.js +32 -0
  47. package/dist-esm/samples-dev/getsPrivateEndpointConnection.js.map +1 -0
  48. package/dist-esm/samples-dev/listMachinesByResourceGroup.d.ts +2 -0
  49. package/dist-esm/samples-dev/listMachinesByResourceGroup.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/listMachinesByResourceGroup.js +43 -0
  51. package/dist-esm/samples-dev/listMachinesByResourceGroup.js.map +1 -0
  52. package/dist-esm/samples-dev/privateLinkScopeCreate.d.ts +2 -0
  53. package/dist-esm/samples-dev/privateLinkScopeCreate.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/privateLinkScopeCreate.js +32 -0
  55. package/dist-esm/samples-dev/privateLinkScopeCreate.js.map +1 -0
  56. package/dist-esm/samples-dev/privateLinkScopeGet.d.ts +2 -0
  57. package/dist-esm/samples-dev/privateLinkScopeGet.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/privateLinkScopeGet.js +31 -0
  59. package/dist-esm/samples-dev/privateLinkScopeGet.js.map +1 -0
  60. package/dist-esm/samples-dev/privateLinkScopeListByResourceGroup.d.ts +2 -0
  61. package/dist-esm/samples-dev/privateLinkScopeListByResourceGroup.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/privateLinkScopeListByResourceGroup.js +44 -0
  63. package/dist-esm/samples-dev/privateLinkScopeListByResourceGroup.js.map +1 -0
  64. package/dist-esm/samples-dev/privateLinkScopeUpdate.d.ts +2 -0
  65. package/dist-esm/samples-dev/privateLinkScopeUpdate.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/privateLinkScopeUpdate.js +35 -0
  67. package/dist-esm/samples-dev/privateLinkScopeUpdate.js.map +1 -0
  68. package/dist-esm/samples-dev/privateLinkScopeUpdateTagsOnly.d.ts +2 -0
  69. package/dist-esm/samples-dev/privateLinkScopeUpdateTagsOnly.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/privateLinkScopeUpdateTagsOnly.js +34 -0
  71. package/dist-esm/samples-dev/privateLinkScopeUpdateTagsOnly.js.map +1 -0
  72. package/dist-esm/samples-dev/privateLinkScopesDelete.d.ts +2 -0
  73. package/dist-esm/samples-dev/privateLinkScopesDelete.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/privateLinkScopesDelete.js +31 -0
  75. package/dist-esm/samples-dev/privateLinkScopesDelete.js.map +1 -0
  76. package/dist-esm/samples-dev/privateLinkScopesListJson.d.ts +2 -0
  77. package/dist-esm/samples-dev/privateLinkScopesListJson.d.ts.map +1 -0
  78. package/dist-esm/samples-dev/privateLinkScopesListJson.js +43 -0
  79. package/dist-esm/samples-dev/privateLinkScopesListJson.js.map +1 -0
  80. package/dist-esm/samples-dev/upgradeMachineExtensions.d.ts +2 -0
  81. package/dist-esm/samples-dev/upgradeMachineExtensions.d.ts.map +1 -0
  82. package/dist-esm/samples-dev/upgradeMachineExtensions.js +37 -0
  83. package/dist-esm/samples-dev/upgradeMachineExtensions.js.map +1 -0
  84. package/dist-esm/src/hybridComputeManagementClient.d.ts +40 -0
  85. package/dist-esm/src/hybridComputeManagementClient.d.ts.map +1 -0
  86. package/dist-esm/src/hybridComputeManagementClient.js +138 -0
  87. package/dist-esm/src/hybridComputeManagementClient.js.map +1 -0
  88. package/dist-esm/src/index.d.ts +5 -0
  89. package/dist-esm/src/index.d.ts.map +1 -0
  90. package/dist-esm/src/index.js +12 -0
  91. package/dist-esm/src/index.js.map +1 -0
  92. package/dist-esm/src/lroImpl.d.ts +16 -0
  93. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  94. package/dist-esm/src/lroImpl.js +29 -0
  95. package/dist-esm/src/lroImpl.js.map +1 -0
  96. package/dist-esm/src/models/index.d.ts +875 -0
  97. package/dist-esm/src/models/index.d.ts.map +1 -0
  98. package/dist-esm/src/models/index.js +43 -0
  99. package/dist-esm/src/models/index.js.map +1 -0
  100. package/dist-esm/src/models/mappers.d.ts +45 -0
  101. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  102. package/{esm → dist-esm/src}/models/mappers.js +829 -555
  103. package/dist-esm/src/models/mappers.js.map +1 -0
  104. package/dist-esm/src/models/parameters.d.ts +25 -0
  105. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  106. package/dist-esm/src/models/parameters.js +219 -0
  107. package/dist-esm/src/models/parameters.js.map +1 -0
  108. package/dist-esm/src/operations/index.d.ts +7 -0
  109. package/dist-esm/src/operations/index.d.ts.map +1 -0
  110. package/dist-esm/src/operations/index.js +14 -0
  111. package/dist-esm/src/operations/index.js.map +1 -0
  112. package/dist-esm/src/operations/machineExtensions.d.ts +99 -0
  113. package/dist-esm/src/operations/machineExtensions.d.ts.map +1 -0
  114. package/dist-esm/src/operations/machineExtensions.js +429 -0
  115. package/dist-esm/src/operations/machineExtensions.js.map +1 -0
  116. package/dist-esm/src/operations/machines.d.ts +71 -0
  117. package/dist-esm/src/operations/machines.d.ts.map +1 -0
  118. package/dist-esm/src/operations/machines.js +294 -0
  119. package/dist-esm/src/operations/machines.js.map +1 -0
  120. package/dist-esm/src/operations/operations.d.ts +26 -0
  121. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  122. package/dist-esm/src/operations/operations.js +90 -0
  123. package/dist-esm/src/operations/operations.js.map +1 -0
  124. package/dist-esm/src/operations/privateEndpointConnections.d.ts +81 -0
  125. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
  126. package/dist-esm/src/operations/privateEndpointConnections.js +337 -0
  127. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
  128. package/dist-esm/src/operations/privateLinkResources.d.ts +46 -0
  129. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
  130. package/dist-esm/src/operations/privateLinkResources.js +169 -0
  131. package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
  132. package/dist-esm/src/operations/privateLinkScopes.d.ts +108 -0
  133. package/dist-esm/src/operations/privateLinkScopes.d.ts.map +1 -0
  134. package/dist-esm/src/operations/privateLinkScopes.js +466 -0
  135. package/dist-esm/src/operations/privateLinkScopes.js.map +1 -0
  136. package/dist-esm/src/operationsInterfaces/index.d.ts +7 -0
  137. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  138. package/dist-esm/src/operationsInterfaces/index.js +14 -0
  139. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  140. package/dist-esm/src/operationsInterfaces/machineExtensions.d.ts +74 -0
  141. package/dist-esm/src/operationsInterfaces/machineExtensions.d.ts.map +1 -0
  142. package/dist-esm/src/operationsInterfaces/machineExtensions.js +9 -0
  143. package/dist-esm/src/operationsInterfaces/machineExtensions.js.map +1 -0
  144. package/dist-esm/src/operationsInterfaces/machines.d.ts +33 -0
  145. package/dist-esm/src/operationsInterfaces/machines.d.ts.map +1 -0
  146. package/dist-esm/src/operationsInterfaces/machines.js +9 -0
  147. package/dist-esm/src/operationsInterfaces/machines.js.map +1 -0
  148. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  149. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  150. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  151. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  152. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +56 -0
  153. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
  154. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
  155. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
  156. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +21 -0
  157. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
  158. package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
  159. package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
  160. package/dist-esm/src/operationsInterfaces/privateLinkScopes.d.ts +72 -0
  161. package/dist-esm/src/operationsInterfaces/privateLinkScopes.d.ts.map +1 -0
  162. package/dist-esm/src/operationsInterfaces/privateLinkScopes.js +9 -0
  163. package/dist-esm/src/operationsInterfaces/privateLinkScopes.js.map +1 -0
  164. package/dist-esm/test/sampleTest.d.ts +2 -0
  165. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  166. package/dist-esm/test/sampleTest.js +40 -0
  167. package/dist-esm/test/sampleTest.js.map +1 -0
  168. package/package.json +80 -33
  169. package/review/arm-hybridcompute.api.md +708 -0
  170. package/rollup.config.js +181 -30
  171. package/src/hybridComputeManagementClient.ts +204 -37
  172. package/src/index.ts +12 -0
  173. package/src/lroImpl.ts +34 -0
  174. package/src/models/index.ts +744 -786
  175. package/src/models/mappers.ts +836 -576
  176. package/src/models/parameters.ts +192 -33
  177. package/src/operations/index.ts +6 -5
  178. package/src/operations/machineExtensions.ts +484 -275
  179. package/src/operations/machines.ts +240 -225
  180. package/src/operations/operations.ts +66 -42
  181. package/src/operations/privateEndpointConnections.ts +483 -0
  182. package/src/operations/privateLinkResources.ts +233 -0
  183. package/src/operations/privateLinkScopes.ts +599 -0
  184. package/{esm/operations/index.js → src/operationsInterfaces/index.ts} +7 -6
  185. package/src/operationsInterfaces/machineExtensions.ts +147 -0
  186. package/src/operationsInterfaces/machines.ts +62 -0
  187. package/src/operationsInterfaces/operations.ts +22 -0
  188. package/src/operationsInterfaces/privateEndpointConnections.ts +109 -0
  189. package/src/operationsInterfaces/privateLinkResources.ts +44 -0
  190. package/src/operationsInterfaces/privateLinkScopes.ts +132 -0
  191. package/tsconfig.json +5 -4
  192. package/types/arm-hybridcompute.d.ts +1280 -0
  193. package/types/tsdoc-metadata.json +11 -0
  194. package/dist/arm-hybridcompute.js +0 -1971
  195. package/dist/arm-hybridcompute.js.map +0 -1
  196. package/dist/arm-hybridcompute.min.js +0 -1
  197. package/dist/arm-hybridcompute.min.js.map +0 -1
  198. package/esm/hybridComputeManagementClient.d.ts +0 -27
  199. package/esm/hybridComputeManagementClient.d.ts.map +0 -1
  200. package/esm/hybridComputeManagementClient.js +0 -41
  201. package/esm/hybridComputeManagementClient.js.map +0 -1
  202. package/esm/hybridComputeManagementClientContext.d.ts +0 -23
  203. package/esm/hybridComputeManagementClientContext.d.ts.map +0 -1
  204. package/esm/hybridComputeManagementClientContext.js +0 -62
  205. package/esm/hybridComputeManagementClientContext.js.map +0 -1
  206. package/esm/models/index.d.ts +0 -971
  207. package/esm/models/index.d.ts.map +0 -1
  208. package/esm/models/index.js +0 -8
  209. package/esm/models/index.js.map +0 -1
  210. package/esm/models/machineExtensionsMappers.d.ts +0 -2
  211. package/esm/models/machineExtensionsMappers.d.ts.map +0 -1
  212. package/esm/models/machineExtensionsMappers.js +0 -9
  213. package/esm/models/machineExtensionsMappers.js.map +0 -1
  214. package/esm/models/machinesMappers.d.ts +0 -2
  215. package/esm/models/machinesMappers.d.ts.map +0 -1
  216. package/esm/models/machinesMappers.js +0 -9
  217. package/esm/models/machinesMappers.js.map +0 -1
  218. package/esm/models/mappers.d.ts +0 -32
  219. package/esm/models/mappers.d.ts.map +0 -1
  220. package/esm/models/mappers.js.map +0 -1
  221. package/esm/models/operationsMappers.d.ts +0 -2
  222. package/esm/models/operationsMappers.d.ts.map +0 -1
  223. package/esm/models/operationsMappers.js +0 -9
  224. package/esm/models/operationsMappers.js.map +0 -1
  225. package/esm/models/parameters.d.ts +0 -10
  226. package/esm/models/parameters.d.ts.map +0 -1
  227. package/esm/models/parameters.js +0 -93
  228. package/esm/models/parameters.js.map +0 -1
  229. package/esm/operations/index.d.ts +0 -4
  230. package/esm/operations/index.d.ts.map +0 -1
  231. package/esm/operations/index.js.map +0 -1
  232. package/esm/operations/machineExtensions.d.ts +0 -135
  233. package/esm/operations/machineExtensions.d.ts.map +0 -1
  234. package/esm/operations/machineExtensions.js +0 -294
  235. package/esm/operations/machineExtensions.js.map +0 -1
  236. package/esm/operations/machines.d.ts +0 -128
  237. package/esm/operations/machines.d.ts.map +0 -1
  238. package/esm/operations/machines.js +0 -197
  239. package/esm/operations/machines.js.map +0 -1
  240. package/esm/operations/operations.d.ts +0 -28
  241. package/esm/operations/operations.d.ts.map +0 -1
  242. package/esm/operations/operations.js +0 -51
  243. package/esm/operations/operations.js.map +0 -1
  244. package/src/hybridComputeManagementClientContext.ts +0 -69
  245. package/src/models/machineExtensionsMappers.ts +0 -31
  246. package/src/models/machinesMappers.ts +0 -28
  247. package/src/models/operationsMappers.ts +0 -14
package/rollup.config.js CHANGED
@@ -1,37 +1,188 @@
1
- import rollup from "rollup";
2
- import nodeResolve from "rollup-plugin-node-resolve";
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";
3
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
4
66
 
5
67
  /**
6
- * @type {rollup.RollupFileOptions}
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.
7
70
  */
8
- const config = {
9
- input: "./esm/hybridComputeManagementClient.js",
10
- external: [
11
- "@azure/ms-rest-js",
12
- "@azure/ms-rest-azure-js"
13
- ],
14
- output: {
15
- file: "./dist/arm-hybridcompute.js",
16
- format: "umd",
17
- name: "Azure.ArmHybridcompute",
18
- sourcemap: true,
19
- globals: {
20
- "@azure/ms-rest-js": "msRest",
21
- "@azure/ms-rest-azure-js": "msRestAzure"
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/**"]
22
113
  },
23
- banner: `/*
24
- * Copyright (c) Microsoft Corporation. All rights reserved.
25
- * Licensed under the MIT License. See License.txt in the project root for license information.
26
- *
27
- * Code generated by Microsoft (R) AutoRest Code Generator.
28
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
29
- */`
30
- },
31
- plugins: [
32
- nodeResolve({ mainFields: ['module', 'main'] }),
33
- sourcemaps()
34
- ]
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
35
158
  };
36
159
 
37
- export default config;
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"));
@@ -1,53 +1,220 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import { TokenCredential } from "@azure/core-auth";
13
- import * as Models from "./models";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
12
+ import { LroImpl } from "./lroImpl";
13
+ import {
14
+ MachinesImpl,
15
+ MachineExtensionsImpl,
16
+ OperationsImpl,
17
+ PrivateLinkScopesImpl,
18
+ PrivateLinkResourcesImpl,
19
+ PrivateEndpointConnectionsImpl
20
+ } from "./operations";
21
+ import {
22
+ Machines,
23
+ MachineExtensions,
24
+ Operations,
25
+ PrivateLinkScopes,
26
+ PrivateLinkResources,
27
+ PrivateEndpointConnections
28
+ } from "./operationsInterfaces";
29
+ import * as Parameters from "./models/parameters";
14
30
  import * as Mappers from "./models/mappers";
15
- import * as operations from "./operations";
16
- import { HybridComputeManagementClientContext } from "./hybridComputeManagementClientContext";
31
+ import {
32
+ HybridComputeManagementClientOptionalParams,
33
+ MachineExtensionUpgrade,
34
+ UpgradeExtensionsOptionalParams
35
+ } from "./models";
17
36
 
18
-
19
- class HybridComputeManagementClient extends HybridComputeManagementClientContext {
20
- // Operation groups
21
- machines: operations.Machines;
22
- machineExtensions: operations.MachineExtensions;
23
- operations: operations.Operations;
37
+ export class HybridComputeManagementClient extends coreClient.ServiceClient {
38
+ $host: string;
39
+ apiVersion: string;
40
+ subscriptionId: string;
24
41
 
25
42
  /**
26
43
  * Initializes a new instance of the HybridComputeManagementClient class.
27
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
28
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
29
- * more information about these credentials, see
30
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
31
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
32
- * @azure/ms-rest-browserauth are also supported.
33
- * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure
34
- * subscription. The subscription ID forms part of the URI for every service call.
35
- * @param [options] The parameter options
44
+ * @param credentials Subscription credentials which uniquely identify client subscription.
45
+ * @param subscriptionId The ID of the target subscription.
46
+ * @param options The parameter options
36
47
  */
37
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.HybridComputeManagementClientOptions) {
38
- super(credentials, subscriptionId, options);
39
- this.machines = new operations.Machines(this);
40
- this.machineExtensions = new operations.MachineExtensions(this);
41
- this.operations = new operations.Operations(this);
48
+ constructor(
49
+ credentials: coreAuth.TokenCredential,
50
+ subscriptionId: string,
51
+ options?: HybridComputeManagementClientOptionalParams
52
+ ) {
53
+ if (credentials === undefined) {
54
+ throw new Error("'credentials' cannot be null");
55
+ }
56
+ if (subscriptionId === undefined) {
57
+ throw new Error("'subscriptionId' cannot be null");
58
+ }
59
+
60
+ // Initializing default values for options
61
+ if (!options) {
62
+ options = {};
63
+ }
64
+ const defaults: HybridComputeManagementClientOptionalParams = {
65
+ requestContentType: "application/json; charset=utf-8",
66
+ credential: credentials
67
+ };
68
+
69
+ const packageDetails = `azsdk-js-arm-hybridcompute/3.0.0`;
70
+ const userAgentPrefix =
71
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
72
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
73
+ : `${packageDetails}`;
74
+
75
+ if (!options.credentialScopes) {
76
+ options.credentialScopes = ["https://management.azure.com/.default"];
77
+ }
78
+ const optionsWithDefaults = {
79
+ ...defaults,
80
+ ...options,
81
+ userAgentOptions: {
82
+ userAgentPrefix
83
+ },
84
+ baseUri: options.endpoint || "https://management.azure.com"
85
+ };
86
+ super(optionsWithDefaults);
87
+ // Parameter assignments
88
+ this.subscriptionId = subscriptionId;
89
+
90
+ // Assigning values to Constant parameters
91
+ this.$host = options.$host || "https://management.azure.com";
92
+ this.apiVersion = options.apiVersion || "2021-05-20";
93
+ this.machines = new MachinesImpl(this);
94
+ this.machineExtensions = new MachineExtensionsImpl(this);
95
+ this.operations = new OperationsImpl(this);
96
+ this.privateLinkScopes = new PrivateLinkScopesImpl(this);
97
+ this.privateLinkResources = new PrivateLinkResourcesImpl(this);
98
+ this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
99
+ }
100
+
101
+ /**
102
+ * The operation to Upgrade Machine Extensions.
103
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
104
+ * @param machineName The name of the hybrid machine.
105
+ * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation.
106
+ * @param options The options parameters.
107
+ */
108
+ async beginUpgradeExtensions(
109
+ resourceGroupName: string,
110
+ machineName: string,
111
+ extensionUpgradeParameters: MachineExtensionUpgrade,
112
+ options?: UpgradeExtensionsOptionalParams
113
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
114
+ const directSendOperation = async (
115
+ args: coreClient.OperationArguments,
116
+ spec: coreClient.OperationSpec
117
+ ): Promise<void> => {
118
+ return this.sendOperationRequest(args, spec);
119
+ };
120
+ const sendOperation = async (
121
+ args: coreClient.OperationArguments,
122
+ spec: coreClient.OperationSpec
123
+ ) => {
124
+ let currentRawResponse:
125
+ | coreClient.FullOperationResponse
126
+ | undefined = undefined;
127
+ const providedCallback = args.options?.onResponse;
128
+ const callback: coreClient.RawResponseCallback = (
129
+ rawResponse: coreClient.FullOperationResponse,
130
+ flatResponse: unknown
131
+ ) => {
132
+ currentRawResponse = rawResponse;
133
+ providedCallback?.(rawResponse, flatResponse);
134
+ };
135
+ const updatedArgs = {
136
+ ...args,
137
+ options: {
138
+ ...args.options,
139
+ onResponse: callback
140
+ }
141
+ };
142
+ const flatResponse = await directSendOperation(updatedArgs, spec);
143
+ return {
144
+ flatResponse,
145
+ rawResponse: {
146
+ statusCode: currentRawResponse!.status,
147
+ body: currentRawResponse!.parsedBody,
148
+ headers: currentRawResponse!.headers.toJSON()
149
+ }
150
+ };
151
+ };
152
+
153
+ const lro = new LroImpl(
154
+ sendOperation,
155
+ { resourceGroupName, machineName, extensionUpgradeParameters, options },
156
+ upgradeExtensionsOperationSpec
157
+ );
158
+ return new LroEngine(lro, {
159
+ resumeFrom: options?.resumeFrom,
160
+ intervalInMs: options?.updateIntervalInMs
161
+ });
162
+ }
163
+
164
+ /**
165
+ * The operation to Upgrade Machine Extensions.
166
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
167
+ * @param machineName The name of the hybrid machine.
168
+ * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation.
169
+ * @param options The options parameters.
170
+ */
171
+ async beginUpgradeExtensionsAndWait(
172
+ resourceGroupName: string,
173
+ machineName: string,
174
+ extensionUpgradeParameters: MachineExtensionUpgrade,
175
+ options?: UpgradeExtensionsOptionalParams
176
+ ): Promise<void> {
177
+ const poller = await this.beginUpgradeExtensions(
178
+ resourceGroupName,
179
+ machineName,
180
+ extensionUpgradeParameters,
181
+ options
182
+ );
183
+ return poller.pollUntilDone();
42
184
  }
43
- }
44
185
 
186
+ machines: Machines;
187
+ machineExtensions: MachineExtensions;
188
+ operations: Operations;
189
+ privateLinkScopes: PrivateLinkScopes;
190
+ privateLinkResources: PrivateLinkResources;
191
+ privateEndpointConnections: PrivateEndpointConnections;
192
+ }
45
193
  // Operation Specifications
194
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
46
195
 
47
- export {
48
- HybridComputeManagementClient,
49
- HybridComputeManagementClientContext,
50
- Models as HybridComputeManagementModels,
51
- Mappers as HybridComputeManagementMappers
196
+ const upgradeExtensionsOperationSpec: coreClient.OperationSpec = {
197
+ path:
198
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions",
199
+ httpMethod: "POST",
200
+ responses: {
201
+ 200: {},
202
+ 201: {},
203
+ 202: {},
204
+ 204: {},
205
+ default: {
206
+ bodyMapper: Mappers.ErrorResponse
207
+ }
208
+ },
209
+ requestBody: Parameters.extensionUpgradeParameters,
210
+ queryParameters: [Parameters.apiVersion],
211
+ urlParameters: [
212
+ Parameters.$host,
213
+ Parameters.subscriptionId,
214
+ Parameters.resourceGroupName,
215
+ Parameters.machineName
216
+ ],
217
+ headerParameters: [Parameters.accept, Parameters.contentType],
218
+ mediaType: "json",
219
+ serializer
52
220
  };
53
- 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 { HybridComputeManagementClient } from "./hybridComputeManagementClient";
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
+ }