@pageproof/sdk-pr 663.0.1769464022834 → 663.0.1773092450820
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 +26 -1
- package/lib/api/Dashboard.d.ts +170 -17
- package/lib/api/Dashboard.js +1 -1
- package/lib/api/Proofs.d.ts +7 -2
- package/lib/api/Proofs.js +1 -1
- package/lib/api/admin/TeamDashboard.d.ts +119 -8
- package/lib/api/admin/TeamDashboard.js +192 -13
- package/lib/api/admin/TeamFeatures.d.ts +2 -0
- package/lib/api/admin/TeamFeatures.js +6 -0
- package/lib/enum/StatusMessage.d.ts +24 -0
- package/lib/enum/StatusMessage.js +1 -0
- package/lib/enum/index.d.ts +2 -1
- package/lib/enum/index.js +1 -1
- package/lib/models/Proof.d.ts +18 -0
- package/lib/models/Proof.js +1 -1
- package/lib/models/TeamIntelligenceFeatures.d.ts +12 -0
- package/lib/models/TeamIntelligenceFeatures.js +1 -1
- package/lib/network/endpoints.json +1 -1
- package/lib/pageproof.js +1 -1
- package/lib/util/dashboardSearchShared.d.ts +156 -0
- package/lib/util/dashboardSearchShared.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## 2.14.0
|
|
2
|
+
|
|
3
|
+
Released on the 6th of March 2026.
|
|
4
|
+
|
|
5
|
+
- [[PP-9566](https://pageproof.atlassian.net/browse/PP-9566)] Added support for displaying the PageProof Intelligence® insights button on the proofing screen.
|
|
6
|
+
|
|
7
|
+
## 2.13.2
|
|
8
|
+
|
|
9
|
+
Released on the 2nd of March 2026.
|
|
10
|
+
|
|
11
|
+
- [[PP-9814](https://pageproof.atlassian.net/browse/PP-9814)] Bug fixes for dashboard search backward compatibility.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 2.13.1
|
|
15
|
+
|
|
16
|
+
Released on the 11th of February 2026.
|
|
17
|
+
|
|
18
|
+
- [[PP-9673](https://pageproof.atlassian.net/browse/PP-9673)] Bug fixes for dashboard search now validating proof fields used in search filters and sorting.
|
|
19
|
+
|
|
20
|
+
## 2.13.0
|
|
21
|
+
|
|
22
|
+
Released on the 9th of February 2026.
|
|
23
|
+
|
|
24
|
+
- [[PP-9325](https://pageproof.atlassian.net/browse/PP-9325)] Added support for dashboard search replacement, enabling enhanced search capabilities across the platform.
|
|
25
|
+
|
|
1
26
|
## 2.12.0
|
|
2
27
|
|
|
3
28
|
Released on the 22nd of January 2026.
|
|
@@ -104,7 +129,7 @@ Released on the 1st of April 2025.
|
|
|
104
129
|
|
|
105
130
|
Released on the 16th of December 2024.
|
|
106
131
|
|
|
107
|
-
- [[PP-7712](https://pageproof.atlassian.net/browse/PP-7712)] Added support for description on a proof group (collection).
|
|
132
|
+
- [[PP-7712](https://pageproof.atlassian.net/browse/PP-7712)] Added support for description on a proof group (collection).
|
|
108
133
|
|
|
109
134
|
## 2.2.0
|
|
110
135
|
|
package/lib/api/Dashboard.d.ts
CHANGED
|
@@ -11,61 +11,214 @@ declare class Dashboard extends API {
|
|
|
11
11
|
/**
|
|
12
12
|
* Loads all the proofs in the current authenticated inbox.
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
14
|
+
* @param {number} [page] The page number (only used with useAzureSearch)
|
|
15
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
16
|
+
* @param {number} [options.pageSize] Optional page size (defaults to DASHBOARD_PROOFS_PER_PAGE)
|
|
17
|
+
* @param {object} [options.sort] Optional sort options object
|
|
18
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
19
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
20
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
21
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
15
22
|
*/
|
|
16
|
-
inbox(): Promise<
|
|
23
|
+
inbox(page?: number, options?: number | object): Promise<{
|
|
24
|
+
proofs: Array<Proof>;
|
|
25
|
+
totalCount: number;
|
|
26
|
+
} | Array<Proof>>;
|
|
17
27
|
/**
|
|
18
28
|
* Loads all the proofs in the current authenticated sent box.
|
|
19
29
|
*
|
|
20
|
-
* @
|
|
30
|
+
* @param {number} [page] The page number (only used with useAzureSearch)
|
|
31
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
32
|
+
* @param {number} [options.pageSize] Optional page size (defaults to DASHBOARD_PROOFS_PER_PAGE)
|
|
33
|
+
* @param {object} [options.sort] Optional sort options object
|
|
34
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
35
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
36
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
37
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
21
38
|
*/
|
|
22
|
-
sent(): Promise<
|
|
39
|
+
sent(page?: number, options?: number | object): Promise<{
|
|
40
|
+
proofs: Array<Proof>;
|
|
41
|
+
totalCount: number;
|
|
42
|
+
} | Array<Proof>>;
|
|
23
43
|
/**
|
|
24
44
|
* Loads all the proofs in the current authenticated outbox.
|
|
25
45
|
*
|
|
26
|
-
* @
|
|
46
|
+
* @param {number} [page] The page number (only used with useAzureSearch)
|
|
47
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
48
|
+
* @param {number} [options.pageSize] Optional page size (defaults to DASHBOARD_PROOFS_PER_PAGE)
|
|
49
|
+
* @param {object} [options.sort] Optional sort options object
|
|
50
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
51
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
52
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
53
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
27
54
|
*/
|
|
28
|
-
outbox(): Promise<
|
|
55
|
+
outbox(page?: number, options?: number | object): Promise<{
|
|
56
|
+
proofs: Array<Proof>;
|
|
57
|
+
totalCount: number;
|
|
58
|
+
} | Array<Proof>>;
|
|
29
59
|
/**
|
|
30
60
|
* Loads all the briefs in the current authenticated brief box.
|
|
31
61
|
*
|
|
32
62
|
* @since 2.0.0-beta.54
|
|
63
|
+
* @param {number} [page] The page number (only used with useAzureSearch)
|
|
64
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
65
|
+
* @param {number} [options.pageSize] Optional page size (defaults to DASHBOARD_PROOFS_PER_PAGE)
|
|
66
|
+
* @param {object} [options.sort] Optional sort options object
|
|
67
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
68
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
69
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
70
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
71
|
+
*/
|
|
72
|
+
briefs(page?: number, options?: number | object): Promise<{
|
|
73
|
+
proofs: Array<Proof>;
|
|
74
|
+
totalCount: number;
|
|
75
|
+
} | Array<Proof>>;
|
|
76
|
+
/** @private */
|
|
77
|
+
/** this is the legacy function for get tab proofs data from API.
|
|
78
|
+
* @param {string} name - The name of the tab to load.
|
|
33
79
|
* @returns {Promise<Array<Proof>>}
|
|
34
80
|
*/
|
|
35
|
-
|
|
81
|
+
_loadSingleTabProofs(name: string): Promise<Array<Proof>>;
|
|
36
82
|
/** @private */
|
|
37
|
-
|
|
83
|
+
/** this is the new function for get tab proofs data from Spider instead
|
|
84
|
+
* of API.
|
|
85
|
+
* @param {string} name - The name of the tab to load.
|
|
86
|
+
* @param {object} [params] - The parameters for the request.
|
|
87
|
+
* @param {number} [params.page=1] - The page number to load.
|
|
88
|
+
* @param {number} [params.pageSize=DASHBOARD_PROOFS_PER_PAGE] - The page size to load.
|
|
89
|
+
* @param {object} [params.sort] - Sort options object.
|
|
90
|
+
* @param {boolean} [params.excludeArchived] - Whether to exclude archived proofs.
|
|
91
|
+
* @param {object} [params.dateFilters] - Date filters object.
|
|
92
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}>}
|
|
93
|
+
*/
|
|
94
|
+
_loadSingleTabProofsFromSpider(name: string, params?: {
|
|
95
|
+
page: number;
|
|
96
|
+
pageSize: number;
|
|
97
|
+
sort: object;
|
|
98
|
+
excludeArchived: boolean;
|
|
99
|
+
dateFilters: object;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
proofs: Array<Proof>;
|
|
102
|
+
totalCount: number;
|
|
103
|
+
}>;
|
|
104
|
+
/** @private */
|
|
105
|
+
/** Search function for dashboard proofs using Spider GraphQL
|
|
106
|
+
* @param {object} [params] - The parameters for the search.
|
|
107
|
+
* @param {string} [params.query] - The search query text.
|
|
108
|
+
* @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
|
|
109
|
+
* @param {Array<number>} [params.filters.status] - Array of status numbers to filter by.
|
|
110
|
+
* @param {object} [params.filters.dateFilters] - Date filters object.
|
|
111
|
+
* @param {boolean} [params.filters.excludeArchived] - Whether to exclude archived proofs.
|
|
112
|
+
* @param {object} [params.sort] - Sort options object.
|
|
113
|
+
* @param {number} [params.page=1] - The page number to load.
|
|
114
|
+
* @param {number} [params.pageSize=DASHBOARD_PROOFS_PER_PAGE] - The page size to load.
|
|
115
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}>}
|
|
116
|
+
*/
|
|
117
|
+
_searchProofsFromSpider(params?: {
|
|
118
|
+
query: string;
|
|
119
|
+
filters: {
|
|
120
|
+
status: Array<number>;
|
|
121
|
+
dateFilters: object;
|
|
122
|
+
excludeArchived: boolean;
|
|
123
|
+
};
|
|
124
|
+
sort: object;
|
|
125
|
+
page: number;
|
|
126
|
+
pageSize: number;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
proofs: Array<Proof>;
|
|
129
|
+
totalCount: number;
|
|
130
|
+
}>;
|
|
131
|
+
/**
|
|
132
|
+
* Fetches only the total count for a specific tab without loading proof data.
|
|
133
|
+
* This is useful for displaying tab counts/badges before user clicks on them.
|
|
134
|
+
*
|
|
135
|
+
* @param {string} tabName - The name of the tab (e.g., 'inbox', 'sent', 'outbox', 'briefs', 'approved', 'archived', 'everything')
|
|
136
|
+
* @param {object} [options] - Optional options object
|
|
137
|
+
* @param {boolean} [options.excludeArchived] - Whether to exclude archived proofs from the count
|
|
138
|
+
* @returns {Promise<number>} The total count of proofs in the tab
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* // Get count for inbox tab
|
|
142
|
+
* const inboxCount = await sdk.dashboard.getTabCount('inbox');
|
|
143
|
+
* console.log(`Inbox has ${inboxCount} proofs`);
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* // Get count for inbox tab excluding archived proofs
|
|
147
|
+
* const inboxCount = await sdk.dashboard.getTabCount('inbox', { excludeArchived: true });
|
|
148
|
+
*/
|
|
149
|
+
getTabCount(tabName: string, options?: {
|
|
150
|
+
excludeArchived: boolean;
|
|
151
|
+
}): Promise<number>;
|
|
38
152
|
/**
|
|
39
153
|
* Searches the current authenticated user's dashboard using a search query.
|
|
40
154
|
*
|
|
41
155
|
* @param {string} query The search query
|
|
42
156
|
* @param {object} [options] Advanced options
|
|
43
157
|
* @param {ProofStatus|Array<ProofStatus>} [options.status] The proof status (or statuses)
|
|
44
|
-
* @param {boolean} [options.everything] Whether to load every proof the user has access to
|
|
45
|
-
* @
|
|
158
|
+
* @param {boolean} [options.everything] Whether to load every proof the user has access to (legacy only)
|
|
159
|
+
* @param {number} [options.page=1] The page number (only used with useAzureSearch)
|
|
160
|
+
* @param {number} [options.pageSize] Optional page size (only used with useAzureSearch)
|
|
161
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
162
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
46
163
|
*/
|
|
47
164
|
search(query: string, options?: {
|
|
48
165
|
status: any | Array<any>;
|
|
49
166
|
everything: boolean;
|
|
50
|
-
|
|
167
|
+
page: number;
|
|
168
|
+
pageSize: number;
|
|
169
|
+
useAzureSearch: boolean;
|
|
170
|
+
}): Promise<{
|
|
171
|
+
proofs: Array<Proof>;
|
|
172
|
+
totalCount: number;
|
|
173
|
+
} | Array<Proof>>;
|
|
51
174
|
/**
|
|
52
175
|
* Loads all of the proofs the current authenticated user has access to.
|
|
53
176
|
*
|
|
54
|
-
* @
|
|
177
|
+
* @param {number} [page] The page number (only used with useAzureSearch)
|
|
178
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
179
|
+
* @param {number} [options.pageSize] Optional page size (defaults to DASHBOARD_PROOFS_PER_PAGE)
|
|
180
|
+
* @param {object} [options.sort] Optional sort options object
|
|
181
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
182
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
183
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
184
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
55
185
|
*/
|
|
56
|
-
everything(): Promise<
|
|
186
|
+
everything(page?: number, options?: number | object): Promise<{
|
|
187
|
+
proofs: Array<Proof>;
|
|
188
|
+
totalCount: number;
|
|
189
|
+
} | Array<Proof>>;
|
|
57
190
|
/**
|
|
58
191
|
* Loads all the approved proofs the current authenticated user has access to.
|
|
59
192
|
*
|
|
60
|
-
* @
|
|
193
|
+
* @param {number} [page] The page number (only used with useAzureSearch)
|
|
194
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
195
|
+
* @param {number} [options.pageSize] Optional page size (defaults to DASHBOARD_PROOFS_PER_PAGE)
|
|
196
|
+
* @param {object} [options.sort] Optional sort options object
|
|
197
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
198
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
199
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
200
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
61
201
|
*/
|
|
62
|
-
approved(): Promise<
|
|
202
|
+
approved(page?: number, options?: number | object): Promise<{
|
|
203
|
+
proofs: Array<Proof>;
|
|
204
|
+
totalCount: number;
|
|
205
|
+
} | Array<Proof>>;
|
|
63
206
|
/**
|
|
64
207
|
* Loads all the archived proofs the current authenticated user has access to.
|
|
65
208
|
*
|
|
66
|
-
* @
|
|
209
|
+
* @param {number} [page] The page number (only used with useAzureSearch)
|
|
210
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
211
|
+
* @param {number} [options.pageSize] Optional page size (defaults to DASHBOARD_PROOFS_PER_PAGE)
|
|
212
|
+
* @param {object} [options.sort] Optional sort options object
|
|
213
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
214
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
215
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
216
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
67
217
|
*/
|
|
68
|
-
archived(): Promise<
|
|
218
|
+
archived(page?: number, options?: number | object): Promise<{
|
|
219
|
+
proofs: Array<Proof>;
|
|
220
|
+
totalCount: number;
|
|
221
|
+
} | Array<Proof>>;
|
|
69
222
|
/** @private */
|
|
70
223
|
private _loadSearchProofs;
|
|
71
224
|
}
|
package/lib/api/Dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _ProofStatus=require("../enum/ProofStatus");var _ProofStatus2=_interopRequireDefault(_ProofStatus);var _DashboardGroups=require("./DashboardGroups");var _DashboardGroups2=_interopRequireDefault(_DashboardGroups);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 TABS={inbox:"ProofIn",sent:"ProofOut",outbox:"ProofOutBox",briefs:"AllBriefs"};function transformTabs(data){var tabs={};Object.keys(TABS).forEach(function(name){tabs[name]=data[TABS[name]]});return tabs}function transformProofs(proofs){return(proofs||[]).map(function(proofData){return(new _Proof2.default).fromProof(proofData)})}var Dashboard=function(_API){_inherits(Dashboard,_API);function Dashboard(client){_classCallCheck(this,Dashboard);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.groups=new _DashboardGroups2.default(client);return _this}Dashboard.prototype.inbox=function inbox(){return this._loadSingleTabProofs("inbox")};Dashboard.prototype.sent=function sent(){return this._loadSingleTabProofs("sent")};Dashboard.prototype.outbox=function outbox(){return this._loadSingleTabProofs("outbox")};Dashboard.prototype.briefs=function briefs(){return this._loadSingleTabProofs("briefs")};Dashboard.prototype._loadSingleTabProofs=function _loadSingleTabProofs(name){return this.client.request("dashboard."+name).then(function(response){return transformTabs(response.data)}).then(function(dashboard){return dashboard[name]}).then(transformProofs)};Dashboard.prototype.search=function search(query){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var status=options.status,everything=options.everything;return this._loadSearchProofs({query:query,filterBy:typeof status==="undefined"?undefined:[].concat(status).join(","),all:everything?1:0})};Dashboard.prototype.everything=function everything(){return this.search(undefined,{everything:true})};Dashboard.prototype.approved=function approved(){return this.search(undefined,{status:_ProofStatus2.default.APPROVED})};Dashboard.prototype.archived=function archived(){return this.search(undefined,{status:_ProofStatus2.default.ARCHIVED})};Dashboard.prototype._loadSearchProofs=function _loadSearchProofs(params){return this.client.request("dashboard.search",params).then(function(response){return transformProofs(response.data.Proofs)})};return Dashboard}(_API3.default);exports.default=Dashboard;
|
|
1
|
+
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _ProofStatus=require("../enum/ProofStatus");var _ProofStatus2=_interopRequireDefault(_ProofStatus);var _DashboardGroups=require("./DashboardGroups");var _DashboardGroups2=_interopRequireDefault(_DashboardGroups);var _dashboardSearchShared=require("../util/dashboardSearchShared");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i]}return target}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 TABS={inbox:"ProofIn",sent:"ProofOut",outbox:"ProofOutBox",briefs:"AllBriefs",approved:"Approved",archived:"Archived",everything:"Everything"};function transformTabs(data){var tabs={};Object.keys(TABS).forEach(function(name){tabs[name]=data[TABS[name]]});return tabs}function transformProofs(proofs){return(proofs||[]).map(function(proofData){return(new _Proof2.default).fromProof(proofData)})}var Dashboard=function(_API){_inherits(Dashboard,_API);function Dashboard(client){_classCallCheck(this,Dashboard);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.groups=new _DashboardGroups2.default(client);return _this}Dashboard.prototype.inbox=function inbox(page,options){var parsedOptions=(0,_dashboardSearchShared.parseTabOptions)(options);if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,parsedOptions)){return this._loadSingleTabProofsFromSpider("inbox",_extends({page:page},parsedOptions))}return this._loadSingleTabProofs("inbox")};Dashboard.prototype.sent=function sent(page,options){var parsedOptions=(0,_dashboardSearchShared.parseTabOptions)(options);if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,parsedOptions)){return this._loadSingleTabProofsFromSpider("sent",_extends({page:page},parsedOptions))}return this._loadSingleTabProofs("sent")};Dashboard.prototype.outbox=function outbox(page,options){var parsedOptions=(0,_dashboardSearchShared.parseTabOptions)(options);if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,parsedOptions)){return this._loadSingleTabProofsFromSpider("outbox",_extends({page:page},parsedOptions))}return this._loadSingleTabProofs("outbox")};Dashboard.prototype.briefs=function briefs(page,options){var parsedOptions=(0,_dashboardSearchShared.parseTabOptions)(options);if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,parsedOptions)){return this._loadSingleTabProofsFromSpider("briefs",_extends({page:page},parsedOptions))}return this._loadSingleTabProofs("briefs")};Dashboard.prototype._loadSingleTabProofs=function _loadSingleTabProofs(name){return this.client.request("dashboard."+name).then(function(response){return transformTabs(response.data)}).then(function(dashboard){return dashboard[name]}).then(transformProofs)};Dashboard.prototype._loadSingleTabProofsFromSpider=function _loadSingleTabProofsFromSpider(name){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _params$pageSize=params.pageSize,pageSize=_params$pageSize===undefined?_dashboardSearchShared.DASHBOARD_PROOFS_PER_PAGE:_params$pageSize,rest=_objectWithoutProperties(params,["pageSize"]);return(0,_dashboardSearchShared.loadTabProofs)(this.client,"dashboard",name,_extends({pageSize:pageSize},rest),this.client.session.userId,transformProofs)};Dashboard.prototype._searchProofsFromSpider=function _searchProofsFromSpider(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _params$query=params.query,query=_params$query===undefined?"":_params$query,_params$filters=params.filters,filters=_params$filters===undefined?{}:_params$filters,sort=params.sort,_params$page=params.page,page=_params$page===undefined?1:_params$page,_params$pageSize2=params.pageSize,pageSize=_params$pageSize2===undefined?_dashboardSearchShared.DASHBOARD_PROOFS_PER_PAGE:_params$pageSize2;var skip=Math.max(0,(page-1)*pageSize);return(0,_dashboardSearchShared.executeProofSearchQuery)(this.client,"dashboard",query||"*",{top:pageSize,skip:skip,filters:filters,sort:sort},this.client.session.userId,transformProofs)};Dashboard.prototype.getTabCount=function getTabCount(tabName){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var excludeArchived=options.excludeArchived;return this.client.graphql(_dashboardSearchShared.DASHBOARD_TAB_COUNT_QUERY,{searchText:"*",searchOptions:{top:0,skip:0,filters:{tab:tabName,excludeArchived:excludeArchived}}}).then(function(response){var data=response.data.me.dashboardProofSearchV2;return data.totalCount})};Dashboard.prototype.search=function search(query){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,options)){return this._searchProofsFromSpider((0,_dashboardSearchShared.buildSearchParams)(query,options))}var status=options.status,everything=options.everything;return this._loadSearchProofs({query:query,filterBy:typeof status==="undefined"?undefined:[].concat(status).join(","),all:everything?1:0})};Dashboard.prototype.everything=function everything(page,options){var parsedOptions=(0,_dashboardSearchShared.parseTabOptions)(options);if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,parsedOptions)){return this._loadSingleTabProofsFromSpider("everything",_extends({page:page},parsedOptions))}return this.search(undefined,{everything:true,useAzureSearch:false})};Dashboard.prototype.approved=function approved(page,options){var parsedOptions=(0,_dashboardSearchShared.parseTabOptions)(options);if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,parsedOptions)){return this._loadSingleTabProofsFromSpider("approved",_extends({page:page},parsedOptions))}return this.search(undefined,{status:_ProofStatus2.default.APPROVED,useAzureSearch:false})};Dashboard.prototype.archived=function archived(page,options){var parsedOptions=(0,_dashboardSearchShared.parseTabOptions)(options);if((0,_dashboardSearchShared.shouldUseAzureSearch)(this.client,parsedOptions)){return this._loadSingleTabProofsFromSpider("archived",_extends({page:page},parsedOptions))}return this.search(undefined,{status:_ProofStatus2.default.ARCHIVED,useAzureSearch:false})};Dashboard.prototype._loadSearchProofs=function _loadSearchProofs(params){return this.client.request("dashboard.search",params).then(function(response){return transformProofs(response.data.Proofs)})};return Dashboard}(_API3.default);exports.default=Dashboard;
|
package/lib/api/Proofs.d.ts
CHANGED
|
@@ -177,7 +177,7 @@ declare class Proofs extends API {
|
|
|
177
177
|
*
|
|
178
178
|
* @see {@link Proofs.start}
|
|
179
179
|
*
|
|
180
|
-
* @param {{ name: string, tags?: string[], dueDate?: Date | string, messageToReviewers?: string, workflow?: { id: string }, workflowTemplate?: { id: string }, proofTemplate?: { id: string }, checklist?: { templateId?: string, isRequiredForFinalApproval?: boolean, shouldOpenOnProofLoad?: boolean }, file?: { id: string }, group?: { id: string }, previousProof?: { id: string }, team?: { slug: string }, reference?: string, customTools?: any, integrationReferences?: any[], reminders?: Reminder[], owners?: { email?: string, id?: string }[], canDownload?: boolean, start?: boolean, commentVisibility?: string | null }} options The options
|
|
180
|
+
* @param {{ name: string, tags?: string[], dueDate?: Date | string, messageToReviewers?: string, workflow?: { id: string }, workflowTemplate?: { id: string }, proofTemplate?: { id: string }, checklist?: { templateId?: string, isRequiredForFinalApproval?: boolean, shouldOpenOnProofLoad?: boolean }, file?: { id: string }, group?: { id: string }, previousProof?: { id: string }, team?: { slug: string }, reference?: string, customTools?: any, integrationReferences?: any[], reminders?: Reminder[], owners?: { email?: string, id?: string }[], canDownload?: boolean, start?: boolean, commentVisibility?: string | null, isDigitalVerificationEnabled?: boolean, isProofInsightsEnabled?: boolean, isProofInsightsCommentsEnabled?: boolean }} options The options
|
|
181
181
|
*
|
|
182
182
|
* @param options.name The name of the proof
|
|
183
183
|
* @param [options.tags] The tags to add to the proof (defaults to no tags)
|
|
@@ -204,9 +204,11 @@ declare class Proofs extends API {
|
|
|
204
204
|
* @param [options.commentVisibility] Controls the visibility of comments on the proof
|
|
205
205
|
* @param [options.priority] The priority of the proof from 1 to 5. 5 is the highest priority and 1 is the lowest.
|
|
206
206
|
* @param [options.isDigitalVerificationEnabled] Whether the proof has digital verification enabled.
|
|
207
|
+
* @param [options.isProofInsightsEnabled] Whether the proof has proof insights enabled.
|
|
208
|
+
* @param [options.isProofInsightsCommentsEnabled] Whether the proof has proof insights comments enabled.
|
|
207
209
|
* @returns {Promise<Proof>}
|
|
208
210
|
*/
|
|
209
|
-
create({ name, tags, dueDate, messageToReviewers, workflow, workflowTemplate, proofTemplate, checklist, file, group, previousProof, team, reference, customTools, integrationReferences, reminders, owners, canDownload, isPublic, start, commentVisibility, priority, isDigitalVerificationEnabled, scheduledDate, }: {
|
|
211
|
+
create({ name, tags, dueDate, messageToReviewers, workflow, workflowTemplate, proofTemplate, checklist, file, group, previousProof, team, reference, customTools, integrationReferences, reminders, owners, canDownload, isPublic, start, commentVisibility, priority, isDigitalVerificationEnabled, scheduledDate, isProofInsightsEnabled, isProofInsightsCommentsEnabled, }: {
|
|
210
212
|
name: string;
|
|
211
213
|
tags?: string[];
|
|
212
214
|
dueDate?: Date | string;
|
|
@@ -248,6 +250,9 @@ declare class Proofs extends API {
|
|
|
248
250
|
canDownload?: boolean;
|
|
249
251
|
start?: boolean;
|
|
250
252
|
commentVisibility?: string | null;
|
|
253
|
+
isDigitalVerificationEnabled?: boolean;
|
|
254
|
+
isProofInsightsEnabled?: boolean;
|
|
255
|
+
isProofInsightsCommentsEnabled?: boolean;
|
|
251
256
|
}): Promise<Proof>;
|
|
252
257
|
/**
|
|
253
258
|
* Manually archives a proof or proofs. This action hides the proof from all user's who have access to it, but can still be
|
package/lib/api/Proofs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofsOwners=require("./ProofsOwners");var _ProofsOwners2=_interopRequireDefault(_ProofsOwners);var _ProofsEditors=require("./ProofsEditors");var _ProofsEditors2=_interopRequireDefault(_ProofsEditors);var _ProofsReviewers=require("./ProofsReviewers");var _ProofsReviewers2=_interopRequireDefault(_ProofsReviewers);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _ProofsAudit=require("./ProofsAudit");var _ProofsAudit2=_interopRequireDefault(_ProofsAudit);var _ProofsAssets=require("./ProofsAssets");var _ProofsAssets2=_interopRequireDefault(_ProofsAssets);var _ProofsCustomTools=require("./ProofsCustomTools");var _ProofsCustomTools2=_interopRequireDefault(_ProofsCustomTools);var _ProofsIntegrationReferences=require("./ProofsIntegrationReferences");var _ProofsIntegrationReferences2=_interopRequireDefault(_ProofsIntegrationReferences);var _ProofsLinkCheck=require("./ProofsLinkCheck");var _ProofsLinkCheck2=_interopRequireDefault(_ProofsLinkCheck);var _ProofsDecisions=require("./ProofsDecisions");var _ProofsDecisions2=_interopRequireDefault(_ProofsDecisions);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);var _whatwgURL=require("../util/whatwgURL");var _whatwgURL2=_interopRequireDefault(_whatwgURL);var _constants=require("../util/constants");var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var VIDEO_URL_TOKEN_SEPARATOR="|";function transformProofsForUpdate(proofs){var proofsArrForUpdate=[].concat(proofs);proofsArrForUpdate.forEach(function(proof){proof.proofId=proof.id;delete proof.id});return proofsArrForUpdate}var Proofs=function(_API){_inherits(Proofs,_API);function Proofs(client){_classCallCheck(this,Proofs);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _ProofsOwners2.default(client);_this.editors=new _ProofsEditors2.default(client);_this.reviewers=new _ProofsReviewers2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);_this.reminders=new _Reminders2.default(client);_this.audit=new _ProofsAudit2.default(client);_this.assets=new _ProofsAssets2.default(client);_this.customTools=new _ProofsCustomTools2.default(client);_this.integrationReferences=new _ProofsIntegrationReferences2.default(client);_this.linkCheck=new _ProofsLinkCheck2.default(client);_this.decisions=new _ProofsDecisions2.default(client);return _this}Proofs.prototype.setWorkflow=function setWorkflow(proofId,workflowId){var _this2=this;return this.client.request("proofs.normalize-workflow",{proofId:proofId,workflowId:workflowId}).then(function(){return _this2.client.request("proofs.set-workflow",{proofId:proofId,workflowId:workflowId})})};Proofs.prototype.setTags=function setTags(proofId,tags){return this.client.request("proofs.set-tags",{relatedId:proofId,tag:tags.join(",")})};Proofs.prototype.deleteTag=function deleteTag(proofId,tag){return this.client.request("proofs.tag-delete",{relatedId:proofId,tag:tag})};Proofs.prototype.setFile=function setFile(proofId,fileId){var _this3=this;return this.client.request("proofs.set-file",{proofId:proofId,fileId:fileId}).then(function(){return _this3.client.request("proofs.distribute-file",{proofId:proofId})})};Proofs.prototype.create=function create(_ref){var _this4=this;var name=_ref.name,_ref$tags=_ref.tags,tags=_ref$tags===undefined?[]:_ref$tags,_ref$dueDate=_ref.dueDate,dueDate=_ref$dueDate===undefined?new Date(Date.now()+3*_constants.DAY_IN_MS):_ref$dueDate,messageToReviewers=_ref.messageToReviewers,workflow=_ref.workflow,workflowTemplate=_ref.workflowTemplate,proofTemplate=_ref.proofTemplate,checklist=_ref.checklist,file=_ref.file,group=_ref.group,previousProof=_ref.previousProof,team=_ref.team,reference=_ref.reference,customTools=_ref.customTools,integrationReferences=_ref.integrationReferences,_ref$reminders=_ref.reminders,reminders=_ref$reminders===undefined?[]:_ref$reminders,owners=_ref.owners,canDownload=_ref.canDownload,isPublic=_ref.isPublic,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start,_ref$commentVisibilit=_ref.commentVisibility,commentVisibility=_ref$commentVisibilit===undefined?null:_ref$commentVisibilit,priority=_ref.priority,isDigitalVerificationEnabled=_ref.isDigitalVerificationEnabled,_ref$scheduledDate=_ref.scheduledDate,scheduledDate=_ref$scheduledDate===undefined?null:_ref$scheduledDate;return this.client.request("proofs.create",{proof:{name:name,tags:tags,dueDate:dueDate.toISOString?dueDate.toISOString():String(dueDate),messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,workflowTemplateId:workflowTemplate&&workflowTemplate.id||undefined,proofTemplateId:proofTemplate&&proofTemplate.id||undefined,checklist:checklist,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,previousProofId:previousProof&&previousProof.id||undefined,teamSlug:team&&team.slug||undefined,reference:reference,integrationReferences:integrationReferences,reminders:[].concat(reminders),owners:owners,canDownload:canDownload,isPublic:isPublic,start:start,commentVisibility:commentVisibility,priority:priority,scheduledDate:scheduledDate&&scheduledDate.toISOString?scheduledDate.toISOString():null,isDigitalVerificationEnabled:isDigitalVerificationEnabled}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();if(customTools&&!previousProof){return _this4.customTools.update(proof.id,customTools).then(function(){return proof})}return proof})};Proofs.prototype.archive=function archive(proofIdOrIds){return this.client.request("proofs.archive",{proofIds:proofIdOrIds})};Proofs.prototype.unarchive=function unarchive(proofId){return this.client.request("proofs.unarchive",{proofId:proofId})};Proofs.prototype.delete=function _delete(proofId){return this.client.request("proofs.delete",{proofId:proofId})};Proofs.prototype.finish=function finish(proofId,decision){return this.client.request("proofs.finish",{proofId:proofId,decision:decision})};Proofs.prototype.approve=function approve(proofId,message){return this.client.request("proofs.manual-approval",{proofId:proofId,message:message})};Proofs.prototype.withdrawApproval=function withdrawApproval(proofId,messageToSender){return this.client.request("proofs.withdraw-approval",{proofId:proofId,messageToSender:messageToSender})};Proofs.prototype.generateEmail=function generateEmail(proofId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.client.request("email.proofs.generate",_extends({proofId:proofId},options)).then(function(response){return response.data})};Proofs.prototype.return=function _return(proofIdOrIds){return this.client.request("proofs.return",{proofIds:[].concat(proofIdOrIds)}).then(function(response){return{proofIds:response.data.ProofIds,errors:response.data.Errors.map(function(error){return{proofId:error.ProofId,errorCode:error.ErrorCode,errorMessage:error.ErrorMessage}})}})};Proofs.prototype.start=function start(proofId){return this.client.request("proofs.start",{proofId:proofId})};Proofs.prototype.removeEditor=function removeEditor(id){return this.client.request("proofs.remove-editor",{proofId:id})};Proofs.prototype.load=function load(proofId){return this.client.request("proofs.load",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.lock=function lock(proofId){return this.client.request("proofs.lock",{proofId:proofId})};Proofs.prototype.unlock=function unlock(proofId){return this.client.request("proofs.unlock",{proofId:proofId})};Proofs.prototype.requestUnlock=function requestUnlock(proofId){return this.client.request("proofs.request-unlock",{proofId:proofId})};Proofs.prototype.requestAccess=function requestAccess(proofId){return this.client.request("proofs.request-access",{proofId:proofId})};Proofs.prototype.images=function images(proofId){return this.client.request("proofs.images",{proofId:proofId}).then(function(response){return response.data.proof.file})};Proofs.prototype.videoCredentials=function videoCredentials(proofId){var _this5=this;return this.client.cache.auto(_constants.VIDEO_CREDENTIALS_CACHE_PREFIX+proofId,function(){return _this5._videoCredentials(proofId)})};Proofs.prototype._videoCredentials=function _videoCredentials(proofId){var _this6=this;var bluffer=new _bluffer2.default;return this.client.request("proofs.video-credentials",{proofId:proofId}).then(function(response){return Promise.all([response.data.envelope.envelope,_this6.client.rawRequest({method:"GET",url:new _whatwgURL2.default(response.data.videoCredentials.url)}).then(function(videoCredentialsResponse){return videoCredentialsResponse.body})])}).then(function(_ref2){var envelope=_ref2[0],videoCredentials$=_ref2[1];return _this6.client.crypto().decryptImage(envelope+"-"+videoCredentials$,_this6.client.keyPairs.getPrivateKeyPEMs())}).then(function(videoCredentialsBase64){return bluffer.createBase64(videoCredentialsBase64).then(function(buffer){return bluffer.read(buffer)})}).then(function(videoCredentials){try{return JSON.parse(videoCredentials)}catch(err){var _videoCredentials$spl=videoCredentials.split(VIDEO_URL_TOKEN_SEPARATOR),unsafeBaseStreamingUrl=_videoCredentials$spl[0],accessToken=_videoCredentials$spl[1];return{streamingUrl:unsafeBaseStreamingUrl.replace("http://","https://")+"/manifest(format=m3u8-aapl,encryption=cbc)",accessToken:accessToken,manifestUrl:unsafeBaseStreamingUrl.replace("http://","https://")+"/manifest",bearerToken:accessToken}}})};Proofs.prototype._getProofSetup=function _getProofSetup(integrationKey,id){return this.client.request("integrations.get-proof-setup",{integration_key:integrationKey,id:id}).then(function(response){return{payload:response.data.payload}})};Proofs.prototype.setMessageToReviewers=function setMessageToReviewers(proofIdOrIds,messageToReviewers){return this.client.request("proofs.set-message-to-reviewers",{proofIds:[].concat(proofIdOrIds),messageToReviewers:messageToReviewers})};Proofs.prototype.returnTodos=function returnTodos(proofIdOrIds,_ref3){var messageToOwners=_ref3.messageToOwners,_ref3$markCommentsAsT=_ref3.markCommentsAsTodo,markCommentsAsTodo=_ref3$markCommentsAsT===undefined?false:_ref3$markCommentsAsT;return this.client.request("proofs.return-todos",{proofIds:[].concat(proofIdOrIds),messageToOwners:messageToOwners,markCommentAsTodo:markCommentsAsTodo})};Proofs.prototype.updateDecision=function updateDecision(proofId,decision){return this.client.request("proofs.update-decision",{proofId:proofId,decision:decision})};Proofs.prototype.update=function update(proofOrProofs){if(proofOrProofs.length===1||typeof proofOrProofs.length==="undefined"){var _concat$=[].concat(proofOrProofs)[0],id=_concat$.id,name=_concat$.name,tags=_concat$.tags,dueDate=_concat$.dueDate,messageToReviewers=_concat$.messageToReviewers,workflow=_concat$.workflow,checklist=_concat$.checklist,group=_concat$.group,proofTemplate=_concat$.proofTemplate,file=_concat$.file,reference=_concat$.reference,integrationReferences=_concat$.integrationReferences,reminders=_concat$.reminders,owners=_concat$.owners,canDownload=_concat$.canDownload,isPublic=_concat$.isPublic,start=_concat$.start,commentVisibility=_concat$.commentVisibility,priority=_concat$.priority,scheduledDate=_concat$.scheduledDate,isDigitalVerificationEnabled=_concat$.isDigitalVerificationEnabled;return this.client.request("proofs.update",{proof:{id:id,name:name,tags:tags,dueDate:dueDate?dueDate.toISOString():undefined,messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,proofTemplateId:proofTemplate&&proofTemplate.id||undefined,checklist:checklist,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,reference:reference,integrationReferences:integrationReferences,reminders:reminders?[].concat(reminders):undefined,owners:owners,canDownload:canDownload,isPublic:isPublic,start:start,commentVisibility:commentVisibility,priority:priority,scheduledDate:scheduledDate&&scheduledDate.toISOString?scheduledDate.toISOString():scheduledDate,isDigitalVerificationEnabled:isDigitalVerificationEnabled}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();return proof})}return this.client.request("proofs.bulk-update",{proofs:transformProofsForUpdate(proofOrProofs)})};Proofs.prototype.next=function next(proofId){return this.client.request("proofs.next",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.addWorkflow=function addWorkflow(proofIdOrIds,workflowTemplateId){return this.client.request("proofs-workflow.add-bulk",{proofIds:[].concat(proofIdOrIds),workflowTemplateId:workflowTemplateId})};Proofs.prototype.sendShareLink=function sendShareLink(_ref4){var proofId=_ref4.proofId,message=_ref4.message,emailAddresses=_ref4.emailAddresses;return this.client.request("proofs.send-share-link",{proofId:proofId,message:message,emailAddresses:emailAddresses})};Proofs.prototype.getWorkflowMetrics=function getWorkflowMetrics(proofId){return this.client.request("proofs.get-workflow-metrics",{proofId:proofId}).then(function(response){if(response.data){return response.data.workflowMetrics}return null})};return Proofs}(_API3.default);exports.default=Proofs;
|
|
1
|
+
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofsOwners=require("./ProofsOwners");var _ProofsOwners2=_interopRequireDefault(_ProofsOwners);var _ProofsEditors=require("./ProofsEditors");var _ProofsEditors2=_interopRequireDefault(_ProofsEditors);var _ProofsReviewers=require("./ProofsReviewers");var _ProofsReviewers2=_interopRequireDefault(_ProofsReviewers);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _ProofsAudit=require("./ProofsAudit");var _ProofsAudit2=_interopRequireDefault(_ProofsAudit);var _ProofsAssets=require("./ProofsAssets");var _ProofsAssets2=_interopRequireDefault(_ProofsAssets);var _ProofsCustomTools=require("./ProofsCustomTools");var _ProofsCustomTools2=_interopRequireDefault(_ProofsCustomTools);var _ProofsIntegrationReferences=require("./ProofsIntegrationReferences");var _ProofsIntegrationReferences2=_interopRequireDefault(_ProofsIntegrationReferences);var _ProofsLinkCheck=require("./ProofsLinkCheck");var _ProofsLinkCheck2=_interopRequireDefault(_ProofsLinkCheck);var _ProofsDecisions=require("./ProofsDecisions");var _ProofsDecisions2=_interopRequireDefault(_ProofsDecisions);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);var _whatwgURL=require("../util/whatwgURL");var _whatwgURL2=_interopRequireDefault(_whatwgURL);var _constants=require("../util/constants");var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var VIDEO_URL_TOKEN_SEPARATOR="|";function transformProofsForUpdate(proofs){var proofsArrForUpdate=[].concat(proofs);proofsArrForUpdate.forEach(function(proof){proof.proofId=proof.id;delete proof.id});return proofsArrForUpdate}var Proofs=function(_API){_inherits(Proofs,_API);function Proofs(client){_classCallCheck(this,Proofs);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _ProofsOwners2.default(client);_this.editors=new _ProofsEditors2.default(client);_this.reviewers=new _ProofsReviewers2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);_this.reminders=new _Reminders2.default(client);_this.audit=new _ProofsAudit2.default(client);_this.assets=new _ProofsAssets2.default(client);_this.customTools=new _ProofsCustomTools2.default(client);_this.integrationReferences=new _ProofsIntegrationReferences2.default(client);_this.linkCheck=new _ProofsLinkCheck2.default(client);_this.decisions=new _ProofsDecisions2.default(client);return _this}Proofs.prototype.setWorkflow=function setWorkflow(proofId,workflowId){var _this2=this;return this.client.request("proofs.normalize-workflow",{proofId:proofId,workflowId:workflowId}).then(function(){return _this2.client.request("proofs.set-workflow",{proofId:proofId,workflowId:workflowId})})};Proofs.prototype.setTags=function setTags(proofId,tags){return this.client.request("proofs.set-tags",{relatedId:proofId,tag:tags.join(",")})};Proofs.prototype.deleteTag=function deleteTag(proofId,tag){return this.client.request("proofs.tag-delete",{relatedId:proofId,tag:tag})};Proofs.prototype.setFile=function setFile(proofId,fileId){var _this3=this;return this.client.request("proofs.set-file",{proofId:proofId,fileId:fileId}).then(function(){return _this3.client.request("proofs.distribute-file",{proofId:proofId})})};Proofs.prototype.create=function create(_ref){var _this4=this;var name=_ref.name,_ref$tags=_ref.tags,tags=_ref$tags===undefined?[]:_ref$tags,_ref$dueDate=_ref.dueDate,dueDate=_ref$dueDate===undefined?new Date(Date.now()+3*_constants.DAY_IN_MS):_ref$dueDate,messageToReviewers=_ref.messageToReviewers,workflow=_ref.workflow,workflowTemplate=_ref.workflowTemplate,proofTemplate=_ref.proofTemplate,checklist=_ref.checklist,file=_ref.file,group=_ref.group,previousProof=_ref.previousProof,team=_ref.team,reference=_ref.reference,customTools=_ref.customTools,integrationReferences=_ref.integrationReferences,_ref$reminders=_ref.reminders,reminders=_ref$reminders===undefined?[]:_ref$reminders,owners=_ref.owners,canDownload=_ref.canDownload,isPublic=_ref.isPublic,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start,_ref$commentVisibilit=_ref.commentVisibility,commentVisibility=_ref$commentVisibilit===undefined?null:_ref$commentVisibilit,priority=_ref.priority,isDigitalVerificationEnabled=_ref.isDigitalVerificationEnabled,_ref$scheduledDate=_ref.scheduledDate,scheduledDate=_ref$scheduledDate===undefined?null:_ref$scheduledDate,isProofInsightsEnabled=_ref.isProofInsightsEnabled,isProofInsightsCommentsEnabled=_ref.isProofInsightsCommentsEnabled;return this.client.request("proofs.create",{proof:{name:name,tags:tags,dueDate:dueDate.toISOString?dueDate.toISOString():String(dueDate),messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,workflowTemplateId:workflowTemplate&&workflowTemplate.id||undefined,proofTemplateId:proofTemplate&&proofTemplate.id||undefined,checklist:checklist,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,previousProofId:previousProof&&previousProof.id||undefined,teamSlug:team&&team.slug||undefined,reference:reference,integrationReferences:integrationReferences,reminders:[].concat(reminders),owners:owners,canDownload:canDownload,isPublic:isPublic,start:start,commentVisibility:commentVisibility,priority:priority,scheduledDate:scheduledDate&&scheduledDate.toISOString?scheduledDate.toISOString():null,isDigitalVerificationEnabled:isDigitalVerificationEnabled,isProofInsightsEnabled:isProofInsightsEnabled,isProofInsightsCommentsEnabled:isProofInsightsCommentsEnabled}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();if(customTools&&!previousProof){return _this4.customTools.update(proof.id,customTools).then(function(){return proof})}return proof})};Proofs.prototype.archive=function archive(proofIdOrIds){return this.client.request("proofs.archive",{proofIds:proofIdOrIds})};Proofs.prototype.unarchive=function unarchive(proofId){return this.client.request("proofs.unarchive",{proofId:proofId})};Proofs.prototype.delete=function _delete(proofId){return this.client.request("proofs.delete",{proofId:proofId})};Proofs.prototype.finish=function finish(proofId,decision){return this.client.request("proofs.finish",{proofId:proofId,decision:decision})};Proofs.prototype.approve=function approve(proofId,message){return this.client.request("proofs.manual-approval",{proofId:proofId,message:message})};Proofs.prototype.withdrawApproval=function withdrawApproval(proofId,messageToSender){return this.client.request("proofs.withdraw-approval",{proofId:proofId,messageToSender:messageToSender})};Proofs.prototype.generateEmail=function generateEmail(proofId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.client.request("email.proofs.generate",_extends({proofId:proofId},options)).then(function(response){return response.data})};Proofs.prototype.return=function _return(proofIdOrIds){return this.client.request("proofs.return",{proofIds:[].concat(proofIdOrIds)}).then(function(response){return{proofIds:response.data.ProofIds,errors:response.data.Errors.map(function(error){return{proofId:error.ProofId,errorCode:error.ErrorCode,errorMessage:error.ErrorMessage}})}})};Proofs.prototype.start=function start(proofId){return this.client.request("proofs.start",{proofId:proofId})};Proofs.prototype.removeEditor=function removeEditor(id){return this.client.request("proofs.remove-editor",{proofId:id})};Proofs.prototype.load=function load(proofId){return this.client.request("proofs.load",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.lock=function lock(proofId){return this.client.request("proofs.lock",{proofId:proofId})};Proofs.prototype.unlock=function unlock(proofId){return this.client.request("proofs.unlock",{proofId:proofId})};Proofs.prototype.requestUnlock=function requestUnlock(proofId){return this.client.request("proofs.request-unlock",{proofId:proofId})};Proofs.prototype.requestAccess=function requestAccess(proofId){return this.client.request("proofs.request-access",{proofId:proofId})};Proofs.prototype.images=function images(proofId){return this.client.request("proofs.images",{proofId:proofId}).then(function(response){return response.data.proof.file})};Proofs.prototype.videoCredentials=function videoCredentials(proofId){var _this5=this;return this.client.cache.auto(_constants.VIDEO_CREDENTIALS_CACHE_PREFIX+proofId,function(){return _this5._videoCredentials(proofId)})};Proofs.prototype._videoCredentials=function _videoCredentials(proofId){var _this6=this;var bluffer=new _bluffer2.default;return this.client.request("proofs.video-credentials",{proofId:proofId}).then(function(response){return Promise.all([response.data.envelope.envelope,_this6.client.rawRequest({method:"GET",url:new _whatwgURL2.default(response.data.videoCredentials.url)}).then(function(videoCredentialsResponse){return videoCredentialsResponse.body})])}).then(function(_ref2){var envelope=_ref2[0],videoCredentials$=_ref2[1];return _this6.client.crypto().decryptImage(envelope+"-"+videoCredentials$,_this6.client.keyPairs.getPrivateKeyPEMs())}).then(function(videoCredentialsBase64){return bluffer.createBase64(videoCredentialsBase64).then(function(buffer){return bluffer.read(buffer)})}).then(function(videoCredentials){try{return JSON.parse(videoCredentials)}catch(err){var _videoCredentials$spl=videoCredentials.split(VIDEO_URL_TOKEN_SEPARATOR),unsafeBaseStreamingUrl=_videoCredentials$spl[0],accessToken=_videoCredentials$spl[1];return{streamingUrl:unsafeBaseStreamingUrl.replace("http://","https://")+"/manifest(format=m3u8-aapl,encryption=cbc)",accessToken:accessToken,manifestUrl:unsafeBaseStreamingUrl.replace("http://","https://")+"/manifest",bearerToken:accessToken}}})};Proofs.prototype._getProofSetup=function _getProofSetup(integrationKey,id){return this.client.request("integrations.get-proof-setup",{integration_key:integrationKey,id:id}).then(function(response){return{payload:response.data.payload}})};Proofs.prototype.setMessageToReviewers=function setMessageToReviewers(proofIdOrIds,messageToReviewers){return this.client.request("proofs.set-message-to-reviewers",{proofIds:[].concat(proofIdOrIds),messageToReviewers:messageToReviewers})};Proofs.prototype.returnTodos=function returnTodos(proofIdOrIds,_ref3){var messageToOwners=_ref3.messageToOwners,_ref3$markCommentsAsT=_ref3.markCommentsAsTodo,markCommentsAsTodo=_ref3$markCommentsAsT===undefined?false:_ref3$markCommentsAsT;return this.client.request("proofs.return-todos",{proofIds:[].concat(proofIdOrIds),messageToOwners:messageToOwners,markCommentAsTodo:markCommentsAsTodo})};Proofs.prototype.updateDecision=function updateDecision(proofId,decision){return this.client.request("proofs.update-decision",{proofId:proofId,decision:decision})};Proofs.prototype.update=function update(proofOrProofs){if(proofOrProofs.length===1||typeof proofOrProofs.length==="undefined"){var _concat$=[].concat(proofOrProofs)[0],id=_concat$.id,name=_concat$.name,tags=_concat$.tags,dueDate=_concat$.dueDate,messageToReviewers=_concat$.messageToReviewers,workflow=_concat$.workflow,checklist=_concat$.checklist,group=_concat$.group,proofTemplate=_concat$.proofTemplate,file=_concat$.file,reference=_concat$.reference,integrationReferences=_concat$.integrationReferences,reminders=_concat$.reminders,owners=_concat$.owners,canDownload=_concat$.canDownload,isPublic=_concat$.isPublic,start=_concat$.start,commentVisibility=_concat$.commentVisibility,priority=_concat$.priority,scheduledDate=_concat$.scheduledDate,isDigitalVerificationEnabled=_concat$.isDigitalVerificationEnabled,isProofInsightsEnabled=_concat$.isProofInsightsEnabled,isProofInsightsCommentsEnabled=_concat$.isProofInsightsCommentsEnabled;return this.client.request("proofs.update",{proof:{id:id,name:name,tags:tags,dueDate:dueDate?dueDate.toISOString():undefined,messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,proofTemplateId:proofTemplate&&proofTemplate.id||undefined,checklist:checklist,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,reference:reference,integrationReferences:integrationReferences,reminders:reminders?[].concat(reminders):undefined,owners:owners,canDownload:canDownload,isPublic:isPublic,start:start,commentVisibility:commentVisibility,priority:priority,scheduledDate:scheduledDate&&scheduledDate.toISOString?scheduledDate.toISOString():scheduledDate,isDigitalVerificationEnabled:isDigitalVerificationEnabled,isProofInsightsEnabled:isProofInsightsEnabled,isProofInsightsCommentsEnabled:isProofInsightsCommentsEnabled}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();return proof})}return this.client.request("proofs.bulk-update",{proofs:transformProofsForUpdate(proofOrProofs)})};Proofs.prototype.next=function next(proofId){return this.client.request("proofs.next",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.addWorkflow=function addWorkflow(proofIdOrIds,workflowTemplateId){return this.client.request("proofs-workflow.add-bulk",{proofIds:[].concat(proofIdOrIds),workflowTemplateId:workflowTemplateId})};Proofs.prototype.sendShareLink=function sendShareLink(_ref4){var proofId=_ref4.proofId,message=_ref4.message,emailAddresses=_ref4.emailAddresses;return this.client.request("proofs.send-share-link",{proofId:proofId,message:message,emailAddresses:emailAddresses})};Proofs.prototype.getWorkflowMetrics=function getWorkflowMetrics(proofId){return this.client.request("proofs.get-workflow-metrics",{proofId:proofId}).then(function(response){if(response.data){return response.data.workflowMetrics}return null})};return Proofs}(_API3.default);exports.default=Proofs;
|
|
@@ -13,53 +13,159 @@ declare class TeamDashboard extends API {
|
|
|
13
13
|
*
|
|
14
14
|
* @since 2.0.0-beta.54
|
|
15
15
|
* @param {number} page The page number
|
|
16
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
17
|
+
* @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
|
|
18
|
+
* @param {object} [options.sort] Optional sort options object
|
|
19
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
20
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
21
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
16
22
|
* @returns {Promise<TeamDashboardPagination>}
|
|
17
23
|
*/
|
|
18
|
-
inbox(page: number): Promise<TeamDashboardPagination>;
|
|
24
|
+
inbox(page: number, options?: number | object): Promise<TeamDashboardPagination>;
|
|
19
25
|
/**
|
|
20
26
|
* Loads all the proofs in the team's sent box.
|
|
21
27
|
*
|
|
22
28
|
* @since 2.0.0-beta.54
|
|
23
29
|
* @param {number} page The page number
|
|
30
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
31
|
+
* @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
|
|
32
|
+
* @param {object} [options.sort] Optional sort options object
|
|
33
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
34
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
35
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
24
36
|
* @returns {Promise<TeamDashboardPagination>}
|
|
25
37
|
*/
|
|
26
|
-
sent(page: number): Promise<TeamDashboardPagination>;
|
|
38
|
+
sent(page: number, options?: number | object): Promise<TeamDashboardPagination>;
|
|
27
39
|
/**
|
|
28
40
|
* Loads all the proofs in the team's outbox.
|
|
29
41
|
*
|
|
30
42
|
* @since 2.0.0-beta.54
|
|
31
43
|
* @param {number} page The page number
|
|
44
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
45
|
+
* @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
|
|
46
|
+
* @param {object} [options.sort] Optional sort options object
|
|
47
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
48
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
49
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
32
50
|
* @returns {Promise<TeamDashboardPagination>}
|
|
33
51
|
*/
|
|
34
|
-
outbox(page: number): Promise<TeamDashboardPagination>;
|
|
52
|
+
outbox(page: number, options?: number | object): Promise<TeamDashboardPagination>;
|
|
35
53
|
/** @private */
|
|
36
54
|
private _loadSingleTeamTabProofs;
|
|
55
|
+
/** @private */
|
|
56
|
+
/** this is the new function for get team tab proofs data from Spider instead
|
|
57
|
+
* of API.
|
|
58
|
+
* @param {string} name - The name of the tab to load.
|
|
59
|
+
* @param {object} [params] - The parameters for the request.
|
|
60
|
+
* @param {number} [params.page=1] - The page number to load.
|
|
61
|
+
* @param {number} [params.pageSize=TEAM_DASHBOARD_PROOFS_PER_PAGE] - The page size to load.
|
|
62
|
+
* @param {object} [params.sort] - Sort options object.
|
|
63
|
+
* @param {boolean} [params.excludeArchived] - Whether to exclude archived proofs.
|
|
64
|
+
* @param {object} [params.dateFilters] - Date filters object.
|
|
65
|
+
* @returns {Promise<{proofs: Array<Proof>, total: number}>}
|
|
66
|
+
*/
|
|
67
|
+
_loadSingleTeamTabProofsFromSpider(name: string, params?: {
|
|
68
|
+
page: number;
|
|
69
|
+
pageSize: number;
|
|
70
|
+
sort: object;
|
|
71
|
+
excludeArchived: boolean;
|
|
72
|
+
dateFilters: object;
|
|
73
|
+
}): Promise<{
|
|
74
|
+
proofs: Array<Proof>;
|
|
75
|
+
total: number;
|
|
76
|
+
}>;
|
|
77
|
+
/** @private */
|
|
78
|
+
/** Search function for team dashboard proofs using Spider GraphQL
|
|
79
|
+
* @param {object} [params] - The parameters for the search.
|
|
80
|
+
* @param {string} [params.query] - The search query text.
|
|
81
|
+
* @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
|
|
82
|
+
* @param {Array<number>} [params.filters.status] - Array of status numbers to filter by.
|
|
83
|
+
* @param {object} [params.filters.dateFilters] - Date filters object.
|
|
84
|
+
* @param {boolean} [params.filters.excludeArchived] - Whether to exclude archived proofs.
|
|
85
|
+
* @param {object} [params.sort] - Sort options object.
|
|
86
|
+
* @param {number} [params.page=1] - The page number to load.
|
|
87
|
+
* @param {number} [params.pageSize=TEAM_DASHBOARD_PROOFS_PER_PAGE] - The page size to load.
|
|
88
|
+
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}>}
|
|
89
|
+
*/
|
|
90
|
+
_searchTeamProofsFromSpider(params?: {
|
|
91
|
+
query: string;
|
|
92
|
+
filters: {
|
|
93
|
+
status: Array<number>;
|
|
94
|
+
dateFilters: object;
|
|
95
|
+
excludeArchived: boolean;
|
|
96
|
+
};
|
|
97
|
+
sort: object;
|
|
98
|
+
page: number;
|
|
99
|
+
pageSize: number;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
proofs: Array<Proof>;
|
|
102
|
+
totalCount: number;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Fetches only the total count for a specific team tab without loading proof data.
|
|
106
|
+
* This is useful for displaying tab counts/badges before user clicks on them.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} tabName - The name of the tab (e.g., 'inbox', 'sent', 'outbox', 'everything', 'approved', 'archived')
|
|
109
|
+
* @param {object} [options] - Optional options object
|
|
110
|
+
* @param {boolean} [options.excludeArchived] - Whether to exclude archived proofs from the count
|
|
111
|
+
* @returns {Promise<number>} The total count of proofs in the tab
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* // Get count for inbox tab
|
|
115
|
+
* const inboxCount = await sdk.admin.teamDashboard.getTabCount('inbox');
|
|
116
|
+
* console.log(`Team inbox has ${inboxCount} proofs`);
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* // Get count for inbox tab excluding archived proofs
|
|
120
|
+
* const inboxCount = await sdk.admin.teamDashboard.getTabCount('inbox', { excludeArchived: true });
|
|
121
|
+
*/
|
|
122
|
+
getTabCount(tabName: string, options?: {
|
|
123
|
+
excludeArchived: boolean;
|
|
124
|
+
}): Promise<number>;
|
|
37
125
|
/**
|
|
38
126
|
* Loads all of the proofs in the team.
|
|
39
127
|
*
|
|
40
128
|
*
|
|
41
129
|
* @since 2.0.0-beta.54
|
|
42
130
|
* @param {number} page The page number
|
|
131
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
132
|
+
* @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
|
|
133
|
+
* @param {object} [options.sort] Optional sort options object
|
|
134
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
135
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
136
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
43
137
|
* @returns {Promise<TeamDashboardPagination>}
|
|
44
138
|
*/
|
|
45
|
-
everything(page: number): Promise<TeamDashboardPagination>;
|
|
139
|
+
everything(page: number, options?: number | object): Promise<TeamDashboardPagination>;
|
|
46
140
|
/**
|
|
47
141
|
* Loads all the approved proofs in the team.
|
|
48
142
|
*
|
|
49
143
|
*
|
|
50
144
|
* @since 2.0.0-beta.54
|
|
51
145
|
* @param {number} page The page number
|
|
146
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
147
|
+
* @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
|
|
148
|
+
* @param {object} [options.sort] Optional sort options object
|
|
149
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
150
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
151
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
52
152
|
* @returns {Promise<TeamDashboardPagination>}
|
|
53
153
|
*/
|
|
54
|
-
approved(page: number): Promise<TeamDashboardPagination>;
|
|
154
|
+
approved(page: number, options?: number | object): Promise<TeamDashboardPagination>;
|
|
55
155
|
/**
|
|
56
156
|
* Loads all the archived proofs in the team.
|
|
57
157
|
*
|
|
58
158
|
* @since 2.0.0-beta.54
|
|
59
159
|
* @param {number} page The page number
|
|
160
|
+
* @param {number|object} [options] Optional page size (number) or options object
|
|
161
|
+
* @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
|
|
162
|
+
* @param {object} [options.sort] Optional sort options object
|
|
163
|
+
* @param {boolean} [options.excludeArchived] Whether to exclude archived proofs
|
|
164
|
+
* @param {object} [options.dateFilters] Optional date filters object
|
|
165
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
60
166
|
* @returns {Promise<TeamDashboardPagination>}
|
|
61
167
|
*/
|
|
62
|
-
archived(page: number): Promise<TeamDashboardPagination>;
|
|
168
|
+
archived(page: number, options?: number | object): Promise<TeamDashboardPagination>;
|
|
63
169
|
/**
|
|
64
170
|
* Searches all the proofs in the team.
|
|
65
171
|
*
|
|
@@ -68,17 +174,22 @@ declare class TeamDashboard extends API {
|
|
|
68
174
|
* @param {string} query The search query
|
|
69
175
|
* @param {object} [options] Advanced options
|
|
70
176
|
* @param {ProofStatus|Array<ProofStatus>} [options.status] The proof status (or statuses)
|
|
71
|
-
* @param {boolean} [options.everything] Whether to load every proof the user has access to
|
|
72
|
-
* @param {number} [options.page] The page number for team dashboard
|
|
177
|
+
* @param {boolean} [options.everything] Whether to load every proof the user has access to (legacy only)
|
|
178
|
+
* @param {number} [options.page=1] The page number for team dashboard
|
|
179
|
+
* @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
|
|
180
|
+
* @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
|
|
73
181
|
* @returns {Promise<TeamDashboardPagination>}
|
|
74
182
|
*/
|
|
75
183
|
search(query: string, options?: {
|
|
76
184
|
status: any | Array<any>;
|
|
77
185
|
everything: boolean;
|
|
78
186
|
page: number;
|
|
187
|
+
pageSize: number;
|
|
188
|
+
useAzureSearch: boolean;
|
|
79
189
|
}): Promise<TeamDashboardPagination>;
|
|
80
190
|
/** @private */
|
|
81
191
|
private _loadTeamSearchProofs;
|
|
82
192
|
}
|
|
83
193
|
import API from "../API";
|
|
84
194
|
import TeamDashboardGroups from "./TeamDashboardGroups";
|
|
195
|
+
import Proof from "../../models/Proof";
|