@searchability/admin-client 0.0.4 → 0.0.6

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.
@@ -0,0 +1,15 @@
1
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x46a965,_0x33c839,_0x1b60c3,_0x494c12){function _0x26615e(_0x36a14b){return _0x36a14b instanceof _0x1b60c3?_0x36a14b:new _0x1b60c3(function(_0x463343){_0x463343(_0x36a14b);});}return new(_0x1b60c3||(_0x1b60c3=Promise))(function(_0x3256ed,_0x6e8a6e){function _0x43ec3b(_0x35aa13){try{_0x11a50e(_0x494c12['next'](_0x35aa13));}catch(_0x12dcf1){_0x6e8a6e(_0x12dcf1);}}function _0x3d78f3(_0x6343be){try{_0x11a50e(_0x494c12['throw'](_0x6343be));}catch(_0x581c88){_0x6e8a6e(_0x581c88);}}function _0x11a50e(_0x15f2ce){_0x15f2ce['done']?_0x3256ed(_0x15f2ce['value']):_0x26615e(_0x15f2ce['value'])['then'](_0x43ec3b,_0x3d78f3);}_0x11a50e((_0x494c12=_0x494c12['apply'](_0x46a965,_0x33c839||[]))['next']());});};class Fetch{static['get'](_0x4f573f,_0x88617c){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x4f573f,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x88617c}});});}static['post'](_0x1b417f,_0x366ec5,_0x43a3e4){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1b417f,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x366ec5},'body':_0x43a3e4?JSON['stringify'](_0x43a3e4):null});});}static['put'](_0x3ac1a8,_0x4d0a9e,_0x46212b){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3ac1a8,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4d0a9e},'body':_0x46212b?JSON['stringify'](_0x46212b):null});});}static['delete'](_0x1519b6,_0x386bc9){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1519b6,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x386bc9}});});}}
2
+
3
+ class Response{constructor(_0x1d0182){this['isSuccess']=_0x1d0182;}}class SuccessfulAccountResponse extends Response{constructor(_0x140b15){super(!![]),this['account']=_0x140b15;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x58d03f){super(![]),this['problem']=_0x58d03f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x1adb70){super(!![]),this['tokens']=_0x1adb70;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0xbab52b){super(![]),this['problem']=_0xbab52b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
+
5
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x2443c9,_0x239570,_0x550ee6,_0x7fc0b2){function _0x49c2a7(_0x3c45f5){return _0x3c45f5 instanceof _0x550ee6?_0x3c45f5:new _0x550ee6(function(_0x38664c){_0x38664c(_0x3c45f5);});}return new(_0x550ee6||(_0x550ee6=Promise))(function(_0x411828,_0x300911){function _0x30434f(_0x416f1f){try{_0x4783fe(_0x7fc0b2['next'](_0x416f1f));}catch(_0x114aec){_0x300911(_0x114aec);}}function _0x4c40cb(_0x2045d3){try{_0x4783fe(_0x7fc0b2['throw'](_0x2045d3));}catch(_0x9133fb){_0x300911(_0x9133fb);}}function _0x4783fe(_0x52f5ea){_0x52f5ea['done']?_0x411828(_0x52f5ea['value']):_0x49c2a7(_0x52f5ea['value'])['then'](_0x30434f,_0x4c40cb);}_0x4783fe((_0x7fc0b2=_0x7fc0b2['apply'](_0x2443c9,_0x239570||[]))['next']());});};class AccountService{constructor(_0xeee73){this['baseUri']=_0xeee73;}['get'](_0x293955,_0x445a1c){return __awaiter$3(this,arguments,void 0,function*(_0x8a39be,_0x54545e,_0x570364={}){var _0x24ac2e;let _0x2dca72=(_0x24ac2e=_0x570364['baseUri'])!==null&&_0x24ac2e!==void 0?_0x24ac2e:this['baseUri'];!_0x2dca72['endsWith']('/')&&(_0x2dca72=_0x2dca72+'/');_0x2dca72=_0x2dca72+'Account/'+_0x54545e+'/';const _0x3213f9=yield Fetch['get'](_0x2dca72,_0x8a39be);if(_0x3213f9['status']>0xc7&&_0x3213f9['status']<0x12c){const _0x399f87=yield _0x3213f9['json']();return new SuccessfulAccountResponse(_0x399f87);}const _0x12eecb=yield _0x3213f9['json']();return new FailedAccountResponse(_0x12eecb);});}}
6
+
7
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x26eb58,_0x5c255b,_0x2ec01f,_0x3fdd0e){function _0x265a3a(_0x4e0752){return _0x4e0752 instanceof _0x2ec01f?_0x4e0752:new _0x2ec01f(function(_0x5bcb6c){_0x5bcb6c(_0x4e0752);});}return new(_0x2ec01f||(_0x2ec01f=Promise))(function(_0x1e7cd8,_0x2d983e){function _0x5b5ce9(_0x5e0e11){try{_0x3bc669(_0x3fdd0e['next'](_0x5e0e11));}catch(_0x22fd7f){_0x2d983e(_0x22fd7f);}}function _0xdd19de(_0x337351){try{_0x3bc669(_0x3fdd0e['throw'](_0x337351));}catch(_0x3a0b6f){_0x2d983e(_0x3a0b6f);}}function _0x3bc669(_0x42cb38){_0x42cb38['done']?_0x1e7cd8(_0x42cb38['value']):_0x265a3a(_0x42cb38['value'])['then'](_0x5b5ce9,_0xdd19de);}_0x3bc669((_0x3fdd0e=_0x3fdd0e['apply'](_0x26eb58,_0x5c255b||[]))['next']());});};class ListService{constructor(_0x593f0f){this['baseUri']=_0x593f0f;}['add'](_0x50a9b4,_0x1a55a8,_0x4f7da1){return __awaiter$2(this,arguments,void 0,function*(_0x13e77f,_0x358d68,_0x422ffd,_0x10d315={}){var _0x3b5cdf;let _0x15d333=(_0x3b5cdf=_0x10d315['baseUri'])!==null&&_0x3b5cdf!==void 0?_0x3b5cdf:this['baseUri'];!_0x15d333['endsWith']('/')&&(_0x15d333=_0x15d333+'/');_0x15d333=_0x15d333+'List';const _0x3613d6={'account_name':_0x358d68,'list_name':_0x422ffd},_0x3f69ef=yield Fetch['post'](_0x15d333,_0x13e77f,_0x3613d6);if(_0x3f69ef['status']>0xc7&&_0x3f69ef['status']<0x12c){const _0x39cb67=yield _0x3f69ef['json']();return new SuccessfulAccountResponse(_0x39cb67);}const _0x19ecb5=yield _0x3f69ef['json']();return new FailedAccountResponse(_0x19ecb5);});}['remove'](_0x20cb38,_0x4e5758,_0x41e616){return __awaiter$2(this,arguments,void 0,function*(_0x2893c2,_0x450bf4,_0x57bfb8,_0x48c3a3={}){var _0x6383bb;let _0x4a140d=(_0x6383bb=_0x48c3a3['baseUri'])!==null&&_0x6383bb!==void 0?_0x6383bb:this['baseUri'];_0x4a140d=_0x4a140d+'/List/'+_0x450bf4+'/'+_0x57bfb8;const _0x584d1f=yield Fetch['delete'](_0x4a140d,_0x2893c2);if(_0x584d1f['status']>0xc7&&_0x584d1f['status']<0x12c){const _0x8c74f2=yield _0x584d1f['json']();return new SuccessfulAccountResponse(_0x8c74f2);}const _0x5537ee=yield _0x584d1f['json']();return new FailedAccountResponse(_0x5537ee);});}}
8
+
9
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x423627,_0x369906,_0x11beb4,_0x472d9b){function _0x2a8c89(_0x23167c){return _0x23167c instanceof _0x11beb4?_0x23167c:new _0x11beb4(function(_0xb63c95){_0xb63c95(_0x23167c);});}return new(_0x11beb4||(_0x11beb4=Promise))(function(_0xa91a55,_0x1b8089){function _0x4412cd(_0x5827d3){try{_0x43fa5b(_0x472d9b['next'](_0x5827d3));}catch(_0x2f2299){_0x1b8089(_0x2f2299);}}function _0x589f54(_0xa5d68e){try{_0x43fa5b(_0x472d9b['throw'](_0xa5d68e));}catch(_0x22a381){_0x1b8089(_0x22a381);}}function _0x43fa5b(_0x8694a){_0x8694a['done']?_0xa91a55(_0x8694a['value']):_0x2a8c89(_0x8694a['value'])['then'](_0x4412cd,_0x589f54);}_0x43fa5b((_0x472d9b=_0x472d9b['apply'](_0x423627,_0x369906||[]))['next']());});};class TokenManager{constructor(_0x39d0eb){this['securityService']=_0x39d0eb;}['RefreshTokens'](_0x3d0008){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x3d0008['access_expires'])return new SuccessfulRefreshResponse(_0x3d0008);if(Date['now']()>_0x3d0008['refresh_expires']){const _0x11d377={'details':'','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x11d377);}const _0x4ce9d5=yield this['securityService']['refresh'](_0x3d0008['refresh_token']);if(!_0x4ce9d5['isSuccess'])return new FailedRefreshResponse(_0x4ce9d5['toProblem']());return new SuccessfulRefreshResponse(_0x4ce9d5['toSuccess']());});}}
10
+
11
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x3ebed8,_0x23b8d3,_0x19ab83,_0x1c34c5){function _0x205e68(_0x45129c){return _0x45129c instanceof _0x19ab83?_0x45129c:new _0x19ab83(function(_0x105d76){_0x105d76(_0x45129c);});}return new(_0x19ab83||(_0x19ab83=Promise))(function(_0x314ba3,_0x1e9b5d){function _0xda23fc(_0x3b0bc8){try{_0x1fa216(_0x1c34c5['next'](_0x3b0bc8));}catch(_0x227034){_0x1e9b5d(_0x227034);}}function _0x9b044d(_0x47fa45){try{_0x1fa216(_0x1c34c5['throw'](_0x47fa45));}catch(_0xae203d){_0x1e9b5d(_0xae203d);}}function _0x1fa216(_0x36028a){_0x36028a['done']?_0x314ba3(_0x36028a['value']):_0x205e68(_0x36028a['value'])['then'](_0xda23fc,_0x9b044d);}_0x1fa216((_0x1c34c5=_0x1c34c5['apply'](_0x3ebed8,_0x23b8d3||[]))['next']());});};class SecurityService{constructor(_0x239d01){this['baseUri']=_0x239d01,this['tokenManager']=new TokenManager(this);}['refresh'](_0x589c57){return __awaiter(this,arguments,void 0,function*(_0x16ad97,_0x249f7a={}){var _0x35dc9d;let _0x310ea0=(_0x35dc9d=_0x249f7a['baseUri'])!==null&&_0x35dc9d!==void 0?_0x35dc9d:this['baseUri'];!_0x310ea0['endsWith']('/')&&(_0x310ea0=_0x310ea0+'/');_0x310ea0=_0x310ea0+'Security/Refresh';const _0x3565c6=yield Fetch['post'](_0x310ea0,_0x16ad97,null);if(_0x3565c6['status']>0xc7&&_0x3565c6['status']<0x12c){const _0x1ae812=yield _0x3565c6['json']();return new SuccessfulRefreshResponse(_0x1ae812);}const _0x37920e=yield _0x3565c6['json']();return new FailedRefreshResponse(_0x37920e);});}}
12
+
13
+ var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
14
+
15
+ export { AdminClient };
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x443279,_0x436a16,_0x18043b,_0x3976c6){function _0xcdbba6(_0x4880e4){return _0x4880e4 instanceof _0x18043b?_0x4880e4:new _0x18043b(function(_0x198a10){_0x198a10(_0x4880e4);});}return new(_0x18043b||(_0x18043b=Promise))(function(_0x2cdcca,_0x1e7b59){function _0x2f4113(_0x48e99a){try{_0x3e1989(_0x3976c6['next'](_0x48e99a));}catch(_0x50641b){_0x1e7b59(_0x50641b);}}function _0x4ba2eb(_0x3ee2d8){try{_0x3e1989(_0x3976c6['throw'](_0x3ee2d8));}catch(_0x510f66){_0x1e7b59(_0x510f66);}}function _0x3e1989(_0x181b3a){_0x181b3a['done']?_0x2cdcca(_0x181b3a['value']):_0xcdbba6(_0x181b3a['value'])['then'](_0x2f4113,_0x4ba2eb);}_0x3e1989((_0x3976c6=_0x3976c6['apply'](_0x443279,_0x436a16||[]))['next']());});};class Fetch{static['get'](_0x1a2829,_0x4432b4){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1a2829,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4432b4}});});}static['post'](_0x3601ea,_0x39fe3f,_0x47b27f){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3601ea,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x39fe3f},'body':_0x47b27f?JSON['stringify'](_0x47b27f):null});});}static['put'](_0x219d6a,_0x4a85b7,_0x358446){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x219d6a,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4a85b7},'body':_0x358446?JSON['stringify'](_0x358446):null});});}static['delete'](_0x1a41f3,_0x59b929){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1a41f3,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x59b929}});});}}
3
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x228e0e,_0x14b10d,_0x601487,_0x3550d2){function _0x5c94d5(_0xf78992){return _0xf78992 instanceof _0x601487?_0xf78992:new _0x601487(function(_0x5389e2){_0x5389e2(_0xf78992);});}return new(_0x601487||(_0x601487=Promise))(function(_0x46668b,_0x31400e){function _0x5a2c48(_0xb1e38a){try{_0x4b23a7(_0x3550d2['next'](_0xb1e38a));}catch(_0x2d0094){_0x31400e(_0x2d0094);}}function _0x25555c(_0x4c7448){try{_0x4b23a7(_0x3550d2['throw'](_0x4c7448));}catch(_0x5acbcd){_0x31400e(_0x5acbcd);}}function _0x4b23a7(_0x2f0561){_0x2f0561['done']?_0x46668b(_0x2f0561['value']):_0x5c94d5(_0x2f0561['value'])['then'](_0x5a2c48,_0x25555c);}_0x4b23a7((_0x3550d2=_0x3550d2['apply'](_0x228e0e,_0x14b10d||[]))['next']());});};class Fetch{static['get'](_0x5dc12a,_0xaecde0){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x5dc12a,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xaecde0}});});}static['post'](_0x1084ef,_0x4a02af,_0x31d933){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1084ef,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4a02af},'body':_0x31d933?JSON['stringify'](_0x31d933):null});});}static['put'](_0x3bb601,_0x5239ff,_0x33e4d9){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3bb601,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5239ff},'body':_0x33e4d9?JSON['stringify'](_0x33e4d9):null});});}static['delete'](_0xc75b8e,_0x4b7fee){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0xc75b8e,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4b7fee}});});}}
4
4
 
