@pageproof/sdk-pr 736.0.1791868308318 → 738.0.1792351623971

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/README.md CHANGED
@@ -336,17 +336,6 @@ const user = await client.users.byEmail('user@example.com');
336
336
  console.log(user); // User { id: "UDLCS204C9O9JN6T", name: "John Smith", ... }
337
337
  ```
338
338
 
339
- #### Avatars
340
-
341
- User profile pictures are served from the public avatar CDN (no API credentials required). Build a URL with `users.avatarUrl` and use it as an image `src`:
342
-
343
- ```js
344
- const src = client.users.avatarUrl(user.id, { size: 80 });
345
- // => "https://avatar.pageproof.com/-/UDLCS204C9O9JN6T?size=80"
346
- ```
347
-
348
- In development or test, set `options.avatarEndpoint` on the client to your environment’s avatar base URL if it is not the production default.
349
-
350
339
  There's also a list of APIs in the docs sidebar, under the section "api".
351
340
 
352
341
  ### Authenticating as a user/logging in
@@ -105,7 +105,7 @@ declare class Dashboard extends API {
105
105
  /** Search function for dashboard proofs using Spider GraphQL
106
106
  * @param {object} [params] - The parameters for the search.
107
107
  * @param {string} [params.query] - The search query text.
108
- * @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
108
+ * @param {object} [params.filters] - Filter object containing status, dateFilters, excludeArchived and roleFilters.
109
109
  * @param {Array<number>} [params.filters.status] - Array of status numbers to filter by.
110
110
  * @param {object} [params.filters.dateFilters] - Date filters object.
111
111
  * @param {boolean} [params.filters.excludeArchived] - Whether to exclude archived proofs.
@@ -159,6 +159,7 @@ declare class Dashboard extends API {
159
159
  * @param {number} [options.page=1] The page number (only used with useAzureSearch)
160
160
  * @param {number} [options.pageSize] Optional page size (only used with useAzureSearch)
161
161
  * @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
162
+ * @param {Array<object>} [options.roleFilters] Role filters, e.g. [{role: 'approver', user: {userId}}] (Azure Search only)
162
163
  * @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
163
164
  */
164
165
  search(query: string, options?: {
@@ -167,6 +168,7 @@ declare class Dashboard extends API {
167
168
  page: number;
168
169
  pageSize: number;
169
170
  useAzureSearch: boolean;
171
+ roleFilters: Array<object>;
170
172
  }): Promise<{
171
173
  proofs: Array<Proof>;
172
174
  totalCount: number;
@@ -35,30 +35,6 @@ declare class Users extends API {
35
35
  * @returns {Promise}
36
36
  */
37
37
  requestRoleAccess(requestedRoleAccess: string, requestedPageName: string): Promise<any>;
38
- /**
39
- * Returns the public URL for a user's avatar.
40
- *
41
- * The avatar service is unauthenticated and serves a JPEG when the user has uploaded
42
- * an avatar, or a generic SVG placeholder when they haven't. Use this helper to render
43
- * avatars in `<img>` tags. Pair with `user.hasAvatar` if you want to skip the request
44
- * for users with no uploaded avatar.
45
- *
46
- * @example
47
- * const url = client.users.avatarUrl('U0F4R3L41F8WT57X', { size: 64 });
48
- * // => "https://avatar.pageproof.com/-/U0F4R3L41F8WT57X?size=64"
49
- *
50
- * @example <caption>By email</caption>
51
- * const url = client.users.avatarUrl('user@example.com', { size: 120 });
52
- *
53
- * @since v2.27.0
54
- * @param {string} idOrEmail The user's id (preferred) or email address
55
- * @param {object} [options]
56
- * @param {number} [options.size] Requested pixel size; server snaps to nearest bucket
57
- * @returns {string}
58
- */
59
- avatarUrl(idOrEmail: string, { size }?: {
60
- size: number;
61
- }): string;
62
38
  }
63
39
  import API from "./API";
64
40
  import User from "../models/User";
package/lib/api/Users.js CHANGED
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _User=require("../models/User");var _User2=_interopRequireDefault(_User);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 transformResponseUser(response){return response.data.length>0?(new _User2.default).fromUser(response.data[0]):(new _User2.default).fromUser(response.data)}function transformResponseUserArray(response){if(response.data.length){return(new _User2.default).fromUser(response.data[0])}return null}var Users=function(_API){_inherits(Users,_API);function Users(){_classCallCheck(this,Users);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Users.prototype.byEmail=function byEmail(email){return this.client.request("users.by-email",{email:email}).then(transformResponseUserArray)};Users.prototype.byId=function byId(userId){return this.client.request("users.by-id",{userId:userId}).then(transformResponseUser)};Users.prototype.invite=function invite(email){return this.client.request("users.invite",{email:email}).then(transformResponseUser)};Users.prototype.requestRoleAccess=function requestRoleAccess(requestedRoleAccess,requestedPageName){return this.client.request("users.request-role-access",{requestedRoleAccess:requestedRoleAccess,requestedPageName:requestedPageName})};Users.prototype.avatarUrl=function avatarUrl(idOrEmail){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},size=_ref.size;var endpoint=this.client.options.avatarEndpoint||"https://avatar.pageproof.com";var host=endpoint.replace(/\/+$/,"");var query=size?"?size="+size:"";return host+"/-/"+encodeURIComponent(idOrEmail)+query};return Users}(_API3.default);exports.default=Users;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _User=require("../models/User");var _User2=_interopRequireDefault(_User);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 transformResponseUser(response){return response.data.length>0?(new _User2.default).fromUser(response.data[0]):(new _User2.default).fromUser(response.data)}function transformResponseUserArray(response){if(response.data.length){return(new _User2.default).fromUser(response.data[0])}return null}var Users=function(_API){_inherits(Users,_API);function Users(){_classCallCheck(this,Users);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Users.prototype.byEmail=function byEmail(email){return this.client.request("users.by-email",{email:email}).then(transformResponseUserArray)};Users.prototype.byId=function byId(userId){return this.client.request("users.by-id",{userId:userId}).then(transformResponseUser)};Users.prototype.invite=function invite(email){return this.client.request("users.invite",{email:email}).then(transformResponseUser)};Users.prototype.requestRoleAccess=function requestRoleAccess(requestedRoleAccess,requestedPageName){return this.client.request("users.request-role-access",{requestedRoleAccess:requestedRoleAccess,requestedPageName:requestedPageName})};return Users}(_API3.default);exports.default=Users;
@@ -78,7 +78,7 @@ declare class TeamDashboard extends API {
78
78
  /** Search function for team dashboard proofs using Spider GraphQL
79
79
  * @param {object} [params] - The parameters for the search.
80
80
  * @param {string} [params.query] - The search query text.
81
- * @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
81
+ * @param {object} [params.filters] - Filter object containing status, dateFilters, excludeArchived and roleFilters.
82
82
  * @param {Array<number>} [params.filters.status] - Array of status numbers to filter by.
83
83
  * @param {object} [params.filters.dateFilters] - Date filters object.
84
84
  * @param {boolean} [params.filters.excludeArchived] - Whether to exclude archived proofs.
@@ -194,6 +194,7 @@ declare class TeamDashboard extends API {
194
194
  * @param {number} [options.page=1] The page number for team dashboard
195
195
  * @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
196
196
  * @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
197
+ * @param {Array<object>} [options.roleFilters] Role filters, e.g. [{role: 'approver', user: {userId}}] (Azure Search only)
197
198
  * @returns {Promise<TeamDashboardPagination>}
198
199
  */
199
200
  search(query: string, options?: {
@@ -202,6 +203,7 @@ declare class TeamDashboard extends API {
202
203
  page: number;
203
204
  pageSize: number;
204
205
  useAzureSearch: boolean;
206
+ roleFilters: Array<object>;
205
207
  }): Promise<TeamDashboardPagination>;
206
208
  /** @private */
207
209
  private _loadTeamSearchProofs;
@@ -187,7 +187,7 @@ var TeamDashboard = function (_API) {
187
187
  /** Search function for team dashboard proofs using Spider GraphQL
188
188
  * @param {object} [params] - The parameters for the search.
189
189
  * @param {string} [params.query] - The search query text.
190
- * @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
190
+ * @param {object} [params.filters] - Filter object containing status, dateFilters, excludeArchived and roleFilters.
191
191
  * @param {Array<number>} [params.filters.status] - Array of status numbers to filter by.
192
192
  * @param {object} [params.filters.dateFilters] - Date filters object.
193
193
  * @param {boolean} [params.filters.excludeArchived] - Whether to exclude archived proofs.
@@ -365,6 +365,7 @@ var TeamDashboard = function (_API) {
365
365
  * @param {number} [options.page=1] The page number for team dashboard
366
366
  * @param {number} [options.pageSize] Optional page size (defaults to TEAM_DASHBOARD_PROOFS_PER_PAGE)
367
367
  * @param {boolean} [options.useAzureSearch] Whether to use Azure Search (Spider) instead of legacy API
368
+ * @param {Array<object>} [options.roleFilters] Role filters, e.g. [{role: 'approver', user: {userId}}] (Azure Search only)
368
369
  * @returns {Promise<TeamDashboardPagination>}
369
370
  */
370
371
 
@@ -71,6 +71,7 @@ declare class TeamFeatures extends API {
71
71
  * @param {boolean} options.general.enableCelebrations Whether celebrations are enabled for the team.
72
72
  * @param {boolean} options.proofs.enableProofSoftDeletion Whether the scheduled deletion feature is enabled for the team.
73
73
  * @param {boolean} options.general.enableLabels Whether labels are enabled for the team.
74
+ * @param {boolean} options.general.enableBulkNewVersions Whether the bulk upload new version feature is enabled (enterprise only).
74
75
  * @returns {Promise}
75
76
  */
76
77
  update({ emails, comments, proofs, workflows, addressBook, userGroups, webhooks, intelligence, general, }: {
@@ -109,6 +109,7 @@ var TeamFeatures = function (_API) {
109
109
  * @param {boolean} options.general.enableCelebrations Whether celebrations are enabled for the team.
110
110
  * @param {boolean} options.proofs.enableProofSoftDeletion Whether the scheduled deletion feature is enabled for the team.
111
111
  * @param {boolean} options.general.enableLabels Whether labels are enabled for the team.
112
+ * @param {boolean} options.general.enableBulkNewVersions Whether the bulk upload new version feature is enabled (enterprise only).
112
113
  * @returns {Promise}
113
114
  */
114
115
 
@@ -171,6 +172,7 @@ var TeamFeatures = function (_API) {
171
172
  var reauthentication = proofs && proofs.reauthentication;
172
173
  var enableProofSoftDeletion = proofs && proofs.enableProofSoftDeletion;
173
174
  var enableLabels = general && general.enableLabels;
175
+ var enableBulkNewVersions = general && general.enableBulkNewVersions;
174
176
  return this.client.request('admin.team.features.update', {
175
177
  displayComments: displayComments,
176
178
  displayTeamName: displayTeamName,
@@ -194,6 +196,7 @@ var TeamFeatures = function (_API) {
194
196
  messageToOwners: messageToOwners,
195
197
  allowedDecisions: allowedDecisions,
196
198
  enableChecklists: enableChecklists,
199
+ enableBulkNewVersions: enableBulkNewVersions,
197
200
  enableProofMagicAccess: enableProofMagicAccess,
198
201
  defaultGifOutput: defaultGifOutput,
199
202
  enableIntelligence: enableIntelligence,
@@ -1,17 +1,8 @@
1
1
  export default PageProof;
2
2
  declare class PageProof {
3
- /**
4
- * @param {object} [config]
5
- * @param {object} [config.options] Client options passed to the request layer and APIs.
6
- * @param {string} [config.options.avatarEndpoint] Base URL for the public avatar CDN (default `https://avatar.pageproof.com`).
7
- * Override in non-production environments when your app already knows the avatar host (for example from `AVATAR_URL`).
8
- * @param {Array} [config.adapters] Registered adapters (request, crypto, etc.).
9
- */
10
3
  constructor({ options, adapters, }?: {
11
- options: {
12
- avatarEndpoint: string;
13
- };
14
- adapters: Array;
4
+ options?: {};
5
+ adapters?: any[];
15
6
  });
