@autorest/powershell 4.0.0-dev.8 → 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 (494) hide show
  1. package/.rush/temp/package-deps_build.json +214 -206
  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 +27 -2
  6. package/dist/cmdlets/class.d.ts.map +1 -1
  7. package/dist/cmdlets/class.js +913 -549
  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 +3 -0
  38. package/dist/internal/powershell-declarations.d.ts.map +1 -1
  39. package/dist/internal/powershell-declarations.js +5 -2
  40. package/dist/internal/powershell-declarations.js.map +1 -1
  41. package/dist/internal/project.d.ts +14 -8
  42. package/dist/internal/project.d.ts.map +1 -1
  43. package/dist/internal/project.js +27 -20
  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 +25 -11
  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 +4 -12
  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 +10 -5
  101. package/dist/llcsharp/project.d.ts.map +1 -1
  102. package/dist/llcsharp/project.js +15 -4
  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 +5 -9
  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 +17 -7
  193. package/dist/plugins/create-commands-v2.d.ts.map +1 -1
  194. package/dist/plugins/create-commands-v2.js +302 -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 +14 -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 +135 -88
  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 +39 -10
  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/resourceName.d.ts +3 -0
  297. package/dist/utils/resourceName.d.ts.map +1 -0
  298. package/dist/utils/resourceName.js +29 -0
  299. package/dist/utils/resourceName.js.map +1 -0
  300. package/dist/utils/schema.d.ts +1 -1
  301. package/dist/utils/schema.d.ts.map +1 -1
  302. package/dist/utils/schema.js +11 -11
  303. package/dist/utils/schema.js.map +1 -1
  304. package/dist/utils/security-scheme.d.ts +2 -2
  305. package/dist/utils/security-scheme.d.ts.map +1 -1
  306. package/dist/utils/security-scheme.js +2 -2
  307. package/dist/utils/security-scheme.js.map +1 -1
  308. package/dist/utils/sort-parameters.d.ts +3 -0
  309. package/dist/utils/sort-parameters.d.ts.map +1 -0
  310. package/dist/utils/sort-parameters.js +33 -0
  311. package/dist/utils/sort-parameters.js.map +1 -0
  312. package/dist/utils/tsp-generator.d.ts +3 -0
  313. package/dist/utils/tsp-generator.d.ts.map +1 -0
  314. package/dist/utils/tsp-generator.js +65 -0
  315. package/dist/utils/tsp-generator.js.map +1 -0
  316. package/dist/utils/tsp-host.d.ts +42 -0
  317. package/dist/utils/tsp-host.d.ts.map +1 -0
  318. package/dist/utils/tsp-host.js +56 -0
  319. package/dist/utils/tsp-host.js.map +1 -0
  320. package/generators/readme.ts +0 -3
  321. package/package.json +11 -10
  322. package/resources/assets/build-module.ps1 +31 -4
  323. package/resources/assets/check-dependencies.ps1 +3 -3
  324. package/resources/assets/create-model-cmdlets.ps1 +34 -5
  325. package/resources/assets/export-surface.ps1 +3 -3
  326. package/resources/assets/generate-help.ps1 +5 -5
  327. package/resources/assets/generate-portal-ux.ps1 +9 -25
  328. package/resources/assets/run-module.ps1 +4 -4
  329. package/resources/assets/test/loadEnv.ps1 +1 -1
  330. package/resources/assets/test-module.ps1 +11 -7
  331. package/resources/assets/tools/Resources/README.md +0 -3
  332. package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +2 -2
  333. package/resources/assets/tools/Resources/how-to.md +2 -0
  334. package/resources/built-time-cmdlets.csproj +1 -0
  335. package/resources/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml +554 -0
  336. package/resources/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml +471 -0
  337. package/resources/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml +306 -0
  338. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Az.Accounts.nuspec +4 -5
  339. package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 +389 -0
  340. package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 +365 -0
  341. package/resources/modules/Az.Accounts/2.13.1/FuzzySharp.dll +0 -0
  342. package/resources/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll +0 -0
  343. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll +0 -0
  344. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  345. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  346. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  347. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  348. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  349. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  350. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
  351. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
  352. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  353. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
  354. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
  355. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
  356. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
  357. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  358. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
  359. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
  360. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  361. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +2510 -779
  362. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  363. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
  364. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
  365. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
  366. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll +0 -0
  367. package/resources/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 +222 -0
  368. package/resources/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 +281 -0
  369. package/resources/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 +242 -0
  370. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/[Content_Types].xml +2 -3
  371. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/_rels/.rels +2 -2
  372. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll +0 -0
  373. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll +0 -0
  374. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  375. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll +0 -0
  376. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  377. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll +0 -0
  378. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll +0 -0
  379. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll +0 -0
  380. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll +0 -0
  381. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  382. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll +0 -0
  383. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll +0 -0
  384. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll +0 -0
  385. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll +0 -0
  386. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll +0 -0
  387. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll +0 -0
  388. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll +0 -0
  389. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll +0 -0
  390. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll +0 -0
  391. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll +0 -0
  392. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll +0 -0
  393. package/resources/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp +11 -0
  394. package/resources/psruntime/Attributes/PSArgumentCompleterAttribute.cs +52 -0
  395. package/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +4 -1
  396. package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +6 -3
  397. package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +7 -4
  398. package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +130 -81
  399. package/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs +64 -0
  400. package/resources/psruntime/BuildTime/MarkdownRenderer.cs +17 -9
  401. package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +53 -8
  402. package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +35 -11
  403. package/resources/psruntime/BuildTime/PsAttributes.cs +5 -0
  404. package/resources/psruntime/BuildTime/PsHelpers.cs +4 -3
  405. package/resources/psruntime/MessageAttribute.cs +45 -55
  406. package/resources/psruntime/MessageAttributeHelper.cs +30 -7
  407. package/resources/psruntime/Properties/Resources.Designer.cs +25 -3
  408. package/resources/psruntime/Properties/Resources.resx +8 -2
  409. package/resources/runtime/csharp/pipeline/ISendAsync.cs +113 -0
  410. package/resources/runtime/csharp/pipeline/PipelineMocking.cs +1 -1
  411. package/resources/templates/azureMethod.ejs +2 -2
  412. package/resources/templates/azureMethodGroup.ejs +2 -2
  413. package/resources/templates/azureServiceClient.ejs +11 -4
  414. package/resources/templates/enum.ejs +3 -3
  415. package/resources/templates/extensionMethod.ejs +18 -12
  416. package/resources/templates/extensions.ejs +9 -2
  417. package/resources/templates/longRunningOperationMethod.ejs +10 -8
  418. package/resources/templates/method.ejs +10 -8
  419. package/resources/templates/methodBodyRestCall.ejs +77 -32
  420. package/resources/templates/methodGroupInterface.ejs +2 -61
  421. package/resources/templates/methodGroupInterfaceBody.ejs +60 -0
  422. package/resources/templates/model.ejs +15 -15
  423. package/resources/templates/serviceClientBody.ejs +8 -8
  424. package/resources/templates/serviceClientInterface.ejs +10 -4
  425. package/resources/utils/Get-SubscriptionIdTestSafe.ps1 +7 -0
  426. package/dist/utils/WrapComments.d.ts +0 -2
  427. package/dist/utils/WrapComments.d.ts.map +0 -1
  428. package/dist/utils/WrapComments.js +0 -46
  429. package/dist/utils/WrapComments.js.map +0 -1
  430. package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +0 -496
  431. package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +0 -468
  432. package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +0 -303
  433. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +0 -387
  434. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +0 -375
  435. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
  436. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
  437. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  438. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
  439. package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
  440. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  441. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +0 -2309
  442. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  443. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json +0 -2273
  444. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  445. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json +0 -1316
  446. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  447. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  448. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  449. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  450. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  451. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +0 -2413
  452. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  453. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  454. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
  455. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
  456. package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +0 -219
  457. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
  458. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
  459. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  460. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  461. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  462. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
  463. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
  464. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll +0 -0
  465. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
  466. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
  467. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
  468. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  469. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
  470. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll +0 -0
  471. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
  472. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
  473. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +0 -278
  474. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +0 -234
  475. package/resources/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp +0 -11
  476. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Hyak.Common.dll +0 -0
  477. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.Common.dll +0 -0
  478. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
  479. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
  480. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.dll +0 -0
  481. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/en-US/about_az.help.txt +0 -0
  482. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Numerics.Vectors.dll +0 -0
  483. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Security.Cryptography.Cng.dll +0 -0
  484. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Text.Encodings.Web.dll +0 -0
  485. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Xml.ReaderWriter.dll +0 -0
  486. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  487. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Buffers.dll +0 -0
  488. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.Data.dll +0 -0
  489. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.dll +0 -0
  490. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Net.Http.WinHttpHandler.dll +0 -0
  491. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Private.ServiceModel.dll +0 -0
  492. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.ServiceModel.Primitives.dll +0 -0
  493. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Text.Json.dll +0 -0
  494. /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,8 +172,35 @@ 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;
