@searchability/admin-client 0.0.15 → 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,19 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x40557c,_0x4eb2b0,_0xca3c2c,_0x451241){function _0x4a822d(_0x241bb9){return _0x241bb9 instanceof _0xca3c2c?_0x241bb9:new _0xca3c2c(function(_0x518759){_0x518759(_0x241bb9);});}return new(_0xca3c2c||(_0xca3c2c=Promise))(function(_0x3ef87b,_0x5a7b20){function _0x543178(_0x50fd99){try{_0x433bc6(_0x451241['next'](_0x50fd99));}catch(_0x379645){_0x5a7b20(_0x379645);}}function _0x107f1f(_0x27bbee){try{_0x433bc6(_0x451241['throw'](_0x27bbee));}catch(_0x484469){_0x5a7b20(_0x484469);}}function _0x433bc6(_0x16186e){_0x16186e['done']?_0x3ef87b(_0x16186e['value']):_0x4a822d(_0x16186e['value'])['then'](_0x543178,_0x107f1f);}_0x433bc6((_0x451241=_0x451241['apply'](_0x40557c,_0x4eb2b0||[]))['next']());});};class Fetch{constructor(_0x49e642){this['baseUri']=_0x49e642,this['getUrl']=_0x80ff4a=>{return _0x80ff4a['startsWith']('/')&&(_0x80ff4a=_0x80ff4a['replace']('/','')),''+this['baseUri']+_0x80ff4a;},!_0x49e642['endsWith']('/')&&(_0x49e642=_0x49e642+'/');}['get'](_0x5adffd,_0xa33c6b){return __awaiter$4(this,void 0,void 0,function*(){const _0x512ff4=this['getUrl'](_0x5adffd);return yield fetch(_0x512ff4,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xa33c6b}});});}['post'](_0x24c3d9,_0x308df7,_0x417b9f){return __awaiter$4(this,void 0,void 0,function*(){const _0x141ac2=this['getUrl'](_0x24c3d9);return yield fetch(_0x141ac2,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x308df7},'body':_0x417b9f?JSON['stringify'](_0x417b9f):null});});}['put'](_0x5dbdfa,_0x4188da,_0x3a8d6f){return __awaiter$4(this,void 0,void 0,function*(){const _0x121e4f=this['getUrl'](_0x5dbdfa);return yield fetch(_0x121e4f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4188da},'body':_0x3a8d6f?JSON['stringify'](_0x3a8d6f):null});});}['delete'](_0x476d4b,_0x363449){return __awaiter$4(this,void 0,void 0,function*(){const _0x4d3ce3=this['getUrl'](_0x476d4b);return yield fetch(_0x4d3ce3,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x363449}});});}}
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
- undefined&&undefined['__awaiter']||function(_0x3d5721,_0x9991d8,_0x579d02,_0x2ebf90){function _0x5aaacd(_0x15b5d6){return _0x15b5d6 instanceof _0x579d02?_0x15b5d6:new _0x579d02(function(_0x53e9fb){_0x53e9fb(_0x15b5d6);});}return new(_0x579d02||(_0x579d02=Promise))(function(_0x5d3c14,_0x4b4eeb){function _0x9a42f6(_0x1d339e){try{_0x2b19f2(_0x2ebf90['next'](_0x1d339e));}catch(_0x145840){_0x4b4eeb(_0x145840);}}function _0x1ba21e(_0x4d6e3a){try{_0x2b19f2(_0x2ebf90['throw'](_0x4d6e3a));}catch(_0x3d51d4){_0x4b4eeb(_0x3d51d4);}}function _0x2b19f2(_0x512fe9){_0x512fe9['done']?_0x5d3c14(_0x512fe9['value']):_0x5aaacd(_0x512fe9['value'])['then'](_0x9a42f6,_0x1ba21e);}_0x2b19f2((_0x2ebf90=_0x2ebf90['apply'](_0x3d5721,_0x9991d8||[]))['next']());});};
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
- class Response{constructor(_0xd192c8){this['isSuccess']=_0xd192c8;}}class SuccessfulAccountResponse extends Response{constructor(_0x352ece){super(!![]),this['account']=_0x352ece;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x138f52){super(![]),this['problem']=_0x138f52;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x277e21){super(!![]),this['tokens']=_0x277e21;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x10e166){super(![]),this['problem']=_0x10e166;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x3a6a27){super(!![]),this['apiKey']=_0x3a6a27;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0xb47c7){super(![]),this['problem']=_0xb47c7;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
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(_0xc3f8e8,_0x58c3d1,_0x40d577,_0x4efd0f){function _0x48b9f7(_0x1024f9){return _0x1024f9 instanceof _0x40d577?_0x1024f9:new _0x40d577(function(_0x41c513){_0x41c513(_0x1024f9);});}return new(_0x40d577||(_0x40d577=Promise))(function(_0x272d80,_0x44a79e){function _0x2bdc25(_0x2ed9a6){try{_0x471c9(_0x4efd0f['next'](_0x2ed9a6));}catch(_0x3f77f3){_0x44a79e(_0x3f77f3);}}function _0x1240cd(_0x53b21d){try{_0x471c9(_0x4efd0f['throw'](_0x53b21d));}catch(_0x1265e9){_0x44a79e(_0x1265e9);}}function _0x471c9(_0x58a024){_0x58a024['done']?_0x272d80(_0x58a024['value']):_0x48b9f7(_0x58a024['value'])['then'](_0x2bdc25,_0x1240cd);}_0x471c9((_0x4efd0f=_0x4efd0f['apply'](_0xc3f8e8,_0x58c3d1||[]))['next']());});};class AccountService{constructor(_0x4058f5,_0x139cdf){this['tokenManager']=_0x4058f5,this['fetch']=_0x139cdf;}['get'](_0x532062,_0x18ab89){return __awaiter$3(this,void 0,void 0,function*(){const _0x43ec38=yield this['tokenManager']['getOrRefreshTokens'](_0x18ab89);if(!_0x43ec38['isSuccess'])return new FailedAccountResponse(_0x43ec38['toProblem']());_0x18ab89=_0x43ec38['toSuccess']();const _0x4f86d4='Account/'+_0x532062+'/',_0x1606cf=yield this['fetch']['get'](_0x4f86d4,_0x18ab89['access_token']);try{if(_0x1606cf['status']>0xc7&&_0x1606cf['status']<0x12c){const _0x381827=yield _0x1606cf['json']();return new SuccessfulAccountResponse(_0x381827);}const _0x277b21=yield _0x1606cf['json']();return new FailedAccountResponse(_0x277b21);}catch(_0x23b37e){if(_0x23b37e instanceof Error)return new FailedAccountResponse({'detail':_0x23b37e['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x23b37e;}});}}
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(_0x4ff64a,_0x49f29a,_0x5e7827,_0x5f0785){function _0x26dcae(_0x3c2d68){return _0x3c2d68 instanceof _0x5e7827?_0x3c2d68:new _0x5e7827(function(_0x5f3fdd){_0x5f3fdd(_0x3c2d68);});}return new(_0x5e7827||(_0x5e7827=Promise))(function(_0x1086a9,_0xf58854){function _0x5ba92d(_0x577732){try{_0x5c0162(_0x5f0785['next'](_0x577732));}catch(_0x1d7395){_0xf58854(_0x1d7395);}}function _0x9bf94b(_0x478d0a){try{_0x5c0162(_0x5f0785['throw'](_0x478d0a));}catch(_0x5c0ff0){_0xf58854(_0x5c0ff0);}}function _0x5c0162(_0xb403bf){_0xb403bf['done']?_0x1086a9(_0xb403bf['value']):_0x26dcae(_0xb403bf['value'])['then'](_0x5ba92d,_0x9bf94b);}_0x5c0162((_0x5f0785=_0x5f0785['apply'](_0x4ff64a,_0x49f29a||[]))['next']());});};class ApiKeyService{constructor(_0x459e29,_0x371ecc){this['tokenManager']=_0x459e29,this['fetch']=_0x371ecc;}['create'](_0x32e4fb,_0x3dd63c,_0x513331){return __awaiter$2(this,void 0,void 0,function*(){const _0x276b72=yield this['tokenManager']['getOrRefreshTokens'](_0x513331);if(!_0x276b72['isSuccess'])return new FailedApiKeyResponse(_0x276b72['toProblem']());_0x513331=_0x276b72['toSuccess']();const _0x2f8b6d='ApiKey/Create',_0xb66e76={'account_name':_0x32e4fb,'name':_0x3dd63c};try{const _0x39eb7f=yield this['fetch']['post'](_0x2f8b6d,_0x513331['access_token'],_0xb66e76);if(_0x39eb7f['status']>0xc7&&_0x39eb7f['status']<0x12c){const _0x2cf186=yield _0x39eb7f['json']();return new SuccessfulApiKeyResponse(_0x2cf186);}const _0x218846=yield _0x39eb7f['json']();return new FailedApiKeyResponse(_0x218846);}catch(_0xb0b95d){if(_0xb0b95d instanceof Error)return new FailedApiKeyResponse({'detail':_0xb0b95d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xb0b95d;}});}}
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(_0x2452d0,_0x3eb67b,_0xaa5814,_0x3f1913){function _0x344516(_0x40d85c){return _0x40d85c instanceof _0xaa5814?_0x40d85c:new _0xaa5814(function(_0x71e495){_0x71e495(_0x40d85c);});}return new(_0xaa5814||(_0xaa5814=Promise))(function(_0x8d4413,_0x1e37c9){function _0x4e8511(_0x3f11d9){try{_0x489570(_0x3f1913['next'](_0x3f11d9));}catch(_0x327531){_0x1e37c9(_0x327531);}}function _0x16265a(_0x4686e4){try{_0x489570(_0x3f1913['throw'](_0x4686e4));}catch(_0x45f587){_0x1e37c9(_0x45f587);}}function _0x489570(_0x474beb){_0x474beb['done']?_0x8d4413(_0x474beb['value']):_0x344516(_0x474beb['value'])['then'](_0x4e8511,_0x16265a);}_0x489570((_0x3f1913=_0x3f1913['apply'](_0x2452d0,_0x3eb67b||[]))['next']());});};class ListService{constructor(_0x4b79b0,_0x12976a){this['tokenManager']=_0x4b79b0,this['fetch']=_0x12976a;}['add'](_0x12ebbc,_0x564d9e,_0x9e5391){return __awaiter$1(this,void 0,void 0,function*(){const _0x15f9bf=yield this['tokenManager']['getOrRefreshTokens'](_0x9e5391);if(!_0x15f9bf['isSuccess'])return new FailedAccountResponse(_0x15f9bf['toProblem']());_0x9e5391=_0x15f9bf['toSuccess']();const _0x56faa3='List',_0x4c1d3d={'account_name':_0x12ebbc,'list_name':_0x564d9e};try{const _0x32817f=yield this['fetch']['post'](_0x56faa3,_0x9e5391['access_token'],_0x4c1d3d);if(_0x32817f['status']>0xc7&&_0x32817f['status']<0x12c){const _0x5bb8bd=yield _0x32817f['json']();return new SuccessfulAccountResponse(_0x5bb8bd);}const _0x6f9397=yield _0x32817f['json']();return new FailedAccountResponse(_0x6f9397);}catch(_0x3eff2a){if(_0x3eff2a instanceof Error)return new FailedAccountResponse({'detail':_0x3eff2a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3eff2a;}});}['remove'](_0x3f1758,_0x5c9dc9,_0x2397fe){return __awaiter$1(this,void 0,void 0,function*(){const _0x70fac1=yield this['tokenManager']['getOrRefreshTokens'](_0x2397fe);if(!_0x70fac1['isSuccess'])return new FailedAccountResponse(_0x70fac1['toProblem']());_0x2397fe=_0x70fac1['toSuccess']();const _0x35cf07='List/'+_0x3f1758+'/'+_0x5c9dc9,_0x25903d=yield this['fetch']['delete'](_0x35cf07,_0x2397fe['access_token']);try{if(_0x25903d['status']>0xc7&&_0x25903d['status']<0x12c){const _0x31c413=yield _0x25903d['json']();return new SuccessfulAccountResponse(_0x31c413);}const _0x149be6=yield _0x25903d['json']();return new FailedAccountResponse(_0x149be6);}catch(_0x994c87){if(_0x994c87 instanceof Error)return new FailedAccountResponse({'detail':_0x994c87['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x994c87;}});}}
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(_0xfc3f59,_0x366c4b,_0x50b25b,_0x837feb){function _0x26c5ff(_0xe52cd2){return _0xe52cd2 instanceof _0x50b25b?_0xe52cd2:new _0x50b25b(function(_0x426c91){_0x426c91(_0xe52cd2);});}return new(_0x50b25b||(_0x50b25b=Promise))(function(_0x40a1c3,_0x5e0193){function _0x1ab839(_0x362601){try{_0x4a4205(_0x837feb['next'](_0x362601));}catch(_0x5afd9a){_0x5e0193(_0x5afd9a);}}function _0x5052a6(_0x3fbd26){try{_0x4a4205(_0x837feb['throw'](_0x3fbd26));}catch(_0x12e052){_0x5e0193(_0x12e052);}}function _0x4a4205(_0x5dfcde){_0x5dfcde['done']?_0x40a1c3(_0x5dfcde['value']):_0x26c5ff(_0x5dfcde['value'])['then'](_0x1ab839,_0x5052a6);}_0x4a4205((_0x837feb=_0x837feb['apply'](_0xfc3f59,_0x366c4b||[]))['next']());});};class TokenManager{constructor(_0xd31079){this['authClient']=_0xd31079;}['getOrRefreshTokens'](_0x29b972){return __awaiter(this,void 0,void 0,function*(){if(Date['now']()<_0x29b972['access_expires'])return new SuccessfulAuthResponse(_0x29b972);if(Date['now']()>_0x29b972['refresh_expires'])return yield this['authClient']['refresh'](_0x29b972['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
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
- class AdminClient{constructor(_0x4f97f0,_0xf18d61='https://admin.searchability.dev/'){var _0x46fcf1=new TokenManager(_0x4f97f0),_0x26c886=new Fetch(_0xf18d61);this['Accounts']=new AccountService(_0x46fcf1,_0x26c886),this['Lists']=new ListService(_0x46fcf1,_0x26c886),this['ApiKeys']=new ApiKeyService(_0x46fcf1,_0x26c886);}}
18
-
19
- module.exports = AdminClient;
17
+ exports.AdminClient = AdminClient;
18
+ exports.AuthClient = AuthClient;
@@ -1,17 +1,15 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0xe391a6,_0x454e27,_0x514c6e,_0x402fa9){function _0xd50388(_0x4a9272){return _0x4a9272 instanceof _0x514c6e?_0x4a9272:new _0x514c6e(function(_0x2d58e3){_0x2d58e3(_0x4a9272);});}return new(_0x514c6e||(_0x514c6e=Promise))(function(_0x53da61,_0x4eb3c6){function _0x5603e2(_0x4ec0b6){try{_0x448dca(_0x402fa9['next'](_0x4ec0b6));}catch(_0x27c2b5){_0x4eb3c6(_0x27c2b5);}}function _0x3681fa(_0x486c9){try{_0x448dca(_0x402fa9['throw'](_0x486c9));}catch(_0x36f386){_0x4eb3c6(_0x36f386);}}function _0x448dca(_0x10a04c){_0x10a04c['done']?_0x53da61(_0x10a04c['value']):_0xd50388(_0x10a04c['value'])['then'](_0x5603e2,_0x3681fa);}_0x448dca((_0x402fa9=_0x402fa9['apply'](_0xe391a6,_0x454e27||[]))['next']());});};class Fetch{constructor(_0x55c8bc){this['baseUri']=_0x55c8bc,this['getUrl']=_0x36329e=>{return _0x36329e['startsWith']('/')&&(_0x36329e=_0x36329e['replace']('/','')),''+this['baseUri']+_0x36329e;},!_0x55c8bc['endsWith']('/')&&(_0x55c8bc=_0x55c8bc+'/');}['get'](_0x10b939,_0x38c2e1){return __awaiter$4(this,void 0,void 0,function*(){const _0x1914da=this['getUrl'](_0x10b939);return yield fetch(_0x1914da,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x38c2e1}});});}['post'](_0x6a9774,_0x3cfc58,_0x1c2021){return __awaiter$4(this,void 0,void 0,function*(){const _0x2c5516=this['getUrl'](_0x6a9774);return yield fetch(_0x2c5516,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3cfc58},'body':_0x1c2021?JSON['stringify'](_0x1c2021):null});});}['put'](_0x47343f,_0x2e9815,_0x1abf28){return __awaiter$4(this,void 0,void 0,function*(){const _0x568369=this['getUrl'](_0x47343f);return yield fetch(_0x568369,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2e9815},'body':_0x1abf28?JSON['stringify'](_0x1abf28):null});});}['delete'](_0x4c6a94,_0xbc98d0){return __awaiter$4(this,void 0,void 0,function*(){const _0x4a35a6=this['getUrl'](_0x4c6a94);return yield fetch(_0x4a35a6,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xbc98d0}});});}}
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
- undefined&&undefined['__awaiter']||function(_0x5d0aa2,_0xa435e6,_0x4b6313,_0xc460da){function _0x1f9c13(_0x3e5688){return _0x3e5688 instanceof _0x4b6313?_0x3e5688:new _0x4b6313(function(_0x165c2e){_0x165c2e(_0x3e5688);});}return new(_0x4b6313||(_0x4b6313=Promise))(function(_0x186b0b,_0x30a263){function _0x52948d(_0x255fec){try{_0x430ff2(_0xc460da['next'](_0x255fec));}catch(_0x403d64){_0x30a263(_0x403d64);}}function _0x3f8869(_0x3938df){try{_0x430ff2(_0xc460da['throw'](_0x3938df));}catch(_0xea4e23){_0x30a263(_0xea4e23);}}function _0x430ff2(_0x52abe4){_0x52abe4['done']?_0x186b0b(_0x52abe4['value']):_0x1f9c13(_0x52abe4['value'])['then'](_0x52948d,_0x3f8869);}_0x430ff2((_0xc460da=_0xc460da['apply'](_0x5d0aa2,_0xa435e6||[]))['next']());});};
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
- class Response{constructor(_0x36313e){this['isSuccess']=_0x36313e;}}class SuccessfulAccountResponse extends Response{constructor(_0x1147bc){super(!![]),this['account']=_0x1147bc;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x361bc3){super(![]),this['problem']=_0x361bc3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x24a8b6){super(!![]),this['tokens']=_0x24a8b6;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x40438a){super(![]),this['problem']=_0x40438a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x1cb92c){super(!![]),this['apiKey']=_0x1cb92c;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x823f08){super(![]),this['problem']=_0x823f08;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
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(_0x48393b,_0x2b3745,_0x39068f,_0x4bc6b1){function _0x117415(_0x2a0a7a){return _0x2a0a7a instanceof _0x39068f?_0x2a0a7a:new _0x39068f(function(_0x16abc3){_0x16abc3(_0x2a0a7a);});}return new(_0x39068f||(_0x39068f=Promise))(function(_0x3d3a8e,_0x36081b){function _0x98f1c0(_0x534bab){try{_0x250024(_0x4bc6b1['next'](_0x534bab));}catch(_0x560afb){_0x36081b(_0x560afb);}}function _0x24d8ae(_0x33f7e4){try{_0x250024(_0x4bc6b1['throw'](_0x33f7e4));}catch(_0x1a1fd8){_0x36081b(_0x1a1fd8);}}function _0x250024(_0xa49522){_0xa49522['done']?_0x3d3a8e(_0xa49522['value']):_0x117415(_0xa49522['value'])['then'](_0x98f1c0,_0x24d8ae);}_0x250024((_0x4bc6b1=_0x4bc6b1['apply'](_0x48393b,_0x2b3745||[]))['next']());});};class AccountService{constructor(_0x1eadb8,_0x256490){this['tokenManager']=_0x1eadb8,this['fetch']=_0x256490;}['get'](_0x4a1401,_0x290c76){return __awaiter$3(this,void 0,void 0,function*(){const _0xdc7ff4=yield this['tokenManager']['getOrRefreshTokens'](_0x290c76);if(!_0xdc7ff4['isSuccess'])return new FailedAccountResponse(_0xdc7ff4['toProblem']());_0x290c76=_0xdc7ff4['toSuccess']();const _0x15b9cd='Account/'+_0x4a1401+'/',_0x5d0b4b=yield this['fetch']['get'](_0x15b9cd,_0x290c76['access_token']);try{if(_0x5d0b4b['status']>0xc7&&_0x5d0b4b['status']<0x12c){const _0x5e0244=yield _0x5d0b4b['json']();return new SuccessfulAccountResponse(_0x5e0244);}const _0xcdc9dc=yield _0x5d0b4b['json']();return new FailedAccountResponse(_0xcdc9dc);}catch(_0x7ed400){if(_0x7ed400 instanceof Error)return new FailedAccountResponse({'detail':_0x7ed400['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x7ed400;}});}}
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(_0x20ea2c,_0x2e18b5,_0x5d2f1e,_0x8c49c6){function _0x5d54b2(_0x4e2fdf){return _0x4e2fdf instanceof _0x5d2f1e?_0x4e2fdf:new _0x5d2f1e(function(_0x1b285a){_0x1b285a(_0x4e2fdf);});}return new(_0x5d2f1e||(_0x5d2f1e=Promise))(function(_0x5f5798,_0x47c992){function _0x530ee0(_0x40c873){try{_0x322249(_0x8c49c6['next'](_0x40c873));}catch(_0x26d7ab){_0x47c992(_0x26d7ab);}}function _0x2378cf(_0x467548){try{_0x322249(_0x8c49c6['throw'](_0x467548));}catch(_0x4259c3){_0x47c992(_0x4259c3);}}function _0x322249(_0x14f669){_0x14f669['done']?_0x5f5798(_0x14f669['value']):_0x5d54b2(_0x14f669['value'])['then'](_0x530ee0,_0x2378cf);}_0x322249((_0x8c49c6=_0x8c49c6['apply'](_0x20ea2c,_0x2e18b5||[]))['next']());});};class ApiKeyService{constructor(_0x572c48,_0x128887){this['tokenManager']=_0x572c48,this['fetch']=_0x128887;}['create'](_0x969187,_0x4c7959,_0x1e6084){return __awaiter$2(this,void 0,void 0,function*(){const _0x3669b2=yield this['tokenManager']['getOrRefreshTokens'](_0x1e6084);if(!_0x3669b2['isSuccess'])return new FailedApiKeyResponse(_0x3669b2['toProblem']());_0x1e6084=_0x3669b2['toSuccess']();const _0x404d5a='ApiKey/Create',_0x13d66e={'account_name':_0x969187,'name':_0x4c7959};try{const _0x5eb41c=yield this['fetch']['post'](_0x404d5a,_0x1e6084['access_token'],_0x13d66e);if(_0x5eb41c['status']>0xc7&&_0x5eb41c['status']<0x12c){const _0x3201d7=yield _0x5eb41c['json']();return new SuccessfulApiKeyResponse(_0x3201d7);}const _0x4c6aa2=yield _0x5eb41c['json']();return new FailedApiKeyResponse(_0x4c6aa2);}catch(_0x58adbc){if(_0x58adbc instanceof Error)return new FailedApiKeyResponse({'detail':_0x58adbc['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x58adbc;}});}}
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(_0x163567,_0x1b50fc,_0x4b1c35,_0x42b115){function _0x411ba7(_0x2fc545){return _0x2fc545 instanceof _0x4b1c35?_0x2fc545:new _0x4b1c35(function(_0x5e0d53){_0x5e0d53(_0x2fc545);});}return new(_0x4b1c35||(_0x4b1c35=Promise))(function(_0x52f34a,_0x5a4944){function _0x4be41c(_0x5254c3){try{_0x7885f4(_0x42b115['next'](_0x5254c3));}catch(_0x40caed){_0x5a4944(_0x40caed);}}function _0x5cf241(_0x29d469){try{_0x7885f4(_0x42b115['throw'](_0x29d469));}catch(_0x7632de){_0x5a4944(_0x7632de);}}function _0x7885f4(_0x50bde0){_0x50bde0['done']?_0x52f34a(_0x50bde0['value']):_0x411ba7(_0x50bde0['value'])['then'](_0x4be41c,_0x5cf241);}_0x7885f4((_0x42b115=_0x42b115['apply'](_0x163567,_0x1b50fc||[]))['next']());});};class ListService{constructor(_0x5eb57d,_0x177976){this['tokenManager']=_0x5eb57d,this['fetch']=_0x177976;}['add'](_0x3b1c19,_0x3c00e8,_0x105d7a){return __awaiter$1(this,void 0,void 0,function*(){const _0x5a88c7=yield this['tokenManager']['getOrRefreshTokens'](_0x105d7a);if(!_0x5a88c7['isSuccess'])return new FailedAccountResponse(_0x5a88c7['toProblem']());_0x105d7a=_0x5a88c7['toSuccess']();const _0x28b095='List',_0x5ce0c9={'account_name':_0x3b1c19,'list_name':_0x3c00e8};try{const _0x25028b=yield this['fetch']['post'](_0x28b095,_0x105d7a['access_token'],_0x5ce0c9);if(_0x25028b['status']>0xc7&&_0x25028b['status']<0x12c){const _0x84d4c0=yield _0x25028b['json']();return new SuccessfulAccountResponse(_0x84d4c0);}const _0x41b370=yield _0x25028b['json']();return new FailedAccountResponse(_0x41b370);}catch(_0x53de12){if(_0x53de12 instanceof Error)return new FailedAccountResponse({'detail':_0x53de12['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x53de12;}});}['remove'](_0x51228e,_0xd08c70,_0x5f5d67){return __awaiter$1(this,void 0,void 0,function*(){const _0x5f3ca9=yield this['tokenManager']['getOrRefreshTokens'](_0x5f5d67);if(!_0x5f3ca9['isSuccess'])return new FailedAccountResponse(_0x5f3ca9['toProblem']());_0x5f5d67=_0x5f3ca9['toSuccess']();const _0x12cd03='List/'+_0x51228e+'/'+_0xd08c70,_0x4b1701=yield this['fetch']['delete'](_0x12cd03,_0x5f5d67['access_token']);try{if(_0x4b1701['status']>0xc7&&_0x4b1701['status']<0x12c){const _0x154f46=yield _0x4b1701['json']();return new SuccessfulAccountResponse(_0x154f46);}const _0x246940=yield _0x4b1701['json']();return new FailedAccountResponse(_0x246940);}catch(_0x341fc2){if(_0x341fc2 instanceof Error)return new FailedAccountResponse({'detail':_0x341fc2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x341fc2;}});}}
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(_0x2c68d5,_0x2f641b,_0x9b3315,_0x20d1ab){function _0x5176fb(_0x530933){return _0x530933 instanceof _0x9b3315?_0x530933:new _0x9b3315(function(_0x30ae66){_0x30ae66(_0x530933);});}return new(_0x9b3315||(_0x9b3315=Promise))(function(_0x16abef,_0x127653){function _0x213739(_0x1a3bba){try{_0x50e864(_0x20d1ab['next'](_0x1a3bba));}catch(_0xf2d8bd){_0x127653(_0xf2d8bd);}}function _0x5c75ba(_0x3725a2){try{_0x50e864(_0x20d1ab['throw'](_0x3725a2));}catch(_0x4b5730){_0x127653(_0x4b5730);}}function _0x50e864(_0x2e5c26){_0x2e5c26['done']?_0x16abef(_0x2e5c26['value']):_0x5176fb(_0x2e5c26['value'])['then'](_0x213739,_0x5c75ba);}_0x50e864((_0x20d1ab=_0x20d1ab['apply'](_0x2c68d5,_0x2f641b||[]))['next']());});};class TokenManager{constructor(_0x135fae){this['authClient']=_0x135fae;}['getOrRefreshTokens'](_0x5f2099){return __awaiter(this,void 0,void 0,function*(){if(Date['now']()<_0x5f2099['access_expires'])return new SuccessfulAuthResponse(_0x5f2099);if(Date['now']()>_0x5f2099['refresh_expires'])return yield this['authClient']['refresh'](_0x5f2099['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
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
- class AdminClient{constructor(_0x127ac7,_0x20a834='https://admin.searchability.dev/'){var _0x2eab34=new TokenManager(_0x127ac7),_0x3dc468=new Fetch(_0x20a834);this['Accounts']=new AccountService(_0x2eab34,_0x3dc468),this['Lists']=new ListService(_0x2eab34,_0x3dc468),this['ApiKeys']=new ApiKeyService(_0x2eab34,_0x3dc468);}}
16
-
17
- export { AdminClient as default };
15
+ export { AdminClient, AuthClient };
package/dist/types.d.ts CHANGED
@@ -8,13 +8,6 @@ declare class Fetch {
8
8
  delete(path: string, accessToken: string): Promise<globalThis.Response>;
9
9
  }
10
10
 
11
- declare class AuthClient {
12
- readonly fetch: Fetch;
13
- constructor(baseUri?: string);
14
- login(apiKey: string): Promise<Response<Tokens, Problem>>;
15
- refresh(refreshToken: string): Promise<Response<Tokens, Problem>>;
16
- }
17
-
18
11
  declare class TokenManager {
19
12
  readonly authClient: AuthClient;
20
13
  constructor(authClient: AuthClient);
@@ -49,6 +42,12 @@ declare class AdminClient {
49
42
  readonly Lists: ListService;
50
43
  readonly ApiKeys: ApiKeyService;
51
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
+ }
52
51
 
53
52
  declare abstract class Response<S, F> {
54
53
  readonly isSuccess: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
@@ -1,17 +0,0 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x35ea30,_0x8f6d1a,_0x5cab08,_0x138c90){function _0x4c817e(_0x2cbc4e){return _0x2cbc4e instanceof _0x5cab08?_0x2cbc4e:new _0x5cab08(function(_0x52d1a1){_0x52d1a1(_0x2cbc4e);});}return new(_0x5cab08||(_0x5cab08=Promise))(function(_0x3dd53e,_0x4021d7){function _0x4149cb(_0x3f20d0){try{_0x98664(_0x138c90['next'](_0x3f20d0));}catch(_0xd7500f){_0x4021d7(_0xd7500f);}}function _0x22ec3c(_0x1befda){try{_0x98664(_0x138c90['throw'](_0x1befda));}catch(_0x40ec27){_0x4021d7(_0x40ec27);}}function _0x98664(_0x2cdf1a){_0x2cdf1a['done']?_0x3dd53e(_0x2cdf1a['value']):_0x4c817e(_0x2cdf1a['value'])['then'](_0x4149cb,_0x22ec3c);}_0x98664((_0x138c90=_0x138c90['apply'](_0x35ea30,_0x8f6d1a||[]))['next']());});};class Fetch{constructor(_0x3fd208){this['baseUri']=_0x3fd208,this['getUrl']=_0x48ea22=>{return _0x48ea22['startsWith']('/')&&(_0x48ea22=_0x48ea22['replace']('/','')),''+this['baseUri']+_0x48ea22;},!_0x3fd208['endsWith']('/')&&(_0x3fd208=_0x3fd208+'/');}['get'](_0x109c44,_0x179457){return __awaiter$4(this,void 0,void 0,function*(){const _0x1995c2=this['getUrl'](_0x109c44);return yield fetch(_0x1995c2,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x179457}});});}['post'](_0x17e40c,_0x3515a4,_0x514613){return __awaiter$4(this,void 0,void 0,function*(){const _0x3a80d6=this['getUrl'](_0x17e40c);return yield fetch(_0x3a80d6,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3515a4},'body':_0x514613?JSON['stringify'](_0x514613):null});});}['put'](_0x4a2812,_0x3e160b,_0x4e10e7){return __awaiter$4(this,void 0,void 0,function*(){const _0x4469a1=this['getUrl'](_0x4a2812);return yield fetch(_0x4469a1,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3e160b},'body':_0x4e10e7?JSON['stringify'](_0x4e10e7):null});});}['delete'](_0x19b1f0,_0x2f0fcf){return __awaiter$4(this,void 0,void 0,function*(){const _0xdf286d=this['getUrl'](_0x19b1f0);return yield fetch(_0xdf286d,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2f0fcf}});});}}
2
-
3
- undefined&&undefined['__awaiter']||function(_0x2c6747,_0x5c9f8e,_0xfd1f19,_0x41f26e){function _0x490a85(_0x110bcc){return _0x110bcc instanceof _0xfd1f19?_0x110bcc:new _0xfd1f19(function(_0x42a8b7){_0x42a8b7(_0x110bcc);});}return new(_0xfd1f19||(_0xfd1f19=Promise))(function(_0x42b56c,_0x1d02db){function _0x24160c(_0x56816e){try{_0x3b595a(_0x41f26e['next'](_0x56816e));}catch(_0x408176){_0x1d02db(_0x408176);}}function _0x231d88(_0x2b4635){try{_0x3b595a(_0x41f26e['throw'](_0x2b4635));}catch(_0x2d0f01){_0x1d02db(_0x2d0f01);}}function _0x3b595a(_0x5de2a3){_0x5de2a3['done']?_0x42b56c(_0x5de2a3['value']):_0x490a85(_0x5de2a3['value'])['then'](_0x24160c,_0x231d88);}_0x3b595a((_0x41f26e=_0x41f26e['apply'](_0x2c6747,_0x5c9f8e||[]))['next']());});};
4
-
5
- class Response{constructor(_0x403d20){this['isSuccess']=_0x403d20;}}class SuccessfulAccountResponse extends Response{constructor(_0x3ec9c1){super(!![]),this['account']=_0x3ec9c1;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x219623){super(![]),this['problem']=_0x219623;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x23350){super(!![]),this['tokens']=_0x23350;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x2ed39f){super(![]),this['problem']=_0x2ed39f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x4ba93c){super(!![]),this['apiKey']=_0x4ba93c;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x34d97f){super(![]),this['problem']=_0x34d97f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
-
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x1affa8,_0x3b0a9,_0x2920c2,_0x1808b0){function _0x3e426d(_0x48a0cd){return _0x48a0cd instanceof _0x2920c2?_0x48a0cd:new _0x2920c2(function(_0x9acd01){_0x9acd01(_0x48a0cd);});}return new(_0x2920c2||(_0x2920c2=Promise))(function(_0x3e846d,_0x2e7a7e){function _0xc39f2c(_0x339d98){try{_0x2b81fe(_0x1808b0['next'](_0x339d98));}catch(_0x466e4e){_0x2e7a7e(_0x466e4e);}}function _0x24fa69(_0x5574a3){try{_0x2b81fe(_0x1808b0['throw'](_0x5574a3));}catch(_0x2b6384){_0x2e7a7e(_0x2b6384);}}function _0x2b81fe(_0x35bae6){_0x35bae6['done']?_0x3e846d(_0x35bae6['value']):_0x3e426d(_0x35bae6['value'])['then'](_0xc39f2c,_0x24fa69);}_0x2b81fe((_0x1808b0=_0x1808b0['apply'](_0x1affa8,_0x3b0a9||[]))['next']());});};class AccountService{constructor(_0x24bed3,_0x58c5f8){this['tokenManager']=_0x24bed3,this['fetch']=_0x58c5f8;}['get'](_0x570fd5,_0x5847e5){return __awaiter$3(this,void 0,void 0,function*(){const _0x401e57=yield this['tokenManager']['getOrRefreshTokens'](_0x5847e5);if(!_0x401e57['isSuccess'])return new FailedAccountResponse(_0x401e57['toProblem']());_0x5847e5=_0x401e57['toSuccess']();const _0x525e3a='Account/'+_0x570fd5+'/',_0x1d3fc3=yield this['fetch']['get'](_0x525e3a,_0x5847e5['access_token']);try{if(_0x1d3fc3['status']>0xc7&&_0x1d3fc3['status']<0x12c){const _0x29b0d3=yield _0x1d3fc3['json']();return new SuccessfulAccountResponse(_0x29b0d3);}const _0x559542=yield _0x1d3fc3['json']();return new FailedAccountResponse(_0x559542);}catch(_0x11b97f){if(_0x11b97f instanceof Error)return new FailedAccountResponse({'detail':_0x11b97f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x11b97f;}});}}
8
-
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x5f292c,_0x8882f,_0x29fead,_0x4482ad){function _0x47c117(_0x3c17ba){return _0x3c17ba instanceof _0x29fead?_0x3c17ba:new _0x29fead(function(_0x46f87d){_0x46f87d(_0x3c17ba);});}return new(_0x29fead||(_0x29fead=Promise))(function(_0x492f98,_0x3663fc){function _0x31d94b(_0x1022b2){try{_0x1ff4da(_0x4482ad['next'](_0x1022b2));}catch(_0x45c8e1){_0x3663fc(_0x45c8e1);}}function _0x5c970b(_0x39caeb){try{_0x1ff4da(_0x4482ad['throw'](_0x39caeb));}catch(_0xc08e27){_0x3663fc(_0xc08e27);}}function _0x1ff4da(_0x4906a6){_0x4906a6['done']?_0x492f98(_0x4906a6['value']):_0x47c117(_0x4906a6['value'])['then'](_0x31d94b,_0x5c970b);}_0x1ff4da((_0x4482ad=_0x4482ad['apply'](_0x5f292c,_0x8882f||[]))['next']());});};class ApiKeyService{constructor(_0x4bab11,_0x34d012){this['tokenManager']=_0x4bab11,this['fetch']=_0x34d012;}['create'](_0x21ce6d,_0x2f1de7,_0x4a3257){return __awaiter$2(this,void 0,void 0,function*(){const _0x151cfb=yield this['tokenManager']['getOrRefreshTokens'](_0x4a3257);if(!_0x151cfb['isSuccess'])return new FailedApiKeyResponse(_0x151cfb['toProblem']());_0x4a3257=_0x151cfb['toSuccess']();const _0xc260fb='ApiKey/Create',_0x4935e3={'account_name':_0x21ce6d,'name':_0x2f1de7};try{const _0x180616=yield this['fetch']['post'](_0xc260fb,_0x4a3257['access_token'],_0x4935e3);if(_0x180616['status']>0xc7&&_0x180616['status']<0x12c){const _0x30a37f=yield _0x180616['json']();return new SuccessfulApiKeyResponse(_0x30a37f);}const _0x1497bf=yield _0x180616['json']();return new FailedApiKeyResponse(_0x1497bf);}catch(_0x382af8){if(_0x382af8 instanceof Error)return new FailedApiKeyResponse({'detail':_0x382af8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x382af8;}});}}
10
-
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x262b6c,_0x40eca1,_0x392c3b,_0x154cd7){function _0x21313d(_0x2edc4d){return _0x2edc4d instanceof _0x392c3b?_0x2edc4d:new _0x392c3b(function(_0xf333ad){_0xf333ad(_0x2edc4d);});}return new(_0x392c3b||(_0x392c3b=Promise))(function(_0x18982c,_0x5a5e44){function _0x27c33c(_0x2711a6){try{_0x283967(_0x154cd7['next'](_0x2711a6));}catch(_0x47849f){_0x5a5e44(_0x47849f);}}function _0x411be5(_0x5c35bb){try{_0x283967(_0x154cd7['throw'](_0x5c35bb));}catch(_0x44aab6){_0x5a5e44(_0x44aab6);}}function _0x283967(_0x210ed0){_0x210ed0['done']?_0x18982c(_0x210ed0['value']):_0x21313d(_0x210ed0['value'])['then'](_0x27c33c,_0x411be5);}_0x283967((_0x154cd7=_0x154cd7['apply'](_0x262b6c,_0x40eca1||[]))['next']());});};class ListService{constructor(_0x4dafef,_0x513426){this['tokenManager']=_0x4dafef,this['fetch']=_0x513426;}['add'](_0x16f76e,_0x5ad6fc,_0x4d387a){return __awaiter$1(this,void 0,void 0,function*(){const _0x5612df=yield this['tokenManager']['getOrRefreshTokens'](_0x4d387a);if(!_0x5612df['isSuccess'])return new FailedAccountResponse(_0x5612df['toProblem']());_0x4d387a=_0x5612df['toSuccess']();const _0x57aa7a='List',_0x2d19f5={'account_name':_0x16f76e,'list_name':_0x5ad6fc};try{const _0xb367ea=yield this['fetch']['post'](_0x57aa7a,_0x4d387a['access_token'],_0x2d19f5);if(_0xb367ea['status']>0xc7&&_0xb367ea['status']<0x12c){const _0x523bed=yield _0xb367ea['json']();return new SuccessfulAccountResponse(_0x523bed);}const _0x3ac874=yield _0xb367ea['json']();return new FailedAccountResponse(_0x3ac874);}catch(_0x534ee9){if(_0x534ee9 instanceof Error)return new FailedAccountResponse({'detail':_0x534ee9['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x534ee9;}});}['remove'](_0x3c3a6a,_0x5a0f6a,_0x5b3f83){return __awaiter$1(this,void 0,void 0,function*(){const _0x395947=yield this['tokenManager']['getOrRefreshTokens'](_0x5b3f83);if(!_0x395947['isSuccess'])return new FailedAccountResponse(_0x395947['toProblem']());_0x5b3f83=_0x395947['toSuccess']();const _0x10f45c='List/'+_0x3c3a6a+'/'+_0x5a0f6a,_0x22b021=yield this['fetch']['delete'](_0x10f45c,_0x5b3f83['access_token']);try{if(_0x22b021['status']>0xc7&&_0x22b021['status']<0x12c){const _0xcdc476=yield _0x22b021['json']();return new SuccessfulAccountResponse(_0xcdc476);}const _0x413007=yield _0x22b021['json']();return new FailedAccountResponse(_0x413007);}catch(_0x4e6946){if(_0x4e6946 instanceof Error)return new FailedAccountResponse({'detail':_0x4e6946['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4e6946;}});}}
12
-
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x3529a1,_0x195f21,_0x1a4bb8,_0x2e85ef){function _0x1a4c31(_0x25ad88){return _0x25ad88 instanceof _0x1a4bb8?_0x25ad88:new _0x1a4bb8(function(_0x2b2a81){_0x2b2a81(_0x25ad88);});}return new(_0x1a4bb8||(_0x1a4bb8=Promise))(function(_0x21c7d7,_0x3c8c2a){function _0x1e2935(_0x3bb09c){try{_0x474f05(_0x2e85ef['next'](_0x3bb09c));}catch(_0x563c82){_0x3c8c2a(_0x563c82);}}function _0x488e5b(_0x235f09){try{_0x474f05(_0x2e85ef['throw'](_0x235f09));}catch(_0x261c75){_0x3c8c2a(_0x261c75);}}function _0x474f05(_0x58899c){_0x58899c['done']?_0x21c7d7(_0x58899c['value']):_0x1a4c31(_0x58899c['value'])['then'](_0x1e2935,_0x488e5b);}_0x474f05((_0x2e85ef=_0x2e85ef['apply'](_0x3529a1,_0x195f21||[]))['next']());});};class TokenManager{constructor(_0x433358){this['authClient']=_0x433358;}['getOrRefreshTokens'](_0x15b708){return __awaiter(this,void 0,void 0,function*(){if(Date['now']()<_0x15b708['access_expires'])return new SuccessfulAuthResponse(_0x15b708);if(Date['now']()>_0x15b708['refresh_expires'])return yield this['authClient']['refresh'](_0x15b708['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
14
-
15
- class AdminClient{constructor(_0x5f4113,_0x439daa='https://admin.searchability.dev/'){var _0x50bf9c=new TokenManager(_0x5f4113),_0x4677db=new Fetch(_0x439daa);this['Accounts']=new AccountService(_0x50bf9c,_0x4677db),this['Lists']=new ListService(_0x50bf9c,_0x4677db),this['ApiKeys']=new ApiKeyService(_0x50bf9c,_0x4677db);}}
16
-
17
- export { AdminClient as default };