-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from akamai/release/3.0.0
Release/3.0.0 --> Master
- Loading branch information
Showing
16 changed files
with
511 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
bin/commands/contentprotectionjavascriptinjectionrule.create.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
let ContentProtectionJavaScriptInjectionRule = require('../../src/contentprotectionjavascriptinjectionrule') | ||
.contentProtectionJavaScriptInjectionRule; | ||
let out = require('./lib/out'); | ||
|
||
class CreateContentProtectionJavaScriptInjectionRuleCommand { | ||
constructor() { | ||
this.flags = 'create-content-protection-javascript-injection-rule'; | ||
this.desc = 'Create a content protection javascript injection rule.'; | ||
this.setup = this.setup.bind(this); | ||
this.run = this.run.bind(this); | ||
} | ||
|
||
setup(sywac) { | ||
sywac | ||
.positional('<@path>', { | ||
paramsDesc: 'The input file path.' | ||
}) | ||
.number('--config <id>', { | ||
desc: 'Configuration ID. Mandatory if you have more than one configuration.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--version <id>', { | ||
desc: | ||
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.", | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--policy <id>', { | ||
desc: | ||
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.check((argv, context) => { | ||
if (!argv['@path'].startsWith('@')) { | ||
return context.cliMessage("ERROR: Invalid file name, should start with '@'"); | ||
} | ||
}); | ||
} | ||
|
||
run(options) { | ||
options.file = options['@path'].replace('@', ''); | ||
|
||
out.print({ | ||
promise: new ContentProtectionJavaScriptInjectionRule( | ||
options | ||
).addContentProtectionJavaScriptInjectionRule(), | ||
args: options, | ||
success: (args, data) => { | ||
return JSON.stringify(data); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
module.exports = new CreateContentProtectionJavaScriptInjectionRuleCommand(); |
52 changes: 52 additions & 0 deletions
52
bin/commands/contentprotectionjavascriptinjectionrule.delete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
let ContentProtectionJavaScriptInjectionRule = require('../../src/contentprotectionjavascriptinjectionrule') | ||
.contentProtectionJavaScriptInjectionRule; | ||
let out = require('./lib/out'); | ||
|
||
class DeleteContentProtectionJavaScriptInjectionRuleCommand { | ||
constructor() { | ||
this.flags = 'delete-content-protection-javascript-injection-rule'; | ||
this.desc = 'Delete a content protection JavaScript injection rule.'; | ||
this.setup = this.setup.bind(this); | ||
this.run = this.run.bind(this); | ||
} | ||
|
||
setup(sywac) { | ||
sywac | ||
.positional('<content-protection-javascript-injection-rule-id>', { | ||
paramsDesc: 'Content protection JavaScript injection rule ID' | ||
}) | ||
.number('--config <id>', { | ||
desc: 'Configuration ID. Mandatory if you have more than one configuration.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--version <id>', { | ||
desc: | ||
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.", | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--policy <id>', { | ||
desc: | ||
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.', | ||
group: 'Optional:', | ||
required: false | ||
}); | ||
} | ||
|
||
run(options) { | ||
options.rule_id = options['content-protection-javascript-injection-rule-id']; | ||
|
||
out.print({ | ||
promise: new ContentProtectionJavaScriptInjectionRule( | ||
options | ||
).deleteContentProtectionJavaScriptInjectionRule(), | ||
args: options, | ||
success: (args, data) => { | ||
return data; | ||
} | ||
}); | ||
} | ||
} | ||
|
||
module.exports = new DeleteContentProtectionJavaScriptInjectionRuleCommand(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
let ContentProtectionJavaScriptInjectionRule = require('../../src/contentprotectionjavascriptinjectionrule') | ||
.contentProtectionJavaScriptInjectionRule; | ||
let out = require('./lib/out'); | ||
|
||
class ContentProtectionJavaScriptInjectionRuleCommand { | ||
constructor() { | ||
this.flags = 'content-protection-javascript-injection-rule'; | ||
this.desc = 'Display contents of content protection javascript injection rule.'; | ||
this.setup = this.setup.bind(this); | ||
this.run = this.run.bind(this); | ||
} | ||
|
||
setup(sywac) { | ||
sywac | ||
.positional('<content-protection-javascript-injection-rule-id>', { | ||
paramsDesc: 'Content protection JavaScript injection rule ID' | ||
}) | ||
.number('--config <id>', { | ||
desc: 'Configuration ID. Mandatory if you have more than one configuration.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--version <id>', { | ||
desc: | ||
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.", | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--policy <id>', { | ||
desc: | ||
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.', | ||
group: 'Optional:', | ||
required: false | ||
}); | ||
} | ||
|
||
run(options) { | ||
options.rule_id = options['content-protection-javascript-injection-rule-id']; | ||
|
||
out.print({ | ||
promise: new ContentProtectionJavaScriptInjectionRule( | ||
options | ||
).getContentProtectionJavaScriptInjectionRule(), | ||
args: options, | ||
success: (args, data) => { | ||
return JSON.stringify(data); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
module.exports = new ContentProtectionJavaScriptInjectionRuleCommand(); |
61 changes: 61 additions & 0 deletions
61
bin/commands/contentprotectionjavascriptinjectionrule.modify.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
let ContentProtectionJavaScriptInjectionRule = require('../../src/contentprotectionjavascriptinjectionrule') | ||
.contentProtectionJavaScriptInjectionRule; | ||
let out = require('./lib/out'); | ||
|
||
class ModifyContentProtectionJavaScriptInjectionRulesCommand { | ||
constructor() { | ||
this.flags = 'modify-content-protection-javascript-injection-rule'; | ||
this.desc = 'Update content protection JavaScript injection rule.'; | ||
this.setup = this.setup.bind(this); | ||
this.run = this.run.bind(this); | ||
} | ||
|
||
setup(sywac) { | ||
sywac | ||
.positional('<content-protection-javascript-injection-rule-id>', { | ||
paramsDesc: 'Content protection JavaScript injection rule ID' | ||
}) | ||
.positional('<@path>', { | ||
paramsDesc: 'The input file path.' | ||
}) | ||
.number('--config <id>', { | ||
desc: 'Configuration ID. Mandatory if you have more than one configuration.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--version <id>', { | ||
desc: | ||
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.", | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--policy <id>', { | ||
desc: | ||
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.check((argv, context) => { | ||
if (!argv['@path'].startsWith('@')) { | ||
return context.cliMessage("ERROR: Invalid file name, should start with '@'"); | ||
} | ||
}); | ||
} | ||
|
||
run(options) { | ||
options.rule_id = options['content-protection-javascript-injection-rule-id']; | ||
options.file = options['@path'].replace('@', ''); | ||
|
||
out.print({ | ||
promise: new ContentProtectionJavaScriptInjectionRule( | ||
options | ||
).updateContentProtectionJavaScriptInjectionRule(), | ||
args: options, | ||
success: (args, data) => { | ||
return JSON.stringify(data); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
module.exports = new ModifyContentProtectionJavaScriptInjectionRulesCommand(); |
Oops, something went wrong.