@searchability/admin-client 0.0.5 → 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,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x26b976,_0x577e97,_0x35d480,_0x5af5cd){function _0x5d30ee(_0x1a4d8c){return _0x1a4d8c instanceof _0x35d480?_0x1a4d8c:new _0x35d480(function(_0x263ebb){_0x263ebb(_0x1a4d8c);});}return new(_0x35d480||(_0x35d480=Promise))(function(_0x19162b,_0x1cba5f){function _0x5c231b(_0x3d9ac8){try{_0x33cfd6(_0x5af5cd['next'](_0x3d9ac8));}catch(_0x431267){_0x1cba5f(_0x431267);}}function _0x168fa4(_0x16ee42){try{_0x33cfd6(_0x5af5cd['throw'](_0x16ee42));}catch(_0x3a13d5){_0x1cba5f(_0x3a13d5);}}function _0x33cfd6(_0x2c237d){_0x2c237d['done']?_0x19162b(_0x2c237d['value']):_0x5d30ee(_0x2c237d['value'])['then'](_0x5c231b,_0x168fa4);}_0x33cfd6((_0x5af5cd=_0x5af5cd['apply'](_0x26b976,_0x577e97||[]))['next']());});};class Fetch{static['get'](_0x3d8e75,_0x659a29){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3d8e75,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x659a29}});});}static['post'](_0x3b4764,_0x3a7c9f,_0x2aa780){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3b4764,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3a7c9f},'body':_0x2aa780?JSON['stringify'](_0x2aa780):null});});}static['put'](_0x2087d5,_0x245dd2,_0x5f0a3c){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x2087d5,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x245dd2},'body':_0x5f0a3c?JSON['stringify'](_0x5f0a3c):null});});}static['delete'](_0x2a4803,_0x5015c9){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x2a4803,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5015c9}});});}}
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(_0x5eaedc,_0x56235f,_0x265705,_0x4c3a90){function _0x2c131d(_0x3a91dc){return _0x3a91dc instanceof _0x265705?_0x3a91dc:new _0x265705(function(_0x1f6310){_0x1f6310(_0x3a91dc);});}return new(_0x265705||(_0x265705=Promise))(function(_0x446579,_0x167736){function _0x5ec3d7(_0x31bbb3){try{_0x32e177(_0x4c3a90['next'](_0x31bbb3));}catch(_0xf7d576){_0x167736(_0xf7d576);}}function _0x37e5f9(_0x17544c){try{_0x32e177(_0x4c3a90['throw'](_0x17544c));}catch(_0x51bc2b){_0x167736(_0x51bc2b);}}function _0x32e177(_0x1a0096){_0x1a0096['done']?_0x446579(_0x1a0096['value']):_0x2c131d(_0x1a0096['value'])['then'](_0x5ec3d7,_0x37e5f9);}_0x32e177((_0x4c3a90=_0x4c3a90['apply'](_0x5eaedc,_0x56235f||[]))['next']());});};class ListService{constructor(_0x4d5fdb){this['baseUri']=_0x4d5fdb;}['add'](_0x26063d,_0xccb08a,_0x232908){return __awaiter$3(this,arguments,void 0,function*(_0x2073fb,_0x56180a,_0x518613,_0xc01af4={}){var _0x1cbba6;let _0x4ba248=(_0x1cbba6=_0xc01af4['baseUri'])!==null&&_0x1cbba6!==void 0?_0x1cbba6:this['baseUri'];!_0x4ba248['endsWith']('/')&&(_0x4ba248=_0x4ba248+'/');_0x4ba248=_0x4ba248+'List';const _0x1db539={'account_name':_0x56180a,'list_name':_0x518613},_0x1ea6e9=yield Fetch['post'](_0x4ba248,_0x2073fb,_0x1db539);if(_0x1ea6e9['status']>0xc7&&_0x1ea6e9['status']<0x12c){const _0x40e074=yield _0x1ea6e9['json']();return new SuccessfulAccountResponse(_0x40e074);}if(_0x1ea6e9['bodyUsed']){const _0x4978e1=yield _0x1ea6e9['json']();return new FailedAccountResponse(_0x4978e1);}const _0x5d17be={'type':'','status':_0x1ea6e9['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x5d17be);});}['remove'](_0x17d7a9,_0x150710,_0x36c60e){return __awaiter$3(this,arguments,void 0,function*(_0x212e05,_0x18c537,_0x5b682c,_0x556be9={}){var _0x5e349a;let _0x5a433c=(_0x5e349a=_0x556be9['baseUri'])!==null&&_0x5e349a!==void 0?_0x5e349a:this['baseUri'];_0x5a433c=_0x5a433c+'/List/'+_0x18c537+'/'+_0x5b682c;const _0x3e6770=yield Fetch['delete'](_0x5a433c,_0x212e05);if(_0x3e6770['status']>0xc7&&_0x3e6770['status']<0x12c){const _0x5022f9=yield _0x3e6770['json']();return new SuccessfulAccountResponse(_0x5022f9);}if(_0x3e6770['bodyUsed']){const _0x2b44f7=yield _0x3e6770['json']();return new FailedAccountResponse(_0x2b44f7);}const _0x107bef={'type':'','status':_0x3e6770['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x107bef);});}}
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(_0x1432e5){this['isSuccess']=_0x1432e5;}}class SuccessfulAccountResponse extends Response{constructor(_0x449d65){super(!![]),this['account']=_0x449d65;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2b5065){super(![]),this['problem']=_0x2b5065;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x3286c2){super(!![]),this['tokens']=_0x3286c2;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x341ae3){super(![]),this['problem']=_0x341ae3;}['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(_0x1c0d47,_0x4b366c,_0x33ca5,_0x8f3279){function _0x5396a9(_0x3c7be7){return _0x3c7be7 instanceof _0x33ca5?_0x3c7be7:new _0x33ca5(function(_0x3782e0){_0x3782e0(_0x3c7be7);});}return new(_0x33ca5||(_0x33ca5=Promise))(function(_0x24ed25,_0x489e7e){function _0x214b93(_0x14db67){try{_0x47bb4f(_0x8f3279['next'](_0x14db67));}catch(_0x4e8447){_0x489e7e(_0x4e8447);}}function _0x3c0936(_0x313a40){try{_0x47bb4f(_0x8f3279['throw'](_0x313a40));}catch(_0x4accdd){_0x489e7e(_0x4accdd);}}function _0x47bb4f(_0x2e1bf8){_0x2e1bf8['done']?_0x24ed25(_0x2e1bf8['value']):_0x5396a9(_0x2e1bf8['value'])['then'](_0x214b93,_0x3c0936);}_0x47bb4f((_0x8f3279=_0x8f3279['apply'](_0x1c0d47,_0x4b366c||[]))['next']());});};class AccountService{constructor(_0x1295e6){this['baseUri']=_0x1295e6;}['get'](_0x1369b1,_0x58fb1c){return __awaiter$2(this,arguments,void 0,function*(_0x21ee7d,_0x1d6219,_0x186115={}){var _0x5ea899;let _0xc9fc59=(_0x5ea899=_0x186115['baseUri'])!==null&&_0x5ea899!==void 0?_0x5ea899:this['baseUri'];!_0xc9fc59['endsWith']('/')&&(_0xc9fc59=_0xc9fc59+'/');_0xc9fc59=_0xc9fc59+'Account/'+_0x1d6219+'/';const _0x2cc8ac=yield Fetch['get'](_0xc9fc59,_0x21ee7d);if(_0x2cc8ac['status']>0xc7&&_0x2cc8ac['status']<0x12c){const _0x11e72c=yield _0x2cc8ac['json']();return new SuccessfulAccountResponse(_0x11e72c);}if(_0x2cc8ac['bodyUsed']){const _0x31aa40=yield _0x2cc8ac['json']();return new FailedAccountResponse(_0x31aa40);}const _0x1e0800={'type':'','status':_0x2cc8ac['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x1e0800);});}}
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(_0xbe58b2,_0x49d0fe,_0x5e20d2,_0x261379){function _0x562931(_0x39889e){return _0x39889e instanceof _0x5e20d2?_0x39889e:new _0x5e20d2(function(_0x2892aa){_0x2892aa(_0x39889e);});}return new(_0x5e20d2||(_0x5e20d2=Promise))(function(_0x4d2471,_0x85ae8a){function _0x4edb75(_0x5a543b){try{_0x3db309(_0x261379['next'](_0x5a543b));}catch(_0x5e297b){_0x85ae8a(_0x5e297b);}}function _0x39f81f(_0x237de){try{_0x3db309(_0x261379['throw'](_0x237de));}catch(_0x3450a5){_0x85ae8a(_0x3450a5);}}function _0x3db309(_0x253c4d){_0x253c4d['done']?_0x4d2471(_0x253c4d['value']):_0x562931(_0x253c4d['value'])['then'](_0x4edb75,_0x39f81f);}_0x3db309((_0x261379=_0x261379['apply'](_0xbe58b2,_0x49d0fe||[]))['next']());});};class TokenManager{constructor(_0x210695){this['securityService']=_0x210695;}['RefreshTokens'](_0x41f744){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x41f744['access_expires'])return new SuccessfulRefreshResponse(_0x41f744);if(Date['now']()>_0x41f744['refresh_expires']){const _0x336cf8={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x336cf8);}const _0x39eab1=yield this['securityService']['refresh'](_0x41f744['refresh_token']);if(!_0x39eab1['isSuccess'])return new FailedRefreshResponse(_0x39eab1['toProblem']());return new SuccessfulRefreshResponse(_0x39eab1['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(_0x3ad69e,_0x5cace8,_0x430397,_0x48dab6){function _0x5ab103(_0x3ff3ec){return _0x3ff3ec instanceof _0x430397?_0x3ff3ec:new _0x430397(function(_0x296d1c){_0x296d1c(_0x3ff3ec);});}return new(_0x430397||(_0x430397=Promise))(function(_0x4db515,_0x5b8b5a){function _0x13ba04(_0x4bb6c5){try{_0x18c6ec(_0x48dab6['next'](_0x4bb6c5));}catch(_0x5b732b){_0x5b8b5a(_0x5b732b);}}function _0x11d155(_0x3a6fc1){try{_0x18c6ec(_0x48dab6['throw'](_0x3a6fc1));}catch(_0x452599){_0x5b8b5a(_0x452599);}}function _0x18c6ec(_0x800cda){_0x800cda['done']?_0x4db515(_0x800cda['value']):_0x5ab103(_0x800cda['value'])['then'](_0x13ba04,_0x11d155);}_0x18c6ec((_0x48dab6=_0x48dab6['apply'](_0x3ad69e,_0x5cace8||[]))['next']());});};class SecurityService{constructor(_0x497d82){this['baseUri']=_0x497d82,this['tokenManager']=new TokenManager(this);}['refresh'](_0x473d40){return __awaiter(this,arguments,void 0,function*(_0x4a7b46,_0x4c6ca8={}){var _0x40cebb;let _0x50b01=(_0x40cebb=_0x4c6ca8['baseUri'])!==null&&_0x40cebb!==void 0?_0x40cebb:this['baseUri'];!_0x50b01['endsWith']('/')&&(_0x50b01=_0x50b01+'/');_0x50b01=_0x50b01+'Security/Refresh';const _0x3bd25a=yield Fetch['post'](_0x50b01,_0x4a7b46,null);if(_0x3bd25a['status']>0xc7&&_0x3bd25a['status']<0x12c){const _0x46c97c=yield _0x3bd25a['json']();return new SuccessfulRefreshResponse(_0x46c97c);}if(_0x3bd25a['bodyUsed']){const _0x45bf05=yield _0x3bd25a['json']();return new FailedRefreshResponse(_0x45bf05);}const _0x4eff38={'type':'','status':_0x3bd25a['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x4eff38);});}}
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
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
 
