{"version":3,"file":"rules.cjs","names":["createRule","propertyId","rule","post","data","deleteRule","ruleId","delete","getRule","get","getPropertyForRule","listLibrariesForRule","queryParams","listRulesForBuild","buildId","listRulesForProperty","listRevisionsForRule","reviseRule","patch","createReviseBody","getOriginForRule","updateRule","rulePatch","id","createNoteForRule","note"],"sources":["../../src/rules.js"],"sourcesContent":["/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n// Rules\n// https://developer.adobelaunch.com/api/rules\n//\n// Create a Rule\n// https://developer.adobelaunch.com/api/rules/create/\nexport function createRule(propertyId, rule) {\n  return this.post(`/properties/${propertyId}/rules`, { data: rule });\n}\n\n// Delete a Rule\n// https://developer.adobelaunch.com/api/rules/delete/\nexport function deleteRule(ruleId) {\n  return this.delete(`/rules/${ruleId}`);\n}\n\n// Get a Rule\n// https://developer.adobelaunch.com/api/rules/fetch/\nexport function getRule(ruleId) {\n  return this.get(`/rules/${ruleId}`);\n}\n\n// Get the Property\n// https://developer.adobelaunch.com/api/rules/property/\nexport function getPropertyForRule(ruleId) {\n  return this.get(`/rules/${ruleId}/property`);\n}\n\n// List Libraries\n// https://developer.adobelaunch.com/api/rules/libraries/\nexport function listLibrariesForRule(ruleId, queryParams) {\n  return this.get(`/rules/${ruleId}/libraries`, queryParams);\n}\n\n// List Rules for Build\n// https://developer.adobelaunch.com/api/builds/rules/\nexport function listRulesForBuild(buildId, queryParams) {\n  return this.get(`/builds/${buildId}/rules`, queryParams);\n}\n\n// List Rules for Property\n// https://developer.adobelaunch.com/api/rules/list/\nexport function listRulesForProperty(propertyId, queryParams) {\n  return this.get(`/properties/${propertyId}/rules`, queryParams);\n}\n\n// List revisions\n// https://developer.adobelaunch.com/api/rules/revisions/\nexport function listRevisionsForRule(ruleId, queryParams) {\n  return this.get(`/rules/${ruleId}/revisions`, queryParams);\n}\n\n// Revise a Rule\n// https://developer.adobelaunch.com/api/rules/revise/\nexport function reviseRule(ruleId) {\n  return this.patch(`/rules/${ruleId}`, this.createReviseBody('rules', ruleId));\n}\n\n// Get origin for Rule\n// https://developer.adobelaunch.com/api/rules/origin/\nexport function getOriginForRule(ruleId) {\n  return this.get(`/rules/${ruleId}/origin`);\n}\n\n// Update a Rule\n// https://developer.adobelaunch.com/api/rules/update/\nexport function updateRule(rulePatch) {\n  return this.patch(`/rules/${rulePatch.id}`, {\n    data: rulePatch\n  });\n}\n\n// Create a note for Rule\n// https://developer.adobelaunch.com/api/rules/:rule_id/notes\nexport function createNoteForRule(ruleId, note) {\n  return this.post(`/rules/${ruleId}/notes`, {\n    data: note\n  });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAUA,CAACC,UAAU,EAAEC,IAAI,EAAE;EAC3C,OAAO,IAAI,CAACC,IAAI,CAAC,eAAeF,UAAU,QAAQ,EAAE;IAAEG,IAAI,EAAEF;EAAK,CAAC,CAAC;AACrE;;AAEA;AACA;AACO,SAASG,UAAUA,CAACC,MAAM,EAAE;EACjC,OAAO,IAAI,CAACC,MAAM,CAAC,UAAUD,MAAM,EAAE,CAAC;AACxC;;AAEA;AACA;AACO,SAASE,OAAOA,CAACF,MAAM,EAAE;EAC9B,OAAO,IAAI,CAACG,GAAG,CAAC,UAAUH,MAAM,EAAE,CAAC;AACrC;;AAEA;AACA;AACO,SAASI,kBAAkBA,CAACJ,MAAM,EAAE;EACzC,OAAO,IAAI,CAACG,GAAG,CAAC,UAAUH,MAAM,WAAW,CAAC;AAC9C;;AAEA;AACA;AACO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