@pageproof/sdk-pr 699.0.1780438282753 → 700.0.1781555980487
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 +11 -0
- package/lib/api/Comments.d.ts +24 -0
- package/lib/api/Comments.js +1 -1
- package/lib/api/Integrations.d.ts +39 -0
- package/lib/api/Integrations.js +1 -1
- package/lib/api/ProofsGroups.d.ts +2 -1
- package/lib/api/ProofsGroups.js +1 -1
- package/lib/api/admin/TeamFeatures.d.ts +1 -0
- package/lib/api/admin/TeamFeatures.js +4 -1
- package/lib/models/Comment.d.ts +9 -0
- package/lib/models/Comment.js +1 -1
- package/lib/models/Label.d.ts +36 -0
- package/lib/models/Label.js +1 -0
- package/lib/models/Proof.d.ts +0 -12
- package/lib/models/Proof.js +1 -1
- package/lib/models/TeamGeneralFeatures.d.ts +6 -0
- package/lib/models/TeamGeneralFeatures.js +1 -1
- package/lib/models/index.d.ts +2 -1
- package/lib/models/index.js +1 -1
- package/lib/network/endpoints.json +23 -2
- package/lib/pageproof.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 2.20.0
|
|
2
|
+
Released on the 13th of June 2026.
|
|
3
|
+
|
|
4
|
+
[PP-2353] Added support for comment labels.
|
|
5
|
+
|
|
6
|
+
## 2.19.0
|
|
7
|
+
Released on the 8th of June 2026.
|
|
8
|
+
|
|
9
|
+
[PP-10174] Added integration support with Jira.
|
|
10
|
+
|
|
11
|
+
|
|
1
12
|
## 2.18.0
|
|
2
13
|
|
|
3
14
|
Released on the 8th of May 2026.
|
package/lib/api/Comments.d.ts
CHANGED
|
@@ -92,6 +92,30 @@ declare class Comments extends API {
|
|
|
92
92
|
* @returns {Promise}
|
|
93
93
|
*/
|
|
94
94
|
delete(commentId: string): Promise<any>;
|
|
95
|
+
/**
|
|
96
|
+
* Adds a label to a comment.
|
|
97
|
+
*
|
|
98
|
+
* Labels are an Enterprise feature, gated by the team's `enableLabels` setting. The request is
|
|
99
|
+
* idempotent: adding a label that is already applied resolves successfully without emitting an
|
|
100
|
+
* event. Private comments cannot be labelled.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} commentId The comment id
|
|
103
|
+
* @param {string} labelId The label id to add
|
|
104
|
+
* @returns {Promise<string[]>} Resolves with the comment's full set of label ids after the change
|
|
105
|
+
*/
|
|
106
|
+
addLabel(commentId: string, labelId: string): Promise<string[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Removes a label from a comment.
|
|
109
|
+
*
|
|
110
|
+
* Labels are an Enterprise feature, gated by the team's `enableLabels` setting. The request is
|
|
111
|
+
* idempotent: removing a label that is not applied resolves successfully without emitting an
|
|
112
|
+
* event.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} commentId The comment id
|
|
115
|
+
* @param {string} labelId The label id to remove
|
|
116
|
+
* @returns {Promise<string[]>} Resolves with the comment's full set of label ids after the change
|
|
117
|
+
*/
|
|
118
|
+
removeLabel(commentId: string, labelId: string): Promise<string[]>;
|
|
95
119
|
/**
|
|
96
120
|
* Loads a proof's comments.
|
|
97
121
|
*
|
package/lib/api/Comments.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Comment=require("../models/Comment");var _Comment2=_interopRequireDefault(_Comment);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _constants=require("../util/constants");var _sort=require("../util/sort");var _v=require("../util/comments/v2");var _extractMentions=require("../util/comments/extractMentions");var _extractMentions2=_interopRequireDefault(_extractMentions);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _creationToken=require("../util/creationToken");var _throttle=require("../util/throttle");var _throttle2=_interopRequireDefault(_throttle);var _getCommentState=require("../util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);var _serializePins=require("../util/pins/serializePins");var _CommentsImport=require("./CommentsImport");var _CommentsImport2=_interopRequireDefault(_CommentsImport);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}function getCommentDataFromPages(pages){var comments=[];Object.keys(pages).forEach(function(pageNumber){pages[pageNumber].Comments.forEach(function(commentData){comments.push(commentData)})});return comments}var _sortPages=(0,_sort.sortObjectsByKey)("pageNumber");var _sortCreatedDateDESC=(0,_sort.sortObjectsByKey)("createdDate",true);var _sortCreatedDateASC=(0,_sort.sortObjectsByKey)("createdDate",false);var sortComments=(0,_sort.combineSort)(_sortPages,_sortCreatedDateDESC);var sortReplies=(0,_sort.combineSort)(_sortPages,_sortCreatedDateASC);function mapComments(commentsData){var comments=[];var replies=[];commentsData.forEach(function(commentData){var entity=(new _Comment2.default).fromComment(commentData);if(entity.parentCommentId){replies.push(entity)}else{comments.push(entity)}});comments.sort(sortComments);var commentIds=comments.map(function(c){return c.id});var sortByParentCommentIndex=(0,_sort.sortObjectsBy)(function(r){return commentIds.indexOf(r.parentCommentId)},true);replies.sort((0,_sort.combineSort)(sortReplies,sortByParentCommentIndex));return comments.concat(replies)}var Comments=function(_API){_inherits(Comments,_API);function Comments(client){_classCallCheck(this,Comments);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.import=new _CommentsImport2.default(client);return _this}Comments.prototype._mark=function _mark(commentId,state,value){if(Object.keys(_CommentState2.default).map(function(key){return _CommentState2.default[key]}).indexOf(state)===-1){throw new Error('Cannot mark comment state "'+state+'".')}var TODO=_CommentState2.default.TODO,DONE=_CommentState2.default.DONE,UNMARKED=_CommentState2.default.UNMARKED;var data={commentId:commentId};switch(state){case UNMARKED:{data.change=0;data.done=0;break}case TODO:{data.change=value?1:0;data.done=0;break}case DONE:{data.done=value?1:0;break}default:{break}}return this.client.request("comments.state.update",data).then(function(response){return(0,_getCommentState2.default)(response.data)})};Comments.prototype._markAll=function _markAll(proofId,commentIds,state,value){if(Object.keys(_CommentState2.default).map(function(key){return _CommentState2.default[key]}).indexOf(state)===-1){throw new Error('Cannot mark comment state "'+state+'".')}var TODO=_CommentState2.default.TODO,DONE=_CommentState2.default.DONE,UNMARKED=_CommentState2.default.UNMARKED;var data={proofId:proofId,commentIds:commentIds};switch(state){case UNMARKED:{data.change=0;data.done=0;break}case TODO:{data.change=value?1:0;data.done=0;break}case DONE:{data.done=value?1:0;break}default:{break}}return this.client.request("comments.state.multiple-update",data).then(function(response){return response.data.map(function(comment){return{commentId:comment.CommentId,commentState:(0,_getCommentState2.default)(comment)}})})};Comments.prototype.mark=function mark(commentId,state){return this._mark(commentId,state,true)};Comments.prototype.unmark=function unmark(commentId,state){return this._mark(commentId,state,false)};Comments.prototype.markAll=function markAll(proofId,commentIds,state){return this._markAll(proofId,commentIds,state,true)};Comments.prototype.unmarkAll=function unmarkAll(proofId,commentIds,state){return this._markAll(proofId,commentIds,state,false)};Comments.prototype.delete=function _delete(commentId){return this.client.request("comments.delete",{commentId:commentId})};Comments.prototype.load=function load(_options){var _this2=this;var options=typeof _options==="string"?{proofId:_options}:_options;var proofId=options.proofId,_options$pageNumber=options.pageNumber,pageNumber=_options$pageNumber===undefined?null:_options$pageNumber,_options$sinceDate=options.sinceDate,sinceDate=_options$sinceDate===undefined?null:_options$sinceDate,_options$async=options.async,async=_options$async===undefined?false:_options$async,_options$decrypt=options.decrypt,decrypt=_options$decrypt===undefined?true:_options$decrypt,onDecryptComment=options.onDecryptComment,onDecryptComments=options.onDecryptComments,_options$onDecryptCom=options.onDecryptCommentsThrottleMs,onDecryptCommentsThrottleMs=_options$onDecryptCom===undefined?1e3:_options$onDecryptCom,onDecryptError=options.onDecryptError;var sinceDateISO=sinceDate?sinceDate.toISOString().match(_constants.ISO_REGEX)[0]:_constants.DEFAULT_ISO_DATE;var payload={proofId:proofId,page:pageNumber,timestamp:sinceDateISO};return this.client.request(pageNumber!==null?"comments.load-page":"comments.load-all",payload).then(function(response){var comments=mapComments(response.data.Pages?getCommentDataFromPages(response.data.Pages):response.data);var wait=Promise.resolve();if(decrypt){var scheduled=[];var pendingBatch=[];var scheduleOnDecryptComments=onDecryptComments?(0,_throttle2.default)(function(){if(pendingBatch.length){onDecryptComments(pendingBatch);pendingBatch=[]}},onDecryptCommentsThrottleMs):function(){};var cached=Promise.all(comments.map(function(comment){return _this2.client.cache.auto(_constants.COMMENT_CACHE_PREFIX+comment.comment$,function(resolve){scheduled.push({comment:comment,resolve:resolve})}).then(function(rawComment){if(rawComment){comment.fromRawComment(rawComment)}return comment})}));wait=wait.then(function(){return cached});wait=wait.then(function(){var decrypted=scheduled.map(function(_ref){var comment=_ref.comment,resolve=_ref.resolve;return _this2.client.crypto().decryptComment(comment.comment$,comment.envelope,_this2.client.keyPairs.getPrivateKeyPEMs()).then(function(rawComment){comment.fromRawComment(rawComment);resolve(rawComment);if(onDecryptComment){onDecryptComment(comment)}pendingBatch.push(comment);scheduleOnDecryptComments()}).catch(function(err){if(onDecryptError){onDecryptError(err,comment)}if(!async){return Promise.reject(err)}return undefined})});if(!async){return Promise.all(decrypted)}return null})}return wait.then(function(){return comments})})};Comments.prototype.create=function create(_ref2){var _this3=this;var raw=_ref2.raw,tokens=_ref2.tokens,proofId=_ref2.proofId,_ref2$pageNumber=_ref2.pageNumber,pageNumber=_ref2$pageNumber===undefined?1:_ref2$pageNumber,pin=_ref2.pin,pins=_ref2.pins,mediaTime=_ref2.mediaTime,mediaDuration=_ref2.mediaDuration,parentCommentId=_ref2.parentCommentId,metadata=_ref2.metadata,sourceMetadata=_ref2.sourceMetadata,state=_ref2.state,autoState=_ref2.autoState,isPrivate=_ref2.isPrivate,retryCreationToken=_ref2.creationToken;var mentions=[];var serialized=raw||(0,_v.serialize)(tokens);{var parsed=tokens||(0,_parseComment2.default)(raw);mentions.push.apply(mentions,(0,_extractMentions2.default)(parsed))}var pinList=[];var boxFill=void 0;if(pins){pinList=pinList.concat(pins)}else if(pin){pinList.push(pin)}var primaryPin=pinList[0];if(primaryPin){if(primaryPin.fill)boxFill=primaryPin.fill;if(mediaTime)primaryPin.time=mediaTime;if(mediaDuration)primaryPin.duration=mediaDuration}var creationToken=retryCreationToken||(0,_creationToken.generateCreationToken)();return this.client.crypto().encryptComment(serialized,this.client.keyPairs.getPublicKeyPEMs()).then(function(_ref3){var envelope=_ref3.envelope,comment$=_ref3.comment$;return{proofId:proofId,page:parentCommentId?undefined:pageNumber,envelope:envelope,encryptedComment:comment$,xy:(0,_serializePins.serializePins)(pinList),boxFillImage:boxFill?boxFill.image:undefined,boxFillType:boxFill?boxFill.type:undefined,parent:parentCommentId||undefined,mentions:mentions,metadata:metadata?JSON.stringify(metadata):"{}",sourceMetadata:sourceMetadata,creationToken:creationToken,change:state===_CommentState2.default.TODO?"1":undefined,done:state===_CommentState2.default.DONE?"1":undefined,autoState:autoState,private:typeof isPrivate!=="undefined"?isPrivate?"1":"0":undefined}}).then(function(requestData){return _this3.client.request("comments.create",requestData).then(function(response){return(new _Comment2.default).fromComment(response.data).fromRawComment(serialized)})}).catch(function(err){if(err){err.creationToken=creationToken}return Promise.reject(err)})};Comments.prototype.loadContext=function loadContext(commentId){var _this4=this;return this.client.request("comments.load-context",{commentId:commentId}).then(function(response){return _this4.client.crypto().decryptImage(response.data,_this4.client.keyPairs.getPrivateKeyPEMs())}).then(function(imageBase64){var bluffer=new _bluffer2.default;return bluffer.createBase64(imageBase64)})};return Comments}(_API3.default);exports.default=Comments;
|
|
1
|
+
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Comment=require("../models/Comment");var _Comment2=_interopRequireDefault(_Comment);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _constants=require("../util/constants");var _sort=require("../util/sort");var _v=require("../util/comments/v2");var _extractMentions=require("../util/comments/extractMentions");var _extractMentions2=_interopRequireDefault(_extractMentions);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _creationToken=require("../util/creationToken");var _throttle=require("../util/throttle");var _throttle2=_interopRequireDefault(_throttle);var _getCommentState=require("../util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);var _serializePins=require("../util/pins/serializePins");var _CommentsImport=require("./CommentsImport");var _CommentsImport2=_interopRequireDefault(_CommentsImport);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}function getCommentDataFromPages(pages){var comments=[];Object.keys(pages).forEach(function(pageNumber){pages[pageNumber].Comments.forEach(function(commentData){comments.push(commentData)})});return comments}var _sortPages=(0,_sort.sortObjectsByKey)("pageNumber");var _sortCreatedDateDESC=(0,_sort.sortObjectsByKey)("createdDate",true);var _sortCreatedDateASC=(0,_sort.sortObjectsByKey)("createdDate",false);var sortComments=(0,_sort.combineSort)(_sortPages,_sortCreatedDateDESC);var sortReplies=(0,_sort.combineSort)(_sortPages,_sortCreatedDateASC);function mapComments(commentsData){var comments=[];var replies=[];commentsData.forEach(function(commentData){var entity=(new _Comment2.default).fromComment(commentData);if(entity.parentCommentId){replies.push(entity)}else{comments.push(entity)}});comments.sort(sortComments);var commentIds=comments.map(function(c){return c.id});var sortByParentCommentIndex=(0,_sort.sortObjectsBy)(function(r){return commentIds.indexOf(r.parentCommentId)},true);replies.sort((0,_sort.combineSort)(sortReplies,sortByParentCommentIndex));return comments.concat(replies)}var Comments=function(_API){_inherits(Comments,_API);function Comments(client){_classCallCheck(this,Comments);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.import=new _CommentsImport2.default(client);return _this}Comments.prototype._mark=function _mark(commentId,state,value){if(Object.keys(_CommentState2.default).map(function(key){return _CommentState2.default[key]}).indexOf(state)===-1){throw new Error('Cannot mark comment state "'+state+'".')}var TODO=_CommentState2.default.TODO,DONE=_CommentState2.default.DONE,UNMARKED=_CommentState2.default.UNMARKED;var data={commentId:commentId};switch(state){case UNMARKED:{data.change=0;data.done=0;break}case TODO:{data.change=value?1:0;data.done=0;break}case DONE:{data.done=value?1:0;break}default:{break}}return this.client.request("comments.state.update",data).then(function(response){return(0,_getCommentState2.default)(response.data)})};Comments.prototype._markAll=function _markAll(proofId,commentIds,state,value){if(Object.keys(_CommentState2.default).map(function(key){return _CommentState2.default[key]}).indexOf(state)===-1){throw new Error('Cannot mark comment state "'+state+'".')}var TODO=_CommentState2.default.TODO,DONE=_CommentState2.default.DONE,UNMARKED=_CommentState2.default.UNMARKED;var data={proofId:proofId,commentIds:commentIds};switch(state){case UNMARKED:{data.change=0;data.done=0;break}case TODO:{data.change=value?1:0;data.done=0;break}case DONE:{data.done=value?1:0;break}default:{break}}return this.client.request("comments.state.multiple-update",data).then(function(response){return response.data.map(function(comment){return{commentId:comment.CommentId,commentState:(0,_getCommentState2.default)(comment)}})})};Comments.prototype.mark=function mark(commentId,state){return this._mark(commentId,state,true)};Comments.prototype.unmark=function unmark(commentId,state){return this._mark(commentId,state,false)};Comments.prototype.markAll=function markAll(proofId,commentIds,state){return this._markAll(proofId,commentIds,state,true)};Comments.prototype.unmarkAll=function unmarkAll(proofId,commentIds,state){return this._markAll(proofId,commentIds,state,false)};Comments.prototype.delete=function _delete(commentId){return this.client.request("comments.delete",{commentId:commentId})};Comments.prototype.addLabel=function addLabel(commentId,labelId){return this.client.request("comments.label.add",{commentId:commentId,labelId:labelId}).then(function(response){return response.data.LabelIds||[]})};Comments.prototype.removeLabel=function removeLabel(commentId,labelId){return this.client.request("comments.label.remove",{commentId:commentId,labelId:labelId}).then(function(response){return response.data.LabelIds||[]})};Comments.prototype.load=function load(_options){var _this2=this;var options=typeof _options==="string"?{proofId:_options}:_options;var proofId=options.proofId,_options$pageNumber=options.pageNumber,pageNumber=_options$pageNumber===undefined?null:_options$pageNumber,_options$sinceDate=options.sinceDate,sinceDate=_options$sinceDate===undefined?null:_options$sinceDate,_options$async=options.async,async=_options$async===undefined?false:_options$async,_options$decrypt=options.decrypt,decrypt=_options$decrypt===undefined?true:_options$decrypt,onDecryptComment=options.onDecryptComment,onDecryptComments=options.onDecryptComments,_options$onDecryptCom=options.onDecryptCommentsThrottleMs,onDecryptCommentsThrottleMs=_options$onDecryptCom===undefined?1e3:_options$onDecryptCom,onDecryptError=options.onDecryptError;var sinceDateISO=sinceDate?sinceDate.toISOString().match(_constants.ISO_REGEX)[0]:_constants.DEFAULT_ISO_DATE;var payload={proofId:proofId,page:pageNumber,timestamp:sinceDateISO};return this.client.request(pageNumber!==null?"comments.load-page":"comments.load-all",payload).then(function(response){var comments=mapComments(response.data.Pages?getCommentDataFromPages(response.data.Pages):response.data);var wait=Promise.resolve();if(decrypt){var scheduled=[];var pendingBatch=[];var scheduleOnDecryptComments=onDecryptComments?(0,_throttle2.default)(function(){if(pendingBatch.length){onDecryptComments(pendingBatch);pendingBatch=[]}},onDecryptCommentsThrottleMs):function(){};var cached=Promise.all(comments.map(function(comment){return _this2.client.cache.auto(_constants.COMMENT_CACHE_PREFIX+comment.comment$,function(resolve){scheduled.push({comment:comment,resolve:resolve})}).then(function(rawComment){if(rawComment){comment.fromRawComment(rawComment)}return comment})}));wait=wait.then(function(){return cached});wait=wait.then(function(){var decrypted=scheduled.map(function(_ref){var comment=_ref.comment,resolve=_ref.resolve;return _this2.client.crypto().decryptComment(comment.comment$,comment.envelope,_this2.client.keyPairs.getPrivateKeyPEMs()).then(function(rawComment){comment.fromRawComment(rawComment);resolve(rawComment);if(onDecryptComment){onDecryptComment(comment)}pendingBatch.push(comment);scheduleOnDecryptComments()}).catch(function(err){if(onDecryptError){onDecryptError(err,comment)}if(!async){return Promise.reject(err)}return undefined})});if(!async){return Promise.all(decrypted)}return null})}return wait.then(function(){return comments})})};Comments.prototype.create=function create(_ref2){var _this3=this;var raw=_ref2.raw,tokens=_ref2.tokens,proofId=_ref2.proofId,_ref2$pageNumber=_ref2.pageNumber,pageNumber=_ref2$pageNumber===undefined?1:_ref2$pageNumber,pin=_ref2.pin,pins=_ref2.pins,mediaTime=_ref2.mediaTime,mediaDuration=_ref2.mediaDuration,parentCommentId=_ref2.parentCommentId,metadata=_ref2.metadata,sourceMetadata=_ref2.sourceMetadata,state=_ref2.state,autoState=_ref2.autoState,isPrivate=_ref2.isPrivate,retryCreationToken=_ref2.creationToken;var mentions=[];var serialized=raw||(0,_v.serialize)(tokens);{var parsed=tokens||(0,_parseComment2.default)(raw);mentions.push.apply(mentions,(0,_extractMentions2.default)(parsed))}var pinList=[];var boxFill=void 0;if(pins){pinList=pinList.concat(pins)}else if(pin){pinList.push(pin)}var primaryPin=pinList[0];if(primaryPin){if(primaryPin.fill)boxFill=primaryPin.fill;if(mediaTime)primaryPin.time=mediaTime;if(mediaDuration)primaryPin.duration=mediaDuration}var creationToken=retryCreationToken||(0,_creationToken.generateCreationToken)();return this.client.crypto().encryptComment(serialized,this.client.keyPairs.getPublicKeyPEMs()).then(function(_ref3){var envelope=_ref3.envelope,comment$=_ref3.comment$;return{proofId:proofId,page:parentCommentId?undefined:pageNumber,envelope:envelope,encryptedComment:comment$,xy:(0,_serializePins.serializePins)(pinList),boxFillImage:boxFill?boxFill.image:undefined,boxFillType:boxFill?boxFill.type:undefined,parent:parentCommentId||undefined,mentions:mentions,metadata:metadata?JSON.stringify(metadata):"{}",sourceMetadata:sourceMetadata,creationToken:creationToken,change:state===_CommentState2.default.TODO?"1":undefined,done:state===_CommentState2.default.DONE?"1":undefined,autoState:autoState,private:typeof isPrivate!=="undefined"?isPrivate?"1":"0":undefined}}).then(function(requestData){return _this3.client.request("comments.create",requestData).then(function(response){return(new _Comment2.default).fromComment(response.data).fromRawComment(serialized)})}).catch(function(err){if(err){err.creationToken=creationToken}return Promise.reject(err)})};Comments.prototype.loadContext=function loadContext(commentId){var _this4=this;return this.client.request("comments.load-context",{commentId:commentId}).then(function(response){return _this4.client.crypto().decryptImage(response.data,_this4.client.keyPairs.getPrivateKeyPEMs())}).then(function(imageBase64){var bluffer=new _bluffer2.default;return bluffer.createBase64(imageBase64)})};return Comments}(_API3.default);exports.default=Comments;
|
|
@@ -63,5 +63,44 @@ declare class Integrations extends API {
|
|
|
63
63
|
* @returns {Promise}
|
|
64
64
|
*/
|
|
65
65
|
updateConfiguration(integrationKey: string, key: string, value: string): Promise<any>;
|
|
66
|
+
/**
|
|
67
|
+
* Gets the list of Jira sites associated with a pending connection so the user
|
|
68
|
+
* can pick which one to finalise the integration against.
|
|
69
|
+
*
|
|
70
|
+
* Used when the OAuth callback found that the consenting user has access to more
|
|
71
|
+
* than one Atlassian site, and so the SDK consumer needs to prompt the user to
|
|
72
|
+
* pick which site to connect to.
|
|
73
|
+
*
|
|
74
|
+
* @example <caption>Retrieving the sites for a pending Jira connection</caption>
|
|
75
|
+
* const admin = await client.admin();
|
|
76
|
+
* const sites = await admin.team.integrations.getJiraPendingConnection(pendingId);
|
|
77
|
+
*
|
|
78
|
+
* @since 2.16.0
|
|
79
|
+
* @param {string} pendingId The id of the pending connection (returned from the OAuth callback)
|
|
80
|
+
* @returns {Promise<Array<{ cloudId: string, url: string, name: string, avatarUrl: string }>>}
|
|
81
|
+
*/
|
|
82
|
+
getJiraPendingConnection(pendingId: string): Promise<Array<{
|
|
83
|
+
cloudId: string;
|
|
84
|
+
url: string;
|
|
85
|
+
name: string;
|
|
86
|
+
avatarUrl: string;
|
|
87
|
+
}>>;
|
|
88
|
+
/**
|
|
89
|
+
* Finalises a pending Jira connection by selecting which Atlassian site to use.
|
|
90
|
+
*
|
|
91
|
+
* The chosen `cloudId` must be one of the sites returned by
|
|
92
|
+
* {@link Integrations#getJiraPendingConnection}. On success the integration
|
|
93
|
+
* configuration is upserted and the pending connection is consumed.
|
|
94
|
+
*
|
|
95
|
+
* @example <caption>Completing a pending Jira connection</caption>
|
|
96
|
+
* const admin = await client.admin();
|
|
97
|
+
* await admin.team.integrations.completeJiraPendingConnection(pendingId, cloudId);
|
|
98
|
+
*
|
|
99
|
+
* @since 2.16.0
|
|
100
|
+
* @param {string} pendingId The id of the pending connection (returned from the OAuth callback)
|
|
101
|
+
* @param {string} cloudId The Atlassian cloud id of the site the user picked
|
|
102
|
+
* @returns {Promise}
|
|
103
|
+
*/
|
|
104
|
+
completeJiraPendingConnection(pendingId: string, cloudId: string): Promise<any>;
|
|
66
105
|
}
|
|
67
106
|
import API from "./API";
|
package/lib/api/Integrations.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);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(){var integrationKeys=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return this.client.request("integrations.get-configurations",{level:this.level,integration_keys:integrationKeys.join(",")}).then(function(response){if(response.data){return response.data.integrations}return null})};Integrations.prototype.getSetupUrl=function getSetupUrl(integrationKey,params){return this.client.request("integrations.get-setup-url",{params:_extends({},params,{integration_key:integrationKey,level:this.level})}).then(function(response){return{url:response.data.url,windowFeatures:response.data.windowFeatures}})};Integrations.prototype.disable=function disable(integrationKey){return this.client.request("integrations.disable",{level:this.level,integration_key:integrationKey})};Integrations.prototype.updateConfiguration=function updateConfiguration(integrationKey,key,value){return this.client.request("integrations.update-configuration",{level:this.level,integrationKey:integrationKey,key:key,value:value})};return Integrations}(_API3.default);exports.default=Integrations;
|
|
1
|
+
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var 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(){var integrationKeys=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return this.client.request("integrations.get-configurations",{level:this.level,integration_keys:integrationKeys.join(",")}).then(function(response){if(response.data){return response.data.integrations}return null})};Integrations.prototype.getSetupUrl=function getSetupUrl(integrationKey,params){return this.client.request("integrations.get-setup-url",{params:_extends({},params,{integration_key:integrationKey,level:this.level})}).then(function(response){return{url:response.data.url,windowFeatures:response.data.windowFeatures}})};Integrations.prototype.disable=function disable(integrationKey){return this.client.request("integrations.disable",{level:this.level,integration_key:integrationKey})};Integrations.prototype.updateConfiguration=function updateConfiguration(integrationKey,key,value){return this.client.request("integrations.update-configuration",{level:this.level,integrationKey:integrationKey,key:key,value:value})};Integrations.prototype.getJiraPendingConnection=function getJiraPendingConnection(pendingId){return this.client.request("integrations.jira.get-pending-connection",{pendingId:pendingId}).then(function(response){return response.data.sites})};Integrations.prototype.completeJiraPendingConnection=function completeJiraPendingConnection(pendingId,cloudId){return this.client.request("integrations.jira.complete-pending-connection",{pendingId:pendingId,cloudId:cloudId})};return Integrations}(_API3.default);exports.default=Integrations;
|
|
@@ -61,9 +61,10 @@ declare class ProofsGroups extends API {
|
|
|
61
61
|
* @param {string} [options.name] The name of the group to update
|
|
62
62
|
* @param {string} [options.isOwnedByTeam] If group can be shared with team
|
|
63
63
|
* @param {{name: string}} [options.folder] The folder the group belongs to
|
|
64
|
+
* @param {string} [options.parentGroupUuid] The id of the parent group that the group belongs to
|
|
64
65
|
* @returns {Promise<ProofGroup>}
|
|
65
66
|
*/
|
|
66
|
-
update(groupId: string, { name, isOwnedByTeam, folder, }?: object): Promise<ProofGroup>;
|
|
67
|
+
update(groupId: string, { name, isOwnedByTeam, folder, parentGroupUuid, }?: object): Promise<ProofGroup>;
|
|
67
68
|
/**
|
|
68
69
|
* Removes a proof from a group.
|
|
69
70
|
*
|
package/lib/api/ProofsGroups.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 _templateObject=_taggedTemplateLiteralLoose(["\n query sdk_CollectionProgress($collectionId: ID!) {\n collectionProgress(id: $collectionId) {\n status\n completedProofsCount\n totalProofsCount\n }\n }\n"],["\n query sdk_CollectionProgress($collectionId: ID!) {\n collectionProgress(id: $collectionId) {\n status\n completedProofsCount\n totalProofsCount\n }\n }\n"]);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);var _gql=require("../util/gql");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 _taggedTemplateLiteralLoose(strings,raw){strings.raw=raw;return strings}function mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var GET_COLLECTION_PROGRESS=(0,_gql.gql)(_templateObject);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.getProgress=function getProgress(groupId){return this.client.graphql(GET_COLLECTION_PROGRESS,{collectionId:groupId}).then(function(response){return response.data.collectionProgress})};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,folder=_ref2.folder;return this.client.request("proofs.groups.update",{groupId:groupId,name:name,ownedByTeam:isOwnedByTeam,folderName:folder&&folder.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,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}if(args.every(function(arg){return typeof arg==="string"})){return this.client.request("proofs.groups.archive",{groupIds:args})}else{var defaultOptions={archiveProofs:false};var groupIdOrGroupIds=args[0],_args$=args[1],options=_args$===undefined?defaultOptions:_args$;var groupIds=[].concat(groupIdOrGroupIds);return this.client.request("proofs.groups.archive",_extends({groupIds:groupIds},options))}};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 _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 _templateObject=_taggedTemplateLiteralLoose(["\n query sdk_CollectionProgress($collectionId: ID!) {\n collectionProgress(id: $collectionId) {\n status\n completedProofsCount\n totalProofsCount\n }\n }\n"],["\n query sdk_CollectionProgress($collectionId: ID!) {\n collectionProgress(id: $collectionId) {\n status\n completedProofsCount\n totalProofsCount\n }\n }\n"]);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);var _gql=require("../util/gql");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 _taggedTemplateLiteralLoose(strings,raw){strings.raw=raw;return strings}function mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var GET_COLLECTION_PROGRESS=(0,_gql.gql)(_templateObject);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.getProgress=function getProgress(groupId){return this.client.graphql(GET_COLLECTION_PROGRESS,{collectionId:groupId}).then(function(response){return response.data.collectionProgress})};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,folder=_ref2.folder,parentGroupUuid=_ref2.parentGroupUuid;return this.client.request("proofs.groups.update",{groupId:groupId,name:name,ownedByTeam:isOwnedByTeam,folderName:folder&&folder.name,parentGroupUuid:parentGroupUuid}).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,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}if(args.every(function(arg){return typeof arg==="string"})){return this.client.request("proofs.groups.archive",{groupIds:args})}else{var defaultOptions={archiveProofs:false};var groupIdOrGroupIds=args[0],_args$=args[1],options=_args$===undefined?defaultOptions:_args$;var groupIds=[].concat(groupIdOrGroupIds);return this.client.request("proofs.groups.archive",_extends({groupIds:groupIds},options))}};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;
|
|
@@ -69,6 +69,7 @@ declare class TeamFeatures extends API {
|
|
|
69
69
|
* @param {boolean} options.intelligence.enableSmartCheckCr Whether Smart Check: CR is enabled for the team's proofs.
|
|
70
70
|
* @param {boolean} options.general.enableCelebrations Whether celebrations are enabled for the team.
|
|
71
71
|
* @param {boolean} options.proofs.enableProofSoftDeletion Whether the scheduled deletion feature is enabled for the team.
|
|
72
|
+
* @param {boolean} options.general.enableLabels Whether labels are enabled for the team.
|
|
72
73
|
* @returns {Promise}
|
|
73
74
|
*/
|
|
74
75
|
update({ emails, comments, proofs, workflows, addressBook, userGroups, webhooks, intelligence, general, }: {
|
|
@@ -107,6 +107,7 @@ var TeamFeatures = function (_API) {
|
|
|
107
107
|
* @param {boolean} options.intelligence.enableSmartCheckCr Whether Smart Check: CR is enabled for the team's proofs.
|
|
108
108
|
* @param {boolean} options.general.enableCelebrations Whether celebrations are enabled for the team.
|
|
109
109
|
* @param {boolean} options.proofs.enableProofSoftDeletion Whether the scheduled deletion feature is enabled for the team.
|
|
110
|
+
* @param {boolean} options.general.enableLabels Whether labels are enabled for the team.
|
|
110
111
|
* @returns {Promise}
|
|
111
112
|
*/
|
|
112
113
|
|
|
@@ -167,6 +168,7 @@ var TeamFeatures = function (_API) {
|
|
|
167
168
|
var defaultDigitalVerification = proofs && proofs.defaultDigitalVerification;
|
|
168
169
|
var reauthentication = proofs && proofs.reauthentication;
|
|
169
170
|
var enableProofSoftDeletion = proofs && proofs.enableProofSoftDeletion;
|
|
171
|
+
var enableLabels = general && general.enableLabels;
|
|
170
172
|
return this.client.request('admin.team.features.update', {
|
|
171
173
|
displayComments: displayComments,
|
|
172
174
|
displayTeamName: displayTeamName,
|
|
@@ -212,7 +214,8 @@ var TeamFeatures = function (_API) {
|
|
|
212
214
|
enableDigitalVerification: enableDigitalVerification,
|
|
213
215
|
defaultDigitalVerification: defaultDigitalVerification,
|
|
214
216
|
reauthentication: reauthentication,
|
|
215
|
-
enableProofSoftDeletion: enableProofSoftDeletion
|
|
217
|
+
enableProofSoftDeletion: enableProofSoftDeletion,
|
|
218
|
+
enableLabels: enableLabels
|
|
216
219
|
});
|
|
217
220
|
};
|
|
218
221
|
|
package/lib/models/Comment.d.ts
CHANGED
|
@@ -184,6 +184,14 @@ declare class Comment {
|
|
|
184
184
|
* @type {boolean}
|
|
185
185
|
*/
|
|
186
186
|
isPrivate: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* The labels currently applied to the comment.
|
|
189
|
+
*
|
|
190
|
+
* Labels are an Enterprise feature, gated by the team's `enableLabels` setting.
|
|
191
|
+
*
|
|
192
|
+
* @type {Label[]}
|
|
193
|
+
*/
|
|
194
|
+
labels: Label[];
|
|
187
195
|
/**
|
|
188
196
|
* @private
|
|
189
197
|
* @param {object} commentData The comment object from the server
|
|
@@ -199,3 +207,4 @@ declare class Comment {
|
|
|
199
207
|
}
|
|
200
208
|
import User from "./User";
|
|
201
209
|
import File from "./File";
|
|
210
|
+
import Label from "./Label";
|
package/lib/models/Comment.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 _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _getCommentState=require("../util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);var _parsePins=require("../util/pins/parsePins");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 commentSchema={id:"CommentId",proofId:"ProofId",pins:function pins(data){return(0,_parsePins.parsePins)(data.XY).map(function(pin,index){if(index===0&&data.BoxFillType){return _extends({},pin,{fill:data.BoxFillType&&{type:data.BoxFillType,image:data.BoxFillImage}})}return pin})},pin:function pin(){return this.pins[0]},user:function user(data){return(new _User2.default).fromUser(data)},comment$:"EncryptedComment",envelope:"Envelope",attachments:function attachments(data){if(data.Attachments){return data.Attachments.map(function(attachment){return(new _File2.default).fromCommentAttachment(_extends({CommentId:data.CommentId},attachment))})}return[]},agreeCount:function agreeCount(data){return data.Agrees.length},pageNumber:(0,_transform.number)("Page"),mediaTime:function mediaTime(){return this.pin&&this.pin.time},mediaDuration:function mediaDuration(){return this.pin&&this.pin.duration},createdDate:(0,_transform.date)("Timestamp"),updatedDate:(0,_transform.date)("Updated"),parentCommentId:(0,_transform.optional)("Parent"),metadata:(0,_transform.json)("Metadata",{}),sourceMetadata:"SourceMetadata",state:function state(data){return(0,_getCommentState2.default)(data)},isPrivate:"Private"};var Comment=function(){function Comment(){_classCallCheck(this,Comment)}Comment.prototype.fromComment=function fromComment(commentData){(0,_transform2.default)(this,commentSchema,commentData);return this};Comment.prototype.fromRawComment=function fromRawComment(rawComment){var parsed=(0,_parseComment2.default)(rawComment);this.raw=rawComment;this.tokens=parsed;return this};return Comment}();exports.default=Comment;
|
|
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 _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _Label=require("./Label");var _Label2=_interopRequireDefault(_Label);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _getCommentState=require("../util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);var _parsePins=require("../util/pins/parsePins");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 commentSchema={id:"CommentId",proofId:"ProofId",pins:function pins(data){return(0,_parsePins.parsePins)(data.XY).map(function(pin,index){if(index===0&&data.BoxFillType){return _extends({},pin,{fill:data.BoxFillType&&{type:data.BoxFillType,image:data.BoxFillImage}})}return pin})},pin:function pin(){return this.pins[0]},user:function user(data){return(new _User2.default).fromUser(data)},comment$:"EncryptedComment",envelope:"Envelope",attachments:function attachments(data){if(data.Attachments){return data.Attachments.map(function(attachment){return(new _File2.default).fromCommentAttachment(_extends({CommentId:data.CommentId},attachment))})}return[]},agreeCount:function agreeCount(data){return data.Agrees.length},pageNumber:(0,_transform.number)("Page"),mediaTime:function mediaTime(){return this.pin&&this.pin.time},mediaDuration:function mediaDuration(){return this.pin&&this.pin.duration},createdDate:(0,_transform.date)("Timestamp"),updatedDate:(0,_transform.date)("Updated"),parentCommentId:(0,_transform.optional)("Parent"),metadata:(0,_transform.json)("Metadata",{}),sourceMetadata:"SourceMetadata",state:function state(data){return(0,_getCommentState2.default)(data)},isPrivate:"Private",labels:function labels(data){return(data.Labels||[]).map(function(label){return(new _Label2.default).fromLabel(label)})}};var Comment=function(){function Comment(){_classCallCheck(this,Comment)}Comment.prototype.fromComment=function fromComment(commentData){(0,_transform2.default)(this,commentSchema,commentData);return this};Comment.prototype.fromRawComment=function fromRawComment(rawComment){var parsed=(0,_parseComment2.default)(rawComment);this.raw=rawComment;this.tokens=parsed;return this};return Comment}();exports.default=Comment;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default Label;
|
|
2
|
+
declare class Label {
|
|
3
|
+
/**
|
|
4
|
+
* The label's unique identifier.
|
|
5
|
+
*
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* The display text of the label.
|
|
11
|
+
*
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
text: string;
|
|
15
|
+
/**
|
|
16
|
+
* The label's color (as a string, e.g. a hex code or named color).
|
|
17
|
+
*
|
|
18
|
+
* @type {string}
|
|
19
|
+
*/
|
|
20
|
+
color: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the label has been archived.
|
|
23
|
+
*
|
|
24
|
+
* Archived labels are still returned on existing comments, so callers can decide
|
|
25
|
+
* whether to render them differently (e.g. hide or grey-out).
|
|
26
|
+
*
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
*/
|
|
29
|
+
isArchived: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
* @param {object} labelData The label object from the server
|
|
33
|
+
* @returns {Label}
|
|
34
|
+
*/
|
|
35
|
+
private fromLabel;
|
|
36
|
+
}
|
|
@@ -0,0 +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 labelSchema={id:"Id",text:"Text",color:"Color",isArchived:"IsArchived"};var Label=function(){function Label(){_classCallCheck(this,Label)}Label.prototype.fromLabel=function fromLabel(labelData){(0,_transform2.default)(this,labelSchema,labelData);return this};return Label}();exports.default=Label;
|
package/lib/models/Proof.d.ts
CHANGED
|
@@ -476,18 +476,6 @@ declare class Proof {
|
|
|
476
476
|
* @type {boolean}
|
|
477
477
|
*/
|
|
478
478
|
isDigitalVerificationEnabled: boolean;
|
|
479
|
-
/**
|
|
480
|
-
* Whether the proof has proof insights enabled.
|
|
481
|
-
*
|
|
482
|
-
* @type {boolean}
|
|
483
|
-
*/
|
|
484
|
-
isProofInsightsEnabled: boolean;
|
|
485
|
-
/**
|
|
486
|
-
* Whether the proof has proof insights on comments enabled.
|
|
487
|
-
*
|
|
488
|
-
* @type {boolean}
|
|
489
|
-
*/
|
|
490
|
-
isProofInsightsCommentsEnabled: boolean;
|
|
491
479
|
/**
|
|
492
480
|
* Whether a user is a team admin of this proof.
|
|
493
481
|
*
|
package/lib/models/Proof.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _ProofState=require("../enum/ProofState");var _ProofState2=_interopRequireDefault(_ProofState);var _ProofStatus=require("../enum/ProofStatus");var _ProofStatus2=_interopRequireDefault(_ProofStatus);var _ProofType=require("../enum/ProofType");var _ProofType2=_interopRequireDefault(_ProofType);var _FileStatus=require("../enum/FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _StatusMessage=require("../enum/StatusMessage");var _StatusMessage2=_interopRequireDefault(_StatusMessage);var _id=require("../util/id");var _getPercentage=require("../util/getPercentage");var _getPercentage2=_interopRequireDefault(_getPercentage);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _DecisionSummary=require("./DecisionSummary");var _DecisionSummary2=_interopRequireDefault(_DecisionSummary);var _ProofIntegrationReference=require("./ProofIntegrationReference");var _ProofIntegrationReference2=_interopRequireDefault(_ProofIntegrationReference);var _ProofChecklist=require("./ProofChecklist");var _ProofChecklist2=_interopRequireDefault(_ProofChecklist);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 isOverdue(){return this.dueDate&&this.dueDate.getTime()<Date.now()}var proofSchema={id:"ProofId",name:"Title",status:"Status",workflowId:"WorkflowId",proofTemplateId:"ProofTemplateId",version:"Version",dueDate:(0,_transform.date)("DueDate"),createdDate:(0,_transform.date)("CreateDate"),approvedDate:(0,_transform.date)("ApprovedDate"),isLocked:"Locked",isArchived:"Closed",isOverdue:isOverdue,uploaderUserId:"UserId",ownerUserIds:"OwnerIds",editorUserId:"EditorId",editorUserIds:"EditorIds",lockerUserId:"ProofLockerId",messageToReviewers:"Description",messageToOwners:"OwnerMessage",messageToEditor:"EditorMessage",fileId:"FileId",fileExtension:"Extension",fileStatus:"FileStatus",fileMessage:"FileStatusMessage",fileSize:"FileSize",pageCount:(0,_transform.number)("Pages"),commentCount:(0,_transform.number)("ParentComments"),canDownload:(0,_transform.truthy)("DownloadOriginal"),type:"Type",processStatus:"ProcessStatus",recipient:"Recipient",recipientEmail:"RecipientEmail",todoCommentCount:(0,_transform.number)("CountTodoComments"),doneCommentCount:(0,_transform.number)("CountDoneComments"),fileCategory:"FileCategory",isAdminOnProof:"IsAdminOnProof",groupId:"GroupId",canReupload:"CanReupload",hasEditors:"HasEditors",groupName:"GroupName",role:"Role",canOthersEditComments:"FeatureEditComments",canAddCommentReplies:"FeatureCanAddCommentReplies",canHaveGeneralComments:"FeatureGeneralComments",canHavePrivateComments:"FeaturePrivateComments",canAddChecklist:"FeatureCanAddChecklist",hasDecisionsEnabled:"FeatureDecisions",hasColorSeparations:"HasColorSeparations",reference:"Reference",integrationReferences:(0,_transform.each)("IntegrationReferences",function(data){return(new _ProofIntegrationReference2.default).fromProofIntegrationReference(data)}),checklist:function checklist(data){return data.Checklist&&(new _ProofChecklist2.default).fromProofChecklist(data.Checklist)},isReferenceEnabled:"FeatureProofReference",source:"Source",owners:(0,_transform.each)("Owners",function(ownerData){return(new _User2.default).fromUser(ownerData)}),decisionSummary:(0,_transform.each)("Decisions",function(decisionsData){return(new _DecisionSummary2.default).fromDecisionSummary(decisionsData)}),tags:(0,_transform.each)("Tags",function(tag){return tag.Value}),teamId:"TeamId",isPublic:"IsPublic",canBePublic:"FeaturePublicProofs",availableWorkflowRoles:"FeatureAvailableWorkflowRoles",usePreviousVersionDueDate:"FeatureUsePreviousVersionDueDate",canSendShareLink:"FeatureSendShareLink",publicProofKeyPair:function publicProofKeyPair(data){return data.PublicProofKeyPair&&{publicKeyPEM:data.PublicProofKeyPair.PublicKey,privateKeyPEM:data.PublicProofKeyPair.PrivateKey}},canSendMessageToOwners:"FeatureMessageToOwners",workflowMetrics:"WorkflowMetrics",commentVisibility:"CommentVisibility",canHaveCommentVisibility:"FeatureCommentVisibility",importUrl:"ImportURL",priority:"Priority",scheduledDate:(0,_transform.date)("ScheduledDate"),statusMessage:"StatusMessage",isDigitalVerificationEnabled:"IsDigitalVerificationEnabled",isProofInsightsEnabled:"FeatureProofInsights",isProofInsightsCommentsEnabled:"FeatureProofInsightsComments"};var Proof=function(){function Proof(){_classCallCheck(this,Proof)}Proof.prototype.isUserAdminOfProofTeam=function isUserAdminOfProofTeam(user){return user.isAdmin&&this.teamId===user.teamId};Proof.prototype.getState=function getState(){var state=_ProofState2.default.ACTIVE;if(this.fileStatus===_FileStatus2.default.UPLOADING||!this.fileStatus&&this.statusMessage===_StatusMessage2.default.UPLOADING){state=_ProofState2.default.UPLOADING}else if(this.hasFileError()){state=_ProofState2.default.FILE_ERROR}else if(this.isProcessing()){state=_ProofState2.default.PROCESSING}else if(this.type===_ProofType2.default.BRIEF){switch(this.status){case _ProofStatus2.default.NEW:state=_ProofState2.default.SETUP_NEEDED;break;case _ProofStatus2.default.PROOFING:case _ProofStatus2.default.FINAL_APPROVING:state=_ProofState2.default.AWAITING_PROOF;break;case _ProofStatus2.default.AWAITING_NEW_VERSION:state=_ProofState2.default.AWAITING_PROOF;break;case _ProofStatus2.default.HAS_NEW_VERSION:state=_ProofState2.default.HAS_NEW_VERSION;break;case _ProofStatus2.default.APPROVED:state=_ProofState2.default.APPROVED;break;case _ProofStatus2.default.ARCHIVED:state=_ProofState2.default.ARCHIVED;break;default:state=_ProofState2.default.BRIEFING;break}}else if(this.status===_ProofStatus2.default.ARCHIVED){state=_ProofState2.default.ARCHIVED}else if(this.status===_ProofStatus2.default.TODOS_REQUESTED){state=_ProofState2.default.TODOS_REQUESTED}else if(this.status===_ProofStatus2.default.AWAITING_NEW_VERSION){state=_ProofState2.default.AWAITING_NEW_VERSION}else if(this.status===_ProofStatus2.default.HAS_NEW_VERSION){state=_ProofState2.default.HAS_NEW_VERSION}else if(this.status===_ProofStatus2.default.APPROVED){state=_ProofState2.default.APPROVED}else if(!this.hasWorkflow()){state=_ProofState2.default.PROOFERS_NEEDED}else if(!this.hasWorkflowStarted()){state=_ProofState2.default.NOT_STARTED}else if(this.isOverdue||this.dueDate&&this.dueDate.getTime()<Date.now()){state=_ProofState2.default.OVERDUE}return state};Proof.prototype.getVideoProcessingProgress=function getVideoProcessingProgress(){var percent=0;var message=String(this.fileMessage);if(message){var thumbMatch=/^Thumb-\w+\-([-+]?[0-9]*\.?[0-9]*)/g.exec(message);var videoMatch=/^Video-\w+\-([-+]?[0-9]*\.?[0-9]*)/g.exec(message);if(message.startsWith("Video-Scheduled-")){percent=0}else if(videoMatch){percent=(0,_getPercentage2.default)(parseFloat(videoMatch[1])/100,0,.2)}else if(thumbMatch){percent=(0,_getPercentage2.default)(parseFloat(thumbMatch[1])/100,.8,0)}}return percent};Proof.prototype.hasWorkflowStarted=function hasWorkflowStarted(){return this.hasWorkflow()&&this.status!==_ProofStatus2.default.NEW};Proof.prototype.isProcessing=function isProcessing(){if(this.fileStatus===_FileStatus2.default.UPLOADING||this.fileStatus===_FileStatus2.default.QUEUED||this.fileStatus===_FileStatus2.default.RIPPING){return true}if(!this.fileStatus){return this.statusMessage===_StatusMessage2.default.UPLOADING||this.statusMessage===_StatusMessage2.default.PROCESSING}return false};Proof.prototype.isAwaitingFile=function isAwaitingFile(){return this.source&&this.fileStatus===_FileStatus2.default.CREATED};Proof.prototype.getProcessingProgress=function getProcessingProgress(){switch(this.fileStatus){case _FileStatus2.default.UPLOADING:return.1;case _FileStatus2.default.QUEUED:return.2;case _FileStatus2.default.RIPPING:if(this.fileCategory==="video"){return(0,_getPercentage2.default)(this.getVideoProcessingProgress(),.2,.1).toFixed(2)}return.6;default:return-1}};Proof.prototype.hasWorkflow=function hasWorkflow(){return(0,_id.isWorkflowId)(this.workflowId)};Proof.prototype.hasFile=function hasFile(){return(0,_id.isFileId)(this.fileId)};Proof.prototype.hasFileError=function hasFileError(){if(this.fileStatus===_FileStatus2.default.ERROR){return true}if(!this.fileStatus){if(this.statusMessage===_StatusMessage2.default.FILE_ERROR){return true}if(!this.hasFile()){return true}return false}return false};Proof.prototype.hasEditor=function hasEditor(){return(0,_id.isUserId)(this.editorUserId)};Proof.prototype.hasThumbnail=function hasThumbnail(){if(this.fileStatus===_FileStatus2.default.OK){return true}if(!this.fileStatus&&this.hasFile()){if(this.statusMessage===_StatusMessage2.default.FILE_ERROR||this.statusMessage===_StatusMessage2.default.UPLOADING||this.statusMessage===_StatusMessage2.default.PROCESSING||this.statusMessage===_StatusMessage2.default.AWAITING_FILE||this.statusMessage===_StatusMessage2.default.AWAITING_EMAIL){return false}return true}return false};Proof.prototype.canUserUploadNewVersion=function canUserUploadNewVersion(userId){return this.getState()===_ProofState2.default.AWAITING_NEW_VERSION&&(this.isEditor(userId)||this.isOwner(userId))||this.getState()===_ProofState2.default.AWAITING_PROOF&&(this.isEditor(userId)||this.isRecipient(userId))};Proof.prototype.isOwner=function isOwner(userId){return this.ownerUserIds.indexOf(userId)!==-1};Proof.prototype.isEditor=function isEditor(userId){return this.editorUserIds.indexOf(userId)!==-1};Proof.prototype.isRecipient=function isRecipient(userId){return this.recipient===userId};Proof.prototype.calculateState=function calculateState(){this.state=this.getState()};Proof.prototype.fromProof=function fromProof(proofData){(0,_transform2.default)(this,proofSchema,proofData);this.calculateState();return this};Proof.getStateFromRawData=function getStateFromRawData(proofData){var proof=new Proof;proof.fromProof(proofData);return proof.getState()};return Proof}();exports.default=Proof;
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _ProofState=require("../enum/ProofState");var _ProofState2=_interopRequireDefault(_ProofState);var _ProofStatus=require("../enum/ProofStatus");var _ProofStatus2=_interopRequireDefault(_ProofStatus);var _ProofType=require("../enum/ProofType");var _ProofType2=_interopRequireDefault(_ProofType);var _FileStatus=require("../enum/FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _StatusMessage=require("../enum/StatusMessage");var _StatusMessage2=_interopRequireDefault(_StatusMessage);var _id=require("../util/id");var _getPercentage=require("../util/getPercentage");var _getPercentage2=_interopRequireDefault(_getPercentage);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _DecisionSummary=require("./DecisionSummary");var _DecisionSummary2=_interopRequireDefault(_DecisionSummary);var _ProofIntegrationReference=require("./ProofIntegrationReference");var _ProofIntegrationReference2=_interopRequireDefault(_ProofIntegrationReference);var _ProofChecklist=require("./ProofChecklist");var _ProofChecklist2=_interopRequireDefault(_ProofChecklist);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 isOverdue(){return this.dueDate&&this.dueDate.getTime()<Date.now()}var proofSchema={id:"ProofId",name:"Title",status:"Status",workflowId:"WorkflowId",proofTemplateId:"ProofTemplateId",version:"Version",dueDate:(0,_transform.date)("DueDate"),createdDate:(0,_transform.date)("CreateDate"),approvedDate:(0,_transform.date)("ApprovedDate"),isLocked:"Locked",isArchived:"Closed",isOverdue:isOverdue,uploaderUserId:"UserId",ownerUserIds:"OwnerIds",editorUserId:"EditorId",editorUserIds:"EditorIds",lockerUserId:"ProofLockerId",messageToReviewers:"Description",messageToOwners:"OwnerMessage",messageToEditor:"EditorMessage",fileId:"FileId",fileExtension:"Extension",fileStatus:"FileStatus",fileMessage:"FileStatusMessage",fileSize:"FileSize",pageCount:(0,_transform.number)("Pages"),commentCount:(0,_transform.number)("ParentComments"),canDownload:(0,_transform.truthy)("DownloadOriginal"),type:"Type",processStatus:"ProcessStatus",recipient:"Recipient",recipientEmail:"RecipientEmail",todoCommentCount:(0,_transform.number)("CountTodoComments"),doneCommentCount:(0,_transform.number)("CountDoneComments"),fileCategory:"FileCategory",isAdminOnProof:"IsAdminOnProof",groupId:"GroupId",canReupload:"CanReupload",hasEditors:"HasEditors",groupName:"GroupName",role:"Role",canOthersEditComments:"FeatureEditComments",canAddCommentReplies:"FeatureCanAddCommentReplies",canHaveGeneralComments:"FeatureGeneralComments",canHavePrivateComments:"FeaturePrivateComments",canAddChecklist:"FeatureCanAddChecklist",hasDecisionsEnabled:"FeatureDecisions",hasColorSeparations:"HasColorSeparations",reference:"Reference",integrationReferences:(0,_transform.each)("IntegrationReferences",function(data){return(new _ProofIntegrationReference2.default).fromProofIntegrationReference(data)}),checklist:function checklist(data){return data.Checklist&&(new _ProofChecklist2.default).fromProofChecklist(data.Checklist)},isReferenceEnabled:"FeatureProofReference",source:"Source",owners:(0,_transform.each)("Owners",function(ownerData){return(new _User2.default).fromUser(ownerData)}),decisionSummary:(0,_transform.each)("Decisions",function(decisionsData){return(new _DecisionSummary2.default).fromDecisionSummary(decisionsData)}),tags:(0,_transform.each)("Tags",function(tag){return tag.Value}),teamId:"TeamId",isPublic:"IsPublic",canBePublic:"FeaturePublicProofs",availableWorkflowRoles:"FeatureAvailableWorkflowRoles",usePreviousVersionDueDate:"FeatureUsePreviousVersionDueDate",canSendShareLink:"FeatureSendShareLink",publicProofKeyPair:function publicProofKeyPair(data){return data.PublicProofKeyPair&&{publicKeyPEM:data.PublicProofKeyPair.PublicKey,privateKeyPEM:data.PublicProofKeyPair.PrivateKey}},canSendMessageToOwners:"FeatureMessageToOwners",workflowMetrics:"WorkflowMetrics",commentVisibility:"CommentVisibility",canHaveCommentVisibility:"FeatureCommentVisibility",importUrl:"ImportURL",priority:"Priority",scheduledDate:(0,_transform.date)("ScheduledDate"),statusMessage:"StatusMessage",isDigitalVerificationEnabled:"IsDigitalVerificationEnabled"};var Proof=function(){function Proof(){_classCallCheck(this,Proof)}Proof.prototype.isUserAdminOfProofTeam=function isUserAdminOfProofTeam(user){return user.isAdmin&&this.teamId===user.teamId};Proof.prototype.getState=function getState(){var state=_ProofState2.default.ACTIVE;if(this.fileStatus===_FileStatus2.default.UPLOADING||!this.fileStatus&&this.statusMessage===_StatusMessage2.default.UPLOADING){state=_ProofState2.default.UPLOADING}else if(this.hasFileError()){state=_ProofState2.default.FILE_ERROR}else if(this.isProcessing()){state=_ProofState2.default.PROCESSING}else if(this.type===_ProofType2.default.BRIEF){switch(this.status){case _ProofStatus2.default.NEW:state=_ProofState2.default.SETUP_NEEDED;break;case _ProofStatus2.default.PROOFING:case _ProofStatus2.default.FINAL_APPROVING:state=_ProofState2.default.AWAITING_PROOF;break;case _ProofStatus2.default.AWAITING_NEW_VERSION:state=_ProofState2.default.AWAITING_PROOF;break;case _ProofStatus2.default.HAS_NEW_VERSION:state=_ProofState2.default.HAS_NEW_VERSION;break;case _ProofStatus2.default.APPROVED:state=_ProofState2.default.APPROVED;break;case _ProofStatus2.default.ARCHIVED:state=_ProofState2.default.ARCHIVED;break;default:state=_ProofState2.default.BRIEFING;break}}else if(this.status===_ProofStatus2.default.ARCHIVED){state=_ProofState2.default.ARCHIVED}else if(this.status===_ProofStatus2.default.TODOS_REQUESTED){state=_ProofState2.default.TODOS_REQUESTED}else if(this.status===_ProofStatus2.default.AWAITING_NEW_VERSION){state=_ProofState2.default.AWAITING_NEW_VERSION}else if(this.status===_ProofStatus2.default.HAS_NEW_VERSION){state=_ProofState2.default.HAS_NEW_VERSION}else if(this.status===_ProofStatus2.default.APPROVED){state=_ProofState2.default.APPROVED}else if(!this.hasWorkflow()){state=_ProofState2.default.PROOFERS_NEEDED}else if(!this.hasWorkflowStarted()){state=_ProofState2.default.NOT_STARTED}else if(this.isOverdue||this.dueDate&&this.dueDate.getTime()<Date.now()){state=_ProofState2.default.OVERDUE}return state};Proof.prototype.getVideoProcessingProgress=function getVideoProcessingProgress(){var percent=0;var message=String(this.fileMessage);if(message){var thumbMatch=/^Thumb-\w+\-([-+]?[0-9]*\.?[0-9]*)/g.exec(message);var videoMatch=/^Video-\w+\-([-+]?[0-9]*\.?[0-9]*)/g.exec(message);if(message.startsWith("Video-Scheduled-")){percent=0}else if(videoMatch){percent=(0,_getPercentage2.default)(parseFloat(videoMatch[1])/100,0,.2)}else if(thumbMatch){percent=(0,_getPercentage2.default)(parseFloat(thumbMatch[1])/100,.8,0)}}return percent};Proof.prototype.hasWorkflowStarted=function hasWorkflowStarted(){return this.hasWorkflow()&&this.status!==_ProofStatus2.default.NEW};Proof.prototype.isProcessing=function isProcessing(){if(this.fileStatus===_FileStatus2.default.UPLOADING||this.fileStatus===_FileStatus2.default.QUEUED||this.fileStatus===_FileStatus2.default.RIPPING){return true}if(!this.fileStatus){return this.statusMessage===_StatusMessage2.default.UPLOADING||this.statusMessage===_StatusMessage2.default.PROCESSING}return false};Proof.prototype.isAwaitingFile=function isAwaitingFile(){return this.source&&this.fileStatus===_FileStatus2.default.CREATED};Proof.prototype.getProcessingProgress=function getProcessingProgress(){switch(this.fileStatus){case _FileStatus2.default.UPLOADING:return.1;case _FileStatus2.default.QUEUED:return.2;case _FileStatus2.default.RIPPING:if(this.fileCategory==="video"){return(0,_getPercentage2.default)(this.getVideoProcessingProgress(),.2,.1).toFixed(2)}return.6;default:return-1}};Proof.prototype.hasWorkflow=function hasWorkflow(){return(0,_id.isWorkflowId)(this.workflowId)};Proof.prototype.hasFile=function hasFile(){return(0,_id.isFileId)(this.fileId)};Proof.prototype.hasFileError=function hasFileError(){if(this.fileStatus===_FileStatus2.default.ERROR){return true}if(!this.fileStatus){if(this.statusMessage===_StatusMessage2.default.FILE_ERROR){return true}if(!this.hasFile()){return true}return false}return false};Proof.prototype.hasEditor=function hasEditor(){return(0,_id.isUserId)(this.editorUserId)};Proof.prototype.hasThumbnail=function hasThumbnail(){if(this.fileStatus===_FileStatus2.default.OK){return true}if(!this.fileStatus&&this.hasFile()){if(this.statusMessage===_StatusMessage2.default.FILE_ERROR||this.statusMessage===_StatusMessage2.default.UPLOADING||this.statusMessage===_StatusMessage2.default.PROCESSING||this.statusMessage===_StatusMessage2.default.AWAITING_FILE||this.statusMessage===_StatusMessage2.default.AWAITING_EMAIL){return false}return true}return false};Proof.prototype.canUserUploadNewVersion=function canUserUploadNewVersion(userId){return this.getState()===_ProofState2.default.AWAITING_NEW_VERSION&&(this.isEditor(userId)||this.isOwner(userId))||this.getState()===_ProofState2.default.AWAITING_PROOF&&(this.isEditor(userId)||this.isRecipient(userId))};Proof.prototype.isOwner=function isOwner(userId){return this.ownerUserIds.indexOf(userId)!==-1};Proof.prototype.isEditor=function isEditor(userId){return this.editorUserIds.indexOf(userId)!==-1};Proof.prototype.isRecipient=function isRecipient(userId){return this.recipient===userId};Proof.prototype.calculateState=function calculateState(){this.state=this.getState()};Proof.prototype.fromProof=function fromProof(proofData){(0,_transform2.default)(this,proofSchema,proofData);this.calculateState();return this};Proof.getStateFromRawData=function getStateFromRawData(proofData){var proof=new Proof;proof.fromProof(proofData);return proof.getState()};return Proof}();exports.default=Proof;
|
|
@@ -6,6 +6,12 @@ declare class TeamGeneralFeatures {
|
|
|
6
6
|
* @type {boolean}
|
|
7
7
|
*/
|
|
8
8
|
enableCelebrations: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the labels feature is enabled for the team.
|
|
11
|
+
*
|
|
12
|
+
* @type {boolean}
|
|
13
|
+
*/
|
|
14
|
+
enableLabels: boolean;
|
|
9
15
|
/** @private */
|
|
10
16
|
private fromTeamGeneralFeatures;
|
|
11
17
|
}
|
|
@@ -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 TeamGeneralFeaturesSchema={enableCelebrations:"EnableCelebrations"};var TeamGeneralFeatures=function(){function TeamGeneralFeatures(){_classCallCheck(this,TeamGeneralFeatures)}TeamGeneralFeatures.prototype.fromTeamGeneralFeatures=function fromTeamGeneralFeatures(teamGeneralFeaturesData){(0,_transform2.default)(this,TeamGeneralFeaturesSchema,teamGeneralFeaturesData);return this};return TeamGeneralFeatures}();exports.default=TeamGeneralFeatures;
|
|
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 TeamGeneralFeaturesSchema={enableCelebrations:"EnableCelebrations",enableLabels:"EnableLabels"};var TeamGeneralFeatures=function(){function TeamGeneralFeatures(){_classCallCheck(this,TeamGeneralFeatures)}TeamGeneralFeatures.prototype.fromTeamGeneralFeatures=function fromTeamGeneralFeatures(teamGeneralFeaturesData){(0,_transform2.default)(this,TeamGeneralFeaturesSchema,teamGeneralFeaturesData);return this};return TeamGeneralFeatures}();exports.default=TeamGeneralFeatures;
|
package/lib/models/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Comment from "./Comment";
|
|
2
2
|
import File from "./File";
|
|
3
|
+
import Label from "./Label";
|
|
3
4
|
import Proof from "./Proof";
|
|
4
5
|
import ProofGroup from "./ProofGroup";
|
|
5
6
|
import ProofVersion from "./ProofVersion";
|
|
@@ -8,4 +9,4 @@ import User from "./User";
|
|
|
8
9
|
import Workflow from "./Workflow";
|
|
9
10
|
import WorkflowStep from "./WorkflowStep";
|
|
10
11
|
import WorkflowUser from "./WorkflowUser";
|
|
11
|
-
export { Comment, File, Proof, ProofGroup, ProofVersion, Session, User, Workflow, WorkflowStep, WorkflowUser };
|
|
12
|
+
export { Comment, File, Label, Proof, ProofGroup, ProofVersion, Session, User, Workflow, WorkflowStep, WorkflowUser };
|
package/lib/models/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;exports.WorkflowUser=exports.WorkflowStep=exports.Workflow=exports.User=exports.Session=exports.ProofVersion=exports.ProofGroup=exports.Proof=exports.File=exports.Comment=undefined;var _Comment=require("./Comment");var _Comment2=_interopRequireDefault(_Comment);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _Proof=require("./Proof");var _Proof2=_interopRequireDefault(_Proof);var _ProofGroup=require("./ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _ProofVersion=require("./ProofVersion");var _ProofVersion2=_interopRequireDefault(_ProofVersion);var _Session=require("./Session");var _Session2=_interopRequireDefault(_Session);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _Workflow=require("./Workflow");var _Workflow2=_interopRequireDefault(_Workflow);var _WorkflowStep=require("./WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);var _WorkflowUser=require("./WorkflowUser");var _WorkflowUser2=_interopRequireDefault(_WorkflowUser);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.Comment=_Comment2.default;exports.File=_File2.default;exports.Proof=_Proof2.default;exports.ProofGroup=_ProofGroup2.default;exports.ProofVersion=_ProofVersion2.default;exports.Session=_Session2.default;exports.User=_User2.default;exports.Workflow=_Workflow2.default;exports.WorkflowStep=_WorkflowStep2.default;exports.WorkflowUser=_WorkflowUser2.default;
|
|
1
|
+
"use strict";exports.__esModule=true;exports.WorkflowUser=exports.WorkflowStep=exports.Workflow=exports.User=exports.Session=exports.ProofVersion=exports.ProofGroup=exports.Proof=exports.Label=exports.File=exports.Comment=undefined;var _Comment=require("./Comment");var _Comment2=_interopRequireDefault(_Comment);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _Label=require("./Label");var _Label2=_interopRequireDefault(_Label);var _Proof=require("./Proof");var _Proof2=_interopRequireDefault(_Proof);var _ProofGroup=require("./ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _ProofVersion=require("./ProofVersion");var _ProofVersion2=_interopRequireDefault(_ProofVersion);var _Session=require("./Session");var _Session2=_interopRequireDefault(_Session);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _Workflow=require("./Workflow");var _Workflow2=_interopRequireDefault(_Workflow);var _WorkflowStep=require("./WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);var _WorkflowUser=require("./WorkflowUser");var _WorkflowUser2=_interopRequireDefault(_WorkflowUser);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.Comment=_Comment2.default;exports.File=_File2.default;exports.Label=_Label2.default;exports.Proof=_Proof2.default;exports.ProofGroup=_ProofGroup2.default;exports.ProofVersion=_ProofVersion2.default;exports.Session=_Session2.default;exports.User=_User2.default;exports.Workflow=_Workflow2.default;exports.WorkflowStep=_WorkflowStep2.default;exports.WorkflowUser=_WorkflowUser2.default;
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
"version": 2,
|
|
328
328
|
"method": "POST",
|
|
329
329
|
"path": "/api/proofs/groups/update",
|
|
330
|
-
"body": ["groupId", "name", "ownedByTeam", "folderName"]
|
|
330
|
+
"body": ["groupId", "name", "ownedByTeam", "folderName", "parentGroupUuid"]
|
|
331
331
|
},
|
|
332
332
|
"proofs.groups.delete": {
|
|
333
333
|
"method": "POST",
|
|
@@ -769,6 +769,16 @@
|
|
|
769
769
|
"path": "/api/proofs/comment/delete",
|
|
770
770
|
"body": ["commentId"]
|
|
771
771
|
},
|
|
772
|
+
"comments.label.add": {
|
|
773
|
+
"method": "POST",
|
|
774
|
+
"path": "/api/comments/label/add",
|
|
775
|
+
"body": ["commentId", "labelId"]
|
|
776
|
+
},
|
|
777
|
+
"comments.label.remove": {
|
|
778
|
+
"method": "POST",
|
|
779
|
+
"path": "/api/comments/label/remove",
|
|
780
|
+
"body": ["commentId", "labelId"]
|
|
781
|
+
},
|
|
772
782
|
"comments.import.create-task": {
|
|
773
783
|
"version": 2,
|
|
774
784
|
"method": "POST",
|
|
@@ -911,7 +921,7 @@
|
|
|
911
921
|
"version": 2,
|
|
912
922
|
"method": "POST",
|
|
913
923
|
"path": "/api/admin/settings",
|
|
914
|
-
"body": ["displayComments", "generalComments", "privateComments", "enableWebhooks", "editComments", "ownerCanDeleteComments", "proofReference", "proofReferenceRequired", "displayTeamName", "emailTitleTextColor", "emailLinkTextColor", "emailButtonBackgroundColor", "emailButtonTextColor", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners", "allowedDecisions", "enableChecklists", "suggestionsIncludeTeamMembers", "enableUserGroups", "enableCommentVisibility", "defaultCommentVisibility", "usePreviousVersionDueDate", "enableViewOnlyReviewers", "enableIntelligence", "licenseIntelligenceInsightsInProofing", "enableIntelligenceInsightsInProofing", "defaultIntelligenceInsightsInProofing", "enableIntelligenceInsightsCommentsInProofing", "defaultIntelligenceInsightsCommentsInProofing", "licenseIntelligenceInsightsOnDashboard", "defaultIntelligenceInsightsCommentsOnDashboard", "enableIntelligenceInsightsOnDashboard", "licenseIntelligenceInsightsInReports", "enableIntelligenceInsightsInReports", "enableIntelligenceSmartTags", "enableProofMagicAccess", "enableIntelligenceSmartCheckCr", "defaultGifOutput", "enableCelebrations", "licenseDigitalVerification", "enableDigitalVerification", "defaultDigitalVerification", "reauthentication", "enableProofSoftDeletion"]
|
|
924
|
+
"body": ["displayComments", "generalComments", "privateComments", "enableWebhooks", "editComments", "ownerCanDeleteComments", "proofReference", "proofReferenceRequired", "displayTeamName", "emailTitleTextColor", "emailLinkTextColor", "emailButtonBackgroundColor", "emailButtonTextColor", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners", "allowedDecisions", "enableChecklists", "suggestionsIncludeTeamMembers", "enableUserGroups", "enableCommentVisibility", "defaultCommentVisibility", "usePreviousVersionDueDate", "enableViewOnlyReviewers", "enableIntelligence", "licenseIntelligenceInsightsInProofing", "enableIntelligenceInsightsInProofing", "defaultIntelligenceInsightsInProofing", "enableIntelligenceInsightsCommentsInProofing", "defaultIntelligenceInsightsCommentsInProofing", "licenseIntelligenceInsightsOnDashboard", "defaultIntelligenceInsightsCommentsOnDashboard", "enableIntelligenceInsightsOnDashboard", "licenseIntelligenceInsightsInReports", "enableIntelligenceInsightsInReports", "enableIntelligenceSmartTags", "enableProofMagicAccess", "enableIntelligenceSmartCheckCr", "defaultGifOutput", "enableCelebrations", "licenseDigitalVerification", "enableDigitalVerification", "defaultDigitalVerification", "reauthentication", "enableProofSoftDeletion", "enableLabels"]
|
|
915
925
|
},
|
|
916
926
|
"admin.team.features.sender-email.set": {
|
|
917
927
|
"version": 2,
|
|
@@ -945,6 +955,17 @@
|
|
|
945
955
|
"path": "/api/integrations/configuration/update",
|
|
946
956
|
"body": ["level", "integrationKey", "key", "value"]
|
|
947
957
|
},
|
|
958
|
+
"integrations.jira.get-pending-connection": {
|
|
959
|
+
"method": "GET",
|
|
960
|
+
"path": "/api/integrations/jira/pending-connection",
|
|
961
|
+
"query": ["pendingId"]
|
|
962
|
+
},
|
|
963
|
+
"integrations.jira.complete-pending-connection": {
|
|
964
|
+
"version": 2,
|
|
965
|
+
"method": "POST",
|
|
966
|
+
"path": "/api/integrations/jira/pending-connection",
|
|
967
|
+
"body": ["pendingId", "cloudId"]
|
|
968
|
+
},
|
|
948
969
|
"integrations.get-available-reference-integrations": {
|
|
949
970
|
"method": "GET",
|
|
950
971
|
"path": "/api/integrations/reference/available_integrations"
|