├── .eslintignore ├── tests ├── new.associate.com │ ├── cache │ │ └── dummy.txt │ ├── environments │ │ ├── bar │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── foo │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ ├── dynamic.json │ │ └── compression.json ├── new.customname.com │ ├── cache │ │ └── dummy.txt │ ├── environments │ │ ├── bar │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── foo │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ ├── dynamic.json │ │ └── compression.json ├── testproject.com │ ├── cache │ │ └── cacheinfo.json │ ├── environments │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── qa │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── staging │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ ├── dynamic.json │ │ └── compression.json ├── new.snippets.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── envInfo.json │ └── config-snippets │ │ ├── dynamic.json │ │ └── compression.json ├── new.testproject.com │ ├── cache │ │ └── dummy.txt │ ├── environments │ │ ├── qa │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── staging │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ ├── dynamic.json │ │ └── compression.json ├── testproject-novar.com │ ├── cache │ │ └── cacheinfo.json │ ├── environments │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── qa │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── staging │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ ├── dynamic.json │ │ └── compression.json ├── import.snippets.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── envInfo.json │ └── config-snippets │ │ ├── dynamic.json │ │ └── compression.json ├── merger.snippets.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── config-snippets │ │ ├── dynamic.json │ │ └── compression.json │ └── envInfo.json ├── pull-snippets.com │ ├── cache │ │ └── dummy.txt │ ├── projectInfo.json │ ├── config-snippets │ │ ├── dynamic.json │ │ └── compression.json │ ├── hostnames.json │ └── envInfo.json ├── saveTest.snippets.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── config-snippets │ │ └── dynamic.json │ └── envInfo.json ├── snippets-uservar.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── variableDefinitions.json │ ├── envInfo.json │ └── config-snippets │ │ ├── dynamic.json │ │ └── compression.json ├── testdata │ ├── papi_errors │ │ ├── productList.output.txt │ │ ├── secure_origin.json │ │ ├── wrong_type.json │ │ ├── locked.json │ │ ├── added.json │ │ └── added_criteria.json │ ├── propertyRuleformat.output.txt │ ├── activateVersion.json │ ├── help.footer.txt │ ├── host.json │ ├── json │ │ ├── unexpectedtoken.json │ │ ├── truncated.json │ │ └── badlitteral.json │ ├── ruleFormatsList.json │ ├── patchhost.json │ ├── import.non.existent.property.output.txt │ ├── promote.output.txt │ ├── lstat.output.txt │ ├── snippets.activate.output.txt │ ├── setDefaultModified.output.txt │ ├── snippets.deactivate.output.txt │ ├── activateVersion.output.txt │ ├── setDefault.output.txt │ ├── contractList.output.txt │ ├── contractList.json │ ├── checkPromotions.wait.exception.delayed.output.txt │ ├── snippets.checkActivations.wait.exception.delayed.output.txt │ ├── setDefaultAdd.output.txt │ ├── checkPromotions.output.txt │ ├── ruleFormatsList.output.txt │ ├── checkPromotions.wait.output.txt │ ├── snippets.checkActivations.output.txt │ ├── snippets.checkActivations.wait.output.txt │ ├── checkPromotions.wait.already.output.txt │ ├── search.json │ ├── propertyVariables.output.txt │ ├── update.json │ ├── propertyVariablesList.json │ ├── snippets.checkActivations.wait.already.output.txt │ ├── activateVersionWait.output.txt │ ├── checkPromotions.wait.delayed.output.txt │ ├── propertyUpdateSuppressOutput.json │ ├── snippets.checkActivations.wait.delayed.output.txt │ ├── activateVersionWait.json │ ├── propertiesList.json │ ├── merge.output.txt │ ├── productList.output.txt │ ├── merge.noValidate.output.txt │ ├── merge.output.hostname.error.txt │ ├── merge.output.hostname.warning.txt │ ├── merge.output.validation.error.txt │ ├── merge.output.validation.warning.txt │ ├── search.output.txt │ ├── productList.json │ ├── promote.wait.output.txt │ ├── promote.wait.failed.output.txt │ ├── promote.wait.aborted.output.txt │ ├── promote.wait.inactive.output.txt │ ├── promote.wait.cancelled.output.txt │ ├── CPCodeList.output.txt │ ├── promote.wait.deactive.output.txt │ ├── snippets.activate.wait.output.txt │ ├── snippets.activate.wait.failed.output.txt │ ├── properties.output.txt │ ├── snippets.activate.wait.aborted.output.txt │ ├── snippets.activate.wait.inactive.output.txt │ ├── snippets.activate.wait.cancelled.output.txt │ ├── snippets.deactivate.wait.output.txt │ ├── snippets.deactivate.wait.failed.output.txt │ ├── snippets.activate.wait.deactive.output.txt │ ├── CPCodeList.json │ ├── checkPromotions.wait.zone.delayed.output.txt │ ├── ruletreeError.json │ ├── snippets.checkActivations.wait.zone.delayed.output.txt │ ├── listStatus.output.txt │ ├── propertyHostnamesList.json │ ├── promote.wait.zone.output.txt │ ├── snippets.activate.wait.zone.output.txt │ └── updatePropertyHostnamesOutput.json ├── testproject-hostnames.com │ ├── cache │ │ └── cacheinfo.json │ ├── environments │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── qa │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── staging │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ ├── dynamic.json │ │ └── compression.json ├── import.snippets.noHostnames.com │ ├── hostnames.json │ ├── cache │ │ └── dummy.txt │ ├── projectInfo.json │ ├── envInfo.json │ └── config-snippets │ │ └── dynamic.json ├── new.snipppets.existing.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── envInfo.json │ └── config-snippets │ │ └── dynamic.json ├── pull-snippets-pending.com │ ├── cache │ │ └── dummy.txt │ ├── projectInfo.json │ ├── hostnames.json │ ├── config-snippets │ │ ├── dynamic.json │ │ └── compression.json │ └── envInfo.json ├── pull-snippets-uservar.com │ ├── cache │ │ └── dummy.txt │ ├── projectInfo.json │ ├── variableDefinitions.json │ ├── hostnames.json │ ├── config-snippets │ │ └── dynamic.json │ └── envInfo.json ├── testproject-novar-associate.com │ ├── cache │ │ └── cacheinfo.json │ ├── environments │ │ ├── bar │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── foo │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ └── dynamic.json ├── testproject-uservar.com │ ├── cache │ │ └── dummy.txt │ ├── environments │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── qa │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── staging │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ ├── dynamic.json │ │ └── compression.json ├── import-uservar.snippets.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── variableDefinitions.json │ ├── envInfo.json │ └── config-snippets │ │ └── dynamic.json ├── merger.variables.snippets.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── variableDefinitions.json │ ├── config-snippets │ │ └── dynamic.json │ └── envInfo.json ├── saveTest.snippets-hostname.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── config-snippets │ │ └── dynamic.json │ └── envInfo.json ├── snippets.environment.tests.com │ ├── cache │ │ └── dummy.txt │ ├── projectInfo.json │ ├── hostnames.json │ ├── envInfo.json │ └── config-snippets │ │ └── dynamic.json ├── testproject-novar-customname.com │ ├── cache │ │ └── cacheinfo.json │ ├── environments │ │ ├── bar │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── foo │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ └── dynamic.json ├── import.snippets.noHostnameID.com │ ├── cache │ │ └── dummy.txt │ ├── hostnames.json │ ├── projectInfo.json │ ├── envInfo.json │ └── config-snippets │ │ └── dynamic.json ├── testproject-uservar-associate.com │ ├── cache │ │ └── dummy.txt │ ├── environments │ │ ├── bar │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── foo │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ └── dynamic.json ├── testproject-uservar-customname.com │ ├── cache │ │ └── dummy.txt │ ├── environments │ │ ├── bar │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── foo │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ ├── prod │ │ │ ├── variables.json │ │ │ ├── hostnames.json │ │ │ └── envInfo.json │ │ └── variableDefinitions.json │ ├── projectInfo.json │ └── templates │ │ └── dynamic.json ├── snippetsSettings.json ├── devopsSettings.json ├── example.com │ └── projectInfo.json ├── hostnameTests.com │ ├── projectInfo.json │ └── environments │ │ └── qa │ │ ├── envInfo.json │ │ └── hostnames.json ├── snippets.hostnameTests.com │ ├── projectInfo.json │ ├── envInfo.json │ └── hostnames.json ├── edgerc.config ├── snippets │ └── snippets.project_tests.data.json ├── project_tests_custom_name.data.json ├── project_tests.data.json ├── overlay-utils.js ├── pegjs_tests.js └── factory_tests.js ├── .gitignore ├── tests_no_default └── edgerc.config ├── eslintrc.json ├── scripts └── jsbeautify.sh ├── cli.json ├── index.js ├── sonar-project.properties ├── bin ├── akamai-pipeline └── akamai-property-manager ├── src └── enums │ ├── Network.js │ ├── ActivationType.js │ └── Status.js └── resources └── expression_parser.pegjs /.eslintignore: -------------------------------------------------------------------------------- 1 | expression_parser.js -------------------------------------------------------------------------------- /tests/new.associate.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | far -------------------------------------------------------------------------------- /tests/new.customname.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | far -------------------------------------------------------------------------------- /tests/testproject.com/cache/cacheinfo.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/new.snippets.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/new.testproject.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | far -------------------------------------------------------------------------------- /tests/testproject-novar.com/cache/cacheinfo.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/import.snippets.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/merger.snippets.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/pull-snippets.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/saveTest.snippets.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/snippets-uservar.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/testdata/papi_errors/productList.output.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/cache/cacheinfo.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/import.snippets.noHostnames.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /tests/new.snipppets.existing.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/pull-snippets-pending.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/pull-snippets-uservar.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/testdata/propertyRuleformat.output.txt: -------------------------------------------------------------------------------- 1 | "v2020-03-04" -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/cache/cacheinfo.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/testproject-uservar.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/import-uservar.snippets.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/import.snippets.noHostnames.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/merger.variables.snippets.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/saveTest.snippets-hostname.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/snippets.environment.tests.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/cache/cacheinfo.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/qa/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/import.snippets.noHostnameID.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/staging/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/cache/dummy.txt: -------------------------------------------------------------------------------- 1 | dummy file -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/bar/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/foo/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/bar/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/foo/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": {} 3 | } -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": {} 3 | } -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": {} 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | *.iml 3 | node_modules 4 | .idea 5 | stuff/ 6 | .nyc_output/ 7 | *.log 8 | dist/ 9 | .DS_Store -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/qa/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/snippetsSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultProject": "testproject.com", 3 | "edgeGridConfig": { 4 | "section": "credentials" 5 | } 6 | } -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/staging/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/devopsSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultProject": "testproject.com", 3 | "edgeGridConfig": { 4 | "section": "credentials" 5 | } 6 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/bar/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/foo/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/bar/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/foo/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "PMUSER_HOSTNAME_value": null, 3 | "PMUSER_FOO_value": null 4 | } -------------------------------------------------------------------------------- /tests/new.associate.com/environments/bar/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-bar", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/new.associate.com/environments/foo/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-foo", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/new.customname.com/environments/bar/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-bar", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/new.customname.com/environments/foo/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-foo", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testdata/activateVersion.json: -------------------------------------------------------------------------------- 1 | { 2 | "propertyId": "prp_609774", 3 | "propertyVersion": 2, 4 | "network": "STAGING", 5 | "activationId": 8481528 6 | } -------------------------------------------------------------------------------- /tests/new.associate.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-prod", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/new.customname.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-prod", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testdata/help.footer.txt: -------------------------------------------------------------------------------- 1 | 2 | © 2017-2020 Akamai Technologies, Inc. All rights reserved 3 | Visit http://github.com/akamai/cli-property-manager for more documentation -------------------------------------------------------------------------------- /tests/testproject.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-prod.testproject.com", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testproject.com/environments/qa/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-qa.testproject.com", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/qa/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-qa.new.testproject.com", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-prod.new.testproject.com", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/prod/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-prod.testproject.com", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/qa/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-qa.testproject.com", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testproject.com/environments/staging/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-staging.testproject.com", 3 | "cpCode": 654321, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/staging/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-staging.new.testproject.com", 3 | "cpCode": null, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/staging/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "originHostname": "origin-staging.testproject.com", 3 | "cpCode": 654321, 4 | "sureRouteTestObject": null 5 | } -------------------------------------------------------------------------------- /tests/testdata/host.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameType": "EDGE_HOSTNAME", 4 | "cnameFrom": "dev.pipeline.com", 5 | "cnameTo": "dev.pipeline.com.edgesuite.net", 6 | "edgeHostnameId": 4363836 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testdata/json/unexpectedtoken.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": { 3 | "bar": [ 4 | "gn", "foogle", 5 | 6 | "rg", "zrgl"], 7 | "buzz": 34, 8 | "puszz": true, 9 | } 10 | } -------------------------------------------------------------------------------- /tests/testdata/ruleFormatsList.json: -------------------------------------------------------------------------------- 1 | { 2 | "ruleFormats" : { 3 | "items" : [ "v2020-03-04", "v2019-07-25", "v2018-09-12", "v2018-02-27", "v2017-06-19", "v2016-11-15", "v2015-08-17", "latest" ] 4 | } 5 | } -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/bar/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "bar", 4 | "cnameTo": "bar.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/foo/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "foo", 4 | "cnameTo": "foo.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod", 4 | "cnameTo": "prod.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/bar/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "bar", 4 | "cnameTo": "bar.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/foo/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "foo", 4 | "cnameTo": "foo.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod", 4 | "cnameTo": "prod.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.associate.com/environments/bar/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "bar", 4 | "cnameTo": "bar.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.associate.com/environments/foo/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "foo", 4 | "cnameTo": "foo.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.associate.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod", 4 | "cnameTo": "prod.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.customname.com/environments/bar/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "bar", 4 | "cnameTo": "bar.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.customname.com/environments/foo/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "foo", 4 | "cnameTo": "foo.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.customname.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod", 4 | "cnameTo": "prod.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.snippets.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "new.snippets.com", 4 | "cnameTo": "new.snippets.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testdata/patchhost.json: -------------------------------------------------------------------------------- 1 | { 2 | "add": { 3 | "cnameType": "EDGE_HOSTNAME", 4 | "cnameFrom": "dev.pipeline.com", 5 | "cnameTo": "dev.pipeline.com.edgesuite.net", 6 | "edgeHostnameId": 4363836 7 | }, 8 | "remove": [] 9 | } -------------------------------------------------------------------------------- /tests/testproject.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod.testproject.com", 4 | "cnameTo": "prod.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/import.snippets.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "import.snippets.com", 4 | "cnameTo": "import.snippets.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": 12345 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/qa/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "qa.testproject.com", 4 | "cnameTo": "qa.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/bar/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "bar", 4 | "cnameTo": "bar.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/foo/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "foo", 4 | "cnameTo": "foo.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/bar/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "bar", 4 | "cnameTo": "bar.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/foo/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "foo", 4 | "cnameTo": "foo.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/import.snippets.noHostnameID.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "import.snippets.noHostnameID.com", 4 | "cnameTo": "import.snippets.noHostnameID.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME" 6 | } 7 | ] -------------------------------------------------------------------------------- /tests/saveTest.snippets.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "saveTest.snippets.com", 4 | "cnameTo": "saveTest.snippets.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/snippets-uservar.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "snippets-uservar.com", 4 | "cnameTo": "snippets-uservar.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testdata/import.non.existent.property.output.txt: -------------------------------------------------------------------------------- 1 | Importing and creating local files for non-existent-property from PAPI... 2 | PM CLI Error: 'property_does_not_exist_on_server' occurred: 3 | Can't find any version of property 'non-existent-property' -------------------------------------------------------------------------------- /tests/testdata/promote.output.txt: -------------------------------------------------------------------------------- 1 | ╒═════════════╤═════════╤═══════════════╕ 2 | │"Environment"│"Network"│"Activation Id"│ 3 | ╞═════════════╪═════════╪═══════════════╡ 4 | │"qa" │"STAGING"│5355534 │ 5 | └─────────────┴─────────┴───────────────┘ -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod.testproject.com", 4 | "cnameTo": "prod.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod", 4 | "cnameTo": "prod.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod", 4 | "cnameTo": "prod.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject.com/environments/staging/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "staging.testproject.com", 4 | "cnameTo": "staging.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/qa/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "qa.testproject-novar.com", 4 | "cnameTo": "qa.testproject-novar.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/saveTest.snippets-hostname.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "saveTest.snippets.com", 4 | "cnameTo": "saveTest.snippets.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/staging/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "staging.testproject.com", 4 | "cnameTo": "staging.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod.testproject-novar.com", 4 | "cnameTo": "prod.testproject-novar.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.snipppets.existing.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "new.snipppets.existing.com", 4 | "cnameTo": "new.snipppets.existing.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/import-uservar.snippets.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "import-uservar.snippets.com", 4 | "cnameTo": "import-uservar.snippets.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": 12345 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/qa/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "qa.new.testproject.com", 4 | "cnameTo": "qa.new.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/staging/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "staging.testproject-novar.com", 4 | "cnameTo": "staging.testproject-novar.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/merger.snippets.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "new.snippets.com.new.snippets.com", 4 | "cnameTo": "new.snippets.com.new.snippets.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod.new.testproject.com", 4 | "cnameTo": "prod.new.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/example.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupIds": [ 5 | 61726 6 | ], 7 | "environments": [ 8 | "staging", 9 | "prod" 10 | ], 11 | "name": "example.com", 12 | "version": "0.1.10" 13 | } -------------------------------------------------------------------------------- /tests/testdata/lstat.output.txt: -------------------------------------------------------------------------------- 1 | 2 | Usage: akamai pipeline list-status|lstat [options] 3 | 4 | Show status of the pipeline. 5 | 6 | Options: 7 | 8 | -p, --pipeline Pipeline name. 9 | -h, --help output usage information 10 | -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/qa/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "qa.testproject-uservar.com", 4 | "cnameTo": "qa.testproject-uservar.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/merger.variables.snippets.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "new.snippets.com.new.snippets.com", 4 | "cnameTo": "new.snippets.com.new.snippets.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/staging/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "staging.new.testproject.com", 4 | "cnameTo": "staging.new.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.output.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════╤═════════╤═══════════════╕ 2 | │"Property" │"Network"│"Activation Id"│ 3 | ╞══════════════════╪═════════╪═══════════════╡ 4 | │"new.snippets.com"│"STAGING"│5355534 │ 5 | └──────────────────┴─────────┴───────────────┘ -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/prod/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "prod.testproject-uservar.com", 4 | "cnameTo": "prod.testproject-uservar.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testdata/setDefaultModified.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════════════╤═════════════╕ 2 | │"Option Name" │"Value" │ 3 | ╞════════════════╪═════════════╡ 4 | │"section" │"frodo" │ 5 | ├────────────────┼─────────────┤ 6 | │"defaultProject"│"example.com"│ 7 | └────────────────┴─────────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.deactivate.output.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════╤═════════╤═══════════════╕ 2 | │"Property" │"Network"│"Activation Id"│ 3 | ╞══════════════════╪═════════╪═══════════════╡ 4 | │"old.snippets.com"│"STAGING"│5355534 │ 5 | └──────────────────┴─────────┴───────────────┘ -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/staging/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "staging.testproject-uservar.com", 4 | "cnameTo": "staging.testproject-uservar.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | } 8 | ] -------------------------------------------------------------------------------- /tests/testdata/activateVersion.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════════╤═════════╤═════════╤═══════════════╕ 2 | │"PropertyId"│"Version"│"Network"│"Activation Id"│ 3 | ╞════════════╪═════════╪═════════╪═══════════════╡ 4 | │"prp_609774"│2 │"STAGING"│8481528 │ 5 | └────────────┴─────────┴─────────┴───────────────┘ -------------------------------------------------------------------------------- /tests/testdata/setDefault.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════════════╤═════════════════╕ 2 | │"Option Name" │"Value" │ 3 | ╞════════════════╪═════════════════╡ 4 | │"section" │"credentials" │ 5 | ├────────────────┼─────────────────┤ 6 | │"defaultProject"│"testproject.com"│ 7 | └────────────────┴─────────────────┘ -------------------------------------------------------------------------------- /tests/new.snippets.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "new.snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/testdata/contractList.output.txt: -------------------------------------------------------------------------------- 1 | ╒═════════════╤════════════════════╕ 2 | │"Contract ID"│"Contract Type Name"│ 3 | ╞═════════════╪════════════════════╡ 4 | │"1-1TJZH5" │"TIER_1_RESELLER" │ 5 | ├─────────────┼────────────────────┤ 6 | │"1-1TJZFW" │"INDIRECT_CUSTOMER" │ 7 | └─────────────┴────────────────────┘ -------------------------------------------------------------------------------- /tests/import.snippets.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "import.snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/merger.snippets.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "merger.snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/pull-snippets.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "pull-snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/saveTest.snippets.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "saveTest.snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/snippets-uservar.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "snippets-uservar.com" 11 | } -------------------------------------------------------------------------------- /tests/new.snipppets.existing.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "new.snipppets.existing.com" 11 | } -------------------------------------------------------------------------------- /tests/pull-snippets-pending.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "pull-snippets-pending.com" 11 | } -------------------------------------------------------------------------------- /tests/pull-snippets-uservar.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "pull-snippets-uservar.com" 11 | } -------------------------------------------------------------------------------- /tests/saveTest.snippets-hostname.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "saveTest.snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/testdata/contractList.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountId" : "1-1TJZFB", 3 | "contracts" : { 4 | "items" : [ { 5 | "contractId" : "1-1TJZH5", 6 | "contractTypeName" : "TIER_1_RESELLER" 7 | }, { 8 | "contractId" : "1-1TJZFW", 9 | "contractTypeName" : "INDIRECT_CUSTOMER" 10 | } ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/import-uservar.snippets.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "import-uservar.snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/merger.variables.snippets.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "merger.variables.snippets.com" 11 | } -------------------------------------------------------------------------------- /tests/import.snippets.noHostnames.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "import.snippets.noHostnames.com" 11 | } -------------------------------------------------------------------------------- /tests/snippets.environment.tests.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "snippets.environment.tests.com" 11 | } -------------------------------------------------------------------------------- /tests/import.snippets.noHostnameID.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupId": 61726, 5 | "version": "0.1.10", 6 | "isSecure": false, 7 | "edgeGridConfig": { 8 | "section": "credentials" 9 | }, 10 | "name": "import.snippets.noHostnameID.com" 11 | } -------------------------------------------------------------------------------- /tests/merger.variables.snippets.com/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "cpCode": { 4 | "type": "cpCode", 5 | "default": 98765 6 | }, 7 | "sureRouteTestObject": { 8 | "type": "url", 9 | "default": "/akamai/sure-route-test-object.html" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests_no_default/edgerc.config: -------------------------------------------------------------------------------- 1 | [papi] 2 | host = blahblahblah 3 | client_token = foobarvoobawejrw 4 | client_secret = werlwe;rk06U7ndc= 5 | access_token = wljwler;klwj324234 6 | 7 | [frodo] 8 | host = ewrdfsfsdweew 9 | client_token = foobasdfsdfwdsfnfnfgnfgn 10 | client_secret=werlwewewrvvsvsvs=06U7n=dc= 11 | access_token = pppeoewrpwksdnlvknsd;lkn 12 | -------------------------------------------------------------------------------- /tests/testdata/checkPromotions.wait.exception.delayed.output.txt: -------------------------------------------------------------------------------- 1 | ...activation status is NEW... 2 | ...Waiting for active status... 3 | ...Checking promotions... 4 | ...activation status is PENDING... 5 | ...Waiting for active status... 6 | ...Checking promotions... 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking promotions... -------------------------------------------------------------------------------- /tests/testdata/snippets.checkActivations.wait.exception.delayed.output.txt: -------------------------------------------------------------------------------- 1 | ...activation status is NEW... 2 | ...Waiting for active status... 3 | ...Checking activations... 4 | ...activation status is PENDING... 5 | ...Waiting for active status... 6 | ...Checking activations... 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... -------------------------------------------------------------------------------- /tests/snippets-uservar.com/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "PMUSER_HOSTNAME_value": { 4 | "type": "userVariableValue", 5 | "default": "www.example-origin.com" 6 | }, 7 | "PMUSER_FOO_value": { 8 | "type": "userVariableValue", 9 | "default": "fooooo" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/import-uservar.snippets.com/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "PMUSER_HOSTNAME_value": { 4 | "type": "userVariableValue", 5 | "default": "www.example-origin.com" 6 | }, 7 | "PMUSER_FOO_value": { 8 | "type": "userVariableValue", 9 | "default": "fooooo" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/pull-snippets-uservar.com/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "PMUSER_HOSTNAME_value": { 4 | "type": "userVariableValue", 5 | "default": "www.example-origin.com" 6 | }, 7 | "PMUSER_FOO_value": { 8 | "type": "userVariableValue", 9 | "default": "fooooo" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/testdata/setDefaultAdd.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════════════╤═════════════════╕ 2 | │"Option Name" │"Value" │ 3 | ╞════════════════╪═════════════════╡ 4 | │"section" │"credentials" │ 5 | ├────────────────┼─────────────────┤ 6 | │"defaultProject"│"testproject.com"│ 7 | ├────────────────┼─────────────────┤ 8 | │"emails" │"test@akamai.com"│ 9 | └────────────────┴─────────────────┘ -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "PMUSER_HOSTNAME_value": { 4 | "type": "userVariableValue", 5 | "default": "www.example-origin.com" 6 | }, 7 | "PMUSER_FOO_value": { 8 | "type": "userVariableValue", 9 | "default": "fooooo" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "node" 4 | ], 5 | "rules": { 6 | "eqeqeq": "error", 7 | "node/exports-style": [ 8 | "error", 9 | "module.exports" 10 | ], 11 | "no-console": "off", 12 | "no-bitwise": ["error", { "int32Hint": true }] 13 | }, 14 | "extends": [ 15 | "eslint:recommended", 16 | "plugin:node/recommended" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "PMUSER_HOSTNAME_value": { 4 | "type": "userVariableValue", 5 | "default": "www.example-origin.com" 6 | }, 7 | "PMUSER_FOO_value": { 8 | "type": "userVariableValue", 9 | "default": "fooooo" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "PMUSER_HOSTNAME_value": { 4 | "type": "userVariableValue", 5 | "default": "www.example-origin.com" 6 | }, 7 | "PMUSER_FOO_value": { 8 | "type": "userVariableValue", 9 | "default": "fooooo" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/hostnameTests.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "edgeGridConfig": { 5 | "section": "credentials" 6 | }, 7 | "environments": [ 8 | "qa", 9 | "staging", 10 | "prod" 11 | ], 12 | "name": "hostnameTests.com", 13 | "groupIds": [ 14 | 61726 15 | ], 16 | "version": "0.1.10" 17 | } -------------------------------------------------------------------------------- /tests/testproject.com/environments/qa/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "qa.testproject.com", 4 | "cnameTo": "qa.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | },{ 8 | "cnameFrom": "qa.securesite.com", 9 | "cnameTo": "qa.securesite.com.edgekey.net", 10 | "cnameType": "EDGE_HOSTNAME", 11 | "edgeHostnameId": null 12 | } 13 | ] -------------------------------------------------------------------------------- /tests/snippets.hostnameTests.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "edgeGridConfig": { 5 | "section": "credentials" 6 | }, 7 | "environments": [ 8 | "qa", 9 | "staging", 10 | "prod" 11 | ], 12 | "name": "hostnameTests.com", 13 | "groupIds": [ 14 | 61726 15 | ], 16 | "version": "0.1.10" 17 | } -------------------------------------------------------------------------------- /tests/testdata/checkPromotions.output.txt: -------------------------------------------------------------------------------- 1 | ╒═════════════╤════════════╤═══════════════╤════════╕ 2 | │"Environment"│"Network" │"Activation Id"│"Status"│ 3 | ╞═════════════╪════════════╪═══════════════╪════════╡ 4 | │"qa" │"PRODUCTION"│"5355534" │"ACTIVE"│ 5 | ├─────────────┼────────────┼───────────────┼────────┤ 6 | │"qa" │"STAGING" │"5355810" │"ACTIVE"│ 7 | └─────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testproject.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "edgeGridConfig": { 5 | "section": "credentials" 6 | }, 7 | "environments": [ 8 | "qa", 9 | "staging", 10 | "prod" 11 | ], 12 | "name": "testproject.com", 13 | "groupIds": [ 14 | 61726 15 | ], 16 | "isSecure": false, 17 | "version": "0.1.10" 18 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupIds": [ 5 | 61726 6 | ], 7 | "environments": [ 8 | "qa", 9 | "staging", 10 | "prod" 11 | ], 12 | "edgeGridConfig": { 13 | "section": "credentials" 14 | }, 15 | "name": "new.testproject.com", 16 | "isSecure": false, 17 | "version": "0.1.10" 18 | } -------------------------------------------------------------------------------- /tests/snippets.environment.tests.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "new.snippets.com", 4 | "cnameTo": "snippets.environment.tests.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | },{ 8 | "cnameFrom": "qa.securesite.com", 9 | "cnameTo": "qa.securesite.com.edgekey.net", 10 | "cnameType": "EDGE_HOSTNAME", 11 | "edgeHostnameId": null 12 | } 13 | ] -------------------------------------------------------------------------------- /tests/testdata/ruleFormatsList.output.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════╕ 2 | │"Rule Formats"│ 3 | ╞══════════════╡ 4 | │"v2020-03-04" │ 5 | ├──────────────┤ 6 | │"v2019-07-25" │ 7 | ├──────────────┤ 8 | │"v2018-09-12" │ 9 | ├──────────────┤ 10 | │"v2018-02-27" │ 11 | ├──────────────┤ 12 | │"v2017-06-19" │ 13 | ├──────────────┤ 14 | │"v2016-11-15" │ 15 | ├──────────────┤ 16 | │"v2015-08-17" │ 17 | ├──────────────┤ 18 | │"latest" │ 19 | └──────────────┘ -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "edgeGridConfig": { 5 | "section": "credentials" 6 | }, 7 | "environments": [ 8 | "qa", 9 | "staging", 10 | "prod" 11 | ], 12 | "name": "testproject.com", 13 | "groupIds": [ 14 | 61726 15 | ], 16 | "isSecure": false, 17 | "version": "0.1.10" 18 | } -------------------------------------------------------------------------------- /tests/testproject-novar.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "edgeGridConfig": { 5 | "section": "credentials" 6 | }, 7 | "environments": [ 8 | "qa", 9 | "staging", 10 | "prod" 11 | ], 12 | "name": "testproject-novar.com", 13 | "groupIds": [ 14 | 61726 15 | ], 16 | "isSecure": false, 17 | "version": "0.1.10" 18 | } -------------------------------------------------------------------------------- /tests/testproject-uservar.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupIds": [ 5 | 61726 6 | ], 7 | "environments": [ 8 | "qa", 9 | "staging", 10 | "prod" 11 | ], 12 | "version": "0.1.10", 13 | "isSecure": false, 14 | "edgeGridConfig": { 15 | "section": "credentials" 16 | }, 17 | "name": "testproject-uservar.com" 18 | } -------------------------------------------------------------------------------- /tests/testdata/checkPromotions.wait.output.txt: -------------------------------------------------------------------------------- 1 | Activation status report: 2 | ╒═════════════╤════════════╤═══════════════╤════════╕ 3 | │"Environment"│"Network" │"Activation Id"│"Status"│ 4 | ╞═════════════╪════════════╪═══════════════╪════════╡ 5 | │"qa" │"PRODUCTION"│"5355534" │"ACTIVE"│ 6 | ├─────────────┼────────────┼───────────────┼────────┤ 7 | │"qa" │"STAGING" │"5355810" │"ACTIVE"│ 8 | └─────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /scripts/jsbeautify.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | jsfiles=`find src bin -name "*.js" | grep -v src/expression_parser.js | xargs` 4 | echo "checking files: ${jsfiles}" 5 | output=`./node_modules/.bin/js-beautify -r -f index.js ${jsfiles} | grep -v unchanged` 6 | 7 | if [ $? -eq 1 ] 8 | then 9 | echo "No files needed to be beautified." 10 | exit 0 11 | else 12 | echo "Following files needed to be beautified:" >&2; 13 | echo "${output}" >&2; 14 | exit 1 15 | fi 16 | -------------------------------------------------------------------------------- /tests/new.associate.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "originHostname": { 4 | "type": "hostname", 5 | "default": null 6 | }, 7 | "cpCode": { 8 | "type": "cpCode", 9 | "default": null 10 | }, 11 | "sureRouteTestObject": { 12 | "type": "url", 13 | "default": "/akamai/sure-route-test-object.html" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.customname.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "originHostname": { 4 | "type": "hostname", 5 | "default": null 6 | }, 7 | "cpCode": { 8 | "type": "cpCode", 9 | "default": null 10 | }, 11 | "sureRouteTestObject": { 12 | "type": "url", 13 | "default": "/akamai/sure-route-test-object.html" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "originHostname": { 4 | "type": "hostname", 5 | "default": null 6 | }, 7 | "cpCode": { 8 | "type": "cpCode", 9 | "default": null 10 | }, 11 | "sureRouteTestObject": { 12 | "type": "url", 13 | "default": "/akamai/sure-route-test-object.html" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testdata/snippets.checkActivations.output.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════╤════════════╤═══════════════╤════════╕ 2 | │"Property" │"Network" │"Activation Id"│"Status"│ 3 | ╞══════════════════╪════════════╪═══════════════╪════════╡ 4 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ACTIVE"│ 5 | ├──────────────────┼────────────┼───────────────┼────────┤ 6 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE"│ 7 | └──────────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testproject.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "originHostname": { 4 | "type": "hostname", 5 | "default": null 6 | }, 7 | "cpCode": { 8 | "type": "cpCode", 9 | "default": 98765 10 | }, 11 | "sureRouteTestObject": { 12 | "type": "url", 13 | "default": "/akamai/sure-route-test-object.html" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.customname.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupIds": [ 5 | 61726 6 | ], 7 | "environments": [ 8 | "foo", 9 | "bar", 10 | "prod" 11 | ], 12 | "version": "0.1.10", 13 | "isSecure": false, 14 | "customPropertyName": true, 15 | "edgeGridConfig": { 16 | "section": "credentials" 17 | }, 18 | "name": "new.customname.com" 19 | } -------------------------------------------------------------------------------- /tests/pull-snippets-pending.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "testing-snippets-pull.com", 4 | "cnameTo": "testing-snippets-pull.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": 3248236 7 | }, 8 | { 9 | "cnameFrom": "testing-snippets.com", 10 | "cnameTo": "testing-snippets.edgesuite.net", 11 | "cnameType": "EDGE_HOSTNAME", 12 | "edgeHostnameId": 3216762 13 | } 14 | ] -------------------------------------------------------------------------------- /tests/pull-snippets-uservar.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "testing-snippets-pull.com", 4 | "cnameTo": "testing-snippets-pull.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": 3248236 7 | }, 8 | { 9 | "cnameFrom": "testing-snippets.com", 10 | "cnameTo": "testing-snippets.edgesuite.net", 11 | "cnameType": "EDGE_HOSTNAME", 12 | "edgeHostnameId": 3216762 13 | } 14 | ] -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/variableDefinitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "originHostname": { 4 | "type": "hostname", 5 | "default": null 6 | }, 7 | "cpCode": { 8 | "type": "cpCode", 9 | "default": 98765 10 | }, 11 | "sureRouteTestObject": { 12 | "type": "url", 13 | "default": "/akamai/sure-route-test-object.html" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "requirements": { 3 | "node": "8.9.1" 4 | }, 5 | "commands": [ 6 | { 7 | "name": "property-manager", 8 | "aliases": ["pm", "snippets"], 9 | "version": "0.7.8-RELEASE", 10 | "description": "Property Manager CLI for DevOps" 11 | }, 12 | { 13 | "name": "pipeline", 14 | "aliases": ["pl", "pd", "proddeploy"], 15 | "version": "0.7.8-RELEASE", 16 | "description": "Akamai Pipeline for DevOps" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Exporting all major classes used in this package. 3 | * 4 | * Main function, also used by cli: 5 | * static DevOps.createDevOps(devopsHome, overrideDependencies) 6 | * 7 | * 8 | * @type {*|(function(): DevOps)} 9 | */ 10 | module.exports = { 11 | createDevOps: require("./src/factory"), 12 | DevOps: require("./src/devops"), 13 | Project: require("./src/project"), 14 | Environment: require("./src/environment"), 15 | Merger: require("./src/merger") 16 | }; -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "customPropertyName": true, 5 | "edgeGridConfig": { 6 | "section": "credentials" 7 | }, 8 | "environments": [ 9 | "foo", 10 | "bar", 11 | "prod" 12 | ], 13 | "name": "testproject-novar-customname.com", 14 | "groupIds": [ 15 | 61726 16 | ], 17 | "isSecure": false, 18 | "version": "0.1.10" 19 | } -------------------------------------------------------------------------------- /tests/testdata/snippets.checkActivations.wait.output.txt: -------------------------------------------------------------------------------- 1 | Activation status report: 2 | ╒══════════════════╤════════════╤═══════════════╤════════╕ 3 | │"Property" │"Network" │"Activation Id"│"Status"│ 4 | ╞══════════════════╪════════════╪═══════════════╪════════╡ 5 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ACTIVE"│ 6 | ├──────────────────┼────────────┼───────────────┼────────┤ 7 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE"│ 8 | └──────────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/bar/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bar", 3 | "groupId": 61726, 4 | "propertyName": "bar", 5 | "propertyId": 411090, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:19Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/foo/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo", 3 | "groupId": 61726, 4 | "propertyName": "foo", 5 | "propertyId": 411089, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "customPropertyName": true, 5 | "groupIds": [ 6 | 61726 7 | ], 8 | "environments": [ 9 | "foo", 10 | "bar", 11 | "prod" 12 | ], 13 | "version": "0.1.10", 14 | "isSecure": false, 15 | "edgeGridConfig": { 16 | "section": "credentials" 17 | }, 18 | "name": "testproject-uservar-customname.com" 19 | } -------------------------------------------------------------------------------- /tests/new.associate.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "groupIds": [ 5 | 15225 6 | ], 7 | "environments": [ 8 | "foo", 9 | "bar", 10 | "prod" 11 | ], 12 | "version": "0.1.10", 13 | "isSecure": false, 14 | "customPropertyName": true, 15 | "associatePropertyName": true, 16 | "edgeGridConfig": { 17 | "section": "credentials" 18 | }, 19 | "name": "new.associate.com" 20 | } -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "groupId": 61726, 4 | "propertyName": "prod", 5 | "propertyId": 411091, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:31Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testdata/checkPromotions.wait.already.output.txt: -------------------------------------------------------------------------------- 1 | 'wait' option unnecessary. Most likely the promotion was already checked on. 2 | Current activation status of 'qa' by network: 3 | ╒═════════════╤════════════╤════════════════╕ 4 | │"Environment"│"Network" │"Active Version"│ 5 | ╞═════════════╪════════════╪════════════════╡ 6 | │"qa" │"staging" │10 │ 7 | ├─────────────┼────────────┼────────────────┤ 8 | │"qa" │"production"│9 │ 9 | └─────────────┴────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/bar/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bar", 3 | "groupId": 15225, 4 | "propertyName": "bar", 5 | "propertyId": "518929", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/foo/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo", 3 | "groupId": 15225, 4 | "propertyName": "foo", 5 | "propertyId": "518928", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "groupId": 15225, 4 | "propertyName": "prod", 5 | "propertyId": "518930", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/qa/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qa", 3 | "groupId": 61726, 4 | "propertyName": "qa.testproject-novar.com", 5 | "propertyId": 411089, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "groupId": 61726, 4 | "propertyName": "prod.testproject-novar.com", 5 | "propertyId": 411091, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:31Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testdata/search.json: -------------------------------------------------------------------------------- 1 | { 2 | "versions" : { 3 | "items" : [ { 4 | "accountId" : "1-1TJZFB", 5 | "contractId" : "1-1TJZH5", 6 | "assetId" : "10591019", 7 | "groupId" : "15225", 8 | "propertyId" : "495911", 9 | "propertyName" : "FOOBAR", 10 | "propertyVersion" : 1, 11 | "updatedByUser" : "tohare@gmail.com", 12 | "updatedDate" : "2018-10-03T13:14:54Z", 13 | "productionStatus" : "INACTIVE", 14 | "stagingStatus" : "INACTIVE" 15 | } ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/testdata/propertyVariables.output.txt: -------------------------------------------------------------------------------- 1 | ╒══════════╤═══════════════╤══════════════════════════════╤════════╤═══════════╕ 2 | │"Name" │"Value" │"Description" │"Hidden"│"Sensitive"│ 3 | ╞══════════╪═══════════════╪══════════════════════════════╪════════╪═══════════╡ 4 | │"VAR_NAME"│"default value"│"This is a sample Property Man│false │false │ 5 | │ │ │ager variable." │ │ │ 6 | └──────────┴───────────────┴──────────────────────────────┴────────┴───────────┘ -------------------------------------------------------------------------------- /tests/testproject-novar.com/environments/staging/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "staging", 3 | "groupId": 61726, 4 | "propertyName": "staging.testproject-novar.com", 5 | "propertyId": 411090, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:19Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.customname.com/environments/bar/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bar", 3 | "propertyName": "bar", 4 | "groupId": 61726, 5 | "propertyId": 411090, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:19Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.customname.com/environments/foo/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo", 3 | "propertyName": "foo", 4 | "groupId": 61726, 5 | "propertyId": 411089, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.associate.com/environments/bar/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bar", 3 | "propertyName": "bar", 4 | "groupId": 15225, 5 | "propertyId": "518929", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.associate.com/environments/foo/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo", 3 | "propertyName": "foo", 4 | "groupId": 15225, 5 | "propertyId": "518928", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.customname.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "propertyName": "prod", 4 | "groupId": 61726, 5 | "propertyId": 411091, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:31Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.snippets.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "new.snippets.com", 3 | "propertyName": "new.snippets.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "customPropertyName": true, 5 | "associatePropertyName": true, 6 | "edgeGridConfig": { 7 | "section": "credentials" 8 | }, 9 | "environments": [ 10 | "foo", 11 | "bar", 12 | "prod" 13 | ], 14 | "name": "testproject-novar-associate.com", 15 | "groupIds": [ 16 | 15225 17 | ], 18 | "isSecure": false, 19 | "version": "0.1.10" 20 | } -------------------------------------------------------------------------------- /tests/new.associate.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "propertyName": "prod", 4 | "groupId": 15225, 5 | "propertyId": "518930", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testdata/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "versions" : { 3 | "items" : [ { 4 | "accountId" : "1-1TJZFB", 5 | "contractId" : "1-1TJZH5", 6 | "assetId" : "10591019", 7 | "groupId" : "15225", 8 | "propertyId" : "411089", 9 | "propertyName" : "new.snipppets.existing.com", 10 | "propertyVersion" : 1, 11 | "updatedByUser" : "tohare@gmail.com", 12 | "updatedDate" : "2018-10-03T13:14:54Z", 13 | "productionStatus" : "INACTIVE", 14 | "stagingStatus" : "INACTIVE" 15 | } ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/projectInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": "Web_App_Accel", 3 | "contractId": "1-1TJZH5", 4 | "customPropertyName": true, 5 | "associatePropertyName": true, 6 | "groupIds": [ 7 | 15225 8 | ], 9 | "environments": [ 10 | "foo", 11 | "bar", 12 | "prod" 13 | ], 14 | "version": "0.1.10", 15 | "isSecure": false, 16 | "edgeGridConfig": { 17 | "section": "credentials" 18 | }, 19 | "name": "testproject-uservar-associate.com" 20 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/bar/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bar", 3 | "propertyName": "bar", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411090, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:19Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/foo/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo", 3 | "propertyName": "foo", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/import.snippets.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "import.snippets.com", 3 | "propertyId": 501778, 4 | "propertyName": "import.snippets.com", 5 | "groupId": 61726, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "dummy@gmail.com", 10 | "updatedDate": "2018-11-06T15:39:49Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-09-12" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/qa/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qa", 3 | "propertyName": "qa.new.testproject.com", 4 | "groupId": 61726, 5 | "propertyId": 411089, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/snippets-uservar.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snippets-uservar.com", 3 | "propertyName": "snippets-uservar.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/bar/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bar", 3 | "propertyName": "bar", 4 | "groupId": 15225, 5 | "propertyId": "518929", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/foo/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo", 3 | "propertyName": "foo", 4 | "groupId": 15225, 5 | "propertyId": "518928", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "propertyName": "prod", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411091, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:31Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "propertyName": "prod.new.testproject.com", 4 | "groupId": 61726, 5 | "propertyId": 411091, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:31Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "propertyName": "prod", 4 | "groupId": 15225, 5 | "propertyId": "518930", 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 2, 9 | "updatedByUser": "4hcpfgsuqewr56a2", 10 | "updatedDate": "2019-03-18T17:25:23Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-02-27" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/qa/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qa", 3 | "propertyName": "qa.testproject-uservar.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/edgerc.config: -------------------------------------------------------------------------------- 1 | [credentials] 2 | host = blahblahblah 3 | client_token = foobarvoobawejrw 4 | client_secret = werlwe;rk06U7ndc= 5 | access_token = wljwler;klwj324234 6 | 7 | [frodo] 8 | host = ewrdfsfsdweew 9 | client_token = foobasdfsdfwdsfnfnfgnfgn 10 | client_secret=werlwewewrvvsvsvs=06U7n=dc= 11 | access_token = pppeoewrpwksdnlvknsd;lkn 12 | 13 | [sec-with-comment] #comment1 14 | host = sec.with.comment.com 15 | #comment2 16 | client_token = foobasdfsdfwdsfnfnfgnfgn 17 | client_secret=werlwewewrvvsvsvs=06U7n=dc= 18 | access_token = pppeoewrpwksdnlvknsd;lkn -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "propertyName": "prod.testproject-uservar.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411091, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:31Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.snipppets.existing.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "new.snipppets.existing.com", 3 | "propertyName": "new.snipppets.existing.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/environments/staging/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "staging", 3 | "propertyName": "staging.new.testproject.com", 4 | "groupId": 61726, 5 | "propertyId": 411090, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:19Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/testdata/propertyVariablesList.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "name": "default", 4 | "options": { 5 | "is_secure": false 6 | }, 7 | "variables": [ 8 | { 9 | "name": "VAR_NAME", 10 | "value": "default value", 11 | "description": "This is a sample Property Manager variable.", 12 | "hidden": false, 13 | "sensitive": false 14 | } 15 | ], 16 | "criteriaMustSatisfy": "all", 17 | "criteria": [], 18 | "behaviors": [], 19 | "children": [] 20 | }, 21 | "ruleFormat": "v2020-03-04" 22 | } -------------------------------------------------------------------------------- /tests/testdata/snippets.checkActivations.wait.already.output.txt: -------------------------------------------------------------------------------- 1 | 'wait' option unnecessary. Most likely the activation was already checked on. 2 | Current activation status of 'new.snippets.com' by network: 3 | ╒══════════════════╤════════════╤════════════════╕ 4 | │"Property" │"Network" │"Active Version"│ 5 | ╞══════════════════╪════════════╪════════════════╡ 6 | │"new.snippets.com"│"staging" │10 │ 7 | ├──────────────────┼────────────┼────────────────┤ 8 | │"new.snippets.com"│"production"│9 │ 9 | └──────────────────┴────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/testproject-uservar.com/environments/staging/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "staging", 3 | "propertyName": "staging.testproject-uservar.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411090, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:19Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/import-uservar.snippets.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "import-uservar.snippets.com", 3 | "propertyId": 501778, 4 | "propertyName": "import-uservar.snippets.com", 5 | "groupId": 61726, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "dummy@gmail.com", 10 | "updatedDate": "2018-11-06T15:39:49Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-09-12" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/snippets.environment.tests.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snippets.environment.tests.com", 3 | "propertyName": "snippets.environment.tests.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/import.snippets.noHostnames.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "import.snippets.noHostnames.com", 3 | "propertyId": 501778, 4 | "propertyName": "import.snippets.noHostnames.com", 5 | "groupId": 61726, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "dummy@gmail.com", 10 | "updatedDate": "2018-11-06T15:39:49Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-09-12" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.associate.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/new.customname.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/import.snippets.noHostnameID.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "import.snippets.noHostnameID.com", 3 | "propertyId": 501778, 4 | "propertyName": "import.snippets.noHostnameID.com", 5 | "groupId": 61726, 6 | "isSecure": false, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "dummy@gmail.com", 10 | "updatedDate": "2018-11-06T15:39:49Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "v2018-09-12" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/new.snippets.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/pull-snippets.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject-novar.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject-uservar.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/import.snippets.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/merger.snippets.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/saveTest.snippets.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/snippets-uservar.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/import-uservar.snippets.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/new.snipppets.existing.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/pull-snippets-pending.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/pull-snippets-uservar.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject-novar-associate.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject-novar-customname.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-associate.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/import.snippets.noHostnameID.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/import.snippets.noHostnames.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/merger.variables.snippets.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/saveTest.snippets-hostname.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/snippets.environment.tests.com/config-snippets/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /tests/testproject-uservar-customname.com/templates/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dynamic Content", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "downstreamCache", 7 | "options": { 8 | "behavior": "TUNNEL_ORIGIN" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "cacheability", 15 | "options": { 16 | "matchOperator": "IS_NOT", 17 | "value": "CACHEABLE" 18 | } 19 | } 20 | ], 21 | "criteriaMustSatisfy": "all" 22 | } -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | # must be unique in a given SonarQube instance 2 | sonar.projectKey=devops-prov-sdk 3 | # this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1. 4 | sonar.projectName=pm-cli #project name should same as in the pulsar dashboard. 5 | sonar.projectVersion=1.0 6 | 7 | # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. 8 | # This property is optional if sonar.modules is set. 9 | sonar.sources=src 10 | sonar.javascript.lcov.reportPaths=dist/coverage/lcov.info 11 | #sonar.exclusions=app/libs/**/* 12 | sonar.language=js -------------------------------------------------------------------------------- /tests/testdata/papi_errors/secure_origin.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors": [ 3 | { 4 | "type": "https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required", 5 | "errorLocation": "#/rules/behaviors/0/options/verificationMode", 6 | "detail": "The Verification Settings option on the `Origin Server` behavior is required." 7 | }, 8 | { 9 | "type": "https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required", 10 | "errorLocation": "#/rules/behaviors/0/options/httpsPort", 11 | "detail": "The HTTPS Port option on the `Origin Server` behavior is required." 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /tests/testdata/activateVersionWait.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒════════════╤═════════╤═════════╤═══════════════╕ 3 | │"PropertyId"│"Version"│"Network"│"Activation Id"│ 4 | ╞════════════╪═════════╪═════════╪═══════════════╡ 5 | │"prp_609774"│2 │"STAGING"│8481528 │ 6 | └────────────┴─────────┴─────────┴───────────────┘ 7 | Activation status report: 8 | ╒════════════╤═════════╤═══════════════╤════════╕ 9 | │"Property" │"Network"│"Activation Id"│"Status"│ 10 | ╞════════════╪═════════╪═══════════════╪════════╡ 11 | │"prp_609774"│"STAGING"│"atv_8481528" │"ACTIVE"│ 12 | └────────────┴─────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/checkPromotions.wait.delayed.output.txt: -------------------------------------------------------------------------------- 1 | ...activation status is PENDING... 2 | ...Waiting for active status... 3 | ...Checking promotions... 4 | ...activation status is PENDING... 5 | ...Waiting for active status... 6 | ...Checking promotions... 7 | Activation status report: 8 | ╒═════════════╤════════════╤═══════════════╤════════╕ 9 | │"Environment"│"Network" │"Activation Id"│"Status"│ 10 | ╞═════════════╪════════════╪═══════════════╪════════╡ 11 | │"qa" │"PRODUCTION"│"5355534" │"ACTIVE"│ 12 | ├─────────────┼────────────┼───────────────┼────────┤ 13 | │"qa" │"STAGING" │"5355810" │"ACTIVE"│ 14 | └─────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/propertyUpdateSuppressOutput.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors": [ 3 | { 4 | "type": "https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required", 5 | "errorLocation": "#/rules/behaviors/3/options/netStorage", 6 | "detail": "The NetStorage Account option on the `Origin Server` behavior is required." 7 | }, 8 | { 9 | "type": "https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required", 10 | "errorLocation": "#/rules/behaviors/4/options/value", 11 | "detail": "The Content Provider Code option on the `Content Provider Code` behavior is required." 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /tests/snippets.hostnameTests.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qa", 3 | "groupId": 61726, 4 | "propertyName": "qa.hostnameTests.com", 5 | "propertyId": 411089, 6 | "environmentHash": "f91b2efb777cc1a6124d844e4a707676c9e2c105b8852f4700071193b221aaa2", 7 | "ruleTreeHash": "6ac5ef477dbdc1abbc1c8957a0b6faef28f9d21b2f92e5771f29391da00a7744", 8 | "latestVersionInfo": { 9 | "propertyVersion": 1, 10 | "updatedByUser": "jpws7ubcv5jjsv37", 11 | "updatedDate": "2017-11-13T21:49:05Z", 12 | "productionStatus": "INACTIVE", 13 | "stagingStatus": "INACTIVE", 14 | "productId": "Web_App_Accel", 15 | "ruleFormat": "latest" 16 | }, 17 | "lastSaveErrors": [], 18 | "lastSaveWarnings": [] 19 | } -------------------------------------------------------------------------------- /tests/hostnameTests.com/environments/qa/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qa", 3 | "groupId": 61726, 4 | "propertyName": "qa.hostnameTests.com", 5 | "propertyId": 411089, 6 | "environmentHash": "f91b2efb777cc1a6124d844e4a707676c9e2c105b8852f4700071193b221aaa2", 7 | "ruleTreeHash": "6ac5ef477dbdc1abbc1c8957a0b6faef28f9d21b2f92e5771f29391da00a7744", 8 | "latestVersionInfo": { 9 | "propertyVersion": 1, 10 | "updatedByUser": "jpws7ubcv5jjsv37", 11 | "updatedDate": "2017-11-13T21:49:05Z", 12 | "productionStatus": "INACTIVE", 13 | "stagingStatus": "INACTIVE", 14 | "productId": "Web_App_Accel", 15 | "ruleFormat": "latest" 16 | }, 17 | "lastSaveErrors": [], 18 | "lastSaveWarnings": [] 19 | } -------------------------------------------------------------------------------- /tests/testdata/json/truncated.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountId": "15Q-MPF", 3 | "accountName": "IKEA IT AB", 4 | "groups": { 5 | "items": [ 6 | { 7 | "groupName": "TestGroupupdategrptestcase4", 8 | "groupId": "24511", 9 | "contractIds": [ 10 | "1-2681AU" 11 | ] 12 | }, 13 | { 14 | "groupName": "IRW domains", 15 | "groupId": "24514", 16 | "parentGroupId": "24511", 17 | "contractIds": [ 18 | "1-2681AU" 19 | ] 20 | }, 21 | { 22 | "groupName": "IRW CTE", 23 | "groupId": "24515", 24 | "parentGroupId": "24514", 25 | "contractIds": [ 26 | "1-2681AU" 27 | ] 28 | } -------------------------------------------------------------------------------- /tests/testdata/snippets.checkActivations.wait.delayed.output.txt: -------------------------------------------------------------------------------- 1 | ...activation status is PENDING... 2 | ...Waiting for active status... 3 | ...Checking activations... 4 | ...activation status is PENDING... 5 | ...Waiting for active status... 6 | ...Checking activations... 7 | Activation status report: 8 | ╒══════════════════╤════════════╤═══════════════╤════════╕ 9 | │"Property" │"Network" │"Activation Id"│"Status"│ 10 | ╞══════════════════╪════════════╪═══════════════╪════════╡ 11 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ACTIVE"│ 12 | ├──────────────────┼────────────┼───────────────┼────────┤ 13 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE"│ 14 | └──────────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/snippets/snippets.project_tests.data.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "mkdir", 4 | "homeSweetHome/Foobar" 5 | ], 6 | [ 7 | "mkdir", 8 | "homeSweetHome/Foobar/cache" 9 | ], 10 | [ 11 | "mkdir", 12 | "homeSweetHome/Foobar/dist" 13 | ], 14 | [ 15 | "mkdir", 16 | "homeSweetHome/Foobar/config-snippets" 17 | ], 18 | [ 19 | "writeJsonFile", 20 | "homeSweetHome/Foobar/projectInfo.json", 21 | { 22 | "productId": "WAA", 23 | "contractId": "ABF543", 24 | "groupId": 76342, 25 | "version": "0.1.11", 26 | "isSecure": false, 27 | "name": "Foobar" 28 | } 29 | ] 30 | ] -------------------------------------------------------------------------------- /tests/testproject.com/environments/qa/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qa", 3 | "groupId": 61726, 4 | "propertyName": "qa.testproject.com", 5 | "propertyId": 411089, 6 | "isSecure": false, 7 | "environmentHash": "f91b2efb777cc1a6124d844e4a707676c9e2c105b8852f4700071193b221aaa2", 8 | "ruleTreeHash": "6ac5ef477dbdc1abbc1c8957a0b6faef28f9d21b2f92e5771f29391da00a7744", 9 | "latestVersionInfo": { 10 | "propertyVersion": 1, 11 | "updatedByUser": "jpws7ubcv5jjsv37", 12 | "updatedDate": "2017-11-13T21:49:05Z", 13 | "productionStatus": "INACTIVE", 14 | "stagingStatus": "INACTIVE", 15 | "productId": "Web_App_Accel", 16 | "ruleFormat": "latest" 17 | }, 18 | "lastSaveErrors": [], 19 | "lastSaveWarnings": [] 20 | } -------------------------------------------------------------------------------- /tests/testdata/json/badlitteral.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountId": "15Q-MPF", 3 | "accountName": "IKEA IT AB", 4 | "groups": { 5 | "items": [ 6 | { 7 | "groupName": "TestGroupupdategrptestcase4", 8 | "groupId": "24511", 9 | "contractIds": [ 10 | "1-2681AU" 11 | ] 12 | }, 13 | { 14 | "groupName": "IRW domains", 15 | "groupId": "24514", 16 | "parentGroupId": 0x242342, 17 | "contractIds": [ 18 | "1-2681AU" 19 | ] 20 | }, 21 | { 22 | "groupName": "IRW CTE", 23 | "groupId": 24515, 24 | "parentGroupId": 24514, 25 | "contractIds": [ 26 | "1-2681AU" 27 | ] 28 | } 29 | ] 30 | } 31 | } -------------------------------------------------------------------------------- /bin/akamai-pipeline: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Copyright 2020. Akamai Technologies, Inc 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | 18 | 19 | require('../src/cli')(); -------------------------------------------------------------------------------- /tests/testdata/activateVersionWait.json: -------------------------------------------------------------------------------- 1 | { 2 | "activationId": "atv_8481528", 3 | "propertyName": "dev.heggadahalli.com", 4 | "propertyId": "prp_609774", 5 | "propertyVersion": 2, 6 | "network": "STAGING", 7 | "activationType": "ACTIVATE", 8 | "status": "ACTIVE", 9 | "submitDate": "2020-09-11T13:47:34Z", 10 | "updateDate": "2020-09-11T13:48:55Z", 11 | "note": "testing", 12 | "notifyEmails": [ 13 | "sheggada@akamai.com" 14 | ], 15 | "fmaActivationState": "steady", 16 | "fallbackInfo": { 17 | "fastFallbackAttempted": false, 18 | "fallbackVersion": 1, 19 | "canFastFallback": true, 20 | "steadyStateTime": 1599832135, 21 | "fastFallbackExpirationTime": 1599835735, 22 | "fastFallbackRecoveryState": null 23 | } 24 | } -------------------------------------------------------------------------------- /bin/akamai-property-manager: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Copyright 2020. Akamai Technologies, Inc 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | 18 | 19 | require('../src/pm/property_manager_cli')(); -------------------------------------------------------------------------------- /tests/merger.snippets.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "new.snippets.com", 3 | "propertyName": "new.snippets.com", 4 | "environmentHash": "1d74578384fc42fbd0a9775e2c9c277493b74ebe4f9736f48efcfe9f1770b77f", 5 | "groupId": 61726, 6 | "isSecure": false, 7 | "lastSaveErrors": [], 8 | "lastSaveWarnings": [], 9 | "lastValidatedHash": "f91b2efb777cc1a6124d844e4a707676c9e2c105b8852f4700071193b221aaa2", 10 | "propertyId": 411089, 11 | "latestVersionInfo": { 12 | "propertyVersion": 1, 13 | "updatedByUser": "jpws7ubcv5jjsv37", 14 | "updatedDate": "2017-11-13T21:49:05Z", 15 | "productionStatus": "INACTIVE", 16 | "stagingStatus": "INACTIVE", 17 | "productId": "Web_App_Accel", 18 | "ruleFormat": "latest" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/saveTest.snippets.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "saveTest.snippets.com", 3 | "propertyName": "saveTest.snippets.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | }, 16 | "environmentHash": "11d6a9eb700504cad14a5f31810958781bf717a7fc7b36427656811d2b83d9cd", 17 | "ruleTreeHash": "04fd417918c8ab13fb220473facef022b08630e1050bf744d4a2e56dab36d2bf", 18 | "lastSaveWarnings": [], 19 | "lastSaveErrors": [] 20 | } -------------------------------------------------------------------------------- /src/enums/Network.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020. Akamai Technologies, Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | const Network = { 17 | STAGING: "STAGING", 18 | PRODUCTION: "PRODUCTION" 19 | }; 20 | module.exports = Network; -------------------------------------------------------------------------------- /tests/testdata/propertiesList.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties" : { 3 | "items": [ 4 | { 5 | "accountId": "act_1-599K", 6 | "contractId": "ctr_1-3CV382", 7 | "groupId" : "grp_18385", 8 | "propertyId": "prp_556622", 9 | "propertyName": "AMDTest", 10 | "latestVersion": 1, 11 | "stagingVersion": null, 12 | "productionVersion" : null, 13 | "assetId": "aid_10698919" 14 | }, { 15 | "accountId" : "act_1-599K", 16 | "contractId": "ctr_1-3CV382", 17 | "groupId": "grp_18385", 18 | "propertyId": "prp_483090", 19 | "propertyName": "mmc-amd-ns", 20 | "latestVersion" : 1, 21 | "stagingVersion": null, 22 | "productionVersion": null, 23 | "assetId": "aid_10590392" 24 | } 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /src/enums/ActivationType.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020. Akamai Technologies, Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | const ActivationType = { 17 | ACTIVATE: "ACTIVATE", 18 | DEACTIVATE: "DEACTIVATE" 19 | }; 20 | 21 | module.exports = ActivationType; -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/qa/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qa", 3 | "groupId": 61726, 4 | "propertyName": "qa.testproject.com", 5 | "propertyId": 411089, 6 | "isSecure": false, 7 | "environmentHash": "f91b2efb777cc1a6124d844e4a707676c9e2c105b8852f4700071193b221aaa2", 8 | "lastSavedHash": "f91b2efb777cc1a6124d844e4a707676c9e2c105b8852f4700071193b221aaa2", 9 | "ruleTreeHash": "6ac5ef477dbdc1abbc1c8957a0b6faef28f9d21b2f92e5771f29391da00a7744", 10 | "latestVersionInfo": { 11 | "propertyVersion": 1, 12 | "updatedByUser": "jpws7ubcv5jjsv37", 13 | "updatedDate": "2017-11-13T21:49:05Z", 14 | "productionStatus": "INACTIVE", 15 | "stagingStatus": "INACTIVE", 16 | "productId": "Web_App_Accel", 17 | "ruleFormat": "latest" 18 | }, 19 | "lastSaveErrors": [], 20 | "lastSaveWarnings": [] 21 | } -------------------------------------------------------------------------------- /tests/testproject.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "groupId": 61726, 4 | "propertyName": "prod.testproject.com", 5 | "propertyId": 411091, 6 | "isSecure": false, 7 | "environmentHash": "ddc71e346d217bcb717870b63b8ba3c515fd3d65faeb2626db0f6fd01ce54664", 8 | "lastValidatedHash": "ddc71e346d217bcb717870b63b8ba3c515fd3d65faeb2626db0f6fd01ce54664", 9 | "ruleTreeHash": "621bac67d0294c0b774aa64cd478120cb2457b89e11cc789cae94914f61e93ea", 10 | "latestVersionInfo": { 11 | "propertyVersion": 1, 12 | "updatedByUser": "jpws7ubcv5jjsv37", 13 | "updatedDate": "2017-11-13T21:49:31Z", 14 | "productionStatus": "INACTIVE", 15 | "stagingStatus": "INACTIVE", 16 | "productId": "Web_App_Accel", 17 | "ruleFormat": "latest" 18 | }, 19 | "lastSaveErrors": [], 20 | "lastSaveWarnings": [] 21 | } -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/prod/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prod", 3 | "groupId": 61726, 4 | "propertyName": "prod.testproject.com", 5 | "propertyId": 411091, 6 | "isSecure": false, 7 | "environmentHash": "ddc71e346d217bcb717870b63b8ba3c515fd3d65faeb2626db0f6fd01ce54664", 8 | "lastValidatedHash": "ddc71e346d217bcb717870b63b8ba3c515fd3d65faeb2626db0f6fd01ce54664", 9 | "ruleTreeHash": "621bac67d0294c0b774aa64cd478120cb2457b89e11cc789cae94914f61e93ea", 10 | "latestVersionInfo": { 11 | "propertyVersion": 1, 12 | "updatedByUser": "jpws7ubcv5jjsv37", 13 | "updatedDate": "2017-11-13T21:49:31Z", 14 | "productionStatus": "INACTIVE", 15 | "stagingStatus": "INACTIVE", 16 | "productId": "Web_App_Accel", 17 | "ruleFormat": "latest" 18 | }, 19 | "lastSaveErrors": [], 20 | "lastSaveWarnings": [] 21 | } -------------------------------------------------------------------------------- /tests/testproject.com/environments/staging/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "staging", 3 | "groupId": 61726, 4 | "propertyName": "staging.testproject.com", 5 | "propertyId": 411090, 6 | "isSecure": false, 7 | "environmentHash": "012c5a4a21d0b39216a5af80e78bf731f0354d51672338adbede86432a697a64", 8 | "lastValidatedHash": "012c5a4a21d0b39216a5af80e78bf731f0354d51672338adbede86432a697a64", 9 | "ruleTreeHash": "2744fa78eb04033bc18cfa7c4496d95b2af7ee15195dcca93606e9bf4a74405b", 10 | "latestVersionInfo": { 11 | "propertyVersion": 1, 12 | "updatedByUser": "jpws7ubcv5jjsv37", 13 | "updatedDate": "2017-11-13T21:49:19Z", 14 | "productionStatus": "INACTIVE", 15 | "stagingStatus": "INACTIVE", 16 | "productId": "Web_App_Accel", 17 | "ruleFormat": "latest" 18 | }, 19 | "lastSaveErrors": [], 20 | "lastSaveWarnings": [] 21 | } -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/environments/staging/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "staging", 3 | "groupId": 61726, 4 | "propertyName": "staging.testproject.com", 5 | "propertyId": 411090, 6 | "isSecure": false, 7 | "environmentHash": "012c5a4a21d0b39216a5af80e78bf731f0354d51672338adbede86432a697a64", 8 | "lastValidatedHash": "012c5a4a21d0b39216a5af80e78bf731f0354d51672338adbede86432a697a64", 9 | "ruleTreeHash": "2744fa78eb04033bc18cfa7c4496d95b2af7ee15195dcca93606e9bf4a74405b", 10 | "latestVersionInfo": { 11 | "propertyVersion": 1, 12 | "updatedByUser": "jpws7ubcv5jjsv37", 13 | "updatedDate": "2017-11-13T21:49:19Z", 14 | "productionStatus": "INACTIVE", 15 | "stagingStatus": "INACTIVE", 16 | "productId": "Web_App_Accel", 17 | "ruleFormat": "latest" 18 | }, 19 | "lastSaveErrors": [], 20 | "lastSaveWarnings": [] 21 | } -------------------------------------------------------------------------------- /tests/testdata/merge.output.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════════╤════════════════╕ 2 | │"Action" │"Result" │ 3 | ╞══════════════════════╪════════════════╡ 4 | │"changes detected" │"yes" │ 5 | ├──────────────────────┼────────────────┤ 6 | │"rule tree stored in" │"foobar.json" │ 7 | ├──────────────────────┼────────────────┤ 8 | │"hash" │"hash baby hash"│ 9 | ├──────────────────────┼────────────────┤ 10 | │"validation performed"│"yes" │ 11 | ├──────────────────────┼────────────────┤ 12 | │"validation warnings" │"no" │ 13 | ├──────────────────────┼────────────────┤ 14 | │"validation errors" │"no" │ 15 | ├──────────────────────┼────────────────┤ 16 | │"hostname warnings" │"no" │ 17 | ├──────────────────────┼────────────────┤ 18 | │"hostname errors" │"no" │ 19 | └──────────────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/testdata/productList.output.txt: -------------------------------------------------------------------------------- 1 | ╒═══════════════════╤═══════════════════╕ 2 | │"Product Name" │"Product ID" │ 3 | ╞═══════════════════╪═══════════════════╡ 4 | │"Rich_Media_Accel" │"Rich_Media_Accel" │ 5 | ├───────────────────┼───────────────────┤ 6 | │"Site_Del" │"Site_Del" │ 7 | ├───────────────────┼───────────────────┤ 8 | │"HTTP_Downloads" │"HTTP_Downloads" │ 9 | ├───────────────────┼───────────────────┤ 10 | │"Mobile_Accel" │"Mobile_Accel" │ 11 | ├───────────────────┼───────────────────┤ 12 | │"Web_App_Accel" │"Web_App_Accel" │ 13 | ├───────────────────┼───────────────────┤ 14 | │"Site_Accel" │"Site_Accel" │ 15 | ├───────────────────┼───────────────────┤ 16 | │"HTTP_Content_Del" │"HTTP_Content_Del" │ 17 | ├───────────────────┼───────────────────┤ 18 | │"Progressive_Media"│"Progressive_Media"│ 19 | └───────────────────┴───────────────────┘ -------------------------------------------------------------------------------- /tests/saveTest.snippets-hostname.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "saveTest.snippets.com", 3 | "propertyName": "saveTest.snippets.com", 4 | "groupId": 61726, 5 | "isSecure": false, 6 | "propertyId": 411089, 7 | "latestVersionInfo": { 8 | "propertyVersion": 1, 9 | "updatedByUser": "jpws7ubcv5jjsv37", 10 | "updatedDate": "2017-11-13T21:49:05Z", 11 | "productionStatus": "INACTIVE", 12 | "stagingStatus": "INACTIVE", 13 | "productId": "Web_App_Accel", 14 | "ruleFormat": "latest" 15 | }, 16 | "environmentHash": "11d6a9eb700504cad14a5f31810958781bf717a7fc7b36427656811d2b83d9cd", 17 | "lastSavedHash": "11d6a9eb700504cad14a5f31810958781bf717a7fc7b36427656811d2b83d9cd", 18 | "ruleTreeHash": "04fd417918c8ab13fb220473facef022b08630e1050bf744d4a2e56dab36d2bf", 19 | "lastSaveWarnings": [], 20 | "lastSaveErrors": [] 21 | } -------------------------------------------------------------------------------- /tests/testdata/merge.noValidate.output.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════════╤════════════════╕ 2 | │"Action" │"Result" │ 3 | ╞══════════════════════╪════════════════╡ 4 | │"changes detected" │"yes" │ 5 | ├──────────────────────┼────────────────┤ 6 | │"rule tree stored in" │"foobar.json" │ 7 | ├──────────────────────┼────────────────┤ 8 | │"hash" │"hash baby hash"│ 9 | ├──────────────────────┼────────────────┤ 10 | │"validation performed"│"no" │ 11 | ├──────────────────────┼────────────────┤ 12 | │"validation warnings" │"no" │ 13 | ├──────────────────────┼────────────────┤ 14 | │"validation errors" │"no" │ 15 | ├──────────────────────┼────────────────┤ 16 | │"hostname warnings" │"no" │ 17 | ├──────────────────────┼────────────────┤ 18 | │"hostname errors" │"no" │ 19 | └──────────────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/testdata/merge.output.hostname.error.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════════╤════════════════╕ 2 | │"Action" │"Result" │ 3 | ╞══════════════════════╪════════════════╡ 4 | │"changes detected" │"yes" │ 5 | ├──────────────────────┼────────────────┤ 6 | │"rule tree stored in" │"foobar.json" │ 7 | ├──────────────────────┼────────────────┤ 8 | │"hash" │"hash baby hash"│ 9 | ├──────────────────────┼────────────────┤ 10 | │"validation performed"│"yes" │ 11 | ├──────────────────────┼────────────────┤ 12 | │"validation warnings" │"no" │ 13 | ├──────────────────────┼────────────────┤ 14 | │"validation errors" │"no" │ 15 | ├──────────────────────┼────────────────┤ 16 | │"hostname warnings" │"no" │ 17 | ├──────────────────────┼────────────────┤ 18 | │"hostname errors" │"yes" │ 19 | └──────────────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/testdata/merge.output.hostname.warning.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════════╤════════════════╕ 2 | │"Action" │"Result" │ 3 | ╞══════════════════════╪════════════════╡ 4 | │"changes detected" │"yes" │ 5 | ├──────────────────────┼────────────────┤ 6 | │"rule tree stored in" │"foobar.json" │ 7 | ├──────────────────────┼────────────────┤ 8 | │"hash" │"hash baby hash"│ 9 | ├──────────────────────┼────────────────┤ 10 | │"validation performed"│"yes" │ 11 | ├──────────────────────┼────────────────┤ 12 | │"validation warnings" │"no" │ 13 | ├──────────────────────┼────────────────┤ 14 | │"validation errors" │"no" │ 15 | ├──────────────────────┼────────────────┤ 16 | │"hostname warnings" │"yes" │ 17 | ├──────────────────────┼────────────────┤ 18 | │"hostname errors" │"no" │ 19 | └──────────────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/testdata/merge.output.validation.error.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════════╤════════════════╕ 2 | │"Action" │"Result" │ 3 | ╞══════════════════════╪════════════════╡ 4 | │"changes detected" │"yes" │ 5 | ├──────────────────────┼────────────────┤ 6 | │"rule tree stored in" │"foobar.json" │ 7 | ├──────────────────────┼────────────────┤ 8 | │"hash" │"hash baby hash"│ 9 | ├──────────────────────┼────────────────┤ 10 | │"validation performed"│"yes" │ 11 | ├──────────────────────┼────────────────┤ 12 | │"validation warnings" │"no" │ 13 | ├──────────────────────┼────────────────┤ 14 | │"validation errors" │"yes" │ 15 | ├──────────────────────┼────────────────┤ 16 | │"hostname warnings" │"no" │ 17 | ├──────────────────────┼────────────────┤ 18 | │"hostname errors" │"no" │ 19 | └──────────────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/testdata/merge.output.validation.warning.txt: -------------------------------------------------------------------------------- 1 | ╒══════════════════════╤════════════════╕ 2 | │"Action" │"Result" │ 3 | ╞══════════════════════╪════════════════╡ 4 | │"changes detected" │"yes" │ 5 | ├──────────────────────┼────────────────┤ 6 | │"rule tree stored in" │"foobar.json" │ 7 | ├──────────────────────┼────────────────┤ 8 | │"hash" │"hash baby hash"│ 9 | ├──────────────────────┼────────────────┤ 10 | │"validation performed"│"yes" │ 11 | ├──────────────────────┼────────────────┤ 12 | │"validation warnings" │"yes" │ 13 | ├──────────────────────┼────────────────┤ 14 | │"validation errors" │"no" │ 15 | ├──────────────────────┼────────────────┤ 16 | │"hostname warnings" │"no" │ 17 | ├──────────────────────┼────────────────┤ 18 | │"hostname errors" │"no" │ 19 | └──────────────────────┴────────────────┘ -------------------------------------------------------------------------------- /tests/merger.variables.snippets.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "merger.variables.snippets.com", 3 | "propertyName": "merger.variables.com", 4 | "environmentHash": "e0ff694ab387e42e5697a93297808132f51d4cf33fac80dacb3be675f8b372c2", 5 | "ruleTreeHash": "99098cceffd2e1ebfa92b350e2b3134c9463e5d18ba3fc6201d7ddd27226c520", 6 | "groupId": 61726, 7 | "isSecure": false, 8 | "lastSaveErrors": [], 9 | "lastSaveWarnings": [], 10 | "lastValidatedHash": "f91b2efb777cc1a6124d844e4a707676c9e2c105b8852f4700071193b221aaa2", 11 | "propertyId": 411089, 12 | "latestVersionInfo": { 13 | "propertyVersion": 1, 14 | "updatedByUser": "jpws7ubcv5jjsv37", 15 | "updatedDate": "2017-11-13T21:49:05Z", 16 | "productionStatus": "INACTIVE", 17 | "stagingStatus": "INACTIVE", 18 | "productId": "Web_App_Accel", 19 | "ruleFormat": "latest" 20 | } 21 | } -------------------------------------------------------------------------------- /tests/testdata/search.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════════╤═════════════╤══════════╤══════════╤═════════════╤═══════════════╤══════════════════╤══════════════════╤══════════════════════╤═══════════════════╤════════════════╕ 2 | │"Account ID"│"Contract ID"│"Asset ID"│"Group ID"│"Property ID"│"Property Name"│"Property Version"│"Updated By User" │"Update Date" │"Production Status"│"Staging Status"│ 3 | ╞════════════╪═════════════╪══════════╪══════════╪═════════════╪═══════════════╪══════════════════╪══════════════════╪══════════════════════╪═══════════════════╪════════════════╡ 4 | │"1-1TJZFB" │"1-1TJZH5" │"10591019"│"15225" │"495911" │"FOOBAR" │1 │"tohare@gmail.com"│"2018-10-03T13:14:54Z"│"INACTIVE" │"INACTIVE" │ 5 | └────────────┴─────────────┴──────────┴──────────┴─────────────┴───────────────┴──────────────────┴──────────────────┴──────────────────────┴───────────────────┴────────────────┘ -------------------------------------------------------------------------------- /src/enums/Status.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020. Akamai Technologies, Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | const Status = { 17 | ACTIVE: "ACTIVE", 18 | INACTIVE: "INACTIVE", 19 | PENDING: "PENDING", 20 | FAILED: "FAILED", 21 | ABORTED: "ABORTED", 22 | DEACTIVATED: "DEACTIVATED" 23 | }; 24 | module.exports = Status; -------------------------------------------------------------------------------- /tests/testdata/productList.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountId" : "1-1TJZFB", 3 | "contractId" : "1-1TJZH5", 4 | "products" : { 5 | "items" : [ { 6 | "productName" : "Rich_Media_Accel", 7 | "productId" : "Rich_Media_Accel" 8 | }, { 9 | "productName" : "Site_Del", 10 | "productId" : "Site_Del" 11 | }, { 12 | "productName" : "HTTP_Downloads", 13 | "productId" : "HTTP_Downloads" 14 | }, { 15 | "productName" : "Mobile_Accel", 16 | "productId" : "Mobile_Accel" 17 | }, { 18 | "productName" : "Web_App_Accel", 19 | "productId" : "Web_App_Accel" 20 | }, { 21 | "productName" : "Site_Accel", 22 | "productId" : "Site_Accel" 23 | }, { 24 | "productName" : "HTTP_Content_Del", 25 | "productId" : "HTTP_Content_Del" 26 | }, { 27 | "productName" : "Progressive_Media", 28 | "productId" : "Progressive_Media" 29 | } ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/testdata/promote.wait.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒═════════════╤═════════╤═══════════════╕ 3 | │"Environment"│"Network"│"Activation Id"│ 4 | ╞═════════════╪═════════╪═══════════════╡ 5 | │"qa" │"STAGING"│5355534 │ 6 | └─────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | Activation status report: 14 | ╒═════════════╤════════════╤═══════════════╤════════╕ 15 | │"Environment"│"Network" │"Activation Id"│"Status"│ 16 | ╞═════════════╪════════════╪═══════════════╪════════╡ 17 | │"qa" │"PRODUCTION"│"5355534" │"ACTIVE"│ 18 | ├─────────────┼────────────┼───────────────┼────────┤ 19 | │"qa" │"STAGING" │"5355810" │"ACTIVE"│ 20 | └─────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/promote.wait.failed.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒═════════════╤═════════╤═══════════════╕ 3 | │"Environment"│"Network"│"Activation Id"│ 4 | ╞═════════════╪═════════╪═══════════════╡ 5 | │"qa" │"STAGING"│5355534 │ 6 | └─────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | Activation status report: 14 | ╒═════════════╤════════════╤═══════════════╤════════╕ 15 | │"Environment"│"Network" │"Activation Id"│"Status"│ 16 | ╞═════════════╪════════════╪═══════════════╪════════╡ 17 | │"qa" │"PRODUCTION"│"5355534" │"FAILED"│ 18 | ├─────────────┼────────────┼───────────────┼────────┤ 19 | │"qa" │"STAGING" │"5355810" │"ACTIVE"│ 20 | └─────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/promote.wait.aborted.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒═════════════╤═════════╤═══════════════╕ 3 | │"Environment"│"Network"│"Activation Id"│ 4 | ╞═════════════╪═════════╪═══════════════╡ 5 | │"qa" │"STAGING"│5355534 │ 6 | └─────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | Activation status report: 14 | ╒═════════════╤════════════╤═══════════════╤═════════╕ 15 | │"Environment"│"Network" │"Activation Id"│"Status" │ 16 | ╞═════════════╪════════════╪═══════════════╪═════════╡ 17 | │"qa" │"PRODUCTION"│"5355534" │"ABORTED"│ 18 | ├─────────────┼────────────┼───────────────┼─────────┤ 19 | │"qa" │"STAGING" │"5355810" │"ACTIVE" │ 20 | └─────────────┴────────────┴───────────────┴─────────┘ -------------------------------------------------------------------------------- /tests/testdata/papi_errors/wrong_type.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "https://problems.luna.akamaiapis.net/papi/v0/json-schema-invalid", 3 | "title": "Input does not match schema", 4 | "status": 400, 5 | "detail": "Your input has a syntax problem. Please double check against the schema.", 6 | "instance": "https://akaa-575u5pwzrgn7x2kx-kcqanlogvq2ynqja.luna-dev.akamaiapis.net/papi/v0/properties/467055/versions/1/rules#9341386c-f0e7-4e67-88b7-ddd57936f2b8", 7 | "schemaLink": "/papi/v0/schemas/products/prd_Site_Del/v2018-02-27", 8 | "errors": [ 9 | { 10 | "location": "/rules/behaviors/1/options/value/id", 11 | "schemaLocation": "/definitions/catalog/option_types/cpcode/properties/id", 12 | "detail": "instance type (string) does not match any allowed primitive type (allowed: [\"integer\",\"number\"])", 13 | "foundType": "string", 14 | "allowedTypes": [ 15 | "integer", 16 | "number" 17 | ] 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /tests/testdata/promote.wait.inactive.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒═════════════╤═════════╤═══════════════╕ 3 | │"Environment"│"Network"│"Activation Id"│ 4 | ╞═════════════╪═════════╪═══════════════╡ 5 | │"qa" │"STAGING"│5355534 │ 6 | └─────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | Activation status report: 14 | ╒═════════════╤════════════╤═══════════════╤══════════╕ 15 | │"Environment"│"Network" │"Activation Id"│"Status" │ 16 | ╞═════════════╪════════════╪═══════════════╪══════════╡ 17 | │"qa" │"PRODUCTION"│"5355534" │"INACTIVE"│ 18 | ├─────────────┼────────────┼───────────────┼──────────┤ 19 | │"qa" │"STAGING" │"5355810" │"ACTIVE" │ 20 | └─────────────┴────────────┴───────────────┴──────────┘ -------------------------------------------------------------------------------- /tests/testdata/promote.wait.cancelled.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒═════════════╤═════════╤═══════════════╕ 3 | │"Environment"│"Network"│"Activation Id"│ 4 | ╞═════════════╪═════════╪═══════════════╡ 5 | │"qa" │"STAGING"│5355534 │ 6 | └─────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is PENDING_CANCELLATION... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | Activation status report: 14 | ╒═════════════╤════════════╤═══════════════╤═════════╕ 15 | │"Environment"│"Network" │"Activation Id"│"Status" │ 16 | ╞═════════════╪════════════╪═══════════════╪═════════╡ 17 | │"qa" │"PRODUCTION"│"5355534" │"ABORTED"│ 18 | ├─────────────┼────────────┼───────────────┼─────────┤ 19 | │"qa" │"STAGING" │"5355810" │"ACTIVE" │ 20 | └─────────────┴────────────┴───────────────┴─────────┘ -------------------------------------------------------------------------------- /tests/testdata/CPCodeList.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════╤══════════════════════╤═════════════╤══════════════════════╕ 2 | │"ID" │"Name" │"Product IDs"│"Creation Date" │ 3 | ╞════════╪══════════════════════╪═════════════╪══════════════════════╡ 4 | │"336850"│"David.M.Group.Test" │"Site_Accel" │"2014-10-30T14:12:36Z"│ 5 | ├────────┼──────────────────────┼─────────────┼──────────────────────┤ 6 | │"575265"│"oca-g1.faden.me" │"Site_Accel" │"2017-05-12T11:16:28Z"│ 7 | ├────────┼──────────────────────┼─────────────┼──────────────────────┤ 8 | │"575259"│"oca-g2.faden.me" │"Site_Accel" │"2017-05-12T11:07:42Z"│ 9 | ├────────┼──────────────────────┼─────────────┼──────────────────────┤ 10 | │"586969"│"oca-g4.faden.me" │"Site_Accel" │"2017-06-15T17:30:08Z"│ 11 | ├────────┼──────────────────────┼─────────────┼──────────────────────┤ 12 | │"699595"│"www42517.xmarkvh.com"│"Site_Accel" │"2018-04-25T16:14:03Z"│ 13 | └────────┴──────────────────────┴─────────────┴──────────────────────┘ -------------------------------------------------------------------------------- /tests/testdata/promote.wait.deactive.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒═════════════╤═════════╤═══════════════╕ 3 | │"Environment"│"Network"│"Activation Id"│ 4 | ╞═════════════╪═════════╪═══════════════╡ 5 | │"qa" │"STAGING"│5355534 │ 6 | └─────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING_DEACTIVATION... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is PENDING_DEACTIVATION... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | Activation status report: 14 | ╒═════════════╤════════════╤═══════════════╤═════════════╕ 15 | │"Environment"│"Network" │"Activation Id"│"Status" │ 16 | ╞═════════════╪════════════╪═══════════════╪═════════════╡ 17 | │"qa" │"PRODUCTION"│"5355534" │"DEACTIVATED"│ 18 | ├─────────────┼────────────┼───────────────┼─────────────┤ 19 | │"qa" │"STAGING" │"5355810" │"ACTIVE" │ 20 | └─────────────┴────────────┴───────────────┴─────────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.wait.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒══════════════════╤═════════╤═══════════════╕ 3 | │"Property" │"Network"│"Activation Id"│ 4 | ╞══════════════════╪═════════╪═══════════════╡ 5 | │"new.snippets.com"│"STAGING"│5355534 │ 6 | └──────────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status"│ 16 | ╞══════════════════╪════════════╪═══════════════╪════════╡ 17 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ACTIVE"│ 18 | ├──────────────────┼────────────┼───────────────┼────────┤ 19 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE"│ 20 | └──────────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.wait.failed.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒══════════════════╤═════════╤═══════════════╕ 3 | │"Property" │"Network"│"Activation Id"│ 4 | ╞══════════════════╪═════════╪═══════════════╡ 5 | │"new.snippets.com"│"STAGING"│5355534 │ 6 | └──────────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status"│ 16 | ╞══════════════════╪════════════╪═══════════════╪════════╡ 17 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"FAILED"│ 18 | ├──────────────────┼────────────┼───────────────┼────────┤ 19 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE"│ 20 | └──────────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/properties.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════════╤══════════════╤═══════════╤═══════════════╤═════════════╤══════════════╤════════════════════╤════════════════╤═════════════════╕ 2 | │"Account Id"│"Contract Id" │"Group Id" │"Property Name"│"Property Id"│"Asset Id" │"Production Version"│"Latest Version"│"Staging Version"│ 3 | ╞════════════╪══════════════╪═══════════╪═══════════════╪═════════════╪══════════════╪════════════════════╪════════════════╪═════════════════╡ 4 | │"act_1-599K"│"ctr_1-3CV382"│"grp_18385"│"AMDTest" │"prp_556622" │"aid_10698919"│null │1 │null │ 5 | ├────────────┼──────────────┼───────────┼───────────────┼─────────────┼──────────────┼────────────────────┼────────────────┼─────────────────┤ 6 | │"act_1-599K"│"ctr_1-3CV382"│"grp_18385"│"mmc-amd-ns" │"prp_483090" │"aid_10590392"│null │1 │null │ 7 | └────────────┴──────────────┴───────────┴───────────────┴─────────────┴──────────────┴────────────────────┴────────────────┴─────────────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.wait.aborted.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒══════════════════╤═════════╤═══════════════╕ 3 | │"Property" │"Network"│"Activation Id"│ 4 | ╞══════════════════╪═════════╪═══════════════╡ 5 | │"new.snippets.com"│"STAGING"│5355534 │ 6 | └──────────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤═════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status" │ 16 | ╞══════════════════╪════════════╪═══════════════╪═════════╡ 17 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ABORTED"│ 18 | ├──────────────────┼────────────┼───────────────┼─────────┤ 19 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE" │ 20 | └──────────────────┴────────────┴───────────────┴─────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.wait.inactive.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒══════════════════╤═════════╤═══════════════╕ 3 | │"Property" │"Network"│"Activation Id"│ 4 | ╞══════════════════╪═════════╪═══════════════╡ 5 | │"new.snippets.com"│"STAGING"│5355534 │ 6 | └──────────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤══════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status" │ 16 | ╞══════════════════╪════════════╪═══════════════╪══════════╡ 17 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"INACTIVE"│ 18 | ├──────────────────┼────────────┼───────────────┼──────────┤ 19 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE" │ 20 | └──────────────────┴────────────┴───────────────┴──────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.wait.cancelled.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒══════════════════╤═════════╤═══════════════╕ 3 | │"Property" │"Network"│"Activation Id"│ 4 | ╞══════════════════╪═════════╪═══════════════╡ 5 | │"new.snippets.com"│"STAGING"│5355534 │ 6 | └──────────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING_CANCELLATION... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤═════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status" │ 16 | ╞══════════════════╪════════════╪═══════════════╪═════════╡ 17 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ABORTED"│ 18 | ├──────────────────┼────────────┼───────────────┼─────────┤ 19 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE" │ 20 | └──────────────────┴────────────┴───────────────┴─────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.deactivate.wait.output.txt: -------------------------------------------------------------------------------- 1 | Following deactivations are now pending: 2 | ╒══════════════════╤════════════╤═══════════════╕ 3 | │"Property" │"Network" │"Activation Id"│ 4 | ╞══════════════════╪════════════╪═══════════════╡ 5 | │"old.snippets.com"│"PRODUCTION"│5355534 │ 6 | └──────────────────┴────────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤═════════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status" │ 16 | ╞══════════════════╪════════════╪═══════════════╪═════════════╡ 17 | │"old.snippets.com"│"PRODUCTION"│"5355534" │"INACTIVE" │ 18 | ├──────────────────┼────────────┼───────────────┼─────────────┤ 19 | │"old.snippets.com"│"STAGING" │"5355810" │"DEACTIVATED"│ 20 | └──────────────────┴────────────┴───────────────┴─────────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.deactivate.wait.failed.output.txt: -------------------------------------------------------------------------------- 1 | Following deactivations are now pending: 2 | ╒══════════════════╤════════════╤═══════════════╕ 3 | │"Property" │"Network" │"Activation Id"│ 4 | ╞══════════════════╪════════════╪═══════════════╡ 5 | │"old.snippets.com"│"PRODUCTION"│5355534 │ 6 | └──────────────────┴────────────┴───────────────┘ 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤═════════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status" │ 16 | ╞══════════════════╪════════════╪═══════════════╪═════════════╡ 17 | │"old.snippets.com"│"PRODUCTION"│"5355534" │"FAILED" │ 18 | ├──────────────────┼────────────┼───────────────┼─────────────┤ 19 | │"old.snippets.com"│"STAGING" │"5355810" │"DEACTIVATED"│ 20 | └──────────────────┴────────────┴───────────────┴─────────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.wait.deactive.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒══════════════════╤═════════╤═══════════════╕ 3 | │"Property" │"Network"│"Activation Id"│ 4 | ╞══════════════════╪═════════╪═══════════════╡ 5 | │"new.snippets.com"│"STAGING"│5355534 │ 6 | └──────────────────┴─────────┴───────────────┘ 7 | ...activation status is PENDING_DEACTIVATION... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING_DEACTIVATION... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | Activation status report: 14 | ╒══════════════════╤════════════╤═══════════════╤═════════════╕ 15 | │"Property" │"Network" │"Activation Id"│"Status" │ 16 | ╞══════════════════╪════════════╪═══════════════╪═════════════╡ 17 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"DEACTIVATED"│ 18 | ├──────────────────┼────────────┼───────────────┼─────────────┤ 19 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE" │ 20 | └──────────────────┴────────────┴───────────────┴─────────────┘ -------------------------------------------------------------------------------- /tests/testdata/CPCodeList.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountId" : "1-1TJZFB", 3 | "contractId" : "1-1TJZH5", 4 | "groupId" : "15231", 5 | "cpcodes" : { 6 | "items" : [ { 7 | "cpcodeId" : "336850", 8 | "cpcodeName" : "David.M.Group.Test", 9 | "productIds" : [ "Site_Accel" ], 10 | "createdDate" : "2014-10-30T14:12:36Z" 11 | }, { 12 | "cpcodeId" : "575265", 13 | "cpcodeName" : "oca-g1.faden.me", 14 | "productIds" : [ "Site_Accel" ], 15 | "createdDate" : "2017-05-12T11:16:28Z" 16 | }, { 17 | "cpcodeId" : "575259", 18 | "cpcodeName" : "oca-g2.faden.me", 19 | "productIds" : [ "Site_Accel" ], 20 | "createdDate" : "2017-05-12T11:07:42Z" 21 | }, { 22 | "cpcodeId" : "586969", 23 | "cpcodeName" : "oca-g4.faden.me", 24 | "productIds" : [ "Site_Accel" ], 25 | "createdDate" : "2017-06-15T17:30:08Z" 26 | }, { 27 | "cpcodeId" : "699595", 28 | "cpcodeName" : "www42517.xmarkvh.com", 29 | "productIds" : [ "Site_Accel" ], 30 | "createdDate" : "2018-04-25T16:14:03Z" 31 | } ] 32 | } 33 | } -------------------------------------------------------------------------------- /tests/pull-snippets.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "testing-snippets-pull.com", 4 | "cnameTo": "testing-snippets-pull.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": 3248236, 7 | "certProvisioningType": "CPS_MANAGED" 8 | }, 9 | { 10 | "cnameFrom": "testing-snippets.com", 11 | "cnameTo": "testing-snippets.edgesuite.net", 12 | "cnameType": "EDGE_HOSTNAME", 13 | "edgeHostnameId": 3216762, 14 | "certProvisioningType": "DEFAULT", 15 | "certStatus": { 16 | "validationCname": { 17 | "hostname": "_acme-challenge.www.example.com", 18 | "target": "{token}.www.example.com.akamai-domain.com" 19 | }, 20 | "staging": [ 21 | { 22 | "status": "NEEDS_VALIDATION" 23 | } 24 | ], 25 | "production": [ 26 | { 27 | "status": "NEEDS_VALIDATION" 28 | } 29 | ] 30 | } 31 | } 32 | ] -------------------------------------------------------------------------------- /tests/testdata/checkPromotions.wait.zone.delayed.output.txt: -------------------------------------------------------------------------------- 1 | ...activation status is NEW... 2 | ...Waiting for active status... 3 | ...Checking promotions... 4 | ...activation status is PENDING... 5 | ...Waiting for active status... 6 | ...Checking promotions... 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is ZONE_1... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | ...activation status is ZONE_2... 14 | ...Waiting for active status... 15 | ...Checking promotions... 16 | ...activation status is ZONE_3... 17 | ...Waiting for active status... 18 | ...Checking promotions... 19 | Activation status report: 20 | ╒═════════════╤════════════╤═══════════════╤════════╕ 21 | │"Environment"│"Network" │"Activation Id"│"Status"│ 22 | ╞═════════════╪════════════╪═══════════════╪════════╡ 23 | │"qa" │"PRODUCTION"│"5355534" │"ACTIVE"│ 24 | ├─────────────┼────────────┼───────────────┼────────┤ 25 | │"qa" │"STAGING" │"5355810" │"ACTIVE"│ 26 | └─────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/project_tests_custom_name.data.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "mkdir", 4 | "homeSweetHome/Foobar" 5 | ], 6 | [ 7 | "mkdir", 8 | "homeSweetHome/Foobar/cache" 9 | ], 10 | [ 11 | "mkdir", 12 | "homeSweetHome/Foobar/dist" 13 | ], 14 | [ 15 | "mkdir", 16 | "homeSweetHome/Foobar/environments" 17 | ], 18 | [ 19 | "mkdir", 20 | "homeSweetHome/Foobar/templates" 21 | ], 22 | [ 23 | "writeJsonFile", 24 | "homeSweetHome/Foobar/projectInfo.json", 25 | { 26 | "productId": "WAA", 27 | "contractId": "ABF543", 28 | "customPropertyName": true, 29 | "groupIds": [ 30 | 76342 31 | ], 32 | "environments": [ 33 | "foo", 34 | "bar", 35 | "prod" 36 | ], 37 | "version": "0.1.11", 38 | "isSecure": false, 39 | "name": "Foobar" 40 | } 41 | ], 42 | [ 43 | "mkdir", 44 | "homeSweetHome/Foobar/environments/foo" 45 | ], 46 | [ 47 | "mkdir", 48 | "homeSweetHome/Foobar/environments/bar" 49 | ], 50 | [ 51 | "mkdir", 52 | "homeSweetHome/Foobar/environments/prod" 53 | ] 54 | ] -------------------------------------------------------------------------------- /tests/testdata/ruletreeError.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules" : { 3 | "name" : "default", 4 | "children" : [ ], 5 | "behaviors" : [ { 6 | "name" : "originCharacteristics", 7 | "options" : { 8 | "authenticationMethod" : "AUTOMATIC", 9 | "country" : "UNKNOWN" 10 | } 11 | }, { 12 | "name" : "contentCharacteristicsDD", 13 | "options" : { 14 | "catalogSize" : "UNKNOWN", 15 | "contentType" : "UNKNOWN", 16 | "objectSize" : "UNKNOWN", 17 | "optimizeOption" : false, 18 | "popularityDistribution" : "UNKNOWN" 19 | } 20 | }, { 21 | "name" : "clientCharacteristics", 22 | "options" : { 23 | "country" : "UNKNOWN" 24 | } 25 | }, { 26 | "name" : "origin", 27 | "options" : { 28 | "originType" : "NET_STORAGE" 29 | } 30 | }, { 31 | "name" : "cpCode", 32 | "options" : { } 33 | }, { 34 | "name" : "cacheKeyQueryParams", 35 | "options" : { 36 | "behavior" : "IGNORE_ALL" 37 | } 38 | } ], 39 | "options" : { 40 | "is_secure" : false 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /tests/testdata/snippets.checkActivations.wait.zone.delayed.output.txt: -------------------------------------------------------------------------------- 1 | ...activation status is NEW... 2 | ...Waiting for active status... 3 | ...Checking activations... 4 | ...activation status is PENDING... 5 | ...Waiting for active status... 6 | ...Checking activations... 7 | ...activation status is PENDING... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is ZONE_1... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | ...activation status is ZONE_2... 14 | ...Waiting for active status... 15 | ...Checking activations... 16 | ...activation status is ZONE_3... 17 | ...Waiting for active status... 18 | ...Checking activations... 19 | Activation status report: 20 | ╒══════════════════╤════════════╤═══════════════╤════════╕ 21 | │"Property" │"Network" │"Activation Id"│"Status"│ 22 | ╞══════════════════╪════════════╪═══════════════╪════════╡ 23 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ACTIVE"│ 24 | ├──────────────────┼────────────┼───────────────┼────────┤ 25 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE"│ 26 | └──────────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/pull-snippets.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "propertyName": "pull-snippets.com", 3 | "propertyId": 411089, 4 | "isSecure": false, 5 | "latestVersionInfo": { 6 | "propertyVersion":9, 7 | "updatedByUser": "z35aszfk53n362pc", 8 | "updatedDate": "2018-09-27T18:30:45Z", 9 | "productionStatus": "INACTIVE", 10 | "stagingStatus": "INACTIVE", 11 | "productId": "Web_App_Accel", 12 | "ruleFormat": "v2018-02-27" 13 | }, 14 | "activeIn_PRODUCTION_Info": { 15 | "productId": "Web_App_Accel", 16 | "productionStatus": "ACTIVE", 17 | "propertyVersion": 2, 18 | "ruleFormat": "v2018-02-27", 19 | "stagingStatus": "INACTIVE", 20 | "updatedByUser": "z35aszfk53n362pc", 21 | "updatedDate": "2018-09-27T18:30:45Z" 22 | }, 23 | "activeIn_STAGING_Info": { 24 | "productId": "Web_App_Accel", 25 | "productionStatus": "INACTIVE", 26 | "propertyVersion": 4, 27 | "ruleFormat": "v2018-02-27", 28 | "stagingStatus": "ACTIVE", 29 | "updatedByUser": "z35aszfk53n362pc", 30 | "updatedDate": "2018-09-27T18:30:45Z" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/testdata/papi_errors/locked.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "https://problems.luna.akamaiapis.net/papi/v0/property-version/lock-error", 3 | "title": "Unable to edit read-only element", 4 | "status": 403, 5 | "detail": "Only Akamai representatives can change read-only behaviors, criteria and child rules.", 6 | "instance": "https://akaa-575u5pwzrgn7x2kx-kcqanlogvq2ynqja.luna-dev.akamaiapis.net/papi/v0/properties/466833/versions/1/rules#77fadc4d-7c69-4f7c-b3fb-d2ea2440c954", 7 | "errors": [ 8 | { 9 | "added": [ 10 | { 11 | "behavior": { 12 | "name": "cpCode", 13 | "options": { 14 | "value": { 15 | "id": 12345 16 | } 17 | }, 18 | "uuid": "dead9bb7-1aab-43f0-8fd1-82b5c5476d9f", 19 | "locked": true 20 | }, 21 | "location": "#/rules/behaviors/1" 22 | } 23 | ], 24 | "type": "https://problems.luna.akamaiapis.net/papi/v0/property-version/lock-error/behaviors-changed", 25 | "title": "Read-only behaviors changed", 26 | "detail": "Read-only behaviors have been added, removed, changed or moved." 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /tests/pull-snippets-uservar.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "propertyName": "pull-snippets-uservar.com", 3 | "propertyId": 411089, 4 | "isSecure": false, 5 | "latestVersionInfo": { 6 | "propertyVersion":9, 7 | "updatedByUser": "z35aszfk53n362pc", 8 | "updatedDate": "2018-09-27T18:30:45Z", 9 | "productionStatus": "INACTIVE", 10 | "stagingStatus": "INACTIVE", 11 | "productId": "Web_App_Accel", 12 | "ruleFormat": "v2018-02-27" 13 | }, 14 | "activeIn_PRODUCTION_Info": { 15 | "productId": "Web_App_Accel", 16 | "productionStatus": "ACTIVE", 17 | "propertyVersion": 2, 18 | "ruleFormat": "v2018-02-27", 19 | "stagingStatus": "INACTIVE", 20 | "updatedByUser": "z35aszfk53n362pc", 21 | "updatedDate": "2018-09-27T18:30:45Z" 22 | }, 23 | "activeIn_STAGING_Info": { 24 | "productId": "Web_App_Accel", 25 | "productionStatus": "INACTIVE", 26 | "propertyVersion": 4, 27 | "ruleFormat": "v2018-02-27", 28 | "stagingStatus": "ACTIVE", 29 | "updatedByUser": "z35aszfk53n362pc", 30 | "updatedDate": "2018-09-27T18:30:45Z" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/testdata/papi_errors/added.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "https://problems.luna.akamaiapis.net/papi/v0/property-version/lock-error", 3 | "title": "Unable to edit read-only element", 4 | "status": 403, 5 | "detail": "Only Akamai representatives can change read-only behaviors, criteria and child rules.", 6 | "instance": "https://akaa-575u5pwzrgn7x2kx-kcqanlogvq2ynqja.luna-dev.akamaiapis.net/papi/v0/properties/466833/versions/1/rules#6df0413d-0d3c-4e95-8b6e-52adb83ec20f", 7 | "errors": [ 8 | { 9 | "added": [ 10 | { 11 | "behavior": { 12 | "name": "advanced", 13 | "options": { 14 | "description": "advanced", 15 | "xml": "onOn" 16 | }, 17 | "uuid": "7d6ef02b-a1be-489f-a42f-b6e19ef0d63e" 18 | }, 19 | "location": "#/rules/behaviors/6" 20 | } 21 | ], 22 | "type": "https://problems.luna.akamaiapis.net/papi/v0/property-version/lock-error/behaviors-changed", 23 | "title": "Read-only behaviors changed", 24 | "detail": "Read-only behaviors have been added, removed, changed or moved." 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /tests/testdata/listStatus.output.txt: -------------------------------------------------------------------------------- 1 | ╒════════════════════╤════════════════════╤═════════════════════════╤══════════════════════╕ 2 | │"Environment Name" │"qa" │"staging" │"prod" │ 3 | ╞════════════════════╪════════════════════╪═════════════════════════╪══════════════════════╡ 4 | │"Property Name" │"qa.testproject.com"│"staging.testproject.com"│"prod.testproject.com"│ 5 | ├────────────────────┼────────────────────┼─────────────────────────┼──────────────────────┤ 6 | │"Latest Version" │1 │1 │1 │ 7 | ├────────────────────┼────────────────────┼─────────────────────────┼──────────────────────┤ 8 | │"Production Version"│"N/A" │"N/A" │"N/A" │ 9 | ├────────────────────┼────────────────────┼─────────────────────────┼──────────────────────┤ 10 | │"Staging Version" │"N/A" │"N/A" │"N/A" │ 11 | ├────────────────────┼────────────────────┼─────────────────────────┼──────────────────────┤ 12 | │"Rule Format" │"latest" │"latest" │"latest" │ 13 | └────────────────────┴────────────────────┴─────────────────────────┴──────────────────────┘ -------------------------------------------------------------------------------- /tests/project_tests.data.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "mkdir", 4 | "homeSweetHome/Foobar" 5 | ], 6 | [ 7 | "mkdir", 8 | "homeSweetHome/Foobar/cache" 9 | ], 10 | [ 11 | "mkdir", 12 | "homeSweetHome/Foobar/dist" 13 | ], 14 | [ 15 | "mkdir", 16 | "homeSweetHome/Foobar/environments" 17 | ], 18 | [ 19 | "mkdir", 20 | "homeSweetHome/Foobar/templates" 21 | ], 22 | [ 23 | "writeJsonFile", 24 | "homeSweetHome/Foobar/projectInfo.json", 25 | { 26 | "productId": "WAA", 27 | "contractId": "ABF543", 28 | "groupIds": [ 29 | 76342 30 | ], 31 | "environments": [ 32 | "qa", 33 | "staging", 34 | "production" 35 | ], 36 | "version": "0.1.11", 37 | "isSecure": false, 38 | "name": "Foobar" 39 | } 40 | ], 41 | [ 42 | "mkdir", 43 | "homeSweetHome/Foobar/environments/qa" 44 | ], 45 | [ 46 | "mkdir", 47 | "homeSweetHome/Foobar/environments/staging" 48 | ], 49 | [ 50 | "mkdir", 51 | "homeSweetHome/Foobar/environments/production" 52 | ] 53 | ] -------------------------------------------------------------------------------- /tests/pull-snippets-pending.com/envInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "propertyName": "pull-snippets.com", 3 | "propertyId": 411089, 4 | "isSecure": false, 5 | "latestVersionInfo": { 6 | "propertyVersion":9, 7 | "updatedByUser": "z35aszfk53n362pc", 8 | "updatedDate": "2018-09-27T18:30:45Z", 9 | "productionStatus": "PENDING", 10 | "stagingStatus": "PENDING", 11 | "productId": "Web_App_Accel", 12 | "ruleFormat": "v2018-02-27" 13 | }, 14 | "activeIn_PRODUCTION_Info": { 15 | "productId": "Web_App_Accel", 16 | "productionStatus": "ACTIVE", 17 | "propertyVersion": 2, 18 | "ruleFormat": "v2018-02-27", 19 | "stagingStatus": "INACTIVE", 20 | "updatedByUser": "z35aszfk53n362pc", 21 | "updatedDate": "2018-09-27T18:30:45Z" 22 | }, 23 | "activeIn_STAGING_Info": { 24 | "productId": "Web_App_Accel", 25 | "productionStatus": "INACTIVE", 26 | "propertyVersion": 4, 27 | "ruleFormat": "v2018-02-27", 28 | "stagingStatus": "ACTIVE", 29 | "updatedByUser": "z35aszfk53n362pc", 30 | "updatedDate": "2018-09-27T18:30:45Z" 31 | }, 32 | "pendingActivations": { 33 | "STAGING": 6405830, 34 | "PRODUCTION": 6405831 35 | } 36 | } -------------------------------------------------------------------------------- /tests/testdata/propertyHostnamesList.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountId" : "act_1-599K", 3 | "contractId" : "ctr_1-3CV382", 4 | "groupId" : "grp_18385", 5 | "propertyId" : "prp_609774", 6 | "propertyName" : "dev.pipeline.com", 7 | "propertyVersion" : 1, 8 | "etag" : "50d2e771d4cf4c6e5daaf42fc8e665208b66273e", 9 | "hostnames" : { 10 | "items" : [ { 11 | "cnameType" : "EDGE_HOSTNAME", 12 | "edgeHostnameId" : "ehn_4363836", 13 | "cnameFrom" : "dev.pipeline.com", 14 | "cnameTo" : "dev.pipeline.com.edgesuite.net", 15 | "certProvisioningType": "DEFAULT", 16 | "certStatus": { 17 | "validationCname": { 18 | "hostname": "_acme-challenge.www.example.com", 19 | "target": "{token}.www.example.com.akamai-domain.com" 20 | }, 21 | "staging": [ 22 | { 23 | "status": "NEEDS_VALIDATION" 24 | } 25 | ], 26 | "production": [ 27 | { 28 | "status": "NEEDS_VALIDATION" 29 | } 30 | ] 31 | } 32 | }, 33 | { 34 | "cnameType" : "EDGE_HOSTNAME", 35 | "edgeHostnameId" : "ehn_4363836", 36 | "cnameFrom" : "dev1.pipeline.com", 37 | "cnameTo" : "dev1.pipeline.com.edgesuite.net", 38 | "certProvisioningType": "CPS_MANAGED" 39 | }] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /resources/expression_parser.pegjs: -------------------------------------------------------------------------------- 1 | { 2 | const errors = require("./errors"); 3 | var context; 4 | } 5 | 6 | start = items:( expression / regular_text )+ { 7 | if (items.length > 1) { 8 | return items.join('') 9 | } else if (items.length === 1) { 10 | return items[0] 11 | } else { 12 | return ""; 13 | } 14 | } 15 | 16 | regular_text = text:regular_text_item+ { 17 | return text.join(''); 18 | } 19 | 20 | regular_text_item = item:(!start_exp (start_esc_exp / .) ) { return item[1]; } 21 | 22 | start_esc_exp = "\\" start_exp:start_exp { return start_exp; } 23 | 24 | expression = start:start_exp exp:var_exp end:end_exp {return context.finalValue();} 25 | 26 | start_exp = '${' 27 | 28 | var_exp = dotless_exp (access_exp)* {return context;} 29 | 30 | end_exp = '}' 31 | 32 | dotless_exp = name:var_name { context = options.context.get(name); return context; } 33 | 34 | access_exp = dot_exp / bracket_exp {return context;} 35 | 36 | dot_exp = '.' name:var_name { 37 | context = context.get(name); 38 | return context; 39 | } 40 | 41 | bracket_exp = '[' number:number ']' { 42 | context = context.get(number); 43 | return context; 44 | } 45 | 46 | number = digits:[0-9]* { return digits.join(''); } 47 | 48 | var_name = start:[a-zA-Z_] letters:[a-zA-Z0-9_]* { return start + letters.join(''); } -------------------------------------------------------------------------------- /tests/snippets.hostnameTests.com/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "qa.testproject.com", 4 | "cnameTo": "qa.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | }, 8 | { 9 | "cnameFrom": "qa.secureTestproject.com", 10 | "cnameTo": "qa.testproject.com.edgekey.net", 11 | "cnameType": "EDGE_HOSTNAME", 12 | "certEnrollmentId" : 123456, 13 | "edgeHostnameId": null 14 | }, 15 | { 16 | "cnameFrom": "qa.securesite.com", 17 | "cnameTo": "qa.securesite.com.edgekey.net", 18 | "cnameType": "EDGE_HOSTNAME", 19 | "edgeHostnameId": null 20 | }, 21 | { 22 | "cnameFrom": "qa.customEdgeHostname.com", 23 | "cnameTo": "qa.testproject.com.customEdgeHostname.net", 24 | "cnameType": "EDGE_HOSTNAME", 25 | "edgeHostnameId": null 26 | }, 27 | { 28 | "cnameFrom": "qa.testprojectnull.com", 29 | "cnameTo": null, 30 | "cnameType": "EDGE_HOSTNAME", 31 | "edgeHostnameId": null 32 | },{ 33 | "cnameFrom": "qa.securesiteNoCreate.com", 34 | "cnameTo": "qa.noCertEnrollmentId.com.edgekey.net", 35 | "cnameType": "EDGE_HOSTNAME", 36 | "edgeHostnameId": null 37 | }, 38 | { 39 | "cnameFrom": "wontCreateBecauseHasId", 40 | "cnameTo": "wontCreateBecauseHasId.info.edgekey.net", 41 | "edgeHostnameId": "2951" 42 | } 43 | ] -------------------------------------------------------------------------------- /tests/hostnameTests.com/environments/qa/hostnames.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cnameFrom": "qa.testproject.com", 4 | "cnameTo": "qa.testproject.com.edgesuite.net", 5 | "cnameType": "EDGE_HOSTNAME", 6 | "edgeHostnameId": null 7 | }, 8 | { 9 | "cnameFrom": "qa.secureTestproject.com", 10 | "cnameTo": "qa.testproject.com.edgekey.net", 11 | "cnameType": "EDGE_HOSTNAME", 12 | "certEnrollmentId" : 123456, 13 | "edgeHostnameId": null 14 | }, 15 | { 16 | "cnameFrom": "qa.securesite.com", 17 | "cnameTo": "qa.securesite.com.edgekey.net", 18 | "cnameType": "EDGE_HOSTNAME", 19 | "edgeHostnameId": null 20 | }, 21 | { 22 | "cnameFrom": "qa.customEdgeHostname.com", 23 | "cnameTo": "qa.testproject.com.customEdgeHostname.net", 24 | "cnameType": "EDGE_HOSTNAME", 25 | "edgeHostnameId": null 26 | }, 27 | { 28 | "cnameFrom": "qa.testprojectnull.com", 29 | "cnameTo": null, 30 | "cnameType": "EDGE_HOSTNAME", 31 | "edgeHostnameId": null 32 | },{ 33 | "cnameFrom": "qa.securesiteNoCreate.com", 34 | "cnameTo": "qa.noCertEnrollmentId.com.edgekey.net", 35 | "cnameType": "EDGE_HOSTNAME", 36 | "edgeHostnameId": null 37 | }, 38 | { 39 | "cnameFrom": "wontCreateBecauseHasId", 40 | "cnameTo": "wontCreateBecauseHasId.info.edgekey.net", 41 | "edgeHostnameId": "2951" 42 | } 43 | ] -------------------------------------------------------------------------------- /tests/testdata/promote.wait.zone.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒═════════════╤═════════╤═══════════════╕ 3 | │"Environment"│"Network"│"Activation Id"│ 4 | ╞═════════════╪═════════╪═══════════════╡ 5 | │"qa" │"STAGING"│5355534 │ 6 | └─────────────┴─────────┴───────────────┘ 7 | ...activation status is NEW... 8 | ...Waiting for active status... 9 | ...Checking promotions... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking promotions... 13 | ...activation status is PENDING... 14 | ...Waiting for active status... 15 | ...Checking promotions... 16 | ...activation status is ZONE_1... 17 | ...Waiting for active status... 18 | ...Checking promotions... 19 | ...activation status is ZONE_2... 20 | ...Waiting for active status... 21 | ...Checking promotions... 22 | ...activation status is ZONE_3... 23 | ...Waiting for active status... 24 | ...Checking promotions... 25 | Activation status report: 26 | ╒═════════════╤════════════╤═══════════════╤════════╕ 27 | │"Environment"│"Network" │"Activation Id"│"Status"│ 28 | ╞═════════════╪════════════╪═══════════════╪════════╡ 29 | │"qa" │"PRODUCTION"│"5355534" │"ACTIVE"│ 30 | ├─────────────┼────────────┼───────────────┼────────┤ 31 | │"qa" │"STAGING" │"5355810" │"ACTIVE"│ 32 | └─────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/snippets.activate.wait.zone.output.txt: -------------------------------------------------------------------------------- 1 | Following activations are now pending: 2 | ╒══════════════════╤═════════╤═══════════════╕ 3 | │"Property" │"Network"│"Activation Id"│ 4 | ╞══════════════════╪═════════╪═══════════════╡ 5 | │"new.snippets.com"│"STAGING"│5355534 │ 6 | └──────────────────┴─────────┴───────────────┘ 7 | ...activation status is NEW... 8 | ...Waiting for active status... 9 | ...Checking activations... 10 | ...activation status is PENDING... 11 | ...Waiting for active status... 12 | ...Checking activations... 13 | ...activation status is PENDING... 14 | ...Waiting for active status... 15 | ...Checking activations... 16 | ...activation status is ZONE_1... 17 | ...Waiting for active status... 18 | ...Checking activations... 19 | ...activation status is ZONE_2... 20 | ...Waiting for active status... 21 | ...Checking activations... 22 | ...activation status is ZONE_3... 23 | ...Waiting for active status... 24 | ...Checking activations... 25 | Activation status report: 26 | ╒══════════════════╤════════════╤═══════════════╤════════╕ 27 | │"Property" │"Network" │"Activation Id"│"Status"│ 28 | ╞══════════════════╪════════════╪═══════════════╪════════╡ 29 | │"new.snippets.com"│"PRODUCTION"│"5355534" │"ACTIVE"│ 30 | ├──────────────────┼────────────┼───────────────┼────────┤ 31 | │"new.snippets.com"│"STAGING" │"5355810" │"ACTIVE"│ 32 | └──────────────────┴────────────┴───────────────┴────────┘ -------------------------------------------------------------------------------- /tests/testdata/papi_errors/added_criteria.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "https://problems.luna.akamaiapis.net/papi/v0/property-version/lock-error", 3 | "title": "Unable to edit read-only element", 4 | "status": 403, 5 | "detail": "Only Akamai representatives can change read-only behaviors, criteria and child rules.", 6 | "instance": "https://akaa-575u5pwzrgn7x2kx-kcqanlogvq2ynqja.luna-dev.akamaiapis.net/papi/v0/properties/466305/versions/1/rules#d5364e98-1bf4-4977-9c3b-a553e2a662c8", 7 | "errors": [ 8 | { 9 | "added": [ 10 | { 11 | "match": { 12 | "name": "responseHeader", 13 | "options": { 14 | "headerName": "Content-Type", 15 | "matchWildcardName": false, 16 | "matchOperator": "IS_ONE_OF", 17 | "values": [ 18 | "text/html*" 19 | ], 20 | "matchCaseSensitiveValue": false, 21 | "matchWildcardValue": true 22 | }, 23 | "uuid": "22e76155-007f-4ff5-a1ba-045ff7e0f8cd", 24 | "locked": true 25 | }, 26 | "location": "#/rules/children/2/criteria/0" 27 | } 28 | ], 29 | "type": "https://problems.luna.akamaiapis.net/papi/v0/property-version/lock-error/criteria-changed", 30 | "title": "Read-only criteria changed", 31 | "detail": "Read-only criteria have been added, removed, changed or moved." 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /tests/overlay-utils.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020. Akamai Technologies, Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | 17 | 18 | const createOverlayUtils = function(baseUtils, callback, classOnly = false) { 19 | class OverlayUtils extends baseUtils { 20 | readJsonFile(path) { 21 | return callback(path, super.readJsonFile(path), "read"); 22 | } 23 | writeJsonFile(path, data) { 24 | data = callback(path, data, "write"); 25 | if (data) { 26 | super.writeJsonFile(path, data); 27 | } 28 | } 29 | fileExists(path) { 30 | return callback(path, super.fileExists(path), "exists"); 31 | } 32 | } 33 | if (classOnly) { 34 | return OverlayUtils; 35 | } else { 36 | return new OverlayUtils(); 37 | } 38 | }; 39 | 40 | module.exports = createOverlayUtils; -------------------------------------------------------------------------------- /tests/pegjs_tests.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020. Akamai Technologies, Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | const peg = require("pegjs"); 17 | 18 | const chai = require('chai'); 19 | const assert = chai.assert; 20 | 21 | describe('Simple pegjs test', function () { 22 | let parser; 23 | before(function () { 24 | parser = peg.generate("start = letters:('a' / 'b')+ {return options.prefix + letters.join('');}"); 25 | }); 26 | 27 | it('Parse test success', function () { 28 | let result = parser.parse("abaabbbaaa", options = { 29 | prefix: "blah" 30 | }); 31 | assert.equal(result, "blahabaabbbaaa"); 32 | }); 33 | 34 | it('Parse test with failure', function () { 35 | assert.throws(function() { 36 | let result = parser.parse("abaabcbaaa", options = { 37 | prefix: "blah" 38 | }); 39 | }, 'Expected "a", "b", or end of input but "c" found.'); 40 | }); 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /tests/testproject.com/templates/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/factory_tests.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020. Akamai Technologies, Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | const td = require('testdouble'); 17 | const chai = require('chai'); 18 | const assert = chai.assert; 19 | 20 | const logger = require("../src/logging") 21 | .createLogger("devops-prov.el_tests"); 22 | 23 | const createDevOps = require("../src/factory"); 24 | 25 | describe('Factory tests', function () { 26 | let devops; 27 | let papiCount = 0; 28 | 29 | class TestPAPI { 30 | constructor(openClient) { 31 | this.openClient = openClient; 32 | papiCount++; 33 | } 34 | } 35 | 36 | before(function () { 37 | devops = createDevOps({ 38 | papiClass: TestPAPI, 39 | devopsHome: __dirname 40 | }) 41 | }); 42 | 43 | it('Test stuff', function () { 44 | let qaEnv = devops.getDefaultProject().getEnvironment("qa"); 45 | let papi = qaEnv.getPAPI(); 46 | papi = qaEnv.getPAPI(); 47 | assert.equal(papiCount, 1, "we should create PAPI only once!"); 48 | }); 49 | }); -------------------------------------------------------------------------------- /tests/new.associate.com/templates/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/new.customname.com/templates/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/new.testproject.com/templates/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/testproject-novar.com/templates/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/import.snippets.com/config-snippets/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/merger.snippets.com/config-snippets/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/new.snippets.com/config-snippets/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/pull-snippets.com/config-snippets/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/snippets-uservar.com/config-snippets/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/testdata/updatePropertyHostnamesOutput.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountId": "act_1-599K", 3 | "contractId": "ctr_1-3CV382", 4 | "groupId": "grp_18385", 5 | "propertyId": "prp_609774", 6 | "propertyName": "dev.pipeline.com", 7 | "propertyVersion": 1, 8 | "etag": "50d2e771d4cf4c6e5daaf42fc8e665208b66273e", 9 | "hostnames": { 10 | "items": [ 11 | { 12 | "cnameType": "EDGE_HOSTNAME", 13 | "edgeHostnameId": "ehn_4363836", 14 | "cnameFrom": "dev.pipeline.com", 15 | "cnameTo": "dev.pipeline.com.edgesuite.net", 16 | "certProvisioningType": "DEFAULT", 17 | "certStatus": { 18 | "validationCname": { 19 | "hostname": "_acme-challenge.www.example.com", 20 | "target": "{token}.www.example.com.akamai-domain.com" 21 | }, 22 | "staging": [ 23 | { 24 | "status": "NEEDS_VALIDATION" 25 | } 26 | ], 27 | "production": [ 28 | { 29 | "status": "NEEDS_VALIDATION" 30 | } 31 | ] 32 | } 33 | }, 34 | { 35 | "cnameType": "EDGE_HOSTNAME", 36 | "edgeHostnameId": "ehn_4363836", 37 | "cnameFrom": "dev1.pipeline.com", 38 | "cnameTo": "dev1.pipeline.com.edgesuite.net", 39 | "certProvisioningType": "CPS_MANAGED" 40 | } 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /tests/testproject-hostnames.com/templates/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/testproject-uservar.com/templates/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } -------------------------------------------------------------------------------- /tests/pull-snippets-pending.com/config-snippets/compression.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Content Compression", 3 | "children": [], 4 | "behaviors": [ 5 | { 6 | "name": "gzipResponse", 7 | "options": { 8 | "behavior": "ALWAYS" 9 | } 10 | } 11 | ], 12 | "criteria": [ 13 | { 14 | "name": "contentType", 15 | "options": { 16 | "matchCaseSensitive": false, 17 | "matchOperator": "IS_ONE_OF", 18 | "matchWildcard": true, 19 | "values": [ 20 | "text/*", 21 | "application/javascript", 22 | "application/x-javascript", 23 | "application/x-javascript*", 24 | "application/json", 25 | "application/x-json", 26 | "application/*+json", 27 | "application/*+xml", 28 | "application/text", 29 | "application/vnd.microsoft.icon", 30 | "application/vnd-ms-fontobject", 31 | "application/x-font-ttf", 32 | "application/x-font-opentype", 33 | "application/x-font-truetype", 34 | "application/xmlfont/eot", 35 | "application/xml", 36 | "font/opentype", 37 | "font/otf", 38 | "font/eot", 39 | "image/svg+xml", 40 | "image/vnd.microsoft.icon" 41 | ] 42 | } 43 | } 44 | ], 45 | "criteriaMustSatisfy": "all" 46 | } --------------------------------------------------------------------------------