@searchability/admin-client 0.0.15 → 0.0.16

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(_0x3eff6d){this['isSuccess']=_0x3eff6d;}}class SuccessfulAccountResponse extends Response{constructor(_0xef5724){super(!![]),this['account']=_0xef5724;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x291bef){super(![]),this['problem']=_0x291bef;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x18d43a){super(!![]),this['tokens']=_0x18d43a;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x19314a){super(![]),this['problem']=_0x19314a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x29de01){super(!![]),this['apiKey']=_0x29de01;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x34cb72){super(![]),this['problem']=_0x34cb72;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
2
+
3
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x48154e,_0x2c0acc,_0xeea91,_0x188fef){function _0x374824(_0x116368){return _0x116368 instanceof _0xeea91?_0x116368:new _0xeea91(function(_0x449518){_0x449518(_0x116368);});}return new(_0xeea91||(_0xeea91=Promise))(function(_0x4d7057,_0x5ea4e8){function _0xce8cc9(_0x2f8357){try{_0xdac8d8(_0x188fef['next'](_0x2f8357));}catch(_0x1db9a5){_0x5ea4e8(_0x1db9a5);}}function _0x181110(_0x115185){try{_0xdac8d8(_0x188fef['throw'](_0x115185));}catch(_0x4dc9cd){_0x5ea4e8(_0x4dc9cd);}}function _0xdac8d8(_0x1a1879){_0x1a1879['done']?_0x4d7057(_0x1a1879['value']):_0x374824(_0x1a1879['value'])['then'](_0xce8cc9,_0x181110);}_0xdac8d8((_0x188fef=_0x188fef['apply'](_0x48154e,_0x2c0acc||[]))['next']());});};class AccountService{constructor(_0x580cda,_0x123ff7){this['tokenManager']=_0x580cda,this['fetch']=_0x123ff7;}['get'](_0x149609,_0x23b0d7){return __awaiter$5(this,void 0,void 0,function*(){const _0x4780b1=yield this['tokenManager']['getOrRefreshTokens'](_0x23b0d7);if(!_0x4780b1['isSuccess'])return new FailedAccountResponse(_0x4780b1['toProblem']());_0x23b0d7=_0x4780b1['toSuccess']();const _0x46f1d9='Account/'+_0x149609+'/',_0x56e12c=yield this['fetch']['get'](_0x46f1d9,_0x23b0d7['access_token']);try{if(_0x56e12c['status']>0xc7&&_0x56e12c['status']<0x12c){const _0x28e3eb=yield _0x56e12c['json']();return new SuccessfulAccountResponse(_0x28e3eb);}const _0x34bdee=yield _0x56e12c['json']();return new FailedAccountResponse(_0x34bdee);}catch(_0x5e19d8){if(_0x5e19d8 instanceof Error)return new FailedAccountResponse({'detail':_0x5e19d8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5e19d8;}});}}
4
+
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x343589,_0x382e91,_0x256a8e,_0x111236){function _0x527772(_0x3f340f){return _0x3f340f instanceof _0x256a8e?_0x3f340f:new _0x256a8e(function(_0x4b0d4c){_0x4b0d4c(_0x3f340f);});}return new(_0x256a8e||(_0x256a8e=Promise))(function(_0x58b614,_0x461f82){function _0x411ab(_0x3b4d9f){try{_0x140189(_0x111236['next'](_0x3b4d9f));}catch(_0x4b8b89){_0x461f82(_0x4b8b89);}}function _0xc41abd(_0x2323d1){try{_0x140189(_0x111236['throw'](_0x2323d1));}catch(_0x12bd36){_0x461f82(_0x12bd36);}}function _0x140189(_0x86bf43){_0x86bf43['done']?_0x58b614(_0x86bf43['value']):_0x527772(_0x86bf43['value'])['then'](_0x411ab,_0xc41abd);}_0x140189((_0x111236=_0x111236['apply'](_0x343589,_0x382e91||[]))['next']());});};class ApiKeyService{constructor(_0x870ed4,_0x2463f5){this['tokenManager']=_0x870ed4,this['fetch']=_0x2463f5;}['create'](_0xc135a1,_0x2fa8b2,_0x119286){return __awaiter$4(this,void 0,void 0,function*(){const _0x2d677c=yield this['tokenManager']['getOrRefreshTokens'](_0x119286);if(!_0x2d677c['isSuccess'])return new FailedApiKeyResponse(_0x2d677c['toProblem']());_0x119286=_0x2d677c['toSuccess']();const _0x29eb02='ApiKey/Create',_0x3edb4d={'account_name':_0xc135a1,'name':_0x2fa8b2};try{const _0x8ba201=yield this['fetch']['post'](_0x29eb02,_0x119286['access_token'],_0x3edb4d);if(_0x8ba201['status']>0xc7&&_0x8ba201['status']<0x12c){const _0x28f1ac=yield _0x8ba201['json']();return new SuccessfulApiKeyResponse(_0x28f1ac);}const _0x4f26cc=yield _0x8ba201['json']();return new FailedApiKeyResponse(_0x4f26cc);}catch(_0xc1f443){if(_0xc1f443 instanceof Error)return new FailedApiKeyResponse({'detail':_0xc1f443['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xc1f443;}});}}
6
+
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x193d5b,_0x32ed4e,_0x28b9ab,_0x4fadc3){function _0x2fc5c6(_0x1a5364){return _0x1a5364 instanceof _0x28b9ab?_0x1a5364:new _0x28b9ab(function(_0x13ac67){_0x13ac67(_0x1a5364);});}return new(_0x28b9ab||(_0x28b9ab=Promise))(function(_0x1b218d,_0x396190){function _0xafbb04(_0x4a261a){try{_0x5a5880(_0x4fadc3['next'](_0x4a261a));}catch(_0x10a75b){_0x396190(_0x10a75b);}}function _0x4903f7(_0x51adf5){try{_0x5a5880(_0x4fadc3['throw'](_0x51adf5));}catch(_0x4b775b){_0x396190(_0x4b775b);}}function _0x5a5880(_0x273934){_0x273934['done']?_0x1b218d(_0x273934['value']):_0x2fc5c6(_0x273934['value'])['then'](_0xafbb04,_0x4903f7);}_0x5a5880((_0x4fadc3=_0x4fadc3['apply'](_0x193d5b,_0x32ed4e||[]))['next']());});};class ListService{constructor(_0x40e70d,_0x5633d2){this['tokenManager']=_0x40e70d,this['fetch']=_0x5633d2;}['add'](_0x1a3fba,_0x53a1af,_0x5c2d70){return __awaiter$3(this,void 0,void 0,function*(){const _0x383aa2=yield this['tokenManager']['getOrRefreshTokens'](_0x5c2d70);if(!_0x383aa2['isSuccess'])return new FailedAccountResponse(_0x383aa2['toProblem']());_0x5c2d70=_0x383aa2['toSuccess']();const _0x4a20dc='List',_0x3b05e5={'account_name':_0x1a3fba,'list_name':_0x53a1af};try{const _0xf34477=yield this['fetch']['post'](_0x4a20dc,_0x5c2d70['access_token'],_0x3b05e5);if(_0xf34477['status']>0xc7&&_0xf34477['status']<0x12c){const _0x539f0a=yield _0xf34477['json']();return new SuccessfulAccountResponse(_0x539f0a);}const _0x5ad511=yield _0xf34477['json']();return new FailedAccountResponse(_0x5ad511);}catch(_0x4e7c03){if(_0x4e7c03 instanceof Error)return new FailedAccountResponse({'detail':_0x4e7c03['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4e7c03;}});}['remove'](_0x918bf7,_0x5da9f4,_0x5262c1){return __awaiter$3(this,void 0,void 0,function*(){const _0xc0da70=yield this['tokenManager']['getOrRefreshTokens'](_0x5262c1);if(!_0xc0da70['isSuccess'])return new FailedAccountResponse(_0xc0da70['toProblem']());_0x5262c1=_0xc0da70['toSuccess']();const _0x167081='List/'+_0x918bf7+'/'+_0x5da9f4,_0x366753=yield this['fetch']['delete'](_0x167081,_0x5262c1['access_token']);try{if(_0x366753['status']>0xc7&&_0x366753['status']<0x12c){const _0x3c44ff=yield _0x366753['json']();return new SuccessfulAccountResponse(_0x3c44ff);}const _0x22e6d0=yield _0x366753['json']();return new FailedAccountResponse(_0x22e6d0);}catch(_0x4df1c1){if(_0x4df1c1 instanceof Error)return new FailedAccountResponse({'detail':_0x4df1c1['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4df1c1;}});}}
8
+
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x16d1e1,_0x5f52b7,_0x5e69e7,_0x1eb91c){function _0x12dbd5(_0x243b65){return _0x243b65 instanceof _0x5e69e7?_0x243b65:new _0x5e69e7(function(_0x3a203a){_0x3a203a(_0x243b65);});}return new(_0x5e69e7||(_0x5e69e7=Promise))(function(_0x1e5a18,_0x45acec){function _0x3b5641(_0x19d911){try{_0x1cf3cf(_0x1eb91c['next'](_0x19d911));}catch(_0x331e58){_0x45acec(_0x331e58);}}function _0x17d88b(_0x3bc91a){try{_0x1cf3cf(_0x1eb91c['throw'](_0x3bc91a));}catch(_0x19803b){_0x45acec(_0x19803b);}}function _0x1cf3cf(_0x467935){_0x467935['done']?_0x1e5a18(_0x467935['value']):_0x12dbd5(_0x467935['value'])['then'](_0x3b5641,_0x17d88b);}_0x1cf3cf((_0x1eb91c=_0x1eb91c['apply'](_0x16d1e1,_0x5f52b7||[]))['next']());});};class TokenManager{constructor(_0x50df61){this['authClient']=_0x50df61;}['getOrRefreshTokens'](_0x10fa72){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0x10fa72['access_expires'])return new SuccessfulAuthResponse(_0x10fa72);if(Date['now']()>_0x10fa72['refresh_expires'])return yield this['authClient']['refresh'](_0x10fa72['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
10
+
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5a1794,_0x4ec20a,_0xe5677a,_0x57aa9c){function _0x620747(_0x31c181){return _0x31c181 instanceof _0xe5677a?_0x31c181:new _0xe5677a(function(_0x50b2c1){_0x50b2c1(_0x31c181);});}return new(_0xe5677a||(_0xe5677a=Promise))(function(_0xded1d2,_0xe506e1){function _0x4d8089(_0x5ab860){try{_0x254b41(_0x57aa9c['next'](_0x5ab860));}catch(_0x312e0f){_0xe506e1(_0x312e0f);}}function _0x4fe5b8(_0x29a55b){try{_0x254b41(_0x57aa9c['throw'](_0x29a55b));}catch(_0x55f812){_0xe506e1(_0x55f812);}}function _0x254b41(_0x55fcc0){_0x55fcc0['done']?_0xded1d2(_0x55fcc0['value']):_0x620747(_0x55fcc0['value'])['then'](_0x4d8089,_0x4fe5b8);}_0x254b41((_0x57aa9c=_0x57aa9c['apply'](_0x5a1794,_0x4ec20a||[]))['next']());});};class Fetch{constructor(_0x52cf31){this['baseUri']=_0x52cf31,this['getUrl']=_0x3066ce=>{return _0x3066ce['startsWith']('/')&&(_0x3066ce=_0x3066ce['replace']('/','')),''+this['baseUri']+_0x3066ce;},!_0x52cf31['endsWith']('/')&&(_0x52cf31=_0x52cf31+'/');}['get'](_0x59c95e,_0x194707){return __awaiter$1(this,void 0,void 0,function*(){const _0x2f6957=this['getUrl'](_0x59c95e);return yield fetch(_0x2f6957,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x194707}});});}['post'](_0x3aa1ae,_0x1b08e4,_0x978588){return __awaiter$1(this,void 0,void 0,function*(){const _0x1f2334=this['getUrl'](_0x3aa1ae);return yield fetch(_0x1f2334,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1b08e4},'body':_0x978588?JSON['stringify'](_0x978588):null});});}['put'](_0xc6a10c,_0x25d0f7,_0x52b55e){return __awaiter$1(this,void 0,void 0,function*(){const _0x2bc9e2=this['getUrl'](_0xc6a10c);return yield fetch(_0x2bc9e2,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x25d0f7},'body':_0x52b55e?JSON['stringify'](_0x52b55e):null});});}['delete'](_0xf8a5ae,_0x4d89c0){return __awaiter$1(this,void 0,void 0,function*(){const _0x42615e=this['getUrl'](_0xf8a5ae);return yield fetch(_0x42615e,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4d89c0}});});}}
12
+
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x23551f,_0x4ee97c,_0x82a32b,_0x5ab364){function _0xba444b(_0x3640b6){return _0x3640b6 instanceof _0x82a32b?_0x3640b6:new _0x82a32b(function(_0x1b1746){_0x1b1746(_0x3640b6);});}return new(_0x82a32b||(_0x82a32b=Promise))(function(_0x3814ec,_0x644b7){function _0x477b3d(_0xa5f8d5){try{_0x30abb1(_0x5ab364['next'](_0xa5f8d5));}catch(_0x2a23d6){_0x644b7(_0x2a23d6);}}function _0x555dc9(_0x265317){try{_0x30abb1(_0x5ab364['throw'](_0x265317));}catch(_0x43d689){_0x644b7(_0x43d689);}}function _0x30abb1(_0x2c56d0){_0x2c56d0['done']?_0x3814ec(_0x2c56d0['value']):_0xba444b(_0x2c56d0['value'])['then'](_0x477b3d,_0x555dc9);}_0x30abb1((_0x5ab364=_0x5ab364['apply'](_0x23551f,_0x4ee97c||[]))['next']());});};class AdminClient{constructor(_0x514c2d,_0x3b5376='https://admin.searchability.dev/'){var _0x5b74d6=new TokenManager(_0x514c2d),_0xdf4dea=new Fetch(_0x3b5376);this['Accounts']=new AccountService(_0x5b74d6,_0xdf4dea),this['Lists']=new ListService(_0x5b74d6,_0xdf4dea),this['ApiKeys']=new ApiKeyService(_0x5b74d6,_0xdf4dea);}}class AuthClient{constructor(_0x9d6f08='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x9d6f08);}['login'](_0x1bc1cf){return __awaiter(this,void 0,void 0,function*(){var _0x5b379e='login/'+_0x1bc1cf;try{const _0x53c4ab=yield yield fetch(_0x5b379e);if(_0x53c4ab['status']>0xc7&&_0x53c4ab['status']<0x12c){const _0x237ddd=yield _0x53c4ab['json']();return new SuccessfulAuthResponse(_0x237ddd);}const _0x527fc3=yield _0x53c4ab['json']();return new FailedAuthResponse(_0x527fc3);}catch(_0x1c0a2d){if(_0x1c0a2d instanceof Error)return new FailedAuthResponse({'detail':_0x1c0a2d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1c0a2d;}});}['refresh'](_0x5f42ab){return __awaiter(this,void 0,void 0,function*(){var _0x12909='refresh';try{const _0x117679=yield this['fetch']['post'](_0x12909,_0x5f42ab,null);if(_0x117679['status']>0xc7&&_0x117679['status']<0x12c){const _0x410e3a=yield _0x117679['json']();return new SuccessfulAuthResponse(_0x410e3a);}const _0x1ecefb=yield _0x117679['json']();return new FailedAuthResponse(_0x1ecefb);}catch(_0x312d49){if(_0x312d49 instanceof Error)return new FailedAuthResponse({'detail':_0x312d49['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x312d49;}});}}
14
+
15
+ export { AdminClient, AuthClient };
@@ -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(_0x483b2a){this['isSuccess']=_0x483b2a;}}class SuccessfulAccountResponse extends Response{constructor(_0x359602){super(!![]),this['account']=_0x359602;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x57b0ad){super(![]),this['problem']=_0x57b0ad;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x4d8ea7){super(!![]),this['tokens']=_0x4d8ea7;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x11fb24){super(![]),this['problem']=_0x11fb24;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x10e474){super(!![]),this['apiKey']=_0x10e474;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x1b0f09){super(![]),this['problem']=_0x1b0f09;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
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(_0x102e2e,_0x7fbaf2,_0x1ababd,_0x2b058a){function _0x1776be(_0x234885){return _0x234885 instanceof _0x1ababd?_0x234885:new _0x1ababd(function(_0x1734fb){_0x1734fb(_0x234885);});}return new(_0x1ababd||(_0x1ababd=Promise))(function(_0x58f85d,_0x4bca37){function _0x8a7cc5(_0x384bf9){try{_0x2193ad(_0x2b058a['next'](_0x384bf9));}catch(_0xd8184a){_0x4bca37(_0xd8184a);}}function _0x4d1980(_0x54874a){try{_0x2193ad(_0x2b058a['throw'](_0x54874a));}catch(_0x48765f){_0x4bca37(_0x48765f);}}function _0x2193ad(_0x3d404d){_0x3d404d['done']?_0x58f85d(_0x3d404d['value']):_0x1776be(_0x3d404d['value'])['then'](_0x8a7cc5,_0x4d1980);}_0x2193ad((_0x2b058a=_0x2b058a['apply'](_0x102e2e,_0x7fbaf2||[]))['next']());});};class AccountService{constructor(_0x264609,_0x382bc7){this['tokenManager']=_0x264609,this['fetch']=_0x382bc7;}['get'](_0xbeda9f,_0x188320){return __awaiter$5(this,void 0,void 0,function*(){const _0x559a74=yield this['tokenManager']['getOrRefreshTokens'](_0x188320);if(!_0x559a74['isSuccess'])return new FailedAccountResponse(_0x559a74['toProblem']());_0x188320=_0x559a74['toSuccess']();const _0x500bd0='Account/'+_0xbeda9f+'/',_0x1a2763=yield this['fetch']['get'](_0x500bd0,_0x188320['access_token']);try{if(_0x1a2763['status']>0xc7&&_0x1a2763['status']<0x12c){const _0x1699e5=yield _0x1a2763['json']();return new SuccessfulAccountResponse(_0x1699e5);}const _0x4a60d6=yield _0x1a2763['json']();return new FailedAccountResponse(_0x4a60d6);}catch(_0x210731){if(_0x210731 instanceof Error)return new FailedAccountResponse({'detail':_0x210731['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x210731;}});}}
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(_0x2a690f,_0x3ee8af,_0x5fa35b,_0x41f1e7){function _0x5acfe0(_0x447519){return _0x447519 instanceof _0x5fa35b?_0x447519:new _0x5fa35b(function(_0x560672){_0x560672(_0x447519);});}return new(_0x5fa35b||(_0x5fa35b=Promise))(function(_0x314dec,_0x290882){function _0x45ce4a(_0x2dd66b){try{_0x8d54ae(_0x41f1e7['next'](_0x2dd66b));}catch(_0x13ecc3){_0x290882(_0x13ecc3);}}function _0x5c12ed(_0x23e832){try{_0x8d54ae(_0x41f1e7['throw'](_0x23e832));}catch(_0x2b4991){_0x290882(_0x2b4991);}}function _0x8d54ae(_0x3c7282){_0x3c7282['done']?_0x314dec(_0x3c7282['value']):_0x5acfe0(_0x3c7282['value'])['then'](_0x45ce4a,_0x5c12ed);}_0x8d54ae((_0x41f1e7=_0x41f1e7['apply'](_0x2a690f,_0x3ee8af||[]))['next']());});};class ApiKeyService{constructor(_0x3246be,_0x262f5d){this['tokenManager']=_0x3246be,this['fetch']=_0x262f5d;}['create'](_0x7404ff,_0x441724,_0x38cbb5){return __awaiter$4(this,void 0,void 0,function*(){const _0xbed44c=yield this['tokenManager']['getOrRefreshTokens'](_0x38cbb5);if(!_0xbed44c['isSuccess'])return new FailedApiKeyResponse(_0xbed44c['toProblem']());_0x38cbb5=_0xbed44c['toSuccess']();const _0x5153b1='ApiKey/Create',_0x3fbca9={'account_name':_0x7404ff,'name':_0x441724};try{const _0x14ce0a=yield this['fetch']['post'](_0x5153b1,_0x38cbb5['access_token'],_0x3fbca9);if(_0x14ce0a['status']>0xc7&&_0x14ce0a['status']<0x12c){const _0x266c21=yield _0x14ce0a['json']();return new SuccessfulApiKeyResponse(_0x266c21);}const _0x4738f5=yield _0x14ce0a['json']();return new FailedApiKeyResponse(_0x4738f5);}catch(_0x5692d9){if(_0x5692d9 instanceof Error)return new FailedApiKeyResponse({'detail':_0x5692d9['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5692d9;}});}}
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(_0x57ed8a,_0x25796d,_0x18f7af,_0x32e1b5){function _0x46e61e(_0x92ee95){return _0x92ee95 instanceof _0x18f7af?_0x92ee95:new _0x18f7af(function(_0x2629b6){_0x2629b6(_0x92ee95);});}return new(_0x18f7af||(_0x18f7af=Promise))(function(_0x331966,_0x20699c){function _0x3b5d32(_0x75d242){try{_0x414997(_0x32e1b5['next'](_0x75d242));}catch(_0x11b94a){_0x20699c(_0x11b94a);}}function _0x2d6d1f(_0x31b5c8){try{_0x414997(_0x32e1b5['throw'](_0x31b5c8));}catch(_0x55b757){_0x20699c(_0x55b757);}}function _0x414997(_0x420ff1){_0x420ff1['done']?_0x331966(_0x420ff1['value']):_0x46e61e(_0x420ff1['value'])['then'](_0x3b5d32,_0x2d6d1f);}_0x414997((_0x32e1b5=_0x32e1b5['apply'](_0x57ed8a,_0x25796d||[]))['next']());});};class ListService{constructor(_0x12eb8f,_0xecbd48){this['tokenManager']=_0x12eb8f,this['fetch']=_0xecbd48;}['add'](_0x897070,_0x4dca2c,_0x51d573){return __awaiter$3(this,void 0,void 0,function*(){const _0x1b4dda=yield this['tokenManager']['getOrRefreshTokens'](_0x51d573);if(!_0x1b4dda['isSuccess'])return new FailedAccountResponse(_0x1b4dda['toProblem']());_0x51d573=_0x1b4dda['toSuccess']();const _0x3d9350='List',_0x312a9e={'account_name':_0x897070,'list_name':_0x4dca2c};try{const _0x463e7f=yield this['fetch']['post'](_0x3d9350,_0x51d573['access_token'],_0x312a9e);if(_0x463e7f['status']>0xc7&&_0x463e7f['status']<0x12c){const _0x2e275a=yield _0x463e7f['json']();return new SuccessfulAccountResponse(_0x2e275a);}const _0x480f1c=yield _0x463e7f['json']();return new FailedAccountResponse(_0x480f1c);}catch(_0x361b8a){if(_0x361b8a instanceof Error)return new FailedAccountResponse({'detail':_0x361b8a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x361b8a;}});}['remove'](_0x3bc725,_0x54987c,_0x173ebe){return __awaiter$3(this,void 0,void 0,function*(){const _0xe15b45=yield this['tokenManager']['getOrRefreshTokens'](_0x173ebe);if(!_0xe15b45['isSuccess'])return new FailedAccountResponse(_0xe15b45['toProblem']());_0x173ebe=_0xe15b45['toSuccess']();const _0x5b10f7='List/'+_0x3bc725+'/'+_0x54987c,_0x26d56a=yield this['fetch']['delete'](_0x5b10f7,_0x173ebe['access_token']);try{if(_0x26d56a['status']>0xc7&&_0x26d56a['status']<0x12c){const _0x3f4660=yield _0x26d56a['json']();return new SuccessfulAccountResponse(_0x3f4660);}const _0x4ae422=yield _0x26d56a['json']();return new FailedAccountResponse(_0x4ae422);}catch(_0x24f327){if(_0x24f327 instanceof Error)return new FailedAccountResponse({'detail':_0x24f327['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x24f327;}});}}
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(_0x21bd20,_0x5eead8,_0x2860fa,_0x1fb93c){function _0x3e286c(_0x25bcb1){return _0x25bcb1 instanceof _0x2860fa?_0x25bcb1:new _0x2860fa(function(_0x527eb9){_0x527eb9(_0x25bcb1);});}return new(_0x2860fa||(_0x2860fa=Promise))(function(_0x332dbf,_0x23ffed){function _0x12d682(_0x110cc8){try{_0x38fb66(_0x1fb93c['next'](_0x110cc8));}catch(_0x58f206){_0x23ffed(_0x58f206);}}function _0x30fbdd(_0x7c7a14){try{_0x38fb66(_0x1fb93c['throw'](_0x7c7a14));}catch(_0x2b7e4a){_0x23ffed(_0x2b7e4a);}}function _0x38fb66(_0x4f2f4a){_0x4f2f4a['done']?_0x332dbf(_0x4f2f4a['value']):_0x3e286c(_0x4f2f4a['value'])['then'](_0x12d682,_0x30fbdd);}_0x38fb66((_0x1fb93c=_0x1fb93c['apply'](_0x21bd20,_0x5eead8||[]))['next']());});};class TokenManager{constructor(_0x541552){this['authClient']=_0x541552;}['getOrRefreshTokens'](_0x5df157){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0x5df157['access_expires'])return new SuccessfulAuthResponse(_0x5df157);if(Date['now']()>_0x5df157['refresh_expires'])return yield this['authClient']['refresh'](_0x5df157['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
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(_0x451fc0,_0x5aff56,_0x382d1c,_0x24b6d0){function _0x240c31(_0x50600e){return _0x50600e instanceof _0x382d1c?_0x50600e:new _0x382d1c(function(_0x254c5a){_0x254c5a(_0x50600e);});}return new(_0x382d1c||(_0x382d1c=Promise))(function(_0x36f09a,_0x27e6e4){function _0x211d86(_0x37bd14){try{_0x2d42a9(_0x24b6d0['next'](_0x37bd14));}catch(_0x41dbaa){_0x27e6e4(_0x41dbaa);}}function _0x567cc3(_0x240ac1){try{_0x2d42a9(_0x24b6d0['throw'](_0x240ac1));}catch(_0x29fe05){_0x27e6e4(_0x29fe05);}}function _0x2d42a9(_0x3a7f3e){_0x3a7f3e['done']?_0x36f09a(_0x3a7f3e['value']):_0x240c31(_0x3a7f3e['value'])['then'](_0x211d86,_0x567cc3);}_0x2d42a9((_0x24b6d0=_0x24b6d0['apply'](_0x451fc0,_0x5aff56||[]))['next']());});};class Fetch{constructor(_0x23f86a){this['baseUri']=_0x23f86a,this['getUrl']=_0xa63060=>{return _0xa63060['startsWith']('/')&&(_0xa63060=_0xa63060['replace']('/','')),''+this['baseUri']+_0xa63060;},!_0x23f86a['endsWith']('/')&&(_0x23f86a=_0x23f86a+'/');}['get'](_0xfe9631,_0x118335){return __awaiter$1(this,void 0,void 0,function*(){const _0x2cdeeb=this['getUrl'](_0xfe9631);return yield fetch(_0x2cdeeb,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x118335}});});}['post'](_0x1a1d40,_0x2e69cd,_0x1ff973){return __awaiter$1(this,void 0,void 0,function*(){const _0x55d4d3=this['getUrl'](_0x1a1d40);return yield fetch(_0x55d4d3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2e69cd},'body':_0x1ff973?JSON['stringify'](_0x1ff973):null});});}['put'](_0x2a5bc8,_0xac25c8,_0x202856){return __awaiter$1(this,void 0,void 0,function*(){const _0x1e4386=this['getUrl'](_0x2a5bc8);return yield fetch(_0x1e4386,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xac25c8},'body':_0x202856?JSON['stringify'](_0x202856):null});});}['delete'](_0x480130,_0x910a0b){return __awaiter$1(this,void 0,void 0,function*(){const _0x241501=this['getUrl'](_0x480130);return yield fetch(_0x241501,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x910a0b}});});}}
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(_0x53a92b,_0xf9ddf3,_0x40755d,_0x1fe7da){function _0xdeb0bf(_0x4813b2){return _0x4813b2 instanceof _0x40755d?_0x4813b2:new _0x40755d(function(_0x9c105e){_0x9c105e(_0x4813b2);});}return new(_0x40755d||(_0x40755d=Promise))(function(_0x19b708,_0x214f3d){function _0x5cf3bc(_0x18669b){try{_0x240463(_0x1fe7da['next'](_0x18669b));}catch(_0xb93b03){_0x214f3d(_0xb93b03);}}function _0x17c5cd(_0x3eb581){try{_0x240463(_0x1fe7da['throw'](_0x3eb581));}catch(_0x10e01c){_0x214f3d(_0x10e01c);}}function _0x240463(_0x5ec8ab){_0x5ec8ab['done']?_0x19b708(_0x5ec8ab['value']):_0xdeb0bf(_0x5ec8ab['value'])['then'](_0x5cf3bc,_0x17c5cd);}_0x240463((_0x1fe7da=_0x1fe7da['apply'](_0x53a92b,_0xf9ddf3||[]))['next']());});};class AdminClient{constructor(_0x3c2ad4,_0x3590ab='https://admin.searchability.dev/'){var _0x3d8743=new TokenManager(_0x3c2ad4),_0x78bde=new Fetch(_0x3590ab);this['Accounts']=new AccountService(_0x3d8743,_0x78bde),this['Lists']=new ListService(_0x3d8743,_0x78bde),this['ApiKeys']=new ApiKeyService(_0x3d8743,_0x78bde);}}class AuthClient{constructor(_0x1eae63='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x1eae63);}['login'](_0x94be26){return __awaiter(this,void 0,void 0,function*(){var _0x204f16='login/'+_0x94be26;try{const _0x45f086=yield yield fetch(_0x204f16);if(_0x45f086['status']>0xc7&&_0x45f086['status']<0x12c){const _0x2fd5f6=yield _0x45f086['json']();return new SuccessfulAuthResponse(_0x2fd5f6);}const _0x27bc8b=yield _0x45f086['json']();return new FailedAuthResponse(_0x27bc8b);}catch(_0x4f19fd){if(_0x4f19fd instanceof Error)return new FailedAuthResponse({'detail':_0x4f19fd['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4f19fd;}});}['refresh'](_0x46b65e){return __awaiter(this,void 0,void 0,function*(){var _0x55721d='refresh';try{const _0x10e754=yield this['fetch']['post'](_0x55721d,_0x46b65e,null);if(_0x10e754['status']>0xc7&&_0x10e754['status']<0x12c){const _0x2c2af7=yield _0x10e754['json']();return new SuccessfulAuthResponse(_0x2c2af7);}const _0x1ed635=yield _0x10e754['json']();return new FailedAuthResponse(_0x1ed635);}catch(_0x4dff2b){if(_0x4dff2b instanceof Error)return new FailedAuthResponse({'detail':_0x4dff2b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4dff2b;}});}}
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(_0x255990){this['isSuccess']=_0x255990;}}class SuccessfulAccountResponse extends Response{constructor(_0xd018f8){super(!![]),this['account']=_0xd018f8;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2c9836){super(![]),this['problem']=_0x2c9836;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x5fcbbb){super(!![]),this['tokens']=_0x5fcbbb;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x57d77c){super(![]),this['problem']=_0x57d77c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x5e971c){super(!![]),this['apiKey']=_0x5e971c;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x4dcda1){super(![]),this['problem']=_0x4dcda1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
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(_0x4341b5,_0x15e4a5,_0xb8a193,_0x57421d){function _0x515eaa(_0x332da3){return _0x332da3 instanceof _0xb8a193?_0x332da3:new _0xb8a193(function(_0x3b5b11){_0x3b5b11(_0x332da3);});}return new(_0xb8a193||(_0xb8a193=Promise))(function(_0x433d6f,_0x3bbc51){function _0x3aeb5b(_0x598a03){try{_0x194a46(_0x57421d['next'](_0x598a03));}catch(_0x42a031){_0x3bbc51(_0x42a031);}}function _0x3a51e2(_0x37b0d9){try{_0x194a46(_0x57421d['throw'](_0x37b0d9));}catch(_0xf04724){_0x3bbc51(_0xf04724);}}function _0x194a46(_0x47e36b){_0x47e36b['done']?_0x433d6f(_0x47e36b['value']):_0x515eaa(_0x47e36b['value'])['then'](_0x3aeb5b,_0x3a51e2);}_0x194a46((_0x57421d=_0x57421d['apply'](_0x4341b5,_0x15e4a5||[]))['next']());});};class AccountService{constructor(_0xccec72,_0x2a9de1){this['tokenManager']=_0xccec72,this['fetch']=_0x2a9de1;}['get'](_0x53ba7e,_0x54d95a){return __awaiter$5(this,void 0,void 0,function*(){const _0xd36b93=yield this['tokenManager']['getOrRefreshTokens'](_0x54d95a);if(!_0xd36b93['isSuccess'])return new FailedAccountResponse(_0xd36b93['toProblem']());_0x54d95a=_0xd36b93['toSuccess']();const _0x4d534f='Account/'+_0x53ba7e+'/',_0x252389=yield this['fetch']['get'](_0x4d534f,_0x54d95a['access_token']);try{if(_0x252389['status']>0xc7&&_0x252389['status']<0x12c){const _0x24dcbd=yield _0x252389['json']();return new SuccessfulAccountResponse(_0x24dcbd);}const _0x3eb135=yield _0x252389['json']();return new FailedAccountResponse(_0x3eb135);}catch(_0x435847){if(_0x435847 instanceof Error)return new FailedAccountResponse({'detail':_0x435847['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x435847;}});}}
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(_0x32c201,_0x25d54e,_0x1e8875,_0x1fa38e){function _0x1364b2(_0x13598d){return _0x13598d instanceof _0x1e8875?_0x13598d:new _0x1e8875(function(_0x2457f6){_0x2457f6(_0x13598d);});}return new(_0x1e8875||(_0x1e8875=Promise))(function(_0x4aa9a9,_0x362168){function _0x2c5cc6(_0x3778be){try{_0x59cbf9(_0x1fa38e['next'](_0x3778be));}catch(_0x225334){_0x362168(_0x225334);}}function _0x29abf9(_0x353aeb){try{_0x59cbf9(_0x1fa38e['throw'](_0x353aeb));}catch(_0x3e3199){_0x362168(_0x3e3199);}}function _0x59cbf9(_0x2b464a){_0x2b464a['done']?_0x4aa9a9(_0x2b464a['value']):_0x1364b2(_0x2b464a['value'])['then'](_0x2c5cc6,_0x29abf9);}_0x59cbf9((_0x1fa38e=_0x1fa38e['apply'](_0x32c201,_0x25d54e||[]))['next']());});};class ApiKeyService{constructor(_0x6b1478,_0x46e2b1){this['tokenManager']=_0x6b1478,this['fetch']=_0x46e2b1;}['create'](_0x14013a,_0x47990b,_0x13c08a){return __awaiter$4(this,void 0,void 0,function*(){const _0x3bf43b=yield this['tokenManager']['getOrRefreshTokens'](_0x13c08a);if(!_0x3bf43b['isSuccess'])return new FailedApiKeyResponse(_0x3bf43b['toProblem']());_0x13c08a=_0x3bf43b['toSuccess']();const _0xa86a3d='ApiKey/Create',_0x289964={'account_name':_0x14013a,'name':_0x47990b};try{const _0x19fd5c=yield this['fetch']['post'](_0xa86a3d,_0x13c08a['access_token'],_0x289964);if(_0x19fd5c['status']>0xc7&&_0x19fd5c['status']<0x12c){const _0x50ec54=yield _0x19fd5c['json']();return new SuccessfulApiKeyResponse(_0x50ec54);}const _0x34f3c5=yield _0x19fd5c['json']();return new FailedApiKeyResponse(_0x34f3c5);}catch(_0x427ef6){if(_0x427ef6 instanceof Error)return new FailedApiKeyResponse({'detail':_0x427ef6['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x427ef6;}});}}
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(_0x515128,_0x50e496,_0x247767,_0x8dca76){function _0x5ea90d(_0x381a65){return _0x381a65 instanceof _0x247767?_0x381a65:new _0x247767(function(_0x442474){_0x442474(_0x381a65);});}return new(_0x247767||(_0x247767=Promise))(function(_0x125783,_0x2abe8d){function _0x388b4d(_0x3f3567){try{_0xa3a624(_0x8dca76['next'](_0x3f3567));}catch(_0x1c3d4c){_0x2abe8d(_0x1c3d4c);}}function _0x3e95bd(_0x47aceb){try{_0xa3a624(_0x8dca76['throw'](_0x47aceb));}catch(_0x428430){_0x2abe8d(_0x428430);}}function _0xa3a624(_0x410921){_0x410921['done']?_0x125783(_0x410921['value']):_0x5ea90d(_0x410921['value'])['then'](_0x388b4d,_0x3e95bd);}_0xa3a624((_0x8dca76=_0x8dca76['apply'](_0x515128,_0x50e496||[]))['next']());});};class ListService{constructor(_0x1fd804,_0x3c834c){this['tokenManager']=_0x1fd804,this['fetch']=_0x3c834c;}['add'](_0x42d069,_0x28235c,_0x5b16e4){return __awaiter$3(this,void 0,void 0,function*(){const _0x4f5ce5=yield this['tokenManager']['getOrRefreshTokens'](_0x5b16e4);if(!_0x4f5ce5['isSuccess'])return new FailedAccountResponse(_0x4f5ce5['toProblem']());_0x5b16e4=_0x4f5ce5['toSuccess']();const _0x2b94db='List',_0x1ff0e5={'account_name':_0x42d069,'list_name':_0x28235c};try{const _0x50ec2c=yield this['fetch']['post'](_0x2b94db,_0x5b16e4['access_token'],_0x1ff0e5);if(_0x50ec2c['status']>0xc7&&_0x50ec2c['status']<0x12c){const _0x1630ba=yield _0x50ec2c['json']();return new SuccessfulAccountResponse(_0x1630ba);}const _0x516d74=yield _0x50ec2c['json']();return new FailedAccountResponse(_0x516d74);}catch(_0x3e968c){if(_0x3e968c instanceof Error)return new FailedAccountResponse({'detail':_0x3e968c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3e968c;}});}['remove'](_0x37c055,_0x23738f,_0x59caa5){return __awaiter$3(this,void 0,void 0,function*(){const _0x34b652=yield this['tokenManager']['getOrRefreshTokens'](_0x59caa5);if(!_0x34b652['isSuccess'])return new FailedAccountResponse(_0x34b652['toProblem']());_0x59caa5=_0x34b652['toSuccess']();const _0x6d01f5='List/'+_0x37c055+'/'+_0x23738f,_0x348726=yield this['fetch']['delete'](_0x6d01f5,_0x59caa5['access_token']);try{if(_0x348726['status']>0xc7&&_0x348726['status']<0x12c){const _0x586251=yield _0x348726['json']();return new SuccessfulAccountResponse(_0x586251);}const _0x2b6333=yield _0x348726['json']();return new FailedAccountResponse(_0x2b6333);}catch(_0x66d79c){if(_0x66d79c instanceof Error)return new FailedAccountResponse({'detail':_0x66d79c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x66d79c;}});}}
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(_0x46cc9b,_0x50796d,_0x48ecff,_0x13e845){function _0x484d73(_0x2917c0){return _0x2917c0 instanceof _0x48ecff?_0x2917c0:new _0x48ecff(function(_0x22aa3a){_0x22aa3a(_0x2917c0);});}return new(_0x48ecff||(_0x48ecff=Promise))(function(_0x33e6ef,_0x477ffc){function _0x2c8ef6(_0x180bd7){try{_0xb162d9(_0x13e845['next'](_0x180bd7));}catch(_0x50712c){_0x477ffc(_0x50712c);}}function _0x18ce01(_0x56c04b){try{_0xb162d9(_0x13e845['throw'](_0x56c04b));}catch(_0x34a20c){_0x477ffc(_0x34a20c);}}function _0xb162d9(_0x45ea82){_0x45ea82['done']?_0x33e6ef(_0x45ea82['value']):_0x484d73(_0x45ea82['value'])['then'](_0x2c8ef6,_0x18ce01);}_0xb162d9((_0x13e845=_0x13e845['apply'](_0x46cc9b,_0x50796d||[]))['next']());});};class TokenManager{constructor(_0x52c976){this['authClient']=_0x52c976;}['getOrRefreshTokens'](_0x50361f){return __awaiter$2(this,void 0,void 0,function*(){if(Date['now']()<_0x50361f['access_expires'])return new SuccessfulAuthResponse(_0x50361f);if(Date['now']()>_0x50361f['refresh_expires'])return yield this['authClient']['refresh'](_0x50361f['refresh_token']);return new FailedAuthResponse({'detail':'Refresh\x20token\x20expired','title':'','status':0x194,'instance':'','type':''});});}}
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(_0xecd813,_0x47d2fd,_0x1a807c,_0x3c7684){function _0x2d66bf(_0xd0d90d){return _0xd0d90d instanceof _0x1a807c?_0xd0d90d:new _0x1a807c(function(_0x544de0){_0x544de0(_0xd0d90d);});}return new(_0x1a807c||(_0x1a807c=Promise))(function(_0x162520,_0x3034e6){function _0x24b2b4(_0x21495f){try{_0x309794(_0x3c7684['next'](_0x21495f));}catch(_0x2eb183){_0x3034e6(_0x2eb183);}}function _0x3ab56d(_0x58df80){try{_0x309794(_0x3c7684['throw'](_0x58df80));}catch(_0x2da922){_0x3034e6(_0x2da922);}}function _0x309794(_0x1b90b9){_0x1b90b9['done']?_0x162520(_0x1b90b9['value']):_0x2d66bf(_0x1b90b9['value'])['then'](_0x24b2b4,_0x3ab56d);}_0x309794((_0x3c7684=_0x3c7684['apply'](_0xecd813,_0x47d2fd||[]))['next']());});};class Fetch{constructor(_0x1cd52e){this['baseUri']=_0x1cd52e,this['getUrl']=_0x121d47=>{return _0x121d47['startsWith']('/')&&(_0x121d47=_0x121d47['replace']('/','')),''+this['baseUri']+_0x121d47;},!_0x1cd52e['endsWith']('/')&&(_0x1cd52e=_0x1cd52e+'/');}['get'](_0x5b3a24,_0x1d7ef9){return __awaiter$1(this,void 0,void 0,function*(){const _0x308003=this['getUrl'](_0x5b3a24);return yield fetch(_0x308003,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1d7ef9}});});}['post'](_0x5ec813,_0x334647,_0x2aab7e){return __awaiter$1(this,void 0,void 0,function*(){const _0x265435=this['getUrl'](_0x5ec813);return yield fetch(_0x265435,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x334647},'body':_0x2aab7e?JSON['stringify'](_0x2aab7e):null});});}['put'](_0x5850ef,_0x1911ce,_0x1c4c61){return __awaiter$1(this,void 0,void 0,function*(){const _0x47058f=this['getUrl'](_0x5850ef);return yield fetch(_0x47058f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1911ce},'body':_0x1c4c61?JSON['stringify'](_0x1c4c61):null});});}['delete'](_0x592c20,_0x12b6b6){return __awaiter$1(this,void 0,void 0,function*(){const _0x2b2fed=this['getUrl'](_0x592c20);return yield fetch(_0x2b2fed,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x12b6b6}});});}}
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(_0x359c09,_0x3a06fb,_0x1a06e4,_0x55b003){function _0x40d50d(_0x179c88){return _0x179c88 instanceof _0x1a06e4?_0x179c88:new _0x1a06e4(function(_0x4bda10){_0x4bda10(_0x179c88);});}return new(_0x1a06e4||(_0x1a06e4=Promise))(function(_0x4de546,_0x82de35){function _0x26d3bb(_0x1be43e){try{_0x22711e(_0x55b003['next'](_0x1be43e));}catch(_0x29e9c3){_0x82de35(_0x29e9c3);}}function _0x20aa2d(_0x42e862){try{_0x22711e(_0x55b003['throw'](_0x42e862));}catch(_0x44c1be){_0x82de35(_0x44c1be);}}function _0x22711e(_0x26d806){_0x26d806['done']?_0x4de546(_0x26d806['value']):_0x40d50d(_0x26d806['value'])['then'](_0x26d3bb,_0x20aa2d);}_0x22711e((_0x55b003=_0x55b003['apply'](_0x359c09,_0x3a06fb||[]))['next']());});};class AdminClient{constructor(_0x594c88,_0x36fd51='https://admin.searchability.dev/'){var _0x156342=new TokenManager(_0x594c88),_0x4a7e72=new Fetch(_0x36fd51);this['Accounts']=new AccountService(_0x156342,_0x4a7e72),this['Lists']=new ListService(_0x156342,_0x4a7e72),this['ApiKeys']=new ApiKeyService(_0x156342,_0x4a7e72);}}class AuthClient{constructor(_0xd78ba5='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0xd78ba5);}['login'](_0x55eac1){return __awaiter(this,void 0,void 0,function*(){var _0x3e0050='login/'+_0x55eac1;try{const _0x21933d=yield yield fetch(_0x3e0050);if(_0x21933d['status']>0xc7&&_0x21933d['status']<0x12c){const _0x591f04=yield _0x21933d['json']();return new SuccessfulAuthResponse(_0x591f04);}const _0x11cd04=yield _0x21933d['json']();return new FailedAuthResponse(_0x11cd04);}catch(_0x146b8f){if(_0x146b8f instanceof Error)return new FailedAuthResponse({'detail':_0x146b8f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x146b8f;}});}['refresh'](_0x1e8b8d){return __awaiter(this,void 0,void 0,function*(){var _0x984a74='refresh';try{const _0x214d19=yield this['fetch']['post'](_0x984a74,_0x1e8b8d,null);if(_0x214d19['status']>0xc7&&_0x214d19['status']<0x12c){const _0x13530b=yield _0x214d19['json']();return new SuccessfulAuthResponse(_0x13530b);}const _0x1e83c0=yield _0x214d19['json']();return new FailedAuthResponse(_0x1e83c0);}catch(_0x37a292){if(_0x37a292 instanceof Error)return new FailedAuthResponse({'detail':_0x37a292['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x37a292;}});}}
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
@@ -1,55 +1,3 @@
1
- declare class Fetch {
2
- readonly baseUri: string;
3
- constructor(baseUri: string);
4
- private getUrl;
5
- get(path: string, accessToken: string): Promise<globalThis.Response>;
6
- post(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
7
- put(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
8
- delete(path: string, accessToken: string): Promise<globalThis.Response>;
9
- }
10
-
11
- declare class 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
- declare class TokenManager {
19
- readonly authClient: AuthClient;
20
- constructor(authClient: AuthClient);
21
- getOrRefreshTokens(tokens: Tokens): Promise<Response<Tokens, Problem>>;
22
- }
23
-
24
- declare class AccountService {
25
- readonly tokenManager: TokenManager;
26
- readonly fetch: Fetch;
27
- constructor(tokenManager: TokenManager, fetch: Fetch);
28
- get(accountName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
29
- }
30
-
31
- declare class ApiKeyService {
32
- readonly tokenManager: TokenManager;
33
- readonly fetch: Fetch;
34
- constructor(tokenManager: TokenManager, fetch: Fetch);
35
- create(accountName: string, apiKeyName: string, tokens: Tokens): Promise<Response<ApiKey, Problem>>;
36
- }
37
-
38
- declare class ListService {
39
- readonly tokenManager: TokenManager;
40
- readonly fetch: Fetch;
41
- constructor(tokenManager: TokenManager, fetch: Fetch);
42
- add(accountName: string, listName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
43
- remove(accountName: string, listName: string, tokens: Tokens): Promise<Response<Account, Problem>>;
44
- }
45
-
46
- declare class AdminClient {
47
- constructor(authClient: AuthClient, baseUri?: string);
48
- readonly Accounts: AccountService;
49
- readonly Lists: ListService;
50
- readonly ApiKeys: ApiKeyService;
51
- }
52
-
53
1
  declare abstract class Response<S, F> {
54
2
  readonly isSuccess: boolean;
55
3
  constructor(isSuccess: boolean);
@@ -132,4 +80,4 @@ declare class FailedApiKeyResponse extends Response<ApiKey, Problem> {
132
80
  toProblem(): Problem;
133
81
  }
134
82
 
135
- export { type Account, AdminClient, type ApiKey, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, type Tokens };
83
+ export { type Account, type ApiKey, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulAuthResponse, type Tokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
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 };