@pageproof/sdk-pr 393.0.1639437949014 → 394.0.1639437462069
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/lib/api/Workflows.d.ts +20 -0
- package/lib/api/Workflows.js +1 -1
- package/lib/api/admin/TeamFeatures.d.ts +10 -14
- package/lib/api/admin/TeamFeatures.js +13 -35
- package/lib/models/TeamEmailFeatures.d.ts +0 -6
- package/lib/models/TeamEmailFeatures.js +1 -1
- package/lib/models/TeamFeatures.d.ts +6 -0
- package/lib/models/TeamFeatures.js +1 -1
- package/lib/models/Workflow.d.ts +6 -0
- package/lib/models/Workflow.js +1 -1
- package/lib/network/endpoints.json +11 -7
- package/lib/pageproof.js +1 -1
- package/lib/types/TeamBrandingFeatures.d.ts +17 -0
- package/package.json +1 -1
- package/lib/types/SpfRecordDefinition.d.ts +0 -17
- package/lib/types/TeamSenderEmail.d.ts +0 -21
- package/lib/types/TeamSenderEmail.js +0 -1
- /package/lib/types/{SpfRecordDefinition.js → TeamBrandingFeatures.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
## 2.0.0-beta.280
|
|
5
|
+
|
|
6
|
+
Released on the 10th of December 2021.
|
|
7
|
+
|
|
8
|
+
- [[PP-1642](https://pageproof.atlassian.net/browse/PP-1642)] Added support for favoriting workflow templates. See [Workflow.isFavorite](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/Workflow.js~Workflow.html#instance-member-isFavorite), [Workflows.favorite](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Workflows.js~Workflows.html#instance-method-favorite), and [Workflows.unfavorite](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Workflows.js~Workflows.html#instance-method-unfavorite).
|
|
9
|
+
|
|
10
|
+
## 2.0.0-beta.279
|
|
11
|
+
|
|
12
|
+
Released on the 10th of December 2021.
|
|
13
|
+
|
|
14
|
+
_This version does not contain any new features._
|
|
15
|
+
|
|
3
16
|
## 2.0.0-beta.278
|
|
4
17
|
|
|
5
18
|
Released on the 7th of December 2021.
|
|
6
19
|
|
|
7
20
|
- [[PP-1641](https://pageproof.atlassian.net/browse/PP-1641)] Add the `decisionDate` field to the WorkflowUser model. See [WorkflowUser.decisionDate](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/WorkflowUser.js~WorkflowUser.html#instance-member-decisionDate).
|
|
8
21
|
|
|
9
|
-
## 2.0.0-beta.
|
|
22
|
+
## 2.0.0-beta.277
|
|
10
23
|
|
|
11
24
|
Released on the 28th of October 2021.
|
|
12
25
|
|
|
13
26
|
- [[PP-1515](https://pageproof.atlassian.net/browse/PP-1515)] Added support for retrieving multiple comment attachments. See [Comments.load](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Comments.js~Comments.html#instance-method-load).
|
|
14
27
|
|
|
28
|
+
Note: This version was mistakenly released as `2.0.0-beta.277` instead of `2.0.0-beta.177`.
|
|
29
|
+
|
|
15
30
|
## 2.0.0-beta.176
|
|
16
31
|
|
|
17
32
|
Released on the 27th of September 2021.
|
package/lib/api/Workflows.d.ts
CHANGED
|
@@ -392,6 +392,26 @@ declare class Workflows extends API {
|
|
|
392
392
|
* @returns {Promise<string|null>}
|
|
393
393
|
*/
|
|
394
394
|
getNudgeMessage(workflowId: string, userId: string): Promise<string>;
|
|
395
|
+
/**
|
|
396
|
+
* Set a workflow template as favorite.
|
|
397
|
+
*
|
|
398
|
+
* @example <caption>Set workflow template as favorite</caption>
|
|
399
|
+
* await client.workflows.favorite('W8VN0H4UYFVV1VQL');
|
|
400
|
+
*
|
|
401
|
+
* @param {string} workflowId The workflow id
|
|
402
|
+
* @returns {Promise}
|
|
403
|
+
*/
|
|
404
|
+
favorite(workflowId: string): Promise<any>;
|
|
405
|
+
/**
|
|
406
|
+
* Unfavorite a workflow template.
|
|
407
|
+
*
|
|
408
|
+
* @example <caption>Unfavorite a workflow template</caption>
|
|
409
|
+
* await client.workflows.unfavorite('W8VN0H4UYFVV1VQL');
|
|
410
|
+
*
|
|
411
|
+
* @param {string} workflowId The workflow id
|
|
412
|
+
* @returns {Promise}
|
|
413
|
+
*/
|
|
414
|
+
unfavorite(workflowId: string): Promise<any>;
|
|
395
415
|
/** @private */
|
|
396
416
|
_duplicateWorkflow(workflowId: any, options: any): any;
|
|
397
417
|
/** @private */
|
package/lib/api/Workflows.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Workflow=require("../models/Workflow");var _Workflow2=_interopRequireDefault(_Workflow);var _WorkflowStep=require("../models/WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);var _WorkflowUser=require("../models/WorkflowUser");var _WorkflowUser2=_interopRequireDefault(_WorkflowUser);var _id=require("../util/id");var _WorkflowsSteps=require("./WorkflowsSteps");var _WorkflowsSteps2=_interopRequireDefault(_WorkflowsSteps);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}function hasEnoughUserDetails(workflowUser){return workflowUser&&((0,_id.isUserId)(workflowUser.id)||workflowUser.email)}function transformWorkflows(workflows){return(workflows||[]).map(function(workflowData){return(new _Workflow2.default).fromWorkflow(workflowData)})}var Workflows=function(_API){_inherits(Workflows,_API);function Workflows(client){_classCallCheck(this,Workflows);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.steps=new _WorkflowsSteps2.default(client);return _this}Workflows.prototype.create=function create(_ref){var _this2=this;var _ref$save=_ref.save,save=_ref$save===undefined?false:_ref$save,name=_ref.name,_ref$steps=_ref.steps,_steps=_ref$steps===undefined?[]:_ref$steps,reviewers=_ref.reviewers,approver=_ref.approver,owners=_ref.owners,_ref$isOwnedByTeam=_ref.isOwnedByTeam,isOwnedByTeam=_ref$isOwnedByTeam===undefined?false:_ref$isOwnedByTeam;if(approver&&!hasEnoughUserDetails(approver)){return Promise.reject(Error("Please provide an approver id or email address."))}if(save&&!name){return Promise.reject(Error("A workflow must have a name when saving it as a workflow template."))}var steps=_steps;if(reviewers&&reviewers.length){steps.splice(0,0,{users:reviewers})}if(approver){steps.push({position:1e3,users:[approver],start:approver.start})}var largestPosition=0;for(var i=0;i<steps.length;i++){var step=steps[i];step.users=step.users||[];if(!step.position||step.position<largestPosition){step.position=largestPosition+1}largestPosition=Math.max(largestPosition,step.position);for(var ii=0;ii<step.users.length;ii++){var user=step.users[ii];if(!hasEnoughUserDetails(user)){return Promise.reject(Error("A user id or email address must be provided for a workflow user."))}}}var workflowId=void 0;return this._createWorkflow(name,isOwnedByTeam).then(function(workflow){workflowId=workflow.id;return Promise.all([workflow,Promise.all(steps.map(function(step){var workflowStep=workflow.getStepByPosition(step.position);return workflowStep?Promise.resolve(step.dueDate&&_this2.steps.update(workflowStep.id,{dueDate:step.dueDate}).then(function(updatedWorkflowStep){workflowStep.dueDate=updatedWorkflowStep.dueDate})).then(function(){return _this2._setWorkflowStepUsersMutate(workflow.id,workflowStep,step.users,step.start)}):_this2._addWorkflowStepAndUsers(workflow.id,step,step.start)})),owners&&Promise.all(owners.map(function(owner){return _this2._addProofOwnerToWorkflowTemplate(workflowId,owner)}))])}).then(function(_ref2){var workflow=_ref2[0],workflowSteps=_ref2[1];workflow.steps=workflowSteps;return workflow}).then(function(workflow){if(save){return _this2._duplicateWorkflow(workflowId)}return workflow}).catch(function(err){return Promise.resolve(workflowId&&_this2._deleteWorkflow(workflowId)).then(function(){return Promise.reject(err)})})};Workflows.prototype.load=function load(workflowId){return this.client.request("workflows.load",{workflowId:workflowId}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype.use=function use(workflowId,options){return this.duplicate(workflowId,options)};Workflows.prototype.duplicate=function duplicate(workflowId,options){return this._duplicateWorkflow(workflowId,options)};Workflows.prototype.delete=function _delete(workflowId){return this._deleteWorkflow(workflowId)};Workflows.prototype.all=function all(){return Promise.all([this.owned(),this.shared()]).then(function(_ref3){var owned=_ref3[0],shared=_ref3[1];return[].concat(owned,shared)})};Workflows.prototype.owned=function owned(){return this.client.request("workflows.owned").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.shared=function shared(){return this.client.request("workflows.shared").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.setApprover=function setApprover(workflowId,user){return this.client.request("workflows.users.set",{workflowId:workflowId,position:1e3,users:[user]})};Workflows.prototype.skipAll=function skipAll(workflowId){return this.client.request("workflows.users.skip-all",{workflowId:workflowId})};Workflows.prototype.nudgeUser=function nudgeUser(workflowId,userId){var message=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return this.client.request("workflows.user.nudge",{workflowId:workflowId,userId:userId,message:message})};Workflows.prototype.nudgeAll=function nudgeAll(workflowId){var message=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return this.client.request("workflows.nudge-all",{workflowId:workflowId,message:message})};Workflows.prototype.setStartingStep=function setStartingStep(workflowId,stepId){return this.client.request("workflows.set-starting-step",{workflowId:workflowId,stepId:stepId})};Workflows.prototype.replaceApprover=function replaceApprover(workflowIdOrIds,user){return this.client.request("workflows.replace-approver",{workflowIds:[].concat(workflowIdOrIds),user:user})};Workflows.prototype.update=function update(workflowId,_ref4){var name=_ref4.name,isOwnedByTeam=_ref4.isOwnedByTeam;return this.client.request("workflows.update",{workflowId:workflowId,title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype.getNudgeAllMessage=function getNudgeAllMessage(workflowId){return this.client.request("workflows.nudge-message",{workflowId:workflowId}).then(function(response){return response.data.Message})};Workflows.prototype.getNudgeMessage=function getNudgeMessage(workflowId,userId){return this.client.request("workflows.nudge-message",{workflowId:workflowId,userId:userId}).then(function(response){return response.data.Message})};Workflows.prototype._duplicateWorkflow=function _duplicateWorkflow(workflowId,options){var _this3=this;return this.client.request("workflows.duplicate",{workflowId:workflowId,noOwners:options&&options.includeOwners===false?true:undefined,excludeStepDueDates:options&&options.includeStepDueDates===false?true:undefined,includeOwnedByTeam:options&&options.includeOwnedByTeam===true||undefined,includeSharedUsers:options&&options.includeSharedUsers===true||undefined}).then(function(response){var duplicatedWorkflowId=response.data.WorkflowId;return _this3.load(duplicatedWorkflowId)})};Workflows.prototype._deleteWorkflow=function _deleteWorkflow(workflowId){return this.client.request("workflows.delete",{workflowId:workflowId})};Workflows.prototype._createWorkflow=function _createWorkflow(name,isOwnedByTeam){return this.client.request("workflows.create",{title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype._addWorkflowStepAndUsers=function _addWorkflowStepAndUsers(workflowId,step,start){var _this4=this;return this.client.request("workflows.steps.add",{workflowId:workflowId,title:step.name,position:step.position,dueDate:step.dueDate}).then(function(response){var workflowStep=(new _WorkflowStep2.default).fromWorkflowStep(response.data);return _this4._setWorkflowStepUsersMutate(workflowId,workflowStep,step.users,start)})};Workflows.prototype._setWorkflowStepUsersMutate=function _setWorkflowStepUsersMutate(workflowId,workflowStep,users,start){var _this5=this;return this.client.request("workflows.users.set",{workflowId:workflowId,stepId:workflowStep.id,users:users.map(function(user){return{email:user.email,userId:user.id,role:user.role,permissions:user.permissions&&{inviter:!!user.permissions.inviter}}})}).then(function(response){var workflowUsers=response.data.map(function(user){return(new _WorkflowUser2.default).fromWorkflowUser(user)});workflowStep.users=workflowUsers}).then(function(){if(start===true){return _this5.setStartingStep(workflowId,workflowStep.id).then(function(){return workflowStep})}return workflowStep})};Workflows.prototype._addProofOwnerToWorkflowTemplate=function _addProofOwnerToWorkflowTemplate(workflowId,user){return this.client.request("workflows.proof-owners.add",{relatedId:workflowId,workflowCopyToProof:1,userId:user.id,email:user.email})};return Workflows}(_API3.default);exports.default=Workflows;
|
|
1
|
+
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Workflow=require("../models/Workflow");var _Workflow2=_interopRequireDefault(_Workflow);var _WorkflowStep=require("../models/WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);var _WorkflowUser=require("../models/WorkflowUser");var _WorkflowUser2=_interopRequireDefault(_WorkflowUser);var _id=require("../util/id");var _WorkflowsSteps=require("./WorkflowsSteps");var _WorkflowsSteps2=_interopRequireDefault(_WorkflowsSteps);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}function hasEnoughUserDetails(workflowUser){return workflowUser&&((0,_id.isUserId)(workflowUser.id)||workflowUser.email)}function transformWorkflows(workflows){return(workflows||[]).map(function(workflowData){return(new _Workflow2.default).fromWorkflow(workflowData)})}var Workflows=function(_API){_inherits(Workflows,_API);function Workflows(client){_classCallCheck(this,Workflows);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.steps=new _WorkflowsSteps2.default(client);return _this}Workflows.prototype.create=function create(_ref){var _this2=this;var _ref$save=_ref.save,save=_ref$save===undefined?false:_ref$save,name=_ref.name,_ref$steps=_ref.steps,_steps=_ref$steps===undefined?[]:_ref$steps,reviewers=_ref.reviewers,approver=_ref.approver,owners=_ref.owners,_ref$isOwnedByTeam=_ref.isOwnedByTeam,isOwnedByTeam=_ref$isOwnedByTeam===undefined?false:_ref$isOwnedByTeam;if(approver&&!hasEnoughUserDetails(approver)){return Promise.reject(Error("Please provide an approver id or email address."))}if(save&&!name){return Promise.reject(Error("A workflow must have a name when saving it as a workflow template."))}var steps=_steps;if(reviewers&&reviewers.length){steps.splice(0,0,{users:reviewers})}if(approver){steps.push({position:1e3,users:[approver],start:approver.start})}var largestPosition=0;for(var i=0;i<steps.length;i++){var step=steps[i];step.users=step.users||[];if(!step.position||step.position<largestPosition){step.position=largestPosition+1}largestPosition=Math.max(largestPosition,step.position);for(var ii=0;ii<step.users.length;ii++){var user=step.users[ii];if(!hasEnoughUserDetails(user)){return Promise.reject(Error("A user id or email address must be provided for a workflow user."))}}}var workflowId=void 0;return this._createWorkflow(name,isOwnedByTeam).then(function(workflow){workflowId=workflow.id;return Promise.all([workflow,Promise.all(steps.map(function(step){var workflowStep=workflow.getStepByPosition(step.position);return workflowStep?Promise.resolve(step.dueDate&&_this2.steps.update(workflowStep.id,{dueDate:step.dueDate}).then(function(updatedWorkflowStep){workflowStep.dueDate=updatedWorkflowStep.dueDate})).then(function(){return _this2._setWorkflowStepUsersMutate(workflow.id,workflowStep,step.users,step.start)}):_this2._addWorkflowStepAndUsers(workflow.id,step,step.start)})),owners&&Promise.all(owners.map(function(owner){return _this2._addProofOwnerToWorkflowTemplate(workflowId,owner)}))])}).then(function(_ref2){var workflow=_ref2[0],workflowSteps=_ref2[1];workflow.steps=workflowSteps;return workflow}).then(function(workflow){if(save){return _this2._duplicateWorkflow(workflowId)}return workflow}).catch(function(err){return Promise.resolve(workflowId&&_this2._deleteWorkflow(workflowId)).then(function(){return Promise.reject(err)})})};Workflows.prototype.load=function load(workflowId){return this.client.request("workflows.load",{workflowId:workflowId}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype.use=function use(workflowId,options){return this.duplicate(workflowId,options)};Workflows.prototype.duplicate=function duplicate(workflowId,options){return this._duplicateWorkflow(workflowId,options)};Workflows.prototype.delete=function _delete(workflowId){return this._deleteWorkflow(workflowId)};Workflows.prototype.all=function all(){return Promise.all([this.owned(),this.shared()]).then(function(_ref3){var owned=_ref3[0],shared=_ref3[1];return[].concat(owned,shared)})};Workflows.prototype.owned=function owned(){return this.client.request("workflows.owned").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.shared=function shared(){return this.client.request("workflows.shared").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.setApprover=function setApprover(workflowId,user){return this.client.request("workflows.users.set",{workflowId:workflowId,position:1e3,users:[user]})};Workflows.prototype.skipAll=function skipAll(workflowId){return this.client.request("workflows.users.skip-all",{workflowId:workflowId})};Workflows.prototype.nudgeUser=function nudgeUser(workflowId,userId){var message=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return this.client.request("workflows.user.nudge",{workflowId:workflowId,userId:userId,message:message})};Workflows.prototype.nudgeAll=function nudgeAll(workflowId){var message=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return this.client.request("workflows.nudge-all",{workflowId:workflowId,message:message})};Workflows.prototype.setStartingStep=function setStartingStep(workflowId,stepId){return this.client.request("workflows.set-starting-step",{workflowId:workflowId,stepId:stepId})};Workflows.prototype.replaceApprover=function replaceApprover(workflowIdOrIds,user){return this.client.request("workflows.replace-approver",{workflowIds:[].concat(workflowIdOrIds),user:user})};Workflows.prototype.update=function update(workflowId,_ref4){var name=_ref4.name,isOwnedByTeam=_ref4.isOwnedByTeam;return this.client.request("workflows.update",{workflowId:workflowId,title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype.getNudgeAllMessage=function getNudgeAllMessage(workflowId){return this.client.request("workflows.nudge-message",{workflowId:workflowId}).then(function(response){return response.data.Message})};Workflows.prototype.getNudgeMessage=function getNudgeMessage(workflowId,userId){return this.client.request("workflows.nudge-message",{workflowId:workflowId,userId:userId}).then(function(response){return response.data.Message})};Workflows.prototype.favorite=function favorite(workflowId){return this.client.request("workflows.favorite",{workflowId:workflowId})};Workflows.prototype.unfavorite=function unfavorite(workflowId){return this.client.request("workflows.unfavorite",{workflowId:workflowId})};Workflows.prototype._duplicateWorkflow=function _duplicateWorkflow(workflowId,options){var _this3=this;return this.client.request("workflows.duplicate",{workflowId:workflowId,noOwners:options&&options.includeOwners===false?true:undefined,excludeStepDueDates:options&&options.includeStepDueDates===false?true:undefined,includeOwnedByTeam:options&&options.includeOwnedByTeam===true||undefined,includeSharedUsers:options&&options.includeSharedUsers===true||undefined}).then(function(response){var duplicatedWorkflowId=response.data.WorkflowId;return _this3.load(duplicatedWorkflowId)})};Workflows.prototype._deleteWorkflow=function _deleteWorkflow(workflowId){return this.client.request("workflows.delete",{workflowId:workflowId})};Workflows.prototype._createWorkflow=function _createWorkflow(name,isOwnedByTeam){return this.client.request("workflows.create",{title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype._addWorkflowStepAndUsers=function _addWorkflowStepAndUsers(workflowId,step,start){var _this4=this;return this.client.request("workflows.steps.add",{workflowId:workflowId,title:step.name,position:step.position,dueDate:step.dueDate}).then(function(response){var workflowStep=(new _WorkflowStep2.default).fromWorkflowStep(response.data);return _this4._setWorkflowStepUsersMutate(workflowId,workflowStep,step.users,start)})};Workflows.prototype._setWorkflowStepUsersMutate=function _setWorkflowStepUsersMutate(workflowId,workflowStep,users,start){var _this5=this;return this.client.request("workflows.users.set",{workflowId:workflowId,stepId:workflowStep.id,users:users.map(function(user){return{email:user.email,userId:user.id,role:user.role,permissions:user.permissions&&{inviter:!!user.permissions.inviter}}})}).then(function(response){var workflowUsers=response.data.map(function(user){return(new _WorkflowUser2.default).fromWorkflowUser(user)});workflowStep.users=workflowUsers}).then(function(){if(start===true){return _this5.setStartingStep(workflowId,workflowStep.id).then(function(){return workflowStep})}return workflowStep})};Workflows.prototype._addProofOwnerToWorkflowTemplate=function _addProofOwnerToWorkflowTemplate(workflowId,user){return this.client.request("workflows.proof-owners.add",{relatedId:workflowId,workflowCopyToProof:1,userId:user.id,email:user.email})};return Workflows}(_API3.default);exports.default=Workflows;
|
|
@@ -32,9 +32,13 @@ declare class TeamFeatures extends API {
|
|
|
32
32
|
* @param {boolean} options.proofs.publicProofs Whether the public proofs feature is enabled.
|
|
33
33
|
* @param {boolean} options.proofs.defaultIsPublic The default value for whether a proof is public on the proof setup page.
|
|
34
34
|
* @param {boolean} options.proofs.messageToOwners Whether reviewers can send a message to the proof owners.
|
|
35
|
+
* @param {object} options.branding The branding features
|
|
36
|
+
* @param {string} options.branding.emailLinkColor The link color on the team email notification.
|
|
37
|
+
* @param {string} options.branding.emailButtonColor The button color on the team email notification.
|
|
38
|
+
* @param {string} options.branding.emailButtonTextColor The button text color on the team email notification.
|
|
35
39
|
* @returns {Promise}
|
|
36
40
|
*/
|
|
37
|
-
update({ emails, comments, proofs, }: {
|
|
41
|
+
update({ emails, comments, proofs, branding, }: {
|
|
38
42
|
emails: {
|
|
39
43
|
displayComments: boolean;
|
|
40
44
|
displayTeamName: boolean;
|
|
@@ -49,19 +53,11 @@ declare class TeamFeatures extends API {
|
|
|
49
53
|
defaultIsPublic: boolean;
|
|
50
54
|
messageToOwners: boolean;
|
|
51
55
|
};
|
|
56
|
+
branding: {
|
|
57
|
+
emailLinkColor: string;
|
|
58
|
+
emailButtonColor: string;
|
|
59
|
+
emailButtonTextColor: string;
|
|
60
|
+
};
|
|
52
61
|
}): Promise<any>;
|
|
53
|
-
/**
|
|
54
|
-
* Set the team sender email address for the team email notification.
|
|
55
|
-
*
|
|
56
|
-
* Note: This feature is only available to enterprise teams.
|
|
57
|
-
*
|
|
58
|
-
* @example <caption>Setting the team sender email</caption>
|
|
59
|
-
* const admin = await client.admin();
|
|
60
|
-
* const features = admin.team.features.setSenderEmail('team@example.com');
|
|
61
|
-
*
|
|
62
|
-
* @param {string} senderEmail The team sender email address.
|
|
63
|
-
* @returns {Promise<TeamSenderEmail>}
|
|
64
|
-
*/
|
|
65
|
-
setSenderEmail(senderEmail: string): Promise<TeamSenderEmail>;
|
|
66
62
|
}
|
|
67
63
|
import API from "../API";
|
|
@@ -70,6 +70,10 @@ var TeamFeatures = function (_API) {
|
|
|
70
70
|
* @param {boolean} options.proofs.publicProofs Whether the public proofs feature is enabled.
|
|
71
71
|
* @param {boolean} options.proofs.defaultIsPublic The default value for whether a proof is public on the proof setup page.
|
|
72
72
|
* @param {boolean} options.proofs.messageToOwners Whether reviewers can send a message to the proof owners.
|
|
73
|
+
* @param {object} options.branding The branding features
|
|
74
|
+
* @param {string} options.branding.emailLinkColor The link color on the team email notification.
|
|
75
|
+
* @param {string} options.branding.emailButtonColor The button color on the team email notification.
|
|
76
|
+
* @param {string} options.branding.emailButtonTextColor The button text color on the team email notification.
|
|
73
77
|
* @returns {Promise}
|
|
74
78
|
*/
|
|
75
79
|
|
|
@@ -77,7 +81,8 @@ var TeamFeatures = function (_API) {
|
|
|
77
81
|
TeamFeatures.prototype.update = function update(_ref) {
|
|
78
82
|
var emails = _ref.emails,
|
|
79
83
|
comments = _ref.comments,
|
|
80
|
-
proofs = _ref.proofs
|
|
84
|
+
proofs = _ref.proofs,
|
|
85
|
+
branding = _ref.branding;
|
|
81
86
|
|
|
82
87
|
var displayComments = emails && emails.displayComments;
|
|
83
88
|
var displayTeamName = emails && emails.displayTeamName;
|
|
@@ -87,6 +92,9 @@ var TeamFeatures = function (_API) {
|
|
|
87
92
|
var publicProofs = proofs && proofs.publicProofs;
|
|
88
93
|
var defaultProofIsPublic = proofs && proofs.defaultIsPublic;
|
|
89
94
|
var messageToOwners = proofs && proofs.messageToOwners;
|
|
95
|
+
var emailLinkColor = branding && branding.emailLinkColor;
|
|
96
|
+
var emailButtonColor = branding && branding.emailButtonColor;
|
|
97
|
+
var emailButtonTextColor = branding && branding.emailButtonTextColor;
|
|
90
98
|
return this.client.request('admin.team.features.update', {
|
|
91
99
|
displayComments: displayComments,
|
|
92
100
|
displayTeamName: displayTeamName,
|
|
@@ -95,40 +103,10 @@ var TeamFeatures = function (_API) {
|
|
|
95
103
|
proofReference: proofReference,
|
|
96
104
|
publicProofs: publicProofs,
|
|
97
105
|
defaultProofIsPublic: defaultProofIsPublic,
|
|
98
|
-
messageToOwners: messageToOwners
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Set the team sender email address for the team email notification.
|
|
104
|
-
*
|
|
105
|
-
* Note: This feature is only available to enterprise teams.
|
|
106
|
-
*
|
|
107
|
-
* @example <caption>Setting the team sender email</caption>
|
|
108
|
-
* const admin = await client.admin();
|
|
109
|
-
* const features = admin.team.features.setSenderEmail('team@example.com');
|
|
110
|
-
*
|
|
111
|
-
* @param {string} senderEmail The team sender email address.
|
|
112
|
-
* @returns {Promise<TeamSenderEmail>}
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
TeamFeatures.prototype.setSenderEmail = function setSenderEmail(senderEmail) {
|
|
117
|
-
return this.client.request('admin.team.features.sender-email.set', {
|
|
118
|
-
senderEmail: senderEmail
|
|
119
|
-
}).then(function (response) {
|
|
120
|
-
return {
|
|
121
|
-
success: response.data.Success,
|
|
122
|
-
domain: response.data.Domain,
|
|
123
|
-
email: response.data.Email,
|
|
124
|
-
records: response.data.Records && response.data.Records.map(function (record) {
|
|
125
|
-
return {
|
|
126
|
-
version: record.Version,
|
|
127
|
-
current: record.Current,
|
|
128
|
-
new: record.New
|
|
129
|
-
};
|
|
130
|
-
})
|
|
131
|
-
};
|
|
106
|
+
messageToOwners: messageToOwners,
|
|
107
|
+
emailLinkColor: emailLinkColor,
|
|
108
|
+
emailButtonColor: emailButtonColor,
|
|
109
|
+
emailButtonTextColor: emailButtonTextColor
|
|
132
110
|
});
|
|
133
111
|
};
|
|
134
112
|
|
|
@@ -14,12 +14,6 @@ declare class TeamEmailFeatures {
|
|
|
14
14
|
* @type {boolean}
|
|
15
15
|
*/
|
|
16
16
|
displayTeamName: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* The sender email address for the team email notification.
|
|
19
|
-
*
|
|
20
|
-
* @type {string}
|
|
21
|
-
*/
|
|
22
|
-
senderEmail: string;
|
|
23
17
|
/** @private */
|
|
24
18
|
fromTeamEmailFeatures(teamEmailFeaturesData: any): TeamEmailFeatures;
|
|
25
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var TeamEmailFeatureSchema={displayComments:"DisplayComments",displayTeamName:"DisplayTeamName"
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var TeamEmailFeatureSchema={displayComments:"DisplayComments",displayTeamName:"DisplayTeamName"};var TeamEmailFeatures=function(){function TeamEmailFeatures(){_classCallCheck(this,TeamEmailFeatures)}TeamEmailFeatures.prototype.fromTeamEmailFeatures=function fromTeamEmailFeatures(teamEmailFeaturesData){(0,_transform2.default)(this,TeamEmailFeatureSchema,teamEmailFeaturesData);return this};return TeamEmailFeatures}();exports.default=TeamEmailFeatures;
|
|
@@ -28,6 +28,12 @@ declare class TeamFeatures {
|
|
|
28
28
|
* @type {TeamAccountFeatures}
|
|
29
29
|
*/
|
|
30
30
|
accounts: TeamAccountFeatures;
|
|
31
|
+
/**
|
|
32
|
+
* Branding features.
|
|
33
|
+
*
|
|
34
|
+
* @type {TeamBrandingFeatures}
|
|
35
|
+
*/
|
|
36
|
+
branding: TeamBrandingFeatures;
|
|
31
37
|
/** @private */
|
|
32
38
|
fromTeamFeatures(teamFeaturesData: any): TeamFeatures;
|
|
33
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _TeamEmailFeatures=require("./TeamEmailFeatures");var _TeamEmailFeatures2=_interopRequireDefault(_TeamEmailFeatures);var _TeamCommentFeatures=require("./TeamCommentFeatures");var _TeamCommentFeatures2=_interopRequireDefault(_TeamCommentFeatures);var _TeamProofFeatures=require("./TeamProofFeatures");var _TeamProofFeatures2=_interopRequireDefault(_TeamProofFeatures);var _TeamAccountFeatures=require("./TeamAccountFeatures");var _TeamAccountFeatures2=_interopRequireDefault(_TeamAccountFeatures);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var teamFeaturesSchema={emails:function emails(data){return(new _TeamEmailFeatures2.default).fromTeamEmailFeatures(data)},comments:function comments(data){return(new _TeamCommentFeatures2.default).fromTeamCommentFeatures(data)},proofs:function proofs(data){return(new _TeamProofFeatures2.default).fromTeamProofFeatures(data)},accounts:function accounts(data){return(new _TeamAccountFeatures2.default).fromTeamAccountFeatures(data)}};var TeamFeatures=function(){function TeamFeatures(){_classCallCheck(this,TeamFeatures)}TeamFeatures.prototype.fromTeamFeatures=function fromTeamFeatures(teamFeaturesData){(0,_transform2.default)(this,teamFeaturesSchema,teamFeaturesData);return this};return TeamFeatures}();exports.default=TeamFeatures;
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _TeamEmailFeatures=require("./TeamEmailFeatures");var _TeamEmailFeatures2=_interopRequireDefault(_TeamEmailFeatures);var _TeamCommentFeatures=require("./TeamCommentFeatures");var _TeamCommentFeatures2=_interopRequireDefault(_TeamCommentFeatures);var _TeamProofFeatures=require("./TeamProofFeatures");var _TeamProofFeatures2=_interopRequireDefault(_TeamProofFeatures);var _TeamAccountFeatures=require("./TeamAccountFeatures");var _TeamAccountFeatures2=_interopRequireDefault(_TeamAccountFeatures);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var teamFeaturesSchema={emails:function emails(data){return(new _TeamEmailFeatures2.default).fromTeamEmailFeatures(data)},comments:function comments(data){return(new _TeamCommentFeatures2.default).fromTeamCommentFeatures(data)},proofs:function proofs(data){return(new _TeamProofFeatures2.default).fromTeamProofFeatures(data)},accounts:function accounts(data){return(new _TeamAccountFeatures2.default).fromTeamAccountFeatures(data)},branding:function branding(data){return{emailLinkColor:data.EmailLinkColor,emailButtonColor:data.EmailButtonColor,emailButtonTextColor:data.EmailButtonTextColor}}};var TeamFeatures=function(){function TeamFeatures(){_classCallCheck(this,TeamFeatures)}TeamFeatures.prototype.fromTeamFeatures=function fromTeamFeatures(teamFeaturesData){(0,_transform2.default)(this,teamFeaturesSchema,teamFeaturesData);return this};return TeamFeatures}();exports.default=TeamFeatures;
|
package/lib/models/Workflow.d.ts
CHANGED
|
@@ -47,6 +47,12 @@ declare class Workflow {
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
*/
|
|
49
49
|
startFrom: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a workflow is favorite.
|
|
52
|
+
*
|
|
53
|
+
* @type {boolean}
|
|
54
|
+
*/
|
|
55
|
+
isFavorite: boolean;
|
|
50
56
|
/**
|
|
51
57
|
* Returns a {@link WorkflowStep} by it's position within the workflow.
|
|
52
58
|
*
|
package/lib/models/Workflow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _WorkflowStep=require("./WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var workflowSchema={id:"WorkflowId",name:"Title",isOwnedByTeam:"OwnedByTeam",teamId:"TeamId",ownerId:"UserId",startFrom:"StartFrom",steps:(0,_transform.each)("WorkflowSteps",function(stepData){return(new _WorkflowStep2.default).fromWorkflowStep(stepData)})};var Workflow=function(){function Workflow(){_classCallCheck(this,Workflow)}Workflow.prototype.getStepByPosition=function getStepByPosition(position){var length=this.steps.length;for(var i=0;i<length;i+=1){var step=this.steps[i];if(step.position===position){return step}}return null};Workflow.prototype.getOrderedSteps=function getOrderedSteps(){return this.steps.sort(function(a,b){if(a.position<b.position)return-1;if(a.position>b.position)return 1;return 0})};Workflow.prototype.getApproverStep=function getApproverStep(){return this.getStepByPosition(1e3)};Workflow.prototype.fromWorkflow=function fromWorkflow(workflowData){(0,_transform2.default)(this,workflowSchema,workflowData);return this};return Workflow}();exports.default=Workflow;
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _WorkflowStep=require("./WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var workflowSchema={id:"WorkflowId",name:"Title",isOwnedByTeam:"OwnedByTeam",teamId:"TeamId",ownerId:"UserId",startFrom:"StartFrom",isFavorite:"IsFavorite",steps:(0,_transform.each)("WorkflowSteps",function(stepData){return(new _WorkflowStep2.default).fromWorkflowStep(stepData)})};var Workflow=function(){function Workflow(){_classCallCheck(this,Workflow)}Workflow.prototype.getStepByPosition=function getStepByPosition(position){var length=this.steps.length;for(var i=0;i<length;i+=1){var step=this.steps[i];if(step.position===position){return step}}return null};Workflow.prototype.getOrderedSteps=function getOrderedSteps(){return this.steps.sort(function(a,b){if(a.position<b.position)return-1;if(a.position>b.position)return 1;return 0})};Workflow.prototype.getApproverStep=function getApproverStep(){return this.getStepByPosition(1e3)};Workflow.prototype.fromWorkflow=function fromWorkflow(workflowData){(0,_transform2.default)(this,workflowSchema,workflowData);return this};return Workflow}();exports.default=Workflow;
|
|
@@ -571,6 +571,16 @@
|
|
|
571
571
|
"path": "/api/v2/workflows/create",
|
|
572
572
|
"body": ["title", "ownedByTeam"]
|
|
573
573
|
},
|
|
574
|
+
"workflows.favorite": {
|
|
575
|
+
"method": "POST",
|
|
576
|
+
"path": "/api/workflows/favorite",
|
|
577
|
+
"body": ["workflowId"]
|
|
578
|
+
},
|
|
579
|
+
"workflows.unfavorite": {
|
|
580
|
+
"method": "POST",
|
|
581
|
+
"path": "/api/workflows/unfavorite",
|
|
582
|
+
"body": ["workflowId"]
|
|
583
|
+
},
|
|
574
584
|
"workflows.update": {
|
|
575
585
|
"method": "POST",
|
|
576
586
|
"path": "/api/workflows/update",
|
|
@@ -835,13 +845,7 @@
|
|
|
835
845
|
"version": 2,
|
|
836
846
|
"method": "POST",
|
|
837
847
|
"path": "/api/admin/settings",
|
|
838
|
-
"body": ["displayComments", "editComments", "proofReference", "displayTeamName", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners"
|
|
839
|
-
},
|
|
840
|
-
"admin.team.features.sender-email.set": {
|
|
841
|
-
"version": 2,
|
|
842
|
-
"method": "POST",
|
|
843
|
-
"path": "/api/admin/sender-email/set",
|
|
844
|
-
"body": ["senderEmail"]
|
|
848
|
+
"body": ["displayComments", "editComments", "proofReference", "displayTeamName", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners"]
|
|
845
849
|
},
|
|
846
850
|
"integrations.get-setup-url": {
|
|
847
851
|
"method": "GET",
|