@searchability/admin-client 0.0.13 → 0.0.14

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,17 @@
1
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4e84ea,_0xf1ae15,_0x5ebedb,_0x37e57f){function _0x25091a(_0x5a828a){return _0x5a828a instanceof _0x5ebedb?_0x5a828a:new _0x5ebedb(function(_0x23cd2a){_0x23cd2a(_0x5a828a);});}return new(_0x5ebedb||(_0x5ebedb=Promise))(function(_0x1d9633,_0x9bfd9f){function _0x57e1b1(_0x353301){try{_0x32539a(_0x37e57f['next'](_0x353301));}catch(_0x317117){_0x9bfd9f(_0x317117);}}function _0x621b27(_0x4353d1){try{_0x32539a(_0x37e57f['throw'](_0x4353d1));}catch(_0x53021c){_0x9bfd9f(_0x53021c);}}function _0x32539a(_0x227d17){_0x227d17['done']?_0x1d9633(_0x227d17['value']):_0x25091a(_0x227d17['value'])['then'](_0x57e1b1,_0x621b27);}_0x32539a((_0x37e57f=_0x37e57f['apply'](_0x4e84ea,_0xf1ae15||[]))['next']());});};class Fetch{constructor(_0xdc4de7){this['baseUri']=_0xdc4de7,this['getUrl']=_0x2abbc1=>{return _0x2abbc1['startsWith']('/')&&(_0x2abbc1=_0x2abbc1['replace']('/','')),''+this['baseUri']+_0x2abbc1;},!_0xdc4de7['endsWith']('/')&&(_0xdc4de7=_0xdc4de7+'/');}['get'](_0x396f4d,_0x2c9a93){return __awaiter$4(this,void 0,void 0,function*(){const _0x3881bc=this['getUrl'](_0x396f4d);return yield fetch(_0x3881bc,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2c9a93}});});}['post'](_0x2878fd,_0x57ee2f,_0x485dcb){return __awaiter$4(this,void 0,void 0,function*(){const _0x44b0f8=this['getUrl'](_0x2878fd);return yield fetch(_0x44b0f8,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x57ee2f},'body':_0x485dcb?JSON['stringify'](_0x485dcb):null});});}['put'](_0x417918,_0x13e259,_0x52cbff){return __awaiter$4(this,void 0,void 0,function*(){const _0x2a6e72=this['getUrl'](_0x417918);return yield fetch(_0x2a6e72,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x13e259},'body':_0x52cbff?JSON['stringify'](_0x52cbff):null});});}['delete'](_0x17d527,_0x16b3f6){return __awaiter$4(this,void 0,void 0,function*(){const _0xe72478=this['getUrl'](_0x17d527);return yield fetch(_0xe72478,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x16b3f6}});});}}
2
+
3
+ undefined&&undefined['__awaiter']||function(_0x3c5743,_0x2a5bda,_0x2a811c,_0x37e568){function _0x265efa(_0x1e4cc0){return _0x1e4cc0 instanceof _0x2a811c?_0x1e4cc0:new _0x2a811c(function(_0x17b452){_0x17b452(_0x1e4cc0);});}return new(_0x2a811c||(_0x2a811c=Promise))(function(_0x4ee972,_0x19d76a){function _0x72288b(_0x4b77ac){try{_0x1babee(_0x37e568['next'](_0x4b77ac));}catch(_0x181f5d){_0x19d76a(_0x181f5d);}}function _0x64e6fc(_0x43fe64){try{_0x1babee(_0x37e568['throw'](_0x43fe64));}catch(_0x9604f4){_0x19d76a(_0x9604f4);}}function _0x1babee(_0x1a369d){_0x1a369d['done']?_0x4ee972(_0x1a369d['value']):_0x265efa(_0x1a369d['value'])['then'](_0x72288b,_0x64e6fc);}_0x1babee((_0x37e568=_0x37e568['apply'](_0x3c5743,_0x2a5bda||[]))['next']());});};
4
+
5
+ class Response{constructor(_0x43331a){this['isSuccess']=_0x43331a;}}class SuccessfulAccountResponse extends Response{constructor(_0x18ad8b){super(!![]),this['account']=_0x18ad8b;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x5ca6f4){super(![]),this['problem']=_0x5ca6f4;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x428d76){super(!![]),this['tokens']=_0x428d76;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x3c7aff){super(![]),this['problem']=_0x3c7aff;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x59428c){super(!![]),this['apiKey']=_0x59428c;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x41ce9d){super(![]),this['problem']=_0x41ce9d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
+
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x4f376a,_0x5311cc,_0x30b08f,_0x20c2b9){function _0x511ffd(_0x3bbfa0){return _0x3bbfa0 instanceof _0x30b08f?_0x3bbfa0:new _0x30b08f(function(_0x2d564a){_0x2d564a(_0x3bbfa0);});}return new(_0x30b08f||(_0x30b08f=Promise))(function(_0x3c352e,_0x1c70f4){function _0x42aa75(_0x4addaf){try{_0x41526a(_0x20c2b9['next'](_0x4addaf));}catch(_0x14ddb5){_0x1c70f4(_0x14ddb5);}}function _0x410df6(_0x5b85c4){try{_0x41526a(_0x20c2b9['throw'](_0x5b85c4));}catch(_0x358f66){_0x1c70f4(_0x358f66);}}function _0x41526a(_0x218f7b){_0x218f7b['done']?_0x3c352e(_0x218f7b['value']):_0x511ffd(_0x218f7b['value'])['then'](_0x42aa75,_0x410df6);}_0x41526a((_0x20c2b9=_0x20c2b9['apply'](_0x4f376a,_0x5311cc||[]))['next']());});};class AccountService{constructor(_0x20b91a,_0x4f3228){this['tokenManager']=_0x20b91a,this['fetch']=_0x4f3228;}['get'](_0x494659,_0x4aec94){return __awaiter$3(this,void 0,void 0,function*(){const _0x2ddcc5=yield this['tokenManager']['getOrRefreshTokens'](_0x4aec94);if(!_0x2ddcc5['isSuccess'])return new FailedAccountResponse(_0x2ddcc5['toProblem']());_0x4aec94=_0x2ddcc5['toSuccess']();const _0x4a3b83='Account/'+_0x494659+'/',_0xda1603=yield this['fetch']['get'](_0x4a3b83,_0x4aec94['access_token']);try{if(_0xda1603['status']>0xc7&&_0xda1603['status']<0x12c){const _0x2f5b00=yield _0xda1603['json']();return new SuccessfulAccountResponse(_0x2f5b00);}const _0x5c764b=yield _0xda1603['json']();return new FailedAccountResponse(_0x5c764b);}catch(_0x64176b){if(_0x64176b instanceof Error)return new FailedAccountResponse({'detail':_0x64176b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x64176b;}});}}
8
+
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x51da42,_0x131116,_0x56006e,_0x77b2e6){function _0x1bf265(_0x309a61){return _0x309a61 instanceof _0x56006e?_0x309a61:new _0x56006e(function(_0x403746){_0x403746(_0x309a61);});}return new(_0x56006e||(_0x56006e=Promise))(function(_0x9d8b54,_0x3aa3c0){function _0x417410(_0x34e5b4){try{_0x4cbccb(_0x77b2e6['next'](_0x34e5b4));}catch(_0x1ef813){_0x3aa3c0(_0x1ef813);}}function _0x7fb333(_0x49e7d7){try{_0x4cbccb(_0x77b2e6['throw'](_0x49e7d7));}catch(_0x55dd2e){_0x3aa3c0(_0x55dd2e);}}function _0x4cbccb(_0x56496d){_0x56496d['done']?_0x9d8b54(_0x56496d['value']):_0x1bf265(_0x56496d['value'])['then'](_0x417410,_0x7fb333);}_0x4cbccb((_0x77b2e6=_0x77b2e6['apply'](_0x51da42,_0x131116||[]))['next']());});};class ApiKeyService{constructor(_0x1e3c54,_0x8ef509){this['tokenManager']=_0x1e3c54,this['fetch']=_0x8ef509;}['create'](_0x593e2f,_0x588c69,_0x8aa8ba){return __awaiter$2(this,void 0,void 0,function*(){const _0x17495b=yield this['tokenManager']['getOrRefreshTokens'](_0x8aa8ba);if(!_0x17495b['isSuccess'])return new FailedApiKeyResponse(_0x17495b['toProblem']());_0x8aa8ba=_0x17495b['toSuccess']();const _0x1b5956='ApiKey/Create',_0x23a328={'account_name':_0x593e2f,'name':_0x588c69};try{const _0x5b37db=yield this['fetch']['post'](_0x1b5956,_0x8aa8ba['access_token'],_0x23a328);if(_0x5b37db['status']>0xc7&&_0x5b37db['status']<0x12c){const _0x466da3=yield _0x5b37db['json']();return new SuccessfulApiKeyResponse(_0x466da3);}const _0x423da7=yield _0x5b37db['json']();return new FailedApiKeyResponse(_0x423da7);}catch(_0x23f0f9){if(_0x23f0f9 instanceof Error)return new FailedApiKeyResponse({'detail':_0x23f0f9['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x23f0f9;}});}}
10
+
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5e0757,_0x3c8ce0,_0x3d072d,_0x2877c8){function _0x4a402e(_0x53564c){return _0x53564c instanceof _0x3d072d?_0x53564c:new _0x3d072d(function(_0x5eb723){_0x5eb723(_0x53564c);});}return new(_0x3d072d||(_0x3d072d=Promise))(function(_0x2e1a62,_0x5e95f7){function _0x3d3da9(_0x1438b4){try{_0xc6b981(_0x2877c8['next'](_0x1438b4));}catch(_0x1d0224){_0x5e95f7(_0x1d0224);}}function _0x114c30(_0x204a18){try{_0xc6b981(_0x2877c8['throw'](_0x204a18));}catch(_0x3885f2){_0x5e95f7(_0x3885f2);}}function _0xc6b981(_0x4a62a5){_0x4a62a5['done']?_0x2e1a62(_0x4a62a5['value']):_0x4a402e(_0x4a62a5['value'])['then'](_0x3d3da9,_0x114c30);}_0xc6b981((_0x2877c8=_0x2877c8['apply'](_0x5e0757,_0x3c8ce0||[]))['next']());});};class ListService{constructor(_0x31195b,_0x3223f6){this['tokenManager']=_0x31195b,this['fetch']=_0x3223f6;}['add'](_0x18f358,_0x29ee43,_0x9da558){return __awaiter$1(this,void 0,void 0,function*(){const _0x398951=yield this['tokenManager']['getOrRefreshTokens'](_0x9da558);if(!_0x398951['isSuccess'])return new FailedAccountResponse(_0x398951['toProblem']());_0x9da558=_0x398951['toSuccess']();const _0xc97b90='List',_0xb94bca={'account_name':_0x18f358,'list_name':_0x29ee43};try{const _0x2dd70d=yield this['fetch']['post'](_0xc97b90,_0x9da558['access_token'],_0xb94bca);if(_0x2dd70d['status']>0xc7&&_0x2dd70d['status']<0x12c){const _0x4ddfb9=yield _0x2dd70d['json']();return new SuccessfulAccountResponse(_0x4ddfb9);}const _0x3adc14=yield _0x2dd70d['json']();return new FailedAccountResponse(_0x3adc14);}catch(_0x5a33cc){if(_0x5a33cc instanceof Error)return new FailedAccountResponse({'detail':_0x5a33cc['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5a33cc;}});}['remove'](_0x370b30,_0x5c6161,_0x4ce7f3){return __awaiter$1(this,void 0,void 0,function*(){const _0x264bcc=yield this['tokenManager']['getOrRefreshTokens'](_0x4ce7f3);if(!_0x264bcc['isSuccess'])return new FailedAccountResponse(_0x264bcc['toProblem']());_0x4ce7f3=_0x264bcc['toSuccess']();const _0x353b1e='List/'+_0x370b30+'/'+_0x5c6161,_0x1dfcc2=yield this['fetch']['delete'](_0x353b1e,_0x4ce7f3['access_token']);try{if(_0x1dfcc2['status']>0xc7&&_0x1dfcc2['status']<0x12c){const _0x4b9015=yield _0x1dfcc2['json']();return new SuccessfulAccountResponse(_0x4b9015);}const _0x587ff6=yield _0x1dfcc2['json']();return new FailedAccountResponse(_0x587ff6);}catch(_0x3c7314){if(_0x3c7314 instanceof Error)return new FailedAccountResponse({'detail':_0x3c7314['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3c7314;}});}}
12
+
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x369b4f,_0x5dc0bf,_0x3f6822,_0x31ca5e){function _0x200084(_0x4b9218){return _0x4b9218 instanceof _0x3f6822?_0x4b9218:new _0x3f6822(function(_0x445189){_0x445189(_0x4b9218);});}return new(_0x3f6822||(_0x3f6822=Promise))(function(_0x32d081,_0x504273){function _0x5bc432(_0x2eff04){try{_0x2b4be2(_0x31ca5e['next'](_0x2eff04));}catch(_0x4cd0e5){_0x504273(_0x4cd0e5);}}function _0x5e1489(_0x2af077){try{_0x2b4be2(_0x31ca5e['throw'](_0x2af077));}catch(_0xf19cee){_0x504273(_0xf19cee);}}function _0x2b4be2(_0x31ca81){_0x31ca81['done']?_0x32d081(_0x31ca81['value']):_0x200084(_0x31ca81['value'])['then'](_0x5bc432,_0x5e1489);}_0x2b4be2((_0x31ca5e=_0x31ca5e['apply'](_0x369b4f,_0x5dc0bf||[]))['next']());});};class TokenManager{constructor(_0x24ef69){this['authClient']=_0x24ef69;}['getOrRefreshTokens'](_0x5a28de){return __awaiter(this,void 0,void 0,function*(){if(Date['now']()<_0x5a28de['access_expires'])return new SuccessfulAuthResponse(_0x5a28de);if(Date['now']()>_0x5a28de['refresh_expires'])return yield this['authClient']['refresh'](_0x5a28de['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
14
+
15
+ class AdminClient{constructor(_0x221e31,_0x2c5098='https://admin.searchability.dev/'){var _0x269c06=new TokenManager(_0x221e31),_0xa2c5b6=new Fetch(_0x2c5098);this['Accounts']=new AccountService(_0x269c06,_0xa2c5b6),this['Lists']=new ListService(_0x269c06,_0xa2c5b6),this['ApiKeys']=new ApiKeyService(_0x269c06,_0xa2c5b6);}}
16
+
17
+ export { AdminClient as default };
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x414e3b,_0x2c6189,_0x471348,_0x3a9525){function _0x4c2be0(_0x3bfdbd){return _0x3bfdbd instanceof _0x471348?_0x3bfdbd:new _0x471348(function(_0x2b679b){_0x2b679b(_0x3bfdbd);});}return new(_0x471348||(_0x471348=Promise))(function(_0x5ee39b,_0x247078){function _0x470e0b(_0x4b0faf){try{_0x33dca6(_0x3a9525['next'](_0x4b0faf));}catch(_0x3aa045){_0x247078(_0x3aa045);}}function _0x4db0d6(_0x37b761){try{_0x33dca6(_0x3a9525['throw'](_0x37b761));}catch(_0x5f1f9f){_0x247078(_0x5f1f9f);}}function _0x33dca6(_0x156965){_0x156965['done']?_0x5ee39b(_0x156965['value']):_0x4c2be0(_0x156965['value'])['then'](_0x470e0b,_0x4db0d6);}_0x33dca6((_0x3a9525=_0x3a9525['apply'](_0x414e3b,_0x2c6189||[]))['next']());});};class Fetch{constructor(_0x702f5f){this['baseUri']=_0x702f5f,this['getUrl']=_0x53f15e=>{return _0x53f15e['startsWith']('/')&&(_0x53f15e=_0x53f15e['replace']('/','')),''+this['baseUri']+_0x53f15e;},!_0x702f5f['endsWith']('/')&&(_0x702f5f=_0x702f5f+'/');}['get'](_0x2ee506,_0x3a49cd){return __awaiter$4(this,void 0,void 0,function*(){const _0x2aa67c=this['getUrl'](_0x2ee506);return yield fetch(_0x2aa67c,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3a49cd}});});}['post'](_0x311f8d,_0x20a870,_0x51f24f){return __awaiter$4(this,void 0,void 0,function*(){const _0x367f8d=this['getUrl'](_0x311f8d);return yield fetch(_0x367f8d,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x20a870},'body':_0x51f24f?JSON['stringify'](_0x51f24f):null});});}['put'](_0x1ba2c8,_0x573e43,_0x5f3a8d){return __awaiter$4(this,void 0,void 0,function*(){const _0x5c14f9=this['getUrl'](_0x1ba2c8);return yield fetch(_0x5c14f9,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x573e43},'body':_0x5f3a8d?JSON['stringify'](_0x5f3a8d):null});});}['delete'](_0x3b586e,_0x159f63){return __awaiter$4(this,void 0,void 0,function*(){const _0x5b15ab=this['getUrl'](_0x3b586e);return yield fetch(_0x5b15ab,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x159f63}});});}}
3
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x360201,_0x8db91f,_0x1c1172,_0x191151){function _0x291c78(_0x42e2cd){return _0x42e2cd instanceof _0x1c1172?_0x42e2cd:new _0x1c1172(function(_0x5dcda7){_0x5dcda7(_0x42e2cd);});}return new(_0x1c1172||(_0x1c1172=Promise))(function(_0x41ca28,_0x3818ff){function _0x2238cd(_0x568128){try{_0x5f2100(_0x191151['next'](_0x568128));}catch(_0x42ad9c){_0x3818ff(_0x42ad9c);}}function _0x12f5d5(_0x41d640){try{_0x5f2100(_0x191151['throw'](_0x41d640));}catch(_0xe8cf79){_0x3818ff(_0xe8cf79);}}function _0x5f2100(_0x44cf5a){_0x44cf5a['done']?_0x41ca28(_0x44cf5a['value']):_0x291c78(_0x44cf5a['value'])['then'](_0x2238cd,_0x12f5d5);}_0x5f2100((_0x191151=_0x191151['apply'](_0x360201,_0x8db91f||[]))['next']());});};class Fetch{constructor(_0x385a43){this['baseUri']=_0x385a43,this['getUrl']=_0x5b0bfa=>{return _0x5b0bfa['startsWith']('/')&&(_0x5b0bfa=_0x5b0bfa['replace']('/','')),''+this['baseUri']+_0x5b0bfa;},!_0x385a43['endsWith']('/')&&(_0x385a43=_0x385a43+'/');}['get'](_0x10f44c,_0x16c3cc){return __awaiter$4(this,void 0,void 0,function*(){const _0x342ee7=this['getUrl'](_0x10f44c);return yield fetch(_0x342ee7,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x16c3cc}});});}['post'](_0x221f05,_0x1bbe47,_0x3e3176){return __awaiter$4(this,void 0,void 0,function*(){const _0x57050d=this['getUrl'](_0x221f05);return yield fetch(_0x57050d,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1bbe47},'body':_0x3e3176?JSON['stringify'](_0x3e3176):null});});}['put'](_0x508bdd,_0x5352e1,_0x53d103){return __awaiter$4(this,void 0,void 0,function*(){const _0x319d7c=this['getUrl'](_0x508bdd);return yield fetch(_0x319d7c,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5352e1},'body':_0x53d103?JSON['stringify'](_0x53d103):null});});}['delete'](_0xf649f5,_0x334692){return __awaiter$4(this,void 0,void 0,function*(){const _0x152604=this['getUrl'](_0xf649f5);return yield fetch(_0x152604,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x334692}});});}}
4
4
 
