UNPKG

condoit

Version:

[![](https://img.shields.io/badge/Docs-Docs-00a02e?logo=github&style=for-the-badge&color=0000ff)](https://securisec.github.io/condoit/) ![](https://img.shields.io/npm/v/condoit?style=for-the-badge)

711 lines (709 loc) 18.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transactions = void 0; /** *Change the title of the object * * @param {string} value * @returns {object} */ const title = (value) => { return { type: 'title', value: value }; }; /** *Change the view policy of the object. * * @param {string} value * @returns {object} */ const view = (value) => { return { type: 'view', value: value }; }; /** *Change the edit policy of the object. * * @param {string} value * @returns {object} */ const edit = (value) => { return { type: 'edit', value: value }; }; /** *Sign this transaction group with MFA. * * @param {string} value * @returns {object} */ const mfa = (value) => { return { type: 'mfa', value: value }; }; /** *Make comments * * @param {string} value * @returns {object} */ const comment = (value) => { return { type: 'comment', value: value }; }; const subscribers = { /** *Add subscribers. * * @param {Array<phid>} value * @returns {object} */ add: (value) => { return { type: 'subscribers.add', value: value }; }, /** *Remove subscribers. * * @param {Array<phid>} value * @returns {object} */ remove: (value) => { return { type: 'subscribers.remove', value: value }; }, /** *Set subscribers, overwriting current value * * @param {Array<phid>} value * @returns {object} */ set: (value) => { return { type: 'subscribers.set', value: value }; } }; const projects = { /** *Add project tags. * * @param {Array<phid>} value * @returns {object} */ add: (value) => { return { type: 'projects.add', value: value }; }, /** *Remove project tags * * @param {Array<phid>} value * @returns {object} */ remove: (value) => { return { type: 'projects.remove', value: value }; }, /** *Set project tags * * @param {Array<phid>} value * @returns {object} */ set: (value) => { return { type: 'projects.set', value: value }; } }; exports.transactions = { /** * Badge edit transactions */ badge: { /** *Badge name * * @param {string} value * @returns {object} */ name: (value) => { return { type: 'name', value: value }; }, /** *Short description of the badge. * * @param {string} value * @returns {object} */ flavor: (value) => { return { type: 'flavor', value: value }; }, /** *Change the badge icon. * * @param {faIcons} value * @returns {object} */ icon: (value) => { return { type: 'icon', value: value }; }, /** *Color and rarity of the badge. * * @param {('poor'|'common'|'uncommon'|'rare'|'epic'|'legendary'|'heirloom')} value * @returns {object} */ quality: (value) => { let values = { poor: 140, common: 120, uncommon: 100, rare: 80, epic: 60, legendary: 40, heirloom: 20 }; return { type: 'quality', value: values[value] }; }, /** *Badge long description * * @param {string} value * @returns {object} */ description: (value) => { return { type: 'description', value: value }; }, /** *New badge award recipients. * * @param {Array<string>} value * @returns {object} */ award: (value) => { return { type: 'award', value: value }; }, /** *Revoke badge award recipients. * * @param {Array<phid>} value * @returns {object} */ revoke: (value) => { return { type: 'revoke', value: value }; }, /** *Change the edit policy of the object. * * @param {phid} value * @returns {object} */ edit: (value) => { return { type: 'edit', value: value }; }, subscribers: subscribers, comment: comment, mfa: mfa }, /** * Conpherence edit transactions */ conpherence: { /** *Room name * * @param {string} value * @returns {object} */ name: (value) => { return { type: 'name', value: value }; }, /** *Room topic * * @param {string} value * @returns {object} */ topic: (value) => { return { type: 'topic', value: value }; }, participants: { /** *Add room participants. * * @param {Array<phid>} value * @returns {object} */ add: (value) => { return { type: 'participants.add', value: value }; }, /** *Remove room participants. * * @param {Array<phid>} value * @returns {object} */ remove: (value) => { return { type: 'participants.remove', value: value }; }, /** *Set room participants. * * @param {Array<phid>} value * @returns {object} */ set: (value) => { return { type: 'participants.set', value: value }; } }, view: view, edit: edit, comment: comment, mfa: mfa }, /** * Maniphest edit transactions */ maniphest: { /** *Use this to set transactions with custom fields. The type argument is the transaction type name, the value is value. An example transaction type name is `custom.myfield` * * @param {string} type * @param {*} value * @returns */ custom: (type, value) => { return { type: type, value: value }; }, /** *Create as a subtask of another task * * @param {phid} value * @returns {object} */ parent: (value) => { return { type: 'parent', value: value }; }, /** *Move a task to one or more workboard columns. You can use this transaction type to create a task into a particular workboard column, or move an existing task between columns. * * @param {Array<phid>} value * @returns {object} */ column: (value) => { return { type: 'column', value: value }; }, /** *Shift the object between spaces. * * @param {phid} value * @returns {object} */ space: (value) => { return { type: 'space', value: value }; }, title: title, /** *Reassign the task * * @param {phid} value * @returns {object} */ owner: (value) => { return { type: 'owner', value: value }; }, /** *Change the task status * * @param {('open'|'resolved'|'wontfix'|'invalid'|'duplicate'|'spite')} value * @returns {object} */ status: (value) => { return { type: 'status', value: value }; }, /** *Change the priority of the task * * @param {('unbreak'|'triage'|'high'|'normal'|'low'|'wishlist')} value * @returns {object} */ priority: (value) => { return { type: 'priority', value: value }; }, /** *Update the task description * * @param {string} value * @returns {object} */ description: (value) => { return { type: 'description', value: value }; }, parents: { /** *Change the parents of this task * * @param {Array<phid>} value * @returns {object} */ add: (value) => { return { type: 'parents.add', value: value }; }, /** *Remove the parents of this task * * @param {Array<phid>} value * @returns {object} */ remove: (value) => { return { type: 'parents.remove', value: value }; }, /** *Set the parents of this task * * @param {Array<phid>} value * @returns {object} */ set: (value) => { return { type: 'parents.set', value: value }; } }, subtasks: { /** *Change the subtasks of this task * * @param {Array<phid>} value * @returns {object} */ add: (value) => { return { type: 'subtasks.add', value: value }; }, /** *Remove the subtasks of this task * * @param {Array<phid>} value * @returns {object} */ remove: (value) => { return { type: 'subtasks.remove', value: value }; }, /** *Set the subtasks of this task * * @param {Array<phid>} value * @returns {object} */ set: (value) => { return { type: 'subtasks.set', value: value }; } }, commits: { /** *Change the related commits for this task * * @param {Array<phid>} value * @returns {object} */ add: (value) => { return { type: 'commits.add', value: value }; }, /** *Remove the related commits for this task * * @param {Array<phid>} value * @returns {object} */ remove: (value) => { return { type: 'commits.remove', value: value }; }, /** *Set the related commits for this task * * @param {Array<phid>} value * @returns {object} */ set: (value) => { return { type: 'commits.set', value: value }; } }, view: view, edit: edit, projects: projects, subscribers: subscribers, /** *Change the object subtype * * @param {('default'|'bug'|'feature')} value * @returns {object} */ subtype: (value) => { return { type: 'subtype', value: value }; }, comment: comment, mfa: mfa }, /** * Paste edit transactions */ paste: { /** *Shift the object between spaces * * @param {string} value * @returns {object} */ space: (value) => { return { type: 'space', value: value }; }, title: title, /** *Change language for syntax highlighting * * @param {lang} value * @returns {object} */ language: (value) => { return { type: 'language', value: value }; }, /** *The paste content * * @param {string} value * @returns {object} */ text: (value) => { return { type: 'text', value: value }; }, /** *Active or archive the paste * * @param {('active'|'archived')} value * @returns {object} */ status: (value) => { return { type: 'status', value: value }; }, view: view, edit: edit, projects: projects, subscribers: subscribers, comment: comment, mfa: mfa }, /** * Portal edit transactions */ portal: { /** *Rename the portal * * @param {string} value * @returns {object} */ name: (value) => { return { type: 'name', value: value }; }, view: view, edit: edit, projects: projects, mfa: mfa }, /** * Project edit transactions */ project: { /** *Choose a parent project to create a subproject beneath. * * @param {phid} value * @returns {object} */ parent: (value) => { return { type: 'parent', value: value }; }, /** *Choose a parent project to create a new milestone for. * * @param {phid} value * @returns {object} */ milestone: (value) => { return { type: 'milestone', value: value }; }, /** *Shift the object between spaces * * @param {phid} value * @returns {object} */ space: (value) => { return { type: 'space', value: value }; }, /** *New project name or rename * * @param {string} value * @returns {object} */ name: (value) => { return { type: 'name', value: value }; }, /** *Short project description * * @param {string} value * @returns {object} */ description: (value) => { return { type: 'description', value: value }; }, /** *Change the project icon * * @param {('project'| * 'tag'| * 'policy'| * 'group'| * 'folder'| * 'timeline'| * 'goal'| * 'release'| * 'bugs'| * 'cleanup'| * 'umbrella'| * 'communication'| * 'organization'| * 'infrastructure'| * 'account'| * 'experimental')} value * @returns {object} */ icon: (value) => { return { type: 'icon', value: value }; }, /** *Change the project tag color * * @param {colors} value * @returns {object} */ color: (value) => { return { type: 'color', value: value }; }, /** *Change project slugs * * @param {Array<string>} value * @returns {object} */ slugs: (value) => { return { type: 'slugs', value: value }; }, members: { /** *Add project members * * @param {Array<phid>} value * @returns {object} */ add: (value) => { return { type: 'members.add', value: value }; }, /** *Remove project members * * @param {Array<phid>} value * @returns {object} */ remove: (value) => { return { type: 'members.remove', value: value }; }, /** *Set project members * * @param {Array<phid>} value * @returns {object} */ set: (value) => { return { type: 'members.set', value: value }; } }, view: view, edit: edit, /** *Change the join policy of the object. * * @param {string} value * @returns {object} */ join: (value) => { return { type: 'join', value: value }; }, subtype: (value) => { return { type: 'subtype', value: value }; }, mfa: mfa }, /** * User edit transactions */ user: { /** *Disable or enable the user * * @param {boolean} value true to disable * @returns {object} */ disabled: (value) => { return { type: 'disabled', value: value }; }, /** *Approve or reject the user * * @param {boolean} value true to approve the user * @returns {object} */ approved: (value) => { return { type: 'approved', value: value }; }, /** *Stores the real name of the user, like "Abraham Lincoln". * * @param {string} value * @returns {object} */ realName: (value) => { return { type: 'realName', value: value }; }, /** *User title, like "CEO" or "Assistant to the Manager". * * @param {string} value * @returns {object} */ title: (value) => { return { type: 'title', value: value }; }, /** *User icon to accompany their title. * * @param {string} value * @returns {object} */ icon: (value) => { return { type: 'icon', value: value }; }, /** *Short blurb about the user * * @param {string} value * @returns {object} */ blurb: (value) => { return { type: 'blurb', value: value }; }, /** *Sign the transaction group with MFA * * @param {boolean} value * @returns {object} */ mfa: (value) => { return { type: 'mfa', value: value }; } } };