@autorest/powershell 4.0.0-dev.9 → 4.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 (483) hide show
  1. package/.rush/temp/package-deps_build.json +208 -203
  2. package/.rush/temp/shrinkwrap-deps.json +253 -280
  3. package/autorest-configuration-for-sdk.md +9 -3
  4. package/autorest-configuration.md +1 -1
  5. package/dist/cmdlets/class.d.ts +24 -3
  6. package/dist/cmdlets/class.d.ts.map +1 -1
  7. package/dist/cmdlets/class.js +888 -603
  8. package/dist/cmdlets/class.js.map +1 -1
  9. package/dist/cmdlets/namespace.d.ts.map +1 -1
  10. package/dist/cmdlets/namespace.js +39 -5
  11. package/dist/cmdlets/namespace.js.map +1 -1
  12. package/dist/enums/namespace.js +5 -5
  13. package/dist/enums/namespace.js.map +1 -1
  14. package/dist/exports.d.ts +3 -0
  15. package/dist/exports.d.ts.map +1 -0
  16. package/dist/exports.js +19 -0
  17. package/dist/exports.js.map +1 -0
  18. package/dist/generators/gitignore.d.ts.map +1 -1
  19. package/dist/generators/gitignore.js +2 -0
  20. package/dist/generators/gitignore.js.map +1 -1
  21. package/dist/generators/psm1.custom.js +2 -2
  22. package/dist/generators/psm1.custom.js.map +1 -1
  23. package/dist/generators/psm1.d.ts.map +1 -1
  24. package/dist/generators/psm1.internal.js +2 -2
  25. package/dist/generators/psm1.internal.js.map +1 -1
  26. package/dist/generators/psm1.js +17 -11
  27. package/dist/generators/psm1.js.map +1 -1
  28. package/dist/generators/readme.d.ts.map +1 -1
  29. package/dist/generators/readme.js +0 -3
  30. package/dist/generators/readme.js.map +1 -1
  31. package/dist/generators/script-cmdlet.js +18 -18
  32. package/dist/generators/script-cmdlet.js.map +1 -1
  33. package/dist/internal/name-inferrer.d.ts +1 -1
  34. package/dist/internal/name-inferrer.d.ts.map +1 -1
  35. package/dist/internal/name-inferrer.js +12 -12
  36. package/dist/internal/name-inferrer.js.map +1 -1
  37. package/dist/internal/powershell-declarations.d.ts +2 -0
  38. package/dist/internal/powershell-declarations.d.ts.map +1 -1
  39. package/dist/internal/powershell-declarations.js +4 -2
  40. package/dist/internal/powershell-declarations.js.map +1 -1
  41. package/dist/internal/project.d.ts +14 -6
  42. package/dist/internal/project.d.ts.map +1 -1
  43. package/dist/internal/project.js +24 -13
  44. package/dist/internal/project.js.map +1 -1
  45. package/dist/internal/state.d.ts +3 -2
  46. package/dist/internal/state.d.ts.map +1 -1
  47. package/dist/internal/state.js.map +1 -1
  48. package/dist/llcsharp/clientruntime.d.ts +1 -0
  49. package/dist/llcsharp/clientruntime.d.ts.map +1 -1
  50. package/dist/llcsharp/clientruntime.js +12 -11
  51. package/dist/llcsharp/clientruntime.js.map +1 -1
  52. package/dist/llcsharp/code-model.d.ts +7 -7
  53. package/dist/llcsharp/code-model.d.ts.map +1 -1
  54. package/dist/llcsharp/enums/enum.d.ts +1 -1
  55. package/dist/llcsharp/enums/enum.d.ts.map +1 -1
  56. package/dist/llcsharp/enums/enum.js +42 -42
  57. package/dist/llcsharp/enums/enum.js.map +1 -1
  58. package/dist/llcsharp/exports.js +5 -1
  59. package/dist/llcsharp/exports.js.map +1 -1
  60. package/dist/llcsharp/generator.d.ts +3 -2
  61. package/dist/llcsharp/generator.d.ts.map +1 -1
  62. package/dist/llcsharp/generator.js.map +1 -1
  63. package/dist/llcsharp/model/idictionary.js +16 -16
  64. package/dist/llcsharp/model/idictionary.js.map +1 -1
  65. package/dist/llcsharp/model/interface.d.ts +1 -1
  66. package/dist/llcsharp/model/interface.d.ts.map +1 -1
  67. package/dist/llcsharp/model/interface.js +19 -19
  68. package/dist/llcsharp/model/interface.js.map +1 -1
  69. package/dist/llcsharp/model/model-class-dictionary.js +18 -18
  70. package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
  71. package/dist/llcsharp/model/model-class-json.js +20 -20
  72. package/dist/llcsharp/model/model-class-json.js.map +1 -1
  73. package/dist/llcsharp/model/model-class-serializer.d.ts +1 -1
  74. package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
  75. package/dist/llcsharp/model/model-class-serializer.js +6 -6
  76. package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
  77. package/dist/llcsharp/model/model-class.d.ts +1 -1
  78. package/dist/llcsharp/model/model-class.d.ts.map +1 -1
  79. package/dist/llcsharp/model/model-class.js +108 -97
  80. package/dist/llcsharp/model/model-class.js.map +1 -1
  81. package/dist/llcsharp/model/namespace.d.ts +1 -1
  82. package/dist/llcsharp/model/namespace.d.ts.map +1 -1
  83. package/dist/llcsharp/model/namespace.js +2 -2
  84. package/dist/llcsharp/model/namespace.js.map +1 -1
  85. package/dist/llcsharp/model/property.d.ts +1 -1
  86. package/dist/llcsharp/model/property.d.ts.map +1 -1
  87. package/dist/llcsharp/model/property.js +20 -20
  88. package/dist/llcsharp/model/property.js.map +1 -1
  89. package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
  90. package/dist/llcsharp/operation/api-class.js +26 -1
  91. package/dist/llcsharp/operation/api-class.js.map +1 -1
  92. package/dist/llcsharp/operation/method.d.ts +10 -5
  93. package/dist/llcsharp/operation/method.d.ts.map +1 -1
  94. package/dist/llcsharp/operation/method.js +287 -134
  95. package/dist/llcsharp/operation/method.js.map +1 -1
  96. package/dist/llcsharp/operation/parameter.d.ts +1 -1
  97. package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
  98. package/dist/llcsharp/operation/parameter.js +10 -10
  99. package/dist/llcsharp/operation/parameter.js.map +1 -1
  100. package/dist/llcsharp/project.d.ts +8 -4
  101. package/dist/llcsharp/project.d.ts.map +1 -1
  102. package/dist/llcsharp/project.js +10 -1
  103. package/dist/llcsharp/project.js.map +1 -1
  104. package/dist/llcsharp/schema/Uuid.d.ts +1 -1
  105. package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
  106. package/dist/llcsharp/schema/Uuid.js +2 -2
  107. package/dist/llcsharp/schema/Uuid.js.map +1 -1
  108. package/dist/llcsharp/schema/array.d.ts +1 -1
  109. package/dist/llcsharp/schema/array.d.ts.map +1 -1
  110. package/dist/llcsharp/schema/array.js +45 -43
  111. package/dist/llcsharp/schema/array.js.map +1 -1
  112. package/dist/llcsharp/schema/binary.d.ts +1 -1
  113. package/dist/llcsharp/schema/binary.d.ts.map +1 -1
  114. package/dist/llcsharp/schema/binary.js +9 -9
  115. package/dist/llcsharp/schema/binary.js.map +1 -1
  116. package/dist/llcsharp/schema/boolean.d.ts +1 -1
  117. package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
  118. package/dist/llcsharp/schema/byte-array.d.ts +1 -1
  119. package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
  120. package/dist/llcsharp/schema/byte-array.js +24 -24
  121. package/dist/llcsharp/schema/byte-array.js.map +1 -1
  122. package/dist/llcsharp/schema/char.d.ts +1 -1
  123. package/dist/llcsharp/schema/char.d.ts.map +1 -1
  124. package/dist/llcsharp/schema/char.js +1 -1
  125. package/dist/llcsharp/schema/char.js.map +1 -1
  126. package/dist/llcsharp/schema/date-time.d.ts +1 -1
  127. package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
  128. package/dist/llcsharp/schema/date-time.js +45 -41
  129. package/dist/llcsharp/schema/date-time.js.map +1 -1
  130. package/dist/llcsharp/schema/date.d.ts +1 -1
  131. package/dist/llcsharp/schema/date.d.ts.map +1 -1
  132. package/dist/llcsharp/schema/duration.d.ts +1 -1
  133. package/dist/llcsharp/schema/duration.d.ts.map +1 -1
  134. package/dist/llcsharp/schema/duration.js +9 -7
  135. package/dist/llcsharp/schema/duration.js.map +1 -1
  136. package/dist/llcsharp/schema/enum.d.ts +6 -2
  137. package/dist/llcsharp/schema/enum.d.ts.map +1 -1
  138. package/dist/llcsharp/schema/enum.js +13 -4
  139. package/dist/llcsharp/schema/enum.js.map +1 -1
  140. package/dist/llcsharp/schema/extended-type-declaration.d.ts +1 -1
  141. package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
  142. package/dist/llcsharp/schema/fixed-array.d.ts +1 -1
  143. package/dist/llcsharp/schema/fixed-array.d.ts.map +1 -1
  144. package/dist/llcsharp/schema/fixed-array.js +44 -42
  145. package/dist/llcsharp/schema/fixed-array.js.map +1 -1
  146. package/dist/llcsharp/schema/integer.d.ts +1 -1
  147. package/dist/llcsharp/schema/integer.d.ts.map +1 -1
  148. package/dist/llcsharp/schema/integer.js +5 -5
  149. package/dist/llcsharp/schema/integer.js.map +1 -1
  150. package/dist/llcsharp/schema/object.d.ts +1 -1
  151. package/dist/llcsharp/schema/object.d.ts.map +1 -1
  152. package/dist/llcsharp/schema/object.js +28 -28
  153. package/dist/llcsharp/schema/object.js.map +1 -1
  154. package/dist/llcsharp/schema/password.d.ts +1 -1
  155. package/dist/llcsharp/schema/password.d.ts.map +1 -1
  156. package/dist/llcsharp/schema/password.js +13 -13
  157. package/dist/llcsharp/schema/password.js.map +1 -1
  158. package/dist/llcsharp/schema/primitive.d.ts +1 -1
  159. package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
  160. package/dist/llcsharp/schema/primitive.js +40 -37
  161. package/dist/llcsharp/schema/primitive.js.map +1 -1
  162. package/dist/llcsharp/schema/schema-resolver.d.ts +1 -1
  163. package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
  164. package/dist/llcsharp/schema/schema-resolver.js +2 -1
  165. package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
  166. package/dist/llcsharp/schema/string.d.ts +1 -1
  167. package/dist/llcsharp/schema/string.d.ts.map +1 -1
  168. package/dist/llcsharp/schema/string.js +48 -44
  169. package/dist/llcsharp/schema/string.js.map +1 -1
  170. package/dist/llcsharp/schema/uri.d.ts +1 -1
  171. package/dist/llcsharp/schema/uri.d.ts.map +1 -1
  172. package/dist/llcsharp/schema/uri.js +2 -2
  173. package/dist/llcsharp/schema/uri.js.map +1 -1
  174. package/dist/llcsharp/validations.js +2 -2
  175. package/dist/llcsharp/validations.js.map +1 -1
  176. package/dist/main.d.ts.map +1 -1
  177. package/dist/main.js +5 -2
  178. package/dist/main.js.map +1 -1
  179. package/dist/models/model-extensions.d.ts +1 -1
  180. package/dist/models/model-extensions.d.ts.map +1 -1
  181. package/dist/models/model-extensions.js +39 -39
  182. package/dist/models/model-extensions.js.map +1 -1
  183. package/dist/module/module-class.d.ts.map +1 -1
  184. package/dist/module/module-class.js +45 -15
  185. package/dist/module/module-class.js.map +1 -1
  186. package/dist/module/module-namespace.js +3 -3
  187. package/dist/module/module-namespace.js.map +1 -1
  188. package/dist/plugins/add-azure-completers-v2.d.ts +6 -1
  189. package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -1
  190. package/dist/plugins/add-azure-completers-v2.js +5 -4
  191. package/dist/plugins/add-azure-completers-v2.js.map +1 -1
  192. package/dist/plugins/create-commands-v2.d.ts +16 -7
  193. package/dist/plugins/create-commands-v2.d.ts.map +1 -1
  194. package/dist/plugins/create-commands-v2.js +269 -66
  195. package/dist/plugins/create-commands-v2.js.map +1 -1
  196. package/dist/plugins/cs-namer-v2.d.ts +6 -1
  197. package/dist/plugins/cs-namer-v2.d.ts.map +1 -1
  198. package/dist/plugins/cs-namer-v2.js +42 -41
  199. package/dist/plugins/cs-namer-v2.js.map +1 -1
  200. package/dist/plugins/llcsharp-v2.d.ts +5 -2
  201. package/dist/plugins/llcsharp-v2.d.ts.map +1 -1
  202. package/dist/plugins/llcsharp-v2.js +11 -9
  203. package/dist/plugins/llcsharp-v2.js.map +1 -1
  204. package/dist/plugins/modifiers-v2.d.ts +6 -1
  205. package/dist/plugins/modifiers-v2.d.ts.map +1 -1
  206. package/dist/plugins/modifiers-v2.js +120 -92
  207. package/dist/plugins/modifiers-v2.js.map +1 -1
  208. package/dist/plugins/plugin-create-inline-properties.d.ts +6 -1
  209. package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
  210. package/dist/plugins/plugin-create-inline-properties.js +44 -32
  211. package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
  212. package/dist/plugins/plugin-tweak-m4-model.d.ts +7 -1
  213. package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -1
  214. package/dist/plugins/plugin-tweak-m4-model.js +28 -11
  215. package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
  216. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +6 -1
  217. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -1
  218. package/dist/plugins/plugin-tweak-model-azure-v2.js +32 -22
  219. package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
  220. package/dist/plugins/plugin-tweak-model.d.ts +6 -1
  221. package/dist/plugins/plugin-tweak-model.d.ts.map +1 -1
  222. package/dist/plugins/plugin-tweak-model.js +33 -32
  223. package/dist/plugins/plugin-tweak-model.js.map +1 -1
  224. package/dist/plugins/powershell-v2.d.ts +5 -2
  225. package/dist/plugins/powershell-v2.d.ts.map +1 -1
  226. package/dist/plugins/powershell-v2.js +32 -28
  227. package/dist/plugins/powershell-v2.js.map +1 -1
  228. package/dist/plugins/ps-namer-v2.d.ts +6 -1
  229. package/dist/plugins/ps-namer-v2.d.ts.map +1 -1
  230. package/dist/plugins/ps-namer-v2.js +33 -32
  231. package/dist/plugins/ps-namer-v2.js.map +1 -1
  232. package/dist/plugins/sdk-create-inline-properties.d.ts +1 -1
  233. package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -1
  234. package/dist/plugins/sdk-create-inline-properties.js +129 -39
  235. package/dist/plugins/sdk-create-inline-properties.js.map +1 -1
  236. package/dist/plugins/sdk-cs-namer.d.ts +1 -1
  237. package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
  238. package/dist/plugins/sdk-cs-namer.js +59 -34
  239. package/dist/plugins/sdk-cs-namer.js.map +1 -1
  240. package/dist/plugins/sdk-cs-simplifier.d.ts +1 -1
  241. package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -1
  242. package/dist/plugins/sdk-cs-simplifier.js +3 -3
  243. package/dist/plugins/sdk-cs-simplifier.js.map +1 -1
  244. package/dist/plugins/sdk-generate.d.ts +1 -1
  245. package/dist/plugins/sdk-generate.d.ts.map +1 -1
  246. package/dist/plugins/sdk-generate.js +23 -18
  247. package/dist/plugins/sdk-generate.js.map +1 -1
  248. package/dist/plugins/sdk-modifiers.d.ts +4 -0
  249. package/dist/plugins/sdk-modifiers.d.ts.map +1 -0
  250. package/dist/plugins/sdk-modifiers.js +175 -0
  251. package/dist/plugins/sdk-modifiers.js.map +1 -0
  252. package/dist/plugins/sdk-tweak-model.d.ts +1 -1
  253. package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
  254. package/dist/plugins/sdk-tweak-model.js +140 -44
  255. package/dist/plugins/sdk-tweak-model.js.map +1 -1
  256. package/dist/sdk/project.d.ts +2 -2
  257. package/dist/sdk/project.d.ts.map +1 -1
  258. package/dist/sdk/project.js +10 -9
  259. package/dist/sdk/project.js.map +1 -1
  260. package/dist/sdk/state.d.ts +2 -2
  261. package/dist/sdk/state.d.ts.map +1 -1
  262. package/dist/sdk/utility.d.ts +12 -3
  263. package/dist/sdk/utility.d.ts.map +1 -1
  264. package/dist/sdk/utility.js +122 -30
  265. package/dist/sdk/utility.js.map +1 -1
  266. package/dist/utils/PwshModel.d.ts +1 -1
  267. package/dist/utils/PwshModel.d.ts.map +1 -1
  268. package/dist/utils/PwshModel.js +1 -1
  269. package/dist/utils/PwshModel.js.map +1 -1
  270. package/dist/utils/SdkModel.d.ts +1 -1
  271. package/dist/utils/SdkModel.d.ts.map +1 -1
  272. package/dist/utils/SdkModel.js +1 -1
  273. package/dist/utils/SdkModel.js.map +1 -1
  274. package/dist/utils/command-operation.d.ts +11 -3
  275. package/dist/utils/command-operation.d.ts.map +1 -1
  276. package/dist/utils/command-operation.js +26 -4
  277. package/dist/utils/command-operation.js.map +1 -1
  278. package/dist/utils/components.d.ts +1 -1
  279. package/dist/utils/components.d.ts.map +1 -1
  280. package/dist/utils/components.js +2 -2
  281. package/dist/utils/components.js.map +1 -1
  282. package/dist/utils/http-operation.d.ts +2 -0
  283. package/dist/utils/http-operation.d.ts.map +1 -1
  284. package/dist/utils/http-operation.js +16 -12
  285. package/dist/utils/http-operation.js.map +1 -1
  286. package/dist/utils/model-state.d.ts +7 -5
  287. package/dist/utils/model-state.d.ts.map +1 -1
  288. package/dist/utils/model-state.js +28 -20
  289. package/dist/utils/model-state.js.map +1 -1
  290. package/dist/utils/programatic-operation.d.ts +1 -1
  291. package/dist/utils/programatic-operation.d.ts.map +1 -1
  292. package/dist/utils/programatic-operation.js +1 -1
  293. package/dist/utils/programatic-operation.js.map +1 -1
  294. package/dist/utils/resolve-conflicts.js +8 -8
  295. package/dist/utils/resolve-conflicts.js.map +1 -1
  296. package/dist/utils/schema.d.ts +1 -1
  297. package/dist/utils/schema.d.ts.map +1 -1
  298. package/dist/utils/schema.js +11 -11
  299. package/dist/utils/schema.js.map +1 -1
  300. package/dist/utils/security-scheme.d.ts +2 -2
  301. package/dist/utils/security-scheme.d.ts.map +1 -1
  302. package/dist/utils/security-scheme.js +2 -2
  303. package/dist/utils/security-scheme.js.map +1 -1
  304. package/dist/utils/sort-parameters.d.ts +1 -1
  305. package/dist/utils/sort-parameters.d.ts.map +1 -1
  306. package/dist/utils/tsp-generator.d.ts +3 -0
  307. package/dist/utils/tsp-generator.d.ts.map +1 -0
  308. package/dist/utils/tsp-generator.js +65 -0
  309. package/dist/utils/tsp-generator.js.map +1 -0
  310. package/dist/utils/tsp-host.d.ts +42 -0
  311. package/dist/utils/tsp-host.d.ts.map +1 -0
  312. package/dist/utils/tsp-host.js +56 -0
  313. package/dist/utils/tsp-host.js.map +1 -0
  314. package/generators/readme.ts +0 -3
  315. package/package.json +11 -10
  316. package/resources/assets/build-module.ps1 +29 -2
  317. package/resources/assets/create-model-cmdlets.ps1 +1 -0
  318. package/resources/assets/generate-help.ps1 +2 -2
  319. package/resources/assets/generate-portal-ux.ps1 +6 -22
  320. package/resources/assets/test/loadEnv.ps1 +1 -1
  321. package/resources/assets/test-module.ps1 +9 -5
  322. package/resources/assets/tools/Resources/README.md +0 -3
  323. package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +2 -2
  324. package/resources/assets/tools/Resources/how-to.md +2 -0
  325. package/resources/built-time-cmdlets.csproj +1 -0
  326. package/resources/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml +554 -0
  327. package/resources/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml +471 -0
  328. package/resources/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml +306 -0
  329. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Az.Accounts.nuspec +4 -5
  330. package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 +389 -0
  331. package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 +365 -0
  332. package/resources/modules/Az.Accounts/2.13.1/FuzzySharp.dll +0 -0
  333. package/resources/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll +0 -0
  334. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll +0 -0
  335. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  336. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  337. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  338. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  339. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  340. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  341. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
  342. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
  343. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  344. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
  345. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
  346. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
  347. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
  348. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  349. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
  350. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
  351. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  352. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +2510 -779
  353. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  354. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
  355. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
  356. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
  357. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll +0 -0
  358. package/resources/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 +222 -0
  359. package/resources/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 +281 -0
  360. package/resources/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 +242 -0
  361. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/[Content_Types].xml +2 -3
  362. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/_rels/.rels +2 -2
  363. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll +0 -0
  364. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll +0 -0
  365. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  366. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll +0 -0
  367. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  368. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll +0 -0
  369. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll +0 -0
  370. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll +0 -0
  371. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll +0 -0
  372. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  373. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll +0 -0
  374. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll +0 -0
  375. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll +0 -0
  376. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll +0 -0
  377. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll +0 -0
  378. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll +0 -0
  379. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll +0 -0
  380. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll +0 -0
  381. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll +0 -0
  382. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll +0 -0
  383. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll +0 -0
  384. package/resources/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp +11 -0
  385. package/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +4 -1
  386. package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +6 -3
  387. package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +7 -4
  388. package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +130 -81
  389. package/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs +64 -0
  390. package/resources/psruntime/BuildTime/MarkdownRenderer.cs +17 -9
  391. package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +36 -8
  392. package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +21 -10
  393. package/resources/psruntime/BuildTime/PsAttributes.cs +5 -0
  394. package/resources/psruntime/BuildTime/PsHelpers.cs +4 -3
  395. package/resources/psruntime/MessageAttribute.cs +45 -55
  396. package/resources/psruntime/MessageAttributeHelper.cs +30 -7
  397. package/resources/psruntime/Properties/Resources.Designer.cs +25 -3
  398. package/resources/psruntime/Properties/Resources.resx +8 -2
  399. package/resources/runtime/csharp/pipeline/PipelineMocking.cs +1 -1
  400. package/resources/templates/azureMethod.ejs +2 -2
  401. package/resources/templates/azureMethodGroup.ejs +2 -2
  402. package/resources/templates/azureServiceClient.ejs +11 -4
  403. package/resources/templates/enum.ejs +3 -3
  404. package/resources/templates/extensionMethod.ejs +18 -12
  405. package/resources/templates/extensions.ejs +9 -2
  406. package/resources/templates/longRunningOperationMethod.ejs +10 -8
  407. package/resources/templates/method.ejs +10 -8
  408. package/resources/templates/methodBodyRestCall.ejs +77 -32
  409. package/resources/templates/methodGroupInterface.ejs +2 -61
  410. package/resources/templates/methodGroupInterfaceBody.ejs +60 -0
  411. package/resources/templates/model.ejs +15 -15
  412. package/resources/templates/serviceClientBody.ejs +8 -8
  413. package/resources/templates/serviceClientInterface.ejs +10 -4
  414. package/resources/utils/Get-SubscriptionIdTestSafe.ps1 +7 -0
  415. package/dist/utils/WrapComments.d.ts +0 -2
  416. package/dist/utils/WrapComments.d.ts.map +0 -1
  417. package/dist/utils/WrapComments.js +0 -46
  418. package/dist/utils/WrapComments.js.map +0 -1
  419. package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +0 -496
  420. package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +0 -468
  421. package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +0 -303
  422. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +0 -387
  423. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +0 -375
  424. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
  425. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
  426. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  427. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
  428. package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
  429. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  430. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +0 -2309
  431. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  432. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json +0 -2273
  433. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  434. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json +0 -1316
  435. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  436. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  437. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  438. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  439. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  440. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +0 -2413
  441. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  442. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  443. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
  444. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
  445. package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +0 -219
  446. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
  447. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
  448. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  449. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  450. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  451. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
  452. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
  453. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll +0 -0
  454. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
  455. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
  456. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
  457. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  458. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
  459. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll +0 -0
  460. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
  461. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
  462. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +0 -278
  463. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +0 -234
  464. package/resources/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp +0 -11
  465. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Hyak.Common.dll +0 -0
  466. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.Common.dll +0 -0
  467. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
  468. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
  469. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.dll +0 -0
  470. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/en-US/about_az.help.txt +0 -0
  471. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Numerics.Vectors.dll +0 -0
  472. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Security.Cryptography.Cng.dll +0 -0
  473. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Text.Encodings.Web.dll +0 -0
  474. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Xml.ReaderWriter.dll +0 -0
  475. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  476. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Buffers.dll +0 -0
  477. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.Data.dll +0 -0
  478. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.dll +0 -0
  479. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Net.Http.WinHttpHandler.dll +0 -0
  480. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Private.ServiceModel.dll +0 -0
  481. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.ServiceModel.Primitives.dll +0 -0
  482. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Text.Json.dll +0 -0
  483. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Threading.Tasks.Extensions.dll +0 -0