@@ -1,14 +1,14 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x57eabd,_0x36ba67,_0x41ee23,_0x2acf31){function _0x22bd23(_0xbbe5ca){return _0xbbe5ca instanceof _0x41ee23?_0xbbe5ca:new _0x41ee23(function(_0x2a690e){_0x2a690e(_0xbbe5ca);});}return new(_0x41ee23||(_0x41ee23=Promise))(function(_0x16c429,_0x574c9b){function _0x5b91f8(_0x54ee9f){try{_0x199569(_0x2acf31['next'](_0x54ee9f));}catch(_0x439de0){_0x574c9b(_0x439de0);}}function _0x275cd1(_0x3e88b8){try{_0x199569(_0x2acf31['throw'](_0x3e88b8));}catch(_0x86aab6){_0x574c9b(_0x86aab6);}}function _0x199569(_0x1682e4){_0x1682e4['done']?_0x16c429(_0x1682e4['value']):_0x22bd23(_0x1682e4['value'])['then'](_0x5b91f8,_0x275cd1);}_0x199569((_0x2acf31=_0x2acf31['apply'](_0x57eabd,_0x36ba67||[]))['next']());});};class Fetch{static['get'](_0x18a213,_0xe9c6e5){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x18a213,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xe9c6e5}});});}static['post'](_0x129b94,_0x4a2ae7,_0x46f6d2){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x129b94,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4a2ae7},'body':_0x46f6d2?JSON['stringify'](_0x46f6d2):null});});}static['put'](_0x143fe9,_0x32fa31,_0x3c0102){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x143fe9,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x32fa31},'body':_0x3c0102?JSON['stringify'](_0x3c0102):null});});}static['delete'](_0x4475a4,_0x4e478c){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x4475a4,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4e478c}});});}}
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(_0x15527d,_0x177f53,_0x4e6cac,_0x392356){function _0x209797(_0x3a9be3){return _0x3a9be3 instanceof _0x4e6cac?_0x3a9be3:new _0x4e6cac(function(_0x1c78f6){_0x1c78f6(_0x3a9be3);});}return new(_0x4e6cac||(_0x4e6cac=Promise))(function(_0x505f6d,_0x1df980){function _0x4e1c7d(_0x476f23){try{_0x197398(_0x392356['next'](_0x476f23));}catch(_0x71d635){_0x1df980(_0x71d635);}}function _0x4d3a9c(_0x5182f5){try{_0x197398(_0x392356['throw'](_0x5182f5));}catch(_0x314167){_0x1df980(_0x314167);}}function _0x197398(_0x5b3c69){_0x5b3c69['done']?_0x505f6d(_0x5b3c69['value']):_0x209797(_0x5b3c69['value'])['then'](_0x4e1c7d,_0x4d3a9c);}_0x197398((_0x392356=_0x392356['apply'](_0x15527d,_0x177f53||[]))['next']());});};class ListService{constructor(_0xd123f8){this['baseUri']=_0xd123f8;}['add'](_0xe66136,_0xc0a37c,_0xd96249){return __awaiter$3(this,arguments,void 0,function*(_0x582bd6,_0x4fd25b,_0x1fdfb3,_0x24942e={}){var _0x271119;let _0x29cb51=(_0x271119=_0x24942e['baseUri'])!==null&&_0x271119!==void 0?_0x271119:this['baseUri'];!_0x29cb51['endsWith']('/')&&(_0x29cb51=_0x29cb51+'/');_0x29cb51=_0x29cb51+'List';const _0x7e52c9={'account_name':_0x4fd25b,'list_name':_0x1fdfb3},_0x633fde=yield Fetch['post'](_0x29cb51,_0x582bd6,_0x7e52c9);if(_0x633fde['status']>0xc7&&_0x633fde['status']<0x12c){const _0x63cb57=yield _0x633fde['json']();return new SuccessfulAccountResponse(_0x63cb57);}if(_0x633fde['bodyUsed']){const _0x4d85a8=yield _0x633fde['json']();return new FailedAccountResponse(_0x4d85a8);}const _0x5b1334={'type':'','status':_0x633fde['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x5b1334);});}['remove'](_0x19ab56,_0x4b1345,_0x4718ea){return __awaiter$3(this,arguments,void 0,function*(_0x5661f7,_0x595086,_0x157c1f,_0x4b1e33={}){var _0x1abad1;let _0x2fb13a=(_0x1abad1=_0x4b1e33['baseUri'])!==null&&_0x1abad1!==void 0?_0x1abad1:this['baseUri'];_0x2fb13a=_0x2fb13a+'/List/'+_0x595086+'/'+_0x157c1f;const _0x3fecb5=yield Fetch['delete'](_0x2fb13a,_0x5661f7);if(_0x3fecb5['status']>0xc7&&_0x3fecb5['status']<0x12c){const _0x278fb0=yield _0x3fecb5['json']();return new SuccessfulAccountResponse(_0x278fb0);}if(_0x3fecb5['bodyUsed']){const _0x1cc9a3=yield _0x3fecb5['json']();return new FailedAccountResponse(_0x1cc9a3);}const _0x5b6ccf={'type':'','status':_0x3fecb5['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x5b6ccf);});}}
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(_0x5db6a5){this['isSuccess']=_0x5db6a5;}}class SuccessfulAccountResponse extends Response{constructor(_0x1f7188){super(!![]),this['account']=_0x1f7188;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x83fd19){super(![]),this['problem']=_0x83fd19;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x231240){super(!![]),this['tokens']=_0x231240;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x47eb45){super(![]),this['problem']=_0x47eb45;}['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(_0x28694f,_0x1a9e79,_0x317e6c,_0x161a07){function _0x2a3013(_0x128c13){return _0x128c13 instanceof _0x317e6c?_0x128c13:new _0x317e6c(function(_0x751e4c){_0x751e4c(_0x128c13);});}return new(_0x317e6c||(_0x317e6c=Promise))(function(_0x3c1218,_0x4a75f6){function _0x3511ab(_0x324773){try{_0x4cc1f0(_0x161a07['next'](_0x324773));}catch(_0x56542e){_0x4a75f6(_0x56542e);}}function _0x94cd92(_0x339f9c){try{_0x4cc1f0(_0x161a07['throw'](_0x339f9c));}catch(_0x4b8091){_0x4a75f6(_0x4b8091);}}function _0x4cc1f0(_0xf77f88){_0xf77f88['done']?_0x3c1218(_0xf77f88['value']):_0x2a3013(_0xf77f88['value'])['then'](_0x3511ab,_0x94cd92);}_0x4cc1f0((_0x161a07=_0x161a07['apply'](_0x28694f,_0x1a9e79||[]))['next']());});};class AccountService{constructor(_0x563378){this['baseUri']=_0x563378;}['get'](_0x5d6633,_0x3e9c5d){return __awaiter$2(this,arguments,void 0,function*(_0x13b384,_0x4ac820,_0x51d7f2={}){var _0x56b61a;let _0x3aa3bd=(_0x56b61a=_0x51d7f2['baseUri'])!==null&&_0x56b61a!==void 0?_0x56b61a:this['baseUri'];!_0x3aa3bd['endsWith']('/')&&(_0x3aa3bd=_0x3aa3bd+'/');_0x3aa3bd=_0x3aa3bd+'Account/'+_0x4ac820+'/';const _0xdb77e9=yield Fetch['get'](_0x3aa3bd,_0x13b384);if(_0xdb77e9['status']>0xc7&&_0xdb77e9['status']<0x12c){const _0x362940=yield _0xdb77e9['json']();return new SuccessfulAccountResponse(_0x362940);}if(_0xdb77e9['bodyUsed']){const _0x241707=yield _0xdb77e9['json']();return new FailedAccountResponse(_0x241707);}const _0x3d990b={'type':'','status':_0xdb77e9['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x3d990b);});}}
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(_0x14f533,_0x36061a,_0x4dda07,_0x556141){function _0x518aa6(_0x3feffc){return _0x3feffc instanceof _0x4dda07?_0x3feffc:new _0x4dda07(function(_0x129623){_0x129623(_0x3feffc);});}return new(_0x4dda07||(_0x4dda07=Promise))(function(_0x2102f8,_0x3e8634){function _0x15b2df(_0x40f9d0){try{_0x29497c(_0x556141['next'](_0x40f9d0));}catch(_0x3e0992){_0x3e8634(_0x3e0992);}}function _0x43cce6(_0x40cffc){try{_0x29497c(_0x556141['throw'](_0x40cffc));}catch(_0x4cb5af){_0x3e8634(_0x4cb5af);}}function _0x29497c(_0x5725d9){_0x5725d9['done']?_0x2102f8(_0x5725d9['value']):_0x518aa6(_0x5725d9['value'])['then'](_0x15b2df,_0x43cce6);}_0x29497c((_0x556141=_0x556141['apply'](_0x14f533,_0x36061a||[]))['next']());});};class TokenManager{constructor(_0x3a93d1){this['securityService']=_0x3a93d1;}['RefreshTokens'](_0x20c6a2){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x20c6a2['access_expires'])return new SuccessfulRefreshResponse(_0x20c6a2);if(Date['now']()>_0x20c6a2['refresh_expires']){const _0x230e5c={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x230e5c);}const _0x421d26=yield this['securityService']['refresh'](_0x20c6a2['refresh_token']);if(!_0x421d26['isSuccess'])return new FailedRefreshResponse(_0x421d26['toProblem']());return new SuccessfulRefreshResponse(_0x421d26['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(_0x4582be,_0x37e07d,_0x155afa,_0x291eec){function _0x506014(_0x147db7){return _0x147db7 instanceof _0x155afa?_0x147db7:new _0x155afa(function(_0x62764){_0x62764(_0x147db7);});}return new(_0x155afa||(_0x155afa=Promise))(function(_0xd26d61,_0x6acf8e){function _0x5d76a4(_0x4da379){try{_0x6cae41(_0x291eec['next'](_0x4da379));}catch(_0x1f185f){_0x6acf8e(_0x1f185f);}}function _0x334790(_0x59b712){try{_0x6cae41(_0x291eec['throw'](_0x59b712));}catch(_0x34e63d){_0x6acf8e(_0x34e63d);}}function _0x6cae41(_0x4f984e){_0x4f984e['done']?_0xd26d61(_0x4f984e['value']):_0x506014(_0x4f984e['value'])['then'](_0x5d76a4,_0x334790);}_0x6cae41((_0x291eec=_0x291eec['apply'](_0x4582be,_0x37e07d||[]))['next']());});};class SecurityService{constructor(_0x213ef5){this['baseUri']=_0x213ef5,this['tokenManager']=new TokenManager(this);}['refresh'](_0x5f1600){return __awaiter(this,arguments,void 0,function*(_0x5de950,_0x5e7ca1={}){var _0x4a8c01;let _0xed0c89=(_0x4a8c01=_0x5e7ca1['baseUri'])!==null&&_0x4a8c01!==void 0?_0x4a8c01:this['baseUri'];!_0xed0c89['endsWith']('/')&&(_0xed0c89=_0xed0c89+'/');_0xed0c89=_0xed0c89+'Security/Refresh';const _0x2fad28=yield Fetch['post'](_0xed0c89,_0x5de950,null);if(_0x2fad28['status']>0xc7&&_0x2fad28['status']<0x12c){const _0x4fc1e0=yield _0x2fad28['json']();return new SuccessfulRefreshResponse(_0x4fc1e0);}if(_0x2fad28['bodyUsed']){const _0x2ed6f8=yield _0x2fad28['json']();return new FailedRefreshResponse(_0x2ed6f8);}const _0x197b2b={'type':'','status':_0x2fad28['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x197b2b);});}}
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
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
 
