@pageproof/sdk-pr 286.0.1603407976502 → 286.0.1603418032960

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.
@@ -85,16 +85,20 @@ declare class ProofsGroups extends API {
85
85
  delete(groupId: string): Promise<any>;
86
86
  /**
87
87
  * Archives a group or array of groups.
88
- * Archives all proofs of a group or array of groups user owns, if archiveProofs flag is passed as true.
88
+ * Optionally archives all the proofs in the group/groups that the user owns - if the `archiveProofs` option is set to `true`.
89
+ *
90
+ * Signature 1 examples-
89
91
  *
90
92
  * @example <caption>Archiving a group</caption>
91
93
  * await client.proofs.groups.archive('GVNM8NTI1VSTCRN5');
92
94
  *
93
- * @example <caption>Archiving a group and it's proofs user owns</caption>
94
- * await client.proofs.groups.archive('GVNM8NTI1VSTCRN5', {archiveProofs: true});
95
- *
96
95
  * @example <caption>Archiving number of groups</caption>
97
- * await client.proofs.groups.archive(['GVNM8NTI1VSTCRN5', 'GVNM8NTI1VSTCRN6']);
96
+ * await client.proofs.groups.archive('GVNM8NTI1VSTCRN5', 'GVNM8NTI1VSTCRN6');
97
+ *
98
+ * Signature 2 examples-
99
+ *
100
+ * @example <caption>Archiving a group and it's proofs user owns</caption>
101
+ * await client.proofs.groups.archive(['GVNM8NTI1VSTCRN5'], {archiveProofs: true});
98
102
  *
99
103
  * @example <caption>Archiving number of groups and their all proofs user owns</caption>
100
104
  * await client.proofs.groups.archive(
@@ -104,13 +108,18 @@ declare class ProofsGroups extends API {
104
108
  * }
105
109
  * );
106
110
  *
111
+ * Signature 1
107
112
  * @since v2.0.0-beta.110
108
- * @param {string} groupIds The id or ids of the groups
113
+ * @param {string} groupIdOrIds The id or ids of the groups
109
114
  * @returns {Promise}
115
+ *
116
+ * Signature 2
117
+ * @since v2.0.0-beta.14x
118
+ * @param {string|Array<string>} groupIdOrIds The id or array of ids of the groups
119
+ * @param {object} options
120
+ * @param {boolean} options.archiveProofs Whether to archive all owned proofs as well or just the group
110
121
  */
111
- archive(groupIdOrIds: any, { archiveProofs, }: {
112
- archiveProofs?: boolean;
113
- }): Promise<any>;
122
+ archive(...groupIdOrIds: string): Promise<any>;
114
123
  /**
115
124
  * Reopen a group or array of groups.
116
125
  *
@@ -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,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(groupIdOrIds,_ref3){var _ref3$archiveProofs=_ref3.archiveProofs,archiveProofs=_ref3$archiveProofs===undefined?true:_ref3$archiveProofs;return this.client.request("proofs.groups.archive",{groupIds:[].concat(groupIdOrIds),archiveProofs:archiveProofs})};ProofsGroups.prototype.reopen=function reopen(){for(var _len=arguments.length,groupIds=Array(_len),_key=0;_key<_len;_key++){groupIds[_key]=arguments[_key]}return this.client.request("proofs.groups.reopen",{groupIds:groupIds})};return ProofsGroups}(_API3.default);exports.default=ProofsGroups;
1
+ "use strict";exports.__esModule=true;var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};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,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(){var archiveProofs=false;for(var _len=arguments.length,groupIdOrIds=Array(_len),_key=0;_key<_len;_key++){groupIdOrIds[_key]=arguments[_key]}var copiedGroupIds=groupIdOrIds;var firstArg=groupIdOrIds[0];var lastArg=groupIdOrIds.length>1&&groupIdOrIds[groupIdOrIds.length-1];if(Array.isArray(firstArg)&&(typeof lastArg==="undefined"?"undefined":_typeof(lastArg))==="object"){archiveProofs=lastArg.archiveProofs;copiedGroupIds=groupIdOrIds[0]}if(typeof firstArg==="string"&&(typeof lastArg==="undefined"?"undefined":_typeof(lastArg))==="object"){copiedGroupIds=[firstArg]}return this.client.request("proofs.groups.archive",{groupIds:copiedGroupIds,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;