185
+ const isAzure = await state.getValue('azure', false) || await state.getValue('azure-arm', false);
186
+ const removePecAndPlr = !await state.getValue('keep-pec-and-plr', isAzure ? false : true);
187
+ if (removePecAndPlr) {
188
+ const PecOrPlrRegex = '^PrivateEndpointConnection$|^PrivateLinkResource$';
189
+ let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
190
+ .select(operation => operation.key)
191
+ .toArray());
192
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
193
+ .where(operation => !!`${operation.value.details.csharp.subject}`.match(PecOrPlrRegex) && operationsToRemoveKeys.has(operation.key))
194
+ .select(operation => operation.key)
195
+ .toArray());
196
+ for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
197
+ const operationInfo = state.model.commands.operations[key].details.csharp;
198
+ state.message({
199
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
200
+ });
201
+ delete state.model.commands.operations[key];
202
+ }
203
+ }
176
204
  // only look at directives without the `transform` node.
177
205
  // dolauli for directives with transform are implemented in autorest core
178
206
  for (const directive of directives.filter(each => !each.transform)) {
@@ -187,6 +215,7 @@ async function tweakModel(state) {
187
215
  const verbRegex = getPatternToMatch(directive.where.verb);
188
216
  const variantRegex = getPatternToMatch(directive.where.variant);
189
217
  const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
218
+ const SupportsShouldProcess = (directive.set !== undefined) ? directive.set['suppress-should-process'] : undefined;
190
219
  const alias = (directive.set !== undefined) ?
191
220
  (directive.set.alias !== undefined) ?
192
221
  !Array.isArray(directive.set.alias) ?
@@ -195,41 +224,42 @@ async function tweakModel(state) {
195
224
  : undefined
196
225
  : undefined;
197
226
  const breakingChange = (directive.set !== undefined) ? directive.set['breaking-change'] : undefined;
198
- const previewMessage = (directive.set !== undefined) ? directive.set['preview-message'] : undefined;
227
+ const previewAnnouncement = (directive.set !== undefined) ? directive.set['preview-announcement'] : undefined;
199
228
  const subjectReplacer = (directive.set !== undefined) ? directive.set['subject'] : undefined;
200
229
  const subjectPrefixReplacer = (directive.set !== undefined) ? directive.set['subject-prefix'] : undefined;
201
230
  const verbReplacer = (directive.set !== undefined) ? directive.set.verb : undefined;
202
231
  const variantReplacer = (directive.set !== undefined) ? directive.set.variant : undefined;
203
232
  const parameterReplacer = (directive.set !== undefined) ? directive.set['parameter-name'] : undefined;
204
233
  const paramDescriptionReplacer = (directive.set !== undefined) ? directive.set['parameter-description'] : undefined;
234
+ const commandDescriptionReplacer = (directive.set !== undefined) ? directive.set['command-description'] : undefined;
205
235
  const paramCompleterReplacer = (directive.set !== undefined) ? directive.set['completer'] : undefined;
206
236
  const paramDefaultReplacer = (directive.set !== undefined) ? directive.set['default'] : undefined;
207
237
  const cliensidePagination = (directive.set !== undefined) ? directive.set['clientside-pagination'] : undefined;
208
238
  // select all operations
209
- let operations = linq_1.values(state.model.commands.operations).toArray();
239
+ let operations = (0, linq_1.values)(state.model.commands.operations).toArray();
210
240
  if (subjectRegex) {
211
- operations = linq_1.values(operations)
241
+ operations = (0, linq_1.values)(operations)
212
242
  .where(operation => !!`${operation.details.csharp.subject}`.match(subjectRegex))
213
243
  .toArray();
214
244
  }
215
245
  if (subjectPrefixRegex) {
216
- operations = linq_1.values(operations)
246
+ operations = (0, linq_1.values)(operations)
217
247
  .where(operation => !!`${operation.details.csharp.subjectPrefix}`.match(subjectPrefixRegex))
218
248
  .toArray();
219
249
  }
220
250
  if (verbRegex) {
221
- operations = linq_1.values(operations)
251
+ operations = (0, linq_1.values)(operations)
222
252
  .where(operation => !!`${operation.details.csharp.verb}`.match(verbRegex))
223
253
  .toArray();
224
254
  }
225
255
  if (variantRegex) {
226
- operations = linq_1.values(operations)
256
+ operations = (0, linq_1.values)(operations)
227
257
  .where(operation => !!`${operation.details.csharp.name}`.match(variantRegex))
228
258
  .toArray();
229
259
  }
230
260
  if (parameterRegex && selectType === 'command') {
231
- operations = linq_1.values(operations)
232
- .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))
233
263
  .any(parameter => !!`${parameter.name}`.match(parameterRegex)))
234
264
  .toArray();
235
265
  }
