@pageproof/sdk-pr 214.0.1573078592815 → 214.0.1576200799744

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,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-beta.110
4
+
5
+ Released on the 5th of December 2019.
6
+
7
+ - [[#217](https://github.com/PageProofCom/sdk/pull/217)] Support for archiving/reopening a group. See [ProofsGroups.archive](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~ProofsGroups.html#instance-method-archive) See [ProofsGroups.reopen](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~ProofsGroups.html#instance-method-reopen).
8
+
9
+ ## 2.0.0-beta.109
10
+
11
+ Released on the 29th of November 2019
12
+
13
+ - Support for regenerating SCIM access tokens.
14
+
15
+ ## 2.0.0-beta.108
16
+
17
+ Released on the 28th of November 2019
18
+
19
+ - Support for SCIM.
20
+
3
21
  ## 2.0.0-beta.106
4
22
 
5
23
  Released on the 23rd of October 2019.
@@ -20,5 +20,15 @@ declare class DashboardGroups extends API {
20
20
  * @returns {Promise<Array<ProofGroup>>}
21
21
  */
22
22
  current(): Promise<any[]>;
23
+ /**
24
+ * Loads all the archived proof groups that the user has access to.
25
+ *
26
+ * @example <caption>Loads all archived group metadata</caption>
27
+ * await client.dashboard.groups.archived();
28
+ *
29
+ * @since v2.0.0-beta.110
30
+ * @returns {Promise<Array<ProofGroup>>}
31
+ */
32
+ archived(): Promise<any[]>;
23
33
  }
24
34
  import API from "./API";
@@ -1 +1 @@
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
+ "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")};DashboardGroups.prototype.archived=function archived(){return this._loadGroups("archived")};return DashboardGroups}(_API3.default);exports.default=DashboardGroups;
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 _ProofsReviewers=require("./ProofsReviewers");var _ProofsReviewers2=_interopRequireDefault(_ProofsReviewers);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _ProofsAudit=require("./ProofsAudit");var _ProofsAudit2=_interopRequireDefault(_ProofsAudit);var _ProofsAssets=require("./ProofsAssets");var _ProofsAssets2=_interopRequireDefault(_ProofsAssets);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);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.reviewers=new _ProofsReviewers2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);_this.reminders=new _Reminders2.default(client);_this.audit=new _ProofsAudit2.default(client);_this.assets=new _ProofsAssets2.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,reference=_ref.reference,reminders=_ref.reminders,_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,reference:reference,reminders:[].concat(reminders)}).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(proofIdOrIds){return this.client.request("proofs.archive",{proofIds:proofIdOrIds})};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.finish=function finish(proofId,decision){return this.client.request("proofs.finish",{proofId:proofId,decision:decision})};Proofs.prototype.approve=function approve(proofId,message){return this.client.request("proofs.manual-approval",{proofId:proofId,message:message})};Proofs.prototype.withdrawApproval=function withdrawApproval(proofId,messageToSender){return this.client.request("proofs.withdraw-approval",{proofId:proofId,messageToSender:messageToSender})};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})};Proofs.prototype.images=function images(proofId){return this.client.request("proofs.images",{proofId:proofId}).then(function(response){return response.data.proof.file})};Proofs.prototype.setMessageToReviewers=function setMessageToReviewers(proofId,messageToReviewers){return this.client.request("proofs.set-reviewers-message",{proofId:proofId,messageToReviewers:messageToReviewers})};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 _ProofsReviewers=require("./ProofsReviewers");var _ProofsReviewers2=_interopRequireDefault(_ProofsReviewers);var _ProofsVersions=require("./ProofsVersions");var _ProofsVersions2=_interopRequireDefault(_ProofsVersions);var _ProofsGroups=require("./ProofsGroups");var _ProofsGroups2=_interopRequireDefault(_ProofsGroups);var _ProofsAudit=require("./ProofsAudit");var _ProofsAudit2=_interopRequireDefault(_ProofsAudit);var _ProofsAssets=require("./ProofsAssets");var _ProofsAssets2=_interopRequireDefault(_ProofsAssets);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);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.reviewers=new _ProofsReviewers2.default(client);_this.versions=new _ProofsVersions2.default(client);_this.groups=new _ProofsGroups2.default(client);_this.reminders=new _Reminders2.default(client);_this.audit=new _ProofsAudit2.default(client);_this.assets=new _ProofsAssets2.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,reference=_ref.reference,_ref$reminders=_ref.reminders,reminders=_ref$reminders===undefined?[]:_ref$reminders,_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,reference:reference,reminders:[].concat(reminders)}).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(proofIdOrIds){return this.client.request("proofs.archive",{proofIds:proofIdOrIds})};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.finish=function finish(proofId,decision){return this.client.request("proofs.finish",{proofId:proofId,decision:decision})};Proofs.prototype.approve=function approve(proofId,message){return this.client.request("proofs.manual-approval",{proofId:proofId,message:message})};Proofs.prototype.withdrawApproval=function withdrawApproval(proofId,messageToSender){return this.client.request("proofs.withdraw-approval",{proofId:proofId,messageToSender:messageToSender})};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})};Proofs.prototype.images=function images(proofId){return this.client.request("proofs.images",{proofId:proofId}).then(function(response){return response.data.proof.file})};Proofs.prototype.setMessageToReviewers=function setMessageToReviewers(proofId,messageToReviewers){return this.client.request("proofs.set-reviewers-message",{proofId:proofId,messageToReviewers:messageToReviewers})};return Proofs}(_API3.default);exports.default=Proofs;
@@ -81,6 +81,34 @@ declare class ProofsGroups extends API {
81
81
  * @returns {Promise}
82
82
  */
83
83
  delete(groupId: string): Promise<any>;
84
+ /**
85
+ * Archives a group or array of groups.
86
+ *
87
+ * @example <caption>Archiving a group</caption>
88
+ * await client.proofs.groups.archive('GVNM8NTI1VSTCRN5');
89
+ *
90
+ * @example <caption>Archiving number of groups</caption>
91
+ * await client.proofs.groups.archive('GVNM8NTI1VSTCRN5', 'GVNM8NTI1VSTCRN6');
92
+ *
93
+ * @since v2.0.0-beta.110
94
+ * @param {string} groupIds The id or ids of the groups
95
+ * @returns {Promise}
96
+ */
97
+ archive(...groupIds: string): Promise<any>;
98
+ /**
99
+ * Reopen a group or array of groups.
100
+ *
101
+ * @example <caption>Reopening a group</caption>
102
+ * await client.proofs.groups.reopen('GVNM8NTI1VSTCRN5');
103
+ *
104
+ * @example <caption>Reopening number of groups</caption>
105
+ * await client.proofs.groups.reopen('GVNM8NTI1VSTCRN5', 'GVNM8NTI1VSTCRN6');
106
+ *
107
+ * @since v2.0.0-beta.110
108
+ * @param {string} groupIds The id or ids of the groups
109
+ * @returns {Promise}
110
+ */
111
+ reopen(...groupIds: string): Promise<any>;
84
112
  }
