@searchability/admin-client 0.0.32 → 0.0.34

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,13 @@
1
+ var TokenStatus;(function(_0x1fa570){_0x1fa570[_0x1fa570['Ok']=0x0]='Ok',_0x1fa570[_0x1fa570['Refresh']=0x1]='Refresh',_0x1fa570[_0x1fa570['Expired']=0x2]='Expired';}(TokenStatus||(TokenStatus={})));class Tokens{constructor(){this['access_token']='',this['access_expires']=0x0,this['refresh_token']='',this['refresh_expires']=0x0;}}class Response{constructor(_0x1b72e8){this['isSuccess']=_0x1b72e8;}}class SuccessfulAccountResponse extends Response{constructor(_0x2644dd){super(!![]),this['account']=_0x2644dd;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1c5a32){super(![]),this['problem']=_0x1c5a32;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x1e845d){super(!![]),this['tokens']=_0x1e845d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x5b283e){super(![]),this['problem']=_0x5b283e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x1a6546){super(!![]),this['apiKey']=_0x1a6546;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x26c630){super(![]),this['problem']=_0x26c630;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x31c3dd){super(!![]),this['apiKeyValue']=_0x31c3dd;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x32e0fd){super(!![]),this['obj']=_0x32e0fd;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x155586){super(![]),this['problem']=_0x155586;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x35a6a1){super(![]),this['problem']=_0x35a6a1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
2
+
3
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4dde19,_0x22c40b,_0x25efd7,_0x3737c8){function _0x28d033(_0x184d21){return _0x184d21 instanceof _0x25efd7?_0x184d21:new _0x25efd7(function(_0x18e6b9){_0x18e6b9(_0x184d21);});}return new(_0x25efd7||(_0x25efd7=Promise))(function(_0x523474,_0x346225){function _0x7ada70(_0x32a6f6){try{_0x232bee(_0x3737c8['next'](_0x32a6f6));}catch(_0x22a609){_0x346225(_0x22a609);}}function _0x15be6d(_0x44aa74){try{_0x232bee(_0x3737c8['throw'](_0x44aa74));}catch(_0x30555b){_0x346225(_0x30555b);}}function _0x232bee(_0x1161ab){_0x1161ab['done']?_0x523474(_0x1161ab['value']):_0x28d033(_0x1161ab['value'])['then'](_0x7ada70,_0x15be6d);}_0x232bee((_0x3737c8=_0x3737c8['apply'](_0x4dde19,_0x22c40b||[]))['next']());});};class AccountService{constructor(_0x2d4ec6){this['fetch']=_0x2d4ec6;}['get'](_0x549209,_0x3aa058){return __awaiter$4(this,void 0,void 0,function*(){const _0x249d5f='Account/'+_0x549209+'/',_0x325ae1=yield this['fetch']['get'](_0x249d5f,_0x3aa058);try{if(_0x325ae1['status']>0xc7&&_0x325ae1['status']<0x12c){const _0x5c6dbf=yield _0x325ae1['json']();return new SuccessfulAccountResponse(_0x5c6dbf);}const _0x3c0a52=yield _0x325ae1['json']();return new FailedAccountResponse(_0x3c0a52);}catch(_0x4fa46b){if(_0x4fa46b instanceof Error)return new FailedAccountResponse({'detail':_0x4fa46b['message'],'title':_0x4fa46b['name'],'status':0x1f4,'instance':'','type':''});throw _0x4fa46b;}});}}
4
+
5
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x33f13c,_0x566018,_0x545c0d,_0x29770e){function _0x4ae24b(_0x2495a7){return _0x2495a7 instanceof _0x545c0d?_0x2495a7:new _0x545c0d(function(_0x3515cb){_0x3515cb(_0x2495a7);});}return new(_0x545c0d||(_0x545c0d=Promise))(function(_0x415829,_0x58c714){function _0x12c4c6(_0x115574){try{_0x1f21a1(_0x29770e['next'](_0x115574));}catch(_0x495135){_0x58c714(_0x495135);}}function _0x194652(_0x58c26e){try{_0x1f21a1(_0x29770e['throw'](_0x58c26e));}catch(_0x26e83b){_0x58c714(_0x26e83b);}}function _0x1f21a1(_0x595e55){_0x595e55['done']?_0x415829(_0x595e55['value']):_0x4ae24b(_0x595e55['value'])['then'](_0x12c4c6,_0x194652);}_0x1f21a1((_0x29770e=_0x29770e['apply'](_0x33f13c,_0x566018||[]))['next']());});};class ApiKeyService{constructor(_0x2024f0){this['fetch']=_0x2024f0,this['path']='api-key';}['create'](_0x2898c2,_0x521c09,_0x20129a){return __awaiter$3(this,void 0,void 0,function*(){const _0xa46dd={'account_name':_0x2898c2,'api_key_name':_0x521c09};try{const _0x368b30=yield this['fetch']['post'](this['path'],_0x20129a,_0xa46dd);if(_0x368b30['status']>0xc7&&_0x368b30['status']<0x12c){const _0x4e01fc=yield _0x368b30['json']();return new SuccessfulApiKeyResponse(_0x4e01fc);}const _0x136477=yield _0x368b30['json']();return new FailedApiKeyResponse(_0x136477);}catch(_0x5f370e){if(_0x5f370e instanceof Error)return new FailedApiKeyResponse({'detail':_0x5f370e['message'],'title':_0x5f370e['name'],'status':0x1f4,'instance':'','type':''});throw _0x5f370e;}});}['view'](_0x1184e2,_0x2ffd6a,_0x257fe7){return __awaiter$3(this,void 0,void 0,function*(){const _0x9f413c=this['path']+'/'+_0x1184e2+'/'+_0x2ffd6a;try{const _0x6a5fcd=yield this['fetch']['get'](_0x9f413c,_0x257fe7);if(_0x6a5fcd['status']>0xc7&&_0x6a5fcd['status']<0x12c){const _0x37afe5=yield _0x6a5fcd['json']();return new SuccessfulApiKeyValueResponse(_0x37afe5);}const _0x48cae3=yield _0x6a5fcd['json']();return new FailedApiKeyValueResponse(_0x48cae3);}catch(_0x3dd893){if(_0x3dd893 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x3dd893['message'],'title':_0x3dd893['name'],'status':0x1f4,'instance':'','type':''});throw _0x3dd893;}});}['delete'](_0x73fe1b,_0x338e02,_0x3697ff){return __awaiter$3(this,void 0,void 0,function*(){const _0x24423a=this['path']+'/'+_0x73fe1b+'/'+_0x338e02;try{const _0xff981f=yield this['fetch']['delete'](_0x24423a,_0x3697ff);if(_0xff981f['status']>0xc7&&_0xff981f['status']<0x12c)return new SuccessfulResponse({});const _0x301133=yield _0xff981f['json']();return new FailedResponse(_0x301133);}catch(_0xe6cad3){if(_0xe6cad3 instanceof Error)return new FailedResponse({'detail':_0xe6cad3['message'],'title':_0xe6cad3['name'],'status':0x1f4,'instance':'','type':''});throw _0xe6cad3;}});}}
6
+
7
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x2221a6,_0x48be92,_0x9cd39d,_0x549cec){function _0x5090d1(_0x587852){return _0x587852 instanceof _0x9cd39d?_0x587852:new _0x9cd39d(function(_0x4b155f){_0x4b155f(_0x587852);});}return new(_0x9cd39d||(_0x9cd39d=Promise))(function(_0x20f185,_0x5c6788){function _0x12b7eb(_0x18d6ff){try{_0x18ac5d(_0x549cec['next'](_0x18d6ff));}catch(_0x8acff1){_0x5c6788(_0x8acff1);}}function _0x4fac32(_0x5af909){try{_0x18ac5d(_0x549cec['throw'](_0x5af909));}catch(_0x1802bf){_0x5c6788(_0x1802bf);}}function _0x18ac5d(_0x4548fa){_0x4548fa['done']?_0x20f185(_0x4548fa['value']):_0x5090d1(_0x4548fa['value'])['then'](_0x12b7eb,_0x4fac32);}_0x18ac5d((_0x549cec=_0x549cec['apply'](_0x2221a6,_0x48be92||[]))['next']());});};class ListService{constructor(_0x4d3856){this['fetch']=_0x4d3856;}['add'](_0x33f017,_0x35126d,_0x3f394c){return __awaiter$2(this,void 0,void 0,function*(){const _0x1a8ca8='List',_0x52e2c9={'account_name':_0x33f017,'list_name':_0x35126d};try{const _0x3e0867=yield this['fetch']['post'](_0x1a8ca8,_0x3f394c,_0x52e2c9);if(_0x3e0867['status']>0xc7&&_0x3e0867['status']<0x12c){const _0x595eb6=yield _0x3e0867['json']();return new SuccessfulAccountResponse(_0x595eb6);}const _0x5963d6=yield _0x3e0867['json']();return new FailedAccountResponse(_0x5963d6);}catch(_0x282546){if(_0x282546 instanceof Error)return new FailedAccountResponse({'detail':_0x282546['message'],'title':_0x282546['name'],'status':0x1f4,'instance':'','type':''});throw _0x282546;}});}['remove'](_0x28e7bb,_0x253c12,_0x207608){return __awaiter$2(this,void 0,void 0,function*(){const _0x212123='List/'+_0x28e7bb+'/'+_0x253c12,_0x55a041=yield this['fetch']['delete'](_0x212123,_0x207608);try{if(_0x55a041['status']>0xc7&&_0x55a041['status']<0x12c){const _0x159828=yield _0x55a041['json']();return new SuccessfulAccountResponse(_0x159828);}const _0x2c3d8d=yield _0x55a041['json']();return new FailedAccountResponse(_0x2c3d8d);}catch(_0x159044){if(_0x159044 instanceof Error)return new FailedAccountResponse({'detail':_0x159044['message'],'title':_0x159044['name'],'status':0x1f4,'instance':'','type':''});throw _0x159044;}});}}
8
+
9
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1ade3,_0x2245b8,_0x4fa39e,_0xe19001){function _0x26ab4f(_0x37bd36){return _0x37bd36 instanceof _0x4fa39e?_0x37bd36:new _0x4fa39e(function(_0x4f63d7){_0x4f63d7(_0x37bd36);});}return new(_0x4fa39e||(_0x4fa39e=Promise))(function(_0x37ad6f,_0x2fd3c6){function _0x4c11ea(_0x4904b7){try{_0x5c0731(_0xe19001['next'](_0x4904b7));}catch(_0x43b36b){_0x2fd3c6(_0x43b36b);}}function _0x4748fa(_0x3f1268){try{_0x5c0731(_0xe19001['throw'](_0x3f1268));}catch(_0x139155){_0x2fd3c6(_0x139155);}}function _0x5c0731(_0xca0298){_0xca0298['done']?_0x37ad6f(_0xca0298['value']):_0x26ab4f(_0xca0298['value'])['then'](_0x4c11ea,_0x4748fa);}_0x5c0731((_0xe19001=_0xe19001['apply'](_0x1ade3,_0x2245b8||[]))['next']());});};class Fetch{constructor(_0x41025b){this['baseUri']=_0x41025b,this['getUrl']=_0x1916ec=>{return _0x1916ec['startsWith']('/')&&(_0x1916ec=_0x1916ec['replace']('/','')),''+this['baseUri']+_0x1916ec;},!_0x41025b['endsWith']('/')&&(_0x41025b=_0x41025b+'/');}['get'](_0x55ddfb,_0x137860){return __awaiter$1(this,void 0,void 0,function*(){const _0x15b8c4=this['getUrl'](_0x55ddfb);return yield fetch(_0x15b8c4,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x137860}});});}['post'](_0xb20ca1,_0x38e353,_0x4262e4){return __awaiter$1(this,void 0,void 0,function*(){const _0x2be050=this['getUrl'](_0xb20ca1);return yield fetch(_0x2be050,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x38e353},'body':_0x4262e4?JSON['stringify'](_0x4262e4):null});});}['put'](_0x4e2857,_0x4cdc37,_0x565cdc){return __awaiter$1(this,void 0,void 0,function*(){const _0x400a1c=this['getUrl'](_0x4e2857);return yield fetch(_0x400a1c,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4cdc37},'body':_0x565cdc?JSON['stringify'](_0x565cdc):null});});}['delete'](_0x1d1a43,_0x33be86){return __awaiter$1(this,void 0,void 0,function*(){const _0x222f26=this['getUrl'](_0x1d1a43);return yield fetch(_0x222f26,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x33be86}});});}}
10
+
11
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x557af9,_0x40bb74,_0x96075b,_0x5ef64d){function _0x5dc0ca(_0x42535a){return _0x42535a instanceof _0x96075b?_0x42535a:new _0x96075b(function(_0xf4e430){_0xf4e430(_0x42535a);});}return new(_0x96075b||(_0x96075b=Promise))(function(_0x3a2f61,_0x438be8){function _0x1ab90c(_0x3ee85d){try{_0x12385b(_0x5ef64d['next'](_0x3ee85d));}catch(_0x58d550){_0x438be8(_0x58d550);}}function _0x19e842(_0x277497){try{_0x12385b(_0x5ef64d['throw'](_0x277497));}catch(_0x534c1c){_0x438be8(_0x534c1c);}}function _0x12385b(_0x29cbe0){_0x29cbe0['done']?_0x3a2f61(_0x29cbe0['value']):_0x5dc0ca(_0x29cbe0['value'])['then'](_0x1ab90c,_0x19e842);}_0x12385b((_0x5ef64d=_0x5ef64d['apply'](_0x557af9,_0x40bb74||[]))['next']());});};class AdminClient{constructor(_0x78c035='https://admin.searchability.dev/'){var _0x3910a7=new Fetch(_0x78c035);this['Accounts']=new AccountService(_0x3910a7),this['Lists']=new ListService(_0x3910a7),this['ApiKeys']=new ApiKeyService(_0x3910a7);}}class AuthClient{constructor(_0x29efbd='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x29efbd);}['login'](_0x4d29df){return __awaiter(this,void 0,void 0,function*(){var _0x270bc1='login/'+_0x4d29df;try{const _0x170899=yield yield fetch(_0x270bc1);if(_0x170899['status']>0xc7&&_0x170899['status']<0x12c){const _0x11a4a6=yield _0x170899['json']();return new SuccessfulAuthResponse(_0x11a4a6);}const _0x253ab1=yield _0x170899['json']();return new FailedAuthResponse(_0x253ab1);}catch(_0x4c2a82){if(_0x4c2a82 instanceof Error)return new FailedAuthResponse({'detail':_0x4c2a82['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4c2a82;}});}['refresh'](_0x3a8311){return __awaiter(this,void 0,void 0,function*(){var _0x12b2f2='refresh';try{const _0x203f2b=yield this['fetch']['post'](_0x12b2f2,_0x3a8311,null);if(_0x203f2b['status']>0xc7&&_0x203f2b['status']<0x12c){const _0x154b54=yield _0x203f2b['json']();return new SuccessfulAuthResponse(_0x154b54);}const _0x512cee=yield _0x203f2b['json']();return new FailedAuthResponse(_0x512cee);}catch(_0x17fc25){if(_0x17fc25 instanceof Error)return new FailedAuthResponse({'detail':_0x17fc25['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x17fc25;}});}['getTokenStatus'](_0x2c193d){if(Date['now']()<_0x2c193d['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x2c193d['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
12
+
13
+ export { AdminClient, AuthClient, TokenStatus, Tokens };
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- exports.TokenStatus = void 0;(function(_0x5872b0){_0x5872b0[_0x5872b0['Ok']=0x0]='Ok',_0x5872b0[_0x5872b0['Refresh']=0x1]='Refresh',_0x5872b0[_0x5872b0['Expired']=0x2]='Expired';}(exports.TokenStatus||(exports.TokenStatus={})));class Tokens{constructor(){this['access_token']='',this['access_expires']=0x0,this['refresh_token']='',this['refresh_expires']=0x0;}}class Response{constructor(_0x38e8d0){this['isSuccess']=_0x38e8d0;}}class SuccessfulAccountResponse extends Response{constructor(_0xc6586){super(!![]),this['account']=_0xc6586;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x4e8e97){super(![]),this['problem']=_0x4e8e97;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x12c212){super(!![]),this['tokens']=_0x12c212;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x1e7afc){super(![]),this['problem']=_0x1e7afc;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0xa2f21a){super(!![]),this['apiKey']=_0xa2f21a;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x388194){super(![]),this['problem']=_0x388194;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x41d625){super(!![]),this['apiKeyValue']=_0x41d625;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyValueResponse extends Response{constructor(_0x571896){super(![]),this['problem']=_0x571896;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
3
+ exports.TokenStatus = void 0;(function(_0x3dbff4){_0x3dbff4[_0x3dbff4['Ok']=0x0]='Ok',_0x3dbff4[_0x3dbff4['Refresh']=0x1]='Refresh',_0x3dbff4[_0x3dbff4['Expired']=0x2]='Expired';}(exports.TokenStatus||(exports.TokenStatus={})));class Tokens{constructor(){this['access_token']='',this['access_expires']=0x0,this['refresh_token']='',this['refresh_expires']=0x0;}}class Response{constructor(_0x4d2fc4){this['isSuccess']=_0x4d2fc4;}}class SuccessfulAccountResponse extends Response{constructor(_0x7dc9c0){super(!![]),this['account']=_0x7dc9c0;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0xf90dc0){super(![]),this['problem']=_0xf90dc0;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x1d6825){super(!![]),this['tokens']=_0x1d6825;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x1d32b1){super(![]),this['problem']=_0x1d32b1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x526950){super(!![]),this['apiKey']=_0x526950;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x2f01e8){super(![]),this['problem']=_0x2f01e8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x4c5e35){super(!![]),this['apiKeyValue']=_0x4c5e35;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x426185){super(!![]),this['obj']=_0x426185;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x40ac68){super(![]),this['problem']=_0x40ac68;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x589c68){super(![]),this['problem']=_0x589c68;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
4
 
5
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2fa8bf,_0x3ede50,_0x44c363,_0x402615){function _0x36255e(_0x566641){return _0x566641 instanceof _0x44c363?_0x566641:new _0x44c363(function(_0x241080){_0x241080(_0x566641);});}return new(_0x44c363||(_0x44c363=Promise))(function(_0x5345f7,_0x2c45f3){function _0x271709(_0x37915c){try{_0x1289e3(_0x402615['next'](_0x37915c));}catch(_0x506a36){_0x2c45f3(_0x506a36);}}function _0x1cfb67(_0x1910ac){try{_0x1289e3(_0x402615['throw'](_0x1910ac));}catch(_0x4415bf){_0x2c45f3(_0x4415bf);}}function _0x1289e3(_0x52c075){_0x52c075['done']?_0x5345f7(_0x52c075['value']):_0x36255e(_0x52c075['value'])['then'](_0x271709,_0x1cfb67);}_0x1289e3((_0x402615=_0x402615['apply'](_0x2fa8bf,_0x3ede50||[]))['next']());});};class AccountService{constructor(_0x4e25fd){this['fetch']=_0x4e25fd;}['get'](_0x1aa42a,_0x211dc4){return __awaiter$4(this,void 0,void 0,function*(){const _0x982225='Account/'+_0x1aa42a+'/',_0xbbddcb=yield this['fetch']['get'](_0x982225,_0x211dc4);try{if(_0xbbddcb['status']>0xc7&&_0xbbddcb['status']<0x12c){const _0x15e4a7=yield _0xbbddcb['json']();return new SuccessfulAccountResponse(_0x15e4a7);}const _0x3d313c=yield _0xbbddcb['json']();return new FailedAccountResponse(_0x3d313c);}catch(_0x880ddb){if(_0x880ddb instanceof Error)return new FailedAccountResponse({'detail':_0x880ddb['message'],'title':_0x880ddb['name'],'status':0x1f4,'instance':'','type':''});throw _0x880ddb;}});}}
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x36070c,_0x429e58,_0x4d9b2f,_0x534a78){function _0x3b9c72(_0x46e3b9){return _0x46e3b9 instanceof _0x4d9b2f?_0x46e3b9:new _0x4d9b2f(function(_0xbf4a91){_0xbf4a91(_0x46e3b9);});}return new(_0x4d9b2f||(_0x4d9b2f=Promise))(function(_0x1f31cd,_0x3425bd){function _0x4c1d10(_0x42e7be){try{_0x32fe2d(_0x534a78['next'](_0x42e7be));}catch(_0x33032a){_0x3425bd(_0x33032a);}}function _0x1835f1(_0x283f84){try{_0x32fe2d(_0x534a78['throw'](_0x283f84));}catch(_0x4bc75e){_0x3425bd(_0x4bc75e);}}function _0x32fe2d(_0x2c6459){_0x2c6459['done']?_0x1f31cd(_0x2c6459['value']):_0x3b9c72(_0x2c6459['value'])['then'](_0x4c1d10,_0x1835f1);}_0x32fe2d((_0x534a78=_0x534a78['apply'](_0x36070c,_0x429e58||[]))['next']());});};class AccountService{constructor(_0x2e23ec){this['fetch']=_0x2e23ec;}['get'](_0x4517e8,_0x15ee02){return __awaiter$4(this,void 0,void 0,function*(){const _0x3ca3ff='Account/'+_0x4517e8+'/',_0x568024=yield this['fetch']['get'](_0x3ca3ff,_0x15ee02);try{if(_0x568024['status']>0xc7&&_0x568024['status']<0x12c){const _0x346d3d=yield _0x568024['json']();return new SuccessfulAccountResponse(_0x346d3d);}const _0x2f6d9a=yield _0x568024['json']();return new FailedAccountResponse(_0x2f6d9a);}catch(_0x28191f){if(_0x28191f instanceof Error)return new FailedAccountResponse({'detail':_0x28191f['message'],'title':_0x28191f['name'],'status':0x1f4,'instance':'','type':''});throw _0x28191f;}});}}
6
6
 
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x4c1bec,_0x1e8b53,_0x3b0181,_0x41b43c){function _0x3b494f(_0x4da2ba){return _0x4da2ba instanceof _0x3b0181?_0x4da2ba:new _0x3b0181(function(_0x1ac7a5){_0x1ac7a5(_0x4da2ba);});}return new(_0x3b0181||(_0x3b0181=Promise))(function(_0x3826c9,_0x3da1c9){function _0x46b0c8(_0x3942c3){try{_0x506517(_0x41b43c['next'](_0x3942c3));}catch(_0x2e371e){_0x3da1c9(_0x2e371e);}}function _0x3ca535(_0x3d8c92){try{_0x506517(_0x41b43c['throw'](_0x3d8c92));}catch(_0x369164){_0x3da1c9(_0x369164);}}function _0x506517(_0x48b048){_0x48b048['done']?_0x3826c9(_0x48b048['value']):_0x3b494f(_0x48b048['value'])['then'](_0x46b0c8,_0x3ca535);}_0x506517((_0x41b43c=_0x41b43c['apply'](_0x4c1bec,_0x1e8b53||[]))['next']());});};class ApiKeyService{constructor(_0x58b0b2){this['fetch']=_0x58b0b2;}['create'](_0x3ff695,_0x38bbf1,_0x271ea5){return __awaiter$3(this,void 0,void 0,function*(){const _0x518b9c='api-key/create',_0x207bed={'account_name':_0x3ff695,'api_key_name':_0x38bbf1};try{const _0x22205d=yield this['fetch']['post'](_0x518b9c,_0x271ea5,_0x207bed);if(_0x22205d['status']>0xc7&&_0x22205d['status']<0x12c){const _0x365b33=yield _0x22205d['json']();return new SuccessfulApiKeyResponse(_0x365b33);}const _0x2e3eb5=yield _0x22205d['json']();return new FailedApiKeyResponse(_0x2e3eb5);}catch(_0x5c9fca){if(_0x5c9fca instanceof Error)return new FailedApiKeyResponse({'detail':_0x5c9fca['message'],'title':_0x5c9fca['name'],'status':0x1f4,'instance':'','type':''});throw _0x5c9fca;}});}['view'](_0x4fed72,_0x1fdf18,_0x34258c){return __awaiter$3(this,void 0,void 0,function*(){const _0x3a3e7c='api-key/'+_0x4fed72+'/'+_0x1fdf18;try{const _0x29fba7=yield this['fetch']['get'](_0x3a3e7c,_0x34258c);if(_0x29fba7['status']>0xc7&&_0x29fba7['status']<0x12c){const _0x3ed200=yield _0x29fba7['json']();return new SuccessfulApiKeyValueResponse(_0x3ed200);}const _0xcc3d2f=yield _0x29fba7['json']();return new FailedApiKeyValueResponse(_0xcc3d2f);}catch(_0x6b727d){if(_0x6b727d instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x6b727d['message'],'title':_0x6b727d['name'],'status':0x1f4,'instance':'','type':''});throw _0x6b727d;}});}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x5aaec8,_0x5d5b4b,_0x2579ff,_0x11c52e){function _0x267b06(_0x1a6efd){return _0x1a6efd instanceof _0x2579ff?_0x1a6efd:new _0x2579ff(function(_0x344d3e){_0x344d3e(_0x1a6efd);});}return new(_0x2579ff||(_0x2579ff=Promise))(function(_0x1b3779,_0x478f25){function _0x2744ca(_0x3e26ce){try{_0x1c0a54(_0x11c52e['next'](_0x3e26ce));}catch(_0x2ccd5e){_0x478f25(_0x2ccd5e);}}function _0x5073ed(_0x3ae6c5){try{_0x1c0a54(_0x11c52e['throw'](_0x3ae6c5));}catch(_0x269a52){_0x478f25(_0x269a52);}}function _0x1c0a54(_0xe3c5ea){_0xe3c5ea['done']?_0x1b3779(_0xe3c5ea['value']):_0x267b06(_0xe3c5ea['value'])['then'](_0x2744ca,_0x5073ed);}_0x1c0a54((_0x11c52e=_0x11c52e['apply'](_0x5aaec8,_0x5d5b4b||[]))['next']());});};class ApiKeyService{constructor(_0x4a7354){this['fetch']=_0x4a7354,this['path']='api-key';}['create'](_0x353bbd,_0x27e28f,_0x4e245c){return __awaiter$3(this,void 0,void 0,function*(){const _0x1a14cb={'account_name':_0x353bbd,'api_key_name':_0x27e28f};try{const _0x3575c2=yield this['fetch']['post'](this['path'],_0x4e245c,_0x1a14cb);if(_0x3575c2['status']>0xc7&&_0x3575c2['status']<0x12c){const _0x21f96b=yield _0x3575c2['json']();return new SuccessfulApiKeyResponse(_0x21f96b);}const _0x59c2d2=yield _0x3575c2['json']();return new FailedApiKeyResponse(_0x59c2d2);}catch(_0x362fa9){if(_0x362fa9 instanceof Error)return new FailedApiKeyResponse({'detail':_0x362fa9['message'],'title':_0x362fa9['name'],'status':0x1f4,'instance':'','type':''});throw _0x362fa9;}});}['view'](_0x3a1437,_0x1c2376,_0x595c96){return __awaiter$3(this,void 0,void 0,function*(){const _0x5c9b8f=this['path']+'/'+_0x3a1437+'/'+_0x1c2376;try{const _0x15306b=yield this['fetch']['get'](_0x5c9b8f,_0x595c96);if(_0x15306b['status']>0xc7&&_0x15306b['status']<0x12c){const _0x2d6848=yield _0x15306b['json']();return new SuccessfulApiKeyValueResponse(_0x2d6848);}const _0x1da988=yield _0x15306b['json']();return new FailedApiKeyValueResponse(_0x1da988);}catch(_0xa4eeb2){if(_0xa4eeb2 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0xa4eeb2['message'],'title':_0xa4eeb2['name'],'status':0x1f4,'instance':'','type':''});throw _0xa4eeb2;}});}['delete'](_0x40dc44,_0x4b8b36,_0x12caf9){return __awaiter$3(this,void 0,void 0,function*(){const _0x59276b=this['path']+'/'+_0x40dc44+'/'+_0x4b8b36;try{const _0x120150=yield this['fetch']['delete'](_0x59276b,_0x12caf9);if(_0x120150['status']>0xc7&&_0x120150['status']<0x12c)return new SuccessfulResponse({});const _0x3a80ba=yield _0x120150['json']();return new FailedResponse(_0x3a80ba);}catch(_0x27de3e){if(_0x27de3e instanceof Error)return new FailedResponse({'detail':_0x27de3e['message'],'title':_0x27de3e['name'],'status':0x1f4,'instance':'','type':''});throw _0x27de3e;}});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x46036c,_0x3f67e0,_0x164c98,_0x49b1c9){function _0x24351c(_0x50f637){return _0x50f637 instanceof _0x164c98?_0x50f637:new _0x164c98(function(_0x3be7de){_0x3be7de(_0x50f637);});}return new(_0x164c98||(_0x164c98=Promise))(function(_0x139d6e,_0x75d149){function _0x291a38(_0x174da6){try{_0x44d5dc(_0x49b1c9['next'](_0x174da6));}catch(_0x376b8f){_0x75d149(_0x376b8f);}}function _0x2ab679(_0x43cd08){try{_0x44d5dc(_0x49b1c9['throw'](_0x43cd08));}catch(_0x372f1d){_0x75d149(_0x372f1d);}}function _0x44d5dc(_0x299a58){_0x299a58['done']?_0x139d6e(_0x299a58['value']):_0x24351c(_0x299a58['value'])['then'](_0x291a38,_0x2ab679);}_0x44d5dc((_0x49b1c9=_0x49b1c9['apply'](_0x46036c,_0x3f67e0||[]))['next']());});};class ListService{constructor(_0x1fe3f3){this['fetch']=_0x1fe3f3;}['add'](_0x383190,_0x23a762,_0xd40e38){return __awaiter$2(this,void 0,void 0,function*(){const _0x338d69='List',_0x4911ba={'account_name':_0x383190,'list_name':_0x23a762};try{const _0x4c1c10=yield this['fetch']['post'](_0x338d69,_0xd40e38,_0x4911ba);if(_0x4c1c10['status']>0xc7&&_0x4c1c10['status']<0x12c){const _0xe069a0=yield _0x4c1c10['json']();return new SuccessfulAccountResponse(_0xe069a0);}const _0x107672=yield _0x4c1c10['json']();return new FailedAccountResponse(_0x107672);}catch(_0x417cbb){if(_0x417cbb instanceof Error)return new FailedAccountResponse({'detail':_0x417cbb['message'],'title':_0x417cbb['name'],'status':0x1f4,'instance':'','type':''});throw _0x417cbb;}});}['remove'](_0xd35d3b,_0x41a7d4,_0x5602cd){return __awaiter$2(this,void 0,void 0,function*(){const _0x17d6eb='List/'+_0xd35d3b+'/'+_0x41a7d4,_0x535566=yield this['fetch']['delete'](_0x17d6eb,_0x5602cd);try{if(_0x535566['status']>0xc7&&_0x535566['status']<0x12c){const _0x1f6226=yield _0x535566['json']();return new SuccessfulAccountResponse(_0x1f6226);}const _0x5000af=yield _0x535566['json']();return new FailedAccountResponse(_0x5000af);}catch(_0xb184db){if(_0xb184db instanceof Error)return new FailedAccountResponse({'detail':_0xb184db['message'],'title':_0xb184db['name'],'status':0x1f4,'instance':'','type':''});throw _0xb184db;}});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x58be9f,_0x401f23,_0x56df56,_0x113fc9){function _0xd8f29a(_0x4cdbdf){return _0x4cdbdf instanceof _0x56df56?_0x4cdbdf:new _0x56df56(function(_0x258968){_0x258968(_0x4cdbdf);});}return new(_0x56df56||(_0x56df56=Promise))(function(_0x314376,_0x26e4a8){function _0x178d99(_0x226929){try{_0x452318(_0x113fc9['next'](_0x226929));}catch(_0x5522e3){_0x26e4a8(_0x5522e3);}}function _0x1c4318(_0x23b52e){try{_0x452318(_0x113fc9['throw'](_0x23b52e));}catch(_0x2b3327){_0x26e4a8(_0x2b3327);}}function _0x452318(_0x5a56f2){_0x5a56f2['done']?_0x314376(_0x5a56f2['value']):_0xd8f29a(_0x5a56f2['value'])['then'](_0x178d99,_0x1c4318);}_0x452318((_0x113fc9=_0x113fc9['apply'](_0x58be9f,_0x401f23||[]))['next']());});};class ListService{constructor(_0x5e2cfb){this['fetch']=_0x5e2cfb;}['add'](_0x172ab7,_0x465606,_0x30616a){return __awaiter$2(this,void 0,void 0,function*(){const _0x1dd6da='List',_0x56c7b5={'account_name':_0x172ab7,'list_name':_0x465606};try{const _0x84379b=yield this['fetch']['post'](_0x1dd6da,_0x30616a,_0x56c7b5);if(_0x84379b['status']>0xc7&&_0x84379b['status']<0x12c){const _0x4d8042=yield _0x84379b['json']();return new SuccessfulAccountResponse(_0x4d8042);}const _0x4fd562=yield _0x84379b['json']();return new FailedAccountResponse(_0x4fd562);}catch(_0x3e64d0){if(_0x3e64d0 instanceof Error)return new FailedAccountResponse({'detail':_0x3e64d0['message'],'title':_0x3e64d0['name'],'status':0x1f4,'instance':'','type':''});throw _0x3e64d0;}});}['remove'](_0x185d1c,_0x5de4d6,_0x460c9a){return __awaiter$2(this,void 0,void 0,function*(){const _0x14b3cb='List/'+_0x185d1c+'/'+_0x5de4d6,_0x53d084=yield this['fetch']['delete'](_0x14b3cb,_0x460c9a);try{if(_0x53d084['status']>0xc7&&_0x53d084['status']<0x12c){const _0x3a8772=yield _0x53d084['json']();return new SuccessfulAccountResponse(_0x3a8772);}const _0x95e8e7=yield _0x53d084['json']();return new FailedAccountResponse(_0x95e8e7);}catch(_0x2536b5){if(_0x2536b5 instanceof Error)return new FailedAccountResponse({'detail':_0x2536b5['message'],'title':_0x2536b5['name'],'status':0x1f4,'instance':'','type':''});throw _0x2536b5;}});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x336db4,_0x23d696,_0x659bb,_0x479d48){function _0x1b5222(_0x334a6d){return _0x334a6d instanceof _0x659bb?_0x334a6d:new _0x659bb(function(_0x2a051d){_0x2a051d(_0x334a6d);});}return new(_0x659bb||(_0x659bb=Promise))(function(_0x19444d,_0x4c5ff6){function _0xa45f37(_0x542b5a){try{_0x171759(_0x479d48['next'](_0x542b5a));}catch(_0xf8d04b){_0x4c5ff6(_0xf8d04b);}}function _0x2308f2(_0x2e333c){try{_0x171759(_0x479d48['throw'](_0x2e333c));}catch(_0x4b0792){_0x4c5ff6(_0x4b0792);}}function _0x171759(_0x2406a9){_0x2406a9['done']?_0x19444d(_0x2406a9['value']):_0x1b5222(_0x2406a9['value'])['then'](_0xa45f37,_0x2308f2);}_0x171759((_0x479d48=_0x479d48['apply'](_0x336db4,_0x23d696||[]))['next']());});};class Fetch{constructor(_0x11e235){this['baseUri']=_0x11e235,this['getUrl']=_0x398c08=>{return _0x398c08['startsWith']('/')&&(_0x398c08=_0x398c08['replace']('/','')),''+this['baseUri']+_0x398c08;},!_0x11e235['endsWith']('/')&&(_0x11e235=_0x11e235+'/');}['get'](_0x1197d1,_0x154732){return __awaiter$1(this,void 0,void 0,function*(){const _0x16bdc5=this['getUrl'](_0x1197d1);return yield fetch(_0x16bdc5,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x154732}});});}['post'](_0x57c09c,_0x4a400f,_0x1f42b5){return __awaiter$1(this,void 0,void 0,function*(){const _0x3dd135=this['getUrl'](_0x57c09c);return yield fetch(_0x3dd135,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4a400f},'body':_0x1f42b5?JSON['stringify'](_0x1f42b5):null});});}['put'](_0x547b96,_0x4a748e,_0x5a6e28){return __awaiter$1(this,void 0,void 0,function*(){const _0x2e6435=this['getUrl'](_0x547b96);return yield fetch(_0x2e6435,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4a748e},'body':_0x5a6e28?JSON['stringify'](_0x5a6e28):null});});}['delete'](_0x34131e,_0x53c18b){return __awaiter$1(this,void 0,void 0,function*(){const _0x159bef=this['getUrl'](_0x34131e);return yield fetch(_0x159bef,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x53c18b}});});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2df809,_0x3f2384,_0x652faa,_0x2f0c8e){function _0x28e2a0(_0x1264f1){return _0x1264f1 instanceof _0x652faa?_0x1264f1:new _0x652faa(function(_0x1d972c){_0x1d972c(_0x1264f1);});}return new(_0x652faa||(_0x652faa=Promise))(function(_0x5dbf04,_0x4dbc54){function _0x5bbe9f(_0x4f92aa){try{_0x37bada(_0x2f0c8e['next'](_0x4f92aa));}catch(_0x1f4d1b){_0x4dbc54(_0x1f4d1b);}}function _0x1a194a(_0x5a48b5){try{_0x37bada(_0x2f0c8e['throw'](_0x5a48b5));}catch(_0x5e86d2){_0x4dbc54(_0x5e86d2);}}function _0x37bada(_0x4f221f){_0x4f221f['done']?_0x5dbf04(_0x4f221f['value']):_0x28e2a0(_0x4f221f['value'])['then'](_0x5bbe9f,_0x1a194a);}_0x37bada((_0x2f0c8e=_0x2f0c8e['apply'](_0x2df809,_0x3f2384||[]))['next']());});};class Fetch{constructor(_0x38d277){this['baseUri']=_0x38d277,this['getUrl']=_0x1e37a7=>{return _0x1e37a7['startsWith']('/')&&(_0x1e37a7=_0x1e37a7['replace']('/','')),''+this['baseUri']+_0x1e37a7;},!_0x38d277['endsWith']('/')&&(_0x38d277=_0x38d277+'/');}['get'](_0x14b9be,_0x53ebb3){return __awaiter$1(this,void 0,void 0,function*(){const _0x1c75b3=this['getUrl'](_0x14b9be);return yield fetch(_0x1c75b3,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x53ebb3}});});}['post'](_0x18e705,_0x17b39d,_0xc46625){return __awaiter$1(this,void 0,void 0,function*(){const _0x2dd61b=this['getUrl'](_0x18e705);return yield fetch(_0x2dd61b,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x17b39d},'body':_0xc46625?JSON['stringify'](_0xc46625):null});});}['put'](_0x1784ff,_0x554a4f,_0x52e3ae){return __awaiter$1(this,void 0,void 0,function*(){const _0x38e127=this['getUrl'](_0x1784ff);return yield fetch(_0x38e127,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x554a4f},'body':_0x52e3ae?JSON['stringify'](_0x52e3ae):null});});}['delete'](_0x55bdf6,_0x166cae){return __awaiter$1(this,void 0,void 0,function*(){const _0x1fd79a=this['getUrl'](_0x55bdf6);return yield fetch(_0x1fd79a,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x166cae}});});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x2b2c48,_0x14cab9,_0x5c7c72,_0xaff6f6){function _0x4c874f(_0x1e6118){return _0x1e6118 instanceof _0x5c7c72?_0x1e6118:new _0x5c7c72(function(_0x3db553){_0x3db553(_0x1e6118);});}return new(_0x5c7c72||(_0x5c7c72=Promise))(function(_0x16667d,_0x2d6000){function _0x13ea6d(_0x7577){try{_0x2ca7bb(_0xaff6f6['next'](_0x7577));}catch(_0x1eeaea){_0x2d6000(_0x1eeaea);}}function _0x2ab460(_0x4f1a26){try{_0x2ca7bb(_0xaff6f6['throw'](_0x4f1a26));}catch(_0x538067){_0x2d6000(_0x538067);}}function _0x2ca7bb(_0x157d90){_0x157d90['done']?_0x16667d(_0x157d90['value']):_0x4c874f(_0x157d90['value'])['then'](_0x13ea6d,_0x2ab460);}_0x2ca7bb((_0xaff6f6=_0xaff6f6['apply'](_0x2b2c48,_0x14cab9||[]))['next']());});};class AdminClient{constructor(_0x2bfc97='https://admin.searchability.dev/'){var _0x43c062=new Fetch(_0x2bfc97);this['Accounts']=new AccountService(_0x43c062),this['Lists']=new ListService(_0x43c062),this['ApiKeys']=new ApiKeyService(_0x43c062);}}class AuthClient{constructor(_0x4e0b81='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x4e0b81);}['login'](_0x548ace){return __awaiter(this,void 0,void 0,function*(){var _0x1616d5='login/'+_0x548ace;try{const _0x371252=yield yield fetch(_0x1616d5);if(_0x371252['status']>0xc7&&_0x371252['status']<0x12c){const _0x2f1cdb=yield _0x371252['json']();return new SuccessfulAuthResponse(_0x2f1cdb);}const _0x221ad3=yield _0x371252['json']();return new FailedAuthResponse(_0x221ad3);}catch(_0x216519){if(_0x216519 instanceof Error)return new FailedAuthResponse({'detail':_0x216519['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x216519;}});}['refresh'](_0x216a48){return __awaiter(this,void 0,void 0,function*(){var _0xac6c0f='refresh';try{const _0x3671e0=yield this['fetch']['post'](_0xac6c0f,_0x216a48,null);if(_0x3671e0['status']>0xc7&&_0x3671e0['status']<0x12c){const _0x48a5f8=yield _0x3671e0['json']();return new SuccessfulAuthResponse(_0x48a5f8);}const _0x2e1035=yield _0x3671e0['json']();return new FailedAuthResponse(_0x2e1035);}catch(_0x4ee17d){if(_0x4ee17d instanceof Error)return new FailedAuthResponse({'detail':_0x4ee17d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4ee17d;}});}['getTokenStatus'](_0x1f6e05){if(Date['now']()<_0x1f6e05['access_expires'])return exports.TokenStatus['Ok'];if(Date['now']()<_0x1f6e05['refresh_expires'])return exports.TokenStatus['Refresh'];return exports.TokenStatus['Expired'];}}
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x1f1d8a,_0x194e43,_0xc3aa87,_0x49f880){function _0x369228(_0x420894){return _0x420894 instanceof _0xc3aa87?_0x420894:new _0xc3aa87(function(_0x42c6fe){_0x42c6fe(_0x420894);});}return new(_0xc3aa87||(_0xc3aa87=Promise))(function(_0x33c519,_0x5a2fca){function _0x59e534(_0x37d7e2){try{_0x13c3e8(_0x49f880['next'](_0x37d7e2));}catch(_0x1a513f){_0x5a2fca(_0x1a513f);}}function _0x169afd(_0x33b467){try{_0x13c3e8(_0x49f880['throw'](_0x33b467));}catch(_0x49f675){_0x5a2fca(_0x49f675);}}function _0x13c3e8(_0x2233f2){_0x2233f2['done']?_0x33c519(_0x2233f2['value']):_0x369228(_0x2233f2['value'])['then'](_0x59e534,_0x169afd);}_0x13c3e8((_0x49f880=_0x49f880['apply'](_0x1f1d8a,_0x194e43||[]))['next']());});};class AdminClient{constructor(_0x2ac418='https://admin.searchability.dev/'){var _0x108ab4=new Fetch(_0x2ac418);this['Accounts']=new AccountService(_0x108ab4),this['Lists']=new ListService(_0x108ab4),this['ApiKeys']=new ApiKeyService(_0x108ab4);}}class AuthClient{constructor(_0x41e7e7='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x41e7e7);}['login'](_0x237618){return __awaiter(this,void 0,void 0,function*(){var _0xe81e1b='login/'+_0x237618;try{const _0x1c7dd2=yield yield fetch(_0xe81e1b);if(_0x1c7dd2['status']>0xc7&&_0x1c7dd2['status']<0x12c){const _0x18b8ec=yield _0x1c7dd2['json']();return new SuccessfulAuthResponse(_0x18b8ec);}const _0x16802d=yield _0x1c7dd2['json']();return new FailedAuthResponse(_0x16802d);}catch(_0x1cb3bd){if(_0x1cb3bd instanceof Error)return new FailedAuthResponse({'detail':_0x1cb3bd['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1cb3bd;}});}['refresh'](_0x767d36){return __awaiter(this,void 0,void 0,function*(){var _0x290db1='refresh';try{const _0x11c2f0=yield this['fetch']['post'](_0x290db1,_0x767d36,null);if(_0x11c2f0['status']>0xc7&&_0x11c2f0['status']<0x12c){const _0x2537d7=yield _0x11c2f0['json']();return new SuccessfulAuthResponse(_0x2537d7);}const _0x62ce68=yield _0x11c2f0['json']();return new FailedAuthResponse(_0x62ce68);}catch(_0x33d18a){if(_0x33d18a instanceof Error)return new FailedAuthResponse({'detail':_0x33d18a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x33d18a;}});}['getTokenStatus'](_0x1d1052){if(Date['now']()<_0x1d1052['access_expires'])return exports.TokenStatus['Ok'];if(Date['now']()<_0x1d1052['refresh_expires'])return exports.TokenStatus['Refresh'];return exports.TokenStatus['Expired'];}}
14
14
 
15
15
  exports.AdminClient = AdminClient;
16
16
  exports.AuthClient = AuthClient;
@@ -1,13 +1,13 @@
1
- var TokenStatus;(function(_0x2869f6){_0x2869f6[_0x2869f6['Ok']=0x0]='Ok',_0x2869f6[_0x2869f6['Refresh']=0x1]='Refresh',_0x2869f6[_0x2869f6['Expired']=0x2]='Expired';}(TokenStatus||(TokenStatus={})));class Tokens{constructor(){this['access_token']='',this['access_expires']=0x0,this['refresh_token']='',this['refresh_expires']=0x0;}}class Response{constructor(_0x7bf789){this['isSuccess']=_0x7bf789;}}class SuccessfulAccountResponse extends Response{constructor(_0x335f9d){super(!![]),this['account']=_0x335f9d;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x146354){super(![]),this['problem']=_0x146354;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x141869){super(!![]),this['tokens']=_0x141869;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x231743){super(![]),this['problem']=_0x231743;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x4f07b1){super(!![]),this['apiKey']=_0x4f07b1;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x17c8f7){super(![]),this['problem']=_0x17c8f7;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x4379e6){super(!![]),this['apiKeyValue']=_0x4379e6;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyValueResponse extends Response{constructor(_0x494fb0){super(![]),this['problem']=_0x494fb0;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
1
+ var TokenStatus;(function(_0x17f738){_0x17f738[_0x17f738['Ok']=0x0]='Ok',_0x17f738[_0x17f738['Refresh']=0x1]='Refresh',_0x17f738[_0x17f738['Expired']=0x2]='Expired';}(TokenStatus||(TokenStatus={})));class Tokens{constructor(){this['access_token']='',this['access_expires']=0x0,this['refresh_token']='',this['refresh_expires']=0x0;}}class Response{constructor(_0x59eeb4){this['isSuccess']=_0x59eeb4;}}class SuccessfulAccountResponse extends Response{constructor(_0x3b6d30){super(!![]),this['account']=_0x3b6d30;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x3d5b58){super(![]),this['problem']=_0x3d5b58;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x5091ee){super(!![]),this['tokens']=_0x5091ee;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x72bed4){super(![]),this['problem']=_0x72bed4;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x15d1fe){super(!![]),this['apiKey']=_0x15d1fe;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x1abfb2){super(![]),this['problem']=_0x1abfb2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x4ef6f2){super(!![]),this['apiKeyValue']=_0x4ef6f2;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x78802b){super(!![]),this['obj']=_0x78802b;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x228ceb){super(![]),this['problem']=_0x228ceb;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x15a037){super(![]),this['problem']=_0x15a037;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
2
2
 
3
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x3ca976,_0x49454b,_0x2fdcbe,_0x5aa82c){function _0x422724(_0x3283d5){return _0x3283d5 instanceof _0x2fdcbe?_0x3283d5:new _0x2fdcbe(function(_0x5c019a){_0x5c019a(_0x3283d5);});}return new(_0x2fdcbe||(_0x2fdcbe=Promise))(function(_0x53d3f7,_0x59daab){function _0x43885a(_0x42150e){try{_0x5163db(_0x5aa82c['next'](_0x42150e));}catch(_0x2413f5){_0x59daab(_0x2413f5);}}function _0x37c6fa(_0x130b49){try{_0x5163db(_0x5aa82c['throw'](_0x130b49));}catch(_0x49e598){_0x59daab(_0x49e598);}}function _0x5163db(_0x566c9f){_0x566c9f['done']?_0x53d3f7(_0x566c9f['value']):_0x422724(_0x566c9f['value'])['then'](_0x43885a,_0x37c6fa);}_0x5163db((_0x5aa82c=_0x5aa82c['apply'](_0x3ca976,_0x49454b||[]))['next']());});};class AccountService{constructor(_0x2a8741){this['fetch']=_0x2a8741;}['get'](_0x2e7e72,_0x78cdb9){return __awaiter$4(this,void 0,void 0,function*(){const _0x57d5de='Account/'+_0x2e7e72+'/',_0x2f18c1=yield this['fetch']['get'](_0x57d5de,_0x78cdb9);try{if(_0x2f18c1['status']>0xc7&&_0x2f18c1['status']<0x12c){const _0x1f9de8=yield _0x2f18c1['json']();return new SuccessfulAccountResponse(_0x1f9de8);}const _0x519693=yield _0x2f18c1['json']();return new FailedAccountResponse(_0x519693);}catch(_0x324f47){if(_0x324f47 instanceof Error)return new FailedAccountResponse({'detail':_0x324f47['message'],'title':_0x324f47['name'],'status':0x1f4,'instance':'','type':''});throw _0x324f47;}});}}
3
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x23cf00,_0x2c07c7,_0x4493ef,_0x8182){function _0x3eea06(_0x4ff1d3){return _0x4ff1d3 instanceof _0x4493ef?_0x4ff1d3:new _0x4493ef(function(_0x31b5a9){_0x31b5a9(_0x4ff1d3);});}return new(_0x4493ef||(_0x4493ef=Promise))(function(_0x5e41c2,_0x192e77){function _0x315323(_0x10abfd){try{_0x5b7f4c(_0x8182['next'](_0x10abfd));}catch(_0x1c648a){_0x192e77(_0x1c648a);}}function _0x40d02d(_0x425404){try{_0x5b7f4c(_0x8182['throw'](_0x425404));}catch(_0x445a9d){_0x192e77(_0x445a9d);}}function _0x5b7f4c(_0xa110e0){_0xa110e0['done']?_0x5e41c2(_0xa110e0['value']):_0x3eea06(_0xa110e0['value'])['then'](_0x315323,_0x40d02d);}_0x5b7f4c((_0x8182=_0x8182['apply'](_0x23cf00,_0x2c07c7||[]))['next']());});};class AccountService{constructor(_0xc4263b){this['fetch']=_0xc4263b;}['get'](_0x1b69ab,_0x5685ff){return __awaiter$4(this,void 0,void 0,function*(){const _0x531823='Account/'+_0x1b69ab+'/',_0x42e13e=yield this['fetch']['get'](_0x531823,_0x5685ff);try{if(_0x42e13e['status']>0xc7&&_0x42e13e['status']<0x12c){const _0x3eed20=yield _0x42e13e['json']();return new SuccessfulAccountResponse(_0x3eed20);}const _0x40e561=yield _0x42e13e['json']();return new FailedAccountResponse(_0x40e561);}catch(_0x189671){if(_0x189671 instanceof Error)return new FailedAccountResponse({'detail':_0x189671['message'],'title':_0x189671['name'],'status':0x1f4,'instance':'','type':''});throw _0x189671;}});}}
4
4
 
5
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x4064bd,_0xe70e67,_0x25354c,_0x283f75){function _0x3fa6a2(_0x50e9e6){return _0x50e9e6 instanceof _0x25354c?_0x50e9e6:new _0x25354c(function(_0xbfa97a){_0xbfa97a(_0x50e9e6);});}return new(_0x25354c||(_0x25354c=Promise))(function(_0x3b13a8,_0x59187a){function _0x7203ce(_0x28f540){try{_0x2c4c3b(_0x283f75['next'](_0x28f540));}catch(_0x1f1a7a){_0x59187a(_0x1f1a7a);}}function _0x6bb640(_0x589445){try{_0x2c4c3b(_0x283f75['throw'](_0x589445));}catch(_0x14685e){_0x59187a(_0x14685e);}}function _0x2c4c3b(_0x2f2adc){_0x2f2adc['done']?_0x3b13a8(_0x2f2adc['value']):_0x3fa6a2(_0x2f2adc['value'])['then'](_0x7203ce,_0x6bb640);}_0x2c4c3b((_0x283f75=_0x283f75['apply'](_0x4064bd,_0xe70e67||[]))['next']());});};class ApiKeyService{constructor(_0x6764bd){this['fetch']=_0x6764bd;}['create'](_0xd08c7f,_0x66b6a2,_0x4c26fe){return __awaiter$3(this,void 0,void 0,function*(){const _0x3a136d='api-key/create',_0x3a2c3e={'account_name':_0xd08c7f,'api_key_name':_0x66b6a2};try{const _0x37c899=yield this['fetch']['post'](_0x3a136d,_0x4c26fe,_0x3a2c3e);if(_0x37c899['status']>0xc7&&_0x37c899['status']<0x12c){const _0x1c5fc9=yield _0x37c899['json']();return new SuccessfulApiKeyResponse(_0x1c5fc9);}const _0x437bf0=yield _0x37c899['json']();return new FailedApiKeyResponse(_0x437bf0);}catch(_0x414104){if(_0x414104 instanceof Error)return new FailedApiKeyResponse({'detail':_0x414104['message'],'title':_0x414104['name'],'status':0x1f4,'instance':'','type':''});throw _0x414104;}});}['view'](_0x21e759,_0x3e6de0,_0x31f3f0){return __awaiter$3(this,void 0,void 0,function*(){const _0x565b58='api-key/'+_0x21e759+'/'+_0x3e6de0;try{const _0x3ad80a=yield this['fetch']['get'](_0x565b58,_0x31f3f0);if(_0x3ad80a['status']>0xc7&&_0x3ad80a['status']<0x12c){const _0xb1671d=yield _0x3ad80a['json']();return new SuccessfulApiKeyValueResponse(_0xb1671d);}const _0x1f0166=yield _0x3ad80a['json']();return new FailedApiKeyValueResponse(_0x1f0166);}catch(_0x28521a){if(_0x28521a instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x28521a['message'],'title':_0x28521a['name'],'status':0x1f4,'instance':'','type':''});throw _0x28521a;}});}}
5
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x32ee49,_0x264836,_0x5a4aee,_0x4cfd75){function _0x5ea14e(_0x1df19d){return _0x1df19d instanceof _0x5a4aee?_0x1df19d:new _0x5a4aee(function(_0x5681b3){_0x5681b3(_0x1df19d);});}return new(_0x5a4aee||(_0x5a4aee=Promise))(function(_0xc72283,_0x477a63){function _0x4e47d5(_0x3f1f9a){try{_0x43e970(_0x4cfd75['next'](_0x3f1f9a));}catch(_0x4804c1){_0x477a63(_0x4804c1);}}function _0x696fbb(_0x48945d){try{_0x43e970(_0x4cfd75['throw'](_0x48945d));}catch(_0xcc717b){_0x477a63(_0xcc717b);}}function _0x43e970(_0x226730){_0x226730['done']?_0xc72283(_0x226730['value']):_0x5ea14e(_0x226730['value'])['then'](_0x4e47d5,_0x696fbb);}_0x43e970((_0x4cfd75=_0x4cfd75['apply'](_0x32ee49,_0x264836||[]))['next']());});};class ApiKeyService{constructor(_0x1fc300){this['fetch']=_0x1fc300,this['path']='api-key';}['create'](_0x115451,_0x5388e3,_0x32b5b4){return __awaiter$3(this,void 0,void 0,function*(){const _0x5324f9={'account_name':_0x115451,'api_key_name':_0x5388e3};try{const _0x3933a0=yield this['fetch']['post'](this['path'],_0x32b5b4,_0x5324f9);if(_0x3933a0['status']>0xc7&&_0x3933a0['status']<0x12c){const _0x20b3fd=yield _0x3933a0['json']();return new SuccessfulApiKeyResponse(_0x20b3fd);}const _0x192382=yield _0x3933a0['json']();return new FailedApiKeyResponse(_0x192382);}catch(_0x4fda5d){if(_0x4fda5d instanceof Error)return new FailedApiKeyResponse({'detail':_0x4fda5d['message'],'title':_0x4fda5d['name'],'status':0x1f4,'instance':'','type':''});throw _0x4fda5d;}});}['view'](_0x33d2e8,_0x2b7e7c,_0x112078){return __awaiter$3(this,void 0,void 0,function*(){const _0x35dfca=this['path']+'/'+_0x33d2e8+'/'+_0x2b7e7c;try{const _0x2d46fe=yield this['fetch']['get'](_0x35dfca,_0x112078);if(_0x2d46fe['status']>0xc7&&_0x2d46fe['status']<0x12c){const _0xfa7318=yield _0x2d46fe['json']();return new SuccessfulApiKeyValueResponse(_0xfa7318);}const _0x27cacb=yield _0x2d46fe['json']();return new FailedApiKeyValueResponse(_0x27cacb);}catch(_0xaae9b7){if(_0xaae9b7 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0xaae9b7['message'],'title':_0xaae9b7['name'],'status':0x1f4,'instance':'','type':''});throw _0xaae9b7;}});}['delete'](_0x51d565,_0x2088c9,_0x254df4){return __awaiter$3(this,void 0,void 0,function*(){const _0x52a8d8=this['path']+'/'+_0x51d565+'/'+_0x2088c9;try{const _0x283543=yield this['fetch']['delete'](_0x52a8d8,_0x254df4);if(_0x283543['status']>0xc7&&_0x283543['status']<0x12c)return new SuccessfulResponse({});const _0x3e67e3=yield _0x283543['json']();return new FailedResponse(_0x3e67e3);}catch(_0x372aa4){if(_0x372aa4 instanceof Error)return new FailedResponse({'detail':_0x372aa4['message'],'title':_0x372aa4['name'],'status':0x1f4,'instance':'','type':''});throw _0x372aa4;}});}}
6
6
 
7
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x54451d,_0x4bb625,_0x25bb7d,_0x22eb26){function _0x762a2f(_0x512991){return _0x512991 instanceof _0x25bb7d?_0x512991:new _0x25bb7d(function(_0x3f5734){_0x3f5734(_0x512991);});}return new(_0x25bb7d||(_0x25bb7d=Promise))(function(_0x47a383,_0x559df1){function _0x1a3e12(_0x12c5a0){try{_0x484308(_0x22eb26['next'](_0x12c5a0));}catch(_0x59e429){_0x559df1(_0x59e429);}}function _0x35053c(_0x236fb7){try{_0x484308(_0x22eb26['throw'](_0x236fb7));}catch(_0x2898d1){_0x559df1(_0x2898d1);}}function _0x484308(_0x130d65){_0x130d65['done']?_0x47a383(_0x130d65['value']):_0x762a2f(_0x130d65['value'])['then'](_0x1a3e12,_0x35053c);}_0x484308((_0x22eb26=_0x22eb26['apply'](_0x54451d,_0x4bb625||[]))['next']());});};class ListService{constructor(_0x25c8fa){this['fetch']=_0x25c8fa;}['add'](_0x101df0,_0x54f17a,_0x5846ed){return __awaiter$2(this,void 0,void 0,function*(){const _0x90cbff='List',_0x462115={'account_name':_0x101df0,'list_name':_0x54f17a};try{const _0x22f0d7=yield this['fetch']['post'](_0x90cbff,_0x5846ed,_0x462115);if(_0x22f0d7['status']>0xc7&&_0x22f0d7['status']<0x12c){const _0x1b51b1=yield _0x22f0d7['json']();return new SuccessfulAccountResponse(_0x1b51b1);}const _0x2402d0=yield _0x22f0d7['json']();return new FailedAccountResponse(_0x2402d0);}catch(_0x40433f){if(_0x40433f instanceof Error)return new FailedAccountResponse({'detail':_0x40433f['message'],'title':_0x40433f['name'],'status':0x1f4,'instance':'','type':''});throw _0x40433f;}});}['remove'](_0x5e175f,_0x47d64a,_0x1ef493){return __awaiter$2(this,void 0,void 0,function*(){const _0x5aa85c='List/'+_0x5e175f+'/'+_0x47d64a,_0x38e8ab=yield this['fetch']['delete'](_0x5aa85c,_0x1ef493);try{if(_0x38e8ab['status']>0xc7&&_0x38e8ab['status']<0x12c){const _0x4c341b=yield _0x38e8ab['json']();return new SuccessfulAccountResponse(_0x4c341b);}const _0x2d0802=yield _0x38e8ab['json']();return new FailedAccountResponse(_0x2d0802);}catch(_0x5d896c){if(_0x5d896c instanceof Error)return new FailedAccountResponse({'detail':_0x5d896c['message'],'title':_0x5d896c['name'],'status':0x1f4,'instance':'','type':''});throw _0x5d896c;}});}}
7
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x1af114,_0x59abfb,_0x96264f,_0x2351de){function _0x14d3d0(_0x206c4d){return _0x206c4d instanceof _0x96264f?_0x206c4d:new _0x96264f(function(_0x8abb6d){_0x8abb6d(_0x206c4d);});}return new(_0x96264f||(_0x96264f=Promise))(function(_0x2e0b1d,_0x292b9b){function _0x5089cd(_0xf6f1a5){try{_0x2ff821(_0x2351de['next'](_0xf6f1a5));}catch(_0x37fad8){_0x292b9b(_0x37fad8);}}function _0x16efa9(_0x3f1f46){try{_0x2ff821(_0x2351de['throw'](_0x3f1f46));}catch(_0x45be81){_0x292b9b(_0x45be81);}}function _0x2ff821(_0x2e8d3b){_0x2e8d3b['done']?_0x2e0b1d(_0x2e8d3b['value']):_0x14d3d0(_0x2e8d3b['value'])['then'](_0x5089cd,_0x16efa9);}_0x2ff821((_0x2351de=_0x2351de['apply'](_0x1af114,_0x59abfb||[]))['next']());});};class ListService{constructor(_0x14cf1e){this['fetch']=_0x14cf1e;}['add'](_0xea7dbc,_0x580bba,_0x4c4c58){return __awaiter$2(this,void 0,void 0,function*(){const _0x5a08a9='List',_0x326f8a={'account_name':_0xea7dbc,'list_name':_0x580bba};try{const _0x20841e=yield this['fetch']['post'](_0x5a08a9,_0x4c4c58,_0x326f8a);if(_0x20841e['status']>0xc7&&_0x20841e['status']<0x12c){const _0x180e26=yield _0x20841e['json']();return new SuccessfulAccountResponse(_0x180e26);}const _0x3c7035=yield _0x20841e['json']();return new FailedAccountResponse(_0x3c7035);}catch(_0xb64caf){if(_0xb64caf instanceof Error)return new FailedAccountResponse({'detail':_0xb64caf['message'],'title':_0xb64caf['name'],'status':0x1f4,'instance':'','type':''});throw _0xb64caf;}});}['remove'](_0xc556ab,_0x5a34e9,_0xcbdaf2){return __awaiter$2(this,void 0,void 0,function*(){const _0x3384c1='List/'+_0xc556ab+'/'+_0x5a34e9,_0x18f2d5=yield this['fetch']['delete'](_0x3384c1,_0xcbdaf2);try{if(_0x18f2d5['status']>0xc7&&_0x18f2d5['status']<0x12c){const _0x42cdb2=yield _0x18f2d5['json']();return new SuccessfulAccountResponse(_0x42cdb2);}const _0x4ec011=yield _0x18f2d5['json']();return new FailedAccountResponse(_0x4ec011);}catch(_0x17d773){if(_0x17d773 instanceof Error)return new FailedAccountResponse({'detail':_0x17d773['message'],'title':_0x17d773['name'],'status':0x1f4,'instance':'','type':''});throw _0x17d773;}});}}
8
8
 
