@adobe/reactor-sdk
Version:
JavaScript SDK for the Reactor API
110 lines (85 loc) • 3.55 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createRule = createRule;
exports.deleteRule = deleteRule;
exports.getRule = getRule;
exports.getPropertyForRule = getPropertyForRule;
exports.listLibrariesForRule = listLibrariesForRule;
exports.listRulesForBuild = listRulesForBuild;
exports.listRulesForProperty = listRulesForProperty;
exports.listRevisionsForRule = listRevisionsForRule;
exports.reviseRule = reviseRule;
exports.getOriginForRule = getOriginForRule;
exports.updateRule = updateRule;
exports.createNoteForRule = createNoteForRule;
/*
Copyright 2019 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
// Rules
// https://developer.adobelaunch.com/api/rules
//
// Create a Rule
// https://developer.adobelaunch.com/api/rules/create/
function createRule(propertyId, rule) {
return this.post("/properties/".concat(propertyId, "/rules"), {
data: rule
});
} // Delete a Rule
// https://developer.adobelaunch.com/api/rules/delete/
function deleteRule(ruleId) {
return this.delete("/rules/".concat(ruleId));
} // Get a Rule
// https://developer.adobelaunch.com/api/rules/fetch/
function getRule(ruleId) {
return this.get("/rules/".concat(ruleId));
} // Get the Property
// https://developer.adobelaunch.com/api/rules/property/
function getPropertyForRule(ruleId) {
return this.get("/rules/".concat(ruleId, "/property"));
} // List Libraries
// https://developer.adobelaunch.com/api/rules/libraries/
function listLibrariesForRule(ruleId, queryParams) {
return this.get("/rules/".concat(ruleId, "/libraries"), queryParams);
} // List Rules for Build
// https://developer.adobelaunch.com/api/builds/rules/
function listRulesForBuild(buildId, queryParams) {
return this.get("/builds/".concat(buildId, "/rules"), queryParams);
} // List Rules for Property
// https://developer.adobelaunch.com/api/rules/list/
function listRulesForProperty(propertyId, queryParams) {
return this.get("/properties/".concat(propertyId, "/rules"), queryParams);
} // List revisions
// https://developer.adobelaunch.com/api/rules/revisions/
function listRevisionsForRule(ruleId, queryParams) {
return this.get("/rules/".concat(ruleId, "/revisions"), queryParams);
} // Revise a Rule
// https://developer.adobelaunch.com/api/rules/revise/
function reviseRule(ruleId) {
return this.patch("/rules/".concat(ruleId), this.createReviseBody('rules', ruleId));
} // Get origin for Rule
// https://developer.adobelaunch.com/api/rules/origin/
function getOriginForRule(ruleId) {
return this.get("/rules/".concat(ruleId, "/origin"));
} // Update a Rule
// https://developer.adobelaunch.com/api/rules/update/
function updateRule(rulePatch) {
return this.patch("/rules/".concat(rulePatch.id), {
data: rulePatch
});
} // Create a note for Rule
// https://developer.adobelaunch.com/api/rules/:rule_id/notes
function createNoteForRule(ruleId, note) {
return this.post("/rules/".concat(ruleId, "/notes"), {
data: note
});
}
//# sourceMappingURL=rules.js.map