5
- undefined&&undefined['__awaiter']||function(_0x498c12,_0x2ff5da,_0x53b644,_0x582909){function _0x167528(_0x13892c){return _0x13892c instanceof _0x53b644?_0x13892c:new _0x53b644(function(_0x9d887){_0x9d887(_0x13892c);});}return new(_0x53b644||(_0x53b644=Promise))(function(_0x1ee67d,_0x427b20){function _0x16e386(_0x47051b){try{_0x4790b8(_0x582909['next'](_0x47051b));}catch(_0x59fc49){_0x427b20(_0x59fc49);}}function _0x37ce8c(_0x23ab8f){try{_0x4790b8(_0x582909['throw'](_0x23ab8f));}catch(_0x18f662){_0x427b20(_0x18f662);}}function _0x4790b8(_0x39392d){_0x39392d['done']?_0x1ee67d(_0x39392d['value']):_0x167528(_0x39392d['value'])['then'](_0x16e386,_0x37ce8c);}_0x4790b8((_0x582909=_0x582909['apply'](_0x498c12,_0x2ff5da||[]))['next']());});};
5
+ undefined&&undefined['__awaiter']||function(_0x469a10,_0x44213b,_0x205add,_0x3235dd){function _0x3052bf(_0x28f402){return _0x28f402 instanceof _0x205add?_0x28f402:new _0x205add(function(_0x189fa9){_0x189fa9(_0x28f402);});}return new(_0x205add||(_0x205add=Promise))(function(_0x4093ba,_0x1996c4){function _0x2e715d(_0x959255){try{_0x2eead7(_0x3235dd['next'](_0x959255));}catch(_0x3fdb90){_0x1996c4(_0x3fdb90);}}function _0x350e88(_0x125af8){try{_0x2eead7(_0x3235dd['throw'](_0x125af8));}catch(_0x54beb0){_0x1996c4(_0x54beb0);}}function _0x2eead7(_0x14253e){_0x14253e['done']?_0x4093ba(_0x14253e['value']):_0x3052bf(_0x14253e['value'])['then'](_0x2e715d,_0x350e88);}_0x2eead7((_0x3235dd=_0x3235dd['apply'](_0x469a10,_0x44213b||[]))['next']());});};
6
6
 
