@pageproof/sdk-pr 90.0.1538971062335 → 92.0.1530833367136

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +0 -55
  2. package/README.md +2 -5
  3. package/lib/adapters/ICryptoAdapter.js +1 -1
  4. package/lib/adapters/SchedulerCryptoAdapter.js +1 -1
  5. package/lib/adapters/SyncCryptoAdapter.js +1 -1
  6. package/lib/api/Comments.js +1 -1
  7. package/lib/api/Dashboard.js +1 -1
  8. package/lib/api/Files.js +1 -1
  9. package/lib/api/Proofs.js +1 -1
  10. package/lib/api/ProofsGroups.js +1 -1
  11. package/lib/api/admin/Admin.js +1 -5
  12. package/lib/api/admin/Team.js +3 -19
  13. package/lib/api/admin/TeamUsers.js +1 -5
  14. package/lib/core/PageProof.js +1 -1
  15. package/lib/crypto/index.js +1 -1
  16. package/lib/enum/CommentState.js +1 -1
  17. package/lib/enum/ProofState.js +1 -1
  18. package/lib/enum/ProofStatus.js +1 -1
  19. package/lib/enum/index.js +1 -1
  20. package/lib/index.js +1 -5
  21. package/lib/models/Comment.js +1 -1
  22. package/lib/models/Proof.js +1 -1
  23. package/lib/network/endpoints.json +3 -60
  24. package/lib/pageproof.js +2 -2
  25. package/lib/sync-crypto-adapter.js +1 -1
  26. package/lib/util/constants.js +1 -1
  27. package/lib/util/getSlug.js +1 -0
  28. package/lib/worker-crypto-adapter.js +1 -1
  29. package/lib/{worker.35eb8871.js → worker.434ad608.js} +2 -2
  30. package/lib/xhr-request-adapter.js +1 -1
  31. package/package.json +1 -1
  32. package/lib/api/DashboardGroups.js +0 -1
  33. package/lib/api/Preferences.js +0 -1
  34. package/lib/api/admin/TeamDashboard.js +0 -189
  35. package/lib/crypto/encryptComment.js +0 -1
  36. package/lib/enum/FileCategory.js +0 -1
  37. package/lib/enum/Preference.js +0 -1
  38. package/lib/enum/ProofType.js +0 -1
  39. package/lib/models/Preference.js +0 -1
  40. package/lib/types/EncryptedComment.js +0 -1
  41. package/lib/types/TeamDashboardPagination.js +0 -1
  42. package/lib/util/comment.js +0 -1
  43. package/lib/util/creationToken.js +0 -1
  44. package/lib/util/throttle.js +0 -1
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PageProofXHRRequestAdapter=t():e.PageProofXHRRequestAdapter=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},s=o(1),u=function(e){return e&&e.__esModule?e:{default:e}}(s),p=o(2),c=o(3)("XHRRequestAdapter"),l={applicationId:null,endpoint:null,key:null,async:!0},d=function(e){function t(o){n(this,t);var a=r(this,e.call(this));if(a.options=i({},l,o),a.options.key&&!a.options.applicationId)throw new Error("You must provide your application id (applicationId).");return a}return a(t,e),t.prototype.send=function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e.method+" "+e.path),new Promise(function(n,r){var a=new XMLHttpRequest;if(a.onreadystatechange=function(){if(4===a.readyState){c(e.method+" "+e.path+" ("+a.status+")");var t={};try{a.getAllResponseHeaders().split("\n").forEach(function(e){if(e){var o=e.split(": ",2),n=o[0],r=o[1];t[n.toLowerCase()]=r}})}catch(e){c(e)}n({status:a.status,headers:t,body:a.responseText})}},a.onerror=function(){c(e.method+" "+e.path+" (Unknown error)"),r(new Error("A network level error occurred."))},o.onUploadProgress&&(a.upload.onprogress=function(e){e.loaded&&e.total&&o.onUploadProgress(e.loaded/e.total*100)}),o.onDownloadProgress){var i=null;a.onprogress=function(e){if(null===i){i=e.total;try{i||(i=parseInt(a.getResponseHeader("ppcl"),10))}catch(e){i=0}}i&&o.onDownloadProgress(e.loaded/i*100)}}a.open(e.method,t.options.endpoint+e.path+e.query,t.options.async),e.credentials&&(a.withCredentials=!0),Object.keys(e.headers).forEach(function(t){var o=e.headers[t];null!=o&&a.setRequestHeader(t,o)}),t.options.key&&a.setRequestHeader(p.SUBSCRIPTION_KEY_HEADER,t.options.key),t.options.applicationId&&a.setRequestHeader(p.DEVICE_ID_HEADER,t.options.applicationId),a.send(e.body)})},t}(u.default);t.default=d},function(e,t,o){"use strict";function n(){}t.__esModule=!0,n.__adapter__="IRequestAdapter",t.default=n},function(e,t,o){"use strict";t.__esModule=!0;t.TOKEN_HEADER="x-authorization-token",t.HMAC_HEADER="x-authorization-hmac",t.TIMESTAMP_HEADER="x-timestamp",t.DEVICE_ID_HEADER="x-device-id",t.SUBSCRIPTION_KEY_HEADER="ocp-apim-subscription-key",t.SDK_VERSION_HEADER="x-pageproof-javascript-sdk",t.RETRY_AFTER_HEADER="retry-after",t.BYTES_PER_BLOCK=2097152,t.MENTION_REGEX=/@{(U[a-zA-Z0-9]{15}|~everyone)}{(.*?)}/g,t.ISO_REGEX=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,t.DEFAULT_ISO_DATE="0001-01-01T00:00:00",t.DAY_IN_MS=864e5,t.COMMENT_CACHE_PREFIX="comment",t.THUMBNAIL_CACHE_PREFIX="thumbnail"},function(e,t,o){"use strict";e.exports=function e(){return e}}])});
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PageProofXHRRequestAdapter=t():e.PageProofXHRRequestAdapter=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},s=o(1),u=function(e){return e&&e.__esModule?e:{default:e}}(s),p=o(2),c=o(3)("XHRRequestAdapter"),l={applicationId:null,endpoint:null,key:null,async:!0},d=function(e){function t(o){n(this,t);var a=r(this,e.call(this));if(a.options=i({},l,o),a.options.key&&!a.options.applicationId)throw new Error("You must provide your application id (applicationId).");return a}return a(t,e),t.prototype.send=function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e.method+" "+e.path),new Promise(function(n,r){var a=new XMLHttpRequest;if(a.onreadystatechange=function(){if(4===a.readyState){c(e.method+" "+e.path+" ("+a.status+")");var t={};try{a.getAllResponseHeaders().split("\n").forEach(function(e){if(e){var o=e.split(": ",2),n=o[0],r=o[1];t[n.toLowerCase()]=r}})}catch(e){c(e)}n({status:a.status,headers:t,body:a.responseText})}},a.onerror=function(){c(e.method+" "+e.path+" (Unknown error)"),r(new Error("A network level error occurred."))},o.onUploadProgress&&(a.upload.onprogress=function(e){e.loaded&&e.total&&o.onUploadProgress(e.loaded/e.total*100)}),o.onDownloadProgress){var i=null;a.onprogress=function(e){if(null===i){i=e.total;try{i||(i=parseInt(a.getResponseHeader("ppcl"),10))}catch(e){i=0}}i&&o.onDownloadProgress(e.loaded/i*100)}}a.open(e.method,t.options.endpoint+e.path+e.query,t.options.async),e.credentials&&(a.withCredentials=!0),Object.keys(e.headers).forEach(function(t){var o=e.headers[t];null!=o&&a.setRequestHeader(t,o)}),t.options.key&&a.setRequestHeader(p.SUBSCRIPTION_KEY_HEADER,t.options.key),t.options.applicationId&&a.setRequestHeader(p.DEVICE_ID_HEADER,t.options.applicationId),a.send(e.body)})},t}(u.default);t.default=d},function(e,t,o){"use strict";function n(){}t.__esModule=!0,n.__adapter__="IRequestAdapter",t.default=n},function(e,t,o){"use strict";t.__esModule=!0;t.TOKEN_HEADER="x-authorization-token",t.HMAC_HEADER="x-authorization-hmac",t.TIMESTAMP_HEADER="x-timestamp",t.DEVICE_ID_HEADER="x-device-id",t.SUBSCRIPTION_KEY_HEADER="ocp-apim-subscription-key",t.SDK_VERSION_HEADER="x-pageproof-javascript-sdk",t.RETRY_AFTER_HEADER="retry-after",t.BYTES_PER_BLOCK=2097152,t.MENTION_REGEX=/@{(U[a-zA-Z0-9]{15})}{(.*?)}/g,t.ISO_REGEX=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,t.DEFAULT_ISO_DATE="0001-01-01T00:00:00",t.DAY_IN_MS=864e5,t.COMMENT_CACHE_PREFIX="comment",t.THUMBNAIL_CACHE_PREFIX="thumbnail"},function(e,t,o){"use strict";e.exports=function e(){return e}}])});
2
2
  //# sourceMappingURL=xhr-request-adapter.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pageproof/sdk-pr",
