@pageproof/sdk-pr 696.0.1778852270802 → 697.0.1779117125982

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 CHANGED
@@ -1,10 +1,3 @@
1
- ## 2.19.0
2
-
3
- Released on the 15th of May 2026.
4
-
5
- - [[PP-10284](https://pageproof.atlassian.net/browse/PP-10284)] Added `Users.avatarUrl(idOrEmail, options)` to build public avatar CDN URLs for `<img src>`, and optional client option `options.avatarEndpoint` to point at non-production avatar hosts.
6
-
7
-
8
1
  ## 2.18.0
9
2
 
10
3
  Released on the 8th of May 2026.
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
@@ -1,4 +1,5 @@
1
1
  export default Comments;
2
+ export type CommentState = "done" | "todo" | "unmarked";
2
3
  declare class Comments extends API {
3
4
  /** @private */
4
5
  private constructor();
@@ -21,15 +22,7 @@ declare class Comments extends API {
21
22
  * @param {CommentState} state The comment mark type (otherwise known as the "state")
22
23
  * @returns {Promise<CommentState>}
23
24
  */
24
- mark(commentId: string, state: {
25
- TODO: string;
26
- DONE: string;
27
- UNMARKED: string;
28
- }): Promise<{
29
- TODO: string;
30
- DONE: string;
31
- UNMARKED: string;
32
- }>;
25
+ mark(commentId: string, state: CommentState): Promise<CommentState>;
33
26
  /**
34
27
  * Unmarks a comment as to-do or done.
35
28
  *
@@ -39,15 +32,7 @@ declare class Comments extends API {
39
32
  * @param {CommentState} state The comment mark type (otherwise known as the "state")
40
33
  * @returns {Promise<CommentState>}
41
34
  */
42
- unmark(commentId: string, state: {
43
- TODO: string;
44
- DONE: string;
45
- UNMARKED: string;
46
- }): Promise<{
47
- TODO: string;
48
- DONE: string;
49
- UNMARKED: string;
50
- }>;
35
+ unmark(commentId: string, state: CommentState): Promise<CommentState>;
51
36
  /**
52
37
  * Mark comments as to-do or done.
53
38
  *
@@ -58,11 +43,7 @@ declare class Comments extends API {
58
43
  * @param {CommentState} state The comment mark type (otherwise known as the "state")
59
44
  * @returns {Promise<Array<{CommentId, CommentState}>>}
60
45
  */
61
- markAll(proofId: string, commentIds: Array<string>, state: {
62
- TODO: string;
63
- DONE: string;
64
- UNMARKED: string;
65
- }): Promise<Array<{
46
+ markAll(proofId: string, commentIds: Array<string>, state: CommentState): Promise<Array<{
66
47
  CommentId;
67
48
  CommentState;
68
49
  }>>;
@@ -76,11 +57,7 @@ declare class Comments extends API {
76
57
  * @param {CommentState} state The comment mark type (otherwise known as the "state")
77
58
  * @returns {Promise<Array<{CommentId, CommentState}>>}
78
59
  */
79
- unmarkAll(proofId: string, commentIds: Array<string>, state: {
80
- TODO: string;
81
- DONE: string;
82
- UNMARKED: string;
83
- }): Promise<Array<{
60
+ unmarkAll(proofId: string, commentIds: Array<string>, state: CommentState): Promise<Array<{
84
61
  CommentId;
85
62
  CommentState;
86
63
  }>>;
@@ -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.19.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 host=this.client.options.avatarEndpoint||"https://avatar.pageproof.com";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;
@@ -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;
@@ -1,6 +1,18 @@
1
1
  export default CommentState;
2
- declare namespace CommentState {
3
- export const TODO: string;
4
- export const DONE: string;
5
- export const UNMARKED: string;
6
- }
2
+ /**
3
+ * A comment's state value. Used wherever the SDK accepts or returns a comment
4
+ * state (eg. `client.comments.mark`, `client.comments.unmark`).
5
+ */
6
+ export type CommentState = "done" | "todo" | "unmarked";
7
+ /**
8
+ * A comment's state value. Used wherever the SDK accepts or returns a comment
9
+ * state (eg. `client.comments.mark`, `client.comments.unmark`).
10
+ *
11
+ * @typedef {('todo' | 'done' | 'unmarked')} CommentState
12
+ */
13
+ /** @type {{TODO: CommentState, DONE: CommentState, UNMARKED: CommentState}} */
14
+ declare const CommentState: {
15
+ TODO: CommentState;
16
+ DONE: CommentState;
17
+ UNMARKED: CommentState;
18
+ };