@pageproof/sdk-pr 270.0.1600393121423 → 270.0.1602540468272
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 +19 -0
- package/README.md +13 -0
- package/lib/api/Integrations.js +1 -1
- package/lib/api/Profile.d.ts +6 -6
- package/lib/api/Profile.js +1 -1
- package/lib/api/Proofs.d.ts +2 -0
- package/lib/api/Proofs.js +1 -1
- package/lib/api/ProofsAssetsExtractedText.js +1 -1
- package/lib/api/ProofsGroups.d.ts +4 -2
- package/lib/api/ProofsGroups.js +1 -1
- package/lib/api/ProofsLinkCheck.d.ts +33 -0
- package/lib/api/ProofsLinkCheck.js +1 -0
- package/lib/models/ProofGroup.d.ts +23 -1
- package/lib/models/ProofGroup.js +1 -1
- package/lib/models/User.d.ts +7 -0
- package/lib/models/User.js +1 -1
- package/lib/network/endpoints.json +14 -7
- package/lib/pageproof.js +1 -1
- package/lib/types/LinkCheckLinkResult.d.ts +22 -0
- package/lib/types/LinkCheckLinkResult.js +1 -0
- package/lib/types/LinkCheckPageResult.d.ts +18 -0
- package/lib/types/LinkCheckPageResult.js +1 -0
- package/lib/types/LinkCheckPageSummary.d.ts +18 -0
- package/lib/types/LinkCheckPageSummary.js +1 -0
- package/lib/types/LinkCheckResults.d.ts +15 -0
- package/lib/types/LinkCheckResults.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.140
|
|
4
|
+
|
|
5
|
+
Released on the 9th of October 2020.
|
|
6
|
+
|
|
7
|
+
- Minor bug fixes related to extracted text.
|
|
8
|
+
|
|
9
|
+
## 2.0.0-beta.139
|
|
10
|
+
|
|
11
|
+
Released on the 30th of September 2020.
|
|
12
|
+
|
|
13
|
+
- [[#251](https://github.com/PageProofCom/sdk/pull/251)] Support for fetching results of link checking on email proofs and re-checking links. See [Proofs.linkCheck](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsLinkCheck.js~ProofsLinkCheck.html).
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 2.0.0-beta.138
|
|
17
|
+
|
|
18
|
+
Released on the 18th of September 2020.
|
|
19
|
+
|
|
20
|
+
- [[#274](https://github.com/PageProofCom/sdk/pull/274)] Support for sharing a group with team. See [ProofGroup.isOwnedByTeam](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/ProofGroup.js~ProofGroup.html#instance-member-isOwnedByTeam) [ProofsGroups.create](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~ProofsGroups.html#instance-method-create) [ProofsGroups.update](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~ProofsGroups.html#instance-method-update)
|
|
21
|
+
|
|
3
22
|
## 2.0.0-beta.137
|
|
4
23
|
|
|
5
24
|
Released on the 10th of September 2020.
|
package/README.md
CHANGED
|
@@ -376,3 +376,16 @@ refreshes, we need to remind the client what the current session is.
|
|
|
376
376
|
[Session](./class/src/models/Session.js~Session.html) object contains the user's private keys.
|
|
377
377
|
Sharing the private keys with anybody, directly or even indirectly (over unencrypted traffic, for example), gives
|
|
378
378
|
anybody the ability to access & decrypt all proofs you have access to, including those you have been invited to.
|
|
379
|
+
|
|
380
|
+
### SDK development
|
|
381
|
+
Local development:
|
|
382
|
+
1. Node version <= 6
|
|
383
|
+
```sh
|
|
384
|
+
$ npm install
|
|
385
|
+
$ npm run dev
|
|
386
|
+
```
|
|
387
|
+
2. To test the SDK locally: switch to node version >=12, then
|
|
388
|
+
```sh
|
|
389
|
+
$ cd examples
|
|
390
|
+
$ node ./basic-node/index.js
|
|
391
|
+
```
|
package/lib/api/Integrations.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;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 Integrations=function(_API){_inherits(Integrations,_API);Integrations.prototype.configurations=function configurations(){return this.client.request("integrations.get-configurations",{level:this.level}).then(function(response){if(response.data){return response.data.integrations}return null})};Integrations.prototype.getSetupUrl=function getSetupUrl(integrationKey){return this.client.request("integrations.get-setup-url",{integration_key:integrationKey}).then(function(response){return{url:response.data.url,windowFeatures:response.data.windowFeatures}})};
|
|
1
|
+
"use strict";exports.__esModule=true;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 Integrations=function(_API){_inherits(Integrations,_API);function Integrations(client,level){_classCallCheck(this,Integrations);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.level=level;return _this}Integrations.prototype.configurations=function configurations(){return this.client.request("integrations.get-configurations",{level:this.level}).then(function(response){if(response.data){return response.data.integrations}return null})};Integrations.prototype.getSetupUrl=function getSetupUrl(integrationKey){return this.client.request("integrations.get-setup-url",{integration_key:integrationKey}).then(function(response){return{url:response.data.url,windowFeatures:response.data.windowFeatures}})};return Integrations}(_API3.default);exports.default=Integrations;
|
package/lib/api/Profile.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ export default Profile;
|
|
|
2
2
|
declare class Profile extends API {
|
|
3
3
|
/** @private */
|
|
4
4
|
constructor(client: any);
|
|
5
|
+
/**
|
|
6
|
+
* The Integrations API.
|
|
7
|
+
*
|
|
8
|
+
* @type {Integrations}
|
|
9
|
+
*/
|
|
10
|
+
integrations: Integrations;
|
|
5
11
|
/**
|
|
6
12
|
* Uploads the avatar for the current user.
|
|
7
13
|
*
|
|
@@ -75,12 +81,6 @@ declare class Profile extends API {
|
|
|
75
81
|
* @returns {Promise}
|
|
76
82
|
*/
|
|
77
83
|
clearStatus(): Promise<any>;
|
|
78
|
-
/**
|
|
79
|
-
* The Integrations API.
|
|
80
|
-
*
|
|
81
|
-
* @type {Integrations}
|
|
82
|
-
*/
|
|
83
|
-
integrations: Integrations;
|
|
84
84
|
}
|
|
85
85
|
import API from "./API";
|
|
86
86
|
import Integrations from "./Integrations";
|
package/lib/api/Profile.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);var _Integrations=require("./Integrations");var _Integrations2=_interopRequireDefault(_Integrations);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 Profile=function(_API){_inherits(Profile,_API);Profile.prototype.uploadAvatar=function uploadAvatar(file){var _this2=this;var bluffer=new _bluffer2.default;return bluffer.readBase64(file).then(function(base64){return _this2.client.request("profile.upload-avatar",{uploadedImage:"data:image/png;base64,"+base64})})};Profile.prototype.changePassword=function changePassword(currentPassword,password){var _this3=this;var crypto=this.client.crypto();return Promise.all([crypto.generatePasswordHash(currentPassword),crypto.generatePasswordHash(password),crypto.encryptPrivateKey(this.client.session.privateKeyPEM,password)]).then(function(_ref){var oldPassword=_ref[0],newPassword=_ref[1],newPrivateKey=_ref[2];return _this3.client.request("profile.change-password",{oldPassword:oldPassword,newPassword:newPassword,newPrivateKey:newPrivateKey})})};Profile.prototype.getStatus=function getStatus(){return this.client.request("profile.status").then(function(response){return response.data.status})};Profile.prototype.setStatus=function setStatus(status){return this.client.request("profile.set-status",status)};Profile.prototype.clearStatus=function clearStatus(){return this.client.request("profile.clear-status")};
|
|
1
|
+
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);var _Integrations=require("./Integrations");var _Integrations2=_interopRequireDefault(_Integrations);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 Profile=function(_API){_inherits(Profile,_API);function Profile(client){_classCallCheck(this,Profile);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.integrations=new _Integrations2.default(client,"user");return _this}Profile.prototype.uploadAvatar=function uploadAvatar(file){var _this2=this;var bluffer=new _bluffer2.default;return bluffer.readBase64(file).then(function(base64){return _this2.client.request("profile.upload-avatar",{uploadedImage:"data:image/png;base64,"+base64})})};Profile.prototype.changePassword=function changePassword(currentPassword,password){var _this3=this;var crypto=this.client.crypto();return Promise.all([crypto.generatePasswordHash(currentPassword),crypto.generatePasswordHash(password),crypto.encryptPrivateKey(this.client.session.privateKeyPEM,password)]).then(function(_ref){var oldPassword=_ref[0],newPassword=_ref[1],newPrivateKey=_ref[2];return _this3.client.request("profile.change-password",{oldPassword:oldPassword,newPassword:newPassword,newPrivateKey:newPrivateKey})})};Profile.prototype.getStatus=function getStatus(){return this.client.request("profile.status").then(function(response){return response.data.status})};Profile.prototype.setStatus=function setStatus(status){return this.client.request("profile.set-status",status)};Profile.prototype.clearStatus=function clearStatus(){return this.client.request("profile.clear-status")};return Profile}(_API3.default);exports.default=Profile;
|
package/lib/api/Proofs.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare class Proofs extends API {
|
|
|
56
56
|
* @type {ProofsCustomTools}
|
|
57
57
|
*/
|
|
58
58
|
customTools: ProofsCustomTools;
|
|
59
|
+
linkCheck: ProofLinkCheck;
|
|
59
60
|
/**
|
|
60
61
|
* Assigns a workflow to a proof.
|
|
61
62
|
*
|
|
@@ -457,4 +458,5 @@ import ProofsGroups from "./ProofsGroups";
|
|
|
457
458
|
import ProofsAudit from "./ProofsAudit";
|
|
458
459
|
import ProofsAssets from "./ProofsAssets";
|
|
459
460
|
import ProofsCustomTools from "./ProofsCustomTools";
|
|
461
|
+
import ProofLinkCheck from "./ProofsLinkCheck";
|
|
460
462
|
import Proof from "../models/Proof";
|
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 _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);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,_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,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,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,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;
|
|
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 _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.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,_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,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,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,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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _whatwgURL=require("../util/whatwgURL");var _whatwgURL2=_interopRequireDefault(_whatwgURL);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);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 ProofsAssetsExtractedText=function(_API){_inherits(ProofsAssetsExtractedText,_API);function ProofsAssetsExtractedText(){_classCallCheck(this,ProofsAssetsExtractedText);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ProofsAssetsExtractedText.prototype.resources=function resources(proofId){return this.client.request("proofs.assets.extracted-text",{proofId:proofId}).then(function(response){return response.data.result})};ProofsAssetsExtractedText.prototype.download=function download(resources,pageNumber){var _this2=this;var matchingPages=resources.pages.filter(function(page){return page.number===pageNumber});if(!matchingPages||!matchingPages.length){return Promise.reject(new Error("Page does not contain any text."))}var envelope=resources.envelope;var url=new _whatwgURL2.default(matchingPages[0].chunks[0].url);var bluffer=new _bluffer2.default;return this.client.rawRequest({method:"GET",url:url},{bluffer:true}).then(function(response){return response.body}).then(function(buffer){return bluffer.readBase64(buffer)}).then(function(buffer){return _this2.client.crypto().decryptBytes(buffer,envelope,_this2.client.session.privateKeyPEM,[],["unzip"])}).then(function(base64){return bluffer.createBase64(base64)}).then(function(buffer){return bluffer.readArrayBuffer(buffer)}).then(function(ab){return _this2.client.protobuf().ExtractedText(ab)})};return ProofsAssetsExtractedText}(_API3.default);exports.default=ProofsAssetsExtractedText;
|
|
1
|
+
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _whatwgURL=require("../util/whatwgURL");var _whatwgURL2=_interopRequireDefault(_whatwgURL);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);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 ProofsAssetsExtractedText=function(_API){_inherits(ProofsAssetsExtractedText,_API);function ProofsAssetsExtractedText(){_classCallCheck(this,ProofsAssetsExtractedText);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ProofsAssetsExtractedText.prototype.resources=function resources(proofId){return this.client.request("proofs.assets.extracted-text",{proofId:proofId}).then(function(response){return response.data.result}).catch(function(err){if(err&&err.response&&err.response.code===400)return;throw err})};ProofsAssetsExtractedText.prototype.download=function download(resources,pageNumber){var _this2=this;var matchingPages=resources.pages.filter(function(page){return page.number===pageNumber});if(!matchingPages||!matchingPages.length){return Promise.reject(new Error("Page does not contain any text."))}var envelope=resources.envelope;var url=new _whatwgURL2.default(matchingPages[0].chunks[0].url);var bluffer=new _bluffer2.default;return this.client.rawRequest({method:"GET",url:url},{bluffer:true}).then(function(response){return response.body}).then(function(buffer){return bluffer.readBase64(buffer)}).then(function(buffer){return _this2.client.crypto().decryptBytes(buffer,envelope,_this2.client.session.privateKeyPEM,[],["unzip"])}).then(function(base64){return bluffer.createBase64(base64)}).then(function(buffer){return bluffer.readArrayBuffer(buffer)}).then(function(ab){return _this2.client.protobuf().ExtractedText(ab)})};return ProofsAssetsExtractedText}(_API3.default);exports.default=ProofsAssetsExtractedText;
|
|
@@ -20,9 +20,10 @@ declare class ProofsGroups extends API {
|
|
|
20
20
|
* @since v2.0.0-beta.31
|
|
21
21
|
* @param {object} [option]
|
|
22
22
|
* @param {string} [options.name] An optional name of the group
|
|
23
|
+
* @param {string} [options.isOwnedByTeam] Whether the group should belong to your team
|
|
23
24
|
* @returns {Promise<ProofGroup>}
|
|
24
25
|
*/
|
|
25
|
-
create({ name, }?: any): Promise<ProofGroup>;
|
|
26
|
+
create({ name, isOwnedByTeam, }?: any): Promise<ProofGroup>;
|
|
26
27
|
/**
|
|
27
28
|
* Loads a single proof group by id.
|
|
28
29
|
*
|
|
@@ -47,9 +48,10 @@ declare class ProofsGroups extends API {
|
|
|
47
48
|
* @param {string} groupId The group id
|
|
48
49
|
* @param {object} [option]
|
|
49
50
|
* @param {string} [options.name] The name of the group to update
|
|
51
|
+
* @param {string} [options.isOwnedByTeam] If group can be shared with team
|
|
50
52
|
* @returns {Promise<ProofGroup>}
|
|
51
53
|
*/
|
|
52
|
-
update(groupId: string, { name }?: any): Promise<ProofGroup>;
|
|
54
|
+
update(groupId: string, { name, isOwnedByTeam, }?: any): Promise<ProofGroup>;
|
|
53
55
|
/**
|
|
54
56
|
* Removes a proof from a group.
|
|
55
57
|
*
|
package/lib/api/ProofsGroups.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofGroup=require("../models/ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _GroupsOwners=require("./GroupsOwners");var _GroupsOwners2=_interopRequireDefault(_GroupsOwners);var _GroupsWorkflows=require("./GroupsWorkflows");var _GroupsWorkflows2=_interopRequireDefault(_GroupsWorkflows);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 mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var ProofsGroups=function(_API){_inherits(ProofsGroups,_API);function ProofsGroups(client){_classCallCheck(this,ProofsGroups);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _GroupsOwners2.default(client);_this.workflows=new _GroupsWorkflows2.default(client);return _this}ProofsGroups.prototype.create=function create(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},name=_ref.name;return this.client.request("proofs.groups.create",{name:name}).then(mapResponseToGroup)};ProofsGroups.prototype.load=function load(groupId){return this.client.request("proofs.groups.load",{groupId:groupId}).then(mapResponseToGroup)};ProofsGroups.prototype.ready=function ready(groupId){return this.client.request("proofs.groups.ready",{groupId:groupId})};ProofsGroups.prototype.update=function update(groupId,_ref2){var name=_ref2.name;return this.client.request("proofs.groups.update",{groupId:groupId,name:name}).then(mapResponseToGroup)};ProofsGroups.prototype.removeProof=function removeProof(proofId){return this.client.request("proofs.groups.remove-proof",{proofId:proofId})};ProofsGroups.prototype.addProof=function addProof(groupId,proofId){return this.client.request("proofs.groups.add-proof",{groupId:groupId,proofId:proofId})};ProofsGroups.prototype.delete=function _delete(groupId){return this.client.request("proofs.groups.delete",{groupId:groupId})};ProofsGroups.prototype.archive=function archive(){for(var _len=arguments.length,groupIds=Array(_len),_key=0;_key<_len;_key++){groupIds[_key]=arguments[_key]}return this.client.request("proofs.groups.archive",{groupIds:groupIds})};ProofsGroups.prototype.reopen=function reopen(){for(var _len2=arguments.length,groupIds=Array(_len2),_key2=0;_key2<_len2;_key2++){groupIds[_key2]=arguments[_key2]}return this.client.request("proofs.groups.reopen",{groupIds:groupIds})};return ProofsGroups}(_API3.default);exports.default=ProofsGroups;
|
|
1
|
+
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofGroup=require("../models/ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _GroupsOwners=require("./GroupsOwners");var _GroupsOwners2=_interopRequireDefault(_GroupsOwners);var _GroupsWorkflows=require("./GroupsWorkflows");var _GroupsWorkflows2=_interopRequireDefault(_GroupsWorkflows);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 mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var ProofsGroups=function(_API){_inherits(ProofsGroups,_API);function ProofsGroups(client){_classCallCheck(this,ProofsGroups);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _GroupsOwners2.default(client);_this.workflows=new _GroupsWorkflows2.default(client);return _this}ProofsGroups.prototype.create=function create(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},name=_ref.name,isOwnedByTeam=_ref.isOwnedByTeam;return this.client.request("proofs.groups.create",{name:name,ownedByTeam:isOwnedByTeam}).then(mapResponseToGroup)};ProofsGroups.prototype.load=function load(groupId){return this.client.request("proofs.groups.load",{groupId:groupId}).then(mapResponseToGroup)};ProofsGroups.prototype.ready=function ready(groupId){return this.client.request("proofs.groups.ready",{groupId:groupId})};ProofsGroups.prototype.update=function update(groupId,_ref2){var name=_ref2.name,isOwnedByTeam=_ref2.isOwnedByTeam;return this.client.request("proofs.groups.update",{groupId:groupId,name:name,ownedByTeam:isOwnedByTeam}).then(mapResponseToGroup)};ProofsGroups.prototype.removeProof=function removeProof(proofId){return this.client.request("proofs.groups.remove-proof",{proofId:proofId})};ProofsGroups.prototype.addProof=function addProof(groupId,proofId){return this.client.request("proofs.groups.add-proof",{groupId:groupId,proofId:proofId})};ProofsGroups.prototype.delete=function _delete(groupId){return this.client.request("proofs.groups.delete",{groupId:groupId})};ProofsGroups.prototype.archive=function archive(){for(var _len=arguments.length,groupIds=Array(_len),_key=0;_key<_len;_key++){groupIds[_key]=arguments[_key]}return this.client.request("proofs.groups.archive",{groupIds:groupIds})};ProofsGroups.prototype.reopen=function reopen(){for(var _len2=arguments.length,groupIds=Array(_len2),_key2=0;_key2<_len2;_key2++){groupIds[_key2]=arguments[_key2]}return this.client.request("proofs.groups.reopen",{groupIds:groupIds})};return ProofsGroups}(_API3.default);exports.default=ProofsGroups;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default ProofsLinkCheck;
|
|
2
|
+
/**
|
|
3
|
+
* Proofs Link Check API
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
declare class ProofsLinkCheck extends API {
|
|
7
|
+
constructor(client: any);
|
|
8
|
+
/**
|
|
9
|
+
* Fetch the results for a Link Check scan of an email proof.
|
|
10
|
+
*
|
|
11
|
+
* @example <caption> Fetch the results of a given proof</caption>
|
|
12
|
+
* const proof = getProof(); // Get a proof from somewhere.
|
|
13
|
+
* const results = await client.proofs.linkCheck.results(proof.id);
|
|
14
|
+
*
|
|
15
|
+
* @param proofId The proofId to an email proof file.
|
|
16
|
+
* @since 2.0.0-beta.139
|
|
17
|
+
* @returns {Promise<LinkCheckResults>}
|
|
18
|
+
*/
|
|
19
|
+
results(proofId: any): Promise<LinkCheckResults>;
|
|
20
|
+
/**
|
|
21
|
+
* Requests a re-check of links for a given email proof.
|
|
22
|
+
*
|
|
23
|
+
* @example <caption>Re-check links for a given email proof</caption>
|
|
24
|
+
* const proof = getProof(); // Get a proof from somewhere.
|
|
25
|
+
* const results = await client.proofs.linkCheck.recheck(proof.id);
|
|
26
|
+
*
|
|
27
|
+
* @param proofId The proofId to an email proof.
|
|
28
|
+
* @since 2.0.0-beta.139
|
|
29
|
+
* @returns {Promise}
|
|
30
|
+
*/
|
|
31
|
+
recheck(proofId: any): Promise<any>;
|
|
32
|
+
}
|
|
33
|
+
import API from "./API";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.__esModule=true;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 ProofsLinkCheck=function(_API){_inherits(ProofsLinkCheck,_API);function ProofsLinkCheck(){_classCallCheck(this,ProofsLinkCheck);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ProofsLinkCheck.prototype.results=function results(proofId){return this.client.request("proofs.link-check.results",{proofId:proofId})};ProofsLinkCheck.prototype.recheck=function recheck(proofId){return this.client.request("proofs.link-check.recheck",{proofId:proofId})};return ProofsLinkCheck}(_API3.default);exports.default=ProofsLinkCheck;
|
|
@@ -37,13 +37,35 @@ declare class ProofGroup {
|
|
|
37
37
|
*/
|
|
38
38
|
proofs: Array<Proof>;
|
|
39
39
|
/**
|
|
40
|
-
* Whether the user can add new proofs to the
|
|
40
|
+
* Whether the user can add new proofs to the group.
|
|
41
41
|
*
|
|
42
42
|
* @since v2.0.0-beta.56
|
|
43
43
|
*
|
|
44
44
|
* @type {boolean}
|
|
45
45
|
*/
|
|
46
46
|
canAddProofs: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The group owner's team.
|
|
49
|
+
*
|
|
50
|
+
* @since v2.0.0-beta.138
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
teamId: string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the group is also owned by the group owner's team.
|
|
56
|
+
*
|
|
57
|
+
* @since v2.0.0-beta.138
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
*/
|
|
60
|
+
isOwnedByTeam: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The group owner's user Id.
|
|
63
|
+
*
|
|
64
|
+
* @since v2.0.0-beta.138
|
|
65
|
+
*
|
|
66
|
+
* @type {string}
|
|
67
|
+
*/
|
|
68
|
+
createdBy: string;
|
|
47
69
|
/**
|
|
48
70
|
* @private
|
|
49
71
|
*/
|
package/lib/models/ProofGroup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _Proof=require("./Proof");var _Proof2=_interopRequireDefault(_Proof);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 proofGroupSchema={canAddProofs:"CanAddProofs",id:"GroupId",name:"Name",isEmpty:"IsEmpty",isArchived:"Archived",proofs:(0,_transform.each)("ProofInfo",function(proofData){return(new _Proof2.default).fromProof(proofData)})};var ProofGroup=function(){function ProofGroup(){_classCallCheck(this,ProofGroup)}ProofGroup.prototype.fromProofGroup=function fromProofGroup(proofGroupData){(0,_transform2.default)(this,proofGroupSchema,proofGroupData);return this};return ProofGroup}();exports.default=ProofGroup;
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _Proof=require("./Proof");var _Proof2=_interopRequireDefault(_Proof);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 proofGroupSchema={canAddProofs:"CanAddProofs",id:"GroupId",name:"Name",isEmpty:"IsEmpty",isArchived:"Archived",teamId:"TeamId",createdBy:"CreatedBy",isOwnedByTeam:"OwnedByTeam",proofs:(0,_transform.each)("ProofInfo",function(proofData){return(new _Proof2.default).fromProof(proofData)})};var ProofGroup=function(){function ProofGroup(){_classCallCheck(this,ProofGroup)}ProofGroup.prototype.fromProofGroup=function fromProofGroup(proofGroupData){(0,_transform2.default)(this,proofGroupSchema,proofGroupData);return this};return ProofGroup}();exports.default=ProofGroup;
|
package/lib/models/User.d.ts
CHANGED
|
@@ -100,6 +100,13 @@ declare class User {
|
|
|
100
100
|
* @type {Object}
|
|
101
101
|
*/
|
|
102
102
|
features: Object;
|
|
103
|
+
/**
|
|
104
|
+
* The user's team ID.
|
|
105
|
+
*
|
|
106
|
+
* @since v2.0.0-beta.138
|
|
107
|
+
* @type {string}
|
|
108
|
+
*/
|
|
109
|
+
teamId: string;
|
|
103
110
|
/**
|
|
104
111
|
* @private
|
|
105
112
|
* @param {object} userJSON The serialised user object
|
package/lib/models/User.js
CHANGED
|
@@ -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 userSchema={id:"UserId",name:"Name",email:"Email",hasActivated:"Activated",hasRegistered:"IsRegistered",hasAvatar:"HasAvatar",accountType:"AccountType",teamType:"TeamType",teamLogo:"Branding.LogoURL",registeredDate:(0,_transform.date)("Registered"),lastLoginDate:(0,_transform.date)("LastLogin"),lastUploadDate:(0,_transform.date)("LastUpload"),isAdmin:"IsDomainAdmin",features:"Features"};var User=function(){function User(){_classCallCheck(this,User)}User.prototype.fromJSON=function fromJSON(userJSON){(0,_transform2.default)(this,Object.keys(userSchema),userJSON);return this};User.prototype.fromUser=function fromUser(userData){(0,_transform2.default)(this,userSchema,userData);return this};return User}();exports.default=User;
|
|
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 userSchema={id:"UserId",name:"Name",email:"Email",hasActivated:"Activated",hasRegistered:"IsRegistered",hasAvatar:"HasAvatar",accountType:"AccountType",teamType:"TeamType",teamLogo:"Branding.LogoURL",registeredDate:(0,_transform.date)("Registered"),lastLoginDate:(0,_transform.date)("LastLogin"),lastUploadDate:(0,_transform.date)("LastUpload"),isAdmin:"IsDomainAdmin",features:"Features",teamId:"DomainId"};var User=function(){function User(){_classCallCheck(this,User)}User.prototype.fromJSON=function fromJSON(userJSON){(0,_transform2.default)(this,Object.keys(userSchema),userJSON);return this};User.prototype.fromUser=function fromUser(userData){(0,_transform2.default)(this,userSchema,userData);return this};return User}();exports.default=User;
|
|
@@ -287,12 +287,12 @@
|
|
|
287
287
|
"proofs.groups.create": {
|
|
288
288
|
"method": "POST",
|
|
289
289
|
"path": "/api/proofs/groups/create",
|
|
290
|
-
"body": ["name"]
|
|
290
|
+
"body": ["name", "ownedByTeam"]
|
|
291
291
|
},
|
|
292
292
|
"proofs.groups.update": {
|
|
293
293
|
"method": "POST",
|
|
294
294
|
"path": "/api/proofs/groups/update",
|
|
295
|
-
"body": ["groupId", "name"]
|
|
295
|
+
"body": ["groupId", "name", "ownedByTeam"]
|
|
296
296
|
},
|
|
297
297
|
"proofs.groups.delete": {
|
|
298
298
|
"method": "POST",
|
|
@@ -731,15 +731,10 @@
|
|
|
731
731
|
"path": "/api/integrations/setup_url",
|
|
732
732
|
"query": ["integration_key"]
|
|
733
733
|
},
|
|
734
|
-
"admin.team.integrations.monday-dot-com.disable": {
|
|
735
|
-
"method": "POST",
|
|
736
|
-
"path": "/api/integrations/monday-dot-com/configuration/team/disable"
|
|
737
|
-
},
|
|
738
734
|
"integrations.get-configurations": {
|
|
739
735
|
"method": "GET",
|
|
740
736
|
"path": "/api/integrations/configuration",
|
|
741
737
|
"query": ["level"]
|
|
742
|
-
|
|
743
738
|
},
|
|
744
739
|
"admin.team.preferences.notifications.load": {
|
|
745
740
|
"method": "GET",
|
|
@@ -911,5 +906,17 @@
|
|
|
911
906
|
"method": "POST",
|
|
912
907
|
"path": "/api/email-upload/email-address",
|
|
913
908
|
"body": true
|
|
909
|
+
},
|
|
910
|
+
"proofs.link-check.results": {
|
|
911
|
+
"version": 2,
|
|
912
|
+
"method": "GET",
|
|
913
|
+
"chain": ["proofId"],
|
|
914
|
+
"path": "/api/link-check/results"
|
|
915
|
+
},
|
|
916
|
+
"proofs.link-check.recheck": {
|
|
917
|
+
"version": 2,
|
|
918
|
+
"method": "POST",
|
|
919
|
+
"body": ["proofId"],
|
|
920
|
+
"path": "/api/link-check/recheck"
|
|
914
921
|
}
|
|
915
922
|
}
|