@pageproof/sdk-pr 481.0.1683171051464 → 482.0.1681792530640

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pageproof/sdk-pr",
3
3
  "description": "The official PageProof SDK",
4
- "version": "481.0.1683171051464",
4
+ "version": "482.0.1681792530640",
5
5
  "main": "lib/index.js",
6
6
  "browser": "lib/pageproof.js",
7
7
  "dependencies": {
@@ -1,59 +0,0 @@
1
- export default CommentsImport;
2
- declare class CommentsImport extends API {
3
- constructor(client: any);
4
- /**
5
- * Creates a new task for importing comments.
6
- *
7
- * @private
8
- * @param {object} options The options for the task
9
- * @returns {Promise<{ task: CommentImport; uploadRequest: object }>}
10
- */
11
- _createTask(options: any): Promise<{
12
- task: CommentImport;
13
- uploadRequest: any;
14
- }>;
15
- /**
16
- * Starts a comment import task.
17
- *
18
- * @private
19
- * @param {string} id The task ID.
20
- * @param {object} options The options for the task
21
- * @returns {Promise<CommentImport>}
22
- */
23
- _startTask(id: string, options: any): Promise<CommentImport>;
24
- /**
25
- * Creates a comment import from a file (currently PDF files are the only ones supported).
26
- *
27
- * @param {File|Blob|Buffer} file The file/file contents to import comments from.
28
- * @param {object} options The options for the task.
29
- * @param {string} options.proofId The proof id.
30
- * @param {string} options.fileName The name of the file.
31
- * @param {boolean} [options.skipPreviouslyImported] Whether comments that have been previously imported from the same file should be skipped.
32
- * @param {boolean} [options.includeStatuses] Whether comments statuses should be set based on the comment statuses in the file.
33
- * @param {boolean} [options.isPrivate] Whether comments should be created as private.
34
- * @param {function} [progressCallback] The upload progress callback. The first argument is a number between 0 and 100, correlating to the percentage of the upload.
35
- * @returns {Promise<CommentImport>}
36
- */
37
- fromFile(file: Blob | File | Buffer, options: {
38
- proofId: string;
39
- fileName: string;
40
- skipPreviouslyImported?: boolean;
41
- includeStatuses?: boolean;
42
- isPrivate?: boolean;
43
- }, progressCallback?: Function): Promise<CommentImport>;
44
- /**
45
- * Gets information about a comment import.
46
- *
47
- * @param {string} id The import ID.
48
- * @returns {Promise<CommentImport>}
49
- */
50
- info(id: string): Promise<CommentImport>;
51
- /**
52
- * Cancels a comment import
53
- *
54
- * @param {string} id The import ID.
55
- * @returns {Promise<CommentImport>}
56
- */
57
- cancel(id: string): Promise<CommentImport>;
58
- }
59
- import API from "./API";
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _whatwgURL=require("../util/whatwgURL");var _whatwgURL2=_interopRequireDefault(_whatwgURL);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i]}return target}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 CommentsImport=function(_API){_inherits(CommentsImport,_API);function CommentsImport(){_classCallCheck(this,CommentsImport);return _possibleConstructorReturn(this,_API.apply(this,arguments))}CommentsImport.prototype._createTask=function _createTask(options){return this.client.request("comments.import.create-task",{options:options}).then(function(response){return response.data})};CommentsImport.prototype._startTask=function _startTask(id,options){return this.client.request("comments.import.action-task",{id:id,options:options,action:"start"}).then(function(response){return response.data.task})};CommentsImport.prototype.fromFile=function fromFile(file,options,progressCallback){var _this2=this;var proofId=options.proofId,fileName=options.fileName,startTaskOptions=_objectWithoutProperties(options,["proofId","fileName"]);return this._createTask({type:"pdf",proofId:proofId,fileName:fileName}).then(function(_ref){var task=_ref.task,uploadRequest=_ref.uploadRequest;return _this2.client.rawRequest({url:new _whatwgURL2.default(uploadRequest.url),method:uploadRequest.method,headers:uploadRequest.headers,body:file},{onUploadProgress:progressCallback}).then(function(){return task})}).then(function(task){return _this2._startTask(task.id,startTaskOptions)})};CommentsImport.prototype.info=function info(id){return this.client.request("comments.import.get-task",{id:id}).then(function(response){return response.data.task})};CommentsImport.prototype.cancel=function cancel(id){return this.client.request("comments.import.action-task",{id:id,action:"cancel"}).then(function(response){return response.data.task})};return CommentsImport}(_API3.default);exports.default=CommentsImport;
@@ -1,81 +0,0 @@
1
- /**
2
- * Information about a comment import
3
- */
4
- type CommentImport = {
5
- /**
6
- * The import id
7
- */
8
- id: string;
9
- /**
10
- * The type of import
11
- */
12
- type: string;
13
- /**
14
- * The name of the file that is being imported
15
- */
16
- fileName: string;
17
- /**
18
- * The status of the import
19
- */
20
- status: string;
21
- /**
22
- * A user friendly message about the status of the import
23
- */
24
- statusMessage: string;
25
- /**
26
- * A summary of the import
27
- */
28
- summary: CommentImportSummary;
29
- /**
30
- * The options used for the import
31
- */
32
- options: any;
33
- /**
34
- * A user friendly message about the progress of the import
35
- */
36
- progressMessage: string;
37
- /**
38
- * The percentage of the import that has been completed
39
- */
40
- progressPercentage: string;
41
- /**
42
- * The date the import was initiated
43
- */
44
- createdDate: string;
45
- };
46
- type CommentImportSummary = {
47
- /**
48
- * Numbers of each type of comment imported
49
- */
50
- importedComments: CommentImportSummaryImportedComments;
51
- /**
52
- * The number of comments that were skipped
53
- */
54
- skippedComments: number;
55
- };
56
- type CommentImportSummaryImportedComments = {
57
- /**
58
- * The total number of comments imported
59
- */
60
- total: number;
61
- /**
62
- * The number of comments imported
63
- */
64
- comments: number;
65
- /**
66
- * The number of replies imported
67
- */
68
- replies: number;
69
- /**
70
- * The number of comments imported marked as todo
71
- */
72
- todo: number;
73
- /**
74
- * The number of comments imported unmarked
75
- */
76
- unmarked: number;
77
- /**
78
- * The number of comments imported marked as done
79
- */
80
- done: number;
81
- };
@@ -1 +0,0 @@
1
- "use strict";