5
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x2c440e,_0x2b9f37,_0x4238ee,_0x1e052b){function _0xaf9b6(_0x38b50e){return _0x38b50e instanceof _0x4238ee?_0x38b50e:new _0x4238ee(function(_0x5986a8){_0x5986a8(_0x38b50e);});}return new(_0x4238ee||(_0x4238ee=Promise))(function(_0x988832,_0xcf1a3f){function _0x1e2e93(_0x4603a9){try{_0x2a36e9(_0x1e052b['next'](_0x4603a9));}catch(_0xdf894e){_0xcf1a3f(_0xdf894e);}}function _0x244ed9(_0x3e1e56){try{_0x2a36e9(_0x1e052b['throw'](_0x3e1e56));}catch(_0x20c376){_0xcf1a3f(_0x20c376);}}function _0x2a36e9(_0x2af5fb){_0x2af5fb['done']?_0x988832(_0x2af5fb['value']):_0xaf9b6(_0x2af5fb['value'])['then'](_0x1e2e93,_0x244ed9);}_0x2a36e9((_0x1e052b=_0x1e052b['apply'](_0x2c440e,_0x2b9f37||[]))['next']());});};class ListService{constructor(_0x4b194e){this['baseUri']=_0x4b194e;}['add'](_0x2f07a6,_0x41e43d,_0x2360ee){return __awaiter$3(this,arguments,void 0,function*(_0x23dd69,_0xea1094,_0x5400e5,_0x302716={}){var _0x2407a7;let _0x48d051=(_0x2407a7=_0x302716['baseUri'])!==null&&_0x2407a7!==void 0?_0x2407a7:this['baseUri'];_0x48d051=_0x48d051+'/List';const _0xd0b91c={'account_name':_0xea1094,'list_name':_0x5400e5},_0x14689e=yield Fetch['post'](_0x48d051,_0x23dd69,_0xd0b91c);if(_0x14689e['status']>0xc7&&_0x14689e['status']<0x12c){const _0x518117=yield _0x14689e['json']();return new SuccessfulAccountResponse(_0x518117);}if(_0x14689e['bodyUsed']){const _0x5c2172=yield _0x14689e['json']();return new FailedAccountResponse(_0x5c2172);}const _0x3ff639={'type':'','status':_0x14689e['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x3ff639);});}['remove'](_0x3f4988,_0x5280d9,_0x733693){return __awaiter$3(this,arguments,void 0,function*(_0x31c7e3,_0x9abbe2,_0x5467af,_0x18180b={}){var _0x6ea324;let _0x3a9c8f=(_0x6ea324=_0x18180b['baseUri'])!==null&&_0x6ea324!==void 0?_0x6ea324:this['baseUri'];_0x3a9c8f=_0x3a9c8f+'/List/'+_0x9abbe2+'/'+_0x5467af;const _0x150ca9=yield Fetch['delete'](_0x3a9c8f,_0x31c7e3);if(_0x150ca9['status']>0xc7&&_0x150ca9['status']<0x12c){const _0x4e058e=yield _0x150ca9['json']();return new SuccessfulAccountResponse(_0x4e058e);}if(_0x150ca9['bodyUsed']){const _0x4d9855=yield _0x150ca9['json']();return new FailedAccountResponse(_0x4d9855);}const _0x2d45a4={'type':'','status':_0x150ca9['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x2d45a4);});}}
5
+ class Response{constructor(_0x587ab8){this['isSuccess']=_0x587ab8;}}class SuccessfulAccountResponse extends Response{constructor(_0x5b9193){super(!![]),this['account']=_0x5b9193;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x244d52){super(![]),this['problem']=_0x244d52;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x18986b){super(!![]),this['tokens']=_0x18986b;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x318272){super(![]),this['problem']=_0x318272;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
6
 
7
- class Response{constructor(_0x179c24){this['isSuccess']=_0x179c24;}}class SuccessfulAccountResponse extends Response{constructor(_0x557fa4){super(!![]),this['account']=_0x557fa4;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x517ed1){super(![]),this['problem']=_0x517ed1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x40c572){super(!![]),this['tokens']=_0x40c572;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0xbd6ac5){super(![]),this['problem']=_0xbd6ac5;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x16ac02,_0x4771a0,_0x2541df,_0x29b898){function _0x47906c(_0x5d204d){return _0x5d204d instanceof _0x2541df?_0x5d204d:new _0x2541df(function(_0x172a63){_0x172a63(_0x5d204d);});}return new(_0x2541df||(_0x2541df=Promise))(function(_0x1d7abf,_0x2833db){function _0x693697(_0x415fd2){try{_0x47e3fa(_0x29b898['next'](_0x415fd2));}catch(_0x560ee8){_0x2833db(_0x560ee8);}}function _0x5d7b31(_0x59f68a){try{_0x47e3fa(_0x29b898['throw'](_0x59f68a));}catch(_0x6b4269){_0x2833db(_0x6b4269);}}function _0x47e3fa(_0x3f9651){_0x3f9651['done']?_0x1d7abf(_0x3f9651['value']):_0x47906c(_0x3f9651['value'])['then'](_0x693697,_0x5d7b31);}_0x47e3fa((_0x29b898=_0x29b898['apply'](_0x16ac02,_0x4771a0||[]))['next']());});};class AccountService{constructor(_0x246d63){this['baseUri']=_0x246d63;}['get'](_0x71bcaa,_0x2beefb){return __awaiter$3(this,arguments,void 0,function*(_0x2a1b42,_0x86c52f,_0x54279e={}){var _0x15b0c2;let _0x4ac683=(_0x15b0c2=_0x54279e['baseUri'])!==null&&_0x15b0c2!==void 0?_0x15b0c2:this['baseUri'];!_0x4ac683['endsWith']('/')&&(_0x4ac683=_0x4ac683+'/');_0x4ac683=_0x4ac683+'Account/'+_0x86c52f+'/';const _0x19da3f=yield Fetch['get'](_0x4ac683,_0x2a1b42);if(_0x19da3f['status']>0xc7&&_0x19da3f['status']<0x12c){const _0x1c47fb=yield _0x19da3f['json']();return new SuccessfulAccountResponse(_0x1c47fb);}const _0x52bdb8=yield _0x19da3f['json']();return new FailedAccountResponse(_0x52bdb8);});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x44eb8a,_0x58c7f0,_0x4e7c44,_0x77da4f){function _0x1e3894(_0x20716f){return _0x20716f instanceof _0x4e7c44?_0x20716f:new _0x4e7c44(function(_0x6af8d9){_0x6af8d9(_0x20716f);});}return new(_0x4e7c44||(_0x4e7c44=Promise))(function(_0x1d39de,_0xfc14a0){function _0x845f0a(_0x5164c4){try{_0x3c578d(_0x77da4f['next'](_0x5164c4));}catch(_0x346964){_0xfc14a0(_0x346964);}}function _0x3297ee(_0x19738f){try{_0x3c578d(_0x77da4f['throw'](_0x19738f));}catch(_0x174aae){_0xfc14a0(_0x174aae);}}function _0x3c578d(_0x3f9124){_0x3f9124['done']?_0x1d39de(_0x3f9124['value']):_0x1e3894(_0x3f9124['value'])['then'](_0x845f0a,_0x3297ee);}_0x3c578d((_0x77da4f=_0x77da4f['apply'](_0x44eb8a,_0x58c7f0||[]))['next']());});};class AccountService{constructor(_0x1f26d5){this['baseUri']=_0x1f26d5;}['get'](_0x31d789,_0x471c04){return __awaiter$2(this,arguments,void 0,function*(_0x5a55ad,_0x519199,_0x193014={}){var _0x283e67;let _0xa48d93=(_0x283e67=_0x193014['baseUri'])!==null&&_0x283e67!==void 0?_0x283e67:this['baseUri'];_0xa48d93=_0xa48d93+'/Account/'+_0x519199+'/';const _0x3b2432=yield Fetch['get'](_0xa48d93,_0x5a55ad);if(_0x3b2432['status']>0xc7&&_0x3b2432['status']<0x12c){const _0x33675d=yield _0x3b2432['json']();return new SuccessfulAccountResponse(_0x33675d);}if(_0x3b2432['bodyUsed']){const _0x523549=yield _0x3b2432['json']();return new FailedAccountResponse(_0x523549);}const _0x4506f1={'type':'','status':_0x3b2432['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x4506f1);});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x5b363e,_0x4c78cb,_0x69b4f6,_0x431b98){function _0x28bc62(_0x47c631){return _0x47c631 instanceof _0x69b4f6?_0x47c631:new _0x69b4f6(function(_0x1812c3){_0x1812c3(_0x47c631);});}return new(_0x69b4f6||(_0x69b4f6=Promise))(function(_0x4e4bfc,_0x5a1f1d){function _0x1e1a15(_0x42f087){try{_0x51e2ab(_0x431b98['next'](_0x42f087));}catch(_0x1ebfd4){_0x5a1f1d(_0x1ebfd4);}}function _0x2f13cd(_0x1251da){try{_0x51e2ab(_0x431b98['throw'](_0x1251da));}catch(_0x53904c){_0x5a1f1d(_0x53904c);}}function _0x51e2ab(_0x30cb33){_0x30cb33['done']?_0x4e4bfc(_0x30cb33['value']):_0x28bc62(_0x30cb33['value'])['then'](_0x1e1a15,_0x2f13cd);}_0x51e2ab((_0x431b98=_0x431b98['apply'](_0x5b363e,_0x4c78cb||[]))['next']());});};class ListService{constructor(_0x45d1d3){this['baseUri']=_0x45d1d3;}['add'](_0x46166f,_0x23a967,_0x4783c4){return __awaiter$2(this,arguments,void 0,function*(_0x262c36,_0x14602b,_0x278c73,_0x4e615b={}){var _0x4b62a1;let _0x25eea8=(_0x4b62a1=_0x4e615b['baseUri'])!==null&&_0x4b62a1!==void 0?_0x4b62a1:this['baseUri'];!_0x25eea8['endsWith']('/')&&(_0x25eea8=_0x25eea8+'/');_0x25eea8=_0x25eea8+'List';const _0x45b0ba={'account_name':_0x14602b,'list_name':_0x278c73},_0x29893e=yield Fetch['post'](_0x25eea8,_0x262c36,_0x45b0ba);if(_0x29893e['status']>0xc7&&_0x29893e['status']<0x12c){const _0x22b5e0=yield _0x29893e['json']();return new SuccessfulAccountResponse(_0x22b5e0);}const _0xf8dba2=yield _0x29893e['json']();return new FailedAccountResponse(_0xf8dba2);});}['remove'](_0xd73407,_0x2064f7,_0xafe621){return __awaiter$2(this,arguments,void 0,function*(_0x2f4090,_0x3deecd,_0x27f736,_0xac84f1={}){var _0xdca412;let _0x125de3=(_0xdca412=_0xac84f1['baseUri'])!==null&&_0xdca412!==void 0?_0xdca412:this['baseUri'];_0x125de3=_0x125de3+'/List/'+_0x3deecd+'/'+_0x27f736;const _0x4227a8=yield Fetch['delete'](_0x125de3,_0x2f4090);if(_0x4227a8['status']>0xc7&&_0x4227a8['status']<0x12c){const _0x3edd43=yield _0x4227a8['json']();return new SuccessfulAccountResponse(_0x3edd43);}const _0x121b80=yield _0x4227a8['json']();return new FailedAccountResponse(_0x121b80);});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5bc795,_0x88fc1e,_0x14330f,_0x406143){function _0x2e6df9(_0xa52a30){return _0xa52a30 instanceof _0x14330f?_0xa52a30:new _0x14330f(function(_0x34e356){_0x34e356(_0xa52a30);});}return new(_0x14330f||(_0x14330f=Promise))(function(_0x471f4a,_0x5ced6b){function _0x17fbab(_0x2a0647){try{_0x2c4253(_0x406143['next'](_0x2a0647));}catch(_0x480d17){_0x5ced6b(_0x480d17);}}function _0x2927f2(_0xa85613){try{_0x2c4253(_0x406143['throw'](_0xa85613));}catch(_0x293094){_0x5ced6b(_0x293094);}}function _0x2c4253(_0x1aae34){_0x1aae34['done']?_0x471f4a(_0x1aae34['value']):_0x2e6df9(_0x1aae34['value'])['then'](_0x17fbab,_0x2927f2);}_0x2c4253((_0x406143=_0x406143['apply'](_0x5bc795,_0x88fc1e||[]))['next']());});};class TokenManager{constructor(_0x224c21){this['securityService']=_0x224c21;}['RefreshTokens'](_0x367645){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x367645['access_expires'])return new SuccessfulRefreshResponse(_0x367645);if(Date['now']()>_0x367645['refresh_expires']){const _0x321add={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x321add);}const _0x47e974=yield this['securityService']['refresh'](_0x367645['refresh_token']);if(!_0x47e974['isSuccess'])return new FailedRefreshResponse(_0x47e974['toProblem']());return new SuccessfulRefreshResponse(_0x47e974['toSuccess']());});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x55d2f3,_0x308481,_0x52bee5,_0x2c5331){function _0x83b136(_0x375084){return _0x375084 instanceof _0x52bee5?_0x375084:new _0x52bee5(function(_0x44960d){_0x44960d(_0x375084);});}return new(_0x52bee5||(_0x52bee5=Promise))(function(_0x5d3bbb,_0x13464d){function _0x209c84(_0x4145a8){try{_0x22d14e(_0x2c5331['next'](_0x4145a8));}catch(_0x252c7b){_0x13464d(_0x252c7b);}}function _0x1f302b(_0x38a39c){try{_0x22d14e(_0x2c5331['throw'](_0x38a39c));}catch(_0x2f5767){_0x13464d(_0x2f5767);}}function _0x22d14e(_0x55ad6b){_0x55ad6b['done']?_0x5d3bbb(_0x55ad6b['value']):_0x83b136(_0x55ad6b['value'])['then'](_0x209c84,_0x1f302b);}_0x22d14e((_0x2c5331=_0x2c5331['apply'](_0x55d2f3,_0x308481||[]))['next']());});};class TokenManager{constructor(_0x4dd521){this['securityService']=_0x4dd521;}['RefreshTokens'](_0x294241){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x294241['access_expires'])return new SuccessfulRefreshResponse(_0x294241);if(Date['now']()>_0x294241['refresh_expires']){const _0x53e77f={'details':'','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x53e77f);}const _0x41a950=yield this['securityService']['refresh'](_0x294241['refresh_token']);if(!_0x41a950['isSuccess'])return new FailedRefreshResponse(_0x41a950['toProblem']());return new SuccessfulRefreshResponse(_0x41a950['toSuccess']());});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x4ba3bd,_0x5bd25f,_0x3ade23,_0xbf2e62){function _0x42314a(_0x428c17){return _0x428c17 instanceof _0x3ade23?_0x428c17:new _0x3ade23(function(_0x1dbeec){_0x1dbeec(_0x428c17);});}return new(_0x3ade23||(_0x3ade23=Promise))(function(_0x5ac8b6,_0x2d3d50){function _0x5967e4(_0x2ca42b){try{_0xd509c7(_0xbf2e62['next'](_0x2ca42b));}catch(_0x1ba6bd){_0x2d3d50(_0x1ba6bd);}}function _0x1a0f44(_0x31da00){try{_0xd509c7(_0xbf2e62['throw'](_0x31da00));}catch(_0x3f7155){_0x2d3d50(_0x3f7155);}}function _0xd509c7(_0x8608d4){_0x8608d4['done']?_0x5ac8b6(_0x8608d4['value']):_0x42314a(_0x8608d4['value'])['then'](_0x5967e4,_0x1a0f44);}_0xd509c7((_0xbf2e62=_0xbf2e62['apply'](_0x4ba3bd,_0x5bd25f||[]))['next']());});};class SecurityService{constructor(_0x3b3eb1){this['baseUri']=_0x3b3eb1,this['tokenManager']=new TokenManager(this);}['refresh'](_0x56d88c){return __awaiter(this,arguments,void 0,function*(_0x393e79,_0x29bd87={}){var _0x17fad9;let _0x40aaeb=(_0x17fad9=_0x29bd87['baseUri'])!==null&&_0x17fad9!==void 0?_0x17fad9:this['baseUri'];_0x40aaeb=_0x40aaeb+'/Security/Refresh';const _0x563425=yield Fetch['post'](_0x40aaeb,_0x393e79,null);if(_0x563425['status']>0xc7&&_0x563425['status']<0x12c){const _0x9919af=yield _0x563425['json']();return new SuccessfulRefreshResponse(_0x9919af);}if(_0x563425['bodyUsed']){const _0x2db682=yield _0x563425['json']();return new FailedRefreshResponse(_0x2db682);}const _0x1f4bb1={'type':'','status':_0x563425['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x1f4bb1);});}}
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x1dbb73,_0x2e1d09,_0x5e50fb,_0x105f4e){function _0xa8c27(_0x4b18cb){return _0x4b18cb instanceof _0x5e50fb?_0x4b18cb:new _0x5e50fb(function(_0x3e9e1d){_0x3e9e1d(_0x4b18cb);});}return new(_0x5e50fb||(_0x5e50fb=Promise))(function(_0x3feff0,_0x26a937){function _0x482fc7(_0x55fb6a){try{_0x4e18fe(_0x105f4e['next'](_0x55fb6a));}catch(_0x343b08){_0x26a937(_0x343b08);}}function _0x3a9dae(_0xa033ba){try{_0x4e18fe(_0x105f4e['throw'](_0xa033ba));}catch(_0x54fa22){_0x26a937(_0x54fa22);}}function _0x4e18fe(_0x5a94b6){_0x5a94b6['done']?_0x3feff0(_0x5a94b6['value']):_0xa8c27(_0x5a94b6['value'])['then'](_0x482fc7,_0x3a9dae);}_0x4e18fe((_0x105f4e=_0x105f4e['apply'](_0x1dbb73,_0x2e1d09||[]))['next']());});};class SecurityService{constructor(_0x10f4c3){this['baseUri']=_0x10f4c3,this['tokenManager']=new TokenManager(this);}['refresh'](_0x36acf0){return __awaiter(this,arguments,void 0,function*(_0x2f2ece,_0x4483fd={}){var _0x323c5b;let _0x352bca=(_0x323c5b=_0x4483fd['baseUri'])!==null&&_0x323c5b!==void 0?_0x323c5b:this['baseUri'];!_0x352bca['endsWith']('/')&&(_0x352bca=_0x352bca+'/');_0x352bca=_0x352bca+'Security/Refresh';const _0x13690b=yield Fetch['post'](_0x352bca,_0x2f2ece,null);if(_0x13690b['status']>0xc7&&_0x13690b['status']<0x12c){const _0x503646=yield _0x13690b['json']();return new SuccessfulRefreshResponse(_0x503646);}const _0x5760f5=yield _0x13690b['json']();return new FailedRefreshResponse(_0x5760f5);});}}
14
14
 
15
- var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
15
+ var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
16
16
 
17
17
  exports.AdminClient = AdminClient;
@@ -1,15 +1,15 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2f4c13,_0x57a28c,_0x5e31e6,_0x4c9520){function _0x535069(_0x4db99a){return _0x4db99a instanceof _0x5e31e6?_0x4db99a:new _0x5e31e6(function(_0x474577){_0x474577(_0x4db99a);});}return new(_0x5e31e6||(_0x5e31e6=Promise))(function(_0x51b2d3,_0x17f12b){function _0x4ece6c(_0x2bae1c){try{_0x421c3d(_0x4c9520['next'](_0x2bae1c));}catch(_0x5cc7df){_0x17f12b(_0x5cc7df);}}function _0x22116a(_0x4b5c9d){try{_0x421c3d(_0x4c9520['throw'](_0x4b5c9d));}catch(_0x1d19f2){_0x17f12b(_0x1d19f2);}}function _0x421c3d(_0x45e807){_0x45e807['done']?_0x51b2d3(_0x45e807['value']):_0x535069(_0x45e807['value'])['then'](_0x4ece6c,_0x22116a);}_0x421c3d((_0x4c9520=_0x4c9520['apply'](_0x2f4c13,_0x57a28c||[]))['next']());});};class Fetch{static['get'](_0x2cef69,_0x21b038){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x2cef69,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x21b038}});});}static['post'](_0x365774,_0x55af25,_0x4e9f53){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x365774,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x55af25},'body':_0x4e9f53?JSON['stringify'](_0x4e9f53):null});});}static['put'](_0x5654ba,_0x505e98,_0x139512){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x5654ba,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x505e98},'body':_0x139512?JSON['stringify'](_0x139512):null});});}static['delete'](_0x324e87,_0x594ddc){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x324e87,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x594ddc}});});}}
1
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2d86cd,_0x471c76,_0xe4038b,_0x4f8f69){function _0x2b4b39(_0x211ab7){return _0x211ab7 instanceof _0xe4038b?_0x211ab7:new _0xe4038b(function(_0x176ca1){_0x176ca1(_0x211ab7);});}return new(_0xe4038b||(_0xe4038b=Promise))(function(_0xfc4b8c,_0x2e0e30){function _0xbaed14(_0x40a44f){try{_0x1a10bb(_0x4f8f69['next'](_0x40a44f));}catch(_0x4c5be7){_0x2e0e30(_0x4c5be7);}}function _0x158ffa(_0x22dd30){try{_0x1a10bb(_0x4f8f69['throw'](_0x22dd30));}catch(_0x578c65){_0x2e0e30(_0x578c65);}}function _0x1a10bb(_0x26dd7a){_0x26dd7a['done']?_0xfc4b8c(_0x26dd7a['value']):_0x2b4b39(_0x26dd7a['value'])['then'](_0xbaed14,_0x158ffa);}_0x1a10bb((_0x4f8f69=_0x4f8f69['apply'](_0x2d86cd,_0x471c76||[]))['next']());});};class Fetch{static['get'](_0x50bb51,_0x511985){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x50bb51,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x511985}});});}static['post'](_0x51cd27,_0x420c22,_0x8ee2ab){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x51cd27,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x420c22},'body':_0x8ee2ab?JSON['stringify'](_0x8ee2ab):null});});}static['put'](_0x519b2f,_0x505c9f,_0x53629c){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x519b2f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x505c9f},'body':_0x53629c?JSON['stringify'](_0x53629c):null});});}static['delete'](_0x94effe,_0x2ea167){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x94effe,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2ea167}});});}}
2
2
 
