@pageproof/sdk-pr 300.0.1607632288232 → 301.0.1608512357873
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 +21 -0
- package/lib/api/ProofsIntegrationReferences.d.ts +1 -1
- package/lib/api/admin/TeamDashboard.d.ts +8 -0
- package/lib/api/admin/TeamDashboard.js +19 -2
- package/lib/api/admin/TeamDashboardGroups.d.ts +49 -0
- package/lib/api/admin/TeamDashboardGroups.js +112 -0
- package/lib/api/admin/TeamFeatures.d.ts +2 -0
- package/lib/api/admin/TeamFeatures.js +4 -1
- package/lib/models/Proof.d.ts +23 -1
- package/lib/models/Proof.js +1 -1
- package/lib/models/ProofGroup.d.ts +8 -0
- package/lib/models/ProofGroup.js +1 -1
- package/lib/models/ProofIntegrationReference.d.ts +6 -0
- package/lib/models/ProofIntegrationReference.js +1 -1
- package/lib/models/TeamCommentFeatures.d.ts +7 -0
- package/lib/models/TeamCommentFeatures.js +1 -1
- package/lib/network/endpoints.json +12 -1
- package/lib/pageproof.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.154
|
|
4
|
+
|
|
5
|
+
Released on the 21st of December 2020.
|
|
6
|
+
|
|
7
|
+
- Type updates for proof integration references.
|
|
8
|
+
|
|
9
|
+
## 2.0.0-beta.153
|
|
10
|
+
|
|
11
|
+
Released on the 14th of December 2020.
|
|
12
|
+
|
|
13
|
+
- [[#272](https://github.com/PageProofCom/sdk/pull/272)] Team administrators can now load their team's groups - see [TeamDashboardGroups](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/admin/TeamDashboardGroups.js~TeamDashboardGroups.html).
|
|
14
|
+
- The Proof model now contains the team ID, it belongs to ([Proof.teamId](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/Proof.js~Proof.html#instance-member-teamId)).
|
|
15
|
+
|
|
16
|
+
## 2.0.0-beta.152
|
|
17
|
+
|
|
18
|
+
Released on the 11th of December 2020.
|
|
19
|
+
|
|
20
|
+
- [[#294](https://github.com/PageProofCom/sdk/pull/294)]
|
|
21
|
+
- Support for allowing to disabling replies on comments (by reviewers) in statuses. See [TeamCommentFeatures.disableReplyingToCommentsInStatuses](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/TeamCommentFeatures.js~TeamCommentFeatures.html#instance-member-disableReplyingToCommentsInStatuses).
|
|
22
|
+
- Added `canAddCommentReplies` to proof model, to tell if replies are disabled on comments (by reviewers). See [Proofs.canAddCommentReplies](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/Proof.js~Proof.html#instance-member-canAddCommentReplies).
|
|
23
|
+
|
|
3
24
|
## 2.0.0-beta.151
|
|
4
25
|
|
|
5
26
|
Released on the 11th of December 2020.
|
|
@@ -25,7 +25,7 @@ declare class ProofsIntegrationReferences extends API {
|
|
|
25
25
|
*
|
|
26
26
|
* @since 2.0.0-beta.144
|
|
27
27
|
* @param {string} proofId The proof id
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {ProofIntegrationReference} integrationReference The integration reference option to add to a proof
|
|
29
29
|
* @returns {Promise}
|
|
30
30
|
*/
|
|
31
31
|
add(proofId: string, integrationReference: any): Promise<any>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export default TeamDashboard;
|
|
2
2
|
declare class TeamDashboard extends API {
|
|
3
|
+
/** @private */
|
|
3
4
|
constructor(client: any);
|
|
5
|
+
/**
|
|
6
|
+
* The Team Dashboard Groups API.
|
|
7
|
+
*
|
|
8
|
+
* @type {TeamDashboardGroups}
|
|
9
|
+
*/
|
|
10
|
+
groups: TeamDashboardGroups;
|
|
4
11
|
/**
|
|
5
12
|
* Loads all the proofs in the team's inbox.
|
|
6
13
|
*
|
|
@@ -74,3 +81,4 @@ declare class TeamDashboard extends API {
|
|
|
74
81
|
_loadTeamSearchProofs(params: any): any;
|
|
75
82
|
}
|
|
76
83
|
import API from "../API";
|
|
84
|
+
import TeamDashboardGroups from "./TeamDashboardGroups";
|
|
@@ -14,6 +14,10 @@ var _ProofStatus = require('../../enum/ProofStatus');
|
|
|
14
14
|
|
|
15
15
|
var _ProofStatus2 = _interopRequireDefault(_ProofStatus);
|
|
16
16
|
|
|
17
|
+
var _TeamDashboardGroups = require('./TeamDashboardGroups');
|
|
18
|
+
|
|
19
|
+
var _TeamDashboardGroups2 = _interopRequireDefault(_TeamDashboardGroups);
|
|
20
|
+
|
|
17
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
22
|
|
|
19
23
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -49,10 +53,15 @@ function transformProofs(proofs) {
|
|
|
49
53
|
var TeamDashboard = function (_API) {
|
|
50
54
|
_inherits(TeamDashboard, _API);
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
/** @private */
|
|
57
|
+
function TeamDashboard(client) {
|
|
53
58
|
_classCallCheck(this, TeamDashboard);
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
// Nested APIs
|
|
61
|
+
var _this = _possibleConstructorReturn(this, _API.call(this, client));
|
|
62
|
+
|
|
63
|
+
_this.groups = new _TeamDashboardGroups2.default(client);
|
|
64
|
+
return _this;
|
|
56
65
|
}
|
|
57
66
|
|
|
58
67
|
/**
|
|
@@ -62,6 +71,14 @@ var TeamDashboard = function (_API) {
|
|
|
62
71
|
* @param {number} page The page number
|
|
63
72
|
* @returns {Promise<TeamDashboardPagination>}
|
|
64
73
|
*/
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The Team Dashboard Groups API.
|
|
77
|
+
*
|
|
78
|
+
* @type {TeamDashboardGroups}
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
|
|
65
82
|
TeamDashboard.prototype.inbox = function inbox(page) {
|
|
66
83
|
return this._loadSingleTeamTabProofs('inbox', { page: page });
|
|
67
84
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default TeamDashboardGroups;
|
|
2
|
+
declare class TeamDashboardGroups extends API {
|
|
3
|
+
constructor(client: any);
|
|
4
|
+
/**
|
|
5
|
+
* Loads all the team's proof groups in a certain category (current/archived).
|
|
6
|
+
*
|
|
7
|
+
* @param {string} category The proof groups category name
|
|
8
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
9
|
+
*/
|
|
10
|
+
_loadGroups(category: string): Promise<any[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Loads a team group by id for team admin.
|
|
13
|
+
*
|
|
14
|
+
* @example <caption>Loads a team group for team admin</caption>
|
|
15
|
+
* const admin = await client.admin();
|
|
16
|
+
* const teamGroup = await admin.team.dashboard.groups.load('GVNM8NTI1VSTCRN5');
|
|
17
|
+
* console.log(teamGroup); // {ProofGroup}
|
|
18
|
+
*
|
|
19
|
+
* @since v2.0.0-beta.153
|
|
20
|
+
* @param {string} groupId The group id
|
|
21
|
+
* @returns {Promise<ProofGroup>}
|
|
22
|
+
*/
|
|
23
|
+
load(groupId: string): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Loads all the team's active proof groups.
|
|
26
|
+
*
|
|
27
|
+
* @example <caption>Loads all the team's active proof groups.</caption>
|
|
28
|
+
* const admin = await client.admin();
|
|
29
|
+
* const currentGroupsForTeam = await admin.team.dashboard.groups.current();
|
|
30
|
+
* console.log(currentGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
31
|
+
*
|
|
32
|
+
* @since v2.0.0-beta.153
|
|
33
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
34
|
+
*/
|
|
35
|
+
current(): Promise<any[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Loads all the team's archived proof groups.
|
|
38
|
+
*
|
|
39
|
+
* @example <caption>Loads all the team's archived proof groups.</caption>
|
|
40
|
+
* const admin = await client.admin();
|
|
41
|
+
* const archivedGroupsForTeam = await admin.team.dashboard.groups.archived();
|
|
42
|
+
* console.log(archivedGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
43
|
+
*
|
|
44
|
+
* @since v2.0.0-beta.153
|
|
45
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
46
|
+
*/
|
|
47
|
+
archived(): Promise<any[]>;
|
|
48
|
+
}
|
|
49
|
+
import API from "../API";
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _API2 = require('../API');
|
|
6
|
+
|
|
7
|
+
var _API3 = _interopRequireDefault(_API2);
|
|
8
|
+
|
|
9
|
+
var _ProofGroup = require('../../models/ProofGroup');
|
|
10
|
+
|
|
11
|
+
var _ProofGroup2 = _interopRequireDefault(_ProofGroup);
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
15
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
+
|
|
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
|
+
|
|
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; }
|
|
20
|
+
|
|
21
|
+
function transformGroups(groups) {
|
|
22
|
+
return (groups || []).map(function (groupData) {
|
|
23
|
+
return new _ProofGroup2.default().fromProofGroup(groupData);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function mapResponseToGroup(response) {
|
|
28
|
+
return new _ProofGroup2.default().fromProofGroup(response.data);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var TeamDashboardGroups = function (_API) {
|
|
32
|
+
_inherits(TeamDashboardGroups, _API);
|
|
33
|
+
|
|
34
|
+
function TeamDashboardGroups() {
|
|
35
|
+
_classCallCheck(this, TeamDashboardGroups);
|
|
36
|
+
|
|
37
|
+
return _possibleConstructorReturn(this, _API.apply(this, arguments));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Loads all the team's proof groups in a certain category (current/archived).
|
|
42
|
+
*
|
|
43
|
+
* @param {string} category The proof groups category name
|
|
44
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
45
|
+
*/
|
|
46
|
+
TeamDashboardGroups.prototype._loadGroups = function _loadGroups(category) {
|
|
47
|
+
return this.client.request('admin.team.dashboard.groups.category', {
|
|
48
|
+
category: category
|
|
49
|
+
}).then(function (response) {
|
|
50
|
+
return transformGroups(response.data);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Loads a team group by id for team admin.
|
|
56
|
+
*
|
|
57
|
+
* @example <caption>Loads a team group for team admin</caption>
|
|
58
|
+
* const admin = await client.admin();
|
|
59
|
+
* const teamGroup = await admin.team.dashboard.groups.load('GVNM8NTI1VSTCRN5');
|
|
60
|
+
* console.log(teamGroup); // {ProofGroup}
|
|
61
|
+
*
|
|
62
|
+
* @since v2.0.0-beta.153
|
|
63
|
+
* @param {string} groupId The group id
|
|
64
|
+
* @returns {Promise<ProofGroup>}
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
TeamDashboardGroups.prototype.load = function load(groupId) {
|
|
69
|
+
return this.client.request('admin.team.proofs.groups.load', {
|
|
70
|
+
groupId: groupId
|
|
71
|
+
}).then(mapResponseToGroup);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Loads all the team's active proof groups.
|
|
76
|
+
*
|
|
77
|
+
* @example <caption>Loads all the team's active proof groups.</caption>
|
|
78
|
+
* const admin = await client.admin();
|
|
79
|
+
* const currentGroupsForTeam = await admin.team.dashboard.groups.current();
|
|
80
|
+
* console.log(currentGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
81
|
+
*
|
|
82
|
+
* @since v2.0.0-beta.153
|
|
83
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
TeamDashboardGroups.prototype.current = function current() {
|
|
88
|
+
return this._loadGroups('current');
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Loads all the team's archived proof groups.
|
|
93
|
+
*
|
|
94
|
+
* @example <caption>Loads all the team's archived proof groups.</caption>
|
|
95
|
+
* const admin = await client.admin();
|
|
96
|
+
* const archivedGroupsForTeam = await admin.team.dashboard.groups.archived();
|
|
97
|
+
* console.log(archivedGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
98
|
+
*
|
|
99
|
+
* @since v2.0.0-beta.153
|
|
100
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
TeamDashboardGroups.prototype.archived = function archived() {
|
|
105
|
+
return this._loadGroups('archived');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return TeamDashboardGroups;
|
|
109
|
+
}(_API3.default);
|
|
110
|
+
|
|
111
|
+
exports.default = TeamDashboardGroups;
|
|
112
|
+
//# sourceMappingURL=TeamDashboardGroups.js.map
|
|
@@ -26,6 +26,7 @@ declare class TeamFeatures extends API {
|
|
|
26
26
|
* @param {boolean} options.emails.displayTeamName Whether using the team name or ’PageProof Team’ as the ‘from’ name in Email.
|
|
27
27
|
* @param {object} options.comments The comments features
|
|
28
28
|
* @param {boolean} options.comments.editComments Whether the comments/replies can be edited by other users or not
|
|
29
|
+
* @param {ProofStatus|Array<ProofStatus>} options.comments.disableReplyingToCommentsInStatuses The proof status or array of proof status to disable the replies to comments (by reviewers).
|
|
29
30
|
* @param {object} options.proofs The proofs features
|
|
30
31
|
* @param {boolean} options.proofs.reference Whether showing the reference field on a proof
|
|
31
32
|
* @returns {Promise}
|
|
@@ -37,6 +38,7 @@ declare class TeamFeatures extends API {
|
|
|
37
38
|
};
|
|
38
39
|
comments: {
|
|
39
40
|
editComments: boolean;
|
|
41
|
+
disableReplyingToCommentsInStatuses: any;
|
|
40
42
|
};
|
|
41
43
|
proofs: {
|
|
42
44
|
reference: boolean;
|
|
@@ -64,6 +64,7 @@ var TeamFeatures = function (_API) {
|
|
|
64
64
|
* @param {boolean} options.emails.displayTeamName Whether using the team name or ’PageProof Team’ as the ‘from’ name in Email.
|
|
65
65
|
* @param {object} options.comments The comments features
|
|
66
66
|
* @param {boolean} options.comments.editComments Whether the comments/replies can be edited by other users or not
|
|
67
|
+
* @param {ProofStatus|Array<ProofStatus>} options.comments.disableReplyingToCommentsInStatuses The proof status or array of proof status to disable the replies to comments (by reviewers).
|
|
67
68
|
* @param {object} options.proofs The proofs features
|
|
68
69
|
* @param {boolean} options.proofs.reference Whether showing the reference field on a proof
|
|
69
70
|
* @returns {Promise}
|
|
@@ -78,12 +79,14 @@ var TeamFeatures = function (_API) {
|
|
|
78
79
|
var displayComments = emails && emails.displayComments;
|
|
79
80
|
var displayTeamName = emails && emails.displayTeamName;
|
|
80
81
|
var editComments = comments && comments.editComments;
|
|
82
|
+
var disableReplyingToCommentsInStatuses = comments && comments.disableReplyingToCommentsInStatuses && [].concat(comments.disableReplyingToCommentsInStatuses);
|
|
81
83
|
var proofReference = proofs && proofs.reference;
|
|
82
84
|
return this.client.request('admin.team.features.update', {
|
|
83
85
|
displayComments: displayComments,
|
|
84
86
|
displayTeamName: displayTeamName,
|
|
85
87
|
editComments: editComments,
|
|
86
|
-
proofReference: proofReference
|
|
88
|
+
proofReference: proofReference,
|
|
89
|
+
disableReplyingToCommentsInStatuses: disableReplyingToCommentsInStatuses
|
|
87
90
|
});
|
|
88
91
|
};
|
|
89
92
|
|
package/lib/models/Proof.d.ts
CHANGED
|
@@ -272,7 +272,7 @@ declare class Proof {
|
|
|
272
272
|
*/
|
|
273
273
|
integrationReferences: Array<ProofIntegrationReference>;
|
|
274
274
|
/**
|
|
275
|
-
* Whether the reference has been
|
|
275
|
+
* Whether the reference has been enabled/disabled (which can be used to integrate with other applications)
|
|
276
276
|
*
|
|
277
277
|
* @since v2.0.0-beta.100
|
|
278
278
|
* @type {boolean}
|
|
@@ -303,6 +303,13 @@ declare class Proof {
|
|
|
303
303
|
* @type {boolean}
|
|
304
304
|
*/
|
|
305
305
|
canOthersEditComments: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Whether reviewers can add replies to comments.
|
|
308
|
+
*
|
|
309
|
+
* @since v2.0.0-beta.152
|
|
310
|
+
* @type {boolean}
|
|
311
|
+
*/
|
|
312
|
+
canAddCommentReplies: boolean;
|
|
306
313
|
/**
|
|
307
314
|
* The source of the proof if coming from an external system.
|
|
308
315
|
*
|
|
@@ -324,6 +331,21 @@ declare class Proof {
|
|
|
324
331
|
* @type {Array<string>}
|
|
325
332
|
*/
|
|
326
333
|
tags: Array<string>;
|
|
334
|
+
/**
|
|
335
|
+
* The proof owner's team.
|
|
336
|
+
*
|
|
337
|
+
* @since v2.0.0-beta.153
|
|
338
|
+
* @type {string}
|
|
339
|
+
*/
|
|
340
|
+
teamId: string;
|
|
341
|
+
/**
|
|
342
|
+
* Whether a user is a team admin of this proof.
|
|
343
|
+
*
|
|
344
|
+
* @since v2.0.0-beta.153
|
|
345
|
+
* @param {User} This {@link User} object may be subset of only these 2 properties (teamId and isAdmin)
|
|
346
|
+
* @returns {boolean}
|
|
347
|
+
*/
|
|
348
|
+
isUserAdminOfProofTeam(user: any): boolean;
|
|
327
349
|
/**
|
|
328
350
|
* @private
|
|
329
351
|
* @returns {string}
|
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);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",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",hasDecisionsEnabled:"FeatureDecisions",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})};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.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;
|
|
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",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",hasDecisionsEnabled:"FeatureDecisions",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"};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,6 +66,14 @@ declare class ProofGroup {
|
|
|
66
66
|
* @type {string}
|
|
67
67
|
*/
|
|
68
68
|
createdBy: string;
|
|
69
|
+
/**
|
|
70
|
+
* Whether a user is a team admin of this proof group.
|
|
71
|
+
*
|
|
72
|
+
* @since v2.0.0-beta.153
|
|
73
|
+
* @param {User} This {@link User} object may be subset of only these 2 properties (teamId and isAdmin)
|
|
74
|
+
* @returns {boolean}
|
|
75
|
+
*/
|
|
76
|
+
isUserAdminOfGroupTeam(user: any): boolean;
|
|
69
77
|
/**
|
|
70
78
|
* @private
|
|
71
79
|
*/
|
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",proofs:(0,_transform.each)("ProofInfo",function(proofData){return(new _Proof2.default).fromProof(proofData)})};var ProofGroup=function(){function ProofGroup(){_classCallCheck(this,ProofGroup)}ProofGroup.prototype.fromProofGroup=function fromProofGroup(proofGroupData){(0,_transform2.default)(this,proofGroupSchema,proofGroupData);return this};return ProofGroup}();exports.default=ProofGroup;
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _Proof=require("./Proof");var _Proof2=_interopRequireDefault(_Proof);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var proofGroupSchema={canAddProofs:"CanAddProofs",id:"GroupId",name:"Name",isEmpty:"IsEmpty",isArchived:"Archived",teamId:"TeamId",createdBy:"CreatedBy",isOwnedByTeam:"OwnedByTeam",proofs:(0,_transform.each)("ProofInfo",function(proofData){return(new _Proof2.default).fromProof(proofData)})};var ProofGroup=function(){function ProofGroup(){_classCallCheck(this,ProofGroup)}ProofGroup.prototype.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;
|
|
@@ -24,6 +24,12 @@ declare class ProofIntegrationReference {
|
|
|
24
24
|
* @type {string}
|
|
25
25
|
*/
|
|
26
26
|
referenceLabel: string;
|
|
27
|
+
/**
|
|
28
|
+
* Arbitrary metadata required internally by PageProof.
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
*/
|
|
32
|
+
metadata: string;
|
|
27
33
|
/**
|
|
28
34
|
* @private
|
|
29
35
|
* @param {object} data The ProofIntegrationReference data
|
|
@@ -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 proofIntegrationReferenceSchema={referenceId:"ReferenceId",referenceUrl:"ReferenceUrl",referenceType:"ReferenceType",referenceLabel:"ReferenceLabel"};var ProofIntegrationReference=function(){function ProofIntegrationReference(){_classCallCheck(this,ProofIntegrationReference)}ProofIntegrationReference.prototype.fromProofIntegrationReference=function fromProofIntegrationReference(data){(0,_transform2.default)(this,proofIntegrationReferenceSchema,data);return this};return ProofIntegrationReference}();exports.default=ProofIntegrationReference;
|
|
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 proofIntegrationReferenceSchema={referenceId:"ReferenceId",referenceUrl:"ReferenceUrl",referenceType:"ReferenceType",referenceLabel:"ReferenceLabel",metadata:"Metadata"};var ProofIntegrationReference=function(){function ProofIntegrationReference(){_classCallCheck(this,ProofIntegrationReference)}ProofIntegrationReference.prototype.fromProofIntegrationReference=function fromProofIntegrationReference(data){(0,_transform2.default)(this,proofIntegrationReferenceSchema,data);return this};return ProofIntegrationReference}();exports.default=ProofIntegrationReference;
|
|
@@ -7,6 +7,13 @@ declare class TeamCommentFeatures {
|
|
|
7
7
|
* @type {boolean}
|
|
8
8
|
*/
|
|
9
9
|
editComments: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Array of proof statuses where replies have been disabled to comments (by reviewers).
|
|
12
|
+
*
|
|
13
|
+
* @since v2.0.0-beta.152
|
|
14
|
+
* @type {Array<ProofStatus>}
|
|
15
|
+
*/
|
|
16
|
+
disableReplyingToCommentsInStatuses: Array<ProofStatus>;
|
|
10
17
|
/** @private */
|
|
11
18
|
fromTeamCommentFeatures(teamCommentFeaturesData: any): TeamCommentFeatures;
|
|
12
19
|
}
|
|
@@ -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 TeamCommentFeatureSchema={editComments:"EditComments"};var TeamCommentFeatures=function(){function TeamCommentFeatures(){_classCallCheck(this,TeamCommentFeatures)}TeamCommentFeatures.prototype.fromTeamCommentFeatures=function fromTeamCommentFeatures(teamCommentFeaturesData){(0,_transform2.default)(this,TeamCommentFeatureSchema,teamCommentFeaturesData);return this};return TeamCommentFeatures}();exports.default=TeamCommentFeatures;
|
|
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 TeamCommentFeatureSchema={editComments:"EditComments",disableReplyingToCommentsInStatuses:"DisableReplyingToCommentsInStatuses"};var TeamCommentFeatures=function(){function TeamCommentFeatures(){_classCallCheck(this,TeamCommentFeatures)}TeamCommentFeatures.prototype.fromTeamCommentFeatures=function fromTeamCommentFeatures(teamCommentFeaturesData){(0,_transform2.default)(this,TeamCommentFeatureSchema,teamCommentFeaturesData);return this};return TeamCommentFeatures}();exports.default=TeamCommentFeatures;
|
|
@@ -151,6 +151,16 @@
|
|
|
151
151
|
"path": "/api/admin/search",
|
|
152
152
|
"body": ["query", "all", "filterBy", "page"]
|
|
153
153
|
},
|
|
154
|
+
"admin.team.dashboard.groups.category": {
|
|
155
|
+
"method": "GET",
|
|
156
|
+
"path": "/api/admin/dashboard/groups",
|
|
157
|
+
"chain": ["category"]
|
|
158
|
+
},
|
|
159
|
+
"admin.team.proofs.groups.load": {
|
|
160
|
+
"method": "GET",
|
|
161
|
+
"path": "/api/admin/group",
|
|
162
|
+
"chain": ["groupId"]
|
|
163
|
+
},
|
|
154
164
|
"admin.team.custom-webhooks.create": {
|
|
155
165
|
"method": "POST",
|
|
156
166
|
"path": "/api/admin/teams/custom-webhooks/create",
|
|
@@ -729,9 +739,10 @@
|
|
|
729
739
|
"trailing": true
|
|
730
740
|
},
|
|
731
741
|
"admin.team.features.update": {
|
|
742
|
+
"version": 2,
|
|
732
743
|
"method": "POST",
|
|
733
744
|
"path": "/api/admin/settings",
|
|
734
|
-
"body": ["displayComments", "editComments", "proofReference", "displayTeamName"]
|
|
745
|
+
"body": ["displayComments", "editComments", "proofReference", "displayTeamName", "disableReplyingToCommentsInStatuses"]
|
|
735
746
|
},
|
|
736
747
|
"integrations.get-setup-url": {
|
|
737
748
|
"method": "GET",
|