3
3
  "description": "The official PageProof SDK",
4
- "version": "90.0.1538971062335",
4
+ "version": "92.0.1530833367136",
5
5
  "main": "lib/index.js",
6
6
  "browser": "lib/pageproof.js",
7
7
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofGroup=require("../models/ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);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 transformGroups(groups){return(groups||[]).map(function(groupData){return(new _ProofGroup2.default).fromProofGroup(groupData)})}var DashboardGroups=function(_API){_inherits(DashboardGroups,_API);function DashboardGroups(){_classCallCheck(this,DashboardGroups);return _possibleConstructorReturn(this,_API.apply(this,arguments))}DashboardGroups.prototype._loadGroups=function _loadGroups(filterBy){return this.client.request("dashboard.groups.filter-by",{filterBy:filterBy}).then(function(response){return transformGroups(response.data)})};DashboardGroups.prototype.current=function current(){return this._loadGroups("current")};return DashboardGroups}(_API3.default);exports.default=DashboardGroups;
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Preference=require("../models/Preference");var _Preference2=_interopRequireDefault(_Preference);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 mapPreference(preferenceData){return(new _Preference2.default).fromPreference(preferenceData)}function sortPreferences(names,preferences){var sorted=new Array(names.length);preferences.forEach(function(preference){sorted[names.indexOf(preference.name)]=preference});return sorted}var Preferences=function(_API){_inherits(Preferences,_API);function Preferences(){_classCallCheck(this,Preferences);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Preferences.prototype.all=function all(){return this.client.request("preferences.all")};Preferences.prototype.get=function get(nameOrNames){var names=[].concat(nameOrNames);return this.client.request("preferences.get",{preferences:names}).then(function(response){return response.data.map(mapPreference)}).then(function(preferences){return typeof nameOrNames==="string"?preferences[0]:sortPreferences(names,preferences)})};Preferences.prototype.update=function update(preferenceNameOrPreferences,preferenceValue){var _ref;var updatedPreferences=typeof preferenceValue!=="undefined"?(_ref={},_ref[preferenceNameOrPreferences]=preferenceValue,_ref):preferenceNameOrPreferences;return this.client.request("preferences.update",updatedPreferences)};Preferences.prototype.reset=function reset(nameOrNames){return this.client.request("preferences.reset",{preferences:[].concat(nameOrNames)})};return Preferences}(_API3.default);exports.default=Preferences;
@@ -1,189 +0,0 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _API2 = require('../API');
6
-
7
- var _API3 = _interopRequireDefault(_API2);
8
-
9
- var _Proof = require('../../models/Proof');
10
-
11
- var _Proof2 = _interopRequireDefault(_Proof);
12
-
13
- var _ProofStatus = require('../../enum/ProofStatus');
14
-
15
- var _ProofStatus2 = _interopRequireDefault(_ProofStatus);
16
-
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
19
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
-
21
- 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; }
22
-
23
- 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; } /* Copyright (C) 2018 PageProof Holdings Limited - All Rights Reserved.
24
- * Unauthorized copying of this file, via any medium is strictly prohibited.
25
- * Proprietary and confidential.
26
- */
27
-
28
-
29
- var TABS = {
30
- inbox: 'ProofIn',
31
- sent: 'ProofSent',
32
- outbox: 'ProofOut',
33
- search: 'Proofs'
34
- };
35
-
36
- function transformTeamTab(data, name) {
37
- var tab = {};
38
- tab.proofs = transformProofs(data[TABS[name]]);
39
- tab.total = data.ProofsNumber;
40
- return tab;
41
- }
42
-
43
- function transformProofs(proofs) {
44
- return (proofs || []).map(function (proofData) {
45
- return new _Proof2.default().fromProof(proofData);
46
- });
47
- }
48
-
49
- var TeamDashboard = function (_API) {
50
- _inherits(TeamDashboard, _API);
51
-
52
- function TeamDashboard() {
53
- _classCallCheck(this, TeamDashboard);
54
-
55
- return _possibleConstructorReturn(this, _API.apply(this, arguments));
56
- }
57
-
58
- /**
59
- * Loads all the proofs in the team's inbox.
60
- *
61
- * @since 2.0.0-beta.54
62
- * @param {number} page The page number
63
- * @returns {Promise<TeamDashboardPagination>}
64
- */
65
- TeamDashboard.prototype.inbox = function inbox(page) {
66
- return this._loadSingleTeamTabProofs('inbox', { page: page });
67
- };
68
-
69
- /**
70
- * Loads all the proofs in the team's sent box.
71
- *
72
- * @since 2.0.0-beta.54
73
- * @param {number} page The page number
74
- * @returns {Promise<TeamDashboardPagination>}
75
- */
76
-
77
-
78
- TeamDashboard.prototype.sent = function sent(page) {
79
- return this._loadSingleTeamTabProofs('sent', { page: page });
80
- };
81
-
82
- /**
83
- * Loads all the proofs in the team's outbox.
84
- *
85
- * @since 2.0.0-beta.54
86
- * @param {number} page The page number
87
- * @returns {Promise<TeamDashboardPagination>}
88
- */
89
-
90
-
91
- TeamDashboard.prototype.outbox = function outbox(page) {
92
- return this._loadSingleTeamTabProofs('outbox', { page: page });
93
- };
94
-
95
- /** @private */
96
-
97
-
98
- TeamDashboard.prototype._loadSingleTeamTabProofs = function _loadSingleTeamTabProofs(name, params) {
99
- return this.client.request('team.dashboard.' + name, params).then(function (response) {
100
- return transformTeamTab(response.data, name);
101
- }).then(function (dashboard) {
102
- return dashboard;
103
- });
104
- };
105
-
106
- /**
107
- * Loads all of the proofs in the team.
108
- *
109
- *
110
- * @since 2.0.0-beta.54
111
- * @param {number} page The page number
112
- * @returns {Promise<TeamDashboardPagination>}
113
- */
114
-
115
-
116
- TeamDashboard.prototype.everything = function everything(page) {
117
- return this.search(undefined, { everything: true, page: page });
118
- };
119
-
120
- /**
121
- * Loads all the approved proofs in the team.
122
- *
123
- *
124
- * @since 2.0.0-beta.54
125
- * @param {number} page The page number
126
- * @returns {Promise<TeamDashboardPagination>}
127
- */
128
-
129
-
130
- TeamDashboard.prototype.approved = function approved(page) {
131
- return this.search(undefined, { status: _ProofStatus2.default.APPROVED, page: page });
132
- };
133
-
134
- /**
135
- * Loads all the archived proofs in the team.
136
- *
137
- * @since 2.0.0-beta.54
138
- * @param {number} page The page number
139
- * @returns {Promise<TeamDashboardPagination>}
140
- */
141
-
142
-
143
- TeamDashboard.prototype.archived = function archived(page) {
144
- return this.search(undefined, { status: _ProofStatus2.default.ARCHIVED, page: page });
145
- };
146
-
147
- /**
148
- * Searches all the proofs in the team.
149
- *
150
- *
151
- * @since 2.0.0-beta.54
152
- * @param {string} query The search query
153
- * @param {object} [options] Advanced options
154
- * @param {ProofStatus|Array<ProofStatus>} [options.status] The proof status (or statuses)
155
- * @param {boolean} [options.everything] Whether to load every proof the user has access to
156
- * @param {number} [options.page] The page number for team dashboard
157
- * @returns {Promise<TeamDashboardPagination>}
158
- */
159
-
160
-
161
- TeamDashboard.prototype.search = function search(query) {
162
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
163
- var status = options.status,
164
- everything = options.everything,
165
- page = options.page;
166
-
167
- return this._loadTeamSearchProofs({
168
- query: query,
169
- filterBy: typeof status === 'undefined' ? undefined // no status filter
170
- : [].concat(status).join(','), // one or more statuses
171
- all: everything ? 1 : 0,
172
- page: page
173
- });
174
- };
175
-
176
- /** @private */
177
-
178
-
179
- TeamDashboard.prototype._loadTeamSearchProofs = function _loadTeamSearchProofs(params) {
180
- return this.client.request('team.dashboard.search', params).then(function (response) {
181
- return transformTeamTab(response.data, 'search');
182
- });
183
- };
184
-
185
- return TeamDashboard;
186
- }(_API3.default);
187
-
188
- exports.default = TeamDashboard;
189
- //# sourceMappingURL=TeamDashboard.js.map
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var _aes=require("crypto-js/aes");var _envelopes=require("./envelopes");var _generateKeyIV=require("./generateKeyIV");var _generateKeyIV2=_interopRequireDefault(_generateKeyIV);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function encryptComment(comment,publicKeyPEMs){return(0,_generateKeyIV2.default)().then(function(_ref){var key=_ref.key,iv=_ref.iv,keyIV=_ref.keyIV;return Promise.all([key,iv,(0,_envelopes.envelopeSeal)(keyIV,publicKeyPEMs)])}).then(function(_ref2){var key=_ref2[0],iv=_ref2[1],envelope=_ref2[2];return{envelope:envelope,comment$:(0,_aes.encrypt)(comment,key,{iv:iv}).toString()}})}exports.default=encryptComment;
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var FileCategory={STATIC:"static",VIDEO:"video",AUDIO:"audio",WEB:"web"};exports.default=FileCategory;
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var Preference={DEFAULT_DUE_DATE:"dueDate",DEFAULT_MESSAGE_TO_REVIEWERS:"messageToReviewers",ENABLE_COLOR_BLIND_UI:"colorBlind"};exports.default=Preference;
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var ProofType={PROOF:1,BRIEF:2};exports.default=ProofType;
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var preferenceSchema={name:"Name",defaultValue:"DefaultValue",value:"Value"};var Preference=function(){function Preference(){_classCallCheck(this,Preference)}Preference.prototype.getValueOrDefault=function getValueOrDefault(){if(this.value===null){return this.defaultValue}return this.value};Preference.prototype.fromPreference=function fromPreference(preferenceData){(0,_transform2.default)(this,preferenceSchema,preferenceData);return this};return Preference}();exports.default=Preference;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;exports.getCommentTokens=exports.getCommentText=exports.getCommentMentions=exports.getCommentHTML=exports.getCommentEscaped=exports.parseComment=undefined;var _escapeHtml=require("escape-html");var _escapeHtml2=_interopRequireDefault(_escapeHtml);var _constants=require("../util/constants");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function getCommentEscaped(rawComment){return(0,_escapeHtml2.default)(rawComment)}function getCommentText(escapedComment){return escapedComment.replace(_constants.MENTION_REGEX,function(_,id,label){return label})}function getCommentHTML(escapedComment){var mentionIndex=0;return escapedComment.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>"})}function getCommentMentions(rawComment){var mentions=[];rawComment.replace(_constants.MENTION_REGEX,function(match,id,label,startIndex){mentions.push({id:id,label:label,index:startIndex,length:match.length})});return mentions}function getCommentTokens(rawComment){var mentions=getCommentMentions(rawComment);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})}return tokens}function parseComment(rawComment){var escapedComment=getCommentEscaped(rawComment);return{raw:rawComment,text:getCommentText(escapedComment),html:getCommentHTML(escapedComment),mentions:getCommentMentions(rawComment),tokens:getCommentTokens(rawComment)}}exports.parseComment=parseComment;exports.getCommentEscaped=getCommentEscaped;exports.getCommentHTML=getCommentHTML;exports.getCommentMentions=getCommentMentions;exports.getCommentText=getCommentText;exports.getCommentTokens=getCommentTokens;
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;var CREATION_TOKEN_LENGTH=32;function generateCreationToken(){var time=(new Date).getTime();var mask="abcdefghijklmnopqrstuvwxyz"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"0123456789"+"~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\";var result="";for(var i=CREATION_TOKEN_LENGTH;i>0;--i){result+=mask[Math.round(Math.random()*(mask.length-1))]}return result+"-"+time}exports.generateCreationToken=generateCreationToken;
@@ -1 +0,0 @@
1
- "use strict";exports.__esModule=true;function throttle(func,ms){var timeout=void 0;return function(){if(!timeout){timeout=setTimeout(function(){func();timeout=null},ms)}}}exports.default=throttle;