@autorest/powershell 4.0.0-dev.9 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +208 -203
- 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 +24 -3
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +888 -603
- 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 +2 -0
- package/dist/internal/powershell-declarations.d.ts.map +1 -1
- package/dist/internal/powershell-declarations.js +4 -2
- package/dist/internal/powershell-declarations.js.map +1 -1
- package/dist/internal/project.d.ts +14 -6
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +24 -13
- 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 +19 -19
- 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 +2 -2
- 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 +8 -4
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +10 -1
- 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 +2 -1
- 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 +16 -7
- package/dist/plugins/create-commands-v2.d.ts.map +1 -1
- package/dist/plugins/create-commands-v2.js +269 -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 +11 -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 +120 -92
- 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 +28 -11
- 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/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 +1 -1
- package/dist/utils/sort-parameters.d.ts.map +1 -1
- 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 +29 -2
- package/resources/assets/create-model-cmdlets.ps1 +1 -0
- package/resources/assets/generate-help.ps1 +2 -2
- package/resources/assets/generate-portal-ux.ps1 +6 -22
- package/resources/assets/test/loadEnv.ps1 +1 -1
- package/resources/assets/test-module.ps1 +9 -5
- 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/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 +36 -8
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +21 -10
- 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/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,23 +172,31 @@ function isWhereEnumDirective(it) {
|
|
|
171
172
|
}
|
|
172
173
|
return false;
|
|
173
174
|
}
|
|
175
|
+
async function tweakModelForTsp(state) {
|
|
176
|
+
const allDirectives = await state.service.getValue('directive');
|
|
177
|
+
directives = (0, linq_1.values)(allDirectives)
|
|
178
|
+
.where(directive => isWhereCommandDirective(directive) || isWhereModelDirective(directive) || isWhereEnumDirective(directive) || isRemoveCommandDirective(directive))
|
|
179
|
+
.toArray();
|
|
180
|
+
return await tweakModel(state);
|
|
181
|
+
}
|
|
182
|
+
exports.tweakModelForTsp = tweakModelForTsp;
|
|
174
183
|
async function tweakModel(state) {
|
|
175
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
184
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
176
185
|
const isAzure = await state.getValue('azure', false) || await state.getValue('azure-arm', false);
|
|
177
186
|
const removePecAndPlr = !await state.getValue('keep-pec-and-plr', isAzure ? false : true);
|
|
178
187
|
if (removePecAndPlr) {
|
|
179
|
-
const PecOrPlrRegex =
|
|
180
|
-
let operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
188
|
+
const PecOrPlrRegex = '^PrivateEndpointConnection$|^PrivateLinkResource$';
|
|
189
|
+
let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
181
190
|
.select(operation => operation.key)
|
|
182
191
|
.toArray());
|
|
183
|
-
operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
192
|
+
operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
184
193
|
.where(operation => !!`${operation.value.details.csharp.subject}`.match(PecOrPlrRegex) && operationsToRemoveKeys.has(operation.key))
|
|
185
194
|
.select(operation => operation.key)
|
|
186
195
|
.toArray());
|
|
187
|
-
for (const key of linq_1.values(operationsToRemoveKeys)) {
|
|
196
|
+
for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
|
|
188
197
|
const operationInfo = state.model.commands.operations[key].details.csharp;
|
|
189
198
|
state.message({
|
|
190
|
-
Channel:
|
|
199
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
|
|
191
200
|
});
|
|
192
201
|
delete state.model.commands.operations[key];
|
|
193
202
|
}
|
|
@@ -206,6 +215,7 @@ async function tweakModel(state) {
|
|
|
206
215
|
const verbRegex = getPatternToMatch(directive.where.verb);
|
|
207
216
|
const variantRegex = getPatternToMatch(directive.where.variant);
|
|
208
217
|
const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
|
|
218
|
+
const SupportsShouldProcess = (directive.set !== undefined) ? directive.set['suppress-should-process'] : undefined;
|
|
209
219
|
const alias = (directive.set !== undefined) ?
|
|
210
220
|
(directive.set.alias !== undefined) ?
|
|
211
221
|
!Array.isArray(directive.set.alias) ?
|
|
@@ -214,41 +224,42 @@ async function tweakModel(state) {
|
|
|
214
224
|
: undefined
|
|
215
225
|
: undefined;
|
|
216
226
|
const breakingChange = (directive.set !== undefined) ? directive.set['breaking-change'] : undefined;
|
|
217
|
-
const
|
|
227
|
+
const previewAnnouncement = (directive.set !== undefined) ? directive.set['preview-announcement'] : undefined;
|
|
218
228
|
const subjectReplacer = (directive.set !== undefined) ? directive.set['subject'] : undefined;
|
|
219
229
|
const subjectPrefixReplacer = (directive.set !== undefined) ? directive.set['subject-prefix'] : undefined;
|
|
220
230
|
const verbReplacer = (directive.set !== undefined) ? directive.set.verb : undefined;
|
|
221
231
|
const variantReplacer = (directive.set !== undefined) ? directive.set.variant : undefined;
|
|
222
232
|
const parameterReplacer = (directive.set !== undefined) ? directive.set['parameter-name'] : undefined;
|
|
223
233
|
const paramDescriptionReplacer = (directive.set !== undefined) ? directive.set['parameter-description'] : undefined;
|
|
234
|
+
const commandDescriptionReplacer = (directive.set !== undefined) ? directive.set['command-description'] : undefined;
|
|
224
235
|
const paramCompleterReplacer = (directive.set !== undefined) ? directive.set['completer'] : undefined;
|
|
225
236
|
const paramDefaultReplacer = (directive.set !== undefined) ? directive.set['default'] : undefined;
|
|
226
237
|
const cliensidePagination = (directive.set !== undefined) ? directive.set['clientside-pagination'] : undefined;
|
|
227
238
|
// select all operations
|
|
228
|
-
let operations = linq_1.values(state.model.commands.operations).toArray();
|
|
239
|
+
let operations = (0, linq_1.values)(state.model.commands.operations).toArray();
|
|
229
240
|
if (subjectRegex) {
|
|
230
|
-
operations = linq_1.values(operations)
|
|
241
|
+
operations = (0, linq_1.values)(operations)
|
|
231
242
|
.where(operation => !!`${operation.details.csharp.subject}`.match(subjectRegex))
|
|
232
243
|
.toArray();
|
|
233
244
|
}
|
|
234
245
|
if (subjectPrefixRegex) {
|
|
235
|
-
operations = linq_1.values(operations)
|
|
246
|
+
operations = (0, linq_1.values)(operations)
|
|
236
247
|
.where(operation => !!`${operation.details.csharp.subjectPrefix}`.match(subjectPrefixRegex))
|
|
237
248
|
.toArray();
|
|
238
249
|
}
|
|
239
250
|
if (verbRegex) {
|
|
240
|
-
operations = linq_1.values(operations)
|
|
251
|
+
operations = (0, linq_1.values)(operations)
|
|
241
252
|
.where(operation => !!`${operation.details.csharp.verb}`.match(verbRegex))
|
|
242
253
|
.toArray();
|
|
243
254
|
}
|
|
244
255
|
if (variantRegex) {
|
|
245
|
-
operations = linq_1.values(operations)
|
|
256
|
+
operations = (0, linq_1.values)(operations)
|
|
246
257
|
.where(operation => !!`${operation.details.csharp.name}`.match(variantRegex))
|
|
247
258
|
.toArray();
|
|
248
259
|
}
|
|
249
260
|
if (parameterRegex && selectType === 'command') {
|
|
250
|
-
operations = linq_1.values(operations)
|
|
251
|
-
.where(operation => linq_1.values(resolve_conflicts_1.allVirtualParameters(operation.details.csharp.virtualParameters))
|
|
261
|
+
operations = (0, linq_1.values)(operations)
|
|
262
|
+
.where(operation => (0, linq_1.values)((0, resolve_conflicts_1.allVirtualParameters)(operation.details.csharp.virtualParameters))
|
|
252
263
|
.any(parameter => !!`${parameter.name}`.match(parameterRegex)))
|
|
253
264
|
.toArray();
|
|
254
265
|
}
|
|
@@ -261,11 +272,11 @@ async function tweakModel(state) {
|
|
|
261
272
|
await addPipelines(state, operations, directive.add.pipelines);
|
|
262
273
|
}
|
|
263
274
|
if (parameterRegex && (selectType === undefined || selectType === 'parameter')) {
|
|
264
|
-
const parameters = linq_1.values(operations)
|
|
265
|
-
.selectMany(operation => resolve_conflicts_1.allVirtualParameters(operation.details.csharp.virtualParameters))
|
|
275
|
+
const parameters = (0, linq_1.values)(operations)
|
|
276
|
+
.selectMany(operation => (0, resolve_conflicts_1.allVirtualParameters)(operation.details.csharp.virtualParameters))
|
|
266
277
|
.where(parameter => !!`${parameter.name}`.match(parameterRegex))
|
|
267
278
|
.toArray();
|
|
268
|
-
for (const p of linq_1.values(parameters)) {
|
|
279
|
+
for (const p of (0, linq_1.values)(parameters)) {
|
|
269
280
|
const parameter = p;
|
|
270
281
|
const prevName = parameter.name;
|
|
271
282
|
parameter.name = parameterReplacer ? parameterRegex ? parameter.name.replace(parameterRegex, parameterReplacer) : parameterReplacer : parameter.name;
|
|
@@ -281,15 +292,20 @@ async function tweakModel(state) {
|
|
|
281
292
|
parameter.breakingChange.oldParamaterType = (breakingChange && breakingChange['old-parameter-type']) ? breakingChange['old-parameter-type'] : undefined;
|
|
282
293
|
parameter.breakingChange.newParameterType = (breakingChange && breakingChange['new-parameter-type']) ? breakingChange['new-parameter-type'] : undefined;
|
|
283
294
|
parameter.breakingChange.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
|
|
295
|
+
parameter.breakingChange.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
|
|
284
296
|
parameter.breakingChange.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
|
|
285
297
|
parameter.breakingChange.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
|
|
286
298
|
}
|
|
287
299
|
// handle preview message for parameter
|
|
288
|
-
|
|
300
|
+
if (previewAnnouncement) {
|
|
301
|
+
parameter.previewAnnouncement = {};
|
|
302
|
+
parameter.previewAnnouncement.previewMessage = (_a = previewAnnouncement['preview-message']) !== null && _a !== void 0 ? _a : '';
|
|
303
|
+
parameter.previewAnnouncement.estimatedGaDate = (_b = previewAnnouncement['estimated-ga-date']) !== null && _b !== void 0 ? _b : undefined;
|
|
304
|
+
}
|
|
289
305
|
if (clearAlias) {
|
|
290
306
|
parameter.alias = [];
|
|
291
307
|
state.message({
|
|
292
|
-
Channel:
|
|
308
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from parameter ${parameter.name}.`
|
|
293
309
|
});
|
|
294
310
|
}
|
|
295
311
|
// handle hiding parameters
|
|
@@ -301,34 +317,38 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
301
317
|
p.required = false;
|
|
302
318
|
p.hidden = true;
|
|
303
319
|
state.message({
|
|
304
|
-
Channel:
|
|
320
|
+
Channel: extension_base_1.Channel.Debug,
|
|
305
321
|
Text: `[DIRECTIVE] Hide parameter ${p.name}.`,
|
|
306
322
|
});
|
|
307
323
|
}
|
|
308
324
|
if (alias) {
|
|
309
325
|
const parsedAlias = new Array();
|
|
310
|
-
for (const each of linq_1.values(alias)) {
|
|
326
|
+
for (const each of (0, linq_1.values)(alias)) {
|
|
311
327
|
parsedAlias.push(hasSpecialChars(each) ? prevName.replace(parameterRegex, each) : each);
|
|
312
328
|
}
|
|
313
|
-
parameter.alias = [...new Set(linq_1.values(parameter.alias, parsedAlias).toArray())];
|
|
329
|
+
parameter.alias = [...new Set((0, linq_1.values)(parameter.alias, parsedAlias).toArray())];
|
|
314
330
|
state.message({
|
|
315
|
-
Channel:
|
|
331
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to parameter ${parameter.name}.`
|
|
316
332
|
});
|
|
317
333
|
}
|
|
318
334
|
if (parameterReplacer) {
|
|
319
335
|
state.message({
|
|
320
|
-
Channel:
|
|
336
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed parameter-name from ${prevName} to ${parameter.name}.`
|
|
321
337
|
});
|
|
322
338
|
}
|
|
323
339
|
if (paramDescriptionReplacer) {
|
|
324
340
|
state.message({
|
|
325
|
-
Channel:
|
|
341
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Set parameter-description from parameter ${parameter.name}.`
|
|
326
342
|
});
|
|
327
343
|
}
|
|
328
344
|
}
|
|
329
345
|
}
|
|
330
346
|
else if (operations) {
|
|
331
|
-
for (const operation of linq_1.values(operations)) {
|
|
347
|
+
for (const operation of (0, linq_1.values)(operations)) {
|
|
348
|
+
// set suppress-should-process
|
|
349
|
+
if (!!SupportsShouldProcess && (0, command_operation_1.isWritableCmdlet)(operation)) {
|
|
350
|
+
operation.details.csharp.supportShouldProcess = SupportsShouldProcess;
|
|
351
|
+
}
|
|
332
352
|
const getCmdletName = (verb, subjectPrefix, subject, variantName) => {
|
|
333
353
|
return `${verb}-${subjectPrefix}${subject}${variantName ? `_${variantName}` : ''}`;
|
|
334
354
|
};
|
|
@@ -343,6 +363,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
343
363
|
operation.details.csharp.verb = verbReplacer ? verbRegex ? prevVerb.replace(verbRegex, verbReplacer) : verbReplacer : prevVerb;
|
|
344
364
|
operation.details.csharp.name = variantReplacer ? variantRegex ? prevVariantName.replace(variantRegex, variantReplacer) : variantReplacer : prevVariantName;
|
|
345
365
|
operation.details.csharp.hidden = (directive.hide !== undefined) ? !!directive.hide : operation.details.csharp.hidden;
|
|
366
|
+
operation.details.csharp.description = commandDescriptionReplacer ? commandDescriptionReplacer : operation.details.csharp.description;
|
|
346
367
|
const newSubject = operation.details.csharp.subject;
|
|
347
368
|
const newSubjectPrefix = operation.details.csharp.subjectPrefix;
|
|
348
369
|
const newVerb = operation.details.csharp.verb;
|
|
@@ -357,6 +378,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
357
378
|
// handle parameter breaking change for variant
|
|
358
379
|
operation.details.csharp.breakingChange.variant = {};
|
|
359
380
|
operation.details.csharp.breakingChange.variant.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
|
|
381
|
+
operation.details.csharp.breakingChange.variant.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
|
|
360
382
|
operation.details.csharp.breakingChange.variant.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
|
|
361
383
|
operation.details.csharp.breakingChange.variant.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
|
|
362
384
|
operation.details.csharp.breakingChange.variant.name = newVariantName;
|
|
@@ -370,6 +392,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
370
392
|
operation.details.csharp.breakingChange.output.deprecatedOutputProperties = (breakingChange && breakingChange['deprecated-output-properties']) ? breakingChange['deprecated-output-properties'] : undefined;
|
|
371
393
|
operation.details.csharp.breakingChange.output.newOutputProperties = (breakingChange && breakingChange['new-output-properties']) ? breakingChange['new-output-properties'] : undefined;
|
|
372
394
|
operation.details.csharp.breakingChange.output.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
|
|
395
|
+
operation.details.csharp.breakingChange.output.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
|
|
373
396
|
operation.details.csharp.breakingChange.output.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
|
|
374
397
|
operation.details.csharp.breakingChange.output.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
|
|
375
398
|
}
|
|
@@ -378,9 +401,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
378
401
|
operation.details.csharp.breakingChange.cmdlet = {};
|
|
379
402
|
operation.details.csharp.breakingChange.cmdlet.replacement = (breakingChange && breakingChange['replacement-cmdlet']) ? breakingChange['replacement-cmdlet'] : undefined;
|
|
380
403
|
if (operation.details.csharp.breakingChange.cmdlet.replacement && operation.details.csharp.breakingChange.cmdlet.replacement.startsWith('$.')) {
|
|
381
|
-
operation.details.csharp.breakingChange.cmdlet.replacement = codegen_1.safeEval(operation.details.csharp.breakingChange.cmdlet.replacement.replace('$', `"${newCommandName.split('_')[0]}"`));
|
|
404
|
+
operation.details.csharp.breakingChange.cmdlet.replacement = (0, codegen_1.safeEval)(operation.details.csharp.breakingChange.cmdlet.replacement.replace('$', `"${newCommandName.split('_')[0]}"`));
|
|
382
405
|
}
|
|
383
406
|
operation.details.csharp.breakingChange.cmdlet.deprecateByVersion = (breakingChange && breakingChange['deprecated-by-version']) ? breakingChange['deprecated-by-version'] : undefined;
|
|
407
|
+
operation.details.csharp.breakingChange.cmdlet.deprecateByAzVersion = (breakingChange && breakingChange['deprecated-by-azversion']) ? breakingChange['deprecated-by-azversion'] : undefined;
|
|
384
408
|
operation.details.csharp.breakingChange.cmdlet.changeInEfectByDate = (breakingChange && breakingChange['change-effective-date']) ? breakingChange['change-effective-date'] : undefined;
|
|
385
409
|
operation.details.csharp.breakingChange.cmdlet.changeDescription = (breakingChange && breakingChange['change-description']) ? breakingChange['change-description'] : undefined;
|
|
386
410
|
operation.details.csharp.breakingChange.cmdlet.name = newCommandName.split('_')[0];
|
|
@@ -388,18 +412,22 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
388
412
|
}
|
|
389
413
|
}
|
|
390
414
|
// handle preview message for cmdlet
|
|
391
|
-
|
|
415
|
+
if (previewAnnouncement) {
|
|
416
|
+
operation.details.csharp.previewAnnouncement = {};
|
|
417
|
+
operation.details.csharp.previewAnnouncement.previewMessage = (_c = previewAnnouncement['preview-message']) !== null && _c !== void 0 ? _c : '';
|
|
418
|
+
operation.details.csharp.previewAnnouncement.estimatedGaDate = (_d = previewAnnouncement['estimated-ga-date']) !== null && _d !== void 0 ? _d : undefined;
|
|
419
|
+
}
|
|
392
420
|
// just the subject prefix can be an empty string
|
|
393
421
|
if (subjectPrefixReplacer !== undefined || subjectReplacer || verbReplacer || variantReplacer) {
|
|
394
422
|
const modificationMessage = `[DIRECTIVE] Changed command from ${oldCommandName} to ${newCommandName}. `;
|
|
395
423
|
state.message({
|
|
396
|
-
Channel:
|
|
424
|
+
Channel: extension_base_1.Channel.Debug, Text: modificationMessage
|
|
397
425
|
});
|
|
398
426
|
}
|
|
399
427
|
if (clearAlias) {
|
|
400
428
|
operation.details.csharp.alias = [];
|
|
401
429
|
state.message({
|
|
402
|
-
Channel:
|
|
430
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Cleared aliases from command ${newCommandName}.`
|
|
403
431
|
});
|
|
404
432
|
}
|
|
405
433
|
if (alias) {
|
|
@@ -410,12 +438,12 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
410
438
|
.replace('${variant}', operation.details.csharp.name);
|
|
411
439
|
};
|
|
412
440
|
const parsedAlias = new Array();
|
|
413
|
-
for (const each of linq_1.values(alias)) {
|
|
441
|
+
for (const each of (0, linq_1.values)(alias)) {
|
|
414
442
|
parsedAlias.push(getParsedAlias(each));
|
|
415
443
|
}
|
|
416
|
-
operation.details.csharp.alias = [...new Set(linq_1.values(operation.details.csharp.alias, parsedAlias).toArray())];
|
|
444
|
+
operation.details.csharp.alias = [...new Set((0, linq_1.values)(operation.details.csharp.alias, parsedAlias).toArray())];
|
|
417
445
|
state.message({
|
|
418
|
-
Channel:
|
|
446
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Added alias ${parsedAlias} to command ${newCommandName}.`
|
|
419
447
|
});
|
|
420
448
|
}
|
|
421
449
|
}
|
|
@@ -434,53 +462,53 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
434
462
|
const formatTable = directive.set['format-table'];
|
|
435
463
|
const suppressFormat = directive.set['suppress-format'];
|
|
436
464
|
// select all models
|
|
437
|
-
let models = [...(
|
|
465
|
+
let models = [...(_e = state.model.schemas.objects) !== null && _e !== void 0 ? _e : []];
|
|
438
466
|
// let models = values(state.model.schemas).toArray();
|
|
439
467
|
if (modelNameRegex) {
|
|
440
|
-
models = linq_1.values(models)
|
|
468
|
+
models = (0, linq_1.values)(models)
|
|
441
469
|
.where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(modelNameRegex); })
|
|
442
470
|
.toArray();
|
|
443
471
|
}
|
|
444
472
|
if (modelFullNameRegex) {
|
|
445
|
-
models = linq_1.values(models)
|
|
473
|
+
models = (0, linq_1.values)(models)
|
|
446
474
|
.where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.fullname}`.match(modelFullNameRegex); })
|
|
447
475
|
.toArray();
|
|
448
476
|
}
|
|
449
477
|
if (modelNamespaceRegex) {
|
|
450
|
-
models = linq_1.values(models)
|
|
478
|
+
models = (0, linq_1.values)(models)
|
|
451
479
|
.where(model => { var _a; return !!`${(_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.namespace}`.match(modelNamespaceRegex); })
|
|
452
480
|
.toArray();
|
|
453
481
|
}
|
|
454
482
|
if (propertyNameRegex && selectType === 'model') {
|
|
455
|
-
models = linq_1.values(models)
|
|
483
|
+
models = (0, linq_1.values)(models)
|
|
456
484
|
.where(model => {
|
|
457
485
|
var _a;
|
|
458
|
-
return linq_1.values(resolve_conflicts_1.allVirtualProperties((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties))
|
|
486
|
+
return (0, linq_1.values)((0, resolve_conflicts_1.allVirtualProperties)((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties))
|
|
459
487
|
.any(property => !!`${property.name}`.match(propertyNameRegex));
|
|
460
488
|
})
|
|
461
489
|
.toArray();
|
|
462
490
|
}
|
|
463
491
|
if (propertyNameRegex && (selectType === undefined || selectType === 'property')) {
|
|
464
|
-
const properties = linq_1.values(models)
|
|
465
|
-
.selectMany(model => { var _a; return resolve_conflicts_1.allVirtualProperties((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties); })
|
|
492
|
+
const properties = (0, linq_1.values)(models)
|
|
493
|
+
.selectMany(model => { var _a; return (0, resolve_conflicts_1.allVirtualProperties)((_a = model.language.csharp) === null || _a === void 0 ? void 0 : _a.virtualProperties); })
|
|
466
494
|
.where(property => !!`${property.name}`.match(propertyNameRegex))
|
|
467
495
|
.toArray();
|
|
468
|
-
for (const property of linq_1.values(properties)) {
|
|
496
|
+
for (const property of (0, linq_1.values)(properties)) {
|
|
469
497
|
const prevName = property.name;
|
|
470
498
|
property.name = propertyNameReplacer ? propertyNameRegex ? property.name.replace(propertyNameRegex, propertyNameReplacer) : propertyNameReplacer : property.name;
|
|
471
499
|
property.description = propertyDescriptionReplacer ? propertyDescriptionReplacer : property.description;
|
|
472
500
|
if (!property.name) {
|
|
473
|
-
state.message({ Channel:
|
|
501
|
+
state.message({ Channel: extension_base_1.Channel.Error, Text: `Directive '${directive.where['model-name'] || directive.where['model-fullname']}/${directive.where['property-name']}' attempted to change '${prevName}' to '' ` });
|
|
474
502
|
}
|
|
475
503
|
if (propertyNameRegex) {
|
|
476
504
|
state.message({
|
|
477
|
-
Channel:
|
|
505
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed property-name from ${prevName} to ${property.name}.`
|
|
478
506
|
});
|
|
479
507
|
}
|
|
480
508
|
}
|
|
481
509
|
}
|
|
482
510
|
else if (models) {
|
|
483
|
-
for (const model of linq_1.values(models)) {
|
|
511
|
+
for (const model of (0, linq_1.values)(models)) {
|
|
484
512
|
if (suppressFormat && model.language.csharp) {
|
|
485
513
|
model.language.csharp.suppressFormat = true;
|
|
486
514
|
}
|
|
@@ -488,22 +516,22 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
488
516
|
const resourceGroupFormat = {};
|
|
489
517
|
let ResourceGroupNameInclude = false;
|
|
490
518
|
const resourceGroupName = 'resourcegroupname';
|
|
491
|
-
const properties = resolve_conflicts_1.allVirtualProperties((
|
|
519
|
+
const properties = (0, resolve_conflicts_1.allVirtualProperties)((_f = model.language.csharp) === null || _f === void 0 ? void 0 : _f.virtualProperties);
|
|
492
520
|
const propertiesToExclude = formatTable['exclude-properties'];
|
|
493
521
|
const propertiesToInclude = formatTable.properties;
|
|
494
522
|
const labels = formatTable.labels;
|
|
495
523
|
const widths = formatTable.width;
|
|
496
|
-
for (const property of linq_1.values(properties)) {
|
|
524
|
+
for (const property of (0, linq_1.values)(properties)) {
|
|
497
525
|
if (property.name.toLowerCase() == resourceGroupName) {
|
|
498
526
|
ResourceGroupNameInclude = true;
|
|
499
527
|
}
|
|
500
528
|
}
|
|
501
529
|
if (labels) {
|
|
502
530
|
const parsedLabels = new linq_1.Dictionary();
|
|
503
|
-
for (const label of linq_1.items(labels)) {
|
|
531
|
+
for (const label of (0, linq_1.items)(labels)) {
|
|
504
532
|
parsedLabels[label.key.toLowerCase()] = label.value;
|
|
505
533
|
}
|
|
506
|
-
for (const property of linq_1.values(properties)) {
|
|
534
|
+
for (const property of (0, linq_1.values)(properties)) {
|
|
507
535
|
if (Object.keys(parsedLabels).includes(property.name.toLowerCase())) {
|
|
508
536
|
if (property.format === undefined) {
|
|
509
537
|
property.format = {};
|
|
@@ -517,10 +545,10 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
517
545
|
}
|
|
518
546
|
if (widths) {
|
|
519
547
|
const parsedWidths = new linq_1.Dictionary();
|
|
520
|
-
for (const w of linq_1.items(widths)) {
|
|
548
|
+
for (const w of (0, linq_1.items)(widths)) {
|
|
521
549
|
parsedWidths[w.key.toLowerCase()] = w.value;
|
|
522
550
|
}
|
|
523
|
-
for (const property of linq_1.values(properties)) {
|
|
551
|
+
for (const property of (0, linq_1.values)(properties)) {
|
|
524
552
|
if (Object.keys(parsedWidths).includes(property.name.toLowerCase())) {
|
|
525
553
|
if (property.format === undefined) {
|
|
526
554
|
property.format = {};
|
|
@@ -534,11 +562,11 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
534
562
|
}
|
|
535
563
|
if (propertiesToInclude) {
|
|
536
564
|
const indexes = new linq_1.Dictionary();
|
|
537
|
-
for (const item of linq_1.items(propertiesToInclude)) {
|
|
565
|
+
for (const item of (0, linq_1.items)(propertiesToInclude)) {
|
|
538
566
|
indexes[item.value.toLowerCase()] = item.key;
|
|
539
567
|
}
|
|
540
568
|
let ResourceGroupNameInclude = false;
|
|
541
|
-
for (const property of linq_1.values(properties)) {
|
|
569
|
+
for (const property of (0, linq_1.values)(properties)) {
|
|
542
570
|
if (property.name.toLowerCase() == 'resourcegroupname') {
|
|
543
571
|
ResourceGroupNameInclude = true;
|
|
544
572
|
}
|
|
@@ -560,7 +588,7 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
560
588
|
}
|
|
561
589
|
}
|
|
562
590
|
if (propertiesToExclude) {
|
|
563
|
-
for (const property of linq_1.values(properties)) {
|
|
591
|
+
for (const property of (0, linq_1.values)(properties)) {
|
|
564
592
|
if (propertiesToExclude.map(x => x.toLowerCase()).includes(property.name.toLowerCase())) {
|
|
565
593
|
property.format = { suppressFormat: true };
|
|
566
594
|
}
|
|
@@ -572,16 +600,16 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
572
600
|
if (!ResourceGroupNameInclude && await state.getValue('azure', false)) {
|
|
573
601
|
// Keep the format info for ResourceGroupName and we will need it later if resourcegroup-append is set
|
|
574
602
|
const formats = await state.getValue('formats', {});
|
|
575
|
-
formats[`${(
|
|
603
|
+
formats[`${(_g = model.language.csharp) === null || _g === void 0 ? void 0 : _g.name}`] = resourceGroupFormat;
|
|
576
604
|
await state.setValue('formats', formats);
|
|
577
605
|
}
|
|
578
606
|
}
|
|
579
|
-
const prevName = (
|
|
607
|
+
const prevName = (_h = model.language.csharp) === null || _h === void 0 ? void 0 : _h.name;
|
|
580
608
|
if (model.language.csharp) {
|
|
581
609
|
model.language.csharp.name = modelNameReplacer ? modelNameRegex ? model.language.csharp.name.replace(modelNameRegex, modelNameReplacer) : modelNameReplacer : model.language.csharp.name;
|
|
582
610
|
}
|
|
583
611
|
state.message({
|
|
584
|
-
Channel:
|
|
612
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed model-name from ${prevName} to ${(_j = model.language.csharp) === null || _j === void 0 ? void 0 : _j.name}.`
|
|
585
613
|
});
|
|
586
614
|
}
|
|
587
615
|
}
|
|
@@ -592,40 +620,40 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
592
620
|
const enumValueNameRegex = getPatternToMatch(directive.where['enum-value-name']);
|
|
593
621
|
const enumNameReplacer = directive.set['enum-name'];
|
|
594
622
|
const enumValueNameReplacer = directive.set['enum-value-name'];
|
|
595
|
-
let enums = [...(
|
|
623
|
+
let enums = [...(_k = state.model.schemas.sealedChoices) !== null && _k !== void 0 ? _k : [], ...(_l = state.model.schemas.choices) !== null && _l !== void 0 ? _l : []];
|
|
596
624
|
// let enums = values(state.model.schemas)
|
|
597
625
|
// .where(each => each.details.csharp.enum !== undefined)
|
|
598
626
|
// .toArray();
|
|
599
627
|
if (enumNameRegex) {
|
|
600
|
-
enums = linq_1.values(enums)
|
|
628
|
+
enums = (0, linq_1.values)(enums)
|
|
601
629
|
.where(each => { var _a; return !!`${(_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name}`.match(enumNameRegex); })
|
|
602
630
|
.toArray();
|
|
603
631
|
}
|
|
604
632
|
if (enumValueNameRegex) {
|
|
605
|
-
const enumsValues = linq_1.values(enums)
|
|
633
|
+
const enumsValues = (0, linq_1.values)(enums)
|
|
606
634
|
.selectMany(each => { var _a; return ((_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.enum) ? each.language.csharp.enum.values : []; })
|
|
607
635
|
.where(each => !!`${each.name}`.match(enumValueNameRegex))
|
|
608
636
|
.toArray();
|
|
609
|
-
for (const enumValue of linq_1.values(enumsValues)) {
|
|
637
|
+
for (const enumValue of (0, linq_1.values)(enumsValues)) {
|
|
610
638
|
const prevName = enumValue.name;
|
|
611
639
|
enumValue.name = enumValueNameReplacer ? enumNameRegex ? enumValue.name.replace(enumValueNameRegex, enumValueNameReplacer) : enumValueNameReplacer : prevName;
|
|
612
640
|
if (enumValueNameRegex) {
|
|
613
|
-
const enumNames = linq_1.values(enums)
|
|
641
|
+
const enumNames = (0, linq_1.values)(enums)
|
|
614
642
|
.select(each => { var _a; return (_a = each.language.csharp) === null || _a === void 0 ? void 0 : _a.name; })
|
|
615
643
|
.toArray();
|
|
616
644
|
state.message({
|
|
617
|
-
Channel:
|
|
645
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-value-name from ${prevName} to ${enumValue.name}. Enum: ${JSON.stringify(enumNames, null, 2)}`
|
|
618
646
|
});
|
|
619
647
|
}
|
|
620
648
|
}
|
|
621
649
|
}
|
|
622
650
|
else {
|
|
623
|
-
for (const each of linq_1.values(enums)) {
|
|
624
|
-
const prevName = (
|
|
651
|
+
for (const each of (0, linq_1.values)(enums)) {
|
|
652
|
+
const prevName = (_o = (_m = each.language.csharp) === null || _m === void 0 ? void 0 : _m.name) !== null && _o !== void 0 ? _o : '';
|
|
625
653
|
if (each.language.csharp) {
|
|
626
654
|
each.language.csharp.name = enumNameReplacer ? enumNameRegex ? each.language.csharp.name.replace(enumNameRegex, enumNameReplacer) : enumNameReplacer : prevName;
|
|
627
655
|
state.message({
|
|
628
|
-
Channel:
|
|
656
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Changed enum-name from ${prevName} to ${(_p = each.language.csharp) === null || _p === void 0 ? void 0 : _p.name}.`
|
|
629
657
|
});
|
|
630
658
|
}
|
|
631
659
|
}
|
|
@@ -641,45 +669,45 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
641
669
|
const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
|
|
642
670
|
if (subjectRegex || subjectPrefixRegex || verbRegex || variantRegex || (parameterRegex && selectType === 'command')) {
|
|
643
671
|
// select all operations first then reduce by finding the intersection with selectors
|
|
644
|
-
let operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
672
|
+
let operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
645
673
|
.select(operation => operation.key)
|
|
646
674
|
.toArray());
|
|
647
675
|
if (subjectRegex) {
|
|
648
|
-
operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
676
|
+
operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
649
677
|
.where(operation => !!`${operation.value.details.csharp.subject}`.match(subjectRegex) && operationsToRemoveKeys.has(operation.key))
|
|
650
678
|
.select(operation => operation.key)
|
|
651
679
|
.toArray());
|
|
652
680
|
}
|
|
653
681
|
if (subjectPrefixRegex && operationsToRemoveKeys.size > 0) {
|
|
654
|
-
operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
682
|
+
operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
655
683
|
.where(operation => !!`${operation.value.details.csharp.subjectPrefix}`.match(subjectPrefixRegex) && operationsToRemoveKeys.has(operation.key))
|
|
656
684
|
.select(operation => operation.key)
|
|
657
685
|
.toArray());
|
|
658
686
|
}
|
|
659
687
|
if (verbRegex && operationsToRemoveKeys.size > 0) {
|
|
660
|
-
operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
688
|
+
operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
661
689
|
.where(operation => !!`${operation.value.details.csharp.verb}`.match(verbRegex) && operationsToRemoveKeys.has(operation.key))
|
|
662
690
|
.select(operation => operation.key)
|
|
663
691
|
.toArray());
|
|
664
692
|
}
|
|
665
693
|
if (variantRegex && operationsToRemoveKeys.size > 0) {
|
|
666
|
-
operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
694
|
+
operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
667
695
|
.where(operation => !!`${operation.value.details.csharp.name}`.match(variantRegex) && operationsToRemoveKeys.has(operation.key))
|
|
668
696
|
.select(operation => operation.key)
|
|
669
697
|
.toArray());
|
|
670
698
|
}
|
|
671
699
|
if (parameterRegex && selectType === 'command' && operationsToRemoveKeys.size > 0) {
|
|
672
|
-
operationsToRemoveKeys = new Set(linq_1.items(state.model.commands.operations)
|
|
673
|
-
.where(operation => linq_1.values(resolve_conflicts_1.allVirtualParameters(operation.value.details.csharp.virtualParameters))
|
|
700
|
+
operationsToRemoveKeys = new Set((0, linq_1.items)(state.model.commands.operations)
|
|
701
|
+
.where(operation => (0, linq_1.values)((0, resolve_conflicts_1.allVirtualParameters)(operation.value.details.csharp.virtualParameters))
|
|
674
702
|
.any(parameter => !!`${parameter.name}`.match(parameterRegex)))
|
|
675
703
|
.where(operation => operationsToRemoveKeys.has(operation.key))
|
|
676
704
|
.select(operation => operation.key)
|
|
677
705
|
.toArray());
|
|
678
706
|
}
|
|
679
|
-
for (const key of linq_1.values(operationsToRemoveKeys)) {
|
|
707
|
+
for (const key of (0, linq_1.values)(operationsToRemoveKeys)) {
|
|
680
708
|
const operationInfo = state.model.commands.operations[key].details.csharp;
|
|
681
709
|
state.message({
|
|
682
|
-
Channel:
|
|
710
|
+
Channel: extension_base_1.Channel.Debug, Text: `[DIRECTIVE] Removed command ${operationInfo.verb}-${operationInfo.subjectPrefix}${operationInfo.subject}${operationInfo.name ? `_${operationInfo.name}` : ''}`
|
|
683
711
|
});
|
|
684
712
|
delete state.model.commands.operations[key];
|
|
685
713
|
}
|
|
@@ -688,13 +716,13 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
688
716
|
}
|
|
689
717
|
}
|
|
690
718
|
const operationIdentities = new Set();
|
|
691
|
-
for (const operation of linq_1.values(state.model.commands.operations)) {
|
|
719
|
+
for (const operation of (0, linq_1.values)(state.model.commands.operations)) {
|
|
692
720
|
const details = operation.details.csharp;
|
|
693
721
|
let fname = `${details.verb} -${details.subjectPrefix}${details.subject} -${details.name} `;
|
|
694
722
|
let n = 1;
|
|
695
723
|
while (operationIdentities.has(fname)) {
|
|
696
|
-
details.name = codegen_1.pascalCase(`${details.name.replace(/\d*$/g, '')} ${n++}`);
|
|
697
|
-
fname = codegen_1.pascalCase(`${details.verb} -${details.subjectPrefix}${details.subject} -${details.name}`);
|
|
724
|
+
details.name = (0, codegen_1.pascalCase)(`${details.name.replace(/\d*$/g, '')} ${n++}`);
|
|
725
|
+
fname = (0, codegen_1.pascalCase)(`${details.verb} -${details.subjectPrefix}${details.subject} -${details.name}`);
|
|
698
726
|
}
|
|
699
727
|
operationIdentities.add(fname);
|
|
700
728
|
}
|
|
@@ -702,14 +730,14 @@ See https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#de
|
|
|
702
730
|
}
|
|
703
731
|
async function applyModifiersV2(service) {
|
|
704
732
|
// dolauli implement directives
|
|
705
|
-
const allDirectives = await service.
|
|
706
|
-
directives = linq_1.values(allDirectives)
|
|
733
|
+
const allDirectives = await service.getValue('directive');
|
|
734
|
+
directives = (0, linq_1.values)(allDirectives)
|
|
707
735
|
// .select(directive => directive)
|
|
708
736
|
.where(directive => isWhereCommandDirective(directive) || isWhereModelDirective(directive) || isWhereEnumDirective(directive) || isRemoveCommandDirective(directive))
|
|
709
737
|
.toArray();
|
|
710
738
|
const state = await new model_state_1.ModelState(service).init();
|
|
711
739
|
const result = await tweakModel(state);
|
|
712
|
-
await service.
|
|
740
|
+
await service.writeFile({ filename: 'code-model-v4-modifiers-v2.yaml', content: (0, codegen_1.serialize)(result), sourceMap: undefined, artifactType: 'code-model-v4' });
|
|
713
741
|
}
|
|
714
742
|
exports.applyModifiersV2 = applyModifiersV2;
|
|
715
743
|
//# sourceMappingURL=modifiers-v2.js.map
|