@pageproof/sdk-pr 235.0.1591565533294 → 236.0.1590550892287
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 +0 -6
- package/lib/api/Encryption.d.ts +3 -8
- package/lib/api/Encryption.js +1 -1
- package/lib/api/admin/TeamUsers.d.ts +0 -20
- package/lib/api/admin/TeamUsers.js +0 -27
- package/lib/network/endpoints.json +0 -6
- package/lib/pageproof.js +1 -1
- package/package.json +1 -1
- package/lib/types/GenericUserDefinition.d.ts +0 -13
- package/lib/types/GenericUserDefinition.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.0.0-beta.123
|
|
4
|
-
|
|
5
|
-
Released on the 8th of June 2020.
|
|
6
|
-
|
|
7
|
-
- Support for removing user/users from a team by Administrators. See [TeamUsers.remove](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/admin/TeamUsers.js~TeamUsers.html#instance-method-remove).
|
|
8
|
-
|
|
9
3
|
## 2.0.0-beta.122
|
|
10
4
|
|
|
11
5
|
Released on the 25th of May 2020.
|
package/lib/api/Encryption.d.ts
CHANGED
|
@@ -5,23 +5,18 @@ declare class Encryption extends API {
|
|
|
5
5
|
* Decrypts a generic piece of encrypted data.
|
|
6
6
|
*
|
|
7
7
|
* @example <caption>Decrypting a thumbnail from the CDN (internal use only)</caption>
|
|
8
|
-
* const { url } = thumbnail;
|
|
9
|
-
* const { version, envelope } = key;
|
|
8
|
+
* const { url, envelope } = thumbnail;
|
|
10
9
|
* const response = await fetch(url);
|
|
11
10
|
* const data = await response.blob();
|
|
12
|
-
* const thumbnail = await client.encryption.decrypt({
|
|
13
|
-
* version, data, envelope,
|
|
14
|
-
* });
|
|
11
|
+
* const thumbnail = await client.encryption.decrypt({ data, envelope });
|
|
15
12
|
* const image = URL.createObjectURL(thumbnail);
|
|
16
13
|
* document.querySelector('#thumbnail').src = image;
|
|
17
14
|
*
|
|
18
15
|
* @param {object} options
|
|
19
|
-
* @param {number} options.version The encryption version number
|
|
20
16
|
* @param {Buffer|Blob} options.data The data to decrypt (Blob or Buffer depending on the platform)
|
|
21
17
|
* @param {string} options.envelope The envelope
|
|
22
18
|
*/
|
|
23
|
-
decrypt({
|
|
24
|
-
version: number;
|
|
19
|
+
decrypt({ data, envelope, }: {
|
|
25
20
|
data: Blob | Buffer;
|
|
26
21
|
envelope: string;
|
|
27
22
|
}): any;
|
package/lib/api/Encryption.js
CHANGED
|
@@ -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 Encryption=function(_API){_inherits(Encryption,_API);function Encryption(){_classCallCheck(this,Encryption);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Encryption.prototype.decrypt=function decrypt(_ref){var _this2=this;var
|
|
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 Encryption=function(_API){_inherits(Encryption,_API);function Encryption(){_classCallCheck(this,Encryption);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Encryption.prototype.decrypt=function decrypt(_ref){var _this2=this;var data=_ref.data,envelope=_ref.envelope;var bluffer=new _bluffer2.default;var content=typeof data==="string"?bluffer.create(data):Promise.resolve(data);return content.then(function(buffer){return bluffer.readBase64(buffer)}).then(function(buffer){return _this2.client.crypto().decryptBytes(buffer,envelope,_this2.client.session.privateKeyPEM,[],[])}).then(function(base64){return bluffer.createBase64(base64)})};return Encryption}(_API3.default);exports.default=Encryption;
|
|
@@ -50,26 +50,6 @@ declare class TeamUsers extends API {
|
|
|
50
50
|
* @returns {Promise}
|
|
51
51
|
*/
|
|
52
52
|
invite(emailOrEmails: any): Promise<any>;
|
|
53
|
-
/**
|
|
54
|
-
* Removes a user from the team.
|
|
55
|
-
*
|
|
56
|
-
* @example <caption>Removing single user by user email</caption>
|
|
57
|
-
* await admin.team.users.remove({email: 'existinguser@domain.com'});
|
|
58
|
-
*
|
|
59
|
-
* @example <caption>Removing single user by user id</caption>
|
|
60
|
-
* await admin.team.users.remove({id: 'ULVRHSLLP69ACHCT'});
|
|
61
|
-
*
|
|
62
|
-
* @example <caption>Removing multiple users (by email/ user id)</caption>
|
|
63
|
-
* await admin.team.users.remove([
|
|
64
|
-
* {email: 'existinguser@domain.com'},
|
|
65
|
-
* {id: 'ULVRHSLLP69ACHCT'},
|
|
66
|
-
* ]);
|
|
67
|
-
*
|
|
68
|
-
* @since v2.0.0-beta.123
|
|
69
|
-
* @param {GenericUserDefinition|Array<GenericUserDefinition>} userOrUsers The user or users to remove from team.
|
|
70
|
-
* @returns {Promise}
|
|
71
|
-
*/
|
|
72
|
-
remove(userOrUsers: GenericUserDefinition | GenericUserDefinition[]): Promise<any>;
|
|
73
53
|
}
|
|
74
54
|
import API from "../API";
|
|
75
55
|
import User from "../../models/User";
|
|
@@ -120,33 +120,6 @@ var TeamUsers = function (_API) {
|
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
/**
|
|
124
|
-
* Removes a user from the team.
|
|
125
|
-
*
|
|
126
|
-
* @example <caption>Removing single user by user email</caption>
|
|
127
|
-
* await admin.team.users.remove({email: 'existinguser@domain.com'});
|
|
128
|
-
*
|
|
129
|
-
* @example <caption>Removing single user by user id</caption>
|
|
130
|
-
* await admin.team.users.remove({id: 'ULVRHSLLP69ACHCT'});
|
|
131
|
-
*
|
|
132
|
-
* @example <caption>Removing multiple users (by email/ user id)</caption>
|
|
133
|
-
* await admin.team.users.remove([
|
|
134
|
-
* {email: 'existinguser@domain.com'},
|
|
135
|
-
* {id: 'ULVRHSLLP69ACHCT'},
|
|
136
|
-
* ]);
|
|
137
|
-
*
|
|
138
|
-
* @since v2.0.0-beta.123
|
|
139
|
-
* @param {GenericUserDefinition|Array<GenericUserDefinition>} userOrUsers The user or users to remove from team.
|
|
140
|
-
* @returns {Promise}
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
TeamUsers.prototype.remove = function remove(userOrUsers) {
|
|
145
|
-
return this.client.request('admin.team.users.remove-from-team', {
|
|
146
|
-
users: [].concat(userOrUsers)
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
|
|
150
123
|
return TeamUsers;
|
|
151
124
|
}(_API3.default);
|
|
152
125
|
|
|
@@ -654,12 +654,6 @@
|
|
|
654
654
|
"path": "/api/admin/member/invite",
|
|
655
655
|
"body": ["emails"]
|
|
656
656
|
},
|
|
657
|
-
"admin.team.users.remove-from-team": {
|
|
658
|
-
"version": 2,
|
|
659
|
-
"method": "POST",
|
|
660
|
-
"path": "/api/admin/member/remove",
|
|
661
|
-
"body": ["users"]
|
|
662
|
-
},
|
|
663
657
|
"admin.team.features.load": {
|
|
664
658
|
"method": "GET",
|
|
665
659
|
"path": "/api/admin/settings",
|