mirror of
https://github.com/kissyjpf/rtm-sync.git
synced 2026-07-22 07:02:51 +00:00
- Replace setCssStyles() with CSS classes (avoids Obsidian 1.6+ API) - Rename heading "Remember The Milk Settings" -> "RTM Sync" (no-settings-in-heading) - Add RTM API response interfaces to eliminate all any-type warnings - Type callRtmApi return as RtmResponse - Fix remaining Promise void warnings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
17 KiB
JavaScript
26 lines
17 KiB
JavaScript
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var Y=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var at=Object.prototype.hasOwnProperty;var ot=(E,h)=>{for(var n in h)Y(E,n,{get:h[n],enumerable:!0})},ct=(E,h,n,d)=>{if(h&&typeof h=="object"||typeof h=="function")for(let s of rt(h))!at.call(E,s)&&s!==n&&Y(E,s,{get:()=>h[s],enumerable:!(d=it(h,s))||d.enumerable});return E};var lt=E=>ct(Y({},"__esModule",{value:!0}),E);var ut={};ot(ut,{default:()=>X});module.exports=lt(ut);var m=require("obsidian");function M(E){function h(w,k){return w<<k|w>>>32-k}function n(w,k){let A=w&1073741824,T=k&1073741824,F=w&2147483648,C=k&2147483648,b=(w&1073741823)+(k&1073741823);return A&T?b^2147483648^F^C:A|T?b&1073741824?b^3221225472^F^C:b^1073741824^F^C:b^F^C}function d(w,k,A){return w&k|~w&A}function s(w,k,A){return w&A|k&~A}function l(w,k,A){return w^k^A}function c(w,k,A){return k^(w|~A)}function u(w,k,A,T,F,C,b){return w=n(w,n(n(d(k,A,T),F),b)),n(h(w,C),k)}function p(w,k,A,T,F,C,b){return w=n(w,n(n(s(k,A,T),F),b)),n(h(w,C),k)}function f(w,k,A,T,F,C,b){return w=n(w,n(n(l(k,A,T),F),b)),n(h(w,C),k)}function g(w,k,A,T,F,C,b){return w=n(w,n(n(c(k,A,T),F),b)),n(h(w,C),k)}function y(w){let k,A=w.length,T=A+8,C=((T-T%64)/64+1)*16,b=Array(C-1),J=0,N=0;for(;N<A;)k=(N-N%4)/4,J=N%4*8,b[k]=b[k]|w.charCodeAt(N)<<J,N++;return k=(N-N%4)/4,J=N%4*8,b[k]=b[k]|128<<J,b[C-2]=A<<3,b[C-1]=A>>>29,b}function x(w){let k="",A="",T,F;for(F=0;F<=3;F++)T=w>>>F*8&255,A="0"+T.toString(16),k=k+A.substr(A.length-2,2);return k}function S(w){w=w.replace(/\r\n/g,`
|
|
`);let k="";for(let A=0;A<w.length;A++){let T=w.charCodeAt(A);T<128?k+=String.fromCharCode(T):T>127&&T<2048?(k+=String.fromCharCode(T>>6|192),k+=String.fromCharCode(T&63|128)):(k+=String.fromCharCode(T>>12|224),k+=String.fromCharCode(T>>6&63|128),k+=String.fromCharCode(T&63|128))}return k}let o=Array(),i,B,D,R,P,e,t,a,r,L=7,_=12,$=17,I=22,v=5,O=9,W=14,j=20,V=4,K=11,U=16,H=23,G=6,q=10,Q=15,z=21;for(E=S(E),o=y(E),e=1732584193,t=4023233417,a=2562383102,r=271733878,i=0;i<o.length;i+=16)B=e,D=t,R=a,P=r,e=u(e,t,a,r,o[i+0],L,3614090360),r=u(r,e,t,a,o[i+1],_,3905402710),a=u(a,r,e,t,o[i+2],$,606105819),t=u(t,a,r,e,o[i+3],I,3250441966),e=u(e,t,a,r,o[i+4],L,4118548399),r=u(r,e,t,a,o[i+5],_,1200080426),a=u(a,r,e,t,o[i+6],$,2821735955),t=u(t,a,r,e,o[i+7],I,4249261313),e=u(e,t,a,r,o[i+8],L,1770035416),r=u(r,e,t,a,o[i+9],_,2336552879),a=u(a,r,e,t,o[i+10],$,4294925233),t=u(t,a,r,e,o[i+11],I,2304563134),e=u(e,t,a,r,o[i+12],L,1804603682),r=u(r,e,t,a,o[i+13],_,4254626195),a=u(a,r,e,t,o[i+14],$,2792965006),t=u(t,a,r,e,o[i+15],I,1236535329),e=p(e,t,a,r,o[i+1],v,4129170786),r=p(r,e,t,a,o[i+6],O,3225465664),a=p(a,r,e,t,o[i+11],W,643717713),t=p(t,a,r,e,o[i+0],j,3921069994),e=p(e,t,a,r,o[i+5],v,3593408605),r=p(r,e,t,a,o[i+10],O,38016083),a=p(a,r,e,t,o[i+15],W,3634488961),t=p(t,a,r,e,o[i+4],j,3889429448),e=p(e,t,a,r,o[i+9],v,568446438),r=p(r,e,t,a,o[i+14],O,3275163606),a=p(a,r,e,t,o[i+3],W,4107603335),t=p(t,a,r,e,o[i+8],j,1163531501),e=p(e,t,a,r,o[i+13],v,2850285829),r=p(r,e,t,a,o[i+2],O,4243563512),a=p(a,r,e,t,o[i+7],W,1735328473),t=p(t,a,r,e,o[i+12],j,2368359562),e=f(e,t,a,r,o[i+5],V,4294588738),r=f(r,e,t,a,o[i+8],K,2272392833),a=f(a,r,e,t,o[i+11],U,1839030562),t=f(t,a,r,e,o[i+14],H,4259657740),e=f(e,t,a,r,o[i+1],V,2763975236),r=f(r,e,t,a,o[i+4],K,1272893353),a=f(a,r,e,t,o[i+7],U,4139469664),t=f(t,a,r,e,o[i+10],H,3200236656),e=f(e,t,a,r,o[i+13],V,681279174),r=f(r,e,t,a,o[i+0],K,3936430074),a=f(a,r,e,t,o[i+3],U,3572445317),t=f(t,a,r,e,o[i+6],H,76029189),e=f(e,t,a,r,o[i+9],V,3654602809),r=f(r,e,t,a,o[i+12],K,3873151461),a=f(a,r,e,t,o[i+15],U,530742520),t=f(t,a,r,e,o[i+2],H,3299628645),e=g(e,t,a,r,o[i+0],G,4096336452),r=g(r,e,t,a,o[i+7],q,1126891415),a=g(a,r,e,t,o[i+14],Q,2878612391),t=g(t,a,r,e,o[i+5],z,4237533241),e=g(e,t,a,r,o[i+12],G,1700485571),r=g(r,e,t,a,o[i+3],q,2399980690),a=g(a,r,e,t,o[i+10],Q,4293915773),t=g(t,a,r,e,o[i+1],z,2240044497),e=g(e,t,a,r,o[i+8],G,1873313359),r=g(r,e,t,a,o[i+15],q,4264355552),a=g(a,r,e,t,o[i+6],Q,2734768916),t=g(t,a,r,e,o[i+13],z,1309151649),e=g(e,t,a,r,o[i+4],G,4149444226),r=g(r,e,t,a,o[i+11],q,3174756917),a=g(a,r,e,t,o[i+2],Q,718787259),t=g(t,a,r,e,o[i+9],z,3951481745),e=n(e,B),t=n(t,D),a=n(a,R),r=n(r,P);return(x(e)+x(t)+x(a)+x(r)).toLowerCase()}var dt="https://www.rememberthemilk.com/services/auth/",nt="https://api.rememberthemilk.com/services/rest/",mt={apiKey:"",sharedSecret:"",authToken:"",defaultDueForNewTask:"none",noteCreationFolder:"",importWithNotesAndLink:!1},X=class extends m.Plugin{constructor(){super(...arguments);this.timeline=null}async onload(){await this.loadSettings(),this.addSettingTab(new et(this.app,this)),this.addCommand({id:"import-rtm-tasks",name:"Download all incomplete tasks",editorCallback:async(n,d)=>{this.checkAuth()&&await this.fetchAndProcessTasks("status:incomplete",!1,s=>{this.insertTasksToEditor(n,s)})}}),this.addCommand({id:"select-rtm-tasks",name:"Select and import tasks",editorCallback:async(n,d)=>{this.checkAuth()&&await this.fetchAndProcessTasks("status:incomplete",!0,s=>{this.insertTasksToEditor(n,s)})}}),this.addCommand({id:"import-rtm-tasks-custom",name:"Download tasks (Custom Filter)",editorCallback:async(n,d)=>{this.checkAuth()&&new tt(this.app,s=>{this.fetchAndProcessTasks(s,!0,l=>{this.insertTasksToEditor(n,l)})}).open()}}),this.addCommand({id:"create-note-from-rtm-task",name:"Create note from RTM task",callback:async()=>{this.checkAuth()&&await this.fetchAndProcessTasks("status:incomplete",!0,n=>{this.createNotesFromTasks(n)})}}),this.addCommand({id:"add-rtm-task",name:"Add cursor line to RTM",editorCallback:async(n,d)=>{this.checkAuth()&&await this.addTaskFromEditor(n,d)}}),this.addCommand({id:"complete-rtm-task",name:"Complete task at cursor",editorCallback:async(n,d)=>{this.checkAuth()&&await this.completeTaskInEditor(n)}})}checkAuth(){return!this.settings.apiKey||!this.settings.sharedSecret?(new m.Notice("Please set your API Key and Secret in settings."),!1):this.settings.authToken?!0:(new m.Notice("Please authenticate with RTM from settings."),!1)}async fetchListsMap(){var d;let n={};try{let s=await this.callRtmApi("rtm.lists.getList");if((d=s.rsp.lists)!=null&&d.list){let l=Array.isArray(s.rsp.lists.list)?s.rsp.lists.list:[s.rsp.lists.list];for(let c of l)c!=null&&c.id&&(c!=null&&c.name)&&(n[c.id]=c.name)}}catch(s){console.error("List fetch error:",s)}return n}async fetchAndProcessTasks(n,d,s){var l,c,u,p;new m.Notice("Fetching tasks...");try{let f=await this.fetchListsMap(),g=await this.callRtmApi("rtm.tasks.getList",{filter:n,notes:"1"});if(!((l=g.rsp.tasks)!=null&&l.list)){new m.Notice("No tasks found.");return}let y=[],x=Array.isArray(g.rsp.tasks.list)?g.rsp.tasks.list:[g.rsp.tasks.list];for(let S of x){if(!S.taskseries)continue;let o=Array.isArray(S.taskseries)?S.taskseries:[S.taskseries];for(let i of o){let B=i.name,D=Array.isArray(i.task)?i.task[0]:i.task,R=S.id;!R&&i.list_id&&(R=i.list_id),R||(R="MISSING");let P="";D.due&&D.due!==""&&(P=`\u{1F4C5} ${D.due.split("T")[0]}`);let e="";D.start&&D.start!==""&&(e=`\u{1F6EB} ${D.start.split("T")[0]}`);let t="";switch(D.priority){case"1":t="\u{1F53A}";break;case"2":t="\u{1F53C}";break;case"3":t="\u{1F53D}";break}let a=(c=f[R])!=null?c:"",r=[];(u=i.tags)!=null&&u.tag&&(Array.isArray(i.tags.tag)?i.tags.tag:[i.tags.tag]).forEach($=>r.push($));let L=[];(p=i.notes)!=null&&p.note&&(Array.isArray(i.notes.note)?i.notes.note:[i.notes.note]).forEach($=>{var v;let I=(v=$.$t)!=null?v:String($);I&&L.push(I)}),y.push({name:B,due:P,start:e,priority:t,listName:a,tags:r,notes:L,rtmId:{list:R,series:i.id,task:D.id},rawPriority:D.priority,rawDue:D.due})}}d?new Z(this.app,y,S=>{s(S)}).open():s(y)}catch(f){console.error(f),new m.Notice("Fetch error.")}}insertTasksToEditor(n,d){if(d.length===0){new m.Notice("No tasks selected.");return}let s="";for(let l of d){let c="";l.listName&&(c=` #${l.listName.replace(/[\s,.]+/g,"_")}`);let u=l.tags.map(y=>` #${y}`).join(""),p=`[\u{1F42E}](rtm:${l.rtmId.list}:${l.rtmId.series}:${l.rtmId.task})`,f=l.priority?` ${l.priority}`:"",g=l.due?` ${l.due}`:"";if(s+=`- [ ] ${p} ${l.name}${f}${g}${c}${u}
|
|
`,this.settings.importWithNotesAndLink){let y=`https://www.rememberthemilk.com/app/#all/${l.rtmId.task}`;s+=` - RTM Link: ${y}
|
|
`,l.notes&&l.notes.length>0&&l.notes.forEach(x=>{x.split(`
|
|
`).forEach(o=>{o.trim()!==""&&(s+=` - Note: ${o}
|
|
`)})})}}n.replaceSelection(s),new m.Notice(`${d.length} tasks inserted.`)}async createNotesFromTasks(n){if(n.length===0){new m.Notice("No tasks selected.");return}let d=0;for(let s of n){let l=s.name.replace(/[\\/:*?"<>|]/g,"-"),c=this.settings.noteCreationFolder.trim();c.endsWith("/")&&(c=c.slice(0,-1)),c.startsWith("/")&&(c=c.slice(1)),c&&await this.ensureFolderExists(c);let u=c?`${c}/${l}.md`:`${l}.md`;this.app.vault.getAbstractFileByPath(u)&&(u=c?`${c}/${l}-${Date.now()}.md`:`${l}-${Date.now()}.md`);let p=s.tags.map(y=>`#${y}`).join(" "),f=s.listName?`#${s.listName.replace(/[\s,.]+/g,"_")}`:"",g=`# ${s.name}
|
|
|
|
`;g+=`- **RTM Link**: [\u{1F42E} Open Task](rtm:${s.rtmId.list}:${s.rtmId.series}:${s.rtmId.task})
|
|
`,s.due&&(g+=`- **Due**: ${s.due}
|
|
`),s.start&&(g+=`- **Start**: ${s.start}
|
|
`),s.priority&&(g+=`- **Priority**: ${s.priority}
|
|
`),(f||p)&&(g+=`- **Tags**: ${f} ${p}
|
|
`),g+=`
|
|
---
|
|
|
|
`,s.notes.length>0?(g+=`## Notes
|
|
|
|
`,s.notes.forEach(y=>{g+=`${y}
|
|
|
|
`})):g+=`(No notes in RTM)
|
|
`;try{await this.app.vault.create(u,g),d++}catch(y){console.error(`Failed to create file: ${u}`,y),new m.Notice(`Failed to create note for "${s.name}"`)}}new m.Notice(`${d} notes created.`)}async addTaskFromEditor(n,d){var p;let s=n.getCursor(),c=n.getLine(s.line).replace(/^[-*] \[[ x]\] /,"").replace(/^[-*] /,"").trim();if(!c){new m.Notice("Task name is empty.");return}new m.Notice(`Adding: ${c}`);let u=d.file?d.file.basename:"";try{let f=await this.getTimeline(),y=(p=(await this.callRtmApi("rtm.tasks.add",{timeline:f,name:c,parse:"1"})).rsp.tasks)==null?void 0:p.list,x=Array.isArray(y)?y[0]:y!=null?y:{id:"",taskseries:void 0},S=x.id,o=x.taskseries,i=Array.isArray(o)?o[0]:o!=null?o:{id:"",name:"",task:{id:"",due:"",start:"",priority:"",completed:""}},B=i.id,R=(Array.isArray(i.task)?i.task[0]:i.task).id;if(this.settings.defaultDueForNewTask==="today")try{await this.callRtmApi("rtm.tasks.setDueDate",{timeline:f,list_id:S,taskseries_id:B,task_id:R,due:"today",parse:"1"})}catch(t){console.error("Failed to set due date",t)}if(u)try{await this.callRtmApi("rtm.tasks.notes.add",{timeline:f,list_id:S,taskseries_id:B,task_id:R,note_title:"Obsidian Link",note_text:`From Obsidian Note: [[${u}]]`})}catch(t){console.error("Failed to add note to RTM task",t)}let e=`- [ ] ${`[\u{1F42E}](rtm:${S}:${B}:${R})`} ${c}`;n.setLine(s.line,e),new m.Notice("Added to RTM!")}catch(f){console.error("Add Task Error:",f),new m.Notice("Add error.")}}async completeTaskInEditor(n){let d=n.getCursor(),s=n.getLine(d.line),l=/\(rtm:([\w\d]+):([\w\d]+):([\w\d]+)\)/,c=s.match(l);if(!c){new m.Notice("Error: No RTM Link found.");return}let u=c[1],p=c[2],f=c[3];if(!u||u==="MISSING"){new m.Notice("Error: List ID invalid.");return}new m.Notice("Completing task...");try{let g=await this.getTimeline();await this.callRtmApi("rtm.tasks.complete",{timeline:g,list_id:u,taskseries_id:p,task_id:f});let y=s.replace("- [ ]","- [x]");n.setLine(d.line,y),new m.Notice("Task completed!")}catch(g){console.error("Completion Error:",g),new m.Notice("Completion error.")}}async getTimeline(){var d;if(this.timeline)return this.timeline;let n=await this.callRtmApi("rtm.timelines.create");return this.timeline=(d=n.rsp.timeline)!=null?d:"",this.timeline}async callRtmApi(n,d={}){var x;let s=this.settings.apiKey,l=this.settings.sharedSecret;if(!s||!l)throw new Error("API Key/Secret missing");let c={...d,method:n,api_key:s,format:"json",auth_token:this.settings.authToken},u=Object.keys(c).sort(),p=l;for(let S of u)p+=S+c[S];c.api_sig=M(p);let f=`${nt}?${new URLSearchParams(c).toString()}`,y=(await(0,m.requestUrl)({url:f})).json;if(y.rsp.stat!=="ok")throw console.error("API Error:",y),new Error(`API Error: ${(x=y.rsp.err)==null?void 0:x.msg}`);return y}async ensureFolderExists(n){if(!n)return;let d=n.split("/"),s="";for(let l of d)if(l&&(s=s===""?l:`${s}/${l}`,!this.app.vault.getAbstractFileByPath(s)))try{await this.app.vault.createFolder(s)}catch(c){console.error(`Failed to create folder: ${s}`,c)}}async loadSettings(){this.settings=Object.assign({},mt,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}},Z=class extends m.Modal{constructor(h,n,d){super(h),this.tasks=n,this.selected=new Array(n.length).fill(!1),this.onSubmit=d}onOpen(){let{contentEl:h}=this;new m.Setting(h).setName(`Select Tasks (${this.tasks.length})`).setHeading();let n=h.createDiv({cls:"rtm-task-list"});this.tasks.forEach((c,u)=>{var y;let p=n.createDiv({cls:"rtm-task-item"}),f=p.createEl("input",{type:"checkbox"});f.checked=(y=this.selected[u])!=null?y:!1,f.onchange=x=>{this.selected[u]=x.target.checked};let g=p.createSpan({cls:"rtm-task-label"});g.createEl("b",{text:c.name}),c.listName&&g.createEl("small",{text:` [${c.listName}]`,cls:"rtm-task-list-name"}),c.due&&g.createEl("small",{text:` ${c.due}`,cls:"rtm-task-due"}),c.notes&&c.notes.length>0&&g.createEl("small",{text:" \u{1F4DD}"})});let d=h.createDiv({cls:"rtm-btn-row"}),s=d.createEl("button",{text:"Select All"});s.onclick=()=>{let c=this.selected.every(Boolean);this.selected.fill(!c),n.querySelectorAll('input[type="checkbox"]').forEach(p=>p.checked=!c),s.textContent=c?"Select All":"Deselect All"};let l=d.createEl("button",{text:"Process Selected"});l.className="mod-cta",l.onclick=()=>{let c=this.tasks.filter((u,p)=>this.selected[p]);this.onSubmit(c),this.close()}}onClose(){this.contentEl.empty()}},tt=class extends m.Modal{constructor(h,n){super(h),this.onSubmit=n}onOpen(){let{contentEl:h}=this;h.createEl("h3",{text:"Filter RTM Tasks"}),new m.Setting(h).setName("Search Query").setDesc("e.g. list:Inbox, due:today").addText(n=>n.setValue("status:incomplete").onChange(d=>{}).inputEl.addEventListener("keydown",d=>{d.key==="Enter"&&(this.onSubmit(n.getValue()),this.close())})),new m.Setting(h).addButton(n=>n.setButtonText("Search").setCta().onClick(()=>{let d=h.querySelector("input");d&&(this.onSubmit(d.value),this.close())}))}onClose(){this.contentEl.empty()}},et=class extends m.PluginSettingTab{constructor(h,n){super(h,n),this.plugin=n}display(){let{containerEl:h}=this;h.empty(),new m.Setting(h).setName("RTM Sync").setHeading(),h.createEl("p",{text:`Version: ${this.plugin.manifest.version} (Build: 6/13/2026, 6:23:04 PM)`,cls:"setting-item-description rtm-version-info"}),new m.Setting(h).setName("API Key").addText(s=>s.setValue(this.plugin.settings.apiKey).onChange(async l=>{this.plugin.settings.apiKey=l,await this.plugin.saveSettings()})),new m.Setting(h).setName("Shared Secret").addText(s=>s.setValue(this.plugin.settings.sharedSecret).onChange(async l=>{this.plugin.settings.sharedSecret=l,await this.plugin.saveSettings()}));let d=new m.Setting(h).setName("Auth");this.plugin.settings.authToken&&d.setDesc("\u2705 Authorized"),d.addButton(s=>s.setButtonText("Start Auth").onClick(async()=>await this.startAuthProcess())),new m.Setting(h).setName("Default Due Date").setDesc("Setting for new tasks created from editor").addDropdown(s=>s.addOption("none","No Due Date").addOption("today","Today").setValue(this.plugin.settings.defaultDueForNewTask).onChange(async l=>{this.plugin.settings.defaultDueForNewTask=l,await this.plugin.saveSettings()})),new m.Setting(h).setName("Note Creation Folder").setDesc("Folder to create notes from RTM tasks.").addDropdown(s=>{s.addOption("","/ (Vault Root)"),this.app.vault.getAllLoadedFiles().filter(c=>c instanceof m.TFolder).forEach(c=>{c.path!=="/"&&s.addOption(c.path,c.path)}),s.setValue(this.plugin.settings.noteCreationFolder),s.onChange(async c=>{this.plugin.settings.noteCreationFolder=c,await this.plugin.saveSettings()})}),new m.Setting(h).setName("Import with Notes and RTM Link").setDesc("When inserting tasks to the editor, also include RTM task notes and links as sub-items.").addToggle(s=>s.setValue(this.plugin.settings.importWithNotesAndLink).onChange(async l=>{this.plugin.settings.importWithNotesAndLink=l,await this.plugin.saveSettings()}))}async startAuthProcess(){var y;let h=this.plugin,n=h.settings.apiKey,d=h.settings.sharedSecret;if(!n||!d){new m.Notice("Enter keys first");return}let s={method:"rtm.auth.getFrob",api_key:n,format:"json"},l=d;Object.keys(s).sort().forEach(x=>l+=x+s[x]),s.api_sig=M(l);let u=(y=(await(0,m.requestUrl)({url:`${nt}?${new URLSearchParams(s).toString()}`})).json.rsp.frob)!=null?y:"",p={api_key:n,perms:"delete",frob:u},f=d;Object.keys(p).sort().forEach(x=>f+=x+p[x]);let g=M(f);window.open(`${dt}?api_key=${n}&perms=delete&frob=${u}&api_sig=${g}`),new st(this.app,u,h,()=>{this.display()}).open()}},st=class extends m.Modal{constructor(h,n,d,s){super(h),this.frob=n,this.plugin=d,this.onSuccess=s}onOpen(){let{contentEl:h}=this;new m.Setting(h).addButton(n=>n.setButtonText("Finish Auth").setCta().onClick(async()=>{let d=this.plugin.settings.apiKey,s=this.plugin.settings.sharedSecret,l={method:"rtm.auth.getToken",api_key:d,format:"json",frob:this.frob},c=s;Object.keys(l).sort().forEach(u=>c+=u+l[u]),l.api_sig=M(c);try{let p=(await(0,m.requestUrl)({url:`${nt}?${new URLSearchParams(l).toString()}`})).json;p.rsp.auth?(this.plugin.settings.authToken=p.rsp.auth.token,await this.plugin.saveSettings(),new m.Notice("Success!"),this.onSuccess(),this.close()):new m.Notice("Failed.")}catch(u){new m.Notice("Error.")}}))}onClose(){this.contentEl.empty()}};
|