@pageproof/sdk-pr 734.0.1791486912299 → 736.0.1791868308318
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 +11 -0
- package/lib/api/Users.d.ts +24 -0
- package/lib/api/Users.js +1 -1
- package/lib/api/admin/TeamFeatures.d.ts +0 -1
- package/lib/api/admin/TeamFeatures.js +0 -3
- package/lib/core/PageProof.d.ts +11 -2
- package/lib/models/TeamGeneralFeatures.d.ts +0 -6
- package/lib/models/TeamGeneralFeatures.js +1 -1
- package/lib/network/endpoints.json +1 -1
- package/lib/pageproof.js +1 -1
- package/lib/util/dashboardSearchShared.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -336,6 +336,17 @@ 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
|
+
|
|
339
350
|
There's also a list of APIs in the docs sidebar, under the section "api".
|
|
340
351
|
|
|
341
352
|
### Authenticating as a user/logging in
|
package/lib/api/Users.d.ts
CHANGED
|
@@ -35,6 +35,30 @@ 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;
|
|
38
62
|
}
|
|
39
63
|
import API from "./API";
|
|
40
64
|
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})};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})};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;
|
|
@@ -71,7 +71,6 @@ 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).
|
|
75
74
|
* @returns {Promise}
|
|
76
75
|
*/
|
|
77
76
|
update({ emails, comments, proofs, workflows, addressBook, userGroups, webhooks, intelligence, general, }: {
|
|
@@ -109,7 +109,6 @@ 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).
|
|
113
112
|
* @returns {Promise}
|
|
114
113
|
*/
|
|
115
114
|
|
|
@@ -172,7 +171,6 @@ var TeamFeatures = function (_API) {
|
|
|
172
171
|
var reauthentication = proofs && proofs.reauthentication;
|
|
173
172
|
var enableProofSoftDeletion = proofs && proofs.enableProofSoftDeletion;
|
|
174
173
|
var enableLabels = general && general.enableLabels;
|
|
175
|
-
var enableBulkNewVersions = general && general.enableBulkNewVersions;
|
|
176
174
|
return this.client.request('admin.team.features.update', {
|
|
177
175
|
displayComments: displayComments,
|
|
178
176
|
displayTeamName: displayTeamName,
|
|
@@ -196,7 +194,6 @@ var TeamFeatures = function (_API) {
|
|
|
196
194
|
messageToOwners: messageToOwners,
|
|
197
195
|
allowedDecisions: allowedDecisions,
|
|
198
196
|
enableChecklists: enableChecklists,
|
|
199
|
-
enableBulkNewVersions: enableBulkNewVersions,
|
|
200
197
|
enableProofMagicAccess: enableProofMagicAccess,
|
|
201
198
|
defaultGifOutput: defaultGifOutput,
|
|
202
199
|
enableIntelligence: enableIntelligence,
|
package/lib/core/PageProof.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
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
|
+
*/
|
|
3
10
|
constructor({ options, adapters, }?: {
|
|
4
|
-
options
|
|
5
|
-
|
|
11
|
+
options: {
|
|
12
|
+
avatarEndpoint: string;
|
|
13
|
+
};
|
|
14
|
+
adapters: Array;
|
|
6
15
|
});
|
|
7
16
|
/** @private */
|
|
8
17
|
private events;
|
|
@@ -18,12 +18,6 @@ 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;
|
|
27
21
|
/** @private */
|
|
28
22
|
private fromTeamGeneralFeatures;
|
|
29
23
|
}
|
|
@@ -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"
|
|
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;
|
|
@@ -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", "
|
|
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"]
|
|
925
925
|
},
|
|
926
926
|
"admin.team.features.sender-email.set": {
|
|
927
927
|
"version": 2,
|