@pageproof/sdk-pr 263.0.1596579204625 → 263.0.1597722406400

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,11 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## 2.0.0-beta.133
3
+ ## 2.0.0-beta.134
4
4
 
5
- Released on the 7th of August 2020.
5
+ Released on the 19th of August 2020.
6
6
 
7
7
  - [[#263](https://github.com/PageProofCom/sdk/pull/263)] Support for loading next proof to review with in a group. See [ProofsGroups.next](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~ProofsGroups.html#instance-method-next)
8
8
 
9
+ ## 2.0.0-beta.133
10
+
11
+ Released on the 18th of August 2020.
12
+
13
+ - Added support for team email notification settings. See [TeamNotifications](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/admin/TeamNotifications.js~TeamNotifications.html)
14
+
9
15
  ## 2.0.0-beta.132
10
16
 
11
17
  Released on the 3rd of August 2020.
@@ -116,7 +116,7 @@ declare class ProofsGroups extends API {
116
116
  * @example <caption>Loading next proof to review out of all proofs of a group</caption>
117
117
  * await client.proofs.groups.next('PVNM8NTI1VSTCRN5');
118
118
  *
119
- * @since v2.0.0-beta.133
119
+ * @since v2.0.0-beta.134
120
120
  * @param {string} proofId The proof id user just has reviewed
121
121
  * @returns {Promise}
122
122
  */
@@ -20,6 +20,12 @@ declare class Team extends API {
20
20
  * @type {TeamFeatures}
21
21
  */
22
22
  features: TeamFeatures;
23
+ /**
24
+ * The Admin Team Preferences API.
25
+ *
26
+ * @type {TeamPreferences}
27
+ */
28
+ preferences: TeamPreferences;
23
29
  /**
24
30
  * The Admin Custom Webhooks API.
25
31
  *
@@ -37,5 +43,6 @@ import API from "../API";
37
43
  import TeamUsers from "./TeamUsers";
38
44
  import TeamDashboard from "./TeamDashboard";
39
45
  import TeamFeatures from "./TeamFeatures";
46
+ import TeamPreferences from "./TeamPreferences";
40
47
  import TeamCustomWebhooks from "./TeamCustomWebhooks";
41
48
  import TeamSCIM from "./TeamSCIM";
@@ -18,6 +18,10 @@ var _TeamFeatures = require('./TeamFeatures');
18
18
 
19
19
  var _TeamFeatures2 = _interopRequireDefault(_TeamFeatures);
20
20
 
21
+ var _TeamPreferences = require('./TeamPreferences');
22
+
23
+ var _TeamPreferences2 = _interopRequireDefault(_TeamPreferences);
24
+
21
25
  var _TeamCustomWebhooks = require('./TeamCustomWebhooks');
22
26
 
23
27
  var _TeamCustomWebhooks2 = _interopRequireDefault(_TeamCustomWebhooks);
@@ -52,9 +56,15 @@ var Team = function (_API) {
52
56
 
53
57
 
54
58
  /**
55
- * The Admin Team Dashboard API.
59
+ * The Admin Team Features API.
56
60
  *
57
- * @type {TeamDashboard}
61
+ * @type {TeamFeatures}
62
+ */
63
+
64
+ /**
65
+ * The Admin Team Users API.
66
+ *
67
+ * @type {TeamUsers}
58
68
  */
59
69
  function Team(client) {
60
70
  _classCallCheck(this, Team);
@@ -65,6 +75,7 @@ var Team = function (_API) {
65
75
  _this.users = new _TeamUsers2.default(client);
66
76
  _this.dashboard = new _TeamDashboard2.default(client);
67
77
  _this.features = new _TeamFeatures2.default(client);
78
+ _this.preferences = new _TeamPreferences2.default(client);
68
79
  _this.customWebhooks = new _TeamCustomWebhooks2.default(client);
69
80
  _this.scim = new _TeamSCIM2.default(client);
70
81
  return _this;
@@ -78,15 +89,16 @@ var Team = function (_API) {
78
89
 
79
90
 
80
91
  /**
81
- * The Admin Team Features API.
92
+ * The Admin Team Preferences API.
82
93
  *
83
- * @type {TeamFeatures}
94
+ * @type {TeamPreferences}
84
95
  */
85
96
 
97
+
86
98
  /**
87
- * The Admin Team Users API.
99
+ * The Admin Team Dashboard API.
88
100
  *
89
- * @type {TeamUsers}
101
+ * @type {TeamDashboard}
90
102
  */
91
103
 
92
104
 
@@ -0,0 +1,31 @@
1
+ export default TeamNotifications;
2
+ declare class TeamNotifications extends API {
3
+ constructor(client: any);
4
+ /**
5
+ * Loads the administrator's team notifications.
6
+ *
7
+ * @example
8
+ * const admin = await client.admin();
9
+ * const preferences = admin.team.preferences.notifications.load();
10
+ *
11
+ * @since v2.0.0-beta.133
12
+ * @returns {Promise<TeamNotifications>}
13
+ */
14
+ load(): Promise<TeamNotifications>;
15
+ /**
16
+ * Set the notifications preferences for the administrator's team.
17
+ *
18
+ * @example <caption>Disabling the owner add email from admin</caption>
19
+ * const admin = await client.admin();
20
+ * const preferences = admin.team.preferences.notifications.set({ownerAddedByAdmin: false});
21
+ *
22
+ * @since v2.0.0-beta.133
23
+ * @param {object} options
24
+ * @param {boolean} options.ownerAddedByAdmin Whether the email should be sent or not to other owners, when an owner added on a proof by admin.
25
+ * @returns {Promise}
26
+ */
27
+ set({ ownerAddedByAdmin, }: {
28
+ ownerAddedByAdmin: boolean;
29
+ }): Promise<any>;
30
+ }
31
+ import API from "../API";
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _API2 = require('../API');
6
+
7
+ var _API3 = _interopRequireDefault(_API2);
8
+
9
+ var _TeamNotifications = require('../../models/TeamNotifications');
10
+
11
+ var _TeamNotifications2 = _interopRequireDefault(_TeamNotifications);
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
+
17
+ 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; }
18
+
19
+ 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.
20
+ * Unauthorized copying of this file, via any medium is strictly prohibited.
21
+ * Proprietary and confidential.
22
+ */
23
+
24
+
25
+ var TeamNotifications = function (_API) {
26
+ _inherits(TeamNotifications, _API);
27
+
28
+ function TeamNotifications() {
29
+ _classCallCheck(this, TeamNotifications);
30
+
31
+ return _possibleConstructorReturn(this, _API.apply(this, arguments));
32
+ }
33
+
34
+ /**
35
+ * Loads the administrator's team notifications.
36
+ *
37
+ * @example
38
+ * const admin = await client.admin();
39
+ * const preferences = admin.team.preferences.notifications.load();
40
+ *
41
+ * @since v2.0.0-beta.133
42
+ * @returns {Promise<TeamNotifications>}
43
+ */
44
+ TeamNotifications.prototype.load = function load() {
45
+ return this.client.request('admin.team.preferences.notifications.load').then(function (response) {
46
+ if (response.data) {
47
+ return new _TeamNotifications2.default().fromTeamNotifications(response.data);
48
+ }
49
+ return null;
50
+ });
51
+ };
52
+
53
+ /**
54
+ * Set the notifications preferences for the administrator's team.
55
+ *
56
+ * @example <caption>Disabling the owner add email from admin</caption>
57
+ * const admin = await client.admin();
58
+ * const preferences = admin.team.preferences.notifications.set({ownerAddedByAdmin: false});
59
+ *
60
+ * @since v2.0.0-beta.133
61
+ * @param {object} options
62
+ * @param {boolean} options.ownerAddedByAdmin Whether the email should be sent or not to other owners, when an owner added on a proof by admin.
63
+ * @returns {Promise}
64
+ */
65
+
66
+
67
+ TeamNotifications.prototype.set = function set(_ref) {
68
+ var ownerAddedByAdmin = _ref.ownerAddedByAdmin;
69
+
70
+ return this.client.request('admin.team.preferences.notifications.set', {
71
+ ownerAddedByAdmin: ownerAddedByAdmin
72
+ });
73
+ };
74
+
75
+ return TeamNotifications;
76
+ }(_API3.default);
77
+
78
+ exports.default = TeamNotifications;
79
+ //# sourceMappingURL=TeamNotifications.js.map
@@ -0,0 +1,10 @@
1
+ export default TeamPreferences;
2
+ declare class TeamPreferences extends API {
3
+ /** @private */
4
+ constructor(client: any);
5
+ /**
6
+ * The Admin Team Notification API.
7
+ */
8
+ notifications: any;
9
+ }
10
+ import API from "../API";
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _API2 = require('../API');
6
+
7
+ var _API3 = _interopRequireDefault(_API2);
8
+
9
+ var _TeamNotifications = require('./TeamNotifications');
10
+
11
+ var _TeamNotifications2 = _interopRequireDefault(_TeamNotifications);
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
+
17
+ 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; }
18
+
19
+ 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.
20
+ * Unauthorized copying of this file, via any medium is strictly prohibited.
21
+ * Proprietary and confidential.
22
+ */
23
+
24
+
25
+ var TeamPreferences = function (_API) {
26
+ _inherits(TeamPreferences, _API);
27
+
28
+ /** @private */
29
+ function TeamPreferences(client) {
30
+ _classCallCheck(this, TeamPreferences);
31
+
32
+ // Nested APIs
33
+ var _this = _possibleConstructorReturn(this, _API.call(this, client));
34
+
35
+ _this.notifications = new _TeamNotifications2.default(client);
36
+ return _this;
37
+ }
38
+ /**
39
+ * The Admin Team Notification API.
40
+ */
41
+
42
+
43
+ return TeamPreferences;
44
+ }(_API3.default);
45
+
46
+ exports.default = TeamPreferences;
47
+ //# sourceMappingURL=TeamPreferences.js.map
@@ -0,0 +1,19 @@
1
+ export default TeamNotifications;
2
+ declare class TeamNotifications {
3
+ /**
4
+ * The team id.
5
+ *
6
+ * @since v2.0.0-beta.133
7
+ * @type {string}
8
+ */
9
+ teamId: string;
10
+ /**
11
+ * The notification type (when owner added by admin).
12
+ *
13
+ * @since v2.0.0-beta.133
14
+ * @type {boolean}
15
+ */
16
+ ownerAddedByAdmin: boolean;
17
+ /** @private */
18
+ fromTeamNotifications(teamNotificationsData: any): TeamNotifications;
19
+ }
@@ -0,0 +1 @@
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 teamNotificationsSchema={teamId:"TeamId",ownerAddedByAdmin:"OwnerAddedByAdmin"};var TeamNotifications=function(){function TeamNotifications(){_classCallCheck(this,TeamNotifications)}TeamNotifications.prototype.fromTeamNotifications=function fromTeamNotifications(teamNotificationsData){(0,_transform2.default)(this,teamNotificationsSchema,teamNotificationsData);return this};return TeamNotifications}();exports.default=TeamNotifications;
@@ -692,6 +692,16 @@
692
692
  "path": "/api/admin/settings",
693
693
  "body": ["displayComments", "editComments", "proofReference"]
694
694
  },
695
+ "admin.team.preferences.notifications.load": {
696
+ "method": "GET",
697
+ "path": "/api/admin/preferences/notifications",
698
+ "trailing": true
699
+ },
700
+ "admin.team.preferences.notifications.set": {
701
+ "method": "POST",
702
+ "path": "/api/admin/preferences/notifications/set",
703
+ "body": ["ownerAddedByAdmin"]
704
+ },
695
705
  "sessions.check": {
696
706
  "method": "GET",
697
707
  "path": "/api/sessions/check"