diff --git a/src/vanilla/CodeGeneratorJs.cs b/src/vanilla/CodeGeneratorJs.cs index 8dcb1ec..c780023 100644 --- a/src/vanilla/CodeGeneratorJs.cs +++ b/src/vanilla/CodeGeneratorJs.cs @@ -17,7 +17,7 @@ namespace AutoRest.NodeJS { public class CodeGeneratorJs : CodeGenerator { - private const string ClientRuntimePackage = "ms-rest version 2.4.1"; + private const string ClientRuntimePackage = "ms-rest version 2.5.0"; public override string ImplementationFileExtension => ".js"; @@ -77,6 +77,8 @@ public override async Task Generate(CodeModel cm) await GenerateReadmeMd(codeModel, generatorSettings).ConfigureAwait(false); await GenerateLicenseTxt(codeModel, generatorSettings).ConfigureAwait(false); + + await GeneratePostinstallScript(codeModel, generatorSettings).ConfigureAwait(false); } protected async Task GenerateServiceClientJs(Func> serviceClientTemplateCreator, GeneratorSettingsJs generatorSettings) where T : CodeModelJs @@ -152,6 +154,14 @@ protected async Task GenerateLicenseTxt(CodeModelJs codeModel, GeneratorSettings } } + protected async Task GeneratePostinstallScript(CodeModelJs codeModel, GeneratorSettingsJs generatorSettings) + { + if (generatorSettings.GeneratePostinstallScript) + { + PostinstallScript postinstallScript = new PostinstallScript { Model = codeModel }; + await Write(postinstallScript, ".scripts/postinstall.js").ConfigureAwait(false); + } + } protected string GetModelSourceCodeFilePath(GeneratorSettingsJs generatorSettings, string modelFileName) => GetSourceCodeFilePath(generatorSettings, "models", modelFileName); diff --git a/src/vanilla/GeneratorSettingsJs.cs b/src/vanilla/GeneratorSettingsJs.cs index 52ef57e..a99f060 100644 --- a/src/vanilla/GeneratorSettingsJs.cs +++ b/src/vanilla/GeneratorSettingsJs.cs @@ -32,6 +32,11 @@ public class GeneratorSettingsJs : IGeneratorSettings /// public bool GenerateLicenseTxt { get; set; } + /// + /// Whether or not to generate the postinstall.js script. + /// + public bool GeneratePostinstallScript { get; set; } = true; + /// /// The sub-folder path where source code will be generated. /// @@ -251,4 +256,4 @@ private static void Log(Category category, string message, params string[] messa } } } -} \ No newline at end of file +} diff --git a/src/vanilla/Model/CodeModelJs.cs b/src/vanilla/Model/CodeModelJs.cs index 45a67d1..cfc048a 100644 --- a/src/vanilla/Model/CodeModelJs.cs +++ b/src/vanilla/Model/CodeModelJs.cs @@ -94,7 +94,7 @@ public virtual IEnumerable PackageDependencies() { return new[] { - "\"ms-rest\": \"^2.4.1\"" + "\"ms-rest\": \"^2.5.0\"" }; } @@ -425,6 +425,10 @@ private static string ConvertPackageNameToTypeScript(string packageName) { { "azure-arm-sb", "@azure/arm-servicebus" } }; + if (packageName == null) { + return ""; + } + if (customNamePackages.ContainsKey(packageName)) { return customNamePackages[packageName]; } @@ -437,9 +441,14 @@ private static string ConvertPackageNameToTypeScript(string packageName) { return $"@azure/{packageName}"; } + public string GetCorrespondingTypeScriptPackageName() + { + return ConvertPackageNameToTypeScript(PackageName); + } + public void GenerateTypeScriptSDKMessage(MarkdownBuilder builder) { - string typeScriptPackageName = ConvertPackageNameToTypeScript(PackageName); + string typeScriptPackageName = GetCorrespondingTypeScriptPackageName(); builder.Line($"**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://www.npmjs.com/package/{typeScriptPackageName}) which works on Node.js and browsers.**"); builder.Line($"**See https://aka.ms/azure-sdk-for-js-migration to learn more.**"); } diff --git a/src/vanilla/Templates/PackageJson.cshtml b/src/vanilla/Templates/PackageJson.cshtml index 49638fa..8b93ea5 100644 --- a/src/vanilla/Templates/PackageJson.cshtml +++ b/src/vanilla/Templates/PackageJson.cshtml @@ -24,6 +24,6 @@ "url": "@(Model.BugsUrl)" }, "scripts": { - "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" + "postinstall": "node .scripts/postinstall.js" } } diff --git a/src/vanilla/Templates/PostinstallScript.cshtml b/src/vanilla/Templates/PostinstallScript.cshtml new file mode 100644 index 0000000..d67d03a --- /dev/null +++ b/src/vanilla/Templates/PostinstallScript.cshtml @@ -0,0 +1,37 @@ +@using System +@inherits AutoRest.Core.Template +@Header("// ") +@EmptyLine +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; +@EmptyLine +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; +@EmptyLine + const firstLine = `Active development of this SDK has been moved to ${highlightColor}@(Model.GetCorrespondingTypeScriptPackageName())${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; +@EmptyLine + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; +@EmptyLine + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); +@EmptyLine + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; +@EmptyLine + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/options/generatelicense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js b/test/options/generatelicense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js new file mode 100644 index 0000000..5317e8d --- /dev/null +++ b/test/options/generatelicense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/options/generatelicense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/package.json b/test/options/generatelicense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/package.json index fae939d..7e268c1 100644 --- a/test/options/generatelicense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/package.json +++ b/test/options/generatelicense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/package.json @@ -4,7 +4,7 @@ "description": "AutoRestParameterFlattening Library with typescript type definitions for node", "version": "1.0.0-preview", "dependencies": { - "ms-rest": "^2.4.1" + "ms-rest": "^2.5.0" }, "keywords": [ "node", @@ -22,6 +22,6 @@ "url": "https://github.com/azure/azure-sdk-for-node/issues" }, "scripts": { - "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" + "postinstall": "node .scripts/postinstall.js" } } diff --git a/test/options/generatelicense-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js b/test/options/generatelicense-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js new file mode 100644 index 0000000..5317e8d --- /dev/null +++ b/test/options/generatelicense-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/options/generatelicense-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json b/test/options/generatelicense-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json index fae939d..7e268c1 100644 --- a/test/options/generatelicense-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json +++ b/test/options/generatelicense-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json @@ -4,7 +4,7 @@ "description": "AutoRestParameterFlattening Library with typescript type definitions for node", "version": "1.0.0-preview", "dependencies": { - "ms-rest": "^2.4.1" + "ms-rest": "^2.5.0" }, "keywords": [ "node", @@ -22,6 +22,6 @@ "url": "https://github.com/azure/azure-sdk-for-node/issues" }, "scripts": { - "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" + "postinstall": "node .scripts/postinstall.js" } } diff --git a/test/options/generatepackagejson-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js b/test/options/generatepackagejson-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js new file mode 100644 index 0000000..5317e8d --- /dev/null +++ b/test/options/generatepackagejson-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/options/generatereadmemd-azure-true/Expected/AcceptanceTests/ParameterFlattening/package.json b/test/options/generatereadmemd-azure-true/Expected/AcceptanceTests/ParameterFlattening/package.json index 7f79893..1e8b5d5 100644 --- a/test/options/generatereadmemd-azure-true/Expected/AcceptanceTests/ParameterFlattening/package.json +++ b/test/options/generatereadmemd-azure-true/Expected/AcceptanceTests/ParameterFlattening/package.json @@ -4,7 +4,7 @@ "description": "AutoRestParameterFlattening Library with typescript type definitions for node", "version": "1.0.0-preview", "dependencies": { - "ms-rest": "^2.4.1", + "ms-rest": "^2.5.0", "ms-rest-azure": "^2.5.5" }, "keywords": [ @@ -23,6 +23,6 @@ "url": "https://github.com/azure/azure-sdk-for-node/issues" }, "scripts": { - "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" + "postinstall": "node .scripts/postinstall.js" } } diff --git a/test/options/generatereadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js b/test/options/generatereadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js new file mode 100644 index 0000000..5317e8d --- /dev/null +++ b/test/options/generatereadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/options/generatereadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json b/test/options/generatereadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json index 3aedc1d..a1f292a 100644 --- a/test/options/generatereadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json +++ b/test/options/generatereadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/package.json @@ -4,7 +4,7 @@ "description": "AutoRestParameterFlattening Library with typescript type definitions for node", "version": "1.2.3", "dependencies": { - "ms-rest": "^2.4.1" + "ms-rest": "^2.5.0" }, "keywords": [ "node", @@ -22,6 +22,6 @@ "url": "https://github.com/azure/azure-sdk-for-node/issues" }, "scripts": { - "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" + "postinstall": "node .scripts/postinstall.js" } } diff --git a/test/options/sourcecodefolderpath-azure-sources/Expected/AcceptanceTests/ParameterFlattening/package.json b/test/options/sourcecodefolderpath-azure-sources/Expected/AcceptanceTests/ParameterFlattening/package.json index 7f79893..1e8b5d5 100644 --- a/test/options/sourcecodefolderpath-azure-sources/Expected/AcceptanceTests/ParameterFlattening/package.json +++ b/test/options/sourcecodefolderpath-azure-sources/Expected/AcceptanceTests/ParameterFlattening/package.json @@ -4,7 +4,7 @@ "description": "AutoRestParameterFlattening Library with typescript type definitions for node", "version": "1.0.0-preview", "dependencies": { - "ms-rest": "^2.4.1", + "ms-rest": "^2.5.0", "ms-rest-azure": "^2.5.5" }, "keywords": [ @@ -23,6 +23,6 @@ "url": "https://github.com/azure/azure-sdk-for-node/issues" }, "scripts": { - "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" + "postinstall": "node .scripts/postinstall.js" } } diff --git a/test/options/sourcecodefolderpath-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js b/test/options/sourcecodefolderpath-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js new file mode 100644 index 0000000..5317e8d --- /dev/null +++ b/test/options/sourcecodefolderpath-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/options/sourcecodefolderpath-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/package.json b/test/options/sourcecodefolderpath-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/package.json index fae939d..7e268c1 100644 --- a/test/options/sourcecodefolderpath-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/package.json +++ b/test/options/sourcecodefolderpath-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/package.json @@ -4,7 +4,7 @@ "description": "AutoRestParameterFlattening Library with typescript type definitions for node", "version": "1.0.0-preview", "dependencies": { - "ms-rest": "^2.4.1" + "ms-rest": "^2.5.0" }, "keywords": [ "node", @@ -22,6 +22,6 @@ "url": "https://github.com/azure/azure-sdk-for-node/issues" }, "scripts": { - "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" + "postinstall": "node .scripts/postinstall.js" } } diff --git a/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArray/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyArray/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArray/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyBoolean/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyBoolean/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyBoolean/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyByte/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyByte/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyByte/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyComplex/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDate/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyDate/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyDate/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDateTime/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyDateTime/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyDateTime/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDictionary/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyDictionary/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyDictionary/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDuration/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyDuration/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyDuration/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyFile/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyFile/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyFile/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyFormData/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyFormData/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyFormData/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyInteger/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyInteger/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyInteger/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyNumber/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyNumber/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyNumber/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/BodyString/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/BodyString/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyString/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/ComplexModelClient/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/ComplexModelClient/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/ComplexModelClient/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/CompositeBoolIntClient/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/CompositeBoolIntClient/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/CompositeBoolIntClient/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/Header/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/Header/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/Header/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/Http/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/Http/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/Http/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/ModelFlattening/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/ModelFlattening/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/ModelFlattening/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/Report/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/Report/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/Report/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/Url/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/Url/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/Url/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +} diff --git a/test/vanilla/Expected/AcceptanceTests/Validation/.scripts/postinstall.js b/test/vanilla/Expected/AcceptanceTests/Validation/.scripts/postinstall.js new file mode 100644 index 0000000..a4811c1 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/Validation/.scripts/postinstall.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +const resetColor = "\x1b[0m"; +const brightColor = "\x1b[1m"; +const highlightColor = "\x1b[31m"; + +try { + const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; + + const firstLine = `Active development of this SDK has been moved to ${highlightColor}${resetColor}${brightColor} package.`; + const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; + const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; + + const framePadding = 4; + const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; + const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; + const getPaddingLength = (strLength) => width - strLength - framePadding; + + const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); + const secondLinePaddingLength = getPaddingLength(secondLine.length); + const thirdLinePaddingLength = getPaddingLength(thirdLine.length); + const line = "#".repeat(width); + + const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; + + console.log(brightColor); + console.log("\n" + line); + console.log(formatTextLine(firstLine, firstLinePaddingLength)); + console.log(formatTextLine(secondLine, secondLinePaddingLength)); + console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); + console.log(line + "\n"); + console.log(resetColor); +} catch (err) { + // ignore +}