@autorest/powershell 4.0.0-dev.8 → 4.0.617

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 (316) hide show
  1. package/.rush/temp/operation/build/state.json +3 -0
  2. package/.rush/temp/package-deps_build.json +106 -103
  3. package/.rush/temp/shrinkwrap-deps.json +182 -234
  4. package/dist/cmdlets/class.d.ts +12 -1
  5. package/dist/cmdlets/class.d.ts.map +1 -1
  6. package/dist/cmdlets/class.js +693 -532
  7. package/dist/cmdlets/class.js.map +1 -1
  8. package/dist/cmdlets/namespace.d.ts.map +1 -1
  9. package/dist/cmdlets/namespace.js +38 -5
  10. package/dist/cmdlets/namespace.js.map +1 -1
  11. package/dist/enums/namespace.js +5 -5
  12. package/dist/enums/namespace.js.map +1 -1
  13. package/dist/generators/psm1.custom.js +2 -2
  14. package/dist/generators/psm1.custom.js.map +1 -1
  15. package/dist/generators/psm1.internal.js +2 -2
  16. package/dist/generators/psm1.internal.js.map +1 -1
  17. package/dist/generators/psm1.js +1 -1
  18. package/dist/generators/psm1.js.map +1 -1
  19. package/dist/generators/script-cmdlet.js +18 -18
  20. package/dist/generators/script-cmdlet.js.map +1 -1
  21. package/dist/internal/name-inferrer.d.ts +1 -1
  22. package/dist/internal/name-inferrer.d.ts.map +1 -1
  23. package/dist/internal/name-inferrer.js +12 -12
  24. package/dist/internal/name-inferrer.js.map +1 -1
  25. package/dist/internal/powershell-declarations.d.ts +2 -0
  26. package/dist/internal/powershell-declarations.d.ts.map +1 -1
  27. package/dist/internal/powershell-declarations.js +4 -2
  28. package/dist/internal/powershell-declarations.js.map +1 -1
  29. package/dist/internal/project.d.ts +3 -5
  30. package/dist/internal/project.d.ts.map +1 -1
  31. package/dist/internal/project.js +14 -18
  32. package/dist/internal/project.js.map +1 -1
  33. package/dist/internal/state.d.ts +1 -1
  34. package/dist/internal/state.d.ts.map +1 -1
  35. package/dist/llcsharp/clientruntime.d.ts +1 -0
  36. package/dist/llcsharp/clientruntime.d.ts.map +1 -1
  37. package/dist/llcsharp/clientruntime.js +12 -11
  38. package/dist/llcsharp/clientruntime.js.map +1 -1
  39. package/dist/llcsharp/code-model.d.ts +7 -7
  40. package/dist/llcsharp/code-model.d.ts.map +1 -1
  41. package/dist/llcsharp/enums/enum.d.ts +1 -1
  42. package/dist/llcsharp/enums/enum.d.ts.map +1 -1
  43. package/dist/llcsharp/enums/enum.js +42 -42
  44. package/dist/llcsharp/enums/enum.js.map +1 -1
  45. package/dist/llcsharp/exports.js +5 -1
  46. package/dist/llcsharp/exports.js.map +1 -1
  47. package/dist/llcsharp/generator.d.ts +1 -1
  48. package/dist/llcsharp/generator.d.ts.map +1 -1
  49. package/dist/llcsharp/model/idictionary.js +16 -16
  50. package/dist/llcsharp/model/idictionary.js.map +1 -1
  51. package/dist/llcsharp/model/interface.d.ts +1 -1
  52. package/dist/llcsharp/model/interface.d.ts.map +1 -1
  53. package/dist/llcsharp/model/interface.js +25 -11
  54. package/dist/llcsharp/model/interface.js.map +1 -1
  55. package/dist/llcsharp/model/model-class-dictionary.js +18 -18
  56. package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
  57. package/dist/llcsharp/model/model-class-json.js +19 -19
  58. package/dist/llcsharp/model/model-class-json.js.map +1 -1
  59. package/dist/llcsharp/model/model-class-serializer.d.ts +1 -1
  60. package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
  61. package/dist/llcsharp/model/model-class-serializer.js +6 -6
  62. package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
  63. package/dist/llcsharp/model/model-class.d.ts +1 -1
  64. package/dist/llcsharp/model/model-class.d.ts.map +1 -1
  65. package/dist/llcsharp/model/model-class.js +97 -89
  66. package/dist/llcsharp/model/model-class.js.map +1 -1
  67. package/dist/llcsharp/model/namespace.d.ts +1 -1
  68. package/dist/llcsharp/model/namespace.d.ts.map +1 -1
  69. package/dist/llcsharp/model/namespace.js +4 -12
  70. package/dist/llcsharp/model/namespace.js.map +1 -1
  71. package/dist/llcsharp/model/property.d.ts +1 -1
  72. package/dist/llcsharp/model/property.d.ts.map +1 -1
  73. package/dist/llcsharp/model/property.js +20 -20
  74. package/dist/llcsharp/model/property.js.map +1 -1
  75. package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
  76. package/dist/llcsharp/operation/api-class.js +26 -1
  77. package/dist/llcsharp/operation/api-class.js.map +1 -1
  78. package/dist/llcsharp/operation/method.d.ts +10 -5
  79. package/dist/llcsharp/operation/method.d.ts.map +1 -1
  80. package/dist/llcsharp/operation/method.js +276 -134
  81. package/dist/llcsharp/operation/method.js.map +1 -1
  82. package/dist/llcsharp/operation/parameter.d.ts +1 -1
  83. package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
  84. package/dist/llcsharp/operation/parameter.js +10 -10
  85. package/dist/llcsharp/operation/parameter.js.map +1 -1
  86. package/dist/llcsharp/project.d.ts +4 -2
  87. package/dist/llcsharp/project.d.ts.map +1 -1
  88. package/dist/llcsharp/project.js +11 -3
  89. package/dist/llcsharp/project.js.map +1 -1
  90. package/dist/llcsharp/schema/Uuid.d.ts +1 -1
  91. package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
  92. package/dist/llcsharp/schema/Uuid.js +2 -2
  93. package/dist/llcsharp/schema/Uuid.js.map +1 -1
  94. package/dist/llcsharp/schema/array.d.ts +1 -1
  95. package/dist/llcsharp/schema/array.d.ts.map +1 -1
  96. package/dist/llcsharp/schema/array.js +45 -43
  97. package/dist/llcsharp/schema/array.js.map +1 -1
  98. package/dist/llcsharp/schema/binary.d.ts +1 -1
  99. package/dist/llcsharp/schema/binary.d.ts.map +1 -1
  100. package/dist/llcsharp/schema/binary.js +9 -9
  101. package/dist/llcsharp/schema/binary.js.map +1 -1
  102. package/dist/llcsharp/schema/boolean.d.ts +1 -1
  103. package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
  104. package/dist/llcsharp/schema/byte-array.d.ts +1 -1
  105. package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
  106. package/dist/llcsharp/schema/byte-array.js +24 -24
  107. package/dist/llcsharp/schema/byte-array.js.map +1 -1
  108. package/dist/llcsharp/schema/char.d.ts +1 -1
  109. package/dist/llcsharp/schema/char.d.ts.map +1 -1
  110. package/dist/llcsharp/schema/char.js +1 -1
  111. package/dist/llcsharp/schema/char.js.map +1 -1
  112. package/dist/llcsharp/schema/date-time.d.ts +1 -1
  113. package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
  114. package/dist/llcsharp/schema/date-time.js +45 -41
  115. package/dist/llcsharp/schema/date-time.js.map +1 -1
  116. package/dist/llcsharp/schema/date.d.ts +1 -1
  117. package/dist/llcsharp/schema/date.d.ts.map +1 -1
  118. package/dist/llcsharp/schema/duration.d.ts +1 -1
  119. package/dist/llcsharp/schema/duration.d.ts.map +1 -1
  120. package/dist/llcsharp/schema/duration.js +9 -7
  121. package/dist/llcsharp/schema/duration.js.map +1 -1
  122. package/dist/llcsharp/schema/enum.d.ts +6 -2
  123. package/dist/llcsharp/schema/enum.d.ts.map +1 -1
  124. package/dist/llcsharp/schema/enum.js +13 -4
  125. package/dist/llcsharp/schema/enum.js.map +1 -1
  126. package/dist/llcsharp/schema/extended-type-declaration.d.ts +1 -1
  127. package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
  128. package/dist/llcsharp/schema/fixed-array.d.ts +1 -1
  129. package/dist/llcsharp/schema/fixed-array.d.ts.map +1 -1
  130. package/dist/llcsharp/schema/fixed-array.js +44 -42
  131. package/dist/llcsharp/schema/fixed-array.js.map +1 -1
  132. package/dist/llcsharp/schema/integer.d.ts +1 -1
  133. package/dist/llcsharp/schema/integer.d.ts.map +1 -1
  134. package/dist/llcsharp/schema/integer.js +5 -5
  135. package/dist/llcsharp/schema/integer.js.map +1 -1
  136. package/dist/llcsharp/schema/object.d.ts +1 -1
  137. package/dist/llcsharp/schema/object.d.ts.map +1 -1
  138. package/dist/llcsharp/schema/object.js +28 -28
  139. package/dist/llcsharp/schema/object.js.map +1 -1
  140. package/dist/llcsharp/schema/password.d.ts +1 -1
  141. package/dist/llcsharp/schema/password.d.ts.map +1 -1
  142. package/dist/llcsharp/schema/password.js +13 -13
  143. package/dist/llcsharp/schema/password.js.map +1 -1
  144. package/dist/llcsharp/schema/primitive.d.ts +1 -1
  145. package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
  146. package/dist/llcsharp/schema/primitive.js +40 -37
  147. package/dist/llcsharp/schema/primitive.js.map +1 -1
  148. package/dist/llcsharp/schema/schema-resolver.d.ts +1 -1
  149. package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
  150. package/dist/llcsharp/schema/schema-resolver.js +4 -9
  151. package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
  152. package/dist/llcsharp/schema/string.d.ts +1 -1
  153. package/dist/llcsharp/schema/string.d.ts.map +1 -1
  154. package/dist/llcsharp/schema/string.js +48 -44
  155. package/dist/llcsharp/schema/string.js.map +1 -1
  156. package/dist/llcsharp/schema/uri.d.ts +1 -1
  157. package/dist/llcsharp/schema/uri.d.ts.map +1 -1
  158. package/dist/llcsharp/schema/uri.js +2 -2
  159. package/dist/llcsharp/schema/uri.js.map +1 -1
  160. package/dist/llcsharp/validations.js +2 -2
  161. package/dist/llcsharp/validations.js.map +1 -1
  162. package/dist/main.js +2 -2
  163. package/dist/main.js.map +1 -1
  164. package/dist/models/model-extensions.d.ts +1 -1
  165. package/dist/models/model-extensions.d.ts.map +1 -1
  166. package/dist/models/model-extensions.js +39 -39
  167. package/dist/models/model-extensions.js.map +1 -1
  168. package/dist/module/module-class.js +8 -8
  169. package/dist/module/module-class.js.map +1 -1
  170. package/dist/module/module-namespace.js +3 -3
  171. package/dist/module/module-namespace.js.map +1 -1
  172. package/dist/plugins/add-azure-completers-v2.d.ts +1 -1
  173. package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -1
  174. package/dist/plugins/add-azure-completers-v2.js +3 -3
  175. package/dist/plugins/add-azure-completers-v2.js.map +1 -1
  176. package/dist/plugins/create-commands-v2.d.ts +9 -7
  177. package/dist/plugins/create-commands-v2.d.ts.map +1 -1
  178. package/dist/plugins/create-commands-v2.js +233 -62
  179. package/dist/plugins/create-commands-v2.js.map +1 -1
  180. package/dist/plugins/cs-namer-v2.d.ts +1 -1
  181. package/dist/plugins/cs-namer-v2.d.ts.map +1 -1
  182. package/dist/plugins/cs-namer-v2.js +40 -40
  183. package/dist/plugins/cs-namer-v2.js.map +1 -1
  184. package/dist/plugins/llcsharp-v2.d.ts +1 -1
  185. package/dist/plugins/llcsharp-v2.d.ts.map +1 -1
  186. package/dist/plugins/llcsharp-v2.js +12 -7
  187. package/dist/plugins/llcsharp-v2.js.map +1 -1
  188. package/dist/plugins/modifiers-v2.d.ts +1 -1
  189. package/dist/plugins/modifiers-v2.d.ts.map +1 -1
  190. package/dist/plugins/modifiers-v2.js +109 -78
  191. package/dist/plugins/modifiers-v2.js.map +1 -1
  192. package/dist/plugins/plugin-create-inline-properties.d.ts +1 -1
  193. package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
  194. package/dist/plugins/plugin-create-inline-properties.js +42 -31
  195. package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
  196. package/dist/plugins/plugin-tweak-m4-model.d.ts +1 -1
  197. package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -1
  198. package/dist/plugins/plugin-tweak-m4-model.js +19 -7
  199. package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
  200. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +1 -1
  201. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -1
  202. package/dist/plugins/plugin-tweak-model-azure-v2.js +17 -17
  203. package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
  204. package/dist/plugins/plugin-tweak-model.d.ts +1 -1
  205. package/dist/plugins/plugin-tweak-model.d.ts.map +1 -1
  206. package/dist/plugins/plugin-tweak-model.js +31 -31
  207. package/dist/plugins/plugin-tweak-model.js.map +1 -1
  208. package/dist/plugins/powershell-v2.d.ts +1 -1
  209. package/dist/plugins/powershell-v2.d.ts.map +1 -1
  210. package/dist/plugins/powershell-v2.js +26 -26
  211. package/dist/plugins/powershell-v2.js.map +1 -1
  212. package/dist/plugins/ps-namer-v2.d.ts +1 -1
  213. package/dist/plugins/ps-namer-v2.d.ts.map +1 -1
  214. package/dist/plugins/ps-namer-v2.js +31 -31
  215. package/dist/plugins/ps-namer-v2.js.map +1 -1
  216. package/dist/plugins/sdk-create-inline-properties.d.ts +1 -1
  217. package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -1
  218. package/dist/plugins/sdk-create-inline-properties.js +37 -37
  219. package/dist/plugins/sdk-create-inline-properties.js.map +1 -1
  220. package/dist/plugins/sdk-cs-namer.d.ts +1 -1
  221. package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
  222. package/dist/plugins/sdk-cs-namer.js +21 -21
  223. package/dist/plugins/sdk-cs-namer.js.map +1 -1
  224. package/dist/plugins/sdk-cs-simplifier.d.ts +1 -1
  225. package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -1
  226. package/dist/plugins/sdk-cs-simplifier.js +3 -3
  227. package/dist/plugins/sdk-cs-simplifier.js.map +1 -1
  228. package/dist/plugins/sdk-generate.d.ts +1 -1
  229. package/dist/plugins/sdk-generate.d.ts.map +1 -1
  230. package/dist/plugins/sdk-generate.js +14 -14
  231. package/dist/plugins/sdk-generate.js.map +1 -1
  232. package/dist/plugins/sdk-tweak-model.d.ts +1 -1
  233. package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
  234. package/dist/plugins/sdk-tweak-model.js +23 -23
  235. package/dist/plugins/sdk-tweak-model.js.map +1 -1
  236. package/dist/sdk/project.d.ts +2 -2
  237. package/dist/sdk/project.d.ts.map +1 -1
  238. package/dist/sdk/project.js +8 -8
  239. package/dist/sdk/project.js.map +1 -1
  240. package/dist/sdk/state.d.ts +2 -2
  241. package/dist/sdk/state.d.ts.map +1 -1
  242. package/dist/sdk/utility.d.ts +1 -1
  243. package/dist/sdk/utility.d.ts.map +1 -1
  244. package/dist/sdk/utility.js +17 -16
  245. package/dist/sdk/utility.js.map +1 -1
  246. package/dist/utils/PwshModel.d.ts +1 -1
  247. package/dist/utils/PwshModel.d.ts.map +1 -1
  248. package/dist/utils/PwshModel.js +1 -1
  249. package/dist/utils/PwshModel.js.map +1 -1
  250. package/dist/utils/SdkModel.d.ts +1 -1
  251. package/dist/utils/SdkModel.d.ts.map +1 -1
  252. package/dist/utils/SdkModel.js +1 -1
  253. package/dist/utils/SdkModel.js.map +1 -1
  254. package/dist/utils/command-operation.d.ts +9 -3
  255. package/dist/utils/command-operation.d.ts.map +1 -1
  256. package/dist/utils/command-operation.js +24 -4
  257. package/dist/utils/command-operation.js.map +1 -1
  258. package/dist/utils/components.d.ts +1 -1
  259. package/dist/utils/components.d.ts.map +1 -1
  260. package/dist/utils/components.js +2 -2
  261. package/dist/utils/components.js.map +1 -1
  262. package/dist/utils/http-operation.d.ts +2 -0
  263. package/dist/utils/http-operation.d.ts.map +1 -1
  264. package/dist/utils/http-operation.js +16 -12
  265. package/dist/utils/http-operation.js.map +1 -1
  266. package/dist/utils/model-state.d.ts +1 -1
  267. package/dist/utils/model-state.d.ts.map +1 -1
  268. package/dist/utils/model-state.js +20 -20
  269. package/dist/utils/model-state.js.map +1 -1
  270. package/dist/utils/programatic-operation.d.ts +1 -1
  271. package/dist/utils/programatic-operation.d.ts.map +1 -1
  272. package/dist/utils/programatic-operation.js +1 -1
  273. package/dist/utils/programatic-operation.js.map +1 -1
  274. package/dist/utils/resolve-conflicts.js +8 -8
  275. package/dist/utils/resolve-conflicts.js.map +1 -1
  276. package/dist/utils/resourceName.d.ts +3 -0
  277. package/dist/utils/resourceName.d.ts.map +1 -0
  278. package/dist/utils/resourceName.js +29 -0
  279. package/dist/utils/resourceName.js.map +1 -0
  280. package/dist/utils/schema.d.ts +1 -1
  281. package/dist/utils/schema.d.ts.map +1 -1
  282. package/dist/utils/schema.js +11 -11
  283. package/dist/utils/schema.js.map +1 -1
  284. package/dist/utils/security-scheme.d.ts +2 -2
  285. package/dist/utils/security-scheme.d.ts.map +1 -1
  286. package/dist/utils/security-scheme.js +2 -2
  287. package/dist/utils/security-scheme.js.map +1 -1
  288. package/dist/utils/sort-parameters.d.ts +3 -0
  289. package/dist/utils/sort-parameters.d.ts.map +1 -0
  290. package/dist/utils/sort-parameters.js +33 -0
  291. package/dist/utils/sort-parameters.js.map +1 -0
  292. package/package.json +7 -7
  293. package/resources/assets/build-module.ps1 +9 -4
  294. package/resources/assets/check-dependencies.ps1 +3 -3
  295. package/resources/assets/create-model-cmdlets.ps1 +33 -5
  296. package/resources/assets/export-surface.ps1 +3 -3
  297. package/resources/assets/generate-help.ps1 +5 -5
  298. package/resources/assets/generate-portal-ux.ps1 +3 -3
  299. package/resources/assets/run-module.ps1 +4 -4
  300. package/resources/assets/test-module.ps1 +5 -5
  301. package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +2 -2
  302. package/resources/psruntime/Attributes/PSArgumentCompleterAttribute.cs +52 -0
  303. package/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +4 -1
  304. package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +4 -1
  305. package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +6 -4
  306. package/resources/psruntime/BuildTime/MarkdownRenderer.cs +16 -8
  307. package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +20 -3
  308. package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +28 -2
  309. package/resources/psruntime/BuildTime/PsAttributes.cs +5 -0
  310. package/resources/psruntime/BuildTime/PsHelpers.cs +4 -3
  311. package/resources/psruntime/MessageAttribute.cs +23 -52
  312. package/resources/psruntime/MessageAttributeHelper.cs +5 -1
  313. package/resources/psruntime/Properties/Resources.Designer.cs +15 -2
  314. package/resources/psruntime/Properties/Resources.resx +4 -1
  315. package/resources/runtime/csharp/pipeline/ISendAsync.cs +113 -0
  316. package/resources/runtime/csharp/pipeline/PipelineMocking.cs +1 -1