@@ -242,11 +272,11 @@ async function tweakModel(state) {
242
272
  await addPipelines(state, operations, directive.add.pipelines);
243
273
  }
244
274
  if (parameterRegex && (selectType === undefined || selectType === 'parameter')) {
245
- const parameters = linq_1.values(operations)
246
- .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))
247
277
  .where(parameter => !!`${parameter.name}`.match(parameterRegex))
248
278
  .toArray();
249
- for (const p of linq_1.values(parameters)) {
279
+ for (const p of (0, linq_1.values)(parameters)) {
250
280
  const parameter = p;
251
281
  const prevName = parameter.name;
252
282
  parameter.name = parameterReplacer ? parameterRegex ? parameter.name.replace(parameterRegex, parameterReplacer) : parameterReplacer : parameter.name;
@@ -262,15 +292,20 @@ async function tweakModel(state) {
262
292
  parameter.breakingChange.oldParamaterType = (breakingChange && breakingChange['old-parameter-type']) ? breakingChange['old-parameter-type'] : undefined;
263
293
  parameter.breakingChange.newParameterType = (breakingChange && breakingChange['new-parameter-type']) ? breakingChange['new-parameter-type'] : undefined;
264
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;
265
296
  parameter.breakingChange.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
266
297
  parameter.breakingChange.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
267
298
  }
268
299
  // handle preview message for parameter
269
- 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
+ }
270
305
  if (clearAlias) {
271
306
  parameter.alias = [];
272
307
  state.message({
273
- 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}.`
274
309
  });
275
310
  }
276
311
  // handle hiding parameters
@@ -282,34 +317,38 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
282
317
  p.required = false;
283
318
  p.hidden = true;
284
319
  state.message({
285
- Channel: autorest_extension_base_1.Channel.Debug,
320
+ Channel: extension_base_1.Channel.Debug,
286
321
  Text: `[DIRECTIVE] Hide parameter ${p.name}.`,
287
322
  });
288
323
  }
289
324
  if (alias) {
290
325
  const parsedAlias = new Array();
291
- for (const each of linq_1.values(alias)) {
326
+ for (const each of (0, linq_1.values)(alias)) {
292
327
  parsedAlias.push(hasSpecialChars(each) ? prevName.replace(parameterRegex, each) : each);
293
328
  }
294
- parameter.alias = [...new Set(linq_1.values(parameter.alias, parsedAlias).toArray())];
329
+ parameter.alias = [...new Set((0, linq_1.values)(parameter.alias, parsedAlias).toArray())];
295
330
  state.message({
296
- 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}.`
297
332
  });
298
333
  }
