UNPKG

@cloud-copilot/iam-policy

Version:
41 lines 977 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ActionImpl = void 0; const utils_js_1 = require("../utils.js"); class ActionImpl { rawValue; otherProps; constructor(rawValue, otherProps) { this.rawValue = rawValue; this.otherProps = otherProps; } path() { return this.otherProps.path; } type() { if ((0, utils_js_1.isAllWildcards)(this.rawValue)) { return 'wildcard'; } return 'service'; } wildcardValue() { return '*'; } value() { return this.rawValue; } isWildcardAction() { return this.type() === 'wildcard'; } isServiceAction() { return this.type() === 'service'; } service() { return this.rawValue.split(':')[0].toLowerCase(); } action() { return this.rawValue.split(':')[1]; } } exports.ActionImpl = ActionImpl; //# sourceMappingURL=action.js.map