@pageproof/sdk-pr 96.0.1532919041916 → 97.0.1532385132287

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,30 +1,5 @@
1
1
  # Changelog
2
2
 
3
- ## 2.0.0-beta.49
4
-
5
- Released on the 30th of July 2018.
6
-
7
- - [[#96](https://github.com/PageProofCom/sdk/pull/96)] Adds the ability to request access to a proof you have not yet been invited to. See [Proofs.requestAccess](http://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-method-requestAccess).
8
-
9
- ## 2.0.0-beta.48
10
-
11
- Released on the 30th of July 2018.
12
-
13
- - [[#99](https://github.com/PageProofCom/sdk/pull/99)] Adds support for special characters in filenames uploaded through the SDK. And adds support for a `onFileDetails` callback option when downloading files - this option provides you details about the file about to be downloaded (like filename, what it's assigned to, etc...). See [Files.upload](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Files.js~Files.html#instance-method-upload) and [Files.download](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Files.js~Files.html#instance-method-download).
14
-
15
- ## 2.0.0-beta.47
16
-
17
- Released on the 30th of July 2018.
18
-
19
- - [[#92](https://github.com/PageProofCom/sdk/pull/92)] Support for loading active proof groups (known as "Collections"). See [DashboardGroups.current](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/DashboardGroups.js~DashboardGroups.html).
20
-
21
-
22
- ## 2.0.0-beta.46
23
-
24
- Released on the 27th of July 2018.
25
-
26
- - [[#94](https://github.com/PageProofCom/sdk/pull/94)] Support for creating comments and replies (`Comments.create`), parsing `@everyone` and `@all` mentions in comments, as well as some new options that can be used to help throttle how often callbacks are invoked (`onDecryptComments` and `onDecryptCommentsThrottleMs`) when decrypting comments, and catching decryption failures (`onDecryptError`). See [Comments.create](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Comments.js~Comments.html#instance-method-create) and [Comments.load](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Comments.js~Comments.html#instance-method-load).
27
-
28
3
  ## 2.0.0-beta.45
29
4
 
30
5
  Released on the 5th of July 2018.
package/README.md CHANGED
@@ -256,7 +256,6 @@ Name | Namespace | Description | Admin-only | Stability
256
256
  [Accounts SSO API](./class/src/api/AccountsSSO.js~AccountsSSO.html) | `accounts.sso` | Used to login using a SSO provider. | No | Experimental
257
257
  [Comments API](./class/src/api/Comments.js~Comments.html) | `comments` | Used to load comments. | No | Stable
258
258
  [Dashboard API](./class/src/api/Dashboard.js~Dashboard.html) | `dashboard` | Used to load the authenticated user's dashboard & search for/filter proofs. | No | Stable
259
- [Dashboard Groups API](./class/src/api/DashboardGroups.js~DashboardGroups.html) | `dashboard.groups` | Used to load proof groups | No | Experimental
260
259
  [Files API](./class/src/api/Files.js~Files.html) | `files` | Used to upload & manage files. | No | Stable
261
260
  [Profile API](./class/src/api/Profile.js~Profile.html) | `profile` | Manage your account details. | No | Experimental
262
261
  [Proofs API](./class/src/api/Proofs.js~Proofs.html) | `proofs` | Used to create & manage proofs. | No | Stable
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _class,_temp;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function notImplementedStub(name){return new Error(name+" is not implemented on ICryptoAdapter.")}var ICryptoAdapter=(_temp=_class=function(){function ICryptoAdapter(){_classCallCheck(this,ICryptoAdapter)}ICryptoAdapter.prototype.decryptComment=function decryptComment(){throw notImplementedStub("decryptComment(comment$: string, envelope: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.decryptFileBlock=function decryptFileBlock(){throw notImplementedStub("decryptFileBlock(data$: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.decryptImage=function decryptImage(){throw notImplementedStub("decryptImage(data$: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.decryptPrivateKey=function decryptPrivateKey(){throw notImplementedStub("decryptPrivateKey(privateKey$: string, password: string): Promise<string>")};ICryptoAdapter.prototype.encryptFileBlock=function encryptFileBlock(){throw notImplementedStub("encryptFileBlock(keyIV: {key: string, iv: string}, fileBlockBase64: string): Promise<string>")};ICryptoAdapter.prototype.encryptPrivateKey=function encryptPrivateKey(){throw notImplementedStub("encryptPrivateKey(privateKeyPEM: string, password: string): Promise<string>")};ICryptoAdapter.prototype.envelopeSeal=function envelopeSeal(){throw notImplementedStub("envelopeSeal(secret: string, publicKeyPEMs: Array<string>): Promise<string>")};ICryptoAdapter.prototype.envelopeUnseal=function envelopeUnseal(){throw notImplementedStub("envelopeUnseal(envelope: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.generateAuthorizationHeaders=function generateAuthorizationHeaders(){throw notImplementedStub("generateAuthorizationHeaders(method: string, path: string, session: Session): Promise<Object<string, string>>")};ICryptoAdapter.prototype.generateKeyIV=function generateKeyIV(){throw notImplementedStub("generateKeyIV(): Promise<{KeyIV}>")};ICryptoAdapter.prototype.generateKeyPair=function generateKeyPair(){throw notImplementedStub("generateKeyPair(): Promise<{KeyPair}>")};ICryptoAdapter.prototype.generatePasswordHash=function generatePasswordHash(){throw notImplementedStub("generatePasswordHash(password: string): Promise<string>")};ICryptoAdapter.prototype.generateWrappedSymmetricKey=function generateWrappedSymmetricKey(){throw notImplementedStub("generateWrappedSymmetricKey(serverPublicKeyPEM: string): Promise<WrappedSymmetricKey>")};ICryptoAdapter.prototype.decryptManagedPrivateKey=function decryptManagedPrivateKey(){throw notImplementedStub("decryptManagedPrivateKey(privateKey$: string, keyBase64: string): Promise<string>")};ICryptoAdapter.prototype.encryptComment=function encryptComment(){throw notImplementedStub("encryptComment(comment: string, publicKeyPEMs: Array<string>): Promise<EncryptedComment>")};return ICryptoAdapter}(),_class.__adapter__="ICryptoAdapter",_temp);exports.default=ICryptoAdapter;
1
+ "use strict";exports.__esModule=true;var _class,_temp;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function notImplementedStub(name){return new Error(name+" is not implemented on ICryptoAdapter.")}var ICryptoAdapter=(_temp=_class=function(){function ICryptoAdapter(){_classCallCheck(this,ICryptoAdapter)}ICryptoAdapter.prototype.decryptComment=function decryptComment(){throw notImplementedStub("decryptComment(comment$: string, envelope: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.decryptFileBlock=function decryptFileBlock(){throw notImplementedStub("decryptFileBlock(data$: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.decryptImage=function decryptImage(){throw notImplementedStub("decryptImage(data$: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.decryptPrivateKey=function decryptPrivateKey(){throw notImplementedStub("decryptPrivateKey(privateKey$: string, password: string): Promise<string>")};ICryptoAdapter.prototype.encryptFileBlock=function encryptFileBlock(){throw notImplementedStub("encryptFileBlock(keyIV: {key: string, iv: string}, fileBlockBase64: string): Promise<string>")};ICryptoAdapter.prototype.encryptPrivateKey=function encryptPrivateKey(){throw notImplementedStub("encryptPrivateKey(privateKeyPEM: string, password: string): Promise<string>")};ICryptoAdapter.prototype.envelopeSeal=function envelopeSeal(){throw notImplementedStub("envelopeSeal(secret: string, publicKeyPEMs: Array<string>): Promise<string>")};ICryptoAdapter.prototype.envelopeUnseal=function envelopeUnseal(){throw notImplementedStub("envelopeUnseal(envelope: string, privateKeyPEM: string): Promise<string>")};ICryptoAdapter.prototype.generateAuthorizationHeaders=function generateAuthorizationHeaders(){throw notImplementedStub("generateAuthorizationHeaders(method: string, path: string, session: Session): Promise<Object<string, string>>")};ICryptoAdapter.prototype.generateKeyIV=function generateKeyIV(){throw notImplementedStub("generateKeyIV(): Promise<{KeyIV}>")};ICryptoAdapter.prototype.generateKeyPair=function generateKeyPair(){throw notImplementedStub("generateKeyPair(): Promise<{KeyPair}>")};ICryptoAdapter.prototype.generatePasswordHash=function generatePasswordHash(){throw notImplementedStub("generatePasswordHash(password: string): Promise<string>")};ICryptoAdapter.prototype.generateWrappedSymmetricKey=function generateWrappedSymmetricKey(){throw notImplementedStub("generateWrappedSymmetricKey(serverPublicKeyPEM: string): Promise<WrappedSymmetricKey>")};ICryptoAdapter.prototype.decryptManagedPrivateKey=function decryptManagedPrivateKey(){throw notImplementedStub("decryptManagedPrivateKey(privateKey$: string, keyBase64: string): Promise<string>")};return ICryptoAdapter}(),_class.__adapter__="ICryptoAdapter",_temp);exports.default=ICryptoAdapter;
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _Scheduler=require("../util/Scheduler");var _Scheduler2=_interopRequireDefault(_Scheduler);var _ICryptoAdapter2=require("./ICryptoAdapter");var _ICryptoAdapter3=_interopRequireDefault(_ICryptoAdapter2);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}var SchedulerCryptoAdapter=function(_ICryptoAdapter){_inherits(SchedulerCryptoAdapter,_ICryptoAdapter);function SchedulerCryptoAdapter(options){_classCallCheck(this,SchedulerCryptoAdapter);var _this=_possibleConstructorReturn(this,_ICryptoAdapter.call(this));_this.scheduler=new _Scheduler2.default(options);return _this}SchedulerCryptoAdapter.prototype.decryptComment=function decryptComment(comment$,envelope,privateKeyPEM){return this.scheduler.send({type:"decryptComment",args:[comment$,envelope,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptFileBlock=function decryptFileBlock(data$,privateKeyPEM){return this.scheduler.send({type:"decryptFileBlock",args:[data$,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptImage=function decryptImage(data$,privateKeyPEM){return this.scheduler.send({type:"decryptImage",args:[data$,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptPrivateKey=function decryptPrivateKey(privateKey$,password){return this.scheduler.send({type:"decryptPrivateKey",args:[privateKey$,password]})};SchedulerCryptoAdapter.prototype.encryptFileBlock=function encryptFileBlock(keyIV,fileBlockBase64){return this.scheduler.send({type:"encryptFileBlock",args:[keyIV,fileBlockBase64]})};SchedulerCryptoAdapter.prototype.encryptPrivateKey=function encryptPrivateKey(privateKeyPEM,password){return this.scheduler.send({type:"encryptPrivateKey",args:[privateKeyPEM,password]})};SchedulerCryptoAdapter.prototype.envelopeSeal=function envelopeSeal(secret,publicKeyPEMs){return this.scheduler.send({type:"envelopeSeal",args:[secret,publicKeyPEMs]})};SchedulerCryptoAdapter.prototype.envelopeUnseal=function envelopeUnseal(envelope,privateKeyPEM){return this.scheduler.send({type:"envelopeUnseal",args:[envelope,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.generateAuthorizationHeaders=function generateAuthorizationHeaders(method,path,session){return this.scheduler.send({type:"generateAuthorizationHeaders",args:[method,path,session]})};SchedulerCryptoAdapter.prototype.generateKeyIV=function generateKeyIV(){return this.scheduler.send({type:"generateKeyIV"})};SchedulerCryptoAdapter.prototype.generateKeyPair=function generateKeyPair(){return this.scheduler.send({type:"generateKeyPair"})};SchedulerCryptoAdapter.prototype.generatePasswordHash=function generatePasswordHash(password){return this.scheduler.send({type:"generatePasswordHash",args:[password]})};SchedulerCryptoAdapter.prototype.generateWrappedSymmetricKey=function generateWrappedSymmetricKey(serverPublicKeyPEM){return this.scheduler.send({type:"generateWrappedSymmetricKey",args:[serverPublicKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptManagedPrivateKey=function decryptManagedPrivateKey(privateKey$,keyBase64){return this.scheduler.send({type:"decryptManagedPrivateKey",args:[privateKey$,keyBase64]})};SchedulerCryptoAdapter.prototype.encryptComment=function encryptComment(comment,publicKeyPEMs){return this.scheduler.send({type:"encryptComment",args:[comment,publicKeyPEMs]})};return SchedulerCryptoAdapter}(_ICryptoAdapter3.default);exports.default=SchedulerCryptoAdapter;
1
+ "use strict";exports.__esModule=true;var _Scheduler=require("../util/Scheduler");var _Scheduler2=_interopRequireDefault(_Scheduler);var _ICryptoAdapter2=require("./ICryptoAdapter");var _ICryptoAdapter3=_interopRequireDefault(_ICryptoAdapter2);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}var SchedulerCryptoAdapter=function(_ICryptoAdapter){_inherits(SchedulerCryptoAdapter,_ICryptoAdapter);function SchedulerCryptoAdapter(options){_classCallCheck(this,SchedulerCryptoAdapter);var _this=_possibleConstructorReturn(this,_ICryptoAdapter.call(this));_this.scheduler=new _Scheduler2.default(options);return _this}SchedulerCryptoAdapter.prototype.decryptComment=function decryptComment(comment$,envelope,privateKeyPEM){return this.scheduler.send({type:"decryptComment",args:[comment$,envelope,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptFileBlock=function decryptFileBlock(data$,privateKeyPEM){return this.scheduler.send({type:"decryptFileBlock",args:[data$,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptImage=function decryptImage(data$,privateKeyPEM){return this.scheduler.send({type:"decryptImage",args:[data$,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptPrivateKey=function decryptPrivateKey(privateKey$,password){return this.scheduler.send({type:"decryptPrivateKey",args:[privateKey$,password]})};SchedulerCryptoAdapter.prototype.encryptFileBlock=function encryptFileBlock(keyIV,fileBlockBase64){return this.scheduler.send({type:"encryptFileBlock",args:[keyIV,fileBlockBase64]})};SchedulerCryptoAdapter.prototype.encryptPrivateKey=function encryptPrivateKey(privateKeyPEM,password){return this.scheduler.send({type:"encryptPrivateKey",args:[privateKeyPEM,password]})};SchedulerCryptoAdapter.prototype.envelopeSeal=function envelopeSeal(secret,publicKeyPEMs){return this.scheduler.send({type:"envelopeSeal",args:[secret,publicKeyPEMs]})};SchedulerCryptoAdapter.prototype.envelopeUnseal=function envelopeUnseal(envelope,privateKeyPEM){return this.scheduler.send({type:"envelopeUnseal",args:[envelope,privateKeyPEM]})};SchedulerCryptoAdapter.prototype.generateAuthorizationHeaders=function generateAuthorizationHeaders(method,path,session){return this.scheduler.send({type:"generateAuthorizationHeaders",args:[method,path,session]})};SchedulerCryptoAdapter.prototype.generateKeyIV=function generateKeyIV(){return this.scheduler.send({type:"generateKeyIV"})};SchedulerCryptoAdapter.prototype.generateKeyPair=function generateKeyPair(){return this.scheduler.send({type:"generateKeyPair"})};SchedulerCryptoAdapter.prototype.generatePasswordHash=function generatePasswordHash(password){return this.scheduler.send({type:"generatePasswordHash",args:[password]})};SchedulerCryptoAdapter.prototype.generateWrappedSymmetricKey=function generateWrappedSymmetricKey(serverPublicKeyPEM){return this.scheduler.send({type:"generateWrappedSymmetricKey",args:[serverPublicKeyPEM]})};SchedulerCryptoAdapter.prototype.decryptManagedPrivateKey=function decryptManagedPrivateKey(privateKey$,keyBase64){return this.scheduler.send({type:"decryptManagedPrivateKey",args:[privateKey$,keyBase64]})};return SchedulerCryptoAdapter}(_ICryptoAdapter3.default);exports.default=SchedulerCryptoAdapter;
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _ICryptoAdapter2=require("./ICryptoAdapter");var _ICryptoAdapter3=_interopRequireDefault(_ICryptoAdapter2);var _crypto=require("../crypto");var crypto=_interopRequireWildcard(_crypto);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}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}var SyncCryptoAdapter=function(_ICryptoAdapter){_inherits(SyncCryptoAdapter,_ICryptoAdapter);function SyncCryptoAdapter(){_classCallCheck(this,SyncCryptoAdapter);return _possibleConstructorReturn(this,_ICryptoAdapter.apply(this,arguments))}SyncCryptoAdapter.prototype.decryptComment=function decryptComment(comment$,envelope,privateKeyPEM){return crypto.decryptComment(comment$,envelope,privateKeyPEM)};SyncCryptoAdapter.prototype.decryptImage=function decryptImage(data$,privateKeyPEM){return crypto.decryptImage(data$,privateKeyPEM)};SyncCryptoAdapter.prototype.decryptPrivateKey=function decryptPrivateKey(privateKey$,password){return crypto.decryptPrivateKey(privateKey$,password)};SyncCryptoAdapter.prototype.encryptFileBlock=function encryptFileBlock(keyIV,fileBlockBase64){return crypto.encryptFileBlock(keyIV,fileBlockBase64)};SyncCryptoAdapter.prototype.encryptPrivateKey=function encryptPrivateKey(privateKeyPEM,password){return crypto.encryptPrivateKey(privateKeyPEM,password)};SyncCryptoAdapter.prototype.envelopeSeal=function envelopeSeal(secret,publicKeyPEMs){return crypto.envelopeSeal(secret,publicKeyPEMs)};SyncCryptoAdapter.prototype.envelopeUnseal=function envelopeUnseal(envelope,privateKeyPEM){return crypto.envelopeUnseal(envelope,privateKeyPEM)};SyncCryptoAdapter.prototype.generateAuthorizationHeaders=function generateAuthorizationHeaders(method,path,session){return crypto.generateAuthorizationHeaders(method,path,session)};SyncCryptoAdapter.prototype.generateKeyIV=function generateKeyIV(){return crypto.generateKeyIV()};SyncCryptoAdapter.prototype.generateKeyPair=function generateKeyPair(){return crypto.generateKeyPair()};SyncCryptoAdapter.prototype.generatePasswordHash=function generatePasswordHash(password){return crypto.generatePasswordHash(password)};SyncCryptoAdapter.prototype.generateWrappedSymmetricKey=function generateWrappedSymmetricKey(serverPublicKeyPEM){return crypto.generateWrappedSymmetricKey(serverPublicKeyPEM)};SyncCryptoAdapter.prototype.decryptManagedPrivateKey=function decryptManagedPrivateKey(privateKey$,keyBase64){return crypto.decryptManagedPrivateKey(privateKey$,keyBase64)};SyncCryptoAdapter.prototype.encryptComment=function encryptComment(comment,publicKeyPEMs){return crypto.encryptComment(comment,publicKeyPEMs)};return SyncCryptoAdapter}(_ICryptoAdapter3.default);exports.default=SyncCryptoAdapter;
1
+ "use strict";exports.__esModule=true;var _ICryptoAdapter2=require("./ICryptoAdapter");var _ICryptoAdapter3=_interopRequireDefault(_ICryptoAdapter2);var _crypto=require("../crypto");var crypto=_interopRequireWildcard(_crypto);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}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}var SyncCryptoAdapter=function(_ICryptoAdapter){_inherits(SyncCryptoAdapter,_ICryptoAdapter);function SyncCryptoAdapter(){_classCallCheck(this,SyncCryptoAdapter);return _possibleConstructorReturn(this,_ICryptoAdapter.apply(this,arguments))}SyncCryptoAdapter.prototype.decryptComment=function decryptComment(comment$,envelope,privateKeyPEM){return crypto.decryptComment(comment$,envelope,privateKeyPEM)};SyncCryptoAdapter.prototype.decryptImage=function decryptImage(data$,privateKeyPEM){return crypto.decryptImage(data$,privateKeyPEM)};SyncCryptoAdapter.prototype.decryptPrivateKey=function decryptPrivateKey(privateKey$,password){return crypto.decryptPrivateKey(privateKey$,password)};SyncCryptoAdapter.prototype.encryptFileBlock=function encryptFileBlock(keyIV,fileBlockBase64){return crypto.encryptFileBlock(keyIV,fileBlockBase64)};SyncCryptoAdapter.prototype.encryptPrivateKey=function encryptPrivateKey(privateKeyPEM,password){return crypto.encryptPrivateKey(privateKeyPEM,password)};SyncCryptoAdapter.prototype.envelopeSeal=function envelopeSeal(secret,publicKeyPEMs){return crypto.envelopeSeal(secret,publicKeyPEMs)};SyncCryptoAdapter.prototype.envelopeUnseal=function envelopeUnseal(envelope,privateKeyPEM){return crypto.envelopeUnseal(envelope,privateKeyPEM)};SyncCryptoAdapter.prototype.generateAuthorizationHeaders=function generateAuthorizationHeaders(method,path,session){return crypto.generateAuthorizationHeaders(method,path,session)};SyncCryptoAdapter.prototype.generateKeyIV=function generateKeyIV(){return crypto.generateKeyIV()};SyncCryptoAdapter.prototype.generateKeyPair=function generateKeyPair(){return crypto.generateKeyPair()};SyncCryptoAdapter.prototype.generatePasswordHash=function generatePasswordHash(password){return crypto.generatePasswordHash(password)};SyncCryptoAdapter.prototype.generateWrappedSymmetricKey=function generateWrappedSymmetricKey(serverPublicKeyPEM){return crypto.generateWrappedSymmetricKey(serverPublicKeyPEM)};SyncCryptoAdapter.prototype.decryptManagedPrivateKey=function decryptManagedPrivateKey(privateKey$,keyBase64){return crypto.decryptManagedPrivateKey(privateKey$,keyBase64)};return SyncCryptoAdapter}(_ICryptoAdapter3.default);exports.default=SyncCryptoAdapter;
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Comment=require("../models/Comment");var _Comment2=_interopRequireDefault(_Comment);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _constants=require("../util/constants");var _sort=require("../util/sort");var _comment=require("../util/comment");var _creationToken=require("../util/creationToken");var _throttle=require("../util/throttle");var _throttle2=_interopRequireDefault(_throttle);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 getCommentDataFromPages(pages){var comments=[];Object.keys(pages).forEach(function(pageNumber){pages[pageNumber].Comments.forEach(function(commentData){comments.push(commentData)})});return comments}var _sortPages=(0,_sort.sortObjectsByKey)("pageNumber");var _sortCreatedDateDESC=(0,_sort.sortObjectsByKey)("createdDate",true);var _sortCreatedDateASC=(0,_sort.sortObjectsByKey)("createdDate",false);var sortComments=(0,_sort.combineSort)(_sortPages,_sortCreatedDateDESC);var sortReplies=(0,_sort.combineSort)(_sortPages,_sortCreatedDateASC);function mapComments(commentsData){var comments=[];var replies=[];commentsData.forEach(function(commentData){var entity=(new _Comment2.default).fromComment(commentData);if(entity.parentCommentId){replies.push(entity)}else{comments.push(entity)}});comments.sort(sortComments);var commentIds=comments.map(function(c){return c.id});var sortByParentCommentIndex=(0,_sort.sortObjectsBy)(function(r){return commentIds.indexOf(r.parentCommentId)},true);replies.sort((0,_sort.combineSort)(sortReplies,sortByParentCommentIndex));return comments.concat(replies)}var Comments=function(_API){_inherits(Comments,_API);function Comments(){_classCallCheck(this,Comments);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Comments.prototype._mark=function _mark(commentId,state,value){var _data;var field=void 0;switch(state){case _CommentState2.default.TODO:{field="change";break}case _CommentState2.default.DONE:{field="done";break}default:{throw new Error('Cannot mark comment state "'+state+'".')}}var data=(_data={commentId:commentId},_data[field]=value?1:0,_data);return this.client.request("comments.state.update",data).then(function(){return null})};Comments.prototype.mark=function mark(commentId,state){return this._mark(commentId,state,true)};Comments.prototype.unmark=function unmark(commentId,state){return this._mark(commentId,state,false)};Comments.prototype.load=function load(_options){var _this2=this;var options=typeof _options==="string"?{proofId:_options}:_options;var proofId=options.proofId,_options$pageNumber=options.pageNumber,pageNumber=_options$pageNumber===undefined?null:_options$pageNumber,_options$sinceDate=options.sinceDate,sinceDate=_options$sinceDate===undefined?null:_options$sinceDate,_options$async=options.async,async=_options$async===undefined?false:_options$async,_options$decrypt=options.decrypt,decrypt=_options$decrypt===undefined?true:_options$decrypt,onDecryptComment=options.onDecryptComment,onDecryptComments=options.onDecryptComments,_options$onDecryptCom=options.onDecryptCommentsThrottleMs,onDecryptCommentsThrottleMs=_options$onDecryptCom===undefined?1e3:_options$onDecryptCom,onDecryptError=options.onDecryptError;var sinceDateISO=sinceDate?sinceDate.toISOString().match(_constants.ISO_REGEX)[0]:_constants.DEFAULT_ISO_DATE;var payload={proofId:proofId,page:pageNumber,timestamp:sinceDateISO};return this.client.request(pageNumber!==null?"comments.load-page":"comments.load-all",payload).then(function(response){var comments=mapComments(response.data.Pages?getCommentDataFromPages(response.data.Pages):response.data);var wait=Promise.resolve();if(decrypt){var scheduled=[];var pendingBatch=[];var scheduleOnDecryptComments=onDecryptComments?(0,_throttle2.default)(function(){if(pendingBatch.length){onDecryptComments(pendingBatch);pendingBatch=[]}},onDecryptCommentsThrottleMs):function(){};var cached=Promise.all(comments.map(function(comment){return _this2.client.cache.auto(_constants.COMMENT_CACHE_PREFIX+comment.comment$,function(resolve){scheduled.push({comment:comment,resolve:resolve})}).then(function(rawComment){if(rawComment){comment.fromRawComment(rawComment)}return comment})}));wait=wait.then(function(){return cached});wait=wait.then(function(){var decrypted=scheduled.map(function(_ref){var comment=_ref.comment,resolve=_ref.resolve;return _this2.client.crypto().decryptComment(comment.comment$,comment.envelope,_this2.client.session.privateKeyPEM).then(function(rawComment){comment.fromRawComment(rawComment);resolve(rawComment);if(onDecryptComment){onDecryptComment(comment)}pendingBatch.push(comment);scheduleOnDecryptComments()}).catch(function(err){if(onDecryptError){onDecryptError(err,comment)}if(!async){return Promise.reject(err)}return undefined})});if(!async){return Promise.all(decrypted)}return null})}return wait.then(function(){return comments})})};Comments.prototype.create=function create(_ref2){var _this3=this;var raw=_ref2.raw,proofId=_ref2.proofId,_ref2$pageNumber=_ref2.pageNumber,pageNumber=_ref2$pageNumber===undefined?1:_ref2$pageNumber,pin=_ref2.pin,mediaTime=_ref2.mediaTime,mediaDuration=_ref2.mediaDuration,parentCommentId=_ref2.parentCommentId,metadata=_ref2.metadata,state=_ref2.state,retryCreationToken=_ref2.creationToken;var mentions=(0,_comment.getCommentMentions)(raw);var creationToken=retryCreationToken||(0,_creationToken.generateCreationToken)();return this.client.crypto().encryptComment(raw,[this.client.session.serverPublicKeyPEM,this.client.session.publicKeyPEM]).then(function(_ref3){var envelope=_ref3.envelope,comment$=_ref3.comment$;return{proofId:proofId,page:parentCommentId?undefined:pageNumber,envelope:envelope,encryptedComment:comment$,xy:JSON.stringify({x:pin&&typeof pin.x==="number"?pin.x:null,y:pin&&typeof pin.y==="number"?pin.y:null,x2:pin&&typeof pin.x2==="number"?pin.x2:null,y2:pin&&typeof pin.y2==="number"?pin.y2:null,time:typeof mediaTime==="number"?mediaTime:null,duration:typeof mediaDuration==="number"?mediaDuration:null}),parent:parentCommentId||undefined,mentions:mentions.map(function(m){return m.id}).join(","),metadata:metadata?JSON.stringify(metadata):"{}",creationToken:creationToken,change:state===_CommentState2.default.TODO?"1":undefined,done:state===_CommentState2.default.DONE?"1":undefined}}).then(function(requestData){return _this3.client.request("comments.create",requestData).then(function(response){return(new _Comment2.default).fromComment(response.data).fromRawComment(raw)})}).catch(function(err){if(err){err.creationToken=creationToken}return Promise.reject(err)})};return Comments}(_API3.default);exports.default=Comments;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Comment=require("../models/Comment");var _Comment2=_interopRequireDefault(_Comment);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _constants=require("../util/constants");var _sort=require("../util/sort");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 getCommentDataFromPages(pages){var comments=[];Object.keys(pages).forEach(function(pageNumber){pages[pageNumber].Comments.forEach(function(commentData){comments.push(commentData)})});return comments}var _sortPages=(0,_sort.sortObjectsByKey)("pageNumber");var _sortCreatedDateDESC=(0,_sort.sortObjectsByKey)("createdDate",true);var _sortCreatedDateASC=(0,_sort.sortObjectsByKey)("createdDate",false);var sortComments=(0,_sort.combineSort)(_sortPages,_sortCreatedDateDESC);var sortReplies=(0,_sort.combineSort)(_sortPages,_sortCreatedDateASC);function mapComments(commentsData){var comments=[];var replies=[];commentsData.forEach(function(commentData){var entity=(new _Comment2.default).fromComment(commentData);if(entity.parentCommentId){replies.push(entity)}else{comments.push(entity)}});comments.sort(sortComments);var commentIds=comments.map(function(c){return c.id});var sortByParentCommentIndex=(0,_sort.sortObjectsBy)(function(r){return commentIds.indexOf(r.parentCommentId)},true);replies.sort((0,_sort.combineSort)(sortReplies,sortByParentCommentIndex));return comments.concat(replies)}var Comments=function(_API){_inherits(Comments,_API);function Comments(){_classCallCheck(this,Comments);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Comments.prototype._mark=function _mark(commentId,state,value){var _data;var field=void 0;switch(state){case _CommentState2.default.TODO:{field="change";break}case _CommentState2.default.DONE:{field="done";break}default:{throw new Error('Cannot mark comment state "'+state+'".')}}var data=(_data={commentId:commentId},_data[field]=value?1:0,_data);return this.client.request("comments.state.update",data).then(function(){return null})};Comments.prototype.mark=function mark(commentId,state){return this._mark(commentId,state,true)};Comments.prototype.unmark=function unmark(commentId,state){return this._mark(commentId,state,false)};Comments.prototype.load=function load(_options){var _this2=this;var options=typeof _options==="string"?{proofId:_options}:_options;var proofId=options.proofId,_options$pageNumber=options.pageNumber,pageNumber=_options$pageNumber===undefined?null:_options$pageNumber,_options$sinceDate=options.sinceDate,sinceDate=_options$sinceDate===undefined?null:_options$sinceDate,_options$async=options.async,async=_options$async===undefined?false:_options$async,_options$decrypt=options.decrypt,decrypt=_options$decrypt===undefined?true:_options$decrypt,onDecryptComment=options.onDecryptComment;var sinceDateISO=sinceDate?sinceDate.toISOString().match(_constants.ISO_REGEX)[0]:_constants.DEFAULT_ISO_DATE;var payload={proofId:proofId,page:pageNumber,timestamp:sinceDateISO};return this.client.request(pageNumber!==null?"comments.load-page":"comments.load-all",payload).then(function(response){var comments=mapComments(response.data.Pages?getCommentDataFromPages(response.data.Pages):response.data);var wait=Promise.resolve();if(decrypt){var scheduled=[];var cached=Promise.all(comments.map(function(comment){return _this2.client.cache.auto(_constants.COMMENT_CACHE_PREFIX+comment.comment$,function(resolve){scheduled.push({comment:comment,resolve:resolve})}).then(function(rawComment){if(rawComment){comment.fromRawComment(rawComment)}return comment})}));wait=wait.then(function(){return cached});wait=wait.then(function(){var decrypted=scheduled.map(function(_ref){var comment=_ref.comment,resolve=_ref.resolve;return _this2.client.crypto().decryptComment(comment.comment$,comment.envelope,_this2.client.session.privateKeyPEM).then(function(rawComment){comment.fromRawComment(rawComment);resolve(rawComment);if(onDecryptComment){onDecryptComment(comment)}})});if(!async){return Promise.all(decrypted)}return null})}return wait.then(function(){return comments})})};return Comments}(_API3.default);exports.default=Comments;
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _DashboardGroups=require("./DashboardGroups");var _DashboardGroups2=_interopRequireDefault(_DashboardGroups);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}var TABS={inbox:"ProofIn",sent:"ProofOut",outbox:"ProofOutBox"};function transformTabs(data){var tabs={};Object.keys(TABS).forEach(function(name){tabs[name]=data[TABS[name]]});return tabs}function transformProofs(proofs){return(proofs||[]).map(function(proofData){return(new _Proof2.default).fromProof(proofData)})}var Dashboard=function(_API){_inherits(Dashboard,_API);function Dashboard(client){_classCallCheck(this,Dashboard);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.groups=new _DashboardGroups2.default(client);return _this}Dashboard.prototype.inbox=function inbox(){return this._loadSingleTabProofs("inbox")};Dashboard.prototype.sent=function sent(){return this._loadSingleTabProofs("sent")};Dashboard.prototype.outbox=function outbox(){return this._loadSingleTabProofs("outbox")};Dashboard.prototype._loadSingleTabProofs=function _loadSingleTabProofs(name){return this.client.request("dashboard."+name).then(function(response){return transformTabs(response.data)}).then(function(dashboard){return dashboard[name]}).then(transformProofs)};Dashboard.prototype.search=function search(query){return this._loadSearchProofs({query:query})};Dashboard.prototype.everything=function everything(){return this._loadSearchProofs({all:1})};Dashboard.prototype.approved=function approved(){return this._loadSearchProofs({filterBy:70})};Dashboard.prototype.archived=function archived(){return this._loadSearchProofs({filterBy:100})};Dashboard.prototype._loadSearchProofs=function _loadSearchProofs(params){return this.client.request("dashboard.search",params).then(function(response){return transformProofs(response.data.Proofs)})};return Dashboard}(_API3.default);exports.default=Dashboard;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);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}var TABS={inbox:"ProofIn",sent:"ProofOut",outbox:"ProofOutBox"};function transformTabs(data){var tabs={};Object.keys(TABS).forEach(function(name){tabs[name]=data[TABS[name]]});return tabs}function transformProofs(proofs){return(proofs||[]).map(function(proofData){return(new _Proof2.default).fromProof(proofData)})}var Dashboard=function(_API){_inherits(Dashboard,_API);function Dashboard(){_classCallCheck(this,Dashboard);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Dashboard.prototype.inbox=function inbox(){return this._loadSingleTabProofs("inbox")};Dashboard.prototype.sent=function sent(){return this._loadSingleTabProofs("sent")};Dashboard.prototype.outbox=function outbox(){return this._loadSingleTabProofs("outbox")};Dashboard.prototype._loadSingleTabProofs=function _loadSingleTabProofs(name){return this.client.request("dashboard."+name).then(function(response){return transformTabs(response.data)}).then(function(dashboard){return dashboard[name]}).then(transformProofs)};Dashboard.prototype.search=function search(query){return this._loadSearchProofs({query:query})};Dashboard.prototype.everything=function everything(){return this._loadSearchProofs({all:1})};Dashboard.prototype.approved=function approved(){return this._loadSearchProofs({filterBy:70})};Dashboard.prototype.archived=function archived(){return this._loadSearchProofs({filterBy:100})};Dashboard.prototype._loadSearchProofs=function _loadSearchProofs(params){return this.client.request("dashboard.search",params).then(function(response){return transformProofs(response.data.Proofs)})};return Dashboard}(_API3.default);exports.default=Dashboard;
package/lib/api/Files.js CHANGED
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _File=require("../models/File");var _File2=_interopRequireDefault(_File);var _FileStatus=require("../enum/FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _ImportProvider=require("../enum/ImportProvider");var _ImportProvider2=_interopRequireDefault(_ImportProvider);var _streamBlocks=require("../util/streamBlocks");var _streamBlocks2=_interopRequireDefault(_streamBlocks);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);var _getContentLength=require("../util/getContentLength");var _getContentLength2=_interopRequireDefault(_getContentLength);var _constants=require("../util/constants");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 parseFilename(filename){var extensionIndex=filename.lastIndexOf(".");var name=filename.substring(0,extensionIndex);var extension=filename.substring(extensionIndex+1);return{name:name,extension:extension}}var Files=function(_API){_inherits(Files,_API);function Files(){_classCallCheck(this,Files);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Files.prototype.generateToken=function generateToken(assignedTo,assignedType){if(assignedTo&&!assignedType){return Promise.reject(Error('The "assignedType" option is required when specifying the "assignedTo" option.'))}if(!assignedTo&&assignedType){return Promise.reject(Error('The "assignedTo" option is required when specifying the "assignedType" option.'))}return this.client.request("files.generate-token",{relatedId:assignedTo,fileType:assignedType}).then(function(response){return response.data.Token})};Files.prototype._waitFileProcessed=function _waitFileProcessed(id){var _this2=this;return new Promise(function(resolve,reject){var checkTimeout=null;var timeoutTimeout=null;var check=function check(){_this2.details(id).then(function(file){checkTimeout=null;switch(file.status){case _FileStatus2.default.OK:{resolve(file);break}case _FileStatus2.default.ERROR:{reject(new Error("File "+id+" encountered a processing error: "+file.message));break}default:{checkTimeout=setTimeout(check,5e3);break}}if(!checkTimeout||file.status===_FileStatus2.default.RIPPING){clearTimeout(timeoutTimeout)}}).catch(reject)};check();timeoutTimeout=setTimeout(function(){clearTimeout(checkTimeout);reject(new Error("File did not finish processing within specified duration."))},3e4)})};Files.prototype.import=function _import(_ref){var _this3=this;var name=_ref.name,url=_ref.url,_ref$provider=_ref.provider,provider=_ref$provider===undefined?_ImportProvider2.default.NONE:_ref$provider,auth=_ref.auth,_ref$download=_ref.download,download=_ref$download===undefined?false:_ref$download,_ref$process=_ref.process,process=_ref$process===undefined?false:_ref$process;var providerSupported=Object.keys(_ImportProvider2.default).some(function(key){return _ImportProvider2.default[key]===provider});if(!providerSupported){return Promise.reject(new Error('Unsupported provider "'+provider+'"'))}var endpoint=provider;if(provider===_ImportProvider2.default.NONE){endpoint="generic"}var _parseFilename=parseFilename(name),filename=_parseFilename.name,extension=_parseFilename.extension;return this._generateKeyIVEnvelope().then(function(_ref2){var envelope=_ref2.envelope;return _this3.client.request("files.import."+endpoint,{extn:extension,filename:filename,url:url,envelope:envelope,accessToken:auth,storeOriginal:download})}).then(function(response){return response.data}).then(function(token){if(process){return _this3._waitFileProcessed(token)}else{var file=new _File2.default;file.id=token;return file}})};Files.prototype._generateKeyIVEnvelope=function _generateKeyIVEnvelope(){var _this4=this;return this.client.crypto().generateKeyIV().then(function(keyIV){return Promise.all([keyIV,_this4.client.crypto().envelopeSeal(keyIV.keyIV,[_this4.client.session.serverPublicKeyPEM,_this4.client.session.publicKeyPEM])])}).then(function(_ref3){var keyIV=_ref3[0],envelope=_ref3[1];return{keyIV:keyIV,envelope:envelope}})};Files.prototype.upload=function upload(_ref4){var _this5=this;var name=_ref4.name,contents=_ref4.contents,assignedTo=_ref4.assignedTo,assignedType=_ref4.assignedType,_ref4$download=_ref4.download,download=_ref4$download===undefined?false:_ref4$download,_ref4$async=_ref4.async,async=_ref4$async===undefined?true:_ref4$async,onProgress=_ref4.onProgress,onError=_ref4.onError;return this.generateToken(assignedTo,assignedType).then(function(token){return Promise.all([token,_this5._generateKeyIVEnvelope()])}).then(function(_ref5){var token=_ref5[0],_ref5$=_ref5[1],keyIV=_ref5$.keyIV,envelope=_ref5$.envelope;var process=_this5._upload({name:name,contents:contents,download:download,token:token,keyIV:keyIV,envelope:envelope,onProgress:onProgress,onError:onError});if(async){process=Promise.resolve()}return process.then(function(){return token})}).then(function(token){var file=new _File2.default;file.id=token;return file})};Files.prototype._upload=function _upload(_ref6){var _this6=this;var name=_ref6.name,contents=_ref6.contents,download=_ref6.download,token=_ref6.token,keyIV=_ref6.keyIV,envelope=_ref6.envelope,onProgress=_ref6.onProgress;return new Promise(function(resolve){var concurrent=4;var _parseFilename2=parseFilename(name),filename=_parseFilename2.name,extension=_parseFilename2.extension;var blocks=(0,_streamBlocks2.default)(contents);var chain=Promise.resolve();var index=0;var end=false;var count=Math.ceil((0,_getContentLength2.default)(contents)/_constants.BYTES_PER_BLOCK);var percent=new Array(count);var onUploadProgress=function onUploadProgress(){};if(onProgress){onUploadProgress=function onUploadProgress(blockIndex,progress){percent[blockIndex]=Math.max(progress,percent[blockIndex]||0);onProgress(percent.reduce(function(a,b){return a+(b||0)},0)/count*.99)}}var process=function process(block,blockIndex){return _this6.client.crypto().encryptFileBlock(keyIV,block).then(function(block$){return _this6.client.request("files.upload-block",{block:blockIndex,part:1,token:token,data:block$},{onUploadProgress:onUploadProgress.bind(null,blockIndex)})})};function next(){blocks().then(function(block){if(end)return;if(block===null){end=true;resolve(chain.then(complete))}else{var handle=process(block,index++);chain=chain.then(function(){return handle});handle.then(next)}})}var complete=function complete(){return _this6.client.request("files.upload-complete",{block:0,blockCount:index,part:0,token:token,extn:extension,pages:1,filename:filename,storeoriginal:download?1:0,envelope:envelope}).then(function(){return onProgress&&onProgress(100)})};while(concurrent--){next()}})};Files.prototype.download=function download(_options){var _this7=this;var options=typeof _options==="string"?{fileId:_options}:_options;var fileId=options.fileId,onFileDetails=options.onFileDetails;return this.details(fileId).then(function(file){if(!file.downloadable){throw new Error("File "+fileId+" is not downloadable.")}if(file.status!==_FileStatus2.default.OK){throw new Error("File "+fileId+" cannot be download. The file may still be uploading, processing or has errored.")}if(!file.blocks){throw new Error("File "+fileId+" is empty.")}if(onFileDetails){onFileDetails(file)}return _this7._downloadFile(file,options)})};Files.prototype._downloadFile=function _downloadFile(file,options){var _this8=this;return new Promise(function(resolve){var concurrent=4;var bluffer=new _bluffer2.default;var count=file.blocks;var blocks=new Array(count);var chain=Promise.resolve();var onData=options.onData||function onData(block,index){blocks[index]=block};var onDownloadProgress=function onDownloadProgress(){};if(options.onProgress){var percent=new Array(count);onDownloadProgress=function onDownloadProgress(blockIndex,progress){percent[blockIndex]=Math.max(progress,percent[blockIndex]||0);options.onProgress(percent.reduce(function(a,b){return a+(b||0)},0)/count*.99)}}var process=function process(blockIndex){return _this8.client.request("files.download-block",{proofId:file.assignedTo,fileId:file.id,block:blockIndex+1},{onDownloadProgress:onDownloadProgress.bind(null,blockIndex)}).then(function(response){return _this8.client.crypto().decryptFileBlock(response.data,_this8.client.session.privateKeyPEM).then(function(blockBase64){return bluffer.createBase64(blockBase64)})})};var index=0;var end=false;function next(){if(end)return;if(index<blocks.length){var blockIndex=index++;var block=process(blockIndex);chain=chain.then(function(){return block.then(function(data){return onData(data,blockIndex,count)})});block.then(next)}else{end=true;resolve(chain.then(complete))}}var complete=function complete(){if(options.onProgress){options.onProgress(100)}if(!options.onData){return bluffer.combine.apply(bluffer,blocks)}return null};while(concurrent--){next()}})};Files.prototype.details=function details(fileId){return this.client.request("files.details",{fileId:fileId}).then(function(response){return(new _File2.default).fromFile(response.data)})};Files.prototype.thumbnail=function thumbnail(fileId){var _this9=this;return this.client.cache.auto(_constants.THUMBNAIL_CACHE_PREFIX+fileId,function(){return _this9._thumbnail(fileId)})};Files.prototype._thumbnail=function _thumbnail(fileId){var _this10=this;return this.client.request("files.thumbnail",{fileId:fileId}).then(function(response){return _this10.client.crypto().decryptImage(response.data,_this10.client.session.privateKeyPEM)}).then(function(imageBase64){var bluffer=new _bluffer2.default;return bluffer.createBase64(imageBase64)})};Files.prototype.thumbnails=function thumbnails(fileIds,_ref7){var _this11=this;var _ref7$async=_ref7.async,async=_ref7$async===undefined?false:_ref7$async,onLoadThumbnails=_ref7.onLoadThumbnails;var scheduled=[];return Promise.all(fileIds.map(function(fileId){return _this11.client.cache.auto(_constants.THUMBNAIL_CACHE_PREFIX+fileId,function(resolve){scheduled.push({fileId:fileId,resolve:resolve})}).then(function(thumbnail){var _ref8;return thumbnail&&(_ref8={},_ref8[fileId]=thumbnail,_ref8)})})).then(function(entries){var more=Promise.all(scheduled.map(function(_ref9){var fileId=_ref9.fileId,resolve=_ref9.resolve;return _this11._thumbnail(fileId).then(function(thumbnail){resolve(thumbnail);if(async){var _onLoadThumbnails;onLoadThumbnails((_onLoadThumbnails={},_onLoadThumbnails[fileId]=thumbnail,_onLoadThumbnails))}return thumbnail})}));if(async){return entries}else{return more.then(function(moreEntries){return[].concat(entries,moreEntries)})}}).then(function(entries){return Object.assign.apply(Object,[{}].concat(entries))})};return Files}(_API3.default);exports.default=Files;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _File=require("../models/File");var _File2=_interopRequireDefault(_File);var _FileStatus=require("../enum/FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _ImportProvider=require("../enum/ImportProvider");var _ImportProvider2=_interopRequireDefault(_ImportProvider);var _streamBlocks=require("../util/streamBlocks");var _streamBlocks2=_interopRequireDefault(_streamBlocks);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);var _getContentLength=require("../util/getContentLength");var _getContentLength2=_interopRequireDefault(_getContentLength);var _getSlug=require("../util/getSlug");var _getSlug2=_interopRequireDefault(_getSlug);var _constants=require("../util/constants");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 parseFilename(filename){var extensionIndex=filename.lastIndexOf(".");var name=(0,_getSlug2.default)(filename.substring(0,extensionIndex));var extension=filename.substring(extensionIndex+1);return{name:name,extension:extension}}var Files=function(_API){_inherits(Files,_API);function Files(){_classCallCheck(this,Files);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Files.prototype.generateToken=function generateToken(assignedTo,assignedType){if(assignedTo&&!assignedType){return Promise.reject(Error('The "assignedType" option is required when specifying the "assignedTo" option.'))}if(!assignedTo&&assignedType){return Promise.reject(Error('The "assignedTo" option is required when specifying the "assignedType" option.'))}return this.client.request("files.generate-token",{relatedId:assignedTo,fileType:assignedType}).then(function(response){return response.data.Token})};Files.prototype._waitFileProcessed=function _waitFileProcessed(id){var _this2=this;return new Promise(function(resolve,reject){var checkTimeout=null;var timeoutTimeout=null;var check=function check(){_this2.details(id).then(function(file){checkTimeout=null;switch(file.status){case _FileStatus2.default.OK:{resolve(file);break}case _FileStatus2.default.ERROR:{reject(new Error("File "+id+" encountered a processing error: "+file.message));break}default:{checkTimeout=setTimeout(check,5e3);break}}if(!checkTimeout||file.status===_FileStatus2.default.RIPPING){clearTimeout(timeoutTimeout)}}).catch(reject)};check();timeoutTimeout=setTimeout(function(){clearTimeout(checkTimeout);reject(new Error("File did not finish processing within specified duration."))},3e4)})};Files.prototype.import=function _import(_ref){var _this3=this;var name=_ref.name,url=_ref.url,_ref$provider=_ref.provider,provider=_ref$provider===undefined?_ImportProvider2.default.NONE:_ref$provider,auth=_ref.auth,_ref$download=_ref.download,download=_ref$download===undefined?false:_ref$download,_ref$process=_ref.process,process=_ref$process===undefined?false:_ref$process;var providerSupported=Object.keys(_ImportProvider2.default).some(function(key){return _ImportProvider2.default[key]===provider});if(!providerSupported){return Promise.reject(new Error('Unsupported provider "'+provider+'"'))}var endpoint=provider;if(provider===_ImportProvider2.default.NONE){endpoint="generic"}var _parseFilename=parseFilename(name),filename=_parseFilename.name,extension=_parseFilename.extension;return this._generateKeyIVEnvelope().then(function(_ref2){var envelope=_ref2.envelope;return _this3.client.request("files.import."+endpoint,{extn:extension,filename:filename,url:url,envelope:envelope,accessToken:auth,storeOriginal:download})}).then(function(response){return response.data}).then(function(token){if(process){return _this3._waitFileProcessed(token)}else{var file=new _File2.default;file.id=token;return file}})};Files.prototype._generateKeyIVEnvelope=function _generateKeyIVEnvelope(){var _this4=this;return this.client.crypto().generateKeyIV().then(function(keyIV){return Promise.all([keyIV,_this4.client.crypto().envelopeSeal(keyIV.keyIV,[_this4.client.session.serverPublicKeyPEM,_this4.client.session.publicKeyPEM])])}).then(function(_ref3){var keyIV=_ref3[0],envelope=_ref3[1];return{keyIV:keyIV,envelope:envelope}})};Files.prototype.upload=function upload(_ref4){var _this5=this;var name=_ref4.name,contents=_ref4.contents,assignedTo=_ref4.assignedTo,assignedType=_ref4.assignedType,_ref4$download=_ref4.download,download=_ref4$download===undefined?false:_ref4$download,_ref4$async=_ref4.async,async=_ref4$async===undefined?true:_ref4$async,onProgress=_ref4.onProgress,onError=_ref4.onError;return this.generateToken(assignedTo,assignedType).then(function(token){return Promise.all([token,_this5._generateKeyIVEnvelope()])}).then(function(_ref5){var token=_ref5[0],_ref5$=_ref5[1],keyIV=_ref5$.keyIV,envelope=_ref5$.envelope;var process=_this5._upload({name:name,contents:contents,download:download,token:token,keyIV:keyIV,envelope:envelope,onProgress:onProgress,onError:onError});if(async){process=Promise.resolve()}return process.then(function(){return token})}).then(function(token){var file=new _File2.default;file.id=token;return file})};Files.prototype._upload=function _upload(_ref6){var _this6=this;var name=_ref6.name,contents=_ref6.contents,download=_ref6.download,token=_ref6.token,keyIV=_ref6.keyIV,envelope=_ref6.envelope,onProgress=_ref6.onProgress;return new Promise(function(resolve){var concurrent=4;var _parseFilename2=parseFilename(name),filename=_parseFilename2.name,extension=_parseFilename2.extension;var blocks=(0,_streamBlocks2.default)(contents);var chain=Promise.resolve();var index=0;var end=false;var count=Math.ceil((0,_getContentLength2.default)(contents)/_constants.BYTES_PER_BLOCK);var percent=new Array(count);var onUploadProgress=function onUploadProgress(){};if(onProgress){onUploadProgress=function onUploadProgress(blockIndex,progress){percent[blockIndex]=Math.max(progress,percent[blockIndex]||0);onProgress(percent.reduce(function(a,b){return a+(b||0)},0)/count*.99)}}var process=function process(block,blockIndex){return _this6.client.crypto().encryptFileBlock(keyIV,block).then(function(block$){return _this6.client.request("files.upload-block",{block:blockIndex,part:1,token:token,data:block$},{onUploadProgress:onUploadProgress.bind(null,blockIndex)})})};function next(){blocks().then(function(block){if(end)return;if(block===null){end=true;resolve(chain.then(complete))}else{var handle=process(block,index++);chain=chain.then(function(){return handle});handle.then(next)}})}var complete=function complete(){return _this6.client.request("files.upload-complete",{block:0,blockCount:index,part:0,token:token,extn:extension,pages:1,filename:filename,storeoriginal:download?1:0,envelope:envelope}).then(function(){return onProgress&&onProgress(100)})};while(concurrent--){next()}})};Files.prototype.download=function download(_options){var _this7=this;var options=typeof _options==="string"?{fileId:_options}:_options;var fileId=options.fileId;return this.details(fileId).then(function(file){if(!file.downloadable){throw new Error("File "+fileId+" is not downloadable.")}if(file.status!==_FileStatus2.default.OK){throw new Error("File "+fileId+" cannot be download. The file may still be uploading, processing or has errored.")}if(!file.blocks){throw new Error("File "+fileId+" is empty.")}return _this7._downloadFile(file,options)})};Files.prototype._downloadFile=function _downloadFile(file,options){var _this8=this;return new Promise(function(resolve){var concurrent=4;var bluffer=new _bluffer2.default;var count=file.blocks;var blocks=new Array(count);var chain=Promise.resolve();var onData=options.onData||function onData(block,index){blocks[index]=block};var onDownloadProgress=function onDownloadProgress(){};if(options.onProgress){var percent=new Array(count);onDownloadProgress=function onDownloadProgress(blockIndex,progress){percent[blockIndex]=Math.max(progress,percent[blockIndex]||0);options.onProgress(percent.reduce(function(a,b){return a+(b||0)},0)/count*.99)}}var process=function process(blockIndex){return _this8.client.request("files.download-block",{proofId:file.assignedTo,fileId:file.id,block:blockIndex+1},{onDownloadProgress:onDownloadProgress.bind(null,blockIndex)}).then(function(response){return _this8.client.crypto().decryptFileBlock(response.data,_this8.client.session.privateKeyPEM).then(function(blockBase64){return bluffer.createBase64(blockBase64)})})};var index=0;var end=false;function next(){if(end)return;if(index<blocks.length){var blockIndex=index++;var block=process(blockIndex);chain=chain.then(function(){return block.then(function(data){return onData(data,blockIndex,count)})});block.then(next)}else{end=true;resolve(chain.then(complete))}}var complete=function complete(){if(options.onProgress){options.onProgress(100)}if(!options.onData){return bluffer.combine.apply(bluffer,blocks)}return null};while(concurrent--){next()}})};Files.prototype.details=function details(fileId){return this.client.request("files.details",{fileId:fileId}).then(function(response){return(new _File2.default).fromFile(response.data)})};Files.prototype.thumbnail=function thumbnail(fileId){var _this9=this;return this.client.cache.auto(_constants.THUMBNAIL_CACHE_PREFIX+fileId,function(){return _this9._thumbnail(fileId)})};Files.prototype._thumbnail=function _thumbnail(fileId){var _this10=this;return this.client.request("files.thumbnail",{fileId:fileId}).then(function(response){return _this10.client.crypto().decryptImage(response.data,_this10.client.session.privateKeyPEM)}).then(function(imageBase64){var bluffer=new _bluffer2.default;return bluffer.createBase64(imageBase64)})};Files.prototype.thumbnails=function thumbnails(fileIds,_ref7){var _this11=this;var _ref7$async=_ref7.async,async=_ref7$async===undefined?false:_ref7$async,onLoadThumbnails=_ref7.onLoadThumbnails;var scheduled=[];return Promise.all(fileIds.map(function(fileId){return _this11.client.cache.auto(_constants.THUMBNAIL_CACHE_PREFIX+fileId,function(resolve){scheduled.push({fileId:fileId,resolve:resolve})}).then(function(thumbnail){var _ref8;return thumbnail&&(_ref8={},_ref8[fileId]=thumbnail,_ref8)})})).then(function(entries){var more=Promise.all(scheduled.map(function(_ref9){var fileId=_ref9.fileId,resolve=_ref9.resolve;return _this11._thumbnail(fileId).then(function(thumbnail){resolve(thumbnail);if(async){var _onLoadThumbnails;onLoadThumbnails((_onLoadThumbnails={},_onLoadThumbnails[fileId]=thumbnail,_onLoadThumbnails))}return thumbnail})}));if(async){return entries}else{return more.then(function(moreEntries){return[].concat(entries,moreEntries)})}}).then(function(entries){return Object.assign.apply(Object,[{}].concat(entries))})};return Files}(_API3.default);exports.default=Files;
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);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}var Profile=function(_API){_inherits(Profile,_API);function Profile(){_classCallCheck(this,Profile);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Profile.prototype.uploadAvatar=function uploadAvatar(file){var _this2=this;var bluffer=new _bluffer2.default;return bluffer.readBase64(file).then(function(base64){return _this2.client.request("profile.upload-avatar",{uploadedImage:"data:image/png;base64,"+base64})})};Profile.prototype.changePassword=function changePassword(currentPassword,password){var _this3=this;var crypto=this.client.crypto();return Promise.all([crypto.generatePasswordHash(currentPassword),crypto.generatePasswordHash(password),crypto.encryptPrivateKey(this.client.session.privateKeyPEM,password)]).then(function(_ref){var oldPassword=_ref[0],newPassword=_ref[1],newPrivateKey=_ref[2];return _this3.client.request("profile.change-password",{oldPassword:oldPassword,newPassword:newPassword,newPrivateKey:newPrivateKey})})};return Profile}(_API3.default);exports.default=Profile;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _bluffer=require("../bluffer");var _bluffer2=_interopRequireDefault(_bluffer);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}var Profile=function(_API){_inherits(Profile,_API);function Profile(){_classCallCheck(this,Profile);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Profile.prototype.uploadAvatar=function uploadAvatar(file){var _this2=this;var bluffer=new _bluffer2.default;return bluffer.readBase64(file).then(function(base64){return _this2.client.request("profile.upload-avatar",{uploadedImage:"data:image/png;base64,"+base64})})};Profile.prototype.changePassword=function changePassword(currentPassword,password){var _this3=this;var crypto=this.client.crypto();return Promise.all([crypto.generatePasswordHash(currentPassword),crypto.generatePasswordHash(password),crypto.encryptPrivateKey(this.client.session.privateKeyPEM,password)]).then(function(_ref){var oldPassword=_ref[0],newPassword=_ref[1],newPrivateKey=_ref[2];return _this3.client.request("profile.change-password",{oldPassword:oldPassword,newPassword:newPassword,newPrivateKey:newPrivateKey})})};Profile.prototype.getAllUserPreferences=function getAllUserPreferences(){return this.client.request("users.preferences-all")};Profile.prototype.getUserPreferences=function getUserPreferences(){return this.client.request("users.preferences-get")};Profile.prototype.updateUserPreferences=function updateUserPreferences(date,message){return this.client.request("users.preferences-update",{dueDate:date,messageToReviewers:message})};return Profile}(_API3.default);exports.default=Profile;
package/lib/api/Proofs.js CHANGED
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofsOwners=require("./ProofsOwners");var _ProofsOwners2=_interopRequireDefault(_ProofsOwners);var _ProofsEditors=require("./ProofsEditors");var _ProofsEditors2=_interopRequireDefault(_ProofsEditors);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _FileStatus=require("../enum/FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _constants=require("../util/constants");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}var Proofs=function(_API){_inherits(Proofs,_API);function Proofs(client){_classCallCheck(this,Proofs);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _ProofsOwners2.default(client);_this.editors=new _ProofsEditors2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);return _this}Proofs.prototype.setWorkflow=function setWorkflow(proofId,workflowId){var _this2=this;return this.client.request("proofs.normalize-workflow",{proofId:proofId,workflowId:workflowId}).then(function(){return _this2.client.request("proofs.set-workflow",{proofId:proofId,workflowId:workflowId})})};Proofs.prototype.setTags=function setTags(proofId,tags){return this.client.request("proofs.set-tags",{relatedId:proofId,tag:tags.join(",")})};Proofs.prototype.deleteTag=function deleteTag(proofId,tag){return this.client.request("proofs.tag-delete",{relatedId:proofId,tag:tag})};Proofs.prototype.setFile=function setFile(proofId,fileId){var _this3=this;return this.client.request("proofs.set-file",{proofId:proofId,fileId:fileId}).then(function(){return _this3.client.request("proofs.distribute-file",{proofId:proofId})})};Proofs.prototype.create=function create(_ref){var _this4=this;var name=_ref.name,_ref$tags=_ref.tags,tags=_ref$tags===undefined?[]:_ref$tags,_ref$dueDate=_ref.dueDate,dueDate=_ref$dueDate===undefined?new Date(Date.now()+3*_constants.DAY_IN_MS):_ref$dueDate,messageToReviewers=_ref.messageToReviewers,workflow=_ref.workflow,file=_ref.file,group=_ref.group,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start;var shouldStart=start&&!group;return this.client.request("proofs.create",{title:name,dueDate:dueDate.toISOString(),description:messageToReviewers,groupId:group?group.id:undefined}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);return Promise.all([proof,tags.length&&_this4.setTags(proof.id,tags),workflow&&_this4.setWorkflow(proof.id,workflow.id),file&&_this4.setFile(proof.id,file.id)])}).then(function(_ref2){var proof=_ref2[0];return Promise.resolve(shouldStart&&_this4.start(proof.id)).then(function(){return proof})}).then(function(proof){if(workflow){proof.workflowId=workflow.id}if(file){proof.fileId=file.id;proof.fileStatus=_FileStatus2.default.UPLOADING}proof.calculateState();return proof})};Proofs.prototype.archive=function archive(proofId){return this.client.request("proofs.archive",{proofId:proofId})};Proofs.prototype.unarchive=function unarchive(proofId){return this.client.request("proofs.unarchive",{proofId:proofId})};Proofs.prototype.delete=function _delete(proofId){return this.client.request("proofs.delete",{proofId:proofId})};Proofs.prototype.return=function _return(proofId){return this.client.request("proofs.return",{proofId:proofId})};Proofs.prototype.start=function start(proofId){return this.client.request("proofs.start",{proofId:proofId})};Proofs.prototype.removeEditor=function removeEditor(id){return this.client.request("proofs.remove-editor",{proofId:id})};Proofs.prototype.load=function load(proofId){return this.client.request("proofs.load",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.lock=function lock(proofId){return this.client.request("proofs.lock",{proofId:proofId})};Proofs.prototype.unlock=function unlock(proofId){return this.client.request("proofs.unlock",{proofId:proofId})};Proofs.prototype.requestUnlock=function requestUnlock(proofId){return this.client.request("proofs.request-unlock",{proofId:proofId})};Proofs.prototype.requestAccess=function requestAccess(proofId){return this.client.request("proofs.request-access",{proofId:proofId})};return Proofs}(_API3.default);exports.default=Proofs;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofsOwners=require("./ProofsOwners");var _ProofsOwners2=_interopRequireDefault(_ProofsOwners);var _ProofsEditors=require("./ProofsEditors");var _ProofsEditors2=_interopRequireDefault(_ProofsEditors);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _FileStatus=require("../enum/FileStatus");var _FileStatus2=_interopRequireDefault(_FileStatus);var _constants=require("../util/constants");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}var Proofs=function(_API){_inherits(Proofs,_API);function Proofs(client){_classCallCheck(this,Proofs);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _ProofsOwners2.default(client);_this.editors=new _ProofsEditors2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);return _this}Proofs.prototype.setWorkflow=function setWorkflow(proofId,workflowId){var _this2=this;return this.client.request("proofs.normalize-workflow",{proofId:proofId,workflowId:workflowId}).then(function(){return _this2.client.request("proofs.set-workflow",{proofId:proofId,workflowId:workflowId})})};Proofs.prototype.setTags=function setTags(proofId,tags){return this.client.request("proofs.set-tags",{relatedId:proofId,tag:tags.join(",")})};Proofs.prototype.deleteTag=function deleteTag(proofId,tag){return this.client.request("proofs.tag-delete",{relatedId:proofId,tag:tag})};Proofs.prototype.setFile=function setFile(proofId,fileId){var _this3=this;return this.client.request("proofs.set-file",{proofId:proofId,fileId:fileId}).then(function(){return _this3.client.request("proofs.distribute-file",{proofId:proofId})})};Proofs.prototype.create=function create(_ref){var _this4=this;var name=_ref.name,_ref$tags=_ref.tags,tags=_ref$tags===undefined?[]:_ref$tags,_ref$dueDate=_ref.dueDate,dueDate=_ref$dueDate===undefined?new Date(Date.now()+3*_constants.DAY_IN_MS):_ref$dueDate,messageToReviewers=_ref.messageToReviewers,workflow=_ref.workflow,file=_ref.file,group=_ref.group,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start;var shouldStart=start&&!group;return this.client.request("proofs.create",{title:name,dueDate:dueDate.toISOString(),description:messageToReviewers,groupId:group?group.id:undefined}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);return Promise.all([proof,tags.length&&_this4.setTags(proof.id,tags),workflow&&_this4.setWorkflow(proof.id,workflow.id),file&&_this4.setFile(proof.id,file.id)])}).then(function(_ref2){var proof=_ref2[0];return Promise.resolve(shouldStart&&_this4.start(proof.id)).then(function(){return proof})}).then(function(proof){if(workflow){proof.workflowId=workflow.id}if(file){proof.fileId=file.id;proof.fileStatus=_FileStatus2.default.UPLOADING}proof.calculateState();return proof})};Proofs.prototype.archive=function archive(proofId){return this.client.request("proofs.archive",{proofId:proofId})};Proofs.prototype.unarchive=function unarchive(proofId){return this.client.request("proofs.unarchive",{proofId:proofId})};Proofs.prototype.delete=function _delete(proofId){return this.client.request("proofs.delete",{proofId:proofId})};Proofs.prototype.return=function _return(proofId){return this.client.request("proofs.return",{proofId:proofId})};Proofs.prototype.start=function start(proofId){return this.client.request("proofs.start",{proofId:proofId})};Proofs.prototype.removeEditor=function removeEditor(id){return this.client.request("proofs.remove-editor",{proofId:id})};Proofs.prototype.load=function load(proofId){return this.client.request("proofs.load",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};Proofs.prototype.lock=function lock(proofId){return this.client.request("proofs.lock",{proofId:proofId})};Proofs.prototype.unlock=function unlock(proofId){return this.client.request("proofs.unlock",{proofId:proofId})};Proofs.prototype.requestUnlock=function requestUnlock(proofId){return this.client.request("proofs.request-unlock",{proofId:proofId})};return Proofs}(_API3.default);exports.default=Proofs;
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;exports.encryptComment=exports.decryptManagedPrivateKey=exports.generateWrappedSymmetricKey=exports.generatePasswordHash=exports.generateKeyPair=exports.generateKeyIV=exports.generateAuthorizationHeaders=exports.envelopeUnseal=exports.envelopeSeal=exports.encryptPrivateKey=exports.encryptFileBlock=exports.decryptPrivateKey=exports.decryptImage=exports.decryptFileBlock=exports.decryptComment=undefined;var _decryptComment=require("./decryptComment");var _decryptComment2=_interopRequireDefault(_decryptComment);var _decryptFileBlock=require("./decryptFileBlock");var _decryptFileBlock2=_interopRequireDefault(_decryptFileBlock);var _decryptImage=require("./decryptImage");var _decryptImage2=_interopRequireDefault(_decryptImage);var _decryptPrivateKey=require("./decryptPrivateKey");var _decryptPrivateKey2=_interopRequireDefault(_decryptPrivateKey);var _encryptFileBlock=require("./encryptFileBlock");var _encryptFileBlock2=_interopRequireDefault(_encryptFileBlock);var _encryptPrivateKey=require("./encryptPrivateKey");var _encryptPrivateKey2=_interopRequireDefault(_encryptPrivateKey);var _envelopes=require("./envelopes");var _generateAuthorizationHeaders=require("./generateAuthorizationHeaders");var _generateAuthorizationHeaders2=_interopRequireDefault(_generateAuthorizationHeaders);var _generateKeyIV=require("./generateKeyIV");var _generateKeyIV2=_interopRequireDefault(_generateKeyIV);var _generateKeyPair=require("./generateKeyPair");var _generateKeyPair2=_interopRequireDefault(_generateKeyPair);var _generatePasswordHash=require("./generatePasswordHash");var _generatePasswordHash2=_interopRequireDefault(_generatePasswordHash);var _generateWrappedSymmetricKey=require("./generateWrappedSymmetricKey");var _generateWrappedSymmetricKey2=_interopRequireDefault(_generateWrappedSymmetricKey);var _decryptManagedPrivateKey=require("./decryptManagedPrivateKey");var _decryptManagedPrivateKey2=_interopRequireDefault(_decryptManagedPrivateKey);var _encryptComment=require("./encryptComment");var _encryptComment2=_interopRequireDefault(_encryptComment);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.decryptComment=_decryptComment2.default;exports.decryptFileBlock=_decryptFileBlock2.default;exports.decryptImage=_decryptImage2.default;exports.decryptPrivateKey=_decryptPrivateKey2.default;exports.encryptFileBlock=_encryptFileBlock2.default;exports.encryptPrivateKey=_encryptPrivateKey2.default;exports.envelopeSeal=_envelopes.envelopeSeal;exports.envelopeUnseal=_envelopes.envelopeUnseal;exports.generateAuthorizationHeaders=_generateAuthorizationHeaders2.default;exports.generateKeyIV=_generateKeyIV2.default;exports.generateKeyPair=_generateKeyPair2.default;exports.generatePasswordHash=_generatePasswordHash2.default;exports.generateWrappedSymmetricKey=_generateWrappedSymmetricKey2.default;exports.decryptManagedPrivateKey=_decryptManagedPrivateKey2.default;exports.encryptComment=_encryptComment2.default;
1
+ "use strict";exports.__esModule=true;exports.decryptManagedPrivateKey=exports.generateWrappedSymmetricKey=exports.generatePasswordHash=exports.generateKeyPair=exports.generateKeyIV=exports.generateAuthorizationHeaders=exports.envelopeUnseal=exports.envelopeSeal=exports.encryptPrivateKey=exports.encryptFileBlock=exports.decryptPrivateKey=exports.decryptImage=exports.decryptFileBlock=exports.decryptComment=undefined;var _decryptComment=require("./decryptComment");var _decryptComment2=_interopRequireDefault(_decryptComment);var _decryptFileBlock=require("./decryptFileBlock");var _decryptFileBlock2=_interopRequireDefault(_decryptFileBlock);var _decryptImage=require("./decryptImage");var _decryptImage2=_interopRequireDefault(_decryptImage);var _decryptPrivateKey=require("./decryptPrivateKey");var _decryptPrivateKey2=_interopRequireDefault(_decryptPrivateKey);var _encryptFileBlock=require("./encryptFileBlock");var _encryptFileBlock2=_interopRequireDefault(_encryptFileBlock);var _encryptPrivateKey=require("./encryptPrivateKey");var _encryptPrivateKey2=_interopRequireDefault(_encryptPrivateKey);var _envelopes=require("./envelopes");var _generateAuthorizationHeaders=require("./generateAuthorizationHeaders");var _generateAuthorizationHeaders2=_interopRequireDefault(_generateAuthorizationHeaders);var _generateKeyIV=require("./generateKeyIV");var _generateKeyIV2=_interopRequireDefault(_generateKeyIV);var _generateKeyPair=require("./generateKeyPair");var _generateKeyPair2=_interopRequireDefault(_generateKeyPair);var _generatePasswordHash=require("./generatePasswordHash");var _generatePasswordHash2=_interopRequireDefault(_generatePasswordHash);var _generateWrappedSymmetricKey=require("./generateWrappedSymmetricKey");var _generateWrappedSymmetricKey2=_interopRequireDefault(_generateWrappedSymmetricKey);var _decryptManagedPrivateKey=require("./decryptManagedPrivateKey");var _decryptManagedPrivateKey2=_interopRequireDefault(_decryptManagedPrivateKey);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.decryptComment=_decryptComment2.default;exports.decryptFileBlock=_decryptFileBlock2.default;exports.decryptImage=_decryptImage2.default;exports.decryptPrivateKey=_decryptPrivateKey2.default;exports.encryptFileBlock=_encryptFileBlock2.default;exports.encryptPrivateKey=_encryptPrivateKey2.default;exports.envelopeSeal=_envelopes.envelopeSeal;exports.envelopeUnseal=_envelopes.envelopeUnseal;exports.generateAuthorizationHeaders=_generateAuthorizationHeaders2.default;exports.generateKeyIV=_generateKeyIV2.default;exports.generateKeyPair=_generateKeyPair2.default;exports.generatePasswordHash=_generatePasswordHash2.default;exports.generateWrappedSymmetricKey=_generateWrappedSymmetricKey2.default;exports.decryptManagedPrivateKey=_decryptManagedPrivateKey2.default;
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _Pin=require("./Pin");var _Pin2=_interopRequireDefault(_Pin);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _comment=require("../util/comment");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 commentSchema={__prepare:function __prepare(data){data._XY=_Pin2.default.parseValue(data.XY)},id:"CommentId",proofId:"ProofId",pin:function pin(data){return(new _Pin2.default).fromPin(data._XY)},user:function user(data){return(new _User2.default).fromUser(data)},comment$:"EncryptedComment",envelope:"Envelope",attachments:function attachments(data){if(data.Attachment){return[(new _File2.default).fromCommentAttachment(data)]}return[]},agreeCount:function agreeCount(data){return data.Agrees.length},pageNumber:(0,_transform.number)("Page"),mediaTime:function mediaTime(data){return data._XY.time==null?undefined:data._XY.time},mediaDuration:function mediaDuration(data){return data._XY.duration==null?undefined:data._XY.duration},createdDate:(0,_transform.date)("Timestamp"),updatedDate:(0,_transform.date)("Updated"),parentCommentId:(0,_transform.optional)("Parent"),metadata:(0,_transform.json)("Metadata",{}),state:function state(data){return+data.Done?_CommentState2.default.DONE:+data.Change?_CommentState2.default.TODO:_CommentState2.default.COMMENT}};var Comment=function(){function Comment(){_classCallCheck(this,Comment)}Comment.prototype.fromComment=function fromComment(commentData){(0,_transform2.default)(this,commentSchema,commentData);return this};Comment.prototype.fromRawComment=function fromRawComment(rawComment){var parsed=(0,_comment.parseComment)(rawComment);this.raw=parsed.raw;this.text=parsed.text;this.html=parsed.html;this.tokens=parsed.tokens;return this};return Comment}();exports.default=Comment;
1
+ "use strict";exports.__esModule=true;var _escapeHtml=require("escape-html");var _escapeHtml2=_interopRequireDefault(_escapeHtml);var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User=require("./User");var _User2=_interopRequireDefault(_User);var _Pin=require("./Pin");var _Pin2=_interopRequireDefault(_Pin);var _File=require("./File");var _File2=_interopRequireDefault(_File);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _constants=require("../util/constants");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 commentSchema={__prepare:function __prepare(data){data._XY=_Pin2.default.parseValue(data.XY)},id:"CommentId",pin:function pin(data){return(new _Pin2.default).fromPin(data._XY)},user:function user(data){return(new _User2.default).fromUser(data)},comment$:"EncryptedComment",envelope:"Envelope",attachments:function attachments(data){if(data.Attachment){return[(new _File2.default).fromCommentAttachment(data)]}return[]},agreeCount:function agreeCount(data){return data.Agrees.length},pageNumber:(0,_transform.number)("Page"),mediaTime:function mediaTime(data){return data._XY.time==null?undefined:data._XY.time},mediaDuration:function mediaDuration(data){return data._XY.duration==null?undefined:data._XY.duration},createdDate:(0,_transform.date)("Timestamp"),updatedDate:(0,_transform.date)("Updated"),parentCommentId:(0,_transform.optional)("Parent"),metadata:(0,_transform.json)("Metadata",{}),state:function state(data){return+data.Done?_CommentState2.default.DONE:+data.Change?_CommentState2.default.TODO:_CommentState2.default.COMMENT}};var Comment=function(){function Comment(){_classCallCheck(this,Comment)}Comment.prototype.fromComment=function fromComment(commentData){(0,_transform2.default)(this,commentSchema,commentData);return this};Comment.prototype.fromRawComment=function fromRawComment(rawComment){this.raw=rawComment;var escaped=(0,_escapeHtml2.default)(rawComment);this.text=escaped.replace(_constants.MENTION_REGEX,function(_,id,label){return label});var mentionIndex=0;this.html=escaped.replace(_constants.MENTION_REGEX,function(match,id,label,startIndex){var index=mentionIndex++;return"<span "+"data-mention "+('data-mention-index="'+index+'" ')+('data-mention-user-id="'+id+'" ')+('data-mention-user-label="'+label.replace(/"/,'\\"')+'" ')+('data-mention-start-index="'+startIndex+'" ')+('data-mention-end-index="'+(startIndex+match.length)+'" ')+('data-mention-length="'+match.length+'">')+label+"</span>"});var mentions=[];rawComment.replace(_constants.MENTION_REGEX,function(match,id,label,startIndex){mentions.push({id:id,label:label,index:startIndex,length:match.length})});var tokens=[];var previousIndex=0;mentions.forEach(function(mention){var before=rawComment.slice(previousIndex,mention.index);previousIndex=mention.index+mention.length;if(before){tokens.push({type:"text",value:before})}tokens.push({type:"mention",value:mention})});var remainder=rawComment.slice(previousIndex);if(remainder){tokens.push({type:"text",value:remainder})}this.tokens=tokens;return this};return Comment}();exports.default=Comment;
@@ -38,6 +38,19 @@
38
38
  "body": ["oldPassword", "newPassword", "newPrivateKey"],
39
39
  "trailing": true
40
40
  },
41
+ "users.preferences-all": {
42
+ "method": "GET",
43
+ "path": "api/users/preferences/all"
44
+ },
45
+ "users.preferences-get": {
46
+ "method": "GET",
47
+ "path": "api/users/preferences/get"
48
+ },
49
+ "users.preferences-update": {
50
+ "method": "POST",
51
+ "path": "api/users/preferences/update",
52
+ "body": ["defaultDate", "defaultMessage"]
53
+ },
41
54
  "dashboard.inbox": {
42
55
  "method": "GET",
43
56
  "path": "/api/proofs/dashboard/proofin",
@@ -58,12 +71,6 @@
58
71
  "path": "/api/proofs/search",
59
72
  "body": ["query", "all", "filterBy"]
60
73
  },
61
- "dashboard.groups.filter-by": {
62
- "method": "GET",
63
- "path": "/api/proofs/dashboard/groups",
64
- "chain": ["filterBy"],
65
- "trailing": true
66
- },
67
74
  "users.by-id": {
68
75
  "method": "GET",
69
76
  "path": "/api/users",
@@ -218,11 +225,6 @@
218
225
  "chain": ["proofId"],
219
226
  "trailing": true
220
227
  },
221
- "proofs.request-access": {
222
- "method": "GET",
223
- "path": "/api/proofs/requestaccess",
224
- "chain": ["proofId"]
225
- },
226
228
  "proofs.lock": {
227
229
  "method": "GET",
228
230
  "path": "/api/proofs/lock/",
@@ -384,11 +386,6 @@
384
386
  "path": "/api/proofs/comment/updatestatus",
385
387
  "body": ["commentId", "change", "done"]
386
388
  },
387
- "comments.create": {
388
- "method": "POST",
389
- "path": "/api/proofs/comment/create",
390
- "body": ["proofId", "page", "envelope", "encryptedComment", "xy", "parent", "mentions", "metadata", "creationToken", "change", "done"]
391
- },
392
389
  "proofs-owners.add": {
393
390
  "version": 2,
394
391
  "method": "POST",