├── .markdownlint.yml ├── images ├── f5.png ├── ACC_Robot_Rev.png └── ACC_Robot_Rev.svg ├── chariot_output_4.15.2021.png ├── chariot_output_bare_4.15.2021.png ├── f5-automation-config-converter-1.126.0.tgz ├── .vscode ├── extensions.json ├── tasks.json └── launch.json ├── .gitignore ├── .vscodeignore ├── tsconfig.json ├── src ├── tests │ ├── runTests.ts │ └── suite │ │ ├── index.ts │ │ └── extension.tests.ts ├── loadTeem.ts ├── util.ts └── extension.ts ├── UPDATE.md ├── artifacts ├── data-groups.conf ├── testApp.conf ├── base.do.json ├── testApp.as3.json └── base_do.conf ├── .github └── workflows │ ├── PublishToMarketPlace.yml │ ├── PublishToOpenVsx.yml │ ├── main.yml │ └── test-matrix.yml ├── package.json ├── README.md ├── CHANGELOG.md └── LICENSE /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | MD024: false 2 | MD013: false -------------------------------------------------------------------------------- /images/f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f5devcentral/vscode-f5-chariot/HEAD/images/f5.png -------------------------------------------------------------------------------- /images/ACC_Robot_Rev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f5devcentral/vscode-f5-chariot/HEAD/images/ACC_Robot_Rev.png -------------------------------------------------------------------------------- /chariot_output_4.15.2021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f5devcentral/vscode-f5-chariot/HEAD/chariot_output_4.15.2021.png -------------------------------------------------------------------------------- /chariot_output_bare_4.15.2021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f5devcentral/vscode-f5-chariot/HEAD/chariot_output_bare_4.15.2021.png -------------------------------------------------------------------------------- /f5-automation-config-converter-1.126.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f5devcentral/vscode-f5-chariot/HEAD/f5-automation-config-converter-1.126.0.tgz -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "f5devcentral.vscode-f5", 6 | "bitwisecook.iapp", 7 | "bitwisecook.irule" 8 | ] 9 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # converted ts 2 | out 3 | 4 | # node/modules install directory 5 | ./node_modules/ 6 | node_modules 7 | 8 | .vscode-test/ 9 | # installable extension packages 10 | *.vsix 11 | 12 | # user app data for npm? 13 | *AppDataRoamingnpm 14 | 15 | # exclude input/output files for file workflow 16 | toConvert.conf 17 | converted.as3.json 18 | .f5-acc 19 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/tests/** 4 | # ignore new documentation site 5 | docs/** 6 | # ignore source typescript files 7 | src/** 8 | .gitignore 9 | vsc-extension-quickstart.md 10 | **/tsconfig.json 11 | **/.eslintrc.json 12 | **/*.map 13 | **/*.ts 14 | 15 | # ignore github actions 16 | .github/** 17 | # ignore node cpu profiling file 18 | *.cpuprofile -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2019", 5 | "lib": [ 6 | "ES2019" 7 | ], 8 | "outDir": "out", 9 | "sourceMap": true, 10 | "strict": true, 11 | "rootDir": "src", 12 | "esModuleInterop": true, 13 | "resolveJsonModule": true, 14 | "skipLibCheck": true 15 | }, 16 | "exclude": [ 17 | "node_modules", 18 | ".vscode-test", 19 | "tests" 20 | ] 21 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/tests/runTests.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | import { runTests } from '@vscode/test-electron'; 4 | 5 | async function main() { 6 | try { 7 | // The folder containing the Extension Manifest package.json 8 | // Passed to `--extensionDevelopmentPath` 9 | const extensionDevelopmentPath = path.resolve(__dirname, '../../'); 10 | 11 | // The path to test runner 12 | // Passed to --extensionTestsPath 13 | const extensionTestsPath = path.resolve(__dirname, './suite/index'); 14 | 15 | // Download VS Code, unzip it and run the integration test 16 | await runTests({ extensionDevelopmentPath, extensionTestsPath }); 17 | } catch (err) { 18 | console.error('Failed to run tests'); 19 | process.exit(1); 20 | } 21 | } 22 | 23 | main(); 24 | -------------------------------------------------------------------------------- /UPDATE.md: -------------------------------------------------------------------------------- 1 | # how to update acc package 2 | 3 | Since ACC is not published as an npm package, we have to point directly to the github repo for code and updates. To prevent any skew along the way we point to specific tags/versions 4 | 5 | To update ACC package use the following command but update the version tag at the end. DO NOT use latest. 6 | 7 | Update the vscode-f5-chariot package version 8 | 9 | For the example below, we assume the current verion is 1.18.0, we want to upgrade to 1.19.0 10 | 11 | ```bash 12 | npm verion 1.19.0 13 | ``` 14 | 15 | Install the latest tag using the specific tag 16 | 17 | ```bash 18 | npm install f5devcentral/f5-automation-config-converter.git#v1.19.0 19 | ``` 20 | 21 | update CHANGELOG.md 22 | 23 | 24 | ## run tests 25 | 26 | npm test 27 | 28 | -------------------------------------------------------------------------------- /artifacts/data-groups.conf: -------------------------------------------------------------------------------- 1 | ltm data-group internal /partition_1/string-datagroup { 2 | records { 3 | /api/test/app1 {} 4 | /api/test/app2 { 5 | data something 6 | } 7 | /api/test/app3 { 8 | data "something in quotes with special stuff!@#${}[]" 9 | } 10 | /api/test/app4 { 11 | data 1234x5678 12 | } 13 | } 14 | type string 15 | } 16 | ltm data-group internal /partition_2/address_datagroup { 17 | records { 18 | 1.1.1.1/28 { 19 | data somedata 20 | } 21 | 2.2.2.2/32 { 22 | data "some data with special !@#${}[]12345" 23 | } 24 | 3.3.3.3/24 { 25 | data 6534cv 26 | } 27 | type ip 28 | } 29 | } 30 | ltm data-group internal /partition_3/integer_datagroup { 31 | records { 32 | 1 { 33 | data 1 34 | } 35 | 4 { 36 | data xxx 37 | } 38 | 5 { 39 | data 5000 40 | } 41 | 777 { 42 | data 7 43 | } 44 | 96789 { 45 | data "some data with special !@#${}[]12345" 46 | } 47 | } 48 | type integer 49 | } -------------------------------------------------------------------------------- /src/loadTeem.ts: -------------------------------------------------------------------------------- 1 | 2 | 'use strict'; 3 | 4 | import fs from 'fs'; 5 | import path from 'path'; 6 | 7 | import { ExtensionContext } from "vscode"; 8 | 9 | export async function loadTeemKey(ctx: ExtensionContext) { 10 | 11 | const filePath = path.join(ctx.extensionPath, 'TEEM_KEY'); 12 | let tKey: string | undefined; 13 | 14 | // try to find/read/load key file from new extension install 15 | try { 16 | 17 | tKey = fs.readFileSync(filePath, 'utf-8'); 18 | 19 | console.log('teem key file detected'); 20 | 21 | // store key in vscode secret store 22 | await ctx.secrets.store('TEEM_KEY', tKey); 23 | 24 | // if we made it this far, wait 2 seconds, then delete the file 25 | setTimeout( () => { 26 | console.log('Deleting key file at', filePath); 27 | fs.unlinkSync(filePath); 28 | }, 2000); 29 | 30 | } catch (e) { 31 | // if this doesn't work, just continue and try to load the key from secret 32 | // return; 33 | } 34 | 35 | // try to load the key from secrets 36 | tKey = await ctx.secrets.get('TEEM_KEY'); 37 | 38 | // if after all that, set the env for with the key 39 | if(tKey) { 40 | process.env.TEEM_KEY = tKey; 41 | } 42 | 43 | // console.log(process.env); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /artifacts/testApp.conf: -------------------------------------------------------------------------------- 1 | ltm virtual /Common/app1_t443_vs { 2 | destination /Common/192.168.1.21:443 3 | ip-protocol tcp 4 | last-modified-time 2020-09-18:10:05:54 5 | mask 255.255.255.255 6 | pool /Common/app1_t80_pool 7 | profiles { 8 | /Common/http { } 9 | /Common/tcp { } 10 | } 11 | serverssl-use-sni disabled 12 | source 0.0.0.0/0 13 | source-address-translation { 14 | type automap 15 | } 16 | translate-address enabled 17 | translate-port enabled 18 | } 19 | ltm pool /Common/app1_t80_pool { 20 | members { 21 | /Common/app1_Node1:80 { 22 | address 192.168.1.22 23 | } 24 | /Common/app1_Node2:80 { 25 | address 192.168.1.23 26 | } 27 | } 28 | monitor /Common/http and /Common/tcp 29 | } 30 | ltm node /Common/app1_Node1 { 31 | address 192.168.1.22 32 | } 33 | ltm node /Common/app1_Node2 { 34 | address 192.168.1.23 35 | } 36 | 37 | 38 | ############################################# 39 | 40 | 41 | ltm virtual /Common/app1_t80_vs { 42 | creation-time 2020-09-17:08:50:22 43 | destination /Common/192.168.1.21:80 44 | ip-protocol tcp 45 | last-modified-time 2020-09-17:08:51:07 46 | mask 255.255.255.255 47 | profiles { 48 | /Common/http { } 49 | /Common/tcp { } 50 | } 51 | rules { 52 | /Common/_sys_https_redirect 53 | } 54 | serverssl-use-sni disabled 55 | source 0.0.0.0/0 56 | translate-address enabled 57 | translate-port enabled 58 | } 59 | 60 | 61 | ############################################# 62 | 63 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Run Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "runtimeExecutable": "${execPath}", 13 | "args": [ 14 | "--extensionDevelopmentPath=${workspaceFolder}" 15 | ], 16 | "outFiles": [ 17 | "${workspaceFolder}/out/**/*.js" 18 | ], 19 | "preLaunchTask": "${defaultBuildTask}" 20 | }, 21 | { 22 | "name": "Extension Tests", 23 | "type": "extensionHost", 24 | "request": "launch", 25 | "runtimeExecutable": "${execPath}", 26 | "args": [ 27 | "--extensionDevelopmentPath=${workspaceFolder}", 28 | "--extensionTestsPath=${workspaceFolder}/out/tests/suite/index" 29 | ], 30 | "outFiles": [ 31 | "${workspaceFolder}/out/tests/**/*.js" 32 | ], 33 | "preLaunchTask": "${defaultBuildTask}" 34 | }, 35 | { 36 | "name": "Debug current test", 37 | "type": "node", 38 | "request": "launch", 39 | "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", 40 | "args": [ 41 | "-r", 42 | "ts-node/register", 43 | "--no-timeout", 44 | "--colors", 45 | "${file}", 46 | ], 47 | "internalConsoleOptions": "neverOpen", 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /src/tests/suite/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as fs from 'fs'; 3 | import Mocha from 'mocha'; 4 | import { glob } from 'glob'; 5 | 6 | // Log file path - writes to project root 7 | const logFile = path.resolve(__dirname, '..', '..', '..', 'test-debug.log'); 8 | 9 | export function log(message: string, data?: unknown): void { 10 | const timestamp = new Date().toISOString(); 11 | let line = `[${timestamp}] ${message}`; 12 | if (data !== undefined) { 13 | line += ` ${typeof data === 'string' ? data : JSON.stringify(data, null, 2)}`; 14 | } 15 | line += '\n'; 16 | fs.appendFileSync(logFile, line); 17 | console.log(message, data ?? ''); 18 | } 19 | 20 | export async function run(): Promise { 21 | // Clear log file at start 22 | fs.writeFileSync(logFile, `=== TEST RUN STARTED ${new Date().toISOString()} ===\n`); 23 | 24 | log('=== TEST RUNNER STARTING ==='); 25 | log('Current directory:', __dirname); 26 | log('Log file:', logFile); 27 | 28 | // Create the mocha test 29 | const mocha = new Mocha({ 30 | ui: 'tdd', 31 | timeout: 60000, 32 | }); 33 | // mocha.useColors(true); 34 | 35 | const testsRoot = path.resolve(__dirname, '..'); 36 | log('Tests root:', testsRoot); 37 | 38 | try { 39 | const files = await glob('**/**.tests.js', { cwd: testsRoot }); 40 | log('Found test files:', files); 41 | 42 | // Add files to the test suite 43 | files.forEach((f: string) => { 44 | const fullPath = path.resolve(testsRoot, f); 45 | log('Adding test file:', fullPath); 46 | mocha.addFile(fullPath); 47 | }); 48 | 49 | // Run the mocha test 50 | log('=== RUNNING MOCHA TESTS ==='); 51 | return new Promise((c, e) => { 52 | mocha.run(failures => { 53 | log('=== MOCHA FINISHED ==='); 54 | log('Failures:', failures); 55 | if (failures > 0) { 56 | e(new Error(`${failures} tests failed.`)); 57 | } else { 58 | c(); 59 | } 60 | }); 61 | }); 62 | } catch (err) { 63 | log('=== TEST RUNNER ERROR ==='); 64 | log('Error:', err instanceof Error ? err.message : String(err)); 65 | throw err; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /.github/workflows/PublishToMarketPlace.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow that is manually triggered 2 | 3 | name: Publish to Marketplace 4 | 5 | # on: 6 | # release: 7 | # # Only use the types keyword to narrow down the activity types that will trigger your workflow. 8 | # # types: [published] 9 | # types: [published, created, edited] 10 | 11 | # curl -sL https://api.github.com/repos/f5devcentral/vscode-f5/releases/latest | jq .assets[0].browser_download_url 12 | # "https://github.com/f5devcentral/vscode-f5/releases/download/v2.3.0/vscode-f5-fast-2.3.0.vsix" 13 | 14 | # single line command to download latest release 15 | # curl -sL https://api.github.com/repos/f5devcentral/vscode-f5/releases/latest | jq .assets[0].browser_download_url | xargs wget 16 | 17 | 18 | on: 19 | workflow_dispatch: 20 | 21 | jobs: 22 | Build_Publish: 23 | runs-on: ubuntu-latest 24 | 25 | steps: 26 | - uses: actions/checkout@v2 27 | - uses: actions/setup-node@v1 28 | with: 29 | node-version: 14 30 | 31 | - name: npm install everything 32 | # https://docs.npmjs.com/cli/v8/commands/npm-ci 33 | run: npm ci 34 | 35 | # - name: Publish to Open VSX Registry 36 | # id: publishToOpenVSX 37 | # uses: HaaLeo/publish-vscode-extension@v0 38 | # with: 39 | # pat: ${{ secrets.OPEN_VSX_TOKEN }} 40 | # # extensionFile: ${{ steps.get_release_name.outputs.name }} 41 | # # packagePath: '' 42 | # # dryRun: true 43 | 44 | # - name: display open vsx output 45 | # run: 46 | # echo ${{ steps.publishToOpenVSX.outputs.vsixPath }} 47 | # echo ${{ steps.get_release_name.outputs.name }} 48 | 49 | - name: Publish to Visual Studio Marketplace 50 | uses: HaaLeo/publish-vscode-extension@v0 51 | with: 52 | pat: ${{ secrets.MARKETPLACE_PUBLISH_KEY }} 53 | registryUrl: https://marketplace.visualstudio.com 54 | # extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} 55 | # extensionFile: ${{ steps.get_release_name.outputs.name }} 56 | # packagePath: '' 57 | dryRun: true 58 | -------------------------------------------------------------------------------- /artifacts/base.do.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/F5Networks/f5-declarative-onboarding/master/src/schema/latest/remote.schema.json", 3 | "schemaVersion": "1.0.0", 4 | "class": "Device", 5 | "async": true, 6 | "Common": { 7 | "class": "Tenant", 8 | "System": { 9 | "class": "System", 10 | "hostname": "devCloud01.benlab.io", 11 | "consoleInactivityTimeout": 1200, 12 | "mgmtDhcpEnabled": true, 13 | "autoCheck": true, 14 | "autoPhonehome": false 15 | }, 16 | "Authentication": { 17 | "class": "Authentication", 18 | "fallback": true, 19 | "remoteUsersDefaults": { 20 | "role": "admin", 21 | "terminalAccess": "tmsh" 22 | }, 23 | "radius": { 24 | "servers": { 25 | "primary": { 26 | "secret": "", 27 | "server": "10.200.244.1" 28 | } 29 | } 30 | } 31 | }, 32 | "ManagementIp_IPv4": { 33 | "class": "ManagementIp", 34 | "remark": "configured-statically", 35 | "address": "10.200.244.110/24" 36 | }, 37 | "Provision": { 38 | "class": "Provision", 39 | "apm": "nominal", 40 | "avr": "nominal", 41 | "ltm": "nominal" 42 | }, 43 | "NTP": { 44 | "class": "NTP", 45 | "timezone": "US/Central" 46 | }, 47 | "DNS": { 48 | "class": "DNS", 49 | "nameServers": [ 50 | "192.168.200.7", 51 | "192.168.200.8" 52 | ], 53 | "search": [ 54 | "benlab.io" 55 | ] 56 | }, 57 | "internal": { 58 | "class": "VLAN", 59 | "tag": 4094, 60 | "interfaces": [ 61 | { 62 | "name": "1.0", 63 | "tagged": false 64 | } 65 | ] 66 | }, 67 | "Analytics": { 68 | "class": "Analytics" 69 | }, 70 | "default": { 71 | "class": "ManagementRoute", 72 | "remark": "configured-statically", 73 | "gw": "10.200.244.1", 74 | "network": "default" 75 | }, 76 | "/Common/comm-public": { 77 | "source": "default", 78 | "class": "SnmpCommunity", 79 | "name": "public" 80 | }, 81 | "HTTPD": { 82 | "class": "HTTPD", 83 | "authPamIdleTimeout": 12000 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /.github/workflows/PublishToOpenVsx.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow that is manually triggered 2 | 3 | name: Publish to OpenVSX 4 | 5 | # on: 6 | # release: 7 | # # Only use the types keyword to narrow down the activity types that will trigger your workflow. 8 | # # types: [published] 9 | # types: [published, created, edited] 10 | 11 | # curl -sL https://api.github.com/repos/f5devcentral/vscode-f5/releases/latest | jq .assets[0].browser_download_url 12 | # "https://github.com/f5devcentral/vscode-f5/releases/download/v2.3.0/vscode-f5-fast-2.3.0.vsix" 13 | 14 | # single line command to download latest release 15 | # curl -sL https://api.github.com/repos/f5devcentral/vscode-f5/releases/latest | jq .assets[0].browser_download_url | xargs wget 16 | 17 | 18 | on: 19 | workflow_dispatch: 20 | 21 | jobs: 22 | Build_Publish: 23 | runs-on: ubuntu-latest 24 | 25 | steps: 26 | - uses: actions/checkout@v2 27 | - uses: actions/setup-node@v1 28 | with: 29 | node-version: 12 30 | 31 | # - name: get latest release name 32 | # id: get_release_name 33 | # run: echo ::set-output name=name::$(curl -sL https://api.github.com/repos/f5devcentral/vscode-f5/releases/latest | jq .assets[0].name) 34 | # # outputs: 35 | # # releaseName: 36 | # # description: 'full name of the release' 37 | 38 | # - name: display release name from output 39 | # # run: echo ${{ outputs.releaseName.value }} 40 | # run: echo ${{ steps.get_release_name.outputs.name }} 41 | 42 | # - name: download latest release 43 | # run: "curl -sL https://api.github.com/repos/f5devcentral/vscode-f5/releases/latest | jq .assets[0].browser_download_url | xargs wget" 44 | # shell: bash 45 | 46 | # - name: list directory 47 | # run: ls -la 48 | # shell: bash 49 | 50 | - name: npm install everything 51 | run: npm install 52 | 53 | - name: Publish to Open VSX Registry 54 | id: publishToOpenVSX 55 | uses: HaaLeo/publish-vscode-extension@v0 56 | with: 57 | pat: ${{ secrets.OPEN_VSX_TOKEN }} 58 | # extensionFile: ${{ steps.get_release_name.outputs.name }} 59 | # packagePath: '' 60 | # dryRun: true 61 | 62 | # - name: display open vsx output 63 | # run: 64 | # echo ${{ steps.publishToOpenVSX.outputs.vsixPath }} 65 | # echo ${{ steps.get_release_name.outputs.name }} 66 | 67 | # - name: Publish to Visual Studio Marketplace 68 | # uses: HaaLeo/publish-vscode-extension@v0 69 | # with: 70 | # pat: ${{ secrets.MARKETPLACE_PUBLISH_KEY }} 71 | # registryUrl: https://marketplace.visualstudio.com 72 | # extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} 73 | # # extensionFile: ${{ steps.get_release_name.outputs.name }} 74 | # packagePath: '' 75 | # # dryRun: true 76 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-f5-chariot", 3 | "displayName": "F5 ACC Chariot", 4 | "description": "(ACC) AS3 Configuration Converter integration", 5 | "version": "1.22.0", 6 | "license": "Apache-2.0", 7 | "publisher": "F5DevCentral", 8 | "icon": "images/f5.png", 9 | "galleryBanner": { 10 | "color": "#DCDCDC", 11 | "theme": "light" 12 | }, 13 | "homepage": "https://github.com/f5devcentral/vscode-f5-chariot/blob/main/README.md", 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/f5devcentral/vscode-f5-chariot" 17 | }, 18 | "engines": { 19 | "vscode": "^1.53.0" 20 | }, 21 | "categories": [ 22 | "Other" 23 | ], 24 | "activationEvents": [ 25 | "onCommand:f5.chariot.convertAS3", 26 | "onCommand:f5.chariot.convertDO" 27 | ], 28 | "main": "./out/extension.js", 29 | "contributes": { 30 | "commands": [ 31 | { 32 | "command": "f5.chariot.convertAS3", 33 | "title": "Convert to AS3 with ACC", 34 | "category": "F5" 35 | }, 36 | { 37 | "command": "f5.chariot.convertDO", 38 | "title": "Convert to DO with ACC", 39 | "category": "F5" 40 | } 41 | ], 42 | "menus": { 43 | "editor/context": [ 44 | { 45 | "command": "f5.chariot.convertAS3", 46 | "group": "chariot" 47 | }, 48 | { 49 | "command": "f5.chariot.convertDO", 50 | "group": "chariot" 51 | } 52 | ] 53 | } 54 | }, 55 | "scripts": { 56 | "vscode:prepublish": "npm run compile", 57 | "compile": "tsc -p ./", 58 | "package": "vsce package --no-dependencies", 59 | "lint": "eslint . --ext .ts,.tsx", 60 | "pretest": "npm run compile && npm run lint", 61 | "test": "node ./out/tests/runTests.js", 62 | "watch": "tsc -watch -p ./" 63 | }, 64 | "devDependencies": { 65 | "@types/glob": "^7.2.0", 66 | "@types/mocha": "^9.1.0", 67 | "@types/node": "^17.0.12", 68 | "@types/vscode": "^1.53.0", 69 | "@typescript-eslint/eslint-plugin": "^5.62.0", 70 | "@typescript-eslint/parser": "^5.62.0", 71 | "eslint": "^8.57.0", 72 | "mocha": "^11.7.5", 73 | "ts-node": "^10.4.0", 74 | "typescript": "^4.5.5", 75 | "@vscode/test-electron": "^2.4.1" 76 | }, 77 | "dependencies": { 78 | "f5-automation-config-converter": "file:f5-automation-config-converter-1.126.0.tgz", 79 | "f5-conx-core": "^1.2.0" 80 | }, 81 | "overrides": { 82 | "f5-automation-config-converter": { 83 | "ajv": "8.17.1" 84 | }, 85 | "semver": "7.7.3" 86 | }, 87 | "eslintConfig": { 88 | "root": true, 89 | "parser": "@typescript-eslint/parser", 90 | "plugins": [ 91 | "@typescript-eslint" 92 | ], 93 | "extends": [ 94 | "eslint:recommended", 95 | "plugin:@typescript-eslint/recommended" 96 | ], 97 | "rules": { 98 | "semi": [ 99 | 2, 100 | "always" 101 | ], 102 | "@typescript-eslint/no-unused-vars": 0, 103 | "@typescript-eslint/no-explicit-any": 0, 104 | "@typescript-eslint/explicit-module-boundary-types": 0, 105 | "@typescript-eslint/no-non-null-assertion": 0 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /artifacts/testApp.as3.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/F5Networks/f5-appsvcs-extension/master/schema/latest/as3-schema.json", 3 | "class": "AS3", 4 | "declaration": { 5 | "class": "ADC", 6 | "schemaVersion": "3.34.0", 7 | "id": "urn:uuid:4e380b90-10a6-4c2f-9337-2156568b665b", 8 | "label": "Converted Declaration", 9 | "remark": "Generated by Automation Config Converter", 10 | "Common": { 11 | "class": "Tenant", 12 | "Shared": { 13 | "class": "Application", 14 | "template": "shared", 15 | "app1_t443_vs": { 16 | "layer4": "tcp", 17 | "pool": "app1_t80_pool", 18 | "translateServerAddress": true, 19 | "translateServerPort": true, 20 | "class": "Service_HTTP", 21 | "profileHTTP": { 22 | "bigip": "/Common/http" 23 | }, 24 | "profileTCP": { 25 | "bigip": "/Common/tcp" 26 | }, 27 | "virtualAddresses": [ 28 | "192.168.1.21" 29 | ], 30 | "virtualPort": 443, 31 | "persistenceMethods": [], 32 | "snat": "auto" 33 | }, 34 | "app1_t80_pool": { 35 | "members": [ 36 | { 37 | "addressDiscovery": "static", 38 | "servicePort": 80, 39 | "servers": [ 40 | { 41 | "name": "app1_Node1", 42 | "address": "192.168.1.22" 43 | }, 44 | { 45 | "name": "app1_Node2", 46 | "address": "192.168.1.23" 47 | } 48 | ], 49 | "shareNodes": true 50 | } 51 | ], 52 | "monitors": [ 53 | { 54 | "bigip": "/Common/http" 55 | }, 56 | { 57 | "bigip": "/Common/tcp" 58 | } 59 | ], 60 | "class": "Pool" 61 | }, 62 | "app1_t80_vs": { 63 | "layer4": "tcp", 64 | "iRules": [ 65 | { 66 | "bigip": "/Common/_sys_https_redirect" 67 | } 68 | ], 69 | "translateServerAddress": true, 70 | "translateServerPort": true, 71 | "class": "Service_HTTP", 72 | "profileHTTP": { 73 | "bigip": "/Common/http" 74 | }, 75 | "profileTCP": { 76 | "bigip": "/Common/tcp" 77 | }, 78 | "virtualAddresses": [ 79 | "192.168.1.21" 80 | ], 81 | "virtualPort": 80, 82 | "persistenceMethods": [], 83 | "snat": "none" 84 | } 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: "Main" 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [main] 7 | 8 | env: 9 | NODE_VERSION: 20.x 10 | 11 | jobs: 12 | 13 | test: 14 | runs-on: ${{ matrix.os }} 15 | strategy: 16 | matrix: 17 | os: [windows-latest, ubuntu-latest, macos-latest] 18 | name: Test on ${{ matrix.os }} 19 | steps: 20 | - uses: actions/checkout@v4 21 | - uses: actions/setup-node@v4 22 | with: 23 | node-version: ${{ env.NODE_VERSION }} 24 | - run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo "Started xvfb" 25 | shell: bash 26 | if: ${{ success() && matrix.os == 'ubuntu-latest' }} 27 | - run: npm install 28 | - name: Cache node modules 29 | uses: actions/cache@v4 30 | env: 31 | cache-name: cache-node-modules 32 | with: 33 | # npm cache files are stored in `~/.npm` on Linux/macOS 34 | path: ~/.npm 35 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} 36 | restore-keys: | 37 | ${{ runner.os }}-build-${{ env.cache-name }}- 38 | ${{ runner.os }}-build- 39 | ${{ runner.os }}- 40 | - run: npm test 41 | env: 42 | DISPLAY: ":99.0" 43 | 44 | package-release-publish: 45 | runs-on: ubuntu-latest 46 | environment: publishing 47 | needs: test 48 | name: Package-Release-Publish 49 | steps: 50 | 51 | - name: Checkout code 52 | uses: actions/checkout@v4 53 | 54 | - name: setup node.js ${{ env.NODE_VERSION }} 55 | uses: actions/setup-node@v4 56 | with: 57 | node-version: ${{ env.NODE_VERSION }} 58 | 59 | - name: install node deps 60 | run: npm install 61 | 62 | - name: install vscode marketplace cli (vsce) 63 | run: npm install -g @vscode/vsce 64 | 65 | - name: install open-vsix marketplace cli (ovsx) 66 | run: npm install -g ovsx 67 | 68 | - name: install teem keys 69 | run: echo "${{ secrets.F5_TEEM_KEY_PROD }}" >> TEEM_KEY 70 | 71 | - name: package extension 72 | run: vsce package 73 | 74 | - name: get extension path 75 | run: echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV 76 | 77 | - name: get extension name 78 | run: echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV 79 | 80 | - name: get extension version 81 | run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV 82 | 83 | - name: create upload artifacts 84 | uses: actions/upload-artifact@v4 85 | with: 86 | path: ${{ env.VSIX_PATH }} 87 | name: ${{ env.VSIX_NAME }} 88 | 89 | - name: create github release 90 | uses: softprops/action-gh-release@v2 91 | with: 92 | tag_name: v${{ env.PACKAGE_VERSION }} 93 | name: ${{ env.VSIX_NAME }} 94 | body: See [CHANGE LOG](https://github.com/f5devcentral/vscode-f5-chariot/blob/main/CHANGELOG.md) for details. 95 | draft: false 96 | prerelease: false 97 | files: ${{ env.VSIX_PATH }} 98 | env: 99 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 100 | 101 | - name: publish to marketplace 102 | run: vsce publish -i ${{ env.VSIX_PATH }} -p ${{ secrets.MARKETPLACE_PUBLISH_KEY }} 103 | 104 | - name: publish to open-vsix 105 | run: ovsx publish ${{ env.VSIX_PATH }} -p ${{ secrets.OVSX_PAT }} 106 | 107 | 108 | # good example of action workflow for publishing an extension 109 | # https://github.com/politie/omt-odt-language/pull/30/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34 110 | 111 | # vsce source for understanding switches 112 | # https://github.com/microsoft/vscode-vsce/tree/main/src 113 | 114 | # ovsx source 115 | # https://github.com/eclipse/openvsx 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # vscode-f5-chariot 3 | 4 | [![Main](https://github.com/f5devcentral/vscode-f5-chariot/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/f5devcentral/vscode-f5-chariot/actions/workflows/main.yml) 5 | ![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/F5DevCentral.vscode-f5-chariot?style=plastic) 6 | 7 | Greetings! 8 | 9 | This is an integration with AS3-Configuration-Converter (ACC) to provide quick TMOS to AS3 conversions within vscode. 10 | 11 | Install via the VSCode marketplace here: 12 | 13 | This version of the extension has "batteries included" and does not require any external docker containers or dependencies. 14 | 15 | The version of this extension is locked with the version of the ACC project. 16 | 17 | It is recommended to utilize the output of the vscode-f5 config explorer output for conversions: 18 | 19 | - 20 | - 21 | - 22 | 23 | Please open an issue with any comments, questions, enhancements, or bugs. 24 | 25 | Thanks! 26 | 27 | --- 28 | 29 | ## Other Pages 30 | 31 | ### Main f5-automation-config-converter (ACC) Repo 32 | 33 | * [Repo](https://github.com/f5devcentral/f5-automation-config-converter) 34 | * [Issues](https://github.com/f5devcentral/f5-automation-config-converter/issues) 35 | * [Releases](https://github.com/f5devcentral/f5-automation-config-converter/releases) 36 | 37 | ### Other pages from this repo 38 | 39 | [vscode-f5-chariot CHANGELOG](CHANGELOG.md) 40 | 41 | --- 42 | 43 | ## Troubleshooting 44 | 45 | The extension is a single command/function to convert configuration to AS3. By default all the output provided by ACC is displayed in the ``f5`` view of the ``OUTPUT`` window 46 | 47 | ## Good Input 48 | 49 | 50 | drawing 51 | 52 |   53 | 54 | ## Bad Input 55 | 56 | 57 | drawing 58 | 59 |   60 | 61 | --- 62 | 63 | ## Extension Commands 64 | 65 | This extension provides a single command: 66 | 67 | * `F5: Convert with ACC`: (via editor right-click) Converts entire editor text or selection with ACC 68 | 69 |   70 | 71 | --- 72 | 73 |   74 | 75 | ## Debugging extension 76 | 77 | * Clone repo 78 | * Run `npm install` in terminal to install dependencies 79 | * Run the `Run Extension` target in the Debug View. This will: 80 | * Start a task `npm: watch` to compile the code 81 | * Run the extension in a new VS Code window 82 | 83 | ## Copyright 84 | 85 | Copyright 2014-2020 F5 Networks Inc. 86 | 87 | ### F5 Networks Contributor License Agreement 88 | 89 | Before you start contributing to any project sponsored by F5 Networks, Inc. (F5) on GitHub, you will need to sign a Contributor License Agreement (CLA). 90 | 91 | If you are signing as an individual, we recommend that you talk to your employer (if applicable) before signing the CLA since some employment agreements may have restrictions on your contributions to other projects. Otherwise by submitting a CLA you represent that you are legally entitled to grant the licenses recited therein. 92 | 93 | If your employer has rights to intellectual property that you create, such as your contributions, you represent that you have received permission to make contributions on behalf of that employer, that your employer has waived such rights for your contributions, or that your employer has executed a separate CLA with F5. 94 | 95 | If you are signing on behalf of a company, you represent that you are legally entitled to grant the license recited therein. You represent further that each employee of the entity that submits contributions is authorized to submit such contributions on behalf of the entity pursuant to the CLA. 96 | -------------------------------------------------------------------------------- /.github/workflows/test-matrix.yml: -------------------------------------------------------------------------------- 1 | name: "test-matrix" 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | env: 7 | NODE_VERSION: 14.x 8 | 9 | jobs: 10 | 11 | test: 12 | runs-on: ${{ matrix.os }} 13 | strategy: 14 | matrix: 15 | os: [windows-latest, ubuntu-latest, macos-latest] 16 | name: Test on ${{ matrix.os }} 17 | steps: 18 | - uses: actions/checkout@v2 19 | - uses: actions/setup-node@v2 20 | with: 21 | node-version: ${{ env.NODE_VERSION }} 22 | - run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo "Started xvfb" 23 | shell: bash 24 | if: ${{ success() && matrix.os == 'ubuntu-latest' }} 25 | - run: npm install 26 | - name: Cache node modules 27 | uses: actions/cache@v2 28 | env: 29 | cache-name: cache-node-modules 30 | with: 31 | # npm cache files are stored in `~/.npm` on Linux/macOS 32 | path: ~/.npm 33 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} 34 | restore-keys: | 35 | ${{ runner.os }}-build-${{ env.cache-name }}- 36 | ${{ runner.os }}-build- 37 | ${{ runner.os }}- 38 | - run: npm test 39 | env: 40 | DISPLAY: ":99.0" 41 | 42 | # package-release-publish: 43 | # runs-on: ubuntu-latest 44 | # environment: publishing 45 | # needs: test 46 | # name: Package-Release-Publish 47 | # steps: 48 | 49 | # - name: Checkout code 50 | # uses: actions/checkout@v2 51 | 52 | # - name: setup node.js ${{ env.NODE_VERSION }} 53 | # uses: actions/setup-node@v2 54 | # with: 55 | # node-version: ${{ env.NODE_VERSION }} 56 | 57 | # - name: install node deps 58 | # run: npm ci 59 | 60 | # - name: install vscode marketplace cli (vsce) 61 | # run: npm install -g vsce 62 | 63 | # - name: install open-vsix marketplace cli (ovsx) 64 | # run: npm install -g ovsx 65 | 66 | # - name: package extension 67 | # run: vsce package 68 | 69 | # - name: get extension path 70 | # run: echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV 71 | 72 | # - name: get extension name 73 | # run: echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV 74 | 75 | # - name: get extension version 76 | # run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV 77 | # - name: create upload artifacts 78 | # uses: actions/upload-artifact@v2 79 | # with: 80 | # path: ${{ env.VSIX_PATH }} 81 | # name: ${{ env.VSIX_NAME }} 82 | 83 | # - name: create github release 84 | # uses: actions/create-release@v1 85 | # id: create_release 86 | # env: 87 | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 88 | # with: 89 | # tag_name: v${{ env.PACKAGE_VERSION }} 90 | # release_name: ${{ env.VSIX_NAME }} 91 | # body: See [CHANGE LOG](https://github.com/f5devcentral/vscode-f5-chariot/blob/main/README.md) for details. 92 | # draft: false 93 | # prerelease: false 94 | 95 | # - name: upload releases 96 | # uses: actions/upload-release-asset@v1 97 | # env: 98 | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 99 | # PUBLISH_TOKEN: ${{ secrets.MARKETPLACE_PUBLISH_KEY }} 100 | # with: 101 | # upload_url: ${{ steps.create_release.outputs.upload_url }} 102 | # asset_path: ${{ env.VSIX_PATH }} 103 | # asset_name: ${{ env.VSIX_NAME }} 104 | # asset_content_type: application/zip 105 | 106 | # - name: publish to marketplace 107 | # run: vsce publish -i ${{ env.VSIX_PATH }} -p ${{ secrets.MARKETPLACE_PUBLISH_KEY }} 108 | 109 | # - name: publish to open-vsix 110 | # run: ovsx publish ${{ env.VSIX_PATH }} -p ${{ secrets.OVSX_PAT }} 111 | 112 | 113 | 114 | # good example of action workflow for publishing an extension 115 | # https://github.com/politie/omt-odt-language/pull/30/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34 116 | 117 | # vsce source for understanding switches 118 | # https://github.com/microsoft/vscode-vsce/tree/main/src 119 | 120 | # ovsx source 121 | # https://github.com/eclipse/openvsx 122 | -------------------------------------------------------------------------------- /artifacts/base_do.conf: -------------------------------------------------------------------------------- 1 | sys global-settings { 2 | console-inactivity-timeout 1200 3 | file-whitelist-path-prefix "{/var/local/scf} {/tmp/} {/shared/} {/config/} {/usr/share/aws/} {/var/config/rest/downloads/appsvcs_update.cli}" 4 | gui-setup disabled 5 | hostname devCloud01.benlab.io 6 | mgmt-dhcp dhcpv6 7 | } 8 | sys software update { 9 | auto-check enabled 10 | auto-phonehome disabled 11 | frequency weekly 12 | } 13 | sys management-ip 10.200.244.110/24 { 14 | description configured-statically 15 | } 16 | sys provision apm { 17 | level nominal 18 | } 19 | sys provision avr { 20 | level nominal 21 | } 22 | sys provision ltm { 23 | level nominal 24 | } 25 | sys ntp { 26 | timezone US/Central 27 | } 28 | sys dns { 29 | description configured-by-dhcp 30 | name-servers { 192.168.200.7 192.168.200.8 } 31 | search { benlab.io } 32 | } 33 | net dns-resolver /Common/f5-aws-dns { 34 | forward-zones { 35 | amazonaws.com { 36 | nameservers { 37 | 8.8.8.8:53 { } 38 | } 39 | } 40 | idservice.net { 41 | nameservers { 42 | 8.8.8.8:53 { } 43 | } 44 | } 45 | } 46 | route-domain /Common/0 47 | } 48 | net vlan /Common/internal { 49 | interfaces { 50 | 1.0 { } 51 | } 52 | tag 4094 53 | } 54 | analytics global-settings { } 55 | sys management-route /Common/default { 56 | description configured-statically 57 | gateway 10.200.244.1 58 | network default 59 | } 60 | auth source { 61 | fallback true 62 | } 63 | auth remote-user { 64 | default-role admin 65 | remote-console-access tmsh 66 | } 67 | auth radius /Common/system-auth { 68 | servers { 69 | /Common/system_auth_name1 70 | } 71 | } 72 | auth radius-server /Common/system_auth_name1 { 73 | secret $M$mn$9uYx+bTjLD8YSGZAUEfFwHvpSDwZsL25kZxdn5NZmCI= 74 | server 10.200.244.1 75 | } 76 | net route-domain /Common/0 { 77 | id 0 78 | vlans { 79 | /Common/http-tunnel 80 | /Common/socks-tunnel 81 | /Common/internal 82 | } 83 | } 84 | sys snmp { 85 | agent-addresses { tcp6:161 udp6:161 } 86 | communities { 87 | /Common/comm-public { 88 | community-name public 89 | source default 90 | } 91 | } 92 | disk-monitors { 93 | /Common/root { 94 | minspace 2000 95 | path / 96 | } 97 | /Common/var { 98 | minspace 10000 99 | path /var 100 | } 101 | } 102 | process-monitors { 103 | /Common/bigd { 104 | max-processes infinity 105 | process bigd 106 | } 107 | /Common/chmand { 108 | process chmand 109 | } 110 | /Common/httpd { 111 | max-processes infinity 112 | process httpd 113 | } 114 | /Common/mcpd { 115 | process mcpd 116 | } 117 | /Common/sod { 118 | process sod 119 | } 120 | /Common/tmm { 121 | max-processes infinity 122 | process tmm 123 | } 124 | } 125 | } 126 | sys snmp { 127 | agent-addresses { tcp6:161 udp6:161 } 128 | communities { 129 | /Common/comm-public { 130 | community-name public 131 | source default 132 | } 133 | } 134 | disk-monitors { 135 | /Common/root { 136 | minspace 2000 137 | path / 138 | } 139 | /Common/var { 140 | minspace 10000 141 | path /var 142 | } 143 | } 144 | process-monitors { 145 | /Common/bigd { 146 | max-processes infinity 147 | process bigd 148 | } 149 | /Common/chmand { 150 | process chmand 151 | } 152 | /Common/httpd { 153 | max-processes infinity 154 | process httpd 155 | } 156 | /Common/mcpd { 157 | process mcpd 158 | } 159 | /Common/sod { 160 | process sod 161 | } 162 | /Common/tmm { 163 | max-processes infinity 164 | process tmm 165 | } 166 | } 167 | } 168 | sys httpd { 169 | auth-pam-idle-timeout 12000 170 | ssl-port 8443 171 | } 172 | net tunnels tunnel /Common/http-tunnel { 173 | description "Tunnel for http-explicit profile" 174 | profile /Common/tcp-forward 175 | } 176 | net tunnels tunnel /Common/socks-tunnel { 177 | description "Tunnel for socks profile" 178 | profile /Common/tcp-forward 179 | } 180 | security firewall port-list /Common/_sys_self_allow_tcp_defaults { 181 | ports { 182 | 22 { } 183 | 53 { } 184 | 161 { } 185 | 443 { } 186 | 1029-1043 { } 187 | 4353 { } 188 | } 189 | } 190 | security firewall port-list /Common/_sys_self_allow_udp_defaults { 191 | ports { 192 | 53 { } 193 | 161 { } 194 | 520 { } 195 | 1026 { } 196 | 4353 { } 197 | } 198 | } -------------------------------------------------------------------------------- /src/util.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2021 F5 Networks, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 'use strict'; 18 | 19 | import fs from 'fs'; 20 | 21 | import { 22 | Position, 23 | Range, 24 | TextDocument, 25 | Uri, 26 | ViewColumn, 27 | window, 28 | workspace 29 | } from "vscode"; 30 | 31 | import Logger from 'f5-conx-core/dist/logger'; 32 | 33 | const logger = new Logger('F5_CHARIOT_LOG_LEVEL'); 34 | 35 | 36 | /** 37 | * import/require file to string variable 38 | * @param path file path/name 39 | * @returns file contents as string 40 | */ 41 | export function requireText(path: string): string { 42 | return fs.readFileSync(require.resolve(path)).toString(); 43 | } 44 | 45 | /** 46 | * display json in new editor window 47 | * @param item json object to display in new editor 48 | */ 49 | export async function displayJsonInEditor2(item: unknown): Promise { 50 | const editor = await workspace.openTextDocument({ 51 | language: 'json', 52 | content: JSON.stringify(item, undefined, 4) 53 | }); 54 | await window.showTextDocument(editor, { preview: false }); 55 | return editor; 56 | } 57 | 58 | /** 59 | * display json in new editor window 60 | * @param item json object to display in new editor 61 | */ 62 | export async function displayJsonInEditor(text: string, type: 'DO' | 'AS3'): Promise { 63 | 64 | let vDoc: Uri; 65 | if (type === 'AS3') { 66 | vDoc = Uri.parse("untitled:" + 'converted.as3.json'); 67 | } else { 68 | vDoc = Uri.parse("untitled:" + 'converted.do.json'); 69 | } 70 | 71 | // for some reason, this doesn't always put the text and it errors when trying to save the document 72 | // the other way (displayJsonInEditor2) displays a regular utitled doc with json language which can easily be saved 73 | // the regular doc does not 74 | return workspace.openTextDocument(vDoc) 75 | .then(async (a: TextDocument) => { 76 | await window.showTextDocument(a, ViewColumn.Beside, false).then(e => { 77 | e.edit(edit => { 78 | const startPosition = new Position(0, 0); 79 | const endPosition = a.lineAt(a.lineCount - 1).range.end; 80 | edit.replace(new Range(startPosition, endPosition), JSON.stringify(text, undefined, 4)); 81 | }); 82 | }); 83 | return a; 84 | }); 85 | } 86 | 87 | 88 | 89 | /** 90 | * capture entire active editor text or selected text 91 | */ 92 | export async function getEditorText(doc?: any) { 93 | 94 | let isDocUri = false; 95 | if ( 96 | doc.path && 97 | doc.scheme 98 | ) { 99 | // doc is path.uri object 100 | isDocUri = true; 101 | } 102 | 103 | // get editor window - should only happen from right-click 104 | const editor = window.activeTextEditor; 105 | if (editor && isDocUri) { 106 | // capture selected text or all text in editor 107 | if (editor.selection.isEmpty) { 108 | return editor.document.getText(); // entire editor/doc window 109 | } else { 110 | return editor.document.getText(editor.selection); // highlighted text 111 | } 112 | 113 | // is doc => vscode.Textdocument param from tests? 114 | // eslint-disable-next-line no-prototype-builtins 115 | } else if (doc.hasOwnProperty('getText')) { 116 | // got doc definition and no editor, so this should be automated tests 117 | return doc.getText(); 118 | } else { 119 | logger.warn('getText was called, but no active editor... this should not happen'); 120 | throw new Error('getText was called, but no active editor... this should not happen'); 121 | // return; // No open/active text editor 122 | } 123 | 124 | } 125 | 126 | 127 | /** 128 | * sanitize dec from params that can change but are not critical to deployment (ex. id/schemaVersion/remark/label) 129 | * @param dec AS3 declaration 130 | * @returns 131 | */ 132 | export async function cleanUniques(dec: any): Promise> { 133 | // take in as3 declarate, remove unique properties, return rest 134 | 135 | // re-assing the core as3 declartion 136 | if (dec.declaration) dec = dec.declaration; 137 | if (dec.dec) dec = dec.dec; 138 | 139 | // new way to sanitize fields 140 | delete dec.id; 141 | delete dec.schemaVersion; 142 | delete dec.remark; 143 | delete dec.label; 144 | delete dec['$schema']; 145 | 146 | return dec; 147 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | [BACK TO MAIN README](README.md) 4 | 5 | All notable changes to the "vscode-f5-chariot" extension will be documented in this file. 6 | 7 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 8 | 9 | --- 10 | 11 | ## [1.22.0] - (12-11-2025) 12 | 13 | - ACC 1.126.0 release 14 | - 15 | - Updated ESLint to v8.x and @typescript-eslint packages to v5.x for AJV 8 compatibility 16 | - Scoped AJV override to f5-automation-config-converter dependency 17 | 18 | --- 19 | 20 | ## [1.19.2] - (03-23-2022) 21 | 22 | - acc 1.19.2 release 23 | - 24 | 25 | --- 26 | 27 | ## [1.18.0] - (01-26-2022) 28 | 29 | - acc 1.18 release 30 | - 31 | 32 | --- 33 | 34 | ## [1.17.1] - (12-26-2021) 35 | 36 | - fix for bug -> conversion failing with - f5.chariot.convertAS3 failed with [TypeError: doc.getText is not a functio #7 37 | - 38 | 39 | --- 40 | 41 | ## [1.17.0] - (12-17-2021) 42 | 43 | - update to v1.17.0 acc 44 | - Please see for release information 45 | - smoothed out tests 46 | - changed output editor to standard 'untitled', but then injects the atc apropriate schema from the vscode-f5 command 'f5.injectSchemaRef' 47 | - this will continue the effort to make editing of the output easy with schema validation 48 | - should silently fail if command not available 49 | 50 | --- 51 | 52 | ## [1.16.3] - (11-28-2021) 53 | 54 | - github action automation done 55 | - added open-vsix publishing step 56 | 57 | --- 58 | 59 | ## [1.16.2] - (11-25-2021) 60 | 61 | - Updated logger to f5-conx-core@v0.11.0 62 | - automated github actions testing and extension publishing 63 | 64 | Please see for release information 65 | 66 | --- 67 | 68 | ## [1.16.1] - (11-12-2021) 69 | 70 | - Enabled Declarative Onboarding conversion flag 71 | - updated conversion output file name to include as3/do for schema reference 72 | - adjustect tests/utils to return editor opened from conversion output for better flow 73 | 74 | Please see for release information 75 | 76 | --- 77 | 78 | ## [1.14.0-...] 79 | 80 | Please see for release information 81 | 82 | --- 83 | 84 | ## [1.13.0] - (07-07-2021) 85 | 86 | ### Modified 87 | 88 | - ACC v1.13.0 89 | - 90 | - Convert all /r/n to /n before processing with ACC 91 | - ACC is based on linux 92 | - Utilize new f5-as3-config-converter exposed function 93 | - Removed local custom acc wrapper function 94 | - This should make the ACC package more standard and easily testable 95 | - Stated adding tests and artifacts 96 | 97 | --- 98 | 99 | ## [1.12.0] - (05-25-2021) 100 | 101 | ### Modified 102 | 103 | - ACC v1.12.0 104 | - 105 | - Minor code tweaks for house keeping 106 | - all logs are now info 107 | - extension only loads on first command execution 108 | - command execution makes output visible 109 | 110 | --- 111 | 112 | ## [1.11.0] - (04-15-2021) 113 | 114 | ### Modified 115 | 116 | - Complete refactor for direct integration with acc code, bypassing docker/rest-api. 117 | - Alligned local version with ACC version 118 | - the thought here is to release a new extension version for each ACC release 119 | - update independently of the main vscode-f5 extension 120 | - users could easily revert to previous versions 121 | 122 | --- 123 | 124 | ## [0.5.0] - (03-14-2020) 125 | 126 | This version was primarily exploration on the ACC REST API which led to integrating directly with the code 127 | 128 | --- 129 | 130 | ## [0.4.0] - (12-14-2020) 131 | 132 | ### Added 133 | 134 | - Added configuration option to specify entire docker command string 135 | - This should provide complete flexibility for getting the command to execute on different systems 136 | - And control the different ACC processing outputs that are now available with v1.8 137 | - Added catching and logging of all errors from docker command execution 138 | - This should provide full visibility into all execution output 139 | 140 | ### Modified 141 | 142 | - Updated default ACC version to latest 1.8 143 | 144 | --- 145 | 146 | ## [0.3.0] - (10-26-2020) 147 | 148 | ### Added 149 | 150 | - Added progress bar for the main "Chariot Convert" command to indicate status 151 | 152 | --- 153 | 154 | ## [0.2.0] - (10-20-2020) 155 | 156 | ### Added 157 | 158 | - Command for quick access to settings 159 | - OUTPUT logging in vscode to provide feedback about what's happening and hopefully some idea of errors when they happen 160 | - System informtion to logs for troubleshooting (Host OS, Platform, Release, and UserInfo) 161 | 162 | ## Modified 163 | 164 | - Added the following switches to the docker command to provide the most output 165 | - --unsupported --unsupported-objects unSupported.json 166 | 167 | --- 168 | 169 | ## [0.0.1] - (10-17-2020) 170 | 171 | ## initial 172 | 173 | - Right click option to convert text in editor with charon 174 | - based on the .conf input 175 | - outputs to coverted.as3.json so it should get as3 validation if vscode-f5 extension is installed 176 | - options to set the output file and docker images 177 | 178 | --- 179 | -------------------------------------------------------------------------------- /src/tests/suite/extension.tests.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert'; 2 | import { isObject } from 'f5-conx-core'; 3 | import fs = require('fs'); 4 | import path = require('path'); 5 | 6 | // You can import and use all API from the 'vscode' module 7 | // as well as import your extension to test it 8 | import { Uri, window, commands, workspace, TextDocument } from 'vscode'; 9 | import { cleanUniques, getEditorText, requireText } from '../../util'; 10 | import { log } from './index'; 11 | 12 | log('=== EXTENSION TESTS LOADING ==='); 13 | 14 | // test file/path 15 | const testAppConf = path.join(__dirname, '..', '..', '..', 'artifacts', 'testApp.conf'); 16 | const testAppAS3 = path.join(__dirname, '..', '..', '..', 'artifacts', 'testApp.as3.json'); 17 | const testDoConf = path.join(__dirname, '..', '..', '..', 'artifacts', 'base_do.conf'); 18 | const testDo = path.join(__dirname, '..', '..', '..', 'artifacts', 'base.do.json'); 19 | // src/tests/artifacts/testApp.conf 20 | 21 | log('Test file paths:'); 22 | log(' testAppConf:', testAppConf); 23 | log(' testAppAS3:', testAppAS3); 24 | log(' testDoConf:', testDoConf); 25 | log(' testDo:', testDo); 26 | 27 | const testAppText = requireText(testAppConf); 28 | const testAppJson = requireText(testAppAS3); 29 | const testAppParsed = Uri.file(testAppConf); 30 | 31 | const testDoText = requireText(testDoConf); 32 | const testDoJson = requireText(testDo); 33 | const testDoParsed = Uri.file(testDoConf); 34 | 35 | log('Test files loaded successfully'); 36 | 37 | // flag to step through tests for debugging 38 | // eslint-disable-next-line prefer-const 39 | // step = true; 40 | let testTitle: string; 41 | 42 | suite('Core acc-chariot tests', () => { 43 | log('=== SUITE STARTING ==='); 44 | window.showInformationMessage('Starting main tests'); 45 | 46 | test('clearing all editors', async () => { 47 | log('[TEST] clearing all editors - START'); 48 | // clear all open editors 49 | await commands.executeCommand('workbench.action.closeAllEditors'); 50 | log('[TEST] clearing all editors - DONE'); 51 | }).timeout(5000); 52 | 53 | test('convert test app tmos to as3 with acc', async () => { 54 | log('[TEST] convert AS3 - START'); 55 | 56 | // open a new text editor 57 | log('[TEST] Opening test file:', testAppParsed.fsPath); 58 | const appConfigEditor = await workspace.openTextDocument(testAppParsed) 59 | .then(async doc => { 60 | log('[TEST] Document opened, showing in editor'); 61 | // show new text editor (make active) 62 | await window.showTextDocument(doc); 63 | return doc; 64 | }); 65 | log('[TEST] Editor ready, document length:', appConfigEditor.getText().length); 66 | 67 | // execute acc to pick up editor text and convert it 68 | log('[TEST] Executing f5.chariot.convertAS3 command...'); 69 | const editor = await commands.executeCommand('f5.chariot.convertAS3', appConfigEditor) as TextDocument; 70 | log('[TEST] Command completed, editor returned:', !!editor); 71 | 72 | if (!editor) { 73 | log('[TEST] ERROR: No editor returned from convertAS3 command!'); 74 | throw new Error('No editor returned from convertAS3 command'); 75 | } 76 | 77 | await window.showTextDocument(editor.uri); 78 | 79 | // get converted text 80 | const converted = editor.getText(); 81 | log('[TEST] Converted text length:', converted.length); 82 | log('[TEST] Converted text (full):', converted); 83 | 84 | const editorText = await cleanUniques(JSON.parse(converted)); 85 | const original = await cleanUniques(JSON.parse(testAppJson)); 86 | log('[TEST] COMPARING:'); 87 | log('[TEST] Actual:', editorText); 88 | log('[TEST] Expected:', original); 89 | 90 | assert.deepStrictEqual(editorText, original); 91 | assert.ok(editorText.class === 'ADC'); 92 | log('[TEST] convert AS3 - PASSED'); 93 | 94 | }).timeout(50000); 95 | 96 | test('clearing all editors 2', async () => { 97 | log('[TEST] clearing all editors 2 - START'); 98 | // clear all open editors 99 | await commands.executeCommand('workbench.action.closeAllEditors'); 100 | log('[TEST] clearing all editors 2 - DONE'); 101 | }).timeout(5000); 102 | 103 | 104 | 105 | test('convert test app tmos to DO with acc', async () => { 106 | log('[TEST] convert DO - START'); 107 | 108 | // open a new text editor 109 | log('[TEST] Opening DO test file:', testDoParsed.fsPath); 110 | const baseConfigEditor = await workspace.openTextDocument(testDoParsed) 111 | .then(async doc => { 112 | log('[TEST] DO Document opened, showing in editor'); 113 | // show new text editor (make active) 114 | await window.showTextDocument(doc); 115 | return doc; 116 | }); 117 | log('[TEST] DO Editor ready, document length:', baseConfigEditor.getText().length); 118 | 119 | // execute acc to pick up editor text and convert it 120 | log('[TEST] Executing f5.chariot.convertDO command...'); 121 | const editor = await commands.executeCommand('f5.chariot.convertDO', baseConfigEditor) as TextDocument; 122 | log('[TEST] DO Command completed, editor returned:', !!editor); 123 | 124 | if (!editor) { 125 | log('[TEST] ERROR: No editor returned from convertDO command!'); 126 | throw new Error('No editor returned from convertDO command'); 127 | } 128 | 129 | // get converted text 130 | const converted = editor.getText(); 131 | log('[TEST] DO Converted text length:', converted.length); 132 | log('[TEST] DO Converted text (full):', converted); 133 | 134 | const editorText = await cleanUniques(JSON.parse(converted)); 135 | const original = await cleanUniques(JSON.parse(testDoJson)); 136 | log('[TEST] DO COMPARING:'); 137 | log('[TEST] DO Actual:', editorText); 138 | log('[TEST] DO Expected:', original); 139 | assert.deepStrictEqual(editorText, original); 140 | assert.ok(editorText?.async); 141 | assert.ok(editorText.class === 'Device'); 142 | assert.ok(isObject(editorText.Common)); 143 | log('[TEST] convert DO - PASSED'); 144 | 145 | }).timeout(50000); 146 | 147 | test('clearing all editors 3', async () => { 148 | log('[TEST] clearing all editors 3 - START'); 149 | // clear all open editors 150 | await commands.executeCommand('workbench.action.closeAllEditors'); 151 | log('[TEST] clearing all editors 3 - DONE'); 152 | }).timeout(5000); 153 | }); 154 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2021 F5 Networks, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 'use strict'; 18 | 19 | import { 20 | ExtensionContext, 21 | commands, 22 | window, 23 | ProgressLocation 24 | } from 'vscode'; 25 | 26 | import { 27 | displayJsonInEditor, 28 | displayJsonInEditor2, 29 | getEditorText 30 | } from './util'; 31 | 32 | import Logger from 'f5-conx-core/dist/logger'; 33 | 34 | import { EventEmitter } from 'events'; 35 | import { loadTeemKey } from './loadTeem'; 36 | 37 | // import main acc function (no TS types available at this time) 38 | // eslint-disable-next-line @typescript-eslint/no-var-requires 39 | const acc = require('f5-automation-config-converter/src/main'); 40 | 41 | const logger = new Logger('F5_CHARIOT_LOG_LEVEL'); 42 | logger.console = false; 43 | 44 | // create OUTPUT channel 45 | const f5OutputChannel = window.createOutputChannel('f5-chariot'); 46 | // there is no way to get the output channel id of the main vscode-f5 extension, so we can't just output there 47 | // https://stackoverflow.com/questions/59597290/get-vscode-output-channel 48 | // So, we create a new channel and make it visible for each conversion 49 | 50 | // make visible 51 | f5OutputChannel.show(); 52 | 53 | // inject vscode output into logger 54 | logger.output = function (log: string) { 55 | f5OutputChannel.appendLine(log); 56 | }; 57 | 58 | const eventer = new EventEmitter() 59 | .on('log-http-request', msg => logger.httpRequest(msg)) 60 | .on('log-http-response', msg => logger.httpResponse(msg)) 61 | .on('log-debug', msg => logger.debug(msg)) 62 | .on('log-info', msg => logger.info(msg)) 63 | .on('log-warn', msg => logger.warn(msg)) 64 | .on('log-error', msg => logger.error(msg)); 65 | 66 | // import package details for logging 67 | // eslint-disable-next-line @typescript-eslint/no-var-requires 68 | const accPackageJson = require('f5-automation-config-converter/package.json'); 69 | 70 | export function activate(context: ExtensionContext) { 71 | 72 | // process.on('unhandledRejection', error => { 73 | // logger.error('--- unhandledRejection ---', error); 74 | // }); 75 | 76 | 77 | // log core acc package details 78 | logger.info(`ACC Details: `, { 79 | name: accPackageJson.name, 80 | author: accPackageJson.author, 81 | description: accPackageJson.description, 82 | version: accPackageJson.version, 83 | license: accPackageJson.license, 84 | repository: accPackageJson.repository.url 85 | }); 86 | 87 | loadTeemKey(context); 88 | 89 | context.subscriptions.push(commands.registerCommand('f5.chariot.convertAS3', async (editor) => { 90 | 91 | // make output visible 92 | f5OutputChannel.show(); 93 | 94 | logger.info(`f5.chariot.convertAS3 called`); 95 | 96 | return await window.withProgress({ 97 | location: ProgressLocation.Notification, 98 | title: `Converting to AS3 with ACC`, 99 | }, async () => { 100 | 101 | return await getEditorText(editor) 102 | .then(async text => { 103 | 104 | logger.info(`f5.chariot.convertAS3 text found`); 105 | 106 | // standardize line returns to linux/mac 107 | if (/\r\n/.test(text)) { 108 | logger.info(`f5.chariot.convertAS3 converting "\\r\\n" to "\\n"`); 109 | text = text.replace(/\r\n/g, '\n'); 110 | } 111 | 112 | // const { declaration, metaData } = await acc(text); 113 | const { declaration, metaData } = await acc.mainAPI(text) 114 | .catch((accErr: Error) => { 115 | logger.error('ACC parsing failed with', accErr); 116 | throw accErr; 117 | }); 118 | 119 | // log all the metadata 120 | logger.info('ACC METADATA', metaData); 121 | 122 | // display as3 output in editor 123 | const convertedAs3editor = await displayJsonInEditor2(declaration); 124 | 125 | try { 126 | const a = await (await commands.getCommands(true)).filter( x => x === 'f5.injectSchemaRef'); 127 | commands.executeCommand('f5.injectSchemaRef'); 128 | logger.info('f5 atc schema injected'); 129 | } catch (e) { 130 | logger.info('f5 atc schema injection failed', e); 131 | } 132 | 133 | return convertedAs3editor; 134 | }) 135 | .catch(err => { 136 | // log full error if we got one 137 | logger.error('f5.chariot.convertAS3 failed with', err); 138 | }); 139 | }); 140 | 141 | })); 142 | 143 | 144 | context.subscriptions.push(commands.registerCommand('f5.chariot.convertDO', async (editor) => { 145 | 146 | // make output visible 147 | f5OutputChannel.show(); 148 | 149 | logger.info(`f5.chariot.convertDO called`); 150 | 151 | return await window.withProgress({ 152 | location: ProgressLocation.Notification, 153 | title: `Converting to DO with ACC`, 154 | }, async () => { 155 | 156 | return await getEditorText(editor) 157 | .then(async text => { 158 | 159 | logger.info(`f5.chariot.convert text found`); 160 | 161 | // standardize line returns to linux/mac 162 | if (/\r\n/.test(text)) { 163 | logger.info(`f5.chariot.convertDO converting "\\r\\n" to "\\n"`); 164 | text = text.replace(/\r\n/g, '\n'); 165 | } 166 | 167 | // const { declaration, metaData } = await acc(text); 168 | const { declaration, metaData } = await acc.mainAPI(text, { declarativeOnboarding: true }); 169 | 170 | // log all the metadata 171 | logger.info('ACC METADATA', metaData); 172 | 173 | // display as3 output in editor 174 | const convertedDo = await displayJsonInEditor2(declaration); 175 | return convertedDo; 176 | }) 177 | .catch(err => { 178 | // log full error if we got one 179 | logger.error('f5.chariot.convertDO failed with', err); 180 | }); 181 | }); 182 | 183 | })); 184 | 185 | } 186 | 187 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /images/ACC_Robot_Rev.svg: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------