@@ -5,9 +5,10 @@
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.applyModifiersV2 = void 0;
8
- const autorest_extension_base_1 = require("@azure-tools/autorest-extension-base");
8
+ const extension_base_1 = require("@autorest/extension-base");
9
9
  const codegen_1 = require("@azure-tools/codegen");
10
10
  const linq_1 = require("@azure-tools/linq");
11
+ const command_operation_1 = require("../utils/command-operation");
11
12
  // import { CommandOperation } from '@azure-tools/codemodel-v3/dist/code-model/command-operation';
12
13
  const model_state_1 = require("../utils/model-state");
13
14
  const resolve_conflicts_1 = require("../utils/resolve-conflicts");
@@ -17,7 +18,7 @@ function hasSpecialChars(str) {
17
18
  }
18
19
  function addParameters(operations, parameters) {
19
20
  var _a;
20
- for (const parameter of linq_1.values(parameters)) {
21
+ for (const parameter of (0, linq_1.values)(parameters)) {
21
22
  const vp = {};
22
23
  vp.name = parameter.name;
23
24
  vp.description = parameter.description;
@@ -37,7 +38,7 @@ function addParameters(operations, parameters) {
37
38
  }
38
39
  vp.required = !!parameter.required;
39
40
  vp.type = parameter.type;
40
- for (const operation of linq_1.values(operations)) {
41
+ for (const operation of (0, linq_1.values)(operations)) {
41
42
  (_a = operation.details.csharp.virtualParameters) === null || _a === void 0 ? void 0 : _a.operation.push(vp);
42
43
  //operation.details.csharp.virtualParameters?.operation
43
44
  }
@@ -45,11 +46,11 @@ function addParameters(operations, parameters) {
45
46
  }
46
47
  async function addInputPipelines(state, operations, pipeline) {
47
48
  const inputHandlers = await state.getValue('input-handlers', []);
48
- for (const handler of linq_1.values(pipeline)) {
49
+ for (const handler of (0, linq_1.values)(pipeline)) {
49
50
  if (!inputHandlers.includes(handler.name)) {
50
51
  inputHandlers.push(handler.name);
51
52
  }
52
- for (const operation of linq_1.values(operations)) {
53
+ for (const operation of (0, linq_1.values)(operations)) {
53
54
  operation.extensions.inputPipe = (operation.extensions.inputPipe || []);
54
55
  operation.extensions.inputPipe.push(handler);
55
56
  }
@@ -63,7 +64,7 @@ async function addPipelines(state, operations, pipelines) {
63
64
  }
64
65
  function getFilterError(whereObject, prohibitedFilters, selectionType) {
65
66
  let error = '';
66
- for (const each of linq_1.values(prohibitedFilters)) {
67
+ for (const each of (0, linq_1.values)(prohibitedFilters)) {
67
68
  if (whereObject[each] !== undefined) {
68
69
  error += `Can't filter by ${each} when selecting command. `;
69
70
  }
@@ -72,7 +73,7 @@ function getFilterError(whereObject, prohibitedFilters, selectionType) {
72
73
  }
73
74
  function getSetError(setObject, prohibitedSetters, selectionType) {
74
75
  let error = '';
75
- for (const each of linq_1.values(prohibitedSetters)) {
76
+ for (const each of (0, linq_1.values)(prohibitedSetters)) {
76
77
  if (setObject[each] !== undefined) {
77
78
  error += `Can't set ${each} when a ${selectionType} is selected. `;
78
79
  }
@@ -114,7 +115,7 @@ function isWhereModelDirective(it) {
114
115
  if (where && set && (where['model-name'] || where['model-fullname'] || where['model-namespace'] || where['property-name'] || directive.select === 'model')) {
115
116
  const prohibitedFilters = ['enum-name', 'enum-value-name', 'subject', 'subject-prefix', 'verb', 'variant', 'parameter-name'];
116
117
  let error = getFilterError(where, prohibitedFilters, 'enum');
117
- const prohibitedSetters = ['enum-name', 'enum-value-name', 'subject', 'subject-prefix', 'verb', 'variant', 'parameter-name', 'parameter-description', 'completer', 'default'];
118
+ const prohibitedSetters = ['enum-name', 'enum-value-name', 'subject', 'subject-prefix', 'verb', 'variant', 'parameter-name', 'parameter-description', 'command-description', 'completer', 'default'];
118
119
  error += getSetError(set, prohibitedSetters, 'enum');
119
120
  const modelSelectNameConflict = [];
120
121
  let modelSelectNameType = '';
@@ -145,7 +146,7 @@ function isWhereModelDirective(it) {
145
146
  modelSelectNameConflict.push('model-name');
146
147
  }
147
148
  }
148
- if (linq_1.length(modelSelectNameConflict) > 0) {
149
+ if ((0, linq_1.length)(modelSelectNameConflict) > 0) {
149
150
  error += `Can't select ${modelSelectNameType} and ${modelSelectNameConflict} at the same time`;
150
151
  }
151
152
  if (error) {
@@ -162,7 +163,7 @@ function isWhereEnumDirective(it) {
162
163
  if (where && set && (where['enum-name'] || where['enum-value-name'] || directive.select === 'enum')) {
163
164
  const prohibitedFilters = ['model-name', 'property-name', 'subject', 'subject-prefix', 'verb', 'variant', 'parameter-name'];
164
165
  let error = getFilterError(where, prohibitedFilters, 'enum');
165
- const prohibitedSetters = ['model-name', 'property-name', 'subject', 'subject-prefix', 'verb', 'variant', 'parameter-name', 'parameter-description', 'completer', 'default'];
166
+ const prohibitedSetters = ['model-name', 'property-name', 'subject', 'subject-prefix', 'verb', 'variant', 'parameter-name', 'parameter-description', 'command-description', 'completer', 'default'];
166
167
  error += getSetError(set, prohibitedSetters, 'enum');
167
168
  if (error) {
168
169
  throw Error(`Incorrect Directive: ${JSON.stringify(it, null, 2)}. Reason: ${error}.`);
@@ -173,6 +174,25 @@ function isWhereEnumDirective(it) {
173
174
  }
174
175
  async function tweakModel(state) {
175
176
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
177
+ const isAzure = await state.getValue('azure', false) || await state.getValue('azure-arm', false);
178
+ const removePecAndPlr = !await state.getValue('keep-pec-and-plr', isAzure ? false : true);
179
+ if (removePecAndPlr) {
180
+ const PecOrPlrRegex = '^PrivateEndpointConnection$|^PrivateLinkResource$';
181
+ let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
182
+ .select(operation => operation.key)
183
+ .toArray());
184
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
185
+ .where(operation => !!`${operation.value.details.csharp.subject}`.match(PecOrPlrRegex) && operationsToRemoveKeys.has(operation.key))
186
+ .select(operation => operation.key)
187
+ .toArray());
188
+ for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
189
+ const operationInfo = state.model.commands.operations[key].details.csharp;
190
+ state.message({
191
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
192
+ });
193
+ delete state.model.commands.operations[key];
194
+ }
195
+ }
176
196
  // only look at directives without the `transform` node.
177
197
  // dolauli for directives with transform are implemented in autorest core
178
198
  for (const directive of directives.filter(each => !each.transform)) {
@@ -187,6 +207,7 @@ async function tweakModel(state) {
187
207
  const verbRegex = getPatternToMatch(directive.where.verb);
188
208
  const variantRegex = getPatternToMatch(directive.where.variant);
189
209
  const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
210
+ const SupportsShouldProcess = (directive.set !== undefined) ? directive.set['suppress-should-process'] : undefined;
190
211
  const alias = (directive.set !== undefined) ?
191
212
  (directive.set.alias !== undefined) ?
192
213
  !Array.isArray(directive.set.alias) ?
@@ -202,34 +223,35 @@ async function tweakModel(state) {
202
223
  const variantReplacer = (directive.set !== undefined) ? directive.set.variant : undefined;
203
224
  const parameterReplacer = (directive.set !== undefined) ? directive.set['parameter-name'] : undefined;
204
225
  const paramDescriptionReplacer = (directive.set !== undefined) ? directive.set['parameter-description'] : undefined;
226
+ const commandDescriptionReplacer = (directive.set !== undefined) ? directive.set['command-description'] : undefined;
205
227
  const paramCompleterReplacer = (directive.set !== undefined) ? directive.set['completer'] : undefined;
206
228
  const paramDefaultReplacer = (directive.set !== undefined) ? directive.set['default'] : undefined;
207
229
  const cliensidePagination = (directive.set !== undefined) ? directive.set['clientside-pagination'] : undefined;
208
230
  // select all operations
209
- let operations = linq_1.values(state.model.commands.operations).toArray();
231
+ let operations = (0, linq_1.values)(state.model.commands.operations).toArray();
210
232
  if (subjectRegex) {
211
- operations = linq_1.values(operations)
233
+ operations = (0, linq_1.values)(operations)
212
234
  .where(operation => !!`${operation.details.csharp.subject}`.match(subjectRegex))
213
235
  .toArray();
214
236
  }
215
237
  if (subjectPrefixRegex) {
216
- operations = linq_1.values(operations)
238
+ operations = (0, linq_1.values)(operations)
217
239
  .where(operation => !!`${operation.details.csharp.subjectPrefix}`.match(subjectPrefixRegex))
218
240
  .toArray();
219
241
  }
220
242
  if (verbRegex) {
221
- operations = linq_1.values(operations)
243
+ operations = (0, linq_1.values)(operations)
222
244
  .where(operation => !!`${operation.details.csharp.verb}`.match(verbRegex))
223
245
  .toArray();
224
246
  }
225
247
  if (variantRegex) {
226
- operations = linq_1.values(operations)
248
+ operations = (0, linq_1.values)(operations)
227
249
  .where(operation => !!`${operation.details.csharp.name}`.match(variantRegex))
228
250
  .toArray();
229
251
  }
230
252
  if (parameterRegex && selectType === 'command') {
231
- operations = linq_1.values(operations)
232
- .where(operation => linq_1.values(resolve_conflicts_1.allVirtualParameters(operation.details.csharp.virtualParameters))
253
+ operations = (0, linq_1.values)(operations)
254
+ .where(operation => (0, linq_1.values)((0, resolve_conflicts_1.allVirtualParameters)(operation.details.csharp.virtualParameters))
233
255
  .any(parameter => !!`${parameter.name}`.match(parameterRegex)))
234
256
  .toArray();
235
257
  }
@@ -242,11 +264,11 @@ async function tweakModel(state) {
242
264
  await addPipelines(state, operations, directive.add.pipelines);
243
265
  }
244
266
  if (parameterRegex && (selectType === undefined || selectType === 'parameter')) {
245
- const parameters = linq_1.values(operations)
246
- .selectMany(operation => resolve_conflicts_1.allVirtualParameters(operation.details.csharp.virtualParameters))
267
+ const parameters = (0, linq_1.values)(operations)
268
+ .selectMany(operation => (0, resolve_conflicts_1.allVirtualParameters)(operation.details.csharp.virtualParameters))
247
269
  .where(parameter => !!`${parameter.name}`.match(parameterRegex))
248
270
  .toArray();
249
- for (const p of linq_1.values(parameters)) {
271
+ for (const p of (0, linq_1.values)(parameters)) {
250
272
  const parameter = p;
251
273
  const prevName = parameter.name;
252
274
  parameter.name = parameterReplacer ? parameterRegex ? parameter.name.replace(parameterRegex, parameterReplacer) : parameterReplacer : parameter.name;
@@ -262,6 +284,7 @@ async function tweakModel(state) {
262
284
  parameter.breakingChange.oldParamaterType = (breakingChange && breakingChange['old-parameter-type']) ? breakingChange['old-parameter-type'] : undefined;
263
285
  parameter.breakingChange.newParameterType = (breakingChange && breakingChange['new-parameter-type']) ? breakingChange['new-parameter-type'] : undefined;
264
286
  parameter.breakingChange.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
287
+ parameter.breakingChange.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
265
288
  parameter.breakingChange.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
266
289
  parameter.breakingChange.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
267
290
  }
@@ -270,7 +293,7 @@ async function tweakModel(state) {
270
293
  if (clearAlias) {
271
294
  parameter.alias = [];
272
295
  state.message({
273
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from parameter ${parameter.name}.`
296
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from parameter ${parameter.name}.`
274
297
  });
275
298
  }
276
299
  // handle hiding parameters
@@ -282,34 +305,38 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
282
305
  p.required = false;
283
306
  p.hidden = true;
284
307
  state.message({
285
- Channel: autorest_extension_base_1.Channel.Debug,
308
+ Channel: extension_base_1.Channel.Debug,
286
309
  Text: `[DIRECTIVE] Hide parameter ${p.name}.`,
287
310
  });
288
311
  }
289
312
  if (alias) {
290
313
  const parsedAlias = new Array();
291
- for (const each of linq_1.values(alias)) {
314
+ for (const each of (0, linq_1.values)(alias)) {
292
315
  parsedAlias.push(hasSpecialChars(each) ? prevName.replace(parameterRegex, each) : each);
293
316
  }
294
- parameter.alias = [...new Set(linq_1.values(parameter.alias, parsedAlias).toArray())];
317
+ parameter.alias = [...new Set((0, linq_1.values)(parameter.alias, parsedAlias).toArray())];
295
318
  state.message({
296
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to parameter ${parameter.name}.`
319
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to parameter ${parameter.name}.`
297
320
  });
298
321
  }
299
322
  if (parameterReplacer) {
300
323
  state.message({
301
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed parameter-name from ${prevName} to ${parameter.name}.`
324
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed parameter-name from ${prevName} to ${parameter.name}.`
302
325
  });
303
326
  }
304
327
  if (paramDescriptionReplacer) {
305
328
  state.message({
306
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Set parameter-description from parameter ${parameter.name}.`
329
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Set parameter-description from parameter ${parameter.name}.`
307
330
  });
308
331
  }
309
332
  }
310
333
  }
311
334
  else if (operations) {
312
- for (const operation of linq_1.values(operations)) {
335
+ for (const operation of (0, linq_1.values)(operations)) {
336
+ // set suppress-should-process
337
+ if (!!SupportsShouldProcess && (0, command_operation_1.isWritableCmdlet)(operation)) {
338
+ operation.details.csharp.supportShouldProcess = SupportsShouldProcess;
339
+ }
313
340
  const getCmdletName = (verb, subjectPrefix, subject, variantName) => {
314
341
  return `${verb}-${subjectPrefix}${subject}${variantName ? `_${variantName}` : ''}`;
315
342
  };
@@ -324,6 +351,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
324
351
  operation.details.csharp.verb = verbReplacer ? verbRegex ? prevVerb.replace(verbRegex, verbReplacer) : verbReplacer : prevVerb;
325
352
  operation.details.csharp.name = variantReplacer ? variantRegex ? prevVariantName.replace(variantRegex, variantReplacer) : variantReplacer : prevVariantName;
326
353
  operation.details.csharp.hidden = (directive.hide !== undefined) ? !!directive.hide : operation.details.csharp.hidden;
354
+ operation.details.csharp.description = commandDescriptionReplacer ? commandDescriptionReplacer : operation.details.csharp.description;
327
355
  const newSubject = operation.details.csharp.subject;
328
356
  const newSubjectPrefix = operation.details.csharp.subjectPrefix;
329
357
  const newVerb = operation.details.csharp.verb;
@@ -338,6 +366,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
338
366
  // handle parameter breaking change for variant
339
367
  operation.details.csharp.breakingChange.variant = {};
340
368
  operation.details.csharp.breakingChange.variant.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
369
+ operation.details.csharp.breakingChange.variant.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
341
370
  operation.details.csharp.breakingChange.variant.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
342
371
  operation.details.csharp.breakingChange.variant.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
343
372
  operation.details.csharp.breakingChange.variant.name = newVariantName;
@@ -351,6 +380,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
351
380
  operation.details.csharp.breakingChange.output.deprecatedOutputProperties = (breakingChange && breakingChange['deprecated-output-properties']) ? breakingChange['deprecated-output-properties'] : undefined;
352
381
  operation.details.csharp.breakingChange.output.newOutputProperties = (breakingChange && breakingChange['new-output-properties']) ? breakingChange['new-output-properties'] : undefined;
353
382
  operation.details.csharp.breakingChange.output.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
383
+ operation.details.csharp.breakingChange.output.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
354
384
  operation.details.csharp.breakingChange.output.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
355
385
  operation.details.csharp.breakingChange.output.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
356
386
  }
@@ -359,9 +389,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
359
389
  operation.details.csharp.breakingChange.cmdlet = {};
360
390
  operation.details.csharp.breakingChange.cmdlet.replacement = (breakingChange && breakingChange['replacement-cmdlet']) ? breakingChange['replacement-cmdlet'] : undefined;
361
391
  if (operation.details.csharp.breakingChange.cmdlet.replacement && operation.details.csharp.breakingChange.cmdlet.replacement.startsWith('$.')) {
362
- operation.details.csharp.breakingChange.cmdlet.replacement = codegen_1.safeEval(operation.details.csharp.breakingChange.cmdlet.replacement.replace('$', `"${newCommandName.split('_')[0]}"`));
392
+ operation.details.csharp.breakingChange.cmdlet.replacement = (0, codegen_1.safeEval)(operation.details.csharp.breakingChange.cmdlet.replacement.replace('$', `"${newCommandName.split('_')[0]}"`));
363
393
  }
364
394
  operation.details.csharp.breakingChange.cmdlet.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
395
+ operation.details.csharp.breakingChange.cmdlet.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
365
396
  operation.details.csharp.breakingChange.cmdlet.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
366
397
  operation.details.csharp.breakingChange.cmdlet.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
367
398
  operation.details.csharp.breakingChange.cmdlet.name = newCommandName.split('_')[0];
@@ -374,13 +405,13 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
374
405
  if (subjectPrefixReplacer !== undefined || subjectReplacer || verbReplacer || variantReplacer) {
375
406
  const modificationMessage = `[DIRECTIVE] Changed command from ${oldCommandName} to ${newCommandName}. `;
376
407
  state.message({
377
- Channel: autorest_extension_base_1.Channel.Debug, Text: modificationMessage
408
+ Channel: extension_base_1.Channel.Debug, Text: modificationMessage
378
409
  });
379
410
  }
380
411
  if (clearAlias) {
381
412
  operation.details.csharp.alias = [];
382
413
  state.message({
383
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from command ${newCommandName}.`
414
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from command ${newCommandName}.`
384
415
  });
385
416
  }
386
417
  if (alias) {
@@ -391,12 +422,12 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
391
422
  .replace('${variant}', operation.details.csharp.name);
392
423
  };
393
424
  const parsedAlias = new Array();
394
- for (const each of linq_1.values(alias)) {
425
+ for (const each of (0, linq_1.values)(alias)) {
395
426
  parsedAlias.push(getParsedAlias(each));
396
427
  }
397
- operation.details.csharp.alias = [...new Set(linq_1.values(operation.details.csharp.alias, parsedAlias).toArray())];
428
+ operation.details.csharp.alias = [...new Set((0, linq_1.values)(operation.details.csharp.alias, parsedAlias).toArray())];
398
429
  state.message({
399
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to command ${newCommandName}.`
430
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to command ${newCommandName}.`
400
431
  });
401
432
  }
402
433
  }
@@ -418,50 +449,50 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
418
449
  let models = [...(_a = state.model.schemas.objects) !== null && _a !== void 0 ? _a : []];
419
450
  // let models = values(state.model.schemas).toArray();
420
451
  if (modelNameRegex) {
421
- models = linq_1.values(models)
452
+ models = (0, linq_1.values)(models)
422
453
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(modelNameRegex); })
423
454
  .toArray();
424
455
  }
425
456
  if (modelFullNameRegex) {
426
- models = linq_1.values(models)
457
+ models = (0, linq_1.values)(models)
427
458
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.fullname}`.match(modelFullNameRegex); })
428
459
  .toArray();
429
460
  }
430
461
  if (modelNamespaceRegex) {
431
- models = linq_1.values(models)
462
+ models = (0, linq_1.values)(models)
432
463
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.namespace}`.match(modelNamespaceRegex); })
433
464
  .toArray();
434
465
  }
435
466
  if (propertyNameRegex && selectType === 'model') {
436
- models = linq_1.values(models)
467
+ models = (0, linq_1.values)(models)
437
468
  .where(model => {
438
469
  var _a;
439
- return linq_1.values(resolve_conflicts_1.allVirtualProperties((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties))
470
+ return (0, linq_1.values)((0, resolve_conflicts_1.allVirtualProperties)((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties))
440
471
  .any(property => !!`${property.name}`.match(propertyNameRegex));
441
472
  })
442
473
  .toArray();
443
474
  }
444
475
  if (propertyNameRegex && (selectType === undefined || selectType === 'property')) {
445
- const properties = linq_1.values(models)
446
- .selectMany(model => { var _a; return resolve_conflicts_1.allVirtualProperties((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties); })
476
+ const properties = (0, linq_1.values)(models)
477
+ .selectMany(model => { var _a; return (0, resolve_conflicts_1.allVirtualProperties)((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties); })
447
478
  .where(property => !!`${property.name}`.match(propertyNameRegex))
448
479
  .toArray();
449
- for (const property of linq_1.values(properties)) {
480
+ for (const property of (0, linq_1.values)(properties)) {
450
481
  const prevName = property.name;
451
482
  property.name = propertyNameReplacer ? propertyNameRegex ? property.name.replace(propertyNameRegex, propertyNameReplacer) : propertyNameReplacer : property.name;
452
483
  property.description = propertyDescriptionReplacer ? propertyDescriptionReplacer : property.description;
453
484
  if (!property.name) {
454
- state.message({ Channel: autorest_extension_base_1.Channel.Error, Text: `Directive '${directive.where['model-name'] || directive.where['model-fullname']}/${directive.where['property-name']}' attempted to change '${prevName}' to '' ` });
485
+ state.message({ Channel: extension_base_1.Channel.Error, Text: `Directive '${directive.where['model-name'] || directive.where['model-fullname']}/${directive.where['property-name']}' attempted to change '${prevName}' to '' ` });
455
486
  }
456
487
  if (propertyNameRegex) {
457
488
  state.message({
458
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed property-name from ${prevName} to ${property.name}.`
489
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed property-name from ${prevName} to ${property.name}.`
459
490
  });
460
491
  }
461
492
  }
462
493
  }
463
494
  else if (models) {
464
- for (const model of linq_1.values(models)) {
495
+ for (const model of (0, linq_1.values)(models)) {
465
496
  if (suppressFormat && model.language.csharp) {
466
497
  model.language.csharp.suppressFormat = true;
467
498
  }
@@ -469,22 +500,22 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
469
500
  const resourceGroupFormat = {};
470
501
  let ResourceGroupNameInclude = false;
471
502
  const resourceGroupName = 'resourcegroupname';
472
- const properties = resolve_conflicts_1.allVirtualProperties((_b = model.language.csharp) === null || _b === void 0 ? void 0 : _b.virtualProperties);
503
+ const properties = (0, resolve_conflicts_1.allVirtualProperties)((_b = model.language.csharp) === null || _b === void 0 ? void 0 : _b.virtualProperties);
473
504
  const propertiesToExclude = formatTable['exclude-properties'];
474
505
  const propertiesToInclude = formatTable.properties;
475
506
  const labels = formatTable.labels;
476
507
  const widths = formatTable.width;
477
- for (const property of linq_1.values(properties)) {
508
+ for (const property of (0, linq_1.values)(properties)) {
478
509
  if (property.name.toLowerCase() == resourceGroupName) {
479
510
  ResourceGroupNameInclude = true;
480
511
  }
481
512
  }
482
513
  if (labels) {
483
514
  const parsedLabels = new linq_1.Dictionary();
484
- for (const label of linq_1.items(labels)) {
515
+ for (const label of (0, linq_1.items)(labels)) {
485
516
  parsedLabels[label.key.toLowerCase()] = label.value;
486
517
  }
487
- for (const property of linq_1.values(properties)) {
518
+ for (const property of (0, linq_1.values)(properties)) {
488
519
  if (Object.keys(parsedLabels).includes(property.name.toLowerCase())) {
489
520
  if (property.format === undefined) {
490
521
  property.format = {};
@@ -498,10 +529,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
498
529
  }
499
530
  if (widths) {
500
531
  const parsedWidths = new linq_1.Dictionary();
501
- for (const w of linq_1.items(widths)) {
532
+ for (const w of (0, linq_1.items)(widths)) {
502
533
  parsedWidths[w.key.toLowerCase()] = w.value;
503
534
  }
504
- for (const property of linq_1.values(properties)) {
535
+ for (const property of (0, linq_1.values)(properties)) {
505
536
  if (Object.keys(parsedWidths).includes(property.name.toLowerCase())) {
506
537
  if (property.format === undefined) {
507
538
  property.format = {};
@@ -515,11 +546,11 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
515
546
  }
516
547
  if (propertiesToInclude) {
517
548
  const indexes = new linq_1.Dictionary();
518
- for (const item of linq_1.items(propertiesToInclude)) {
549
+ for (const item of (0, linq_1.items)(propertiesToInclude)) {
519
550
  indexes[item.value.toLowerCase()] = item.key;
520
551
  }
521
552
  let ResourceGroupNameInclude = false;
522
- for (const property of linq_1.values(properties)) {
553
+ for (const property of (0, linq_1.values)(properties)) {
523
554
  if (property.name.toLowerCase() == 'resourcegroupname') {
524
555
  ResourceGroupNameInclude = true;
525
556
  }
@@ -541,7 +572,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
541
572
  }
542
573
  }
543
574
  if (propertiesToExclude) {
544
- for (const property of linq_1.values(properties)) {
575
+ for (const property of (0, linq_1.values)(properties)) {
545
576
  if (propertiesToExclude.map(x => x.toLowerCase()).includes(property.name.toLowerCase())) {
546
577
  property.format = { suppressFormat: true };
547
578
  }
@@ -562,7 +593,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
562
593
  model.language.csharp.name = modelNameReplacer ? modelNameRegex ? model.language.csharp.name.replace(modelNameRegex, modelNameReplacer) : modelNameReplacer : model.language.csharp.name;
563
594
  }
564
595
  state.message({
565
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed model-name from ${prevName} to ${(_e = model.language.csharp) === null || _e === void 0 ? void 0 : _e.name}.`
596
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed model-name from ${prevName} to ${(_e = model.language.csharp) === null || _e === void 0 ? void 0 : _e.name}.`
566
597
  });
567
598
  }
568
599
  }
@@ -578,35 +609,35 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
578
609
  // .where(each => each.details.csharp.enum !== undefined)
579
610
  // .toArray();
580
611
  if (enumNameRegex) {
581
- enums = linq_1.values(enums)
612
+ enums = (0, linq_1.values)(enums)
582
613
  .where(each => { var _a; return !!`${(_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(enumNameRegex); })
583
614
  .toArray();
584
615
  }
585
616
  if (enumValueNameRegex) {
586
- const enumsValues = linq_1.values(enums)
617
+ const enumsValues = (0, linq_1.values)(enums)
587
618
  .selectMany(each => { var _a; return ((_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.enum) ? each.language.csharp.enum.values : []; })
588
619
  .where(each => !!`${each.name}`.match(enumValueNameRegex))
589
620
  .toArray();
590
- for (const enumValue of linq_1.values(enumsValues)) {
621
+ for (const enumValue of (0, linq_1.values)(enumsValues)) {
591
622
  const prevName = enumValue.name;
592
623
  enumValue.name = enumValueNameReplacer ? enumNameRegex ? enumValue.name.replace(enumValueNameRegex, enumValueNameReplacer) : enumValueNameReplacer : prevName;
593
624
  if (enumValueNameRegex) {
594
- const enumNames = linq_1.values(enums)
625
+ const enumNames = (0, linq_1.values)(enums)
595
626
  .select(each => { var _a; return (_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name; })
596
627
  .toArray();
597
628
  state.message({
598
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-value-name from ${prevName} to ${enumValue.name}. Enum: ${JSON.stringify(enumNames, null, 2)}`
629
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-value-name from ${prevName} to ${enumValue.name}. Enum: ${JSON.stringify(enumNames, null, 2)}`
599
630
  });
600
631
  }
601
632
  }
602
633
  }
603
634
  else {
604
- for (const each of linq_1.values(enums)) {
635
+ for (const each of (0, linq_1.values)(enums)) {
605
636
  const prevName = (_j = (_h = each.language.csharp) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : '';
606
637
  if (each.language.csharp) {
607
638
  each.language.csharp.name = enumNameReplacer ? enumNameRegex ? each.language.csharp.name.replace(enumNameRegex, enumNameReplacer) : enumNameReplacer : prevName;
608
639
  state.message({
609
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-name from ${prevName} to ${(_k = each.language.csharp) === null || _k === void 0 ? void 0 : _k.name}.`
640
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-name from ${prevName} to ${(_k = each.language.csharp) === null || _k === void 0 ? void 0 : _k.name}.`
610
641
  });
611
642
  }
612
643
  }
@@ -622,45 +653,45 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
622
653
  const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
623
654
  if (subjectRegex || subjectPrefixRegex || verbRegex || variantRegex || (parameterRegex && selectType === 'command')) {
624
655
  // select all operations first then reduce by finding the intersection with selectors
625
- let operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
656
+ let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
626
657
  .select(operation => operation.key)
627
658
  .toArray());
628
659
  if (subjectRegex) {
629
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
660
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
630
661
  .where(operation => !!`${operation.value.details.csharp.subject}`.match(subjectRegex) && operationsToRemoveKeys.has(operation.key))
631
662
  .select(operation => operation.key)
632
663
  .toArray());
633
664
  }
634
665
  if (subjectPrefixRegex && operationsToRemoveKeys.size > 0) {
635
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
666
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
636
667
  .where(operation => !!`${operation.value.details.csharp.subjectPrefix}`.match(subjectPrefixRegex) && operationsToRemoveKeys.has(operation.key))
637
668
  .select(operation => operation.key)
638
669
  .toArray());
639
670
  }
640
671
  if (verbRegex && operationsToRemoveKeys.size > 0) {
641
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
672
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
642
673
  .where(operation => !!`${operation.value.details.csharp.verb}`.match(verbRegex) && operationsToRemoveKeys.has(operation.key))
643
674
  .select(operation => operation.key)
644
675
  .toArray());
645
676
  }
646
677
  if (variantRegex && operationsToRemoveKeys.size > 0) {
647
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
678
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
648
679
  .where(operation => !!`${operation.value.details.csharp.name}`.match(variantRegex) && operationsToRemoveKeys.has(operation.key))
649
680
  .select(operation => operation.key)
650
681
  .toArray());
651
682
  }
652
683
  if (parameterRegex && selectType === 'command' && operationsToRemoveKeys.size > 0) {
653
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
654
- .where(operation => linq_1.values(resolve_conflicts_1.allVirtualParameters(operation.value.details.csharp.virtualParameters))
684
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
685
+ .where(operation => (0, linq_1.values)((0, resolve_conflicts_1.allVirtualParameters)(operation.value.details.csharp.virtualParameters))
655
686
  .any(parameter => !!`${parameter.name}`.match(parameterRegex)))
656
687
  .where(operation => operationsToRemoveKeys.has(operation.key))
657
688
  .select(operation => operation.key)
658
689
  .toArray());
659
690
  }
660
- for (const key of linq_1.values(operationsToRemoveKeys)) {
691
+ for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
661
692
  const operationInfo = state.model.commands.operations[key].details.csharp;
662
693
  state.message({
663
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
694
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
664
695
  });
665
696
  delete state.model.commands.operations[key];
666
697
  }
@@ -669,13 +700,13 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
669
700
  }
670
701
  }
671
702
  const operationIdentities = new Set();
672
- for (const operation of linq_1.values(state.model.commands.operations)) {
703
+ for (const operation of (0, linq_1.values)(state.model.commands.operations)) {
673
704
  const details = operation.details.csharp;
674
- let fname = `${details.verb} -${details.subject} -${details.name} `;
705
+ let fname = `${details.verb} -${details.subjectPrefix}${details.subject} -${details.name} `;
675
706
  let n = 1;
676
707
  while (operationIdentities.has(fname)) {
677
- details.name = codegen_1.pascalCase(`${details.name.replace(/\d*$/g, '')} ${n++}`);
678
- fname = codegen_1.pascalCase(`${details.verb} -${details.subject} -${details.name}`);
708
+ details.name = (0, codegen_1.pascalCase)(`${details.name.replace(/\d*$/g, '')} ${n++}`);
709
+ fname = (0, codegen_1.pascalCase)(`${details.verb} -${details.subjectPrefix}${details.subject} -${details.name}`);
679
710
  }
680
711
  operationIdentities.add(fname);
681
712
  }
@@ -683,14 +714,14 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
683
714
  }
684
715
  async function applyModifiersV2(service) {
685
716
  // dolauli implement directives
686
- const allDirectives = await service.GetValue('directive');
687
- directives = linq_1.values(allDirectives)
717
+ const allDirectives = await service.getValue('directive');
718
+ directives = (0, linq_1.values)(allDirectives)
688
719
  // .select(directive => directive)
689
720
  .where(directive => isWhereCommandDirective(directive) || isWhereModelDirective(directive) || isWhereEnumDirective(directive) || isRemoveCommandDirective(directive))
690
721
  .toArray();
691
722
  const state = await new model_state_1.ModelState(service).init();
692
723
  const result = await tweakModel(state);
693
- await service.WriteFile('code-model-v4-modifiers-v2.yaml', codegen_1.serialize(result), undefined, 'code-model-v4');
724
+ await service.writeFile({ filename: 'code-model-v4-modifiers-v2.yaml', content: (0, codegen_1.serialize)(result), sourceMap: undefined, artifactType: 'code-model-v4' });
694
725
  }
695
726
  exports.applyModifiersV2 = applyModifiersV2;
696
727
  //# sourceMappingURL=modifiers-v2.js.map