package/dist/types.d.ts CHANGED
@@ -4,10 +4,6 @@ declare class AccountService {
4
4
  get(accessToken: string, accountName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
5
5
  }
6
6
 
7
- declare namespace AccountService_d {
8
- export { AccountService as default };
9
- }
10
-
11
7
  declare class ListService {
12
8
  readonly baseUri: string;
13
9
  constructor(baseUri: string);
@@ -15,10 +11,6 @@ declare class ListService {
15
11
  remove(accessToken: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
16
12
  }
17
13
 
18
- declare namespace ListService_d {
19
- export { ListService as default };
20
- }
21
-
22
14
  declare class TokenManager {
23
15
  readonly securityService: SecurityService;
24
16
  constructor(securityService: SecurityService);
@@ -59,12 +51,12 @@ type Problem = {
59
51
  title: string;
60
52
  status: number;
61
53
  instance: string;
62
- errors: Error;
54
+ details: string;
63
55
  };
64
56
  type Account = {
65
57
  name: string;
66
58
  owner: string;
67
- created_utc: Date;
59
+ created_utc: number;
68
60
  lists: List[];
69
61
  };
70
62
  type Tokens = {
@@ -98,4 +90,4 @@ declare class FailedRefreshResponse extends Response<Tokens, Problem> {
98
90
  toProblem(): Problem;
99
91
  }
100
92
 
101
- 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.5",
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(_0x22b0dc,_0x15a21f,_0x3815e9,_0x5162bb){function _0x122c0f(_0x3016a0){return _0x3016a0 instanceof _0x3815e9?_0x3016a0:new _0x3815e9(function(_0x36a031){_0x36a031(_0x3016a0);});}return new(_0x3815e9||(_0x3815e9=Promise))(function(_0xdc914b,_0x27f9f1){function _0x4de182(_0x466639){try{_0x2d44da(_0x5162bb['next'](_0x466639));}catch(_0x513151){_0x27f9f1(_0x513151);}}function _0x5359b2(_0x3d06d5){try{_0x2d44da(_0x5162bb['throw'](_0x3d06d5));}catch(_0x5c777b){_0x27f9f1(_0x5c777b);}}function _0x2d44da(_0x229fd4){_0x229fd4['done']?_0xdc914b(_0x229fd4['value']):_0x122c0f(_0x229fd4['value'])['then'](_0x4de182,_0x5359b2);}_0x2d44da((_0x5162bb=_0x5162bb['apply'](_0x22b0dc,_0x15a21f||[]))['next']());});};class Fetch{static['get'](_0x47a65d,_0x153fb0){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x47a65d,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x153fb0}});});}static['post'](_0x1e5e17,_0x2c85b9,_0x281891){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1e5e17,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2c85b9},'body':_0x281891?JSON['stringify'](_0x281891):null});});}static['put'](_0x474ca6,_0x35a23c,_0x6d0dcc){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x474ca6,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x35a23c},'body':_0x6d0dcc?JSON['stringify'](_0x6d0dcc):null});});}static['delete'](_0x3b1d88,_0x861282){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3b1d88,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x861282}});});}}
2
-
3
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x20ff07,_0xb6283b,_0x1879ef,_0x3e6d96){function _0x1121ef(_0x4049f8){return _0x4049f8 instanceof _0x1879ef?_0x4049f8:new _0x1879ef(function(_0x3d294d){_0x3d294d(_0x4049f8);});}return new(_0x1879ef||(_0x1879ef=Promise))(function(_0x23b194,_0x17d1f8){function _0x25da45(_0x231329){try{_0x381188(_0x3e6d96['next'](_0x231329));}catch(_0x33a66b){_0x17d1f8(_0x33a66b);}}function _0x4fa7b6(_0xe33269){try{_0x381188(_0x3e6d96['throw'](_0xe33269));}catch(_0x1bfdca){_0x17d1f8(_0x1bfdca);}}function _0x381188(_0x2808fc){_0x2808fc['done']?_0x23b194(_0x2808fc['value']):_0x1121ef(_0x2808fc['value'])['then'](_0x25da45,_0x4fa7b6);}_0x381188((_0x3e6d96=_0x3e6d96['apply'](_0x20ff07,_0xb6283b||[]))['next']());});};class ListService{constructor(_0x42ae8c){this['baseUri']=_0x42ae8c;}['add'](_0x3b5268,_0x32ee5f,_0x46ce86){return __awaiter$3(this,arguments,void 0,function*(_0x19e76e,_0x588bc2,_0x5fc274,_0x402aa7={}){var _0x12ce8a;let _0x3c9a30=(_0x12ce8a=_0x402aa7['baseUri'])!==null&&_0x12ce8a!==void 0?_0x12ce8a:this['baseUri'];!_0x3c9a30['endsWith']('/')&&(_0x3c9a30=_0x3c9a30+'/');_0x3c9a30=_0x3c9a30+'List';const _0x2814a1={'account_name':_0x588bc2,'list_name':_0x5fc274},_0x48e17e=yield Fetch['post'](_0x3c9a30,_0x19e76e,_0x2814a1);if(_0x48e17e['status']>0xc7&&_0x48e17e['status']<0x12c){const _0x4b6bf6=yield _0x48e17e['json']();return new SuccessfulAccountResponse(_0x4b6bf6);}if(_0x48e17e['bodyUsed']){const _0x182f98=yield _0x48e17e['json']();return new FailedAccountResponse(_0x182f98);}const _0x2eab11={'type':'','status':_0x48e17e['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x2eab11);});}['remove'](_0x315206,_0x50f029,_0x55c0cb){return __awaiter$3(this,arguments,void 0,function*(_0x4091b1,_0x40d4ba,_0x233e3e,_0xf22e10={}){var _0x223b9a;let _0x299f26=(_0x223b9a=_0xf22e10['baseUri'])!==null&&_0x223b9a!==void 0?_0x223b9a:this['baseUri'];_0x299f26=_0x299f26+'/List/'+_0x40d4ba+'/'+_0x233e3e;const _0x10b202=yield Fetch['delete'](_0x299f26,_0x4091b1);if(_0x10b202['status']>0xc7&&_0x10b202['status']<0x12c){const _0x6d39eb=yield _0x10b202['json']();return new SuccessfulAccountResponse(_0x6d39eb);}if(_0x10b202['bodyUsed']){const _0x51b6d8=yield _0x10b202['json']();return new FailedAccountResponse(_0x51b6d8);}const _0x29f228={'type':'','status':_0x10b202['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x29f228);});}}
4
-
5
- class Response{constructor(_0x133e47){this['isSuccess']=_0x133e47;}}class SuccessfulAccountResponse extends Response{constructor(_0x27d2e8){super(!![]),this['account']=_0x27d2e8;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x32f2f9){super(![]),this['problem']=_0x32f2f9;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x2460f1){super(!![]),this['tokens']=_0x2460f1;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x2f2be6){super(![]),this['problem']=_0x2f2be6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
-
7
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x3355da,_0x436357,_0x2e9e98,_0x218c90){function _0x416807(_0x4b96f0){return _0x4b96f0 instanceof _0x2e9e98?_0x4b96f0:new _0x2e9e98(function(_0x1c9abd){_0x1c9abd(_0x4b96f0);});}return new(_0x2e9e98||(_0x2e9e98=Promise))(function(_0x35ee5c,_0x462aeb){function _0x3dc267(_0x4ea50e){try{_0xa1de2e(_0x218c90['next'](_0x4ea50e));}catch(_0x380b3b){_0x462aeb(_0x380b3b);}}function _0x39f5b7(_0x52f629){try{_0xa1de2e(_0x218c90['throw'](_0x52f629));}catch(_0x1543b6){_0x462aeb(_0x1543b6);}}function _0xa1de2e(_0x4c0ea8){_0x4c0ea8['done']?_0x35ee5c(_0x4c0ea8['value']):_0x416807(_0x4c0ea8['value'])['then'](_0x3dc267,_0x39f5b7);}_0xa1de2e((_0x218c90=_0x218c90['apply'](_0x3355da,_0x436357||[]))['next']());});};class AccountService{constructor(_0x4c03d4){this['baseUri']=_0x4c03d4;}['get'](_0x2cd554,_0x32bb9){return __awaiter$2(this,arguments,void 0,function*(_0x528add,_0x279872,_0x294b81={}){var _0x8eca0b;let _0x121c1b=(_0x8eca0b=_0x294b81['baseUri'])!==null&&_0x8eca0b!==void 0?_0x8eca0b:this['baseUri'];!_0x121c1b['endsWith']('/')&&(_0x121c1b=_0x121c1b+'/');_0x121c1b=_0x121c1b+'Account/'+_0x279872+'/';const _0x14e6a8=yield Fetch['get'](_0x121c1b,_0x528add);if(_0x14e6a8['status']>0xc7&&_0x14e6a8['status']<0x12c){const _0xb09ca4=yield _0x14e6a8['json']();return new SuccessfulAccountResponse(_0xb09ca4);}if(_0x14e6a8['bodyUsed']){const _0x87284b=yield _0x14e6a8['json']();return new FailedAccountResponse(_0x87284b);}const _0x9e48c9={'type':'','status':_0x14e6a8['status'],'title':'','instance':'','errors':{}};return new FailedAccountResponse(_0x9e48c9);});}}
8
-
9
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x53ab04,_0xe5ec75,_0x21937b,_0x226926){function _0x258cd2(_0x633c02){return _0x633c02 instanceof _0x21937b?_0x633c02:new _0x21937b(function(_0x50eb27){_0x50eb27(_0x633c02);});}return new(_0x21937b||(_0x21937b=Promise))(function(_0x129920,_0x2810c6){function _0x8a8e60(_0x4de5f9){try{_0x422057(_0x226926['next'](_0x4de5f9));}catch(_0x1fdef7){_0x2810c6(_0x1fdef7);}}function _0xba6b32(_0x56028c){try{_0x422057(_0x226926['throw'](_0x56028c));}catch(_0x48e0aa){_0x2810c6(_0x48e0aa);}}function _0x422057(_0x567dfc){_0x567dfc['done']?_0x129920(_0x567dfc['value']):_0x258cd2(_0x567dfc['value'])['then'](_0x8a8e60,_0xba6b32);}_0x422057((_0x226926=_0x226926['apply'](_0x53ab04,_0xe5ec75||[]))['next']());});};class TokenManager{constructor(_0x404272){this['securityService']=_0x404272;}['RefreshTokens'](_0x5591de){return __awaiter$1(this,void 0,void 0,function*(){if(Date['now']()<_0x5591de['access_expires'])return new SuccessfulRefreshResponse(_0x5591de);if(Date['now']()>_0x5591de['refresh_expires']){const _0x26e588={'type':'','status':0x193,'title':'Forbidden','instance':'','errors':{}};return new FailedRefreshResponse(_0x26e588);}const _0x283b50=yield this['securityService']['refresh'](_0x5591de['refresh_token']);if(!_0x283b50['isSuccess'])return new FailedRefreshResponse(_0x283b50['toProblem']());return new SuccessfulRefreshResponse(_0x283b50['toSuccess']());});}}
10
-
11
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x552c69,_0x51f5bb,_0x280868,_0xc280f6){function _0x76c13d(_0x3389e8){return _0x3389e8 instanceof _0x280868?_0x3389e8:new _0x280868(function(_0x3bd60b){_0x3bd60b(_0x3389e8);});}return new(_0x280868||(_0x280868=Promise))(function(_0xe93b9d,_0x3626f7){function _0x17ffbf(_0x866605){try{_0x2191e5(_0xc280f6['next'](_0x866605));}catch(_0x37b84c){_0x3626f7(_0x37b84c);}}function _0x293675(_0x284036){try{_0x2191e5(_0xc280f6['throw'](_0x284036));}catch(_0x47bdb9){_0x3626f7(_0x47bdb9);}}function _0x2191e5(_0x22c695){_0x22c695['done']?_0xe93b9d(_0x22c695['value']):_0x76c13d(_0x22c695['value'])['then'](_0x17ffbf,_0x293675);}_0x2191e5((_0xc280f6=_0xc280f6['apply'](_0x552c69,_0x51f5bb||[]))['next']());});};class SecurityService{constructor(_0x15df19){this['baseUri']=_0x15df19,this['tokenManager']=new TokenManager(this);}['refresh'](_0x50cf56){return __awaiter(this,arguments,void 0,function*(_0x366ad3,_0x1fcd71={}){var _0x210760;let _0x3ddef4=(_0x210760=_0x1fcd71['baseUri'])!==null&&_0x210760!==void 0?_0x210760:this['baseUri'];!_0x3ddef4['endsWith']('/')&&(_0x3ddef4=_0x3ddef4+'/');_0x3ddef4=_0x3ddef4+'Security/Refresh';const _0x5b11de=yield Fetch['post'](_0x3ddef4,_0x366ad3,null);if(_0x5b11de['status']>0xc7&&_0x5b11de['status']<0x12c){const _0x4203de=yield _0x5b11de['json']();return new SuccessfulRefreshResponse(_0x4203de);}if(_0x5b11de['bodyUsed']){const _0x4e3a8c=yield _0x5b11de['json']();return new FailedRefreshResponse(_0x4e3a8c);}const _0x384aa8={'type':'','status':_0x5b11de['status'],'title':'','instance':'','errors':{}};return new FailedRefreshResponse(_0x384aa8);});}}
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 };