@pageproof/sdk-pr 90.0.1530762572906 → 90.0.1531966420850
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/lib/api/admin/Admin.js +5 -1
- package/lib/api/admin/Team.js +5 -1
- package/lib/api/admin/TeamUsers.js +5 -1
- package/lib/enum/ProofState.js +1 -1
- package/lib/enum/ProofType.js +1 -0
- package/lib/enum/index.js +1 -1
- package/lib/index.js +5 -1
- package/lib/models/Proof.js +1 -1
- package/lib/pageproof.js +2 -2
- package/lib/worker-crypto-adapter.js +1 -1
- package/lib/{worker.434ad608.js → worker.fa2b047e.js} +1 -1
- package/package.json +1 -1
package/lib/api/admin/Admin.js
CHANGED
|
@@ -16,7 +16,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
19
|
-
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; }
|
|
19
|
+
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; } /* Copyright (C) 2018 PageProof Holdings Limited - All Rights Reserved.
|
|
20
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
21
|
+
* Proprietary and confidential.
|
|
22
|
+
*/
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
var Admin = function (_API) {
|
|
22
26
|
_inherits(Admin, _API);
|
package/lib/api/admin/Team.js
CHANGED
|
@@ -16,7 +16,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
19
|
-
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; }
|
|
19
|
+
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; } /* Copyright (C) 2018 PageProof Holdings Limited - All Rights Reserved.
|
|
20
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
21
|
+
* Proprietary and confidential.
|
|
22
|
+
*/
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
var Team = function (_API) {
|
|
22
26
|
_inherits(Team, _API);
|
|
@@ -16,7 +16,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
19
|
-
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; }
|
|
19
|
+
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; } /* Copyright (C) 2018 PageProof Holdings Limited - All Rights Reserved.
|
|
20
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
21
|
+
* Proprietary and confidential.
|
|
22
|
+
*/
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
/** @private */
|
|
22
26
|
function transformResponseUsers(response) {
|
package/lib/enum/ProofState.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var ProofState={UPLOADING:"uploading",FILE_ERROR:"file-error",PROCESSING:"processing",ARCHIVED:"archived",PROOFERS_NEEDED:"proofers-needed",TODOS_REQUESTED:"todos-requested",AWAITING_NEW_VERSION:"awaiting-new-version",HAS_NEW_VERSION:"has-new-version",APPROVED:"approved",NOT_STARTED:"not-started",OVERDUE:"overdue",ACTIVE:"active"};exports.default=ProofState;
|
|
1
|
+
"use strict";exports.__esModule=true;var ProofState={UPLOADING:"uploading",FILE_ERROR:"file-error",PROCESSING:"processing",ARCHIVED:"archived",PROOFERS_NEEDED:"proofers-needed",TODOS_REQUESTED:"todos-requested",AWAITING_NEW_VERSION:"awaiting-new-version",HAS_NEW_VERSION:"has-new-version",APPROVED:"approved",NOT_STARTED:"not-started",OVERDUE:"overdue",ACTIVE:"active",BRIEF_SETUP_NEEDED:"brief-setup-needed",BRIEF_AWAITING_PROOF:"brief-awaiting-proof",BRIEF_UPLOAD_PROOF:"brief-upload-proof"};exports.default=ProofState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.__esModule=true;var ProofType={PROOF:1,BRIEF:2};exports.default=ProofType;
|
package/lib/enum/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;exports.WorkflowUserState=exports.WorkflowUserRole=exports.WorkflowStepState=exports.ResponseStatus=exports.ProofStatus=exports.ProofState=exports.ImportProvider=exports.FileStatus=exports.FileAssignee=exports.CommentState=undefined;var _CommentState=require("./CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _FileAssignee=require("./FileAssignee");var _FileAssignee2=_interopRequireDefault(_FileAssignee);var _FileStatus=require("./FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _ImportProvider=require("./ImportProvider");var _ImportProvider2=_interopRequireDefault(_ImportProvider);var _ProofState=require("./ProofState");var _ProofState2=_interopRequireDefault(_ProofState);var _ProofStatus=require("./ProofStatus");var _ProofStatus2=_interopRequireDefault(_ProofStatus);var _ResponseStatus=require("./ResponseStatus");var _ResponseStatus2=_interopRequireDefault(_ResponseStatus);var _WorkflowStepState=require("./WorkflowStepState");var _WorkflowStepState2=_interopRequireDefault(_WorkflowStepState);var _WorkflowUserRole=require("./WorkflowUserRole");var _WorkflowUserRole2=_interopRequireDefault(_WorkflowUserRole);var _WorkflowUserState=require("./WorkflowUserState");var _WorkflowUserState2=_interopRequireDefault(_WorkflowUserState);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.CommentState=_CommentState2.default;exports.FileAssignee=_FileAssignee2.default;exports.FileStatus=_FileStatus2.default;exports.ImportProvider=_ImportProvider2.default;exports.ProofState=_ProofState2.default;exports.ProofStatus=_ProofStatus2.default;exports.ResponseStatus=_ResponseStatus2.default;exports.WorkflowStepState=_WorkflowStepState2.default;exports.WorkflowUserRole=_WorkflowUserRole2.default;exports.WorkflowUserState=_WorkflowUserState2.default;
|
|
1
|
+
"use strict";exports.__esModule=true;exports.ProofType=exports.WorkflowUserState=exports.WorkflowUserRole=exports.WorkflowStepState=exports.ResponseStatus=exports.ProofStatus=exports.ProofState=exports.ImportProvider=exports.FileStatus=exports.FileAssignee=exports.CommentState=undefined;var _CommentState=require("./CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _FileAssignee=require("./FileAssignee");var _FileAssignee2=_interopRequireDefault(_FileAssignee);var _FileStatus=require("./FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _ImportProvider=require("./ImportProvider");var _ImportProvider2=_interopRequireDefault(_ImportProvider);var _ProofState=require("./ProofState");var _ProofState2=_interopRequireDefault(_ProofState);var _ProofStatus=require("./ProofStatus");var _ProofStatus2=_interopRequireDefault(_ProofStatus);var _ResponseStatus=require("./ResponseStatus");var _ResponseStatus2=_interopRequireDefault(_ResponseStatus);var _WorkflowStepState=require("./WorkflowStepState");var _WorkflowStepState2=_interopRequireDefault(_WorkflowStepState);var _WorkflowUserRole=require("./WorkflowUserRole");var _WorkflowUserRole2=_interopRequireDefault(_WorkflowUserRole);var _WorkflowUserState=require("./WorkflowUserState");var _WorkflowUserState2=_interopRequireDefault(_WorkflowUserState);var _ProofType=require("./ProofType");var _ProofType2=_interopRequireDefault(_ProofType);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.CommentState=_CommentState2.default;exports.FileAssignee=_FileAssignee2.default;exports.FileStatus=_FileStatus2.default;exports.ImportProvider=_ImportProvider2.default;exports.ProofState=_ProofState2.default;exports.ProofStatus=_ProofStatus2.default;exports.ResponseStatus=_ResponseStatus2.default;exports.WorkflowStepState=_WorkflowStepState2.default;exports.WorkflowUserRole=_WorkflowUserRole2.default;exports.WorkflowUserState=_WorkflowUserState2.default;exports.ProofType=_ProofType2.default;
|
package/lib/index.js
CHANGED
|
@@ -27,7 +27,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
|
-
exports.default = _PageProof2.default;
|
|
30
|
+
exports.default = _PageProof2.default; /* Copyright (C) 2018 PageProof Holdings Limited - All Rights Reserved.
|
|
31
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
32
|
+
* Proprietary and confidential.
|
|
33
|
+
*/
|
|
34
|
+
|
|
31
35
|
exports.Client = _PageProof2.default;
|
|
32
36
|
exports.Bluffer = _bluffer2.default;
|
|
33
37
|
exports.Enum = Enum;
|
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 _FileStatus=require("../enum/FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _id=require("../util/id");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",version:"Version",dueDate:(0,_transform.date)("DueDate"),createdDate:(0,_transform.date)("CreatedDate"),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",pageCount:(0,_transform.number)("Pages"),commentCount:(0,_transform.number)("ParentComments"),canDownload:(0,_transform.truthy)("DownloadOriginal"),type:"Type",processStatus:"ProcessStatus",recipient:"Recipient"};var Proof=function(){function Proof(){_classCallCheck(this,Proof)}Proof.prototype.getState=function getState(){var state=_ProofState2.default.ACTIVE;if(this.fileStatus===_FileStatus2.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.status===_ProofStatus2.default.ARCHIVED){state=_ProofState2.default.ARCHIVED}else if(!this.hasWorkflow()){state=_ProofState2.default.PROOFERS_NEEDED}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.hasWorkflowStarted()){state=_ProofState2.default.NOT_STARTED}else if(this.isOverdue){state=_ProofState2.default.OVERDUE}return state};Proof.prototype.hasWorkflowStarted=function hasWorkflowStarted(){return this.hasWorkflow()&&this.status!==_ProofStatus2.default.NEW};Proof.prototype.isProcessing=function isProcessing(){return this.fileStatus===_FileStatus2.default.UPLOADING||this.fileStatus===_FileStatus2.default.QUEUED||this.fileStatus===_FileStatus2.default.RIPPING};Proof.prototype.getProcessingProgress=function getProcessingProgress(){switch(this.fileStatus){case _FileStatus2.default.UPLOADING:return.1;case _FileStatus2.default.QUEUED:return.2;case _FileStatus2.default.RIPPING: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(){return this.fileStatus===_FileStatus2.default.ERROR||!this.fileStatus||!this.hasFile()};Proof.prototype.hasEditor=function hasEditor(){return(0,_id.isUserId)(this.editorUserId)};Proof.prototype.hasThumbnail=function hasThumbnail(){return this.fileStatus===_FileStatus2.default.OK};Proof.prototype.canUserUploadNewVersion=function canUserUploadNewVersion(userId){return this.getState()===_ProofState2.default.AWAITING_NEW_VERSION&&(this.isEditor(userId)||this.isOwner(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.calculateState=function calculateState(){this.state=this.getState()};Proof.prototype.fromProof=function fromProof(proofData){(0,_transform2.default)(this,proofSchema,proofData);this.calculateState();return this};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 _id=require("../util/id");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",version:"Version",dueDate:(0,_transform.date)("DueDate"),createdDate:(0,_transform.date)("CreatedDate"),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",pageCount:(0,_transform.number)("Pages"),commentCount:(0,_transform.number)("ParentComments"),canDownload:(0,_transform.truthy)("DownloadOriginal"),type:"Type",processStatus:"ProcessStatus",recipient:"Recipient"};var Proof=function(){function Proof(){_classCallCheck(this,Proof)}Proof.prototype.getState=function getState(){var state=_ProofState2.default.ACTIVE;if(this.fileStatus===_FileStatus2.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.BRIEF_SETUP_NEEDED;case _ProofStatus2.default.PROOFING:state=_ProofState2.default.BRIEF_AWAITING_PROOF;case _ProofStatus2.default.AWAITING_NEW_VERSION:state=_ProofState2.default.BRIEF_UPLOAD_PROOF;case _ProofStatus2.default.HAS_NEW_VERSION:state=_ProofState2.default.HAS_NEW_VERSION;case _ProofStatus2.default.ARCHIVED:state=_ProofState2.default.ARCHIVED}}else if(this.status===_ProofStatus2.default.ARCHIVED){state=_ProofState2.default.ARCHIVED}else if(!this.hasWorkflow()){state=_ProofState2.default.PROOFERS_NEEDED}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.hasWorkflowStarted()){state=_ProofState2.default.NOT_STARTED}else if(this.isOverdue){state=_ProofState2.default.OVERDUE}return state};Proof.prototype.hasWorkflowStarted=function hasWorkflowStarted(){return this.hasWorkflow()&&this.status!==_ProofStatus2.default.NEW};Proof.prototype.isProcessing=function isProcessing(){return this.fileStatus===_FileStatus2.default.UPLOADING||this.fileStatus===_FileStatus2.default.QUEUED||this.fileStatus===_FileStatus2.default.RIPPING};Proof.prototype.getProcessingProgress=function getProcessingProgress(){switch(this.fileStatus){case _FileStatus2.default.UPLOADING:return.1;case _FileStatus2.default.QUEUED:return.2;case _FileStatus2.default.RIPPING: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(){return this.fileStatus===_FileStatus2.default.ERROR||!this.fileStatus||!this.hasFile()};Proof.prototype.hasEditor=function hasEditor(){return(0,_id.isUserId)(this.editorUserId)};Proof.prototype.hasThumbnail=function hasThumbnail(){return this.fileStatus===_FileStatus2.default.OK};Proof.prototype.canUserUploadNewVersion=function canUserUploadNewVersion(userId){return this.getState()===_ProofState2.default.AWAITING_NEW_VERSION&&(this.type===_ProofType2.default.PROOF&&(this.isEditor(userId)||this.isOwner(userId))||this.type===_ProofType2.default.BRIEF&&(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.recipeint===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};return Proof}();exports.default=Proof;
|