@pageproof/sdk-pr 659.0.1769126776601 → 660.0.1769459222017
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 +12 -0
- package/lib/api/Dashboard.d.ts +17 -170
- package/lib/api/Dashboard.js +1 -1
- package/lib/api/ProofsGroups.d.ts +11 -0
- package/lib/api/ProofsGroups.js +1 -1
- package/lib/api/admin/TeamDashboard.d.ts +8 -119
- package/lib/api/admin/TeamDashboard.js +13 -192
- package/lib/api/admin/TeamFeatures.d.ts +7 -0
- package/lib/api/admin/TeamFeatures.js +21 -0
- package/lib/enum/index.d.ts +1 -2
- package/lib/enum/index.js +1 -1
- package/lib/models/Proof.d.ts +0 -18
- package/lib/models/Proof.js +1 -1
- package/lib/models/TeamAccountFeatures.js +1 -1
- package/lib/models/TeamIntelligenceFeatures.d.ts +42 -0
- package/lib/models/TeamIntelligenceFeatures.js +1 -1
- package/lib/network/endpoints.json +1 -1
- package/lib/pageproof.js +1 -1
- package/package.json +1 -1
- package/lib/enum/StatusMessage.d.ts +0 -24
- package/lib/enum/StatusMessage.js +0 -1
- package/lib/util/dashboardSearchShared.d.ts +0 -156
- package/lib/util/dashboardSearchShared.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 2.12.0
|
|
2
|
+
|
|
3
|
+
Released on the 22nd of January 2026.
|
|
4
|
+
|
|
5
|
+
- [[PP-9564](https://pageproof.atlassian.net/browse/PP-9564)] Added support for PageProof Intelligence® feature flags, allowing teams to control PI insights across proofs, dashboard, and reports.
|
|
6
|
+
|
|
7
|
+
## 2.11.0
|
|
8
|
+
|
|
9
|
+
Released on the 6th of January 2026.
|
|
10
|
+
|
|
11
|
+
- [[PP-9218](https://pageproof.atlassian.net/browse/PP-9218)] Added support for the collection status feature.
|
|
12
|
+
|
|
1
13
|
## 2.10.1
|
|
2
14
|
|
|
3
15
|
Released on the 10th of December 2025.
|
package/lib/api/Dashboard.d.ts
CHANGED
|
@@ -11,214 +11,61 @@ declare class Dashboard extends API {
|
|
|
11
11
|
/**
|
|
12
12
|
* Loads all the proofs in the current authenticated inbox.
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
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>>}
|
|
14
|
+
* @returns {Promise<Array<Proof>>}
|
|
22
15
|
*/
|
|
23
|
-
inbox(
|
|
24
|
-
proofs: Array<Proof>;
|
|
25
|
-
totalCount: number;
|
|
26
|
-
} | Array<Proof>>;
|
|
16
|
+
inbox(): Promise<Array<Proof>>;
|
|
27
17
|
/**
|
|
28
18
|
* Loads all the proofs in the current authenticated sent box.
|
|
29
19
|
*
|
|
30
|
-
* @
|
|
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>>}
|
|
20
|
+
* @returns {Promise<Array<Proof>>}
|
|
38
21
|
*/
|
|
39
|
-
sent(
|
|
40
|
-
proofs: Array<Proof>;
|
|
41
|
-
totalCount: number;
|
|
42
|
-
} | Array<Proof>>;
|
|
22
|
+
sent(): Promise<Array<Proof>>;
|
|
43
23
|
/**
|
|
44
24
|
* Loads all the proofs in the current authenticated outbox.
|
|
45
25
|
*
|
|
46
|
-
* @
|
|
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>>}
|
|
26
|
+
* @returns {Promise<Array<Proof>>}
|
|
54
27
|
*/
|
|
55
|
-
outbox(
|
|
56
|
-
proofs: Array<Proof>;
|
|
57
|
-
totalCount: number;
|
|
58
|
-
} | Array<Proof>>;
|
|
28
|
+
outbox(): Promise<Array<Proof>>;
|
|
59
29
|
/**
|
|
60
30
|
* Loads all the briefs in the current authenticated brief box.
|
|
61
31
|
*
|
|
62
32
|
* @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.
|
|
79
33
|
* @returns {Promise<Array<Proof>>}
|
|
80
34
|
*/
|
|
81
|
-
|
|
35
|
+
briefs(): Promise<Array<Proof>>;
|
|
82
36
|
/** @private */
|
|
83
|
-
|
|
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>;
|
|
37
|
+
private _loadSingleTabProofs;
|
|
152
38
|
/**
|
|
153
39
|
* Searches the current authenticated user's dashboard using a search query.
|
|
154
40
|
*
|
|
155
41
|
* @param {string} query The search query
|
|
156
42
|
* @param {object} [options] Advanced options
|
|
157
43
|
* @param {ProofStatus|Array<ProofStatus>} [options.status] The proof status (or statuses)
|
|
158
|
-
* @param {boolean} [options.everything] Whether to load every proof the user has access to
|
|
159
|
-
* @
|
|
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>>}
|
|
44
|
+
* @param {boolean} [options.everything] Whether to load every proof the user has access to
|
|
45
|
+
* @returns {Promise<Array<Proof>>}
|
|
163
46
|
*/
|
|
164
47
|
search(query: string, options?: {
|
|
165
48
|
status: any | Array<any>;
|
|
166
49
|
everything: boolean;
|
|
167
|
-
|
|
168
|
-
pageSize: number;
|
|
169
|
-
useAzureSearch: boolean;
|
|
170
|
-
}): Promise<{
|
|
171
|
-
proofs: Array<Proof>;
|
|
172
|
-
totalCount: number;
|
|
173
|
-
} | Array<Proof>>;
|
|
50
|
+
}): Promise<Array<Proof>>;
|
|
174
51
|
/**
|
|
175
52
|
* Loads all of the proofs the current authenticated user has access to.
|
|
176
53
|
*
|
|
177
|
-
* @
|
|
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>>}
|
|
54
|
+
* @returns {Promise<Array<Proof>>}
|
|
185
55
|
*/
|
|
186
|
-
everything(
|
|
187
|
-
proofs: Array<Proof>;
|
|
188
|
-
totalCount: number;
|
|
189
|
-
} | Array<Proof>>;
|
|
56
|
+
everything(): Promise<Array<Proof>>;
|
|
190
57
|
/**
|
|
191
58
|
* Loads all the approved proofs the current authenticated user has access to.
|
|
192
59
|
*
|
|
193
|
-
* @
|
|
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>>}
|
|
60
|
+
* @returns {Promise<Array<Proof>>}
|
|
201
61
|
*/
|
|
202
|
-
approved(
|
|
203
|
-
proofs: Array<Proof>;
|
|
204
|
-
totalCount: number;
|
|
205
|
-
} | Array<Proof>>;
|
|
62
|
+
approved(): Promise<Array<Proof>>;
|
|
206
63
|
/**
|
|
207
64
|
* Loads all the archived proofs the current authenticated user has access to.
|
|
208
65
|
*
|
|
209
|
-
* @
|
|
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>>}
|
|
66
|
+
* @returns {Promise<Array<Proof>>}
|
|
217
67
|
*/
|
|
218
|
-
archived(
|
|
219
|
-
proofs: Array<Proof>;
|
|
220
|
-
totalCount: number;
|
|
221
|
-
} | Array<Proof>>;
|
|
68
|
+
archived(): Promise<Array<Proof>>;
|
|
222
69
|
/** @private */
|
|
223
70
|
private _loadSearchProofs;
|
|
224
71
|
}
|
package/lib/api/Dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var
|
|
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;
|
|
@@ -32,6 +32,17 @@ declare class ProofsGroups extends API {
|
|
|
32
32
|
* @returns {Promise<ProofGroup>}
|
|
33
33
|
*/
|
|
34
34
|
load(groupId: string): Promise<ProofGroup>;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the progress of a proof group by id.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} groupId The group id
|
|
39
|
+
* @returns {Promise<{status: string; totalProofsCount: number; completedProofsCount: number;}>}
|
|
40
|
+
*/
|
|
41
|
+
getProgress(groupId: string): Promise<{
|
|
42
|
+
status: string;
|
|
43
|
+
totalProofsCount: number;
|
|
44
|
+
completedProofsCount: number;
|
|
45
|
+
}>;
|
|
35
46
|
/**
|
|
36
47
|
* Marks a group as ready.
|
|
37
48
|
*
|
package/lib/api/ProofsGroups.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofGroup=require("../models/ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _GroupsOwners=require("./GroupsOwners");var _GroupsOwners2=_interopRequireDefault(_GroupsOwners);var _GroupsWorkflows=require("./GroupsWorkflows");var _GroupsWorkflows2=_interopRequireDefault(_GroupsWorkflows);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}function mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var ProofsGroups=function(_API){_inherits(ProofsGroups,_API);function ProofsGroups(client){_classCallCheck(this,ProofsGroups);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _GroupsOwners2.default(client);_this.workflows=new _GroupsWorkflows2.default(client);return _this}ProofsGroups.prototype.create=function create(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},name=_ref.name,isOwnedByTeam=_ref.isOwnedByTeam;return this.client.request("proofs.groups.create",{name:name,ownedByTeam:isOwnedByTeam}).then(mapResponseToGroup)};ProofsGroups.prototype.load=function load(groupId){return this.client.request("proofs.groups.load",{groupId:groupId}).then(mapResponseToGroup)};ProofsGroups.prototype.ready=function ready(groupId){return this.client.request("proofs.groups.ready",{groupId:groupId})};ProofsGroups.prototype.update=function update(groupId,_ref2){var name=_ref2.name,isOwnedByTeam=_ref2.isOwnedByTeam,folder=_ref2.folder;return this.client.request("proofs.groups.update",{groupId:groupId,name:name,ownedByTeam:isOwnedByTeam,folderName:folder&&folder.name}).then(mapResponseToGroup)};ProofsGroups.prototype.removeProof=function removeProof(proofId){return this.client.request("proofs.groups.remove-proof",{proofId:proofId})};ProofsGroups.prototype.addProof=function addProof(groupId,proofId){return this.client.request("proofs.groups.add-proof",{groupId:groupId,proofId:proofId})};ProofsGroups.prototype.delete=function _delete(groupId){return this.client.request("proofs.groups.delete",{groupId:groupId})};ProofsGroups.prototype.archive=function archive(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}if(args.every(function(arg){return typeof arg==="string"})){return this.client.request("proofs.groups.archive",{groupIds:args})}else{var defaultOptions={archiveProofs:false};var groupIdOrGroupIds=args[0],_args$=args[1],options=_args$===undefined?defaultOptions:_args$;var groupIds=[].concat(groupIdOrGroupIds);return this.client.request("proofs.groups.archive",_extends({groupIds:groupIds},options))}};ProofsGroups.prototype.reopen=function reopen(){for(var _len2=arguments.length,groupIds=Array(_len2),_key2=0;_key2<_len2;_key2++){groupIds[_key2]=arguments[_key2]}return this.client.request("proofs.groups.reopen",{groupIds:groupIds})};return ProofsGroups}(_API3.default);exports.default=ProofsGroups;
|
|
1
|
+
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _templateObject=_taggedTemplateLiteralLoose(["\n query sdk_CollectionProgress($collectionId: ID!) {\n collectionProgress(id: $collectionId) {\n status\n completedProofsCount\n totalProofsCount\n }\n }\n"],["\n query sdk_CollectionProgress($collectionId: ID!) {\n collectionProgress(id: $collectionId) {\n status\n completedProofsCount\n totalProofsCount\n }\n }\n"]);var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofGroup=require("../models/ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _GroupsOwners=require("./GroupsOwners");var _GroupsOwners2=_interopRequireDefault(_GroupsOwners);var _GroupsWorkflows=require("./GroupsWorkflows");var _GroupsWorkflows2=_interopRequireDefault(_GroupsWorkflows);var _gql=require("../util/gql");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}function _taggedTemplateLiteralLoose(strings,raw){strings.raw=raw;return strings}function mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var GET_COLLECTION_PROGRESS=(0,_gql.gql)(_templateObject);var ProofsGroups=function(_API){_inherits(ProofsGroups,_API);function ProofsGroups(client){_classCallCheck(this,ProofsGroups);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _GroupsOwners2.default(client);_this.workflows=new _GroupsWorkflows2.default(client);return _this}ProofsGroups.prototype.create=function create(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},name=_ref.name,isOwnedByTeam=_ref.isOwnedByTeam;return this.client.request("proofs.groups.create",{name:name,ownedByTeam:isOwnedByTeam}).then(mapResponseToGroup)};ProofsGroups.prototype.load=function load(groupId){return this.client.request("proofs.groups.load",{groupId:groupId}).then(mapResponseToGroup)};ProofsGroups.prototype.getProgress=function getProgress(groupId){return this.client.graphql(GET_COLLECTION_PROGRESS,{collectionId:groupId}).then(function(response){return response.data.collectionProgress})};ProofsGroups.prototype.ready=function ready(groupId){return this.client.request("proofs.groups.ready",{groupId:groupId})};ProofsGroups.prototype.update=function update(groupId,_ref2){var name=_ref2.name,isOwnedByTeam=_ref2.isOwnedByTeam,folder=_ref2.folder;return this.client.request("proofs.groups.update",{groupId:groupId,name:name,ownedByTeam:isOwnedByTeam,folderName:folder&&folder.name}).then(mapResponseToGroup)};ProofsGroups.prototype.removeProof=function removeProof(proofId){return this.client.request("proofs.groups.remove-proof",{proofId:proofId})};ProofsGroups.prototype.addProof=function addProof(groupId,proofId){return this.client.request("proofs.groups.add-proof",{groupId:groupId,proofId:proofId})};ProofsGroups.prototype.delete=function _delete(groupId){return this.client.request("proofs.groups.delete",{groupId:groupId})};ProofsGroups.prototype.archive=function archive(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}if(args.every(function(arg){return typeof arg==="string"})){return this.client.request("proofs.groups.archive",{groupIds:args})}else{var defaultOptions={archiveProofs:false};var groupIdOrGroupIds=args[0],_args$=args[1],options=_args$===undefined?defaultOptions:_args$;var groupIds=[].concat(groupIdOrGroupIds);return this.client.request("proofs.groups.archive",_extends({groupIds:groupIds},options))}};ProofsGroups.prototype.reopen=function reopen(){for(var _len2=arguments.length,groupIds=Array(_len2),_key2=0;_key2<_len2;_key2++){groupIds[_key2]=arguments[_key2]}return this.client.request("proofs.groups.reopen",{groupIds:groupIds})};return ProofsGroups}(_API3.default);exports.default=ProofsGroups;
|
|
@@ -13,159 +13,53 @@ 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
|
|
22
16
|
* @returns {Promise<TeamDashboardPagination>}
|
|
23
17
|
*/
|
|
24
|
-
inbox(page: number
|
|
18
|
+
inbox(page: number): Promise<TeamDashboardPagination>;
|
|
25
19
|
/**
|
|
26
20
|
* Loads all the proofs in the team's sent box.
|
|
27
21
|
*
|
|
28
22
|
* @since 2.0.0-beta.54
|
|
29
23
|
* @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
|
|
36
24
|
* @returns {Promise<TeamDashboardPagination>}
|
|
37
25
|
*/
|
|
38
|
-
sent(page: number
|
|
26
|
+
sent(page: number): Promise<TeamDashboardPagination>;
|
|
39
27
|
/**
|
|
40
28
|
* Loads all the proofs in the team's outbox.
|
|
41
29
|
*
|
|
42
30
|
* @since 2.0.0-beta.54
|
|
43
31
|
* @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
|
|
50
32
|
* @returns {Promise<TeamDashboardPagination>}
|
|
51
33
|
*/
|
|
52
|
-
outbox(page: number
|
|
34
|
+
outbox(page: number): Promise<TeamDashboardPagination>;
|
|
53
35
|
/** @private */
|
|
54
36
|
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>;
|
|
125
37
|
/**
|
|
126
38
|
* Loads all of the proofs in the team.
|
|
127
39
|
*
|
|
128
40
|
*
|
|
129
41
|
* @since 2.0.0-beta.54
|
|
130
42
|
* @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
|
|
137
43
|
* @returns {Promise<TeamDashboardPagination>}
|
|
138
44
|
*/
|
|
139
|
-
everything(page: number
|
|
45
|
+
everything(page: number): Promise<TeamDashboardPagination>;
|
|
140
46
|
/**
|
|
141
47
|
* Loads all the approved proofs in the team.
|
|
142
48
|
*
|
|
143
49
|
*
|
|
144
50
|
* @since 2.0.0-beta.54
|
|
145
51
|
* @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
|
|
152
52
|
* @returns {Promise<TeamDashboardPagination>}
|
|
153
53
|
*/
|
|
154
|
-
approved(page: number
|
|
54
|
+
approved(page: number): Promise<TeamDashboardPagination>;
|
|
155
55
|
/**
|
|
156
56
|
* Loads all the archived proofs in the team.
|
|
157
57
|
*
|
|
158
58
|
* @since 2.0.0-beta.54
|
|
159
59
|
* @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
|
|
166
60
|
* @returns {Promise<TeamDashboardPagination>}
|
|
167
61
|
*/
|
|
168
|
-
archived(page: number
|
|
62
|
+
archived(page: number): Promise<TeamDashboardPagination>;
|
|
169
63
|
/**
|
|
170
64
|
* Searches all the proofs in the team.
|
|
171
65
|
*
|
|
@@ -174,22 +68,17 @@ declare class TeamDashboard extends API {
|
|
|
174
68
|
* @param {string} query The search query
|
|
175
69
|
* @param {object} [options] Advanced options
|
|
176
70
|
* @param {ProofStatus|Array<ProofStatus>} [options.status] The proof status (or statuses)
|
|
177
|
-
* @param {boolean} [options.everything] Whether to load every proof the user has access to
|
|
178
|
-
* @param {number} [options.page
|
|
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
|
|
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
|
|
181
73
|
* @returns {Promise<TeamDashboardPagination>}
|
|
182
74
|
*/
|
|
183
75
|
search(query: string, options?: {
|
|
184
76
|
status: any | Array<any>;
|
|
185
77
|
everything: boolean;
|
|
186
78
|
page: number;
|
|
187
|
-
pageSize: number;
|
|
188
|
-
useAzureSearch: boolean;
|
|
189
79
|
}): Promise<TeamDashboardPagination>;
|
|
190
80
|
/** @private */
|
|
191
81
|
private _loadTeamSearchProofs;
|
|
192
82
|
}
|
|
193
83
|
import API from "../API";
|
|
194
84
|
import TeamDashboardGroups from "./TeamDashboardGroups";
|
|
195
|
-
import Proof from "../../models/Proof";
|