@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.
- package/.rush/temp/package-deps_build.json +214 -206
- package/.rush/temp/shrinkwrap-deps.json +253 -280
- package/autorest-configuration-for-sdk.md +9 -3
- package/autorest-configuration.md +1 -1
- package/dist/cmdlets/class.d.ts +27 -2
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +913 -549
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +39 -5
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/enums/namespace.js +5 -5
- package/dist/enums/namespace.js.map +1 -1
- package/dist/exports.d.ts +3 -0
- package/dist/exports.d.ts.map +1 -0
- package/dist/exports.js +19 -0
- package/dist/exports.js.map +1 -0
- package/dist/generators/gitignore.d.ts.map +1 -1
- package/dist/generators/gitignore.js +2 -0
- package/dist/generators/gitignore.js.map +1 -1
- package/dist/generators/psm1.custom.js +2 -2
- package/dist/generators/psm1.custom.js.map +1 -1
- package/dist/generators/psm1.d.ts.map +1 -1
- package/dist/generators/psm1.internal.js +2 -2
- package/dist/generators/psm1.internal.js.map +1 -1
- package/dist/generators/psm1.js +17 -11
- package/dist/generators/psm1.js.map +1 -1
- package/dist/generators/readme.d.ts.map +1 -1
- package/dist/generators/readme.js +0 -3
- package/dist/generators/readme.js.map +1 -1
- package/dist/generators/script-cmdlet.js +18 -18
- package/dist/generators/script-cmdlet.js.map +1 -1
- package/dist/internal/name-inferrer.d.ts +1 -1
- package/dist/internal/name-inferrer.d.ts.map +1 -1
- package/dist/internal/name-inferrer.js +12 -12
- package/dist/internal/name-inferrer.js.map +1 -1
- package/dist/internal/powershell-declarations.d.ts +3 -0
- package/dist/internal/powershell-declarations.d.ts.map +1 -1
- package/dist/internal/powershell-declarations.js +5 -2
- package/dist/internal/powershell-declarations.js.map +1 -1
- package/dist/internal/project.d.ts +14 -8
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +27 -20
- package/dist/internal/project.js.map +1 -1
- package/dist/internal/state.d.ts +3 -2
- package/dist/internal/state.d.ts.map +1 -1
- package/dist/internal/state.js.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +1 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +12 -11
- package/dist/llcsharp/clientruntime.js.map +1 -1
- package/dist/llcsharp/code-model.d.ts +7 -7
- package/dist/llcsharp/code-model.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.d.ts +1 -1
- package/dist/llcsharp/enums/enum.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.js +42 -42
- package/dist/llcsharp/enums/enum.js.map +1 -1
- package/dist/llcsharp/exports.js +5 -1
- package/dist/llcsharp/exports.js.map +1 -1
- package/dist/llcsharp/generator.d.ts +3 -2
- package/dist/llcsharp/generator.d.ts.map +1 -1
- package/dist/llcsharp/generator.js.map +1 -1
- package/dist/llcsharp/model/idictionary.js +16 -16
- package/dist/llcsharp/model/idictionary.js.map +1 -1
- package/dist/llcsharp/model/interface.d.ts +1 -1
- package/dist/llcsharp/model/interface.d.ts.map +1 -1
- package/dist/llcsharp/model/interface.js +25 -11
- package/dist/llcsharp/model/interface.js.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.js +18 -18
- package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
- package/dist/llcsharp/model/model-class-json.js +20 -20
- package/dist/llcsharp/model/model-class-json.js.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.js +6 -6
- package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
- package/dist/llcsharp/model/model-class.d.ts +1 -1
- package/dist/llcsharp/model/model-class.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class.js +108 -97
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/model/namespace.d.ts +1 -1
- package/dist/llcsharp/model/namespace.d.ts.map +1 -1
- package/dist/llcsharp/model/namespace.js +4 -12
- package/dist/llcsharp/model/namespace.js.map +1 -1
- package/dist/llcsharp/model/property.d.ts +1 -1
- package/dist/llcsharp/model/property.d.ts.map +1 -1
- package/dist/llcsharp/model/property.js +20 -20
- package/dist/llcsharp/model/property.js.map +1 -1
- package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
- package/dist/llcsharp/operation/api-class.js +26 -1
- package/dist/llcsharp/operation/api-class.js.map +1 -1
- package/dist/llcsharp/operation/method.d.ts +10 -5
- package/dist/llcsharp/operation/method.d.ts.map +1 -1
- package/dist/llcsharp/operation/method.js +287 -134
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/operation/parameter.d.ts +1 -1
- package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
- package/dist/llcsharp/operation/parameter.js +10 -10
- package/dist/llcsharp/operation/parameter.js.map +1 -1
- package/dist/llcsharp/project.d.ts +10 -5
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +15 -4
- package/dist/llcsharp/project.js.map +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
- package/dist/llcsharp/schema/Uuid.js +2 -2
- package/dist/llcsharp/schema/Uuid.js.map +1 -1
- package/dist/llcsharp/schema/array.d.ts +1 -1
- package/dist/llcsharp/schema/array.d.ts.map +1 -1
- package/dist/llcsharp/schema/array.js +45 -43
- package/dist/llcsharp/schema/array.js.map +1 -1
- package/dist/llcsharp/schema/binary.d.ts +1 -1
- package/dist/llcsharp/schema/binary.d.ts.map +1 -1
- package/dist/llcsharp/schema/binary.js +9 -9
- package/dist/llcsharp/schema/binary.js.map +1 -1
- package/dist/llcsharp/schema/boolean.d.ts +1 -1
- package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.js +24 -24
- package/dist/llcsharp/schema/byte-array.js.map +1 -1
- package/dist/llcsharp/schema/char.d.ts +1 -1
- package/dist/llcsharp/schema/char.d.ts.map +1 -1
- package/dist/llcsharp/schema/char.js +1 -1
- package/dist/llcsharp/schema/char.js.map +1 -1
- package/dist/llcsharp/schema/date-time.d.ts +1 -1
- package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
- package/dist/llcsharp/schema/date-time.js +45 -41
- package/dist/llcsharp/schema/date-time.js.map +1 -1
- package/dist/llcsharp/schema/date.d.ts +1 -1
- package/dist/llcsharp/schema/date.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.d.ts +1 -1
- package/dist/llcsharp/schema/duration.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.js +9 -7
- package/dist/llcsharp/schema/duration.js.map +1 -1
- package/dist/llcsharp/schema/enum.d.ts +6 -2
- package/dist/llcsharp/schema/enum.d.ts.map +1 -1
- package/dist/llcsharp/schema/enum.js +13 -4
- package/dist/llcsharp/schema/enum.js.map +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
- package/dist/llcsharp/schema/fixed-array.d.ts +1 -1
- package/dist/llcsharp/schema/fixed-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/fixed-array.js +44 -42
- package/dist/llcsharp/schema/fixed-array.js.map +1 -1
- package/dist/llcsharp/schema/integer.d.ts +1 -1
- package/dist/llcsharp/schema/integer.d.ts.map +1 -1
- package/dist/llcsharp/schema/integer.js +5 -5
- package/dist/llcsharp/schema/integer.js.map +1 -1
- package/dist/llcsharp/schema/object.d.ts +1 -1
- package/dist/llcsharp/schema/object.d.ts.map +1 -1
- package/dist/llcsharp/schema/object.js +28 -28
- package/dist/llcsharp/schema/object.js.map +1 -1
- package/dist/llcsharp/schema/password.d.ts +1 -1
- package/dist/llcsharp/schema/password.d.ts.map +1 -1
- package/dist/llcsharp/schema/password.js +13 -13
- package/dist/llcsharp/schema/password.js.map +1 -1
- package/dist/llcsharp/schema/primitive.d.ts +1 -1
- package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
- package/dist/llcsharp/schema/primitive.js +40 -37
- package/dist/llcsharp/schema/primitive.js.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.js +5 -9
- package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
- package/dist/llcsharp/schema/string.d.ts +1 -1
- package/dist/llcsharp/schema/string.d.ts.map +1 -1
- package/dist/llcsharp/schema/string.js +48 -44
- package/dist/llcsharp/schema/string.js.map +1 -1
- package/dist/llcsharp/schema/uri.d.ts +1 -1
- package/dist/llcsharp/schema/uri.d.ts.map +1 -1
- package/dist/llcsharp/schema/uri.js +2 -2
- package/dist/llcsharp/schema/uri.js.map +1 -1
- package/dist/llcsharp/validations.js +2 -2
- package/dist/llcsharp/validations.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +5 -2
- package/dist/main.js.map +1 -1
- package/dist/models/model-extensions.d.ts +1 -1
- package/dist/models/model-extensions.d.ts.map +1 -1
- package/dist/models/model-extensions.js +39 -39
- package/dist/models/model-extensions.js.map +1 -1
- package/dist/module/module-class.d.ts.map +1 -1
- package/dist/module/module-class.js +45 -15
- package/dist/module/module-class.js.map +1 -1
- package/dist/module/module-namespace.js +3 -3
- package/dist/module/module-namespace.js.map +1 -1
- package/dist/plugins/add-azure-completers-v2.d.ts +6 -1
- package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -1
- package/dist/plugins/add-azure-completers-v2.js +5 -4
- package/dist/plugins/add-azure-completers-v2.js.map +1 -1
- package/dist/plugins/create-commands-v2.d.ts +17 -7
- package/dist/plugins/create-commands-v2.d.ts.map +1 -1
- package/dist/plugins/create-commands-v2.js +302 -66
- package/dist/plugins/create-commands-v2.js.map +1 -1
- package/dist/plugins/cs-namer-v2.d.ts +6 -1
- package/dist/plugins/cs-namer-v2.d.ts.map +1 -1
- package/dist/plugins/cs-namer-v2.js +42 -41
- package/dist/plugins/cs-namer-v2.js.map +1 -1
- package/dist/plugins/llcsharp-v2.d.ts +5 -2
- package/dist/plugins/llcsharp-v2.d.ts.map +1 -1
- package/dist/plugins/llcsharp-v2.js +14 -9
- package/dist/plugins/llcsharp-v2.js.map +1 -1
- package/dist/plugins/modifiers-v2.d.ts +6 -1
- package/dist/plugins/modifiers-v2.d.ts.map +1 -1
- package/dist/plugins/modifiers-v2.js +135 -88
- package/dist/plugins/modifiers-v2.js.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.d.ts +6 -1
- package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.js +44 -32
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.d.ts +7 -1
- package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.js +39 -10
- package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +6 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.js +32 -22
- package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
- package/dist/plugins/plugin-tweak-model.d.ts +6 -1
- package/dist/plugins/plugin-tweak-model.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-model.js +33 -32
- package/dist/plugins/plugin-tweak-model.js.map +1 -1
- package/dist/plugins/powershell-v2.d.ts +5 -2
- package/dist/plugins/powershell-v2.d.ts.map +1 -1
- package/dist/plugins/powershell-v2.js +32 -28
- package/dist/plugins/powershell-v2.js.map +1 -1
- package/dist/plugins/ps-namer-v2.d.ts +6 -1
- package/dist/plugins/ps-namer-v2.d.ts.map +1 -1
- package/dist/plugins/ps-namer-v2.js +33 -32
- package/dist/plugins/ps-namer-v2.js.map +1 -1
- package/dist/plugins/sdk-create-inline-properties.d.ts +1 -1
- package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -1
- package/dist/plugins/sdk-create-inline-properties.js +129 -39
- package/dist/plugins/sdk-create-inline-properties.js.map +1 -1
- package/dist/plugins/sdk-cs-namer.d.ts +1 -1
- package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
- package/dist/plugins/sdk-cs-namer.js +59 -34
- package/dist/plugins/sdk-cs-namer.js.map +1 -1
- package/dist/plugins/sdk-cs-simplifier.d.ts +1 -1
- package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -1
- package/dist/plugins/sdk-cs-simplifier.js +3 -3
- package/dist/plugins/sdk-cs-simplifier.js.map +1 -1
- package/dist/plugins/sdk-generate.d.ts +1 -1
- package/dist/plugins/sdk-generate.d.ts.map +1 -1
- package/dist/plugins/sdk-generate.js +23 -18
- package/dist/plugins/sdk-generate.js.map +1 -1
- package/dist/plugins/sdk-modifiers.d.ts +4 -0
- package/dist/plugins/sdk-modifiers.d.ts.map +1 -0
- package/dist/plugins/sdk-modifiers.js +175 -0
- package/dist/plugins/sdk-modifiers.js.map +1 -0
- package/dist/plugins/sdk-tweak-model.d.ts +1 -1
- package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
- package/dist/plugins/sdk-tweak-model.js +140 -44
- package/dist/plugins/sdk-tweak-model.js.map +1 -1
- package/dist/sdk/project.d.ts +2 -2
- package/dist/sdk/project.d.ts.map +1 -1
- package/dist/sdk/project.js +10 -9
- package/dist/sdk/project.js.map +1 -1
- package/dist/sdk/state.d.ts +2 -2
- package/dist/sdk/state.d.ts.map +1 -1
- package/dist/sdk/utility.d.ts +12 -3
- package/dist/sdk/utility.d.ts.map +1 -1
- package/dist/sdk/utility.js +122 -30
- package/dist/sdk/utility.js.map +1 -1
- package/dist/utils/PwshModel.d.ts +1 -1
- package/dist/utils/PwshModel.d.ts.map +1 -1
- package/dist/utils/PwshModel.js +1 -1
- package/dist/utils/PwshModel.js.map +1 -1
- package/dist/utils/SdkModel.d.ts +1 -1
- package/dist/utils/SdkModel.d.ts.map +1 -1
- package/dist/utils/SdkModel.js +1 -1
- package/dist/utils/SdkModel.js.map +1 -1
- package/dist/utils/command-operation.d.ts +11 -3
- package/dist/utils/command-operation.d.ts.map +1 -1
- package/dist/utils/command-operation.js +26 -4
- package/dist/utils/command-operation.js.map +1 -1
- package/dist/utils/components.d.ts +1 -1
- package/dist/utils/components.d.ts.map +1 -1
- package/dist/utils/components.js +2 -2
- package/dist/utils/components.js.map +1 -1
- package/dist/utils/http-operation.d.ts +2 -0
- package/dist/utils/http-operation.d.ts.map +1 -1
- package/dist/utils/http-operation.js +16 -12
- package/dist/utils/http-operation.js.map +1 -1
- package/dist/utils/model-state.d.ts +7 -5
- package/dist/utils/model-state.d.ts.map +1 -1
- package/dist/utils/model-state.js +28 -20
- package/dist/utils/model-state.js.map +1 -1
- package/dist/utils/programatic-operation.d.ts +1 -1
- package/dist/utils/programatic-operation.d.ts.map +1 -1
- package/dist/utils/programatic-operation.js +1 -1
- package/dist/utils/programatic-operation.js.map +1 -1
- package/dist/utils/resolve-conflicts.js +8 -8
- package/dist/utils/resolve-conflicts.js.map +1 -1
- package/dist/utils/resourceName.d.ts +3 -0
- package/dist/utils/resourceName.d.ts.map +1 -0
- package/dist/utils/resourceName.js +29 -0
- package/dist/utils/resourceName.js.map +1 -0
- package/dist/utils/schema.d.ts +1 -1
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +11 -11
- package/dist/utils/schema.js.map +1 -1
- package/dist/utils/security-scheme.d.ts +2 -2
- package/dist/utils/security-scheme.d.ts.map +1 -1
- package/dist/utils/security-scheme.js +2 -2
- package/dist/utils/security-scheme.js.map +1 -1
- package/dist/utils/sort-parameters.d.ts +3 -0
- package/dist/utils/sort-parameters.d.ts.map +1 -0
- package/dist/utils/sort-parameters.js +33 -0
- package/dist/utils/sort-parameters.js.map +1 -0
- package/dist/utils/tsp-generator.d.ts +3 -0
- package/dist/utils/tsp-generator.d.ts.map +1 -0
- package/dist/utils/tsp-generator.js +65 -0
- package/dist/utils/tsp-generator.js.map +1 -0
- package/dist/utils/tsp-host.d.ts +42 -0
- package/dist/utils/tsp-host.d.ts.map +1 -0
- package/dist/utils/tsp-host.js +56 -0
- package/dist/utils/tsp-host.js.map +1 -0
- package/generators/readme.ts +0 -3
- package/package.json +11 -10
- package/resources/assets/build-module.ps1 +31 -4
- package/resources/assets/check-dependencies.ps1 +3 -3
- package/resources/assets/create-model-cmdlets.ps1 +34 -5
- package/resources/assets/export-surface.ps1 +3 -3
- package/resources/assets/generate-help.ps1 +5 -5
- package/resources/assets/generate-portal-ux.ps1 +9 -25
- package/resources/assets/run-module.ps1 +4 -4
- package/resources/assets/test/loadEnv.ps1 +1 -1
- package/resources/assets/test-module.ps1 +11 -7
- package/resources/assets/tools/Resources/README.md +0 -3
- package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +2 -2
- package/resources/assets/tools/Resources/how-to.md +2 -0
- package/resources/built-time-cmdlets.csproj +1 -0
- package/resources/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml +554 -0
- package/resources/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml +471 -0
- package/resources/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml +306 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Az.Accounts.nuspec +4 -5
- package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 +389 -0
- package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 +365 -0
- package/resources/modules/Az.Accounts/2.13.1/FuzzySharp.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +2510 -779
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 +222 -0
- package/resources/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 +281 -0
- package/resources/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 +242 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/[Content_Types].xml +2 -3
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/_rels/.rels +2 -2
- package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp +11 -0
- package/resources/psruntime/Attributes/PSArgumentCompleterAttribute.cs +52 -0
- package/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +4 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +6 -3
- package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +7 -4
- package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +130 -81
- package/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs +64 -0
- package/resources/psruntime/BuildTime/MarkdownRenderer.cs +17 -9
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +53 -8
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +35 -11
- package/resources/psruntime/BuildTime/PsAttributes.cs +5 -0
- package/resources/psruntime/BuildTime/PsHelpers.cs +4 -3
- package/resources/psruntime/MessageAttribute.cs +45 -55
- package/resources/psruntime/MessageAttributeHelper.cs +30 -7
- package/resources/psruntime/Properties/Resources.Designer.cs +25 -3
- package/resources/psruntime/Properties/Resources.resx +8 -2
- package/resources/runtime/csharp/pipeline/ISendAsync.cs +113 -0
- package/resources/runtime/csharp/pipeline/PipelineMocking.cs +1 -1
- package/resources/templates/azureMethod.ejs +2 -2
- package/resources/templates/azureMethodGroup.ejs +2 -2
- package/resources/templates/azureServiceClient.ejs +11 -4
- package/resources/templates/enum.ejs +3 -3
- package/resources/templates/extensionMethod.ejs +18 -12
- package/resources/templates/extensions.ejs +9 -2
- package/resources/templates/longRunningOperationMethod.ejs +10 -8
- package/resources/templates/method.ejs +10 -8
- package/resources/templates/methodBodyRestCall.ejs +77 -32
- package/resources/templates/methodGroupInterface.ejs +2 -61
- package/resources/templates/methodGroupInterfaceBody.ejs +60 -0
- package/resources/templates/model.ejs +15 -15
- package/resources/templates/serviceClientBody.ejs +8 -8
- package/resources/templates/serviceClientInterface.ejs +10 -4
- package/resources/utils/Get-SubscriptionIdTestSafe.ps1 +7 -0
- package/dist/utils/WrapComments.d.ts +0 -2
- package/dist/utils/WrapComments.d.ts.map +0 -1
- package/dist/utils/WrapComments.js +0 -46
- package/dist/utils/WrapComments.js.map +0 -1
- package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +0 -496
- package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +0 -468
- package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +0 -303
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +0 -387
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +0 -375
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +0 -2309
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json +0 -2273
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json +0 -1316
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +0 -2413
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +0 -219
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +0 -278
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +0 -234
- package/resources/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp +0 -11
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Hyak.Common.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.Common.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/en-US/about_az.help.txt +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Numerics.Vectors.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Security.Cryptography.Cng.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Text.Encodings.Web.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Xml.ReaderWriter.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Buffers.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.Data.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Net.Http.WinHttpHandler.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Private.ServiceModel.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.ServiceModel.Primitives.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Text.Json.dll +0 -0
- /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
|
|
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
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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 = [...(
|
|
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:
|
|
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:
|
|
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((
|
|
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[`${(
|
|
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 = (
|
|
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:
|
|
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 = [...(
|
|
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:
|
|
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 = (
|
|
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:
|
|
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:
|
|
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.
|
|
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.
|
|
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
|