UNPKG

apim-policy-utils

Version:

An XML file scripts maniputaling and debugging tool targeting to help working with Azure APIM Policy files in xml format.

44 lines (34 loc) • 1.59 kB
import { getVersion } from "./getVersion" export const separator = "// ================== <Generated Separator. Please don't edit this line> ==================" export const cliHelp = ` šŸ‘‹ Welcome to apim-policy-utils! āœ… Version: ${getVersion()} āœ… Usage: apim-policy-utils <command> <directory path> šŸ‘‰ Examples: $ apim-policy-utils -c|--combine path/to/policies $ apim-policy-utils -e|--extract path/to/scripts path/to/policies(optional) šŸ”Ž Here's what each command does: šŸ“„ extract: Extracts inline policies and policy sets from XML files in a directory and generates .csx files for each policy. šŸ“¦ combine: Combines the extracted .csx files from subdirectories of a given directory into a single xml file. šŸ‘‰ For the extract command, please provide a directory path that contains all the policy files. The directory structure should look like this: . ā”œā”€ā”€ policies | ā”œā”€ā”€ policy1.xml | ā”œā”€ā”€ policy2.xml | └── policy3.xml šŸ‘‰ For the combine command, please provide a directory path that contains subdirectories with generated .csx files from the extract command. The directory structure should look like this: . ā”œā”€ā”€ scripts | ā”œā”€ā”€ subfolder1 | | ā”œā”€ā”€ block-001.csx | | ā”œā”€ā”€ inline-001.csx | | ā”œā”€ā”€ replaced.xml | | ā”œā”€ā”€ context.csx | | └── context.json | ā”œā”€ā”€ subfolder2 | | ā”œā”€ā”€ block-001.csx | | ā”œā”€ā”€ inline-001.csx | | ā”œā”€ā”€ replaced.xml | | ā”œā”€ā”€ context.csx | | └── context.json `