16
7
  /** @private */
17
8
  private events;
@@ -36,6 +36,12 @@ declare class ProofChecklist {
36
36
  * @type {boolean}
37
37
  */
38
38
  shouldOpenOnProofLoad: boolean;
39
+ /**
40
+ * Whether the checklist has been completed.
41
+ *
42
+ * @type {boolean}
43
+ */
44
+ isComplete: boolean;
39
45
  /**
40
46
  * @private
41
47
  * @param {object} data The ProofChecklist data
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var ProofChecklistSchema={id:"Id",templateId:"TemplateId",name:"Name",description:"Description",isRequiredForFinalApproval:"IsRequiredForFinalApproval",shouldOpenOnProofLoad:"ShouldOpenOnProofLoad"};var ProofChecklist=function(){function ProofChecklist(){_classCallCheck(this,ProofChecklist)}ProofChecklist.prototype.fromProofChecklist=function fromProofChecklist(data){(0,_transform2.default)(this,ProofChecklistSchema,data);return this};return ProofChecklist}();exports.default=ProofChecklist;
1
+ "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var ProofChecklistSchema={id:"Id",templateId:"TemplateId",name:"Name",description:"Description",isRequiredForFinalApproval:"IsRequiredForFinalApproval",shouldOpenOnProofLoad:"ShouldOpenOnProofLoad",isComplete:"IsComplete"};var ProofChecklist=function(){function ProofChecklist(){_classCallCheck(this,ProofChecklist)}ProofChecklist.prototype.fromProofChecklist=function fromProofChecklist(data){(0,_transform2.default)(this,ProofChecklistSchema,data);return this};return ProofChecklist}();exports.default=ProofChecklist;
@@ -18,6 +18,12 @@ declare class TeamGeneralFeatures {
18
18
  * @type {boolean}
19
19
  */
20
20
  enableLabels: boolean;
21
+ /**
22
+ * Whether the bulk upload new version feature is enabled (enterprise only).
23
+ *
24
+ * @type {boolean}
25
+ */
26
+ enableBulkNewVersions: boolean;
21
27
  /** @private */
22
28
  private fromTeamGeneralFeatures;
23
29
  }
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var TeamGeneralFeaturesSchema={enableCelebrations:"EnableCelebrations",licenseLabels:"LicenseLabels",enableLabels:"EnableLabels"};var TeamGeneralFeatures=function(){function TeamGeneralFeatures(){_classCallCheck(this,TeamGeneralFeatures)}TeamGeneralFeatures.prototype.fromTeamGeneralFeatures=function fromTeamGeneralFeatures(teamGeneralFeaturesData){(0,_transform2.default)(this,TeamGeneralFeaturesSchema,teamGeneralFeaturesData);return this};return TeamGeneralFeatures}();exports.default=TeamGeneralFeatures;
1
+ "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var TeamGeneralFeaturesSchema={enableCelebrations:"EnableCelebrations",licenseLabels:"LicenseLabels",enableLabels:"EnableLabels",enableBulkNewVersions:"EnableBulkNewVersions"};var TeamGeneralFeatures=function(){function TeamGeneralFeatures(){_classCallCheck(this,TeamGeneralFeatures)}TeamGeneralFeatures.prototype.fromTeamGeneralFeatures=function fromTeamGeneralFeatures(teamGeneralFeaturesData){(0,_transform2.default)(this,TeamGeneralFeaturesSchema,teamGeneralFeaturesData);return this};return TeamGeneralFeatures}();exports.default=TeamGeneralFeatures;
@@ -921,7 +921,7 @@
921
921
  "version": 2,
