@overmap-ai/core 1.0.78-view-sets.18 → 1.0.78-view-sets.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/overmap-core.js
CHANGED
|
@@ -11,5 +11,5 @@ Action:`,e);const p=ke();if(!p)throw new Error("Outbox coordinator not set");p.r
|
|
|
11
11
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
12
12
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
13
13
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
14
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(y)}const p=u.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=c??l+"."+p;if(u=fc(u,A),!u.name)throw new Error("Failed to set file's name");await this.addCache(u,l),Bt[n]=new Promise(y=>{y(u)})}return u}}class Bb extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{revisionUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,form_revision:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:y.extension,file_sha1:y.sha1,form_revision:l};r.push(P)}this.dispatch(iu(n));const o=this.enqueueRequest({description:"Attach files to form revision",method:h.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_revision),blocks:n.map(u=>u.uuid)});return o.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(cu(u.attachments))}).catch(()=>{this.dispatch(nu(n.map(u=>u.uuid)))}),[n,o.then(({attachments:u})=>u)]}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch organization form revision attachments",method:h.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]});return this.dispatch(au(s)),s}}class $b extends j{add(e){var o;const{store:s}=this.client,c=(o=s.getState().userReducer.currentUser)==null?void 0:o.id,n=T({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(wa(n));const r=this.enqueueRequest({description:"Create form revision",method:h.POST,url:"/form-revisions/",payload:v(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(hu(m))}).catch(()=>{this.dispatch(Ma(n.uuid))}),[n,r]}async refreshStore(e){const s=await this.enqueueRequest({description:"Get organization form revisions",method:h.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]});return this.dispatch(ou(s)),s}}class Gb extends j{add(e,s){var u;const{store:i}=this.client,c=new Date().toISOString(),n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,r=T({...e,submitted_at:c,created_by:n}),o=T({...s,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(ja(r)),this.dispatch(wa(o));const m=this.enqueueRequest({description:"Create form",method:h.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:o.uuid,submitted_at:o.submitted_at,title:o.title,description:o.description,fields:o.fields}},blockers:[],blocks:[r.uuid,o.uuid]});return m.catch(l=>{throw this.dispatch(qa(r.uuid)),this.dispatch(Ma(o.uuid)),l}),[r,o,m]}async delete(e){const{store:s}=this.client,i=s.getState(),c=Fu(e)(i);if(!c)throw new Error("Expected form to exist");const n=ju(e)(i);n.length>0&&this.dispatch(jt(n.map(({uuid:o})=>o)));const r=Au(e)(i);r.length>0&&this.dispatch(mu(r.map(({uuid:o})=>o))),this.dispatch(qa(e));try{return await this.enqueueRequest({description:"Delete form",method:h.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(ja(c)),r.length>0&&this.dispatch(lu(r)),n.length>0&&this.dispatch(Et(n)),o}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch organization forms",method:h.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]});return this.dispatch(Su(s)),s}}class Lb extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{submissionUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,form_submission:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:y.sha1,file_extension:y.extension,field_identifier:p,form_submission:l};r.push(P)}this.dispatch(vt(n));const o=this.enqueueRequest({description:"Attach files to form submission",method:h.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_submission),blocks:n.map(u=>u.uuid)});return o.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(_u(u.attachments))}).catch(u=>{throw this.dispatch(wt(n.map(l=>l.uuid))),u}),[n,o.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:s}=this.client,i=s.getState(),c=Ou(e)(i);this.dispatch(wt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:h.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(vt(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get form submission attachments",method:h.GET,url:"/form-submission-attachments/",queryParams:{form_submission__project:e},blockers:[],blocks:[]});return this.dispatch(Iu(s)),s}}class Nb extends j{add(e){var r;const{store:s}=this.client,i=s.getState(),c=T({...e,created_by:(r=i.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add form submission",method:h.POST,url:"/form-submissions/",payload:v(c),blockers:[e.form_revision,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return this.dispatch(Da(c)),n.then(o=>(this.dispatch(Mt(o)),o)).catch(()=>{this.dispatch(Ca(c.uuid))}),[c,n]}update(e){const{store:s}=this.client,i=s.getState(),c=$a(e.uuid)(i);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Eu(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:h.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(o=>{this.dispatch(Mt(o))}).catch(()=>{this.dispatch(Mt(c))}),[n,r]}async delete(e){const{store:s}=this.client,i=s.getState(),c=$a(e)(i);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Ru(e)(i);this.dispatch(Ca(e)),this.dispatch(wt(n.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:h.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Da(c)),this.dispatch(vt(n)),r}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch form submissions",method:h.GET,url:"/form-submissions/",queryParams:{project:e},blockers:[],blocks:[]});return this.dispatch(Mu(s)),s}}class Hb extends j{async add(e){var p;const{store:s}=this.client,{file:i,...c}=e,n=new Date().toISOString(),r=(p=s.getState().userReducer.currentUser)==null?void 0:p.id,o=c.project,m=await this.getFilePayload(i),u=T({...c,file_name:i.name,file_sha1:m.sha1,file:URL.createObjectURL(i),submitted_at:n,created_by:r});this.dispatch(ku(u));const l=this.enqueueRequest({description:"Add geo image",method:h.POST,url:"/geo-images/",payload:{uuid:u.uuid,submitted_at:n,title:u.title,description:u.description,geo_marker:u.geo_marker,canvas_marker:u.canvas_marker,sha1:u.file_sha1,project:u.project,file_name:u.file_name,direction:u.direction,original_date:u.original_date,file:m},blocks:[o],blockers:[o]});return l.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(it(A.geo_image))}).catch(()=>{this.dispatch(La(u.uuid))}),[u,l.then(A=>A.geo_image)]}async bulkAdd(e,s){var p;const{store:i}=this.client,c=new Date().toISOString(),n=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,r=[],o=[],m=[],u={};for(const A of e){const{file:y,...b}=A,P=await this.getFilePayload(y);P.sha1 in u||(u[P.sha1]=P);const _=T({...b,file_name:y.name,file_sha1:P.sha1,file:URL.createObjectURL(y),submitted_at:c,created_by:n,project:s});r.push(_),o.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(Bu(r));const l=this.enqueueRequest({description:"Bulk add geo images",method:h.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:s,geo_images:m,files:Object.values(u)},blocks:[s],blockers:o});return l.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Cu(A.geo_images))}).catch(()=>{this.dispatch(Gu(o))}),[r,l.then(A=>A.geo_images)]}update(e){const{store:s}=this.client,i=s.getState(),c=Na(e.uuid)(i);if(!c)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const n={...c,...e};this.dispatch($u(n));const r=this.enqueueRequest({description:"Update geo image",method:h.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(o=>{this.dispatch(it(o))}).catch(()=>{this.dispatch(it(c))}),[n,r]}async delete(e){const{store:s}=this.client,i=s.getState(),c=Na(e)(i);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(La(e));const n=this.enqueueRequest({description:"Delete geo image",method:h.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(it(c))}),n}async refreshStore(e){const s=await this.enqueueRequest({description:"Get geo images",method:h.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]});return this.dispatch(Du(s)),s}}class Wb extends R{add(e){var o;const{store:s}=this.client,i=new Date().toISOString(),c=(o=s.getState().userReducer.currentUser)==null?void 0:o.id,n=T({...e,submitted_at:i,created_by:c});this.dispatch(Wa(n));const r=this.enqueueRequest({description:"Add issue association",method:h.POST,url:"/issue-associations/",payload:v(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Yu(m))}).catch(()=>{this.dispatch(Ya(n.uuid))}),[n,r]}async delete(e){const{store:s}=this.client,i=Ju(e)(s.getState());if(!i)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Ya(e));const c=this.enqueueRequest({description:"Delete issue association",method:h.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Wa(i))}),c}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch issue associations",method:h.GET,url:"/issue-associations/",queryParams:{associated_issue__project:e},blockers:[],blocks:[]});return this.dispatch(Ku(s)),s}}class Kb extends Ce{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Xa);S(this,"addAttachments",Qa);S(this,"updateAttachments",so);S(this,"removeAttachments",xa);S(this,"removeAttachment",ao);S(this,"setAttachment",to);S(this,"selectAttachment",ro)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,issue:s.modelUuid})}buildAttachmentPayload(s){return{...s,issue:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.issueUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get issue attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue__project:s},blocks:[],blockers:[]});return this.dispatch(Xa(i)),i}}class Yb extends Ce{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",ti);S(this,"addAttachments",lo);S(this,"updateAttachments",mo);S(this,"removeAttachments",Ao);S(this,"removeAttachment",po);S(this,"setAttachment",ho);S(this,"selectAttachment",So)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,issue_comment:s.modelUuid})}buildAttachmentPayload(s){return{...s,issue_comment:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.issueCommentUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get issue comment attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue_comment__issue__project:s},blocks:[],blockers:[]});return this.dispatch(ti(i)),i}}class Jb extends R{add(e){var n;const{store:s}=this.client,i=T({...e,author:(n=s.getState().userReducer.currentUser)==null?void 0:n.id,submitted_at:new Date().toISOString()});this.dispatch(ai(i));const c=this.enqueueRequest({description:"Add issue comment",method:h.POST,url:"/issue-comments/",payload:v(i),blockers:[e.issue],blocks:[i.uuid]});return c.catch(()=>{this.dispatch(ci(i.uuid))}),[i,c]}update(e){const{store:s}=this.client,i=ni(e.uuid)(s.getState());if(!i)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...i,...e};this.dispatch(ii(c));const n=this.enqueueRequest({description:"Edit issue comment",method:h.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(ii(i))}),[c,n]}remove(e){const{store:s}=this.client,i=ni(e)(s.getState());if(!i)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(ci(e));const c=this.enqueueRequest({description:"Delete comment",method:h.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(ai(i))}),c}async refreshStore(e){const s=await this.enqueueRequest({description:"Get comments",method:h.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]});return this.dispatch(Po(s)),s}}class Zb extends R{add(e){var m;const{store:s}=this.client,i=s.getState(),c=new Date().toISOString(),n=(m=i.userReducer.currentUser)==null?void 0:m.id,r=T({...e,submitted_at:c,created_by:n});this.dispatch(di(r));const o=this.enqueueRequest({description:"Create issue",method:h.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return o.then(u=>{this.dispatch(qt(u))}).catch(u=>{throw this.dispatch(ui(r.uuid)),u}),[r,o]}update(e){var m;const s=this.client.store.getState(),i=li(e.uuid)(s);if(!i)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...i,...e};this.dispatch(qt(c));const n={};for(const u of[E.TITLE,E.DESCRIPTION,E.STATUS,E.CATEGORY,E.PRIORITY,E.ASSIGNED_TO,E.DUE_DATE])if(u in e&&e[u]!==i[u])switch(u){case E.PRIORITY:case E.STATUS:{const l=e[u];n[u]=l!==void 0?Number(l):null;break}case E.DUE_DATE:case E.DESCRIPTION:case E.TITLE:n[u]=e[u]??null;break;case E.CATEGORY:{let l=null;const p=e[u];if(p&&(l=s.categoryReducer.instances[p]??null,!l))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);n[u]=l?{name:l.name,color:l.color,uuid:l.uuid}:null;break}case E.ASSIGNED_TO:{let l=null;const p=e[u];if(p&&(l=s.userReducer.instances[p]??null,!l))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);n[u]=l?{full_name:l.username,id:l.id}:null;break}}const r=T({created_by:(m=s.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:i.uuid,changes:n});this.dispatch(bl(r));const o=this.enqueueRequest({description:"Edit issue",method:h.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return o.catch(()=>{this.dispatch(qt(i)),this.dispatch(Fl(r.uuid))}),[c,o]}async remove(e){const{store:s}=this.client,i=s.getState(),c=li(e)(i);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=no(e)(i),r=_l(e)(i),o=qu(e)(i),m={};for(const l of Zu(e)(i))m[l.uuid]=l;for(const l of Xu(e)(i))m[l.uuid]=l;const u=Object.values(m);this.dispatch(ui(e)),n.length>0&&this.dispatch(xa(n.map(({uuid:l})=>l))),r.length>0&&this.dispatch(Tl(r.map(({uuid:l})=>l))),o.length>0&&this.dispatch(jt(o.map(({uuid:l})=>l))),u.length>0&&this.dispatch(Ja(u.map(({uuid:l})=>l)));try{return await this.enqueueRequest({description:"Delete issue",method:h.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(di(c)),this.dispatch(Qa(n)),this.dispatch(Pl(r)),this.dispatch(Et(o)),this.dispatch(Ka(u)),l}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get issues",method:h.GET,url:"/issues/",queryParams:{project:e},blockers:[],blocks:[]});return this.dispatch(_o(s)),s}}class Xb extends Ce{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",mi);S(this,"addAttachments",Mo);S(this,"updateAttachments",jo);S(this,"removeAttachments",Vo);S(this,"removeAttachment",qo);S(this,"setAttachment",Eo);S(this,"selectAttachment",Do)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,issue_type:s.modelUuid})}buildAttachmentPayload(s){return{...s,issue_type:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.issueTypeUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get issue type attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue_type__organization:s},blocks:[],blockers:[]});return this.dispatch(mi(i)),i}}class Qb extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,fields_revision:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_extension:y.extension,field_identifier:p,file_sha1:y.sha1,fields_revision:l};r.push(P)}this.dispatch($o(n));const o=this.enqueueRequest({description:"Add issue type fields attachments",method:h.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return o.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Go(u.attachments))}).catch(()=>{this.dispatch(Lo(n.map(u=>u.uuid)))}),[n,o.then(({attachments:u})=>u)]}async refreshStore(e){const s=await this.enqueueRequest({description:"get issue type fields attachments",method:h.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]});return this.dispatch(Bo(s)),s}}class xb extends R{add(e){var o;const{store:s}=this.client,i=(o=s.getState().userReducer.currentUser)==null?void 0:o.id,c=new Date().toISOString(),n=T({...e,created_by:i,submitted_at:c});this.dispatch(xo(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:h.POST,url:"/issue-type-fields/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(el(m))}).catch(m=>{throw this.dispatch(tl(n.uuid)),m}),[n,r]}async refreshStore(e){const s=await this.enqueueRequest({description:"Get Issue Type Fields",method:h.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]});return this.dispatch(Qo(s)),s}}class eP extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldValuesUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,field_values:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:y.sha1,file_extension:y.extension,field_identifier:p,field_values:l};r.push(P)}this.dispatch(zt(n));const o=this.enqueueRequest({description:"Add issue type field values attachments",method:h.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.field_values),blocks:n.map(u=>u.uuid)});return o.then(({presigned_urls:u,attachments:l})=>{this.processPresignedUrls(u),this.dispatch(nl(l))}).catch(u=>{throw this.dispatch(Ut(n.map(l=>l.uuid))),u}),[n,o.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:s}=this.client,i=s.getState(),c=dl(e)(i);this.dispatch(Ut(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:h.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(zt(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get issue type field values attachments",method:h.GET,url:"/issue-type-field-values-attachments/",queryParams:{field_values__issue__project:e},blockers:[],blocks:[]});return this.dispatch(cl(s)),s}}class tP extends R{add(e){var r;const{store:s}=this.client,i=s.getState(),c=T({...e,created_by:(r=i.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add issue type field values",method:h.POST,url:"/issue-type-field-values/",payload:v(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(yi(c)),n.then(o=>(this.dispatch(nt(o)),o)).catch(()=>{this.dispatch(fi(c.uuid))}),[c,n]}update(e){const{store:s}=this.client,i=s.getState(),c=gi(e.uuid)(i);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(nt(n));const r=this.enqueueRequest({description:"Update issue type field values",method:h.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(o=>{this.dispatch(nt(o))}).catch(()=>{this.dispatch(nt(c))}),[n,r]}async delete(e){const{store:s}=this.client,i=s.getState(),c=gi(e)(i);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ul(e)(i);this.dispatch(fi(e)),this.dispatch(Ut(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:h.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(yi(c)),this.dispatch(zt(n)),r}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get issue type field values",method:h.GET,url:"/issue-type-field-values/",queryParams:{issue__project:e},blockers:[],blocks:[]});return this.dispatch(Yo(s)),s}}class sP extends R{add(e){var r;const{store:s}=this.client,i=s.getState(),c=T({...e,submitted_at:new Date().toISOString(),created_by:(r=i.userReducer.currentUser)==null?void 0:r.id});this.dispatch(ml(c));const n=this.enqueueRequest({method:h.POST,url:"/issue-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return n.then(o=>{this.dispatch(rt(o))}).catch(()=>{this.dispatch(Ii(c.uuid))}),[c,n]}update(e){const{store:s}=this.client,i=s.getState(),c=_i(e.uuid)(i);if(!c)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const n={...c,...e};this.dispatch(pl(n));const r=this.enqueueRequest({method:h.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(o=>{this.dispatch(rt(o))}).catch(()=>{this.dispatch(rt(c))}),[n,r]}delete(e){const{store:s}=this.client,i=s.getState(),c=_i(e)(i);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=Oi(e)(i);this.dispatch(Ii(e)),this.dispatch(Ro(n.map(o=>o.uuid)));const r=this.enqueueRequest({method:h.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(rt(c)),this.dispatch(Oo(n))}),r}async refreshStore(e){const s=await this.enqueueRequest({method:h.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]});return this.dispatch(hl(s)),s}}class aP extends R{async refreshStore(e){const s=await this.enqueueRequest({description:"Get issue updates",method:h.GET,url:"/issue-updates/",queryParams:{issue__project:e},blockers:[],blocks:[]});return this.dispatch(gl(s)),s}}const iP=1800;function cP(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class nP extends ub{constructor(){super(...arguments);S(this,"_getRenewedTokens",async s=>{const i=this.enqueueRequest({description:"Get renewed tokens",method:h.POST,url:this.refreshTokensUrl,payload:{refresh:s},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let c;try{c=await i}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Sd(!1)),this.clearTokens(),this.dispatch(F),this.dispatch(F)}async renewTokens(){const s=this.getRefreshToken();if(!s)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const i=await this._getRenewedTokens(s);if(!i)return;console.log("Got renewed tokens"),this.setTokens(i)}catch(i){throw console.error("Could not renew tokens; clearing auth",i),this.clearAuth(),i}}tokenIsExpiringSoon(){const s=this.getAccessToken();if(!s)return!1;const i=Date.now()/1e3;let c;try{c=ym(s).exp??i}catch{c=i}return c-i<iP}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(s){return s instanceof U&&this.clearAuth(),s instanceof Error?Promise.reject(s):Promise.reject(new Error((s??We).toString()))}}}async handleUnauthorized(s,i){const c=this.client.store.getState();if(s.url.endsWith("/token/refresh/"))throw c.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new U({message:"You have been signed out due to inactivity.",response:i,discard:!0});if(c.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new U({message:"Incorrect username or password.",response:i,discard:!0})}async initAuth(s){const i=Le.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:i,description:"Get token pair",method:h.POST,url:this.initTokensUrl,payload:s,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(c=>{this.setTokens(cP(c))})}}class rP extends R{update(e){const{store:s}=this.client,i=ji(e.uuid)(s.getState()),c={...i,...e};this.dispatch(Ct(c));const n=this.enqueueRequest({description:"Edit organization access",method:h.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Ct(r))}).catch(r=>{throw this.dispatch(Ct(i)),r}),[c,n]}async remove(e){const{store:s}=this.client,i=s.getState(),c=ji(e)(i),n=ql(c.user)(i);this.dispatch(Dl(c.uuid)),this.dispatch(Ml(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:h.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(Ul(c)),this.dispatch(wl(n)),r}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get organization accesses",method:h.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]});return this.dispatch(zl(s)),s}}class dP extends R{async add(e){const s=await this.enqueueRequest({description:"Create organization",method:h.POST,url:"/organizations/",payload:{name:e},blockers:[],blocks:[]});return this.dispatch(Gl(s)),s}async update(e){const s=await this.enqueueRequest({description:"Edit organization",method:h.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(Ll(s)),s}async invite(e,s){return this.enqueueRequest({description:"Invite user to organization",method:h.POST,url:`/organizations/${e}/invite/${s}/`,blockers:[],blocks:[]})}async refreshStore(){const e=await this.enqueueRequest({description:"Fetch organizations",method:h.GET,url:"/organizations/",blockers:[],blocks:[]});return this.dispatch($l(e)),e}}class uP extends R{add(e){const s=T(e);this.dispatch(Ui(s));const i=this.enqueueRequest({description:"Add project access",method:h.POST,url:"/project-accesses/",payload:v(s),blockers:[s.organization_access,s.project],blocks:[s.uuid]});return i.then(c=>{this.dispatch(dt(c))}).catch(c=>{throw this.dispatch(Di(s.uuid)),c}),[s,i]}update(e){const{store:s}=this.client,i=ki(e.uuid)(s.getState()),c={...i,...e};this.dispatch(dt(c));const n=this.enqueueRequest({description:"Edit project access",method:h.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(dt(r))}).catch(r=>{throw this.dispatch(dt(i)),r}),[c,n]}async remove(e){const{store:s}=this.client,i=ki(e)(s.getState());this.dispatch(Di(e));try{await this.enqueueRequest({description:"Delete project access",method:h.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ui(i)),c}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get project accesses",method:h.GET,url:"/project-accesses/",queryParams:{project__organization_owner:e},blockers:[],blocks:[]});return this.dispatch(xl(s)),s}}class oP extends Ce{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",nh);S(this,"updateAttachments",uh);S(this,"removeAttachments",$i);S(this,"removeAttachment",oh);S(this,"setAttachment",rh);S(this,"selectAttachment",mh)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,project:s.modelUuid})}buildAttachmentPayload(s){return{...s,project:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.projectUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get project attachments",method:h.GET,url:`${this.url}/`,queryParams:{project__organization_owner:s},blockers:[],blocks:[]});return this.dispatch(ch(i)),i}}class lP extends R{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const s={...e};delete s.file;const i=this.enqueueRequest({method:h.PATCH,url:`/project-files/${e.uuid}/`,payload:s,blockers:[e.uuid],blocks:[e.uuid]});return i.then(c=>{this.dispatch(Li(c))}),i}saveActive(){const{store:e}=this.client,s=e.getState(),i=s.projectFileReducer.activeProjectFileId;if(!i)throw new Error("No active project file");const c=s.projectFileReducer.instances[i];if(!c)throw new Error("No active project file");if(!c.bounds&&!c.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let n;if(typeof c.file=="string"&&!c.file.startsWith("blob:")){const m={...c};delete m.file,n={method:h.PATCH,url:`/project-files/${i}/`,payload:m,blockers:[i],blocks:[i]}}else n=new Promise((m,u)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([l])=>{m({method:h.POST,url:`/project-files${c.project}/`,payload:{...c,...l},blockers:[i],blocks:[i]})}).catch(u)});const o=Promise.resolve(n).then(m=>this.enqueueRequest(m));return o.then(m=>{this.dispatch(Li(m))}),this.dispatch(Th),this.dispatch(Fh(null)),this.dispatch(Ph(!1)),[c,o]}delete(e){return this.dispatch(gh(e)),this.enqueueRequest({method:h.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e){const s=await this.enqueueRequest({description:"Get project files",method:h.GET,url:"/project-files/",queryParams:{project:e},blockers:[],blocks:[]});return this.dispatch(fh(s)),s}}class hP extends R{async add(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return await this.enqueueRequest({description:"Create project",method:h.POST,url:"/projects/",payload:{name:e.name,bounds:e.bounds,organization_owner:e.organization_owner},blockers:[],blocks:[]})}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch(Mh(e)),await this.enqueueRequest({description:"Update project",method:h.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:s}=this.client,i=s.getState(),c=qh(e)(i);if(!c)throw new Error("Expected project to exist");const n=_h(i).filter(m=>m.project===e);this.dispatch(bh(n.map(({uuid:m})=>m)));const r=ph(c.uuid)(i);this.dispatch($i(r.map(({uuid:m})=>m)));const o=ah(e)(i);this.dispatch(th(o.map(({uuid:m})=>m))),this.dispatch(Hi(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:h.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Hi(c.uuid))}catch(m){throw this.dispatch(wh(c)),this.dispatch(eh(Object.values(o))),this.dispatch(Sh(n)),this.dispatch(dh(r)),m}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch projects",method:h.GET,url:"/projects/",queryParams:{organization_owner:e},blockers:[],blocks:[]});return this.dispatch(vh(s)),s}}class mP extends R{add(e){const s=T(e);this.dispatch(Dh(s));const i=this.enqueueRequest({description:"Create team membership",method:h.POST,url:"/team-memberships/",payload:v(s),blockers:[e.team],blocks:[s.uuid]});return i.then(c=>{this.dispatch(Ji(c))}).catch(()=>{this.dispatch(Zi(s.uuid))}),[s,i]}async delete(e){const{store:s}=this.client,i=s.getState(),c=Bh(e)(i);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Zi(e));try{return await this.enqueueRequest({description:"Delete team membership",method:h.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(Ji(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch team memberships",method:h.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]});return this.dispatch(Uh(s)),s}}class pP extends R{add(e){const s=T({...e,submitted_at:new Date().toISOString()});this.dispatch(Lh(s));const i=this.enqueueRequest({description:"Create team",method:h.POST,url:"/teams/",payload:v(s),blockers:[],blocks:[s.uuid]});return i.then(c=>{this.dispatch(ut(c))}).catch(()=>{this.dispatch(xi(s.uuid))}),[s,i]}update(e){const{store:s}=this.client,i=tc(e.uuid)(s.getState());if(!i)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...i,...e};this.dispatch(Nh(c));const n=this.enqueueRequest({description:"Update team",method:h.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ut(i))}),[c,n]}async delete(e){const{store:s}=this.client,i=s.getState(),c=tc(e)(i);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(xi(e));try{return await this.enqueueRequest({description:"Delete team",method:h.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(ut(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch teams",method:h.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]});return this.dispatch(Gh(s)),s}}class AP extends R{async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch organization users",method:h.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]});return this.dispatch(vl(s)),s}}class yP{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,s,i){return this._enqueueRequest(e,s,i).then(c=>{if(c instanceof U)throw c;return c})}_enqueueRequest(e,s,i){const c=new Ac,n={...e,BASE_URL:s,serviceName:i};if(e.immediate){const r={...n,uuid:e.uuid??Le.v4()},o={payload:r,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:r,BASE_URL:s,serviceName:i}}}};ic(o,this).then(m=>{c.resolve(m.body)}).catch(m=>{cc(m,o),m instanceof Error?c.reject(m):c.reject(new Error((m??We).toString()))})}else{const r=this.store.dispatch(Yl(n)),o=u=>{if(u)c.resolve(u.body);else{const l=new U({message:"Could not get a response from the server.",response:u,discard:!0});c.reject(l)}},m=u=>{u instanceof U?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(y)}const p=u.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=c??l+"."+p;if(u=fc(u,A),!u.name)throw new Error("Failed to set file's name");await this.addCache(u,l),Bt[n]=new Promise(y=>{y(u)})}return u}}class Bb extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{revisionUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,form_revision:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:y.extension,file_sha1:y.sha1,form_revision:l};r.push(P)}this.dispatch(iu(n));const o=this.enqueueRequest({description:"Attach files to form revision",method:h.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_revision),blocks:n.map(u=>u.uuid)});return o.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(cu(u.attachments))}).catch(()=>{this.dispatch(nu(n.map(u=>u.uuid)))}),[n,o.then(({attachments:u})=>u)]}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch organization form revision attachments",method:h.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]});return this.dispatch(au(s)),s}}class $b extends j{add(e){var o;const{store:s}=this.client,c=(o=s.getState().userReducer.currentUser)==null?void 0:o.id,n=T({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(wa(n));const r=this.enqueueRequest({description:"Create form revision",method:h.POST,url:"/form-revisions/",payload:v(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(hu(m))}).catch(()=>{this.dispatch(Ma(n.uuid))}),[n,r]}async refreshStore(e){const s=await this.enqueueRequest({description:"Get organization form revisions",method:h.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]});return this.dispatch(ou(s)),s}}class Gb extends j{add(e,s){var u;const{store:i}=this.client,c=new Date().toISOString(),n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,r=T({...e,submitted_at:c,created_by:n}),o=T({...s,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(ja(r)),this.dispatch(wa(o));const m=this.enqueueRequest({description:"Create form",method:h.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:o.uuid,submitted_at:o.submitted_at,title:o.title,description:o.description,fields:o.fields}},blockers:[],blocks:[r.uuid,o.uuid]});return m.catch(l=>{throw this.dispatch(qa(r.uuid)),this.dispatch(Ma(o.uuid)),l}),[r,o,m]}async delete(e){const{store:s}=this.client,i=s.getState(),c=Fu(e)(i);if(!c)throw new Error("Expected form to exist");const n=ju(e)(i);n.length>0&&this.dispatch(jt(n.map(({uuid:o})=>o)));const r=Au(e)(i);r.length>0&&this.dispatch(mu(r.map(({uuid:o})=>o))),this.dispatch(qa(e));try{return await this.enqueueRequest({description:"Delete form",method:h.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(ja(c)),r.length>0&&this.dispatch(lu(r)),n.length>0&&this.dispatch(Et(n)),o}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch organization forms",method:h.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]});return this.dispatch(Su(s)),s}}class Lb extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{submissionUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,form_submission:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:y.sha1,file_extension:y.extension,field_identifier:p,form_submission:l};r.push(P)}this.dispatch(vt(n));const o=this.enqueueRequest({description:"Attach files to form submission",method:h.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_submission),blocks:n.map(u=>u.uuid)});return o.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(_u(u.attachments))}).catch(u=>{throw this.dispatch(wt(n.map(l=>l.uuid))),u}),[n,o.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:s}=this.client,i=s.getState(),c=Ou(e)(i);this.dispatch(wt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:h.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(vt(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get form submission attachments",method:h.GET,url:"/form-submission-attachments/",queryParams:{form_submission__project:e},blockers:[],blocks:[]});return this.dispatch(Iu(s)),s}}class Nb extends j{add(e){var r;const{store:s}=this.client,i=s.getState(),c=T({...e,created_by:(r=i.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add form submission",method:h.POST,url:"/form-submissions/",payload:v(c),blockers:[e.form_revision,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return this.dispatch(Da(c)),n.then(o=>(this.dispatch(Mt(o)),o)).catch(()=>{this.dispatch(Ca(c.uuid))}),[c,n]}update(e){const{store:s}=this.client,i=s.getState(),c=$a(e.uuid)(i);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Eu(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:h.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(o=>{this.dispatch(Mt(o))}).catch(()=>{this.dispatch(Mt(c))}),[n,r]}async delete(e){const{store:s}=this.client,i=s.getState(),c=$a(e)(i);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Ru(e)(i);this.dispatch(Ca(e)),this.dispatch(wt(n.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:h.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Da(c)),this.dispatch(vt(n)),r}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch form submissions",method:h.GET,url:"/form-submissions/",queryParams:{project:e},blockers:[],blocks:[]});return this.dispatch(Mu(s)),s}}class Hb extends j{async add(e){var p;const{store:s}=this.client,{file:i,...c}=e,n=new Date().toISOString(),r=(p=s.getState().userReducer.currentUser)==null?void 0:p.id,o=c.project,m=await this.getFilePayload(i),u=T({...c,file_name:i.name,file_sha1:m.sha1,file:URL.createObjectURL(i),submitted_at:n,created_by:r});this.dispatch(ku(u));const l=this.enqueueRequest({description:"Add geo image",method:h.POST,url:"/geo-images/",payload:{uuid:u.uuid,submitted_at:n,title:u.title,description:u.description,geo_marker:u.geo_marker,canvas_marker:u.canvas_marker,sha1:u.file_sha1,project:u.project,file_name:u.file_name,direction:u.direction,original_date:u.original_date,file:m},blocks:[o],blockers:[o]});return l.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(it(A.geo_image))}).catch(()=>{this.dispatch(La(u.uuid))}),[u,l.then(A=>A.geo_image)]}async bulkAdd(e,s){var p;const{store:i}=this.client,c=new Date().toISOString(),n=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,r=[],o=[],m=[],u={};for(const A of e){const{file:y,...b}=A,P=await this.getFilePayload(y);P.sha1 in u||(u[P.sha1]=P);const _=T({...b,file_name:y.name,file_sha1:P.sha1,file:URL.createObjectURL(y),submitted_at:c,created_by:n,project:s});r.push(_),o.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(Bu(r));const l=this.enqueueRequest({description:"Bulk add geo images",method:h.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:s,geo_images:m,files:Object.values(u)},blocks:[s],blockers:o});return l.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Cu(A.geo_images))}).catch(()=>{this.dispatch(Gu(o))}),[r,l.then(A=>A.geo_images)]}update(e){const{store:s}=this.client,i=s.getState(),c=Na(e.uuid)(i);if(!c)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const n={...c,...e};this.dispatch($u(n));const r=this.enqueueRequest({description:"Update geo image",method:h.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(o=>{this.dispatch(it(o))}).catch(()=>{this.dispatch(it(c))}),[n,r]}async delete(e){const{store:s}=this.client,i=s.getState(),c=Na(e)(i);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(La(e));const n=this.enqueueRequest({description:"Delete geo image",method:h.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(it(c))}),n}async refreshStore(e){const s=await this.enqueueRequest({description:"Get geo images",method:h.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]});return this.dispatch(Du(s)),s}}class Wb extends R{add(e){var o;const{store:s}=this.client,i=new Date().toISOString(),c=(o=s.getState().userReducer.currentUser)==null?void 0:o.id,n=T({...e,submitted_at:i,created_by:c});this.dispatch(Wa(n));const r=this.enqueueRequest({description:"Add issue association",method:h.POST,url:"/issue-associations/",payload:v(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Yu(m))}).catch(()=>{this.dispatch(Ya(n.uuid))}),[n,r]}async delete(e){const{store:s}=this.client,i=Ju(e)(s.getState());if(!i)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Ya(e));const c=this.enqueueRequest({description:"Delete issue association",method:h.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Wa(i))}),c}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch issue associations",method:h.GET,url:"/issue-associations/",queryParams:{associated_issue__project:e},blockers:[],blocks:[]});return this.dispatch(Ku(s)),s}}class Kb extends Ce{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Xa);S(this,"addAttachments",Qa);S(this,"updateAttachments",so);S(this,"removeAttachments",xa);S(this,"removeAttachment",ao);S(this,"setAttachment",to);S(this,"selectAttachment",ro)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,issue:s.modelUuid})}buildAttachmentPayload(s){return{...s,issue:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.issueUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get issue attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue__project:s},blocks:[],blockers:[]});return this.dispatch(Xa(i)),i}}class Yb extends Ce{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",ti);S(this,"addAttachments",lo);S(this,"updateAttachments",mo);S(this,"removeAttachments",Ao);S(this,"removeAttachment",po);S(this,"setAttachment",ho);S(this,"selectAttachment",So)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,issue_comment:s.modelUuid})}buildAttachmentPayload(s){return{...s,issue_comment:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.issueCommentUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get issue comment attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue_comment__issue__project:s},blocks:[],blockers:[]});return this.dispatch(ti(i)),i}}class Jb extends R{add(e){var n;const{store:s}=this.client,i=T({...e,author:(n=s.getState().userReducer.currentUser)==null?void 0:n.id,submitted_at:new Date().toISOString()});this.dispatch(ai(i));const c=this.enqueueRequest({description:"Add issue comment",method:h.POST,url:"/issue-comments/",payload:v(i),blockers:[e.issue],blocks:[i.uuid]});return c.catch(()=>{this.dispatch(ci(i.uuid))}),[i,c]}update(e){const{store:s}=this.client,i=ni(e.uuid)(s.getState());if(!i)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...i,...e};this.dispatch(ii(c));const n=this.enqueueRequest({description:"Edit issue comment",method:h.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(ii(i))}),[c,n]}remove(e){const{store:s}=this.client,i=ni(e)(s.getState());if(!i)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(ci(e));const c=this.enqueueRequest({description:"Delete comment",method:h.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(ai(i))}),c}async refreshStore(e){const s=await this.enqueueRequest({description:"Get comments",method:h.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]});return this.dispatch(Po(s)),s}}class Zb extends R{add(e){var m;const{store:s}=this.client,i=s.getState(),c=new Date().toISOString(),n=(m=i.userReducer.currentUser)==null?void 0:m.id,r=T({...e,submitted_at:c,created_by:n});this.dispatch(di(r));const o=this.enqueueRequest({description:"Create issue",method:h.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return o.then(u=>{this.dispatch(qt(u))}).catch(u=>{throw this.dispatch(ui(r.uuid)),u}),[r,o]}update(e){var m;const s=this.client.store.getState(),i=li(e.uuid)(s);if(!i)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...i,...e};this.dispatch(qt(c));const n={};for(const u of[E.TITLE,E.DESCRIPTION,E.STATUS,E.CATEGORY,E.PRIORITY,E.ASSIGNED_TO,E.DUE_DATE])if(u in e&&e[u]!==i[u])switch(u){case E.PRIORITY:case E.STATUS:{const l=e[u];n[u]=l!==void 0?Number(l):null;break}case E.DUE_DATE:case E.DESCRIPTION:case E.TITLE:n[u]=e[u]??null;break;case E.CATEGORY:{let l=null;const p=e[u];if(p&&(l=s.categoryReducer.instances[p]??null,!l))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);n[u]=l?{name:l.name,color:l.color,uuid:l.uuid}:null;break}case E.ASSIGNED_TO:{let l=null;const p=e[u];if(p&&(l=s.userReducer.instances[p]??null,!l))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);n[u]=l?{full_name:l.username,id:l.id}:null;break}}const r=T({created_by:(m=s.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:i.uuid,changes:n});this.dispatch(bl(r));const o=this.enqueueRequest({description:"Edit issue",method:h.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return o.catch(()=>{this.dispatch(qt(i)),this.dispatch(Fl(r.uuid))}),[c,o]}async remove(e){const{store:s}=this.client,i=s.getState(),c=li(e)(i);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=no(e)(i),r=_l(e)(i),o=qu(e)(i),m={};for(const l of Zu(e)(i))m[l.uuid]=l;for(const l of Xu(e)(i))m[l.uuid]=l;const u=Object.values(m);this.dispatch(ui(e)),n.length>0&&this.dispatch(xa(n.map(({uuid:l})=>l))),r.length>0&&this.dispatch(Tl(r.map(({uuid:l})=>l))),o.length>0&&this.dispatch(jt(o.map(({uuid:l})=>l))),u.length>0&&this.dispatch(Ja(u.map(({uuid:l})=>l)));try{return await this.enqueueRequest({description:"Delete issue",method:h.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(di(c)),this.dispatch(Qa(n)),this.dispatch(Pl(r)),this.dispatch(Et(o)),this.dispatch(Ka(u)),l}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get issues",method:h.GET,url:"/issues/",queryParams:{project:e},blockers:[],blocks:[]});return this.dispatch(_o(s)),s}}class Xb extends Ce{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",mi);S(this,"addAttachments",Mo);S(this,"updateAttachments",jo);S(this,"removeAttachments",Vo);S(this,"removeAttachment",qo);S(this,"setAttachment",Eo);S(this,"selectAttachment",Do)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,issue_type:s.modelUuid})}buildAttachmentPayload(s){return{...s,issue_type:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.issueTypeUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get issue type attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue_type__organization:s},blocks:[],blockers:[]});return this.dispatch(mi(i)),i}}class Qb extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,fields_revision:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_extension:y.extension,field_identifier:p,file_sha1:y.sha1,fields_revision:l};r.push(P)}this.dispatch($o(n));const o=this.enqueueRequest({description:"Add issue type fields attachments",method:h.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return o.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Go(u.attachments))}).catch(()=>{this.dispatch(Lo(n.map(u=>u.uuid)))}),[n,o.then(({attachments:u})=>u)]}async refreshStore(e){const s=await this.enqueueRequest({description:"get issue type fields attachments",method:h.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]});return this.dispatch(Bo(s)),s}}class xb extends R{add(e){var o;const{store:s}=this.client,i=(o=s.getState().userReducer.currentUser)==null?void 0:o.id,c=new Date().toISOString(),n=T({...e,created_by:i,submitted_at:c});this.dispatch(xo(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:h.POST,url:"/issue-type-fields/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(el(m))}).catch(m=>{throw this.dispatch(tl(n.uuid)),m}),[n,r]}async refreshStore(e){const s=await this.enqueueRequest({description:"Get Issue Type Fields",method:h.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]});return this.dispatch(Qo(s)),s}}class eP extends j{async bulkAdd(e){var m;const s=new Date().toISOString(),i=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldValuesUuid:l,fieldIdentifier:p,file:A}=u,y=await this.getFilePayload(A);y.sha1 in c||(c[y.sha1]=y);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:i,field_values:l,submitted_at:s,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:y.sha1,file_extension:y.extension,field_identifier:p,field_values:l};r.push(P)}this.dispatch(zt(n));const o=this.enqueueRequest({description:"Add issue type field values attachments",method:h.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:s,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.field_values),blocks:n.map(u=>u.uuid)});return o.then(({presigned_urls:u,attachments:l})=>{this.processPresignedUrls(u),this.dispatch(nl(l))}).catch(u=>{throw this.dispatch(Ut(n.map(l=>l.uuid))),u}),[n,o.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:s}=this.client,i=s.getState(),c=dl(e)(i);this.dispatch(Ut(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:h.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(zt(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get issue type field values attachments",method:h.GET,url:"/issue-type-field-values-attachments/",queryParams:{field_values__issue__project:e},blockers:[],blocks:[]});return this.dispatch(cl(s)),s}}class tP extends R{add(e){var r;const{store:s}=this.client,i=s.getState(),c=T({...e,created_by:(r=i.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add issue type field values",method:h.POST,url:"/issue-type-field-values/",payload:v(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(yi(c)),n.then(o=>(this.dispatch(nt(o)),o)).catch(()=>{this.dispatch(fi(c.uuid))}),[c,n]}update(e){const{store:s}=this.client,i=s.getState(),c=gi(e.uuid)(i);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(nt(n));const r=this.enqueueRequest({description:"Update issue type field values",method:h.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(o=>{this.dispatch(nt(o))}).catch(()=>{this.dispatch(nt(c))}),[n,r]}async delete(e){const{store:s}=this.client,i=s.getState(),c=gi(e)(i);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ul(e)(i);this.dispatch(fi(e)),this.dispatch(Ut(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:h.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(yi(c)),this.dispatch(zt(n)),r}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get issue type field values",method:h.GET,url:"/issue-type-field-values/",queryParams:{issue__project:e},blockers:[],blocks:[]});return this.dispatch(Yo(s)),s}}class sP extends R{add(e){var r;const{store:s}=this.client,i=s.getState(),c=T({...e,submitted_at:new Date().toISOString(),created_by:(r=i.userReducer.currentUser)==null?void 0:r.id});this.dispatch(ml(c));const n=this.enqueueRequest({method:h.POST,url:"/issue-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return n.then(o=>{this.dispatch(rt(o))}).catch(()=>{this.dispatch(Ii(c.uuid))}),[c,n]}update(e){const{store:s}=this.client,i=s.getState(),c=_i(e.uuid)(i);if(!c)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const n={...c,...e};this.dispatch(pl(n));const r=this.enqueueRequest({method:h.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(o=>{this.dispatch(rt(o))}).catch(()=>{this.dispatch(rt(c))}),[n,r]}delete(e){const{store:s}=this.client,i=s.getState(),c=_i(e)(i);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=Oi(e)(i);this.dispatch(Ii(e)),this.dispatch(Ro(n.map(o=>o.uuid)));const r=this.enqueueRequest({method:h.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(rt(c)),this.dispatch(Oo(n))}),r}async refreshStore(e){const s=await this.enqueueRequest({method:h.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]});return this.dispatch(hl(s)),s}}class aP extends R{async refreshStore(e){const s=await this.enqueueRequest({description:"Get issue updates",method:h.GET,url:"/issue-updates/",queryParams:{issue__project:e},blockers:[],blocks:[]});return this.dispatch(gl(s)),s}}const iP=1800;function cP(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class nP extends ub{constructor(){super(...arguments);S(this,"_getRenewedTokens",async s=>{const i=this.enqueueRequest({description:"Get renewed tokens",method:h.POST,url:this.refreshTokensUrl,payload:{refresh:s},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let c;try{c=await i}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Sd(!1)),this.clearTokens(),this.dispatch(F),this.dispatch(F)}async renewTokens(){const s=this.getRefreshToken();if(!s)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const i=await this._getRenewedTokens(s);if(!i)return;console.log("Got renewed tokens"),this.setTokens(i)}catch(i){throw console.error("Could not renew tokens; clearing auth",i),this.clearAuth(),i}}tokenIsExpiringSoon(){const s=this.getAccessToken();if(!s)return!1;const i=Date.now()/1e3;let c;try{c=ym(s).exp??i}catch{c=i}return c-i<iP}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(s){return s instanceof U&&this.clearAuth(),s instanceof Error?Promise.reject(s):Promise.reject(new Error((s??We).toString()))}}}async handleUnauthorized(s,i){const c=this.client.store.getState();if(s.url.endsWith("/token/refresh/"))throw c.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new U({message:"You have been signed out due to inactivity.",response:i,discard:!0});if(c.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new U({message:"Incorrect username or password.",response:i,discard:!0})}async initAuth(s){const i=Le.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:i,description:"Get token pair",method:h.POST,url:this.initTokensUrl,payload:s,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(c=>{this.setTokens(cP(c))})}}class rP extends R{update(e){const{store:s}=this.client,i=ji(e.uuid)(s.getState()),c={...i,...e};this.dispatch(Ct(c));const n=this.enqueueRequest({description:"Edit organization access",method:h.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Ct(r))}).catch(r=>{throw this.dispatch(Ct(i)),r}),[c,n]}async remove(e){const{store:s}=this.client,i=s.getState(),c=ji(e)(i),n=ql(c.user)(i);this.dispatch(Dl(c.uuid)),this.dispatch(Ml(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:h.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(Ul(c)),this.dispatch(wl(n)),r}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get organization accesses",method:h.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]});return this.dispatch(zl(s)),s}}class dP extends R{async add(e){const s=await this.enqueueRequest({description:"Create organization",method:h.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(Gl(s)),s}async update(e){const s=await this.enqueueRequest({description:"Edit organization",method:h.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(Ll(s)),s}async invite(e,s){return this.enqueueRequest({description:"Invite user to organization",method:h.POST,url:`/organizations/${e}/invite/${s}/`,blockers:[],blocks:[]})}async refreshStore(){const e=await this.enqueueRequest({description:"Fetch organizations",method:h.GET,url:"/organizations/",blockers:[],blocks:[]});return this.dispatch($l(e)),e}}class uP extends R{add(e){const s=T(e);this.dispatch(Ui(s));const i=this.enqueueRequest({description:"Add project access",method:h.POST,url:"/project-accesses/",payload:v(s),blockers:[s.organization_access,s.project],blocks:[s.uuid]});return i.then(c=>{this.dispatch(dt(c))}).catch(c=>{throw this.dispatch(Di(s.uuid)),c}),[s,i]}update(e){const{store:s}=this.client,i=ki(e.uuid)(s.getState()),c={...i,...e};this.dispatch(dt(c));const n=this.enqueueRequest({description:"Edit project access",method:h.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(dt(r))}).catch(r=>{throw this.dispatch(dt(i)),r}),[c,n]}async remove(e){const{store:s}=this.client,i=ki(e)(s.getState());this.dispatch(Di(e));try{await this.enqueueRequest({description:"Delete project access",method:h.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ui(i)),c}}async refreshStore(e){const s=await this.enqueueRequest({description:"Get project accesses",method:h.GET,url:"/project-accesses/",queryParams:{project__organization_owner:e},blockers:[],blocks:[]});return this.dispatch(xl(s)),s}}class oP extends Ce{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",nh);S(this,"updateAttachments",uh);S(this,"removeAttachments",$i);S(this,"removeAttachment",oh);S(this,"setAttachment",rh);S(this,"selectAttachment",mh)}buildOfflineAttachment(s){return T({file:URL.createObjectURL(s.file),file_sha1:s.file_sha1,created_by:s.created_by,file_name:s.file.name,file_type:s.file.type,submitted_at:s.submitted_at,description:s.description,project:s.modelUuid})}buildAttachmentPayload(s){return{...s,project:s.modelUuid}}async bulkAdd(s){return this._bulkAdd(s.map(i=>({modelUuid:i.projectUuid,file:i.file})))}async delete(s){return this._delete(s)}async refreshStore(s){const i=await this.enqueueRequest({description:"Get project attachments",method:h.GET,url:`${this.url}/`,queryParams:{project__organization_owner:s},blockers:[],blocks:[]});return this.dispatch(ch(i)),i}}class lP extends R{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const s={...e};delete s.file;const i=this.enqueueRequest({method:h.PATCH,url:`/project-files/${e.uuid}/`,payload:s,blockers:[e.uuid],blocks:[e.uuid]});return i.then(c=>{this.dispatch(Li(c))}),i}saveActive(){const{store:e}=this.client,s=e.getState(),i=s.projectFileReducer.activeProjectFileId;if(!i)throw new Error("No active project file");const c=s.projectFileReducer.instances[i];if(!c)throw new Error("No active project file");if(!c.bounds&&!c.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let n;if(typeof c.file=="string"&&!c.file.startsWith("blob:")){const m={...c};delete m.file,n={method:h.PATCH,url:`/project-files/${i}/`,payload:m,blockers:[i],blocks:[i]}}else n=new Promise((m,u)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([l])=>{m({method:h.POST,url:`/project-files${c.project}/`,payload:{...c,...l},blockers:[i],blocks:[i]})}).catch(u)});const o=Promise.resolve(n).then(m=>this.enqueueRequest(m));return o.then(m=>{this.dispatch(Li(m))}),this.dispatch(Th),this.dispatch(Fh(null)),this.dispatch(Ph(!1)),[c,o]}delete(e){return this.dispatch(gh(e)),this.enqueueRequest({method:h.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e){const s=await this.enqueueRequest({description:"Get project files",method:h.GET,url:"/project-files/",queryParams:{project:e},blockers:[],blocks:[]});return this.dispatch(fh(s)),s}}class hP extends R{async add(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return await this.enqueueRequest({description:"Create project",method:h.POST,url:"/projects/",payload:{name:e.name,bounds:e.bounds,organization_owner:e.organization_owner},blockers:[],blocks:[]})}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch(Mh(e)),await this.enqueueRequest({description:"Update project",method:h.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:s}=this.client,i=s.getState(),c=qh(e)(i);if(!c)throw new Error("Expected project to exist");const n=_h(i).filter(m=>m.project===e);this.dispatch(bh(n.map(({uuid:m})=>m)));const r=ph(c.uuid)(i);this.dispatch($i(r.map(({uuid:m})=>m)));const o=ah(e)(i);this.dispatch(th(o.map(({uuid:m})=>m))),this.dispatch(Hi(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:h.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Hi(c.uuid))}catch(m){throw this.dispatch(wh(c)),this.dispatch(eh(Object.values(o))),this.dispatch(Sh(n)),this.dispatch(dh(r)),m}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch projects",method:h.GET,url:"/projects/",queryParams:{organization_owner:e},blockers:[],blocks:[]});return this.dispatch(vh(s)),s}}class mP extends R{add(e){const s=T(e);this.dispatch(Dh(s));const i=this.enqueueRequest({description:"Create team membership",method:h.POST,url:"/team-memberships/",payload:v(s),blockers:[e.team],blocks:[s.uuid]});return i.then(c=>{this.dispatch(Ji(c))}).catch(()=>{this.dispatch(Zi(s.uuid))}),[s,i]}async delete(e){const{store:s}=this.client,i=s.getState(),c=Bh(e)(i);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Zi(e));try{return await this.enqueueRequest({description:"Delete team membership",method:h.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(Ji(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch team memberships",method:h.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]});return this.dispatch(Uh(s)),s}}class pP extends R{add(e){const s=T({...e,submitted_at:new Date().toISOString()});this.dispatch(Lh(s));const i=this.enqueueRequest({description:"Create team",method:h.POST,url:"/teams/",payload:v(s),blockers:[],blocks:[s.uuid]});return i.then(c=>{this.dispatch(ut(c))}).catch(()=>{this.dispatch(xi(s.uuid))}),[s,i]}update(e){const{store:s}=this.client,i=tc(e.uuid)(s.getState());if(!i)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...i,...e};this.dispatch(Nh(c));const n=this.enqueueRequest({description:"Update team",method:h.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ut(i))}),[c,n]}async delete(e){const{store:s}=this.client,i=s.getState(),c=tc(e)(i);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(xi(e));try{return await this.enqueueRequest({description:"Delete team",method:h.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(ut(c)),n}}async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch teams",method:h.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]});return this.dispatch(Gh(s)),s}}class AP extends R{async refreshStore(e){const s=await this.enqueueRequest({description:"Fetch organization users",method:h.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]});return this.dispatch(vl(s)),s}}class yP{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,s,i){return this._enqueueRequest(e,s,i).then(c=>{if(c instanceof U)throw c;return c})}_enqueueRequest(e,s,i){const c=new Ac,n={...e,BASE_URL:s,serviceName:i};if(e.immediate){const r={...n,uuid:e.uuid??Le.v4()},o={payload:r,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:r,BASE_URL:s,serviceName:i}}}};ic(o,this).then(m=>{c.resolve(m.body)}).catch(m=>{cc(m,o),m instanceof Error?c.reject(m):c.reject(new Error((m??We).toString()))})}else{const r=this.store.dispatch(Yl(n)),o=u=>{if(u)c.resolve(u.body);else{const l=new U({message:"Could not get a response from the server.",response:u,discard:!0});c.reject(l)}},m=u=>{u instanceof U?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
15
15
|
Converting error to APIError and discarding.`),u=new U({message:"An error occurred while processing the request.",innerError:u,discard:!0})),c.reject(u)};r.then(o,m)}return c}}class Ke{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new fm.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const s=new Ke;for(let i=0;i<e.length;i++){const c=e[i];if(!c){console.error("Outbox item was undefined");continue}s.sneakRequest(c);for(let n=0;n<i;n++){const r=e[n];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==c.payload.uuid&&r.payload.blocks.some(o=>c.payload.blockers.includes(o))&&Ke._addDependency(c.payload.uuid,r.payload.uuid,s.graph)}}return s}_addDependency(e,s){Ke._addDependency(e,s,this.graph)}static _addDependency(e,s,i){if(e===s)throw new Error(`Tried to add dependency from node to itself: ${e}`);if(!i.hasNode(e))throw new Error(`Tried to add dependency from non-existent node: ${e} (to node: ${s})`);if(!i.hasNode(s))throw new Error(`Tried to add dependency to non-existent node: ${s} (from node: ${e})`);i.addDependency(e,s)}addRequest(e){if(this.graph.addNode(e.payload.uuid,e),!(e.payload.blockers.length===0||this.graph.size()===1))for(const s of this.graph.overallOrder()){if(s===e.payload.uuid)continue;const i=this.graph.getNodeData(s);e.payload.blockers.some(c=>i.payload.blocks.includes(c))&&this._addDependency(e.payload.uuid,s)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const s of this.graph.overallOrder()){if(s===e.payload.uuid)continue;this.graph.getNodeData(s).payload.blockers.some(c=>e.payload.blocks.includes(c))&&this._addDependency(s,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let s=1/0,i;for(const c of e){const n=this.requestAttemptCounter[c]||0;n<s&&(s=n,i=c)}return i}peek(){const e=this._getNextNode();if(e)return this.graph.getNodeData(e)}remove(e){this.graph.removeNode(e),delete this.requestAttemptCounter[e]}pop(){const e=this.peek();return e&&this.graph.removeNode(e.payload.uuid),e}getQueue(){const e=this.graph.overallOrder().map(i=>this.graph.getNodeData(i)),s=this._getNextNode();if(s){const i=this.graph.getNodeData(s),c=e.findIndex(n=>n.payload.uuid===i.payload.uuid);c!==-1&&(e.splice(c,1),e.unshift(i))}return e}getReady(){let e=this.graph.overallOrder(!0).map(s=>this.graph.getNodeData(s));return e=e.sort((s,i)=>s.meta.offline.effect.timestamp.localeCompare(i.meta.offline.effect.timestamp)),e=e.sort((s,i)=>{const c=this.requestAttemptCounter[s.payload.uuid]||0,n=this.requestAttemptCounter[i.payload.uuid]||0;return c-n}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}const fP=(t,e)=>{const s=new e(t);return Lg(s),Gg(t),s};var um=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(um||{});a.APIError=U,a.AgentService=ob,a.AssetAttachmentService=lb,a.AssetProcedureAttachmentService=hb,a.AssetProcedureFieldValuesAttachmentService=Ab,a.AssetProcedureFieldValuesService=yb,a.AssetProcedureFieldsAttachmentService=mb,a.AssetProcedureFieldsService=pb,a.AssetProcedureInstanceService=fb,a.AssetProcedureService=Sb,a.AssetProcedureStepFieldValuesAttachmentService=Pb,a.AssetProcedureStepFieldValuesService=Fb,a.AssetProcedureStepFieldsAttachmentService=gb,a.AssetProcedureStepFieldsService=bb,a.AssetProcedureStepService=Tb,a.AssetService=Ib,a.AssetStageCompletionService=_b,a.AssetStageService=Ob,a.AssetTypeAttachmentService=Rb,a.AssetTypeFieldValuesAttachmentService=Mb,a.AssetTypeFieldValuesService=Eb,a.AssetTypeFieldsAttachmentService=vb,a.AssetTypeFieldsService=wb,a.AssetTypeService=jb,a.AttachmentModel=mc,a.BaseApiService=R,a.BaseSDK=yP,a.COMMON_AUTO_FIELDS=bc,a.CategoryService=qb,a.DEFAULT_ISSUE_PRIORITY=gm,a.DEFAULT_ISSUE_STATUS=Sm,a.DeferredPromise=Ac,a.DocumentAttachmentService=Vb,a.DocumentService=zb,a.EMPTY_ARRAY=oc,a.EMPTY_OBJECT=lc,a.EmailDomainsService=Ub,a.EmailVerificationService=Db,a.FileService=kb,a.FormRevisionAttachmentService=Bb,a.FormRevisionService=$b,a.FormService=Gb,a.FormSubmissionAttachmentService=Lb,a.FormSubmissionService=Nb,a.GeoImageService=Hb,a.HttpMethod=h,a.IssueAssociationService=Wb,a.IssueAttachmentService=Kb,a.IssueCommentAttachmentService=Yb,a.IssueCommentService=Jb,a.IssuePriority=Gt,a.IssueService=Zb,a.IssueStatus=Lt,a.IssueTypeAttachmentService=Xb,a.IssueTypeFieldValuesAttachmentService=eP,a.IssueTypeFieldValuesService=tP,a.IssueTypeFieldsAttachmentService=Qb,a.IssueTypeFieldsService=xb,a.IssueTypeService=sP,a.IssueUpdateChange=E,a.IssueUpdateService=aP,a.JWTService=nP,a.OUTBOX_RETRY_DELAY=pc,a.OrganizationAccessLevel=hc,a.OrganizationAccessService=rP,a.OrganizationService=dP,a.OutboxCoordinator=Ke,a.ProjectAccessService=uP,a.ProjectAttachmentService=oP,a.ProjectFileService=lP,a.ProjectService=hP,a.RESET_ORGANIZATION_STATE=O,a.RESET_PROJECT_STATE=M,a.RESET_STATE=F,a.TeamMembershipService=mP,a.TeamService=pP,a.UNKNOWN_ERROR_MESSAGE=We,a.UserService=AP,a.VERSION_REDUCER_KEY=Je,a.VerificationCodeType=um,a._setLatestRetryTime=Zl,a.addAsset=ks,a.addAssetAttachment=Zm,a.addAssetAttachments=Qt,a.addAssetProcedure=Ss,a.addAssetProcedureAttachment=xm,a.addAssetProcedureAttachments=Bc,a.addAssetProcedureFieldValues=rs,a.addAssetProcedureFieldValuesAttachment=Sp,a.addAssetProcedureFieldValuesAttachments=mt,a.addAssetProcedureFieldValuesMany=bn,a.addAssetProcedureFields=nn,a.addAssetProcedureFieldsAttachment=ap,a.addAssetProcedureFieldsAttachments=Xc,a.addAssetProcedureFieldsMany=op,a.addAssetProcedureInstance=hs,a.addAssetProcedureInstances=Rn,a.addAssetProcedureStep=zs,a.addAssetProcedureStepFieldValues=Es,a.addAssetProcedureStepFieldValuesAttachment=sA,a.addAssetProcedureStepFieldValuesAttachments=At,a.addAssetProcedureStepFieldValuesMany=tr,a.addAssetProcedureStepFields=Is,a.addAssetProcedureStepFieldsAttachment=Bp,a.addAssetProcedureStepFieldsAttachments=Dn,a.addAssetProcedureStepFieldsMany=Kp,a.addAssetProcedureSteps=pA,a.addAssetProcedures=qp,a.addAssetStage=Qs,a.addAssetStageCompletion=Ws,a.addAssetStageCompletions=Ks,a.addAssetStages=vA,a.addAssetType=pa,a.addAssetTypeAttachment=VA,a.addAssetTypeAttachments=sa,a.addAssetTypeFieldValues=ua,a.addAssetTypeFieldValuesAttachment=QA,a.addAssetTypeFieldValuesAttachments=It,a.addAssetTypeFieldValuesMany=dd,a.addAssetTypeFields=Yr,a.addAssetTypeFieldsAttachment=DA,a.addAssetTypeFieldsAttachments=Br,a.addAssetTypeFieldsMany=NA,a.addAssetTypes=oy,a.addAssets=bt,a.addCategories=gy,a.addCategory=ga,a.addConversation=_c,a.addConversations=Lm,a.addDocumentAttachment=Oy,a.addDocumentAttachments=vd,a.addDocuments=kd,a.addEmailDomain=Wd,a.addEmailDomains=qy,a.addForm=ja,a.addFormRevision=wa,a.addFormRevisionAttachment=$y,a.addFormRevisionAttachments=iu,a.addFormRevisions=lu,a.addFormSubmission=Da,a.addFormSubmissionAttachment=rf,a.addFormSubmissionAttachments=vt,a.addFormSubmissions=Et,a.addForms=xy,a.addGeoImage=ku,a.addGeoImages=Bu,a.addIssue=di,a.addIssueAssociation=Wa,a.addIssueAssociations=Ka,a.addIssueAttachment=bf,a.addIssueAttachments=Qa,a.addIssueComment=ai,a.addIssueCommentAttachment=Tf,a.addIssueCommentAttachments=lo,a.addIssueComments=vf,a.addIssueType=ml,a.addIssueTypeAttachment=Cf,a.addIssueTypeAttachments=Mo,a.addIssueTypeFieldValues=yi,a.addIssueTypeFieldValuesAttachment=oS,a.addIssueTypeFieldValuesAttachments=zt,a.addIssueTypeFieldValuesMany=Jf,a.addIssueTypeFields=xo,a.addIssueTypeFieldsAttachment=Gf,a.addIssueTypeFieldsAttachments=$o,a.addIssueTypeFieldsMany=tS,a.addIssueTypes=yS,a.addIssueUpdate=bl,a.addIssueUpdates=Pl,a.addIssues=Oo,a.addOrganization=Gl,a.addOrganizationAccess=Ul,a.addOrganizationAccesses=DS,a.addOrganizations=WS,a.addProject=wh,a.addProjectAccess=Ui,a.addProjectAccesses=eh,a.addProjectAttachment=ng,a.addProjectAttachments=nh,a.addProjectFile=og,a.addProjectFiles=Sh,a.addProjects=Sg,a.addTeam=Lh,a.addTeamMembership=Dh,a.addTeamMemberships=Og,a.addTeams=qg,a.addUser=wl,a.addUsers=MS,a.agentsReducer=vc,a.agentsSlice=Yt,a.areArraysEqual=_m,a.assetAttachmentReducer=Dc,a.assetAttachmentSlice=Zt,a.assetProcedureAttachmentReducer=Yc,a.assetProcedureAttachmentSlice=es,a.assetProcedureFieldValuesAttachmentReducer=fn,a.assetProcedureFieldValuesAttachmentSlice=is,a.assetProcedureFieldValuesReducer=In,a.assetProcedureFieldValuesSlice=ns,a.assetProcedureFieldsAttachmentReducer=sn,a.assetProcedureFieldsAttachmentSlice=ts,a.assetProcedureFieldsReducer=on,a.assetProcedureFieldsSlice=ss,a.assetProcedureInstanceReducer=Mn,a.assetProcedureInstanceSlice=ls,a.assetProcedureReducer=Vn,a.assetProcedureSlice=fs,a.assetProcedureStepFieldValuesAttachmentReducer=Qn,a.assetProcedureStepFieldValuesAttachmentSlice=vs,a.assetProcedureStepFieldValuesReducer=cr,a.assetProcedureStepFieldValuesSlice=Ms,a.assetProcedureStepFieldsAttachmentReducer=Gn,a.assetProcedureStepFieldsAttachmentSlice=Fs,a.assetProcedureStepFieldsReducer=Hn,a.assetProcedureStepFieldsSlice=Ts,a.assetProcedureStepReducer=ur,a.assetProcedureStepSlice=Vs,a.assetReducer=Ar,a.assetSlice=Cs,a.assetStageCompletionReducer=br,a.assetStageCompletionSlice=Hs,a.assetStageReducer=Or,a.assetStageSlice=Xs,a.assetTypeAttachmentReducer=Dr,a.assetTypeAttachmentSlice=ta,a.assetTypeFieldValuesAttachmentReducer=cd,a.assetTypeFieldValuesAttachmentSlice=na,a.assetTypeFieldValuesReducer=hd,a.assetTypeFieldValuesSlice=da,a.assetTypeFieldsAttachmentReducer=Hr,a.assetTypeFieldsAttachmentSlice=ia,a.assetTypeFieldsReducer=Qr,a.assetTypeFieldsSlice=ca,a.assetTypeReducer=yd,a.assetTypeSlice=ma,a.authReducer=gd,a.authSlice=Ot,a.baseReducer=Bg,a.baseReducers=sc,a.blobToBase64=Vm,a.categoryReducer=_d,a.categorySlice=Sa,a.clearTokens=yy,a.constructUploadedFilePayloads=qm,a.coordinatesAreEqual=Tm,a.createModelAdapter=I,a.createMultiPointGeometry=Fm,a.createOfflineAction=Wl,a.createPayload=v,a.createPointGeometry=Pm,a.createSelectionAdapter=bm,a.deleteAsset=Bs,a.deleteAssetAttachment=jc,a.deleteAssetAttachments=xt,a.deleteAssetProcedure=gs,a.deleteAssetProcedureAttachment=Lc,a.deleteAssetProcedureAttachments=Nc,a.deleteAssetProcedureFieldValues=ds,a.deleteAssetProcedureFieldValuesAttachment=Fp,a.deleteAssetProcedureFieldValuesAttachments=pt,a.deleteAssetProcedureFieldValuesMany=Fn,a.deleteAssetProcedureFields=dn,a.deleteAssetProcedureFieldsAttachment=rp,a.deleteAssetProcedureFieldsAttachments=xc,a.deleteAssetProcedureFieldsMany=pp,a.deleteAssetProcedureInstance=ms,a.deleteAssetProcedureInstances=vn,a.deleteAssetProcedureStep=Us,a.deleteAssetProcedureStepFieldValues=js,a.deleteAssetProcedureStepFieldValuesAttachment=nA,a.deleteAssetProcedureStepFieldValuesAttachments=yt,a.deleteAssetProcedureStepFieldValuesMany=ar,a.deleteAssetProcedureStepFields=_s,a.deleteAssetProcedureStepFieldsAttachment=Np,a.deleteAssetProcedureStepFieldsAttachments=kn,a.deleteAssetProcedureStepFieldsMany=Xp,a.deleteAssetProcedureSteps=yA,a.deleteAssetProcedures=zp,a.deleteAssetStage=xs,a.deleteAssetStageCompletion=Ys,a.deleteAssetStageCompletions=Js,a.deleteAssetStages=MA,a.deleteAssetType=Aa,a.deleteAssetTypeAttachment=jr,a.deleteAssetTypeAttachments=aa,a.deleteAssetTypeFieldValues=oa,a.deleteAssetTypeFieldValuesAttachment=sy,a.deleteAssetTypeFieldValuesAttachments=_t,a.deleteAssetTypeFieldValuesMany=od,a.deleteAssetTypeFields=Zr,a.deleteAssetTypeFieldsAttachment=$A,a.deleteAssetTypeFieldsAttachments=Gr,a.deleteAssetTypeFieldsMany=YA,a.deleteAssetTypes=hy,a.deleteAssets=$s,a.deleteCategories=Ty,a.deleteCategory=Td,a.deleteConversation=Wm,a.deleteConversations=Km,a.deleteDocumentAttachment=Ed,a.deleteDocumentAttachments=jd,a.deleteEmailDomain=Kd,a.deleteEmailDomains=Cy,a.deleteForm=qa,a.deleteFormRevision=Ma,a.deleteFormRevisionAttachment=Hy,a.deleteFormRevisionAttachments=nu,a.deleteFormRevisions=mu,a.deleteFormSubmission=Ca,a.deleteFormSubmissionAttachment=lf,a.deleteFormSubmissionAttachments=wt,a.deleteFormSubmissions=jt,a.deleteForms=cf,a.deleteGeoImage=La,a.deleteGeoImages=Gu,a.deleteIssue=ui,a.deleteIssueAssociation=Ya,a.deleteIssueAssociations=Ja,a.deleteIssueAttachment=ao,a.deleteIssueAttachments=xa,a.deleteIssueComment=ci,a.deleteIssueCommentAttachment=po,a.deleteIssueCommentAttachments=Ao,a.deleteIssueComments=Ef,a.deleteIssueType=gS,a.deleteIssueTypeAttachment=qo,a.deleteIssueTypeAttachments=Vo,a.deleteIssueTypeFieldValues=fi,a.deleteIssueTypeFieldValuesAttachment=pS,a.deleteIssueTypeFieldValuesAttachments=Ut,a.deleteIssueTypeFieldValuesMany=xf,a.deleteIssueTypeFields=tl,a.deleteIssueTypeFieldsAttachment=Wf,a.deleteIssueTypeFieldsAttachments=Lo,a.deleteIssueTypeFieldsMany=cS,a.deleteIssueTypes=bS,a.deleteIssueUpdate=Fl,a.deleteIssueUpdates=Tl,a.deleteIssues=Ro,a.deleteOrganization=YS,a.deleteOrganizationAccess=Dl,a.deleteOrganizationAccesses=$S,a.deleteOrganizations=JS,a.deleteProject=Hi,a.deleteProjectAccess=Di,a.deleteProjectAccesses=th,a.deleteProjectAttachment=oh,a.deleteProjectAttachments=$i,a.deleteProjectFile=gh,a.deleteProjectFiles=bh,a.deleteProjects=bg,a.deleteTeam=xi,a.deleteTeamMembership=Zi,a.deleteTeamMemberships=Mg,a.deleteTeams=Ug,a.deleteUser=Ml,a.deleteUsers=qS,a.dequeue=cm,a.discard=cc,a.documentAttachmentReducer=Ud,a.documentAttachmentSlice=Fa,a.documentSlice=Ta,a.documentsReducer=Ld,a.downloadFile=zm,a.downloadInMemoryFile=jm,a.emailDomainsReducer=Zd,a.emailDomainsSlice=_a,a.emailRegex=Gm,a.enqueue=im,a.enqueueRequest=Yl,a.fallbackToEmptyArray=g,a.fallbackToEmptyObject=ht,a.fileReducer=tu,a.fileSlice=Oa,a.fileToBlob=Sc,a.formReducer=gu,a.formRevisionAttachmentReducer=du,a.formRevisionAttachmentSlice=Ra,a.formRevisionReducer=yu,a.formRevisionsSlice=va,a.formSlice=Ea,a.formSubmissionAttachmentReducer=vu,a.formSubmissionAttachmentSlice=Va,a.formSubmissionReducer=zu,a.formSubmissionSlice=Ua,a.geoImageReducer=Hu,a.geoImageSlice=Ga,a.getFileIdentifier=Em,a.getFileS3Key=Kt,a.getLocalDateString=yc,a.getLocalRelativeDateString=wm,a.getOutboxCoordinator=ke,a.getRenamedFile=fc,a.hashFile=Ne,a.initSDK=fP,a.initializeAssetAttachments=Xt,a.initializeAssetProcedureAttachments=kc,a.initializeAssetProcedureFieldValues=gn,a.initializeAssetProcedureFieldValuesAttachments=hn,a.initializeAssetProcedureFields=cn,a.initializeAssetProcedureFieldsAttachments=Zc,a.initializeAssetProcedureInstances=On,a.initializeAssetProcedureStepFieldValues=er,a.initializeAssetProcedureStepFieldValuesAttachments=Kn,a.initializeAssetProcedureStepFields=Nn,a.initializeAssetProcedureStepFieldsAttachments=Un,a.initializeAssetProcedureSteps=rr,a.initializeAssetProcedures=jn,a.initializeAssetStageCompletions=fr,a.initializeAssetStages=Ir,a.initializeAssetTypeAttachments=wr,a.initializeAssetTypeFieldValues=rd,a.initializeAssetTypeFieldValuesAttachments=ed,a.initializeAssetTypeFields=Kr,a.initializeAssetTypeFieldsAttachments=kr,a.initializeAssetTypes=pd,a.initializeAssets=hr,a.initializeCategories=Pd,a.initializeConversations=Ic,a.initializeDocumentAttachments=Rd,a.initializeEmailDomains=Hd,a.initializeFormRevisionAttachments=au,a.initializeFormRevisions=ou,a.initializeFormSubmissionAttachments=Iu,a.initializeFormSubmissions=Mu,a.initializeForms=Su,a.initializeGeoImages=Du,a.initializeIssueAssociations=Ku,a.initializeIssueAttachments=Xa,a.initializeIssueCommentAttachments=ti,a.initializeIssueComments=Rf,a.initializeIssueTypeAttachments=mi,a.initializeIssueTypeFieldValues=Yo,a.initializeIssueTypeFieldValuesAttachments=cl,a.initializeIssueTypeFields=Qo,a.initializeIssueTypeFieldsAttachments=Bo,a.initializeIssueTypes=hl,a.initializeIssueUpdates=gl,a.initializeIssues=_o,a.initializeOrganizationAccesses=zl,a.initializeOrganizations=$l,a.initializeProjectAccesses=xl,a.initializeProjectAttachments=ch,a.initializeProjectFiles=fh,a.initializeProjects=vh,a.initializeTeamMemberships=Uh,a.initializeTeams=Gh,a.initializeUsers=vl,a.isToday=vm,a.issueAssociationReducer=xu,a.issueAssociationSlice=Ha,a.issueAttachmentReducer=uo,a.issueAttachmentSlice=Za,a.issueCommentAttachmentReducer=go,a.issueCommentAttachmentSlice=ei,a.issueCommentReducer=To,a.issueCommentSlice=si,a.issueReducer=vo,a.issueSlice=ri,a.issueTypeAttachmentReducer=Co,a.issueTypeAttachmentSlice=hi,a.issueTypeFieldValuesAttachmentReducer=ol,a.issueTypeFieldValuesAttachmentSlice=Pi,a.issueTypeFieldValuesReducer=Zo,a.issueTypeFieldValuesSlice=Ai,a.issueTypeFieldsAttachmentReducer=Wo,a.issueTypeFieldsAttachmentSlice=pi,a.issueTypeFieldsReducer=al,a.issueTypeFieldsSlice=bi,a.issueTypeReducer=fl,a.issueTypeSlice=Ti,a.issueUpdateReducer=Ol,a.issueUpdateSlice=Ri,a.logOnlyOnce=Um,a.markAsDeleted=Jl,a.markForDeletion=eg,a.memoize=Ht,a.moveDocument=Bd,a.offline=T,a.onlyUniqueHashes=$m,a.onlyUniqueOfflineIds=Fc,a.organizationAccessReducer=Cl,a.organizationAccessSlice=Mi,a.organizationReducer=Hl,a.organizationSlice=qi,a.outboxReducer=Xl,a.outboxSlice=Vi,a.overmapEnhancer=Qg,a.overmapReducer=$g,a.overmapReducers=Jh,a.performRequest=ic,a.projectAccessReducer=sh,a.projectAccessSlice=zi,a.projectAttachmentReducer=Ah,a.projectAttachmentSlice=Bi,a.projectFileReducer=Oh,a.projectFileSlice=Gi,a.projectReducer=Eh,a.projectSlice=Ni,a.rehydratedReducer=Vh,a.rehydratedSlice=Ki,a.removeDocuments=Ia,a.removeIssueType=Ii,a.resetProjectFileObjectUrls=hg,a.restructureCreateSelectorWithArgs=f,a.saveActiveProjectFileBounds=Th,a.selectAccessToken=fy,a.selectAccessesByUserOfProject=ig,a.selectAccessibleProjects=Pg,a.selectActiveOrganizationAccess=GS,a.selectActiveProjectFileId=pg,a.selectAllDocumentAttachments=Vd,a.selectAllProjectAttachments=hh,a.selectAncestorIdsOfDocument=Ey,a.selectAssetAttachmentById=zc,a.selectAssetAttachmentMapping=qc,a.selectAssetAttachments=Vc,a.selectAssetById=Ns,a.selectAssetProcedureAttachmentById=Kc,a.selectAssetProcedureAttachmentMapping=Hc,a.selectAssetProcedureAttachments=Wc,a.selectAssetProcedureById=Ps,a.selectAssetProcedureFieldValues=us,a.selectAssetProcedureFieldValuesAttachmentById=Tp,a.selectAssetProcedureFieldValuesAttachments=pn,a.selectAssetProcedureFieldValuesAttachmentsByIds=An,a.selectAssetProcedureFieldValuesAttachmentsMapping=cs,a.selectAssetProcedureFieldValuesById=os,a.selectAssetProcedureFieldValuesMapping=Tn,a.selectAssetProcedureFieldValuesOfAsset=Op,a.selectAssetProcedureFields=as,a.selectAssetProcedureFieldsAttachmentById=up,a.selectAssetProcedureFieldsAttachments=tn,a.selectAssetProcedureFieldsAttachmentsMapping=en,a.selectAssetProcedureFieldsById=fp,a.selectAssetProcedureFieldsMapping=un,a.selectAssetProcedureFieldsOfAssetProcedure=Ap,a.selectAssetProcedureInstanceById=ys,a.selectAssetProcedureInstances=As,a.selectAssetProcedureInstancesByIds=jp,a.selectAssetProcedureInstancesMapping=ps,a.selectAssetProcedureInstancesOfAssetProcedure=wn,a.selectAssetProcedureInstancesOfAssetType=Ep,a.selectAssetProcedureStepById=Ds,a.selectAssetProcedureStepFieldValues=ft,a.selectAssetProcedureStepFieldValuesAttachmentById=rA,a.selectAssetProcedureStepFieldValuesAttachments=Jn,a.selectAssetProcedureStepFieldValuesAttachmentsByIds=Zn,a.selectAssetProcedureStepFieldValuesAttachmentsMapping=ws,a.selectAssetProcedureStepFieldValuesById=qs,a.selectAssetProcedureStepFieldValuesMapping=ir,a.selectAssetProcedureStepFieldValuesOfAsset=oA,a.selectAssetProcedureStepFieldValuesOfAssetProcedureInstance=lA,a.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=hA,a.selectAssetProcedureStepFields=Rs,a.selectAssetProcedureStepFieldsAttachmentById=Wp,a.selectAssetProcedureStepFieldsAttachments=$n,a.selectAssetProcedureStepFieldsAttachmentsMapping=Bn,a.selectAssetProcedureStepFieldsById=tA,a.selectAssetProcedureStepFieldsMapping=Os,a.selectAssetProcedureStepFieldsOfAssetProcedureStep=Qp,a.selectAssetProcedureStepMapping=gt,a.selectAssetProcedureSteps=or,a.selectAssetProcedureStepsByIds=gA,a.selectAssetProcedureStepsMappingOfAssetProcedure=fA,a.selectAssetProcedureStepsOfAssetProcedure=SA,a.selectAssetProcedures=qn,a.selectAssetProceduresByIds=Cp,a.selectAssetProceduresMapping=bs,a.selectAssetProceduresOfOrganization=kp,a.selectAssetStageById=ea,a.selectAssetStageCompletionById=Pr,a.selectAssetStageCompletionMapping=Zs,a.selectAssetStageCompletions=OA,a.selectAssetStageCompletionsByIds=Fr,a.selectAssetStages=Rr,a.selectAssetStagesByIds=qA,a.selectAssetStagesMappingOfAssetProcedure=EA,a.selectAssetStagesOfAssetProcedure=jA,a.selectAssetTypeAttachmentById=zr,a.selectAssetTypeAttachmentMapping=qr,a.selectAssetTypeAttachments=Vr,a.selectAssetTypeById=fa,a.selectAssetTypeFieldValues=la,a.selectAssetTypeFieldValuesAttachmentById=ay,a.selectAssetTypeFieldValuesAttachments=sd,a.selectAssetTypeFieldValuesAttachmentsByIds=ad,a.selectAssetTypeFieldValuesAttachmentsMapping=ra,a.selectAssetTypeFieldValuesById=ha,a.selectAssetTypeFieldValuesMapping=ld,a.selectAssetTypeFieldValuesOfAsset=ny,a.selectAssetTypeFields=Tt,a.selectAssetTypeFieldsAttachmentById=LA,a.selectAssetTypeFieldsAttachments=Nr,a.selectAssetTypeFieldsAttachmentsMapping=Lr,a.selectAssetTypeFieldsById=XA,a.selectAssetTypeFieldsMapping=Xr,a.selectAssetTypeFieldsOfAssetType=JA,a.selectAssetTypeValuesOfAssetType=ry,a.selectAssetTypes=Ad,a.selectAssetTypesByIds=my,a.selectAssetTypesMapping=ya,a.selectAssetTypesOfOrganization=py,a.selectAssets=mr,a.selectAssetsByIds=pr,a.selectAssetsMapping=Gs,a.selectAssetsOfAssetType=Ls,a.selectAttachmentsOfAsset=Uc,a.selectAttachmentsOfAssetProcedure=sp,a.selectAttachmentsOfAssetProcedureFieldValues=yn,a.selectAttachmentsOfAssetProcedureFields=dp,a.selectAttachmentsOfAssetProcedureStepFieldValues=Xn,a.selectAttachmentsOfAssetProcedureStepFields=Hp,a.selectAttachmentsOfAssetType=Ur,a.selectAttachmentsOfAssetTypeFieldValues=id,a.selectAttachmentsOfAssetTypeFields=GA,a.selectAttachmentsOfDocument=wy,a.selectAttachmentsOfFormRevision=Wy,a.selectAttachmentsOfFormSubmission=Ru,a.selectAttachmentsOfIssue=no,a.selectAttachmentsOfIssueComment=Of,a.selectAttachmentsOfIssueType=$f,a.selectAttachmentsOfIssueTypeFieldValues=ul,a.selectAttachmentsOfIssueTypeFields=Kf,a.selectAttachmentsOfProject=ph,a.selectCategories=Id,a.selectCategoriesByIds=Iy,a.selectCategoriesOfProject=_y,a.selectCategoryById=Pa,a.selectCategoryMapping=ba,a.selectCommentsOfIssue=jf,a.selectConversation=Jm,a.selectConversationMapping=Jt,a.selectConversations=Ym,a.selectCurrentUser=jl,a.selectDeletedRequests=QS,a.selectDocumentAttachmentById=zd,a.selectDocumentAttachmentMapping=qd,a.selectDocumentById=Gd,a.selectDocuments=$d,a.selectDocumentsByIds=My,a.selectDocumentsMapping=He,a.selectEmailDomains=Jd,a.selectEmailDomainsAsMapping=Yd,a.selectEmailDomainsOfOrganization=ky,a.selectFieldValuesOfAssetProcedureInstance=Rp,a.selectFormById=Fu,a.selectFormMapping=bu,a.selectFormRevisionAttachmentsMapping=ru,a.selectFormRevisionById=Xy,a.selectFormRevisionMapping=Rt,a.selectFormRevisions=pu,a.selectFormRevisionsOfForm=Au,a.selectFormSubmissionAttachemntsByIds=Ou,a.selectFormSubmissionAttachmentsMapping=za,a.selectFormSubmissionById=$a,a.selectFormSubmissions=Ba,a.selectFormSubmissionsMapping=ka,a.selectFormSubmissionsOfAsset=Vu,a.selectFormSubmissionsOfForm=ju,a.selectFormSubmissionsOfIssue=qu,a.selectForms=Pu,a.selectFormsOfOrganization=nf,a.selectGeoImageById=Na,a.selectGeoImageMapping=Lu,a.selectGeoImages=Nu,a.selectGeoImagesOfProject=Af,a.selectIsImportingProjectFile=Ag,a.selectIsLoggedIn=Sy,a.selectIssueAssociationById=Ju,a.selectIssueAssociationMapping=ct,a.selectIssueAssociations=gf,a.selectIssueAssociationsOfAsset=Qu,a.selectIssueAssociationsOfIssue=Xu,a.selectIssueAssociationsToIssue=Zu,a.selectIssueAttachmentById=ro,a.selectIssueAttachmentMapping=io,a.selectIssueAttachments=co,a.selectIssueById=li,a.selectIssueCommentAttachmentById=So,a.selectIssueCommentAttachmentMapping=yo,a.selectIssueCommentAttachments=fo,a.selectIssueCommentById=ni,a.selectIssueCommentMapping=Fo,a.selectIssueMapping=oi,a.selectIssueTypeAttachmentById=Do,a.selectIssueTypeAttachmentMapping=zo,a.selectIssueTypeAttachments=Uo,a.selectIssueTypeById=_i,a.selectIssueTypeFieldValues=Si,a.selectIssueTypeFieldValuesAttachmentById=AS,a.selectIssueTypeFieldValuesAttachments=rl,a.selectIssueTypeFieldValuesAttachmentsByIds=dl,a.selectIssueTypeFieldValuesAttachmentsMapping=Fi,a.selectIssueTypeFieldValuesById=gi,a.selectIssueTypeFieldValuesMapping=Jo,a.selectIssueTypeFieldValuesOfIssue=eS,a.selectIssueTypeFields=Vt,a.selectIssueTypeFieldsAttachmentById=Yf,a.selectIssueTypeFieldsAttachments=Ho,a.selectIssueTypeFieldsAttachmentsMapping=No,a.selectIssueTypeFieldsById=uS,a.selectIssueTypeFieldsMapping=sl,a.selectIssueTypeFieldsOfIssueType=nS,a.selectIssueTypeMapping=Al,a.selectIssueTypeValuesOfIssueType=dS,a.selectIssueTypes=yl,a.selectIssueTypesByIds=PS,a.selectIssueTypesOfOrganization=FS,a.selectIssueUpdateMapping=Il,a.selectIssueUpdatesOfIssue=_l,a.selectIssues=Uf,a.selectIssuesByIds=Df,a.selectIssuesOfIssueType=Oi,a.selectIssuesOfIssueTypeCount=TS,a.selectLatestAssetProcedureFieldsOfAssetProcedure=yp,a.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=xp,a.selectLatestAssetTypeFieldsOfAssetType=ZA,a.selectLatestFieldsByAssetProcedureStep=eA,a.selectLatestFormRevisionOfForm=Qy,a.selectLatestIssueTypeFieldsOfIssueType=rS,a.selectLatestRetryTime=xS,a.selectMembershipsByUserOfTeam=Eg,a.selectNumberOfAssetsOfAssetType=TA,a.selectOrganizationAccessById=ji,a.selectOrganizationAccessMapping=Ei,a.selectOrganizationAccessUserMapping=kl,a.selectOrganizationById=XS,a.selectOrganizations=ZS,a.selectOrganizationsMapping=Nl,a.selectProjectAccessById=ki,a.selectProjectAccessMapping=Ci,a.selectProjectAccesses=kt,a.selectProjectAccessesOfProject=ah,a.selectProjectAttachmentById=mh,a.selectProjectAttachmentMapping=lh,a.selectProjectById=qh,a.selectProjectFileById=mg,a.selectProjectFileMapping=Ih,a.selectProjectFiles=_h,a.selectProjectMapping=jh,a.selectProjects=Wi,a.selectProjectsOfOrganization=Fg,a.selectRehydrated=_g,a.selectRootDocuments=jy,a.selectStageMapping=Ft,a.selectTeamById=tc,a.selectTeamMembershipById=Bh,a.selectTeamMemberships=Xi,a.selectTeamMembershipsMapping=kh,a.selectTeams=Hh,a.selectTeamsByIds=Dg,a.selectTeamsMapping=ec,a.selectTeamsOfOrganization=Cg,a.selectUploadUrl=eu,a.selectUserById=ql,a.selectUsers=wi,a.selectUsersByIds=US,a.selectUsersMapping=Dt,a.selectUsersOfOrganization=LS,a.selectUsersOfProject=cg,a.selectUsersOfTeam=jg,a.setActiveProjectFileId=Fh,a.setAsset=PA,a.setAssetAttachment=Mc,a.setAssetAttachments=Xm,a.setAssetProcedure=Up,a.setAssetProcedureAttachment=$c,a.setAssetProcedureAttachments=ep,a.setAssetProcedureFieldValues=Ip,a.setAssetProcedureFieldValuesAttachment=gp,a.setAssetProcedureFieldValuesAttachments=bp,a.setAssetProcedureFieldValuesMany=_p,a.setAssetProcedureFields=lp,a.setAssetProcedureFieldsAttachment=ip,a.setAssetProcedureFieldsAttachments=cp,a.setAssetProcedureFieldsMany=hp,a.setAssetProcedureInstance=wp,a.setAssetProcedureInstances=Mp,a.setAssetProcedureStep=dr,a.setAssetProcedureStepFieldValues=dA,a.setAssetProcedureStepFieldValuesAttachment=aA,a.setAssetProcedureStepFieldValuesAttachments=iA,a.setAssetProcedureStepFieldValuesMany=uA,a.setAssetProcedureStepFields=Yp,a.setAssetProcedureStepFieldsAttachment=$p,a.setAssetProcedureStepFieldsAttachments=Gp,a.setAssetProcedureStepFieldsMany=Jp,a.setAssetProcedureSteps=mA,a.setAssetProcedures=Dp,a.setAssetStage=_r,a.setAssetStageCompletion=IA,a.setAssetStageCompletions=_A,a.setAssetStages=RA,a.setAssetType=dy,a.setAssetTypeAttachment=Mr,a.setAssetTypeAttachments=zA,a.setAssetTypeFieldValues=iy,a.setAssetTypeFieldValuesAttachment=xA,a.setAssetTypeFieldValuesAttachments=ey,a.setAssetTypeFieldValuesMany=cy,a.setAssetTypeFields=HA,a.setAssetTypeFieldsAttachment=CA,a.setAssetTypeFieldsAttachments=kA,a.setAssetTypeFieldsMany=WA,a.setAssetTypes=uy,a.setAssets=FA,a.setCategories=Py,a.setCategory=by,a.setConversation=Oc,a.setConversations=Nm,a.setCurrentUser=VS,a.setDocumentAttachment=wd,a.setDocumentAttachments=Ry,a.setDocuments=Cd,a.setEmailDomain=Vy,a.setEmailDomains=zy,a.setForm=ef,a.setFormRevision=hu,a.setFormRevisionAttachment=Gy,a.setFormRevisionAttachments=Ly,a.setFormRevisions=Yy,a.setFormSubmission=Mt,a.setFormSubmissionAttachment=df,a.setFormSubmissionAttachments=uf,a.setFormSubmissions=hf,a.setForms=tf,a.setGeoImage=it,a.setGeoImages=Cu,a.setIsImportingProjectFile=Ph,a.setIssue=qf,a.setIssueAssociation=ff,a.setIssueAssociations=yf,a.setIssueAttachment=to,a.setIssueAttachments=Pf,a.setIssueComment=ii,a.setIssueCommentAttachment=ho,a.setIssueCommentAttachments=If,a.setIssueComments=Po,a.setIssueType=rt,a.setIssueTypeAttachment=Eo,a.setIssueTypeAttachments=kf,a.setIssueTypeFieldValues=Zf,a.setIssueTypeFieldValuesAttachment=lS,a.setIssueTypeFieldValuesAttachments=hS,a.setIssueTypeFieldValuesMany=Xf,a.setIssueTypeFields=sS,a.setIssueTypeFieldsAttachment=Lf,a.setIssueTypeFieldsAttachments=Nf,a.setIssueTypeFieldsMany=aS,a.setIssueTypes=fS,a.setIssueUpdate=IS,a.setIssueUpdates=_S,a.setIssues=Vf,a.setLoggedIn=Sd,a.setOrganization=HS,a.setOrganizationAccess=CS,a.setOrganizationAccesses=kS,a.setOrganizations=NS,a.setProfilePicture=zS,a.setProject=fg,a.setProjectAccess=tg,a.setProjectAccesses=sg,a.setProjectAttachment=rh,a.setProjectAttachments=dh,a.setProjectFile=dg,a.setProjectFiles=ug,a.setProjects=yg,a.setRehydrated=Ig,a.setTeam=ut,a.setTeamMembership=Ji,a.setTeamMemberships=Rg,a.setTeams=Vg,a.setTokens=Ay,a.setUploadUrl=xd,a.setUser=wS,a.setUsers=vS,a.shallowEqual=Im,a.slugify=km,a.spacesToDashesLower=Cm,a.teamMembershipReducer=Ch,a.teamMembershipSlice=Yi,a.teamReducer=Wh,a.teamSlice=Qi,a.toFileNameSafeString=Dm,a.toOfflineIdRecord=Pc,a.truncate=Bm,a.updateAsset=tt,a.updateAssetAttachment=Qm,a.updateAssetAttachments=Ec,a.updateAssetProcedure=Qe,a.updateAssetProcedureAttachment=tp,a.updateAssetProcedureAttachments=Gc,a.updateAssetProcedureFieldValues=Ze,a.updateAssetProcedureFieldValuesAttachment=Pp,a.updateAssetProcedureFieldValuesAttachments=mn,a.updateAssetProcedureFieldValuesMany=Pn,a.updateAssetProcedureFields=rn,a.updateAssetProcedureFieldsAttachment=np,a.updateAssetProcedureFieldsAttachments=Qc,a.updateAssetProcedureFieldsMany=mp,a.updateAssetProcedureInstance=Xe,a.updateAssetProcedureInstances=vp,a.updateAssetProcedureStep=St,a.updateAssetProcedureStepFieldValues=et,a.updateAssetProcedureStepFieldValuesAttachment=cA,a.updateAssetProcedureStepFieldValuesAttachments=Yn,a.updateAssetProcedureStepFieldValuesMany=sr,a.updateAssetProcedureStepFields=xe,a.updateAssetProcedureStepFieldsAttachment=Lp,a.updateAssetProcedureStepFieldsAttachments=Cn,a.updateAssetProcedureStepFieldsMany=Zp,a.updateAssetProcedureSteps=AA,a.updateAssetProcedures=Vp,a.updateAssetStage=Pt,a.updateAssetStageCompletion=Sr,a.updateAssetStageCompletions=gr,a.updateAssetStages=wA,a.updateAssetType=at,a.updateAssetTypeAttachment=UA,a.updateAssetTypeAttachments=Er,a.updateAssetTypeFieldValues=st,a.updateAssetTypeFieldValuesAttachment=ty,a.updateAssetTypeFieldValuesAttachments=td,a.updateAssetTypeFieldValuesMany=ud,a.updateAssetTypeFields=Jr,a.updateAssetTypeFieldsAttachment=BA,a.updateAssetTypeFieldsAttachments=$r,a.updateAssetTypeFieldsMany=KA,a.updateAssetTypes=ly,a.updateAssets=bA,a.updateCategories=Fy,a.updateCategory=Fd,a.updateConversation=Rc,a.updateConversations=Hm,a.updateDocumentAttachment=vy,a.updateDocumentAttachments=Md,a.updateDocuments=De,a.updateEmailDomain=Uy,a.updateEmailDomains=Dy,a.updateForm=sf,a.updateFormRevision=Jy,a.updateFormRevisionAttachment=Ny,a.updateFormRevisionAttachments=cu,a.updateFormRevisions=Zy,a.updateFormSubmission=Eu,a.updateFormSubmissionAttachment=of,a.updateFormSubmissionAttachments=_u,a.updateFormSubmissions=mf,a.updateForms=af,a.updateGeoImage=$u,a.updateGeoImages=pf,a.updateIssue=qt,a.updateIssueAssociation=Yu,a.updateIssueAssociations=Sf,a.updateIssueAttachment=Ff,a.updateIssueAttachments=so,a.updateIssueComment=wf,a.updateIssueCommentAttachment=_f,a.updateIssueCommentAttachments=mo,a.updateIssueComments=Mf,a.updateIssueType=pl,a.updateIssueTypeAttachment=Bf,a.updateIssueTypeAttachments=jo,a.updateIssueTypeFieldValues=nt,a.updateIssueTypeFieldValuesAttachment=mS,a.updateIssueTypeFieldValuesAttachments=nl,a.updateIssueTypeFieldValuesMany=Qf,a.updateIssueTypeFields=el,a.updateIssueTypeFieldsAttachment=Hf,a.updateIssueTypeFieldsAttachments=Go,a.updateIssueTypeFieldsMany=iS,a.updateIssueTypes=SS,a.updateIssueUpdate=OS,a.updateIssueUpdates=RS,a.updateIssues=zf,a.updateOrganization=Ll,a.updateOrganizationAccess=Ct,a.updateOrganizationAccesses=BS,a.updateOrganizations=KS,a.updateProject=Mh,a.updateProjectAccess=dt,a.updateProjectAccesses=ag,a.updateProjectAttachment=rg,a.updateProjectAttachments=uh,a.updateProjectFile=Li,a.updateProjectFiles=lg,a.updateProjects=gg,a.updateTeam=Nh,a.updateTeamMembership=vg,a.updateTeamMemberships=wg,a.updateTeams=zg,a.updateUser=jS,a.updateUsers=ES,a.userReducer=El,a.userSlice=vi,a.versioningReducer=Yh,a.versioningSlice=Kh,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -3,7 +3,7 @@ import { Organization, Payload, UUID } from '../../typings';
|
|
|
3
3
|
import { BaseSDK } from '../base';
|
|
4
4
|
import { BaseApiService } from './BaseApiService';
|
|
5
5
|
export declare abstract class OrganizationService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
|
-
add(
|
|
6
|
+
add(payload: Payload<Organization>): Promise<Organization>;
|
|
7
7
|
update(payload: UUID<Partial<Payload<Organization>>>): Promise<Organization>;
|
|
8
8
|
invite(organizationUuid: Organization["uuid"], email: string): Promise<undefined>;
|
|
9
9
|
refreshStore(): Promise<Organization[]>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { OrganizationAccessLevel } from '../../enums';
|
|
2
|
-
import {
|
|
2
|
+
import { UUIDModel } from './base';
|
|
3
3
|
import { User } from './users';
|
|
4
|
-
export interface Organization extends UUIDModel
|
|
4
|
+
export interface Organization extends UUIDModel {
|
|
5
5
|
name: string;
|
|
6
|
-
has_access: boolean;
|
|
7
6
|
}
|
|
8
7
|
export interface OrganizationAccess extends UUIDModel {
|
|
9
8
|
user: User["id"];
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core functionality for Overmap",
|
|
4
4
|
"author": "Wôrdn Inc.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
-
"version": "1.0.78-view-sets.
|
|
6
|
+
"version": "1.0.78-view-sets.20",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/overmap-core.umd.cjs",
|
|
9
9
|
"module": "dist/overmap-core.js",
|