@autorest/powershell 2.1.400 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/.rush/temp/package-deps_build.json +350 -0
  2. package/.rush/temp/shrinkwrap-deps.json +433 -0
  3. package/autorest-configuration.md +60 -47
  4. package/dist/cmdlets/class.d.ts +21 -8
  5. package/dist/cmdlets/class.d.ts.map +1 -1
  6. package/dist/cmdlets/class.js +475 -151
  7. package/dist/cmdlets/class.js.map +1 -1
  8. package/dist/cmdlets/namespace.d.ts.map +1 -1
  9. package/dist/cmdlets/namespace.js +1 -0
  10. package/dist/cmdlets/namespace.js.map +1 -1
  11. package/dist/enums/namespace.d.ts.map +1 -1
  12. package/dist/enums/namespace.js +17 -10
  13. package/dist/enums/namespace.js.map +1 -1
  14. package/dist/generators/csproj.d.ts.map +1 -1
  15. package/dist/generators/csproj.js +2 -1
  16. package/dist/generators/csproj.js.map +1 -1
  17. package/dist/generators/gitignore.d.ts.map +1 -1
  18. package/dist/generators/gitignore.js +1 -0
  19. package/dist/generators/gitignore.js.map +1 -1
  20. package/dist/generators/nuspec.d.ts.map +1 -1
  21. package/dist/generators/nuspec.js +4 -3
  22. package/dist/generators/nuspec.js.map +1 -1
  23. package/dist/generators/psm1.d.ts.map +1 -1
  24. package/dist/generators/psm1.js +24 -15
  25. package/dist/generators/psm1.js.map +1 -1
  26. package/dist/generators/script-cmdlet.d.ts.map +1 -1
  27. package/dist/generators/script-cmdlet.js +1 -1
  28. package/dist/generators/script-cmdlet.js.map +1 -1
  29. package/dist/internal/name-inferrer.d.ts.map +1 -1
  30. package/dist/internal/name-inferrer.js +2 -0
  31. package/dist/internal/name-inferrer.js.map +1 -1
  32. package/dist/internal/project.d.ts +46 -5
  33. package/dist/internal/project.d.ts.map +1 -1
  34. package/dist/internal/project.js +72 -13
  35. package/dist/internal/project.js.map +1 -1
  36. package/dist/internal/state.d.ts +3 -2
  37. package/dist/internal/state.d.ts.map +1 -1
  38. package/dist/internal/state.js +3 -3
  39. package/dist/internal/state.js.map +1 -1
  40. package/dist/llcsharp/clientruntime.d.ts +5 -0
  41. package/dist/llcsharp/clientruntime.d.ts.map +1 -1
  42. package/dist/llcsharp/clientruntime.js +5 -0
  43. package/dist/llcsharp/clientruntime.js.map +1 -1
  44. package/dist/llcsharp/enums/enum.d.ts +2 -2
  45. package/dist/llcsharp/enums/enum.d.ts.map +1 -1
  46. package/dist/llcsharp/enums/enum.js +11 -10
  47. package/dist/llcsharp/enums/enum.js.map +1 -1
  48. package/dist/llcsharp/generator.d.ts +3 -3
  49. package/dist/llcsharp/generator.d.ts.map +1 -1
  50. package/dist/llcsharp/generator.js +4 -2
  51. package/dist/llcsharp/generator.js.map +1 -1
  52. package/dist/llcsharp/model/interface.d.ts +3 -2
  53. package/dist/llcsharp/model/interface.d.ts.map +1 -1
  54. package/dist/llcsharp/model/interface.js +68 -17
  55. package/dist/llcsharp/model/interface.js.map +1 -1
  56. package/dist/llcsharp/model/model-class-dictionary.d.ts.map +1 -1
  57. package/dist/llcsharp/model/model-class-dictionary.js +12 -6
  58. package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
  59. package/dist/llcsharp/model/model-class-json.d.ts.map +1 -1
  60. package/dist/llcsharp/model/model-class-json.js +20 -12
  61. package/dist/llcsharp/model/model-class-json.js.map +1 -1
  62. package/dist/llcsharp/model/model-class-serializer.d.ts +9 -21
  63. package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
  64. package/dist/llcsharp/model/model-class-serializer.js +21 -50
  65. package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
  66. package/dist/llcsharp/model/model-class.d.ts +7 -4
  67. package/dist/llcsharp/model/model-class.d.ts.map +1 -1
  68. package/dist/llcsharp/model/model-class.js +147 -82
  69. package/dist/llcsharp/model/model-class.js.map +1 -1
  70. package/dist/llcsharp/model/namespace.d.ts +4 -4
  71. package/dist/llcsharp/model/namespace.d.ts.map +1 -1
  72. package/dist/llcsharp/model/namespace.js +40 -18
  73. package/dist/llcsharp/model/namespace.js.map +1 -1
  74. package/dist/llcsharp/model/property.d.ts +4 -4
  75. package/dist/llcsharp/model/property.d.ts.map +1 -1
  76. package/dist/llcsharp/model/property.js +9 -7
  77. package/dist/llcsharp/model/property.js.map +1 -1
  78. package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
  79. package/dist/llcsharp/operation/api-class.js +24 -23
  80. package/dist/llcsharp/operation/api-class.js.map +1 -1
  81. package/dist/llcsharp/operation/method.d.ts +7 -5
  82. package/dist/llcsharp/operation/method.d.ts.map +1 -1
  83. package/dist/llcsharp/operation/method.js +157 -93
  84. package/dist/llcsharp/operation/method.js.map +1 -1
  85. package/dist/llcsharp/operation/namespace.js +2 -1
  86. package/dist/llcsharp/operation/namespace.js.map +1 -1
  87. package/dist/llcsharp/operation/parameter.d.ts +4 -4
  88. package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
  89. package/dist/llcsharp/operation/parameter.js +7 -5
  90. package/dist/llcsharp/operation/parameter.js.map +1 -1
  91. package/dist/llcsharp/project.d.ts +4 -0
  92. package/dist/llcsharp/project.d.ts.map +1 -1
  93. package/dist/llcsharp/project.js +7 -2
  94. package/dist/llcsharp/project.js.map +1 -1
  95. package/dist/llcsharp/schema/Uuid.d.ts +2 -2
  96. package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
  97. package/dist/llcsharp/schema/Uuid.js.map +1 -1
  98. package/dist/llcsharp/schema/array.d.ts +3 -3
  99. package/dist/llcsharp/schema/array.d.ts.map +1 -1
  100. package/dist/llcsharp/schema/array.js +15 -8
  101. package/dist/llcsharp/schema/array.js.map +1 -1
  102. package/dist/llcsharp/schema/binary.d.ts +3 -3
  103. package/dist/llcsharp/schema/binary.d.ts.map +1 -1
  104. package/dist/llcsharp/schema/binary.js.map +1 -1
  105. package/dist/llcsharp/schema/boolean.d.ts +4 -4
  106. package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
  107. package/dist/llcsharp/schema/boolean.js +1 -1
  108. package/dist/llcsharp/schema/boolean.js.map +1 -1
  109. package/dist/llcsharp/schema/byte-array.d.ts +3 -3
  110. package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
  111. package/dist/llcsharp/schema/byte-array.js +12 -2
  112. package/dist/llcsharp/schema/byte-array.js.map +1 -1
  113. package/dist/llcsharp/schema/char.d.ts +4 -4
  114. package/dist/llcsharp/schema/char.d.ts.map +1 -1
  115. package/dist/llcsharp/schema/char.js +3 -3
  116. package/dist/llcsharp/schema/char.js.map +1 -1
  117. package/dist/llcsharp/schema/date-time.d.ts +7 -7
  118. package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
  119. package/dist/llcsharp/schema/date-time.js +4 -4
  120. package/dist/llcsharp/schema/date-time.js.map +1 -1
  121. package/dist/llcsharp/schema/date.d.ts +2 -2
  122. package/dist/llcsharp/schema/date.d.ts.map +1 -1
  123. package/dist/llcsharp/schema/date.js.map +1 -1
  124. package/dist/llcsharp/schema/duration.d.ts +5 -5
  125. package/dist/llcsharp/schema/duration.d.ts.map +1 -1
  126. package/dist/llcsharp/schema/duration.js +2 -2
  127. package/dist/llcsharp/schema/duration.js.map +1 -1
  128. package/dist/llcsharp/schema/enum.d.ts +2 -2
  129. package/dist/llcsharp/schema/enum.d.ts.map +1 -1
  130. package/dist/llcsharp/schema/enum.js +5 -3
  131. package/dist/llcsharp/schema/enum.js.map +1 -1
  132. package/dist/llcsharp/schema/extended-type-declaration.d.ts +2 -2
  133. package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
  134. package/dist/llcsharp/schema/integer.d.ts +4 -4
  135. package/dist/llcsharp/schema/integer.d.ts.map +1 -1
  136. package/dist/llcsharp/schema/integer.js +1 -1
  137. package/dist/llcsharp/schema/integer.js.map +1 -1
  138. package/dist/llcsharp/schema/object.d.ts +3 -3
  139. package/dist/llcsharp/schema/object.d.ts.map +1 -1
  140. package/dist/llcsharp/schema/object.js +25 -21
  141. package/dist/llcsharp/schema/object.js.map +1 -1
  142. package/dist/llcsharp/schema/password.d.ts +23 -0
  143. package/dist/llcsharp/schema/password.d.ts.map +1 -0
  144. package/dist/llcsharp/schema/password.js +89 -0
  145. package/dist/llcsharp/schema/password.js.map +1 -0
  146. package/dist/llcsharp/schema/primitive.d.ts +4 -4
  147. package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
  148. package/dist/llcsharp/schema/primitive.js +7 -3
  149. package/dist/llcsharp/schema/primitive.js.map +1 -1
  150. package/dist/llcsharp/schema/schema-resolver.d.ts +4 -3
  151. package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
  152. package/dist/llcsharp/schema/schema-resolver.js +61 -64
  153. package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
  154. package/dist/llcsharp/schema/string.d.ts +3 -3
  155. package/dist/llcsharp/schema/string.d.ts.map +1 -1
  156. package/dist/llcsharp/schema/string.js +14 -10
  157. package/dist/llcsharp/schema/string.js.map +1 -1
  158. package/dist/main.d.ts.map +1 -1
  159. package/dist/main.js +23 -14
  160. package/dist/main.js.map +1 -1
  161. package/dist/models/model-extensions.d.ts +3 -2
  162. package/dist/models/model-extensions.d.ts.map +1 -1
  163. package/dist/models/model-extensions.js +195 -168
  164. package/dist/models/model-extensions.js.map +1 -1
  165. package/dist/module/module-class.d.ts +4 -2
  166. package/dist/module/module-class.d.ts.map +1 -1
  167. package/dist/module/module-class.js +67 -13
  168. package/dist/module/module-class.js.map +1 -1
  169. package/dist/module/module-namespace.d.ts +2 -2
  170. package/dist/module/module-namespace.d.ts.map +1 -1
  171. package/dist/module/module-namespace.js +3 -2
  172. package/dist/module/module-namespace.js.map +1 -1
  173. package/dist/plugins/add-azure-completers-v2.d.ts +3 -0
  174. package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -0
  175. package/dist/plugins/{add-azure-completers.js → add-azure-completers-v2.js} +7 -5
  176. package/dist/plugins/add-azure-completers-v2.js.map +1 -0
  177. package/dist/plugins/create-commands-v2.d.ts +40 -0
  178. package/dist/plugins/create-commands-v2.d.ts.map +1 -0
  179. package/dist/plugins/{create-commands.js → create-commands-v2.js} +128 -78
  180. package/dist/plugins/create-commands-v2.js.map +1 -0
  181. package/dist/plugins/cs-namer-v2.d.ts +3 -0
  182. package/dist/plugins/cs-namer-v2.d.ts.map +1 -0
  183. package/dist/plugins/cs-namer-v2.js +230 -0
  184. package/dist/plugins/cs-namer-v2.js.map +1 -0
  185. package/dist/plugins/llcsharp-v2.d.ts +3 -0
  186. package/dist/plugins/llcsharp-v2.d.ts.map +1 -0
  187. package/dist/plugins/{llcsharp.js → llcsharp-v2.js} +3 -3
  188. package/dist/plugins/llcsharp-v2.js.map +1 -0
  189. package/dist/plugins/modifiers-v2.d.ts +3 -0
  190. package/dist/plugins/modifiers-v2.d.ts.map +1 -0
  191. package/dist/plugins/{modifiers.js → modifiers-v2.js} +151 -32
  192. package/dist/plugins/modifiers-v2.js.map +1 -0
  193. package/dist/plugins/plugin-create-inline-properties.d.ts +4 -0
  194. package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -0
  195. package/dist/plugins/plugin-create-inline-properties.js +356 -0
  196. package/dist/plugins/plugin-create-inline-properties.js.map +1 -0
  197. package/dist/plugins/plugin-tweak-m4-model.d.ts +3 -0
  198. package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -0
  199. package/dist/plugins/plugin-tweak-m4-model.js +166 -0
  200. package/dist/plugins/plugin-tweak-m4-model.js.map +1 -0
  201. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +3 -0
  202. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -0
  203. package/dist/plugins/plugin-tweak-model-azure-v2.js +169 -0
  204. package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -0
  205. package/dist/plugins/plugin-tweak-model.d.ts +9 -0
  206. package/dist/plugins/plugin-tweak-model.d.ts.map +1 -0
  207. package/dist/plugins/plugin-tweak-model.js +572 -0
  208. package/dist/plugins/plugin-tweak-model.js.map +1 -0
  209. package/dist/plugins/powershell-v2.d.ts +3 -0
  210. package/dist/plugins/powershell-v2.d.ts.map +1 -0
  211. package/dist/plugins/{powershell.js → powershell-v2.js} +9 -4
  212. package/dist/plugins/powershell-v2.js.map +1 -0
  213. package/dist/plugins/{ps-namer.d.ts → ps-namer-v2.d.ts} +2 -2
  214. package/dist/plugins/ps-namer-v2.d.ts.map +1 -0
  215. package/dist/plugins/{ps-namer.js → ps-namer-v2.js} +64 -49
  216. package/dist/plugins/ps-namer-v2.js.map +1 -0
  217. package/dist/utils/PwshModel.d.ts +8 -0
  218. package/dist/utils/PwshModel.d.ts.map +1 -0
  219. package/dist/utils/PwshModel.js +17 -0
  220. package/dist/utils/PwshModel.js.map +1 -0
  221. package/dist/utils/command-operation.d.ts +51 -0
  222. package/dist/utils/command-operation.d.ts.map +1 -0
  223. package/dist/utils/command-operation.js +33 -0
  224. package/dist/utils/command-operation.js.map +1 -0
  225. package/dist/utils/components.d.ts +133 -0
  226. package/dist/utils/components.d.ts.map +1 -0
  227. package/dist/utils/components.js +100 -0
  228. package/dist/utils/components.js.map +1 -0
  229. package/dist/utils/extensions.d.ts +11 -0
  230. package/dist/utils/extensions.d.ts.map +1 -0
  231. package/dist/utils/extensions.js +16 -0
  232. package/dist/utils/extensions.js.map +1 -0
  233. package/dist/utils/http-definitions.d.ts +45 -0
  234. package/dist/utils/http-definitions.d.ts.map +1 -0
  235. package/dist/utils/http-definitions.js +47 -0
  236. package/dist/utils/http-definitions.js.map +1 -0
  237. package/dist/utils/http-operation.d.ts +8 -0
  238. package/dist/utils/http-operation.d.ts.map +1 -0
  239. package/dist/utils/http-operation.js +254 -0
  240. package/dist/utils/http-operation.js.map +1 -0
  241. package/dist/utils/info.d.ts +36 -0
  242. package/dist/utils/info.d.ts.map +1 -0
  243. package/dist/utils/info.js +36 -0
  244. package/dist/utils/info.js.map +1 -0
  245. package/dist/utils/model-state.d.ts +44 -0
  246. package/dist/utils/model-state.d.ts.map +1 -0
  247. package/dist/utils/model-state.js +206 -0
  248. package/dist/utils/model-state.js.map +1 -0
  249. package/dist/utils/powershell-comment.d.ts +2 -0
  250. package/dist/utils/powershell-comment.d.ts.map +1 -0
  251. package/dist/utils/powershell-comment.js +25 -0
  252. package/dist/utils/powershell-comment.js.map +1 -0
  253. package/dist/utils/programatic-operation.d.ts +20 -0
  254. package/dist/utils/programatic-operation.d.ts.map +1 -0
  255. package/dist/utils/programatic-operation.js +29 -0
  256. package/dist/utils/programatic-operation.js.map +1 -0
  257. package/dist/utils/resolve-conflicts.d.ts +7 -0
  258. package/dist/utils/resolve-conflicts.d.ts.map +1 -0
  259. package/dist/utils/resolve-conflicts.js +57 -0
  260. package/dist/utils/resolve-conflicts.js.map +1 -0
  261. package/dist/utils/schema.d.ts +116 -0
  262. package/dist/utils/schema.d.ts.map +1 -0
  263. package/dist/utils/schema.js +186 -0
  264. package/dist/utils/schema.js.map +1 -0
  265. package/dist/utils/security-scheme.d.ts +123 -0
  266. package/dist/utils/security-scheme.d.ts.map +1 -0
  267. package/dist/utils/security-scheme.js +119 -0
  268. package/dist/utils/security-scheme.js.map +1 -0
  269. package/dist/utils/uid.d.ts +2 -0
  270. package/dist/utils/uid.d.ts.map +1 -0
  271. package/dist/utils/uid.js +8 -0
  272. package/dist/utils/uid.js.map +1 -0
  273. package/package.json +22 -21
  274. package/resources/assets/build-module.ps1 +12 -15
  275. package/resources/assets/check-dependencies.ps1 +4 -14
  276. package/resources/assets/create-model-cmdlets.ps1 +157 -0
  277. package/resources/assets/custom/{readme.md → README.md} +7 -7
  278. package/resources/assets/docs/README.md +11 -0
  279. package/resources/assets/examples/{readme.md → README.md} +0 -0
  280. package/resources/assets/export-surface.ps1 +1 -11
  281. package/resources/assets/exports/{readme.md → README.md} +2 -2
  282. package/resources/assets/generate-help.ps1 +2 -12
  283. package/resources/assets/how-to.md +5 -5
  284. package/resources/assets/internal/{readme.md → README.md} +3 -3
  285. package/resources/assets/pack-module.ps1 +1 -11
  286. package/resources/assets/resources/{readme.md → README.md} +0 -0
  287. package/resources/assets/run-module.ps1 +3 -11
  288. package/resources/assets/test/{readme.md → README.md} +0 -0
  289. package/resources/assets/test/loadEnv.ps1 +1 -11
  290. package/resources/assets/test-module.ps1 +39 -24
  291. package/resources/assets/tools/Resources/{readme.md → README.md} +3 -2
  292. package/resources/assets/tools/Resources/docs/{readme.md → README.md} +1 -1
  293. package/resources/assets/tools/Resources/examples/{readme.md → README.md} +0 -0
  294. package/resources/assets/tools/Resources/how-to.md +5 -5
  295. package/resources/assets/tools/Resources/resources/{readme.md → README.md} +0 -0
  296. package/resources/assets/tools/Resources/test/{readme.md → README.md} +0 -0
  297. package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +496 -0
  298. package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +468 -0
  299. package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +303 -0
  300. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Az.Accounts.nuspec +5 -3
  301. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +387 -0
  302. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +375 -0
  303. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
  304. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
  305. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies → 2.7.5/AzSharedAlcAssemblies}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  306. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  307. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
  308. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll +0 -0
  309. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll +0 -0
  310. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Hyak.Common.dll +0 -0
  311. package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
  312. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.Common.dll +0 -0
  313. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  314. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +945 -404
  315. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  316. package/resources/modules/Az.Accounts/{1.8.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json → 2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json} +906 -488
  317. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  318. package/resources/modules/Az.Accounts/{1.8.1/Microsoft.Azure.PowerShell.Authentication.deps.json → 2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json} +301 -719
  319. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  320. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  321. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  322. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
  323. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
  324. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  325. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
  326. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
  327. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
  328. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
  329. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  330. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
  331. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
  332. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +2413 -0
  333. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  334. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +3567 -1995
  335. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  336. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
  337. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
  338. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
  339. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
  340. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
  341. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
  342. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.dll +0 -0
  343. package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +219 -0
  344. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
  345. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
  346. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  347. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  348. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  349. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
  350. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
  351. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/Newtonsoft.Json.10.dll → 2.7.5/PreloadAssemblies/Newtonsoft.Json.dll} +0 -0
  352. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll +0 -0
  353. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Diagnostics.DiagnosticSource.4.0.4.0.dll → 2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll} +0 -0
  354. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
  355. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Memory.dll +0 -0
  356. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll +0 -0
  357. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
  358. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
  359. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
  360. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.5.0.dll → 2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll} +0 -0
  361. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
  362. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll +0 -0
  363. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Permissions.dll +0 -0
  364. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
  365. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
  366. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
  367. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
  368. package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Threading.Tasks.Extensions.4.2.0.0.dll → 2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll} +0 -0
  369. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Xml.ReaderWriter.dll +0 -0
  370. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +278 -0
  371. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +234 -0
  372. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/[Content_Types].xml +1 -0
  373. package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/_rels/.rels +2 -2
  374. package/resources/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt +50 -0
  375. package/resources/modules/Az.Accounts/{1.8.1/package/services/metadata/core-properties/b4e383786e734eb49545960a9feff173.psmdcp → 2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp} +2 -2
  376. package/resources/psruntime/AsyncCommandRuntime.cs +4 -0
  377. package/resources/psruntime/AsyncOperationResponse.cs +10 -11
  378. package/resources/psruntime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +3 -1
  379. package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +94 -87
  380. package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +168 -102
  381. package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +22 -11
  382. package/resources/psruntime/BuildTime/Cmdlets/GetScriptCmdlet.cs +2 -1
  383. package/resources/psruntime/BuildTime/MarkdownRenderer.cs +1 -8
  384. package/resources/psruntime/BuildTime/Models/PsHelpMarkdownOutputs.cs +33 -11
  385. package/resources/psruntime/BuildTime/Models/PsHelpTypes.cs +3 -0
  386. package/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs +17 -14
  387. package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +111 -13
  388. package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +18 -3
  389. package/resources/psruntime/BuildTime/PsAttributes.cs +1 -1
  390. package/resources/psruntime/BuildTime/PsExtensions.cs +9 -0
  391. package/resources/psruntime/BuildTime/PsHelpers.cs +2 -1
  392. package/resources/psruntime/DictionaryExtensions.cs +8 -11
  393. package/resources/psruntime/EventDataExtensions.cs +1 -1
  394. package/resources/psruntime/MessageAttribute.cs +360 -0
  395. package/resources/psruntime/MessageAttributeHelper.cs +161 -0
  396. package/resources/psruntime/Properties/Resources.Designer.cs +5633 -0
  397. package/resources/psruntime/Properties/Resources.resx +1741 -0
  398. package/resources/psruntime/TypeConverterExtensions.cs +31 -10
  399. package/resources/runtime/csharp/client/Extensions.cs +7 -1
  400. package/resources/runtime/csharp/client/IAssociativeArray.cs +4 -1
  401. package/resources/runtime/csharp/client/UndeclaredResponseException.cs +10 -2
  402. package/resources/runtime/csharp/json/Customizations/IJsonSerializable.cs +21 -7
  403. package/resources/runtime/csharp/json/Nodes/JsonNumber.cs +5 -5
  404. package/resources/runtime/csharp/pipeline/ISendAsync.cs +7 -3
  405. package/resources/runtime/csharp/pipeline/PipelineMocking.cs +17 -9
  406. package/resources/utils/Unprotect-SecureString.ps1 +16 -0
  407. package/changelog.md +0 -4
  408. package/dist/llcsharp/enums/json-serializer.d.ts +0 -9
  409. package/dist/llcsharp/enums/json-serializer.d.ts.map +0 -1
  410. package/dist/llcsharp/enums/json-serializer.js +0 -41
  411. package/dist/llcsharp/enums/json-serializer.js.map +0 -1
  412. package/dist/llcsharp/model/model-class-xml.d.ts +0 -15
  413. package/dist/llcsharp/model/model-class-xml.d.ts.map +0 -1
  414. package/dist/llcsharp/model/model-class-xml.js +0 -145
  415. package/dist/llcsharp/model/model-class-xml.js.map +0 -1
  416. package/dist/plugins/add-azure-completers.d.ts +0 -3
  417. package/dist/plugins/add-azure-completers.d.ts.map +0 -1
  418. package/dist/plugins/add-azure-completers.js.map +0 -1
  419. package/dist/plugins/create-commands.d.ts +0 -38
  420. package/dist/plugins/create-commands.d.ts.map +0 -1
  421. package/dist/plugins/create-commands.js.map +0 -1
  422. package/dist/plugins/cs-namer.d.ts +0 -3
  423. package/dist/plugins/cs-namer.d.ts.map +0 -1
  424. package/dist/plugins/cs-namer.js +0 -203
  425. package/dist/plugins/cs-namer.js.map +0 -1
  426. package/dist/plugins/llcsharp.d.ts +0 -3
  427. package/dist/plugins/llcsharp.d.ts.map +0 -1
  428. package/dist/plugins/llcsharp.js.map +0 -1
  429. package/dist/plugins/modifiers.d.ts +0 -3
  430. package/dist/plugins/modifiers.d.ts.map +0 -1
  431. package/dist/plugins/modifiers.js.map +0 -1
  432. package/dist/plugins/powershell.d.ts +0 -3
  433. package/dist/plugins/powershell.d.ts.map +0 -1
  434. package/dist/plugins/powershell.js.map +0 -1
  435. package/dist/plugins/ps-namer.d.ts.map +0 -1
  436. package/dist/plugins/ps-namer.js.map +0 -1
  437. package/resources/assets/docs/readme.md +0 -11
  438. package/resources/modules/Az.Accounts/1.8.1/Accounts.format.ps1xml +0 -368
  439. package/resources/modules/Az.Accounts/1.8.1/Accounts.generated.format.ps1xml +0 -422
  440. package/resources/modules/Az.Accounts/1.8.1/Accounts.types.ps1xml +0 -281
  441. package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psd1 +0 -360
  442. package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psm1 +0 -339
  443. package/resources/modules/Az.Accounts/1.8.1/Microsoft.ApplicationInsights.dll +0 -0
  444. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  445. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  446. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  447. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  448. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  449. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
  450. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  451. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
  452. package/resources/modules/Az.Accounts/1.8.1/Microsoft.Rest.ClientRuntime.dll +0 -0
  453. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Azure.Core.dll +0 -0
  454. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  455. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
  456. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
  457. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Numerics.Vectors.dll +0 -0
  458. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  459. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Encodings.Web.dll +0 -0
  460. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Json.dll +0 -0
  461. package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Threading.Tasks.Extensions.dll +0 -0
  462. package/resources/modules/Az.Accounts/1.8.1/PostImportScripts/LoadAuthenticators.ps1 +0 -197
  463. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Azure.Core.dll +0 -0
  464. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  465. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
  466. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
  467. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Buffers.dll +0 -0
  468. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
  469. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
  470. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
  471. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.0.dll +0 -0
  472. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.1.dll +0 -0
  473. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
  474. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
  475. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Json.dll +0 -0
  476. package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Threading.Tasks.Extensions.4.3.1.0.dll +0 -0
  477. package/resources/modules/Az.Accounts/1.8.1/StartupScripts/AzError.ps1 +0 -256