922
922
  "method": "POST",
923
923
  "path": "/api/admin/settings",
924
- "body": ["displayComments", "generalComments", "privateComments", "enableWebhooks", "editComments", "ownerCanDeleteComments", "proofReference", "proofReferenceRequired", "displayTeamName", "emailTitleTextColor", "emailLinkTextColor", "emailButtonBackgroundColor", "emailButtonTextColor", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners", "allowedDecisions", "enableChecklists", "suggestionsIncludeTeamMembers", "enableUserGroups", "enableCommentVisibility", "defaultCommentVisibility", "usePreviousVersionDueDate", "enableViewOnlyReviewers", "enableIntelligence", "licenseIntelligenceInsightsInProofing", "enableIntelligenceInsightsInProofing", "defaultIntelligenceInsightsInProofing", "enableIntelligenceInsightsTeamOnlyVisibility", "enableIntelligenceInsightsCommentsInProofing", "defaultIntelligenceInsightsCommentsInProofing", "licenseIntelligenceInsightsOnDashboard", "defaultIntelligenceInsightsCommentsOnDashboard", "enableIntelligenceInsightsOnDashboard", "licenseIntelligenceInsightsInReports", "enableIntelligenceInsightsInReports", "enableIntelligenceSmartTags", "enableProofMagicAccess", "enableIntelligenceSmartCheckCr", "defaultGifOutput", "enableCelebrations", "licenseDigitalVerification", "enableDigitalVerification", "defaultDigitalVerification", "reauthentication", "enableProofSoftDeletion", "enableLabels"]
924
+ "body": ["displayComments", "generalComments", "privateComments", "enableWebhooks", "editComments", "ownerCanDeleteComments", "proofReference", "proofReferenceRequired", "displayTeamName", "emailTitleTextColor", "emailLinkTextColor", "emailButtonBackgroundColor", "emailButtonTextColor", "disableReplyingToCommentsInStatuses", "publicProofs", "defaultProofIsPublic", "messageToOwners", "allowedDecisions", "enableChecklists", "enableBulkNewVersions", "suggestionsIncludeTeamMembers", "enableUserGroups", "enableCommentVisibility", "defaultCommentVisibility", "usePreviousVersionDueDate", "enableViewOnlyReviewers", "enableIntelligence", "licenseIntelligenceInsightsInProofing", "enableIntelligenceInsightsInProofing", "defaultIntelligenceInsightsInProofing", "enableIntelligenceInsightsTeamOnlyVisibility", "enableIntelligenceInsightsCommentsInProofing", "defaultIntelligenceInsightsCommentsInProofing", "licenseIntelligenceInsightsOnDashboard", "defaultIntelligenceInsightsCommentsOnDashboard", "enableIntelligenceInsightsOnDashboard", "licenseIntelligenceInsightsInReports", "enableIntelligenceInsightsInReports", "enableIntelligenceSmartTags", "enableProofMagicAccess", "enableIntelligenceSmartCheckCr", "defaultGifOutput", "enableCelebrations", "licenseDigitalVerification", "enableDigitalVerification", "defaultDigitalVerification", "reauthentication", "enableProofSoftDeletion", "enableLabels"]
925
925
  },
926
926
  "admin.team.features.sender-email.set": {
927
927
  "version": 2,