@@ -4,10 +4,11 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.applyModifiersV2 = void 0;
8
- const autorest_extension_base_1 = require("@azure-tools/autorest-extension-base");
7
+ exports.applyModifiersV2 = exports.tweakModelForTsp = void 0;
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}.`);
@@ -171,23 +172,31 @@ function isWhereEnumDirective(it) {
171
172
  }
172
173
  return false;
173
174
  }
175
+ async function tweakModelForTsp(state) {
176
+ const allDirectives = await state.service.getValue('directive');
177
+ directives = (0, linq_1.values)(allDirectives)
178
+ .where(directive => isWhereCommandDirective(directive) || isWhereModelDirective(directive) || isWhereEnumDirective(directive) || isRemoveCommandDirective(directive))
179
+ .toArray();
180
+ return await tweakModel(state);
181
+ }
182
+ exports.tweakModelForTsp = tweakModelForTsp;
174
183
  async function tweakModel(state) {
175
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
184
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
176
185
  const isAzure = await state.getValue('azure', false) || await state.getValue('azure-arm', false);
177
186
  const removePecAndPlr = !await state.getValue('keep-pec-and-plr', isAzure ? false : true);
178
187
  if (removePecAndPlr) {
179
- const PecOrPlrRegex = "^PrivateEndpointConnection$|^PrivateLinkResource$";
180
- let operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
188
+ const PecOrPlrRegex = '^PrivateEndpointConnection$|^PrivateLinkResource$';
189
+ let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
181
190
  .select(operation => operation.key)
182
191
  .toArray());
183
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
192
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
184
193
  .where(operation => !!`${operation.value.details.csharp.subject}`.match(PecOrPlrRegex) && operationsToRemoveKeys.has(operation.key))
185
194
  .select(operation => operation.key)
186
195
  .toArray());
187
- for (const key of linq_1.values(operationsToRemoveKeys)) {
196
+ for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
188
197
  const operationInfo = state.model.commands.operations[key].details.csharp;
189
198
  state.message({
190
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
199
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
191
200
  });
192
201
  delete state.model.commands.operations[key];
193
202
  }
@@ -206,6 +215,7 @@ async function tweakModel(state) {
206
215
  const verbRegex = getPatternToMatch(directive.where.verb);
207
216
  const variantRegex = getPatternToMatch(directive.where.variant);
208
217
  const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
218
+ const SupportsShouldProcess = (directive.set !== undefined) ? directive.set['suppress-should-process'] : undefined;
209
219
  const alias = (directive.set !== undefined) ?
210
220
  (directive.set.alias !== undefined) ?
211
221
  !Array.isArray(directive.set.alias) ?
@@ -214,41 +224,42 @@ async function tweakModel(state) {
214
224
  : undefined
215
225
  : undefined;
216
226
  const breakingChange = (directive.set !== undefined) ? directive.set['breaking-change'] : undefined;
217
- const previewMessage = (directive.set !== undefined) ? directive.set['preview-message'] : undefined;
227
+ const previewAnnouncement = (directive.set !== undefined) ? directive.set['preview-announcement'] : undefined;
218
228
  const subjectReplacer = (directive.set !== undefined) ? directive.set['subject'] : undefined;
219
229
  const subjectPrefixReplacer = (directive.set !== undefined) ? directive.set['subject-prefix'] : undefined;
220
230
  const verbReplacer = (directive.set !== undefined) ? directive.set.verb : undefined;
221
231
  const variantReplacer = (directive.set !== undefined) ? directive.set.variant : undefined;
222
232
  const parameterReplacer = (directive.set !== undefined) ? directive.set['parameter-name'] : undefined;
223
233
  const paramDescriptionReplacer = (directive.set !== undefined) ? directive.set['parameter-description'] : undefined;
234
+ const commandDescriptionReplacer = (directive.set !== undefined) ? directive.set['command-description'] : undefined;
224
235
  const paramCompleterReplacer = (directive.set !== undefined) ? directive.set['completer'] : undefined;
225
236
  const paramDefaultReplacer = (directive.set !== undefined) ? directive.set['default'] : undefined;
226
237
  const cliensidePagination = (directive.set !== undefined) ? directive.set['clientside-pagination'] : undefined;
227
238
  // select all operations
228
- let operations = linq_1.values(state.model.commands.operations).toArray();
239
+ let operations = (0, linq_1.values)(state.model.commands.operations).toArray();
229
240
  if (subjectRegex) {
230
- operations = linq_1.values(operations)
241
+ operations = (0, linq_1.values)(operations)
231
242
  .where(operation => !!`${operation.details.csharp.subject}`.match(subjectRegex))
232
243
  .toArray();
233
244
  }
234
245
  if (subjectPrefixRegex) {
235
- operations = linq_1.values(operations)
246
+ operations = (0, linq_1.values)(operations)
236
247
  .where(operation => !!`${operation.details.csharp.subjectPrefix}`.match(subjectPrefixRegex))
237
248
  .toArray();
238
249
  }
239
250
  if (verbRegex) {
240
- operations = linq_1.values(operations)
251
+ operations = (0, linq_1.values)(operations)
241
252
  .where(operation => !!`${operation.details.csharp.verb}`.match(verbRegex))
242
253
  .toArray();
243
254
  }
244
255
  if (variantRegex) {
245
- operations = linq_1.values(operations)
256
+ operations = (0, linq_1.values)(operations)
246
257
  .where(operation => !!`${operation.details.csharp.name}`.match(variantRegex))
247
258
  .toArray();
248
259
  }
249
260
  if (parameterRegex && selectType === 'command') {
250
- operations = linq_1.values(operations)
251
- .where(operation => linq_1.values(resolve_conflicts_1.allVirtualParameters(operation.details.csharp.virtualParameters))
261
+ operations = (0, linq_1.values)(operations)
262
+ .where(operation => (0, linq_1.values)((0, resolve_conflicts_1.allVirtualParameters)(operation.details.csharp.virtualParameters))
252
263
  .any(parameter => !!`${parameter.name}`.match(parameterRegex)))
253
264
  .toArray();
254
265
  }
@@ -261,11 +272,11 @@ async function tweakModel(state) {
261
272
  await addPipelines(state, operations, directive.add.pipelines);
262
273
  }
263
274
  if (parameterRegex && (selectType === undefined || selectType === 'parameter')) {
264
- const parameters = linq_1.values(operations)
265
- .selectMany(operation => resolve_conflicts_1.allVirtualParameters(operation.details.csharp.virtualParameters))
275
+ const parameters = (0, linq_1.values)(operations)
276
+ .selectMany(operation => (0, resolve_conflicts_1.allVirtualParameters)(operation.details.csharp.virtualParameters))
266
277
  .where(parameter => !!`${parameter.name}`.match(parameterRegex))
267
278
  .toArray();
268
- for (const p of linq_1.values(parameters)) {
279
+ for (const p of (0, linq_1.values)(parameters)) {
269
280
  const parameter = p;
270
281
  const prevName = parameter.name;
271
282
  parameter.name = parameterReplacer ? parameterRegex ? parameter.name.replace(parameterRegex, parameterReplacer) : parameterReplacer : parameter.name;
@@ -281,15 +292,20 @@ async function tweakModel(state) {
281
292
  parameter.breakingChange.oldParamaterType = (breakingChange && breakingChange['old-parameter-type']) ? breakingChange['old-parameter-type'] : undefined;
282
293
  parameter.breakingChange.newParameterType = (breakingChange && breakingChange['new-parameter-type']) ? breakingChange['new-parameter-type'] : undefined;
283
294
  parameter.breakingChange.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
295
+ parameter.breakingChange.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
284
296
  parameter.breakingChange.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
285
297
  parameter.breakingChange.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
286
298
  }
287
299
  // handle preview message for parameter
288
- parameter.previewMessage = previewMessage ? previewMessage : undefined;
300
+ if (previewAnnouncement) {
301
+ parameter.previewAnnouncement = {};
302
+ parameter.previewAnnouncement.previewMessage = (_a = previewAnnouncement['preview-message']) !== null && _a !== void 0 ? _a : '';
303
+ parameter.previewAnnouncement.estimatedGaDate = (_b = previewAnnouncement['estimated-ga-date']) !== null && _b !== void 0 ? _b : undefined;
304
+ }
289
305
  if (clearAlias) {
290
306
  parameter.alias = [];
291
307
  state.message({
292
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from parameter ${parameter.name}.`
308
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from parameter ${parameter.name}.`
293
309
  });
294
310
  }
295
311
  // handle hiding parameters
@@ -301,34 +317,38 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
301
317
  p.required = false;
302
318
  p.hidden = true;
303
319
  state.message({
304
- Channel: autorest_extension_base_1.Channel.Debug,
320
+ Channel: extension_base_1.Channel.Debug,
305
321
  Text: `[DIRECTIVE] Hide parameter ${p.name}.`,
306
322
  });
307
323
  }
308
324
  if (alias) {
309
325
  const parsedAlias = new Array();
310
- for (const each of linq_1.values(alias)) {
326
+ for (const each of (0, linq_1.values)(alias)) {
311
327
  parsedAlias.push(hasSpecialChars(each) ? prevName.replace(parameterRegex, each) : each);
312
328
  }
313
- parameter.alias = [...new Set(linq_1.values(parameter.alias, parsedAlias).toArray())];
329
+ parameter.alias = [...new Set((0, linq_1.values)(parameter.alias, parsedAlias).toArray())];
314
330
  state.message({
315
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to parameter ${parameter.name}.`
331
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to parameter ${parameter.name}.`
316
332
  });
317
333
  }
318
334
  if (parameterReplacer) {
319
335
  state.message({
320
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed parameter-name from ${prevName} to ${parameter.name}.`
336
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed parameter-name from ${prevName} to ${parameter.name}.`
321
337
  });
322
338
  }
323
339
  if (paramDescriptionReplacer) {
324
340
  state.message({
325
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Set parameter-description from parameter ${parameter.name}.`
341
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Set parameter-description from parameter ${parameter.name}.`
326
342
  });
327
343
  }
328
344
  }
329
345
  }
330
346
  else if (operations) {
331
- for (const operation of linq_1.values(operations)) {
347
+ for (const operation of (0, linq_1.values)(operations)) {
348
+ // set suppress-should-process
349
+ if (!!SupportsShouldProcess && (0, command_operation_1.isWritableCmdlet)(operation)) {
350
+ operation.details.csharp.supportShouldProcess = SupportsShouldProcess;
351
+ }
332
352
  const getCmdletName = (verb, subjectPrefix, subject, variantName) => {
333
353
  return `${verb}-${subjectPrefix}${subject}${variantName ? `_${variantName}` : ''}`;
334
354
  };
@@ -343,6 +363,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
343
363
  operation.details.csharp.verb = verbReplacer ? verbRegex ? prevVerb.replace(verbRegex, verbReplacer) : verbReplacer : prevVerb;
344
364
  operation.details.csharp.name = variantReplacer ? variantRegex ? prevVariantName.replace(variantRegex, variantReplacer) : variantReplacer : prevVariantName;
345
365
  operation.details.csharp.hidden = (directive.hide !== undefined) ? !!directive.hide : operation.details.csharp.hidden;
366
+ operation.details.csharp.description = commandDescriptionReplacer ? commandDescriptionReplacer : operation.details.csharp.description;
346
367
  const newSubject = operation.details.csharp.subject;
347
368
  const newSubjectPrefix = operation.details.csharp.subjectPrefix;
348
369
  const newVerb = operation.details.csharp.verb;
@@ -357,6 +378,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
357
378
  // handle parameter breaking change for variant
358
379
  operation.details.csharp.breakingChange.variant = {};
359
380
  operation.details.csharp.breakingChange.variant.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
381
+ operation.details.csharp.breakingChange.variant.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
360
382
  operation.details.csharp.breakingChange.variant.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
361
383
  operation.details.csharp.breakingChange.variant.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
362
384
  operation.details.csharp.breakingChange.variant.name = newVariantName;
@@ -370,6 +392,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
370
392
  operation.details.csharp.breakingChange.output.deprecatedOutputProperties = (breakingChange && breakingChange['deprecated-output-properties']) ? breakingChange['deprecated-output-properties'] : undefined;
371
393
  operation.details.csharp.breakingChange.output.newOutputProperties = (breakingChange && breakingChange['new-output-properties']) ? breakingChange['new-output-properties'] : undefined;
372
394
  operation.details.csharp.breakingChange.output.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
395
+ operation.details.csharp.breakingChange.output.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
373
396
  operation.details.csharp.breakingChange.output.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
374
397
  operation.details.csharp.breakingChange.output.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
375
398
  }
@@ -378,9 +401,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
378
401
  operation.details.csharp.breakingChange.cmdlet = {};
379
402
  operation.details.csharp.breakingChange.cmdlet.replacement = (breakingChange && breakingChange['replacement-cmdlet']) ? breakingChange['replacement-cmdlet'] : undefined;
380
403
  if (operation.details.csharp.breakingChange.cmdlet.replacement && operation.details.csharp.breakingChange.cmdlet.replacement.startsWith('$.')) {
381
- operation.details.csharp.breakingChange.cmdlet.replacement = codegen_1.safeEval(operation.details.csharp.breakingChange.cmdlet.replacement.replace('$', `"${newCommandName.split('_')[0]}"`));
404
+ operation.details.csharp.breakingChange.cmdlet.replacement = (0, codegen_1.safeEval)(operation.details.csharp.breakingChange.cmdlet.replacement.replace('$', `"${newCommandName.split('_')[0]}"`));
382
405
  }
383
406
  operation.details.csharp.breakingChange.cmdlet.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
407
+ operation.details.csharp.breakingChange.cmdlet.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
384
408
  operation.details.csharp.breakingChange.cmdlet.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
385
409
  operation.details.csharp.breakingChange.cmdlet.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
386
410
  operation.details.csharp.breakingChange.cmdlet.name = newCommandName.split('_')[0];
@@ -388,18 +412,22 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
388
412
  }
389
413
  }
390
414
  // handle preview message for cmdlet
391
- operation.details.csharp.previewMessage = previewMessage ? previewMessage : undefined;
415
+ if (previewAnnouncement) {
416
+ operation.details.csharp.previewAnnouncement = {};
417
+ operation.details.csharp.previewAnnouncement.previewMessage = (_c = previewAnnouncement['preview-message']) !== null && _c !== void 0 ? _c : '';
418
+ operation.details.csharp.previewAnnouncement.estimatedGaDate = (_d = previewAnnouncement['estimated-ga-date']) !== null && _d !== void 0 ? _d : undefined;
419
+ }
392
420
  // just the subject prefix can be an empty string
393
421
  if (subjectPrefixReplacer !== undefined || subjectReplacer || verbReplacer || variantReplacer) {
394
422
  const modificationMessage = `[DIRECTIVE] Changed command from ${oldCommandName} to ${newCommandName}. `;
395
423
  state.message({
396
- Channel: autorest_extension_base_1.Channel.Debug, Text: modificationMessage
424
+ Channel: extension_base_1.Channel.Debug, Text: modificationMessage
397
425
  });
398
426
  }
399
427
  if (clearAlias) {
400
428
  operation.details.csharp.alias = [];
401
429
  state.message({
402
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from command ${newCommandName}.`
430
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from command ${newCommandName}.`
403
431
  });
404
432
  }
405
433
  if (alias) {
@@ -410,12 +438,12 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
410
438
  .replace('${variant}', operation.details.csharp.name);
411
439
  };
412
440
  const parsedAlias = new Array();
413
- for (const each of linq_1.values(alias)) {
441
+ for (const each of (0, linq_1.values)(alias)) {
414
442
  parsedAlias.push(getParsedAlias(each));
415
443
  }
416
- operation.details.csharp.alias = [...new Set(linq_1.values(operation.details.csharp.alias, parsedAlias).toArray())];
444
+ operation.details.csharp.alias = [...new Set((0, linq_1.values)(operation.details.csharp.alias, parsedAlias).toArray())];
417
445
  state.message({
418
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to command ${newCommandName}.`
446
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to command ${newCommandName}.`
419
447
  });
420
448
  }
421
449
  }
@@ -434,53 +462,53 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
434
462
  const formatTable = directive.set['format-table'];
435
463
  const suppressFormat = directive.set['suppress-format'];
436
464
  // select all models
437
- let models = [...(_a = state.model.schemas.objects) !== null && _a !== void 0 ? _a : []];
465
+ let models = [...(_e = state.model.schemas.objects) !== null && _e !== void 0 ? _e : []];
438
466
  // let models = values(state.model.schemas).toArray();
439
467
  if (modelNameRegex) {
440
- models = linq_1.values(models)
468
+ models = (0, linq_1.values)(models)
441
469
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(modelNameRegex); })
442
470
  .toArray();
443
471
  }
444
472
  if (modelFullNameRegex) {
445
- models = linq_1.values(models)
473
+ models = (0, linq_1.values)(models)
446
474
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.fullname}`.match(modelFullNameRegex); })
447
475
  .toArray();
