@pageproof/sdk-pr 303.0.1608668877936 → 304.0.1610403288221
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 +6 -0
- package/lib/api/Proofs.d.ts +0 -15
- package/lib/api/Proofs.js +1 -1
- package/lib/api/ProofsIntegrationReferences.d.ts +9 -0
- package/lib/api/ProofsIntegrationReferences.js +1 -1
- package/lib/api/Workflows.d.ts +54 -0
- package/lib/api/Workflows.js +1 -1
- package/lib/models/DecisionSummary.js +1 -1
- package/lib/models/WorkflowUser.d.ts +6 -0
- package/lib/models/WorkflowUser.js +1 -1
- package/lib/network/endpoints.json +22 -6
- package/lib/pageproof.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.155
|
|
4
|
+
|
|
5
|
+
Released on the 8th of January 2021.
|
|
6
|
+
|
|
7
|
+
- [[#297](https://github.com/PageProofCom/sdk/pull/297)] Adds support for nudging with messages, and retrieving previous nudge messages. See [Workflows.nudgeUser](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Workflows.js~Workflows.html#instance-method-nudgeUser) and [Workflows.getNudgeMessage](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Workflows.html#instance-method-getNudgeMessage).
|
|
8
|
+
|
|
3
9
|
## 2.0.0-beta.154
|
|
4
10
|
|
|
5
11
|
Released on the 21st of December 2020.
|
package/lib/api/Proofs.d.ts
CHANGED
|
@@ -453,21 +453,6 @@ declare class Proofs extends API {
|
|
|
453
453
|
* @returns {Promise}
|
|
454
454
|
*/
|
|
455
455
|
next(proofId: string): Promise<any>;
|
|
456
|
-
/**
|
|
457
|
-
* Adds workflow template as a workflow on to proof or proofs which have no workflow yet.
|
|
458
|
-
*
|
|
459
|
-
* @example <caption>Adding workflow template to a proof</caption>
|
|
460
|
-
* await client.proofs.addWorkflow('PVNM8NTI1VSTCRN5', 'WIA76GGP3I4LDJXA');
|
|
461
|
-
*
|
|
462
|
-
* @example <caption>Adding workflow template to proofs</caption>
|
|
463
|
-
* await client.proofs.addWorkflow(['PVNM8NTI1VSTCRN5', 'PVNM8NTI1VSTCRN6'], 'WIA76GGP3I4LDJXA');
|
|
464
|
-
*
|
|
465
|
-
* @since v2.0.0-beta.154
|
|
466
|
-
* @param {string|Array<string>} proofIdOrIds The proof id or proof ids
|
|
467
|
-
* @param {string} workflowTemplateId The workflow template id
|
|
468
|
-
* @returns {Promise}
|
|
469
|
-
*/
|
|
470
|
-
addWorkflow(proofIdOrIds: string | string[], workflowTemplateId: string): Promise<any>;
|
|
471
456
|
}
|
|
472
457
|
import API from "./API";
|
|
473
458
|
import ProofsOwners from "./ProofsOwners";
|
package/lib/api/Proofs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofsOwners=require("./ProofsOwners");var _ProofsOwners2=_interopRequireDefault(_ProofsOwners);var _ProofsEditors=require("./ProofsEditors");var _ProofsEditors2=_interopRequireDefault(_ProofsEditors);var _ProofsReviewers=require("./ProofsReviewers");var _ProofsReviewers2=_interopRequireDefault(_ProofsReviewers);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _ProofsAudit=require("./ProofsAudit");var _ProofsAudit2=_interopRequireDefault(_ProofsAudit);var _ProofsAssets=require("./ProofsAssets");var _ProofsAssets2=_interopRequireDefault(_ProofsAssets);var _ProofsCustomTools=require("./ProofsCustomTools");var _ProofsCustomTools2=_interopRequireDefault(_ProofsCustomTools);var _ProofsIntegrationReferences=require("./ProofsIntegrationReferences");var _ProofsIntegrationReferences2=_interopRequireDefault(_ProofsIntegrationReferences);var _ProofsLinkCheck=require("./ProofsLinkCheck");var _ProofsLinkCheck2=_interopRequireDefault(_ProofsLinkCheck);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);var _constants=require("../util/constants");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 transformProofsForUpdate(proofs){var proofsArrForUpdate=[].concat(proofs);proofsArrForUpdate.forEach(function(proof){proof.proofId=proof.id;delete proof.id});return proofsArrForUpdate}var Proofs=function(_API){_inherits(Proofs,_API);function Proofs(client){_classCallCheck(this,Proofs);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _ProofsOwners2.default(client);_this.editors=new _ProofsEditors2.default(client);_this.reviewers=new _ProofsReviewers2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);_this.reminders=new _Reminders2.default(client);_this.audit=new _ProofsAudit2.default(client);_this.assets=new _ProofsAssets2.default(client);_this.customTools=new _ProofsCustomTools2.default(client);_this.integrationReferences=new _ProofsIntegrationReferences2.default(client);_this.linkCheck=new _ProofsLinkCheck2.default(client);return _this}Proofs.prototype.setWorkflow=function setWorkflow(proofId,workflowId){var _this2=this;return this.client.request("proofs.normalize-workflow",{proofId:proofId,workflowId:workflowId}).then(function(){return _this2.client.request("proofs.set-workflow",{proofId:proofId,workflowId:workflowId})})};Proofs.prototype.setTags=function setTags(proofId,tags){return this.client.request("proofs.set-tags",{relatedId:proofId,tag:tags.join(",")})};Proofs.prototype.deleteTag=function deleteTag(proofId,tag){return this.client.request("proofs.tag-delete",{relatedId:proofId,tag:tag})};Proofs.prototype.setFile=function setFile(proofId,fileId){var _this3=this;return this.client.request("proofs.set-file",{proofId:proofId,fileId:fileId}).then(function(){return _this3.client.request("proofs.distribute-file",{proofId:proofId})})};Proofs.prototype.create=function create(_ref){var _this4=this;var name=_ref.name,_ref$tags=_ref.tags,tags=_ref$tags===undefined?[]:_ref$tags,_ref$dueDate=_ref.dueDate,dueDate=_ref$dueDate===undefined?new Date(Date.now()+3*_constants.DAY_IN_MS):_ref$dueDate,messageToReviewers=_ref.messageToReviewers,workflow=_ref.workflow,workflowTemplate=_ref.workflowTemplate,file=_ref.file,group=_ref.group,previousProof=_ref.previousProof,team=_ref.team,reference=_ref.reference,customTools=_ref.customTools,integrationReferences=_ref.integrationReferences,_ref$reminders=_ref.reminders,reminders=_ref$reminders===undefined?[]:_ref$reminders,owners=_ref.owners,canDownload=_ref.canDownload,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start;return this.client.request("proofs.create",{proof:{name:name,tags:tags,dueDate:dueDate.toISOString(),messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,workflowTemplateId:workflowTemplate&&workflowTemplate.id||undefined,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,previousProofId:previousProof&&previousProof.id||undefined,teamSlug:team&&team.slug||undefined,reference:reference,integrationReferences:integrationReferences,reminders:[].concat(reminders),owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();if(customTools&&!previousProof){return _this4.customTools.update(proof.id,customTools).then(function(){return proof})}return proof})};Proofs.prototype.archive=function archive(proofIdOrIds){return this.client.request("proofs.archive",{proofIds:proofIdOrIds})};Proofs.prototype.unarchive=function unarchive(proofId){return this.client.request("proofs.unarchive",{proofId:proofId})};Proofs.prototype.delete=function _delete(proofId){return this.client.request("proofs.delete",{proofId:proofId})};Proofs.prototype.finish=function finish(proofId,decision){return this.client.request("proofs.finish",{proofId:proofId,decision:decision})};Proofs.prototype.approve=function approve(proofId,message){return this.client.request("proofs.manual-approval",{proofId:proofId,message:message})};Proofs.prototype.withdrawApproval=function withdrawApproval(proofId,messageToSender){return this.client.request("proofs.withdraw-approval",{proofId:proofId,messageToSender:messageToSender})};Proofs.prototype.generateEmail=function generateEmail(proofId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.client.request("email.proofs.generate",_extends({proofId:proofId},options)).then(function(response){return response.data})};Proofs.prototype.return=function _return(proofId){return this.client.request("proofs.return",{proofId:proofId})};Proofs.prototype.start=function start(proofId){return this.client.request("proofs.start",{proofId:proofId})};Proofs.prototype.removeEditor=function removeEditor(id){return this.client.request("proofs.remove-editor",{proofId:id})};Proofs.prototype.load=function load(proofId){return this.client.request("proofs.load",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.lock=function lock(proofId){return this.client.request("proofs.lock",{proofId:proofId})};Proofs.prototype.unlock=function unlock(proofId){return this.client.request("proofs.unlock",{proofId:proofId})};Proofs.prototype.requestUnlock=function requestUnlock(proofId){return this.client.request("proofs.request-unlock",{proofId:proofId})};Proofs.prototype.requestAccess=function requestAccess(proofId){return this.client.request("proofs.request-access",{proofId:proofId})};Proofs.prototype.images=function images(proofId){return this.client.request("proofs.images",{proofId:proofId}).then(function(response){return response.data.proof.file})};Proofs.prototype.setMessageToReviewers=function setMessageToReviewers(proofId,messageToReviewers){return this.client.request("proofs.set-reviewers-message",{proofId:proofId,messageToReviewers:messageToReviewers})};Proofs.prototype.returnTodos=function returnTodos(proofIdOrIds,_ref2){var messageToOwners=_ref2.messageToOwners,_ref2$markCommentsAsT=_ref2.markCommentsAsTodo,markCommentsAsTodo=_ref2$markCommentsAsT===undefined?false:_ref2$markCommentsAsT;return this.client.request("proofs.return-todos",{proofIds:[].concat(proofIdOrIds),messageToOwners:messageToOwners,markCommentAsTodo:markCommentsAsTodo})};Proofs.prototype.updateDecision=function updateDecision(proofId,decision){return this.client.request("proofs.update-decision",{proofId:proofId,decision:decision})};Proofs.prototype.update=function update(proofOrProofs){if(proofOrProofs.length===1||typeof proofOrProofs.length==="undefined"){var _concat$=[].concat(proofOrProofs)[0],id=_concat$.id,name=_concat$.name,tags=_concat$.tags,dueDate=_concat$.dueDate,messageToReviewers=_concat$.messageToReviewers,workflow=_concat$.workflow,file=_concat$.file,reference=_concat$.reference,integrationReferences=_concat$.integrationReferences,reminders=_concat$.reminders,owners=_concat$.owners,canDownload=_concat$.canDownload,start=_concat$.start;return this.client.request("proofs.update",{proof:{id:id,name:name,tags:tags,dueDate:dueDate?dueDate.toISOString():undefined,messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,fileId:file&&file.id||undefined,reference:reference,integrationReferences:integrationReferences,reminders:reminders?[].concat(reminders):undefined,owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();return proof})}return this.client.request("proofs.bulk-update",{proofs:transformProofsForUpdate(proofOrProofs)})};Proofs.prototype.next=function next(proofId){return this.client.request("proofs.next",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.addWorkflow=function addWorkflow(proofIdOrIds,workflowTemplateId){return this.client.request("proofs-workflow.add-bulk",{proofIds:[].concat(proofIdOrIds),workflowTemplateId:workflowTemplateId})};return Proofs}(_API3.default);exports.default=Proofs;
|
|
1
|
+
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofsOwners=require("./ProofsOwners");var _ProofsOwners2=_interopRequireDefault(_ProofsOwners);var _ProofsEditors=require("./ProofsEditors");var _ProofsEditors2=_interopRequireDefault(_ProofsEditors);var _ProofsReviewers=require("./ProofsReviewers");var _ProofsReviewers2=_interopRequireDefault(_ProofsReviewers);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _ProofsAudit=require("./ProofsAudit");var _ProofsAudit2=_interopRequireDefault(_ProofsAudit);var _ProofsAssets=require("./ProofsAssets");var _ProofsAssets2=_interopRequireDefault(_ProofsAssets);var _ProofsCustomTools=require("./ProofsCustomTools");var _ProofsCustomTools2=_interopRequireDefault(_ProofsCustomTools);var _ProofsIntegrationReferences=require("./ProofsIntegrationReferences");var _ProofsIntegrationReferences2=_interopRequireDefault(_ProofsIntegrationReferences);var _ProofsLinkCheck=require("./ProofsLinkCheck");var _ProofsLinkCheck2=_interopRequireDefault(_ProofsLinkCheck);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);var _constants=require("../util/constants");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 transformProofsForUpdate(proofs){var proofsArrForUpdate=[].concat(proofs);proofsArrForUpdate.forEach(function(proof){proof.proofId=proof.id;delete proof.id});return proofsArrForUpdate}var Proofs=function(_API){_inherits(Proofs,_API);function Proofs(client){_classCallCheck(this,Proofs);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _ProofsOwners2.default(client);_this.editors=new _ProofsEditors2.default(client);_this.reviewers=new _ProofsReviewers2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);_this.reminders=new _Reminders2.default(client);_this.audit=new _ProofsAudit2.default(client);_this.assets=new _ProofsAssets2.default(client);_this.customTools=new _ProofsCustomTools2.default(client);_this.integrationReferences=new _ProofsIntegrationReferences2.default(client);_this.linkCheck=new _ProofsLinkCheck2.default(client);return _this}Proofs.prototype.setWorkflow=function setWorkflow(proofId,workflowId){var _this2=this;return this.client.request("proofs.normalize-workflow",{proofId:proofId,workflowId:workflowId}).then(function(){return _this2.client.request("proofs.set-workflow",{proofId:proofId,workflowId:workflowId})})};Proofs.prototype.setTags=function setTags(proofId,tags){return this.client.request("proofs.set-tags",{relatedId:proofId,tag:tags.join(",")})};Proofs.prototype.deleteTag=function deleteTag(proofId,tag){return this.client.request("proofs.tag-delete",{relatedId:proofId,tag:tag})};Proofs.prototype.setFile=function setFile(proofId,fileId){var _this3=this;return this.client.request("proofs.set-file",{proofId:proofId,fileId:fileId}).then(function(){return _this3.client.request("proofs.distribute-file",{proofId:proofId})})};Proofs.prototype.create=function create(_ref){var _this4=this;var name=_ref.name,_ref$tags=_ref.tags,tags=_ref$tags===undefined?[]:_ref$tags,_ref$dueDate=_ref.dueDate,dueDate=_ref$dueDate===undefined?new Date(Date.now()+3*_constants.DAY_IN_MS):_ref$dueDate,messageToReviewers=_ref.messageToReviewers,workflow=_ref.workflow,workflowTemplate=_ref.workflowTemplate,file=_ref.file,group=_ref.group,previousProof=_ref.previousProof,team=_ref.team,reference=_ref.reference,customTools=_ref.customTools,integrationReferences=_ref.integrationReferences,_ref$reminders=_ref.reminders,reminders=_ref$reminders===undefined?[]:_ref$reminders,owners=_ref.owners,canDownload=_ref.canDownload,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start;return this.client.request("proofs.create",{proof:{name:name,tags:tags,dueDate:dueDate.toISOString(),messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,workflowTemplateId:workflowTemplate&&workflowTemplate.id||undefined,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,previousProofId:previousProof&&previousProof.id||undefined,teamSlug:team&&team.slug||undefined,reference:reference,integrationReferences:integrationReferences,reminders:[].concat(reminders),owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();if(customTools&&!previousProof){return _this4.customTools.update(proof.id,customTools).then(function(){return proof})}return proof})};Proofs.prototype.archive=function archive(proofIdOrIds){return this.client.request("proofs.archive",{proofIds:proofIdOrIds})};Proofs.prototype.unarchive=function unarchive(proofId){return this.client.request("proofs.unarchive",{proofId:proofId})};Proofs.prototype.delete=function _delete(proofId){return this.client.request("proofs.delete",{proofId:proofId})};Proofs.prototype.finish=function finish(proofId,decision){return this.client.request("proofs.finish",{proofId:proofId,decision:decision})};Proofs.prototype.approve=function approve(proofId,message){return this.client.request("proofs.manual-approval",{proofId:proofId,message:message})};Proofs.prototype.withdrawApproval=function withdrawApproval(proofId,messageToSender){return this.client.request("proofs.withdraw-approval",{proofId:proofId,messageToSender:messageToSender})};Proofs.prototype.generateEmail=function generateEmail(proofId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.client.request("email.proofs.generate",_extends({proofId:proofId},options)).then(function(response){return response.data})};Proofs.prototype.return=function _return(proofId){return this.client.request("proofs.return",{proofId:proofId})};Proofs.prototype.start=function start(proofId){return this.client.request("proofs.start",{proofId:proofId})};Proofs.prototype.removeEditor=function removeEditor(id){return this.client.request("proofs.remove-editor",{proofId:id})};Proofs.prototype.load=function load(proofId){return this.client.request("proofs.load",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.lock=function lock(proofId){return this.client.request("proofs.lock",{proofId:proofId})};Proofs.prototype.unlock=function unlock(proofId){return this.client.request("proofs.unlock",{proofId:proofId})};Proofs.prototype.requestUnlock=function requestUnlock(proofId){return this.client.request("proofs.request-unlock",{proofId:proofId})};Proofs.prototype.requestAccess=function requestAccess(proofId){return this.client.request("proofs.request-access",{proofId:proofId})};Proofs.prototype.images=function images(proofId){return this.client.request("proofs.images",{proofId:proofId}).then(function(response){return response.data.proof.file})};Proofs.prototype.setMessageToReviewers=function setMessageToReviewers(proofId,messageToReviewers){return this.client.request("proofs.set-reviewers-message",{proofId:proofId,messageToReviewers:messageToReviewers})};Proofs.prototype.returnTodos=function returnTodos(proofIdOrIds,_ref2){var messageToOwners=_ref2.messageToOwners,_ref2$markCommentsAsT=_ref2.markCommentsAsTodo,markCommentsAsTodo=_ref2$markCommentsAsT===undefined?false:_ref2$markCommentsAsT;return this.client.request("proofs.return-todos",{proofIds:[].concat(proofIdOrIds),messageToOwners:messageToOwners,markCommentAsTodo:markCommentsAsTodo})};Proofs.prototype.updateDecision=function updateDecision(proofId,decision){return this.client.request("proofs.update-decision",{proofId:proofId,decision:decision})};Proofs.prototype.update=function update(proofOrProofs){if(proofOrProofs.length===1||typeof proofOrProofs.length==="undefined"){var _concat$=[].concat(proofOrProofs)[0],id=_concat$.id,name=_concat$.name,tags=_concat$.tags,dueDate=_concat$.dueDate,messageToReviewers=_concat$.messageToReviewers,workflow=_concat$.workflow,file=_concat$.file,reference=_concat$.reference,integrationReferences=_concat$.integrationReferences,reminders=_concat$.reminders,owners=_concat$.owners,canDownload=_concat$.canDownload,start=_concat$.start;return this.client.request("proofs.update",{proof:{id:id,name:name,tags:tags,dueDate:dueDate?dueDate.toISOString():undefined,messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,fileId:file&&file.id||undefined,reference:reference,integrationReferences:integrationReferences,reminders:reminders?[].concat(reminders):undefined,owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();return proof})}return this.client.request("proofs.bulk-update",{proofs:transformProofsForUpdate(proofOrProofs)})};Proofs.prototype.next=function next(proofId){return this.client.request("proofs.next",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};return Proofs}(_API3.default);exports.default=Proofs;
|
|
@@ -38,5 +38,14 @@ declare class ProofsIntegrationReferences extends API {
|
|
|
38
38
|
* @returns {Promise}
|
|
39
39
|
*/
|
|
40
40
|
remove(proofId: string, referenceId: string): Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* Gets additional information about an integration reference reference
|
|
43
|
+
*
|
|
44
|
+
* @param {string} referenceType The type of the integration reference
|
|
45
|
+
* @param {string} referenceId The id of the integration reference
|
|
46
|
+
* @param {object} [params] Any additional parameters required for retrieving the information
|
|
47
|
+
* @returns {Promise<object>}
|
|
48
|
+
*/
|
|
49
|
+
loadReferenceAdditionalInformation(referenceType: string, referenceId: string, params?: any): Promise<any>;
|
|
41
50
|
}
|
|
42
51
|
import API from "./API";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);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}var ProofsIntegrationReferences=function(_API){_inherits(ProofsIntegrationReferences,_API);function ProofsIntegrationReferences(){_classCallCheck(this,ProofsIntegrationReferences);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ProofsIntegrationReferences.prototype.availableIntegrations=function availableIntegrations(){return this.client.request("integrations.get-available-reference-integrations").then(function(response){return response.data.integrations})};ProofsIntegrationReferences.prototype.options=function options(integrationKey,params){return this.client.request("integrations.get-available-reference-options",{params:_extends({},params,{integration_key:integrationKey})}).then(function(response){return response.data.optionTypes})};ProofsIntegrationReferences.prototype.add=function add(proofId,integrationReference){return this.client.request("integrations.proof-integration-references.add",{proofId:proofId,integrationReference:integrationReference})};ProofsIntegrationReferences.prototype.remove=function remove(proofId,referenceId){return this.client.request("integrations.proof-integration-references.remove",{proofId:proofId,referenceId:referenceId})};return ProofsIntegrationReferences}(_API3.default);exports.default=ProofsIntegrationReferences;
|
|
1
|
+
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);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}var ProofsIntegrationReferences=function(_API){_inherits(ProofsIntegrationReferences,_API);function ProofsIntegrationReferences(){_classCallCheck(this,ProofsIntegrationReferences);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ProofsIntegrationReferences.prototype.availableIntegrations=function availableIntegrations(){return this.client.request("integrations.get-available-reference-integrations").then(function(response){return response.data.integrations})};ProofsIntegrationReferences.prototype.options=function options(integrationKey,params){return this.client.request("integrations.get-available-reference-options",{params:_extends({},params,{integration_key:integrationKey})}).then(function(response){return response.data.optionTypes})};ProofsIntegrationReferences.prototype.add=function add(proofId,integrationReference){return this.client.request("integrations.proof-integration-references.add",{proofId:proofId,integrationReference:integrationReference})};ProofsIntegrationReferences.prototype.remove=function remove(proofId,referenceId){return this.client.request("integrations.proof-integration-references.remove",{proofId:proofId,referenceId:referenceId})};ProofsIntegrationReferences.prototype.loadReferenceAdditionalInformation=function loadReferenceAdditionalInformation(referenceType,referenceId,params){return this.client.request("integrations.get-reference-additional-information",{params:_extends({},params,{reference_type:referenceType,reference_id:referenceId})}).then(function(response){return response.data.information})};return ProofsIntegrationReferences}(_API3.default);exports.default=ProofsIntegrationReferences;
|
package/lib/api/Workflows.d.ts
CHANGED
|
@@ -276,6 +276,37 @@ declare class Workflows extends API {
|
|
|
276
276
|
* @returns {Promise}
|
|
277
277
|
*/
|
|
278
278
|
skipAll(workflowId: string): Promise<any>;
|
|
279
|
+
/**
|
|
280
|
+
* Nudge a user from the currently visible step of a workflow
|
|
281
|
+
*
|
|
282
|
+
* @example <caption>Nudge current visible step user</caption>
|
|
283
|
+
* await client.workflows.nudgeUser('W8VN0H4UYFVV1VQL', 'UFAFSRPX40JRMLSY', 'new nudge message');
|
|
284
|
+
*
|
|
285
|
+
* @example <caption>Nudge current visible step user without message</caption>
|
|
286
|
+
* await client.workflows.nudgeUser('W8VN0H4UYFVV1VQL', 'UFAFSRPX40JRMLSY');
|
|
287
|
+
*
|
|
288
|
+
* @since v2.0.0-beta.155
|
|
289
|
+
* @param {string} workflowId The workflow id
|
|
290
|
+
* @param {string} userId The user id
|
|
291
|
+
* @param {string|null} [message] The nudge message
|
|
292
|
+
* @returns {Promise}
|
|
293
|
+
*/
|
|
294
|
+
nudgeUser(workflowId: string, userId: string, message?: string): Promise<any>;
|
|
295
|
+
/**
|
|
296
|
+
* Nudge all users from the currently visible steps of a workflow
|
|
297
|
+
*
|
|
298
|
+
* @example <caption>Nudge all current visible steps users</caption>
|
|
299
|
+
* await client.workflows.nudgeAll('W8VN0H4UYFVV1VQL', 'new nudge message');
|
|
300
|
+
*
|
|
301
|
+
* @example <caption>Nudge all current visible step user without message</caption>
|
|
302
|
+
* await client.workflows.nudgeAll('W8VN0H4UYFVV1VQL');
|
|
303
|
+
*
|
|
304
|
+
* @since v2.0.0-beta.155
|
|
305
|
+
* @param {string} workflowId The workflow id
|
|
306
|
+
* @param {string|null} [message] The nudge message
|
|
307
|
+
* @returns {Promise}
|
|
308
|
+
*/
|
|
309
|
+
nudgeAll(workflowId: string, message?: string): Promise<any>;
|
|
279
310
|
/**
|
|
280
311
|
* Set a step id as starting point for the workflow.
|
|
281
312
|
*
|
|
@@ -332,6 +363,29 @@ declare class Workflows extends API {
|
|
|
332
363
|
name?: string;
|
|
333
364
|
isOwnedByTeam?: boolean;
|
|
334
365
|
}): Promise<Workflow>;
|
|
366
|
+
/**
|
|
367
|
+
* Load the nudge all message that the users most recently received.
|
|
368
|
+
*
|
|
369
|
+
* @example <caption>Loading the nudge all message</caption>
|
|
370
|
+
* await client.workflows.getNudgeAllMessage(proof.workflowId);
|
|
371
|
+
*
|
|
372
|
+
* @since 2.0.0-beta.155
|
|
373
|
+
* @param {string} workflowId The workflow id
|
|
374
|
+
* @returns {Promise<string|null>}
|
|
375
|
+
*/
|
|
376
|
+
getNudgeAllMessage(workflowId: string): Promise<string>;
|
|
377
|
+
/**
|
|
378
|
+
* Load the nudge message that the user most recently received.
|
|
379
|
+
*
|
|
380
|
+
* @example <caption>Loading the user nudge message</caption>
|
|
381
|
+
* await client.workflows.getNudgeMessage(proof.workflowId, userId);
|
|
382
|
+
*
|
|
383
|
+
* @since 2.0.0-beta.155
|
|
384
|
+
* @param {string} workflowId The workflow id
|
|
385
|
+
* @param {string} userId The id of the user that received the nudge message
|
|
386
|
+
* @returns {Promise<string|null>}
|
|
387
|
+
*/
|
|
388
|
+
getNudgeMessage(workflowId: string, userId: string): Promise<string>;
|
|
335
389
|
/** @private */
|
|
336
390
|
_duplicateWorkflow(workflowId: any, options: any): any;
|
|
337
391
|
/** @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(!hasEnoughUserDetails(approver)){return Promise.reject(Error("An approver is required to create a workflow."))}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?_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.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._duplicateWorkflow=function _duplicateWorkflow(workflowId,options){var _this3=this;return this.client.request("workflows.duplicate",{workflowId:workflowId,noOwners:options&&options.includeOwners===false?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}).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(!hasEnoughUserDetails(approver)){return Promise.reject(Error("An approver is required to create a workflow."))}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?_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}).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}).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 +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 decisionSummarySchema={count:(0,_transform.number)("Count"),decision:(0,_transform.number)("Decision"),users:(0,_transform.each)("Users",function(userData){return{id:userData.UserId,name:userData.Name,email:userData.Email}})};var DecisionSummary=function(){function DecisionSummary(){_classCallCheck(this,DecisionSummary)}DecisionSummary.prototype.fromDecisionSummary=function fromDecisionSummary(decisionSummaryData){(0,_transform2.default)(this,decisionSummarySchema,decisionSummaryData);return this};return DecisionSummary}();exports.default=DecisionSummary;
|
|
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 decisionSummarySchema={count:(0,_transform.number)("Count"),decision:(0,_transform.number)("Decision"),users:(0,_transform.each)("Users",function(userData){return{id:userData.UserId,name:userData.Name,email:userData.Email,nudgedDate:(0,_transform.date)("NudgedInStep")(userData)}})};var DecisionSummary=function(){function DecisionSummary(){_classCallCheck(this,DecisionSummary)}DecisionSummary.prototype.fromDecisionSummary=function fromDecisionSummary(decisionSummaryData){(0,_transform2.default)(this,decisionSummarySchema,decisionSummaryData);return this};return DecisionSummary}();exports.default=DecisionSummary;
|
|
@@ -20,6 +20,12 @@ declare class WorkflowUser extends User {
|
|
|
20
20
|
* @type {WorkflowUserRole}
|
|
21
21
|
*/
|
|
22
22
|
role: WorkflowUserRole;
|
|
23
|
+
/**
|
|
24
|
+
* The date the user was most recently nudged in this step
|
|
25
|
+
*
|
|
26
|
+
* @type {Date}
|
|
27
|
+
*/
|
|
28
|
+
nudgedDate: Date;
|
|
23
29
|
/**
|
|
24
30
|
* The current state of the user in the {@link WorkflowStep}.
|
|
25
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User2=require("./User");var _User3=_interopRequireDefault(_User2);var _WorkflowUserState=require("../enum/WorkflowUserState");var _WorkflowUserState2=_interopRequireDefault(_WorkflowUserState);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}var workflowUserSchema={id:"UserId",name:"Name",email:"Email",role:"Role",permissions:function permissions(userData){return{inviter:userData.IsInviter}}};var WorkflowUser=function(_User){_inherits(WorkflowUser,_User);function WorkflowUser(){_classCallCheck(this,WorkflowUser);return _possibleConstructorReturn(this,_User.apply(this,arguments))}WorkflowUser.prototype._calculateState=function _calculateState(userData,workflowStepData){if(userData.SkippedInStep){this.state=_WorkflowUserState2.default.SKIPPED}else if(userData.CompleteInStep){this.state=_WorkflowUserState2.default.FINISHED}else if(userData.ViewedInStep){this.state=_WorkflowUserState2.default.SEEN}else if(workflowStepData.Visible){this.state=_WorkflowUserState2.default.VISIBLE}else{this.state=_WorkflowUserState2.default.NOT_VISIBLE}};WorkflowUser.prototype.fromWorkflowUser=function fromWorkflowUser(workflowUserData){this._calculateState({},{});(0,_transform2.default)(this,workflowUserSchema,workflowUserData);return this};return WorkflowUser}(_User3.default);exports.default=WorkflowUser;
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User2=require("./User");var _User3=_interopRequireDefault(_User2);var _WorkflowUserState=require("../enum/WorkflowUserState");var _WorkflowUserState2=_interopRequireDefault(_WorkflowUserState);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}var workflowUserSchema={id:"UserId",name:"Name",email:"Email",role:"Role",permissions:function permissions(userData){return{inviter:userData.IsInviter}},nudgedDate:(0,_transform.date)("NudgedInStep")};var WorkflowUser=function(_User){_inherits(WorkflowUser,_User);function WorkflowUser(){_classCallCheck(this,WorkflowUser);return _possibleConstructorReturn(this,_User.apply(this,arguments))}WorkflowUser.prototype._calculateState=function _calculateState(userData,workflowStepData){if(userData.SkippedInStep){this.state=_WorkflowUserState2.default.SKIPPED}else if(userData.CompleteInStep){this.state=_WorkflowUserState2.default.FINISHED}else if(userData.ViewedInStep){this.state=_WorkflowUserState2.default.SEEN}else if(workflowStepData.Visible){this.state=_WorkflowUserState2.default.VISIBLE}else{this.state=_WorkflowUserState2.default.NOT_VISIBLE}};WorkflowUser.prototype.fromWorkflowUser=function fromWorkflowUser(workflowUserData){this._calculateState({},{});(0,_transform2.default)(this,workflowUserSchema,workflowUserData);return this};return WorkflowUser}(_User3.default);exports.default=WorkflowUser;
|
|
@@ -538,6 +538,11 @@
|
|
|
538
538
|
"path": "/api/v2/workflows/detail",
|
|
539
539
|
"chain": ["workflowId"]
|
|
540
540
|
},
|
|
541
|
+
"workflows.nudge-message": {
|
|
542
|
+
"method": "GET",
|
|
543
|
+
"path": "/api/workflows/nudgemessage",
|
|
544
|
+
"query": ["workflowId", "userId"]
|
|
545
|
+
},
|
|
541
546
|
"workflows.steps.add": {
|
|
542
547
|
"version": 2,
|
|
543
548
|
"method": "POST",
|
|
@@ -582,6 +587,18 @@
|
|
|
582
587
|
"path": "/api/workflows/skipall",
|
|
583
588
|
"body": ["workflowId"]
|
|
584
589
|
},
|
|
590
|
+
"workflows.user.nudge": {
|
|
591
|
+
"version": 2,
|
|
592
|
+
"method": "POST",
|
|
593
|
+
"path": "/api/workflows/user/nudge",
|
|
594
|
+
"body": ["workflowId", "userId", "message"]
|
|
595
|
+
},
|
|
596
|
+
"workflows.nudge-all": {
|
|
597
|
+
"version": 2,
|
|
598
|
+
"method": "POST",
|
|
599
|
+
"path": "/api/workflows/nudgeall",
|
|
600
|
+
"body": ["workflowId", "message"]
|
|
601
|
+
},
|
|
585
602
|
"workflows.delete": {
|
|
586
603
|
"method": "POST",
|
|
587
604
|
"path": "/api/workflows/delete",
|
|
@@ -662,12 +679,6 @@
|
|
|
662
679
|
"path": "/api/proofs/reviewers/add",
|
|
663
680
|
"body": ["proofIds", "reviewers"]
|
|
664
681
|
},
|
|
665
|
-
"proofs-workflow.add-bulk": {
|
|
666
|
-
"version": 2,
|
|
667
|
-
"method": "POST",
|
|
668
|
-
"path": "/api/proofs/workflow/add/bulk",
|
|
669
|
-
"body": ["proofIds", "workflowTemplateId"]
|
|
670
|
-
},
|
|
671
682
|
"proofs-owners.remove": {
|
|
672
683
|
"version": 2,
|
|
673
684
|
"method": "POST",
|
|
@@ -780,6 +791,11 @@
|
|
|
780
791
|
"path": "/api/integrations/reference/options",
|
|
781
792
|
"query": "params"
|
|
782
793
|
},
|
|
794
|
+
"integrations.get-reference-additional-information": {
|
|
795
|
+
"method": "GET",
|
|
796
|
+
"path": "/api/integrations/reference/additional_information",
|
|
797
|
+
"query": "params"
|
|
798
|
+
},
|
|
783
799
|
"integrations.proof-integration-references.add": {
|
|
784
800
|
"version": 2,
|
|
785
801
|
"method": "POST",
|