7
- class Response{constructor(_0x4207a0){this['isSuccess']=_0x4207a0;}}class SuccessfulAccountResponse extends Response{constructor(_0x1ed12c){super(!![]),this['account']=_0x1ed12c;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x18a505){super(![]),this['problem']=_0x18a505;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x50b18e){super(!![]),this['tokens']=_0x50b18e;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulApiKeyResponse extends Response{constructor(_0x2f7507){super(!![]),this['apiKey']=_0x2f7507;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x19302d){super(![]),this['problem']=_0x19302d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
7
+ class Response{constructor(_0x523b80){this['isSuccess']=_0x523b80;}}class SuccessfulAccountResponse extends Response{constructor(_0x5345bf){super(!![]),this['account']=_0x5345bf;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2e5cb6){super(![]),this['problem']=_0x2e5cb6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x43aa15){super(!![]),this['tokens']=_0x43aa15;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x1ad294){super(![]),this['problem']=_0x1ad294;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x576fbb){super(!![]),this['apiKey']=_0x576fbb;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x34195b){super(![]),this['problem']=_0x34195b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
8
8
 
9
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0xd05870,_0x462616,_0x1afdb8,_0x135588){function _0xe44751(_0x46bde0){return _0x46bde0 instanceof _0x1afdb8?_0x46bde0:new _0x1afdb8(function(_0x1dd587){_0x1dd587(_0x46bde0);});}return new(_0x1afdb8||(_0x1afdb8=Promise))(function(_0x4c15e2,_0x10e909){function _0x37f668(_0x27a633){try{_0x1ba528(_0x135588['next'](_0x27a633));}catch(_0x3cff05){_0x10e909(_0x3cff05);}}function _0x533aaa(_0x33cf05){try{_0x1ba528(_0x135588['throw'](_0x33cf05));}catch(_0x5d338a){_0x10e909(_0x5d338a);}}function _0x1ba528(_0x24eb9e){_0x24eb9e['done']?_0x4c15e2(_0x24eb9e['value']):_0xe44751(_0x24eb9e['value'])['then'](_0x37f668,_0x533aaa);}_0x1ba528((_0x135588=_0x135588['apply'](_0xd05870,_0x462616||[]))['next']());});};class AccountService{constructor(_0x39b365,_0x28f7f0){this['tokenManager']=_0x39b365,this['fetch']=_0x28f7f0;}['get'](_0x3683b9){return __awaiter$3(this,arguments,void 0,function*(_0x1bdc83,_0x1044f5=undefined){const _0x1f49bc=yield this['tokenManager']['getOrRefreshTokens'](_0x1044f5);if(!_0x1f49bc['isSuccess'])return new FailedAccountResponse(_0x1f49bc['toProblem']());_0x1044f5=_0x1f49bc['toSuccess']();const _0x485cac='Account/'+_0x1bdc83+'/',_0xff4409=yield this['fetch']['get'](_0x485cac,_0x1044f5['access_token']);try{if(_0xff4409['status']>0xc7&&_0xff4409['status']<0x12c){const _0x4ab5df=yield _0xff4409['json']();return new SuccessfulAccountResponse(_0x4ab5df);}const _0x732b8d=yield _0xff4409['json']();return new FailedAccountResponse(_0x732b8d);}catch(_0x1ee629){if(_0x1ee629 instanceof Error)return new FailedAccountResponse({'detail':_0x1ee629['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1ee629;}});}}
9
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x55bad0,_0x502d5f,_0x2578ab,_0x231fde){function _0xb90d33(_0x53f6af){return _0x53f6af instanceof _0x2578ab?_0x53f6af:new _0x2578ab(function(_0x39133d){_0x39133d(_0x53f6af);});}return new(_0x2578ab||(_0x2578ab=Promise))(function(_0x24a620,_0x3c8c93){function _0x328172(_0xf9950a){try{_0x4d54f1(_0x231fde['next'](_0xf9950a));}catch(_0x30e5e8){_0x3c8c93(_0x30e5e8);}}function _0x346d13(_0x562ddd){try{_0x4d54f1(_0x231fde['throw'](_0x562ddd));}catch(_0x2c2181){_0x3c8c93(_0x2c2181);}}function _0x4d54f1(_0x3e034d){_0x3e034d['done']?_0x24a620(_0x3e034d['value']):_0xb90d33(_0x3e034d['value'])['then'](_0x328172,_0x346d13);}_0x4d54f1((_0x231fde=_0x231fde['apply'](_0x55bad0,_0x502d5f||[]))['next']());});};class AccountService{constructor(_0x1895b1,_0x22df74){this['tokenManager']=_0x1895b1,this['fetch']=_0x22df74;}['get'](_0x4978af,_0x16349a){return __awaiter$3(this,void 0,void 0,function*(){const _0x19d467=yield this['tokenManager']['getOrRefreshTokens'](_0x16349a);if(!_0x19d467['isSuccess'])return new FailedAccountResponse(_0x19d467['toProblem']());_0x16349a=_0x19d467['toSuccess']();const _0x3ffc31='Account/'+_0x4978af+'/',_0x5a37ad=yield this['fetch']['get'](_0x3ffc31,_0x16349a['access_token']);try{if(_0x5a37ad['status']>0xc7&&_0x5a37ad['status']<0x12c){const _0x2304c8=yield _0x5a37ad['json']();return new SuccessfulAccountResponse(_0x2304c8);}const _0x13a277=yield _0x5a37ad['json']();return new FailedAccountResponse(_0x13a277);}catch(_0x4b0948){if(_0x4b0948 instanceof Error)return new FailedAccountResponse({'detail':_0x4b0948['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4b0948;}});}}
10
10
 
11
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0xf3fe6,_0x522853,_0x1727e2,_0x18a6d8){function _0x53bf4f(_0x318cdd){return _0x318cdd instanceof _0x1727e2?_0x318cdd:new _0x1727e2(function(_0x3053b4){_0x3053b4(_0x318cdd);});}return new(_0x1727e2||(_0x1727e2=Promise))(function(_0x585ab8,_0x1f6212){function _0x500f24(_0x3d2538){try{_0x3ce18c(_0x18a6d8['next'](_0x3d2538));}catch(_0x3a3afd){_0x1f6212(_0x3a3afd);}}function _0x39661b(_0x1810b2){try{_0x3ce18c(_0x18a6d8['throw'](_0x1810b2));}catch(_0x21fe5b){_0x1f6212(_0x21fe5b);}}function _0x3ce18c(_0xa64772){_0xa64772['done']?_0x585ab8(_0xa64772['value']):_0x53bf4f(_0xa64772['value'])['then'](_0x500f24,_0x39661b);}_0x3ce18c((_0x18a6d8=_0x18a6d8['apply'](_0xf3fe6,_0x522853||[]))['next']());});};class ApiKeyService{constructor(_0x479d88,_0x21503e){this['tokenManager']=_0x479d88,this['fetch']=_0x21503e;}['create'](_0x452b7c,_0x3b892b,_0x325e98){return __awaiter$2(this,void 0,void 0,function*(){const _0x520a29=yield this['tokenManager']['getOrRefreshTokens'](_0x325e98);if(!_0x520a29['isSuccess'])return new FailedApiKeyResponse(_0x520a29['toProblem']());_0x325e98=_0x520a29['toSuccess']();const _0x593d51='ApiKey/Create',_0x5b29a0={'account_name':_0x452b7c,'name':_0x3b892b};try{const _0x51bcc7=yield this['fetch']['post'](_0x593d51,_0x325e98['access_token'],_0x5b29a0);if(_0x51bcc7['status']>0xc7&&_0x51bcc7['status']<0x12c){const _0x5e320d=yield _0x51bcc7['json']();return new SuccessfulApiKeyResponse(_0x5e320d);}const _0x4f217b=yield _0x51bcc7['json']();return new FailedApiKeyResponse(_0x4f217b);}catch(_0x356b0a){if(_0x356b0a instanceof Error)return new FailedApiKeyResponse({'detail':_0x356b0a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x356b0a;}});}}
11
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x101773,_0x258ad5,_0x4052de,_0x3e44ff){function _0x95cbf(_0x2a1339){return _0x2a1339 instanceof _0x4052de?_0x2a1339:new _0x4052de(function(_0x59ed31){_0x59ed31(_0x2a1339);});}return new(_0x4052de||(_0x4052de=Promise))(function(_0x563c05,_0x176d75){function _0x576892(_0x559406){try{_0x52ec57(_0x3e44ff['next'](_0x559406));}catch(_0x420b92){_0x176d75(_0x420b92);}}function _0x387f0e(_0x53cdcf){try{_0x52ec57(_0x3e44ff['throw'](_0x53cdcf));}catch(_0x3a6784){_0x176d75(_0x3a6784);}}function _0x52ec57(_0x2001b1){_0x2001b1['done']?_0x563c05(_0x2001b1['value']):_0x95cbf(_0x2001b1['value'])['then'](_0x576892,_0x387f0e);}_0x52ec57((_0x3e44ff=_0x3e44ff['apply'](_0x101773,_0x258ad5||[]))['next']());});};class ApiKeyService{constructor(_0x2d4aba,_0x43cd89){this['tokenManager']=_0x2d4aba,this['fetch']=_0x43cd89;}['create'](_0x316a40,_0x8ca3ad,_0x101253){return __awaiter$2(this,void 0,void 0,function*(){const _0x5dfa43=yield this['tokenManager']['getOrRefreshTokens'](_0x101253);if(!_0x5dfa43['isSuccess'])return new FailedApiKeyResponse(_0x5dfa43['toProblem']());_0x101253=_0x5dfa43['toSuccess']();const _0x42da92='ApiKey/Create',_0xaba211={'account_name':_0x316a40,'name':_0x8ca3ad};try{const _0x2f90eb=yield this['fetch']['post'](_0x42da92,_0x101253['access_token'],_0xaba211);if(_0x2f90eb['status']>0xc7&&_0x2f90eb['status']<0x12c){const _0x5bea00=yield _0x2f90eb['json']();return new SuccessfulApiKeyResponse(_0x5bea00);}const _0x3a1a3b=yield _0x2f90eb['json']();return new FailedApiKeyResponse(_0x3a1a3b);}catch(_0x45579f){if(_0x45579f instanceof Error)return new FailedApiKeyResponse({'detail':_0x45579f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x45579f;}});}}
12
12
 
13
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x115648,_0x1f61b3,_0x326669,_0x1c541b){function _0x2ab187(_0x5df156){return _0x5df156 instanceof _0x326669?_0x5df156:new _0x326669(function(_0x5db72f){_0x5db72f(_0x5df156);});}return new(_0x326669||(_0x326669=Promise))(function(_0x2907fa,_0xe0319a){function _0x4427c7(_0x27aec0){try{_0x5ceee6(_0x1c541b['next'](_0x27aec0));}catch(_0x3c57f9){_0xe0319a(_0x3c57f9);}}function _0x5b5bd1(_0x56aefa){try{_0x5ceee6(_0x1c541b['throw'](_0x56aefa));}catch(_0x2dc97e){_0xe0319a(_0x2dc97e);}}function _0x5ceee6(_0x4a265f){_0x4a265f['done']?_0x2907fa(_0x4a265f['value']):_0x2ab187(_0x4a265f['value'])['then'](_0x4427c7,_0x5b5bd1);}_0x5ceee6((_0x1c541b=_0x1c541b['apply'](_0x115648,_0x1f61b3||[]))['next']());});};class ListService{constructor(_0x5422a6,_0x5d34c2){this['tokenManager']=_0x5422a6,this['fetch']=_0x5d34c2;}['add'](_0x196430,_0x2e2b6e,_0x44b238){return __awaiter$1(this,void 0,void 0,function*(){const _0x401245=yield this['tokenManager']['getOrRefreshTokens'](_0x44b238);if(!_0x401245['isSuccess'])return new FailedAccountResponse(_0x401245['toProblem']());_0x44b238=_0x401245['toSuccess']();const _0x3c7713='List',_0x168bc9={'account_name':_0x196430,'list_name':_0x2e2b6e};try{const _0x276d16=yield this['fetch']['post'](_0x3c7713,_0x44b238['access_token'],_0x168bc9);if(_0x276d16['status']>0xc7&&_0x276d16['status']<0x12c){const _0x4c4a5b=yield _0x276d16['json']();return new SuccessfulAccountResponse(_0x4c4a5b);}const _0x4fb0be=yield _0x276d16['json']();return new FailedAccountResponse(_0x4fb0be);}catch(_0x5727d4){if(_0x5727d4 instanceof Error)return new FailedAccountResponse({'detail':_0x5727d4['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5727d4;}});}['remove'](_0x4fd02d,_0x1013f5,_0x483a7c){return __awaiter$1(this,void 0,void 0,function*(){const _0x351c87=yield this['tokenManager']['getOrRefreshTokens'](_0x483a7c);if(!_0x351c87['isSuccess'])return new FailedAccountResponse(_0x351c87['toProblem']());_0x483a7c=_0x351c87['toSuccess']();const _0x20ddaf='List/'+_0x4fd02d+'/'+_0x1013f5,_0x3ebc85=yield this['fetch']['delete'](_0x20ddaf,_0x483a7c['access_token']);try{if(_0x3ebc85['status']>0xc7&&_0x3ebc85['status']<0x12c){const _0x7e7beb=yield _0x3ebc85['json']();return new SuccessfulAccountResponse(_0x7e7beb);}const _0x129997=yield _0x3ebc85['json']();return new FailedAccountResponse(_0x129997);}catch(_0x1d5ab4){if(_0x1d5ab4 instanceof Error)return new FailedAccountResponse({'detail':_0x1d5ab4['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1d5ab4;}});}}
13
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2a4c38,_0x52692c,_0x5d729f,_0x143c00){function _0x970cbc(_0x34aa86){return _0x34aa86 instanceof _0x5d729f?_0x34aa86:new _0x5d729f(function(_0x5a45b8){_0x5a45b8(_0x34aa86);});}return new(_0x5d729f||(_0x5d729f=Promise))(function(_0x13f2c5,_0xa09ded){function _0x247409(_0x15dc70){try{_0x5e3a91(_0x143c00['next'](_0x15dc70));}catch(_0x4731d7){_0xa09ded(_0x4731d7);}}function _0x5d1b6e(_0x47c800){try{_0x5e3a91(_0x143c00['throw'](_0x47c800));}catch(_0x2bc3ee){_0xa09ded(_0x2bc3ee);}}function _0x5e3a91(_0x413a4){_0x413a4['done']?_0x13f2c5(_0x413a4['value']):_0x970cbc(_0x413a4['value'])['then'](_0x247409,_0x5d1b6e);}_0x5e3a91((_0x143c00=_0x143c00['apply'](_0x2a4c38,_0x52692c||[]))['next']());});};class ListService{constructor(_0x8e9c55,_0x47a807){this['tokenManager']=_0x8e9c55,this['fetch']=_0x47a807;}['add'](_0x4e811d,_0x46fb0a,_0x1b16ec){return __awaiter$1(this,void 0,void 0,function*(){const _0x2e8a19=yield this['tokenManager']['getOrRefreshTokens'](_0x1b16ec);if(!_0x2e8a19['isSuccess'])return new FailedAccountResponse(_0x2e8a19['toProblem']());_0x1b16ec=_0x2e8a19['toSuccess']();const _0x4d87a0='List',_0x1eb6a6={'account_name':_0x4e811d,'list_name':_0x46fb0a};try{const _0x17c4d0=yield this['fetch']['post'](_0x4d87a0,_0x1b16ec['access_token'],_0x1eb6a6);if(_0x17c4d0['status']>0xc7&&_0x17c4d0['status']<0x12c){const _0x277f20=yield _0x17c4d0['json']();return new SuccessfulAccountResponse(_0x277f20);}const _0x25da10=yield _0x17c4d0['json']();return new FailedAccountResponse(_0x25da10);}catch(_0x17e08f){if(_0x17e08f instanceof Error)return new FailedAccountResponse({'detail':_0x17e08f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x17e08f;}});}['remove'](_0x189cd0,_0x3a7ea5,_0x1f2271){return __awaiter$1(this,void 0,void 0,function*(){const _0x1f7949=yield this['tokenManager']['getOrRefreshTokens'](_0x1f2271);if(!_0x1f7949['isSuccess'])return new FailedAccountResponse(_0x1f7949['toProblem']());_0x1f2271=_0x1f7949['toSuccess']();const _0x11fde3='List/'+_0x189cd0+'/'+_0x3a7ea5,_0x56da4a=yield this['fetch']['delete'](_0x11fde3,_0x1f2271['access_token']);try{if(_0x56da4a['status']>0xc7&&_0x56da4a['status']<0x12c){const _0x47b2b8=yield _0x56da4a['json']();return new SuccessfulAccountResponse(_0x47b2b8);}const _0x51eacd=yield _0x56da4a['json']();return new FailedAccountResponse(_0x51eacd);}catch(_0x2d40ac){if(_0x2d40ac instanceof Error)return new FailedAccountResponse({'detail':_0x2d40ac['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2d40ac;}});}}
14
14
 
15
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x1fd8cc,_0x3578c4,_0x50b790,_0x3d9fad){function _0x205eaf(_0xa1af6c){return _0xa1af6c instanceof _0x50b790?_0xa1af6c:new _0x50b790(function(_0x33e8af){_0x33e8af(_0xa1af6c);});}return new(_0x50b790||(_0x50b790=Promise))(function(_0x4b22fd,_0x43251b){function _0x1ca094(_0x106dfb){try{_0x221909(_0x3d9fad['next'](_0x106dfb));}catch(_0x3528c3){_0x43251b(_0x3528c3);}}function _0x274de7(_0x22e6e0){try{_0x221909(_0x3d9fad['throw'](_0x22e6e0));}catch(_0x54cb0b){_0x43251b(_0x54cb0b);}}function _0x221909(_0x5116b6){_0x5116b6['done']?_0x4b22fd(_0x5116b6['value']):_0x205eaf(_0x5116b6['value'])['then'](_0x1ca094,_0x274de7);}_0x221909((_0x3d9fad=_0x3d9fad['apply'](_0x1fd8cc,_0x3578c4||[]))['next']());});};class TokenManager{constructor(_0x27c6c5){this['authClient']=_0x27c6c5;}['getOrRefreshTokens'](_0x100a4e){return __awaiter(this,void 0,void 0,function*(){if(!_0x100a4e)return this['authClient']['login']();if(Date['now']()<_0x100a4e['access_expires'])return new SuccessfulAuthResponse(_0x100a4e);if(Date['now']()>_0x100a4e['refresh_expires'])return yield this['authClient']['refresh'](_0x100a4e['refresh_token']);return this['authClient']['login']();});}}
15
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x240269,_0x323f68,_0x30ed02,_0x3518d7){function _0x26a787(_0x666dae){return _0x666dae instanceof _0x30ed02?_0x666dae:new _0x30ed02(function(_0x238582){_0x238582(_0x666dae);});}return new(_0x30ed02||(_0x30ed02=Promise))(function(_0x1da66f,_0x797d9d){function _0x2d4212(_0x31c2d5){try{_0x16162c(_0x3518d7['next'](_0x31c2d5));}catch(_0x56dbf8){_0x797d9d(_0x56dbf8);}}function _0x529892(_0x3ab8a0){try{_0x16162c(_0x3518d7['throw'](_0x3ab8a0));}catch(_0x46d3fd){_0x797d9d(_0x46d3fd);}}function _0x16162c(_0x542926){_0x542926['done']?_0x1da66f(_0x542926['value']):_0x26a787(_0x542926['value'])['then'](_0x2d4212,_0x529892);}_0x16162c((_0x3518d7=_0x3518d7['apply'](_0x240269,_0x323f68||[]))['next']());});};class TokenManager{constructor(_0x2d3358){this['authClient']=_0x2d3358;}['getOrRefreshTokens'](_0x2921e3){return __awaiter(this,void 0,void 0,function*(){if(Date['now']()<_0x2921e3['access_expires'])return new SuccessfulAuthResponse(_0x2921e3);if(Date['now']()>_0x2921e3['refresh_expires'])return yield this['authClient']['refresh'](_0x2921e3['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
16
16
 
17
- class AdminClient{constructor(_0x5c5712,_0x4e0104='https://admin.searchability.dev/'){var _0x31cd59=new TokenManager(_0x5c5712),_0x17881a=new Fetch(_0x4e0104);this['Accounts']=new AccountService(_0x31cd59,_0x17881a),this['Lists']=new ListService(_0x31cd59,_0x17881a),this['ApiKeys']=new ApiKeyService(_0x31cd59,_0x17881a);}}
17
+ class AdminClient{constructor(_0x2cff21,_0x38355f='https://admin.searchability.dev/'){var _0x20d1a5=new TokenManager(_0x2cff21),_0x17ef83=new Fetch(_0x38355f);this['Accounts']=new AccountService(_0x20d1a5,_0x17ef83),this['Lists']=new ListService(_0x20d1a5,_0x17ef83),this['ApiKeys']=new ApiKeyService(_0x20d1a5,_0x17ef83);}}
18
18
 
19
19
  module.exports = AdminClient;
@@ -1,17 +1,17 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x54a3ba,_0x6a08ac,_0x3a4cfa,_0x34240f){function _0x414419(_0x407379){return _0x407379 instanceof _0x3a4cfa?_0x407379:new _0x3a4cfa(function(_0xa94ef1){_0xa94ef1(_0x407379);});}return new(_0x3a4cfa||(_0x3a4cfa=Promise))(function(_0x507097,_0x314a38){function _0x5b82be(_0x2b6ec4){try{_0x46ddb6(_0x34240f['next'](_0x2b6ec4));}catch(_0x16ff8b){_0x314a38(_0x16ff8b);}}function _0xb46638(_0x5ddb7c){try{_0x46ddb6(_0x34240f['throw'](_0x5ddb7c));}catch(_0x45c90b){_0x314a38(_0x45c90b);}}function _0x46ddb6(_0x310c18){_0x310c18['done']?_0x507097(_0x310c18['value']):_0x414419(_0x310c18['value'])['then'](_0x5b82be,_0xb46638);}_0x46ddb6((_0x34240f=_0x34240f['apply'](_0x54a3ba,_0x6a08ac||[]))['next']());});};class Fetch{constructor(_0x3741e4){this['baseUri']=_0x3741e4,this['getUrl']=_0x126bad=>{return _0x126bad['startsWith']('/')&&(_0x126bad=_0x126bad['replace']('/','')),''+this['baseUri']+_0x126bad;},!_0x3741e4['endsWith']('/')&&(_0x3741e4=_0x3741e4+'/');}['get'](_0x32c494,_0x10f54b){return __awaiter$4(this,void 0,void 0,function*(){const _0x326eb8=this['getUrl'](_0x32c494);return yield fetch(_0x326eb8,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x10f54b}});});}['post'](_0x21aac1,_0x1b6124,_0x260392){return __awaiter$4(this,void 0,void 0,function*(){const _0x22ecfd=this['getUrl'](_0x21aac1);return yield fetch(_0x22ecfd,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1b6124},'body':_0x260392?JSON['stringify'](_0x260392):null});});}['put'](_0x58b953,_0x545c86,_0x44fd3e){return __awaiter$4(this,void 0,void 0,function*(){const _0xbdc5f=this['getUrl'](_0x58b953);return yield fetch(_0xbdc5f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x545c86},'body':_0x44fd3e?JSON['stringify'](_0x44fd3e):null});});}['delete'](_0x842269,_0x3bcca0){return __awaiter$4(this,void 0,void 0,function*(){const _0x49b368=this['getUrl'](_0x842269);return yield fetch(_0x49b368,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3bcca0}});});}}
1
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0xe8dd00,_0x4094b7,_0x4c7755,_0x52c64c){function _0xc08f35(_0x14adb3){return _0x14adb3 instanceof _0x4c7755?_0x14adb3:new _0x4c7755(function(_0x35d33c){_0x35d33c(_0x14adb3);});}return new(_0x4c7755||(_0x4c7755=Promise))(function(_0x51b491,_0x10a8b3){function _0x3d59ff(_0x5d23e5){try{_0x56013d(_0x52c64c['next'](_0x5d23e5));}catch(_0xac0276){_0x10a8b3(_0xac0276);}}function _0x39194d(_0x25c77d){try{_0x56013d(_0x52c64c['throw'](_0x25c77d));}catch(_0x3173d4){_0x10a8b3(_0x3173d4);}}function _0x56013d(_0x734016){_0x734016['done']?_0x51b491(_0x734016['value']):_0xc08f35(_0x734016['value'])['then'](_0x3d59ff,_0x39194d);}_0x56013d((_0x52c64c=_0x52c64c['apply'](_0xe8dd00,_0x4094b7||[]))['next']());});};class Fetch{constructor(_0x5c80ae){this['baseUri']=_0x5c80ae,this['getUrl']=_0xe73074=>{return _0xe73074['startsWith']('/')&&(_0xe73074=_0xe73074['replace']('/','')),''+this['baseUri']+_0xe73074;},!_0x5c80ae['endsWith']('/')&&(_0x5c80ae=_0x5c80ae+'/');}['get'](_0x2360b1,_0xf88b46){return __awaiter$4(this,void 0,void 0,function*(){const _0x29496d=this['getUrl'](_0x2360b1);return yield fetch(_0x29496d,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xf88b46}});});}['post'](_0x31adc1,_0x1941dd,_0x35c473){return __awaiter$4(this,void 0,void 0,function*(){const _0x1e27b8=this['getUrl'](_0x31adc1);return yield fetch(_0x1e27b8,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1941dd},'body':_0x35c473?JSON['stringify'](_0x35c473):null});});}['put'](_0x7073d2,_0x445c88,_0x417185){return __awaiter$4(this,void 0,void 0,function*(){const _0x132978=this['getUrl'](_0x7073d2);return yield fetch(_0x132978,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x445c88},'body':_0x417185?JSON['stringify'](_0x417185):null});});}['delete'](_0x24e98d,_0x2580dc){return __awaiter$4(this,void 0,void 0,function*(){const _0x4103c4=this['getUrl'](_0x24e98d);return yield fetch(_0x4103c4,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2580dc}});});}}
2
2
 
3
- undefined&&undefined['__awaiter']||function(_0x1dc762,_0x29bf73,_0x29768b,_0x3d6c8c){function _0x172b88(_0x16eb18){return _0x16eb18 instanceof _0x29768b?_0x16eb18:new _0x29768b(function(_0x46af5a){_0x46af5a(_0x16eb18);});}return new(_0x29768b||(_0x29768b=Promise))(function(_0x2bd3cc,_0x10b567){function _0x7c2b4b(_0x297a46){try{_0x2ab791(_0x3d6c8c['next'](_0x297a46));}catch(_0x2bca73){_0x10b567(_0x2bca73);}}function _0x147a68(_0x1a43d8){try{_0x2ab791(_0x3d6c8c['throw'](_0x1a43d8));}catch(_0x492a0a){_0x10b567(_0x492a0a);}}function _0x2ab791(_0x23351f){_0x23351f['done']?_0x2bd3cc(_0x23351f['value']):_0x172b88(_0x23351f['value'])['then'](_0x7c2b4b,_0x147a68);}_0x2ab791((_0x3d6c8c=_0x3d6c8c['apply'](_0x1dc762,_0x29bf73||[]))['next']());});};
3
+ undefined&&undefined['__awaiter']||function(_0x39dedc,_0x2183eb,_0xea053c,_0x540ad3){function _0x332c29(_0x1141e2){return _0x1141e2 instanceof _0xea053c?_0x1141e2:new _0xea053c(function(_0x4cee2a){_0x4cee2a(_0x1141e2);});}return new(_0xea053c||(_0xea053c=Promise))(function(_0xb10c39,_0x2659b2){function _0x1e826b(_0x2b680d){try{_0x2eb57b(_0x540ad3['next'](_0x2b680d));}catch(_0x1a9d89){_0x2659b2(_0x1a9d89);}}function _0x596442(_0x587d90){try{_0x2eb57b(_0x540ad3['throw'](_0x587d90));}catch(_0x10c8f7){_0x2659b2(_0x10c8f7);}}function _0x2eb57b(_0x41c128){_0x41c128['done']?_0xb10c39(_0x41c128['value']):_0x332c29(_0x41c128['value'])['then'](_0x1e826b,_0x596442);}_0x2eb57b((_0x540ad3=_0x540ad3['apply'](_0x39dedc,_0x2183eb||[]))['next']());});};
4
4
 
5
- class Response{constructor(_0x40fe64){this['isSuccess']=_0x40fe64;}}class SuccessfulAccountResponse extends Response{constructor(_0x1055bf){super(!![]),this['account']=_0x1055bf;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x5c2cd9){super(![]),this['problem']=_0x5c2cd9;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x3572c2){super(!![]),this['tokens']=_0x3572c2;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulApiKeyResponse extends Response{constructor(_0xa5284a){super(!![]),this['apiKey']=_0xa5284a;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x506510){super(![]),this['problem']=_0x506510;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
5
+ class Response{constructor(_0x17ca74){this['isSuccess']=_0x17ca74;}}class SuccessfulAccountResponse extends Response{constructor(_0x218ddb){super(!![]),this['account']=_0x218ddb;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x118cbe){super(![]),this['problem']=_0x118cbe;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x5457cb){super(!![]),this['tokens']=_0x5457cb;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x5d0942){super(![]),this['problem']=_0x5d0942;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x575b34){super(!![]),this['apiKey']=_0x575b34;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x5e6ea1){super(![]),this['problem']=_0x5e6ea1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
6
 
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x3ea6e5,_0x3fa476,_0x4ffc62,_0x4e4f27){function _0x441c73(_0x5de365){return _0x5de365 instanceof _0x4ffc62?_0x5de365:new _0x4ffc62(function(_0x40dd25){_0x40dd25(_0x5de365);});}return new(_0x4ffc62||(_0x4ffc62=Promise))(function(_0x14f6ab,_0xdfc493){function _0x1a9081(_0x5adfa3){try{_0x14b22b(_0x4e4f27['next'](_0x5adfa3));}catch(_0x2a4473){_0xdfc493(_0x2a4473);}}function _0x114b93(_0x7488d2){try{_0x14b22b(_0x4e4f27['throw'](_0x7488d2));}catch(_0x192a99){_0xdfc493(_0x192a99);}}function _0x14b22b(_0x5ce7e1){_0x5ce7e1['done']?_0x14f6ab(_0x5ce7e1['value']):_0x441c73(_0x5ce7e1['value'])['then'](_0x1a9081,_0x114b93);}_0x14b22b((_0x4e4f27=_0x4e4f27['apply'](_0x3ea6e5,_0x3fa476||[]))['next']());});};class AccountService{constructor(_0x35b8a8,_0x455b35){this['tokenManager']=_0x35b8a8,this['fetch']=_0x455b35;}['get'](_0x3e7c53){return __awaiter$3(this,arguments,void 0,function*(_0x8ce88e,_0x472094=undefined){const _0x39393a=yield this['tokenManager']['getOrRefreshTokens'](_0x472094);if(!_0x39393a['isSuccess'])return new FailedAccountResponse(_0x39393a['toProblem']());_0x472094=_0x39393a['toSuccess']();const _0x31346f='Account/'+_0x8ce88e+'/',_0x325ddb=yield this['fetch']['get'](_0x31346f,_0x472094['access_token']);try{if(_0x325ddb['status']>0xc7&&_0x325ddb['status']<0x12c){const _0x7517f3=yield _0x325ddb['json']();return new SuccessfulAccountResponse(_0x7517f3);}const _0x480eb8=yield _0x325ddb['json']();return new FailedAccountResponse(_0x480eb8);}catch(_0x19888a){if(_0x19888a instanceof Error)return new FailedAccountResponse({'detail':_0x19888a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x19888a;}});}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x3e15c5,_0x18a7f1,_0x27ef55,_0x112f2b){function _0x3feb03(_0x13d9a2){return _0x13d9a2 instanceof _0x27ef55?_0x13d9a2:new _0x27ef55(function(_0x4901d3){_0x4901d3(_0x13d9a2);});}return new(_0x27ef55||(_0x27ef55=Promise))(function(_0x4c78c2,_0x208869){function _0x4cf103(_0x5d42e0){try{_0x134a13(_0x112f2b['next'](_0x5d42e0));}catch(_0x14a121){_0x208869(_0x14a121);}}function _0x2ac7a0(_0x387afa){try{_0x134a13(_0x112f2b['throw'](_0x387afa));}catch(_0x351ecd){_0x208869(_0x351ecd);}}function _0x134a13(_0x13602c){_0x13602c['done']?_0x4c78c2(_0x13602c['value']):_0x3feb03(_0x13602c['value'])['then'](_0x4cf103,_0x2ac7a0);}_0x134a13((_0x112f2b=_0x112f2b['apply'](_0x3e15c5,_0x18a7f1||[]))['next']());});};class AccountService{constructor(_0x1986b1,_0x20d729){this['tokenManager']=_0x1986b1,this['fetch']=_0x20d729;}['get'](_0x48fe1b,_0x3c6069){return __awaiter$3(this,void 0,void 0,function*(){const _0x4a700d=yield this['tokenManager']['getOrRefreshTokens'](_0x3c6069);if(!_0x4a700d['isSuccess'])return new FailedAccountResponse(_0x4a700d['toProblem']());_0x3c6069=_0x4a700d['toSuccess']();const _0x333c7a='Account/'+_0x48fe1b+'/',_0x4a05a0=yield this['fetch']['get'](_0x333c7a,_0x3c6069['access_token']);try{if(_0x4a05a0['status']>0xc7&&_0x4a05a0['status']<0x12c){const _0x5d7840=yield _0x4a05a0['json']();return new SuccessfulAccountResponse(_0x5d7840);}const _0x106b19=yield _0x4a05a0['json']();return new FailedAccountResponse(_0x106b19);}catch(_0x2db68b){if(_0x2db68b instanceof Error)return new FailedAccountResponse({'detail':_0x2db68b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2db68b;}});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x40628e,_0x238e5b,_0x175b2c,_0x3930b9){function _0x640619(_0x149449){return _0x149449 instanceof _0x175b2c?_0x149449:new _0x175b2c(function(_0x5d14e6){_0x5d14e6(_0x149449);});}return new(_0x175b2c||(_0x175b2c=Promise))(function(_0xb65450,_0x3172b9){function _0x45b1c1(_0xfbfe0a){try{_0x3960d9(_0x3930b9['next'](_0xfbfe0a));}catch(_0x265388){_0x3172b9(_0x265388);}}function _0x16de14(_0x6e7dca){try{_0x3960d9(_0x3930b9['throw'](_0x6e7dca));}catch(_0x1315d2){_0x3172b9(_0x1315d2);}}function _0x3960d9(_0x5a3c30){_0x5a3c30['done']?_0xb65450(_0x5a3c30['value']):_0x640619(_0x5a3c30['value'])['then'](_0x45b1c1,_0x16de14);}_0x3960d9((_0x3930b9=_0x3930b9['apply'](_0x40628e,_0x238e5b||[]))['next']());});};class ApiKeyService{constructor(_0x1849a1,_0x5de876){this['tokenManager']=_0x1849a1,this['fetch']=_0x5de876;}['create'](_0x2367a1,_0x475fa9,_0xb02ed3){return __awaiter$2(this,void 0,void 0,function*(){const _0x3fb7aa=yield this['tokenManager']['getOrRefreshTokens'](_0xb02ed3);if(!_0x3fb7aa['isSuccess'])return new FailedApiKeyResponse(_0x3fb7aa['toProblem']());_0xb02ed3=_0x3fb7aa['toSuccess']();const _0x449c9d='ApiKey/Create',_0x352b44={'account_name':_0x2367a1,'name':_0x475fa9};try{const _0x39b701=yield this['fetch']['post'](_0x449c9d,_0xb02ed3['access_token'],_0x352b44);if(_0x39b701['status']>0xc7&&_0x39b701['status']<0x12c){const _0x4cd14a=yield _0x39b701['json']();return new SuccessfulApiKeyResponse(_0x4cd14a);}const _0x13a717=yield _0x39b701['json']();return new FailedApiKeyResponse(_0x13a717);}catch(_0x5dec1b){if(_0x5dec1b instanceof Error)return new FailedApiKeyResponse({'detail':_0x5dec1b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5dec1b;}});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4d46fb,_0x19f17d,_0x3a047b,_0x7b792b){function _0x3a1ed8(_0x52ce1a){return _0x52ce1a instanceof _0x3a047b?_0x52ce1a:new _0x3a047b(function(_0x1b218b){_0x1b218b(_0x52ce1a);});}return new(_0x3a047b||(_0x3a047b=Promise))(function(_0x221361,_0x3986e8){function _0x9395b2(_0x3e9f5c){try{_0x161579(_0x7b792b['next'](_0x3e9f5c));}catch(_0xc5aa00){_0x3986e8(_0xc5aa00);}}function _0x1c46cc(_0x5b01e4){try{_0x161579(_0x7b792b['throw'](_0x5b01e4));}catch(_0x491701){_0x3986e8(_0x491701);}}function _0x161579(_0x36f44e){_0x36f44e['done']?_0x221361(_0x36f44e['value']):_0x3a1ed8(_0x36f44e['value'])['then'](_0x9395b2,_0x1c46cc);}_0x161579((_0x7b792b=_0x7b792b['apply'](_0x4d46fb,_0x19f17d||[]))['next']());});};class ApiKeyService{constructor(_0x24a937,_0x489cfd){this['tokenManager']=_0x24a937,this['fetch']=_0x489cfd;}['create'](_0x3e7072,_0x2185c6,_0x488c4f){return __awaiter$2(this,void 0,void 0,function*(){const _0x3ac8cc=yield this['tokenManager']['getOrRefreshTokens'](_0x488c4f);if(!_0x3ac8cc['isSuccess'])return new FailedApiKeyResponse(_0x3ac8cc['toProblem']());_0x488c4f=_0x3ac8cc['toSuccess']();const _0x1d1a89='ApiKey/Create',_0x3f783f={'account_name':_0x3e7072,'name':_0x2185c6};try{const _0x364b40=yield this['fetch']['post'](_0x1d1a89,_0x488c4f['access_token'],_0x3f783f);if(_0x364b40['status']>0xc7&&_0x364b40['status']<0x12c){const _0x34efb4=yield _0x364b40['json']();return new SuccessfulApiKeyResponse(_0x34efb4);}const _0x280eee=yield _0x364b40['json']();return new FailedApiKeyResponse(_0x280eee);}catch(_0x1b1678){if(_0x1b1678 instanceof Error)return new FailedApiKeyResponse({'detail':_0x1b1678['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1b1678;}});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5954ab,_0x414fb6,_0x236374,_0x583c20){function _0x4ca750(_0x82a613){return _0x82a613 instanceof _0x236374?_0x82a613:new _0x236374(function(_0x399dff){_0x399dff(_0x82a613);});}return new(_0x236374||(_0x236374=Promise))(function(_0x443af2,_0x266e44){function _0x545ec8(_0x360b6f){try{_0xe20669(_0x583c20['next'](_0x360b6f));}catch(_0x2fc2aa){_0x266e44(_0x2fc2aa);}}function _0xe3b363(_0x180e7c){try{_0xe20669(_0x583c20['throw'](_0x180e7c));}catch(_0x5f15f5){_0x266e44(_0x5f15f5);}}function _0xe20669(_0x362e47){_0x362e47['done']?_0x443af2(_0x362e47['value']):_0x4ca750(_0x362e47['value'])['then'](_0x545ec8,_0xe3b363);}_0xe20669((_0x583c20=_0x583c20['apply'](_0x5954ab,_0x414fb6||[]))['next']());});};class ListService{constructor(_0x420fdc,_0x24091f){this['tokenManager']=_0x420fdc,this['fetch']=_0x24091f;}['add'](_0x5e6fed,_0xe4bf54,_0xd3f1d5){return __awaiter$1(this,void 0,void 0,function*(){const _0x776dda=yield this['tokenManager']['getOrRefreshTokens'](_0xd3f1d5);if(!_0x776dda['isSuccess'])return new FailedAccountResponse(_0x776dda['toProblem']());_0xd3f1d5=_0x776dda['toSuccess']();const _0x20150f='List',_0x5a3485={'account_name':_0x5e6fed,'list_name':_0xe4bf54};try{const _0x201402=yield this['fetch']['post'](_0x20150f,_0xd3f1d5['access_token'],_0x5a3485);if(_0x201402['status']>0xc7&&_0x201402['status']<0x12c){const _0xe4491f=yield _0x201402['json']();return new SuccessfulAccountResponse(_0xe4491f);}const _0x41be58=yield _0x201402['json']();return new FailedAccountResponse(_0x41be58);}catch(_0x2e7784){if(_0x2e7784 instanceof Error)return new FailedAccountResponse({'detail':_0x2e7784['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2e7784;}});}['remove'](_0x54c0ed,_0x1d3df4,_0x4a03fa){return __awaiter$1(this,void 0,void 0,function*(){const _0xd6ab0d=yield this['tokenManager']['getOrRefreshTokens'](_0x4a03fa);if(!_0xd6ab0d['isSuccess'])return new FailedAccountResponse(_0xd6ab0d['toProblem']());_0x4a03fa=_0xd6ab0d['toSuccess']();const _0x58b446='List/'+_0x54c0ed+'/'+_0x1d3df4,_0x1f26a0=yield this['fetch']['delete'](_0x58b446,_0x4a03fa['access_token']);try{if(_0x1f26a0['status']>0xc7&&_0x1f26a0['status']<0x12c){const _0x4f8b44=yield _0x1f26a0['json']();return new SuccessfulAccountResponse(_0x4f8b44);}const _0x1d37a7=yield _0x1f26a0['json']();return new FailedAccountResponse(_0x1d37a7);}catch(_0x44deff){if(_0x44deff instanceof Error)return new FailedAccountResponse({'detail':_0x44deff['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x44deff;}});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x51132b,_0x162984,_0x449b02,_0x15a919){function _0x21612d(_0x4e5f66){return _0x4e5f66 instanceof _0x449b02?_0x4e5f66:new _0x449b02(function(_0x46a5b8){_0x46a5b8(_0x4e5f66);});}return new(_0x449b02||(_0x449b02=Promise))(function(_0x3540d7,_0x1e27af){function _0x1e88b5(_0x422f9c){try{_0x2a626c(_0x15a919['next'](_0x422f9c));}catch(_0x1a2b54){_0x1e27af(_0x1a2b54);}}function _0x48efd9(_0x3ba3a7){try{_0x2a626c(_0x15a919['throw'](_0x3ba3a7));}catch(_0x2be45d){_0x1e27af(_0x2be45d);}}function _0x2a626c(_0x42d3e4){_0x42d3e4['done']?_0x3540d7(_0x42d3e4['value']):_0x21612d(_0x42d3e4['value'])['then'](_0x1e88b5,_0x48efd9);}_0x2a626c((_0x15a919=_0x15a919['apply'](_0x51132b,_0x162984||[]))['next']());});};class ListService{constructor(_0x1ba414,_0x2b8030){this['tokenManager']=_0x1ba414,this['fetch']=_0x2b8030;}['add'](_0x4f10d9,_0x5ab332,_0x1f6920){return __awaiter$1(this,void 0,void 0,function*(){const _0x30ad45=yield this['tokenManager']['getOrRefreshTokens'](_0x1f6920);if(!_0x30ad45['isSuccess'])return new FailedAccountResponse(_0x30ad45['toProblem']());_0x1f6920=_0x30ad45['toSuccess']();const _0x418845='List',_0x22835e={'account_name':_0x4f10d9,'list_name':_0x5ab332};try{const _0x23991c=yield this['fetch']['post'](_0x418845,_0x1f6920['access_token'],_0x22835e);if(_0x23991c['status']>0xc7&&_0x23991c['status']<0x12c){const _0xd02f2d=yield _0x23991c['json']();return new SuccessfulAccountResponse(_0xd02f2d);}const _0x42d7ae=yield _0x23991c['json']();return new FailedAccountResponse(_0x42d7ae);}catch(_0xf77691){if(_0xf77691 instanceof Error)return new FailedAccountResponse({'detail':_0xf77691['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xf77691;}});}['remove'](_0x4bf452,_0x5253eb,_0x20f387){return __awaiter$1(this,void 0,void 0,function*(){const _0x30422c=yield this['tokenManager']['getOrRefreshTokens'](_0x20f387);if(!_0x30422c['isSuccess'])return new FailedAccountResponse(_0x30422c['toProblem']());_0x20f387=_0x30422c['toSuccess']();const _0x4fbb70='List/'+_0x4bf452+'/'+_0x5253eb,_0x279c82=yield this['fetch']['delete'](_0x4fbb70,_0x20f387['access_token']);try{if(_0x279c82['status']>0xc7&&_0x279c82['status']<0x12c){const _0x259ad6=yield _0x279c82['json']();return new SuccessfulAccountResponse(_0x259ad6);}const _0x14a318=yield _0x279c82['json']();return new FailedAccountResponse(_0x14a318);}catch(_0x104c7f){if(_0x104c7f instanceof Error)return new FailedAccountResponse({'detail':_0x104c7f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x104c7f;}});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x13ef89,_0x507cd7,_0x50c0b6,_0x105c20){function _0x3aed88(_0x1f0de9){return _0x1f0de9 instanceof _0x50c0b6?_0x1f0de9:new _0x50c0b6(function(_0x18a446){_0x18a446(_0x1f0de9);});}return new(_0x50c0b6||(_0x50c0b6=Promise))(function(_0x264b48,_0x54c701){function _0x1088f6(_0x49f4d6){try{_0x33aac2(_0x105c20['next'](_0x49f4d6));}catch(_0x3753d3){_0x54c701(_0x3753d3);}}function _0x4095d6(_0x129f91){try{_0x33aac2(_0x105c20['throw'](_0x129f91));}catch(_0x338921){_0x54c701(_0x338921);}}function _0x33aac2(_0x3e2e5e){_0x3e2e5e['done']?_0x264b48(_0x3e2e5e['value']):_0x3aed88(_0x3e2e5e['value'])['then'](_0x1088f6,_0x4095d6);}_0x33aac2((_0x105c20=_0x105c20['apply'](_0x13ef89,_0x507cd7||[]))['next']());});};class TokenManager{constructor(_0x50d0d7){this['authClient']=_0x50d0d7;}['getOrRefreshTokens'](_0x4327e5){return __awaiter(this,void 0,void 0,function*(){if(!_0x4327e5)return this['authClient']['login']();if(Date['now']()<_0x4327e5['access_expires'])return new SuccessfulAuthResponse(_0x4327e5);if(Date['now']()>_0x4327e5['refresh_expires'])return yield this['authClient']['refresh'](_0x4327e5['refresh_token']);return this['authClient']['login']();});}}
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x2462b7,_0x326170,_0x43a3d3,_0x837eac){function _0x37322e(_0x4ad21f){return _0x4ad21f instanceof _0x43a3d3?_0x4ad21f:new _0x43a3d3(function(_0x5a96a6){_0x5a96a6(_0x4ad21f);});}return new(_0x43a3d3||(_0x43a3d3=Promise))(function(_0x2aa0a6,_0x3c6eb8){function _0x3d42de(_0x3e8cd6){try{_0x49b51e(_0x837eac['next'](_0x3e8cd6));}catch(_0x46a3b1){_0x3c6eb8(_0x46a3b1);}}function _0x59dea2(_0x19fec7){try{_0x49b51e(_0x837eac['throw'](_0x19fec7));}catch(_0x40f97c){_0x3c6eb8(_0x40f97c);}}function _0x49b51e(_0x3fc397){_0x3fc397['done']?_0x2aa0a6(_0x3fc397['value']):_0x37322e(_0x3fc397['value'])['then'](_0x3d42de,_0x59dea2);}_0x49b51e((_0x837eac=_0x837eac['apply'](_0x2462b7,_0x326170||[]))['next']());});};class TokenManager{constructor(_0x2304cd){this['authClient']=_0x2304cd;}['getOrRefreshTokens'](_0x194436){return __awaiter(this,void 0,void 0,function*(){if(Date['now']()<_0x194436['access_expires'])return new SuccessfulAuthResponse(_0x194436);if(Date['now']()>_0x194436['refresh_expires'])return yield this['authClient']['refresh'](_0x194436['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
14
14
 
15
- class AdminClient{constructor(_0x5bc243,_0x238952='https://admin.searchability.dev/'){var _0x4fd609=new TokenManager(_0x5bc243),_0x275619=new Fetch(_0x238952);this['Accounts']=new AccountService(_0x4fd609,_0x275619),this['Lists']=new ListService(_0x4fd609,_0x275619),this['ApiKeys']=new ApiKeyService(_0x4fd609,_0x275619);}}
15
+ class AdminClient{constructor(_0x488819,_0x3f07f7='https://admin.searchability.dev/'){var _0x3e6a16=new TokenManager(_0x488819),_0x1e27ce=new Fetch(_0x3f07f7);this['Accounts']=new AccountService(_0x3e6a16,_0x1e27ce),this['Lists']=new ListService(_0x3e6a16,_0x1e27ce),this['ApiKeys']=new ApiKeyService(_0x3e6a16,_0x1e27ce);}}
16
16
 
17
17
  export { AdminClient as default };
package/dist/types.d.ts CHANGED
@@ -9,39 +9,38 @@ declare class Fetch {
9
9
  }
10
10
 
11
11
  declare class AuthClient {
12
- readonly apiKey: string;
13
12
  readonly fetch: Fetch;
14
- constructor(apiKey: string, baseUri?: string);
15
- login(): Promise<Response<Tokens, Problem>>;
13
+ constructor(baseUri?: string);
14
+ login(apiKey: string): Promise<Response<Tokens, Problem>>;
16
15
  refresh(refreshToken: string): Promise<Response<Tokens, Problem>>;
17
16
  }
18
17
 
19
18
  declare class TokenManager {
20
19
  readonly authClient: AuthClient;
21
20
  constructor(authClient: AuthClient);
22
- getOrRefreshTokens(tokens: Tokens | undefined): Promise<Response<Tokens, Problem>>;
21
+ getOrRefreshTokens(tokens: Tokens): Promise<Response<Tokens, Problem>>;
23
22
  }
24
23
 
25
24
  declare class AccountService {
26
25
  readonly tokenManager: TokenManager;
27
26
  readonly fetch: Fetch;
28
27
  constructor(tokenManager: TokenManager, fetch: Fetch);
29
- get(accountName: string, tokens?: Tokens | undefined): Promise<Response<Account, Problem>>;
28
+ get(accountName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
30
29
  }
31
30
 
32
31
  declare class ApiKeyService {
33
32
  readonly tokenManager: TokenManager;
34
33
  readonly fetch: Fetch;
35
34
  constructor(tokenManager: TokenManager, fetch: Fetch);
36
- create(accountName: string, apiKeyName: string, tokens: Tokens | undefined): Promise<Response<ApiKey, Problem>>;
35
+ create(accountName: string, apiKeyName: string, tokens: Tokens): Promise<Response<ApiKey, Problem>>;
37
36
  }
38
37
 
39
38
  declare class ListService {
40
39
  readonly tokenManager: TokenManager;
41
40
  readonly fetch: Fetch;
42
41
  constructor(tokenManager: TokenManager, fetch: Fetch);
43
- add(accountName: string, listName: string, tokens: Tokens | undefined): Promise<Response<Account, Problem>>;
44
- remove(accountName: string, listName: string, tokens: Tokens | undefined): Promise<Response<Account, Problem>>;
42
+ add(accountName: string, listName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
43
+ remove(accountName: string, listName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
45
44
  }
46
45
 
47
46
  declare class AdminClient {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
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(_0x15082f,_0x336bbf,_0x35ee0a,_0x3414a0){function _0x38e6c0(_0x44fee0){return _0x44fee0 instanceof _0x35ee0a?_0x44fee0:new _0x35ee0a(function(_0x4c0a73){_0x4c0a73(_0x44fee0);});}return new(_0x35ee0a||(_0x35ee0a=Promise))(function(_0x48bbfb,_0x51c46a){function _0x397cda(_0x4b9fe8){try{_0x364410(_0x3414a0['next'](_0x4b9fe8));}catch(_0xc78ac3){_0x51c46a(_0xc78ac3);}}function _0x4a752c(_0x3666d9){try{_0x364410(_0x3414a0['throw'](_0x3666d9));}catch(_0xbdc8b6){_0x51c46a(_0xbdc8b6);}}function _0x364410(_0x43450d){_0x43450d['done']?_0x48bbfb(_0x43450d['value']):_0x38e6c0(_0x43450d['value'])['then'](_0x397cda,_0x4a752c);}_0x364410((_0x3414a0=_0x3414a0['apply'](_0x15082f,_0x336bbf||[]))['next']());});};class Fetch{constructor(_0x484e4b){this['baseUri']=_0x484e4b,this['getUrl']=_0x197c1b=>{return _0x197c1b['startsWith']('/')&&(_0x197c1b=_0x197c1b['replace']('/','')),''+this['baseUri']+_0x197c1b;},!_0x484e4b['endsWith']('/')&&(_0x484e4b=_0x484e4b+'/');}['get'](_0x38fba0,_0x3a46b6){return __awaiter$4(this,void 0,void 0,function*(){const _0x533463=this['getUrl'](_0x38fba0);return yield fetch(_0x533463,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3a46b6}});});}['post'](_0x181e73,_0x3d362a,_0x5c71bc){return __awaiter$4(this,void 0,void 0,function*(){const _0x1ba9b3=this['getUrl'](_0x181e73);return yield fetch(_0x1ba9b3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3d362a},'body':_0x5c71bc?JSON['stringify'](_0x5c71bc):null});});}['put'](_0x36de06,_0xb97608,_0x2e1cc6){return __awaiter$4(this,void 0,void 0,function*(){const _0x427529=this['getUrl'](_0x36de06);return yield fetch(_0x427529,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xb97608},'body':_0x2e1cc6?JSON['stringify'](_0x2e1cc6):null});});}['delete'](_0x1c9b58,_0xbd0d72){return __awaiter$4(this,void 0,void 0,function*(){const _0x59b6af=this['getUrl'](_0x1c9b58);return yield fetch(_0x59b6af,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xbd0d72}});});}}
2
-
3
- undefined&&undefined['__awaiter']||function(_0x252153,_0x5acfbe,_0x9d7cb1,_0x5174a3){function _0x3f6a26(_0x1724fc){return _0x1724fc instanceof _0x9d7cb1?_0x1724fc:new _0x9d7cb1(function(_0x33a81e){_0x33a81e(_0x1724fc);});}return new(_0x9d7cb1||(_0x9d7cb1=Promise))(function(_0x3b83f9,_0x22c48f){function _0x8508f3(_0xf098cb){try{_0x308df6(_0x5174a3['next'](_0xf098cb));}catch(_0x58d9ae){_0x22c48f(_0x58d9ae);}}function _0x5c24e8(_0x104658){try{_0x308df6(_0x5174a3['throw'](_0x104658));}catch(_0x97550){_0x22c48f(_0x97550);}}function _0x308df6(_0x29b9fc){_0x29b9fc['done']?_0x3b83f9(_0x29b9fc['value']):_0x3f6a26(_0x29b9fc['value'])['then'](_0x8508f3,_0x5c24e8);}_0x308df6((_0x5174a3=_0x5174a3['apply'](_0x252153,_0x5acfbe||[]))['next']());});};
4
-
5
- class Response{constructor(_0x580fa0){this['isSuccess']=_0x580fa0;}}class SuccessfulAccountResponse extends Response{constructor(_0x9e525f){super(!![]),this['account']=_0x9e525f;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0xd4154b){super(![]),this['problem']=_0xd4154b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x28ef39){super(!![]),this['tokens']=_0x28ef39;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulApiKeyResponse extends Response{constructor(_0x101bbb){super(!![]),this['apiKey']=_0x101bbb;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x41cf66){super(![]),this['problem']=_0x41cf66;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
-
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x5ba142,_0x34b341,_0xe547d0,_0x178cd9){function _0x40a5e2(_0x27d9e9){return _0x27d9e9 instanceof _0xe547d0?_0x27d9e9:new _0xe547d0(function(_0x3bc9c8){_0x3bc9c8(_0x27d9e9);});}return new(_0xe547d0||(_0xe547d0=Promise))(function(_0x132eb5,_0x888c42){function _0x2e7ac3(_0x2546c8){try{_0x5418cc(_0x178cd9['next'](_0x2546c8));}catch(_0x3aa182){_0x888c42(_0x3aa182);}}function _0x2c74cf(_0x1e0a80){try{_0x5418cc(_0x178cd9['throw'](_0x1e0a80));}catch(_0x50e228){_0x888c42(_0x50e228);}}function _0x5418cc(_0xf4e8d5){_0xf4e8d5['done']?_0x132eb5(_0xf4e8d5['value']):_0x40a5e2(_0xf4e8d5['value'])['then'](_0x2e7ac3,_0x2c74cf);}_0x5418cc((_0x178cd9=_0x178cd9['apply'](_0x5ba142,_0x34b341||[]))['next']());});};class AccountService{constructor(_0x322d10,_0x59dbb5){this['tokenManager']=_0x322d10,this['fetch']=_0x59dbb5;}['get'](_0x1f784c){return __awaiter$3(this,arguments,void 0,function*(_0x5c3364,_0x3e0ea5=undefined){const _0x5e80bb=yield this['tokenManager']['getOrRefreshTokens'](_0x3e0ea5);if(!_0x5e80bb['isSuccess'])return new FailedAccountResponse(_0x5e80bb['toProblem']());_0x3e0ea5=_0x5e80bb['toSuccess']();const _0x3226c5='Account/'+_0x5c3364+'/',_0x4bd6f8=yield this['fetch']['get'](_0x3226c5,_0x3e0ea5['access_token']);try{if(_0x4bd6f8['status']>0xc7&&_0x4bd6f8['status']<0x12c){const _0x34c563=yield _0x4bd6f8['json']();return new SuccessfulAccountResponse(_0x34c563);}const _0x1fa8a2=yield _0x4bd6f8['json']();return new FailedAccountResponse(_0x1fa8a2);}catch(_0x5bacd2){if(_0x5bacd2 instanceof Error)return new FailedAccountResponse({'detail':_0x5bacd2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5bacd2;}});}}
8
-
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x31a2e5,_0x28872c,_0x351dc0,_0x4636cf){function _0x51da1a(_0x44e7f7){return _0x44e7f7 instanceof _0x351dc0?_0x44e7f7:new _0x351dc0(function(_0x146feb){_0x146feb(_0x44e7f7);});}return new(_0x351dc0||(_0x351dc0=Promise))(function(_0x166067,_0x2d7086){function _0x128b1d(_0x276e8c){try{_0x38a387(_0x4636cf['next'](_0x276e8c));}catch(_0x350d55){_0x2d7086(_0x350d55);}}function _0x5c407c(_0x3cc574){try{_0x38a387(_0x4636cf['throw'](_0x3cc574));}catch(_0x7b94b5){_0x2d7086(_0x7b94b5);}}function _0x38a387(_0x3e0197){_0x3e0197['done']?_0x166067(_0x3e0197['value']):_0x51da1a(_0x3e0197['value'])['then'](_0x128b1d,_0x5c407c);}_0x38a387((_0x4636cf=_0x4636cf['apply'](_0x31a2e5,_0x28872c||[]))['next']());});};class ApiKeyService{constructor(_0x366161,_0x3a52ae){this['tokenManager']=_0x366161,this['fetch']=_0x3a52ae;}['create'](_0x1bef50,_0x439638,_0x2148a2){return __awaiter$2(this,void 0,void 0,function*(){const _0x164f0a=yield this['tokenManager']['getOrRefreshTokens'](_0x2148a2);if(!_0x164f0a['isSuccess'])return new FailedApiKeyResponse(_0x164f0a['toProblem']());_0x2148a2=_0x164f0a['toSuccess']();const _0x27260b='ApiKey/Create',_0x16a987={'account_name':_0x1bef50,'name':_0x439638};try{const _0x57efdc=yield this['fetch']['post'](_0x27260b,_0x2148a2['access_token'],_0x16a987);if(_0x57efdc['status']>0xc7&&_0x57efdc['status']<0x12c){const _0x755c86=yield _0x57efdc['json']();return new SuccessfulApiKeyResponse(_0x755c86);}const _0x570714=yield _0x57efdc['json']();return new FailedApiKeyResponse(_0x570714);}catch(_0x331e05){if(_0x331e05 instanceof Error)return new FailedApiKeyResponse({'detail':_0x331e05['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x331e05;}});}}
10
-
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2dc0a4,_0xe00b29,_0x50f7eb,_0x368d5d){function _0x4285b3(_0x43b4f8){return _0x43b4f8 instanceof _0x50f7eb?_0x43b4f8:new _0x50f7eb(function(_0x4b05f2){_0x4b05f2(_0x43b4f8);});}return new(_0x50f7eb||(_0x50f7eb=Promise))(function(_0x246088,_0x111a2e){function _0x3fde91(_0x3b9f1c){try{_0x170560(_0x368d5d['next'](_0x3b9f1c));}catch(_0x4dff87){_0x111a2e(_0x4dff87);}}function _0x1131a1(_0x2c1631){try{_0x170560(_0x368d5d['throw'](_0x2c1631));}catch(_0x42f152){_0x111a2e(_0x42f152);}}function _0x170560(_0xb8d01c){_0xb8d01c['done']?_0x246088(_0xb8d01c['value']):_0x4285b3(_0xb8d01c['value'])['then'](_0x3fde91,_0x1131a1);}_0x170560((_0x368d5d=_0x368d5d['apply'](_0x2dc0a4,_0xe00b29||[]))['next']());});};class ListService{constructor(_0x4b8c34,_0xd648a1){this['tokenManager']=_0x4b8c34,this['fetch']=_0xd648a1;}['add'](_0x5527e8,_0x46b53b,_0x330c2a){return __awaiter$1(this,void 0,void 0,function*(){const _0x3b7a5a=yield this['tokenManager']['getOrRefreshTokens'](_0x330c2a);if(!_0x3b7a5a['isSuccess'])return new FailedAccountResponse(_0x3b7a5a['toProblem']());_0x330c2a=_0x3b7a5a['toSuccess']();const _0x5cb2ce='List',_0x366d80={'account_name':_0x5527e8,'list_name':_0x46b53b};try{const _0x2b5eeb=yield this['fetch']['post'](_0x5cb2ce,_0x330c2a['access_token'],_0x366d80);if(_0x2b5eeb['status']>0xc7&&_0x2b5eeb['status']<0x12c){const _0x4884f7=yield _0x2b5eeb['json']();return new SuccessfulAccountResponse(_0x4884f7);}const _0x191f78=yield _0x2b5eeb['json']();return new FailedAccountResponse(_0x191f78);}catch(_0x4e9b1f){if(_0x4e9b1f instanceof Error)return new FailedAccountResponse({'detail':_0x4e9b1f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4e9b1f;}});}['remove'](_0x336fd9,_0x3f05b4,_0x470c93){return __awaiter$1(this,void 0,void 0,function*(){const _0x15f143=yield this['tokenManager']['getOrRefreshTokens'](_0x470c93);if(!_0x15f143['isSuccess'])return new FailedAccountResponse(_0x15f143['toProblem']());_0x470c93=_0x15f143['toSuccess']();const _0x45827d='List/'+_0x336fd9+'/'+_0x3f05b4,_0x5e5967=yield this['fetch']['delete'](_0x45827d,_0x470c93['access_token']);try{if(_0x5e5967['status']>0xc7&&_0x5e5967['status']<0x12c){const _0x4825ac=yield _0x5e5967['json']();return new SuccessfulAccountResponse(_0x4825ac);}const _0x39c873=yield _0x5e5967['json']();return new FailedAccountResponse(_0x39c873);}catch(_0x2f0c12){if(_0x2f0c12 instanceof Error)return new FailedAccountResponse({'detail':_0x2f0c12['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2f0c12;}});}}
12
-
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x43465f,_0xc6046b,_0x4484bc,_0x3df6bc){function _0x29e539(_0x2e24ab){return _0x2e24ab instanceof _0x4484bc?_0x2e24ab:new _0x4484bc(function(_0x27ba2d){_0x27ba2d(_0x2e24ab);});}return new(_0x4484bc||(_0x4484bc=Promise))(function(_0x393973,_0x754509){function _0x53f666(_0x2cd9af){try{_0x5641f8(_0x3df6bc['next'](_0x2cd9af));}catch(_0x1a9234){_0x754509(_0x1a9234);}}function _0x36df33(_0x17d7a6){try{_0x5641f8(_0x3df6bc['throw'](_0x17d7a6));}catch(_0x113409){_0x754509(_0x113409);}}function _0x5641f8(_0x567fe0){_0x567fe0['done']?_0x393973(_0x567fe0['value']):_0x29e539(_0x567fe0['value'])['then'](_0x53f666,_0x36df33);}_0x5641f8((_0x3df6bc=_0x3df6bc['apply'](_0x43465f,_0xc6046b||[]))['next']());});};class TokenManager{constructor(_0x38113f){this['authClient']=_0x38113f;}['getOrRefreshTokens'](_0x291a63){return __awaiter(this,void 0,void 0,function*(){if(!_0x291a63)return this['authClient']['login']();if(Date['now']()<_0x291a63['access_expires'])return new SuccessfulAuthResponse(_0x291a63);if(Date['now']()>_0x291a63['refresh_expires'])return yield this['authClient']['refresh'](_0x291a63['refresh_token']);return this['authClient']['login']();});}}
14
-
15
- class AdminClient{constructor(_0x47d7a1,_0x4ecc7a='https://admin.searchability.dev/'){var _0x4c902c=new TokenManager(_0x47d7a1),_0xe65f23=new Fetch(_0x4ecc7a);this['Accounts']=new AccountService(_0x4c902c,_0xe65f23),this['Lists']=new ListService(_0x4c902c,_0xe65f23),this['ApiKeys']=new ApiKeyService(_0x4c902c,_0xe65f23);}}
16
-
17
- export { AdminClient as default };