@pageproof/sdk-pr 286.0.1606441646755 → 286.0.1611627932912
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 +47 -2
- package/lib/adapters/IEnhancementAdapter.js +1 -1
- package/lib/angular-enhancement-adapter.js +1 -1
- package/lib/api/Preferences.d.ts +2 -1
- package/lib/api/Proofs.d.ts +48 -19
- package/lib/api/Proofs.js +1 -1
- package/lib/api/ProofsIntegrationReferences.d.ts +1 -1
- package/lib/api/Workflows.d.ts +54 -0
- package/lib/api/Workflows.js +1 -1
- package/lib/api/admin/TeamDashboard.d.ts +8 -0
- package/lib/api/admin/TeamDashboard.js +19 -2
- package/lib/api/admin/TeamDashboardGroups.d.ts +49 -0
- package/lib/api/admin/TeamDashboardGroups.js +112 -0
- package/lib/api/admin/TeamFeatures.d.ts +2 -0
- package/lib/api/admin/TeamFeatures.js +4 -1
- package/lib/core/PageProof.d.ts +8 -1
- package/lib/core/PageProof.js +1 -1
- package/lib/enum/Preference.d.ts +1 -1
- package/lib/enum/Preference.js +1 -1
- package/lib/models/DecisionSummary.js +1 -1
- package/lib/models/Proof.d.ts +23 -1
- package/lib/models/Proof.js +1 -1
- package/lib/models/ProofGroup.d.ts +8 -0
- package/lib/models/ProofGroup.js +1 -1
- package/lib/models/ProofIntegrationReference.d.ts +6 -0
- package/lib/models/ProofIntegrationReference.js +1 -1
- package/lib/models/TeamCommentFeatures.d.ts +7 -0
- package/lib/models/TeamCommentFeatures.js +1 -1
- package/lib/models/WorkflowUser.d.ts +6 -0
- package/lib/models/WorkflowUser.js +1 -1
- package/lib/network/endpoints.json +31 -2
- package/lib/pageproof.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.0.0-beta.
|
|
3
|
+
## 2.0.0-beta.157
|
|
4
4
|
|
|
5
|
-
Released on the
|
|
5
|
+
Released on the 26th of January 2021.
|
|
6
6
|
|
|
7
7
|
- [[#286](https://github.com/PageProofCom/sdk/pull/286)] Adds support for optionally archiving all the proofs in the group that the user owns. See [ProofsGroups.archive](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~Files.html#instance-method-archive).
|
|
8
8
|
|
|
9
|
+
## 2.0.0-beta.156
|
|
10
|
+
|
|
11
|
+
Released on the 15th of January 2021.
|
|
12
|
+
|
|
13
|
+
- Improved some of the auto-generated TypeScript definitions.
|
|
14
|
+
|
|
15
|
+
## 2.0.0-beta.155
|
|
16
|
+
|
|
17
|
+
Released on the 8th of January 2021.
|
|
18
|
+
|
|
19
|
+
- [[#297](https://github.com/PageProofCom/sdk/pull/297)] Adds support for nudging with messages, and retrieving previous nudge messages. See [Workflows.nudgeUser](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Workflows.js~Workflows.html#instance-method-nudgeUser) and [Workflows.getNudgeMessage](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Workflows.html#instance-method-getNudgeMessage).
|
|
20
|
+
|
|
21
|
+
## 2.0.0-beta.154
|
|
22
|
+
|
|
23
|
+
Released on the 21st of December 2020.
|
|
24
|
+
|
|
25
|
+
- Type updates for proof integration references.
|
|
26
|
+
|
|
27
|
+
## 2.0.0-beta.153
|
|
28
|
+
|
|
29
|
+
Released on the 14th of December 2020.
|
|
30
|
+
|
|
31
|
+
- [[#272](https://github.com/PageProofCom/sdk/pull/272)] Team administrators can now load their team's groups - see [TeamDashboardGroups](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/admin/TeamDashboardGroups.js~TeamDashboardGroups.html).
|
|
32
|
+
- The Proof model now contains the team ID, it belongs to ([Proof.teamId](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/Proof.js~Proof.html#instance-member-teamId)).
|
|
33
|
+
|
|
34
|
+
## 2.0.0-beta.152
|
|
35
|
+
|
|
36
|
+
Released on the 11th of December 2020.
|
|
37
|
+
|
|
38
|
+
- [[#294](https://github.com/PageProofCom/sdk/pull/294)]
|
|
39
|
+
- Support for allowing to disabling replies on comments (by reviewers) in statuses. See [TeamCommentFeatures.disableReplyingToCommentsInStatuses](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/TeamCommentFeatures.js~TeamCommentFeatures.html#instance-member-disableReplyingToCommentsInStatuses).
|
|
40
|
+
- Added `canAddCommentReplies` to proof model, to tell if replies are disabled on comments (by reviewers). See [Proofs.canAddCommentReplies](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/Proof.js~Proof.html#instance-member-canAddCommentReplies).
|
|
41
|
+
|
|
42
|
+
## 2.0.0-beta.151
|
|
43
|
+
|
|
44
|
+
Released on the 11th of December 2020.
|
|
45
|
+
|
|
46
|
+
- Minor improvement around user preferences reset method.
|
|
47
|
+
|
|
48
|
+
## 2.0.0-beta.150
|
|
49
|
+
|
|
50
|
+
Released on the 8th of December 2020.
|
|
51
|
+
|
|
52
|
+
- [[#296](https://github.com/PageProofCom/sdk/pull/296)] Adds support for colors user preferences. See [Preferences](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Preferences.js~Preferences.html).
|
|
53
|
+
|
|
9
54
|
## 2.0.0-beta.149
|
|
10
55
|
|
|
11
56
|
Released on the 24th of November 2020.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _class,_temp;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var IEnhancementAdapter=(_temp=_class=function(){function IEnhancementAdapter(){_classCallCheck(this,IEnhancementAdapter)}IEnhancementAdapter.prototype.onClientReady=function onClientReady(client){var _this=this;var methods=getNestedMethods(client);methods.forEach(function(definition){var ctx={api:definition.api,namespace:definition.namespace,name:definition.name,displayName:definition.namespace+"."+definition.name};_this.onMethodEnhance(ctx);enhance(definition.api,definition.name,function(callback){_this.onMethodBefore(ctx);return function(){var value=void 0;try{value=callback()}catch(err){ctx.error=err;_this.onMethodThrown(ctx);throw err}finally{ctx.value=value;_this.onMethodAfter(ctx);if(value&&typeof value.then==="function"){value.then(function(resolved){ctx.resolved=resolved;_this.onMethodResolve(ctx)},function(rejected){ctx.rejected=rejected;_this.onMethodReject(ctx)}).then(function(){_this.onMethodFinally(ctx)})}}return value}})});client.on("experimental.request.before",function(event){return _this.onRequestBefore(event.data)});client.on("experimental.request.after",function(event){return _this.onRequestAfter(event.data)});client.on("error.response",function(event){return _this.onRequestReject(event.data)});client.on("error.throttled",function(event){return _this.onRequestThrottled(event.data)});client.on("experimental.request.retry",function(event){return _this.onRequestRetry(event.data)});client.on("error.unauthorized",function(event){return _this.onRequestUnauthorized(event.data)});client.on("error.deprecated",function(event){return _this.onRequestDeprecated(event.data)});client.on("experimental.request.resolve",function(event){return _this.onRequestResolve(event.data)});client.on("experimental.request.finally",function(event){return _this.onRequestFinally(event.data)})};IEnhancementAdapter.prototype.onMethodEnhance=function onMethodEnhance(ctx){};IEnhancementAdapter.prototype.onMethodBefore=function onMethodBefore(ctx){};IEnhancementAdapter.prototype.onMethodAfter=function onMethodAfter(ctx){};IEnhancementAdapter.prototype.onMethodReject=function onMethodReject(ctx){};IEnhancementAdapter.prototype.onMethodResolve=function onMethodResolve(ctx){};IEnhancementAdapter.prototype.onMethodFinally=function onMethodFinally(ctx){};IEnhancementAdapter.prototype.onMethodThrown=function onMethodThrown(ctx){};IEnhancementAdapter.prototype.onRequestBefore=function onRequestBefore(event){};IEnhancementAdapter.prototype.onRequestAfter=function onRequestAfter(event){};IEnhancementAdapter.prototype.onRequestReject=function onRequestReject(event){};IEnhancementAdapter.prototype.onRequestThrottled=function onRequestThrottled(event){};IEnhancementAdapter.prototype.onRequestRetry=function onRequestRetry(event){};IEnhancementAdapter.prototype.onRequestUnauthorized=function onRequestUnauthorized(event){};IEnhancementAdapter.prototype.onRequestDeprecated=function onRequestDeprecated(event){};IEnhancementAdapter.prototype.onRequestResolve=function onRequestResolve(event){};IEnhancementAdapter.prototype.onRequestFinally=function onRequestFinally(event){};return IEnhancementAdapter}(),_class.__adapter__="IEnhancementAdapter",_temp);function enhance(obj,name,factory){var original=obj[name];obj[name]=function enhanced(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var bound=original.bind.apply(original,[this].concat(args));var replacement=factory(bound,this,args);var value=replacement.apply(this,args);return value}}function getNestedMethods(client){var includeTop=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var definitions=[];function scan(api){var prefix=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var children=Object.getOwnPropertyNames(api).filter(function(name){return api[name].client===client});var proto=Object.getPrototypeOf(api);var methods=Object.keys(proto).filter(function(name){return typeof proto[name]==="function"&&name.indexOf("_")!==0});if(prefix.length||includeTop){methods.forEach(function(name){definitions.push({namespace:
|
|
1
|
+
"use strict";exports.__esModule=true;var _class,_temp;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var IEnhancementAdapter=(_temp=_class=function(){function IEnhancementAdapter(){_classCallCheck(this,IEnhancementAdapter)}IEnhancementAdapter.prototype.onClientReady=function onClientReady(client){var _this=this;var methods=getNestedMethods(client);methods.forEach(function(definition){var ctx={api:definition.api,namespace:definition.namespace,name:definition.name,displayName:definition.namespace+"."+definition.name};_this.onMethodEnhance(ctx);enhance(definition.api,definition.name,function(callback){_this.onMethodBefore(ctx);return function(){var value=void 0;try{value=callback()}catch(err){ctx.error=err;_this.onMethodThrown(ctx);throw err}finally{ctx.value=value;_this.onMethodAfter(ctx);if(value&&typeof value.then==="function"){value.then(function(resolved){ctx.resolved=resolved;_this.onMethodResolve(ctx)},function(rejected){ctx.rejected=rejected;_this.onMethodReject(ctx)}).then(function(){_this.onMethodFinally(ctx)})}}return value}})});client.on("experimental.request.before",function(event){return _this.onRequestBefore(event.data)});client.on("experimental.request.after",function(event){return _this.onRequestAfter(event.data)});client.on("error.response",function(event){return _this.onRequestReject(event.data)});client.on("error.throttled",function(event){return _this.onRequestThrottled(event.data)});client.on("experimental.request.retry",function(event){return _this.onRequestRetry(event.data)});client.on("error.unauthorized",function(event){return _this.onRequestUnauthorized(event.data)});client.on("error.deprecated",function(event){return _this.onRequestDeprecated(event.data)});client.on("experimental.request.resolve",function(event){return _this.onRequestResolve(event.data)});client.on("experimental.request.finally",function(event){return _this.onRequestFinally(event.data)})};IEnhancementAdapter.prototype.onMethodEnhance=function onMethodEnhance(ctx){};IEnhancementAdapter.prototype.onMethodBefore=function onMethodBefore(ctx){};IEnhancementAdapter.prototype.onMethodAfter=function onMethodAfter(ctx){};IEnhancementAdapter.prototype.onMethodReject=function onMethodReject(ctx){};IEnhancementAdapter.prototype.onMethodResolve=function onMethodResolve(ctx){};IEnhancementAdapter.prototype.onMethodFinally=function onMethodFinally(ctx){};IEnhancementAdapter.prototype.onMethodThrown=function onMethodThrown(ctx){};IEnhancementAdapter.prototype.onRequestBefore=function onRequestBefore(event){};IEnhancementAdapter.prototype.onRequestAfter=function onRequestAfter(event){};IEnhancementAdapter.prototype.onRequestReject=function onRequestReject(event){};IEnhancementAdapter.prototype.onRequestThrottled=function onRequestThrottled(event){};IEnhancementAdapter.prototype.onRequestRetry=function onRequestRetry(event){};IEnhancementAdapter.prototype.onRequestUnauthorized=function onRequestUnauthorized(event){};IEnhancementAdapter.prototype.onRequestDeprecated=function onRequestDeprecated(event){};IEnhancementAdapter.prototype.onRequestResolve=function onRequestResolve(event){};IEnhancementAdapter.prototype.onRequestFinally=function onRequestFinally(event){};return IEnhancementAdapter}(),_class.__adapter__="IEnhancementAdapter",_temp);function enhance(obj,name,factory){var original=obj[name];obj[name]=function enhanced(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var bound=original.bind.apply(original,[this].concat(args));var replacement=factory(bound,this,args);var value=replacement.apply(this,args);return value}}function getNestedMethods(client){var includeTop=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var definitions=[];function scan(api){var prefix=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var children=Object.getOwnPropertyNames(api).filter(function(name){return api[name].client===client});var proto=Object.getPrototypeOf(api);var methods=Object.keys(proto).filter(function(name){return typeof proto[name]==="function"&&name.indexOf("_")!==0});if(prefix.length||includeTop){var namespace=prefix.join(".");if(namespace.indexOf("__")===0){namespace=namespace.substring(2)}methods.forEach(function(name){definitions.push({namespace:namespace,name:name,api:api})})}children.forEach(function(name){scan(api[name],prefix.concat(name))})}scan(client);return definitions}exports.default=IEnhancementAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PageProofAngularEnhancementAdapter=t():e.PageProofAngularEnhancementAdapter=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(c),p=n(2)("AngularEnhancementAdapter"),f={$scope:null,$exceptionHandler:null,module:null},s=function(e){function t(n){o(this,t);var i=r(this,e.call(this));return i.options=u({},f,n),i.$scope=i.options.$scope,i.$exceptionHandler=i.options.$exceptionHandler,i.options.module&&i.options.module.run(["$rootScope","$exceptionHandler",function(e,t){p("Extracting the $rootScope and $exceptionHandler from Angular module"),i.$scope=i.$scope||e,i.$exceptionHandler=i.$exceptionHandler||t}]),i}return i(t,e),t.prototype.onMethodFinally=function(){this.$scope&&!this.$scope.$$phase&&this.$scope.$apply(),this.$scope||p("Unable to tell $scope to re-digest, either module hasn't booted, or no $scope was provided")},t.prototype.onMethodReject=function(e){var t=e.rejected;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of rejected Promise, check configuration")},t.prototype.onMethodThrown=function(e){var t=e.error;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of uncaught error, check configuration")},t}(a.default);t.default=s},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){var o=e[t];e[t]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=o.bind.apply(o,[this].concat(t));return n(i,this,t).apply(this,t)}}function i(e){function t(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=Object.getOwnPropertyNames(r).filter(function(t){return r[t].client===e}),c=Object.getPrototypeOf(r),a=Object.keys(c).filter(function(e){return"function"==typeof c[e]&&0!==e.indexOf("_")});(i.length||n)&&a.forEach(function(e){o.push({namespace:
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PageProofAngularEnhancementAdapter=t():e.PageProofAngularEnhancementAdapter=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(c),p=n(2)("AngularEnhancementAdapter"),f={$scope:null,$exceptionHandler:null,module:null},s=function(e){function t(n){o(this,t);var i=r(this,e.call(this));return i.options=u({},f,n),i.$scope=i.options.$scope,i.$exceptionHandler=i.options.$exceptionHandler,i.options.module&&i.options.module.run(["$rootScope","$exceptionHandler",function(e,t){p("Extracting the $rootScope and $exceptionHandler from Angular module"),i.$scope=i.$scope||e,i.$exceptionHandler=i.$exceptionHandler||t}]),i}return i(t,e),t.prototype.onMethodFinally=function(){this.$scope&&!this.$scope.$$phase&&this.$scope.$apply(),this.$scope||p("Unable to tell $scope to re-digest, either module hasn't booted, or no $scope was provided")},t.prototype.onMethodReject=function(e){var t=e.rejected;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of rejected Promise, check configuration")},t.prototype.onMethodThrown=function(e){var t=e.error;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of uncaught error, check configuration")},t}(a.default);t.default=s},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){var o=e[t];e[t]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=o.bind.apply(o,[this].concat(t));return n(i,this,t).apply(this,t)}}function i(e){function t(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=Object.getOwnPropertyNames(r).filter(function(t){return r[t].client===e}),c=Object.getPrototypeOf(r),a=Object.keys(c).filter(function(e){return"function"==typeof c[e]&&0!==e.indexOf("_")});if(i.length||n){var p=i.join(".");0===p.indexOf("__")&&(p=p.substring(2)),a.forEach(function(e){o.push({namespace:p,name:e,api:r})})}u.forEach(function(e){t(r[e],i.concat(e))})}var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=[];return t(e),o}t.__esModule=!0;var u,c,a=(c=u=function(){function e(){o(this,e)}return e.prototype.onClientReady=function(e){var t=this;i(e).forEach(function(e){var n={api:e.api,namespace:e.namespace,name:e.name,displayName:e.namespace+"."+e.name};t.onMethodEnhance(n),r(e.api,e.name,function(e){return t.onMethodBefore(n),function(){var o=void 0;try{o=e()}catch(e){throw n.error=e,t.onMethodThrown(n),e}finally{n.value=o,t.onMethodAfter(n),o&&"function"==typeof o.then&&o.then(function(e){n.resolved=e,t.onMethodResolve(n)},function(e){n.rejected=e,t.onMethodReject(n)}).then(function(){t.onMethodFinally(n)})}return o}})}),e.on("experimental.request.before",function(e){return t.onRequestBefore(e.data)}),e.on("experimental.request.after",function(e){return t.onRequestAfter(e.data)}),e.on("error.response",function(e){return t.onRequestReject(e.data)}),e.on("error.throttled",function(e){return t.onRequestThrottled(e.data)}),e.on("experimental.request.retry",function(e){return t.onRequestRetry(e.data)}),e.on("error.unauthorized",function(e){return t.onRequestUnauthorized(e.data)}),e.on("error.deprecated",function(e){return t.onRequestDeprecated(e.data)}),e.on("experimental.request.resolve",function(e){return t.onRequestResolve(e.data)}),e.on("experimental.request.finally",function(e){return t.onRequestFinally(e.data)})},e.prototype.onMethodEnhance=function(e){},e.prototype.onMethodBefore=function(e){},e.prototype.onMethodAfter=function(e){},e.prototype.onMethodReject=function(e){},e.prototype.onMethodResolve=function(e){},e.prototype.onMethodFinally=function(e){},e.prototype.onMethodThrown=function(e){},e.prototype.onRequestBefore=function(e){},e.prototype.onRequestAfter=function(e){},e.prototype.onRequestReject=function(e){},e.prototype.onRequestThrottled=function(e){},e.prototype.onRequestRetry=function(e){},e.prototype.onRequestUnauthorized=function(e){},e.prototype.onRequestDeprecated=function(e){},e.prototype.onRequestResolve=function(e){},e.prototype.onRequestFinally=function(e){},e}(),u.__adapter__="IEnhancementAdapter",c);t.default=a},function(e,t,n){"use strict";e.exports=function e(){return e}}])});
|
|
2
2
|
//# sourceMappingURL=angular-enhancement-adapter.js.map
|
package/lib/api/Preferences.d.ts
CHANGED
|
@@ -25,9 +25,10 @@ declare class Preferences extends API {
|
|
|
25
25
|
* PageProof.Enum.Preference.DEFAULT_DUE_DATE,
|
|
26
26
|
* PageProof.Enum.Preference.DEFAULT_DUE_TIME,
|
|
27
27
|
* PageProof.Enum.Preference.DEFAULT_MESSAGE_TO_REVIEWERS,
|
|
28
|
+
* PageProof.Enum.Preference.COLORS,
|
|
28
29
|
* PageProof.Enum.Preference.DEFAULT_REMINDER,
|
|
29
30
|
* ]);
|
|
30
|
-
* const [dueDate, dueTime, messageToReviewers, proofReminders] = preferences;
|
|
31
|
+
* const [dueDate, dueTime, messageToReviewers, colors, proofReminders] = preferences;
|
|
31
32
|
* console.log(messageToReviewers.getValueOrDefault());
|
|
32
33
|
*
|
|
33
34
|
* @example <caption>Retrieving a single preference</caption>
|
package/lib/api/Proofs.d.ts
CHANGED
|
@@ -171,31 +171,60 @@ declare class Proofs extends API {
|
|
|
171
171
|
*
|
|
172
172
|
* @see {@link Proofs.start}
|
|
173
173
|
*
|
|
174
|
-
* @param {
|
|
175
|
-
*
|
|
176
|
-
* @param
|
|
177
|
-
* @param
|
|
178
|
-
* @param
|
|
179
|
-
* @param
|
|
180
|
-
* @param
|
|
181
|
-
* @param
|
|
182
|
-
* @param
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
189
|
-
* @param
|
|
190
|
-
* @param
|
|
174
|
+
* @param {{ name: string, tags?: string[], dueDate?: Date | string, messageToReviewers?: string, workflow?: { id: string }, workflowTemplate?: { id: string }, file?: { id: string }, group?: { id: string }, previousProof?: { id: string }, team?: { slug: string }, reference?: string, customTools?: any, integrationReferences: any[], reminders?: Reminder[], owners?: ({ email?: string, id?: string })[], canDownload?: boolean, start?: boolean }} options The options
|
|
175
|
+
*
|
|
176
|
+
* @param options.name The name of the proof
|
|
177
|
+
* @param options.tags The tags to add to the proof (defaults to no tags)
|
|
178
|
+
* @param options.dueDate The due date of the proof (defaults to 3 days in the future)
|
|
179
|
+
* @param options.messageToReviewers The message to reviewers
|
|
180
|
+
* @param options.workflow.id The workflow id to assign to the proof
|
|
181
|
+
* @param options.workflowTemplate.id The workflow template id to duplicate and assign to the proof
|
|
182
|
+
* @param options.file.id The file id to assign to the proof
|
|
183
|
+
* @param options.group.id The proof group id to add the proof to
|
|
184
|
+
* @param options.previousProof.id The proof id of the previous proof to attach this new version to
|
|
185
|
+
* @param options.team.slug The team slug (user-friendly identifier)
|
|
186
|
+
* @param options.reference The proof reference to add the proof to (to integration with other applications)
|
|
187
|
+
* @param options.customTools Any custom tools to expose on the proofing screen
|
|
188
|
+
* @param options.integrationReferences The integration references to attach to the proof
|
|
189
|
+
* @param options.reminders The proof reminders to add the proof to (to nudge users)
|
|
190
|
+
* @param options.owners The users to assign as owners for the proof (if omitted and a new version, the previous version's owners are inherited, otherwise, the user creating the proof is assigned as the only owner)
|
|
191
|
+
* @param options.canDownload Whether the file attached to the proof can be download
|
|
192
|
+
* @param options.start Whether to immediately start the proof (sends invitation emails to reviewers in the workflow)
|
|
191
193
|
* @returns {Promise<Proof>}
|
|
192
194
|
*/
|
|
193
195
|
create({ name, tags, dueDate, messageToReviewers, workflow, workflowTemplate, file, group, previousProof, team, reference, customTools, integrationReferences, reminders, owners, canDownload, start, }: {
|
|
194
196
|
name: string;
|
|
195
197
|
tags?: string[];
|
|
196
|
-
dueDate?: Date;
|
|
198
|
+
dueDate?: string | Date;
|
|
197
199
|
messageToReviewers?: string;
|
|
198
|
-
workflow?:
|
|
200
|
+
workflow?: {
|
|
201
|
+
id: string;
|
|
202
|
+
};
|
|
203
|
+
workflowTemplate?: {
|
|
204
|
+
id: string;
|
|
205
|
+
};
|
|
206
|
+
file?: {
|
|
207
|
+
id: string;
|
|
208
|
+
};
|
|
209
|
+
group?: {
|
|
210
|
+
id: string;
|
|
211
|
+
};
|
|
212
|
+
previousProof?: {
|
|
213
|
+
id: string;
|
|
214
|
+
};
|
|
215
|
+
team?: {
|
|
216
|
+
slug: string;
|
|
217
|
+
};
|
|
218
|
+
reference?: string;
|
|
219
|
+
customTools?: any;
|
|
220
|
+
integrationReferences: any[];
|
|
221
|
+
reminders?: any[];
|
|
222
|
+
owners?: {
|
|
223
|
+
email?: string;
|
|
224
|
+
id?: string;
|
|
225
|
+
}[];
|
|
226
|
+
canDownload?: boolean;
|
|
227
|
+
start?: boolean;
|
|
199
228
|
}): Promise<Proof>;
|
|
200
229
|
/**
|
|
201
230
|
* Manually archives a proof or proofs. This action hides the proof from all user's who have access to it, but can still be
|
package/lib/api/Proofs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};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 _ProofsCustomTools=require("./ProofsCustomTools");var _ProofsCustomTools2=_interopRequireDefault(_ProofsCustomTools);var _ProofsIntegrationReferences=require("./ProofsIntegrationReferences");var _ProofsIntegrationReferences2=_interopRequireDefault(_ProofsIntegrationReferences);var _ProofsLinkCheck=require("./ProofsLinkCheck");var _ProofsLinkCheck2=_interopRequireDefault(_ProofsLinkCheck);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);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}function transformProofsForUpdate(proofs){var proofsArrForUpdate=[].concat(proofs);proofsArrForUpdate.forEach(function(proof){proof.proofId=proof.id;delete proof.id});return proofsArrForUpdate}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);_this.customTools=new _ProofsCustomTools2.default(client);_this.integrationReferences=new _ProofsIntegrationReferences2.default(client);_this.linkCheck=new _ProofsLinkCheck2.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,workflowTemplate=_ref.workflowTemplate,file=_ref.file,group=_ref.group,previousProof=_ref.previousProof,team=_ref.team,reference=_ref.reference,customTools=_ref.customTools,integrationReferences=_ref.integrationReferences,_ref$reminders=_ref.reminders,reminders=_ref$reminders===undefined?[]:_ref$reminders,owners=_ref.owners,canDownload=_ref.canDownload,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start;return this.client.request("proofs.create",{proof:{name:name,tags:tags,dueDate:dueDate.toISOString(),messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,workflowTemplateId:workflowTemplate&&workflowTemplate.id||undefined,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,previousProofId:previousProof&&previousProof.id||undefined,teamSlug:team&&team.slug||undefined,reference:reference,integrationReferences:integrationReferences,reminders:[].concat(reminders),owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();if(customTools&&!previousProof){return _this4.customTools.update(proof.id,customTools).then(function(){return proof})}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.generateEmail=function generateEmail(proofId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.client.request("email.proofs.generate",_extends({proofId:proofId},options)).then(function(response){return response.data})};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})};Proofs.prototype.returnTodos=function returnTodos(proofIdOrIds,_ref2){var messageToOwners=_ref2.messageToOwners,_ref2$markCommentsAsT=_ref2.markCommentsAsTodo,markCommentsAsTodo=_ref2$markCommentsAsT===undefined?false:_ref2$markCommentsAsT;return this.client.request("proofs.return-todos",{proofIds:[].concat(proofIdOrIds),messageToOwners:messageToOwners,markCommentAsTodo:markCommentsAsTodo})};Proofs.prototype.updateDecision=function updateDecision(proofId,decision){return this.client.request("proofs.update-decision",{proofId:proofId,decision:decision})};Proofs.prototype.update=function update(proofOrProofs){if(proofOrProofs.length===1||typeof proofOrProofs.length==="undefined"){var _concat$=[].concat(proofOrProofs)[0],id=_concat$.id,name=_concat$.name,tags=_concat$.tags,dueDate=_concat$.dueDate,messageToReviewers=_concat$.messageToReviewers,workflow=_concat$.workflow,file=_concat$.file,reference=_concat$.reference,integrationReferences=_concat$.integrationReferences,reminders=_concat$.reminders,owners=_concat$.owners,canDownload=_concat$.canDownload,start=_concat$.start;return this.client.request("proofs.update",{proof:{id:id,name:name,tags:tags,dueDate:dueDate?dueDate.toISOString():undefined,messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,fileId:file&&file.id||undefined,reference:reference,integrationReferences:integrationReferences,reminders:reminders?[].concat(reminders):undefined,owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();return proof})}return this.client.request("proofs.bulk-update",{proofs:transformProofsForUpdate(proofOrProofs)})};Proofs.prototype.next=function next(proofId){return this.client.request("proofs.next",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};return Proofs}(_API3.default);exports.default=Proofs;
|
|
1
|
+
"use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};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 _ProofsCustomTools=require("./ProofsCustomTools");var _ProofsCustomTools2=_interopRequireDefault(_ProofsCustomTools);var _ProofsIntegrationReferences=require("./ProofsIntegrationReferences");var _ProofsIntegrationReferences2=_interopRequireDefault(_ProofsIntegrationReferences);var _ProofsLinkCheck=require("./ProofsLinkCheck");var _ProofsLinkCheck2=_interopRequireDefault(_ProofsLinkCheck);var _Proof=require("../models/Proof");var _Proof2=_interopRequireDefault(_Proof);var _Reminders=require("./Reminders");var _Reminders2=_interopRequireDefault(_Reminders);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}function transformProofsForUpdate(proofs){var proofsArrForUpdate=[].concat(proofs);proofsArrForUpdate.forEach(function(proof){proof.proofId=proof.id;delete proof.id});return proofsArrForUpdate}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);_this.customTools=new _ProofsCustomTools2.default(client);_this.integrationReferences=new _ProofsIntegrationReferences2.default(client);_this.linkCheck=new _ProofsLinkCheck2.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,workflowTemplate=_ref.workflowTemplate,file=_ref.file,group=_ref.group,previousProof=_ref.previousProof,team=_ref.team,reference=_ref.reference,customTools=_ref.customTools,integrationReferences=_ref.integrationReferences,_ref$reminders=_ref.reminders,reminders=_ref$reminders===undefined?[]:_ref$reminders,owners=_ref.owners,canDownload=_ref.canDownload,_ref$start=_ref.start,start=_ref$start===undefined?true:_ref$start;return this.client.request("proofs.create",{proof:{name:name,tags:tags,dueDate:dueDate.toISOString?dueDate.toISOString():String(dueDate),messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,workflowTemplateId:workflowTemplate&&workflowTemplate.id||undefined,fileId:file&&file.id||undefined,groupId:group&&group.id||undefined,previousProofId:previousProof&&previousProof.id||undefined,teamSlug:team&&team.slug||undefined,reference:reference,integrationReferences:integrationReferences,reminders:[].concat(reminders),owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();if(customTools&&!previousProof){return _this4.customTools.update(proof.id,customTools).then(function(){return proof})}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.generateEmail=function generateEmail(proofId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.client.request("email.proofs.generate",_extends({proofId:proofId},options)).then(function(response){return response.data})};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})};Proofs.prototype.returnTodos=function returnTodos(proofIdOrIds,_ref2){var messageToOwners=_ref2.messageToOwners,_ref2$markCommentsAsT=_ref2.markCommentsAsTodo,markCommentsAsTodo=_ref2$markCommentsAsT===undefined?false:_ref2$markCommentsAsT;return this.client.request("proofs.return-todos",{proofIds:[].concat(proofIdOrIds),messageToOwners:messageToOwners,markCommentAsTodo:markCommentsAsTodo})};Proofs.prototype.updateDecision=function updateDecision(proofId,decision){return this.client.request("proofs.update-decision",{proofId:proofId,decision:decision})};Proofs.prototype.update=function update(proofOrProofs){if(proofOrProofs.length===1||typeof proofOrProofs.length==="undefined"){var _concat$=[].concat(proofOrProofs)[0],id=_concat$.id,name=_concat$.name,tags=_concat$.tags,dueDate=_concat$.dueDate,messageToReviewers=_concat$.messageToReviewers,workflow=_concat$.workflow,file=_concat$.file,reference=_concat$.reference,integrationReferences=_concat$.integrationReferences,reminders=_concat$.reminders,owners=_concat$.owners,canDownload=_concat$.canDownload,start=_concat$.start;return this.client.request("proofs.update",{proof:{id:id,name:name,tags:tags,dueDate:dueDate?dueDate.toISOString():undefined,messageToReviewers:messageToReviewers,workflowId:workflow&&workflow.id||undefined,fileId:file&&file.id||undefined,reference:reference,integrationReferences:integrationReferences,reminders:reminders?[].concat(reminders):undefined,owners:owners,canDownload:canDownload,start:start}}).then(function(response){var proof=(new _Proof2.default).fromProof(response.data);proof.calculateState();return proof})}return this.client.request("proofs.bulk-update",{proofs:transformProofsForUpdate(proofOrProofs)})};Proofs.prototype.next=function next(proofId){return this.client.request("proofs.next",{proofId:proofId}).then(function(response){return(new _Proof2.default).fromProof(response.data)})};return Proofs}(_API3.default);exports.default=Proofs;
|
|
@@ -25,7 +25,7 @@ declare class ProofsIntegrationReferences extends API {
|
|
|
25
25
|
*
|
|
26
26
|
* @since 2.0.0-beta.144
|
|
27
27
|
* @param {string} proofId The proof id
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {ProofIntegrationReference} integrationReference The integration reference option to add to a proof
|
|
29
29
|
* @returns {Promise}
|
|
30
30
|
*/
|
|
31
31
|
add(proofId: string, integrationReference: any): Promise<any>;
|
package/lib/api/Workflows.d.ts
CHANGED
|
@@ -276,6 +276,37 @@ declare class Workflows extends API {
|
|
|
276
276
|
* @returns {Promise}
|
|
277
277
|
*/
|
|
278
278
|
skipAll(workflowId: string): Promise<any>;
|
|
279
|
+
/**
|
|
280
|
+
* Nudge a user from the currently visible step of a workflow
|
|
281
|
+
*
|
|
282
|
+
* @example <caption>Nudge current visible step user</caption>
|
|
283
|
+
* await client.workflows.nudgeUser('W8VN0H4UYFVV1VQL', 'UFAFSRPX40JRMLSY', 'new nudge message');
|
|
284
|
+
*
|
|
285
|
+
* @example <caption>Nudge current visible step user without message</caption>
|
|
286
|
+
* await client.workflows.nudgeUser('W8VN0H4UYFVV1VQL', 'UFAFSRPX40JRMLSY');
|
|
287
|
+
*
|
|
288
|
+
* @since v2.0.0-beta.155
|
|
289
|
+
* @param {string} workflowId The workflow id
|
|
290
|
+
* @param {string} userId The user id
|
|
291
|
+
* @param {string|null} [message] The nudge message
|
|
292
|
+
* @returns {Promise}
|
|
293
|
+
*/
|
|
294
|
+
nudgeUser(workflowId: string, userId: string, message?: string): Promise<any>;
|
|
295
|
+
/**
|
|
296
|
+
* Nudge all users from the currently visible steps of a workflow
|
|
297
|
+
*
|
|
298
|
+
* @example <caption>Nudge all current visible steps users</caption>
|
|
299
|
+
* await client.workflows.nudgeAll('W8VN0H4UYFVV1VQL', 'new nudge message');
|
|
300
|
+
*
|
|
301
|
+
* @example <caption>Nudge all current visible step user without message</caption>
|
|
302
|
+
* await client.workflows.nudgeAll('W8VN0H4UYFVV1VQL');
|
|
303
|
+
*
|
|
304
|
+
* @since v2.0.0-beta.155
|
|
305
|
+
* @param {string} workflowId The workflow id
|
|
306
|
+
* @param {string|null} [message] The nudge message
|
|
307
|
+
* @returns {Promise}
|
|
308
|
+
*/
|
|
309
|
+
nudgeAll(workflowId: string, message?: string): Promise<any>;
|
|
279
310
|
/**
|
|
280
311
|
* Set a step id as starting point for the workflow.
|
|
281
312
|
*
|
|
@@ -332,6 +363,29 @@ declare class Workflows extends API {
|
|
|
332
363
|
name?: string;
|
|
333
364
|
isOwnedByTeam?: boolean;
|
|
334
365
|
}): Promise<Workflow>;
|
|
366
|
+
/**
|
|
367
|
+
* Load the nudge all message that the users most recently received.
|
|
368
|
+
*
|
|
369
|
+
* @example <caption>Loading the nudge all message</caption>
|
|
370
|
+
* await client.workflows.getNudgeAllMessage(proof.workflowId);
|
|
371
|
+
*
|
|
372
|
+
* @since 2.0.0-beta.155
|
|
373
|
+
* @param {string} workflowId The workflow id
|
|
374
|
+
* @returns {Promise<string|null>}
|
|
375
|
+
*/
|
|
376
|
+
getNudgeAllMessage(workflowId: string): Promise<string>;
|
|
377
|
+
/**
|
|
378
|
+
* Load the nudge message that the user most recently received.
|
|
379
|
+
*
|
|
380
|
+
* @example <caption>Loading the user nudge message</caption>
|
|
381
|
+
* await client.workflows.getNudgeMessage(proof.workflowId, userId);
|
|
382
|
+
*
|
|
383
|
+
* @since 2.0.0-beta.155
|
|
384
|
+
* @param {string} workflowId The workflow id
|
|
385
|
+
* @param {string} userId The id of the user that received the nudge message
|
|
386
|
+
* @returns {Promise<string|null>}
|
|
387
|
+
*/
|
|
388
|
+
getNudgeMessage(workflowId: string, userId: string): Promise<string>;
|
|
335
389
|
/** @private */
|
|
336
390
|
_duplicateWorkflow(workflowId: any, options: any): any;
|
|
337
391
|
/** @private */
|
package/lib/api/Workflows.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Workflow=require("../models/Workflow");var _Workflow2=_interopRequireDefault(_Workflow);var _WorkflowStep=require("../models/WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);var _WorkflowUser=require("../models/WorkflowUser");var _WorkflowUser2=_interopRequireDefault(_WorkflowUser);var _id=require("../util/id");var _WorkflowsSteps=require("./WorkflowsSteps");var _WorkflowsSteps2=_interopRequireDefault(_WorkflowsSteps);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 hasEnoughUserDetails(workflowUser){return workflowUser&&((0,_id.isUserId)(workflowUser.id)||workflowUser.email)}function transformWorkflows(workflows){return(workflows||[]).map(function(workflowData){return(new _Workflow2.default).fromWorkflow(workflowData)})}var Workflows=function(_API){_inherits(Workflows,_API);function Workflows(client){_classCallCheck(this,Workflows);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.steps=new _WorkflowsSteps2.default(client);return _this}Workflows.prototype.create=function create(_ref){var _this2=this;var _ref$save=_ref.save,save=_ref$save===undefined?false:_ref$save,name=_ref.name,_ref$steps=_ref.steps,_steps=_ref$steps===undefined?[]:_ref$steps,reviewers=_ref.reviewers,approver=_ref.approver,owners=_ref.owners,_ref$isOwnedByTeam=_ref.isOwnedByTeam,isOwnedByTeam=_ref$isOwnedByTeam===undefined?false:_ref$isOwnedByTeam;if(!hasEnoughUserDetails(approver)){return Promise.reject(Error("An approver is required to create a workflow."))}if(save&&!name){return Promise.reject(Error("A workflow must have a name when saving it as a workflow template."))}var steps=_steps;if(reviewers&&reviewers.length){steps.splice(0,0,{users:reviewers})}if(approver){steps.push({position:1e3,users:[approver],start:approver.start})}var largestPosition=0;for(var i=0;i<steps.length;i++){var step=steps[i];step.users=step.users||[];if(!step.position||step.position<largestPosition){step.position=largestPosition+1}largestPosition=Math.max(largestPosition,step.position);for(var ii=0;ii<step.users.length;ii++){var user=step.users[ii];if(!hasEnoughUserDetails(user)){return Promise.reject(Error("A user id or email address must be provided for a workflow user."))}}}var workflowId=void 0;return this._createWorkflow(name,isOwnedByTeam).then(function(workflow){workflowId=workflow.id;return Promise.all([workflow,Promise.all(steps.map(function(step){var workflowStep=workflow.getStepByPosition(step.position);return workflowStep?_this2._setWorkflowStepUsersMutate(workflow.id,workflowStep,step.users,step.start):_this2._addWorkflowStepAndUsers(workflow.id,step,step.start)})),owners&&Promise.all(owners.map(function(owner){return _this2._addProofOwnerToWorkflowTemplate(workflowId,owner)}))])}).then(function(_ref2){var workflow=_ref2[0],workflowSteps=_ref2[1];workflow.steps=workflowSteps;return workflow}).then(function(workflow){if(save){return _this2._duplicateWorkflow(workflowId)}return workflow}).catch(function(err){return Promise.resolve(workflowId&&_this2._deleteWorkflow(workflowId)).then(function(){return Promise.reject(err)})})};Workflows.prototype.load=function load(workflowId){return this.client.request("workflows.load",{workflowId:workflowId}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype.use=function use(workflowId,options){return this.duplicate(workflowId,options)};Workflows.prototype.duplicate=function duplicate(workflowId,options){return this._duplicateWorkflow(workflowId,options)};Workflows.prototype.delete=function _delete(workflowId){return this._deleteWorkflow(workflowId)};Workflows.prototype.all=function all(){return Promise.all([this.owned(),this.shared()]).then(function(_ref3){var owned=_ref3[0],shared=_ref3[1];return[].concat(owned,shared)})};Workflows.prototype.owned=function owned(){return this.client.request("workflows.owned").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.shared=function shared(){return this.client.request("workflows.shared").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.setApprover=function setApprover(workflowId,user){return this.client.request("workflows.users.set",{workflowId:workflowId,position:1e3,users:[user]})};Workflows.prototype.skipAll=function skipAll(workflowId){return this.client.request("workflows.users.skip-all",{workflowId:workflowId})};Workflows.prototype.setStartingStep=function setStartingStep(workflowId,stepId){return this.client.request("workflows.set-starting-step",{workflowId:workflowId,stepId:stepId})};Workflows.prototype.replaceApprover=function replaceApprover(workflowIdOrIds,user){return this.client.request("workflows.replace-approver",{workflowIds:[].concat(workflowIdOrIds),user:user})};Workflows.prototype.update=function update(workflowId,_ref4){var name=_ref4.name,isOwnedByTeam=_ref4.isOwnedByTeam;return this.client.request("workflows.update",{workflowId:workflowId,title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype._duplicateWorkflow=function _duplicateWorkflow(workflowId,options){var _this3=this;return this.client.request("workflows.duplicate",{workflowId:workflowId,noOwners:options&&options.includeOwners===false?true:undefined}).then(function(response){var duplicatedWorkflowId=response.data.WorkflowId;return _this3.load(duplicatedWorkflowId)})};Workflows.prototype._deleteWorkflow=function _deleteWorkflow(workflowId){return this.client.request("workflows.delete",{workflowId:workflowId})};Workflows.prototype._createWorkflow=function _createWorkflow(name,isOwnedByTeam){return this.client.request("workflows.create",{title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype._addWorkflowStepAndUsers=function _addWorkflowStepAndUsers(workflowId,step,start){var _this4=this;return this.client.request("workflows.steps.add",{workflowId:workflowId,title:step.name,position:step.position}).then(function(response){var workflowStep=(new _WorkflowStep2.default).fromWorkflowStep(response.data);return _this4._setWorkflowStepUsersMutate(workflowId,workflowStep,step.users,start)})};Workflows.prototype._setWorkflowStepUsersMutate=function _setWorkflowStepUsersMutate(workflowId,workflowStep,users,start){var _this5=this;return this.client.request("workflows.users.set",{workflowId:workflowId,stepId:workflowStep.id,users:users.map(function(user){return{email:user.email,userId:user.id,role:user.role,permissions:user.permissions&&{inviter:!!user.permissions.inviter}}})}).then(function(response){var workflowUsers=response.data.map(function(user){return(new _WorkflowUser2.default).fromWorkflowUser(user)});workflowStep.users=workflowUsers}).then(function(){if(start===true){return _this5.setStartingStep(workflowId,workflowStep.id).then(function(){return workflowStep})}return workflowStep})};Workflows.prototype._addProofOwnerToWorkflowTemplate=function _addProofOwnerToWorkflowTemplate(workflowId,user){return this.client.request("workflows.proof-owners.add",{relatedId:workflowId,workflowCopyToProof:1,userId:user.id,email:user.email})};return Workflows}(_API3.default);exports.default=Workflows;
|
|
1
|
+
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Workflow=require("../models/Workflow");var _Workflow2=_interopRequireDefault(_Workflow);var _WorkflowStep=require("../models/WorkflowStep");var _WorkflowStep2=_interopRequireDefault(_WorkflowStep);var _WorkflowUser=require("../models/WorkflowUser");var _WorkflowUser2=_interopRequireDefault(_WorkflowUser);var _id=require("../util/id");var _WorkflowsSteps=require("./WorkflowsSteps");var _WorkflowsSteps2=_interopRequireDefault(_WorkflowsSteps);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 hasEnoughUserDetails(workflowUser){return workflowUser&&((0,_id.isUserId)(workflowUser.id)||workflowUser.email)}function transformWorkflows(workflows){return(workflows||[]).map(function(workflowData){return(new _Workflow2.default).fromWorkflow(workflowData)})}var Workflows=function(_API){_inherits(Workflows,_API);function Workflows(client){_classCallCheck(this,Workflows);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.steps=new _WorkflowsSteps2.default(client);return _this}Workflows.prototype.create=function create(_ref){var _this2=this;var _ref$save=_ref.save,save=_ref$save===undefined?false:_ref$save,name=_ref.name,_ref$steps=_ref.steps,_steps=_ref$steps===undefined?[]:_ref$steps,reviewers=_ref.reviewers,approver=_ref.approver,owners=_ref.owners,_ref$isOwnedByTeam=_ref.isOwnedByTeam,isOwnedByTeam=_ref$isOwnedByTeam===undefined?false:_ref$isOwnedByTeam;if(!hasEnoughUserDetails(approver)){return Promise.reject(Error("An approver is required to create a workflow."))}if(save&&!name){return Promise.reject(Error("A workflow must have a name when saving it as a workflow template."))}var steps=_steps;if(reviewers&&reviewers.length){steps.splice(0,0,{users:reviewers})}if(approver){steps.push({position:1e3,users:[approver],start:approver.start})}var largestPosition=0;for(var i=0;i<steps.length;i++){var step=steps[i];step.users=step.users||[];if(!step.position||step.position<largestPosition){step.position=largestPosition+1}largestPosition=Math.max(largestPosition,step.position);for(var ii=0;ii<step.users.length;ii++){var user=step.users[ii];if(!hasEnoughUserDetails(user)){return Promise.reject(Error("A user id or email address must be provided for a workflow user."))}}}var workflowId=void 0;return this._createWorkflow(name,isOwnedByTeam).then(function(workflow){workflowId=workflow.id;return Promise.all([workflow,Promise.all(steps.map(function(step){var workflowStep=workflow.getStepByPosition(step.position);return workflowStep?_this2._setWorkflowStepUsersMutate(workflow.id,workflowStep,step.users,step.start):_this2._addWorkflowStepAndUsers(workflow.id,step,step.start)})),owners&&Promise.all(owners.map(function(owner){return _this2._addProofOwnerToWorkflowTemplate(workflowId,owner)}))])}).then(function(_ref2){var workflow=_ref2[0],workflowSteps=_ref2[1];workflow.steps=workflowSteps;return workflow}).then(function(workflow){if(save){return _this2._duplicateWorkflow(workflowId)}return workflow}).catch(function(err){return Promise.resolve(workflowId&&_this2._deleteWorkflow(workflowId)).then(function(){return Promise.reject(err)})})};Workflows.prototype.load=function load(workflowId){return this.client.request("workflows.load",{workflowId:workflowId}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype.use=function use(workflowId,options){return this.duplicate(workflowId,options)};Workflows.prototype.duplicate=function duplicate(workflowId,options){return this._duplicateWorkflow(workflowId,options)};Workflows.prototype.delete=function _delete(workflowId){return this._deleteWorkflow(workflowId)};Workflows.prototype.all=function all(){return Promise.all([this.owned(),this.shared()]).then(function(_ref3){var owned=_ref3[0],shared=_ref3[1];return[].concat(owned,shared)})};Workflows.prototype.owned=function owned(){return this.client.request("workflows.owned").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.shared=function shared(){return this.client.request("workflows.shared").then(function(response){return transformWorkflows(response.data)})};Workflows.prototype.setApprover=function setApprover(workflowId,user){return this.client.request("workflows.users.set",{workflowId:workflowId,position:1e3,users:[user]})};Workflows.prototype.skipAll=function skipAll(workflowId){return this.client.request("workflows.users.skip-all",{workflowId:workflowId})};Workflows.prototype.nudgeUser=function nudgeUser(workflowId,userId){var message=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return this.client.request("workflows.user.nudge",{workflowId:workflowId,userId:userId,message:message})};Workflows.prototype.nudgeAll=function nudgeAll(workflowId){var message=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return this.client.request("workflows.nudge-all",{workflowId:workflowId,message:message})};Workflows.prototype.setStartingStep=function setStartingStep(workflowId,stepId){return this.client.request("workflows.set-starting-step",{workflowId:workflowId,stepId:stepId})};Workflows.prototype.replaceApprover=function replaceApprover(workflowIdOrIds,user){return this.client.request("workflows.replace-approver",{workflowIds:[].concat(workflowIdOrIds),user:user})};Workflows.prototype.update=function update(workflowId,_ref4){var name=_ref4.name,isOwnedByTeam=_ref4.isOwnedByTeam;return this.client.request("workflows.update",{workflowId:workflowId,title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype.getNudgeAllMessage=function getNudgeAllMessage(workflowId){return this.client.request("workflows.nudge-message",{workflowId:workflowId}).then(function(response){return response.data.Message})};Workflows.prototype.getNudgeMessage=function getNudgeMessage(workflowId,userId){return this.client.request("workflows.nudge-message",{workflowId:workflowId,userId:userId}).then(function(response){return response.data.Message})};Workflows.prototype._duplicateWorkflow=function _duplicateWorkflow(workflowId,options){var _this3=this;return this.client.request("workflows.duplicate",{workflowId:workflowId,noOwners:options&&options.includeOwners===false?true:undefined}).then(function(response){var duplicatedWorkflowId=response.data.WorkflowId;return _this3.load(duplicatedWorkflowId)})};Workflows.prototype._deleteWorkflow=function _deleteWorkflow(workflowId){return this.client.request("workflows.delete",{workflowId:workflowId})};Workflows.prototype._createWorkflow=function _createWorkflow(name,isOwnedByTeam){return this.client.request("workflows.create",{title:name,ownedByTeam:isOwnedByTeam}).then(function(response){return(new _Workflow2.default).fromWorkflow(response.data)})};Workflows.prototype._addWorkflowStepAndUsers=function _addWorkflowStepAndUsers(workflowId,step,start){var _this4=this;return this.client.request("workflows.steps.add",{workflowId:workflowId,title:step.name,position:step.position}).then(function(response){var workflowStep=(new _WorkflowStep2.default).fromWorkflowStep(response.data);return _this4._setWorkflowStepUsersMutate(workflowId,workflowStep,step.users,start)})};Workflows.prototype._setWorkflowStepUsersMutate=function _setWorkflowStepUsersMutate(workflowId,workflowStep,users,start){var _this5=this;return this.client.request("workflows.users.set",{workflowId:workflowId,stepId:workflowStep.id,users:users.map(function(user){return{email:user.email,userId:user.id,role:user.role,permissions:user.permissions&&{inviter:!!user.permissions.inviter}}})}).then(function(response){var workflowUsers=response.data.map(function(user){return(new _WorkflowUser2.default).fromWorkflowUser(user)});workflowStep.users=workflowUsers}).then(function(){if(start===true){return _this5.setStartingStep(workflowId,workflowStep.id).then(function(){return workflowStep})}return workflowStep})};Workflows.prototype._addProofOwnerToWorkflowTemplate=function _addProofOwnerToWorkflowTemplate(workflowId,user){return this.client.request("workflows.proof-owners.add",{relatedId:workflowId,workflowCopyToProof:1,userId:user.id,email:user.email})};return Workflows}(_API3.default);exports.default=Workflows;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export default TeamDashboard;
|
|
2
2
|
declare class TeamDashboard extends API {
|
|
3
|
+
/** @private */
|
|
3
4
|
constructor(client: any);
|
|
5
|
+
/**
|
|
6
|
+
* The Team Dashboard Groups API.
|
|
7
|
+
*
|
|
8
|
+
* @type {TeamDashboardGroups}
|
|
9
|
+
*/
|
|
10
|
+
groups: TeamDashboardGroups;
|
|
4
11
|
/**
|
|
5
12
|
* Loads all the proofs in the team's inbox.
|
|
6
13
|
*
|
|
@@ -74,3 +81,4 @@ declare class TeamDashboard extends API {
|
|
|
74
81
|
_loadTeamSearchProofs(params: any): any;
|
|
75
82
|
}
|
|
76
83
|
import API from "../API";
|
|
84
|
+
import TeamDashboardGroups from "./TeamDashboardGroups";
|
|
@@ -14,6 +14,10 @@ var _ProofStatus = require('../../enum/ProofStatus');
|
|
|
14
14
|
|
|
15
15
|
var _ProofStatus2 = _interopRequireDefault(_ProofStatus);
|
|
16
16
|
|
|
17
|
+
var _TeamDashboardGroups = require('./TeamDashboardGroups');
|
|
18
|
+
|
|
19
|
+
var _TeamDashboardGroups2 = _interopRequireDefault(_TeamDashboardGroups);
|
|
20
|
+
|
|
17
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
22
|
|
|
19
23
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -49,10 +53,15 @@ function transformProofs(proofs) {
|
|
|
49
53
|
var TeamDashboard = function (_API) {
|
|
50
54
|
_inherits(TeamDashboard, _API);
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
/** @private */
|
|
57
|
+
function TeamDashboard(client) {
|
|
53
58
|
_classCallCheck(this, TeamDashboard);
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
// Nested APIs
|
|
61
|
+
var _this = _possibleConstructorReturn(this, _API.call(this, client));
|
|
62
|
+
|
|
63
|
+
_this.groups = new _TeamDashboardGroups2.default(client);
|
|
64
|
+
return _this;
|
|
56
65
|
}
|
|
57
66
|
|
|
58
67
|
/**
|
|
@@ -62,6 +71,14 @@ var TeamDashboard = function (_API) {
|
|
|
62
71
|
* @param {number} page The page number
|
|
63
72
|
* @returns {Promise<TeamDashboardPagination>}
|
|
64
73
|
*/
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The Team Dashboard Groups API.
|
|
77
|
+
*
|
|
78
|
+
* @type {TeamDashboardGroups}
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
|
|
65
82
|
TeamDashboard.prototype.inbox = function inbox(page) {
|
|
66
83
|
return this._loadSingleTeamTabProofs('inbox', { page: page });
|
|
67
84
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default TeamDashboardGroups;
|
|
2
|
+
declare class TeamDashboardGroups extends API {
|
|
3
|
+
constructor(client: any);
|
|
4
|
+
/**
|
|
5
|
+
* Loads all the team's proof groups in a certain category (current/archived).
|
|
6
|
+
*
|
|
7
|
+
* @param {string} category The proof groups category name
|
|
8
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
9
|
+
*/
|
|
10
|
+
_loadGroups(category: string): Promise<any[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Loads a team group by id for team admin.
|
|
13
|
+
*
|
|
14
|
+
* @example <caption>Loads a team group for team admin</caption>
|
|
15
|
+
* const admin = await client.admin();
|
|
16
|
+
* const teamGroup = await admin.team.dashboard.groups.load('GVNM8NTI1VSTCRN5');
|
|
17
|
+
* console.log(teamGroup); // {ProofGroup}
|
|
18
|
+
*
|
|
19
|
+
* @since v2.0.0-beta.153
|
|
20
|
+
* @param {string} groupId The group id
|
|
21
|
+
* @returns {Promise<ProofGroup>}
|
|
22
|
+
*/
|
|
23
|
+
load(groupId: string): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Loads all the team's active proof groups.
|
|
26
|
+
*
|
|
27
|
+
* @example <caption>Loads all the team's active proof groups.</caption>
|
|
28
|
+
* const admin = await client.admin();
|
|
29
|
+
* const currentGroupsForTeam = await admin.team.dashboard.groups.current();
|
|
30
|
+
* console.log(currentGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
31
|
+
*
|
|
32
|
+
* @since v2.0.0-beta.153
|
|
33
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
34
|
+
*/
|
|
35
|
+
current(): Promise<any[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Loads all the team's archived proof groups.
|
|
38
|
+
*
|
|
39
|
+
* @example <caption>Loads all the team's archived proof groups.</caption>
|
|
40
|
+
* const admin = await client.admin();
|
|
41
|
+
* const archivedGroupsForTeam = await admin.team.dashboard.groups.archived();
|
|
42
|
+
* console.log(archivedGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
43
|
+
*
|
|
44
|
+
* @since v2.0.0-beta.153
|
|
45
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
46
|
+
*/
|
|
47
|
+
archived(): Promise<any[]>;
|
|
48
|
+
}
|
|
49
|
+
import API from "../API";
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _API2 = require('../API');
|
|
6
|
+
|
|
7
|
+
var _API3 = _interopRequireDefault(_API2);
|
|
8
|
+
|
|
9
|
+
var _ProofGroup = require('../../models/ProofGroup');
|
|
10
|
+
|
|
11
|
+
var _ProofGroup2 = _interopRequireDefault(_ProofGroup);
|
|
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; }
|
|
20
|
+
|
|
21
|
+
function transformGroups(groups) {
|
|
22
|
+
return (groups || []).map(function (groupData) {
|
|
23
|
+
return new _ProofGroup2.default().fromProofGroup(groupData);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function mapResponseToGroup(response) {
|
|
28
|
+
return new _ProofGroup2.default().fromProofGroup(response.data);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var TeamDashboardGroups = function (_API) {
|
|
32
|
+
_inherits(TeamDashboardGroups, _API);
|
|
33
|
+
|
|
34
|
+
function TeamDashboardGroups() {
|
|
35
|
+
_classCallCheck(this, TeamDashboardGroups);
|
|
36
|
+
|
|
37
|
+
return _possibleConstructorReturn(this, _API.apply(this, arguments));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Loads all the team's proof groups in a certain category (current/archived).
|
|
42
|
+
*
|
|
43
|
+
* @param {string} category The proof groups category name
|
|
44
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
45
|
+
*/
|
|
46
|
+
TeamDashboardGroups.prototype._loadGroups = function _loadGroups(category) {
|
|
47
|
+
return this.client.request('admin.team.dashboard.groups.category', {
|
|
48
|
+
category: category
|
|
49
|
+
}).then(function (response) {
|
|
50
|
+
return transformGroups(response.data);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Loads a team group by id for team admin.
|
|
56
|
+
*
|
|
57
|
+
* @example <caption>Loads a team group for team admin</caption>
|
|
58
|
+
* const admin = await client.admin();
|
|
59
|
+
* const teamGroup = await admin.team.dashboard.groups.load('GVNM8NTI1VSTCRN5');
|
|
60
|
+
* console.log(teamGroup); // {ProofGroup}
|
|
61
|
+
*
|
|
62
|
+
* @since v2.0.0-beta.153
|
|
63
|
+
* @param {string} groupId The group id
|
|
64
|
+
* @returns {Promise<ProofGroup>}
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
TeamDashboardGroups.prototype.load = function load(groupId) {
|
|
69
|
+
return this.client.request('admin.team.proofs.groups.load', {
|
|
70
|
+
groupId: groupId
|
|
71
|
+
}).then(mapResponseToGroup);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Loads all the team's active proof groups.
|
|
76
|
+
*
|
|
77
|
+
* @example <caption>Loads all the team's active proof groups.</caption>
|
|
78
|
+
* const admin = await client.admin();
|
|
79
|
+
* const currentGroupsForTeam = await admin.team.dashboard.groups.current();
|
|
80
|
+
* console.log(currentGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
81
|
+
*
|
|
82
|
+
* @since v2.0.0-beta.153
|
|
83
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
TeamDashboardGroups.prototype.current = function current() {
|
|
88
|
+
return this._loadGroups('current');
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Loads all the team's archived proof groups.
|
|
93
|
+
*
|
|
94
|
+
* @example <caption>Loads all the team's archived proof groups.</caption>
|
|
95
|
+
* const admin = await client.admin();
|
|
96
|
+
* const archivedGroupsForTeam = await admin.team.dashboard.groups.archived();
|
|
97
|
+
* console.log(archivedGroupsForTeam); // [ProofGroup, ProofGroup, ...]
|
|
98
|
+
*
|
|
99
|
+
* @since v2.0.0-beta.153
|
|
100
|
+
* @returns {Promise<Array<ProofGroup>>}
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
TeamDashboardGroups.prototype.archived = function archived() {
|
|
105
|
+
return this._loadGroups('archived');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return TeamDashboardGroups;
|
|
109
|
+
}(_API3.default);
|
|
110
|
+
|
|
111
|
+
exports.default = TeamDashboardGroups;
|
|
112
|
+
//# sourceMappingURL=TeamDashboardGroups.js.map
|
|
@@ -26,6 +26,7 @@ declare class TeamFeatures extends API {
|
|
|
26
26
|
* @param {boolean} options.emails.displayTeamName Whether using the team name or ’PageProof Team’ as the ‘from’ name in Email.
|
|
27
27
|
* @param {object} options.comments The comments features
|
|
28
28
|
* @param {boolean} options.comments.editComments Whether the comments/replies can be edited by other users or not
|
|
29
|
+
* @param {ProofStatus|Array<ProofStatus>} options.comments.disableReplyingToCommentsInStatuses The proof status or array of proof status to disable the replies to comments (by reviewers).
|
|
29
30
|
* @param {object} options.proofs The proofs features
|
|
30
31
|
* @param {boolean} options.proofs.reference Whether showing the reference field on a proof
|
|
31
32
|
* @returns {Promise}
|
|
@@ -37,6 +38,7 @@ declare class TeamFeatures extends API {
|
|
|
37
38
|
};
|
|
38
39
|
comments: {
|
|
39
40
|
editComments: boolean;
|
|
41
|
+
disableReplyingToCommentsInStatuses: any;
|
|
40
42
|
};
|
|
41
43
|
proofs: {
|
|
42
44
|
reference: boolean;
|