448
476
  }
449
477
  if (modelNamespaceRegex) {
450
- models = linq_1.values(models)
478
+ models = (0, linq_1.values)(models)
451
479
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.namespace}`.match(modelNamespaceRegex); })
452
480
  .toArray();
453
481
  }
454
482
  if (propertyNameRegex && selectType === 'model') {
455
- models = linq_1.values(models)
483
+ models = (0, linq_1.values)(models)
456
484
  .where(model => {
457
485
  var _a;
458
- return linq_1.values(resolve_conflicts_1.allVirtualProperties((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties))
486
+ return (0, linq_1.values)((0, resolve_conflicts_1.allVirtualProperties)((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties))
459
487
  .any(property => !!`${property.name}`.match(propertyNameRegex));
460
488
  })
461
489
  .toArray();
462
490
  }
463
491
  if (propertyNameRegex && (selectType === undefined || selectType === 'property')) {
464
- const properties = linq_1.values(models)
465
- .selectMany(model => { var _a; return resolve_conflicts_1.allVirtualProperties((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties); })
492
+ const properties = (0, linq_1.values)(models)
493
+ .selectMany(model => { var _a; return (0, resolve_conflicts_1.allVirtualProperties)((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties); })
466
494
  .where(property => !!`${property.name}`.match(propertyNameRegex))
467
495
  .toArray();
468
- for (const property of linq_1.values(properties)) {
496
+ for (const property of (0, linq_1.values)(properties)) {
469
497
  const prevName = property.name;
470
498
  property.name = propertyNameReplacer ? propertyNameRegex ? property.name.replace(propertyNameRegex, propertyNameReplacer) : propertyNameReplacer : property.name;
471
499
  property.description = propertyDescriptionReplacer ? propertyDescriptionReplacer : property.description;
472
500
  if (!property.name) {
473
- 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 '' ` });
501
+ 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 '' ` });
474
502
  }
475
503
  if (propertyNameRegex) {
476
504
  state.message({
477
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed property-name from ${prevName} to ${property.name}.`
505
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed property-name from ${prevName} to ${property.name}.`
478
506
  });
479
507
  }
480
508
  }
481
509
  }
482
510
  else if (models) {
483
- for (const model of linq_1.values(models)) {
511
+ for (const model of (0, linq_1.values)(models)) {
484
512
  if (suppressFormat && model.language.csharp) {
485
513
  model.language.csharp.suppressFormat = true;
486
514
  }
@@ -488,22 +516,22 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
488
516
  const resourceGroupFormat = {};
489
517
  let ResourceGroupNameInclude = false;
490
518
  const resourceGroupName = 'resourcegroupname';
491
- const properties = resolve_conflicts_1.allVirtualProperties((_b = model.language.csharp) === null || _b === void 0 ? void 0 : _b.virtualProperties);
519
+ const properties = (0, resolve_conflicts_1.allVirtualProperties)((_f = model.language.csharp) === null || _f === void 0 ? void 0 : _f.virtualProperties);
492
520
  const propertiesToExclude = formatTable['exclude-properties'];
493
521
  const propertiesToInclude = formatTable.properties;
494
522
  const labels = formatTable.labels;
495
523
  const widths = formatTable.width;
496
- for (const property of linq_1.values(properties)) {
524
+ for (const property of (0, linq_1.values)(properties)) {
497
525
  if (property.name.toLowerCase() == resourceGroupName) {
498
526
  ResourceGroupNameInclude = true;
499
527
  }
500
528
  }
501
529
  if (labels) {
502
530
  const parsedLabels = new linq_1.Dictionary();
503
- for (const label of linq_1.items(labels)) {
531
+ for (const label of (0, linq_1.items)(labels)) {
504
532
  parsedLabels[label.key.toLowerCase()] = label.value;
505
533
  }
506
- for (const property of linq_1.values(properties)) {
534
+ for (const property of (0, linq_1.values)(properties)) {
507
535
  if (Object.keys(parsedLabels).includes(property.name.toLowerCase())) {
508
536
  if (property.format === undefined) {
509
537
  property.format = {};
@@ -517,10 +545,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
517
545
  }
518
546
  if (widths) {
519
547
  const parsedWidths = new linq_1.Dictionary();
520
- for (const w of linq_1.items(widths)) {
548
+ for (const w of (0, linq_1.items)(widths)) {
521
549
  parsedWidths[w.key.toLowerCase()] = w.value;
522
550
  }
523
- for (const property of linq_1.values(properties)) {
551
+ for (const property of (0, linq_1.values)(properties)) {
524
552
  if (Object.keys(parsedWidths).includes(property.name.toLowerCase())) {
525
553
  if (property.format === undefined) {
526
554
  property.format = {};
@@ -534,11 +562,11 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
534
562
  }
535
563
  if (propertiesToInclude) {
536
564
  const indexes = new linq_1.Dictionary();
537
- for (const item of linq_1.items(propertiesToInclude)) {
565
+ for (const item of (0, linq_1.items)(propertiesToInclude)) {
538
566
  indexes[item.value.toLowerCase()] = item.key;
539
567
  }
540
568
  let ResourceGroupNameInclude = false;
541
- for (const property of linq_1.values(properties)) {
569
+ for (const property of (0, linq_1.values)(properties)) {
542
570
  if (property.name.toLowerCase() == 'resourcegroupname') {
543
571
  ResourceGroupNameInclude = true;
544
572
  }
@@ -560,7 +588,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
560
588
  }
561
589
  }
562
590
  if (propertiesToExclude) {
563
- for (const property of linq_1.values(properties)) {
591
+ for (const property of (0, linq_1.values)(properties)) {
564
592
  if (propertiesToExclude.map(x => x.toLowerCase()).includes(property.name.toLowerCase())) {
565
593
  property.format = { suppressFormat: true };
566
594
  }
@@ -572,16 +600,16 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
572
600
  if (!ResourceGroupNameInclude && await state.getValue('azure', false)) {
573
601
  // Keep the format info for ResourceGroupName and we will need it later if resourcegroup-append is set
574
602
  const formats = await state.getValue('formats', {});
575
- formats[`${(_c = model.language.csharp) === null || _c === void 0 ? void 0 : _c.name}`] = resourceGroupFormat;
603
+ formats[`${(_g = model.language.csharp) === null || _g === void 0 ? void 0 : _g.name}`] = resourceGroupFormat;
576
604
  await state.setValue('formats', formats);
577
605
  }
578
606
  }
579
- const prevName = (_d = model.language.csharp) === null || _d === void 0 ? void 0 : _d.name;
607
+ const prevName = (_h = model.language.csharp) === null || _h === void 0 ? void 0 : _h.name;
580
608
  if (model.language.csharp) {
581
609
  model.language.csharp.name = modelNameReplacer ? modelNameRegex ? model.language.csharp.name.replace(modelNameRegex, modelNameReplacer) : modelNameReplacer : model.language.csharp.name;
582
610
  }
583
611
  state.message({
584
- 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}.`
612
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed model-name from ${prevName} to ${(_j = model.language.csharp) === null || _j === void 0 ? void 0 : _j.name}.`
585
613
  });
586
614
  }
587
615
  }
@@ -592,40 +620,40 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
592
620
  const enumValueNameRegex = getPatternToMatch(directive.where['enum-value-name']);
593
621
  const enumNameReplacer = directive.set['enum-name'];
594
622
  const enumValueNameReplacer = directive.set['enum-value-name'];
595
- let enums = [...(_f = state.model.schemas.sealedChoices) !== null && _f !== void 0 ? _f : [], ...(_g = state.model.schemas.choices) !== null && _g !== void 0 ? _g : []];
623
+ let enums = [...(_k = state.model.schemas.sealedChoices) !== null && _k !== void 0 ? _k : [], ...(_l = state.model.schemas.choices) !== null && _l !== void 0 ? _l : []];
596
624
  // let enums = values(state.model.schemas)
597
625
  // .where(each => each.details.csharp.enum !== undefined)
598
626
  // .toArray();
599
627
  if (enumNameRegex) {
600
- enums = linq_1.values(enums)
628
+ enums = (0, linq_1.values)(enums)
601
629
  .where(each => { var _a; return !!`${(_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(enumNameRegex); })