299
334
  if (parameterReplacer) {
300
335
  state.message({
301
- 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}.`
302
337
  });
303
338
  }
304
339
  if (paramDescriptionReplacer) {
305
340
  state.message({
306
- 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}.`
307
342
  });
308
343
  }
309
344
  }
310
345
  }
311
346
  else if (operations) {
312
- 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
+ }
313
352
  const getCmdletName = (verb, subjectPrefix, subject, variantName) => {
314
353
  return `${verb}-${subjectPrefix}${subject}${variantName ? `_${variantName}` : ''}`;
315
354
  };
@@ -324,6 +363,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
324
363
  operation.details.csharp.verb = verbReplacer ? verbRegex ? prevVerb.replace(verbRegex, verbReplacer) : verbReplacer : prevVerb;
325
364
  operation.details.csharp.name = variantReplacer ? variantRegex ? prevVariantName.replace(variantRegex, variantReplacer) : variantReplacer : prevVariantName;
326
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;
327
367
  const newSubject = operation.details.csharp.subject;
328
368
  const newSubjectPrefix = operation.details.csharp.subjectPrefix;
329
369
  const newVerb = operation.details.csharp.verb;
@@ -338,6 +378,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
338
378
  // handle parameter breaking change for variant
339
379
  operation.details.csharp.breakingChange.variant = {};
