@pageproof/sdk-pr 442.0.1663213727878 → 443.0.1652837272571
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 +0 -42
- package/README.md +68 -60
- package/lib/api/Proofs.d.ts +21 -29
- package/lib/api/Proofs.js +1 -1
- package/lib/api/ProofsGroups.d.ts +1 -2
- package/lib/api/ProofsGroups.js +1 -1
- package/lib/api/admin/TeamFeatures.d.ts +0 -4
- package/lib/api/admin/TeamFeatures.js +1 -7
- package/lib/core/PageProof.d.ts +0 -35
- package/lib/core/PageProof.js +1 -1
- package/lib/models/File.d.ts +0 -6
- package/lib/models/File.js +1 -1
- package/lib/models/Proof.d.ts +2 -15
- package/lib/models/Proof.js +1 -1
- package/lib/models/ProofGroup.d.ts +0 -10
- package/lib/models/ProofGroup.js +1 -1
- package/lib/models/TeamProofFeatures.d.ts +0 -12
- package/lib/models/TeamProofFeatures.js +1 -1
- package/lib/network/endpoints.json +2 -9
- package/lib/pageproof.js +1 -1
- package/lib/util/Scheduler.js +1 -1
- package/lib/worker-crypto-adapter.js +1 -1
- package/package.json +1 -1
- package/lib/adapters/WorkerThreadsCryptoAdapter.d.ts +0 -17
- package/lib/adapters/WorkerThreadsCryptoAdapter.js +0 -1
- package/lib/api/ChecklistTemplates.d.ts +0 -86
- package/lib/api/ChecklistTemplates.js +0 -1
- package/lib/api/ChecklistTemplatesEntities.d.ts +0 -30
- package/lib/api/ChecklistTemplatesEntities.js +0 -1
- package/lib/models/ProofChecklist.d.ts +0 -45
- package/lib/models/ProofChecklist.js +0 -1
- package/lib/util/AggregateError.d.ts +0 -2
- package/lib/util/AggregateError.js +0 -1
- package/lib/util/GraphQLError.d.ts +0 -6
- package/lib/util/GraphQLError.js +0 -1
- package/lib/util/gql.d.ts +0 -2
- package/lib/util/gql.js +0 -1
- package/lib/worker/WorkerThreadsWorker.d.ts +0 -1
- package/lib/worker/WorkerThreadsWorker.js +0 -1
package/lib/models/Proof.d.ts
CHANGED
|
@@ -114,9 +114,9 @@ declare class Proof {
|
|
|
114
114
|
*
|
|
115
115
|
* Note: The user object only contain partial details (id, email).
|
|
116
116
|
*
|
|
117
|
-
* @type {User
|
|
117
|
+
* @type {User}
|
|
118
118
|
*/
|
|
119
|
-
emailSender: User
|
|
119
|
+
emailSender: User;
|
|
120
120
|
/**
|
|
121
121
|
* If a user has been assigned to make changes to the file (when to-dos have been requested), this is their user id.
|
|
122
122
|
*
|
|
@@ -259,12 +259,6 @@ declare class Proof {
|
|
|
259
259
|
* @type {string}
|
|
260
260
|
*/
|
|
261
261
|
groupName: string;
|
|
262
|
-
/**
|
|
263
|
-
* Whether the proof can have a checklist added to it.
|
|
264
|
-
*
|
|
265
|
-
* @type {boolean}
|
|
266
|
-
*/
|
|
267
|
-
canAddChecklist: boolean;
|
|
268
262
|
/**
|
|
269
263
|
* Whether the proof has the decisions feature enabled
|
|
270
264
|
*
|
|
@@ -285,12 +279,6 @@ declare class Proof {
|
|
|
285
279
|
* @type {Array<ProofIntegrationReference>}
|
|
286
280
|
*/
|
|
287
281
|
integrationReferences: Array<ProofIntegrationReference>;
|
|
288
|
-
/**
|
|
289
|
-
* The checklist attached to the proof.
|
|
290
|
-
*
|
|
291
|
-
* @type {ProofChecklist}
|
|
292
|
-
*/
|
|
293
|
-
checklist: ProofChecklist;
|
|
294
282
|
/**
|
|
295
283
|
* Whether the reference has been enabled/disabled (which can be used to integrate with other applications)
|
|
296
284
|
*
|
|
@@ -519,5 +507,4 @@ declare class Proof {
|
|
|
519
507
|
import User from "./User";
|
|
520
508
|
import ProofType from "../enum/ProofType";
|
|
521
509
|
import ProofIntegrationReference from "./ProofIntegrationReference";
|
|
522
|
-
import ProofChecklist from "./ProofChecklist";
|
|
523
510
|
import DecisionSummary from "./DecisionSummary";
|
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 _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);
|
|
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");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);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)("CreateDate"),approvedDate:(0,_transform.date)("ApprovedDate"),isLocked:"Locked",isArchived:"Closed",isOverdue:isOverdue,uploaderUserId:"UserId",ownerUserIds:"OwnerIds",emailSender:function emailSender(data){return data.EmailSender&&(new _User2.default).fromUser(data.EmailSender)},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",hasDecisionsEnabled:"FeatureDecisions",hasColorSeparations:"HasColorSeparations",reference:"Reference",integrationReferences:(0,_transform.each)("IntegrationReferences",function(data){return(new _ProofIntegrationReference2.default).fromProofIntegrationReference(data)}),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",canSendShareLink:"FeatureSendShareLink",publicProofKeyPair:function publicProofKeyPair(data){return data.PublicProofKeyPair&&{publicKeyPEM:data.PublicProofKeyPair.PublicKey,privateKeyPEM:data.PublicProofKeyPair.PrivateKey}},canSendMessageToOwners:"FeatureMessageToOwners",workflowMetrics:"WorkflowMetrics"};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){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:state=_ProofState2.default.BRIEFING;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.ARCHIVED:state=_ProofState2.default.ARCHIVED;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){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(){return this.fileStatus===_FileStatus2.default.UPLOADING||this.fileStatus===_FileStatus2.default.QUEUED||this.fileStatus===_FileStatus2.default.RIPPING};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(){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))||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};return Proof}();exports.default=Proof;
|
|
@@ -66,16 +66,6 @@ declare class ProofGroup {
|
|
|
66
66
|
* @type {string}
|
|
67
67
|
*/
|
|
68
68
|
createdBy: string;
|
|
69
|
-
/**
|
|
70
|
-
* The folder the group belongs to.
|
|
71
|
-
*
|
|
72
|
-
* @since v2.0.0-beta.293
|
|
73
|
-
*
|
|
74
|
-
* @type {{ name: string } | null}
|
|
75
|
-
*/
|
|
76
|
-
folder: {
|
|
77
|
-
name: string;
|
|
78
|
-
} | null;
|
|
79
69
|
/**
|
|
80
70
|
* Whether a user is a team admin of this proof group.
|
|
81
71
|
*
|
package/lib/models/ProofGroup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _Proof=require("./Proof");var _Proof2=_interopRequireDefault(_Proof);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var proofGroupSchema={canAddProofs:"CanAddProofs",id:"GroupId",name:"Name",isEmpty:"IsEmpty",isArchived:"Archived",teamId:"TeamId",createdBy:"CreatedBy",isOwnedByTeam:"OwnedByTeam",
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _Proof=require("./Proof");var _Proof2=_interopRequireDefault(_Proof);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var proofGroupSchema={canAddProofs:"CanAddProofs",id:"GroupId",name:"Name",isEmpty:"IsEmpty",isArchived:"Archived",teamId:"TeamId",createdBy:"CreatedBy",isOwnedByTeam:"OwnedByTeam",proofs:(0,_transform.each)("ProofInfo",function(proofData){return(new _Proof2.default).fromProof(proofData)})};var ProofGroup=function(){function ProofGroup(){_classCallCheck(this,ProofGroup)}ProofGroup.prototype.isUserAdminOfGroupTeam=function isUserAdminOfGroupTeam(user){return user.isAdmin&&this.teamId===user.teamId};ProofGroup.prototype.fromProofGroup=function fromProofGroup(proofGroupData){(0,_transform2.default)(this,proofGroupSchema,proofGroupData);return this};return ProofGroup}();exports.default=ProofGroup;
|
|
@@ -26,18 +26,6 @@ declare class TeamProofFeatures {
|
|
|
26
26
|
* @type {boolean}
|
|
27
27
|
*/
|
|
28
28
|
messageToOwners: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Array of proof decisions that allowed to the reviewer.
|
|
31
|
-
*
|
|
32
|
-
* @type {Array<Decision>}
|
|
33
|
-
*/
|
|
34
|
-
allowedDecisions: Array<Decision>;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the checklists feature is enabled.
|
|
37
|
-
*
|
|
38
|
-
* @type {boolean}
|
|
39
|
-
*/
|
|
40
|
-
enableChecklists: boolean;
|
|
41
29
|
/** @private */
|
|
42
30
|
fromTeamProofFeatures(teamProofFeaturesData: any): TeamProofFeatures;
|
|
43
31
|
}
|
|
@@ -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 TeamProofFeatureSchema={reference:"ProofReference",publicProofs:"PublicProofs",defaultIsPublic:"DefaultProofIsPublic",messageToOwners:"MessageToOwners"
|
|
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 TeamProofFeatureSchema={reference:"ProofReference",publicProofs:"PublicProofs",defaultIsPublic:"DefaultProofIsPublic",messageToOwners:"MessageToOwners"};var TeamProofFeatures=function(){function TeamProofFeatures(){_classCallCheck(this,TeamProofFeatures)}TeamProofFeatures.prototype.fromTeamProofFeatures=function fromTeamProofFeatures(teamProofFeaturesData){(0,_transform2.default)(this,TeamProofFeatureSchema,teamProofFeaturesData);return this};return TeamProofFeatures}();exports.default=TeamProofFeatures;
|
|
@@ -312,10 +312,9 @@
|
|
|
312
312
|
"body": ["name", "ownedByTeam"]
|
|
313
313
|
},
|
|
314
314
|
"proofs.groups.update": {
|
|
315
|
-
"version": 2,
|
|
316
315
|
"method": "POST",
|
|
317
316
|
"path": "/api/proofs/groups/update",
|
|
318
|
-
"body": ["groupId", "name", "ownedByTeam"
|
|
317
|
+
"body": ["groupId", "name", "ownedByTeam"]
|
|
319
318
|
},
|
|
320
319
|
"proofs.groups.delete": {
|
|
321
320
|
"method": "POST",
|
|
@@ -853,7 +852,7 @@
|
|
|
853
852
|
"version": 2,
|
|
854
853
|
"method": "POST",
|
|
855
854
|
"path": "/api/admin/settings",
|
|
856
|
-
"body": ["displayComments", "generalComments", "editComments", "proofReference", "displayTeamName", "emailTitleTextColor", "emailLinkTextColor", "emailButtonBackgroundColor", "emailButtonTextColor", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners"
|
|
855
|
+
"body": ["displayComments", "generalComments", "editComments", "proofReference", "displayTeamName", "emailTitleTextColor", "emailLinkTextColor", "emailButtonBackgroundColor", "emailButtonTextColor", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners"]
|
|
857
856
|
},
|
|
858
857
|
"admin.team.features.sender-email.set": {
|
|
859
858
|
"version": 2,
|
|
@@ -1130,11 +1129,5 @@
|
|
|
1130
1129
|
"method": "POST",
|
|
1131
1130
|
"path": "/api/public-proofs/proof/send-share-link",
|
|
1132
1131
|
"body": ["proofId", "message", "emailAddresses"]
|
|
1133
|
-
},
|
|
1134
|
-
"graphql": {
|
|
1135
|
-
"version": 2,
|
|
1136
|
-
"method": "POST",
|
|
1137
|
-
"path": "/spider/graphql",
|
|
1138
|
-
"body": true
|
|
1139
1132
|
}
|
|
1140
1133
|
}
|