@pageproof/sdk-pr 344.0.1622175750163 → 345.0.1622169403354
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 +2 -2
- package/lib/api/Proofs.d.ts +14 -0
- package/lib/api/Proofs.js +1 -1
- package/lib/api/admin/TeamUsers.d.ts +1 -61
- package/lib/api/admin/TeamUsers.js +1 -76
- package/lib/network/endpoints.json +5 -10
- package/lib/pageproof.js +1 -1
- package/lib/sync-crypto-adapter.js +1 -1
- package/lib/util/constants.d.ts +2 -0
- package/lib/util/constants.js +1 -1
- package/lib/worker-crypto-adapter.js +1 -1
- package/lib/{worker.5ce9bb12.js → worker.d1e7122f.js} +2 -2
- package/package.json +1 -1
- package/lib/types/TeamUserInvitation.d.ts +0 -10
- package/lib/types/TeamUserInvitation.js +0 -1
- package/lib/types/TeamUserInvitationUser.d.ts +0 -14
- package/lib/types/TeamUserInvitationUser.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## 2.0.0-beta.169
|
|
4
4
|
|
|
5
|
-
Released on the
|
|
5
|
+
Released on the 28th of May 2021.
|
|
6
6
|
|
|
7
|
-
- [[#
|
|
7
|
+
- [[#345](https://github.com/PageProofCom/sdk/pull/345)] Support for fetching credentials for video proof. See [Proofs.videoCredentials](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-method-videoCredentials).
|
|
8
8
|
|
|
9
9
|
## 2.0.0-beta.168
|
|
10
10
|
|
package/lib/api/Proofs.d.ts
CHANGED
|
@@ -390,6 +390,20 @@ declare class Proofs extends API {
|
|
|
390
390
|
* @returns {Promise<object>}
|
|
391
391
|
*/
|
|
392
392
|
images(proofId: string): Promise<any>;
|
|
393
|
+
/**
|
|
394
|
+
* Send a request to get the video credentials for a video proof.
|
|
395
|
+
*
|
|
396
|
+
* @example <caption>Fetch video credentials</caption>
|
|
397
|
+
* const videoCredentials = await client.proofs.videoCredentials('PIA76GGP3I4LDJXB');
|
|
398
|
+
* const [url, bearer] = videoCredentials.split('|');
|
|
399
|
+
*
|
|
400
|
+
* @since v2.0.0-beta.169
|
|
401
|
+
* @param {string} proofId The proof id
|
|
402
|
+
* @returns {Promise<string>}
|
|
403
|
+
*/
|
|
404
|
+
videoCredentials(proofId: string): Promise<string>;
|
|
405
|
+
/** @private */
|
|
406
|
+
_videoCredentials(proofId: any): any;
|
|
393
407
|
/**
|
|
394
408
|
* Set message to reviewers on a proof.
|
|
395
409
|
*
|
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 _ProofsDecisions=require("./ProofsDecisions");var _ProofsDecisions2=_interopRequireDefault(_ProofsDecisions);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);_this.decisions=new _ProofsDecisions2.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,isPublic=_ref.isPublic,_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?dueDate.toISOString():String(dueDate),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,isPublic:isPublic,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,isPublic=_concat$.isPublic,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,isPublic:isPublic,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})};Proofs.prototype.sendShareLink=function sendShareLink(_ref3){var proofId=_ref3.proofId,message=_ref3.message,emailAddresses=_ref3.emailAddresses;return this.client.request("proofs.send-share-link",{proofId:proofId,message:message,emailAddresses:emailAddresses})};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 _ProofsDecisions=require("./ProofsDecisions");var _ProofsDecisions2=_interopRequireDefault(_ProofsDecisions);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);var _whatwgURL=require("../util/whatwgURL");var _whatwgURL2=_interopRequireDefault(_whatwgURL);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);_this.decisions=new _ProofsDecisions2.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,isPublic=_ref.isPublic,_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?dueDate.toISOString():String(dueDate),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,isPublic:isPublic,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.videoCredentials=function videoCredentials(proofId){var _this5=this;return this.client.cache.auto(_constants.VIDEO_CREDENTIALS_CACHE_PREFIX+proofId,function(){return _this5._videoCredentials(proofId)})};Proofs.prototype._videoCredentials=function _videoCredentials(proofId){var _this6=this;return this.client.request("proofs.video-credentials",{proofId:proofId}).then(function(response){return _this6.client.rawRequest({method:"GET",url:new _whatwgURL2.default(response.data.videoCredentials.url)}).then(function(rawResponse){return rawResponse.body}).then(function(encryptedData){var envelopeAndData=response.data.envelope.envelope+"-"+encryptedData;return _this6.client.crypto().decryptImage(envelopeAndData,_this6.client.keyPairs.getPrivateKeyPEMs()).then(function(decryptedData){return atob(decryptedData)})})})};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,isPublic=_concat$.isPublic,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,isPublic:isPublic,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})};Proofs.prototype.sendShareLink=function sendShareLink(_ref3){var proofId=_ref3.proofId,message=_ref3.message,emailAddresses=_ref3.emailAddresses;return this.client.request("proofs.send-share-link",{proofId:proofId,message:message,emailAddresses:emailAddresses})};return Proofs}(_API3.default);exports.default=Proofs;
|
|
@@ -4,10 +4,6 @@ declare class TeamUsers extends API {
|
|
|
4
4
|
/**
|
|
5
5
|
* Retrieves a list of all enabled ("active") users in your team.
|
|
6
6
|
*
|
|
7
|
-
* @example <caption>Retrieves all enabled users</caption>
|
|
8
|
-
* const admin = await client.admin();
|
|
9
|
-
* const enabledUsers = await admin.team.users.enabled();
|
|
10
|
-
*
|
|
11
7
|
* @since v2.0.0-beta.13
|
|
12
8
|
* @returns {Promise<User>}
|
|
13
9
|
*/
|
|
@@ -15,34 +11,15 @@ declare class TeamUsers extends API {
|
|
|
15
11
|
/**
|
|
16
12
|
* Retrieves a list of all disabled ("deactivated") users in your team.
|
|
17
13
|
*
|
|
18
|
-
* @example <caption>Retrieves all disabled users</caption>
|
|
19
|
-
* const admin = await client.admin();
|
|
20
|
-
* const disabledUsers = await admin.team.users.disabled();
|
|
21
|
-
*
|
|
22
14
|
* @since v2.0.0-beta.13
|
|
23
15
|
* @returns {Promise<User>}
|
|
24
16
|
*/
|
|
25
17
|
disabled(): Promise<User>;
|
|
26
|
-
/**
|
|
27
|
-
* Retrieves a list of all pending invited users in the team.
|
|
28
|
-
*
|
|
29
|
-
* @example <caption>Retrieve all users with pending invitations</caption>
|
|
30
|
-
* const admin = await client.admin();
|
|
31
|
-
* const invitations = await admin.team.users.getInvitations();
|
|
32
|
-
*
|
|
33
|
-
* @since v2.0.0-beta.169
|
|
34
|
-
* @returns {Promise<Array<TeamUserInvitation>>}
|
|
35
|
-
*/
|
|
36
|
-
getInvitations(): Promise<TeamUserInvitation[]>;
|
|
37
18
|
/** @private */
|
|
38
19
|
_setEnabled(email: any, enabled: any): any;
|
|
39
20
|
/**
|
|
40
21
|
* Enable a previously disabled account in the team.
|
|
41
22
|
*
|
|
42
|
-
* @example <caption>Enable a disabled account</caption>
|
|
43
|
-
* const admin = await client.admin();
|
|
44
|
-
* await admin.team.users.enable('user@domain.com');
|
|
45
|
-
*
|
|
46
23
|
* @since v2.0.0-beta.13
|
|
47
24
|
* @param {string} email The disabled user's email address
|
|
48
25
|
* @returns {Promise}
|
|
@@ -51,10 +28,6 @@ declare class TeamUsers extends API {
|
|
|
51
28
|
/**
|
|
52
29
|
* Disable an account in the team.
|
|
53
30
|
*
|
|
54
|
-
* @example <caption>Disable an account</caption>
|
|
55
|
-
* const admin = await client.admin();
|
|
56
|
-
* await admin.team.users.disable('user@domain.com');
|
|
57
|
-
*
|
|
58
31
|
* @since v2.0.0-beta.13
|
|
59
32
|
* @param {string} email The user's email address
|
|
60
33
|
* @returns {Promise}
|
|
@@ -64,11 +37,9 @@ declare class TeamUsers extends API {
|
|
|
64
37
|
* Invite a new user to the team.
|
|
65
38
|
*
|
|
66
39
|
* @example <caption>Inviting single user</caption>
|
|
67
|
-
* const admin = await client.admin();
|
|
68
40
|
* await admin.team.users.invite('newuser@domain.com');
|
|
69
41
|
*
|
|
70
42
|
* @example <caption>Inviting multi users</caption>
|
|
71
|
-
* const admin = await client.admin();
|
|
72
43
|
* await admin.team.users.invite([
|
|
73
44
|
* 'newuser@domain.com',
|
|
74
45
|
* 'newuser1@domain.com'
|
|
@@ -79,44 +50,16 @@ declare class TeamUsers extends API {
|
|
|
79
50
|
* @returns {Promise}
|
|
80
51
|
*/
|
|
81
52
|
invite(emailOrEmails: any): Promise<any>;
|
|
82
|
-
/**
|
|
83
|
-
* Revoke a pending invitation to the team
|
|
84
|
-
*
|
|
85
|
-
* @example <caption>Revoking a pending invitation by user email</caption>
|
|
86
|
-
* const admin = await client.admin();
|
|
87
|
-
* await admin.team.users.revokeInvitation({
|
|
88
|
-
* email: 'newuser@domain.com',
|
|
89
|
-
* });
|
|
90
|
-
*
|
|
91
|
-
* @example <caption>Revoking a pending invitation by invitation id</caption>
|
|
92
|
-
* const admin = await client.admin();
|
|
93
|
-
* await admin.team.users.revokeInvitation({
|
|
94
|
-
* invitationId: '142110ea-ab38-4327-a747-1d48b0b5eb7e',
|
|
95
|
-
* });
|
|
96
|
-
*
|
|
97
|
-
* @since v2.0.0-beta.169
|
|
98
|
-
* @param {object} options
|
|
99
|
-
* @param {string} [options.email] The email of the user to revoke the invitation for
|
|
100
|
-
* @param {string} [options.invitationId] The invitation id
|
|
101
|
-
* @returns {Promise}
|
|
102
|
-
*/
|
|
103
|
-
revokeInvitation({ email, invitationId }: {
|
|
104
|
-
email?: string;
|
|
105
|
-
invitationId?: string;
|
|
106
|
-
}): Promise<any>;
|
|
107
53
|
/**
|
|
108
54
|
* Removes a user from the team.
|
|
109
55
|
*
|
|
110
56
|
* @example <caption>Removing single user by user email</caption>
|
|
111
|
-
* const admin = await client.admin();
|
|
112
57
|
* await admin.team.users.remove({email: 'existinguser@domain.com'});
|
|
113
58
|
*
|
|
114
59
|
* @example <caption>Removing single user by user id</caption>
|
|
115
|
-
* const admin = await client.admin();
|
|
116
60
|
* await admin.team.users.remove({id: 'ULVRHSLLP69ACHCT'});
|
|
117
61
|
*
|
|
118
62
|
* @example <caption>Removing multiple users (by email/ user id)</caption>
|
|
119
|
-
* const admin = await client.admin();
|
|
120
63
|
* await admin.team.users.remove([
|
|
121
64
|
* {email: 'existinguser@domain.com'},
|
|
122
65
|
* {id: 'ULVRHSLLP69ACHCT'},
|
|
@@ -137,13 +80,11 @@ declare class TeamUsers extends API {
|
|
|
137
80
|
* const input = document.querySelector('#file');
|
|
138
81
|
* input.onchange = async (event) => {
|
|
139
82
|
* const avatar = input.files[0];
|
|
140
|
-
* const admin = await client.admin();
|
|
141
83
|
* await admin.team.users.uploadAvatar('ULVRHSLLP69ACHCT', avatar);
|
|
142
84
|
* };
|
|
143
85
|
*
|
|
144
86
|
* @example <caption>Upload an avatar using fs (Node.js)</caption>
|
|
145
87
|
* const fs = require('fs');
|
|
146
|
-
* const admin = await client.admin();
|
|
147
88
|
* fs.readFile(__dirname + '/avatar.png', async (err, avatar) => {
|
|
148
89
|
* if (!err) {
|
|
149
90
|
* await admin.team.users.uploadAvatar('ULVRHSLLP69ACHCT', avatar);
|
|
@@ -159,8 +100,7 @@ declare class TeamUsers extends API {
|
|
|
159
100
|
/**
|
|
160
101
|
* Delete the avatar for the team user.
|
|
161
102
|
*
|
|
162
|
-
* @example
|
|
163
|
-
* const admin = await client.admin();
|
|
103
|
+
* @example
|
|
164
104
|
* await admin.team.users.deleteAvatar('ULVRHSLLP69ACHCT');
|
|
165
105
|
*
|
|
166
106
|
* @since v2.0.0-beta.160
|
|
@@ -45,10 +45,6 @@ var TeamUsers = function (_API) {
|
|
|
45
45
|
/**
|
|
46
46
|
* Retrieves a list of all enabled ("active") users in your team.
|
|
47
47
|
*
|
|
48
|
-
* @example <caption>Retrieves all enabled users</caption>
|
|
49
|
-
* const admin = await client.admin();
|
|
50
|
-
* const enabledUsers = await admin.team.users.enabled();
|
|
51
|
-
*
|
|
52
48
|
* @since v2.0.0-beta.13
|
|
53
49
|
* @returns {Promise<User>}
|
|
54
50
|
*/
|
|
@@ -59,10 +55,6 @@ var TeamUsers = function (_API) {
|
|
|
59
55
|
/**
|
|
60
56
|
* Retrieves a list of all disabled ("deactivated") users in your team.
|
|
61
57
|
*
|
|
62
|
-
* @example <caption>Retrieves all disabled users</caption>
|
|
63
|
-
* const admin = await client.admin();
|
|
64
|
-
* const disabledUsers = await admin.team.users.disabled();
|
|
65
|
-
*
|
|
66
58
|
* @since v2.0.0-beta.13
|
|
67
59
|
* @returns {Promise<User>}
|
|
68
60
|
*/
|
|
@@ -72,24 +64,6 @@ var TeamUsers = function (_API) {
|
|
|
72
64
|
return this.client.request('admin.team.users.disabled').then(transformResponseUsers);
|
|
73
65
|
};
|
|
74
66
|
|
|
75
|
-
/**
|
|
76
|
-
* Retrieves a list of all pending invited users in the team.
|
|
77
|
-
*
|
|
78
|
-
* @example <caption>Retrieve all users with pending invitations</caption>
|
|
79
|
-
* const admin = await client.admin();
|
|
80
|
-
* const invitations = await admin.team.users.getInvitations();
|
|
81
|
-
*
|
|
82
|
-
* @since v2.0.0-beta.169
|
|
83
|
-
* @returns {Promise<Array<TeamUserInvitation>>}
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
TeamUsers.prototype.getInvitations = function getInvitations() {
|
|
88
|
-
return this.client.request('admin.team.users.invitations').then(function (response) {
|
|
89
|
-
return response.data;
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
|
|
93
67
|
/** @private */
|
|
94
68
|
|
|
95
69
|
|
|
@@ -103,10 +77,6 @@ var TeamUsers = function (_API) {
|
|
|
103
77
|
/**
|
|
104
78
|
* Enable a previously disabled account in the team.
|
|
105
79
|
*
|
|
106
|
-
* @example <caption>Enable a disabled account</caption>
|
|
107
|
-
* const admin = await client.admin();
|
|
108
|
-
* await admin.team.users.enable('user@domain.com');
|
|
109
|
-
*
|
|
110
80
|
* @since v2.0.0-beta.13
|
|
111
81
|
* @param {string} email The disabled user's email address
|
|
112
82
|
* @returns {Promise}
|
|
@@ -120,10 +90,6 @@ var TeamUsers = function (_API) {
|
|
|
120
90
|
/**
|
|
121
91
|
* Disable an account in the team.
|
|
122
92
|
*
|
|
123
|
-
* @example <caption>Disable an account</caption>
|
|
124
|
-
* const admin = await client.admin();
|
|
125
|
-
* await admin.team.users.disable('user@domain.com');
|
|
126
|
-
*
|
|
127
93
|
* @since v2.0.0-beta.13
|
|
128
94
|
* @param {string} email The user's email address
|
|
129
95
|
* @returns {Promise}
|
|
@@ -138,11 +104,9 @@ var TeamUsers = function (_API) {
|
|
|
138
104
|
* Invite a new user to the team.
|
|
139
105
|
*
|
|
140
106
|
* @example <caption>Inviting single user</caption>
|
|
141
|
-
* const admin = await client.admin();
|
|
142
107
|
* await admin.team.users.invite('newuser@domain.com');
|
|
143
108
|
*
|
|
144
109
|
* @example <caption>Inviting multi users</caption>
|
|
145
|
-
* const admin = await client.admin();
|
|
146
110
|
* await admin.team.users.invite([
|
|
147
111
|
* 'newuser@domain.com',
|
|
148
112
|
* 'newuser1@domain.com'
|
|
@@ -160,52 +124,16 @@ var TeamUsers = function (_API) {
|
|
|
160
124
|
});
|
|
161
125
|
};
|
|
162
126
|
|
|
163
|
-
/**
|
|
164
|
-
* Revoke a pending invitation to the team
|
|
165
|
-
*
|
|
166
|
-
* @example <caption>Revoking a pending invitation by user email</caption>
|
|
167
|
-
* const admin = await client.admin();
|
|
168
|
-
* await admin.team.users.revokeInvitation({
|
|
169
|
-
* email: 'newuser@domain.com',
|
|
170
|
-
* });
|
|
171
|
-
*
|
|
172
|
-
* @example <caption>Revoking a pending invitation by invitation id</caption>
|
|
173
|
-
* const admin = await client.admin();
|
|
174
|
-
* await admin.team.users.revokeInvitation({
|
|
175
|
-
* invitationId: '142110ea-ab38-4327-a747-1d48b0b5eb7e',
|
|
176
|
-
* });
|
|
177
|
-
*
|
|
178
|
-
* @since v2.0.0-beta.169
|
|
179
|
-
* @param {object} options
|
|
180
|
-
* @param {string} [options.email] The email of the user to revoke the invitation for
|
|
181
|
-
* @param {string} [options.invitationId] The invitation id
|
|
182
|
-
* @returns {Promise}
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
TeamUsers.prototype.revokeInvitation = function revokeInvitation(_ref) {
|
|
187
|
-
var email = _ref.email,
|
|
188
|
-
invitationId = _ref.invitationId;
|
|
189
|
-
|
|
190
|
-
return this.client.request('admin.team.users.revoke-invitation', {
|
|
191
|
-
email: email,
|
|
192
|
-
invitationId: invitationId
|
|
193
|
-
});
|
|
194
|
-
};
|
|
195
|
-
|
|
196
127
|
/**
|
|
197
128
|
* Removes a user from the team.
|
|
198
129
|
*
|
|
199
130
|
* @example <caption>Removing single user by user email</caption>
|
|
200
|
-
* const admin = await client.admin();
|
|
201
131
|
* await admin.team.users.remove({email: 'existinguser@domain.com'});
|
|
202
132
|
*
|
|
203
133
|
* @example <caption>Removing single user by user id</caption>
|
|
204
|
-
* const admin = await client.admin();
|
|
205
134
|
* await admin.team.users.remove({id: 'ULVRHSLLP69ACHCT'});
|
|
206
135
|
*
|
|
207
136
|
* @example <caption>Removing multiple users (by email/ user id)</caption>
|
|
208
|
-
* const admin = await client.admin();
|
|
209
137
|
* await admin.team.users.remove([
|
|
210
138
|
* {email: 'existinguser@domain.com'},
|
|
211
139
|
* {id: 'ULVRHSLLP69ACHCT'},
|
|
@@ -233,13 +161,11 @@ var TeamUsers = function (_API) {
|
|
|
233
161
|
* const input = document.querySelector('#file');
|
|
234
162
|
* input.onchange = async (event) => {
|
|
235
163
|
* const avatar = input.files[0];
|
|
236
|
-
* const admin = await client.admin();
|
|
237
164
|
* await admin.team.users.uploadAvatar('ULVRHSLLP69ACHCT', avatar);
|
|
238
165
|
* };
|
|
239
166
|
*
|
|
240
167
|
* @example <caption>Upload an avatar using fs (Node.js)</caption>
|
|
241
168
|
* const fs = require('fs');
|
|
242
|
-
* const admin = await client.admin();
|
|
243
169
|
* fs.readFile(__dirname + '/avatar.png', async (err, avatar) => {
|
|
244
170
|
* if (!err) {
|
|
245
171
|
* await admin.team.users.uploadAvatar('ULVRHSLLP69ACHCT', avatar);
|
|
@@ -268,8 +194,7 @@ var TeamUsers = function (_API) {
|
|
|
268
194
|
/**
|
|
269
195
|
* Delete the avatar for the team user.
|
|
270
196
|
*
|
|
271
|
-
* @example
|
|
272
|
-
* const admin = await client.admin();
|
|
197
|
+
* @example
|
|
273
198
|
* await admin.team.users.deleteAvatar('ULVRHSLLP69ACHCT');
|
|
274
199
|
*
|
|
275
200
|
* @since v2.0.0-beta.160
|
|
@@ -415,6 +415,11 @@
|
|
|
415
415
|
"path": "/api/proofs/graph/thumbnails/",
|
|
416
416
|
"chain": ["proofId"]
|
|
417
417
|
},
|
|
418
|
+
"proofs.video-credentials": {
|
|
419
|
+
"method": "GET",
|
|
420
|
+
"path": "/api/proofs/assets/video-credentials/",
|
|
421
|
+
"chain": ["proofId"]
|
|
422
|
+
},
|
|
418
423
|
"proofs.finish": {
|
|
419
424
|
"method": "POST",
|
|
420
425
|
"path": "/api/proofs/finished",
|
|
@@ -794,16 +799,6 @@
|
|
|
794
799
|
"path": "/api/admin/member/avatar/delete",
|
|
795
800
|
"body": ["userId"]
|
|
796
801
|
},
|
|
797
|
-
"admin.team.users.invitations": {
|
|
798
|
-
"method": "GET",
|
|
799
|
-
"path": "/api/admin/team/users/invitations"
|
|
800
|
-
},
|
|
801
|
-
"admin.team.users.revoke-invitation": {
|
|
802
|
-
"version": 2,
|
|
803
|
-
"method": "POST",
|
|
804
|
-
"path": "/api/admin/team/users/revoke-invitation",
|
|
805
|
-
"body": ["email", "invitationId"]
|
|
806
|
-
},
|
|
807
802
|
"admin.team.features.load": {
|
|
808
803
|
"method": "GET",
|
|
809
804
|
"path": "/api/admin/settings",
|