340
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;
341
382
  operation.details.csharp.breakingChange.variant.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
342
383
  operation.details.csharp.breakingChange.variant.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
343
384
  operation.details.csharp.breakingChange.variant.name = newVariantName;
@@ -351,6 +392,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
351
392
  operation.details.csharp.breakingChange.output.deprecatedOutputProperties = (breakingChange && breakingChange['deprecated-output-properties']) ? breakingChange['deprecated-output-properties'] : undefined;
352
393
  operation.details.csharp.breakingChange.output.newOutputProperties = (breakingChange && breakingChange['new-output-properties']) ? breakingChange['new-output-properties'] : undefined;
353
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;
354
396
  operation.details.csharp.breakingChange.output.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
355
397
  operation.details.csharp.breakingChange.output.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
356
398
  }
@@ -359,9 +401,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
359
401
  operation.details.csharp.breakingChange.cmdlet = {};
360
402
  operation.details.csharp.breakingChange.cmdlet.replacement = (breakingChange && breakingChange['replacement-cmdlet']) ? breakingChange['replacement-cmdlet'] : undefined;
361
403
  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]}"`));
404
+ operation.details.csharp.breakingChange.cmdlet.replacement = (0, codegen_1.safeEval)(operation.details.csharp.breakingChange.cmdlet.replacement.replace('$', `"${newCommandName.split('_')[0]}"`));
363
405
  }
364
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;
365
408
  operation.details.csharp.breakingChange.cmdlet.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
366
409
  operation.details.csharp.breakingChange.cmdlet.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
367
410
  operation.details.csharp.breakingChange.cmdlet.name = newCommandName.split('_')[0];
@@ -369,18 +412,22 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
369
412
  }
370
413
  }
371
414
  // handle preview message for cmdlet
372
- 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
+ }
373
420
  // just the subject prefix can be an empty string
374
421
  if (subjectPrefixReplacer !== undefined || subjectReplacer || verbReplacer || variantReplacer) {
375
422
  const modificationMessage = `[DIRECTIVE] Changed command from ${oldCommandName} to ${newCommandName}. `;
376
423
  state.message({
377
- Channel: autorest_extension_base_1.Channel.Debug, Text: modificationMessage
424
+ Channel: extension_base_1.Channel.Debug, Text: modificationMessage
378
425
  });
379
426
  }
380
427
  if (clearAlias) {
381
428
  operation.details.csharp.alias = [];
382
429
  state.message({
383
- 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}.`
384
431
  });
385
432
  }
386
433
  if (alias) {
@@ -391,12 +438,12 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
391
438
  .replace('${variant}', operation.details.csharp.name);
392
439
  };
393
440
  const parsedAlias = new Array();
394
- for (const each of linq_1.values(alias)) {
441
+ for (const each of (0, linq_1.values)(alias)) {
395
442
  parsedAlias.push(getParsedAlias(each));
396
443
  }
397
- 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())];
398
445
  state.message({
399
- 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}.`
400
447
  });
401
448
  }
402
449
  }
@@ -415,53 +462,53 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
415
462
  const formatTable = directive.set['format-table'];
