@searchability/admin-client 0.0.33 → 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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var TokenStatus;(function(_0x2a308b){_0x2a308b[_0x2a308b['Ok']=0x0]='Ok',_0x2a308b[_0x2a308b['Refresh']=0x1]='Refresh',_0x2a308b[_0x2a308b['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(_0xf8d7e3){this['isSuccess']=_0xf8d7e3;}}class SuccessfulAccountResponse extends Response{constructor(_0x775645){super(!![]),this['account']=_0x775645;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x122d4f){super(![]),this['problem']=_0x122d4f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x38849d){super(!![]),this['tokens']=_0x38849d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x355c1a){super(![]),this['problem']=_0x355c1a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x143438){super(!![]),this['apiKey']=_0x143438;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x7b9756){super(![]),this['problem']=_0x7b9756;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x4bf273){super(!![]),this['apiKeyValue']=_0x4bf273;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x3cf6d5){super(!![]),this['obj']=_0x3cf6d5;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x35001c){super(![]),this['problem']=_0x35001c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x2b7e91){super(![]),this['problem']=_0x2b7e91;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
|
-
|
|
3
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x5a86b6,_0x27a414,_0x3dced5,_0x54213f){function _0xaf965b(_0x56a2ae){return _0x56a2ae instanceof _0x3dced5?_0x56a2ae:new _0x3dced5(function(_0x822439){_0x822439(_0x56a2ae);});}return new(_0x3dced5||(_0x3dced5=Promise))(function(_0x1c96ed,_0x1bd900){function _0x30b491(_0x434cd9){try{_0x339cce(_0x54213f['next'](_0x434cd9));}catch(_0xfb1c9a){_0x1bd900(_0xfb1c9a);}}function _0x5c9d85(_0x3903dc){try{_0x339cce(_0x54213f['throw'](_0x3903dc));}catch(_0x512063){_0x1bd900(_0x512063);}}function _0x339cce(_0x41e149){_0x41e149['done']?_0x1c96ed(_0x41e149['value']):_0xaf965b(_0x41e149['value'])['then'](_0x30b491,_0x5c9d85);}_0x339cce((_0x54213f=_0x54213f['apply'](_0x5a86b6,_0x27a414||[]))['next']());});};class AccountService{constructor(_0x3a5d10){this['fetch']=_0x3a5d10;}['get'](_0xb7fd5d,_0x395fad){return __awaiter$4(this,void 0,void 0,function*(){const _0x9f7e1a='Account/'+_0xb7fd5d+'/',_0x267e05=yield this['fetch']['get'](_0x9f7e1a,_0x395fad);try{if(_0x267e05['status']>0xc7&&_0x267e05['status']<0x12c){const _0x8065aa=yield _0x267e05['json']();return new SuccessfulAccountResponse(_0x8065aa);}const _0x4b5c83=yield _0x267e05['json']();return new FailedAccountResponse(_0x4b5c83);}catch(_0xe673ea){if(_0xe673ea instanceof Error)return new FailedAccountResponse({'detail':_0xe673ea['message'],'title':_0xe673ea['name'],'status':0x1f4,'instance':'','type':''});throw _0xe673ea;}});}}
|
|
4
|
-
|
|
5
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x27f55f,_0xecb314,_0x5c02db,_0x102800){function _0x3d5fcf(_0x1a8824){return _0x1a8824 instanceof _0x5c02db?_0x1a8824:new _0x5c02db(function(_0x2b1b92){_0x2b1b92(_0x1a8824);});}return new(_0x5c02db||(_0x5c02db=Promise))(function(_0x424cc1,_0x51f70f){function _0x4a0a22(_0x2dad9a){try{_0x52ff19(_0x102800['next'](_0x2dad9a));}catch(_0xcba181){_0x51f70f(_0xcba181);}}function _0x1828b9(_0x59bc94){try{_0x52ff19(_0x102800['throw'](_0x59bc94));}catch(_0x2feda8){_0x51f70f(_0x2feda8);}}function _0x52ff19(_0x2a62f9){_0x2a62f9['done']?_0x424cc1(_0x2a62f9['value']):_0x3d5fcf(_0x2a62f9['value'])['then'](_0x4a0a22,_0x1828b9);}_0x52ff19((_0x102800=_0x102800['apply'](_0x27f55f,_0xecb314||[]))['next']());});};class ApiKeyService{constructor(_0x32c022){this['fetch']=_0x32c022,this['path']='api-key';}['create'](_0x3d4b1a,_0x2febf2,_0x1f7ae4){return __awaiter$3(this,void 0,void 0,function*(){const _0xe76f9b={'account_name':_0x3d4b1a,'api_key_name':_0x2febf2};try{const _0x2e32dc=yield this['fetch']['post'](this['path'],_0x1f7ae4,_0xe76f9b);if(_0x2e32dc['status']>0xc7&&_0x2e32dc['status']<0x12c){const _0x8eaa8c=yield _0x2e32dc['json']();return new SuccessfulApiKeyResponse(_0x8eaa8c);}const _0xcd822e=yield _0x2e32dc['json']();return new FailedApiKeyResponse(_0xcd822e);}catch(_0x5ae12d){if(_0x5ae12d instanceof Error)return new FailedApiKeyResponse({'detail':_0x5ae12d['message'],'title':_0x5ae12d['name'],'status':0x1f4,'instance':'','type':''});throw _0x5ae12d;}});}['view'](_0x518ded,_0x254109,_0x5636db){return __awaiter$3(this,void 0,void 0,function*(){const _0x1d36a5=this['path']+'/'+_0x518ded+'/'+_0x254109;try{const _0x2c0872=yield this['fetch']['get'](_0x1d36a5,_0x5636db);if(_0x2c0872['status']>0xc7&&_0x2c0872['status']<0x12c){const _0x345218=yield _0x2c0872['json']();return new SuccessfulApiKeyValueResponse(_0x345218);}const _0x5354d0=yield _0x2c0872['json']();return new FailedApiKeyValueResponse(_0x5354d0);}catch(_0x341830){if(_0x341830 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x341830['message'],'title':_0x341830['name'],'status':0x1f4,'instance':'','type':''});throw _0x341830;}});}['delete'](_0x2df9b0,_0x56f089,_0x2bfdc4){return __awaiter$3(this,void 0,void 0,function*(){const _0x2d81d3=this['path']+'/'+_0x2df9b0+'/'+_0x56f089;try{const _0x412b0f=yield this['fetch']['delete'](_0x2d81d3,_0x2bfdc4);if(_0x412b0f['status']>0xc7&&_0x412b0f['status']<0x12c){const _0x49a576=yield _0x412b0f['json']();return new SuccessfulResponse(_0x49a576);}const _0x5658e1=yield _0x412b0f['json']();return new FailedResponse(_0x5658e1);}catch(_0x2a1724){if(_0x2a1724 instanceof Error)return new FailedResponse({'detail':_0x2a1724['message'],'title':_0x2a1724['name'],'status':0x1f4,'instance':'','type':''});throw _0x2a1724;}});}}
|
|
6
|
-
|
|
7
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4031b0,_0x1f1ffa,_0x5498b6,_0x39e1e5){function _0x20caae(_0x50b61b){return _0x50b61b instanceof _0x5498b6?_0x50b61b:new _0x5498b6(function(_0x223384){_0x223384(_0x50b61b);});}return new(_0x5498b6||(_0x5498b6=Promise))(function(_0x2330f,_0x5a4626){function _0x29c9b5(_0x21c3cc){try{_0x47fb65(_0x39e1e5['next'](_0x21c3cc));}catch(_0x4f7bae){_0x5a4626(_0x4f7bae);}}function _0x2ab76d(_0x2b826c){try{_0x47fb65(_0x39e1e5['throw'](_0x2b826c));}catch(_0x105b19){_0x5a4626(_0x105b19);}}function _0x47fb65(_0x3a14e0){_0x3a14e0['done']?_0x2330f(_0x3a14e0['value']):_0x20caae(_0x3a14e0['value'])['then'](_0x29c9b5,_0x2ab76d);}_0x47fb65((_0x39e1e5=_0x39e1e5['apply'](_0x4031b0,_0x1f1ffa||[]))['next']());});};class ListService{constructor(_0x113331){this['fetch']=_0x113331;}['add'](_0x3e7a64,_0x53f646,_0xc25477){return __awaiter$2(this,void 0,void 0,function*(){const _0x224b83='List',_0x38ad16={'account_name':_0x3e7a64,'list_name':_0x53f646};try{const _0x9e9ec3=yield this['fetch']['post'](_0x224b83,_0xc25477,_0x38ad16);if(_0x9e9ec3['status']>0xc7&&_0x9e9ec3['status']<0x12c){const _0x3cea10=yield _0x9e9ec3['json']();return new SuccessfulAccountResponse(_0x3cea10);}const _0x238925=yield _0x9e9ec3['json']();return new FailedAccountResponse(_0x238925);}catch(_0x348124){if(_0x348124 instanceof Error)return new FailedAccountResponse({'detail':_0x348124['message'],'title':_0x348124['name'],'status':0x1f4,'instance':'','type':''});throw _0x348124;}});}['remove'](_0x2fd63f,_0x34c869,_0x24084f){return __awaiter$2(this,void 0,void 0,function*(){const _0x4403ef='List/'+_0x2fd63f+'/'+_0x34c869,_0x1b18d7=yield this['fetch']['delete'](_0x4403ef,_0x24084f);try{if(_0x1b18d7['status']>0xc7&&_0x1b18d7['status']<0x12c){const _0x7a2824=yield _0x1b18d7['json']();return new SuccessfulAccountResponse(_0x7a2824);}const _0x25dd34=yield _0x1b18d7['json']();return new FailedAccountResponse(_0x25dd34);}catch(_0x8e46d7){if(_0x8e46d7 instanceof Error)return new FailedAccountResponse({'detail':_0x8e46d7['message'],'title':_0x8e46d7['name'],'status':0x1f4,'instance':'','type':''});throw _0x8e46d7;}});}}
|
|
8
|
-
|
|
9
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x3f6100,_0x1fedd3,_0xdfe76,_0xff7d93){function _0x38fa72(_0x2a045d){return _0x2a045d instanceof _0xdfe76?_0x2a045d:new _0xdfe76(function(_0x43234a){_0x43234a(_0x2a045d);});}return new(_0xdfe76||(_0xdfe76=Promise))(function(_0x42f46d,_0x650c87){function _0x2e8d16(_0x21ae29){try{_0x5a63b9(_0xff7d93['next'](_0x21ae29));}catch(_0x4850b3){_0x650c87(_0x4850b3);}}function _0x3d0034(_0x24fc94){try{_0x5a63b9(_0xff7d93['throw'](_0x24fc94));}catch(_0x6511){_0x650c87(_0x6511);}}function _0x5a63b9(_0x5deb12){_0x5deb12['done']?_0x42f46d(_0x5deb12['value']):_0x38fa72(_0x5deb12['value'])['then'](_0x2e8d16,_0x3d0034);}_0x5a63b9((_0xff7d93=_0xff7d93['apply'](_0x3f6100,_0x1fedd3||[]))['next']());});};class Fetch{constructor(_0x74f72f){this['baseUri']=_0x74f72f,this['getUrl']=_0x35f00a=>{return _0x35f00a['startsWith']('/')&&(_0x35f00a=_0x35f00a['replace']('/','')),''+this['baseUri']+_0x35f00a;},!_0x74f72f['endsWith']('/')&&(_0x74f72f=_0x74f72f+'/');}['get'](_0x2bf6f6,_0x36df34){return __awaiter$1(this,void 0,void 0,function*(){const _0x18eed9=this['getUrl'](_0x2bf6f6);return yield fetch(_0x18eed9,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x36df34}});});}['post'](_0x1ab288,_0x50ef7e,_0x4727b0){return __awaiter$1(this,void 0,void 0,function*(){const _0x48bfd6=this['getUrl'](_0x1ab288);return yield fetch(_0x48bfd6,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x50ef7e},'body':_0x4727b0?JSON['stringify'](_0x4727b0):null});});}['put'](_0x323e74,_0x45ac6c,_0x55f087){return __awaiter$1(this,void 0,void 0,function*(){const _0x58c6da=this['getUrl'](_0x323e74);return yield fetch(_0x58c6da,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x45ac6c},'body':_0x55f087?JSON['stringify'](_0x55f087):null});});}['delete'](_0x15a715,_0x13b25b){return __awaiter$1(this,void 0,void 0,function*(){const _0x1ce9b4=this['getUrl'](_0x15a715);return yield fetch(_0x1ce9b4,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x13b25b}});});}}
|
|
10
|
-
|
|
11
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x25a31a,_0x18450e,_0xc4cf7b,_0x12908f){function _0x3a116a(_0x3aa515){return _0x3aa515 instanceof _0xc4cf7b?_0x3aa515:new _0xc4cf7b(function(_0x9a9b97){_0x9a9b97(_0x3aa515);});}return new(_0xc4cf7b||(_0xc4cf7b=Promise))(function(_0x24808d,_0x269922){function _0x128627(_0xa3abe9){try{_0x10eb42(_0x12908f['next'](_0xa3abe9));}catch(_0x1149c9){_0x269922(_0x1149c9);}}function _0x17967a(_0x3e61e3){try{_0x10eb42(_0x12908f['throw'](_0x3e61e3));}catch(_0x3bba12){_0x269922(_0x3bba12);}}function _0x10eb42(_0x21775b){_0x21775b['done']?_0x24808d(_0x21775b['value']):_0x3a116a(_0x21775b['value'])['then'](_0x128627,_0x17967a);}_0x10eb42((_0x12908f=_0x12908f['apply'](_0x25a31a,_0x18450e||[]))['next']());});};class AdminClient{constructor(_0x2ea3e8='https://admin.searchability.dev/'){var _0x4f6485=new Fetch(_0x2ea3e8);this['Accounts']=new AccountService(_0x4f6485),this['Lists']=new ListService(_0x4f6485),this['ApiKeys']=new ApiKeyService(_0x4f6485);}}class AuthClient{constructor(_0x5a4b3f='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x5a4b3f);}['login'](_0x55ccd9){return __awaiter(this,void 0,void 0,function*(){var _0x325657='login/'+_0x55ccd9;try{const _0x4a263e=yield yield fetch(_0x325657);if(_0x4a263e['status']>0xc7&&_0x4a263e['status']<0x12c){const _0x4548c6=yield _0x4a263e['json']();return new SuccessfulAuthResponse(_0x4548c6);}const _0x5460ac=yield _0x4a263e['json']();return new FailedAuthResponse(_0x5460ac);}catch(_0x52a367){if(_0x52a367 instanceof Error)return new FailedAuthResponse({'detail':_0x52a367['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x52a367;}});}['refresh'](_0x1950e9){return __awaiter(this,void 0,void 0,function*(){var _0x269ff7='refresh';try{const _0x51e0be=yield this['fetch']['post'](_0x269ff7,_0x1950e9,null);if(_0x51e0be['status']>0xc7&&_0x51e0be['status']<0x12c){const _0x293cca=yield _0x51e0be['json']();return new SuccessfulAuthResponse(_0x293cca);}const _0x13a40f=yield _0x51e0be['json']();return new FailedAuthResponse(_0x13a40f);}catch(_0x244f38){if(_0x244f38 instanceof Error)return new FailedAuthResponse({'detail':_0x244f38['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x244f38;}});}['getTokenStatus'](_0x4ee299){if(Date['now']()<_0x4ee299['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x4ee299['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
12
|
-
|
|
13
|
-
export { AdminClient, AuthClient, TokenStatus, Tokens };
|