@pageproof/sdk-pr 442.0.1663213727878 → 443.0.1652837272571
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 +0 -42
- package/README.md +68 -60
- package/lib/api/Proofs.d.ts +21 -29
- package/lib/api/Proofs.js +1 -1
- package/lib/api/ProofsGroups.d.ts +1 -2
- package/lib/api/ProofsGroups.js +1 -1
- package/lib/api/admin/TeamFeatures.d.ts +0 -4
- package/lib/api/admin/TeamFeatures.js +1 -7
- package/lib/core/PageProof.d.ts +0 -35
- package/lib/core/PageProof.js +1 -1
- package/lib/models/File.d.ts +0 -6
- package/lib/models/File.js +1 -1
- package/lib/models/Proof.d.ts +2 -15
- package/lib/models/Proof.js +1 -1
- package/lib/models/ProofGroup.d.ts +0 -10
- package/lib/models/ProofGroup.js +1 -1
- package/lib/models/TeamProofFeatures.d.ts +0 -12
- package/lib/models/TeamProofFeatures.js +1 -1
- package/lib/network/endpoints.json +2 -9
- package/lib/pageproof.js +1 -1
- package/lib/util/Scheduler.js +1 -1
- package/lib/worker-crypto-adapter.js +1 -1
- package/package.json +1 -1
- package/lib/adapters/WorkerThreadsCryptoAdapter.d.ts +0 -17
- package/lib/adapters/WorkerThreadsCryptoAdapter.js +0 -1
- package/lib/api/ChecklistTemplates.d.ts +0 -86
- package/lib/api/ChecklistTemplates.js +0 -1
- package/lib/api/ChecklistTemplatesEntities.d.ts +0 -30
- package/lib/api/ChecklistTemplatesEntities.js +0 -1
- package/lib/models/ProofChecklist.d.ts +0 -45
- package/lib/models/ProofChecklist.js +0 -1
- package/lib/util/AggregateError.d.ts +0 -2
- package/lib/util/AggregateError.js +0 -1
- package/lib/util/GraphQLError.d.ts +0 -6
- package/lib/util/GraphQLError.js +0 -1
- package/lib/util/gql.d.ts +0 -2
- package/lib/util/gql.js +0 -1
- package/lib/worker/WorkerThreadsWorker.d.ts +0 -1
- package/lib/worker/WorkerThreadsWorker.js +0 -1
package/lib/util/Scheduler.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 _uuid=require("./uuid");var _uuid2=_interopRequireDefault(_uuid);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var debug=require("debug")("Scheduler");var defaultOptions={limit:1};var Deferred=function Deferred(){var _this=this;_classCallCheck(this,Deferred);this.promise=new Promise(function(resolve,reject){_this.resolve=resolve;_this.reject=reject})};var Scheduler=function(){function Scheduler(options){_classCallCheck(this,Scheduler);this.queue=[];this.workers=new Map;this.options=_extends({},defaultOptions,options)}Scheduler.prototype.send=function send(message){var deferred=new Deferred;this.queue.push({id:(0,_uuid2.default)(),deferred:deferred,message:message,attempts:0});this.process();return deferred.promise};Scheduler.prototype.prime=function prime(){while(this.workers.size<this.options.limit){this.createWorker()}};Scheduler.prototype.getIdleWorkers=function getIdleWorkers(){var _this2=this;var workers=[];var deadWorkers=[];this.workers.forEach(function(idle,worker){if(idle){if(worker.process&&typeof worker.process.isDead==="function"&&worker.process.isDead()){deadWorkers.push(worker)}else{workers.push(worker)}}});if(deadWorkers.length){debug("Found "+deadWorkers.length+" dead worker(s) while trying to locate an idle worker, removing workers from rotation");deadWorkers.forEach(function(worker){_this2.workers.delete(worker)})}return workers};Scheduler.prototype.getNextIdleWorker=function getNextIdleWorker(){return this.getIdleWorkers()[0]};Scheduler.prototype.shouldCreateWorkers=function shouldCreateWorkers(){return this.getIdleWorkers().length===0&&this.workers.size<this.options.limit&&this.queue.length>=1};Scheduler.prototype.createWorker=function createWorker(){var worker=this.options.create();this.workers.set(worker,true);return worker};Scheduler.prototype.process=function process(){if(this.queue.length===0){debug("Nothing to process, queue empty");return}var worker=null;if(this.shouldCreateWorkers()){worker=this.createWorker()}else{worker=this.getNextIdleWorker()}if(!worker){debug("Unable to process queue, as there are no idle worker available");return}var item=this.queue.shift();this.handle(item,worker)};Scheduler.prototype.handle=function handle(item,worker){var _this3=this;try{item.attempts++;this.workers.set(worker,false);var _onmessage=void 0;var onexit=void 0;_onmessage=function onmessage(event){debug("Recieved response from worker ("+item.id+")");if(worker.process){worker.process.removeListener("exit",onexit)}
|
|
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 _uuid=require("./uuid");var _uuid2=_interopRequireDefault(_uuid);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var debug=require("debug")("Scheduler");var defaultOptions={limit:1};var Deferred=function Deferred(){var _this=this;_classCallCheck(this,Deferred);this.promise=new Promise(function(resolve,reject){_this.resolve=resolve;_this.reject=reject})};var Scheduler=function(){function Scheduler(options){_classCallCheck(this,Scheduler);this.queue=[];this.workers=new Map;this.options=_extends({},defaultOptions,options)}Scheduler.prototype.send=function send(message){var deferred=new Deferred;this.queue.push({id:(0,_uuid2.default)(),deferred:deferred,message:message,attempts:0});this.process();return deferred.promise};Scheduler.prototype.prime=function prime(){while(this.workers.size<this.options.limit){this.createWorker()}};Scheduler.prototype.getIdleWorkers=function getIdleWorkers(){var _this2=this;var workers=[];var deadWorkers=[];this.workers.forEach(function(idle,worker){if(idle){if(worker.process&&typeof worker.process.isDead==="function"&&worker.process.isDead()){deadWorkers.push(worker)}else{workers.push(worker)}}});if(deadWorkers.length){debug("Found "+deadWorkers.length+" dead worker(s) while trying to locate an idle worker, removing workers from rotation");deadWorkers.forEach(function(worker){_this2.workers.delete(worker)})}return workers};Scheduler.prototype.getNextIdleWorker=function getNextIdleWorker(){return this.getIdleWorkers()[0]};Scheduler.prototype.shouldCreateWorkers=function shouldCreateWorkers(){return this.getIdleWorkers().length===0&&this.workers.size<this.options.limit&&this.queue.length>=1};Scheduler.prototype.createWorker=function createWorker(){var worker=this.options.create();this.workers.set(worker,true);return worker};Scheduler.prototype.process=function process(){if(this.queue.length===0){debug("Nothing to process, queue empty");return}var worker=null;if(this.shouldCreateWorkers()){worker=this.createWorker()}else{worker=this.getNextIdleWorker()}if(!worker){debug("Unable to process queue, as there are no idle worker available");return}var item=this.queue.shift();this.handle(item,worker)};Scheduler.prototype.handle=function handle(item,worker){var _this3=this;try{item.attempts++;this.workers.set(worker,false);var _onmessage=void 0;var onexit=void 0;_onmessage=function onmessage(event){debug("Recieved response from worker ("+item.id+")");if(worker.process){worker.process.removeListener("exit",onexit)}worker.removeEventListener("message",_onmessage);_this3.workers.set(worker,true);var _item$deferred=item.deferred,resolve=_item$deferred.resolve,reject=_item$deferred.reject;if(event.data&&event.data.error){var _event$data$error=event.data.error,message=_event$data$error.message,stack=_event$data$error.stack;var err=new Error(message);Object.defineProperty(err,"stack",{value:stack});reject(err)}else{resolve(event.data)}_this3.process()};if(worker.process){onexit=function onexit(_,signal,code){debug("Worker exited (code: "+code+", signal: "+signal+")");if(signal||code!==0){_this3.workers.delete(worker);if(item.attempts<3){_this3.queue.unshift(item)}else{var err=new Error("Worker exited with code "+(typeof code!=="undefined"?code:"<unknown>")+" (signal: "+(typeof signal!=="undefined"?signal:"<unknown>")+").");item.deferred.reject(err)}_this3.process()}};worker.process.addListener("exit",onexit)}worker.addEventListener("message",_onmessage);debug("Sending message to worker ("+item.id+")");worker.postMessage(item.message)}catch(err){debug("A synchronous error occurred in the scheduler handler, for an item");item.deferred.reject(err)}};return Scheduler}();exports.default=Scheduler;
|
|
@@ -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.PageProofWorkerCryptoAdapter=t():e.PageProofWorkerCryptoAdapter=t()}(this,function(){return function(e){function t(
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PageProofWorkerCryptoAdapter=t():e.PageProofWorkerCryptoAdapter=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=r(1),a=n(c),p=r(6),d=n(p),f={url:null,limit:navigator.hardwareConcurrency||1,optimistic:!1},l=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),n=u({},f,n);var i=s(this,e.call(this,{limit:n.limit,create:function(){return r.p=n.url+"/",new d.default}}));return n.optimistic&&i.scheduler.prime(),i.options=n,i}return i(t,e),t}(a.default);t.default=l},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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=r(2),c=n(u),a=r(5),p=n(a),d=function(e){function t(r){o(this,t);var n=s(this,e.call(this));return n.scheduler=new c.default(r),n}return i(t,e),t.prototype.decryptBytes=function(e,t,r,n,o){return this.scheduler.send({type:"decryptBytes",args:[e,t,r,n,o]})},t.prototype.decryptComment=function(e,t,r){return this.scheduler.send({type:"decryptComment",args:[e,t,r]})},t.prototype.decryptData=function(e,t,r,n){return this.scheduler.send({type:"decryptData",args:[e,t,r,n]})},t.prototype.decryptFileBlock=function(e,t){return this.scheduler.send({type:"decryptFileBlock",args:[e,t]})},t.prototype.decryptImage=function(e,t){return this.scheduler.send({type:"decryptImage",args:[e,t]})},t.prototype.decryptPrivateKey=function(e,t){return this.scheduler.send({type:"decryptPrivateKey",args:[e,t]})},t.prototype.encryptFileBlock=function(e,t,r){return this.scheduler.send({type:"encryptFileBlock",args:[e,t,r]})},t.prototype.encryptPrivateKey=function(e,t){return this.scheduler.send({type:"encryptPrivateKey",args:[e,t]})},t.prototype.envelopeSeal=function(e,t){return this.scheduler.send({type:"envelopeSeal",args:[e,t]})},t.prototype.envelopeUnseal=function(e,t){return this.scheduler.send({type:"envelopeUnseal",args:[e,t]})},t.prototype.generateAuthorizationHeaders=function(e,t,r){return this.scheduler.send({type:"generateAuthorizationHeaders",args:[e,t,r]})},t.prototype.generateKeyIV=function(){return this.scheduler.send({type:"generateKeyIV"})},t.prototype.generateKeyPair=function(){return this.scheduler.send({type:"generateKeyPair"})},t.prototype.generatePasswordHash=function(e){return this.scheduler.send({type:"generatePasswordHash",args:[e]})},t.prototype.generateWrappedSymmetricKey=function(e){return this.scheduler.send({type:"generateWrappedSymmetricKey",args:[e]})},t.prototype.decryptManagedPrivateKey=function(e,t){return this.scheduler.send({type:"decryptManagedPrivateKey",args:[e,t]})},t.prototype.encryptComment=function(e,t){return this.scheduler.send({type:"encryptComment",args:[e,t]})},t}(p.default);t.default=d},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=r(3),i=function(e){return e&&e.__esModule?e:{default:e}}(s),u=r(4)("Scheduler"),c={limit:1},a=function e(){var t=this;n(this,e),this.promise=new Promise(function(e,r){t.resolve=e,t.reject=r})},p=function(){function e(t){n(this,e),this.queue=[],this.workers=new Map,this.options=o({},c,t)}return e.prototype.send=function(e){var t=new a;return this.queue.push({id:(0,i.default)(),deferred:t,message:e,attempts:0}),this.process(),t.promise},e.prototype.prime=function(){for(;this.workers.size<this.options.limit;)this.createWorker()},e.prototype.getIdleWorkers=function(){var e=this,t=[],r=[];return this.workers.forEach(function(e,n){e&&(n.process&&"function"==typeof n.process.isDead&&n.process.isDead()?r.push(n):t.push(n))}),r.length&&(u("Found "+r.length+" dead worker(s) while trying to locate an idle worker, removing workers from rotation"),r.forEach(function(t){e.workers.delete(t)})),t},e.prototype.getNextIdleWorker=function(){return this.getIdleWorkers()[0]},e.prototype.shouldCreateWorkers=function(){return 0===this.getIdleWorkers().length&&this.workers.size<this.options.limit&&this.queue.length>=1},e.prototype.createWorker=function(){var e=this.options.create();return this.workers.set(e,!0),e},e.prototype.process=function(){if(0===this.queue.length)return void u("Nothing to process, queue empty");var e=null;if(!(e=this.shouldCreateWorkers()?this.createWorker():this.getNextIdleWorker()))return void u("Unable to process queue, as there are no idle worker available");var t=this.queue.shift();this.handle(t,e)},e.prototype.handle=function(e,t){var r=this;try{e.attempts++,this.workers.set(t,!1);var n=void 0,o=void 0;n=function(s){u("Recieved response from worker ("+e.id+")"),t.process&&t.process.removeListener("exit",o),t.removeEventListener("message",n),r.workers.set(t,!0);var i=e.deferred,c=i.resolve,a=i.reject;if(s.data&&s.data.error){var p=s.data.error,d=p.message,f=p.stack,l=new Error(d);Object.defineProperty(l,"stack",{value:f}),a(l)}else c(s.data);r.process()},t.process&&(o=function(n,o,s){if(u("Worker exited (code: "+s+", signal: "+o+")"),o||0!==s){if(r.workers.delete(t),e.attempts<3)r.queue.unshift(e);else{var i=new Error("Worker exited with code "+(void 0!==s?s:"<unknown>")+" (signal: "+(void 0!==o?o:"<unknown>")+").");e.deferred.reject(i)}r.process()}},t.process.addListener("exit",o)),t.addEventListener("message",n),u("Sending message to worker ("+e.id+")"),t.postMessage(e.message)}catch(t){u("A synchronous error occurred in the scheduler handler, for an item"),e.deferred.reject(t)}},e}();t.default=p},function(e,t,r){"use strict";function n(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n)}t.__esModule=!0,t.default=n},function(e,t,r){"use strict";e.exports=function e(){return e}},function(e,t,r){"use strict";function n(){}t.__esModule=!0,n.__adapter__="ICryptoAdapter",t.default=n},function(e,t,r){e.exports=function(){return new Worker(r.p+"worker.d1e7122f.js")}}])});
|
|
2
2
|
//# sourceMappingURL=worker-crypto-adapter.js.map
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default WorkerThreadsCryptoAdapter;
|
|
2
|
-
declare class WorkerThreadsCryptoAdapter extends SchedulerCryptoAdapter {
|
|
3
|
-
/**
|
|
4
|
-
* @param {object} [options]
|
|
5
|
-
* @param {number|null|undefined} [options.limit] The maximum number of worker threads that can be created for this instance of the adapter (defaults to the same number of CPUs as the host machine, as reported by Node.js).
|
|
6
|
-
* @param {boolean} [options.optimistic] Whether to immediately create the maximum number of worker threads (reduces cold start times).
|
|
7
|
-
*/
|
|
8
|
-
constructor(options?: {
|
|
9
|
-
limit?: number;
|
|
10
|
-
optimistic?: boolean;
|
|
11
|
-
});
|
|
12
|
-
options: {
|
|
13
|
-
limit?: number;
|
|
14
|
-
optimistic?: boolean;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
import SchedulerCryptoAdapter from "./SchedulerCryptoAdapter";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _worker_threads=require("worker_threads");var _os=require("os");var _os2=_interopRequireDefault(_os);var _path=require("path");var _path2=_interopRequireDefault(_path);var _EventEmitter2=require("../events/EventEmitter");var _EventEmitter3=_interopRequireDefault(_EventEmitter2);var _SchedulerCryptoAdapter=require("./SchedulerCryptoAdapter");var _SchedulerCryptoAdapter2=_interopRequireDefault(_SchedulerCryptoAdapter);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var workerPath=_path2.default.resolve(__dirname,"../worker/WorkerThreadsWorker.js");var WorkerThreadsWorker=function(_EventEmitter){_inherits(WorkerThreadsWorker,_EventEmitter);function WorkerThreadsWorker(){_classCallCheck(this,WorkerThreadsWorker);var _this=_possibleConstructorReturn(this,_EventEmitter.call(this));var worker=new _worker_threads.Worker(workerPath);worker.on("message",function(message){return _this.emit("message",message)});worker.on("exit",function(exitCode){return _this.emit("exit",exitCode)});_this.workerThread=worker;return _this}WorkerThreadsWorker.prototype.postMessage=function postMessage(message){this.workerThread.postMessage(message)};return WorkerThreadsWorker}(_EventEmitter3.default);var WorkerThreadsCryptoAdapter=function(_SchedulerCryptoAdapt){_inherits(WorkerThreadsCryptoAdapter,_SchedulerCryptoAdapt);function WorkerThreadsCryptoAdapter(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,WorkerThreadsCryptoAdapter);if(!_worker_threads.isMainThread){throw new Error("Cannot create a WorkerThreadsCryptoAdapter within a worker.")}var _this2=_possibleConstructorReturn(this,_SchedulerCryptoAdapt.call(this,{limit:options.limit||_os2.default.cpus().length,create:function create(){return new WorkerThreadsWorker}}));if(options.optimistic){_this2.scheduler.prime()}_this2.options=options;return _this2}return WorkerThreadsCryptoAdapter}(_SchedulerCryptoAdapter2.default);exports.default=WorkerThreadsCryptoAdapter;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export default ChecklistTemplates;
|
|
2
|
-
/**
|
|
3
|
-
* A checklist template.
|
|
4
|
-
*/
|
|
5
|
-
export type ChecklistTemplate = {
|
|
6
|
-
id: string;
|
|
7
|
-
state: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
defaultIsRequiredForFinalApproval: boolean;
|
|
11
|
-
defaultShouldOpenOnProofLoad: boolean;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* The input to create a checklist template.
|
|
15
|
-
*/
|
|
16
|
-
export type CreateChecklistTemplateInput = {
|
|
17
|
-
name?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
defaultIsRequiredForFinalApproval?: boolean;
|
|
20
|
-
defaultShouldOpenOnProofLoad?: boolean;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* The input to update a checklist template.
|
|
24
|
-
*/
|
|
25
|
-
export type UpdateChecklistTemplateInput = {
|
|
26
|
-
state?: string;
|
|
27
|
-
name?: string;
|
|
28
|
-
description?: string;
|
|
29
|
-
defaultIsRequiredForFinalApproval?: boolean;
|
|
30
|
-
defaultShouldOpenOnProofLoad?: boolean;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* The options to list checklist templates.
|
|
34
|
-
*/
|
|
35
|
-
export type ListChecklistTemplateOptions = {
|
|
36
|
-
/**
|
|
37
|
-
* The states to filter by (defaults to only active checklist templates).
|
|
38
|
-
*/
|
|
39
|
-
states?: string[];
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* The Checklist Templates API
|
|
43
|
-
*/
|
|
44
|
-
declare class ChecklistTemplates extends API {
|
|
45
|
-
/** @private */
|
|
46
|
-
constructor(client: any);
|
|
47
|
-
/**
|
|
48
|
-
* The Checklist Templates Entities API.
|
|
49
|
-
*
|
|
50
|
-
* @type {ChecklistTemplatesEntities}
|
|
51
|
-
*/
|
|
52
|
-
entities: ChecklistTemplatesEntities;
|
|
53
|
-
/**
|
|
54
|
-
* Creates a new checklist template.
|
|
55
|
-
*
|
|
56
|
-
* @param {CreateChecklistTemplateInput} [input] The input to create the checklist template with.
|
|
57
|
-
* @returns {Promise<ChecklistTemplate>}
|
|
58
|
-
*/
|
|
59
|
-
create(input?: CreateChecklistTemplateInput): Promise<ChecklistTemplate>;
|
|
60
|
-
/**
|
|
61
|
-
* Updates a checklist template.
|
|
62
|
-
*
|
|
63
|
-
* @param {string} id The ID of the checklist template to update.
|
|
64
|
-
* @param {UpdateChecklistTemplateInput} input The input to update the checklist template with.
|
|
65
|
-
* @returns {Promise<ChecklistTemplate>}
|
|
66
|
-
*/
|
|
67
|
-
update(id: string, input: UpdateChecklistTemplateInput): Promise<ChecklistTemplate>;
|
|
68
|
-
/**
|
|
69
|
-
* Lists all checklist templates.
|
|
70
|
-
*
|
|
71
|
-
* @param {ListChecklistTemplateOptions} [options] The options to list checklist templates with.
|
|
72
|
-
* @returns {Promise<ChecklistTemplate[]>}
|
|
73
|
-
*/
|
|
74
|
-
list(options?: ListChecklistTemplateOptions): Promise<ChecklistTemplate[]>;
|
|
75
|
-
/**
|
|
76
|
-
* Loads a checklist template.
|
|
77
|
-
*
|
|
78
|
-
* Note: Throws if the checklist template does not exist.
|
|
79
|
-
*
|
|
80
|
-
* @param {string} id The ID of the checklist template to load.
|
|
81
|
-
* @returns {Promise<ChecklistTemplate>}
|
|
82
|
-
*/
|
|
83
|
-
load(id: string): Promise<ChecklistTemplate>;
|
|
84
|
-
}
|
|
85
|
-
import API from "./API";
|
|
86
|
-
import ChecklistTemplatesEntities from "./ChecklistTemplatesEntities";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _templateObject=_taggedTemplateLiteralLoose(["\n fragment ChecklistTemplate on ChecklistTemplate {\n id\n state\n name\n description\n defaultIsRequiredForFinalApproval\n defaultShouldOpenOnProofLoad\n }\n"],["\n fragment ChecklistTemplate on ChecklistTemplate {\n id\n state\n name\n description\n defaultIsRequiredForFinalApproval\n defaultShouldOpenOnProofLoad\n }\n"]),_templateObject2=_taggedTemplateLiteralLoose(["\n mutation sdk_ChecklistTemplates_create($input: CreateChecklistTemplateInput!) {\n createChecklistTemplate(input: $input) {\n ...ChecklistTemplate\n }\n }\n ","\n"],["\n mutation sdk_ChecklistTemplates_create($input: CreateChecklistTemplateInput!) {\n createChecklistTemplate(input: $input) {\n ...ChecklistTemplate\n }\n }\n ","\n"]),_templateObject3=_taggedTemplateLiteralLoose(["\n mutation sdk_ChecklistTemplates_update($id: ID!, $input: UpdateChecklistTemplateInput!) {\n updateChecklistTemplate(id: $id, input: $input) {\n ...ChecklistTemplate\n }\n }\n ","\n"],["\n mutation sdk_ChecklistTemplates_update($id: ID!, $input: UpdateChecklistTemplateInput!) {\n updateChecklistTemplate(id: $id, input: $input) {\n ...ChecklistTemplate\n }\n }\n ","\n"]),_templateObject4=_taggedTemplateLiteralLoose(["\n query sdk_ChecklistTemplates_list($states: [ChecklistTemplateState!]) {\n checklistTemplates(states: $states) {\n ...ChecklistTemplate\n }\n }\n ","\n"],["\n query sdk_ChecklistTemplates_list($states: [ChecklistTemplateState!]) {\n checklistTemplates(states: $states) {\n ...ChecklistTemplate\n }\n }\n ","\n"]),_templateObject5=_taggedTemplateLiteralLoose(["\n query sdk_ChecklistTemplates_load($id: ID!) {\n checklistTemplate(id: $id) {\n ...ChecklistTemplate\n }\n }\n ","\n"],["\n query sdk_ChecklistTemplates_load($id: ID!) {\n checklistTemplate(id: $id) {\n ...ChecklistTemplate\n }\n }\n ","\n"]);var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _gql=require("../util/gql");var _ChecklistTemplatesEntities=require("./ChecklistTemplatesEntities");var _ChecklistTemplatesEntities2=_interopRequireDefault(_ChecklistTemplatesEntities);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 _taggedTemplateLiteralLoose(strings,raw){strings.raw=raw;return strings}var CHECKLIST_TEMPLATE_FRAGMENT=(0,_gql.gql)(_templateObject);var CREATE_CHECKLIST_TEMPLATE=(0,_gql.gql)(_templateObject2,CHECKLIST_TEMPLATE_FRAGMENT);var UPDATE_CHECKLIST_TEMPLATE=(0,_gql.gql)(_templateObject3,CHECKLIST_TEMPLATE_FRAGMENT);var LIST_CHECKLIST_TEMPLATES=(0,_gql.gql)(_templateObject4,CHECKLIST_TEMPLATE_FRAGMENT);var LOAD_CHECKLIST_TEMPLATE=(0,_gql.gql)(_templateObject5,CHECKLIST_TEMPLATE_FRAGMENT);var ChecklistTemplates=function(_API){_inherits(ChecklistTemplates,_API);function ChecklistTemplates(client){_classCallCheck(this,ChecklistTemplates);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.entities=new _ChecklistTemplatesEntities2.default(client);return _this}ChecklistTemplates.prototype.create=function create(input){return this.client.graphql(CREATE_CHECKLIST_TEMPLATE,{input:input}).then(function(response){return response.data.createChecklistTemplate})};ChecklistTemplates.prototype.update=function update(id,input){return this.client.graphql(UPDATE_CHECKLIST_TEMPLATE,{id:id,input:input}).then(function(response){return response.data.updateChecklistTemplate})};ChecklistTemplates.prototype.list=function list(options){return this.client.graphql(LIST_CHECKLIST_TEMPLATES,options).then(function(response){return response.data.checklistTemplates})};ChecklistTemplates.prototype.load=function load(id){return this.client.graphql(LOAD_CHECKLIST_TEMPLATE,{id:id}).then(function(response){return response.data.checklistTemplate})};return ChecklistTemplates}(_API3.default);exports.default=ChecklistTemplates;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export default ChecklistTemplatesEntities;
|
|
2
|
-
/**
|
|
3
|
-
* A checklist template entity.
|
|
4
|
-
*/
|
|
5
|
-
export type ChecklistTemplateEntity = {
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
type: string;
|
|
9
|
-
description: string;
|
|
10
|
-
/**
|
|
11
|
-
* (Only if the type is "group", and the maximum depth hasn't been reached) The entities in the group.
|
|
12
|
-
*/
|
|
13
|
-
entities?: ChecklistTemplateEntity[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* The Checklist Templates Entities API
|
|
17
|
-
*/
|
|
18
|
-
declare class ChecklistTemplatesEntities extends API {
|
|
19
|
-
constructor(client: any);
|
|
20
|
-
/**
|
|
21
|
-
* Lists all entities belonging to a checklist template.
|
|
22
|
-
*
|
|
23
|
-
* Note: Throws if the checklist template does not exist.
|
|
24
|
-
*
|
|
25
|
-
* @param {string} checklistId The ID of the checklist template to retrieve entities for.
|
|
26
|
-
* @returns {Promise<ChecklistTemplateEntity[]>}
|
|
27
|
-
*/
|
|
28
|
-
list(checklistId: string): Promise<ChecklistTemplateEntity[]>;
|
|
29
|
-
}
|
|
30
|
-
import API from "./API";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _templateObject=_taggedTemplateLiteralLoose(["\n fragment ChecklistTemplateEntity on ChecklistTemplateEntity {\n id\n name\n type\n description\n }\n"],["\n fragment ChecklistTemplateEntity on ChecklistTemplateEntity {\n id\n name\n type\n description\n }\n"]),_templateObject2=_taggedTemplateLiteralLoose(["\n query sdk_ChecklistTemplatesEntities_list($checklistId: ID!) {\n checklistTemplate(id: $checklistId) {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n ","\n"],["\n query sdk_ChecklistTemplatesEntities_list($checklistId: ID!) {\n checklistTemplate(id: $checklistId) {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n ...on ChecklistTemplateEntityGroup {\n entities {\n ...ChecklistTemplateEntity\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n ","\n"]);var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _gql=require("../util/gql");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 _taggedTemplateLiteralLoose(strings,raw){strings.raw=raw;return strings}var CHECKLIST_TEMPLATE_ENTITY_FRAGMENT=(0,_gql.gql)(_templateObject);var LIST_CHECKLIST_TEMPLATE_ENTITIES=(0,_gql.gql)(_templateObject2,CHECKLIST_TEMPLATE_ENTITY_FRAGMENT);var ChecklistTemplatesEntities=function(_API){_inherits(ChecklistTemplatesEntities,_API);function ChecklistTemplatesEntities(){_classCallCheck(this,ChecklistTemplatesEntities);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ChecklistTemplatesEntities.prototype.list=function list(checklistId){return this.client.graphql(LIST_CHECKLIST_TEMPLATE_ENTITIES,{checklistId:checklistId}).then(function(response){return response.data.checklistTemplate.entities})};return ChecklistTemplatesEntities}(_API3.default);exports.default=ChecklistTemplatesEntities;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export default ProofChecklist;
|
|
2
|
-
declare class ProofChecklist {
|
|
3
|
-
/**
|
|
4
|
-
* The id of the checklist.
|
|
5
|
-
*
|
|
6
|
-
* @type {string}
|
|
7
|
-
*/
|
|
8
|
-
id: string;
|
|
9
|
-
/**
|
|
10
|
-
* The template id that was used to create the checklist.
|
|
11
|
-
*
|
|
12
|
-
* @type {string}
|
|
13
|
-
*/
|
|
14
|
-
templateId: string;
|
|
15
|
-
/**
|
|
16
|
-
* The name of the checklist.
|
|
17
|
-
*
|
|
18
|
-
* @type {string}
|
|
19
|
-
*/
|
|
20
|
-
name: string;
|
|
21
|
-
/**
|
|
22
|
-
* The description of the checklist.
|
|
23
|
-
*
|
|
24
|
-
* @type {string}
|
|
25
|
-
*/
|
|
26
|
-
description: string;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the checklist must be completed before final approval can be given.
|
|
29
|
-
*
|
|
30
|
-
* @type {boolean}
|
|
31
|
-
*/
|
|
32
|
-
isRequiredForFinalApproval: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Whether the checklist should be opened automatically when the proof is loaded.
|
|
35
|
-
*
|
|
36
|
-
* @type {boolean}
|
|
37
|
-
*/
|
|
38
|
-
shouldOpenOnProofLoad: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* @private
|
|
41
|
-
* @param {object} data The ProofChecklist data
|
|
42
|
-
* @returns {ProofChecklist}
|
|
43
|
-
*/
|
|
44
|
-
fromProofChecklist(data: any): ProofChecklist;
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var ProofChecklistSchema={id:"Id",templateId:"TemplateId",name:"Name",description:"Description",isRequiredForFinalApproval:"IsRequiredForFinalApproval",shouldOpenOnProofLoad:"ShouldOpenOnProofLoad"};var ProofChecklist=function(){function ProofChecklist(){_classCallCheck(this,ProofChecklist)}ProofChecklist.prototype.fromProofChecklist=function fromProofChecklist(data){(0,_transform2.default)(this,ProofChecklistSchema,data);return this};return ProofChecklist}();exports.default=ProofChecklist;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var AggregateError=exports.AggregateError=typeof globalThis!=="undefined"&&globalThis.AggregateError||typeof global!=="undefined"&&global.AggregateError||typeof window!=="undefined"&&window.AggregateError||function(_Error){_inherits(AggregateError,_Error);function AggregateError(message,errors){_classCallCheck(this,AggregateError);var _this=_possibleConstructorReturn(this,_Error.call(this,message));_this.name="AggregateError";_this.errors=errors;return _this}return AggregateError}(Error);
|
package/lib/util/GraphQLError.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var GraphQLError=exports.GraphQLError=function(_Error){_inherits(GraphQLError,_Error);function GraphQLError(message,locations,path){_classCallCheck(this,GraphQLError);var _this=_possibleConstructorReturn(this,_Error.call(this,message));_this.name="GraphQLError";if(locations){_this.locations=locations}if(path){_this.path=path}return _this}return GraphQLError}(Error);
|
package/lib/util/gql.d.ts
DELETED
package/lib/util/gql.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;exports.gql=gql;function gql(template){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}return template.map(function(part,index){return part+(typeof args[index]!=="undefined"?args[index]:"")}).join("")}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _worker_threads=require("worker_threads");var _CryptoWorker=require("./CryptoWorker");var _CryptoWorker2=_interopRequireDefault(_CryptoWorker);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}new _CryptoWorker2.default(function(callback){return _worker_threads.parentPort.on("message",function(data){return callback(data)})},function(result){return _worker_threads.parentPort.postMessage(result)});
|