416
463
  const suppressFormat = directive.set['suppress-format'];
417
464
  // select all models
418
- 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 : []];
419
466
  // let models = values(state.model.schemas).toArray();
420
467
  if (modelNameRegex) {
421
- models = linq_1.values(models)
468
+ models = (0, linq_1.values)(models)
422
469
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(modelNameRegex); })
423
470
  .toArray();
424
471
  }
425
472
  if (modelFullNameRegex) {
426
- models = linq_1.values(models)
473
+ models = (0, linq_1.values)(models)
427
474
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.fullname}`.match(modelFullNameRegex); })
428
475
  .toArray();
429
476
  }
430
477
  if (modelNamespaceRegex) {
431
- models = linq_1.values(models)
478
+ models = (0, linq_1.values)(models)
432
479
  .where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.namespace}`.match(modelNamespaceRegex); })
433
480
  .toArray();
434
481
  }
435
482
  if (propertyNameRegex && selectType === 'model') {
436
- models = linq_1.values(models)
483
+ models = (0, linq_1.values)(models)
437
484
  .where(model => {
438
485
  var _a;
439
- 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))
440
487
  .any(property => !!`${property.name}`.match(propertyNameRegex));
441
488
  })
442
489
  .toArray();
443
490
  }
444
491
  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); })
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); })
447
494
  .where(property => !!`${property.name}`.match(propertyNameRegex))
448
495
  .toArray();
449
- for (const property of linq_1.values(properties)) {
496
+ for (const property of (0, linq_1.values)(properties)) {
450
497
  const prevName = property.name;
451
498
  property.name = propertyNameReplacer ? propertyNameRegex ? property.name.replace(propertyNameRegex, propertyNameReplacer) : propertyNameReplacer : property.name;
452
499
  property.description = propertyDescriptionReplacer ? propertyDescriptionReplacer : property.description;
453
500
  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 '' ` });
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 '' ` });
455
502
  }
