@searchability/admin-client 0.0.16 → 0.0.17

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
+ class Response{constructor(_0x3005e1){this['isSuccess']=_0x3005e1;}}class SuccessfulAccountResponse extends Response{constructor(_0x1cc25f){super(!![]),this['account']=_0x1cc25f;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x55a72c){super(![]),this['problem']=_0x55a72c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x315173){super(!![]),this['tokens']=_0x315173;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x1529c7){super(![]),this['problem']=_0x1529c7;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x4c9b69){super(!![]),this['apiKey']=_0x4c9b69;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x25ca9d){super(![]),this['problem']=_0x25ca9d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
2
+
3
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x16b075,_0x5f4efa,_0x193054,_0x2a1d99){function _0x1efbdb(_0x17319e){return _0x17319e instanceof _0x193054?_0x17319e:new _0x193054(function(_0x1e37c2){_0x1e37c2(_0x17319e);});}return new(_0x193054||(_0x193054=Promise))(function(_0x1e4e9e,_0x307804){function _0x224083(_0x1a34bb){try{_0x2f02be(_0x2a1d99['next'](_0x1a34bb));}catch(_0x2a9186){_0x307804(_0x2a9186);}}function _0x502022(_0x43608f){try{_0x2f02be(_0x2a1d99['throw'](_0x43608f));}catch(_0x444de6){_0x307804(_0x444de6);}}function _0x2f02be(_0x5d1537){_0x5d1537['done']?_0x1e4e9e(_0x5d1537['value']):_0x1efbdb(_0x5d1537['value'])['then'](_0x224083,_0x502022);}_0x2f02be((_0x2a1d99=_0x2a1d99['apply'](_0x16b075,_0x5f4efa||[]))['next']());});};class AccountService{constructor(_0x1c10f6,_0x30d478){this['tokenManager']=_0x1c10f6,this['fetch']=_0x30d478;}['get'](_0x253b94,_0x4b7594){return __awaiter$5(this,void 0,void 0,function*(){const _0x38d60c=yield this['tokenManager']['getOrRefreshTokens'](_0x4b7594);if(!_0x38d60c['isSuccess'])return new FailedAccountResponse(_0x38d60c['toProblem']());_0x4b7594=_0x38d60c['toSuccess']();const _0xcf5b6='Account/'+_0x253b94+'/',_0x26853a=yield this['fetch']['get'](_0xcf5b6,_0x4b7594['access_token']);try{if(_0x26853a['status']>0xc7&&_0x26853a['status']<0x12c){const _0x1d3e9b=yield _0x26853a['json']();return new SuccessfulAccountResponse(_0x1d3e9b);}const _0x521578=yield _0x26853a['json']();return new FailedAccountResponse(_0x521578);}catch(_0x4a8e4a){if(_0x4a8e4a instanceof Error)return new FailedAccountResponse({'detail':_0x4a8e4a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4a8e4a;}});}}
4
+
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x29f5be,_0x709364,_0x162ede,_0x2515ff){function _0x9b04c4(_0x2d7c01){return _0x2d7c01 instanceof _0x162ede?_0x2d7c01:new _0x162ede(function(_0x49f813){_0x49f813(_0x2d7c01);});}return new(_0x162ede||(_0x162ede=Promise))(function(_0x299066,_0xa37cf1){function _0x4c2451(_0x378e7f){try{_0x54a9a2(_0x2515ff['next'](_0x378e7f));}catch(_0x3953ed){_0xa37cf1(_0x3953ed);}}function _0x3db26b(_0x141710){try{_0x54a9a2(_0x2515ff['throw'](_0x141710));}catch(_0x5d6d3d){_0xa37cf1(_0x5d6d3d);}}function _0x54a9a2(_0x435eea){_0x435eea['done']?_0x299066(_0x435eea['value']):_0x9b04c4(_0x435eea['value'])['then'](_0x4c2451,_0x3db26b);}_0x54a9a2((_0x2515ff=_0x2515ff['apply'](_0x29f5be,_0x709364||[]))['next']());});};class ApiKeyService{constructor(_0x7a9f26,_0x2364b1){this['tokenManager']=_0x7a9f26,this['fetch']=_0x2364b1;}['create'](_0x11f81c,_0x51f9dc,_0x2fa237){return __awaiter$4(this,void 0,void 0,function*(){const _0x7b3abb=yield this['tokenManager']['getOrRefreshTokens'](_0x2fa237);if(!_0x7b3abb['isSuccess'])return new FailedApiKeyResponse(_0x7b3abb['toProblem']());_0x2fa237=_0x7b3abb['toSuccess']();const _0xb39fd='ApiKey/Create',_0x4491ab={'account_name':_0x11f81c,'name':_0x51f9dc};try{const _0x5c8ae7=yield this['fetch']['post'](_0xb39fd,_0x2fa237['access_token'],_0x4491ab);if(_0x5c8ae7['status']>0xc7&&_0x5c8ae7['status']<0x12c){const _0x8247b0=yield _0x5c8ae7['json']();return new SuccessfulApiKeyResponse(_0x8247b0);}const _0xf5464a=yield _0x5c8ae7['json']();return new FailedApiKeyResponse(_0xf5464a);}catch(_0x1462ff){if(_0x1462ff instanceof Error)return new FailedApiKeyResponse({'detail':_0x1462ff['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1462ff;}});}}
6
+
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0xe5bd9f,_0xe31908,_0x45bbc9,_0x46078c){function _0x2a80e6(_0x4a3269){return _0x4a3269 instanceof _0x45bbc9?_0x4a3269:new _0x45bbc9(function(_0x2b9c7d){_0x2b9c7d(_0x4a3269);});}return new(_0x45bbc9||(_0x45bbc9=Promise))(function(_0x5ebb6a,_0x12d490){function _0x356c9d(_0x436092){try{_0x1ae97f(_0x46078c['next'](_0x436092));}catch(_0x1c73c9){_0x12d490(_0x1c73c9);}}function _0x3c1840(_0x56450e){try{_0x1ae97f(_0x46078c['throw'](_0x56450e));}catch(_0x17f2eb){_0x12d490(_0x17f2eb);}}function _0x1ae97f(_0x550208){_0x550208['done']?_0x5ebb6a(_0x550208['value']):_0x2a80e6(_0x550208['value'])['then'](_0x356c9d,_0x3c1840);}_0x1ae97f((_0x46078c=_0x46078c['apply'](_0xe5bd9f,_0xe31908||[]))['next']());});};class ListService{constructor(_0x12acfb,_0x52f942){this['tokenManager']=_0x12acfb,this['fetch']=_0x52f942;}['add'](_0x5d89e3,_0x4a75ee,_0x1fa8c7){return __awaiter$3(this,void 0,void 0,function*(){const _0x3a1cab=yield this['tokenManager']['getOrRefreshTokens'](_0x1fa8c7);if(!_0x3a1cab['isSuccess'])return new FailedAccountResponse(_0x3a1cab['toProblem']());_0x1fa8c7=_0x3a1cab['toSuccess']();const _0x26bd11='List',_0x181780={'account_name':_0x5d89e3,'list_name':_0x4a75ee};try{const _0x56cd27=yield this['fetch']['post'](_0x26bd11,_0x1fa8c7['access_token'],_0x181780);if(_0x56cd27['status']>0xc7&&_0x56cd27['status']<0x12c){const _0x2b188a=yield _0x56cd27['json']();return new SuccessfulAccountResponse(_0x2b188a);}const _0x69a1c1=yield _0x56cd27['json']();return new FailedAccountResponse(_0x69a1c1);}catch(_0x419dd9){if(_0x419dd9 instanceof Error)return new FailedAccountResponse({'detail':_0x419dd9['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x419dd9;}});}['remove'](_0x1719f4,_0x8c0090,_0x251034){return __awaiter$3(this,void 0,void 0,function*(){const _0x2fde6d=yield this['tokenManager']['getOrRefreshTokens'](_0x251034);if(!_0x2fde6d['isSuccess'])return new FailedAccountResponse(_0x2fde6d['toProblem']());_0x251034=_0x2fde6d['toSuccess']();const _0x46a2fc='List/'+_0x1719f4+'/'+_0x8c0090,_0x41f47b=yield this['fetch']['delete'](_0x46a2fc,_0x251034['access_token']);try{if(_0x41f47b['status']>0xc7&&_0x41f47b['status']<0x12c){const _0x3df061=yield _0x41f47b['json']();return new SuccessfulAccountResponse(_0x3df061);}const _0x4b5a09=yield _0x41f47b['json']();return new FailedAccountResponse(_0x4b5a09);}catch(_0x348c44){if(_0x348c44 instanceof Error)return new FailedAccountResponse({'detail':_0x348c44['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x348c44;}});}}
8
+
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4206d4,_0x344823,_0xb3439,_0x325efa){function _0x26490b(_0x5174ab){return _0x5174ab instanceof _0xb3439?_0x5174ab:new _0xb3439(function(_0x3ec3bf){_0x3ec3bf(_0x5174ab);});}return new(_0xb3439||(_0xb3439=Promise))(function(_0x434263,_0x109767){function _0x490595(_0x2d4948){try{_0x4cda62(_0x325efa['next'](_0x2d4948));}catch(_0x5110ff){_0x109767(_0x5110ff);}}function _0x4e5704(_0x522976){try{_0x4cda62(_0x325efa['throw'](_0x522976));}catch(_0x1e6d1d){_0x109767(_0x1e6d1d);}}function _0x4cda62(_0x4f20f3){_0x4f20f3['done']?_0x434263(_0x4f20f3['value']):_0x26490b(_0x4f20f3['value'])['then'](_0x490595,_0x4e5704);}_0x4cda62((_0x325efa=_0x325efa['apply'](_0x4206d4,_0x344823||[]))['next']());});};class TokenManager{constructor(_0xee9c3a){this['authClient']=_0xee9c3a;}['getOrRefreshTokens'](_0x997113){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0x997113['access_expires'])return new SuccessfulAuthResponse(_0x997113);if(Date['now']()>_0x997113['refresh_expires'])return yield this['authClient']['refresh'](_0x997113['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
10
+
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x156057,_0x13cb7c,_0x4723ba,_0x516cc5){function _0x9090af(_0x553166){return _0x553166 instanceof _0x4723ba?_0x553166:new _0x4723ba(function(_0x120c4){_0x120c4(_0x553166);});}return new(_0x4723ba||(_0x4723ba=Promise))(function(_0x4875a2,_0x572622){function _0x47c231(_0x177416){try{_0x3b4ed6(_0x516cc5['next'](_0x177416));}catch(_0x505e0a){_0x572622(_0x505e0a);}}function _0x3b1772(_0x158dd1){try{_0x3b4ed6(_0x516cc5['throw'](_0x158dd1));}catch(_0x5ce138){_0x572622(_0x5ce138);}}function _0x3b4ed6(_0x1e6259){_0x1e6259['done']?_0x4875a2(_0x1e6259['value']):_0x9090af(_0x1e6259['value'])['then'](_0x47c231,_0x3b1772);}_0x3b4ed6((_0x516cc5=_0x516cc5['apply'](_0x156057,_0x13cb7c||[]))['next']());});};class Fetch{constructor(_0x39d986){this['baseUri']=_0x39d986,this['getUrl']=_0x32c0fc=>{return _0x32c0fc['startsWith']('/')&&(_0x32c0fc=_0x32c0fc['replace']('/','')),''+this['baseUri']+_0x32c0fc;},!_0x39d986['endsWith']('/')&&(_0x39d986=_0x39d986+'/');}['get'](_0x92f9cf,_0x2ac717){return __awaiter$1(this,void 0,void 0,function*(){const _0xe95cb6=this['getUrl'](_0x92f9cf);return yield fetch(_0xe95cb6,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2ac717}});});}['post'](_0x3a4b9e,_0x3d3ebd,_0x5582ec){return __awaiter$1(this,void 0,void 0,function*(){const _0x7183ed=this['getUrl'](_0x3a4b9e);return yield fetch(_0x7183ed,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3d3ebd},'body':_0x5582ec?JSON['stringify'](_0x5582ec):null});});}['put'](_0x174649,_0x52926d,_0x467928){return __awaiter$1(this,void 0,void 0,function*(){const _0x1ec05c=this['getUrl'](_0x174649);return yield fetch(_0x1ec05c,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x52926d},'body':_0x467928?JSON['stringify'](_0x467928):null});});}['delete'](_0x2aaeae,_0x438675){return __awaiter$1(this,void 0,void 0,function*(){const _0x3c7928=this['getUrl'](_0x2aaeae);return yield fetch(_0x3c7928,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x438675}});});}}
12
+
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x1f156f,_0x3d5022,_0x2b3999,_0x3fdd59){function _0x2bc428(_0x48f3bd){return _0x48f3bd instanceof _0x2b3999?_0x48f3bd:new _0x2b3999(function(_0x5da92f){_0x5da92f(_0x48f3bd);});}return new(_0x2b3999||(_0x2b3999=Promise))(function(_0x194b20,_0x1d2bee){function _0x121007(_0x1c9c97){try{_0x76ff54(_0x3fdd59['next'](_0x1c9c97));}catch(_0x34616b){_0x1d2bee(_0x34616b);}}function _0x299bd1(_0xeb975a){try{_0x76ff54(_0x3fdd59['throw'](_0xeb975a));}catch(_0x5d3daf){_0x1d2bee(_0x5d3daf);}}function _0x76ff54(_0x58cfa0){_0x58cfa0['done']?_0x194b20(_0x58cfa0['value']):_0x2bc428(_0x58cfa0['value'])['then'](_0x121007,_0x299bd1);}_0x76ff54((_0x3fdd59=_0x3fdd59['apply'](_0x1f156f,_0x3d5022||[]))['next']());});};class AdminClient{constructor(_0x5476c3,_0x1445e5='https://admin.searchability.dev/'){var _0x4e3864=new TokenManager(_0x5476c3),_0x5996ea=new Fetch(_0x1445e5);this['Accounts']=new AccountService(_0x4e3864,_0x5996ea),this['Lists']=new ListService(_0x4e3864,_0x5996ea),this['ApiKeys']=new ApiKeyService(_0x4e3864,_0x5996ea);}}class AuthClient{constructor(_0x55c076='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x55c076);}['login'](_0x54ba48){return __awaiter(this,void 0,void 0,function*(){var _0x59c163='login/'+_0x54ba48;try{const _0x516149=yield yield fetch(_0x59c163);if(_0x516149['status']>0xc7&&_0x516149['status']<0x12c){const _0x1250ce=yield _0x516149['json']();return new SuccessfulAuthResponse(_0x1250ce);}const _0x5ce50a=yield _0x516149['json']();return new FailedAuthResponse(_0x5ce50a);}catch(_0x280a14){if(_0x280a14 instanceof Error)return new FailedAuthResponse({'detail':_0x280a14['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x280a14;}});}['refresh'](_0x5ec6d9){return __awaiter(this,void 0,void 0,function*(){var _0x212d3d='refresh';try{const _0x4c4b18=yield this['fetch']['post'](_0x212d3d,_0x5ec6d9,null);if(_0x4c4b18['status']>0xc7&&_0x4c4b18['status']<0x12c){const _0x428006=yield _0x4c4b18['json']();return new SuccessfulAuthResponse(_0x428006);}const _0x290e9c=yield _0x4c4b18['json']();return new FailedAuthResponse(_0x290e9c);}catch(_0x17ccb3){if(_0x17ccb3 instanceof Error)return new FailedAuthResponse({'detail':_0x17ccb3['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x17ccb3;}});}}
14
+
15
+ export { AdminClient, AuthClient };
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- class Response{constructor(_0x483b2a){this['isSuccess']=_0x483b2a;}}class SuccessfulAccountResponse extends Response{constructor(_0x359602){super(!![]),this['account']=_0x359602;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x57b0ad){super(![]),this['problem']=_0x57b0ad;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x4d8ea7){super(!![]),this['tokens']=_0x4d8ea7;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x11fb24){super(![]),this['problem']=_0x11fb24;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x10e474){super(!![]),this['apiKey']=_0x10e474;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x1b0f09){super(![]),this['problem']=_0x1b0f09;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
3
+ class Response{constructor(_0x38b363){this['isSuccess']=_0x38b363;}}class SuccessfulAccountResponse extends Response{constructor(_0x1e2022){super(!![]),this['account']=_0x1e2022;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x251b92){super(![]),this['problem']=_0x251b92;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x43f0e3){super(!![]),this['tokens']=_0x43f0e3;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x18ba77){super(![]),this['problem']=_0x18ba77;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x4c702e){super(!![]),this['apiKey']=_0x4c702e;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0xc76817){super(![]),this['problem']=_0xc76817;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
4
 
5
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x102e2e,_0x7fbaf2,_0x1ababd,_0x2b058a){function _0x1776be(_0x234885){return _0x234885 instanceof _0x1ababd?_0x234885:new _0x1ababd(function(_0x1734fb){_0x1734fb(_0x234885);});}return new(_0x1ababd||(_0x1ababd=Promise))(function(_0x58f85d,_0x4bca37){function _0x8a7cc5(_0x384bf9){try{_0x2193ad(_0x2b058a['next'](_0x384bf9));}catch(_0xd8184a){_0x4bca37(_0xd8184a);}}function _0x4d1980(_0x54874a){try{_0x2193ad(_0x2b058a['throw'](_0x54874a));}catch(_0x48765f){_0x4bca37(_0x48765f);}}function _0x2193ad(_0x3d404d){_0x3d404d['done']?_0x58f85d(_0x3d404d['value']):_0x1776be(_0x3d404d['value'])['then'](_0x8a7cc5,_0x4d1980);}_0x2193ad((_0x2b058a=_0x2b058a['apply'](_0x102e2e,_0x7fbaf2||[]))['next']());});};class AccountService{constructor(_0x264609,_0x382bc7){this['tokenManager']=_0x264609,this['fetch']=_0x382bc7;}['get'](_0xbeda9f,_0x188320){return __awaiter$5(this,void 0,void 0,function*(){const _0x559a74=yield this['tokenManager']['getOrRefreshTokens'](_0x188320);if(!_0x559a74['isSuccess'])return new FailedAccountResponse(_0x559a74['toProblem']());_0x188320=_0x559a74['toSuccess']();const _0x500bd0='Account/'+_0xbeda9f+'/',_0x1a2763=yield this['fetch']['get'](_0x500bd0,_0x188320['access_token']);try{if(_0x1a2763['status']>0xc7&&_0x1a2763['status']<0x12c){const _0x1699e5=yield _0x1a2763['json']();return new SuccessfulAccountResponse(_0x1699e5);}const _0x4a60d6=yield _0x1a2763['json']();return new FailedAccountResponse(_0x4a60d6);}catch(_0x210731){if(_0x210731 instanceof Error)return new FailedAccountResponse({'detail':_0x210731['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x210731;}});}}
5
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x546a18,_0x5177f8,_0x55b640,_0xda713a){function _0x128253(_0x284af3){return _0x284af3 instanceof _0x55b640?_0x284af3:new _0x55b640(function(_0x8616b8){_0x8616b8(_0x284af3);});}return new(_0x55b640||(_0x55b640=Promise))(function(_0x204a87,_0x2fe2fe){function _0x49a779(_0x4e1194){try{_0x43dfe3(_0xda713a['next'](_0x4e1194));}catch(_0x32253f){_0x2fe2fe(_0x32253f);}}function _0x29458c(_0x338281){try{_0x43dfe3(_0xda713a['throw'](_0x338281));}catch(_0x261c84){_0x2fe2fe(_0x261c84);}}function _0x43dfe3(_0x3e7d39){_0x3e7d39['done']?_0x204a87(_0x3e7d39['value']):_0x128253(_0x3e7d39['value'])['then'](_0x49a779,_0x29458c);}_0x43dfe3((_0xda713a=_0xda713a['apply'](_0x546a18,_0x5177f8||[]))['next']());});};class AccountService{constructor(_0x332d06,_0x3ac89b){this['tokenManager']=_0x332d06,this['fetch']=_0x3ac89b;}['get'](_0xb76a85,_0x1788c7){return __awaiter$5(this,void 0,void 0,function*(){const _0x103926=yield this['tokenManager']['getOrRefreshTokens'](_0x1788c7);if(!_0x103926['isSuccess'])return new FailedAccountResponse(_0x103926['toProblem']());_0x1788c7=_0x103926['toSuccess']();const _0x31c98d='Account/'+_0xb76a85+'/',_0x57ff24=yield this['fetch']['get'](_0x31c98d,_0x1788c7['access_token']);try{if(_0x57ff24['status']>0xc7&&_0x57ff24['status']<0x12c){const _0x52219e=yield _0x57ff24['json']();return new SuccessfulAccountResponse(_0x52219e);}const _0x204550=yield _0x57ff24['json']();return new FailedAccountResponse(_0x204550);}catch(_0x33a77d){if(_0x33a77d instanceof Error)return new FailedAccountResponse({'detail':_0x33a77d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x33a77d;}});}}
6
6
 
7
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2a690f,_0x3ee8af,_0x5fa35b,_0x41f1e7){function _0x5acfe0(_0x447519){return _0x447519 instanceof _0x5fa35b?_0x447519:new _0x5fa35b(function(_0x560672){_0x560672(_0x447519);});}return new(_0x5fa35b||(_0x5fa35b=Promise))(function(_0x314dec,_0x290882){function _0x45ce4a(_0x2dd66b){try{_0x8d54ae(_0x41f1e7['next'](_0x2dd66b));}catch(_0x13ecc3){_0x290882(_0x13ecc3);}}function _0x5c12ed(_0x23e832){try{_0x8d54ae(_0x41f1e7['throw'](_0x23e832));}catch(_0x2b4991){_0x290882(_0x2b4991);}}function _0x8d54ae(_0x3c7282){_0x3c7282['done']?_0x314dec(_0x3c7282['value']):_0x5acfe0(_0x3c7282['value'])['then'](_0x45ce4a,_0x5c12ed);}_0x8d54ae((_0x41f1e7=_0x41f1e7['apply'](_0x2a690f,_0x3ee8af||[]))['next']());});};class ApiKeyService{constructor(_0x3246be,_0x262f5d){this['tokenManager']=_0x3246be,this['fetch']=_0x262f5d;}['create'](_0x7404ff,_0x441724,_0x38cbb5){return __awaiter$4(this,void 0,void 0,function*(){const _0xbed44c=yield this['tokenManager']['getOrRefreshTokens'](_0x38cbb5);if(!_0xbed44c['isSuccess'])return new FailedApiKeyResponse(_0xbed44c['toProblem']());_0x38cbb5=_0xbed44c['toSuccess']();const _0x5153b1='ApiKey/Create',_0x3fbca9={'account_name':_0x7404ff,'name':_0x441724};try{const _0x14ce0a=yield this['fetch']['post'](_0x5153b1,_0x38cbb5['access_token'],_0x3fbca9);if(_0x14ce0a['status']>0xc7&&_0x14ce0a['status']<0x12c){const _0x266c21=yield _0x14ce0a['json']();return new SuccessfulApiKeyResponse(_0x266c21);}const _0x4738f5=yield _0x14ce0a['json']();return new FailedApiKeyResponse(_0x4738f5);}catch(_0x5692d9){if(_0x5692d9 instanceof Error)return new FailedApiKeyResponse({'detail':_0x5692d9['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5692d9;}});}}
7
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x5a2ef7,_0x42993f,_0x515964,_0x327be5){function _0x157a93(_0x852cdf){return _0x852cdf instanceof _0x515964?_0x852cdf:new _0x515964(function(_0x21ad9f){_0x21ad9f(_0x852cdf);});}return new(_0x515964||(_0x515964=Promise))(function(_0xff9a69,_0x4d2f8e){function _0xfac469(_0x3f7802){try{_0x255c65(_0x327be5['next'](_0x3f7802));}catch(_0x4a5a1f){_0x4d2f8e(_0x4a5a1f);}}function _0xd891a5(_0x3ecc25){try{_0x255c65(_0x327be5['throw'](_0x3ecc25));}catch(_0x2006ba){_0x4d2f8e(_0x2006ba);}}function _0x255c65(_0x208a22){_0x208a22['done']?_0xff9a69(_0x208a22['value']):_0x157a93(_0x208a22['value'])['then'](_0xfac469,_0xd891a5);}_0x255c65((_0x327be5=_0x327be5['apply'](_0x5a2ef7,_0x42993f||[]))['next']());});};class ApiKeyService{constructor(_0x54f02f,_0x3708ae){this['tokenManager']=_0x54f02f,this['fetch']=_0x3708ae;}['create'](_0x8eb53c,_0x516433,_0x90d2e6){return __awaiter$4(this,void 0,void 0,function*(){const _0x4b021e=yield this['tokenManager']['getOrRefreshTokens'](_0x90d2e6);if(!_0x4b021e['isSuccess'])return new FailedApiKeyResponse(_0x4b021e['toProblem']());_0x90d2e6=_0x4b021e['toSuccess']();const _0x58f1a9='ApiKey/Create',_0x18ee73={'account_name':_0x8eb53c,'name':_0x516433};try{const _0x4fc899=yield this['fetch']['post'](_0x58f1a9,_0x90d2e6['access_token'],_0x18ee73);if(_0x4fc899['status']>0xc7&&_0x4fc899['status']<0x12c){const _0x3e7cb7=yield _0x4fc899['json']();return new SuccessfulApiKeyResponse(_0x3e7cb7);}const _0x37243d=yield _0x4fc899['json']();return new FailedApiKeyResponse(_0x37243d);}catch(_0x1c0c13){if(_0x1c0c13 instanceof Error)return new FailedApiKeyResponse({'detail':_0x1c0c13['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1c0c13;}});}}
8
8
 
9
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x57ed8a,_0x25796d,_0x18f7af,_0x32e1b5){function _0x46e61e(_0x92ee95){return _0x92ee95 instanceof _0x18f7af?_0x92ee95:new _0x18f7af(function(_0x2629b6){_0x2629b6(_0x92ee95);});}return new(_0x18f7af||(_0x18f7af=Promise))(function(_0x331966,_0x20699c){function _0x3b5d32(_0x75d242){try{_0x414997(_0x32e1b5['next'](_0x75d242));}catch(_0x11b94a){_0x20699c(_0x11b94a);}}function _0x2d6d1f(_0x31b5c8){try{_0x414997(_0x32e1b5['throw'](_0x31b5c8));}catch(_0x55b757){_0x20699c(_0x55b757);}}function _0x414997(_0x420ff1){_0x420ff1['done']?_0x331966(_0x420ff1['value']):_0x46e61e(_0x420ff1['value'])['then'](_0x3b5d32,_0x2d6d1f);}_0x414997((_0x32e1b5=_0x32e1b5['apply'](_0x57ed8a,_0x25796d||[]))['next']());});};class ListService{constructor(_0x12eb8f,_0xecbd48){this['tokenManager']=_0x12eb8f,this['fetch']=_0xecbd48;}['add'](_0x897070,_0x4dca2c,_0x51d573){return __awaiter$3(this,void 0,void 0,function*(){const _0x1b4dda=yield this['tokenManager']['getOrRefreshTokens'](_0x51d573);if(!_0x1b4dda['isSuccess'])return new FailedAccountResponse(_0x1b4dda['toProblem']());_0x51d573=_0x1b4dda['toSuccess']();const _0x3d9350='List',_0x312a9e={'account_name':_0x897070,'list_name':_0x4dca2c};try{const _0x463e7f=yield this['fetch']['post'](_0x3d9350,_0x51d573['access_token'],_0x312a9e);if(_0x463e7f['status']>0xc7&&_0x463e7f['status']<0x12c){const _0x2e275a=yield _0x463e7f['json']();return new SuccessfulAccountResponse(_0x2e275a);}const _0x480f1c=yield _0x463e7f['json']();return new FailedAccountResponse(_0x480f1c);}catch(_0x361b8a){if(_0x361b8a instanceof Error)return new FailedAccountResponse({'detail':_0x361b8a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x361b8a;}});}['remove'](_0x3bc725,_0x54987c,_0x173ebe){return __awaiter$3(this,void 0,void 0,function*(){const _0xe15b45=yield this['tokenManager']['getOrRefreshTokens'](_0x173ebe);if(!_0xe15b45['isSuccess'])return new FailedAccountResponse(_0xe15b45['toProblem']());_0x173ebe=_0xe15b45['toSuccess']();const _0x5b10f7='List/'+_0x3bc725+'/'+_0x54987c,_0x26d56a=yield this['fetch']['delete'](_0x5b10f7,_0x173ebe['access_token']);try{if(_0x26d56a['status']>0xc7&&_0x26d56a['status']<0x12c){const _0x3f4660=yield _0x26d56a['json']();return new SuccessfulAccountResponse(_0x3f4660);}const _0x4ae422=yield _0x26d56a['json']();return new FailedAccountResponse(_0x4ae422);}catch(_0x24f327){if(_0x24f327 instanceof Error)return new FailedAccountResponse({'detail':_0x24f327['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x24f327;}});}}
9
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x37e316,_0x485674,_0x4daac7,_0x216eea){function _0x24f6f0(_0x4c60a2){return _0x4c60a2 instanceof _0x4daac7?_0x4c60a2:new _0x4daac7(function(_0x36cdac){_0x36cdac(_0x4c60a2);});}return new(_0x4daac7||(_0x4daac7=Promise))(function(_0x2796d7,_0x232896){function _0x1a7be8(_0xbef472){try{_0x3ebb29(_0x216eea['next'](_0xbef472));}catch(_0x235631){_0x232896(_0x235631);}}function _0x1b6a46(_0xbeac9e){try{_0x3ebb29(_0x216eea['throw'](_0xbeac9e));}catch(_0x4e3dda){_0x232896(_0x4e3dda);}}function _0x3ebb29(_0x57a2cd){_0x57a2cd['done']?_0x2796d7(_0x57a2cd['value']):_0x24f6f0(_0x57a2cd['value'])['then'](_0x1a7be8,_0x1b6a46);}_0x3ebb29((_0x216eea=_0x216eea['apply'](_0x37e316,_0x485674||[]))['next']());});};class ListService{constructor(_0xd3ba48,_0x4e5a5f){this['tokenManager']=_0xd3ba48,this['fetch']=_0x4e5a5f;}['add'](_0x3dcff5,_0x12023c,_0x49abf0){return __awaiter$3(this,void 0,void 0,function*(){const _0x48b269=yield this['tokenManager']['getOrRefreshTokens'](_0x49abf0);if(!_0x48b269['isSuccess'])return new FailedAccountResponse(_0x48b269['toProblem']());_0x49abf0=_0x48b269['toSuccess']();const _0x26c3ab='List',_0x43ef7a={'account_name':_0x3dcff5,'list_name':_0x12023c};try{const _0x42ed98=yield this['fetch']['post'](_0x26c3ab,_0x49abf0['access_token'],_0x43ef7a);if(_0x42ed98['status']>0xc7&&_0x42ed98['status']<0x12c){const _0x1a6fdc=yield _0x42ed98['json']();return new SuccessfulAccountResponse(_0x1a6fdc);}const _0x4f08ca=yield _0x42ed98['json']();return new FailedAccountResponse(_0x4f08ca);}catch(_0x26ffd6){if(_0x26ffd6 instanceof Error)return new FailedAccountResponse({'detail':_0x26ffd6['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x26ffd6;}});}['remove'](_0xd1bfde,_0x5839da,_0x291f60){return __awaiter$3(this,void 0,void 0,function*(){const _0x1a5f9a=yield this['tokenManager']['getOrRefreshTokens'](_0x291f60);if(!_0x1a5f9a['isSuccess'])return new FailedAccountResponse(_0x1a5f9a['toProblem']());_0x291f60=_0x1a5f9a['toSuccess']();const _0x54e195='List/'+_0xd1bfde+'/'+_0x5839da,_0x305844=yield this['fetch']['delete'](_0x54e195,_0x291f60['access_token']);try{if(_0x305844['status']>0xc7&&_0x305844['status']<0x12c){const _0x38ab80=yield _0x305844['json']();return new SuccessfulAccountResponse(_0x38ab80);}const _0x57bde1=yield _0x305844['json']();return new FailedAccountResponse(_0x57bde1);}catch(_0x51989c){if(_0x51989c instanceof Error)return new FailedAccountResponse({'detail':_0x51989c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x51989c;}});}}
10
10
 
11
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x21bd20,_0x5eead8,_0x2860fa,_0x1fb93c){function _0x3e286c(_0x25bcb1){return _0x25bcb1 instanceof _0x2860fa?_0x25bcb1:new _0x2860fa(function(_0x527eb9){_0x527eb9(_0x25bcb1);});}return new(_0x2860fa||(_0x2860fa=Promise))(function(_0x332dbf,_0x23ffed){function _0x12d682(_0x110cc8){try{_0x38fb66(_0x1fb93c['next'](_0x110cc8));}catch(_0x58f206){_0x23ffed(_0x58f206);}}function _0x30fbdd(_0x7c7a14){try{_0x38fb66(_0x1fb93c['throw'](_0x7c7a14));}catch(_0x2b7e4a){_0x23ffed(_0x2b7e4a);}}function _0x38fb66(_0x4f2f4a){_0x4f2f4a['done']?_0x332dbf(_0x4f2f4a['value']):_0x3e286c(_0x4f2f4a['value'])['then'](_0x12d682,_0x30fbdd);}_0x38fb66((_0x1fb93c=_0x1fb93c['apply'](_0x21bd20,_0x5eead8||[]))['next']());});};class TokenManager{constructor(_0x541552){this['authClient']=_0x541552;}['getOrRefreshTokens'](_0x5df157){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0x5df157['access_expires'])return new SuccessfulAuthResponse(_0x5df157);if(Date['now']()>_0x5df157['refresh_expires'])return yield this['authClient']['refresh'](_0x5df157['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
11
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x26f8bf,_0x5f026a,_0x17e3b6,_0x159837){function _0x44f2e6(_0x59cef7){return _0x59cef7 instanceof _0x17e3b6?_0x59cef7:new _0x17e3b6(function(_0x26a930){_0x26a930(_0x59cef7);});}return new(_0x17e3b6||(_0x17e3b6=Promise))(function(_0x59f89c,_0x37d85a){function _0x538630(_0x478fbe){try{_0x365bcc(_0x159837['next'](_0x478fbe));}catch(_0x2967c0){_0x37d85a(_0x2967c0);}}function _0x1844b2(_0x2e2136){try{_0x365bcc(_0x159837['throw'](_0x2e2136));}catch(_0x50708a){_0x37d85a(_0x50708a);}}function _0x365bcc(_0x3db4e9){_0x3db4e9['done']?_0x59f89c(_0x3db4e9['value']):_0x44f2e6(_0x3db4e9['value'])['then'](_0x538630,_0x1844b2);}_0x365bcc((_0x159837=_0x159837['apply'](_0x26f8bf,_0x5f026a||[]))['next']());});};class TokenManager{constructor(_0x1cef81){this['authClient']=_0x1cef81;}['getOrRefreshTokens'](_0xfd10f8){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0xfd10f8['access_expires'])return new SuccessfulAuthResponse(_0xfd10f8);if(Date['now']()>_0xfd10f8['refresh_expires'])return yield this['authClient']['refresh'](_0xfd10f8['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
12
12
 
13
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x451fc0,_0x5aff56,_0x382d1c,_0x24b6d0){function _0x240c31(_0x50600e){return _0x50600e instanceof _0x382d1c?_0x50600e:new _0x382d1c(function(_0x254c5a){_0x254c5a(_0x50600e);});}return new(_0x382d1c||(_0x382d1c=Promise))(function(_0x36f09a,_0x27e6e4){function _0x211d86(_0x37bd14){try{_0x2d42a9(_0x24b6d0['next'](_0x37bd14));}catch(_0x41dbaa){_0x27e6e4(_0x41dbaa);}}function _0x567cc3(_0x240ac1){try{_0x2d42a9(_0x24b6d0['throw'](_0x240ac1));}catch(_0x29fe05){_0x27e6e4(_0x29fe05);}}function _0x2d42a9(_0x3a7f3e){_0x3a7f3e['done']?_0x36f09a(_0x3a7f3e['value']):_0x240c31(_0x3a7f3e['value'])['then'](_0x211d86,_0x567cc3);}_0x2d42a9((_0x24b6d0=_0x24b6d0['apply'](_0x451fc0,_0x5aff56||[]))['next']());});};class Fetch{constructor(_0x23f86a){this['baseUri']=_0x23f86a,this['getUrl']=_0xa63060=>{return _0xa63060['startsWith']('/')&&(_0xa63060=_0xa63060['replace']('/','')),''+this['baseUri']+_0xa63060;},!_0x23f86a['endsWith']('/')&&(_0x23f86a=_0x23f86a+'/');}['get'](_0xfe9631,_0x118335){return __awaiter$1(this,void 0,void 0,function*(){const _0x2cdeeb=this['getUrl'](_0xfe9631);return yield fetch(_0x2cdeeb,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x118335}});});}['post'](_0x1a1d40,_0x2e69cd,_0x1ff973){return __awaiter$1(this,void 0,void 0,function*(){const _0x55d4d3=this['getUrl'](_0x1a1d40);return yield fetch(_0x55d4d3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2e69cd},'body':_0x1ff973?JSON['stringify'](_0x1ff973):null});});}['put'](_0x2a5bc8,_0xac25c8,_0x202856){return __awaiter$1(this,void 0,void 0,function*(){const _0x1e4386=this['getUrl'](_0x2a5bc8);return yield fetch(_0x1e4386,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xac25c8},'body':_0x202856?JSON['stringify'](_0x202856):null});});}['delete'](_0x480130,_0x910a0b){return __awaiter$1(this,void 0,void 0,function*(){const _0x241501=this['getUrl'](_0x480130);return yield fetch(_0x241501,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x910a0b}});});}}
13
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x317cd4,_0x1d69d1,_0xa4320b,_0x2dee01){function _0x14f2fd(_0x3537f4){return _0x3537f4 instanceof _0xa4320b?_0x3537f4:new _0xa4320b(function(_0x1ac99e){_0x1ac99e(_0x3537f4);});}return new(_0xa4320b||(_0xa4320b=Promise))(function(_0x4333a0,_0x526aea){function _0x47fa2e(_0x315e9c){try{_0x3ec2c8(_0x2dee01['next'](_0x315e9c));}catch(_0x877169){_0x526aea(_0x877169);}}function _0xda02fe(_0x26758a){try{_0x3ec2c8(_0x2dee01['throw'](_0x26758a));}catch(_0x23dae7){_0x526aea(_0x23dae7);}}function _0x3ec2c8(_0x57fe0a){_0x57fe0a['done']?_0x4333a0(_0x57fe0a['value']):_0x14f2fd(_0x57fe0a['value'])['then'](_0x47fa2e,_0xda02fe);}_0x3ec2c8((_0x2dee01=_0x2dee01['apply'](_0x317cd4,_0x1d69d1||[]))['next']());});};class Fetch{constructor(_0x24b856){this['baseUri']=_0x24b856,this['getUrl']=_0x52a396=>{return _0x52a396['startsWith']('/')&&(_0x52a396=_0x52a396['replace']('/','')),''+this['baseUri']+_0x52a396;},!_0x24b856['endsWith']('/')&&(_0x24b856=_0x24b856+'/');}['get'](_0x3b0e12,_0x3741cb){return __awaiter$1(this,void 0,void 0,function*(){const _0x3befb9=this['getUrl'](_0x3b0e12);return yield fetch(_0x3befb9,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3741cb}});});}['post'](_0x10d563,_0x43d036,_0x1448e2){return __awaiter$1(this,void 0,void 0,function*(){const _0x4c966d=this['getUrl'](_0x10d563);return yield fetch(_0x4c966d,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x43d036},'body':_0x1448e2?JSON['stringify'](_0x1448e2):null});});}['put'](_0x16ca31,_0x89edb6,_0x18a60f){return __awaiter$1(this,void 0,void 0,function*(){const _0x5cc380=this['getUrl'](_0x16ca31);return yield fetch(_0x5cc380,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x89edb6},'body':_0x18a60f?JSON['stringify'](_0x18a60f):null});});}['delete'](_0x10ad0c,_0xcf6845){return __awaiter$1(this,void 0,void 0,function*(){const _0x2919ca=this['getUrl'](_0x10ad0c);return yield fetch(_0x2919ca,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xcf6845}});});}}
14
14
 
15
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x53a92b,_0xf9ddf3,_0x40755d,_0x1fe7da){function _0xdeb0bf(_0x4813b2){return _0x4813b2 instanceof _0x40755d?_0x4813b2:new _0x40755d(function(_0x9c105e){_0x9c105e(_0x4813b2);});}return new(_0x40755d||(_0x40755d=Promise))(function(_0x19b708,_0x214f3d){function _0x5cf3bc(_0x18669b){try{_0x240463(_0x1fe7da['next'](_0x18669b));}catch(_0xb93b03){_0x214f3d(_0xb93b03);}}function _0x17c5cd(_0x3eb581){try{_0x240463(_0x1fe7da['throw'](_0x3eb581));}catch(_0x10e01c){_0x214f3d(_0x10e01c);}}function _0x240463(_0x5ec8ab){_0x5ec8ab['done']?_0x19b708(_0x5ec8ab['value']):_0xdeb0bf(_0x5ec8ab['value'])['then'](_0x5cf3bc,_0x17c5cd);}_0x240463((_0x1fe7da=_0x1fe7da['apply'](_0x53a92b,_0xf9ddf3||[]))['next']());});};class AdminClient{constructor(_0x3c2ad4,_0x3590ab='https://admin.searchability.dev/'){var _0x3d8743=new TokenManager(_0x3c2ad4),_0x78bde=new Fetch(_0x3590ab);this['Accounts']=new AccountService(_0x3d8743,_0x78bde),this['Lists']=new ListService(_0x3d8743,_0x78bde),this['ApiKeys']=new ApiKeyService(_0x3d8743,_0x78bde);}}class AuthClient{constructor(_0x1eae63='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x1eae63);}['login'](_0x94be26){return __awaiter(this,void 0,void 0,function*(){var _0x204f16='login/'+_0x94be26;try{const _0x45f086=yield yield fetch(_0x204f16);if(_0x45f086['status']>0xc7&&_0x45f086['status']<0x12c){const _0x2fd5f6=yield _0x45f086['json']();return new SuccessfulAuthResponse(_0x2fd5f6);}const _0x27bc8b=yield _0x45f086['json']();return new FailedAuthResponse(_0x27bc8b);}catch(_0x4f19fd){if(_0x4f19fd instanceof Error)return new FailedAuthResponse({'detail':_0x4f19fd['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4f19fd;}});}['refresh'](_0x46b65e){return __awaiter(this,void 0,void 0,function*(){var _0x55721d='refresh';try{const _0x10e754=yield this['fetch']['post'](_0x55721d,_0x46b65e,null);if(_0x10e754['status']>0xc7&&_0x10e754['status']<0x12c){const _0x2c2af7=yield _0x10e754['json']();return new SuccessfulAuthResponse(_0x2c2af7);}const _0x1ed635=yield _0x10e754['json']();return new FailedAuthResponse(_0x1ed635);}catch(_0x4dff2b){if(_0x4dff2b instanceof Error)return new FailedAuthResponse({'detail':_0x4dff2b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4dff2b;}});}}
15
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x5d7041,_0x512ce8,_0x4f3057,_0x15bebd){function _0x5c3121(_0x2b8f4d){return _0x2b8f4d instanceof _0x4f3057?_0x2b8f4d:new _0x4f3057(function(_0x4a4d22){_0x4a4d22(_0x2b8f4d);});}return new(_0x4f3057||(_0x4f3057=Promise))(function(_0x1f494b,_0x45e085){function _0x9c0622(_0x35778a){try{_0x1493a5(_0x15bebd['next'](_0x35778a));}catch(_0xa2935a){_0x45e085(_0xa2935a);}}function _0xca4cb2(_0x183f10){try{_0x1493a5(_0x15bebd['throw'](_0x183f10));}catch(_0x4cbf54){_0x45e085(_0x4cbf54);}}function _0x1493a5(_0x3480ef){_0x3480ef['done']?_0x1f494b(_0x3480ef['value']):_0x5c3121(_0x3480ef['value'])['then'](_0x9c0622,_0xca4cb2);}_0x1493a5((_0x15bebd=_0x15bebd['apply'](_0x5d7041,_0x512ce8||[]))['next']());});};class AdminClient{constructor(_0x1a0148,_0x4bd995='https://admin.searchability.dev/'){var _0x2e3e9b=new TokenManager(_0x1a0148),_0x18fd58=new Fetch(_0x4bd995);this['Accounts']=new AccountService(_0x2e3e9b,_0x18fd58),this['Lists']=new ListService(_0x2e3e9b,_0x18fd58),this['ApiKeys']=new ApiKeyService(_0x2e3e9b,_0x18fd58);}}class AuthClient{constructor(_0x393eca='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x393eca);}['login'](_0x50c04d){return __awaiter(this,void 0,void 0,function*(){var _0xf6f724='login/'+_0x50c04d;try{const _0x406863=yield yield fetch(_0xf6f724);if(_0x406863['status']>0xc7&&_0x406863['status']<0x12c){const _0x3f617c=yield _0x406863['json']();return new SuccessfulAuthResponse(_0x3f617c);}const _0x52dd25=yield _0x406863['json']();return new FailedAuthResponse(_0x52dd25);}catch(_0x56b8fd){if(_0x56b8fd instanceof Error)return new FailedAuthResponse({'detail':_0x56b8fd['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x56b8fd;}});}['refresh'](_0x342858){return __awaiter(this,void 0,void 0,function*(){var _0x553b1a='refresh';try{const _0x11fd32=yield this['fetch']['post'](_0x553b1a,_0x342858,null);if(_0x11fd32['status']>0xc7&&_0x11fd32['status']<0x12c){const _0x1a96e8=yield _0x11fd32['json']();return new SuccessfulAuthResponse(_0x1a96e8);}const _0x58e956=yield _0x11fd32['json']();return new FailedAuthResponse(_0x58e956);}catch(_0x50c857){if(_0x50c857 instanceof Error)return new FailedAuthResponse({'detail':_0x50c857['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x50c857;}});}}
16
16
 
17
17
  exports.AdminClient = AdminClient;
18
18
  exports.AuthClient = AuthClient;
@@ -1,15 +1,15 @@
1
- class Response{constructor(_0x255990){this['isSuccess']=_0x255990;}}class SuccessfulAccountResponse extends Response{constructor(_0xd018f8){super(!![]),this['account']=_0xd018f8;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2c9836){super(![]),this['problem']=_0x2c9836;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x5fcbbb){super(!![]),this['tokens']=_0x5fcbbb;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x57d77c){super(![]),this['problem']=_0x57d77c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x5e971c){super(!![]),this['apiKey']=_0x5e971c;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x4dcda1){super(![]),this['problem']=_0x4dcda1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
1
+ class Response{constructor(_0x12ca97){this['isSuccess']=_0x12ca97;}}class SuccessfulAccountResponse extends Response{constructor(_0x43f58b){super(!![]),this['account']=_0x43f58b;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x3c5a59){super(![]),this['problem']=_0x3c5a59;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0xc38ad4){super(!![]),this['tokens']=_0xc38ad4;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x3a6f67){super(![]),this['problem']=_0x3a6f67;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x55849e){super(!![]),this['apiKey']=_0x55849e;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x15f79e){super(![]),this['problem']=_0x15f79e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
2
2
 
3
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x4341b5,_0x15e4a5,_0xb8a193,_0x57421d){function _0x515eaa(_0x332da3){return _0x332da3 instanceof _0xb8a193?_0x332da3:new _0xb8a193(function(_0x3b5b11){_0x3b5b11(_0x332da3);});}return new(_0xb8a193||(_0xb8a193=Promise))(function(_0x433d6f,_0x3bbc51){function _0x3aeb5b(_0x598a03){try{_0x194a46(_0x57421d['next'](_0x598a03));}catch(_0x42a031){_0x3bbc51(_0x42a031);}}function _0x3a51e2(_0x37b0d9){try{_0x194a46(_0x57421d['throw'](_0x37b0d9));}catch(_0xf04724){_0x3bbc51(_0xf04724);}}function _0x194a46(_0x47e36b){_0x47e36b['done']?_0x433d6f(_0x47e36b['value']):_0x515eaa(_0x47e36b['value'])['then'](_0x3aeb5b,_0x3a51e2);}_0x194a46((_0x57421d=_0x57421d['apply'](_0x4341b5,_0x15e4a5||[]))['next']());});};class AccountService{constructor(_0xccec72,_0x2a9de1){this['tokenManager']=_0xccec72,this['fetch']=_0x2a9de1;}['get'](_0x53ba7e,_0x54d95a){return __awaiter$5(this,void 0,void 0,function*(){const _0xd36b93=yield this['tokenManager']['getOrRefreshTokens'](_0x54d95a);if(!_0xd36b93['isSuccess'])return new FailedAccountResponse(_0xd36b93['toProblem']());_0x54d95a=_0xd36b93['toSuccess']();const _0x4d534f='Account/'+_0x53ba7e+'/',_0x252389=yield this['fetch']['get'](_0x4d534f,_0x54d95a['access_token']);try{if(_0x252389['status']>0xc7&&_0x252389['status']<0x12c){const _0x24dcbd=yield _0x252389['json']();return new SuccessfulAccountResponse(_0x24dcbd);}const _0x3eb135=yield _0x252389['json']();return new FailedAccountResponse(_0x3eb135);}catch(_0x435847){if(_0x435847 instanceof Error)return new FailedAccountResponse({'detail':_0x435847['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x435847;}});}}
3
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x2495f4,_0x17ad38,_0x33c58c,_0x45739c){function _0x300fef(_0xc6b1dd){return _0xc6b1dd instanceof _0x33c58c?_0xc6b1dd:new _0x33c58c(function(_0x2ce4af){_0x2ce4af(_0xc6b1dd);});}return new(_0x33c58c||(_0x33c58c=Promise))(function(_0x163f89,_0x1a6d89){function _0xe68cfa(_0x52e86d){try{_0x165375(_0x45739c['next'](_0x52e86d));}catch(_0x2792e8){_0x1a6d89(_0x2792e8);}}function _0x3bd242(_0x483195){try{_0x165375(_0x45739c['throw'](_0x483195));}catch(_0x7db3af){_0x1a6d89(_0x7db3af);}}function _0x165375(_0x37f400){_0x37f400['done']?_0x163f89(_0x37f400['value']):_0x300fef(_0x37f400['value'])['then'](_0xe68cfa,_0x3bd242);}_0x165375((_0x45739c=_0x45739c['apply'](_0x2495f4,_0x17ad38||[]))['next']());});};class AccountService{constructor(_0x338730,_0x1e4fae){this['tokenManager']=_0x338730,this['fetch']=_0x1e4fae;}['get'](_0x55d523,_0x16eab2){return __awaiter$5(this,void 0,void 0,function*(){const _0x3c4331=yield this['tokenManager']['getOrRefreshTokens'](_0x16eab2);if(!_0x3c4331['isSuccess'])return new FailedAccountResponse(_0x3c4331['toProblem']());_0x16eab2=_0x3c4331['toSuccess']();const _0x1d09e6='Account/'+_0x55d523+'/',_0x2d3ba4=yield this['fetch']['get'](_0x1d09e6,_0x16eab2['access_token']);try{if(_0x2d3ba4['status']>0xc7&&_0x2d3ba4['status']<0x12c){const _0x2d1f6a=yield _0x2d3ba4['json']();return new SuccessfulAccountResponse(_0x2d1f6a);}const _0xfb33bc=yield _0x2d3ba4['json']();return new FailedAccountResponse(_0xfb33bc);}catch(_0x54027f){if(_0x54027f instanceof Error)return new FailedAccountResponse({'detail':_0x54027f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x54027f;}});}}
4
4
 
5
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x32c201,_0x25d54e,_0x1e8875,_0x1fa38e){function _0x1364b2(_0x13598d){return _0x13598d instanceof _0x1e8875?_0x13598d:new _0x1e8875(function(_0x2457f6){_0x2457f6(_0x13598d);});}return new(_0x1e8875||(_0x1e8875=Promise))(function(_0x4aa9a9,_0x362168){function _0x2c5cc6(_0x3778be){try{_0x59cbf9(_0x1fa38e['next'](_0x3778be));}catch(_0x225334){_0x362168(_0x225334);}}function _0x29abf9(_0x353aeb){try{_0x59cbf9(_0x1fa38e['throw'](_0x353aeb));}catch(_0x3e3199){_0x362168(_0x3e3199);}}function _0x59cbf9(_0x2b464a){_0x2b464a['done']?_0x4aa9a9(_0x2b464a['value']):_0x1364b2(_0x2b464a['value'])['then'](_0x2c5cc6,_0x29abf9);}_0x59cbf9((_0x1fa38e=_0x1fa38e['apply'](_0x32c201,_0x25d54e||[]))['next']());});};class ApiKeyService{constructor(_0x6b1478,_0x46e2b1){this['tokenManager']=_0x6b1478,this['fetch']=_0x46e2b1;}['create'](_0x14013a,_0x47990b,_0x13c08a){return __awaiter$4(this,void 0,void 0,function*(){const _0x3bf43b=yield this['tokenManager']['getOrRefreshTokens'](_0x13c08a);if(!_0x3bf43b['isSuccess'])return new FailedApiKeyResponse(_0x3bf43b['toProblem']());_0x13c08a=_0x3bf43b['toSuccess']();const _0xa86a3d='ApiKey/Create',_0x289964={'account_name':_0x14013a,'name':_0x47990b};try{const _0x19fd5c=yield this['fetch']['post'](_0xa86a3d,_0x13c08a['access_token'],_0x289964);if(_0x19fd5c['status']>0xc7&&_0x19fd5c['status']<0x12c){const _0x50ec54=yield _0x19fd5c['json']();return new SuccessfulApiKeyResponse(_0x50ec54);}const _0x34f3c5=yield _0x19fd5c['json']();return new FailedApiKeyResponse(_0x34f3c5);}catch(_0x427ef6){if(_0x427ef6 instanceof Error)return new FailedApiKeyResponse({'detail':_0x427ef6['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x427ef6;}});}}
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x904bba,_0x65e7df,_0x23433a,_0x5a89a6){function _0x3067e1(_0x4e8c90){return _0x4e8c90 instanceof _0x23433a?_0x4e8c90:new _0x23433a(function(_0x3cf911){_0x3cf911(_0x4e8c90);});}return new(_0x23433a||(_0x23433a=Promise))(function(_0x355f67,_0x1a52dd){function _0x21d28a(_0x5300e2){try{_0x15e1e2(_0x5a89a6['next'](_0x5300e2));}catch(_0x4e0da4){_0x1a52dd(_0x4e0da4);}}function _0x2a2dee(_0xee2c7a){try{_0x15e1e2(_0x5a89a6['throw'](_0xee2c7a));}catch(_0x4385ce){_0x1a52dd(_0x4385ce);}}function _0x15e1e2(_0x38d363){_0x38d363['done']?_0x355f67(_0x38d363['value']):_0x3067e1(_0x38d363['value'])['then'](_0x21d28a,_0x2a2dee);}_0x15e1e2((_0x5a89a6=_0x5a89a6['apply'](_0x904bba,_0x65e7df||[]))['next']());});};class ApiKeyService{constructor(_0x5a868d,_0x5d19c3){this['tokenManager']=_0x5a868d,this['fetch']=_0x5d19c3;}['create'](_0x4d3c56,_0x34451f,_0x1d61d9){return __awaiter$4(this,void 0,void 0,function*(){const _0x143d89=yield this['tokenManager']['getOrRefreshTokens'](_0x1d61d9);if(!_0x143d89['isSuccess'])return new FailedApiKeyResponse(_0x143d89['toProblem']());_0x1d61d9=_0x143d89['toSuccess']();const _0x313acf='ApiKey/Create',_0x24be7e={'account_name':_0x4d3c56,'name':_0x34451f};try{const _0xe7818f=yield this['fetch']['post'](_0x313acf,_0x1d61d9['access_token'],_0x24be7e);if(_0xe7818f['status']>0xc7&&_0xe7818f['status']<0x12c){const _0x550ec6=yield _0xe7818f['json']();return new SuccessfulApiKeyResponse(_0x550ec6);}const _0x548ef4=yield _0xe7818f['json']();return new FailedApiKeyResponse(_0x548ef4);}catch(_0xfa2a4d){if(_0xfa2a4d instanceof Error)return new FailedApiKeyResponse({'detail':_0xfa2a4d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xfa2a4d;}});}}
6
6
 
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x515128,_0x50e496,_0x247767,_0x8dca76){function _0x5ea90d(_0x381a65){return _0x381a65 instanceof _0x247767?_0x381a65:new _0x247767(function(_0x442474){_0x442474(_0x381a65);});}return new(_0x247767||(_0x247767=Promise))(function(_0x125783,_0x2abe8d){function _0x388b4d(_0x3f3567){try{_0xa3a624(_0x8dca76['next'](_0x3f3567));}catch(_0x1c3d4c){_0x2abe8d(_0x1c3d4c);}}function _0x3e95bd(_0x47aceb){try{_0xa3a624(_0x8dca76['throw'](_0x47aceb));}catch(_0x428430){_0x2abe8d(_0x428430);}}function _0xa3a624(_0x410921){_0x410921['done']?_0x125783(_0x410921['value']):_0x5ea90d(_0x410921['value'])['then'](_0x388b4d,_0x3e95bd);}_0xa3a624((_0x8dca76=_0x8dca76['apply'](_0x515128,_0x50e496||[]))['next']());});};class ListService{constructor(_0x1fd804,_0x3c834c){this['tokenManager']=_0x1fd804,this['fetch']=_0x3c834c;}['add'](_0x42d069,_0x28235c,_0x5b16e4){return __awaiter$3(this,void 0,void 0,function*(){const _0x4f5ce5=yield this['tokenManager']['getOrRefreshTokens'](_0x5b16e4);if(!_0x4f5ce5['isSuccess'])return new FailedAccountResponse(_0x4f5ce5['toProblem']());_0x5b16e4=_0x4f5ce5['toSuccess']();const _0x2b94db='List',_0x1ff0e5={'account_name':_0x42d069,'list_name':_0x28235c};try{const _0x50ec2c=yield this['fetch']['post'](_0x2b94db,_0x5b16e4['access_token'],_0x1ff0e5);if(_0x50ec2c['status']>0xc7&&_0x50ec2c['status']<0x12c){const _0x1630ba=yield _0x50ec2c['json']();return new SuccessfulAccountResponse(_0x1630ba);}const _0x516d74=yield _0x50ec2c['json']();return new FailedAccountResponse(_0x516d74);}catch(_0x3e968c){if(_0x3e968c instanceof Error)return new FailedAccountResponse({'detail':_0x3e968c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3e968c;}});}['remove'](_0x37c055,_0x23738f,_0x59caa5){return __awaiter$3(this,void 0,void 0,function*(){const _0x34b652=yield this['tokenManager']['getOrRefreshTokens'](_0x59caa5);if(!_0x34b652['isSuccess'])return new FailedAccountResponse(_0x34b652['toProblem']());_0x59caa5=_0x34b652['toSuccess']();const _0x6d01f5='List/'+_0x37c055+'/'+_0x23738f,_0x348726=yield this['fetch']['delete'](_0x6d01f5,_0x59caa5['access_token']);try{if(_0x348726['status']>0xc7&&_0x348726['status']<0x12c){const _0x586251=yield _0x348726['json']();return new SuccessfulAccountResponse(_0x586251);}const _0x2b6333=yield _0x348726['json']();return new FailedAccountResponse(_0x2b6333);}catch(_0x66d79c){if(_0x66d79c instanceof Error)return new FailedAccountResponse({'detail':_0x66d79c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x66d79c;}});}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x1805cf,_0x2ff725,_0x3efd91,_0x4fe400){function _0x2e4c93(_0x14bb93){return _0x14bb93 instanceof _0x3efd91?_0x14bb93:new _0x3efd91(function(_0x5a15b0){_0x5a15b0(_0x14bb93);});}return new(_0x3efd91||(_0x3efd91=Promise))(function(_0xfa0cad,_0x42c07a){function _0x37595e(_0x1357f6){try{_0x1c4975(_0x4fe400['next'](_0x1357f6));}catch(_0x4dadaf){_0x42c07a(_0x4dadaf);}}function _0x37be5c(_0x9f5817){try{_0x1c4975(_0x4fe400['throw'](_0x9f5817));}catch(_0x2b3dcd){_0x42c07a(_0x2b3dcd);}}function _0x1c4975(_0x3fdc76){_0x3fdc76['done']?_0xfa0cad(_0x3fdc76['value']):_0x2e4c93(_0x3fdc76['value'])['then'](_0x37595e,_0x37be5c);}_0x1c4975((_0x4fe400=_0x4fe400['apply'](_0x1805cf,_0x2ff725||[]))['next']());});};class ListService{constructor(_0x466ef9,_0x1c5637){this['tokenManager']=_0x466ef9,this['fetch']=_0x1c5637;}['add'](_0x2fb52c,_0x2a694d,_0x3535e7){return __awaiter$3(this,void 0,void 0,function*(){const _0x30cdb3=yield this['tokenManager']['getOrRefreshTokens'](_0x3535e7);if(!_0x30cdb3['isSuccess'])return new FailedAccountResponse(_0x30cdb3['toProblem']());_0x3535e7=_0x30cdb3['toSuccess']();const _0x53de0f='List',_0x39ca2b={'account_name':_0x2fb52c,'list_name':_0x2a694d};try{const _0x3b521b=yield this['fetch']['post'](_0x53de0f,_0x3535e7['access_token'],_0x39ca2b);if(_0x3b521b['status']>0xc7&&_0x3b521b['status']<0x12c){const _0x6ba866=yield _0x3b521b['json']();return new SuccessfulAccountResponse(_0x6ba866);}const _0xfb3368=yield _0x3b521b['json']();return new FailedAccountResponse(_0xfb3368);}catch(_0x36f485){if(_0x36f485 instanceof Error)return new FailedAccountResponse({'detail':_0x36f485['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x36f485;}});}['remove'](_0x3cff86,_0x4ee4e5,_0x26f76f){return __awaiter$3(this,void 0,void 0,function*(){const _0x54fec3=yield this['tokenManager']['getOrRefreshTokens'](_0x26f76f);if(!_0x54fec3['isSuccess'])return new FailedAccountResponse(_0x54fec3['toProblem']());_0x26f76f=_0x54fec3['toSuccess']();const _0x120006='List/'+_0x3cff86+'/'+_0x4ee4e5,_0x536c91=yield this['fetch']['delete'](_0x120006,_0x26f76f['access_token']);try{if(_0x536c91['status']>0xc7&&_0x536c91['status']<0x12c){const _0x563eea=yield _0x536c91['json']();return new SuccessfulAccountResponse(_0x563eea);}const _0x521c86=yield _0x536c91['json']();return new FailedAccountResponse(_0x521c86);}catch(_0x8666a9){if(_0x8666a9 instanceof Error)return new FailedAccountResponse({'detail':_0x8666a9['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x8666a9;}});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x46cc9b,_0x50796d,_0x48ecff,_0x13e845){function _0x484d73(_0x2917c0){return _0x2917c0 instanceof _0x48ecff?_0x2917c0:new _0x48ecff(function(_0x22aa3a){_0x22aa3a(_0x2917c0);});}return new(_0x48ecff||(_0x48ecff=Promise))(function(_0x33e6ef,_0x477ffc){function _0x2c8ef6(_0x180bd7){try{_0xb162d9(_0x13e845['next'](_0x180bd7));}catch(_0x50712c){_0x477ffc(_0x50712c);}}function _0x18ce01(_0x56c04b){try{_0xb162d9(_0x13e845['throw'](_0x56c04b));}catch(_0x34a20c){_0x477ffc(_0x34a20c);}}function _0xb162d9(_0x45ea82){_0x45ea82['done']?_0x33e6ef(_0x45ea82['value']):_0x484d73(_0x45ea82['value'])['then'](_0x2c8ef6,_0x18ce01);}_0xb162d9((_0x13e845=_0x13e845['apply'](_0x46cc9b,_0x50796d||[]))['next']());});};class TokenManager{constructor(_0x52c976){this['authClient']=_0x52c976;}['getOrRefreshTokens'](_0x50361f){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0x50361f['access_expires'])return new SuccessfulAuthResponse(_0x50361f);if(Date['now']()>_0x50361f['refresh_expires'])return yield this['authClient']['refresh'](_0x50361f['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x37d3e4,_0x3e9b0f,_0x4b1261,_0x5bdd19){function _0x5deeae(_0x1a266c){return _0x1a266c instanceof _0x4b1261?_0x1a266c:new _0x4b1261(function(_0x154262){_0x154262(_0x1a266c);});}return new(_0x4b1261||(_0x4b1261=Promise))(function(_0x493d67,_0xa58883){function _0x3900a4(_0x11d164){try{_0x5d62ee(_0x5bdd19['next'](_0x11d164));}catch(_0x351e69){_0xa58883(_0x351e69);}}function _0x1c55b4(_0x147e38){try{_0x5d62ee(_0x5bdd19['throw'](_0x147e38));}catch(_0x47f86d){_0xa58883(_0x47f86d);}}function _0x5d62ee(_0x3dbf56){_0x3dbf56['done']?_0x493d67(_0x3dbf56['value']):_0x5deeae(_0x3dbf56['value'])['then'](_0x3900a4,_0x1c55b4);}_0x5d62ee((_0x5bdd19=_0x5bdd19['apply'](_0x37d3e4,_0x3e9b0f||[]))['next']());});};class TokenManager{constructor(_0x20862c){this['authClient']=_0x20862c;}['getOrRefreshTokens'](_0xe586f2){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0xe586f2['access_expires'])return new SuccessfulAuthResponse(_0xe586f2);if(Date['now']()>_0xe586f2['refresh_expires'])return yield this['authClient']['refresh'](_0xe586f2['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xecd813,_0x47d2fd,_0x1a807c,_0x3c7684){function _0x2d66bf(_0xd0d90d){return _0xd0d90d instanceof _0x1a807c?_0xd0d90d:new _0x1a807c(function(_0x544de0){_0x544de0(_0xd0d90d);});}return new(_0x1a807c||(_0x1a807c=Promise))(function(_0x162520,_0x3034e6){function _0x24b2b4(_0x21495f){try{_0x309794(_0x3c7684['next'](_0x21495f));}catch(_0x2eb183){_0x3034e6(_0x2eb183);}}function _0x3ab56d(_0x58df80){try{_0x309794(_0x3c7684['throw'](_0x58df80));}catch(_0x2da922){_0x3034e6(_0x2da922);}}function _0x309794(_0x1b90b9){_0x1b90b9['done']?_0x162520(_0x1b90b9['value']):_0x2d66bf(_0x1b90b9['value'])['then'](_0x24b2b4,_0x3ab56d);}_0x309794((_0x3c7684=_0x3c7684['apply'](_0xecd813,_0x47d2fd||[]))['next']());});};class Fetch{constructor(_0x1cd52e){this['baseUri']=_0x1cd52e,this['getUrl']=_0x121d47=>{return _0x121d47['startsWith']('/')&&(_0x121d47=_0x121d47['replace']('/','')),''+this['baseUri']+_0x121d47;},!_0x1cd52e['endsWith']('/')&&(_0x1cd52e=_0x1cd52e+'/');}['get'](_0x5b3a24,_0x1d7ef9){return __awaiter$1(this,void 0,void 0,function*(){const _0x308003=this['getUrl'](_0x5b3a24);return yield fetch(_0x308003,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1d7ef9}});});}['post'](_0x5ec813,_0x334647,_0x2aab7e){return __awaiter$1(this,void 0,void 0,function*(){const _0x265435=this['getUrl'](_0x5ec813);return yield fetch(_0x265435,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x334647},'body':_0x2aab7e?JSON['stringify'](_0x2aab7e):null});});}['put'](_0x5850ef,_0x1911ce,_0x1c4c61){return __awaiter$1(this,void 0,void 0,function*(){const _0x47058f=this['getUrl'](_0x5850ef);return yield fetch(_0x47058f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1911ce},'body':_0x1c4c61?JSON['stringify'](_0x1c4c61):null});});}['delete'](_0x592c20,_0x12b6b6){return __awaiter$1(this,void 0,void 0,function*(){const _0x2b2fed=this['getUrl'](_0x592c20);return yield fetch(_0x2b2fed,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x12b6b6}});});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x37cfc9,_0x2b918d,_0x413540,_0x513098){function _0x2df6ea(_0x24b8a2){return _0x24b8a2 instanceof _0x413540?_0x24b8a2:new _0x413540(function(_0x2aa906){_0x2aa906(_0x24b8a2);});}return new(_0x413540||(_0x413540=Promise))(function(_0x11c2b8,_0x43b012){function _0x5a488d(_0x59dc98){try{_0x36276e(_0x513098['next'](_0x59dc98));}catch(_0x51af02){_0x43b012(_0x51af02);}}function _0x5b9758(_0xdce8d9){try{_0x36276e(_0x513098['throw'](_0xdce8d9));}catch(_0x150d67){_0x43b012(_0x150d67);}}function _0x36276e(_0x1f6ccc){_0x1f6ccc['done']?_0x11c2b8(_0x1f6ccc['value']):_0x2df6ea(_0x1f6ccc['value'])['then'](_0x5a488d,_0x5b9758);}_0x36276e((_0x513098=_0x513098['apply'](_0x37cfc9,_0x2b918d||[]))['next']());});};class Fetch{constructor(_0x2c3ed5){this['baseUri']=_0x2c3ed5,this['getUrl']=_0x19a391=>{return _0x19a391['startsWith']('/')&&(_0x19a391=_0x19a391['replace']('/','')),''+this['baseUri']+_0x19a391;},!_0x2c3ed5['endsWith']('/')&&(_0x2c3ed5=_0x2c3ed5+'/');}['get'](_0x36d2a0,_0x3bab81){return __awaiter$1(this,void 0,void 0,function*(){const _0x195c82=this['getUrl'](_0x36d2a0);return yield fetch(_0x195c82,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3bab81}});});}['post'](_0xdc3469,_0x22ad2c,_0x16e39f){return __awaiter$1(this,void 0,void 0,function*(){const _0xd02e24=this['getUrl'](_0xdc3469);return yield fetch(_0xd02e24,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x22ad2c},'body':_0x16e39f?JSON['stringify'](_0x16e39f):null});});}['put'](_0x1cc225,_0x54f565,_0x5ee2dd){return __awaiter$1(this,void 0,void 0,function*(){const _0x17567d=this['getUrl'](_0x1cc225);return yield fetch(_0x17567d,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x54f565},'body':_0x5ee2dd?JSON['stringify'](_0x5ee2dd):null});});}['delete'](_0x36fa82,_0x6ae4d9){return __awaiter$1(this,void 0,void 0,function*(){const _0x4b0a3b=this['getUrl'](_0x36fa82);return yield fetch(_0x4b0a3b,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x6ae4d9}});});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x359c09,_0x3a06fb,_0x1a06e4,_0x55b003){function _0x40d50d(_0x179c88){return _0x179c88 instanceof _0x1a06e4?_0x179c88:new _0x1a06e4(function(_0x4bda10){_0x4bda10(_0x179c88);});}return new(_0x1a06e4||(_0x1a06e4=Promise))(function(_0x4de546,_0x82de35){function _0x26d3bb(_0x1be43e){try{_0x22711e(_0x55b003['next'](_0x1be43e));}catch(_0x29e9c3){_0x82de35(_0x29e9c3);}}function _0x20aa2d(_0x42e862){try{_0x22711e(_0x55b003['throw'](_0x42e862));}catch(_0x44c1be){_0x82de35(_0x44c1be);}}function _0x22711e(_0x26d806){_0x26d806['done']?_0x4de546(_0x26d806['value']):_0x40d50d(_0x26d806['value'])['then'](_0x26d3bb,_0x20aa2d);}_0x22711e((_0x55b003=_0x55b003['apply'](_0x359c09,_0x3a06fb||[]))['next']());});};class AdminClient{constructor(_0x594c88,_0x36fd51='https://admin.searchability.dev/'){var _0x156342=new TokenManager(_0x594c88),_0x4a7e72=new Fetch(_0x36fd51);this['Accounts']=new AccountService(_0x156342,_0x4a7e72),this['Lists']=new ListService(_0x156342,_0x4a7e72),this['ApiKeys']=new ApiKeyService(_0x156342,_0x4a7e72);}}class AuthClient{constructor(_0xd78ba5='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0xd78ba5);}['login'](_0x55eac1){return __awaiter(this,void 0,void 0,function*(){var _0x3e0050='login/'+_0x55eac1;try{const _0x21933d=yield yield fetch(_0x3e0050);if(_0x21933d['status']>0xc7&&_0x21933d['status']<0x12c){const _0x591f04=yield _0x21933d['json']();return new SuccessfulAuthResponse(_0x591f04);}const _0x11cd04=yield _0x21933d['json']();return new FailedAuthResponse(_0x11cd04);}catch(_0x146b8f){if(_0x146b8f instanceof Error)return new FailedAuthResponse({'detail':_0x146b8f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x146b8f;}});}['refresh'](_0x1e8b8d){return __awaiter(this,void 0,void 0,function*(){var _0x984a74='refresh';try{const _0x214d19=yield this['fetch']['post'](_0x984a74,_0x1e8b8d,null);if(_0x214d19['status']>0xc7&&_0x214d19['status']<0x12c){const _0x13530b=yield _0x214d19['json']();return new SuccessfulAuthResponse(_0x13530b);}const _0x1e83c0=yield _0x214d19['json']();return new FailedAuthResponse(_0x1e83c0);}catch(_0x37a292){if(_0x37a292 instanceof Error)return new FailedAuthResponse({'detail':_0x37a292['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x37a292;}});}}
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x359e42,_0x2afaf5,_0x35b0e3,_0x58b726){function _0x37ab08(_0x4f7ecc){return _0x4f7ecc instanceof _0x35b0e3?_0x4f7ecc:new _0x35b0e3(function(_0x354cab){_0x354cab(_0x4f7ecc);});}return new(_0x35b0e3||(_0x35b0e3=Promise))(function(_0xdf61ee,_0x4323c3){function _0xff0dac(_0x45bfb0){try{_0x3c0773(_0x58b726['next'](_0x45bfb0));}catch(_0x3f0fd2){_0x4323c3(_0x3f0fd2);}}function _0x36d49e(_0x3eb177){try{_0x3c0773(_0x58b726['throw'](_0x3eb177));}catch(_0x1b7dce){_0x4323c3(_0x1b7dce);}}function _0x3c0773(_0x46c332){_0x46c332['done']?_0xdf61ee(_0x46c332['value']):_0x37ab08(_0x46c332['value'])['then'](_0xff0dac,_0x36d49e);}_0x3c0773((_0x58b726=_0x58b726['apply'](_0x359e42,_0x2afaf5||[]))['next']());});};class AdminClient{constructor(_0x4cdc37,_0x1a3a0f='https://admin.searchability.dev/'){var _0x485d8b=new TokenManager(_0x4cdc37),_0x1c0f39=new Fetch(_0x1a3a0f);this['Accounts']=new AccountService(_0x485d8b,_0x1c0f39),this['Lists']=new ListService(_0x485d8b,_0x1c0f39),this['ApiKeys']=new ApiKeyService(_0x485d8b,_0x1c0f39);}}class AuthClient{constructor(_0x760207='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x760207);}['login'](_0x24ef91){return __awaiter(this,void 0,void 0,function*(){var _0x3cb626='login/'+_0x24ef91;try{const _0x261b34=yield yield fetch(_0x3cb626);if(_0x261b34['status']>0xc7&&_0x261b34['status']<0x12c){const _0x257771=yield _0x261b34['json']();return new SuccessfulAuthResponse(_0x257771);}const _0x1183b3=yield _0x261b34['json']();return new FailedAuthResponse(_0x1183b3);}catch(_0x3c53ba){if(_0x3c53ba instanceof Error)return new FailedAuthResponse({'detail':_0x3c53ba['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3c53ba;}});}['refresh'](_0x5d57da){return __awaiter(this,void 0,void 0,function*(){var _0x4adfc8='refresh';try{const _0x338a7d=yield this['fetch']['post'](_0x4adfc8,_0x5d57da,null);if(_0x338a7d['status']>0xc7&&_0x338a7d['status']<0x12c){const _0xb053b2=yield _0x338a7d['json']();return new SuccessfulAuthResponse(_0xb053b2);}const _0x107bd8=yield _0x338a7d['json']();return new FailedAuthResponse(_0x107bd8);}catch(_0x562ff7){if(_0x562ff7 instanceof Error)return new FailedAuthResponse({'detail':_0x562ff7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x562ff7;}});}}
14
14
 
15
15
  export { AdminClient, AuthClient };
package/dist/types.d.ts CHANGED
@@ -1,3 +1,54 @@
1
+ declare class Fetch {
2
+ readonly baseUri: string;
3
+ constructor(baseUri: string);
4
+ private getUrl;
5
+ get(path: string, accessToken: string): Promise<globalThis.Response>;
6
+ post(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
7
+ put(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
8
+ delete(path: string, accessToken: string): Promise<globalThis.Response>;
9
+ }
10
+
11
+ declare class TokenManager {
12
+ readonly authClient: AuthClient;
13
+ constructor(authClient: AuthClient);
14
+ getOrRefreshTokens(tokens: Tokens): Promise<Response<Tokens, Problem>>;
15
+ }
16
+
17
+ declare class AccountService {
18
+ readonly tokenManager: TokenManager;
19
+ readonly fetch: Fetch;
20
+ constructor(tokenManager: TokenManager, fetch: Fetch);
21
+ get(accountName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
22
+ }
23
+
24
+ declare class ApiKeyService {
25
+ readonly tokenManager: TokenManager;
26
+ readonly fetch: Fetch;
27
+ constructor(tokenManager: TokenManager, fetch: Fetch);
28
+ create(accountName: string, apiKeyName: string, tokens: Tokens): Promise<Response<ApiKey, Problem>>;
29
+ }
30
+
31
+ declare class ListService {
32
+ readonly tokenManager: TokenManager;
33
+ readonly fetch: Fetch;
34
+ constructor(tokenManager: TokenManager, fetch: Fetch);
35
+ add(accountName: string, listName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
36
+ remove(accountName: string, listName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
37
+ }
38
+
39
+ declare class AdminClient {
40
+ constructor(authClient: AuthClient, baseUri?: string);
41
+ readonly Accounts: AccountService;
42
+ readonly Lists: ListService;
43
+ readonly ApiKeys: ApiKeyService;
44
+ }
45
+ declare class AuthClient {
46
+ readonly fetch: Fetch;
47
+ constructor(baseUri?: string);
48
+ login(apiKey: string): Promise<Response<Tokens, Problem>>;
49
+ refresh(refreshToken: string): Promise<Response<Tokens, Problem>>;
50
+ }
51
+
1
52
  declare abstract class Response<S, F> {
2
53
  readonly isSuccess: boolean;
3
54
  constructor(isSuccess: boolean);
@@ -80,4 +131,4 @@ declare class FailedApiKeyResponse extends Response<ApiKey, Problem> {
80
131
  toProblem(): Problem;
81
132
  }
82
133
 
83
- export { type Account, type ApiKey, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, type Tokens };
134
+ export { type Account, AdminClient, type ApiKey, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, type Tokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
@@ -1,15 +0,0 @@
1
- class Response{constructor(_0x3eff6d){this['isSuccess']=_0x3eff6d;}}class SuccessfulAccountResponse extends Response{constructor(_0xef5724){super(!![]),this['account']=_0xef5724;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x291bef){super(![]),this['problem']=_0x291bef;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x18d43a){super(!![]),this['tokens']=_0x18d43a;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x19314a){super(![]),this['problem']=_0x19314a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x29de01){super(!![]),this['apiKey']=_0x29de01;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x34cb72){super(![]),this['problem']=_0x34cb72;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
2
-
3
- var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x48154e,_0x2c0acc,_0xeea91,_0x188fef){function _0x374824(_0x116368){return _0x116368 instanceof _0xeea91?_0x116368:new _0xeea91(function(_0x449518){_0x449518(_0x116368);});}return new(_0xeea91||(_0xeea91=Promise))(function(_0x4d7057,_0x5ea4e8){function _0xce8cc9(_0x2f8357){try{_0xdac8d8(_0x188fef['next'](_0x2f8357));}catch(_0x1db9a5){_0x5ea4e8(_0x1db9a5);}}function _0x181110(_0x115185){try{_0xdac8d8(_0x188fef['throw'](_0x115185));}catch(_0x4dc9cd){_0x5ea4e8(_0x4dc9cd);}}function _0xdac8d8(_0x1a1879){_0x1a1879['done']?_0x4d7057(_0x1a1879['value']):_0x374824(_0x1a1879['value'])['then'](_0xce8cc9,_0x181110);}_0xdac8d8((_0x188fef=_0x188fef['apply'](_0x48154e,_0x2c0acc||[]))['next']());});};class AccountService{constructor(_0x580cda,_0x123ff7){this['tokenManager']=_0x580cda,this['fetch']=_0x123ff7;}['get'](_0x149609,_0x23b0d7){return __awaiter$5(this,void 0,void 0,function*(){const _0x4780b1=yield this['tokenManager']['getOrRefreshTokens'](_0x23b0d7);if(!_0x4780b1['isSuccess'])return new FailedAccountResponse(_0x4780b1['toProblem']());_0x23b0d7=_0x4780b1['toSuccess']();const _0x46f1d9='Account/'+_0x149609+'/',_0x56e12c=yield this['fetch']['get'](_0x46f1d9,_0x23b0d7['access_token']);try{if(_0x56e12c['status']>0xc7&&_0x56e12c['status']<0x12c){const _0x28e3eb=yield _0x56e12c['json']();return new SuccessfulAccountResponse(_0x28e3eb);}const _0x34bdee=yield _0x56e12c['json']();return new FailedAccountResponse(_0x34bdee);}catch(_0x5e19d8){if(_0x5e19d8 instanceof Error)return new FailedAccountResponse({'detail':_0x5e19d8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5e19d8;}});}}
4
-
5
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x343589,_0x382e91,_0x256a8e,_0x111236){function _0x527772(_0x3f340f){return _0x3f340f instanceof _0x256a8e?_0x3f340f:new _0x256a8e(function(_0x4b0d4c){_0x4b0d4c(_0x3f340f);});}return new(_0x256a8e||(_0x256a8e=Promise))(function(_0x58b614,_0x461f82){function _0x411ab(_0x3b4d9f){try{_0x140189(_0x111236['next'](_0x3b4d9f));}catch(_0x4b8b89){_0x461f82(_0x4b8b89);}}function _0xc41abd(_0x2323d1){try{_0x140189(_0x111236['throw'](_0x2323d1));}catch(_0x12bd36){_0x461f82(_0x12bd36);}}function _0x140189(_0x86bf43){_0x86bf43['done']?_0x58b614(_0x86bf43['value']):_0x527772(_0x86bf43['value'])['then'](_0x411ab,_0xc41abd);}_0x140189((_0x111236=_0x111236['apply'](_0x343589,_0x382e91||[]))['next']());});};class ApiKeyService{constructor(_0x870ed4,_0x2463f5){this['tokenManager']=_0x870ed4,this['fetch']=_0x2463f5;}['create'](_0xc135a1,_0x2fa8b2,_0x119286){return __awaiter$4(this,void 0,void 0,function*(){const _0x2d677c=yield this['tokenManager']['getOrRefreshTokens'](_0x119286);if(!_0x2d677c['isSuccess'])return new FailedApiKeyResponse(_0x2d677c['toProblem']());_0x119286=_0x2d677c['toSuccess']();const _0x29eb02='ApiKey/Create',_0x3edb4d={'account_name':_0xc135a1,'name':_0x2fa8b2};try{const _0x8ba201=yield this['fetch']['post'](_0x29eb02,_0x119286['access_token'],_0x3edb4d);if(_0x8ba201['status']>0xc7&&_0x8ba201['status']<0x12c){const _0x28f1ac=yield _0x8ba201['json']();return new SuccessfulApiKeyResponse(_0x28f1ac);}const _0x4f26cc=yield _0x8ba201['json']();return new FailedApiKeyResponse(_0x4f26cc);}catch(_0xc1f443){if(_0xc1f443 instanceof Error)return new FailedApiKeyResponse({'detail':_0xc1f443['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xc1f443;}});}}
6
-
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x193d5b,_0x32ed4e,_0x28b9ab,_0x4fadc3){function _0x2fc5c6(_0x1a5364){return _0x1a5364 instanceof _0x28b9ab?_0x1a5364:new _0x28b9ab(function(_0x13ac67){_0x13ac67(_0x1a5364);});}return new(_0x28b9ab||(_0x28b9ab=Promise))(function(_0x1b218d,_0x396190){function _0xafbb04(_0x4a261a){try{_0x5a5880(_0x4fadc3['next'](_0x4a261a));}catch(_0x10a75b){_0x396190(_0x10a75b);}}function _0x4903f7(_0x51adf5){try{_0x5a5880(_0x4fadc3['throw'](_0x51adf5));}catch(_0x4b775b){_0x396190(_0x4b775b);}}function _0x5a5880(_0x273934){_0x273934['done']?_0x1b218d(_0x273934['value']):_0x2fc5c6(_0x273934['value'])['then'](_0xafbb04,_0x4903f7);}_0x5a5880((_0x4fadc3=_0x4fadc3['apply'](_0x193d5b,_0x32ed4e||[]))['next']());});};class ListService{constructor(_0x40e70d,_0x5633d2){this['tokenManager']=_0x40e70d,this['fetch']=_0x5633d2;}['add'](_0x1a3fba,_0x53a1af,_0x5c2d70){return __awaiter$3(this,void 0,void 0,function*(){const _0x383aa2=yield this['tokenManager']['getOrRefreshTokens'](_0x5c2d70);if(!_0x383aa2['isSuccess'])return new FailedAccountResponse(_0x383aa2['toProblem']());_0x5c2d70=_0x383aa2['toSuccess']();const _0x4a20dc='List',_0x3b05e5={'account_name':_0x1a3fba,'list_name':_0x53a1af};try{const _0xf34477=yield this['fetch']['post'](_0x4a20dc,_0x5c2d70['access_token'],_0x3b05e5);if(_0xf34477['status']>0xc7&&_0xf34477['status']<0x12c){const _0x539f0a=yield _0xf34477['json']();return new SuccessfulAccountResponse(_0x539f0a);}const _0x5ad511=yield _0xf34477['json']();return new FailedAccountResponse(_0x5ad511);}catch(_0x4e7c03){if(_0x4e7c03 instanceof Error)return new FailedAccountResponse({'detail':_0x4e7c03['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4e7c03;}});}['remove'](_0x918bf7,_0x5da9f4,_0x5262c1){return __awaiter$3(this,void 0,void 0,function*(){const _0xc0da70=yield this['tokenManager']['getOrRefreshTokens'](_0x5262c1);if(!_0xc0da70['isSuccess'])return new FailedAccountResponse(_0xc0da70['toProblem']());_0x5262c1=_0xc0da70['toSuccess']();const _0x167081='List/'+_0x918bf7+'/'+_0x5da9f4,_0x366753=yield this['fetch']['delete'](_0x167081,_0x5262c1['access_token']);try{if(_0x366753['status']>0xc7&&_0x366753['status']<0x12c){const _0x3c44ff=yield _0x366753['json']();return new SuccessfulAccountResponse(_0x3c44ff);}const _0x22e6d0=yield _0x366753['json']();return new FailedAccountResponse(_0x22e6d0);}catch(_0x4df1c1){if(_0x4df1c1 instanceof Error)return new FailedAccountResponse({'detail':_0x4df1c1['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4df1c1;}});}}
8
-
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x16d1e1,_0x5f52b7,_0x5e69e7,_0x1eb91c){function _0x12dbd5(_0x243b65){return _0x243b65 instanceof _0x5e69e7?_0x243b65:new _0x5e69e7(function(_0x3a203a){_0x3a203a(_0x243b65);});}return new(_0x5e69e7||(_0x5e69e7=Promise))(function(_0x1e5a18,_0x45acec){function _0x3b5641(_0x19d911){try{_0x1cf3cf(_0x1eb91c['next'](_0x19d911));}catch(_0x331e58){_0x45acec(_0x331e58);}}function _0x17d88b(_0x3bc91a){try{_0x1cf3cf(_0x1eb91c['throw'](_0x3bc91a));}catch(_0x19803b){_0x45acec(_0x19803b);}}function _0x1cf3cf(_0x467935){_0x467935['done']?_0x1e5a18(_0x467935['value']):_0x12dbd5(_0x467935['value'])['then'](_0x3b5641,_0x17d88b);}_0x1cf3cf((_0x1eb91c=_0x1eb91c['apply'](_0x16d1e1,_0x5f52b7||[]))['next']());});};class TokenManager{constructor(_0x50df61){this['authClient']=_0x50df61;}['getOrRefreshTokens'](_0x10fa72){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0x10fa72['access_expires'])return new SuccessfulAuthResponse(_0x10fa72);if(Date['now']()>_0x10fa72['refresh_expires'])return yield this['authClient']['refresh'](_0x10fa72['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
10
-
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5a1794,_0x4ec20a,_0xe5677a,_0x57aa9c){function _0x620747(_0x31c181){return _0x31c181 instanceof _0xe5677a?_0x31c181:new _0xe5677a(function(_0x50b2c1){_0x50b2c1(_0x31c181);});}return new(_0xe5677a||(_0xe5677a=Promise))(function(_0xded1d2,_0xe506e1){function _0x4d8089(_0x5ab860){try{_0x254b41(_0x57aa9c['next'](_0x5ab860));}catch(_0x312e0f){_0xe506e1(_0x312e0f);}}function _0x4fe5b8(_0x29a55b){try{_0x254b41(_0x57aa9c['throw'](_0x29a55b));}catch(_0x55f812){_0xe506e1(_0x55f812);}}function _0x254b41(_0x55fcc0){_0x55fcc0['done']?_0xded1d2(_0x55fcc0['value']):_0x620747(_0x55fcc0['value'])['then'](_0x4d8089,_0x4fe5b8);}_0x254b41((_0x57aa9c=_0x57aa9c['apply'](_0x5a1794,_0x4ec20a||[]))['next']());});};class Fetch{constructor(_0x52cf31){this['baseUri']=_0x52cf31,this['getUrl']=_0x3066ce=>{return _0x3066ce['startsWith']('/')&&(_0x3066ce=_0x3066ce['replace']('/','')),''+this['baseUri']+_0x3066ce;},!_0x52cf31['endsWith']('/')&&(_0x52cf31=_0x52cf31+'/');}['get'](_0x59c95e,_0x194707){return __awaiter$1(this,void 0,void 0,function*(){const _0x2f6957=this['getUrl'](_0x59c95e);return yield fetch(_0x2f6957,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x194707}});});}['post'](_0x3aa1ae,_0x1b08e4,_0x978588){return __awaiter$1(this,void 0,void 0,function*(){const _0x1f2334=this['getUrl'](_0x3aa1ae);return yield fetch(_0x1f2334,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1b08e4},'body':_0x978588?JSON['stringify'](_0x978588):null});});}['put'](_0xc6a10c,_0x25d0f7,_0x52b55e){return __awaiter$1(this,void 0,void 0,function*(){const _0x2bc9e2=this['getUrl'](_0xc6a10c);return yield fetch(_0x2bc9e2,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x25d0f7},'body':_0x52b55e?JSON['stringify'](_0x52b55e):null});});}['delete'](_0xf8a5ae,_0x4d89c0){return __awaiter$1(this,void 0,void 0,function*(){const _0x42615e=this['getUrl'](_0xf8a5ae);return yield fetch(_0x42615e,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4d89c0}});});}}
12
-
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x23551f,_0x4ee97c,_0x82a32b,_0x5ab364){function _0xba444b(_0x3640b6){return _0x3640b6 instanceof _0x82a32b?_0x3640b6:new _0x82a32b(function(_0x1b1746){_0x1b1746(_0x3640b6);});}return new(_0x82a32b||(_0x82a32b=Promise))(function(_0x3814ec,_0x644b7){function _0x477b3d(_0xa5f8d5){try{_0x30abb1(_0x5ab364['next'](_0xa5f8d5));}catch(_0x2a23d6){_0x644b7(_0x2a23d6);}}function _0x555dc9(_0x265317){try{_0x30abb1(_0x5ab364['throw'](_0x265317));}catch(_0x43d689){_0x644b7(_0x43d689);}}function _0x30abb1(_0x2c56d0){_0x2c56d0['done']?_0x3814ec(_0x2c56d0['value']):_0xba444b(_0x2c56d0['value'])['then'](_0x477b3d,_0x555dc9);}_0x30abb1((_0x5ab364=_0x5ab364['apply'](_0x23551f,_0x4ee97c||[]))['next']());});};class AdminClient{constructor(_0x514c2d,_0x3b5376='https://admin.searchability.dev/'){var _0x5b74d6=new TokenManager(_0x514c2d),_0xdf4dea=new Fetch(_0x3b5376);this['Accounts']=new AccountService(_0x5b74d6,_0xdf4dea),this['Lists']=new ListService(_0x5b74d6,_0xdf4dea),this['ApiKeys']=new ApiKeyService(_0x5b74d6,_0xdf4dea);}}class AuthClient{constructor(_0x9d6f08='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x9d6f08);}['login'](_0x1bc1cf){return __awaiter(this,void 0,void 0,function*(){var _0x5b379e='login/'+_0x1bc1cf;try{const _0x53c4ab=yield yield fetch(_0x5b379e);if(_0x53c4ab['status']>0xc7&&_0x53c4ab['status']<0x12c){const _0x237ddd=yield _0x53c4ab['json']();return new SuccessfulAuthResponse(_0x237ddd);}const _0x527fc3=yield _0x53c4ab['json']();return new FailedAuthResponse(_0x527fc3);}catch(_0x1c0a2d){if(_0x1c0a2d instanceof Error)return new FailedAuthResponse({'detail':_0x1c0a2d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1c0a2d;}});}['refresh'](_0x5f42ab){return __awaiter(this,void 0,void 0,function*(){var _0x12909='refresh';try{const _0x117679=yield this['fetch']['post'](_0x12909,_0x5f42ab,null);if(_0x117679['status']>0xc7&&_0x117679['status']<0x12c){const _0x410e3a=yield _0x117679['json']();return new SuccessfulAuthResponse(_0x410e3a);}const _0x1ecefb=yield _0x117679['json']();return new FailedAuthResponse(_0x1ecefb);}catch(_0x312d49){if(_0x312d49 instanceof Error)return new FailedAuthResponse({'detail':_0x312d49['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x312d49;}});}}
14
-
15
- export { AdminClient, AuthClient };