602
630
  .toArray();
603
631
  }
604
632
  if (enumValueNameRegex) {
605
- const enumsValues = linq_1.values(enums)
633
+ const enumsValues = (0, linq_1.values)(enums)
606
634
  .selectMany(each => { var _a; return ((_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.enum) ? each.language.csharp.enum.values : []; })
607
635
  .where(each => !!`${each.name}`.match(enumValueNameRegex))
608
636
  .toArray();
609
- for (const enumValue of linq_1.values(enumsValues)) {
637
+ for (const enumValue of (0, linq_1.values)(enumsValues)) {
610
638
  const prevName = enumValue.name;
611
639
  enumValue.name = enumValueNameReplacer ? enumNameRegex ? enumValue.name.replace(enumValueNameRegex, enumValueNameReplacer) : enumValueNameReplacer : prevName;
612
640
  if (enumValueNameRegex) {
613
- const enumNames = linq_1.values(enums)
641
+ const enumNames = (0, linq_1.values)(enums)
614
642
  .select(each => { var _a; return (_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name; })
615
643
  .toArray();
616
644
  state.message({
617
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-value-name from ${prevName} to ${enumValue.name}. Enum: ${JSON.stringify(enumNames, null, 2)}`
645
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-value-name from ${prevName} to ${enumValue.name}. Enum: ${JSON.stringify(enumNames, null, 2)}`
618
646
  });
619
647
  }
620
648
  }
621
649
  }
622
650
  else {
623
- for (const each of linq_1.values(enums)) {
624
- const prevName = (_j = (_h = each.language.csharp) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : '';
651
+ for (const each of (0, linq_1.values)(enums)) {
652
+ const prevName = (_o = (_m = each.language.csharp) === null || _m === void 0 ? void 0 : _m.name) !== null && _o !== void 0 ? _o : '';
625
653
  if (each.language.csharp) {
626
654
  each.language.csharp.name = enumNameReplacer ? enumNameRegex ? each.language.csharp.name.replace(enumNameRegex, enumNameReplacer) : enumNameReplacer : prevName;
627
655
  state.message({
628
- 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}.`
656
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-name from ${prevName} to ${(_p = each.language.csharp) === null || _p === void 0 ? void 0 : _p.name}.`
629
657
  });
630
658
  }
631
659
  }
@@ -641,45 +669,45 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
641
669
  const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
642
670
  if (subjectRegex || subjectPrefixRegex || verbRegex || variantRegex || (parameterRegex && selectType === 'command')) {
643
671
  // select all operations first then reduce by finding the intersection with selectors
644
- let operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
672
+ let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
645
673
  .select(operation => operation.key)
646
674
  .toArray());
647
675
  if (subjectRegex) {
648
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
676
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
649
677
  .where(operation => !!`${operation.value.details.csharp.subject}`.match(subjectRegex) && operationsToRemoveKeys.has(operation.key))
650
678
  .select(operation => operation.key)
651
679
  .toArray());
652
680
  }
653
681
  if (subjectPrefixRegex && operationsToRemoveKeys.size > 0) {
654
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
682
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
655
683
  .where(operation => !!`${operation.value.details.csharp.subjectPrefix}`.match(subjectPrefixRegex) && operationsToRemoveKeys.has(operation.key))
656
684
  .select(operation => operation.key)
657
685
  .toArray());
658
686
  }
659
687
  if (verbRegex && operationsToRemoveKeys.size > 0) {
660
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
688
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
661
689
  .where(operation => !!`${operation.value.details.csharp.verb}`.match(verbRegex) && operationsToRemoveKeys.has(operation.key))
662
690
  .select(operation => operation.key)
663
691
  .toArray());
664
692
  }
665
693
  if (variantRegex && operationsToRemoveKeys.size > 0) {
666
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
694
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
667
695
  .where(operation => !!`${operation.value.details.csharp.name}`.match(variantRegex) && operationsToRemoveKeys.has(operation.key))
668
696
  .select(operation => operation.key)
669
697
  .toArray());
670
698
  }
671
699
  if (parameterRegex && selectType === 'command' && operationsToRemoveKeys.size > 0) {
672
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
673
- .where(operation => linq_1.values(resolve_conflicts_1.allVirtualParameters(operation.value.details.csharp.virtualParameters))
700
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
701
+ .where(operation => (0, linq_1.values)((0, resolve_conflicts_1.allVirtualParameters)(operation.value.details.csharp.virtualParameters))
674
702
  .any(parameter => !!`${parameter.name}`.match(parameterRegex)))
675
703
  .where(operation => operationsToRemoveKeys.has(operation.key))
676
704
  .select(operation => operation.key)
677
705
  .toArray());
678
706
  }
679
- for (const key of linq_1.values(operationsToRemoveKeys)) {
707
+ for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
680
708
  const operationInfo = state.model.commands.operations[key].details.csharp;
681
709
  state.message({
682
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
710
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
683
711
  });
684
712
  delete state.model.commands.operations[key];
685
713
  }
@@ -688,13 +716,13 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
688
716
  }
