@pageproof/sdk-pr 735.0.1791842962674 → 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/Dashboard.d.ts +1 -3
- package/lib/api/Users.d.ts +24 -0
- package/lib/api/Users.js +1 -1
- package/lib/api/admin/TeamDashboard.d.ts +1 -3
- package/lib/api/admin/TeamDashboard.js +1 -2
- package/lib/core/PageProof.d.ts +11 -2
- package/lib/pageproof.js +1 -1
- package/lib/util/dashboardSearchShared.d.ts +0 -10
- 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/Dashboard.d.ts
CHANGED
|
@@ -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,
|
|
108
|
+
* @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
|
|
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,7 +159,6 @@ 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)
|
|
163
162
|
* @returns {Promise<{proofs: Array<Proof>, totalCount: number}|Array<Proof>>}
|
|
164
163
|
*/
|
|
165
164
|
search(query: string, options?: {
|
|
@@ -168,7 +167,6 @@ declare class Dashboard extends API {
|
|
|
168
167
|
page: number;
|
|
169
168
|
pageSize: number;
|
|
170
169
|
useAzureSearch: boolean;
|
|
171
|
-
roleFilters: Array<object>;
|
|
172
170
|
}): Promise<{
|
|
173
171
|
proofs: Array<Proof>;
|
|
174
172
|
totalCount: number;
|
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;
|
|
@@ -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,
|
|
81
|
+
* @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
|
|
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,7 +194,6 @@ 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)
|
|
198
197
|
* @returns {Promise<TeamDashboardPagination>}
|
|
199
198
|
*/
|
|
200
199
|
search(query: string, options?: {
|
|
@@ -203,7 +202,6 @@ declare class TeamDashboard extends API {
|
|
|
203
202
|
page: number;
|
|
204
203
|
pageSize: number;
|
|
205
204
|
useAzureSearch: boolean;
|
|
206
|
-
roleFilters: Array<object>;
|
|
207
205
|
}): Promise<TeamDashboardPagination>;
|
|
208
206
|
/** @private */
|
|
209
207
|
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,
|
|
190
|
+
* @param {object} [params.filters] - Filter object containing status, dateFilters, and excludeArchived.
|
|
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,7 +365,6 @@ 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)
|
|
369
368
|
* @returns {Promise<TeamDashboardPagination>}
|
|
370
369
|
*/
|
|
371
370
|
|
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;
|