@pdftron/collab-sql-resolver-generator
Advanced tools
Comparing version 2.1.0 to 2.2.0-alpha.1
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CollabPostgresGenerator=t():e.CollabPostgresGenerator=t()}(global,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.setupLogger=t.LogLevels=t.LogTags=void 0;var a,u=i(n(2)),s=n(7);!function(e){e.STANDARD="STANDARD",e.ENTITY="ENTITY",e.MUTATION="MUTATION",e.RESPONSE="RESPONSE",e.AUTH="AUTH",e.CACHE="CACHE",e.CONNECTED_USERS="CONNECTED_USERS",e.SCROLL_SYNC="SCROLL_SYNC",e.USERNAMES="USERNAMES",e.ANNOTATION_SYNC="ANNOTATION_SYNC",e.PERMISSIONS="PERMISSIONS",e.PERMISSION_CACHE="PERMISSION_CACHE",e.BATCH="BATCH",e.REAL_TIME="REAL_TIME",e.UNREAD="UNREAD",e.CLIENT="CLIENT",e.ANNOTATIONS="ANNOTATIONS",e.SESSION_STATUS="SESSION_STATUS"}(t.LogTags||(t.LogTags={})),function(e){e.ERROR="error",e.WARN="warn",e.INFO="info",e.HTTP="http",e.VERBOSE="verbose",e.DEBUG="debug",e.SILLY="silly",e.NONE="none"}(a=t.LogLevels||(t.LogLevels={}));var d=u.default.createLogger({format:u.format.combine(u.format.timestamp({format:"YYYY-MM-DD HH:mm:ss"}))});t.setupLogger=function(e,t,n){return e===a.NONE?d.silent=!0:((0,s.addConsoleTransport)(d,e,n),t&&t.length&&(0,s.addTransports)(d,t)),d},t.default=d},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateResolver=t.validateParams=t.throwError=t.ErrorCodes=void 0;var i=o(n(0));t.ErrorCodes={PERMISSION_ERROR:"PERMISSION_ERROR",ENTITY_MISSING:"ENTITY_MISSING",INVALID_ENTITY:"INVALID_ENTITY"};t.throwError=function(e,t,n){var r=t;throw"string"!=typeof r&&(r=t.message),r="".concat(e," - ").concat(r),i.default.error(r),n?new n(r):"string"!=typeof t?t:new Error(r)};t.validateParams=function(e,t){var n,o=function(t){var n="".concat(e,' - Paramater "').concat(t,'" is required');throw i.default.error(n),new Error(n)},a=function(t,n,r){var o="".concat(e,' - Parameter "').concat(t,'" expected type "').concat(r,'" but got "').concat(n,'"');throw i.default.error(o),new Error(o)};for(var u in t){var s=r(t[u],3),d=s[0],c=s[1],l=void 0===c?"any":c,f=s[2],m=void 0===f||f;if(null!=d&&""!==d){if("any"!==l){var p=typeof d;if("string"!==l){if("number"!==l){if("array"!==l){if("blob"!==l){if("boolean"!==l){if("object"!==l){if("function"!==l);else if(!(n=d)||"[object Function]"!=={}.toString.call(n))return a(u,p,l)}else if("object"!==p)return a(u,p,l)}else if("boolean"!==p)return a(u,p,l)}else if(!(d instanceof Blob))return a(u,p,l)}else if(!Array.isArray(d))return a(u,p,l)}else if("number"!==p)return a(u,p,l)}else if("string"!==p)return a(u,p,l)}}else if(m)return o(u)}};t.validateResolver=function(e,n){n||(0,t.throwError)(e,"Could not find resolvers for the ".concat(e,". Please make sure you provide resolvers for ").concat(e,"."))}},function(e,t){e.exports=require("winston")},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},u=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},d=this&&this.__await||function(e){return this instanceof d?(this.v=e,this):new d(e)},c=this&&this.__asyncGenerator||function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof d?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}},l=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},f=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogTags=t.LogLevels=t.MutationOperationType=t.SQLClient=void 0;var p=m(n(4)),v=n(5),h=a(n(0)),y=n(8),b=n(1);t.SQLClient={Postgres:"pg",MSSQL:"mssql",SQLite3:"sqlite3",Oracle:"oracledb",MySQL:"mysql"},t.MutationOperationType={CREATE:"create",UPDATE:"update"};var T=function(e){var n=e.client,o=e.version,i=void 0===o?"":o,a=e.connection,m=e.pool,T=void 0===m?{min:2,max:10}:m,M=e.getDatabaseTimestamp,A=void 0===M?v.defaultGetDatabaseTimestamp:M,w=e.parseToUnixTimestamp,g=void 0===w?v.defaultParseToUnixTimestamp:w,S=e.logLevel,I=void 0===S?h.LogLevels.ERROR:S,C=e.transports,x=void 0===C?[]:C;(0,v.testTimeTransformFunctions)(g,A);var E=e.filterLogsByTag;Array.isArray(E)||(E=[E]),(0,h.setupLogger)(I,x,E),h.default.info("Collab SQL Resolver Generator version ".concat("2.1.0"));var O=(0,y.validateSchema)(h.LogLevels,h.LogTags,t.SQLClient).validate(e).error;if(O)throw h.default.error(O.details),new Error("".concat(O));var _=(0,v.attachAdditionalInfo)(e.info),q=(0,p.default)({client:n,version:i,connection:a,pool:r({afterCreate:function(e,t){h.default.info("--\x3e Database connected"),t(null,e)}},T),postProcessResponse:function(e,t){return u(void 0,void 0,void 0,(function(){var n,o;return s(this,(function(i){switch(i.label){case 0:return t?(null==t?void 0:t.isCountQuery)?[2,e]:Array.isArray(e)?0===e.length?[2,e]:(n=(0,v.transformToApolloFormat)({result:e,columns:null==t?void 0:t.entityInformation.columns,columnMap:t.entityInformation.columnMap,parseToUnixTimestamp:g,from:t.from}),h.default.log({level:h.LogLevels.DEBUG,tag:h.LogTags.RESPONSE,message:"[".concat(t.from,"]: ").concat(JSON.stringify(n))}),t.entityInformation.readMiddleware?(o=[],[4,Promise.all(n.map((function(e,n){return u(void 0,void 0,void 0,(function(){var i;return s(this,(function(a){switch(a.label){case 0:return[4,D({middleware:t.entityInformation.readMiddleware,customContext:r({},t.customContext),data:e,operationType:"read"})];case 1:return i=a.sent(),o[n]=i,[2]}}))}))})))]):[3,2]):[2,e]:[2,e];case 1:i.sent(),n=o,i.label=2;case 2:return[2,n]}}))}))},debug:I===h.LogLevels.DEBUG,log:{warn:function(e){h.default.warn(e)},error:function(e){h.default.error(e)},deprecate:function(e){h.default.warn(e)},debug:function(e){h.default.log({level:h.LogLevels.DEBUG,tag:h.LogTags.MUTATION,message:e})}}}),D=function(e){var t=e.middleware,n=e.data,o=e.operationType,i=e.customContext,a=void 0===i?{}:i;return u(void 0,void 0,void 0,(function(){var e,i,f,m,p,v,h;return s(this,(function(y){switch(y.label){case 0:if(e=r({},n),0===t.length)return[2,e];i=function(){return c(this,arguments,(function(){var n,r,i=this;return s(this,(function(c){switch(c.label){case 0:n=0,r=function(){return u(i,void 0,void 0,(function(){var r;return s(this,(function(i){switch(i.label){case 0:return(r=t[n])?[4,new Promise((function(t){r({data:e,ctx:a,type:o,knex:q,next:function(n,r){n&&(e=n),r&&(a=r),t()}})}))]:[2];case 1:return i.sent(),[2]}}))}))},c.label=1;case 1:return n<t.length?[4,d(r())]:[3,5];case 2:return c.sent(),n++,[4,d(void 0)];case 3:return[4,c.sent()];case 4:return c.sent(),[3,1];case 5:return[4,d(void 0)];case 6:return[2,c.sent()]}}))}))}(),y.label=1;case 1:y.trys.push([1,6,7,12]),f=l(i),y.label=2;case 2:return[4,f.next()];case 3:if((m=y.sent()).done)return[3,5];m.value,i.next(),y.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return p=y.sent(),v={error:p},[3,12];case 7:return y.trys.push([7,,10,11]),m&&!m.done&&(h=f.return)?[4,h.call(f)]:[3,9];case 8:y.sent(),y.label=9;case 9:return[3,11];case 10:if(v)throw v.error;return[7];case 11:return[7];case 12:return[2,e]}}))}))},j=function(e){var r=e.from,o=e.id,i=e.operationType,a=e.entity,d=e.dbDataMap,c=e.customContext;return u(void 0,void 0,void 0,(function(){var e,u,l,m,p,v,h,y;return s(this,(function(s){switch(s.label){case 0:return e=a.table,u=a.selectFields,l=a.columns,m={from:r,entityInformation:a,customContext:c},i!==t.MutationOperationType.CREATE?[3,2]:[4,q(e).queryContext(m).insert(d)];case 1:return s.sent(),[3,4];case 2:return i!==t.MutationOperationType.UPDATE?[3,4]:[4,q(e).queryContext(m).where(l.id.nameWithTable,o).update(d)];case 3:s.sent(),s.label=4;case 4:return i!==t.MutationOperationType.CREATE?[3,6]:(v=n===t.SQLClient.SQLite3?"last_insert_rowid() as id":"LAST_INSERT_ID() as id",[4,q.select(q.raw(v))]);case 5:return h=f.apply(void 0,[s.sent(),1]),y=h[0],p=y.id,[3,7];case 6:p=o,s.label=7;case 7:return n===t.SQLClient.SQLite3&&(u.includes("rowid")||u.push("rowid")),[4,q(e).select(u).queryContext(m).where(l.id.nameWithTable,p)];case 8:return[2,s.sent()]}}))}))},N=function(e){var n=e.customContext,r=e.data,o=e.entity,i=e.from;return u(void 0,void 0,void 0,(function(){var e,a,d,c,l,f,m,p,h,y;return s(this,(function(b){switch(b.label){case 0:return e=o.table,a=o.writeMiddleware,d=void 0===a?[]:a,c=o.returnFields,l=o.columns,f=o.afterWrite,m={from:i,customContext:n,entityInformation:o,batch:!0},[4,Promise.all(r.map((function(r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return o=(0,v.toDatabaseFormat)({data:r,table:e,columns:l,getDatabaseTimestamp:A,knex:q}),[4,D({middleware:d,data:o,operationType:t.MutationOperationType.CREATE,customContext:n})];case 1:return i=a.sent(),[2,(0,v.removeJoinedData)(i,l)]}}))}))})))];case 1:return p=b.sent(),[4,q(e).queryContext(m).insert(p).returning(c)];case 2:return h=b.sent(),y=h.map((function(e){return(0,v.applyMissingData)(r,e,o.columns)})),[4,Promise.all(y.map((function(e){return u(void 0,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return f?[4,f({data:e,knex:q,context:n,operation:t.MutationOperationType.CREATE})]:[3,2];case 1:return(r=o.sent())?[2,r]:[2,e];case 2:return[2,e]}}))}))})))];case 3:return[2,b.sent()]}}))}))},P=function(e){var r=e.from,o=e.id,i=e.entity,a=e.data,d=e.customContext,c=e.operationType;return u(void 0,void 0,void 0,(function(){var e,u,l,f,m,p,h,y,T,M,w,g,S;return s(this,(function(s){switch(s.label){case 0:e=i.table,u=i.writeMiddleware,l=void 0===u?[]:u,f=i.returnFields,m=i.columns,p=i.afterWrite,s.label=1;case 1:return s.trys.push([1,11,,12]),h=(0,v.toDatabaseFormat)({data:a,table:e,columns:m,getDatabaseTimestamp:A,knex:q}),[4,D({middleware:l,data:h,operationType:c,customContext:d})];case 2:return y=s.sent(),y=(0,v.removeJoinedData)(y,m),T={from:r,customContext:d,entityInformation:i},M=[],n!==t.SQLClient.SQLite3&&n!==t.SQLClient.MySQL?[3,4]:[4,j({from:r,id:o,operationType:c,entity:i,dbDataMap:y,customContext:d})];case 3:return M=s.sent(),[3,8];case 4:return c!==t.MutationOperationType.CREATE?[3,6]:[4,q(e).queryContext(T).insert(y).returning(f)];case 5:return M=s.sent(),[3,8];case 6:return[4,q(e).queryContext(T).where(m.id.nameWithTable,o).update(y).returning(f)];case 7:M=s.sent(),s.label=8;case 8:return(w=M[0]||null)&&(w=(0,v.applyMissingData)(a,w,i.columns)),p?[4,p({data:w,knex:q,context:d,operation:c})]:[3,10];case 9:(g=s.sent())&&(w=g),s.label=10;case 10:return[2,w];case 11:return S=s.sent(),(0,b.throwError)("".concat(r),S),[3,12];case 12:return[2]}}))}))},L=function(e){var t=e.entity,n=e.id;return u(void 0,void 0,void 0,(function(){var e,r,o;return s(this,(function(i){switch(i.label){case 0:e=t.table,r=t.columns,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,q(e).where(r.id.nameWithTable,n).del()];case 2:return i.sent(),[2,{id:n,successful:!0}];case 3:return o=i.sent(),h.default.error(o),[2,{id:n,successful:!1}];case 4:return[2]}}))}))},R={Query:{user:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return s(this,(function(s){switch(s.label){case 0:return n=_.Users,r=n.selectFields,o=void 0===r?[]:r,i=n.table,a=n.columns,u={from:"Query.user",entityInformation:_.Users,customContext:t},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Users)})).select(o).where(a.id.nameWithTable,e).limit(1)];case 1:return[2,s.sent()[0]||null]}}))}))},userWithEmail:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return s(this,(function(s){switch(s.label){case 0:return n=_.Users,r=n.selectFields,o=void 0===r?[]:r,i=n.table,a=n.columns,u={from:"Query.userWithEmail",entityInformation:_.Users,customContext:t},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Users)})).select(o).where(a.email.nameWithTable,e).limit(1)];case 1:return[2,s.sent()[0]||null]}}))}))},userByIdentifier:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return s(this,(function(s){switch(s.label){case 0:return n=_.Users,r=n.selectFields,o=void 0===r?[]:r,i=n.table,a=n.columns,u={from:"Query.userByIdentifier",entityInformation:_.Users,customContext:t},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Users)})).select(o).where(a.email.nameWithTable,e).orWhere(a.userName.nameWithTable,e).limit(1)];case 1:return[2,s.sent()[0]||null]}}))}))},annotations:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m,p,h;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.documentId,o=e.annotationIds,i=e.filters,a=void 0===i?{}:i,u=e.inReplyTo,d=e.pageNumbers,c=_.Annotations,l=c.selectFields,f=void 0===l?[]:l,m=c.table,p=c.columns,h={from:"Query.annotations",entityInformation:_.Annotations,customContext:t},[4,q(m).queryContext(h).modify((function(e){(0,v.buildJoinQuery)(e,_.Annotations)})).select(f).where((function(e){n&&e.whereIn(p.id.nameWithTable,n),o&&e.whereIn(p.annotationId.nameWithTable,o),r&&e.where(p.documentId.nameWithTable,r),u&&e.where(p.inReplyTo.nameWithTable,u),d&&e.whereIn(p.pageNumber.nameWithTable,d),(0,v.buildFilterQuery)(e,a,p,A)})).modify((function(e){(0,v.buildModifyQuery)(e,a,p)}))];case 1:return[2,s.sent()]}}))}))},documents:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.userId,o=e.filters,i=void 0===o?{}:o,a=e.isPublic,u=_.Documents,d=u.selectFields,c=void 0===d?[]:d,l=u.table,f=u.columns,m={from:"Query.documents",entityInformation:_.Documents,customContext:t},[4,q(l).queryContext(m).modify((function(e){(0,v.buildJoinQuery)(e,_.Documents)})).select(c).where((function(e){n&&e.whereIn(f.id.nameWithTable,n),a&&e.where(f.isPublic.nameWithTable,!0),r&&e.whereIn(f.id.nameWithTable,(function(){this.select(_.DocumentMembers.columns.documentId.nameWithTable).from(_.DocumentMembers.table).where(_.DocumentMembers.columns.userId.nameWithTable,r)})),(0,v.buildFilterQuery)(e,i,f,A)})).modify((function(e){(0,v.buildModifyQuery)(e,i,f)}))];case 1:return[2,s.sent()]}}))}))},annotationMembers:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m,p;return s(this,(function(s){switch(s.label){case 0:return n=e.annotationId,r=e.documentId,o=e.ids,i=e.userId,a=e.filters,u=void 0===a?{}:a,d=_.AnnotationMembers,c=d.selectFields,l=void 0===c?[]:c,f=d.table,m=d.columns,p={from:"Query.annotationMembers",entityInformation:_.AnnotationMembers,customContext:t},[4,q(f).queryContext(p).modify((function(e){(0,v.buildJoinQuery)(e,_.AnnotationMembers)})).select(l).where((function(e){o&&e.whereIn(m.id.nameWithTable,o),n&&e.where(m.annotationId.nameWithTable,n),r&&e.where(m.documentId.nameWithTable,r),i&&e.where(m.userId.nameWithTable,i),(0,v.buildFilterQuery)(e,u,m,A)})).modify((function(e){(0,v.buildModifyQuery)(e,u,m)}))];case 1:return[2,s.sent()]}}))}))},documentMembers:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m;return s(this,(function(s){switch(s.label){case 0:return n=e.documentId,r=e.ids,o=e.userId,i=e.filters,a=void 0===i?{}:i,u=_.DocumentMembers,d=u.selectFields,c=void 0===d?[]:d,l=u.table,f=u.columns,m={from:"Query.documentMembers",entityInformation:_.DocumentMembers,customContext:t},[4,q(l).queryContext(m).modify((function(e){(0,v.buildJoinQuery)(e,_.DocumentMembers)})).select(c).where((function(e){r&&e.whereIn(f.id.nameWithTable,r),n&&e.where(f.documentId.nameWithTable,n),o&&e.where(f.userId.nameWithTable,o),(0,v.buildFilterQuery)(e,a,f,A)})).modify((function(e){(0,v.buildModifyQuery)(e,a,f)}))];case 1:return[2,s.sent()]}}))}))},mentions:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m,p;return s(this,(function(s){switch(s.label){case 0:return n=e.annotationId,r=e.userId,o=e.documentId,i=e.ids,a=e.filters,u=void 0===a?{}:a,d=_.Mentions,c=d.selectFields,l=void 0===c?[]:c,f=d.table,m=d.columns,p={from:"Query.mentions",entityInformation:_.Mentions,customContext:t},[4,q(f).queryContext(p).modify((function(e){(0,v.buildJoinQuery)(e,_.Mentions)})).select(l).where((function(e){i&&e.whereIn(m.id.nameWithTable,i),o&&e.where(m.documentId.nameWithTable,o),n&&e.where(m.annotationId.nameWithTable,n),r&&e.where(m.userId.nameWithTable,r),(0,v.buildFilterQuery)(e,u,m,A)})).modify((function(e){(0,v.buildModifyQuery)(e,u,m)}))];case 1:return[2,s.sent()]}}))}))},annotationCount:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d;return s(this,(function(s){switch(s.label){case 0:return n=e.since,r=e.documentId,o=_.Annotations,i=o.table,a=o.columns,u={from:"Query.annotationCount",entityInformation:_.Annotations,customContext:t,isCountQuery:!0},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Annotations)})).count({count:[a.id.nameWithTable]}).where(a.documentId.nameWithTable,r).where(a.createdAt.nameWithTable,">",A(n)).whereNotNull(a.authorId.nameWithTable)];case 1:return d=s.sent(),[2,Number(d[0].count||0)]}}))}))},annotationMemberCount:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c;return s(this,(function(s){switch(s.label){case 0:return n=e.userId,r=e.documentId,o=e.since,i=_.AnnotationMembers,a=i.table,u=i.columns,d={from:"Query.annotationMemberCount",entityInformation:_.AnnotationMembers,customContext:t,isCountQuery:!0},[4,q(a).queryContext(d).modify((function(e){(0,v.buildJoinQuery)(e,_.AnnotationMembers)})).count({count:[u.id.nameWithTable]}).where(u.documentId.nameWithTable,r).where(u.userId.nameWithTable,n).where(u.createdAt.nameWithTable,">",A(o))];case 1:return c=s.sent(),[2,Number(c[0].count||0)]}}))}))}},Mutation:{addUser:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addUser",entity:_.Users,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},addAnnotation:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addAnnotation",entity:_.Annotations,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},batchAddAnnotations:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,N({from:"Mutation.batchAddAnnotations",entity:_.Annotations,data:e,customContext:t})]}))}))},editAnnotation:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i,a,u;return s(this,(function(s){return o=n.xfdf,i=n.pageNumber,a=n.updatedAt,u=n.annotContents,[2,P({from:"Mutation.editAnnotation",customContext:r,entity:_.Annotations,id:e,data:{xfdf:o,pageNumber:i,updatedAt:a,annotContents:u},operationType:t.MutationOperationType.UPDATE})]}))}))},deleteAnnotation:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,L({from:"Mutation.deleteAnnotation",entity:_.Annotations,id:e,customContext:t})];case 1:return[2,n.sent()]}}))}))},addDocument:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addDocument",entity:_.Documents,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},editDocument:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i,a;return s(this,(function(u){return o=n.name,i=n.isPublic,a=n.updatedAt,[2,P({from:"Mutation.editDocument",entity:_.Documents,id:e,data:{name:o,isPublic:i,updatedAt:a},customContext:r,operationType:t.MutationOperationType.UPDATE})]}))}))},deleteDocument:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteDocument",entity:_.Documents,id:e,customContext:t})]}))}))},addDocumentMember:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addDocumentMember",entity:_.DocumentMembers,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},editDocumentMember:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.lastRead,i=n.updatedAt,[2,P({from:"Mutation.editDocumentMember",entity:_.DocumentMembers,id:e,data:{lastRead:o,updatedAt:i},customContext:r,operationType:t.MutationOperationType.UPDATE})]}))}))},deleteDocumentMember:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteDocumentMember",entity:_.DocumentMembers,id:e,customContext:t})]}))}))},addAnnotationMember:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addAnnotationMember",entity:_.AnnotationMembers,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},batchAddAnnotationMembers:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,N({from:"Mutation.batchAddAnnotationMembers",entity:_.AnnotationMembers,data:e,customContext:t})]}))}))},editAnnotationMember:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.lastRead,i=n.updatedAt,[2,P({from:"Mutation.editAnnotationMember",entity:_.AnnotationMembers,id:e,data:{lastRead:o,updatedAt:i},customContext:r,operationType:t.MutationOperationType.UPDATE})]}))}))},deleteAnnotationMember:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteAnnotationMember",entity:_.AnnotationMembers,id:e,customContext:t})]}))}))},addMention:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addMention",entity:_.Mentions,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},deleteMention:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteMention",entity:_.Mentions,id:e,customContext:t})]}))}))}}};return _.Snapshots&&(R.Query.snapshots=function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.documentId,o=e.filters,i=void 0===o?{}:o,a=_.Snapshots,u=a.selectFields,d=void 0===u?[]:u,c=a.table,l=a.columns,f={from:"Query.Snapshots",entityInformation:_.Snapshots,customContext:t},[4,q(c).queryContext(f).select(d).where((function(e){n&&e.whereIn(l.id.nameWithTable,n),r&&e.where(l.documentId.nameWithTable,r),(0,v.buildFilterQuery)(e,i,l,A)})).modify((function(e){(0,v.buildModifyQuery)(e,i,l)}))];case 1:return[2,s.sent()]}}))}))},R.Mutation.addSnapshot=function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addSnapshot",entity:_.Snapshots,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},R.Mutation.editSnapshot=function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.name,i=n.updatedAt,[2,P({from:"Mutation.editSnapshot",customContext:r,entity:_.Snapshots,id:e,data:{name:o,updatedAt:i},operationType:t.MutationOperationType.UPDATE})]}))}))},R.Mutation.deleteSnapshot=function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,L({from:"Mutation.deleteSnapshot",entity:_.Snapshots,id:e,customContext:t})];case 1:return[2,n.sent()]}}))}))}),_.SnapshotAssets&&(R.Query.snapshotAssets=function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.snapshotId,o=_.SnapshotAssets,i=o.selectFields,a=void 0===i?[]:i,u=o.table,d=o.columns,c={from:"Query.SnapshotAssets",entityInformation:_.SnapshotAssets,customContext:t},[4,q(u).queryContext(c).select(a).where((function(e){n&&e.whereIn(d.id.nameWithTable,n),r&&e.where(d.snapshotId.nameWithTable,r)}))];case 1:return[2,s.sent()]}}))}))},R.Mutation.addSnapshotAsset=function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addSnapshotAsset",entity:_.SnapshotAssets,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},R.Mutation.editSnapshotAsset=function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.snapshotId,i=n.updatedAt,[2,P({from:"Mutation.editSnapshotAsset",customContext:r,entity:_.SnapshotAssets,id:e,data:{snapshotId:o,updatedAt:i},operationType:t.MutationOperationType.UPDATE})]}))}))},R.Mutation.deleteSnapshotAsset=function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,L({from:"Mutation.deleteSnapshotAsset",entity:_.SnapshotAssets,id:e,customContext:t})];case 1:return[2,n.sent()]}}))}))}),R},M=n(0);Object.defineProperty(t,"LogLevels",{enumerable:!0,get:function(){return M.LogLevels}}),Object.defineProperty(t,"LogTags",{enumerable:!0,get:function(){return M.LogTags}}),T.LogLevels=h.LogLevels,T.LogTags=h.LogTags,t.default=T},function(e,t){e.exports=require("knex")},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.attachAdditionalInfo=t.transformToApolloFormat=t.keysToCamel=t.toUnixTimestamp=t.testTimeTransformFunctions=t.defaultGetDatabaseTimestamp=t.defaultParseToUnixTimestamp=t.toDatabaseFormat=t.removeJoinedData=t.applyMissingData=t.buildModifyQuery=t.buildJoinQuery=t.buildFilterQuery=void 0;var u=n(6),s=n(1);t.buildFilterQuery=function(e,t,n,r){t.createdBefore&&e.where(n.createdAt.nameWithTable,"<",r(t.createdBefore)),t.createdAfter&&e.where(n.createdAt.nameWithTable,">",r(t.createdAfter)),t.updatedBefore&&e.where(n.updatedAt.nameWithTable,"<",r(t.updatedBefore)),t.updatedAfter&&e.where(n.updatedAt.nameWithTable,">",r(t.updatedAfter))};t.buildJoinQuery=function(e,t){var n=t.columns,r=Object.keys(n).reduce((function(e,t){var r=n[t];if("string"==typeof r)return e;if(!r.join)return e;var i=o(r.join,1)[0];return e[i]||(e[i]=[]),e[i].push(r.join),e}),{}),a=Object.keys(r);a.length>0&&e.distinct(),a.forEach((function(t){var n=r[t];if(1===n.length){var a=o(n,1)[0],u=o(a,2),s=u[0],d=u[1];"string"==typeof d?e.join.apply(e,i([],o(a),!1)):e.join(s,(function(){d(this)}))}else e.join(t,(function(){this.on((function(){var e=this;n.forEach((function(t,n){var r=0===n?e.on:e.orOn,a=o(t,2)[1];"string"==typeof a?r.call.apply(r,i([e],o(t.slice(1)),!1)):r((function(){a(this)}))}))}))}))}))};t.buildModifyQuery=function(e,t,n){var r=t.limit,o=t.orderBy,i=t.orderDirection,a=void 0===i?"DESC":i;o&&e.orderBy(n[o].nameWithTable,a),r&&e.limit(r)};t.applyMissingData=function(e,t,n){var r,o,i={},u=Object.keys(n);try{for(var s=a(u),d=s.next();!d.done;d=s.next()){var c=d.value;i[c]=t[c],void 0===i[c]&&void 0!==e[c]&&(i[c]=e[c])}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i};t.removeJoinedData=function(e,t){var n,o,i=r({},e),u=Object.keys(t);try{for(var s=a(u),d=s.next();!d.done;d=s.next()){var c=d.value,l=t[c];l.skipWrite&&(delete i[c],delete i[l.name],delete i[l.nameWithTable])}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i};t.toDatabaseFormat=function(e){var t=e.data,n=e.columns,r=e.getDatabaseTimestamp,o=e.knex,i={};for(var a in t)n[a]&&(u.TimestampProperties.includes(a)?u.NowTimestampProperties.includes(a)?i[n[a].name]=o.raw(t[a]):i[n[a].name]=r(t[a]):i[n[a].name]=t[a]);return i};t.defaultParseToUnixTimestamp=function(e){return new Date(e).getTime()};t.defaultGetDatabaseTimestamp=function(e){return new Date(e).toISOString()};t.testTimeTransformFunctions=function(e,t){var n=Date.now();if(e(t(n))!==n)throw new Error('Configuration error: "getDatabaseTimestamp" and "parseToUnixTimestamp" functions are not compatible. The result of "parseUnixFunc" must be equal to the input of "getDatabaseTimestampFunc". For example, the following must be true: parseUnixFunc(getDatabaseTimestamp('.concat(n,")) === ").concat(n))};t.toUnixTimestamp=function(e,t){return Object.keys(e).forEach((function(n){u.TimestampProperties.includes(n)&&(e[n]=t(e[n]))})),e};t.keysToCamel=function(e,t,n){var r={};return Object.keys(n).forEach((function(t){if(n[t]){var o=n[t],i=e[t];u.StringIdProperties.includes(o)&&"number"==typeof i&&(i="".concat(i)),void 0===r[o]&&void 0!==i&&(r[o]=i)}})),r};t.transformToApolloFormat=function(e){var n=e.result,r=e.columns,o=e.columnMap,i=e.parseToUnixTimestamp,a=[];return n.forEach((function(e){var n=(0,t.keysToCamel)(e,r,o),u=(0,t.toUnixTimestamp)(n,i);a.push(u)})),a};t.attachAdditionalInfo=function(e){var t=function(e){return r(r({},e),{columnMap:{},selectFields:[],returnFields:[]})},n=r(r({Users:t(e.Users),Annotations:t(e.Annotations),Documents:t(e.Documents),AnnotationMembers:t(e.AnnotationMembers),DocumentMembers:t(e.DocumentMembers),Mentions:t(e.Mentions)},e.Snapshots&&{Snapshots:t(e.Snapshots)}),e.SnapshotAssets&&{SnapshotAssets:t(e.SnapshotAssets)});for(var a in n){var u=n[a],d=u.table,c=u.columns;for(var l in c){var f=c[l];"string"==typeof f&&(f=c[l]={name:f,nameWithTable:""});var m=f.join,p=f.name;if(m||p||(0,s.throwError)("SQL Resolver Generator","Expected column object to have either 'name' or 'join' property"),m){var v=o(m),h=v[0],y=v.slice(1),b=o(h.split("."),2),T=b[0],M=b[1];T&&M||(0,s.throwError)("SQL Resolver Generator","First item in join query must be formatted as {TableName}.{ColumnName} - received ".concat(h)),f.skipWrite=!0,f.nameWithTable="".concat(T,".").concat(M),f.name=M,f.join=i([T],o(y),!1),u.selectFields.push("".concat(T,".").concat(M)),u.columnMap[f.nameWithTable]=f.name,u.columnMap[M]=f.name}else f.nameWithTable="".concat(d,".").concat(f.name),u.selectFields.push("".concat(d,".").concat(f.name)),u.returnFields.push("".concat(f.name));u.columnMap[f.name]=l,u.columnMap["".concat(d,".").concat(f.name)]=l}}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringIdProperties=t.NowTimestampProperties=t.TimestampProperties=void 0,t.TimestampProperties=["createdAt","updatedAt","lastRead","annotationCreatedAt"],t.NowTimestampProperties=["createdAt","updatedAt","lastRead"],t.StringIdProperties=["id","userId","snapshotId","authorId","documentId","annotationId"]},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.addTransports=t.addConsoleTransport=void 0;var a=i(n(2)),u=n(0);t.addConsoleTransport=function(e,t,n){void 0===t&&(t=u.LogLevels.INFO),n&&0===(n=n.filter((function(e){return!!e}))).length&&(n=void 0),e.add(new a.default.transports.Console({level:t,format:a.format.combine((0,a.format)((function(e){return!(n&&!n.some((function(t){return e.tag===t})))&&e}))(),a.format.colorize(),a.format.printf((function(e){var t=c(e.message),n=e.tag?" [".concat(e.tag,"]"):"",r=c(e.meta);return"".concat(e.timestamp," ").concat(e.level).concat(n,": ").concat(t," ").concat(r)})),a.format.metadata({fillExcept:["message","level","timestamp","label"]}))}))};t.addTransports=function(e,t){t.forEach((function(t){return e.add(t)}))};var s=/<appearance(.*?)<\/appearance>/g,d=/<imagedata(.*?)<\/imagedata>/g,c=function(e){var t=e||"";return"object"==typeof e&&null!==e&&(t=JSON.stringify(e,null,2)),t=(t=t.replace(s,"<appearance>Truncated for readability...</appearance>")).replace(d,"<imagedata>Truncated for readability...</imagedata>")}},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchema=void 0;var a=i(n(9)),u=a.default.alternatives().try(a.default.object({name:a.default.string(),transform:a.default.function(),join:a.default.array(),resolve:a.default.func()}),a.default.string());t.validateSchema=function(e,t,n){var i,s,d;return a.default.object({client:(i=a.default.string()).valid.apply(i,o([],r(Object.values(n)),!1)).required(),connection:a.default.object().required(),pool:{min:a.default.number(),max:a.default.number()},getDatabaseTimestamp:a.default.func(),parseToUnixTimestamp:a.default.func(),getNow:a.default.func(),logLevel:(s=a.default.string()).valid.apply(s,o([],r(Object.values(e)),!1)),filterLogsByTag:(d=a.default.string()).valid.apply(d,o([],r(Object.values(t)),!1)),transports:a.default.array(),info:a.default.object({Users:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),type:u.required(),email:u.required(),userName:u,createdAt:u.required(),updatedAt:u.required()}).required()}).required(),Annotations:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),xfdf:u.required(),authorId:u.required(),annotationId:u.required(),documentId:u.required(),pageNumber:u.required(),createdAt:u.required(),updatedAt:u.required(),inReplyTo:u.required(),annotContents:u}).required()}).required(),Documents:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),authorId:u.required(),createdAt:u.required(),updatedAt:u.required(),isPublic:u.required(),name:u}).required()}).required(),AnnotationMembers:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),userId:u.required(),documentId:u.required(),annotationId:u.required(),lastRead:u.required(),createdAt:u.required(),updatedAt:u.required(),annotationCreatedAt:u.required()}).required()}),DocumentMembers:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),userId:u.required(),documentId:u.required(),lastRead:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()}).required(),Mentions:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),userId:u.required(),documentId:u.required(),annotationId:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()}).required(),Snapshots:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),authorId:u.required(),documentId:u.required(),xfdf:u.required(),name:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()}),SnapshotAssets:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),snapshotId:u.required(),data:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()})}).required()})}},function(e,t){e.exports=require("joi")}]).default})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CollabPostgresGenerator=t():e.CollabPostgresGenerator=t()}(global,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.setupLogger=t.LogLevels=t.LogTags=void 0;var a,u=i(n(2)),s=n(7);!function(e){e.STANDARD="STANDARD",e.ENTITY="ENTITY",e.MUTATION="MUTATION",e.RESPONSE="RESPONSE",e.AUTH="AUTH",e.CACHE="CACHE",e.CONNECTED_USERS="CONNECTED_USERS",e.SCROLL_SYNC="SCROLL_SYNC",e.USERNAMES="USERNAMES",e.ANNOTATION_SYNC="ANNOTATION_SYNC",e.PERMISSIONS="PERMISSIONS",e.PERMISSION_CACHE="PERMISSION_CACHE",e.BATCH="BATCH",e.REAL_TIME="REAL_TIME",e.UNREAD="UNREAD",e.CLIENT="CLIENT",e.ANNOTATIONS="ANNOTATIONS",e.SESSION_STATUS="SESSION_STATUS"}(t.LogTags||(t.LogTags={})),function(e){e.ERROR="error",e.WARN="warn",e.INFO="info",e.HTTP="http",e.VERBOSE="verbose",e.DEBUG="debug",e.SILLY="silly",e.NONE="none"}(a=t.LogLevels||(t.LogLevels={}));var d=u.default.createLogger({format:u.format.combine(u.format.timestamp({format:"YYYY-MM-DD HH:mm:ss"}))});t.setupLogger=function(e,t,n){return e===a.NONE?d.silent=!0:((0,s.addConsoleTransport)(d,e,n),t&&t.length&&(0,s.addTransports)(d,t)),d},t.default=d},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateResolver=t.validateParams=t.throwError=t.ErrorCodes=void 0;var i=o(n(0));t.ErrorCodes={PERMISSION_ERROR:"PERMISSION_ERROR",ENTITY_MISSING:"ENTITY_MISSING",INVALID_ENTITY:"INVALID_ENTITY"};t.throwError=function(e,t,n){var r=t;throw"string"!=typeof r&&(r=t.message),r="".concat(e," - ").concat(r),i.default.error(r),n?new n(r):"string"!=typeof t?t:new Error(r)};t.validateParams=function(e,t){var n,o=function(t){var n="".concat(e,' - Paramater "').concat(t,'" is required');throw i.default.error(n),new Error(n)},a=function(t,n,r){var o="".concat(e,' - Parameter "').concat(t,'" expected type "').concat(r,'" but got "').concat(n,'"');throw i.default.error(o),new Error(o)};for(var u in t){var s=r(t[u],3),d=s[0],c=s[1],l=void 0===c?"any":c,f=s[2],m=void 0===f||f;if(null!=d&&""!==d){if("any"!==l){var p=typeof d;if("string"!==l){if("number"!==l){if("array"!==l){if("blob"!==l){if("boolean"!==l){if("object"!==l){if("function"!==l);else if(!(n=d)||"[object Function]"!=={}.toString.call(n))return a(u,p,l)}else if("object"!==p)return a(u,p,l)}else if("boolean"!==p)return a(u,p,l)}else if(!(d instanceof Blob))return a(u,p,l)}else if(!Array.isArray(d))return a(u,p,l)}else if("number"!==p)return a(u,p,l)}else if("string"!==p)return a(u,p,l)}}else if(m)return o(u)}};t.validateResolver=function(e,n){n||(0,t.throwError)(e,"Could not find resolvers for the ".concat(e,". Please make sure you provide resolvers for ").concat(e,"."))}},function(e,t){e.exports=require("winston")},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},u=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},d=this&&this.__await||function(e){return this instanceof d?(this.v=e,this):new d(e)},c=this&&this.__asyncGenerator||function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof d?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}},l=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},f=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogTags=t.LogLevels=t.MutationOperationType=t.SQLClient=void 0;var p=m(n(4)),v=n(5),h=a(n(0)),y=n(8),b=n(1);t.SQLClient={Postgres:"pg",MSSQL:"mssql",SQLite3:"sqlite3",Oracle:"oracledb",MySQL:"mysql"},t.MutationOperationType={CREATE:"create",UPDATE:"update"};var T=function(e){var n=e.client,o=e.version,i=void 0===o?"":o,a=e.connection,m=e.pool,T=void 0===m?{min:2,max:10}:m,M=e.getDatabaseTimestamp,A=void 0===M?v.defaultGetDatabaseTimestamp:M,w=e.parseToUnixTimestamp,g=void 0===w?v.defaultParseToUnixTimestamp:w,S=e.logLevel,I=void 0===S?h.LogLevels.ERROR:S,C=e.transports,x=void 0===C?[]:C;(0,v.testTimeTransformFunctions)(g,A);var E=e.filterLogsByTag;Array.isArray(E)||(E=[E]),(0,h.setupLogger)(I,x,E),h.default.info("Collab SQL Resolver Generator version ".concat("2.2.0-alpha.1"));var O=(0,y.validateSchema)(h.LogLevels,h.LogTags,t.SQLClient).validate(e).error;if(O)throw h.default.error(O.details),new Error("".concat(O));var _=(0,v.attachAdditionalInfo)(e.info),q=(0,p.default)({client:n,version:i,connection:a,pool:r({afterCreate:function(e,t){h.default.info("--\x3e Database connected"),t(null,e)}},T),postProcessResponse:function(e,t){return u(void 0,void 0,void 0,(function(){var n,o;return s(this,(function(i){switch(i.label){case 0:return t?(null==t?void 0:t.isCountQuery)?[2,e]:Array.isArray(e)?0===e.length?[2,e]:(n=(0,v.transformToApolloFormat)({result:e,columns:null==t?void 0:t.entityInformation.columns,columnMap:t.entityInformation.columnMap,parseToUnixTimestamp:g,from:t.from}),h.default.log({level:h.LogLevels.DEBUG,tag:h.LogTags.RESPONSE,message:"[".concat(t.from,"]: ").concat(JSON.stringify(n))}),t.entityInformation.readMiddleware?(o=[],[4,Promise.all(n.map((function(e,n){return u(void 0,void 0,void 0,(function(){var i;return s(this,(function(a){switch(a.label){case 0:return[4,D({middleware:t.entityInformation.readMiddleware,customContext:r({},t.customContext),data:e,operationType:"read"})];case 1:return i=a.sent(),o[n]=i,[2]}}))}))})))]):[3,2]):[2,e]:[2,e];case 1:i.sent(),n=o,i.label=2;case 2:return[2,n]}}))}))},debug:I===h.LogLevels.DEBUG,log:{warn:function(e){h.default.warn(e)},error:function(e){h.default.error(e)},deprecate:function(e){h.default.warn(e)},debug:function(e){h.default.log({level:h.LogLevels.DEBUG,tag:h.LogTags.MUTATION,message:e})}}}),D=function(e){var t=e.middleware,n=e.data,o=e.operationType,i=e.customContext,a=void 0===i?{}:i;return u(void 0,void 0,void 0,(function(){var e,i,f,m,p,v,h;return s(this,(function(y){switch(y.label){case 0:if(e=r({},n),0===t.length)return[2,e];i=function(){return c(this,arguments,(function(){var n,r,i=this;return s(this,(function(c){switch(c.label){case 0:n=0,r=function(){return u(i,void 0,void 0,(function(){var r;return s(this,(function(i){switch(i.label){case 0:return(r=t[n])?[4,new Promise((function(t){r({data:e,ctx:a,type:o,knex:q,next:function(n,r){n&&(e=n),r&&(a=r),t()}})}))]:[2];case 1:return i.sent(),[2]}}))}))},c.label=1;case 1:return n<t.length?[4,d(r())]:[3,5];case 2:return c.sent(),n++,[4,d(void 0)];case 3:return[4,c.sent()];case 4:return c.sent(),[3,1];case 5:return[4,d(void 0)];case 6:return[2,c.sent()]}}))}))}(),y.label=1;case 1:y.trys.push([1,6,7,12]),f=l(i),y.label=2;case 2:return[4,f.next()];case 3:if((m=y.sent()).done)return[3,5];m.value,i.next(),y.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return p=y.sent(),v={error:p},[3,12];case 7:return y.trys.push([7,,10,11]),m&&!m.done&&(h=f.return)?[4,h.call(f)]:[3,9];case 8:y.sent(),y.label=9;case 9:return[3,11];case 10:if(v)throw v.error;return[7];case 11:return[7];case 12:return[2,e]}}))}))},j=function(e){var r=e.from,o=e.id,i=e.operationType,a=e.entity,d=e.dbDataMap,c=e.customContext;return u(void 0,void 0,void 0,(function(){var e,u,l,m,p,v,h,y;return s(this,(function(s){switch(s.label){case 0:return e=a.table,u=a.selectFields,l=a.columns,m={from:r,entityInformation:a,customContext:c},i!==t.MutationOperationType.CREATE?[3,2]:[4,q(e).queryContext(m).insert(d)];case 1:return s.sent(),[3,4];case 2:return i!==t.MutationOperationType.UPDATE?[3,4]:[4,q(e).queryContext(m).where(l.id.nameWithTable,o).update(d)];case 3:s.sent(),s.label=4;case 4:return i!==t.MutationOperationType.CREATE?[3,6]:(v=n===t.SQLClient.SQLite3?"last_insert_rowid() as id":"LAST_INSERT_ID() as id",[4,q.select(q.raw(v))]);case 5:return h=f.apply(void 0,[s.sent(),1]),y=h[0],p=y.id,[3,7];case 6:p=o,s.label=7;case 7:return n===t.SQLClient.SQLite3&&(u.includes("rowid")||u.push("rowid")),[4,q(e).select(u).queryContext(m).where(l.id.nameWithTable,p)];case 8:return[2,s.sent()]}}))}))},N=function(e){var n=e.customContext,r=e.data,o=e.entity,i=e.from;return u(void 0,void 0,void 0,(function(){var e,a,d,c,l,f,m,p,h,y;return s(this,(function(b){switch(b.label){case 0:return e=o.table,a=o.writeMiddleware,d=void 0===a?[]:a,c=o.returnFields,l=o.columns,f=o.afterWrite,m={from:i,customContext:n,entityInformation:o,batch:!0},[4,Promise.all(r.map((function(r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:return o=(0,v.toDatabaseFormat)({data:r,table:e,columns:l,getDatabaseTimestamp:A,knex:q}),[4,D({middleware:d,data:o,operationType:t.MutationOperationType.CREATE,customContext:n})];case 1:return i=a.sent(),[2,(0,v.removeJoinedData)(i,l)]}}))}))})))];case 1:return p=b.sent(),[4,q(e).queryContext(m).insert(p).returning(c)];case 2:return h=b.sent(),y=h.map((function(e){return(0,v.applyMissingData)(r,e,o.columns)})),[4,Promise.all(y.map((function(e){return u(void 0,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return f?[4,f({data:e,knex:q,context:n,operation:t.MutationOperationType.CREATE})]:[3,2];case 1:return(r=o.sent())?[2,r]:[2,e];case 2:return[2,e]}}))}))})))];case 3:return[2,b.sent()]}}))}))},P=function(e){var r=e.from,o=e.id,i=e.entity,a=e.data,d=e.customContext,c=e.operationType;return u(void 0,void 0,void 0,(function(){var e,u,l,f,m,p,h,y,T,M,w,g,S;return s(this,(function(s){switch(s.label){case 0:e=i.table,u=i.writeMiddleware,l=void 0===u?[]:u,f=i.returnFields,m=i.columns,p=i.afterWrite,s.label=1;case 1:return s.trys.push([1,11,,12]),h=(0,v.toDatabaseFormat)({data:a,table:e,columns:m,getDatabaseTimestamp:A,knex:q}),[4,D({middleware:l,data:h,operationType:c,customContext:d})];case 2:return y=s.sent(),y=(0,v.removeJoinedData)(y,m),T={from:r,customContext:d,entityInformation:i},M=[],n!==t.SQLClient.SQLite3&&n!==t.SQLClient.MySQL?[3,4]:[4,j({from:r,id:o,operationType:c,entity:i,dbDataMap:y,customContext:d})];case 3:return M=s.sent(),[3,8];case 4:return c!==t.MutationOperationType.CREATE?[3,6]:[4,q(e).queryContext(T).insert(y).returning(f)];case 5:return M=s.sent(),[3,8];case 6:return[4,q(e).queryContext(T).where(m.id.nameWithTable,o).update(y).returning(f)];case 7:M=s.sent(),s.label=8;case 8:return(w=M[0]||null)&&(w=(0,v.applyMissingData)(a,w,i.columns)),p?[4,p({data:w,knex:q,context:d,operation:c})]:[3,10];case 9:(g=s.sent())&&(w=g),s.label=10;case 10:return[2,w];case 11:return S=s.sent(),(0,b.throwError)("".concat(r),S),[3,12];case 12:return[2]}}))}))},L=function(e){var t=e.entity,n=e.id;return u(void 0,void 0,void 0,(function(){var e,r,o;return s(this,(function(i){switch(i.label){case 0:e=t.table,r=t.columns,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,q(e).where(r.id.nameWithTable,n).del()];case 2:return i.sent(),[2,{id:n,successful:!0}];case 3:return o=i.sent(),h.default.error(o),[2,{id:n,successful:!1}];case 4:return[2]}}))}))},R={Query:{user:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return s(this,(function(s){switch(s.label){case 0:return n=_.Users,r=n.selectFields,o=void 0===r?[]:r,i=n.table,a=n.columns,u={from:"Query.user",entityInformation:_.Users,customContext:t},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Users)})).select(o).where(a.id.nameWithTable,e).limit(1)];case 1:return[2,s.sent()[0]||null]}}))}))},userWithEmail:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return s(this,(function(s){switch(s.label){case 0:return n=_.Users,r=n.selectFields,o=void 0===r?[]:r,i=n.table,a=n.columns,u={from:"Query.userWithEmail",entityInformation:_.Users,customContext:t},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Users)})).select(o).where(a.email.nameWithTable,e).limit(1)];case 1:return[2,s.sent()[0]||null]}}))}))},userByIdentifier:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return s(this,(function(s){switch(s.label){case 0:return n=_.Users,r=n.selectFields,o=void 0===r?[]:r,i=n.table,a=n.columns,u={from:"Query.userByIdentifier",entityInformation:_.Users,customContext:t},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Users)})).select(o).where(a.email.nameWithTable,e).orWhere(a.userName.nameWithTable,e).limit(1)];case 1:return[2,s.sent()[0]||null]}}))}))},annotations:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m,p,h;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.documentId,o=e.annotationIds,i=e.filters,a=void 0===i?{}:i,u=e.inReplyTo,d=e.pageNumbers,c=_.Annotations,l=c.selectFields,f=void 0===l?[]:l,m=c.table,p=c.columns,h={from:"Query.annotations",entityInformation:_.Annotations,customContext:t},[4,q(m).queryContext(h).modify((function(e){(0,v.buildJoinQuery)(e,_.Annotations)})).select(f).where((function(e){n&&e.whereIn(p.id.nameWithTable,n),o&&e.whereIn(p.annotationId.nameWithTable,o),r&&e.where(p.documentId.nameWithTable,r),u&&e.where(p.inReplyTo.nameWithTable,u),d&&e.whereIn(p.pageNumber.nameWithTable,d),(0,v.buildFilterQuery)(e,a,p,A)})).modify((function(e){(0,v.buildModifyQuery)(e,a,p)}))];case 1:return[2,s.sent()]}}))}))},documents:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.userId,o=e.filters,i=void 0===o?{}:o,a=e.isPublic,u=_.Documents,d=u.selectFields,c=void 0===d?[]:d,l=u.table,f=u.columns,m={from:"Query.documents",entityInformation:_.Documents,customContext:t},[4,q(l).queryContext(m).modify((function(e){(0,v.buildJoinQuery)(e,_.Documents)})).select(c).where((function(e){n&&e.whereIn(f.id.nameWithTable,n),a&&e.where(f.isPublic.nameWithTable,!0),r&&e.whereIn(f.id.nameWithTable,(function(){this.select(_.DocumentMembers.columns.documentId.nameWithTable).from(_.DocumentMembers.table).where(_.DocumentMembers.columns.userId.nameWithTable,r)})),(0,v.buildFilterQuery)(e,i,f,A)})).modify((function(e){(0,v.buildModifyQuery)(e,i,f)}))];case 1:return[2,s.sent()]}}))}))},annotationMembers:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m,p;return s(this,(function(s){switch(s.label){case 0:return n=e.annotationId,r=e.documentId,o=e.ids,i=e.userId,a=e.filters,u=void 0===a?{}:a,d=_.AnnotationMembers,c=d.selectFields,l=void 0===c?[]:c,f=d.table,m=d.columns,p={from:"Query.annotationMembers",entityInformation:_.AnnotationMembers,customContext:t},[4,q(f).queryContext(p).modify((function(e){(0,v.buildJoinQuery)(e,_.AnnotationMembers)})).select(l).where((function(e){o&&e.whereIn(m.id.nameWithTable,o),n&&e.where(m.annotationId.nameWithTable,n),r&&e.where(m.documentId.nameWithTable,r),i&&e.where(m.userId.nameWithTable,i),(0,v.buildFilterQuery)(e,u,m,A)})).modify((function(e){(0,v.buildModifyQuery)(e,u,m)}))];case 1:return[2,s.sent()]}}))}))},documentMembers:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m;return s(this,(function(s){switch(s.label){case 0:return n=e.documentId,r=e.ids,o=e.userId,i=e.filters,a=void 0===i?{}:i,u=_.DocumentMembers,d=u.selectFields,c=void 0===d?[]:d,l=u.table,f=u.columns,m={from:"Query.documentMembers",entityInformation:_.DocumentMembers,customContext:t},[4,q(l).queryContext(m).modify((function(e){(0,v.buildJoinQuery)(e,_.DocumentMembers)})).select(c).where((function(e){r&&e.whereIn(f.id.nameWithTable,r),n&&e.where(f.documentId.nameWithTable,n),o&&e.where(f.userId.nameWithTable,o),(0,v.buildFilterQuery)(e,a,f,A)})).modify((function(e){(0,v.buildModifyQuery)(e,a,f)}))];case 1:return[2,s.sent()]}}))}))},mentions:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f,m,p;return s(this,(function(s){switch(s.label){case 0:return n=e.annotationId,r=e.userId,o=e.documentId,i=e.ids,a=e.filters,u=void 0===a?{}:a,d=_.Mentions,c=d.selectFields,l=void 0===c?[]:c,f=d.table,m=d.columns,p={from:"Query.mentions",entityInformation:_.Mentions,customContext:t},[4,q(f).queryContext(p).modify((function(e){(0,v.buildJoinQuery)(e,_.Mentions)})).select(l).where((function(e){i&&e.whereIn(m.id.nameWithTable,i),o&&e.where(m.documentId.nameWithTable,o),n&&e.where(m.annotationId.nameWithTable,n),r&&e.where(m.userId.nameWithTable,r),(0,v.buildFilterQuery)(e,u,m,A)})).modify((function(e){(0,v.buildModifyQuery)(e,u,m)}))];case 1:return[2,s.sent()]}}))}))},annotationCount:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d;return s(this,(function(s){switch(s.label){case 0:return n=e.since,r=e.documentId,o=_.Annotations,i=o.table,a=o.columns,u={from:"Query.annotationCount",entityInformation:_.Annotations,customContext:t,isCountQuery:!0},[4,q(i).queryContext(u).modify((function(e){(0,v.buildJoinQuery)(e,_.Annotations)})).count({count:[a.id.nameWithTable]}).where(a.documentId.nameWithTable,r).where(a.createdAt.nameWithTable,">",A(n)).whereNotNull(a.authorId.nameWithTable)];case 1:return d=s.sent(),[2,Number(d[0].count||0)]}}))}))},annotationMemberCount:function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c;return s(this,(function(s){switch(s.label){case 0:return n=e.userId,r=e.documentId,o=e.since,i=_.AnnotationMembers,a=i.table,u=i.columns,d={from:"Query.annotationMemberCount",entityInformation:_.AnnotationMembers,customContext:t,isCountQuery:!0},[4,q(a).queryContext(d).modify((function(e){(0,v.buildJoinQuery)(e,_.AnnotationMembers)})).count({count:[u.id.nameWithTable]}).where(u.documentId.nameWithTable,r).where(u.userId.nameWithTable,n).where(u.createdAt.nameWithTable,">",A(o))];case 1:return c=s.sent(),[2,Number(c[0].count||0)]}}))}))}},Mutation:{addUser:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addUser",entity:_.Users,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},addAnnotation:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addAnnotation",entity:_.Annotations,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},batchAddAnnotations:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,N({from:"Mutation.batchAddAnnotations",entity:_.Annotations,data:e,customContext:t})]}))}))},editAnnotation:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i,a,u;return s(this,(function(s){return o=n.xfdf,i=n.pageNumber,a=n.updatedAt,u=n.annotContents,[2,P({from:"Mutation.editAnnotation",customContext:r,entity:_.Annotations,id:e,data:{xfdf:o,pageNumber:i,updatedAt:a,annotContents:u},operationType:t.MutationOperationType.UPDATE})]}))}))},deleteAnnotation:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,L({from:"Mutation.deleteAnnotation",entity:_.Annotations,id:e,customContext:t})];case 1:return[2,n.sent()]}}))}))},addDocument:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addDocument",entity:_.Documents,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},editDocument:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i,a;return s(this,(function(u){return o=n.name,i=n.isPublic,a=n.updatedAt,[2,P({from:"Mutation.editDocument",entity:_.Documents,id:e,data:{name:o,isPublic:i,updatedAt:a},customContext:r,operationType:t.MutationOperationType.UPDATE})]}))}))},deleteDocument:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteDocument",entity:_.Documents,id:e,customContext:t})]}))}))},addDocumentMember:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addDocumentMember",entity:_.DocumentMembers,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},editDocumentMember:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.lastRead,i=n.updatedAt,[2,P({from:"Mutation.editDocumentMember",entity:_.DocumentMembers,id:e,data:{lastRead:o,updatedAt:i},customContext:r,operationType:t.MutationOperationType.UPDATE})]}))}))},deleteDocumentMember:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteDocumentMember",entity:_.DocumentMembers,id:e,customContext:t})]}))}))},addAnnotationMember:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addAnnotationMember",entity:_.AnnotationMembers,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},batchAddAnnotationMembers:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,N({from:"Mutation.batchAddAnnotationMembers",entity:_.AnnotationMembers,data:e,customContext:t})]}))}))},editAnnotationMember:function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.lastRead,i=n.updatedAt,[2,P({from:"Mutation.editAnnotationMember",entity:_.AnnotationMembers,id:e,data:{lastRead:o,updatedAt:i},customContext:r,operationType:t.MutationOperationType.UPDATE})]}))}))},deleteAnnotationMember:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteAnnotationMember",entity:_.AnnotationMembers,id:e,customContext:t})]}))}))},addMention:function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addMention",entity:_.Mentions,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},deleteMention:function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){return[2,L({from:"Mutation.deleteMention",entity:_.Mentions,id:e,customContext:t})]}))}))}}};return _.Snapshots&&(R.Query.snapshots=function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c,l,f;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.documentId,o=e.filters,i=void 0===o?{}:o,a=_.Snapshots,u=a.selectFields,d=void 0===u?[]:u,c=a.table,l=a.columns,f={from:"Query.Snapshots",entityInformation:_.Snapshots,customContext:t},[4,q(c).queryContext(f).select(d).where((function(e){n&&e.whereIn(l.id.nameWithTable,n),r&&e.where(l.documentId.nameWithTable,r),(0,v.buildFilterQuery)(e,i,l,A)})).modify((function(e){(0,v.buildModifyQuery)(e,i,l)}))];case 1:return[2,s.sent()]}}))}))},R.Mutation.addSnapshot=function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addSnapshot",entity:_.Snapshots,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},R.Mutation.editSnapshot=function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.name,i=n.updatedAt,[2,P({from:"Mutation.editSnapshot",customContext:r,entity:_.Snapshots,id:e,data:{name:o,updatedAt:i},operationType:t.MutationOperationType.UPDATE})]}))}))},R.Mutation.deleteSnapshot=function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,L({from:"Mutation.deleteSnapshot",entity:_.Snapshots,id:e,customContext:t})];case 1:return[2,n.sent()]}}))}))}),_.SnapshotAssets&&(R.Query.snapshotAssets=function(e,t){return u(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,d,c;return s(this,(function(s){switch(s.label){case 0:return n=e.ids,r=e.snapshotId,o=_.SnapshotAssets,i=o.selectFields,a=void 0===i?[]:i,u=o.table,d=o.columns,c={from:"Query.SnapshotAssets",entityInformation:_.SnapshotAssets,customContext:t},[4,q(u).queryContext(c).select(a).where((function(e){n&&e.whereIn(d.id.nameWithTable,n),r&&e.where(d.snapshotId.nameWithTable,r)}))];case 1:return[2,s.sent()]}}))}))},R.Mutation.addSnapshotAsset=function(e,n){return u(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,P({from:"Mutation.addSnapshotAsset",entity:_.SnapshotAssets,data:e,customContext:n,operationType:t.MutationOperationType.CREATE})]}))}))},R.Mutation.editSnapshotAsset=function(e,n,r){return u(void 0,void 0,void 0,(function(){var o,i;return s(this,(function(a){return o=n.snapshotId,i=n.updatedAt,[2,P({from:"Mutation.editSnapshotAsset",customContext:r,entity:_.SnapshotAssets,id:e,data:{snapshotId:o,updatedAt:i},operationType:t.MutationOperationType.UPDATE})]}))}))},R.Mutation.deleteSnapshotAsset=function(e,t){return u(void 0,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,L({from:"Mutation.deleteSnapshotAsset",entity:_.SnapshotAssets,id:e,customContext:t})];case 1:return[2,n.sent()]}}))}))}),R},M=n(0);Object.defineProperty(t,"LogLevels",{enumerable:!0,get:function(){return M.LogLevels}}),Object.defineProperty(t,"LogTags",{enumerable:!0,get:function(){return M.LogTags}}),T.LogLevels=h.LogLevels,T.LogTags=h.LogTags,t.default=T},function(e,t){e.exports=require("knex")},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.attachAdditionalInfo=t.transformToApolloFormat=t.keysToCamel=t.toUnixTimestamp=t.testTimeTransformFunctions=t.defaultGetDatabaseTimestamp=t.defaultParseToUnixTimestamp=t.toDatabaseFormat=t.removeJoinedData=t.applyMissingData=t.buildModifyQuery=t.buildJoinQuery=t.buildFilterQuery=void 0;var u=n(6),s=n(1);t.buildFilterQuery=function(e,t,n,r){t.createdBefore&&e.where(n.createdAt.nameWithTable,"<",r(t.createdBefore)),t.createdAfter&&e.where(n.createdAt.nameWithTable,">",r(t.createdAfter)),t.updatedBefore&&e.where(n.updatedAt.nameWithTable,"<",r(t.updatedBefore)),t.updatedAfter&&e.where(n.updatedAt.nameWithTable,">",r(t.updatedAfter))};t.buildJoinQuery=function(e,t){var n=t.columns,r=Object.keys(n).reduce((function(e,t){var r=n[t];if("string"==typeof r)return e;if(!r.join)return e;var i=o(r.join,1)[0];return e[i]||(e[i]=[]),e[i].push(r.join),e}),{}),a=Object.keys(r);a.length>0&&e.distinct(),a.forEach((function(t){var n=r[t];if(1===n.length){var a=o(n,1)[0],u=o(a,2),s=u[0],d=u[1];"string"==typeof d?e.join.apply(e,i([],o(a),!1)):e.join(s,(function(){d(this)}))}else e.join(t,(function(){this.on((function(){var e=this;n.forEach((function(t,n){var r=0===n?e.on:e.orOn,a=o(t,2)[1];"string"==typeof a?r.call.apply(r,i([e],o(t.slice(1)),!1)):r((function(){a(this)}))}))}))}))}))};t.buildModifyQuery=function(e,t,n){var r=t.limit,o=t.orderBy,i=t.orderDirection,a=void 0===i?"DESC":i;o&&e.orderBy(n[o].nameWithTable,a),r&&e.limit(r)};t.applyMissingData=function(e,t,n){var r,o,i={},u=Object.keys(n);try{for(var s=a(u),d=s.next();!d.done;d=s.next()){var c=d.value;i[c]=t[c],void 0===i[c]&&void 0!==e[c]&&(i[c]=e[c])}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i};t.removeJoinedData=function(e,t){var n,o,i=r({},e),u=Object.keys(t);try{for(var s=a(u),d=s.next();!d.done;d=s.next()){var c=d.value,l=t[c];l.skipWrite&&(delete i[c],delete i[l.name],delete i[l.nameWithTable])}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i};t.toDatabaseFormat=function(e){var t=e.data,n=e.columns,r=e.getDatabaseTimestamp,o=e.knex,i={};for(var a in t)n[a]&&(u.TimestampProperties.includes(a)?u.NowTimestampProperties.includes(a)?i[n[a].name]=o.raw(t[a]):i[n[a].name]=r(t[a]):i[n[a].name]=t[a]);return i};t.defaultParseToUnixTimestamp=function(e){return new Date(e).getTime()};t.defaultGetDatabaseTimestamp=function(e){return new Date(e).toISOString()};t.testTimeTransformFunctions=function(e,t){var n=Date.now();if(e(t(n))!==n)throw new Error('Configuration error: "getDatabaseTimestamp" and "parseToUnixTimestamp" functions are not compatible. The result of "parseUnixFunc" must be equal to the input of "getDatabaseTimestampFunc". For example, the following must be true: parseUnixFunc(getDatabaseTimestamp('.concat(n,")) === ").concat(n))};t.toUnixTimestamp=function(e,t){return Object.keys(e).forEach((function(n){u.TimestampProperties.includes(n)&&(e[n]=t(e[n]))})),e};t.keysToCamel=function(e,t,n){var r={};return Object.keys(n).forEach((function(t){if(n[t]){var o=n[t],i=e[t];u.StringIdProperties.includes(o)&&"number"==typeof i&&(i="".concat(i)),void 0===r[o]&&void 0!==i&&(r[o]=i)}})),r};t.transformToApolloFormat=function(e){var n=e.result,r=e.columns,o=e.columnMap,i=e.parseToUnixTimestamp,a=[];return n.forEach((function(e){var n=(0,t.keysToCamel)(e,r,o),u=(0,t.toUnixTimestamp)(n,i);a.push(u)})),a};t.attachAdditionalInfo=function(e){var t=function(e){return r(r({},e),{columnMap:{},selectFields:[],returnFields:[]})},n=r(r({Users:t(e.Users),Annotations:t(e.Annotations),Documents:t(e.Documents),AnnotationMembers:t(e.AnnotationMembers),DocumentMembers:t(e.DocumentMembers),Mentions:t(e.Mentions)},e.Snapshots&&{Snapshots:t(e.Snapshots)}),e.SnapshotAssets&&{SnapshotAssets:t(e.SnapshotAssets)});for(var a in n){var u=n[a],d=u.table,c=u.columns;for(var l in c){var f=c[l];"string"==typeof f&&(f=c[l]={name:f,nameWithTable:""});var m=f.join,p=f.name;if(m||p||(0,s.throwError)("SQL Resolver Generator","Expected column object to have either 'name' or 'join' property"),m){var v=o(m),h=v[0],y=v.slice(1),b=o(h.split("."),2),T=b[0],M=b[1];T&&M||(0,s.throwError)("SQL Resolver Generator","First item in join query must be formatted as {TableName}.{ColumnName} - received ".concat(h)),f.skipWrite=!0,f.nameWithTable="".concat(T,".").concat(M),f.name=M,f.join=i([T],o(y),!1),u.selectFields.push("".concat(T,".").concat(M)),u.columnMap[f.nameWithTable]=f.name,u.columnMap[M]=f.name}else f.nameWithTable="".concat(d,".").concat(f.name),u.selectFields.push("".concat(d,".").concat(f.name)),u.returnFields.push("".concat(f.name));u.columnMap[f.name]=l,u.columnMap["".concat(d,".").concat(f.name)]=l}}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringIdProperties=t.NowTimestampProperties=t.TimestampProperties=void 0,t.TimestampProperties=["createdAt","updatedAt","lastRead","annotationCreatedAt"],t.NowTimestampProperties=["createdAt","updatedAt","lastRead"],t.StringIdProperties=["id","userId","snapshotId","authorId","documentId","annotationId"]},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.addTransports=t.addConsoleTransport=void 0;var a=i(n(2)),u=n(0);t.addConsoleTransport=function(e,t,n){void 0===t&&(t=u.LogLevels.INFO),n&&0===(n=n.filter((function(e){return!!e}))).length&&(n=void 0),e.add(new a.default.transports.Console({level:t,format:a.format.combine((0,a.format)((function(e){return!(n&&!n.some((function(t){return e.tag===t})))&&e}))(),a.format.colorize(),a.format.printf((function(e){var t=c(e.message),n=e.tag?" [".concat(e.tag,"]"):"",r=c(e.meta);return"".concat(e.timestamp," ").concat(e.level).concat(n,": ").concat(t," ").concat(r)})),a.format.metadata({fillExcept:["message","level","timestamp","label"]}))}))};t.addTransports=function(e,t){t.forEach((function(t){return e.add(t)}))};var s=/<appearance(.*?)<\/appearance>/g,d=/<imagedata(.*?)<\/imagedata>/g,c=function(e){var t=e||"";return"object"==typeof e&&null!==e&&(t=JSON.stringify(e,null,2)),t=(t=t.replace(s,"<appearance>Truncated for readability...</appearance>")).replace(d,"<imagedata>Truncated for readability...</imagedata>")}},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchema=void 0;var a=i(n(9)),u=a.default.alternatives().try(a.default.object({name:a.default.string(),transform:a.default.function(),join:a.default.array(),resolve:a.default.func()}),a.default.string());t.validateSchema=function(e,t,n){var i,s,d;return a.default.object({client:(i=a.default.string()).valid.apply(i,o([],r(Object.values(n)),!1)).required(),connection:a.default.object().required(),pool:{min:a.default.number(),max:a.default.number()},getDatabaseTimestamp:a.default.func(),parseToUnixTimestamp:a.default.func(),getNow:a.default.func(),logLevel:(s=a.default.string()).valid.apply(s,o([],r(Object.values(e)),!1)),filterLogsByTag:(d=a.default.string()).valid.apply(d,o([],r(Object.values(t)),!1)),transports:a.default.array(),info:a.default.object({Users:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),type:u.required(),email:u.required(),userName:u,createdAt:u.required(),updatedAt:u.required()}).required()}).required(),Annotations:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),xfdf:u.required(),authorId:u.required(),annotationId:u.required(),documentId:u.required(),pageNumber:u.required(),createdAt:u.required(),updatedAt:u.required(),inReplyTo:u.required(),annotContents:u}).required()}).required(),Documents:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),authorId:u.required(),createdAt:u.required(),updatedAt:u.required(),isPublic:u.required(),name:u}).required()}).required(),AnnotationMembers:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),userId:u.required(),documentId:u.required(),annotationId:u.required(),lastRead:u.required(),createdAt:u.required(),updatedAt:u.required(),annotationCreatedAt:u.required()}).required()}),DocumentMembers:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),userId:u.required(),documentId:u.required(),lastRead:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()}).required(),Mentions:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),userId:u.required(),documentId:u.required(),annotationId:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()}).required(),Snapshots:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),authorId:u.required(),documentId:u.required(),xfdf:u.required(),name:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()}),SnapshotAssets:a.default.object({table:a.default.string().required(),writeMiddleware:a.default.array().items(a.default.function()),readMiddleware:a.default.array().items(a.default.function()),afterWrite:a.default.function(),columns:a.default.object({id:u.required(),snapshotId:u.required(),data:u.required(),createdAt:u.required(),updatedAt:u.required()}).required()})}).required()})}},function(e,t){e.exports=require("joi")}]).default})); |
@@ -6,3 +6,3 @@ { | ||
"types": "types/packages/collab-sql-resolver-generator/src/index.d.ts", | ||
"version": "2.1.0", | ||
"version": "2.2.0-alpha.1", | ||
"typedocMain": "src/index.ts", | ||
@@ -39,3 +39,3 @@ "scripts": { | ||
}, | ||
"gitHead": "ab62c395f6ce4025fe82efbe1c6968a58174aba6" | ||
"gitHead": "1ce55f436f8f98dfe4f6883e6b18499d05c1cc7b" | ||
} |
@@ -38,5 +38,5 @@ import { PubSub } from 'graphql-subscriptions'; | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -43,0 +43,0 @@ } & { |
@@ -37,9 +37,9 @@ import { Actions } from '..'; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -52,9 +52,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -67,2 +67,3 @@ } & { | ||
documents: (query: import("../types/Params").DocumentsQuery, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
@@ -72,3 +73,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -79,2 +79,3 @@ authorId: string; | ||
})[] | Promise<({ | ||
name?: string; | ||
id: string; | ||
@@ -84,3 +85,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -93,6 +93,6 @@ authorId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -107,6 +107,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -122,5 +122,5 @@ annotationCreatedAt: any; | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -133,5 +133,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -147,6 +147,6 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -158,6 +158,6 @@ userId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -169,8 +169,8 @@ userId: string; | ||
snapshots?: (query: import("../types/Params").SnapshotsQuery, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -181,8 +181,8 @@ authorId: string; | ||
})[] | Promise<({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -216,9 +216,9 @@ authorId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -231,9 +231,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -246,2 +246,3 @@ } & { | ||
documents: (query: import("../types/Params").DocumentsQuery, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
@@ -251,3 +252,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -258,2 +258,3 @@ authorId: string; | ||
})[] | Promise<({ | ||
name?: string; | ||
id: string; | ||
@@ -263,3 +264,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -272,6 +272,6 @@ authorId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -286,6 +286,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -301,5 +301,5 @@ annotationCreatedAt: any; | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -312,5 +312,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -326,6 +326,6 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -337,6 +337,6 @@ userId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -348,8 +348,8 @@ userId: string; | ||
snapshots?: (query: import("../types/Params").SnapshotsQuery, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -360,8 +360,8 @@ authorId: string; | ||
})[] | Promise<({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -386,9 +386,9 @@ authorId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -401,9 +401,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -417,9 +417,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -432,9 +432,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -448,9 +448,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -463,9 +463,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -479,2 +479,3 @@ } & { | ||
addDocument: (document: import("../../../../types/resolvers-types").NewDocumentInput, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
@@ -484,3 +485,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -491,2 +491,3 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
@@ -496,3 +497,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -504,2 +504,3 @@ authorId: string; | ||
editDocument: (id: string, input: import("../../../../types/global-graphql-types").EditDocumentInput, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
@@ -509,3 +510,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -516,2 +516,3 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
@@ -521,3 +522,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -531,5 +531,5 @@ authorId: string; | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -542,5 +542,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -554,5 +554,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -565,5 +565,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -578,6 +578,6 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -592,6 +592,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -607,6 +607,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -621,6 +621,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -636,6 +636,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -650,6 +650,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -666,6 +666,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -677,6 +677,6 @@ userId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -691,8 +691,8 @@ userId: string; | ||
}, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -703,8 +703,8 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -716,8 +716,8 @@ authorId: string; | ||
editSnapshot?: (id: string, input: import("../../../../types/resolvers-types").EditSnapshotInput, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -728,8 +728,8 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -760,9 +760,9 @@ authorId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -775,9 +775,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -791,9 +791,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -806,9 +806,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -822,9 +822,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -837,9 +837,9 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotContents?: string; | ||
xfdf: string; | ||
annotContents?: string; | ||
annotationId: string; | ||
documentId: string; | ||
pageNumber: number; | ||
createdAt: any; | ||
updatedAt: any; | ||
inReplyTo?: string; | ||
@@ -853,2 +853,3 @@ } & { | ||
addDocument: (document: import("../../../../types/resolvers-types").NewDocumentInput, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
@@ -858,3 +859,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -865,2 +865,3 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
@@ -870,3 +871,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -878,2 +878,3 @@ authorId: string; | ||
editDocument: (id: string, input: import("../../../../types/global-graphql-types").EditDocumentInput, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
@@ -883,3 +884,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -890,2 +890,3 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
@@ -895,3 +896,2 @@ createdAt: any; | ||
isPublic?: boolean; | ||
name?: string; | ||
} & { | ||
@@ -905,5 +905,5 @@ authorId: string; | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -916,5 +916,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -928,5 +928,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -939,5 +939,5 @@ } & { | ||
id: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
documentId: string; | ||
lastRead: any; | ||
@@ -952,6 +952,6 @@ } & { | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -966,6 +966,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -981,6 +981,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -995,6 +995,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -1010,6 +1010,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -1024,6 +1024,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
lastRead: any; | ||
@@ -1040,6 +1040,6 @@ annotationCreatedAt: any; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -1051,6 +1051,6 @@ userId: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
annotationId: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
} & { | ||
@@ -1065,8 +1065,8 @@ userId: string; | ||
}, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -1077,8 +1077,8 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -1090,8 +1090,8 @@ authorId: string; | ||
editSnapshot?: (id: string, input: import("../../../../types/resolvers-types").EditSnapshotInput, context: import("../types/CustomContext").CustomContext) => ({ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -1102,8 +1102,8 @@ authorId: string; | ||
}) | Promise<{ | ||
name?: string; | ||
id: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
xfdf: string; | ||
documentId: string; | ||
createdAt: any; | ||
updatedAt: any; | ||
name?: string; | ||
} & { | ||
@@ -1110,0 +1110,0 @@ authorId: string; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
237807
3