9
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x313890,_0x125ab4,_0x572a48,_0x887349){function _0x5e51d9(_0xd97e37){return _0xd97e37 instanceof _0x572a48?_0xd97e37:new _0x572a48(function(_0x19eba0){_0x19eba0(_0xd97e37);});}return new(_0x572a48||(_0x572a48=Promise))(function(_0x1f838e,_0x303e52){function _0x578119(_0x19a23e){try{_0x34cfa9(_0x887349['next'](_0x19a23e));}catch(_0x280d82){_0x303e52(_0x280d82);}}function _0xf1b594(_0x4aede9){try{_0x34cfa9(_0x887349['throw'](_0x4aede9));}catch(_0x30a36f){_0x303e52(_0x30a36f);}}function _0x34cfa9(_0x39ce1f){_0x39ce1f['done']?_0x1f838e(_0x39ce1f['value']):_0x5e51d9(_0x39ce1f['value'])['then'](_0x578119,_0xf1b594);}_0x34cfa9((_0x887349=_0x887349['apply'](_0x313890,_0x125ab4||[]))['next']());});};class Fetch{constructor(_0x3c1c79){this['baseUri']=_0x3c1c79,this['getUrl']=_0x7c5d4f=>{return _0x7c5d4f['startsWith']('/')&&(_0x7c5d4f=_0x7c5d4f['replace']('/','')),''+this['baseUri']+_0x7c5d4f;},!_0x3c1c79['endsWith']('/')&&(_0x3c1c79=_0x3c1c79+'/');}['get'](_0x4c3a8e,_0x156299){return __awaiter$1(this,void 0,void 0,function*(){const _0x8721f5=this['getUrl'](_0x4c3a8e);return yield fetch(_0x8721f5,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x156299}});});}['post'](_0x5e91aa,_0x347768,_0x5c68c8){return __awaiter$1(this,void 0,void 0,function*(){const _0x5bb278=this['getUrl'](_0x5e91aa);return yield fetch(_0x5bb278,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x347768},'body':_0x5c68c8?JSON['stringify'](_0x5c68c8):null});});}['put'](_0x505a3a,_0x2a86d6,_0x317474){return __awaiter$1(this,void 0,void 0,function*(){const _0x119421=this['getUrl'](_0x505a3a);return yield fetch(_0x119421,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2a86d6},'body':_0x317474?JSON['stringify'](_0x317474):null});});}['delete'](_0x4ac717,_0x32b3b7){return __awaiter$1(this,void 0,void 0,function*(){const _0x1c1608=this['getUrl'](_0x4ac717);return yield fetch(_0x1c1608,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x32b3b7}});});}}
9
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x350c07,_0x56df1b,_0x319fd0,_0x48f92e){function _0x10e18e(_0x5bdf37){return _0x5bdf37 instanceof _0x319fd0?_0x5bdf37:new _0x319fd0(function(_0x398ca6){_0x398ca6(_0x5bdf37);});}return new(_0x319fd0||(_0x319fd0=Promise))(function(_0x4a5674,_0xd442b7){function _0x29ff1d(_0x139195){try{_0x4b9fc7(_0x48f92e['next'](_0x139195));}catch(_0x233931){_0xd442b7(_0x233931);}}function _0x5a15a2(_0x47f3dd){try{_0x4b9fc7(_0x48f92e['throw'](_0x47f3dd));}catch(_0x46e82b){_0xd442b7(_0x46e82b);}}function _0x4b9fc7(_0x1c1dd3){_0x1c1dd3['done']?_0x4a5674(_0x1c1dd3['value']):_0x10e18e(_0x1c1dd3['value'])['then'](_0x29ff1d,_0x5a15a2);}_0x4b9fc7((_0x48f92e=_0x48f92e['apply'](_0x350c07,_0x56df1b||[]))['next']());});};class Fetch{constructor(_0x117c79){this['baseUri']=_0x117c79,this['getUrl']=_0xa417e5=>{return _0xa417e5['startsWith']('/')&&(_0xa417e5=_0xa417e5['replace']('/','')),''+this['baseUri']+_0xa417e5;},!_0x117c79['endsWith']('/')&&(_0x117c79=_0x117c79+'/');}['get'](_0x52a774,_0x1767e2){return __awaiter$1(this,void 0,void 0,function*(){const _0xf2d2f8=this['getUrl'](_0x52a774);return yield fetch(_0xf2d2f8,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1767e2}});});}['post'](_0x5a032e,_0x377789,_0x2ec922){return __awaiter$1(this,void 0,void 0,function*(){const _0x2fd091=this['getUrl'](_0x5a032e);return yield fetch(_0x2fd091,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x377789},'body':_0x2ec922?JSON['stringify'](_0x2ec922):null});});}['put'](_0x3b841e,_0x3d1053,_0x53ba1b){return __awaiter$1(this,void 0,void 0,function*(){const _0x47b96f=this['getUrl'](_0x3b841e);return yield fetch(_0x47b96f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3d1053},'body':_0x53ba1b?JSON['stringify'](_0x53ba1b):null});});}['delete'](_0x3942e1,_0x50a9c6){return __awaiter$1(this,void 0,void 0,function*(){const _0x217247=this['getUrl'](_0x3942e1);return yield fetch(_0x217247,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x50a9c6}});});}}
10
10
 
