@zimbra/api-client 101.0.1-master.89348c4.0 → 101.0.1-master.f2f7505.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,5 +23,5 @@ To disable this validator, use:
23
23
  fragment session on Session {
24
24
  id
25
25
  }
26
- `;class SessionHandler{constructor(e){_defineProperty(this,"cache",void 0),_defineProperty(this,"cacheKeyForSession","Session"),_defineProperty(this,"readSessionId",()=>{return this.cache.readFragment({id:this.cacheKeyForSession,fragment:dr})?.id||"1"}),_defineProperty(this,"writeSessionId",e=>{this.cache.writeFragment({id:this.cacheKeyForSession,fragment:dr,data:{id:e,__typename:"Session"}})}),this.cache=e.cache}}OperationBatcher.prototype.enqueueRequest=function(e){var a=this,r=D(D({},e),{next:[],error:[],complete:[],subscribers:new Set}),d=this.batchKey(e.operation);return r.observable||(r.observable=new k(function(n){var i=a.batchesByKey.get(d),e=(i||a.batchesByKey.set(d,i=new Set),0===i.size),t=0===r.subscribers.size;return r.subscribers.add(n),t&&i.add(r),n.next&&r.next.push(n.next.bind(n)),n.error&&r.error.push(n.error.bind(n)),n.complete&&r.complete.push(n.complete.bind(n)),(e||a.batchDebounce)&&a.scheduleQueueConsumption(d),i.size===a.batchMax&&a.consumeQueue(d),function(){var e;r.subscribers.delete(n)&&r.subscribers.size<1&&i.delete(r)&&i.size<1&&(a.consumeQueue(d),null!=(e=i.subscription))&&e.unsubscribe()}})),r.observable},OperationBatcher.prototype.consumeQueue=function(e){var n,i,t,a,r,d,o,s=this.batchesByKey.get(e=void 0===e?"":e);if(this.batchesByKey.delete(e),s&&s.size)return n=[],i=[],t=[],a=[],r=[],d=[],s.forEach(function(e){n.push(e.operation),i.push(e.forward),t.push(e.observable),a.push(e.next),r.push(e.error),d.push(e.complete)}),e=this.batchHandler(n,i)||k.of(),s.subscription=e.subscribe({next:function(e){var n;if(Array.isArray(e)||(e=[e]),a.length!==e.length)return(n=new Error("server returned results with length ".concat(e.length,", expected length of ").concat(a.length))).result=e,o(n);e.forEach(function(n,e){a[e]&&a[e].forEach(function(e){return e(n)})})},error:o=function(n){r.forEach(function(e){e&&e.forEach(function(e){return e(n)})})},complete:function(){d.forEach(function(e){e&&e.forEach(function(e){return e()})})}}),t},OperationBatcher.prototype.scheduleQueueConsumption=function(e){var n=this;clearTimeout(this.scheduledBatchTimerByKey.get(e)),this.scheduledBatchTimerByKey.set(e,setTimeout(function(){n.consumeQueue(e),n.scheduledBatchTimerByKey.delete(e)},this.batchInterval))};var or=OperationBatcher;function OperationBatcher(e){var n=e.batchDebounce,i=e.batchInterval,t=e.batchMax,a=e.batchHandler,e=e.batchKey;this.batchesByKey=new Map,this.scheduledBatchTimerByKey=new Map,this.batchDebounce=n,this.batchInterval=i,this.batchMax=t||0,this.batchHandler=a,this.batchKey=e||function(){return""}}__extends(BatchLink,sr=Zt),BatchLink.prototype.request=function(e,n){return this.batcher.enqueueRequest({operation:e,forward:n})};var sr,lr,mr,ur,pr,cr,vr,kr=BatchLink;function BatchLink(e){var n=sr.call(this)||this,i=e||{},t=i.batchInterval,a=i.batchMax,r=i.batchHandler,d=i.batchKey;return n.batcher=new or({batchDebounce:i.batchDebounce,batchInterval:void 0===t?10:t,batchMax:void 0===a?0:a,batchHandler:void 0===r?function(){return null}:r,batchKey:void 0===d?function(){return""}:d}),e.batchHandler.length<=1&&(n.request=function(e){return n.batcher.enqueueRequest({operation:e})}),n}class LocalBatchLink extends Zt{constructor(t){super(),_defineProperty(this,"off",void 0),_defineProperty(this,"on",void 0),_defineProperty(this,"schema",void 0),_defineProperty(this,"batcher",void 0),this.schema=t.schema;const a=new events;this.on=a.on,this.off=a.off;this.batcher=new kr({batchInterval:t.batchInterval,batchHandler:e=>new k(n=>{a.emit("req",e);let i=!1;Promise.all(e.map(e=>{var{operationName:n,variables:i={}}=e;return graphql({schema:this.schema,source:print$1(e.query),rootValue:null,contextValue:e.getContext()||t.context||{},variableValues:i,operationName:n})})).then(e=>(i=!0,a.emit("res",e),n.next(e),n.complete(),e)).catch(e=>{i||a.emit("res",e),n.error(e)})})})}request(e){return this.batcher.request(e)}}function ErrorLink(e){var n=lr.call(this)||this;return n.link=function onError(d){return new Zt(function(a,r){return new k(function(n){var e,i,t;try{e=r(a).subscribe({next:function(e){e.errors?t=d({graphQLErrors:e.errors,response:e,operation:a,forward:r}):graphQLResultHasProtocolErrors(e)&&(t=d({protocolErrors:e.extensions[ea],response:e,operation:a,forward:r})),t?i=t.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}):n.next(e)},error:function(e){(t=d({operation:a,networkError:e,graphQLErrors:e&&e.result&&e.result.errors||void 0,forward:r}))?i=t.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}):n.error(e)},complete:function(){t||n.complete.bind(n)()}})}catch(e){d({networkError:e,operation:a,forward:r}),n.error(e)}return function(){e&&e.unsubscribe(),i&&e.unsubscribe()}})})}(e),n}__extends(ErrorLink,lr=Zt),ErrorLink.prototype.request=function(e,n){return this.link.request(e,n)};class ZimbraErrorLink extends ErrorLink{constructor(){super(e=>{var{graphQLErrors:e,networkError:n}=e;e&&e.map(e=>{const{message:n,...i}=e;e=e.originalError;this.executeHandlers({errorCode:e?.faults?.[0]?.Detail?.Error?.Code||"",message:n,originalError:e,...i})}),n&&this.executeHandlers({message:"[Network error]: "+n})}),_defineProperty(this,"handlers",[]),_defineProperty(this,"executeHandlers",n=>{this.handlers.map(e=>{e(n)})}),_defineProperty(this,"registerHandler",e=>{this.handlers.push(e)}),_defineProperty(this,"unRegisterAllHandlers",()=>{this.handlers=[]}),_defineProperty(this,"unRegisterHandler",e=>{e=this.handlers.findIndex(e);-1!==e&&this.handlers.splice(e,1)})}}const yr=(e,n)=>{if(e.__typename)return(n=function getValueByPath(e,n){if(n)return n.split(".").reduce((e,n)=>e&&"object"==typeof e?e[n]:void 0,e)}(e,n))?e.__typename+":"+n:defaultDataIdFromObject(e)},fr=e=>{switch(e.__typename){case"CalendarItemHitInfo":return e.instances?defaultDataIdFromObject(e)+":"+e.instances.length:""+defaultDataIdFromObject(e);case"MailboxMetadata":return yr(e,"meta.0.section");case"Folder":return e.local&&null!==e.local?defaultDataIdFromObject(e)+":local":"1"===e.id?e.__typename+`:${e.id}:`+e.uuid:e.id?.includes(":")?e.id+":"+e.absFolderPath:defaultDataIdFromObject(e);case"AutoCompleteMatch":return defaultDataIdFromObject(e)+":"+e.email;case"ContactListMember":return e.type+":"+e.value;case"MessageInfo":return e.part&&null!==e.part?defaultDataIdFromObject(e)+":"+e.part:defaultDataIdFromObject(e);case"SMimeMessage":return defaultDataIdFromObject(e)+":"+e.isSecure;case"Document":return defaultDataIdFromObject(e)+":"+e.version;default:return defaultDataIdFromObject(e)}};function resolvedRefrenceAddress(e,n){return(e||[]).map(e=>function isReference(e){return e&&"object"==typeof e&&"__ref"in e}(e)?{__typename:n("__typename",e),address:n("address",e),type:n("type",e),isGroup:n("isGroup",e),name:n("name",e),displayName:n("displayName",e)}:e)}const Nr={Query:{fields:{accountInfo:{merge:!0},getPreferences:{merge:!0}}},AccountInfo:{fields:{attrs:{merge:!0},habRoots:{merge:!0},license:{merge:!0},zimlets:{merge:!0},props:{merge:!0},cos:{merge:!0}}},Contact:{fields:{attributes:{merge:!0}}},Conversation:{fields:{messages:{merge:!1},emailAddresses:{merge:!1}}},MessageInfo:{fields:{emailAddresses:{merge(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=(2<arguments.length?arguments[2]:void 0)["readField"],e=resolvedRefrenceAddress(e,i),n=[...resolvedRefrenceAddress(n,i)||[],...e||[]];return n.sort((e,n)=>Number(null!=n.isGroup)-Number(null!=e.isGroup)),function uniqWith(n,i){var t=[];for(let e=0;e<n.length;e++){const a=n[e];t.every(e=>!i(e,a))&&t.push(a)}return t}(n,(e,n)=>e.address===n.address&&e.type===n.type)}}}}};class ZimbraInMemoryCache extends n{constructor(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};e.possibleTypes&&"function"!=typeof e.possibleTypes||(e.possibleTypes=function createPossibleTypes(e){return(0<arguments.length&&void 0!==e?e:Object)({MailItem:["Conversation","MessageInfo","MsgWithGroupInfo"]})}(e.possibleTypes)),super({dataIdFromObject:fr,typePolicies:Nr,...e})}}class SyncOfflineOperations{constructor(e){var n=this,{apolloClient:e,storage:i,storeKey:t="@offlineQueueKey"}=e;if(_defineProperty(this,"apolloClient",void 0),_defineProperty(this,"storage",void 0),_defineProperty(this,"offlineData",void 0),_defineProperty(this,"storeKey",void 0),_defineProperty(this,"addOfflineData",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];e&&0<e.length&&n.storage.setItem(n.storeKey,JSON.stringify(e))}),_defineProperty(this,"clearOfflineData",()=>(this.offlineData=[],Promise.resolve(this.storage.removeItem(this.storeKey)))),_defineProperty(this,"getOfflineData",()=>Promise.resolve(this.storage.getItem(this.storeKey))),_defineProperty(this,"hasOfflineData",()=>!!(this.offlineData&&0<this.offlineData.length)),_defineProperty(this,"init",()=>this.getOfflineData().then(e=>this.offlineData=e&&JSON.parse(e)||[])),_defineProperty(this,"sync",()=>{if(this.hasOfflineData()){const n=[];return Promise.all(this.offlineData.map(e=>this.apolloClient["mutation"in e?"mutate":"query"](e).catch(()=>{n.push(e)}))).catch(e=>console.warn("SyncOfflineOperations::sync ERR:",e)).then(this.clearOfflineData).then(()=>{this.addOfflineData(n)})}}),!e)throw new Error("Apollo Client instance is required when syncing data, please assign value to it");if(!i)throw new Error("Storage can be window.localStorage or AsyncStorage but was not set");this.apolloClient=e,this.storage=i,this.storeKey=t,this.offlineData=[]}}function deriveOfflineQueue(e){return e.map(e=>{var{query:e,variables:n}=e["operation"];return{[function isMutationOperation(e){return(e=e.query)&&e.definitions&&0<e.definitions.filter(e=>"mutation"===e.operation).length}({query:e})?"mutation":"query"]:e,variables:n}})}class OfflineQueueLink extends Zt{constructor(e){var n,{storage:e,storeKey:i="@offlineQueueKey",isOpen:t=!0}=e;if(super(),_defineProperty(n=this,"isOpen",void 0),_defineProperty(this,"storage",void 0),_defineProperty(this,"operationQueue",void 0),_defineProperty(this,"storeKey",void 0),_defineProperty(this,"close",()=>{this.isOpen=!1}),_defineProperty(this,"dequeue",e=>{e=this.operationQueue.indexOf(e);-1!==e&&(this.operationQueue=[...this.operationQueue.slice(0,e),...this.operationQueue.slice(e+1)]),this.persist()}),_defineProperty(this,"enqueue",e=>{this.operationQueue.push(e),this.persist()}),_defineProperty(this,"getSize",()=>Promise.resolve(this.storage.getItem(this.storeKey)).then(e=>(e||"").length)),_defineProperty(this,"handleCancelAndOfflineQueue",i=>{let t=-1;this.operationQueue.forEach((e,n)=>{i.offlineQuery===e.offlineQuery&&(t=n),i.cancelQuery===e.offlineQuery&&(this.operationQueue=[...this.operationQueue.slice(0,n),...this.operationQueue.slice(n+1)],this.persist())}),-1!==t?(this.operationQueue[t]=i,this.persist()):this.enqueue(i)}),_defineProperty(this,"open",function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{})["apolloClient"];if(e)return n.isOpen=!0,n.retry()}),_defineProperty(this,"persist",()=>Promise.resolve(this.storage.setItem(this.storeKey,JSON.stringify(deriveOfflineQueue(this.operationQueue))))),_defineProperty(this,"purge",()=>Promise.resolve(this.storage.removeItem(this.storeKey))),_defineProperty(this,"retry",()=>new Promise(e=>{let n=this.operationQueue.length;if(!n)return e();const a=()=>{0==--n&&e()};this.operationQueue.forEach(n=>{const{operation:e,forward:i,observer:t}=n;i(e).subscribe({next:e=>{t.next&&t.next(e)},error:e=>{this.dequeue(n),t.error&&t.error(e),a()},complete:()=>{this.dequeue(n),t.complete&&t.complete(),a()}})})})),_defineProperty(this,"sync",e=>{e=e.apolloClient;if(e){const n=new SyncOfflineOperations({apolloClient:e,storage:this.storage,storeKey:this.storeKey});return n.init().then(e=>{if(e&&e.length)return n.sync()})}}),!e)throw new Error("Storage can be window.localStorage or AsyncStorage but was not set");this.storage=e,this.storeKey=i,this.operationQueue=[],this.isOpen=t}request(i,t){const{skipQueue:e,cancelQueues:a,offlineQueueName:r,local:n}=i.getContext();return(this.isOpen||n||e||function hasSensitiveVariables(e){return!!e?.variables?.password}(i))&&t?t(i):new k(e=>{const n={operation:i,forward:t,observer:e,offlineQuery:r,cancelQuery:a};return r||a?this.handleCancelAndOfflineQueue(n):this.enqueue(n),()=>this.dequeue(n)})}}(We=mr=mr||{}).conversation="conversation",We.message="message",(o=ur=ur||{}).unread="u",o.flagged="f",o.hasAttachment="a",o.replied="r",o.sentByMe="s",o.forwarded="w",o.calendarInvite="v",o.draft="d",o.imapDeleted="x",o.notificationSent="n",o.urgent="!",o.lowPriority="?",o.priority="+",(i=pr=pr||{}).update="update",i.delete="delete",i.read="read",i.unread="!read",i.flag="flag",i.unflag="!flag",i.tag="tag",i.untag="!tag",i.move="move",i.spam="spam",i.unspam="!spam",i.trash="trash",i.copy="copy",i.recover="recover",i.rename="rename",(cr=cr||{}).update="update",(vr=vr||{}).priority="priority";a=Object.freeze({__proto__:null,get MailFolderView(){return mr},get MessageFlags(){return ur},get ActionOps(){return pr},get _MessageActionOps(){return cr},get _ConversationActionOps(){return vr},get ActionType(){return Fi},get ActionResultType(){return Ei},get AccountType(){return _n},get ActionTypeName(){return Pn},get AddressType(){return Vn},get AlarmAction(){return Ln},get AlarmRelatedTo(){return Mn},get AutoCompleteMatchType(){return Bn},get CalendarItemClass(){return jn},get CalendarItemRecurrenceFrequency(){return xn},get ConnectionType(){return zn},get ContactType(){return qn},get ConversationOrderBy(){return $n},get ExternalSendersType(){return Qn},get FilterMatchCondition(){return Un},get FolderView(){return Gn},get FreeBusyStatus(){return Wn},get GalSearchType(){return Hn},get GranteeType(){return Yn},get Importance(){return Kn},get InviteCompletionStatus(){return Jn},get InviteReplyType(){return Zn},get InviteReplyVerb(){return Xn},get InviteType(){return ei},get LicenseStatus(){return ni},get Mode(){return ii},get NeedIsMemberType(){return ti},get ParticipationRole(){return ai},get ParticipationStatus(){return ri},get PasswordRecoveryAddressStatus(){return di},get Pop3DeleteOption(){return oi},get PrefCalendarInitialView(){return si},get PrefClientType(){return li},get PrefDelegatedSendSaveTarget(){return mi},get PrefMailSelectAfterDelete(){return ui},get PrefMailSendReadReceipts(){return pi},get ReadingPaneLocation(){return ci},get RecoverAccountOp(){return vi},get ResetPasswordStatus(){return ki},get SaveDocumentAction(){return yi},get SaveDocumentType(){return fi},get SearchType(){return Ni},get SetRecoveryAccountChannel(){return gi},get SetRecoveryAccountOp(){return hi},get ShareInputAction(){return Ti},get SortBy(){return Di},get Weekday(){return Ii},get ZimletPresence(){return bi}}),s={Contact:ln,Conversation:qe,Document:Pe,FolderEntity:Ke,Mailbox:Le,MessageInfo:ze,Tag:Cn};p.LocalBatchLink=LocalBatchLink,p.OfflineQueueLink=OfflineQueueLink,p.SyncOfflineOperations=SyncOfflineOperations,p.ZimbraBatchClient=ZimbraBatchClient,p.ZimbraErrorLink=ZimbraErrorLink,p.ZimbraInMemoryCache=ZimbraInMemoryCache,p.batchJsonRequest=batchJsonRequest,p.createZimbraSchema=function createZimbraSchema(e){const{cache:n,getApolloClient:i,...t}=e;var a=n?new SessionHandler({cache:n}):void 0;const r=new ZimbraBatchClient({...t,sessionHandler:a}),d=e.localStoreClient;return a=makeExecutableSchema({typeDefs:zi,resolvers:{Query:{accountInfo:r.accountInfo,autoComplete:(e,n)=>r.autoComplete(n),autoCompleteGAL:(e,n)=>r.autoCompleteGAL(n),discoverRights:(e,n)=>r.discoverRights(n),downloadAttachment:(e,n)=>r.downloadAttachment(n),downloadDocument:(e,n)=>r.downloadDocument(n),listDocumentRevisions:(e,n)=>r.listDocumentRevisions(n),getItem:(e,n)=>r.getItem(n),downloadMessage:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).downloadMessage(n)},freeBusy:(e,n)=>r.freeBusy(n),getContact:(e,n)=>r.getContact(n),clientInfo:(e,n)=>r.clientInfo(n),getContactFrequency:(e,n)=>r.getContactFrequency(n),getConversation:(e,n)=>r.getConversation(n),getCustomMetadata:(e,n)=>r.getCustomMetadata(n),getDocumentShareURL:(e,n)=>r.getDocumentShareURL(n),getFilterRules:r.getFilterRules,getFolder:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).getFolder(n)},getHAB:(e,n)=>{n=n.habRootGroupId;return r.getHAB(n)},getAccountDistributionLists:(e,n)=>{var{attrs:n,ownerOf:i}=n;return r.getAccountDistributionLists(n,i)},getDistributionList:(e,n)=>{var{dl:n,needOwners:i,needRights:t,by:a}=n;return r.getDistributionList(n,i,t,a)},getDistributionListMembers:(e,n)=>{var{limit:n,offset:i,dl:t}=n;return r.getDistributionListMembers(n,i,t)},getAppointment:(e,n)=>r.getAppointment(n),getAppointments:(e,n)=>r.search(n),getReminders:(e,n)=>r.search(n),getTasks:(e,n)=>r.getTasks(n),getAvailableLocales:e=>r.getAvailableLocales(),getMailboxMetadata:(e,n)=>r.getMailboxMetadata(n),getMessage:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).getMessage(n)},getMessagesMetadata:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).getMessagesMetadata(n)},getRights:(e,n)=>r.getRights(n),getScratchCodes:r.getScratchCodes,getSearchFolder:r.getSearchFolder,getSMimePublicCerts:(e,n)=>r.getSMimePublicCerts(n),getSMimeCertInfo:r.getSMimeCertInfo,getTrustedDevices:r.getTrustedDevices,getDeviceStatus:r.getDeviceStatus,getWorkingHours:(e,n)=>r.getWorkingHours(n),getPreferences:r.getPreferences,getDataSources:r.getDataSources,getIdentities:r.getIdentities,getImportStatus:r.getImportStatus,getSignatures:r.getSignatures,noop:function(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return r.noop(n,i.fetchOptions)},recoverAccount:(e,n)=>r.recoverAccount(n),relatedContacts:(e,n)=>r.relatedContacts(n),search:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).search(n)},searchCalendarResources:(e,n)=>r.searchCalendarResources(n),searchGal:(e,n)=>r.searchGal(n),shareInfo:(e,n)=>r.shareInfo(n),taskFolders:r.taskFolders,getWhiteBlackList:r.getWhiteBlackList,getAppSpecificPasswords:r.getAppSpecificPasswords,getTag:r.getTag},MailItem:{__resolveType(e){return e.conversationId?"MessageInfo":"Conversation"}},Mutation:{action:function(e,n){let{type:i,...t}=n;n=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).local;return(n?d:r).action(i,t)},addMessage:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"],t=n["message"];return i?d.addMessage(n):r.addMessage(t)},applyFilterRules:(e,n)=>r.applyFilterRules(n),cancelTask:(e,n)=>r.cancelTask(n),itemAction:(e,n)=>r.itemAction(n),login:(e,n)=>r.login(n),logout:r.logout,disableTwoFactorAuth:(e,n)=>{n=n.method;return r.disableTwoFactorAuth(n)},enableTwoFactorAuth:(e,n)=>{n=n.options;return r.enableTwoFactorAuth(n)},messageAction:(e,n)=>r.messageAction(n),changePassword:(e,n)=>r.changePassword(n),modifyProfileImage:(e,n)=>r.modifyProfileImage(n),contactAction:(e,n)=>r.contactAction(n),createAppSpecificPassword:(e,n)=>{n=n.appName;return r.createAppSpecificPassword(n)},conversationAction:(e,n)=>r.conversationAction(n),createFolder:(e,n,i)=>{let{isLocalFolder:t,...a}=n;n=i.local;return n?d.createFolder({isLocalFolder:t,...a}):r.createFolder(a)},createSearchFolder:(e,n)=>r.createSearchFolder(n),createContact:(e,n)=>{n=n.contact;return r.createContact(n)},createContactList:(e,n)=>{n=n.contact;return r.createContact(n)},modifyContact:(e,n)=>{n=n.contact;return r.modifyContact(n)},modifyContactList:(e,n)=>{n=n.contact;return r.modifyContact(n)},createAppointment:(e,n)=>{var{accountName:n,appointment:i}=n;return r.createAppointment(n,i)},snoozeCalendarItem:(e,n)=>{var{appointment:n,task:i}=n;return r.snoozeCalendarItem(n,i)},dismissCalendarItem:(e,n)=>{var{appointment:n,task:i}=n;return r.dismissCalendarItem(n,i)},createAppointmentException:(e,n)=>{var{accountName:n,appointment:i}=n;return r.createAppointmentException(n,i)},modifyAppointment:(e,n)=>{var{accountName:n,appointment:i}=n;return r.modifyAppointment(n,i)},createMountpoint:(e,n)=>r.createMountpoint(n),deleteAppointment:(e,n)=>{n=n.appointment;return r.deleteAppointment(n)},checkCalendars:(e,n)=>r.checkCalendars(n.actions),counterAppointment:(e,n)=>{n=n.counterAppointmentInvite;return r.counterAppointment(n)},createCalendar:(e,n)=>{var{name:n,color:i,url:t,parentFolderId:a}=n;return r.createFolder({name:n,color:i,url:t,view:"appointment",flags:"#",parentFolderId:a})},createSharedCalendar:(e,n)=>{n=n.link;return r.createMountpoint({link:{...n,parentFolderId:1,view:"appointment",flags:"#"}})},saveDocument:(e,n)=>r.saveDocument(n),changeFolderColor:(e,n)=>r.changeFolderColor(n),declineCounterAppointment:(e,n)=>{n=n.counterAppointmentInvite;return r.declineCounterAppointment(n)},folderAction:(e,n)=>{n=n.action;return r.folderAction(n)},documentAction:(e,n)=>{n=n.action;return r.documentAction(n)},forwardAppointment:(e,n)=>{n=n.appointmentInvite;return r.forwardAppointment(n)},forwardAppointmentInvite:(e,n)=>{n=n.appointmentInvite;return r.forwardAppointmentInvite(n)},generateScratchCodes:r.generateScratchCodes,grantRights:(e,n)=>r.grantRights(n.input),sendShareNotification:(e,n)=>{n=n.shareNotification;return r.sendShareNotification(n)},sendTwoFactorAuthCode:(e,n)=>{n=n.options;return r.sendTwoFactorAuthCode(n)},testExternalAccount:(e,n)=>{n=n.externalAccount;return r.testExternalAccount(n)},addExternalAccount:(e,n)=>{n=n.externalAccount;return r.addExternalAccount(n)},modifyExternalAccount:(e,n)=>r.modifyExternalAccount(n),deleteExternalAccount:(e,n)=>r.deleteExternalAccount(n),importExternalAccount:(e,n)=>{n=n.externalAccount;return r.importExternalAccount(n)},purgeRevision:(e,n)=>r.purgeRevision(n),prefEnableOutOfOfficeAlertOnLogin:(e,n)=>{n=n.value;return r.modifyPrefs({zimbraPrefOutOfOfficeStatusAlertOnLogin:n}).then(Boolean)},prefEnableOutOfOfficeReply:(e,n)=>{n=n.value;return r.modifyPrefs({zimbraPrefOutOfOfficeReplyEnabled:n}).then(Boolean)},prefOutOfOfficeFromDate:(e,n)=>{let i=n["value"];return r.modifyPrefs({zimbraPrefOutOfOfficeFromDate:i}).then(()=>i)},prefOutOfOfficeUntilDate:(e,n)=>{let i=n["value"];return r.modifyPrefs({zimbraPrefOutOfOfficeUntilDate:i}).then(()=>i)},prefOutOfOfficeReply:(e,n)=>{let i=n["value"];return r.modifyPrefs({zimbraPrefOutOfOfficeReply:i}).then(()=>i)},createIdentity:(e,n)=>r.createIdentity(n),modifyIdentity:(e,n)=>r.modifyIdentity(n).then(Boolean),deleteIdentity:(e,n)=>r.deleteIdentity(n).then(Boolean),modifyPrefs:(e,n)=>{n=n.prefs;return r.modifyPrefs(n)},modifyProps:(e,n)=>{n=n.props;return r.modifyProps(n)},modifyZimletPrefs:(e,n)=>{n=n.zimlets;return r.modifyZimletPrefs(n)},modifyFilterRules:(e,n)=>{n=n.filters;return r.modifyFilterRules(n)},createSignature:(e,n)=>r.createSignature(n),modifySignature:(e,n)=>r.modifySignature(n),modifySearchFolder:(e,n)=>r.modifySearchFolder(n),deleteSignature:(e,n)=>r.deleteSignature(n),saveDraft:function(e,n){var{message:n,accountName:i}=n;return((2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).local?d:r).saveDraft(n,i)},sendMessage:function(e,n){var{message:n,accountName:i,sign:t=!1,encrypt:a=!1}=n;return((2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).local?d:r).sendMessage(n,i,t,a)},saveSMimeCert:(e,n)=>{var{upload:n,password:i}=n;return r.saveSMimeCert(n,i)},sendDeliveryReport:(e,n)=>{n=n.messageId;return r.sendDeliveryReport(n)},uploadMessage:(e,n)=>{n=n.value;return r.uploadMessage(n)},createTask:(e,n)=>{n=n.task;return r.createTask(n)},modifyTask:(e,n)=>{n=n.task;return r.modifyTask(n)},sendInviteReply:(e,n)=>{n=n.inviteReply;return r.sendInviteReply(n)},recoverAccount:(e,n)=>r.recoverAccount(n),resetPassword:(e,n)=>r.resetPassword(n),revokeAppSpecificPassword:(e,n)=>{n=n.appName;return r.revokeAppSpecificPassword(n)},revokeOtherTrustedDevices:r.revokeOtherTrustedDevices,revokeRights:(e,n)=>r.revokeRights(n.input),revokeTrustedDevice:r.revokeTrustedDevice,setCustomMetadata:(e,n)=>r.setCustomMetadata(n),setMailboxMetadata:(e,n)=>r.jsonRequest({name:"SetMailboxMetadata",body:{meta:{section:n.section,_attrs:mapValues(n.attrs||{},coerceBooleanToString)}}}).then(Boolean),setRecoveryAccount:(e,n)=>r.setRecoveryAccount(n),modifyWhiteBlackList:(e,n)=>{n=n.whiteBlackList;return r.modifyWhiteBlackList(n)},createTag:(e,n)=>{n=n.tag;return r.createTag(n)},tagAction:(e,n)=>{n=n.action;return r.action(Fi.tag,n)},quarantineDeviceSync:(e,n)=>{n=n.deviceId;r.quarantineDeviceSync(n)},allowDeviceSync:(e,n)=>{n=n.deviceId;r.allowDeviceSync(n)},removeDeviceSync:(e,n)=>{n=n.deviceId;r.removeDeviceSync(n)},blockDeviceSync:(e,n)=>{n=n.deviceId;r.blockDeviceSync(n)},accountOnlyRemoteWipeSync:(e,n)=>{n=n.deviceId;r.accountOnlyRemoteWipeSync(n)},cancelPendingAccountOnlyRemoteWipeSync:(e,n)=>{n=n.deviceId;r.cancelPendingAccountOnlyRemoteWipeSync(n)},remoteWipeSync:(e,n)=>{n=n.deviceId;r.remoteWipeSync(n)},cancelPendingRemoteWipeSync:(e,n)=>{n=n.deviceId;r.cancelPendingRemoteWipeSync(n)},subscribeDistributionList:(e,n)=>{var{op:n,by:i,dl:t}=n;return r.subscribeDistributionList(n,i,t)},distributionListAction:(e,n)=>{n=n.dlActions;return r.distributionListAction(n)}}}}),{client:r,schema:a}},p.entities=s,p.jsonRequest=jsonRequest,p.normalize=normalize$2,p.schema=zi,p.types=a,Object.defineProperty(p,"__esModule",{value:!0})});
26
+ `;class SessionHandler{constructor(e){_defineProperty(this,"cache",void 0),_defineProperty(this,"cacheKeyForSession","Session"),_defineProperty(this,"readSessionId",()=>{return this.cache.readFragment({id:this.cacheKeyForSession,fragment:dr})?.id||"1"}),_defineProperty(this,"writeSessionId",e=>{this.cache.writeFragment({id:this.cacheKeyForSession,fragment:dr,data:{id:e,__typename:"Session"}})}),this.cache=e.cache}}OperationBatcher.prototype.enqueueRequest=function(e){var a=this,r=D(D({},e),{next:[],error:[],complete:[],subscribers:new Set}),d=this.batchKey(e.operation);return r.observable||(r.observable=new k(function(n){var i=a.batchesByKey.get(d),e=(i||a.batchesByKey.set(d,i=new Set),0===i.size),t=0===r.subscribers.size;return r.subscribers.add(n),t&&i.add(r),n.next&&r.next.push(n.next.bind(n)),n.error&&r.error.push(n.error.bind(n)),n.complete&&r.complete.push(n.complete.bind(n)),(e||a.batchDebounce)&&a.scheduleQueueConsumption(d),i.size===a.batchMax&&a.consumeQueue(d),function(){var e;r.subscribers.delete(n)&&r.subscribers.size<1&&i.delete(r)&&i.size<1&&(a.consumeQueue(d),null!=(e=i.subscription))&&e.unsubscribe()}})),r.observable},OperationBatcher.prototype.consumeQueue=function(e){var n,i,t,a,r,d,o,s=this.batchesByKey.get(e=void 0===e?"":e);if(this.batchesByKey.delete(e),s&&s.size)return n=[],i=[],t=[],a=[],r=[],d=[],s.forEach(function(e){n.push(e.operation),i.push(e.forward),t.push(e.observable),a.push(e.next),r.push(e.error),d.push(e.complete)}),e=this.batchHandler(n,i)||k.of(),s.subscription=e.subscribe({next:function(e){var n;if(Array.isArray(e)||(e=[e]),a.length!==e.length)return(n=new Error("server returned results with length ".concat(e.length,", expected length of ").concat(a.length))).result=e,o(n);e.forEach(function(n,e){a[e]&&a[e].forEach(function(e){return e(n)})})},error:o=function(n){r.forEach(function(e){e&&e.forEach(function(e){return e(n)})})},complete:function(){d.forEach(function(e){e&&e.forEach(function(e){return e()})})}}),t},OperationBatcher.prototype.scheduleQueueConsumption=function(e){var n=this;clearTimeout(this.scheduledBatchTimerByKey.get(e)),this.scheduledBatchTimerByKey.set(e,setTimeout(function(){n.consumeQueue(e),n.scheduledBatchTimerByKey.delete(e)},this.batchInterval))};var or=OperationBatcher;function OperationBatcher(e){var n=e.batchDebounce,i=e.batchInterval,t=e.batchMax,a=e.batchHandler,e=e.batchKey;this.batchesByKey=new Map,this.scheduledBatchTimerByKey=new Map,this.batchDebounce=n,this.batchInterval=i,this.batchMax=t||0,this.batchHandler=a,this.batchKey=e||function(){return""}}__extends(BatchLink,sr=Zt),BatchLink.prototype.request=function(e,n){return this.batcher.enqueueRequest({operation:e,forward:n})};var sr,lr,mr,ur,pr,cr,vr,kr=BatchLink;function BatchLink(e){var n=sr.call(this)||this,i=e||{},t=i.batchInterval,a=i.batchMax,r=i.batchHandler,d=i.batchKey;return n.batcher=new or({batchDebounce:i.batchDebounce,batchInterval:void 0===t?10:t,batchMax:void 0===a?0:a,batchHandler:void 0===r?function(){return null}:r,batchKey:void 0===d?function(){return""}:d}),e.batchHandler.length<=1&&(n.request=function(e){return n.batcher.enqueueRequest({operation:e})}),n}class LocalBatchLink extends Zt{constructor(t){super(),_defineProperty(this,"off",void 0),_defineProperty(this,"on",void 0),_defineProperty(this,"schema",void 0),_defineProperty(this,"batcher",void 0),this.schema=t.schema;const a=new events;this.on=a.on,this.off=a.off;this.batcher=new kr({batchInterval:t.batchInterval,batchHandler:e=>new k(n=>{a.emit("req",e);let i=!1;Promise.all(e.map(e=>{var{operationName:n,variables:i={}}=e;return graphql({schema:this.schema,source:print$1(e.query),rootValue:null,contextValue:e.getContext()||t.context||{},variableValues:i,operationName:n})})).then(e=>(i=!0,a.emit("res",e),n.next(e),n.complete(),e)).catch(e=>{i||a.emit("res",e),n.error(e)})})})}request(e){return this.batcher.request(e)}}function ErrorLink(e){var n=lr.call(this)||this;return n.link=function onError(d){return new Zt(function(a,r){return new k(function(n){var e,i,t;try{e=r(a).subscribe({next:function(e){e.errors?t=d({graphQLErrors:e.errors,response:e,operation:a,forward:r}):graphQLResultHasProtocolErrors(e)&&(t=d({protocolErrors:e.extensions[ea],response:e,operation:a,forward:r})),t?i=t.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}):n.next(e)},error:function(e){(t=d({operation:a,networkError:e,graphQLErrors:e&&e.result&&e.result.errors||void 0,forward:r}))?i=t.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}):n.error(e)},complete:function(){t||n.complete.bind(n)()}})}catch(e){d({networkError:e,operation:a,forward:r}),n.error(e)}return function(){e&&e.unsubscribe(),i&&e.unsubscribe()}})})}(e),n}__extends(ErrorLink,lr=Zt),ErrorLink.prototype.request=function(e,n){return this.link.request(e,n)};class ZimbraErrorLink extends ErrorLink{constructor(){super(e=>{var{graphQLErrors:e,networkError:n}=e;e&&e.map(e=>{const{message:n,...i}=e;e=e.originalError;this.executeHandlers({errorCode:e?.faults?.[0]?.Detail?.Error?.Code||"",message:n,originalError:e,...i})}),n&&this.executeHandlers({message:"[Network error]: "+n})}),_defineProperty(this,"handlers",[]),_defineProperty(this,"executeHandlers",n=>{this.handlers.map(e=>{e(n)})}),_defineProperty(this,"registerHandler",e=>{this.handlers.push(e)}),_defineProperty(this,"unRegisterAllHandlers",()=>{this.handlers=[]}),_defineProperty(this,"unRegisterHandler",e=>{e=this.handlers.findIndex(e);-1!==e&&this.handlers.splice(e,1)})}}const yr=(e,n)=>{if(e.__typename)return(n=function getValueByPath(e,n){if(n)return n.split(".").reduce((e,n)=>e&&"object"==typeof e?e[n]:void 0,e)}(e,n))?e.__typename+":"+n:defaultDataIdFromObject(e)},fr=e=>{switch(e.__typename){case"CalendarItemHitInfo":return e.instances?defaultDataIdFromObject(e)+":"+e.instances.length:""+defaultDataIdFromObject(e);case"MailboxMetadata":return yr(e,"meta.0.section");case"Folder":return e.local&&null!==e.local?defaultDataIdFromObject(e)+":local":"1"===e.id?e.__typename+`:${e.id}:`+e.uuid:e.id?.includes(":")?e.id+":"+e.absFolderPath:defaultDataIdFromObject(e);case"AutoCompleteMatch":return defaultDataIdFromObject(e)+":"+e.email;case"ContactListMember":return e.type+":"+e.value;case"MessageInfo":return e.part&&null!==e.part?defaultDataIdFromObject(e)+":"+e.part:defaultDataIdFromObject(e);case"SMimeMessage":return defaultDataIdFromObject(e)+":"+e.isSecure;case"Document":return defaultDataIdFromObject(e)+":"+e.version;default:return defaultDataIdFromObject(e)}};function resolvedRefrenceAddress(e,n){return(e||[]).map(e=>function isReference(e){return e&&"object"==typeof e&&"__ref"in e}(e)?{__typename:n("__typename",e),address:n("address",e),type:n("type",e),isGroup:n("isGroup",e),name:n("name",e),displayName:n("displayName",e)}:e)}const Nr={Query:{fields:{accountInfo:{merge:!0},getPreferences:{merge:!0}}},AccountInfo:{fields:{attrs:{merge:!0},habRoots:{merge:!0},license:{merge:!0},zimlets:{merge:!0},props:{merge:!0},cos:{merge:!0}}},Contact:{fields:{attributes:{merge:!0}}},Conversation:{fields:{messages:{merge:!1},emailAddresses:{merge:!1},sortField:{merge(e,n){return null!=n?n:e}}}},MessageInfo:{fields:{emailAddresses:{merge(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=(2<arguments.length?arguments[2]:void 0)["readField"],e=resolvedRefrenceAddress(e,i),n=[...resolvedRefrenceAddress(n,i)||[],...e||[]];return n.sort((e,n)=>Number(null!=n.isGroup)-Number(null!=e.isGroup)),function uniqWith(n,i){var t=[];for(let e=0;e<n.length;e++){const a=n[e];t.every(e=>!i(e,a))&&t.push(a)}return t}(n,(e,n)=>e.address===n.address&&e.type===n.type)}}}}};class ZimbraInMemoryCache extends n{constructor(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};e.possibleTypes&&"function"!=typeof e.possibleTypes||(e.possibleTypes=function createPossibleTypes(e){return(0<arguments.length&&void 0!==e?e:Object)({MailItem:["Conversation","MessageInfo","MsgWithGroupInfo"]})}(e.possibleTypes)),super({dataIdFromObject:fr,typePolicies:Nr,...e})}}class SyncOfflineOperations{constructor(e){var n=this,{apolloClient:e,storage:i,storeKey:t="@offlineQueueKey"}=e;if(_defineProperty(this,"apolloClient",void 0),_defineProperty(this,"storage",void 0),_defineProperty(this,"offlineData",void 0),_defineProperty(this,"storeKey",void 0),_defineProperty(this,"addOfflineData",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];e&&0<e.length&&n.storage.setItem(n.storeKey,JSON.stringify(e))}),_defineProperty(this,"clearOfflineData",()=>(this.offlineData=[],Promise.resolve(this.storage.removeItem(this.storeKey)))),_defineProperty(this,"getOfflineData",()=>Promise.resolve(this.storage.getItem(this.storeKey))),_defineProperty(this,"hasOfflineData",()=>!!(this.offlineData&&0<this.offlineData.length)),_defineProperty(this,"init",()=>this.getOfflineData().then(e=>this.offlineData=e&&JSON.parse(e)||[])),_defineProperty(this,"sync",()=>{if(this.hasOfflineData()){const n=[];return Promise.all(this.offlineData.map(e=>this.apolloClient["mutation"in e?"mutate":"query"](e).catch(()=>{n.push(e)}))).catch(e=>console.warn("SyncOfflineOperations::sync ERR:",e)).then(this.clearOfflineData).then(()=>{this.addOfflineData(n)})}}),!e)throw new Error("Apollo Client instance is required when syncing data, please assign value to it");if(!i)throw new Error("Storage can be window.localStorage or AsyncStorage but was not set");this.apolloClient=e,this.storage=i,this.storeKey=t,this.offlineData=[]}}function deriveOfflineQueue(e){return e.map(e=>{var{query:e,variables:n}=e["operation"];return{[function isMutationOperation(e){return(e=e.query)&&e.definitions&&0<e.definitions.filter(e=>"mutation"===e.operation).length}({query:e})?"mutation":"query"]:e,variables:n}})}class OfflineQueueLink extends Zt{constructor(e){var n,{storage:e,storeKey:i="@offlineQueueKey",isOpen:t=!0}=e;if(super(),_defineProperty(n=this,"isOpen",void 0),_defineProperty(this,"storage",void 0),_defineProperty(this,"operationQueue",void 0),_defineProperty(this,"storeKey",void 0),_defineProperty(this,"close",()=>{this.isOpen=!1}),_defineProperty(this,"dequeue",e=>{e=this.operationQueue.indexOf(e);-1!==e&&(this.operationQueue=[...this.operationQueue.slice(0,e),...this.operationQueue.slice(e+1)]),this.persist()}),_defineProperty(this,"enqueue",e=>{this.operationQueue.push(e),this.persist()}),_defineProperty(this,"getSize",()=>Promise.resolve(this.storage.getItem(this.storeKey)).then(e=>(e||"").length)),_defineProperty(this,"handleCancelAndOfflineQueue",i=>{let t=-1;this.operationQueue.forEach((e,n)=>{i.offlineQuery===e.offlineQuery&&(t=n),i.cancelQuery===e.offlineQuery&&(this.operationQueue=[...this.operationQueue.slice(0,n),...this.operationQueue.slice(n+1)],this.persist())}),-1!==t?(this.operationQueue[t]=i,this.persist()):this.enqueue(i)}),_defineProperty(this,"open",function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{})["apolloClient"];if(e)return n.isOpen=!0,n.retry()}),_defineProperty(this,"persist",()=>Promise.resolve(this.storage.setItem(this.storeKey,JSON.stringify(deriveOfflineQueue(this.operationQueue))))),_defineProperty(this,"purge",()=>Promise.resolve(this.storage.removeItem(this.storeKey))),_defineProperty(this,"retry",()=>new Promise(e=>{let n=this.operationQueue.length;if(!n)return e();const a=()=>{0==--n&&e()};this.operationQueue.forEach(n=>{const{operation:e,forward:i,observer:t}=n;i(e).subscribe({next:e=>{t.next&&t.next(e)},error:e=>{this.dequeue(n),t.error&&t.error(e),a()},complete:()=>{this.dequeue(n),t.complete&&t.complete(),a()}})})})),_defineProperty(this,"sync",e=>{e=e.apolloClient;if(e){const n=new SyncOfflineOperations({apolloClient:e,storage:this.storage,storeKey:this.storeKey});return n.init().then(e=>{if(e&&e.length)return n.sync()})}}),!e)throw new Error("Storage can be window.localStorage or AsyncStorage but was not set");this.storage=e,this.storeKey=i,this.operationQueue=[],this.isOpen=t}request(i,t){const{skipQueue:e,cancelQueues:a,offlineQueueName:r,local:n}=i.getContext();return(this.isOpen||n||e||function hasSensitiveVariables(e){return!!e?.variables?.password}(i))&&t?t(i):new k(e=>{const n={operation:i,forward:t,observer:e,offlineQuery:r,cancelQuery:a};return r||a?this.handleCancelAndOfflineQueue(n):this.enqueue(n),()=>this.dequeue(n)})}}(We=mr=mr||{}).conversation="conversation",We.message="message",(o=ur=ur||{}).unread="u",o.flagged="f",o.hasAttachment="a",o.replied="r",o.sentByMe="s",o.forwarded="w",o.calendarInvite="v",o.draft="d",o.imapDeleted="x",o.notificationSent="n",o.urgent="!",o.lowPriority="?",o.priority="+",(i=pr=pr||{}).update="update",i.delete="delete",i.read="read",i.unread="!read",i.flag="flag",i.unflag="!flag",i.tag="tag",i.untag="!tag",i.move="move",i.spam="spam",i.unspam="!spam",i.trash="trash",i.copy="copy",i.recover="recover",i.rename="rename",(cr=cr||{}).update="update",(vr=vr||{}).priority="priority";a=Object.freeze({__proto__:null,get MailFolderView(){return mr},get MessageFlags(){return ur},get ActionOps(){return pr},get _MessageActionOps(){return cr},get _ConversationActionOps(){return vr},get ActionType(){return Fi},get ActionResultType(){return Ei},get AccountType(){return _n},get ActionTypeName(){return Pn},get AddressType(){return Vn},get AlarmAction(){return Ln},get AlarmRelatedTo(){return Mn},get AutoCompleteMatchType(){return Bn},get CalendarItemClass(){return jn},get CalendarItemRecurrenceFrequency(){return xn},get ConnectionType(){return zn},get ContactType(){return qn},get ConversationOrderBy(){return $n},get ExternalSendersType(){return Qn},get FilterMatchCondition(){return Un},get FolderView(){return Gn},get FreeBusyStatus(){return Wn},get GalSearchType(){return Hn},get GranteeType(){return Yn},get Importance(){return Kn},get InviteCompletionStatus(){return Jn},get InviteReplyType(){return Zn},get InviteReplyVerb(){return Xn},get InviteType(){return ei},get LicenseStatus(){return ni},get Mode(){return ii},get NeedIsMemberType(){return ti},get ParticipationRole(){return ai},get ParticipationStatus(){return ri},get PasswordRecoveryAddressStatus(){return di},get Pop3DeleteOption(){return oi},get PrefCalendarInitialView(){return si},get PrefClientType(){return li},get PrefDelegatedSendSaveTarget(){return mi},get PrefMailSelectAfterDelete(){return ui},get PrefMailSendReadReceipts(){return pi},get ReadingPaneLocation(){return ci},get RecoverAccountOp(){return vi},get ResetPasswordStatus(){return ki},get SaveDocumentAction(){return yi},get SaveDocumentType(){return fi},get SearchType(){return Ni},get SetRecoveryAccountChannel(){return gi},get SetRecoveryAccountOp(){return hi},get ShareInputAction(){return Ti},get SortBy(){return Di},get Weekday(){return Ii},get ZimletPresence(){return bi}}),s={Contact:ln,Conversation:qe,Document:Pe,FolderEntity:Ke,Mailbox:Le,MessageInfo:ze,Tag:Cn};p.LocalBatchLink=LocalBatchLink,p.OfflineQueueLink=OfflineQueueLink,p.SyncOfflineOperations=SyncOfflineOperations,p.ZimbraBatchClient=ZimbraBatchClient,p.ZimbraErrorLink=ZimbraErrorLink,p.ZimbraInMemoryCache=ZimbraInMemoryCache,p.batchJsonRequest=batchJsonRequest,p.createZimbraSchema=function createZimbraSchema(e){const{cache:n,getApolloClient:i,...t}=e;var a=n?new SessionHandler({cache:n}):void 0;const r=new ZimbraBatchClient({...t,sessionHandler:a}),d=e.localStoreClient;return a=makeExecutableSchema({typeDefs:zi,resolvers:{Query:{accountInfo:r.accountInfo,autoComplete:(e,n)=>r.autoComplete(n),autoCompleteGAL:(e,n)=>r.autoCompleteGAL(n),discoverRights:(e,n)=>r.discoverRights(n),downloadAttachment:(e,n)=>r.downloadAttachment(n),downloadDocument:(e,n)=>r.downloadDocument(n),listDocumentRevisions:(e,n)=>r.listDocumentRevisions(n),getItem:(e,n)=>r.getItem(n),downloadMessage:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).downloadMessage(n)},freeBusy:(e,n)=>r.freeBusy(n),getContact:(e,n)=>r.getContact(n),clientInfo:(e,n)=>r.clientInfo(n),getContactFrequency:(e,n)=>r.getContactFrequency(n),getConversation:(e,n)=>r.getConversation(n),getCustomMetadata:(e,n)=>r.getCustomMetadata(n),getDocumentShareURL:(e,n)=>r.getDocumentShareURL(n),getFilterRules:r.getFilterRules,getFolder:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).getFolder(n)},getHAB:(e,n)=>{n=n.habRootGroupId;return r.getHAB(n)},getAccountDistributionLists:(e,n)=>{var{attrs:n,ownerOf:i}=n;return r.getAccountDistributionLists(n,i)},getDistributionList:(e,n)=>{var{dl:n,needOwners:i,needRights:t,by:a}=n;return r.getDistributionList(n,i,t,a)},getDistributionListMembers:(e,n)=>{var{limit:n,offset:i,dl:t}=n;return r.getDistributionListMembers(n,i,t)},getAppointment:(e,n)=>r.getAppointment(n),getAppointments:(e,n)=>r.search(n),getReminders:(e,n)=>r.search(n),getTasks:(e,n)=>r.getTasks(n),getAvailableLocales:e=>r.getAvailableLocales(),getMailboxMetadata:(e,n)=>r.getMailboxMetadata(n),getMessage:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).getMessage(n)},getMessagesMetadata:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).getMessagesMetadata(n)},getRights:(e,n)=>r.getRights(n),getScratchCodes:r.getScratchCodes,getSearchFolder:r.getSearchFolder,getSMimePublicCerts:(e,n)=>r.getSMimePublicCerts(n),getSMimeCertInfo:r.getSMimeCertInfo,getTrustedDevices:r.getTrustedDevices,getDeviceStatus:r.getDeviceStatus,getWorkingHours:(e,n)=>r.getWorkingHours(n),getPreferences:r.getPreferences,getDataSources:r.getDataSources,getIdentities:r.getIdentities,getImportStatus:r.getImportStatus,getSignatures:r.getSignatures,noop:function(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return r.noop(n,i.fetchOptions)},recoverAccount:(e,n)=>r.recoverAccount(n),relatedContacts:(e,n)=>r.relatedContacts(n),search:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"];return(i?d:r).search(n)},searchCalendarResources:(e,n)=>r.searchCalendarResources(n),searchGal:(e,n)=>r.searchGal(n),shareInfo:(e,n)=>r.shareInfo(n),taskFolders:r.taskFolders,getWhiteBlackList:r.getWhiteBlackList,getAppSpecificPasswords:r.getAppSpecificPasswords,getTag:r.getTag},MailItem:{__resolveType(e){return e.conversationId?"MessageInfo":"Conversation"}},Mutation:{action:function(e,n){let{type:i,...t}=n;n=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).local;return(n?d:r).action(i,t)},addMessage:function(e,n){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})["local"],t=n["message"];return i?d.addMessage(n):r.addMessage(t)},applyFilterRules:(e,n)=>r.applyFilterRules(n),cancelTask:(e,n)=>r.cancelTask(n),itemAction:(e,n)=>r.itemAction(n),login:(e,n)=>r.login(n),logout:r.logout,disableTwoFactorAuth:(e,n)=>{n=n.method;return r.disableTwoFactorAuth(n)},enableTwoFactorAuth:(e,n)=>{n=n.options;return r.enableTwoFactorAuth(n)},messageAction:(e,n)=>r.messageAction(n),changePassword:(e,n)=>r.changePassword(n),modifyProfileImage:(e,n)=>r.modifyProfileImage(n),contactAction:(e,n)=>r.contactAction(n),createAppSpecificPassword:(e,n)=>{n=n.appName;return r.createAppSpecificPassword(n)},conversationAction:(e,n)=>r.conversationAction(n),createFolder:(e,n,i)=>{let{isLocalFolder:t,...a}=n;n=i.local;return n?d.createFolder({isLocalFolder:t,...a}):r.createFolder(a)},createSearchFolder:(e,n)=>r.createSearchFolder(n),createContact:(e,n)=>{n=n.contact;return r.createContact(n)},createContactList:(e,n)=>{n=n.contact;return r.createContact(n)},modifyContact:(e,n)=>{n=n.contact;return r.modifyContact(n)},modifyContactList:(e,n)=>{n=n.contact;return r.modifyContact(n)},createAppointment:(e,n)=>{var{accountName:n,appointment:i}=n;return r.createAppointment(n,i)},snoozeCalendarItem:(e,n)=>{var{appointment:n,task:i}=n;return r.snoozeCalendarItem(n,i)},dismissCalendarItem:(e,n)=>{var{appointment:n,task:i}=n;return r.dismissCalendarItem(n,i)},createAppointmentException:(e,n)=>{var{accountName:n,appointment:i}=n;return r.createAppointmentException(n,i)},modifyAppointment:(e,n)=>{var{accountName:n,appointment:i}=n;return r.modifyAppointment(n,i)},createMountpoint:(e,n)=>r.createMountpoint(n),deleteAppointment:(e,n)=>{n=n.appointment;return r.deleteAppointment(n)},checkCalendars:(e,n)=>r.checkCalendars(n.actions),counterAppointment:(e,n)=>{n=n.counterAppointmentInvite;return r.counterAppointment(n)},createCalendar:(e,n)=>{var{name:n,color:i,url:t,parentFolderId:a}=n;return r.createFolder({name:n,color:i,url:t,view:"appointment",flags:"#",parentFolderId:a})},createSharedCalendar:(e,n)=>{n=n.link;return r.createMountpoint({link:{...n,parentFolderId:1,view:"appointment",flags:"#"}})},saveDocument:(e,n)=>r.saveDocument(n),changeFolderColor:(e,n)=>r.changeFolderColor(n),declineCounterAppointment:(e,n)=>{n=n.counterAppointmentInvite;return r.declineCounterAppointment(n)},folderAction:(e,n)=>{n=n.action;return r.folderAction(n)},documentAction:(e,n)=>{n=n.action;return r.documentAction(n)},forwardAppointment:(e,n)=>{n=n.appointmentInvite;return r.forwardAppointment(n)},forwardAppointmentInvite:(e,n)=>{n=n.appointmentInvite;return r.forwardAppointmentInvite(n)},generateScratchCodes:r.generateScratchCodes,grantRights:(e,n)=>r.grantRights(n.input),sendShareNotification:(e,n)=>{n=n.shareNotification;return r.sendShareNotification(n)},sendTwoFactorAuthCode:(e,n)=>{n=n.options;return r.sendTwoFactorAuthCode(n)},testExternalAccount:(e,n)=>{n=n.externalAccount;return r.testExternalAccount(n)},addExternalAccount:(e,n)=>{n=n.externalAccount;return r.addExternalAccount(n)},modifyExternalAccount:(e,n)=>r.modifyExternalAccount(n),deleteExternalAccount:(e,n)=>r.deleteExternalAccount(n),importExternalAccount:(e,n)=>{n=n.externalAccount;return r.importExternalAccount(n)},purgeRevision:(e,n)=>r.purgeRevision(n),prefEnableOutOfOfficeAlertOnLogin:(e,n)=>{n=n.value;return r.modifyPrefs({zimbraPrefOutOfOfficeStatusAlertOnLogin:n}).then(Boolean)},prefEnableOutOfOfficeReply:(e,n)=>{n=n.value;return r.modifyPrefs({zimbraPrefOutOfOfficeReplyEnabled:n}).then(Boolean)},prefOutOfOfficeFromDate:(e,n)=>{let i=n["value"];return r.modifyPrefs({zimbraPrefOutOfOfficeFromDate:i}).then(()=>i)},prefOutOfOfficeUntilDate:(e,n)=>{let i=n["value"];return r.modifyPrefs({zimbraPrefOutOfOfficeUntilDate:i}).then(()=>i)},prefOutOfOfficeReply:(e,n)=>{let i=n["value"];return r.modifyPrefs({zimbraPrefOutOfOfficeReply:i}).then(()=>i)},createIdentity:(e,n)=>r.createIdentity(n),modifyIdentity:(e,n)=>r.modifyIdentity(n).then(Boolean),deleteIdentity:(e,n)=>r.deleteIdentity(n).then(Boolean),modifyPrefs:(e,n)=>{n=n.prefs;return r.modifyPrefs(n)},modifyProps:(e,n)=>{n=n.props;return r.modifyProps(n)},modifyZimletPrefs:(e,n)=>{n=n.zimlets;return r.modifyZimletPrefs(n)},modifyFilterRules:(e,n)=>{n=n.filters;return r.modifyFilterRules(n)},createSignature:(e,n)=>r.createSignature(n),modifySignature:(e,n)=>r.modifySignature(n),modifySearchFolder:(e,n)=>r.modifySearchFolder(n),deleteSignature:(e,n)=>r.deleteSignature(n),saveDraft:function(e,n){var{message:n,accountName:i}=n;return((2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).local?d:r).saveDraft(n,i)},sendMessage:function(e,n){var{message:n,accountName:i,sign:t=!1,encrypt:a=!1}=n;return((2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).local?d:r).sendMessage(n,i,t,a)},saveSMimeCert:(e,n)=>{var{upload:n,password:i}=n;return r.saveSMimeCert(n,i)},sendDeliveryReport:(e,n)=>{n=n.messageId;return r.sendDeliveryReport(n)},uploadMessage:(e,n)=>{n=n.value;return r.uploadMessage(n)},createTask:(e,n)=>{n=n.task;return r.createTask(n)},modifyTask:(e,n)=>{n=n.task;return r.modifyTask(n)},sendInviteReply:(e,n)=>{n=n.inviteReply;return r.sendInviteReply(n)},recoverAccount:(e,n)=>r.recoverAccount(n),resetPassword:(e,n)=>r.resetPassword(n),revokeAppSpecificPassword:(e,n)=>{n=n.appName;return r.revokeAppSpecificPassword(n)},revokeOtherTrustedDevices:r.revokeOtherTrustedDevices,revokeRights:(e,n)=>r.revokeRights(n.input),revokeTrustedDevice:r.revokeTrustedDevice,setCustomMetadata:(e,n)=>r.setCustomMetadata(n),setMailboxMetadata:(e,n)=>r.jsonRequest({name:"SetMailboxMetadata",body:{meta:{section:n.section,_attrs:mapValues(n.attrs||{},coerceBooleanToString)}}}).then(Boolean),setRecoveryAccount:(e,n)=>r.setRecoveryAccount(n),modifyWhiteBlackList:(e,n)=>{n=n.whiteBlackList;return r.modifyWhiteBlackList(n)},createTag:(e,n)=>{n=n.tag;return r.createTag(n)},tagAction:(e,n)=>{n=n.action;return r.action(Fi.tag,n)},quarantineDeviceSync:(e,n)=>{n=n.deviceId;r.quarantineDeviceSync(n)},allowDeviceSync:(e,n)=>{n=n.deviceId;r.allowDeviceSync(n)},removeDeviceSync:(e,n)=>{n=n.deviceId;r.removeDeviceSync(n)},blockDeviceSync:(e,n)=>{n=n.deviceId;r.blockDeviceSync(n)},accountOnlyRemoteWipeSync:(e,n)=>{n=n.deviceId;r.accountOnlyRemoteWipeSync(n)},cancelPendingAccountOnlyRemoteWipeSync:(e,n)=>{n=n.deviceId;r.cancelPendingAccountOnlyRemoteWipeSync(n)},remoteWipeSync:(e,n)=>{n=n.deviceId;r.remoteWipeSync(n)},cancelPendingRemoteWipeSync:(e,n)=>{n=n.deviceId;r.cancelPendingRemoteWipeSync(n)},subscribeDistributionList:(e,n)=>{var{op:n,by:i,dl:t}=n;return r.subscribeDistributionList(n,i,t)},distributionListAction:(e,n)=>{n=n.dlActions;return r.distributionListAction(n)}}}}),{client:r,schema:a}},p.entities=s,p.jsonRequest=jsonRequest,p.normalize=normalize$2,p.schema=zi,p.types=a,Object.defineProperty(p,"__esModule",{value:!0})});
27
27
  //# sourceMappingURL=zm-api-js-client.umd.js.map