@@ -4,12 +4,17 @@
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
- const codemodel_v3_1 = require("@azure-tools/codemodel-v3");
7
+ const codemodel_1 = require("@azure-tools/codemodel");
8
8
  const codegen_1 = require("@azure-tools/codegen");
9
9
  const linq_1 = require("@azure-tools/linq");
10
10
  const autorest_extension_base_1 = require("@azure-tools/autorest-extension-base");
11
11
  const linq_2 = require("@azure-tools/linq");
12
12
  const verbs_1 = require("../internal/verbs");
13
+ const components_1 = require("../utils/components");
14
+ const model_state_1 = require("../utils/model-state");
15
+ //import { Schema as SchemaV3 } from '../utils/schema';
16
+ const command_operation_1 = require("../utils/command-operation");
17
+ const specialWords = { in: ['sign'] };
13
18
  // UNUSED: Moved to plugin-tweak-model.ts in remodeler
14
19
  // For now, we are not dynamically changing the service-name. Instead, we would figure out a method to change it during the creation of service readme's.
15
20
  function titleToAzureServiceName(title) {
@@ -25,6 +30,8 @@ exports.titleToAzureServiceName = titleToAzureServiceName;
25
30
  const pluralizationService = new codegen_1.EnglishPluralizationService();
26
31
  pluralizationService.addWord('Database', 'Databases');
27
32
  pluralizationService.addWord('database', 'databases');
33
+ pluralizationService.addWord('Premise', 'Premises');
34
+ pluralizationService.addWord('premise', 'premises');
28
35
  function fn(active, remaining, result) {
29
36
  if (linq_1.length(active) || linq_1.length(remaining)) {
30
37
  if (linq_1.length(remaining)) {
@@ -40,8 +47,25 @@ function fn(active, remaining, result) {
40
47
  function combinations(elements) {
41
48
  return fn([], elements, []);
42
49
  }
50
+ function filterSpecialWords(preposition, parts) {
51
+ let start = 0;
52
+ let idx = -1;
53
+ if (specialWords[preposition] !== undefined) {
54
+ do {
55
+ idx = parts.indexOf(preposition, start);
56
+ if (idx <= 0 || !specialWords[preposition].includes(parts[idx - 1])) {
57
+ return idx;
58
+ }
59
+ else {
60
+ start = idx + 1;
61
+ }
62
+ // eslint-disable-next-line no-constant-condition
63
+ } while (true);
64
+ }
65
+ return parts.indexOf(preposition);
66
+ }
43
67
  function splitOnPreposition(preposition, parts) {
44
- const i = parts.indexOf(preposition);
68
+ const i = filterSpecialWords(preposition, parts);
45
69
  if (i > 0) {
46
70
  return [
47
71
  parts.slice(0, i),
@@ -64,6 +88,15 @@ class Inferrer {
64
88
  constructor(state) {
65
89
  this.state = state;
66
90
  this.commonParameters = new Array();
91
+ // skip-for-time-being
92
+ // isNameConflict(model: codemodel.Model, variant: CommandVariant, vname: string) {
93
+ // for (const each of values(model.commands.operations)) {
94
+ // if (each.details.default.name === vname) {
95
+ // return true;
96
+ // }
97
+ // }
98
+ // return false;
99
+ // }
67
100
  // for tracking unique operation identities
68
101
  this.operationIdentities = new Set();
69
102
  }
@@ -82,15 +115,15 @@ class Inferrer {
82
115
  this.state.setValue('prefix', this.prefix);
83
116
  const model = this.state.model;
84
117
  this.state.message({
85
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[CMDLET-PREFIX] => '${model.details.default.prefix}'`
118
+ Channel: autorest_extension_base_1.Channel.Debug, Text: `[CMDLET-PREFIX] => '${model.language.default.prefix}'`
86
119
  });
87
- model.details.default.serviceName = this.serviceName;
120
+ model.language.default.serviceName = this.serviceName;
88
121
  this.state.message({
89
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[SERVICE-NAME] => '${model.details.default.serviceName}'`
122
+ Channel: autorest_extension_base_1.Channel.Debug, Text: `[SERVICE-NAME] => '${model.language.default.serviceName}'`
90
123
  });
91
- model.details.default.subjectPrefix = this.subjectPrefix;
124
+ model.language.default.subjectPrefix = this.subjectPrefix;
92
125
  this.state.message({
93
- Channel: autorest_extension_base_1.Channel.Debug, Text: `[SUBJECT-PREFIX] => '${model.details.default.subjectPrefix}'`
126
+ Channel: autorest_extension_base_1.Channel.Debug, Text: `[SUBJECT-PREFIX] => '${model.language.default.subjectPrefix}'`
94
127
  });
95
128
  return this;
96
129
  }
@@ -101,12 +134,19 @@ class Inferrer {
101
134
  parameters: new linq_1.Dictionary(),
102
135
  };
103
136
  this.state.message({ Channel: autorest_extension_base_1.Channel.Debug, Text: 'detecting high level commands...' });
104
- for (const operation of linq_1.values(model.http.operations)) {
105
- for (const variant of await this.inferCommandNames(operation, this.state)) {
106
- // no common parameters (standard variations)
107
- await this.addVariants(operation.parameters, operation, variant, '', this.state);
137
+ for (const operationGroup of linq_1.values(model.operationGroups)) {
138
+ for (const operation of linq_1.values(operationGroup.operations)) {
139
+ for (const variant of await this.inferCommandNames(operation, operationGroup.$key, this.state)) {
140
+ await this.addVariants(operation.parameters, operation, variant, '', this.state);
141
+ }
108
142
  }
109
143
  }
144
+ // for (const operation of values(model.http.operations)) {
145
+ // for (const variant of await this.inferCommandNames(operation, this.state)) {
146
+ // // no common parameters (standard variations)
147
+ // await this.addVariants(operation.parameters, operation, variant, '', this.state);
148
+ // }
149
+ // }
110
150
  return model;
111
151
  }
112
152
  inferCommand(operation, group, suffix = []) {
@@ -181,21 +221,20 @@ class Inferrer {
181
221
  this.state.warning(`Operation ${operation[0]}/${operation[1]} is inferred without finding action.`, [], {});
182
222
  return [this.createCommandVariant(operation[0], group ? [...codegen_1.deconstruct(group), ...operation.slice(1)] : operation.slice(1), [...suffix, ...operation.slice(1)], this.state.model)];
183
223
  }
184
- async inferCommandNames(op, state) {
185
- const operationId = op.operationId || '';
186
- let [group, method] = operationId.split('_', 2);
187
- if (!method) {
188
- if (!group) {
189
- // no operation id at all?
190
- const path = op.path.replace(/{.*?}/g, '').replace(/\/+/g, '/').replace(/\/$/g, '');
191
- method = path.split('/').last;
192
- }
193
- else {
194
- // no group given, use string as method
195
- method = group;
196
- }
197
- group = codegen_1.pascalCase(op.tags) || '';
198
- }
224
+ async inferCommandNames(op, group, state) {
225
+ const method = op.language.default.name;
226
+ // skip-for-time-being
227
+ // if (!method) {
228
+ // if (!group) {
229
+ // // no operation id at all?
230
+ // const path = op.path.replace(/{.*?}/g, '').replace(/\/+/g, '/').replace(/\/$/g, '');
231
+ // method = path.split('/').last;
232
+ // } else {
233
+ // // no group given, use string as method
234
+ // method = group;
235
+ // }
236
+ // group = pascalCase(op.tags) || '';
237
+ // }
199
238
  const groupWords = codegen_1.deconstruct(group);
200
239
  groupWords[groupWords.length - 1] = pluralizationService.singularize(groupWords.last);
201
240
  group = codegen_1.pascalCase(groupWords);
@@ -212,24 +251,24 @@ class Inferrer {
212
251
  // if this has a body with it, let's add that parameter
213
252
  if (body && body.schema) {
214
253
  op.details.default.hasBody = true;
215
- op.parameters.push(new codemodel_v3_1.components.IParameter(bodyParameterName, body.schema, {
254
+ op.parameters.push(new components_1.IParameter(bodyParameterName, body.schema, {
216
255
  details: {
217
256
  default: {
218
- description: body.schema.details.default.description,
257
+ description: body.schema.language.default.description,
219
258
  name: codegen_1.pascalCase(bodyParameterName),
220
259
  isBodyParameter: true,
221
260
  }
222
261
  }
223
262
  }));
224
263
  // let's add a variant where it's expanded out.
225
- // *IF* the body is an object
226
- if (body.schema.type === codemodel_v3_1.JsonType.Object) {
264
+ // *IF* the body is an object or dictionary
265
+ if (body.schema.type === codemodel_1.SchemaType.Object || body.schema.type === codemodel_1.SchemaType.Dictionary || body.schema.type === codemodel_1.SchemaType.Any) {
227
266
  const opExpanded = await this.addCommandOperation(`${vname}Expanded`, parameters, operation, variant, state);
228
267
  opExpanded.details.default.dropBodyParameter = true;
229
- opExpanded.parameters.push(new codemodel_v3_1.components.IParameter(`${bodyParameterName}Body`, body.schema, {
268
+ opExpanded.parameters.push(new components_1.IParameter(`${bodyParameterName}Body`, body.schema, {
230
269
  details: {
231
270
  default: {
232
- description: body.schema.details.default.description,
271
+ description: body.schema.language.default.description,
233
272
  name: codegen_1.pascalCase(`${bodyParameterName}Body`),
234
273
  isBodyParameter: true,
235
274
  }
@@ -238,24 +277,18 @@ class Inferrer {
238
277
  }
239
278
  }
240
279
  }
241
- isNameConflict(model, variant, vname) {
242
- for (const each of linq_1.values(model.commands.operations)) {
243
- if (each.details.default.name === vname) {
244
- return true;
245
- }
246
- }
247
- return false;
248
- }
249
280
  async addCommandOperation(vname, parameters, operation, variant, state) {
250
- let apiversion = '';
251
- for (const each of linq_1.items(operation.responses)) {
252
- for (const rsp of each.value) {
253
- if (rsp.schema && rsp.schema.details && rsp.schema.details.default && rsp.schema.details.default.apiversion) {
254
- apiversion = rsp.schema.details.default.apiversion;
255
- break;
256
- }
257
- }
258
- }
281
+ // skip-for-time-being following code seems redundant -----
282
+ // let apiversion = '';
283
+ // for (const each of items(operation.responses)) {
284
+ // for (const rsp of items(each)) {
285
+ // if (rsp.schema && rsp.schema.details && rsp.schema.details.default && rsp.schema.details.default.apiversion) {
286
+ // apiversion = rsp.schema.details.default.apiversion;
287
+ // break;
288
+ // }
289
+ // }
290
+ // }
291
+ // ----------------------------------------------------------
259
292
  // if vname is > 64 characters, let's trim it
260
293
  // after trimming it, make sure there aren't any other operation with a name that's exactly the same
261
294
  if (linq_1.length(vname) > 64) {
@@ -279,18 +312,16 @@ class Inferrer {
279
312
  this.operationIdentities.add(fname);
280
313
  variant.variant = vname;
281
314
  vname = codegen_1.pascalCase(vname);
282
- const xmsMetadata = operation.pathExtensions ? operation.pathExtensions['x-ms-metadata'] ? linq_2.clone(operation.pathExtensions['x-ms-metadata']) : {} : {};
283
- return state.model.commands.operations[`${linq_1.length(state.model.commands.operations)}`] = new codemodel_v3_1.command.CommandOperation(operation.operationId, {
284
- asjob: operation.details.default.asjob ? true : false,
285
- extensions: {
286
- ...operation.pathExtensions,
287
- 'x-ms-metadata': xmsMetadata
288
- },
315
+ // skip-for-time-being x-ms-metadata looks not supported any more.
316
+ //const xmsMetadata = operation.pathExtensions ? operation.pathExtensions['x-ms-metadata'] ? clone(operation.pathExtensions['x-ms-metadata']) : {} : {};
317
+ return state.model.commands.operations[`${linq_1.length(state.model.commands.operations)}`] = new command_operation_1.CommandOperation(operation.language.default.name, {
318
+ asjob: operation.language.default.asjob ? true : false,
319
+ extensions: {},
289
320
  ...variant,
290
321
  details: {
291
- ...operation.details,
322
+ ...operation.language,
292
323
  default: {
293
- ...operation.details.default,
324
+ ...operation.language.default,
294
325
  subject: variant.subject,
295
326
  subjectPrefix: variant.subjectPrefix,
296
327
  verb: variant.verb,
@@ -298,42 +329,57 @@ class Inferrer {
298
329
  alias: variant.alias
299
330
  }
300
331
  },
301
- operationId: operation.operationId,
332
+ // operationId is not needed any more
333
+ operationId: '',
302
334
  parameters: parameters.map(httpParameter => {
303
335
  // make it's own copy of the parameter since after this,
304
336
  // the parameter can be altered for each operation individually.
305
337
  const each = linq_2.clone(httpParameter, false, undefined, undefined, ['schema', 'origin']);
338
+ each.language.default = {
339
+ ...each.language.default,
340
+ name: codegen_1.pascalCase(each.language.default.name),
341
+ httpParameter
342
+ };
343
+ each.details = {};
306
344
  each.details.default = {
307
- ...each.details.default,
308
- name: codegen_1.pascalCase(each.details.default.name),
345
+ ...each.language.default,
346
+ name: codegen_1.pascalCase(each.language.default.name),
309
347
  httpParameter
310
348
  };
349
+ each.name = each.language.default.serializedName;
311
350
  return each;
312
351
  }),
352
+ // skip-for-time-being, this callGraph is used in the header comments
313
353
  callGraph: [operation],
314
354
  });
315
355
  }
316
356
  async addVariants(parameters, operation, variant, vname, state) {
357
+ var _a, _b, _c, _d;
317
358
  // now synthesize parameter set variants multiplexed by the variants.
318
- const [constants, requiredParameters] = linq_1.values(parameters).bifurcate(parameter => parameter.details.default.constantValue || parameter.details.default.fromHost ? true : false);
319
- const constantParameters = constants.map(each => `'${each.details.default.constantValue}'`);
359
+ const [constants, requiredParameters] = linq_1.values(parameters).bifurcate(parameter => parameter.language.default.constantValue || parameter.language.default.fromHost ? true : false);
360
+ const constantParameters = constants.map(each => `'${each.language.default.constantValue}'`);
320
361
  // the body parameter
321
- const body = operation.requestBody;
322
- const bodyParameterName = (operation.requestBody && operation.requestBody.extensions) ? operation.requestBody.extensions['x-ms-requestBody-name'] || 'bodyParameter' : '';
362
+ // xichen: How to handle if has multiple requests?
363
+ const body = ((_b = (_a = operation.requests) === null || _a === void 0 ? void 0 : _a[0].parameters) === null || _b === void 0 ? void 0 : _b.find((p) => !p.origin || p.origin.indexOf('modelerfour:synthesized') < 0)) || null;
364
+ // skip-for-time-being, looks x-ms-requestBody-name is not supported any more
365
+ //const bodyParameterName = (operation.requestBody && operation.requestBody.extensions) ? operation.requestBody.extensions['x-ms-requestBody-name'] || 'bodyParameter' : '';
366
+ const bodyParameterName = body ? body.language.default.name : '';
323
367
  // all the properties in the body parameter
324
- const bodyProperties = (body && body.schema) ? linq_1.values(codemodel_v3_1.getAllProperties(body.schema)).where(property => !property.details.default.readOnly).toArray() : [];
368
+ const bodyProperties = (body && body.schema && codemodel_1.isObjectSchema(body.schema)) ? linq_1.values(codemodel_1.getAllProperties(body.schema)).where(property => !property.language.default.readOnly).toArray() : [];
325
369
  // smash body property names together
326
- const bodyPropertyNames = bodyProperties.joinWith(each => each.details.default.name);
370
+ const bodyPropertyNames = bodyProperties.joinWith(each => each.language.default.name);
327
371
  // for each polymorphic body, we should do a separate variant that takes the polymorphic body type instead of the base type
328
- const polymorphicBodies = (body && body.schema && body.schema.details.default.polymorphicChildren && linq_1.length(body.schema.details.default.polymorphicChildren)) ? body.schema.details.default.polymorphicChildren.joinWith(child => child.details.default.name) : '';
372
+ // skip-for-time-being, this is for polymorphism
373
+ //const polymorphicBodies = (body && body.schema && body.schema.details.default.polymorphicChildren && length(body.schema.details.default.polymorphicChildren)) ? (<Array<Schema>>body.schema.details.default.polymorphicChildren).joinWith(child => child.details.default.name) : '';
329
374
  // wait! "update" should be "set" if it's a POST
330
- if (variant.verb === 'Update' && operation.method === codemodel_v3_1.http.HttpMethod.Put) {
375
+ if (variant.verb === 'Update' && operation.requests && ((_d = (_c = operation.requests[0].protocol) === null || _c === void 0 ? void 0 : _c.http) === null || _d === void 0 ? void 0 : _d.method) === codemodel_1.HttpMethod.Put) {
331
376
  variant.verb = 'Set';
332
377
  }
333
378
  // create variant
334
- state.message({ Channel: autorest_extension_base_1.Channel.Debug, Text: `${variant.verb}-${variant.subject} // ${operation.operationId} => ${JSON.stringify(variant)} taking ${requiredParameters.joinWith(each => each.name)}; ${constantParameters} ; ${bodyPropertyNames} ${polymorphicBodies ? `; Polymorphic bodies: ${polymorphicBodies} ` : ''}` });
379
+ // skip-for-time-being, since operationId looks not included in m4.
380
+ //state.message({ Channel: Channel.Debug, Text: `${variant.verb}-${variant.subject} // ${operation.operationId} => ${JSON.stringify(variant)} taking ${requiredParameters.joinWith(each => each.name)}; ${constantParameters} ; ${bodyPropertyNames} ${polymorphicBodies ? `; Polymorphic bodies: ${polymorphicBodies} ` : ''}` });
335
381
  await this.addVariant(codegen_1.pascalCase([variant.action, vname]), body, bodyParameterName, [...constants, ...requiredParameters], operation, variant, state);
336
- const [pathParams, otherParams] = linq_1.values(requiredParameters).bifurcate(each => each.in === codemodel_v3_1.ParameterLocation.Path);
382
+ const [pathParams, otherParams] = linq_1.values(requiredParameters).bifurcate(each => { var _a, _b, _c; return ((_c = (_b = (_a = each) === null || _a === void 0 ? void 0 : _a.protocol) === null || _b === void 0 ? void 0 : _b.http) === null || _c === void 0 ? void 0 : _c.in) === codemodel_1.ParameterLocation.Path; });
337
383
  const dvi = await state.getValue('disable-via-identity', false);
338
384
  if (!dvi && linq_1.length(pathParams) > 0 && variant.action.toLowerCase() != 'list') {
339
385
  // we have an operation that has path parameters, a good canididate for piping for identity.
@@ -354,7 +400,7 @@ class Inferrer {
354
400
  subject: codegen_1.pascalCase([...codegen_1.removeSequentialDuplicates(subject.map(each => pluralizationService.singularize(each)))]),
355
401
  variant: codegen_1.pascalCase(variant),
356
402
  verb,
357
- subjectPrefix: model.details.default.subjectPrefix,
403
+ subjectPrefix: model.language.default.subjectPrefix,
358
404
  action
359
405
  };
360
406
  }
@@ -369,11 +415,15 @@ class Inferrer {
369
415
  }
370
416
  }
371
417
  exports.Inferrer = Inferrer;
372
- async function createCommands(service) {
418
+ async function createCommandsV2(service) {
373
419
  // return processCodeModel(commandCreator, service);
374
- return codemodel_v3_1.processCodeModel(async (state) => {
375
- return await (await new Inferrer(state).init()).createCommands();
376
- }, service, 'createCommands');
420
+ //const session = await startSession<PwshModel>(service, {}, codeModelSchema);
421
+ //const result = tweakModelV2(session);
422
+ const state = await new model_state_1.ModelState(service).init();
423
+ await service.WriteFile('code-model-v4-createcommands-v2.yaml', codegen_1.serialize(await (await new Inferrer(state).init()).createCommands()), undefined, 'code-model-v4');
424
+ // return processCodeModel(async (state) => {
425
+ // return await (await new Inferrer(state).init()).createCommands();
426
+ // }, service, 'createCommands-v2');
377
427
  }
378
- exports.createCommands = createCommands;
379
- //# sourceMappingURL=create-commands.js.map
428
+ exports.createCommandsV2 = createCommandsV2;
429
+ //# sourceMappingURL=create-commands-v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-commands-v2.js","sourceRoot":"","sources":["../../plugins/create-commands-v2.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAEhG,sDAAmS;AACnS,kDAAyK;AACzK,4CAA4E;AAE5E,kFAA4F;AAE5F,4CAA0C;AAC1C,6CAA0C;AAE1C,oDAAiD;AACjD,sDAAkD;AAClD,uDAAuD;AACvD,kEAA8D;AAI9D,MAAM,YAAY,GAAsC,EAA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CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa;YACnD,MAAM;SACP,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,MAAc;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9C,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,QAAQ,CAAC;SACjB;IACH,CAAC;CACF;AAhYD,4BAgYC;AAGM,KAAK,UAAU,gBAAgB,CAAC,OAAa;IAClD,oDAAoD;IACpD,8EAA8E;IAC9E,uCAAuC;IACvC,MAAM,KAAK,GAAG,MAAM,IAAI,wBAAU,CAAY,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9D,MAAM,OAAO,CAAC,SAAS,CAAC,sCAAsC,EAAE,mBAAS,CAAC,MAAM,CAAC,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAElK,6CAA6C;IAC7C,sEAAsE;IACtE,oCAAoC;AACtC,CAAC;AAVD,4CAUC"}
@@ -0,0 +1,3 @@
1
+ import { Host } from '@azure-tools/autorest-extension-base';
2
+ export declare function csnamerV2(service: Host): Promise<void>;
3
+ //# sourceMappingURL=cs-namer-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cs-namer-v2.d.ts","sourceRoot":"","sources":["../../plugins/cs-namer-v2.ts"],"names":[],"mappings":"AAUA,OAAO,EAAW,IAAI,EAAyB,MAAM,sCAAsC,CAAC;AAyP5F,wBAAsB,SAAS,CAAC,OAAO,EAAE,IAAI,iBAO5C"}
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const codemodel_1 = require("@azure-tools/codemodel");
8
+ const codegen_1 = require("@azure-tools/codegen");
9
+ const linq_1 = require("@azure-tools/linq");
10
+ const codegen_csharp_1 = require("@azure-tools/codegen-csharp");
11
+ const schema_resolver_1 = require("../llcsharp/schema/schema-resolver");
12
+ const model_state_1 = require("../utils/model-state");
13
+ function setPropertyNames(schema) {
14
+ var _a, _b, _c;
15
+ // name each property in this schema
16
+ // skip-for-time-being
17
+ if (!codemodel_1.isObjectSchema(schema)) {
18
+ return;
19
+ }
20
+ for (const propertySchema of linq_1.values(schema.properties)) {
21
+ const propertyDetails = propertySchema.language.default;
22
+ propertyDetails.required = (_a = propertySchema.required, (_a !== null && _a !== void 0 ? _a : false));
23
+ propertyDetails.readOnly = (_b = propertySchema.readOnly, (_b !== null && _b !== void 0 ? _b : false));
24
+ const className = (_c = schema.language.csharp) === null || _c === void 0 ? void 0 : _c.name;
25
+ let pname = codegen_1.getPascalIdentifier(propertyDetails.name);
26
+ if (pname === className) {
27
+ pname = `${pname}Property`;
28
+ }
29
+ if (pname === 'default') {
30
+ pname = '@default';
31
+ }
32
+ propertySchema.language.csharp = {
33
+ ...propertyDetails,
34
+ name: pname // and so are the propertyNmaes
35
+ };
36
+ if (propertyDetails.isNamedStream) {
37
+ propertySchema.language.csharp.namedStreamPropertyName = codegen_1.pascalCase(codegen_1.fixLeadingNumber([...codegen_1.deconstruct(propertyDetails.name), 'filename']));
38
+ }
39
+ }
40
+ }
41
+ function setSchemaNames(schemaGroups, azure, serviceNamespace) {
42
+ var _a;
43
+ const baseNamespace = new Set();
44
+ const subNamespace = new Map();
45
+ // dolauli need to notice this -- schemas in the namespace of the lowest supported api version
46
+ // in Azure Mode, we want to always put schemas into the namespace of the lowest supported apiversion.
47
+ // otherwise, we just want to differientiate with a simple incremental numbering scheme.
48
+ for (const group of linq_1.values(schemaGroups)) {
49
+ for (const schema of group) {
50
+ if (schema.language.default.skip) {
51
+ continue;
52
+ }
53
+ let thisNamespace = baseNamespace;
54
+ let thisApiversion = '';
55
+ // create the namespace if required
56
+ if (azure) {
57
+ const versions = [...linq_1.values(schema.apiVersions).select(v => v.version)];
58
+ if (((_a = schema.language.default) === null || _a === void 0 ? void 0 : _a.uid) !== 'universal-parameter-type') {
59
+ if (versions && linq_1.length(versions) > 0) {
60
+ thisApiversion = codegen_1.minimum(versions);
61
+ thisNamespace = subNamespace.get(thisApiversion) || new Set();
62
+ subNamespace.set(thisApiversion, thisNamespace);
63
+ }
64
+ }
65
+ }
66
+ // for each schema, we're going to set the name
67
+ // to the suggested name, unless we have collisions
68
+ // at which point, we're going to add a number (for now?)
69
+ const details = schema.language.default;
70
+ let schemaName = codegen_1.getPascalIdentifier(details.name);
71
+ const apiName = (!thisApiversion) ? '' : codegen_1.getPascalIdentifier(`Api ${thisApiversion}`);
72
+ const ns = (!thisApiversion) ? [] : ['.', apiName];
73
+ let n = 1;
74
+ while (thisNamespace.has(schemaName)) {
75
+ schemaName = codegen_1.getPascalIdentifier(`${details.name}_${n++}`);
76
+ }
77
+ thisNamespace.add(schemaName);
78
+ // object types.
79
+ if (schema.type === codemodel_1.SchemaType.Object || schema.type === codemodel_1.SchemaType.Dictionary || schema.type === codemodel_1.SchemaType.Any) {
80
+ schema.language.csharp = {
81
+ ...details,
82
+ apiversion: thisApiversion,
83
+ apiname: apiName,
84
+ interfaceName: 'I' + codegen_1.pascalCase(codegen_1.fixLeadingNumber([...codegen_1.deconstruct(schemaName)])),
85
+ internalInterfaceName: 'I' + codegen_1.pascalCase(codegen_1.fixLeadingNumber([...codegen_1.deconstruct(schemaName), 'Internal'])),
86
+ fullInternalInterfaceName: `${codegen_1.pascalCase([serviceNamespace, '.', 'Models', ...ns])}.${'I' + codegen_1.pascalCase(codegen_1.fixLeadingNumber([...codegen_1.deconstruct(schemaName), 'Internal']))}`,
87
+ name: codegen_1.getPascalIdentifier(schemaName),
88
+ namespace: codegen_1.pascalCase([serviceNamespace, '.', 'Models', ...ns]),
89
+ fullname: `${codegen_1.pascalCase([serviceNamespace, '.', 'Models', ...ns])}.${codegen_1.getPascalIdentifier(schemaName)}`,
90
+ };
91
+ }
92
+ else if (schema.type === codemodel_1.SchemaType.Choice || schema.type === codemodel_1.SchemaType.SealedChoice) {
93
+ // oh, it's an enum type
94
+ const choiceSchema = schema;
95
+ schema.language.csharp = {
96
+ ...details,
97
+ interfaceName: 'I' + codegen_1.pascalCase(codegen_1.fixLeadingNumber([...codegen_1.deconstruct(schemaName)])),
98
+ name: codegen_1.getPascalIdentifier(schemaName),
99
+ namespace: codegen_1.pascalCase([serviceNamespace, '.', 'Support']),
100
+ fullname: `${codegen_1.pascalCase([serviceNamespace, '.', 'Support'])}.${codegen_1.getPascalIdentifier(schemaName)}`,
101
+ enum: {
102
+ ...schema.language.default.enum,
103
+ name: codegen_1.getPascalIdentifier(schema.language.default.name),
104
+ values: choiceSchema.choices.map(each => {
105
+ return {
106
+ ...each,
107
+ name: codegen_1.getPascalIdentifier(each.language.default.name),
108
+ description: each.language.default.description
109
+ };
110
+ })
111
+ }
112
+ };
113
+ }
114
+ else {
115
+ schema.language.csharp = {
116
+ ...details,
117
+ interfaceName: '<INVALID_INTERFACE>',
118
+ internalInterfaceName: '<INVALID_INTERFACE>',
119
+ name: schemaName,
120
+ namespace: '<INVALID_NAMESPACE>',
121
+ fullname: '<INVALID_FULLNAME>'
122
+ };
123
+ // xichen: for invalid namespace case, we won't create model class. So we do not need consider dup case
124
+ thisNamespace.delete(schemaName);
125
+ }
126
+ // name each property in this schema
127
+ setPropertyNames(schema);
128
+ // fix enum names
129
+ if (schema.type === codemodel_1.SchemaType.Choice || schema.type === codemodel_1.SchemaType.SealedChoice) {
130
+ schema.language.csharp.enum.name = codegen_1.getPascalIdentifier(schema.language.default.name);
131
+ // and the value names themselves
132
+ for (const value of linq_1.values(schema.language.csharp.enum.values)) {
133
+ // In m3, enum.name and enum.value are same. But in m4, enum.name is named by m4.
134
+ // To keep same action as m3, use enum.value here
135
+ value.name = codegen_1.getPascalIdentifier(value.value);
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ async function setOperationNames(state, resolver) {
142
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
143
+ // keep a list of operation names that we've assigned.
144
+ const operationNames = new Set();
145
+ for (const operationGroup of linq_1.values(state.model.operationGroups)) {
146
+ for (const operation of linq_1.values(operationGroup.operations)) {
147
+ const details = operation.language.default;
148
+ // come up with a name
149
+ const oName = codegen_1.getPascalIdentifier(operationGroup.$key + '_' + details.name);
150
+ let i = 1;
151
+ let operationName = oName;
152
+ while (operationNames.has(operationName)) {
153
+ // if we have used that name, try again.
154
+ operationName = `${oName}${i++}`;
155
+ }
156
+ operationNames.add(operationName);
157
+ operation.language.csharp = {
158
+ ...details,
159
+ name: operationName,
160
+ };
161
+ // parameters are camelCased.
162
+ for (const parameter of linq_1.values(operation.parameters)) {
163
+ const parameterDetails = parameter.language.default;
164
+ let propName = codegen_1.camelCase(codegen_1.fixLeadingNumber(codegen_1.deconstruct(parameterDetails.serializedName)));
165
+ if (propName === 'default') {
166
+ propName = '@default';
167
+ }
168
+ parameter.language.csharp = {
169
+ ...parameterDetails,
170
+ name: propName
171
+ };
172
+ }
173
+ const responses = [...linq_1.values(operation.responses), ...linq_1.values(operation.exceptions)];
174
+ for (const rsp of responses) {
175
+ // per responseCode
176
+ const response = rsp;
177
+ const responseTypeDefinition = response.schema ? resolver.resolveTypeDeclaration(response.schema, true, state) : undefined;
178
+ const headerSchema = response.language.default.headerSchema;
179
+ const headerTypeDefinition = headerSchema ? resolver.resolveTypeDeclaration(headerSchema, true, state.path('schemas', headerSchema.language.default.name)) : undefined;
180
+ let code = (codegen_csharp_1.System.Net.HttpStatusCode[(_a = response.protocol.http) === null || _a === void 0 ? void 0 : _a.statusCodes[0]] ? codegen_csharp_1.System.Net.HttpStatusCode[(_b = response.protocol.http) === null || _b === void 0 ? void 0 : _b.statusCodes[0]].value : (_c = response.protocol.http) === null || _c === void 0 ? void 0 : _c.statusCodes[0]).replace('global::System.Net.HttpStatusCode', '');
181
+ let rawValue = code.replace(/\./, '');
182
+ if (((_d = response.protocol.http) === null || _d === void 0 ? void 0 : _d.statusCodes[0]) === 'default' || rawValue === 'default' || '') {
183
+ rawValue = 'any response code not handled elsewhere';
184
+ code = 'default';
185
+ response.language.default.isErrorResponse = true;
186
+ }
187
+ response.language.csharp = {
188
+ ...response.language.default,
189
+ responseType: responseTypeDefinition ? responseTypeDefinition.declaration : '',
190
+ headerType: headerTypeDefinition ? headerTypeDefinition.declaration : '',
191
+ name: (linq_1.length((_e = response.protocol.http) === null || _e === void 0 ? void 0 : _e.mimeTypes) <= 1) ?
192
+ codegen_1.camelCase(codegen_1.fixLeadingNumber(codegen_1.deconstruct(`on ${code}`))) : // the common type (or the only one.)
193
+ codegen_1.camelCase(codegen_1.fixLeadingNumber(codegen_1.deconstruct(`on ${code} ${(_f = response.protocol.http) === null || _f === void 0 ? void 0 : _f.mimeTypes[0]}`))),
194
+ description: (linq_1.length((_g = response.protocol.http) === null || _g === void 0 ? void 0 : _g.mimeTypes) <= 1) ?
195
+ `a delegate that is called when the remote service returns ${(_h = response.protocol.http) === null || _h === void 0 ? void 0 : _h.statusCodes[0]} (${rawValue}).` :
196
+ `a delegate that is called when the remote service returns ${(_j = response.protocol.http) === null || _j === void 0 ? void 0 : _j.statusCodes[0]} (${rawValue}) with a Content-Type matching ${(_k = response.protocol.http) === null || _k === void 0 ? void 0 : _k.mimeTypes.join(',')}.`
197
+ };
198
+ }
199
+ }
200
+ }
201
+ }
202
+ async function nameStuffRight(state) {
203
+ const resolver = new schema_resolver_1.SchemaDefinitionResolver();
204
+ const model = state.model;
205
+ // set the namespace for the service
206
+ const serviceNamespace = await state.getValue('namespace', 'Sample.API');
207
+ const azure = await state.getValue('azure', false) || await state.getValue('azure-arm', false);
208
+ const clientName = codegen_1.getPascalIdentifier(model.language.default.name);
209
+ // dolauli see model.details.csharp for c# related staff
210
+ // set c# client details (name)
211
+ model.language.csharp = {
212
+ ...model.language.default,
213
+ name: clientName,
214
+ namespace: serviceNamespace,
215
+ fullname: `${serviceNamespace}.${clientName}`
216
+ };
217
+ setSchemaNames(model.schemas, azure, serviceNamespace);
218
+ await setOperationNames(state, resolver);
219
+ return model;
220
+ }
221
+ async function csnamerV2(service) {
222
+ // dolauli add names for http operations and schemas
223
+ //return processCodeModel(nameStuffRight, service, 'csnamer');
224
+ //const session = await startSession<PwshModel>(service, {}, codeModelSchema);
225
+ //const result = tweakModelV2(session);
226
+ const state = await new model_state_1.ModelState(service).init();
227
+ await service.WriteFile('code-model-v4-csnamer-v2.yaml', codegen_1.serialize(await nameStuffRight(state)), undefined, 'code-model-v4');
228
+ }
229
+ exports.csnamerV2 = csnamerV2;
230
+ //# sourceMappingURL=cs-namer-v2.js.map