11
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x5c6b28,_0x3b0a52,_0x5482bf,_0x202d0f){function _0x33733c(_0x5917e7){return _0x5917e7 instanceof _0x5482bf?_0x5917e7:new _0x5482bf(function(_0x29a235){_0x29a235(_0x5917e7);});}return new(_0x5482bf||(_0x5482bf=Promise))(function(_0x58a969,_0x7b130c){function _0x373d0e(_0x4779b6){try{_0x150f18(_0x202d0f['next'](_0x4779b6));}catch(_0x3598e2){_0x7b130c(_0x3598e2);}}function _0x36059d(_0x26de4c){try{_0x150f18(_0x202d0f['throw'](_0x26de4c));}catch(_0x6210a5){_0x7b130c(_0x6210a5);}}function _0x150f18(_0x1fe269){_0x1fe269['done']?_0x58a969(_0x1fe269['value']):_0x33733c(_0x1fe269['value'])['then'](_0x373d0e,_0x36059d);}_0x150f18((_0x202d0f=_0x202d0f['apply'](_0x5c6b28,_0x3b0a52||[]))['next']());});};class AdminClient{constructor(_0x137d3d='https://admin.searchability.dev/'){var _0x13fa25=new Fetch(_0x137d3d);this['Accounts']=new AccountService(_0x13fa25),this['Lists']=new ListService(_0x13fa25),this['ApiKeys']=new ApiKeyService(_0x13fa25);}}class AuthClient{constructor(_0x3ea384='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x3ea384);}['login'](_0xcd5946){return __awaiter(this,void 0,void 0,function*(){var _0x2effb5='login/'+_0xcd5946;try{const _0xf417cc=yield yield fetch(_0x2effb5);if(_0xf417cc['status']>0xc7&&_0xf417cc['status']<0x12c){const _0x3e2e56=yield _0xf417cc['json']();return new SuccessfulAuthResponse(_0x3e2e56);}const _0xf9d867=yield _0xf417cc['json']();return new FailedAuthResponse(_0xf9d867);}catch(_0x2b629b){if(_0x2b629b instanceof Error)return new FailedAuthResponse({'detail':_0x2b629b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x2b629b;}});}['refresh'](_0x436d12){return __awaiter(this,void 0,void 0,function*(){var _0x5c199e='refresh';try{const _0x432b7d=yield this['fetch']['post'](_0x5c199e,_0x436d12,null);if(_0x432b7d['status']>0xc7&&_0x432b7d['status']<0x12c){const _0x9df81d=yield _0x432b7d['json']();return new SuccessfulAuthResponse(_0x9df81d);}const _0xf90e20=yield _0x432b7d['json']();return new FailedAuthResponse(_0xf90e20);}catch(_0x5e60a2){if(_0x5e60a2 instanceof Error)return new FailedAuthResponse({'detail':_0x5e60a2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5e60a2;}});}['getTokenStatus'](_0x1f5713){if(Date['now']()<_0x1f5713['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x1f5713['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
11
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x1d3050,_0x33455b,_0x2f1357,_0x4b48b0){function _0x250908(_0x1b4a1a){return _0x1b4a1a instanceof _0x2f1357?_0x1b4a1a:new _0x2f1357(function(_0x489315){_0x489315(_0x1b4a1a);});}return new(_0x2f1357||(_0x2f1357=Promise))(function(_0x3f3554,_0x37a6ac){function _0x3875a4(_0x4ed3d5){try{_0x4f2e00(_0x4b48b0['next'](_0x4ed3d5));}catch(_0x4df48a){_0x37a6ac(_0x4df48a);}}function _0x297db5(_0x26e0a9){try{_0x4f2e00(_0x4b48b0['throw'](_0x26e0a9));}catch(_0x54b6ef){_0x37a6ac(_0x54b6ef);}}function _0x4f2e00(_0x36dc71){_0x36dc71['done']?_0x3f3554(_0x36dc71['value']):_0x250908(_0x36dc71['value'])['then'](_0x3875a4,_0x297db5);}_0x4f2e00((_0x4b48b0=_0x4b48b0['apply'](_0x1d3050,_0x33455b||[]))['next']());});};class AdminClient{constructor(_0x214b10='https://admin.searchability.dev/'){var _0x3b1ff5=new Fetch(_0x214b10);this['Accounts']=new AccountService(_0x3b1ff5),this['Lists']=new ListService(_0x3b1ff5),this['ApiKeys']=new ApiKeyService(_0x3b1ff5);}}class AuthClient{constructor(_0x2e4f8f='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x2e4f8f);}['login'](_0xe5d426){return __awaiter(this,void 0,void 0,function*(){var _0xc38f1c='login/'+_0xe5d426;try{const _0x23320f=yield yield fetch(_0xc38f1c);if(_0x23320f['status']>0xc7&&_0x23320f['status']<0x12c){const _0x1be40a=yield _0x23320f['json']();return new SuccessfulAuthResponse(_0x1be40a);}const _0x4b6261=yield _0x23320f['json']();return new FailedAuthResponse(_0x4b6261);}catch(_0xbad3ae){if(_0xbad3ae instanceof Error)return new FailedAuthResponse({'detail':_0xbad3ae['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xbad3ae;}});}['refresh'](_0x363ccf){return __awaiter(this,void 0,void 0,function*(){var _0x25970d='refresh';try{const _0x354abb=yield this['fetch']['post'](_0x25970d,_0x363ccf,null);if(_0x354abb['status']>0xc7&&_0x354abb['status']<0x12c){const _0x2b35fd=yield _0x354abb['json']();return new SuccessfulAuthResponse(_0x2b35fd);}const _0x52df8e=yield _0x354abb['json']();return new FailedAuthResponse(_0x52df8e);}catch(_0x24b181){if(_0x24b181 instanceof Error)return new FailedAuthResponse({'detail':_0x24b181['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x24b181;}});}['getTokenStatus'](_0x2b198d){if(Date['now']()<_0x2b198d['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x2b198d['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
12
12
 
13
13
  export { AdminClient, AuthClient, TokenStatus, Tokens };
package/dist/types.d.ts CHANGED
@@ -16,9 +16,11 @@ declare class AccountService {
16
16
 
17
17
  declare class ApiKeyService {
18
18
  readonly fetch: Fetch;
19
+ readonly path = "api-key";
19
20
  constructor(fetch: Fetch);
20
21
  create(account_name: string, api_key_Name: string, access_token: string): Promise<Response<ApiKey, Problem>>;
21
22
  view(account_name: string, api_key_name: string, access_token: string): Promise<Response<ApiKeyValue, Problem>>;
23
+ delete(account_name: string, api_key_name: string, access_token: string): Promise<Response<any, Problem>>;
22
24
  }
23
25
 
24
26
  declare class ListService {
@@ -138,6 +140,18 @@ declare class SuccessfulApiKeyValueResponse extends Response<ApiKeyValue, Proble
138
140
  toSuccess(): ApiKeyValue;
139
141
  toProblem(): Problem;
140
142
  }
143
+ declare class SuccessfulResponse extends Response<any, Problem> {
144
+ readonly obj: any;
145
+ constructor(obj: any);
146
+ toSuccess(): any;
147
+ toProblem(): Problem;
148
+ }
149
+ declare class FailedResponse extends Response<any, Problem> {
150
+ readonly problem: Problem;
151
+ constructor(problem: Problem);
152
+ toSuccess(): any;
153
+ toProblem(): Problem;
154
+ }
141
155
  declare class FailedApiKeyValueResponse extends Response<ApiKeyValue, Problem> {
142
156
  readonly problem: Problem;
143
157
  constructor(problem: Problem);
@@ -145,4 +159,4 @@ declare class FailedApiKeyValueResponse extends Response<ApiKeyValue, Problem> {
145
159
  toProblem(): Problem;
146
160
  }
147
161
 
148
- export { type Account, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, TokenStatus, Tokens };
162
+ export { type Account, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, FailedResponse, type List, type ListIdentity, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, SuccessfulResponse, TokenStatus, Tokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
@@ -1,13 +0,0 @@
1
- var TokenStatus;(function(_0x4f58b5){_0x4f58b5[_0x4f58b5['Ok']=0x0]='Ok',_0x4f58b5[_0x4f58b5['Refresh']=0x1]='Refresh',_0x4f58b5[_0x4f58b5['Expired']=0x2]='Expired';}(TokenStatus||(TokenStatus={})));class Tokens{constructor(){this['access_token']='',this['access_expires']=0x0,this['refresh_token']='',this['refresh_expires']=0x0;}}class Response{constructor(_0x114535){this['isSuccess']=_0x114535;}}class SuccessfulAccountResponse extends Response{constructor(_0x580886){super(!![]),this['account']=_0x580886;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x7a06fe){super(![]),this['problem']=_0x7a06fe;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x582d93){super(!![]),this['tokens']=_0x582d93;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x470b3d){super(![]),this['problem']=_0x470b3d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x28ccf9){super(!![]),this['apiKey']=_0x28ccf9;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x123715){super(![]),this['problem']=_0x123715;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x288cd4){super(!![]),this['apiKeyValue']=_0x288cd4;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyValueResponse extends Response{constructor(_0x5c9896){super(![]),this['problem']=_0x5c9896;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
2
-
3
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2eceab,_0x52c012,_0x3ae064,_0x2c9afd){function _0x2cc892(_0x37b707){return _0x37b707 instanceof _0x3ae064?_0x37b707:new _0x3ae064(function(_0x403138){_0x403138(_0x37b707);});}return new(_0x3ae064||(_0x3ae064=Promise))(function(_0x1fe38d,_0x2322e9){function _0x2a5c9a(_0x18e00e){try{_0x20b9d1(_0x2c9afd['next'](_0x18e00e));}catch(_0x208dd0){_0x2322e9(_0x208dd0);}}function _0x4b3e8d(_0x45bfd9){try{_0x20b9d1(_0x2c9afd['throw'](_0x45bfd9));}catch(_0x3c5b22){_0x2322e9(_0x3c5b22);}}function _0x20b9d1(_0x4ea42e){_0x4ea42e['done']?_0x1fe38d(_0x4ea42e['value']):_0x2cc892(_0x4ea42e['value'])['then'](_0x2a5c9a,_0x4b3e8d);}_0x20b9d1((_0x2c9afd=_0x2c9afd['apply'](_0x2eceab,_0x52c012||[]))['next']());});};class AccountService{constructor(_0xad7491){this['fetch']=_0xad7491;}['get'](_0xdf26b5,_0x1f1746){return __awaiter$4(this,void 0,void 0,function*(){const _0x9694de='Account/'+_0xdf26b5+'/',_0x1bf25d=yield this['fetch']['get'](_0x9694de,_0x1f1746);try{if(_0x1bf25d['status']>0xc7&&_0x1bf25d['status']<0x12c){const _0x4ab2ad=yield _0x1bf25d['json']();return new SuccessfulAccountResponse(_0x4ab2ad);}const _0x3d376e=yield _0x1bf25d['json']();return new FailedAccountResponse(_0x3d376e);}catch(_0x12eab3){if(_0x12eab3 instanceof Error)return new FailedAccountResponse({'detail':_0x12eab3['message'],'title':_0x12eab3['name'],'status':0x1f4,'instance':'','type':''});throw _0x12eab3;}});}}
4
-
5
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x310716,_0x41e776,_0x4044f2,_0x305a47){function _0xa6f2a4(_0x5d7377){return _0x5d7377 instanceof _0x4044f2?_0x5d7377:new _0x4044f2(function(_0x583da4){_0x583da4(_0x5d7377);});}return new(_0x4044f2||(_0x4044f2=Promise))(function(_0x442074,_0x507352){function _0xa4c537(_0x3c68a7){try{_0x5b4f31(_0x305a47['next'](_0x3c68a7));}catch(_0x1b7403){_0x507352(_0x1b7403);}}function _0x3cec4c(_0x41b24b){try{_0x5b4f31(_0x305a47['throw'](_0x41b24b));}catch(_0x208225){_0x507352(_0x208225);}}function _0x5b4f31(_0x3a023f){_0x3a023f['done']?_0x442074(_0x3a023f['value']):_0xa6f2a4(_0x3a023f['value'])['then'](_0xa4c537,_0x3cec4c);}_0x5b4f31((_0x305a47=_0x305a47['apply'](_0x310716,_0x41e776||[]))['next']());});};class ApiKeyService{constructor(_0x5bf80b){this['fetch']=_0x5bf80b;}['create'](_0x35a771,_0x66eeb8,_0x3746c3){return __awaiter$3(this,void 0,void 0,function*(){const _0x213f83='api-key/create',_0x7ee802={'account_name':_0x35a771,'api_key_name':_0x66eeb8};try{const _0x35551f=yield this['fetch']['post'](_0x213f83,_0x3746c3,_0x7ee802);if(_0x35551f['status']>0xc7&&_0x35551f['status']<0x12c){const _0x567470=yield _0x35551f['json']();return new SuccessfulApiKeyResponse(_0x567470);}const _0x6221fb=yield _0x35551f['json']();return new FailedApiKeyResponse(_0x6221fb);}catch(_0x4509ea){if(_0x4509ea instanceof Error)return new FailedApiKeyResponse({'detail':_0x4509ea['message'],'title':_0x4509ea['name'],'status':0x1f4,'instance':'','type':''});throw _0x4509ea;}});}['view'](_0x53d5d5,_0x2dd48e,_0x220016){return __awaiter$3(this,void 0,void 0,function*(){const _0x1fb399='api-key/'+_0x53d5d5+'/'+_0x2dd48e;try{const _0x3247aa=yield this['fetch']['get'](_0x1fb399,_0x220016);if(_0x3247aa['status']>0xc7&&_0x3247aa['status']<0x12c){const _0x3d53bb=yield _0x3247aa['json']();return new SuccessfulApiKeyValueResponse(_0x3d53bb);}const _0x2e0000=yield _0x3247aa['json']();return new FailedApiKeyValueResponse(_0x2e0000);}catch(_0xda6790){if(_0xda6790 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0xda6790['message'],'title':_0xda6790['name'],'status':0x1f4,'instance':'','type':''});throw _0xda6790;}});}}
6
-
7
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x166c19,_0x4f8330,_0xa52885,_0x23ed43){function _0x4b651b(_0x1221fb){return _0x1221fb instanceof _0xa52885?_0x1221fb:new _0xa52885(function(_0x569622){_0x569622(_0x1221fb);});}return new(_0xa52885||(_0xa52885=Promise))(function(_0x2a737c,_0x928801){function _0x35cd24(_0x376811){try{_0x20d91b(_0x23ed43['next'](_0x376811));}catch(_0x39dc0e){_0x928801(_0x39dc0e);}}function _0x1b84e1(_0x21b210){try{_0x20d91b(_0x23ed43['throw'](_0x21b210));}catch(_0x57b97c){_0x928801(_0x57b97c);}}function _0x20d91b(_0x536bd7){_0x536bd7['done']?_0x2a737c(_0x536bd7['value']):_0x4b651b(_0x536bd7['value'])['then'](_0x35cd24,_0x1b84e1);}_0x20d91b((_0x23ed43=_0x23ed43['apply'](_0x166c19,_0x4f8330||[]))['next']());});};class ListService{constructor(_0x1a36b8){this['fetch']=_0x1a36b8;}['add'](_0x44bfc8,_0x3d7cfe,_0x4f0180){return __awaiter$2(this,void 0,void 0,function*(){const _0x17fc7f='List',_0x5a1400={'account_name':_0x44bfc8,'list_name':_0x3d7cfe};try{const _0x5d1b6c=yield this['fetch']['post'](_0x17fc7f,_0x4f0180,_0x5a1400);if(_0x5d1b6c['status']>0xc7&&_0x5d1b6c['status']<0x12c){const _0x2b8931=yield _0x5d1b6c['json']();return new SuccessfulAccountResponse(_0x2b8931);}const _0x382914=yield _0x5d1b6c['json']();return new FailedAccountResponse(_0x382914);}catch(_0x4dd227){if(_0x4dd227 instanceof Error)return new FailedAccountResponse({'detail':_0x4dd227['message'],'title':_0x4dd227['name'],'status':0x1f4,'instance':'','type':''});throw _0x4dd227;}});}['remove'](_0x534eae,_0x4eda17,_0x45d452){return __awaiter$2(this,void 0,void 0,function*(){const _0x25e5e8='List/'+_0x534eae+'/'+_0x4eda17,_0x5656e9=yield this['fetch']['delete'](_0x25e5e8,_0x45d452);try{if(_0x5656e9['status']>0xc7&&_0x5656e9['status']<0x12c){const _0x1bde21=yield _0x5656e9['json']();return new SuccessfulAccountResponse(_0x1bde21);}const _0x12b653=yield _0x5656e9['json']();return new FailedAccountResponse(_0x12b653);}catch(_0x405c88){if(_0x405c88 instanceof Error)return new FailedAccountResponse({'detail':_0x405c88['message'],'title':_0x405c88['name'],'status':0x1f4,'instance':'','type':''});throw _0x405c88;}});}}
8
-
9
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1994a4,_0x5f2478,_0x249c13,_0x38d0b2){function _0x44c84c(_0x4189e6){return _0x4189e6 instanceof _0x249c13?_0x4189e6:new _0x249c13(function(_0xbb9c2e){_0xbb9c2e(_0x4189e6);});}return new(_0x249c13||(_0x249c13=Promise))(function(_0x3333e2,_0x1b575f){function _0x50f0f0(_0xd8b1e){try{_0x2202a6(_0x38d0b2['next'](_0xd8b1e));}catch(_0x30acc9){_0x1b575f(_0x30acc9);}}function _0x38c42b(_0x5c951e){try{_0x2202a6(_0x38d0b2['throw'](_0x5c951e));}catch(_0x446715){_0x1b575f(_0x446715);}}function _0x2202a6(_0x4185fd){_0x4185fd['done']?_0x3333e2(_0x4185fd['value']):_0x44c84c(_0x4185fd['value'])['then'](_0x50f0f0,_0x38c42b);}_0x2202a6((_0x38d0b2=_0x38d0b2['apply'](_0x1994a4,_0x5f2478||[]))['next']());});};class Fetch{constructor(_0x2574ed){this['baseUri']=_0x2574ed,this['getUrl']=_0x1a4784=>{return _0x1a4784['startsWith']('/')&&(_0x1a4784=_0x1a4784['replace']('/','')),''+this['baseUri']+_0x1a4784;},!_0x2574ed['endsWith']('/')&&(_0x2574ed=_0x2574ed+'/');}['get'](_0x14ebef,_0x5b9513){return __awaiter$1(this,void 0,void 0,function*(){const _0x3f4bde=this['getUrl'](_0x14ebef);return yield fetch(_0x3f4bde,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5b9513}});});}['post'](_0x2bcc5d,_0x19527b,_0x2c7e44){return __awaiter$1(this,void 0,void 0,function*(){const _0x34e458=this['getUrl'](_0x2bcc5d);return yield fetch(_0x34e458,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x19527b},'body':_0x2c7e44?JSON['stringify'](_0x2c7e44):null});});}['put'](_0x2a0b53,_0xe119a,_0x4247a0){return __awaiter$1(this,void 0,void 0,function*(){const _0x182986=this['getUrl'](_0x2a0b53);return yield fetch(_0x182986,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xe119a},'body':_0x4247a0?JSON['stringify'](_0x4247a0):null});});}['delete'](_0x3c60c2,_0x35a97a){return __awaiter$1(this,void 0,void 0,function*(){const _0x488e04=this['getUrl'](_0x3c60c2);return yield fetch(_0x488e04,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x35a97a}});});}}
10
-
11
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x1dbb78,_0x573a85,_0x16df99,_0x4ed601){function _0x1fd13f(_0x194b56){return _0x194b56 instanceof _0x16df99?_0x194b56:new _0x16df99(function(_0x83a5b8){_0x83a5b8(_0x194b56);});}return new(_0x16df99||(_0x16df99=Promise))(function(_0x480902,_0xcf82cf){function _0x11e16d(_0x5098f3){try{_0x468f58(_0x4ed601['next'](_0x5098f3));}catch(_0xaef500){_0xcf82cf(_0xaef500);}}function _0x3a728a(_0x184e44){try{_0x468f58(_0x4ed601['throw'](_0x184e44));}catch(_0x34c2f0){_0xcf82cf(_0x34c2f0);}}function _0x468f58(_0x5933ac){_0x5933ac['done']?_0x480902(_0x5933ac['value']):_0x1fd13f(_0x5933ac['value'])['then'](_0x11e16d,_0x3a728a);}_0x468f58((_0x4ed601=_0x4ed601['apply'](_0x1dbb78,_0x573a85||[]))['next']());});};class AdminClient{constructor(_0x4a01a8='https://admin.searchability.dev/'){var _0x296634=new Fetch(_0x4a01a8);this['Accounts']=new AccountService(_0x296634),this['Lists']=new ListService(_0x296634),this['ApiKeys']=new ApiKeyService(_0x296634);}}class AuthClient{constructor(_0x1825fe='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x1825fe);}['login'](_0x54b05f){return __awaiter(this,void 0,void 0,function*(){var _0x5c8292='login/'+_0x54b05f;try{const _0x5276ff=yield yield fetch(_0x5c8292);if(_0x5276ff['status']>0xc7&&_0x5276ff['status']<0x12c){const _0x18284f=yield _0x5276ff['json']();return new SuccessfulAuthResponse(_0x18284f);}const _0x41b7b8=yield _0x5276ff['json']();return new FailedAuthResponse(_0x41b7b8);}catch(_0x1cd60a){if(_0x1cd60a instanceof Error)return new FailedAuthResponse({'detail':_0x1cd60a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1cd60a;}});}['refresh'](_0x1ac50f){return __awaiter(this,void 0,void 0,function*(){var _0x539465='refresh';try{const _0x306955=yield this['fetch']['post'](_0x539465,_0x1ac50f,null);if(_0x306955['status']>0xc7&&_0x306955['status']<0x12c){const _0x4d9f3b=yield _0x306955['json']();return new SuccessfulAuthResponse(_0x4d9f3b);}const _0x945c1=yield _0x306955['json']();return new FailedAuthResponse(_0x945c1);}catch(_0x3c74d7){if(_0x3c74d7 instanceof Error)return new FailedAuthResponse({'detail':_0x3c74d7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3c74d7;}});}['getTokenStatus'](_0x3a821e){if(Date['now']()<_0x3a821e['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x3a821e['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
12
-
13
- export { AdminClient, AuthClient, TokenStatus, Tokens };