85
113
  import API from "./API";
86
114
  import GroupsOwners from "./GroupsOwners";
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofGroup=require("../models/ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _GroupsOwners=require("./GroupsOwners");var _GroupsOwners2=_interopRequireDefault(_GroupsOwners);var _GroupsWorkflows=require("./GroupsWorkflows");var _GroupsWorkflows2=_interopRequireDefault(_GroupsWorkflows);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 mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var ProofsGroups=function(_API){_inherits(ProofsGroups,_API);function ProofsGroups(client){_classCallCheck(this,ProofsGroups);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _GroupsOwners2.default(client);_this.workflows=new _GroupsWorkflows2.default(client);return _this}ProofsGroups.prototype.create=function create(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},name=_ref.name;return this.client.request("proofs.groups.create",{name:name}).then(mapResponseToGroup)};ProofsGroups.prototype.load=function load(groupId){return this.client.request("proofs.groups.load",{groupId:groupId}).then(mapResponseToGroup)};ProofsGroups.prototype.ready=function ready(groupId){return this.client.request("proofs.groups.ready",{groupId:groupId})};ProofsGroups.prototype.update=function update(groupId,_ref2){var name=_ref2.name;return this.client.request("proofs.groups.update",{groupId:groupId,name:name}).then(mapResponseToGroup)};ProofsGroups.prototype.removeProof=function removeProof(proofId){return this.client.request("proofs.groups.remove-proof",{proofId:proofId})};ProofsGroups.prototype.addProof=function addProof(groupId,proofId){return this.client.request("proofs.groups.add-proof",{groupId:groupId,proofId:proofId})};ProofsGroups.prototype.delete=function _delete(groupId){return this.client.request("proofs.groups.delete",{groupId:groupId})};return ProofsGroups}(_API3.default);exports.default=ProofsGroups;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _ProofGroup=require("../models/ProofGroup");var _ProofGroup2=_interopRequireDefault(_ProofGroup);var _GroupsOwners=require("./GroupsOwners");var _GroupsOwners2=_interopRequireDefault(_GroupsOwners);var _GroupsWorkflows=require("./GroupsWorkflows");var _GroupsWorkflows2=_interopRequireDefault(_GroupsWorkflows);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 mapResponseToGroup(response){return(new _ProofGroup2.default).fromProofGroup(response.data)}var ProofsGroups=function(_API){_inherits(ProofsGroups,_API);function ProofsGroups(client){_classCallCheck(this,ProofsGroups);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.owners=new _GroupsOwners2.default(client);_this.workflows=new _GroupsWorkflows2.default(client);return _this}ProofsGroups.prototype.create=function create(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},name=_ref.name;return this.client.request("proofs.groups.create",{name:name}).then(mapResponseToGroup)};ProofsGroups.prototype.load=function load(groupId){return this.client.request("proofs.groups.load",{groupId:groupId}).then(mapResponseToGroup)};ProofsGroups.prototype.ready=function ready(groupId){return this.client.request("proofs.groups.ready",{groupId:groupId})};ProofsGroups.prototype.update=function update(groupId,_ref2){var name=_ref2.name;return this.client.request("proofs.groups.update",{groupId:groupId,name:name}).then(mapResponseToGroup)};ProofsGroups.prototype.removeProof=function removeProof(proofId){return this.client.request("proofs.groups.remove-proof",{proofId:proofId})};ProofsGroups.prototype.addProof=function addProof(groupId,proofId){return this.client.request("proofs.groups.add-proof",{groupId:groupId,proofId:proofId})};ProofsGroups.prototype.delete=function _delete(groupId){return this.client.request("proofs.groups.delete",{groupId:groupId})};ProofsGroups.prototype.archive=function archive(){for(var _len=arguments.length,groupIds=Array(_len),_key=0;_key<_len;_key++){groupIds[_key]=arguments[_key]}return this.client.request("proofs.groups.archive",{groupIds:groupIds})};ProofsGroups.prototype.reopen=function reopen(){for(var _len2=arguments.length,groupIds=Array(_len2),_key2=0;_key2<_len2;_key2++){groupIds[_key2]=arguments[_key2]}return this.client.request("proofs.groups.reopen",{groupIds:groupIds})};return ProofsGroups}(_API3.default);exports.default=ProofsGroups;
@@ -26,9 +26,16 @@ declare class Team extends API {
26
26
  * @type {TeamCustomWebhooks}
27
27
  */
28
28
  customWebhooks: TeamCustomWebhooks;
29
+ /**
30
+ * The Admin Team SCIM API.
31
+ *
32
+ * @type {TeamSCIM}
33
+ */
34
+ scim: TeamSCIM;
29
35
  }
30
36
  import API from "../API";
31
37
  import TeamUsers from "./TeamUsers";
32
38
  import TeamDashboard from "./TeamDashboard";
33
39
  import TeamFeatures from "./TeamFeatures";
34
40
  import TeamCustomWebhooks from "./TeamCustomWebhooks";
41
+ import TeamSCIM from "./TeamSCIM";
@@ -22,6 +22,10 @@ var _TeamCustomWebhooks = require('./TeamCustomWebhooks');
22
22
 
23
23
  var _TeamCustomWebhooks2 = _interopRequireDefault(_TeamCustomWebhooks);
24
24
 
25
+ var _TeamSCIM = require('./TeamSCIM');
26
+
27
+ var _TeamSCIM2 = _interopRequireDefault(_TeamSCIM);
28
+
25
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
30
 
27
31
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -41,15 +45,16 @@ var Team = function (_API) {
41
45
 
42
46
 
43
47
  /**
44
- * The Admin Team Features API.
48
+ * The Admin Custom Webhooks API.
45
49
  *
46
- * @type {TeamFeatures}
50
+ * @type {TeamCustomWebhooks}
47
51
  */
48
52
 
53
+
49
54
  /**
50
- * The Admin Team Users API.
55
+ * The Admin Team Dashboard API.
51
56
  *
52
- * @type {TeamUsers}
57
+ * @type {TeamDashboard}
53
58
  */
54
59
  function Team(client) {
55
60
  _classCallCheck(this, Team);
@@ -61,20 +66,27 @@ var Team = function (_API) {
61
66
  _this.dashboard = new _TeamDashboard2.default(client);
62
67
  _this.features = new _TeamFeatures2.default(client);
63
68
  _this.customWebhooks = new _TeamCustomWebhooks2.default(client);
69
+ _this.scim = new _TeamSCIM2.default(client);
64
70
  return _this;
65
71
  }
66
72
 
67
73
  /**
68
- * The Admin Custom Webhooks API.
74
+ * The Admin Team SCIM API.
69
75
  *
70
- * @type {TeamCustomWebhooks}
76
+ * @type {TeamSCIM}
71
77
  */
72
78
 
73
79
 
74
80
  /**
75
- * The Admin Team Dashboard API.
81
+ * The Admin Team Features API.
76
82
  *
77
- * @type {TeamDashboard}
83
+ * @type {TeamFeatures}
84
+ */
85
+
86
+ /**
87
+ * The Admin Team Users API.
88
+ *
89
+ * @type {TeamUsers}
78
90
  */
79
91
 
80
92
 
@@ -0,0 +1,49 @@
1
+ export default TeamSCIM;
2
+ declare class TeamSCIM extends API {
3
+ constructor(client: any);
4
+ /**
5
+ * Loads the SCIM settings for the team.
6
+ *
7
+ * @example
8
+ * const admin = await client.admin();
9
+ * const settings = await admin.team.scim.settings();
10
+ *
11
+ * @since v2.0.0-beta.108
12
+ * @returns {Promise<SCIMSettings>}
13
+ */
14
+ settings(): Promise<any>;
15
+ /**
16
+ * Enables SCIM and returns the settings.
17
+ *
18
+ * @example
19
+ * const admin = await client.admin();
20
+ * const settings = await admin.team.scim.enable();
21
+ *
22
+ * @since v2.0.0-beta.108
23
+ * @returns {Promise<SCIMSettings>}
24
+ */
25
+ enable(): Promise<any>;
26
+ /**
27
+ * Disables SCIM.
28
+ *
29
+ * @example
30
+ * const admin = await client.admin();
31
+ * const settings = await admin.team.scim.disable();
32
+ *
33
+ * @since v2.0.0-beta.108
34
+ * @returns {Promise}
35
+ */
36
+ disable(): Promise<any>;
37
+ /**
38
+ * Regenerate an access token and returns the settings (including the regenerated access token).
39
+ *
40
+ * @example
41
+ * const admin = await client.admin();
42
+ * const settings = await admin.team.scim.regenerateAccessToken('primary');
43
+ *
44
+ * @param {string} type The type of access token to generate (eg. primary or secondary)
45
+ * @returns {Promise<SCIMSettings>}
46
+ */
47
+ regenerateAccessToken(type: string): Promise<any>;
48
+ }
49
+ import API from "../API";
@@ -0,0 +1,104 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _API2 = require('../API');
6
+
7
+ var _API3 = _interopRequireDefault(_API2);
8
+
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+
13
+ 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; }
14
+
15
+ 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.
16
+ * Unauthorized copying of this file, via any medium is strictly prohibited.
17
+ * Proprietary and confidential.
18
+ */
19
+
20
+
21
+ var TeamSCIM = function (_API) {
22
+ _inherits(TeamSCIM, _API);
23
+
24
+ function TeamSCIM() {
25
+ _classCallCheck(this, TeamSCIM);
26
+
27
+ return _possibleConstructorReturn(this, _API.apply(this, arguments));
28
+ }
29
+
30
+ /**
31
+ * Loads the SCIM settings for the team.
32
+ *
33
+ * @example
34
+ * const admin = await client.admin();
35
+ * const settings = await admin.team.scim.settings();
36
+ *
37
+ * @since v2.0.0-beta.108
38
+ * @returns {Promise<SCIMSettings>}
39
+ */
40
+ TeamSCIM.prototype.settings = function settings() {
41
+ return this.client.request('scim.admin.settings').then(function (response) {
42
+ return response.data.settings;
43
+ });
44
+ };
45
+
46
+ /**
47
+ * Enables SCIM and returns the settings.
48
+ *
49
+ * @example
50
+ * const admin = await client.admin();
51
+ * const settings = await admin.team.scim.enable();
52
+ *
53
+ * @since v2.0.0-beta.108
54
+ * @returns {Promise<SCIMSettings>}
55
+ */
56
+
57
+
58
+ TeamSCIM.prototype.enable = function enable() {
59
+ return this.client.request('scim.admin.enable').then(function (response) {
60
+ return response.data.settings;
61
+ });
62
+ };
63
+
64
+ /**
65
+ * Disables SCIM.
66
+ *
67
+ * @example
68
+ * const admin = await client.admin();
69
+ * const settings = await admin.team.scim.disable();
70
+ *
71
+ * @since v2.0.0-beta.108
72
+ * @returns {Promise}
73
+ */
74
+
75
+
76
+ TeamSCIM.prototype.disable = function disable() {
77
+ return this.client.request('scim.admin.disable').then(function () {
78
+ return undefined;
79
+ });
80
+ };
81
+
82
+ /**
83
+ * Regenerate an access token and returns the settings (including the regenerated access token).
84
+ *
85
+ * @example
86
+ * const admin = await client.admin();
87
+ * const settings = await admin.team.scim.regenerateAccessToken('primary');
88
+ *
89
+ * @param {string} type The type of access token to generate (eg. primary or secondary)
90
+ * @returns {Promise<SCIMSettings>}
91
+ */
92
+
93
+
94
+ TeamSCIM.prototype.regenerateAccessToken = function regenerateAccessToken(type) {
95
+ return this.client.request('scim.admin.regenerate-access-token', { type: type }).then(function (response) {
96
+ return response.data.settings;
97
+ });
98
+ };
99
+
100
+ return TeamSCIM;
101
+ }(_API3.default);
102
+
103
+ exports.default = TeamSCIM;
104
+ //# sourceMappingURL=TeamSCIM.js.map
@@ -22,6 +22,14 @@ declare class ProofGroup {
22
22
  * @type {boolean}
23
23
  */
24
24
  isEmpty: boolean;
25
+ /**
26
+ * If group has been archived.
27
+ *
28
+ * @since v2.0.0-beta.110
29
+ *
30
+ * @type {boolean}
31
+ */
32
+ isArchived: boolean;
25
33
  /**
26
34
  * The proofs in the group.
27
35
  *
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _Proof=require("./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")}}var proofGroupSchema={canAddProofs:"CanAddProofs",id:"GroupId",name:"Name",isEmpty:"IsEmpty",proofs:(0,_transform.each)("ProofInfo",function(proofData){return(new _Proof2.default).fromProof(proofData)})};var ProofGroup=function(){function ProofGroup(){_classCallCheck(this,ProofGroup)}ProofGroup.prototype.fromProofGroup=function fromProofGroup(proofGroupData){(0,_transform2.default)(this,proofGroupSchema,proofGroupData);return this};return ProofGroup}();exports.default=ProofGroup;
1
+ "use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _Proof=require("./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")}}var proofGroupSchema={canAddProofs:"CanAddProofs",id:"GroupId",name:"Name",isEmpty:"IsEmpty",isArchived:"Archived",proofs:(0,_transform.each)("ProofInfo",function(proofData){return(new _Proof2.default).fromProof(proofData)})};var ProofGroup=function(){function ProofGroup(){_classCallCheck(this,ProofGroup)}ProofGroup.prototype.fromProofGroup=function fromProofGroup(proofGroupData){(0,_transform2.default)(this,proofGroupSchema,proofGroupData);return this};return ProofGroup}();exports.default=ProofGroup;
@@ -297,6 +297,18 @@
297
297
  "path": "/api/proofs/groups/ready",
298
298
  "body": ["groupId"]
299
299
  },
300
+ "proofs.groups.archive": {
301
+ "version": 2,
302
+ "method": "POST",
303
+ "path": "/api/groups/archive",
304
+ "body": ["groupIds"]
305
+ },
306
+ "proofs.groups.reopen": {
307
+ "version": 2,
308
+ "method": "POST",
309
+ "path": "/api/groups/reopen",
310
+ "body": ["groupIds"]
311
+ },
300
312
  "proofs.groups.remove-proof": {
301
313
  "method": "POST",
302
314
  "path": "/api/groups/proof/remove",
@@ -725,5 +737,23 @@
725
737
  "method": "POST",
726
738
  "path": "/api/teams/invitations/decline",
727
739
  "chain": ["invitationId"]
740
+ },
741
+ "scim.admin.settings": {
742
+ "method": "GET",
743
+ "path": "/api/scim/admin/settings"
744
+ },
745
+ "scim.admin.enable": {
746
+ "method": "POST",
747
+ "path": "/api/scim/admin/enable"
748
+ },
749
+ "scim.admin.disable": {
750
+ "method": "POST",
751
+ "path": "/api/scim/admin/disable"
752
+ },
753
+ "scim.admin.regenerate-access-token": {
754
+ "version": 2,
755
+ "method": "POST",
756
+ "path": "/api/scim/admin/regenerate-access-token",
757
+ "body": ["type"]
728
758
  }
729
759
  }