689
717
  }
690
718
  const operationIdentities = new Set();
691
- for (const operation of linq_1.values(state.model.commands.operations)) {
719
+ for (const operation of (0, linq_1.values)(state.model.commands.operations)) {
692
720
  const details = operation.details.csharp;
693
721
  let fname = `${details.verb} -${details.subjectPrefix}${details.subject} -${details.name} `;
694
722
  let n = 1;
695
723
  while (operationIdentities.has(fname)) {
696
- details.name = codegen_1.pascalCase(`${details.name.replace(/\d*$/g, '')} ${n++}`);
697
- fname = codegen_1.pascalCase(`${details.verb} -${details.subjectPrefix}${details.subject} -${details.name}`);
724
+ details.name = (0, codegen_1.pascalCase)(`${details.name.replace(/\d*$/g, '')} ${n++}`);
725
+ fname = (0, codegen_1.pascalCase)(`${details.verb} -${details.subjectPrefix}${details.subject} -${details.name}`);
698
726
  }
699
727
  operationIdentities.add(fname);
700
728
  }
@@ -702,14 +730,14 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
702
730
  }
703
731
  async function applyModifiersV2(service) {
704
732
  // dolauli implement directives
705
- const allDirectives = await service.GetValue('directive');
706
- directives = linq_1.values(allDirectives)
733
+ const allDirectives = await service.getValue('directive');
734
+ directives = (0, linq_1.values)(allDirectives)
707
735
  // .select(directive => directive)
708
736
  .where(directive => isWhereCommandDirective(directive) || isWhereModelDirective(directive) || isWhereEnumDirective(directive) || isRemoveCommandDirective(directive))
709
737
  .toArray();
710
738
  const state = await new model_state_1.ModelState(service).init();
711
739
  const result = await tweakModel(state);
712
- await service.WriteFile('code-model-v4-modifiers-v2.yaml', codegen_1.serialize(result), undefined, 'code-model-v4');
740
+ await service.writeFile({ filename: 'code-model-v4-modifiers-v2.yaml', content: (0, codegen_1.serialize)(result), sourceMap: undefined, artifactType: 'code-model-v4' });
713
741
  }
714
742
  exports.applyModifiersV2 = applyModifiersV2;
715
743
  //# sourceMappingURL=modifiers-v2.js.map