456
503
  if (propertyNameRegex) {
457
504
  state.message({
458
- 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}.`
459
506
  });
460
507
  }
461
508
  }
462
509
  }
463
510
  else if (models) {
464
- for (const model of linq_1.values(models)) {
511
+ for (const model of (0, linq_1.values)(models)) {
465
512
  if (suppressFormat && model.language.csharp) {
466
513
  model.language.csharp.suppressFormat = true;
467
514
  }
@@ -469,22 +516,22 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
469
516
  const resourceGroupFormat = {};
470
517
  let ResourceGroupNameInclude = false;
471
518
  const resourceGroupName = 'resourcegroupname';
472
- 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);
473
520
  const propertiesToExclude = formatTable['exclude-properties'];
474
521
  const propertiesToInclude = formatTable.properties;
475
522
  const labels = formatTable.labels;
476
523
  const widths = formatTable.width;
477
- for (const property of linq_1.values(properties)) {
524
+ for (const property of (0, linq_1.values)(properties)) {
478
525
  if (property.name.toLowerCase() == resourceGroupName) {
479
526
  ResourceGroupNameInclude = true;
480
527
  }
481
528
  }
482
529
  if (labels) {
483
530
  const parsedLabels = new linq_1.Dictionary();
484
- for (const label of linq_1.items(labels)) {
531
+ for (const label of (0, linq_1.items)(labels)) {
485
532
  parsedLabels[label.key.toLowerCase()] = label.value;
486
533
  }
487
- for (const property of linq_1.values(properties)) {
534
+ for (const property of (0, linq_1.values)(properties)) {
488
535
  if (Object.keys(parsedLabels).includes(property.name.toLowerCase())) {
489
536
  if (property.format === undefined) {
490
537
  property.format = {};
@@ -498,10 +545,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
498
545
  }
499
546
  if (widths) {
500
547
  const parsedWidths = new linq_1.Dictionary();
501
- for (const w of linq_1.items(widths)) {
548
+ for (const w of (0, linq_1.items)(widths)) {
502
549
  parsedWidths[w.key.toLowerCase()] = w.value;
503
550
  }
504
- for (const property of linq_1.values(properties)) {
551
+ for (const property of (0, linq_1.values)(properties)) {
505
552
  if (Object.keys(parsedWidths).includes(property.name.toLowerCase())) {
506
553
  if (property.format === undefined) {
507
554
  property.format = {};
@@ -515,11 +562,11 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
515
562
  }
516
563
  if (propertiesToInclude) {
517
564
  const indexes = new linq_1.Dictionary();
518
- for (const item of linq_1.items(propertiesToInclude)) {
565
+ for (const item of (0, linq_1.items)(propertiesToInclude)) {
519
566
  indexes[item.value.toLowerCase()] = item.key;
520
567
  }
521
568
  let ResourceGroupNameInclude = false;
522
- for (const property of linq_1.values(properties)) {
569
+ for (const property of (0, linq_1.values)(properties)) {
523
570
  if (property.name.toLowerCase() == 'resourcegroupname') {
524
571
  ResourceGroupNameInclude = true;
525
572
  }
@@ -541,7 +588,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
541
588
  }
542
589
  }
543
590
  if (propertiesToExclude) {
544
- for (const property of linq_1.values(properties)) {
591
+ for (const property of (0, linq_1.values)(properties)) {
545
592
  if (propertiesToExclude.map(x => x.toLowerCase()).includes(property.name.toLowerCase())) {
546
593
  property.format = { suppressFormat: true };
547
594
  }
@@ -553,16 +600,16 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
553
600
  if (!ResourceGroupNameInclude && await state.getValue('azure', false)) {
554
601
  // Keep the format info for ResourceGroupName and we will need it later if resourcegroup-append is set
555
602
  const formats = await state.getValue('formats', {});
556
- 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;
557
604
  await state.setValue('formats', formats);
558
605
  }
559
606
  }
560
- 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;
561
608
  if (model.language.csharp) {
562
609
  model.language.csharp.name = modelNameReplacer ? modelNameRegex ? model.language.csharp.name.replace(modelNameRegex, modelNameReplacer) : modelNameReplacer : model.language.csharp.name;
563
610
  }
564
611
  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}.`
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}.`
566
613
  });
567
614
  }
568
615
  }
@@ -573,40 +620,40 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
573
620
  const enumValueNameRegex = getPatternToMatch(directive.where['enum-value-name']);
574
621
  const enumNameReplacer = directive.set['enum-name'];
575
622
  const enumValueNameReplacer = directive.set['enum-value-name'];
576
- 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 : []];
577
624
  // let enums = values(state.model.schemas)
578
625
  // .where(each => each.details.csharp.enum !== undefined)
579
626
  // .toArray();
580
627
  if (enumNameRegex) {
581
- enums = linq_1.values(enums)
628
+ enums = (0, linq_1.values)(enums)
582
629
  .where(each => { var _a; return !!`${(_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(enumNameRegex); })
583
630
  .toArray();
584
631
  }
585
632
  if (enumValueNameRegex) {
586
- const enumsValues = linq_1.values(enums)
633
+ const enumsValues = (0, linq_1.values)(enums)
587
634
  .selectMany(each => { var _a; return ((_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.enum) ? each.language.csharp.enum.values : []; })
588
635
  .where(each => !!`${each.name}`.match(enumValueNameRegex))
589
636
  .toArray();
590
- for (const enumValue of linq_1.values(enumsValues)) {
637
+ for (const enumValue of (0, linq_1.values)(enumsValues)) {
591
638
  const prevName = enumValue.name;
592
639
  enumValue.name = enumValueNameReplacer ? enumNameRegex ? enumValue.name.replace(enumValueNameRegex, enumValueNameReplacer) : enumValueNameReplacer : prevName;
593
640
  if (enumValueNameRegex) {
594
- const enumNames = linq_1.values(enums)
641
+ const enumNames = (0, linq_1.values)(enums)
595
642
  .select(each => { var _a; return (_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name; })
596
643
  .toArray();
597
644
  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)}`
645
+ Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-value-name from ${prevName} to ${enumValue.name}. Enum: ${JSON.stringify(enumNames, null, 2)}`
599
646
  });
600
647
  }
601
648
  }
602
649
  }
