@pageproof/sdk-pr 286.0.1603418032960 → 286.0.1603420826436
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.
|
@@ -87,25 +87,19 @@ declare class ProofsGroups extends API {
|
|
|
87
87
|
* Archives a group or array of groups.
|
|
88
88
|
* Optionally archives all the proofs in the group/groups that the user owns - if the `archiveProofs` option is set to `true`.
|
|
89
89
|
*
|
|
90
|
-
* Signature 1 examples-
|
|
91
|
-
*
|
|
92
90
|
* @example <caption>Archiving a group</caption>
|
|
93
91
|
* await client.proofs.groups.archive('GVNM8NTI1VSTCRN5');
|
|
94
92
|
*
|
|
95
93
|
* @example <caption>Archiving number of groups</caption>
|
|
96
94
|
* await client.proofs.groups.archive('GVNM8NTI1VSTCRN5', 'GVNM8NTI1VSTCRN6');
|
|
97
95
|
*
|
|
98
|
-
* Signature 2 examples-
|
|
99
|
-
*
|
|
100
96
|
* @example <caption>Archiving a group and it's proofs user owns</caption>
|
|
101
|
-
* await client.proofs.groups.archive(
|
|
97
|
+
* await client.proofs.groups.archive('GVNM8NTI1VSTCRN5', {archiveProofs: true});
|
|
102
98
|
*
|
|
103
99
|
* @example <caption>Archiving number of groups and their all proofs user owns</caption>
|
|
104
100
|
* await client.proofs.groups.archive(
|
|
105
101
|
* ['GVNM8NTI1VSTCRN5', 'GVNM8NTI1VSTCRN6'],
|
|
106
|
-
* {
|
|
107
|
-
* archiveProofs: true,
|
|
108
|
-
* }
|
|
102
|
+
* { archiveProofs: true }
|
|
109
103
|
* );
|
|
110
104
|
*
|
|
111
105
|
* Signature 1
|
|
@@ -118,6 +112,7 @@ declare class ProofsGroups extends API {
|
|
|
118
112
|
* @param {string|Array<string>} groupIdOrIds The id or array of ids of the groups
|
|
119
113
|
* @param {object} options
|
|
120
114
|
* @param {boolean} options.archiveProofs Whether to archive all owned proofs as well or just the group
|
|
115
|
+
* @returns {Promise}
|
|
121
116
|
*/
|
|
122
117
|
archive(...groupIdOrIds: string): Promise<any>;
|
|
123
118
|
/**
|
package/lib/api/ProofsGroups.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var
|
|
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);var _restParamsToArray2=require("../util/restParamsToArray");var _restParamsToArray3=_interopRequireDefault(_restParamsToArray2);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,isOwnedByTeam=_ref.isOwnedByTeam;return this.client.request("proofs.groups.create",{name:name,ownedByTeam:isOwnedByTeam}).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,isOwnedByTeam=_ref2.isOwnedByTeam;return this.client.request("proofs.groups.update",{groupId:groupId,name:name,ownedByTeam:isOwnedByTeam}).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,groupIdOrIds=Array(_len),_key=0;_key<_len;_key++){groupIdOrIds[_key]=arguments[_key]}var _restParamsToArray=(0,_restParamsToArray3.default)(groupIdOrIds),groupIds=_restParamsToArray.resultedArray,resultedObject=_restParamsToArray.resultedObject;var archiveProofs=resultedObject.archiveProofs||false;return this.client.request("proofs.groups.archive",{groupIds:groupIds,archiveProofs:archiveProofs})};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;
|