3
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0xde33b,_0x180471,_0xef0bc6,_0x41c7e7){function _0x2fe3a9(_0x2a713f){return _0x2a713f instanceof _0xef0bc6?_0x2a713f:new _0xef0bc6(function(_0x1965a9){_0x1965a9(_0x2a713f);});}return new(_0xef0bc6||(_0xef0bc6=Promise))(function(_0x35f909,_0xfe6699){function _0x1dd158(_0x4f5533){try{_0x5a606b(_0x41c7e7['next'](_0x4f5533));}catch(_0x21b2cb){_0xfe6699(_0x21b2cb);}}function _0x58d1eb(_0x4c76f4){try{_0x5a606b(_0x41c7e7['throw'](_0x4c76f4));}catch(_0x4c9039){_0xfe6699(_0x4c9039);}}function _0x5a606b(_0x55f305){_0x55f305['done']?_0x35f909(_0x55f305['value']):_0x2fe3a9(_0x55f305['value'])['then'](_0x1dd158,_0x58d1eb);}_0x5a606b((_0x41c7e7=_0x41c7e7['apply'](_0xde33b,_0x180471||[]))['next']());});};class ListService{constructor(_0x998b0b){this['baseUri']=_0x998b0b;}['add'](_0x43106d,_0x464710,_0x4abcf4){return __awaiter$3(this,arguments,void 0,function*(_0x21a7b2,_0xa8a8f4,_0x477bc7,_0x23d755={}){var _0x38bd32;let _0x168869=(_0x38bd32=_0x23d755['baseUri'])!==null&&_0x38bd32!==void 0?_0x38bd32:this['baseUri'];_0x168869=_0x168869+'/List';const _0xe8e7b1={'account_name':_0xa8a8f4,'list_name':_0x477bc7},_0x52a437=yield Fetch['post'](_0x168869,_0x21a7b2,_0xe8e7b1);if(_0x52a437['status']>0xc7&&_0x52a437['status']<0x12c){const _0x996d9=yield _0x52a437['json']();return new SuccessfulAccountResponse(_0x996d9);}if(_0x52a437['bodyUsed']){const _0x275316=yield _0x52a437['json']();return new FailedAccountResponse(_0x275316);}const _0x5c19d8={'type':'','status':_0x52a437['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x5c19d8);});}['remove'](_0x31536c,_0x3fcb82,_0x17e8dd){return __awaiter$3(this,arguments,void 0,function*(_0x4a19af,_0x1cdecb,_0x13ce5a,_0x2b39fa={}){var _0x2ee500;let _0x34ae6e=(_0x2ee500=_0x2b39fa['baseUri'])!==null&&_0x2ee500!==void 0?_0x2ee500:this['baseUri'];_0x34ae6e=_0x34ae6e+'/List/'+_0x1cdecb+'/'+_0x13ce5a;const _0x28ce30=yield Fetch['delete'](_0x34ae6e,_0x4a19af);if(_0x28ce30['status']>0xc7&&_0x28ce30['status']<0x12c){const _0xfb95a4=yield _0x28ce30['json']();return new SuccessfulAccountResponse(_0xfb95a4);}if(_0x28ce30['bodyUsed']){const _0x39fce6=yield _0x28ce30['json']();return new FailedAccountResponse(_0x39fce6);}const _0x16a5d3={'type':'','status':_0x28ce30['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x16a5d3);});}}
3
+ class Response{constructor(_0x1255ff){this['isSuccess']=_0x1255ff;}}class SuccessfulAccountResponse extends Response{constructor(_0x1ed2eb){super(!![]),this['account']=_0x1ed2eb;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x3d4756){super(![]),this['problem']=_0x3d4756;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x469a1b){super(!![]),this['tokens']=_0x469a1b;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x2c6bf3){super(![]),this['problem']=_0x2c6bf3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
4
 
5
- class Response{constructor(_0x1b7c40){this['isSuccess']=_0x1b7c40;}}class SuccessfulAccountResponse extends Response{constructor(_0x252fc6){super(!![]),this['account']=_0x252fc6;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2cb38a){super(![]),this['problem']=_0x2cb38a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x2b37e1){super(!![]),this['tokens']=_0x2b37e1;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x59ec01){super(![]),this['problem']=_0x59ec01;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
5
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x363e57,_0x2fef3a,_0x5904dd,_0x7c83e7){function _0x36b9e9(_0x5d7794){return _0x5d7794 instanceof _0x5904dd?_0x5d7794:new _0x5904dd(function(_0x47700d){_0x47700d(_0x5d7794);});}return new(_0x5904dd||(_0x5904dd=Promise))(function(_0x48f6de,_0x510b2b){function _0x3e80cb(_0x155d65){try{_0x254a63(_0x7c83e7['next'](_0x155d65));}catch(_0x4b6a74){_0x510b2b(_0x4b6a74);}}function _0x4daf1b(_0x1a7c81){try{_0x254a63(_0x7c83e7['throw'](_0x1a7c81));}catch(_0x5b6856){_0x510b2b(_0x5b6856);}}function _0x254a63(_0x49b37b){_0x49b37b['done']?_0x48f6de(_0x49b37b['value']):_0x36b9e9(_0x49b37b['value'])['then'](_0x3e80cb,_0x4daf1b);}_0x254a63((_0x7c83e7=_0x7c83e7['apply'](_0x363e57,_0x2fef3a||[]))['next']());});};class AccountService{constructor(_0x2fb561){this['baseUri']=_0x2fb561;}['get'](_0x30a8f8,_0x38ac64){return __awaiter$3(this,arguments,void 0,function*(_0x4cbb6c,_0x2b7f44,_0x6d6b2b={}){var _0x169994;let _0x4da1f3=(_0x169994=_0x6d6b2b['baseUri'])!==null&&_0x169994!==void 0?_0x169994:this['baseUri'];!_0x4da1f3['endsWith']('/')&&(_0x4da1f3=_0x4da1f3+'/');_0x4da1f3=_0x4da1f3+'Account/'+_0x2b7f44+'/';const _0xb542a7=yield Fetch['get'](_0x4da1f3,_0x4cbb6c);if(_0xb542a7['status']>0xc7&&_0xb542a7['status']<0x12c){const _0x4db7f4=yield _0xb542a7['json']();return new SuccessfulAccountResponse(_0x4db7f4);}const _0x117c93=yield _0xb542a7['json']();return new FailedAccountResponse(_0x117c93);});}}
6
6
 
7
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x3d2be1,_0x593792,_0x555e20,_0x2b59be){function _0x4df4d7(_0x9d4814){return _0x9d4814 instanceof _0x555e20?_0x9d4814:new _0x555e20(function(_0x39d892){_0x39d892(_0x9d4814);});}return new(_0x555e20||(_0x555e20=Promise))(function(_0x2003fd,_0x156be8){function _0x56e535(_0x3669a2){try{_0x528c08(_0x2b59be['next'](_0x3669a2));}catch(_0x7a96bc){_0x156be8(_0x7a96bc);}}function _0x3419e4(_0x2de69d){try{_0x528c08(_0x2b59be['throw'](_0x2de69d));}catch(_0x1ed6fc){_0x156be8(_0x1ed6fc);}}function _0x528c08(_0x2d68bb){_0x2d68bb['done']?_0x2003fd(_0x2d68bb['value']):_0x4df4d7(_0x2d68bb['value'])['then'](_0x56e535,_0x3419e4);}_0x528c08((_0x2b59be=_0x2b59be['apply'](_0x3d2be1,_0x593792||[]))['next']());});};class AccountService{constructor(_0xd4c74c){this['baseUri']=_0xd4c74c;}['get'](_0x4a83a2,_0x49fa55){return __awaiter$2(this,arguments,void 0,function*(_0x49ec8a,_0x5ec3db,_0x39f1d3={}){var _0x5b5989;let _0x1a943a=(_0x5b5989=_0x39f1d3['baseUri'])!==null&&_0x5b5989!==void 0?_0x5b5989:this['baseUri'];_0x1a943a=_0x1a943a+'/Account/'+_0x5ec3db+'/';const _0x36a462=yield Fetch['get'](_0x1a943a,_0x49ec8a);if(_0x36a462['status']>0xc7&&_0x36a462['status']<0x12c){const _0x76e6c8=yield _0x36a462['json']();return new SuccessfulAccountResponse(_0x76e6c8);}if(_0x36a462['bodyUsed']){const _0x973862=yield _0x36a462['json']();return new FailedAccountResponse(_0x973862);}const _0x19347e={'type':'','status':_0x36a462['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x19347e);});}}
7
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x8b45ff,_0x1966ec,_0x2de026,_0x9ff7fd){function _0x7d9afe(_0x2f0ba0){return _0x2f0ba0 instanceof _0x2de026?_0x2f0ba0:new _0x2de026(function(_0x2ef0fc){_0x2ef0fc(_0x2f0ba0);});}return new(_0x2de026||(_0x2de026=Promise))(function(_0x46687e,_0x5d9ff2){function _0x4aa069(_0xf92266){try{_0x16df6c(_0x9ff7fd['next'](_0xf92266));}catch(_0x206069){_0x5d9ff2(_0x206069);}}function _0x2e0fc6(_0x4cc878){try{_0x16df6c(_0x9ff7fd['throw'](_0x4cc878));}catch(_0x293e1c){_0x5d9ff2(_0x293e1c);}}function _0x16df6c(_0x3d6018){_0x3d6018['done']?_0x46687e(_0x3d6018['value']):_0x7d9afe(_0x3d6018['value'])['then'](_0x4aa069,_0x2e0fc6);}_0x16df6c((_0x9ff7fd=_0x9ff7fd['apply'](_0x8b45ff,_0x1966ec||[]))['next']());});};class ListService{constructor(_0x11e999){this['baseUri']=_0x11e999;}['add'](_0x343acb,_0x1561a9,_0xd55dc5){return __awaiter$2(this,arguments,void 0,function*(_0x43cc19,_0x374309,_0x39cf0c,_0x5b2c8b={}){var _0x19aa83;let _0x409f2e=(_0x19aa83=_0x5b2c8b['baseUri'])!==null&&_0x19aa83!==void 0?_0x19aa83:this['baseUri'];!_0x409f2e['endsWith']('/')&&(_0x409f2e=_0x409f2e+'/');_0x409f2e=_0x409f2e+'List';const _0x41ff6e={'account_name':_0x374309,'list_name':_0x39cf0c},_0x1c69f3=yield Fetch['post'](_0x409f2e,_0x43cc19,_0x41ff6e);if(_0x1c69f3['status']>0xc7&&_0x1c69f3['status']<0x12c){const _0xff7e0b=yield _0x1c69f3['json']();return new SuccessfulAccountResponse(_0xff7e0b);}const _0x3dadc6=yield _0x1c69f3['json']();return new FailedAccountResponse(_0x3dadc6);});}['remove'](_0x5057c9,_0x59e37d,_0x5c4680){return __awaiter$2(this,arguments,void 0,function*(_0x5e6fdd,_0x351066,_0x405d71,_0x5bd7e3={}){var _0x5cadf0;let _0x1b9519=(_0x5cadf0=_0x5bd7e3['baseUri'])!==null&&_0x5cadf0!==void 0?_0x5cadf0:this['baseUri'];_0x1b9519=_0x1b9519+'/List/'+_0x351066+'/'+_0x405d71;const _0x97fde7=yield Fetch['delete'](_0x1b9519,_0x5e6fdd);if(_0x97fde7['status']>0xc7&&_0x97fde7['status']<0x12c){const _0x2e75ef=yield _0x97fde7['json']();return new SuccessfulAccountResponse(_0x2e75ef);}const _0x27aece=yield _0x97fde7['json']();return new FailedAccountResponse(_0x27aece);});}}
8
8
 
9
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x3435eb,_0x141ada,_0x2a350c,_0x1ca1f3){function _0x41de32(_0x379208){return _0x379208 instanceof _0x2a350c?_0x379208:new _0x2a350c(function(_0x573e42){_0x573e42(_0x379208);});}return new(_0x2a350c||(_0x2a350c=Promise))(function(_0x3aebf3,_0x51a302){function _0x4471ea(_0x4aa646){try{_0x402ed0(_0x1ca1f3['next'](_0x4aa646));}catch(_0x405d1b){_0x51a302(_0x405d1b);}}function _0x1f9eca(_0x262b27){try{_0x402ed0(_0x1ca1f3['throw'](_0x262b27));}catch(_0x434713){_0x51a302(_0x434713);}}function _0x402ed0(_0x4eebb4){_0x4eebb4['done']?_0x3aebf3(_0x4eebb4['value']):_0x41de32(_0x4eebb4['value'])['then'](_0x4471ea,_0x1f9eca);}_0x402ed0((_0x1ca1f3=_0x1ca1f3['apply'](_0x3435eb,_0x141ada||[]))['next']());});};class TokenManager{constructor(_0x523744){this['securityService']=_0x523744;}['RefreshTokens'](_0x1d1f66){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x1d1f66['access_expires'])return new SuccessfulRefreshResponse(_0x1d1f66);if(Date['now']()>_0x1d1f66['refresh_expires']){const _0x1fed22={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x1fed22);}const _0x177cb7=yield this['securityService']['refresh'](_0x1d1f66['refresh_token']);if(!_0x177cb7['isSuccess'])return new FailedRefreshResponse(_0x177cb7['toProblem']());return new SuccessfulRefreshResponse(_0x177cb7['toSuccess']());});}}
9
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x48b7d5,_0x5e2a00,_0x120f69,_0x5de50c){function _0x392cd7(_0x59907b){return _0x59907b instanceof _0x120f69?_0x59907b:new _0x120f69(function(_0x43a35a){_0x43a35a(_0x59907b);});}return new(_0x120f69||(_0x120f69=Promise))(function(_0xe9b944,_0x9c68e1){function _0x5581e5(_0x4afa25){try{_0x326f5f(_0x5de50c['next'](_0x4afa25));}catch(_0x28b439){_0x9c68e1(_0x28b439);}}function _0x256e20(_0x28afd3){try{_0x326f5f(_0x5de50c['throw'](_0x28afd3));}catch(_0x1e83cc){_0x9c68e1(_0x1e83cc);}}function _0x326f5f(_0x4e1eb3){_0x4e1eb3['done']?_0xe9b944(_0x4e1eb3['value']):_0x392cd7(_0x4e1eb3['value'])['then'](_0x5581e5,_0x256e20);}_0x326f5f((_0x5de50c=_0x5de50c['apply'](_0x48b7d5,_0x5e2a00||[]))['next']());});};class TokenManager{constructor(_0x17a49b){this['securityService']=_0x17a49b;}['RefreshTokens'](_0x35b47d){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x35b47d['access_expires'])return new SuccessfulRefreshResponse(_0x35b47d);if(Date['now']()>_0x35b47d['refresh_expires']){const _0x3ac042={'details':'','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x3ac042);}const _0x1dc21f=yield this['securityService']['refresh'](_0x35b47d['refresh_token']);if(!_0x1dc21f['isSuccess'])return new FailedRefreshResponse(_0x1dc21f['toProblem']());return new SuccessfulRefreshResponse(_0x1dc21f['toSuccess']());});}}
10
10
 
11
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x27fce2,_0x2ea7e0,_0xbd7d6a,_0x455eef){function _0xed4b51(_0x4b6e6d){return _0x4b6e6d instanceof _0xbd7d6a?_0x4b6e6d:new _0xbd7d6a(function(_0xbc4655){_0xbc4655(_0x4b6e6d);});}return new(_0xbd7d6a||(_0xbd7d6a=Promise))(function(_0x2ca4b3,_0x19ddeb){function _0xefa90f(_0x2f1570){try{_0x6f1edf(_0x455eef['next'](_0x2f1570));}catch(_0x5030a9){_0x19ddeb(_0x5030a9);}}function _0x1eac5c(_0x38c93b){try{_0x6f1edf(_0x455eef['throw'](_0x38c93b));}catch(_0x263841){_0x19ddeb(_0x263841);}}function _0x6f1edf(_0x415190){_0x415190['done']?_0x2ca4b3(_0x415190['value']):_0xed4b51(_0x415190['value'])['then'](_0xefa90f,_0x1eac5c);}_0x6f1edf((_0x455eef=_0x455eef['apply'](_0x27fce2,_0x2ea7e0||[]))['next']());});};class SecurityService{constructor(_0x2952ff){this['baseUri']=_0x2952ff,this['tokenManager']=new TokenManager(this);}['refresh'](_0x1f27dd){return __awaiter(this,arguments,void 0,function*(_0x5de477,_0x502c61={}){var _0x388a60;let _0x3f3927=(_0x388a60=_0x502c61['baseUri'])!==null&&_0x388a60!==void 0?_0x388a60:this['baseUri'];_0x3f3927=_0x3f3927+'/Security/Refresh';const _0x34efb6=yield Fetch['post'](_0x3f3927,_0x5de477,null);if(_0x34efb6['status']>0xc7&&_0x34efb6['status']<0x12c){const _0x209c7c=yield _0x34efb6['json']();return new SuccessfulRefreshResponse(_0x209c7c);}if(_0x34efb6['bodyUsed']){const _0x1044df=yield _0x34efb6['json']();return new FailedRefreshResponse(_0x1044df);}const _0x3c0d79={'type':'','status':_0x34efb6['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x3c0d79);});}}
11
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x2262fe,_0x5b255c,_0xe5a619,_0x23bf94){function _0x4e6c94(_0xf16fbc){return _0xf16fbc instanceof _0xe5a619?_0xf16fbc:new _0xe5a619(function(_0x10f453){_0x10f453(_0xf16fbc);});}return new(_0xe5a619||(_0xe5a619=Promise))(function(_0x4e9bf5,_0x520f7b){function _0x463e8b(_0x2b6729){try{_0x1478cb(_0x23bf94['next'](_0x2b6729));}catch(_0x5523a8){_0x520f7b(_0x5523a8);}}function _0x24d124(_0x54a16f){try{_0x1478cb(_0x23bf94['throw'](_0x54a16f));}catch(_0x23afa9){_0x520f7b(_0x23afa9);}}function _0x1478cb(_0x37d04a){_0x37d04a['done']?_0x4e9bf5(_0x37d04a['value']):_0x4e6c94(_0x37d04a['value'])['then'](_0x463e8b,_0x24d124);}_0x1478cb((_0x23bf94=_0x23bf94['apply'](_0x2262fe,_0x5b255c||[]))['next']());});};class SecurityService{constructor(_0x144362){this['baseUri']=_0x144362,this['tokenManager']=new TokenManager(this);}['refresh'](_0x1db608){return __awaiter(this,arguments,void 0,function*(_0x20c0c4,_0x2dd6e0={}){var _0x5b0bc3;let _0x2d2b48=(_0x5b0bc3=_0x2dd6e0['baseUri'])!==null&&_0x5b0bc3!==void 0?_0x5b0bc3:this['baseUri'];!_0x2d2b48['endsWith']('/')&&(_0x2d2b48=_0x2d2b48+'/');_0x2d2b48=_0x2d2b48+'Security/Refresh';const _0x1cb2ba=yield Fetch['post'](_0x2d2b48,_0x20c0c4,null);if(_0x1cb2ba['status']>0xc7&&_0x1cb2ba['status']<0x12c){const _0x4fcdfe=yield _0x1cb2ba['json']();return new SuccessfulRefreshResponse(_0x4fcdfe);}const _0x1a9cdb=yield _0x1cb2ba['json']();return new FailedRefreshResponse(_0x1a9cdb);});}}
12
12
 
13
- var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
13
+ var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
14
14
 
15
15
  export { AdminClient };
package/dist/types.d.ts CHANGED
@@ -4,25 +4,13 @@ declare class AccountService {
4
4
  get(accessToken: string, accountName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
5
5
  }
6
6
 
7
- type AccountService_d_AccountService = AccountService;
8
- declare const AccountService_d_AccountService: typeof AccountService;
9
- declare namespace AccountService_d {
10
- export { AccountService_d_AccountService as AccountService };
11
- }
12
-
13
7
  declare class ListService {
14
8
  readonly baseUri: string;
15
9
  constructor(baseUri: string);
16
- add(accessToken: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
10
+ add(access_token: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
17
11
  remove(accessToken: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
18
12
  }
19
13
 
20
- type ListService_d_ListService = ListService;
21
- declare const ListService_d_ListService: typeof ListService;
22
- declare namespace ListService_d {
23
- export { ListService_d_ListService as ListService };
24
- }
25
-
26
14
  declare class TokenManager {
27
15
  readonly securityService: SecurityService;
28
16
  constructor(securityService: SecurityService);
@@ -63,12 +51,12 @@ type Problem = {
63
51
  title: string;
64
52
  status: number;
65
53
  instance: string;
66
- errors: Error;
54
+ details: string;
67
55
  };
68
56
  type Account = {
69
57
  name: string;
70
58
  owner: string;
71
- created_utc: Date;
59
+ created_utc: number;
72
60
  lists: List[];
73
61
  };
74
62
  type Tokens = {
@@ -102,4 +90,4 @@ declare class FailedRefreshResponse extends Response<Tokens, Problem> {
102
90
  toProblem(): Problem;
103
91
  }
104
92
 
105
- export { type Account, AccountService_d as AccountServices, AdminClient, type Error, FailedAccountResponse, FailedRefreshResponse, type List, ListService_d as ListServices, type Options, type Problem, Response, SuccessfulAccountResponse, SuccessfulRefreshResponse, type Tokens };
93
+ export { type Account, AdminClient, type Error, FailedAccountResponse, FailedRefreshResponse, type List, type Options, type Problem, Response, SuccessfulAccountResponse, SuccessfulRefreshResponse, type Tokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
@@ -1,15 +0,0 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x234ec5,_0x2b9fb5,_0x501422,_0x10cc3a){function _0x30a5ab(_0x20508f){return _0x20508f instanceof _0x501422?_0x20508f:new _0x501422(function(_0x4a84a7){_0x4a84a7(_0x20508f);});}return new(_0x501422||(_0x501422=Promise))(function(_0xb8b2cb,_0x4d5355){function _0x25e258(_0x479406){try{_0x4ea12e(_0x10cc3a['next'](_0x479406));}catch(_0x183525){_0x4d5355(_0x183525);}}function _0x2f411c(_0x13ca0e){try{_0x4ea12e(_0x10cc3a['throw'](_0x13ca0e));}catch(_0x5c9f12){_0x4d5355(_0x5c9f12);}}function _0x4ea12e(_0x32449f){_0x32449f['done']?_0xb8b2cb(_0x32449f['value']):_0x30a5ab(_0x32449f['value'])['then'](_0x25e258,_0x2f411c);}_0x4ea12e((_0x10cc3a=_0x10cc3a['apply'](_0x234ec5,_0x2b9fb5||[]))['next']());});};class Fetch{static['get'](_0x5a0a91,_0x495d10){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x5a0a91,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x495d10}});});}static['post'](_0x6068f3,_0x4d687b,_0x32a395){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x6068f3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4d687b},'body':_0x32a395?JSON['stringify'](_0x32a395):null});});}static['put'](_0x1dfb59,_0x27f3a3,_0x34c1bc){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1dfb59,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x27f3a3},'body':_0x34c1bc?JSON['stringify'](_0x34c1bc):null});});}static['delete'](_0x1fb02e,_0x42a5e2){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1fb02e,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x42a5e2}});});}}
2
-
3
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x57a80a,_0x546f46,_0x3f6185,_0x230364){function _0x294a09(_0x22a827){return _0x22a827 instanceof _0x3f6185?_0x22a827:new _0x3f6185(function(_0x1da169){_0x1da169(_0x22a827);});}return new(_0x3f6185||(_0x3f6185=Promise))(function(_0x275a08,_0x3c40c5){function _0x45e889(_0x75138){try{_0x318fa8(_0x230364['next'](_0x75138));}catch(_0x49960d){_0x3c40c5(_0x49960d);}}function _0x563228(_0x3cf7e0){try{_0x318fa8(_0x230364['throw'](_0x3cf7e0));}catch(_0xb20449){_0x3c40c5(_0xb20449);}}function _0x318fa8(_0x2480fe){_0x2480fe['done']?_0x275a08(_0x2480fe['value']):_0x294a09(_0x2480fe['value'])['then'](_0x45e889,_0x563228);}_0x318fa8((_0x230364=_0x230364['apply'](_0x57a80a,_0x546f46||[]))['next']());});};class ListService{constructor(_0x18bde8){this['baseUri']=_0x18bde8;}['add'](_0x4bc300,_0x196ce2,_0x51b72f){return __awaiter$3(this,arguments,void 0,function*(_0x33b3e8,_0x4c169f,_0x2edc01,_0x50e166={}){var _0x37c57f;let _0x132cf7=(_0x37c57f=_0x50e166['baseUri'])!==null&&_0x37c57f!==void 0?_0x37c57f:this['baseUri'];_0x132cf7=_0x132cf7+'/List';const _0x599629={'account_name':_0x4c169f,'list_name':_0x2edc01},_0x470edb=yield Fetch['post'](_0x132cf7,_0x33b3e8,_0x599629);if(_0x470edb['status']>0xc7&&_0x470edb['status']<0x12c){const _0x25d666=yield _0x470edb['json']();return new SuccessfulAccountResponse(_0x25d666);}if(_0x470edb['bodyUsed']){const _0xd5bde=yield _0x470edb['json']();return new FailedAccountResponse(_0xd5bde);}const _0x21e183={'type':'','status':_0x470edb['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x21e183);});}['remove'](_0x1d36c3,_0x370119,_0xd6ab5e){return __awaiter$3(this,arguments,void 0,function*(_0x1f1807,_0x1541fd,_0xb36e2a,_0x5ea2bc={}){var _0x869fdb;let _0x133136=(_0x869fdb=_0x5ea2bc['baseUri'])!==null&&_0x869fdb!==void 0?_0x869fdb:this['baseUri'];_0x133136=_0x133136+'/List/'+_0x1541fd+'/'+_0xb36e2a;const _0x4ed54b=yield Fetch['delete'](_0x133136,_0x1f1807);if(_0x4ed54b['status']>0xc7&&_0x4ed54b['status']<0x12c){const _0x35ceef=yield _0x4ed54b['json']();return new SuccessfulAccountResponse(_0x35ceef);}if(_0x4ed54b['bodyUsed']){const _0x2bd313=yield _0x4ed54b['json']();return new FailedAccountResponse(_0x2bd313);}const _0x4b9aef={'type':'','status':_0x4ed54b['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x4b9aef);});}}
4
-
5
- class Response{constructor(_0x5b9dde){this['isSuccess']=_0x5b9dde;}}class SuccessfulAccountResponse extends Response{constructor(_0x112c33){super(!![]),this['account']=_0x112c33;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x361d34){super(![]),this['problem']=_0x361d34;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0xefde84){super(!![]),this['tokens']=_0xefde84;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x420aac){super(![]),this['problem']=_0x420aac;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
-
7
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4af589,_0x2a0b63,_0x42f49a,_0x53aa9d){function _0x2e941a(_0x2353f1){return _0x2353f1 instanceof _0x42f49a?_0x2353f1:new _0x42f49a(function(_0x587f80){_0x587f80(_0x2353f1);});}return new(_0x42f49a||(_0x42f49a=Promise))(function(_0x2cb9d5,_0x2f40e5){function _0x20c9a9(_0x207f27){try{_0x44346b(_0x53aa9d['next'](_0x207f27));}catch(_0x4d1cb1){_0x2f40e5(_0x4d1cb1);}}function _0x423645(_0x2a1788){try{_0x44346b(_0x53aa9d['throw'](_0x2a1788));}catch(_0x340716){_0x2f40e5(_0x340716);}}function _0x44346b(_0x3f40a3){_0x3f40a3['done']?_0x2cb9d5(_0x3f40a3['value']):_0x2e941a(_0x3f40a3['value'])['then'](_0x20c9a9,_0x423645);}_0x44346b((_0x53aa9d=_0x53aa9d['apply'](_0x4af589,_0x2a0b63||[]))['next']());});};class AccountService{constructor(_0x346808){this['baseUri']=_0x346808;}['get'](_0x1df9a7,_0x1ec597){return __awaiter$2(this,arguments,void 0,function*(_0x6b2ddc,_0xf23b84,_0x2fe810={}){var _0x5dfef5;let _0x133552=(_0x5dfef5=_0x2fe810['baseUri'])!==null&&_0x5dfef5!==void 0?_0x5dfef5:this['baseUri'];_0x133552=_0x133552+'/Account/'+_0xf23b84+'/';const _0x2a53df=yield Fetch['get'](_0x133552,_0x6b2ddc);if(_0x2a53df['status']>0xc7&&_0x2a53df['status']<0x12c){const _0x4939e6=yield _0x2a53df['json']();return new SuccessfulAccountResponse(_0x4939e6);}if(_0x2a53df['bodyUsed']){const _0x320470=yield _0x2a53df['json']();return new FailedAccountResponse(_0x320470);}const _0x3bb5c0={'type':'','status':_0x2a53df['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x3bb5c0);});}}
8
-
9
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1c9b84,_0x292015,_0x422554,_0x2d67ed){function _0x16ec6c(_0x9a70bd){return _0x9a70bd instanceof _0x422554?_0x9a70bd:new _0x422554(function(_0x34cbd6){_0x34cbd6(_0x9a70bd);});}return new(_0x422554||(_0x422554=Promise))(function(_0x33a328,_0x527465){function _0x32b12f(_0x4b0fb6){try{_0x11d630(_0x2d67ed['next'](_0x4b0fb6));}catch(_0x3cc53d){_0x527465(_0x3cc53d);}}function _0x357945(_0x57a102){try{_0x11d630(_0x2d67ed['throw'](_0x57a102));}catch(_0x4535c7){_0x527465(_0x4535c7);}}function _0x11d630(_0x2f4a3a){_0x2f4a3a['done']?_0x33a328(_0x2f4a3a['value']):_0x16ec6c(_0x2f4a3a['value'])['then'](_0x32b12f,_0x357945);}_0x11d630((_0x2d67ed=_0x2d67ed['apply'](_0x1c9b84,_0x292015||[]))['next']());});};class TokenManager{constructor(_0x153d7f){this['securityService']=_0x153d7f;}['RefreshTokens'](_0x50cd90){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x50cd90['access_expires'])return new SuccessfulRefreshResponse(_0x50cd90);if(Date['now']()>_0x50cd90['refresh_expires']){const _0x1f6a30={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x1f6a30);}const _0x9649bd=yield this['securityService']['refresh'](_0x50cd90['refresh_token']);if(!_0x9649bd['isSuccess'])return new FailedRefreshResponse(_0x9649bd['toProblem']());return new SuccessfulRefreshResponse(_0x9649bd['toSuccess']());});}}
10
-
11
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x5637b1,_0x26d269,_0x55066a,_0x533ac0){function _0x1883d0(_0x17884e){return _0x17884e instanceof _0x55066a?_0x17884e:new _0x55066a(function(_0x518cd1){_0x518cd1(_0x17884e);});}return new(_0x55066a||(_0x55066a=Promise))(function(_0x2b4900,_0x2d70a1){function _0x5ba48a(_0x1e6088){try{_0x3457c9(_0x533ac0['next'](_0x1e6088));}catch(_0x12ea86){_0x2d70a1(_0x12ea86);}}function _0x4ce972(_0x243822){try{_0x3457c9(_0x533ac0['throw'](_0x243822));}catch(_0x11badc){_0x2d70a1(_0x11badc);}}function _0x3457c9(_0x365541){_0x365541['done']?_0x2b4900(_0x365541['value']):_0x1883d0(_0x365541['value'])['then'](_0x5ba48a,_0x4ce972);}_0x3457c9((_0x533ac0=_0x533ac0['apply'](_0x5637b1,_0x26d269||[]))['next']());});};class SecurityService{constructor(_0x4a7fd7){this['baseUri']=_0x4a7fd7,this['tokenManager']=new TokenManager(this);}['refresh'](_0x3c4441){return __awaiter(this,arguments,void 0,function*(_0x13caa8,_0x1700a4={}){var _0x40f5aa;let _0x3ced62=(_0x40f5aa=_0x1700a4['baseUri'])!==null&&_0x40f5aa!==void 0?_0x40f5aa:this['baseUri'];_0x3ced62=_0x3ced62+'/Security/Refresh';const _0x444986=yield Fetch['post'](_0x3ced62,_0x13caa8,null);if(_0x444986['status']>0xc7&&_0x444986['status']<0x12c){const _0x335e2f=yield _0x444986['json']();return new SuccessfulRefreshResponse(_0x335e2f);}if(_0x444986['bodyUsed']){const _0x1dfcbf=yield _0x444986['json']();return new FailedRefreshResponse(_0x1dfcbf);}const _0x2014ae={'type':'','status':_0x444986['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x2014ae);});}}
12
-
13
- var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
14
-
15
- export { AdminClient };