603
650
  else {
604
- for (const each of linq_1.values(enums)) {
605
- 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 : '';
606
653
  if (each.language.csharp) {
607
654
  each.language.csharp.name = enumNameReplacer ? enumNameRegex ? each.language.csharp.name.replace(enumNameRegex, enumNameReplacer) : enumNameReplacer : prevName;
608
655
  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}.`
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}.`
610
657
  });
611
658
  }
612
659
  }
@@ -622,45 +669,45 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
622
669
  const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
623
670
  if (subjectRegex || subjectPrefixRegex || verbRegex || variantRegex || (parameterRegex && selectType === 'command')) {
624
671
  // select all operations first then reduce by finding the intersection with selectors
625
- let operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
672
+ let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
626
673
  .select(operation => operation.key)
627
674
  .toArray());
628
675
  if (subjectRegex) {
629
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
676
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
630
677
  .where(operation => !!`${operation.value.details.csharp.subject}`.match(subjectRegex) && operationsToRemoveKeys.has(operation.key))
631
678
  .select(operation => operation.key)
632
679
  .toArray());
633
680
  }
634
681
  if (subjectPrefixRegex && operationsToRemoveKeys.size > 0) {
635
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
682
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
636
683
  .where(operation => !!`${operation.value.details.csharp.subjectPrefix}`.match(subjectPrefixRegex) && operationsToRemoveKeys.has(operation.key))
637
684
  .select(operation => operation.key)
638
685
  .toArray());
639
686
  }
640
687
  if (verbRegex && operationsToRemoveKeys.size > 0) {
641
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
688
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
642
689
  .where(operation => !!`${operation.value.details.csharp.verb}`.match(verbRegex) && operationsToRemoveKeys.has(operation.key))
643
690
  .select(operation => operation.key)
644
691
  .toArray());
645
692
  }
646
693
  if (variantRegex && operationsToRemoveKeys.size > 0) {
647
- operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
694
+ operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
648
695
  .where(operation => !!`${operation.value.details.csharp.name}`.match(variantRegex) && operationsToRemoveKeys.has(operation.key))
649
696
  .select(operation => operation.key)
650
697
  .toArray());
651
698
  }
652
699
  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))
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))
655
702
  .any(parameter => !!`${parameter.name}`.match(parameterRegex)))
656
703
  .where(operation => operationsToRemoveKeys.has(operation.key))
657
704
  .select(operation => operation.key)
658
705
  .toArray());
659
706
  }
660
- for (const key of linq_1.values(operationsToRemoveKeys)) {
707
+ for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
661
708
  const operationInfo = state.model.commands.operations[key].details.csharp;
662
709
  state.message({
663
- 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}` : ''}`
664
711
  });
665
712
  delete state.model.commands.operations[key];
666
713
  }
@@ -669,13 +716,13 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
669
716
  }
670
717
  }
671
718
  const operationIdentities = new Set();
672
- for (const operation of linq_1.values(state.model.commands.operations)) {
719
+ for (const operation of (0, linq_1.values)(state.model.commands.operations)) {
673
720
  const details = operation.details.csharp;
674
- let fname = `${details.verb} -${details.subject} -${details.name} `;
721
+ let fname = `${details.verb} -${details.subjectPrefix}${details.subject} -${details.name} `;
675
722
  let n = 1;
676
723
  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}`);
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}`);
679
726
  }
680
727
  operationIdentities.add(fname);
681
728
  }
@@ -683,14 +730,14 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
683
730
  }
684
731
  async function applyModifiersV2(service) {
685
732
  // dolauli implement directives
686
- const allDirectives = await service.GetValue('directive');
687
- directives = linq_1.values(allDirectives)
733
+ const allDirectives = await service.getValue('directive');
734
+ directives = (0, linq_1.values)(allDirectives)
688
735
  // .select(directive => directive)
689
736
  .where(directive => isWhereCommandDirective(directive) || isWhereModelDirective(directive) || isWhereEnumDirective(directive) || isRemoveCommandDirective(directive))
690
737
  .toArray();
691
738
  const state = await new model_state_1.ModelState(service).init();
692
739
  const result = await tweakModel(state);
693
- 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' });
694
741
  }
695
742
  exports.applyModifiersV2 = applyModifiersV2;
696
743
  //# sourceMappingURL=modifiers-v2.js.map