@searchability/admin-client 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var TokenStatus;(function(_0x11d440){_0x11d440[_0x11d440['Ok']=0x0]='Ok',_0x11d440[_0x11d440['Refresh']=0x1]='Refresh',_0x11d440[_0x11d440['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(_0x102230){this['isSuccess']=_0x102230;}}class SuccessfulAccountResponse extends Response{constructor(_0x1c9f27){super(!![]),this['account']=_0x1c9f27;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x4ce2e3){super(![]),this['problem']=_0x4ce2e3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x5790c5){super(!![]),this['tokens']=_0x5790c5;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x345d41){super(![]),this['problem']=_0x345d41;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x1eaf7a){super(!![]),this['apiKey']=_0x1eaf7a;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x420599){super(![]),this['problem']=_0x420599;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x441268){super(!![]),this['searchService']=_0x441268;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x33e46b){super(![]),this['problem']=_0x33e46b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x197d3b){super(!![]),this['searchService']=_0x197d3b;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServiceResponse extends Response{constructor(_0x56c163){super(![]),this['problem']=_0x56c163;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x55f04f){super(!![]),this['apiKeyValue']=_0x55f04f;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x3eb84b){super(!![]),this['obj']=_0x3eb84b;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x155c91){super(![]),this['problem']=_0x155c91;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x9e7e39){super(![]),this['problem']=_0x9e7e39;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
|
+
|
|
3
|
+
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x3c4c88,_0x4580d4,_0x27bf3e,_0x1ebdc1){function _0x369274(_0x5b737b){return _0x5b737b instanceof _0x27bf3e?_0x5b737b:new _0x27bf3e(function(_0x50560b){_0x50560b(_0x5b737b);});}return new(_0x27bf3e||(_0x27bf3e=Promise))(function(_0x1c7540,_0x1fd10b){function _0x151c67(_0x406d48){try{_0x52aa6e(_0x1ebdc1['next'](_0x406d48));}catch(_0xdbede1){_0x1fd10b(_0xdbede1);}}function _0x230851(_0x56dbec){try{_0x52aa6e(_0x1ebdc1['throw'](_0x56dbec));}catch(_0xe9a3ee){_0x1fd10b(_0xe9a3ee);}}function _0x52aa6e(_0x2ca49c){_0x2ca49c['done']?_0x1c7540(_0x2ca49c['value']):_0x369274(_0x2ca49c['value'])['then'](_0x151c67,_0x230851);}_0x52aa6e((_0x1ebdc1=_0x1ebdc1['apply'](_0x3c4c88,_0x4580d4||[]))['next']());});};class AccountService{constructor(_0x429034){this['fetch']=_0x429034;}['get'](_0x3a298b,_0x540bec){return __awaiter$5(this,void 0,void 0,function*(){const _0x3ed165='Account/'+_0x3a298b+'/',_0x347f2f=yield this['fetch']['get'](_0x3ed165,_0x540bec);try{if(_0x347f2f['status']>0xc7&&_0x347f2f['status']<0x12c){const _0x53f464=yield _0x347f2f['json']();return new SuccessfulAccountResponse(_0x53f464);}const _0xe46891=yield _0x347f2f['json']();return new FailedAccountResponse(_0xe46891);}catch(_0x2afce8){if(_0x2afce8 instanceof Error)return new FailedAccountResponse({'detail':_0x2afce8['message'],'title':_0x2afce8['name'],'status':0x1f4,'instance':'','type':''});throw _0x2afce8;}});}}
|
|
4
|
+
|
|
5
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x40688a,_0x1a4c28,_0x40f8c6,_0x55c028){function _0x58e013(_0x29a6ee){return _0x29a6ee instanceof _0x40f8c6?_0x29a6ee:new _0x40f8c6(function(_0xdc9941){_0xdc9941(_0x29a6ee);});}return new(_0x40f8c6||(_0x40f8c6=Promise))(function(_0x26a468,_0x1c2c2c){function _0x196a14(_0x5d8f38){try{_0x288b9b(_0x55c028['next'](_0x5d8f38));}catch(_0x16061f){_0x1c2c2c(_0x16061f);}}function _0x257be3(_0x3b31a9){try{_0x288b9b(_0x55c028['throw'](_0x3b31a9));}catch(_0x13e90d){_0x1c2c2c(_0x13e90d);}}function _0x288b9b(_0x3f902e){_0x3f902e['done']?_0x26a468(_0x3f902e['value']):_0x58e013(_0x3f902e['value'])['then'](_0x196a14,_0x257be3);}_0x288b9b((_0x55c028=_0x55c028['apply'](_0x40688a,_0x1a4c28||[]))['next']());});};class ApiKeyService{constructor(_0x31dce4){this['fetch']=_0x31dce4,this['path']='api-key';}['create'](_0x58ec33,_0x16323f,_0x520c41){return __awaiter$4(this,void 0,void 0,function*(){const _0xa1da63={'account_name':_0x58ec33,'api_key_name':_0x16323f};try{const _0x3a0b2c=yield this['fetch']['post'](this['path'],_0x520c41,_0xa1da63);if(_0x3a0b2c['status']>0xc7&&_0x3a0b2c['status']<0x12c){const _0x3b3b48=yield _0x3a0b2c['json']();return new SuccessfulApiKeyResponse(_0x3b3b48);}const _0xa3dcee=yield _0x3a0b2c['json']();return new FailedApiKeyResponse(_0xa3dcee);}catch(_0x2ed6a5){if(_0x2ed6a5 instanceof Error)return new FailedApiKeyResponse({'detail':_0x2ed6a5['message'],'title':_0x2ed6a5['name'],'status':0x1f4,'instance':'','type':''});throw _0x2ed6a5;}});}['view'](_0x3b0151,_0x45604b,_0x16b318){return __awaiter$4(this,void 0,void 0,function*(){const _0x277ae3=this['path']+'/'+_0x3b0151+'/'+_0x45604b;try{const _0x435b57=yield this['fetch']['get'](_0x277ae3,_0x16b318);if(_0x435b57['status']>0xc7&&_0x435b57['status']<0x12c){const _0x27725a=yield _0x435b57['json']();return new SuccessfulApiKeyValueResponse(_0x27725a);}const _0x156749=yield _0x435b57['json']();return new FailedApiKeyValueResponse(_0x156749);}catch(_0x291321){if(_0x291321 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x291321['message'],'title':_0x291321['name'],'status':0x1f4,'instance':'','type':''});throw _0x291321;}});}['delete'](_0x3c10e3,_0x49146c,_0x4b071d){return __awaiter$4(this,void 0,void 0,function*(){const _0x56e95c=this['path']+'/'+_0x3c10e3+'/'+_0x49146c;try{const _0x226c71=yield this['fetch']['delete'](_0x56e95c,_0x4b071d);if(_0x226c71['status']>0xc7&&_0x226c71['status']<0x12c)return new SuccessfulResponse({});const _0x386fcb=yield _0x226c71['json']();return new FailedResponse(_0x386fcb);}catch(_0x160445){if(_0x160445 instanceof Error)return new FailedResponse({'detail':_0x160445['message'],'title':_0x160445['name'],'status':0x1f4,'instance':'','type':''});throw _0x160445;}});}}
|
|
6
|
+
|
|
7
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0xc17f57,_0x4e2f80,_0x363f73,_0x1bef2c){function _0x5c4942(_0x5b1acc){return _0x5b1acc instanceof _0x363f73?_0x5b1acc:new _0x363f73(function(_0x6f2457){_0x6f2457(_0x5b1acc);});}return new(_0x363f73||(_0x363f73=Promise))(function(_0x4c4e66,_0x58d813){function _0x336589(_0x4a9af4){try{_0x43709d(_0x1bef2c['next'](_0x4a9af4));}catch(_0xc17ff9){_0x58d813(_0xc17ff9);}}function _0x4c0705(_0x42ab25){try{_0x43709d(_0x1bef2c['throw'](_0x42ab25));}catch(_0x363a64){_0x58d813(_0x363a64);}}function _0x43709d(_0x57a338){_0x57a338['done']?_0x4c4e66(_0x57a338['value']):_0x5c4942(_0x57a338['value'])['then'](_0x336589,_0x4c0705);}_0x43709d((_0x1bef2c=_0x1bef2c['apply'](_0xc17f57,_0x4e2f80||[]))['next']());});};class ListService{constructor(_0x4c4f93){this['fetch']=_0x4c4f93;}['add'](_0x2e5ab5,_0x282eff,_0x1e2f4){return __awaiter$3(this,void 0,void 0,function*(){const _0x2981ae='List',_0xe52e77={'account_name':_0x2e5ab5,'list_name':_0x282eff};try{const _0xfeb13=yield this['fetch']['post'](_0x2981ae,_0x1e2f4,_0xe52e77);if(_0xfeb13['status']>0xc7&&_0xfeb13['status']<0x12c){const _0x14d1de=yield _0xfeb13['json']();return new SuccessfulAccountResponse(_0x14d1de);}const _0x4d5e9d=yield _0xfeb13['json']();return new FailedAccountResponse(_0x4d5e9d);}catch(_0x5b75a0){if(_0x5b75a0 instanceof Error)return new FailedAccountResponse({'detail':_0x5b75a0['message'],'title':_0x5b75a0['name'],'status':0x1f4,'instance':'','type':''});throw _0x5b75a0;}});}['remove'](_0x15bbc3,_0x5012ae,_0x441e9e){return __awaiter$3(this,void 0,void 0,function*(){const _0x1d6b5c='List/'+_0x15bbc3+'/'+_0x5012ae,_0x1dfa84=yield this['fetch']['delete'](_0x1d6b5c,_0x441e9e);try{if(_0x1dfa84['status']>0xc7&&_0x1dfa84['status']<0x12c){const _0x1a72d7=yield _0x1dfa84['json']();return new SuccessfulAccountResponse(_0x1a72d7);}const _0x122145=yield _0x1dfa84['json']();return new FailedAccountResponse(_0x122145);}catch(_0x44a661){if(_0x44a661 instanceof Error)return new FailedAccountResponse({'detail':_0x44a661['message'],'title':_0x44a661['name'],'status':0x1f4,'instance':'','type':''});throw _0x44a661;}});}}
|
|
8
|
+
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x412d83,_0x313f02,_0x53ea18,_0x23680a){function _0x35f9a7(_0x256ad9){return _0x256ad9 instanceof _0x53ea18?_0x256ad9:new _0x53ea18(function(_0x5b0e60){_0x5b0e60(_0x256ad9);});}return new(_0x53ea18||(_0x53ea18=Promise))(function(_0x4bef7c,_0x4d2de2){function _0x3a2ddf(_0x140713){try{_0x11566c(_0x23680a['next'](_0x140713));}catch(_0x1c70fb){_0x4d2de2(_0x1c70fb);}}function _0xda8b21(_0x4d700b){try{_0x11566c(_0x23680a['throw'](_0x4d700b));}catch(_0x300e14){_0x4d2de2(_0x300e14);}}function _0x11566c(_0x3c4837){_0x3c4837['done']?_0x4bef7c(_0x3c4837['value']):_0x35f9a7(_0x3c4837['value'])['then'](_0x3a2ddf,_0xda8b21);}_0x11566c((_0x23680a=_0x23680a['apply'](_0x412d83,_0x313f02||[]))['next']());});};class Fetch{constructor(_0x455c1f){this['baseUri']=_0x455c1f,this['getUrl']=_0x1e008a=>{return _0x1e008a['startsWith']('/')&&(_0x1e008a=_0x1e008a['replace']('/','')),''+this['baseUri']+_0x1e008a;},!_0x455c1f['endsWith']('/')&&(_0x455c1f=_0x455c1f+'/');}['get'](_0x3bc6bf,_0xaeb6d6){return __awaiter$2(this,void 0,void 0,function*(){const _0x4f5a90=this['getUrl'](_0x3bc6bf);return yield fetch(_0x4f5a90,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xaeb6d6}});});}['post'](_0x22373d,_0x210e42,_0x40d353){return __awaiter$2(this,void 0,void 0,function*(){const _0x29bf2d=this['getUrl'](_0x22373d);return yield fetch(_0x29bf2d,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x210e42},'body':_0x40d353?JSON['stringify'](_0x40d353):null});});}['PostNoAuth'](_0xde91c8,_0x40d99b){return __awaiter$2(this,void 0,void 0,function*(){const _0x3dba3f=this['getUrl'](_0xde91c8);return yield fetch(_0x3dba3f,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x40d99b?JSON['stringify'](_0x40d99b):null});});}['put'](_0x521bbf,_0x45e40f,_0x2deec7){return __awaiter$2(this,void 0,void 0,function*(){const _0x17206f=this['getUrl'](_0x521bbf);return yield fetch(_0x17206f,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x45e40f},'body':_0x2deec7?JSON['stringify'](_0x2deec7):null});});}['delete'](_0x4d5b4e,_0x4dc7fa){return __awaiter$2(this,void 0,void 0,function*(){const _0x8c11b4=this['getUrl'](_0x4d5b4e);return yield fetch(_0x8c11b4,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4dc7fa}});});}}
|
|
10
|
+
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x2d19cf,_0x5e7116,_0x1fc3ef,_0x425b48){function _0x34cf81(_0x4d838e){return _0x4d838e instanceof _0x1fc3ef?_0x4d838e:new _0x1fc3ef(function(_0x1c7c79){_0x1c7c79(_0x4d838e);});}return new(_0x1fc3ef||(_0x1fc3ef=Promise))(function(_0x277d1b,_0x41d6d9){function _0xaa8cb4(_0x7d2e21){try{_0x3617c5(_0x425b48['next'](_0x7d2e21));}catch(_0x25bdc3){_0x41d6d9(_0x25bdc3);}}function _0x397df5(_0x371bea){try{_0x3617c5(_0x425b48['throw'](_0x371bea));}catch(_0x282790){_0x41d6d9(_0x282790);}}function _0x3617c5(_0x5dacc7){_0x5dacc7['done']?_0x277d1b(_0x5dacc7['value']):_0x34cf81(_0x5dacc7['value'])['then'](_0xaa8cb4,_0x397df5);}_0x3617c5((_0x425b48=_0x425b48['apply'](_0x2d19cf,_0x5e7116||[]))['next']());});};class SearchServersService{constructor(_0x23cd31){this['fetch']=_0x23cd31,this['path']='search-services';}['create'](_0x5c9718,_0x25d925,_0x1fbd9c,_0x4a7409,_0x1bcdf3,_0xcdc58b,_0x426e55,_0x43f3bd){return __awaiter$1(this,void 0,void 0,function*(){const _0x562f79={'account_name':_0x5c9718,'search_service_name':_0x25d925,'endpoint':_0x1fbd9c,'key':_0x4a7409,'country':_0x1bcdf3,'provider':_0xcdc58b,'index_name':_0x426e55};try{const _0x21d779=yield this['fetch']['post'](this['path'],_0x43f3bd,_0x562f79);if(_0x21d779['status']>0xc7&&_0x21d779['status']<0x12c){const _0x3fbbc6=yield _0x21d779['json']();return new SuccessfulSearchServiceResponse(_0x3fbbc6);}const _0x57440b=yield _0x21d779['json']();return new FailedSearchServiceResponse(_0x57440b);}catch(_0x5158fd){if(_0x5158fd instanceof Error)return new FailedSearchServiceResponse({'detail':_0x5158fd['message'],'title':_0x5158fd['name'],'status':0x1f4,'instance':'','type':''});throw _0x5158fd;}});}['delete'](_0x2d486a,_0x144dcd,_0x25973a){return __awaiter$1(this,void 0,void 0,function*(){const _0x403f67=this['path']+'/'+_0x2d486a+'/'+_0x144dcd;try{const _0x2d4860=yield this['fetch']['delete'](_0x403f67,_0x25973a);if(_0x2d4860['status']>0xc7&&_0x2d4860['status']<0x12c)return new SuccessfulResponse({});const _0x80aa07=yield _0x2d4860['json']();return new FailedResponse(_0x80aa07);}catch(_0x4836f8){if(_0x4836f8 instanceof Error)return new FailedResponse({'detail':_0x4836f8['message'],'title':_0x4836f8['name'],'status':0x1f4,'instance':'','type':''});throw _0x4836f8;}});}['view'](_0x52855a,_0x3f0889,_0x36c047){return __awaiter$1(this,void 0,void 0,function*(){const _0x364209=this['path']+'/'+_0x52855a+'/'+_0x3f0889;try{const _0x383651=yield this['fetch']['get'](_0x364209,_0x36c047);if(_0x383651['status']>0xc7&&_0x383651['status']<0x12c){const _0x20b1b9=yield _0x383651['json']();return new SuccessfulViewSearchServiceResponse(_0x20b1b9);}const _0x38c00f=yield _0x383651['json']();return new FailedViewSearchServiceResponse(_0x38c00f);}catch(_0x1f549e){if(_0x1f549e instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x1f549e['message'],'title':_0x1f549e['name'],'status':0x1f4,'instance':'','type':''});throw _0x1f549e;}});}}
|
|
12
|
+
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x1e8cd3,_0x44ce49,_0x29568d,_0x405858){function _0x46545f(_0x20e906){return _0x20e906 instanceof _0x29568d?_0x20e906:new _0x29568d(function(_0x489f45){_0x489f45(_0x20e906);});}return new(_0x29568d||(_0x29568d=Promise))(function(_0x3b6eba,_0x3aa206){function _0x41ff66(_0x11f07e){try{_0x477755(_0x405858['next'](_0x11f07e));}catch(_0x35ca05){_0x3aa206(_0x35ca05);}}function _0x47a0bc(_0x938114){try{_0x477755(_0x405858['throw'](_0x938114));}catch(_0x279159){_0x3aa206(_0x279159);}}function _0x477755(_0x56c781){_0x56c781['done']?_0x3b6eba(_0x56c781['value']):_0x46545f(_0x56c781['value'])['then'](_0x41ff66,_0x47a0bc);}_0x477755((_0x405858=_0x405858['apply'](_0x1e8cd3,_0x44ce49||[]))['next']());});};class AdminClient{constructor(_0x4a406a='https://admin.searchability.dev/'){var _0x310f26=new Fetch(_0x4a406a);this['Accounts']=new AccountService(_0x310f26),this['Lists']=new ListService(_0x310f26),this['ApiKeys']=new ApiKeyService(_0x310f26),this['SearchServices']=new SearchServersService(_0x310f26);}}class AuthClient{constructor(_0x4164d4='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x4164d4);}['login'](_0x5090aa){return __awaiter(this,void 0,void 0,function*(){const _0x54f122='login/'+_0x5090aa;try{const _0x4977a7=yield yield fetch(_0x54f122);if(_0x4977a7['status']>0xc7&&_0x4977a7['status']<0x12c){const _0x162396=yield _0x4977a7['json']();return new SuccessfulAuthResponse(_0x162396);}const _0x326eb9=yield _0x4977a7['json']();return new FailedAuthResponse(_0x326eb9);}catch(_0x24db77){if(_0x24db77 instanceof Error)return new FailedAuthResponse({'detail':_0x24db77['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x24db77;}});}['refresh'](_0x450324){return __awaiter(this,void 0,void 0,function*(){const _0x472e65='refresh',_0x97d047={'refresh_token':_0x450324};try{const _0x4f8af9=yield this['fetch']['PostNoAuth'](_0x472e65,_0x97d047);if(_0x4f8af9['status']>0xc7&&_0x4f8af9['status']<0x12c){const _0x2351e3=yield _0x4f8af9['json']();return new SuccessfulAuthResponse(_0x2351e3);}const _0x176a2a=yield _0x4f8af9['json']();return new FailedAuthResponse(_0x176a2a);}catch(_0x593a50){if(_0x593a50 instanceof Error)return new FailedAuthResponse({'detail':_0x593a50['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x593a50;}});}['getTokenStatus'](_0x3ecc57){if(Date['now']()<_0x3ecc57['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x3ecc57['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
14
|
+
|
|
15
|
+
export { AdminClient, AuthClient, TokenStatus, Tokens };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
exports.TokenStatus = void 0;(function(
|
|
3
|
+
exports.TokenStatus = void 0;(function(_0x4b4dd4){_0x4b4dd4[_0x4b4dd4['Ok']=0x0]='Ok',_0x4b4dd4[_0x4b4dd4['Refresh']=0x1]='Refresh',_0x4b4dd4[_0x4b4dd4['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(_0x1d584f){this['isSuccess']=_0x1d584f;}}class SuccessfulAccountResponse extends Response{constructor(_0x946152){super(!![]),this['account']=_0x946152;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x519e54){super(![]),this['problem']=_0x519e54;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x36dade){super(!![]),this['tokens']=_0x36dade;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x375303){super(![]),this['problem']=_0x375303;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x3c7c5e){super(!![]),this['apiKey']=_0x3c7c5e;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x4449de){super(![]),this['problem']=_0x4449de;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x49c54d){super(!![]),this['searchService']=_0x49c54d;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x36f1c2){super(![]),this['problem']=_0x36f1c2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x487f6f){super(!![]),this['searchService']=_0x487f6f;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServiceResponse extends Response{constructor(_0x2631d6){super(![]),this['problem']=_0x2631d6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0xab7816){super(!![]),this['apiKeyValue']=_0xab7816;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x55f362){super(!![]),this['obj']=_0x55f362;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x5a027b){super(![]),this['problem']=_0x5a027b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x16ba3e){super(![]),this['problem']=_0x16ba3e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$5=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x4ef354,_0x141c27,_0x142bc2,_0x55f19f){function _0x46294c(_0x13717e){return _0x13717e instanceof _0x142bc2?_0x13717e:new _0x142bc2(function(_0x17fe83){_0x17fe83(_0x13717e);});}return new(_0x142bc2||(_0x142bc2=Promise))(function(_0x8d9988,_0x854aae){function _0x1eda2f(_0x34db72){try{_0x365d1a(_0x55f19f['next'](_0x34db72));}catch(_0x4fe68f){_0x854aae(_0x4fe68f);}}function _0x242ddd(_0x3febd8){try{_0x365d1a(_0x55f19f['throw'](_0x3febd8));}catch(_0x1a1064){_0x854aae(_0x1a1064);}}function _0x365d1a(_0x89c473){_0x89c473['done']?_0x8d9988(_0x89c473['value']):_0x46294c(_0x89c473['value'])['then'](_0x1eda2f,_0x242ddd);}_0x365d1a((_0x55f19f=_0x55f19f['apply'](_0x4ef354,_0x141c27||[]))['next']());});};class AccountService{constructor(_0x22da00){this['fetch']=_0x22da00;}['get'](_0x3c322e,_0x8f336){return __awaiter$5(this,void 0,void 0,function*(){const _0x47995f='Account/'+_0x3c322e+'/',_0x4847de=yield this['fetch']['get'](_0x47995f,_0x8f336);try{if(_0x4847de['status']>0xc7&&_0x4847de['status']<0x12c){const _0x26e92f=yield _0x4847de['json']();return new SuccessfulAccountResponse(_0x26e92f);}const _0x2fe183=yield _0x4847de['json']();return new FailedAccountResponse(_0x2fe183);}catch(_0x474b78){if(_0x474b78 instanceof Error)return new FailedAccountResponse({'detail':_0x474b78['message'],'title':_0x474b78['name'],'status':0x1f4,'instance':'','type':''});throw _0x474b78;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x5d2973,_0x16704a,_0x183f0f,_0x10e18f){function _0x4b16f9(_0x5284ca){return _0x5284ca instanceof _0x183f0f?_0x5284ca:new _0x183f0f(function(_0x488f75){_0x488f75(_0x5284ca);});}return new(_0x183f0f||(_0x183f0f=Promise))(function(_0x120f96,_0x5674d1){function _0x333833(_0x5b738b){try{_0x4a1e5e(_0x10e18f['next'](_0x5b738b));}catch(_0x588c4b){_0x5674d1(_0x588c4b);}}function _0x13f4cf(_0x51f87f){try{_0x4a1e5e(_0x10e18f['throw'](_0x51f87f));}catch(_0x4bc447){_0x5674d1(_0x4bc447);}}function _0x4a1e5e(_0x1ee31b){_0x1ee31b['done']?_0x120f96(_0x1ee31b['value']):_0x4b16f9(_0x1ee31b['value'])['then'](_0x333833,_0x13f4cf);}_0x4a1e5e((_0x10e18f=_0x10e18f['apply'](_0x5d2973,_0x16704a||[]))['next']());});};class ApiKeyService{constructor(_0x87aed1){this['fetch']=_0x87aed1,this['path']='api-key';}['create'](_0x344ce8,_0x4093c6,_0x1a65f1){return __awaiter$4(this,void 0,void 0,function*(){const _0x5ccde3={'account_name':_0x344ce8,'api_key_name':_0x4093c6};try{const _0xc80e90=yield this['fetch']['post'](this['path'],_0x1a65f1,_0x5ccde3);if(_0xc80e90['status']>0xc7&&_0xc80e90['status']<0x12c){const _0x488ac3=yield _0xc80e90['json']();return new SuccessfulApiKeyResponse(_0x488ac3);}const _0x57cb21=yield _0xc80e90['json']();return new FailedApiKeyResponse(_0x57cb21);}catch(_0x2bf84a){if(_0x2bf84a instanceof Error)return new FailedApiKeyResponse({'detail':_0x2bf84a['message'],'title':_0x2bf84a['name'],'status':0x1f4,'instance':'','type':''});throw _0x2bf84a;}});}['view'](_0x349c48,_0x9903b4,_0x360190){return __awaiter$4(this,void 0,void 0,function*(){const _0x252b7c=this['path']+'/'+_0x349c48+'/'+_0x9903b4;try{const _0x2c21b0=yield this['fetch']['get'](_0x252b7c,_0x360190);if(_0x2c21b0['status']>0xc7&&_0x2c21b0['status']<0x12c){const _0x466cd4=yield _0x2c21b0['json']();return new SuccessfulApiKeyValueResponse(_0x466cd4);}const _0xd0158c=yield _0x2c21b0['json']();return new FailedApiKeyValueResponse(_0xd0158c);}catch(_0x52a7f0){if(_0x52a7f0 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x52a7f0['message'],'title':_0x52a7f0['name'],'status':0x1f4,'instance':'','type':''});throw _0x52a7f0;}});}['delete'](_0x3766a0,_0x64fb7c,_0x37e0c8){return __awaiter$4(this,void 0,void 0,function*(){const _0x43862f=this['path']+'/'+_0x3766a0+'/'+_0x64fb7c;try{const _0x2ba538=yield this['fetch']['delete'](_0x43862f,_0x37e0c8);if(_0x2ba538['status']>0xc7&&_0x2ba538['status']<0x12c)return new SuccessfulResponse({});const _0x356c87=yield _0x2ba538['json']();return new FailedResponse(_0x356c87);}catch(_0x379efc){if(_0x379efc instanceof Error)return new FailedResponse({'detail':_0x379efc['message'],'title':_0x379efc['name'],'status':0x1f4,'instance':'','type':''});throw _0x379efc;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x23cf3b,_0x3e1b2f,_0x55f05f,_0xc906ae){function _0x2d33bf(_0x229034){return _0x229034 instanceof _0x55f05f?_0x229034:new _0x55f05f(function(_0x53d57e){_0x53d57e(_0x229034);});}return new(_0x55f05f||(_0x55f05f=Promise))(function(_0xecf348,_0x1cc2d2){function _0x106e14(_0x40d904){try{_0x25919d(_0xc906ae['next'](_0x40d904));}catch(_0x43795e){_0x1cc2d2(_0x43795e);}}function _0x3739b8(_0xa1e8a4){try{_0x25919d(_0xc906ae['throw'](_0xa1e8a4));}catch(_0x4422f3){_0x1cc2d2(_0x4422f3);}}function _0x25919d(_0x3e397c){_0x3e397c['done']?_0xecf348(_0x3e397c['value']):_0x2d33bf(_0x3e397c['value'])['then'](_0x106e14,_0x3739b8);}_0x25919d((_0xc906ae=_0xc906ae['apply'](_0x23cf3b,_0x3e1b2f||[]))['next']());});};class ListService{constructor(_0x208ce5){this['fetch']=_0x208ce5;}['add'](_0x2c7a3a,_0x242d01,_0xf0e2d5){return __awaiter$3(this,void 0,void 0,function*(){const _0x23c4a6='List',_0x555e14={'account_name':_0x2c7a3a,'list_name':_0x242d01};try{const _0x4e9dfc=yield this['fetch']['post'](_0x23c4a6,_0xf0e2d5,_0x555e14);if(_0x4e9dfc['status']>0xc7&&_0x4e9dfc['status']<0x12c){const _0x54283d=yield _0x4e9dfc['json']();return new SuccessfulAccountResponse(_0x54283d);}const _0x1bdaae=yield _0x4e9dfc['json']();return new FailedAccountResponse(_0x1bdaae);}catch(_0x54338c){if(_0x54338c instanceof Error)return new FailedAccountResponse({'detail':_0x54338c['message'],'title':_0x54338c['name'],'status':0x1f4,'instance':'','type':''});throw _0x54338c;}});}['remove'](_0x2ba34f,_0x77a290,_0x32503e){return __awaiter$3(this,void 0,void 0,function*(){const _0x434100='List/'+_0x2ba34f+'/'+_0x77a290,_0x3f39ce=yield this['fetch']['delete'](_0x434100,_0x32503e);try{if(_0x3f39ce['status']>0xc7&&_0x3f39ce['status']<0x12c){const _0xe731d3=yield _0x3f39ce['json']();return new SuccessfulAccountResponse(_0xe731d3);}const _0x1a9fbf=yield _0x3f39ce['json']();return new FailedAccountResponse(_0x1a9fbf);}catch(_0x2e6cc0){if(_0x2e6cc0 instanceof Error)return new FailedAccountResponse({'detail':_0x2e6cc0['message'],'title':_0x2e6cc0['name'],'status':0x1f4,'instance':'','type':''});throw _0x2e6cc0;}});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x202894,_0x15e95e,_0x37770d,_0x130710){function _0x2f72a0(_0x471abe){return _0x471abe instanceof _0x37770d?_0x471abe:new _0x37770d(function(_0xcc4807){_0xcc4807(_0x471abe);});}return new(_0x37770d||(_0x37770d=Promise))(function(_0x140be4,_0x59ff25){function _0x3939e9(_0x4069c2){try{_0x27b45f(_0x130710['next'](_0x4069c2));}catch(_0x5a1e1c){_0x59ff25(_0x5a1e1c);}}function _0x556d01(_0x4f4159){try{_0x27b45f(_0x130710['throw'](_0x4f4159));}catch(_0x177547){_0x59ff25(_0x177547);}}function _0x27b45f(_0x5c9c4e){_0x5c9c4e['done']?_0x140be4(_0x5c9c4e['value']):_0x2f72a0(_0x5c9c4e['value'])['then'](_0x3939e9,_0x556d01);}_0x27b45f((_0x130710=_0x130710['apply'](_0x202894,_0x15e95e||[]))['next']());});};class Fetch{constructor(_0x235d19){this['baseUri']=_0x235d19,this['getUrl']=_0x28b28f=>{return _0x28b28f['startsWith']('/')&&(_0x28b28f=_0x28b28f['replace']('/','')),''+this['baseUri']+_0x28b28f;},!_0x235d19['endsWith']('/')&&(_0x235d19=_0x235d19+'/');}['get'](_0x55a359,_0x5e6b4d){return __awaiter$2(this,void 0,void 0,function*(){const _0x20e599=this['getUrl'](_0x55a359);return yield fetch(_0x20e599,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5e6b4d}});});}['post'](_0x2a1f61,_0x2475be,_0x174afb){return __awaiter$2(this,void 0,void 0,function*(){const _0x36c27a=this['getUrl'](_0x2a1f61);return yield fetch(_0x36c27a,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2475be},'body':_0x174afb?JSON['stringify'](_0x174afb):null});});}['PostNoAuth'](_0x58e2a7,_0x5cd3b6){return __awaiter$2(this,void 0,void 0,function*(){const _0x1b84e7=this['getUrl'](_0x58e2a7);return yield fetch(_0x1b84e7,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x5cd3b6?JSON['stringify'](_0x5cd3b6):null});});}['put'](_0x2209e6,_0x1a0db0,_0x30e2a4){return __awaiter$2(this,void 0,void 0,function*(){const _0x1b5dd3=this['getUrl'](_0x2209e6);return yield fetch(_0x1b5dd3,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1a0db0},'body':_0x30e2a4?JSON['stringify'](_0x30e2a4):null});});}['delete'](_0x4afda9,_0x4cdefa){return __awaiter$2(this,void 0,void 0,function*(){const _0x38146d=this['getUrl'](_0x4afda9);return yield fetch(_0x38146d,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4cdefa}});});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xcd2358,_0x1e42e0,_0x514729,_0x5e902a){function _0x3b3462(_0x434dee){return _0x434dee instanceof _0x514729?_0x434dee:new _0x514729(function(_0x19e6cb){_0x19e6cb(_0x434dee);});}return new(_0x514729||(_0x514729=Promise))(function(_0x133e99,_0xf58e53){function _0x3445ac(_0x4f9dad){try{_0x48a265(_0x5e902a['next'](_0x4f9dad));}catch(_0x46ac56){_0xf58e53(_0x46ac56);}}function _0x41477a(_0x16b0dd){try{_0x48a265(_0x5e902a['throw'](_0x16b0dd));}catch(_0x43a525){_0xf58e53(_0x43a525);}}function _0x48a265(_0x519231){_0x519231['done']?_0x133e99(_0x519231['value']):_0x3b3462(_0x519231['value'])['then'](_0x3445ac,_0x41477a);}_0x48a265((_0x5e902a=_0x5e902a['apply'](_0xcd2358,_0x1e42e0||[]))['next']());});};class SearchServersService{constructor(_0xe821ff){this['fetch']=_0xe821ff,this['path']='search-services';}['create'](_0x3b91b1,_0x3cc781,_0x4afd9c,_0x1f25ac,_0xc6a9fb,_0x20675e,_0x2de146,_0x4696c3){return __awaiter$1(this,void 0,void 0,function*(){const _0x17fdfa={'account_name':_0x3b91b1,'search_service_name':_0x3cc781,'endpoint':_0x4afd9c,'key':_0x1f25ac,'country':_0xc6a9fb,'provider':_0x20675e,'index_name':_0x2de146};try{const _0x27f95b=yield this['fetch']['post'](this['path'],_0x4696c3,_0x17fdfa);if(_0x27f95b['status']>0xc7&&_0x27f95b['status']<0x12c){const _0x3ab8a4=yield _0x27f95b['json']();return new SuccessfulSearchServiceResponse(_0x3ab8a4);}const _0x4cf1a5=yield _0x27f95b['json']();return new FailedSearchServiceResponse(_0x4cf1a5);}catch(_0x47723a){if(_0x47723a instanceof Error)return new FailedSearchServiceResponse({'detail':_0x47723a['message'],'title':_0x47723a['name'],'status':0x1f4,'instance':'','type':''});throw _0x47723a;}});}['delete'](_0x429b46,_0x1393a0,_0x50cb9e){return __awaiter$1(this,void 0,void 0,function*(){const _0x553ca2=this['path']+'/'+_0x429b46+'/'+_0x1393a0;try{const _0x5cb37e=yield this['fetch']['delete'](_0x553ca2,_0x50cb9e);if(_0x5cb37e['status']>0xc7&&_0x5cb37e['status']<0x12c)return new SuccessfulResponse({});const _0x494bd4=yield _0x5cb37e['json']();return new FailedResponse(_0x494bd4);}catch(_0x5c3ae5){if(_0x5c3ae5 instanceof Error)return new FailedResponse({'detail':_0x5c3ae5['message'],'title':_0x5c3ae5['name'],'status':0x1f4,'instance':'','type':''});throw _0x5c3ae5;}});}['view'](_0x3aa7d4,_0x590d48,_0x4f2c3c){return __awaiter$1(this,void 0,void 0,function*(){const _0x133a0d=this['path']+'/'+_0x3aa7d4+'/'+_0x590d48;try{const _0x51d3f8=yield this['fetch']['get'](_0x133a0d,_0x4f2c3c);if(_0x51d3f8['status']>0xc7&&_0x51d3f8['status']<0x12c){const _0x513d7c=yield _0x51d3f8['json']();return new SuccessfulViewSearchServiceResponse(_0x513d7c);}const _0x1e0652=yield _0x51d3f8['json']();return new FailedViewSearchServiceResponse(_0x1e0652);}catch(_0x3567bf){if(_0x3567bf instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x3567bf['message'],'title':_0x3567bf['name'],'status':0x1f4,'instance':'','type':''});throw _0x3567bf;}});}}
|
|
14
14
|
|
|
15
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
15
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x131f95,_0x282648,_0x1e47c6,_0xb9e15){function _0x407f75(_0x2588bd){return _0x2588bd instanceof _0x1e47c6?_0x2588bd:new _0x1e47c6(function(_0x150f71){_0x150f71(_0x2588bd);});}return new(_0x1e47c6||(_0x1e47c6=Promise))(function(_0x5e0ba3,_0x488914){function _0x1b9552(_0x15d883){try{_0x18d30d(_0xb9e15['next'](_0x15d883));}catch(_0x4c0fed){_0x488914(_0x4c0fed);}}function _0x232cfd(_0x3675bb){try{_0x18d30d(_0xb9e15['throw'](_0x3675bb));}catch(_0x211d5f){_0x488914(_0x211d5f);}}function _0x18d30d(_0x46c24b){_0x46c24b['done']?_0x5e0ba3(_0x46c24b['value']):_0x407f75(_0x46c24b['value'])['then'](_0x1b9552,_0x232cfd);}_0x18d30d((_0xb9e15=_0xb9e15['apply'](_0x131f95,_0x282648||[]))['next']());});};class AdminClient{constructor(_0x2c9577='https://admin.searchability.dev/'){var _0xf0d179=new Fetch(_0x2c9577);this['Accounts']=new AccountService(_0xf0d179),this['Lists']=new ListService(_0xf0d179),this['ApiKeys']=new ApiKeyService(_0xf0d179),this['SearchServices']=new SearchServersService(_0xf0d179);}}class AuthClient{constructor(_0x1b5981='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x1b5981);}['login'](_0x519ade){return __awaiter(this,void 0,void 0,function*(){const _0x50c127='login/'+_0x519ade;try{const _0x4c7484=yield yield fetch(_0x50c127);if(_0x4c7484['status']>0xc7&&_0x4c7484['status']<0x12c){const _0x26deea=yield _0x4c7484['json']();return new SuccessfulAuthResponse(_0x26deea);}const _0x33f13d=yield _0x4c7484['json']();return new FailedAuthResponse(_0x33f13d);}catch(_0x1d9e54){if(_0x1d9e54 instanceof Error)return new FailedAuthResponse({'detail':_0x1d9e54['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1d9e54;}});}['refresh'](_0x33fbf0){return __awaiter(this,void 0,void 0,function*(){const _0x4bc155='refresh',_0x430f72={'refresh_token':_0x33fbf0};try{const _0x24ba83=yield this['fetch']['PostNoAuth'](_0x4bc155,_0x430f72);if(_0x24ba83['status']>0xc7&&_0x24ba83['status']<0x12c){const _0x3a0b29=yield _0x24ba83['json']();return new SuccessfulAuthResponse(_0x3a0b29);}const _0x5369e7=yield _0x24ba83['json']();return new FailedAuthResponse(_0x5369e7);}catch(_0xcf2be6){if(_0xcf2be6 instanceof Error)return new FailedAuthResponse({'detail':_0xcf2be6['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xcf2be6;}});}['getTokenStatus'](_0x423c03){if(Date['now']()<_0x423c03['access_expires'])return exports.TokenStatus['Ok'];if(Date['now']()<_0x423c03['refresh_expires'])return exports.TokenStatus['Refresh'];return exports.TokenStatus['Expired'];}}
|
|
16
16
|
|
|
17
17
|
exports.AdminClient = AdminClient;
|
|
18
18
|
exports.AuthClient = AuthClient;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var TokenStatus;(function(
|
|
1
|
+
var TokenStatus;(function(_0x134459){_0x134459[_0x134459['Ok']=0x0]='Ok',_0x134459[_0x134459['Refresh']=0x1]='Refresh',_0x134459[_0x134459['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(_0x557fd3){this['isSuccess']=_0x557fd3;}}class SuccessfulAccountResponse extends Response{constructor(_0x5b39c1){super(!![]),this['account']=_0x5b39c1;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x59c3e8){super(![]),this['problem']=_0x59c3e8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x4d1e5c){super(!![]),this['tokens']=_0x4d1e5c;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x9f5df5){super(![]),this['problem']=_0x9f5df5;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x2dc0e4){super(!![]),this['apiKey']=_0x2dc0e4;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x40b50d){super(![]),this['problem']=_0x40b50d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0xdc43a9){super(!![]),this['searchService']=_0xdc43a9;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x2d5f75){super(![]),this['problem']=_0x2d5f75;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x599ec0){super(!![]),this['searchService']=_0x599ec0;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServiceResponse extends Response{constructor(_0x31c1d2){super(![]),this['problem']=_0x31c1d2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x5f2935){super(!![]),this['apiKeyValue']=_0x5f2935;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x58961f){super(!![]),this['obj']=_0x58961f;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x528797){super(![]),this['problem']=_0x528797;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x476bb2){super(![]),this['problem']=_0x476bb2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
2
|
|
|
3
|
-
var __awaiter$5=undefined&&undefined['__awaiter']||function(
|
|
3
|
+
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x2f14bd,_0x656869,_0x5e0ee1,_0x2aaa8b){function _0x1beaf0(_0x1172d7){return _0x1172d7 instanceof _0x5e0ee1?_0x1172d7:new _0x5e0ee1(function(_0x427a3b){_0x427a3b(_0x1172d7);});}return new(_0x5e0ee1||(_0x5e0ee1=Promise))(function(_0x4dfa6c,_0x513a51){function _0x1c7f6c(_0x51fe64){try{_0x41f9a0(_0x2aaa8b['next'](_0x51fe64));}catch(_0x5af6da){_0x513a51(_0x5af6da);}}function _0x3962ea(_0x102948){try{_0x41f9a0(_0x2aaa8b['throw'](_0x102948));}catch(_0x15ac58){_0x513a51(_0x15ac58);}}function _0x41f9a0(_0x4182af){_0x4182af['done']?_0x4dfa6c(_0x4182af['value']):_0x1beaf0(_0x4182af['value'])['then'](_0x1c7f6c,_0x3962ea);}_0x41f9a0((_0x2aaa8b=_0x2aaa8b['apply'](_0x2f14bd,_0x656869||[]))['next']());});};class AccountService{constructor(_0x57fc81){this['fetch']=_0x57fc81;}['get'](_0x5932f3,_0x5b6f43){return __awaiter$5(this,void 0,void 0,function*(){const _0xa4f96c='Account/'+_0x5932f3+'/',_0x2b0d8a=yield this['fetch']['get'](_0xa4f96c,_0x5b6f43);try{if(_0x2b0d8a['status']>0xc7&&_0x2b0d8a['status']<0x12c){const _0x2b7867=yield _0x2b0d8a['json']();return new SuccessfulAccountResponse(_0x2b7867);}const _0xc7342d=yield _0x2b0d8a['json']();return new FailedAccountResponse(_0xc7342d);}catch(_0x1cffd4){if(_0x1cffd4 instanceof Error)return new FailedAccountResponse({'detail':_0x1cffd4['message'],'title':_0x1cffd4['name'],'status':0x1f4,'instance':'','type':''});throw _0x1cffd4;}});}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x1c4f28,_0x4b5119,_0x3d7e29,_0x55089c){function _0xe441dc(_0x301590){return _0x301590 instanceof _0x3d7e29?_0x301590:new _0x3d7e29(function(_0x946634){_0x946634(_0x301590);});}return new(_0x3d7e29||(_0x3d7e29=Promise))(function(_0x117b23,_0x7d48fb){function _0x544179(_0x1bf33d){try{_0x2762f9(_0x55089c['next'](_0x1bf33d));}catch(_0x40a4de){_0x7d48fb(_0x40a4de);}}function _0xbf97c5(_0x1028f3){try{_0x2762f9(_0x55089c['throw'](_0x1028f3));}catch(_0x2b02b7){_0x7d48fb(_0x2b02b7);}}function _0x2762f9(_0x122c25){_0x122c25['done']?_0x117b23(_0x122c25['value']):_0xe441dc(_0x122c25['value'])['then'](_0x544179,_0xbf97c5);}_0x2762f9((_0x55089c=_0x55089c['apply'](_0x1c4f28,_0x4b5119||[]))['next']());});};class ApiKeyService{constructor(_0x32a035){this['fetch']=_0x32a035,this['path']='api-key';}['create'](_0x5b3c93,_0x56dbfc,_0x2fd0d2){return __awaiter$4(this,void 0,void 0,function*(){const _0x23ca18={'account_name':_0x5b3c93,'api_key_name':_0x56dbfc};try{const _0x173bb1=yield this['fetch']['post'](this['path'],_0x2fd0d2,_0x23ca18);if(_0x173bb1['status']>0xc7&&_0x173bb1['status']<0x12c){const _0x321147=yield _0x173bb1['json']();return new SuccessfulApiKeyResponse(_0x321147);}const _0x2278ad=yield _0x173bb1['json']();return new FailedApiKeyResponse(_0x2278ad);}catch(_0x3b7e7f){if(_0x3b7e7f instanceof Error)return new FailedApiKeyResponse({'detail':_0x3b7e7f['message'],'title':_0x3b7e7f['name'],'status':0x1f4,'instance':'','type':''});throw _0x3b7e7f;}});}['view'](_0x137674,_0x42c8c7,_0x62abd0){return __awaiter$4(this,void 0,void 0,function*(){const _0x478a50=this['path']+'/'+_0x137674+'/'+_0x42c8c7;try{const _0x29319d=yield this['fetch']['get'](_0x478a50,_0x62abd0);if(_0x29319d['status']>0xc7&&_0x29319d['status']<0x12c){const _0x1eb5f9=yield _0x29319d['json']();return new SuccessfulApiKeyValueResponse(_0x1eb5f9);}const _0x125726=yield _0x29319d['json']();return new FailedApiKeyValueResponse(_0x125726);}catch(_0x1116c1){if(_0x1116c1 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x1116c1['message'],'title':_0x1116c1['name'],'status':0x1f4,'instance':'','type':''});throw _0x1116c1;}});}['delete'](_0xa0eacf,_0xd2a95c,_0x4f5e0f){return __awaiter$4(this,void 0,void 0,function*(){const _0x399850=this['path']+'/'+_0xa0eacf+'/'+_0xd2a95c;try{const _0xdd11d8=yield this['fetch']['delete'](_0x399850,_0x4f5e0f);if(_0xdd11d8['status']>0xc7&&_0xdd11d8['status']<0x12c)return new SuccessfulResponse({});const _0x1e292a=yield _0xdd11d8['json']();return new FailedResponse(_0x1e292a);}catch(_0x11183b){if(_0x11183b instanceof Error)return new FailedResponse({'detail':_0x11183b['message'],'title':_0x11183b['name'],'status':0x1f4,'instance':'','type':''});throw _0x11183b;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x1a2a16,_0x4bd04a,_0x33e030,_0x30ad4b){function _0x47fa5f(_0x10d9cd){return _0x10d9cd instanceof _0x33e030?_0x10d9cd:new _0x33e030(function(_0x112e19){_0x112e19(_0x10d9cd);});}return new(_0x33e030||(_0x33e030=Promise))(function(_0x39ccf1,_0x4789f3){function _0x41f2e5(_0x5c7986){try{_0x4f6d30(_0x30ad4b['next'](_0x5c7986));}catch(_0x37040b){_0x4789f3(_0x37040b);}}function _0x4bc3eb(_0x4236b8){try{_0x4f6d30(_0x30ad4b['throw'](_0x4236b8));}catch(_0x478dd4){_0x4789f3(_0x478dd4);}}function _0x4f6d30(_0xc4107e){_0xc4107e['done']?_0x39ccf1(_0xc4107e['value']):_0x47fa5f(_0xc4107e['value'])['then'](_0x41f2e5,_0x4bc3eb);}_0x4f6d30((_0x30ad4b=_0x30ad4b['apply'](_0x1a2a16,_0x4bd04a||[]))['next']());});};class ListService{constructor(_0x422e3c){this['fetch']=_0x422e3c;}['add'](_0x4065a2,_0x8ef198,_0x5d860c){return __awaiter$3(this,void 0,void 0,function*(){const _0x542d33='List',_0x1d25f2={'account_name':_0x4065a2,'list_name':_0x8ef198};try{const _0x1bcac0=yield this['fetch']['post'](_0x542d33,_0x5d860c,_0x1d25f2);if(_0x1bcac0['status']>0xc7&&_0x1bcac0['status']<0x12c){const _0x4d4ebf=yield _0x1bcac0['json']();return new SuccessfulAccountResponse(_0x4d4ebf);}const _0x10dbc9=yield _0x1bcac0['json']();return new FailedAccountResponse(_0x10dbc9);}catch(_0x3084f3){if(_0x3084f3 instanceof Error)return new FailedAccountResponse({'detail':_0x3084f3['message'],'title':_0x3084f3['name'],'status':0x1f4,'instance':'','type':''});throw _0x3084f3;}});}['remove'](_0x5b5952,_0x3ce1ba,_0x2cebe8){return __awaiter$3(this,void 0,void 0,function*(){const _0x171575='List/'+_0x5b5952+'/'+_0x3ce1ba,_0x3d749e=yield this['fetch']['delete'](_0x171575,_0x2cebe8);try{if(_0x3d749e['status']>0xc7&&_0x3d749e['status']<0x12c){const _0x378678=yield _0x3d749e['json']();return new SuccessfulAccountResponse(_0x378678);}const _0x4a9a0f=yield _0x3d749e['json']();return new FailedAccountResponse(_0x4a9a0f);}catch(_0x4e4399){if(_0x4e4399 instanceof Error)return new FailedAccountResponse({'detail':_0x4e4399['message'],'title':_0x4e4399['name'],'status':0x1f4,'instance':'','type':''});throw _0x4e4399;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x5d1303,_0x48fdea,_0x3e53a2,_0x10a8e1){function _0x3df46d(_0x3db587){return _0x3db587 instanceof _0x3e53a2?_0x3db587:new _0x3e53a2(function(_0x4cda16){_0x4cda16(_0x3db587);});}return new(_0x3e53a2||(_0x3e53a2=Promise))(function(_0x4ca2a9,_0x30df74){function _0x30593f(_0x44e128){try{_0xe5b5c3(_0x10a8e1['next'](_0x44e128));}catch(_0x2a0b46){_0x30df74(_0x2a0b46);}}function _0x295c25(_0x3e0f77){try{_0xe5b5c3(_0x10a8e1['throw'](_0x3e0f77));}catch(_0x3307ea){_0x30df74(_0x3307ea);}}function _0xe5b5c3(_0x23bc29){_0x23bc29['done']?_0x4ca2a9(_0x23bc29['value']):_0x3df46d(_0x23bc29['value'])['then'](_0x30593f,_0x295c25);}_0xe5b5c3((_0x10a8e1=_0x10a8e1['apply'](_0x5d1303,_0x48fdea||[]))['next']());});};class Fetch{constructor(_0x4b7c7c){this['baseUri']=_0x4b7c7c,this['getUrl']=_0x51ae8e=>{return _0x51ae8e['startsWith']('/')&&(_0x51ae8e=_0x51ae8e['replace']('/','')),''+this['baseUri']+_0x51ae8e;},!_0x4b7c7c['endsWith']('/')&&(_0x4b7c7c=_0x4b7c7c+'/');}['get'](_0x3d61df,_0x387fb3){return __awaiter$2(this,void 0,void 0,function*(){const _0xb73f8d=this['getUrl'](_0x3d61df);return yield fetch(_0xb73f8d,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x387fb3}});});}['post'](_0x7309b,_0x2e65bc,_0x11fc9c){return __awaiter$2(this,void 0,void 0,function*(){const _0x1b0765=this['getUrl'](_0x7309b);return yield fetch(_0x1b0765,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2e65bc},'body':_0x11fc9c?JSON['stringify'](_0x11fc9c):null});});}['PostNoAuth'](_0x20e7da,_0xa94fd1){return __awaiter$2(this,void 0,void 0,function*(){const _0x55ffa3=this['getUrl'](_0x20e7da);return yield fetch(_0x55ffa3,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0xa94fd1?JSON['stringify'](_0xa94fd1):null});});}['put'](_0x302f63,_0x5b6db5,_0x4ec37c){return __awaiter$2(this,void 0,void 0,function*(){const _0x545834=this['getUrl'](_0x302f63);return yield fetch(_0x545834,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5b6db5},'body':_0x4ec37c?JSON['stringify'](_0x4ec37c):null});});}['delete'](_0x1b2525,_0x4cec03){return __awaiter$2(this,void 0,void 0,function*(){const _0x1c1d58=this['getUrl'](_0x1b2525);return yield fetch(_0x1c1d58,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4cec03}});});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x14bfc6,_0x2faa98,_0x506f38,_0x3e4fba){function _0x2b8af8(_0x28d3f8){return _0x28d3f8 instanceof _0x506f38?_0x28d3f8:new _0x506f38(function(_0x3dfe4b){_0x3dfe4b(_0x28d3f8);});}return new(_0x506f38||(_0x506f38=Promise))(function(_0x5991d4,_0x148181){function _0x5f2dac(_0x55fabf){try{_0x25042a(_0x3e4fba['next'](_0x55fabf));}catch(_0x170cc0){_0x148181(_0x170cc0);}}function _0x259c28(_0x238d98){try{_0x25042a(_0x3e4fba['throw'](_0x238d98));}catch(_0x44b9b5){_0x148181(_0x44b9b5);}}function _0x25042a(_0x3af9ab){_0x3af9ab['done']?_0x5991d4(_0x3af9ab['value']):_0x2b8af8(_0x3af9ab['value'])['then'](_0x5f2dac,_0x259c28);}_0x25042a((_0x3e4fba=_0x3e4fba['apply'](_0x14bfc6,_0x2faa98||[]))['next']());});};class SearchServersService{constructor(_0x8640f9){this['fetch']=_0x8640f9,this['path']='search-services';}['create'](_0x5b1199,_0x5b41b4,_0x5e89ab,_0x3b58b1,_0x154287,_0x30048d,_0x2743e8,_0x5a6ff9){return __awaiter$1(this,void 0,void 0,function*(){const _0x5ad299={'account_name':_0x5b1199,'search_service_name':_0x5b41b4,'endpoint':_0x5e89ab,'key':_0x3b58b1,'country':_0x154287,'provider':_0x30048d,'index_name':_0x2743e8};try{const _0xacae29=yield this['fetch']['post'](this['path'],_0x5a6ff9,_0x5ad299);if(_0xacae29['status']>0xc7&&_0xacae29['status']<0x12c){const _0x21c156=yield _0xacae29['json']();return new SuccessfulSearchServiceResponse(_0x21c156);}const _0x3e1641=yield _0xacae29['json']();return new FailedSearchServiceResponse(_0x3e1641);}catch(_0x4c12b9){if(_0x4c12b9 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x4c12b9['message'],'title':_0x4c12b9['name'],'status':0x1f4,'instance':'','type':''});throw _0x4c12b9;}});}['delete'](_0x201535,_0x276cdc,_0x4b7e30){return __awaiter$1(this,void 0,void 0,function*(){const _0x4c5547=this['path']+'/'+_0x201535+'/'+_0x276cdc;try{const _0x2f7883=yield this['fetch']['delete'](_0x4c5547,_0x4b7e30);if(_0x2f7883['status']>0xc7&&_0x2f7883['status']<0x12c)return new SuccessfulResponse({});const _0x13a3df=yield _0x2f7883['json']();return new FailedResponse(_0x13a3df);}catch(_0x103b8c){if(_0x103b8c instanceof Error)return new FailedResponse({'detail':_0x103b8c['message'],'title':_0x103b8c['name'],'status':0x1f4,'instance':'','type':''});throw _0x103b8c;}});}['view'](_0x822caa,_0x1f2b4f,_0x2859c2){return __awaiter$1(this,void 0,void 0,function*(){const _0x4de163=this['path']+'/'+_0x822caa+'/'+_0x1f2b4f;try{const _0x142503=yield this['fetch']['get'](_0x4de163,_0x2859c2);if(_0x142503['status']>0xc7&&_0x142503['status']<0x12c){const _0x345afd=yield _0x142503['json']();return new SuccessfulViewSearchServiceResponse(_0x345afd);}const _0x58a004=yield _0x142503['json']();return new FailedViewSearchServiceResponse(_0x58a004);}catch(_0x8a5730){if(_0x8a5730 instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x8a5730['message'],'title':_0x8a5730['name'],'status':0x1f4,'instance':'','type':''});throw _0x8a5730;}});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x586b4,_0x3f4412,_0x4e516f,_0x489260){function _0x32245a(_0x3e8041){return _0x3e8041 instanceof _0x4e516f?_0x3e8041:new _0x4e516f(function(_0x390ad0){_0x390ad0(_0x3e8041);});}return new(_0x4e516f||(_0x4e516f=Promise))(function(_0x2386f1,_0x1c4af8){function _0x60ce3b(_0xb4d021){try{_0x40d34c(_0x489260['next'](_0xb4d021));}catch(_0x485d90){_0x1c4af8(_0x485d90);}}function _0x1ed519(_0x22331c){try{_0x40d34c(_0x489260['throw'](_0x22331c));}catch(_0x216a4c){_0x1c4af8(_0x216a4c);}}function _0x40d34c(_0x508ad7){_0x508ad7['done']?_0x2386f1(_0x508ad7['value']):_0x32245a(_0x508ad7['value'])['then'](_0x60ce3b,_0x1ed519);}_0x40d34c((_0x489260=_0x489260['apply'](_0x586b4,_0x3f4412||[]))['next']());});};class AdminClient{constructor(_0x583b6d='https://admin.searchability.dev/'){var _0x976bac=new Fetch(_0x583b6d);this['Accounts']=new AccountService(_0x976bac),this['Lists']=new ListService(_0x976bac),this['ApiKeys']=new ApiKeyService(_0x976bac),this['SearchServices']=new SearchServersService(_0x976bac);}}class AuthClient{constructor(_0x567e20='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x567e20);}['login'](_0xcc3eef){return __awaiter(this,void 0,void 0,function*(){const _0x3b4b8a='login/'+_0xcc3eef;try{const _0xb4f71e=yield yield fetch(_0x3b4b8a);if(_0xb4f71e['status']>0xc7&&_0xb4f71e['status']<0x12c){const _0x4ad4ec=yield _0xb4f71e['json']();return new SuccessfulAuthResponse(_0x4ad4ec);}const _0x14463a=yield _0xb4f71e['json']();return new FailedAuthResponse(_0x14463a);}catch(_0x1b2a06){if(_0x1b2a06 instanceof Error)return new FailedAuthResponse({'detail':_0x1b2a06['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1b2a06;}});}['refresh'](_0xaff76d){return __awaiter(this,void 0,void 0,function*(){const _0x3b6a8d='refresh',_0x3e94e3={'refresh_token':_0xaff76d};try{const _0x207630=yield this['fetch']['PostNoAuth'](_0x3b6a8d,_0x3e94e3);if(_0x207630['status']>0xc7&&_0x207630['status']<0x12c){const _0x260da6=yield _0x207630['json']();return new SuccessfulAuthResponse(_0x260da6);}const _0x1ff1f3=yield _0x207630['json']();return new FailedAuthResponse(_0x1ff1f3);}catch(_0x14f7ed){if(_0x14f7ed instanceof Error)return new FailedAuthResponse({'detail':_0x14f7ed['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x14f7ed;}});}['getTokenStatus'](_0x143fdf){if(Date['now']()<_0x143fdf['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x143fdf['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
14
14
|
|
|
15
15
|
export { AdminClient, AuthClient, TokenStatus, Tokens };
|
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ declare class Fetch {
|
|
|
4
4
|
private getUrl;
|
|
5
5
|
get(path: string, accessToken: string): Promise<globalThis.Response>;
|
|
6
6
|
post(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
|
|
7
|
+
PostNoAuth(path: string, body: any): Promise<globalThis.Response>;
|
|
7
8
|
put(path: string, accessToken: string, body: any): Promise<globalThis.Response>;
|
|
8
9
|
delete(path: string, accessToken: string): Promise<globalThis.Response>;
|
|
9
10
|
}
|
|
@@ -59,6 +60,9 @@ declare enum TokenStatus {
|
|
|
59
60
|
Refresh = 1,
|
|
60
61
|
Expired = 2
|
|
61
62
|
}
|
|
63
|
+
type RefreshRequest = {
|
|
64
|
+
refresh_token: string;
|
|
65
|
+
};
|
|
62
66
|
declare class Tokens {
|
|
63
67
|
access_token: string;
|
|
64
68
|
access_expires: number;
|
|
@@ -205,4 +209,4 @@ declare class FailedApiKeyValueResponse extends Response<ApiKeyValue, Problem> {
|
|
|
205
209
|
toProblem(): Problem;
|
|
206
210
|
}
|
|
207
211
|
|
|
208
|
-
export { type Account, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, FailedResponse, FailedSearchServiceResponse, FailedViewSearchServiceResponse, type List, type ListIdentity, type Problem, Response, type SearchService, type SearchServiceDetails, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, SuccessfulResponse, SuccessfulSearchServiceResponse, SuccessfulViewSearchServiceResponse, TokenStatus, Tokens };
|
|
212
|
+
export { type Account, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, FailedResponse, FailedSearchServiceResponse, FailedViewSearchServiceResponse, type List, type ListIdentity, type Problem, type RefreshRequest, Response, type SearchService, type SearchServiceDetails, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, SuccessfulResponse, SuccessfulSearchServiceResponse, SuccessfulViewSearchServiceResponse, TokenStatus, Tokens };
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var TokenStatus;(function(_0x29474c){_0x29474c[_0x29474c['Ok']=0x0]='Ok',_0x29474c[_0x29474c['Refresh']=0x1]='Refresh',_0x29474c[_0x29474c['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(_0x163727){this['isSuccess']=_0x163727;}}class SuccessfulAccountResponse extends Response{constructor(_0x3f71a6){super(!![]),this['account']=_0x3f71a6;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x202622){super(![]),this['problem']=_0x202622;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x3b3d2c){super(!![]),this['tokens']=_0x3b3d2c;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x984b9e){super(![]),this['problem']=_0x984b9e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x19ff41){super(!![]),this['apiKey']=_0x19ff41;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x343c3a){super(![]),this['problem']=_0x343c3a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x1d4c2e){super(!![]),this['searchService']=_0x1d4c2e;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x933194){super(![]),this['problem']=_0x933194;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x81d952){super(!![]),this['searchService']=_0x81d952;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServiceResponse extends Response{constructor(_0x5fa441){super(![]),this['problem']=_0x5fa441;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x58ebc0){super(!![]),this['apiKeyValue']=_0x58ebc0;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x47e5d8){super(!![]),this['obj']=_0x47e5d8;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x1418f8){super(![]),this['problem']=_0x1418f8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x553317){super(![]),this['problem']=_0x553317;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
|
-
|
|
3
|
-
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x7c26e3,_0x43f59c,_0x251f24,_0x3234da){function _0x3fc1a6(_0x47e672){return _0x47e672 instanceof _0x251f24?_0x47e672:new _0x251f24(function(_0x363d52){_0x363d52(_0x47e672);});}return new(_0x251f24||(_0x251f24=Promise))(function(_0x44cc75,_0x4a4074){function _0x54583c(_0x137c84){try{_0x4c3bf6(_0x3234da['next'](_0x137c84));}catch(_0x3c5959){_0x4a4074(_0x3c5959);}}function _0x211b6d(_0x3c7f60){try{_0x4c3bf6(_0x3234da['throw'](_0x3c7f60));}catch(_0x3180ea){_0x4a4074(_0x3180ea);}}function _0x4c3bf6(_0x3da63e){_0x3da63e['done']?_0x44cc75(_0x3da63e['value']):_0x3fc1a6(_0x3da63e['value'])['then'](_0x54583c,_0x211b6d);}_0x4c3bf6((_0x3234da=_0x3234da['apply'](_0x7c26e3,_0x43f59c||[]))['next']());});};class AccountService{constructor(_0x2362b8){this['fetch']=_0x2362b8;}['get'](_0x2b3bb6,_0x3400bd){return __awaiter$5(this,void 0,void 0,function*(){const _0x28c9d='Account/'+_0x2b3bb6+'/',_0x2a6b0f=yield this['fetch']['get'](_0x28c9d,_0x3400bd);try{if(_0x2a6b0f['status']>0xc7&&_0x2a6b0f['status']<0x12c){const _0x1a3adb=yield _0x2a6b0f['json']();return new SuccessfulAccountResponse(_0x1a3adb);}const _0x2ccba0=yield _0x2a6b0f['json']();return new FailedAccountResponse(_0x2ccba0);}catch(_0x45feda){if(_0x45feda instanceof Error)return new FailedAccountResponse({'detail':_0x45feda['message'],'title':_0x45feda['name'],'status':0x1f4,'instance':'','type':''});throw _0x45feda;}});}}
|
|
4
|
-
|
|
5
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x29a9fa,_0x1bc802,_0x4179d7,_0x3114d8){function _0x348c90(_0x50f813){return _0x50f813 instanceof _0x4179d7?_0x50f813:new _0x4179d7(function(_0x57485b){_0x57485b(_0x50f813);});}return new(_0x4179d7||(_0x4179d7=Promise))(function(_0x205e35,_0x1aef0e){function _0x390692(_0x205e29){try{_0x2294f6(_0x3114d8['next'](_0x205e29));}catch(_0x470e48){_0x1aef0e(_0x470e48);}}function _0x486719(_0x483448){try{_0x2294f6(_0x3114d8['throw'](_0x483448));}catch(_0x376a4b){_0x1aef0e(_0x376a4b);}}function _0x2294f6(_0xc3ecf8){_0xc3ecf8['done']?_0x205e35(_0xc3ecf8['value']):_0x348c90(_0xc3ecf8['value'])['then'](_0x390692,_0x486719);}_0x2294f6((_0x3114d8=_0x3114d8['apply'](_0x29a9fa,_0x1bc802||[]))['next']());});};class ApiKeyService{constructor(_0x4cdaec){this['fetch']=_0x4cdaec,this['path']='api-key';}['create'](_0x257d03,_0x54b051,_0x1b346f){return __awaiter$4(this,void 0,void 0,function*(){const _0x21b5e6={'account_name':_0x257d03,'api_key_name':_0x54b051};try{const _0x85fcd0=yield this['fetch']['post'](this['path'],_0x1b346f,_0x21b5e6);if(_0x85fcd0['status']>0xc7&&_0x85fcd0['status']<0x12c){const _0x4d56aa=yield _0x85fcd0['json']();return new SuccessfulApiKeyResponse(_0x4d56aa);}const _0x123282=yield _0x85fcd0['json']();return new FailedApiKeyResponse(_0x123282);}catch(_0x3c2424){if(_0x3c2424 instanceof Error)return new FailedApiKeyResponse({'detail':_0x3c2424['message'],'title':_0x3c2424['name'],'status':0x1f4,'instance':'','type':''});throw _0x3c2424;}});}['view'](_0x5e0205,_0x26e635,_0x458a5c){return __awaiter$4(this,void 0,void 0,function*(){const _0x47bff8=this['path']+'/'+_0x5e0205+'/'+_0x26e635;try{const _0x6b2087=yield this['fetch']['get'](_0x47bff8,_0x458a5c);if(_0x6b2087['status']>0xc7&&_0x6b2087['status']<0x12c){const _0x308e2b=yield _0x6b2087['json']();return new SuccessfulApiKeyValueResponse(_0x308e2b);}const _0x1283f8=yield _0x6b2087['json']();return new FailedApiKeyValueResponse(_0x1283f8);}catch(_0x314fff){if(_0x314fff instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x314fff['message'],'title':_0x314fff['name'],'status':0x1f4,'instance':'','type':''});throw _0x314fff;}});}['delete'](_0x39cccb,_0x269f15,_0x59c906){return __awaiter$4(this,void 0,void 0,function*(){const _0x432cea=this['path']+'/'+_0x39cccb+'/'+_0x269f15;try{const _0x2f7322=yield this['fetch']['delete'](_0x432cea,_0x59c906);if(_0x2f7322['status']>0xc7&&_0x2f7322['status']<0x12c)return new SuccessfulResponse({});const _0x38941f=yield _0x2f7322['json']();return new FailedResponse(_0x38941f);}catch(_0x17c062){if(_0x17c062 instanceof Error)return new FailedResponse({'detail':_0x17c062['message'],'title':_0x17c062['name'],'status':0x1f4,'instance':'','type':''});throw _0x17c062;}});}}
|
|
6
|
-
|
|
7
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x9782f2,_0x4a65fe,_0x3b4cfb,_0x24621c){function _0x240d3d(_0x1a0ea2){return _0x1a0ea2 instanceof _0x3b4cfb?_0x1a0ea2:new _0x3b4cfb(function(_0x48ab96){_0x48ab96(_0x1a0ea2);});}return new(_0x3b4cfb||(_0x3b4cfb=Promise))(function(_0x392ec7,_0x40d9ae){function _0x5a4e7f(_0x3803c5){try{_0x2a772d(_0x24621c['next'](_0x3803c5));}catch(_0x443559){_0x40d9ae(_0x443559);}}function _0x40d081(_0x2260b5){try{_0x2a772d(_0x24621c['throw'](_0x2260b5));}catch(_0x33f192){_0x40d9ae(_0x33f192);}}function _0x2a772d(_0x40c5a2){_0x40c5a2['done']?_0x392ec7(_0x40c5a2['value']):_0x240d3d(_0x40c5a2['value'])['then'](_0x5a4e7f,_0x40d081);}_0x2a772d((_0x24621c=_0x24621c['apply'](_0x9782f2,_0x4a65fe||[]))['next']());});};class ListService{constructor(_0x2ee11e){this['fetch']=_0x2ee11e;}['add'](_0x12b674,_0x422541,_0x3f897a){return __awaiter$3(this,void 0,void 0,function*(){const _0x2fd1df='List',_0x367b8b={'account_name':_0x12b674,'list_name':_0x422541};try{const _0x3944f5=yield this['fetch']['post'](_0x2fd1df,_0x3f897a,_0x367b8b);if(_0x3944f5['status']>0xc7&&_0x3944f5['status']<0x12c){const _0x5964e3=yield _0x3944f5['json']();return new SuccessfulAccountResponse(_0x5964e3);}const _0x4e4737=yield _0x3944f5['json']();return new FailedAccountResponse(_0x4e4737);}catch(_0x1da67c){if(_0x1da67c instanceof Error)return new FailedAccountResponse({'detail':_0x1da67c['message'],'title':_0x1da67c['name'],'status':0x1f4,'instance':'','type':''});throw _0x1da67c;}});}['remove'](_0xdd935,_0x5949e6,_0x24c09c){return __awaiter$3(this,void 0,void 0,function*(){const _0xbcd122='List/'+_0xdd935+'/'+_0x5949e6,_0xbc32bf=yield this['fetch']['delete'](_0xbcd122,_0x24c09c);try{if(_0xbc32bf['status']>0xc7&&_0xbc32bf['status']<0x12c){const _0x1dcec1=yield _0xbc32bf['json']();return new SuccessfulAccountResponse(_0x1dcec1);}const _0x2038f1=yield _0xbc32bf['json']();return new FailedAccountResponse(_0x2038f1);}catch(_0x2992cd){if(_0x2992cd instanceof Error)return new FailedAccountResponse({'detail':_0x2992cd['message'],'title':_0x2992cd['name'],'status':0x1f4,'instance':'','type':''});throw _0x2992cd;}});}}
|
|
8
|
-
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x436ecc,_0x5ee802,_0x39720f,_0x1f68b0){function _0x309a28(_0x2e3c56){return _0x2e3c56 instanceof _0x39720f?_0x2e3c56:new _0x39720f(function(_0x1cfd2c){_0x1cfd2c(_0x2e3c56);});}return new(_0x39720f||(_0x39720f=Promise))(function(_0x1c17ad,_0x54c994){function _0x3e8c70(_0xa297aa){try{_0x556252(_0x1f68b0['next'](_0xa297aa));}catch(_0x266d7c){_0x54c994(_0x266d7c);}}function _0x2f4abb(_0x103467){try{_0x556252(_0x1f68b0['throw'](_0x103467));}catch(_0x59f493){_0x54c994(_0x59f493);}}function _0x556252(_0x5271bc){_0x5271bc['done']?_0x1c17ad(_0x5271bc['value']):_0x309a28(_0x5271bc['value'])['then'](_0x3e8c70,_0x2f4abb);}_0x556252((_0x1f68b0=_0x1f68b0['apply'](_0x436ecc,_0x5ee802||[]))['next']());});};class Fetch{constructor(_0xe79e96){this['baseUri']=_0xe79e96,this['getUrl']=_0x1a9d02=>{return _0x1a9d02['startsWith']('/')&&(_0x1a9d02=_0x1a9d02['replace']('/','')),''+this['baseUri']+_0x1a9d02;},!_0xe79e96['endsWith']('/')&&(_0xe79e96=_0xe79e96+'/');}['get'](_0x1bd4d9,_0x25101a){return __awaiter$2(this,void 0,void 0,function*(){const _0x43dbdb=this['getUrl'](_0x1bd4d9);return yield fetch(_0x43dbdb,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x25101a}});});}['post'](_0x47f8dc,_0x41bd65,_0x2dcef1){return __awaiter$2(this,void 0,void 0,function*(){const _0x31ce69=this['getUrl'](_0x47f8dc);return yield fetch(_0x31ce69,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x41bd65},'body':_0x2dcef1?JSON['stringify'](_0x2dcef1):null});});}['put'](_0x4664bc,_0x1961e6,_0x529cf7){return __awaiter$2(this,void 0,void 0,function*(){const _0x3e6597=this['getUrl'](_0x4664bc);return yield fetch(_0x3e6597,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1961e6},'body':_0x529cf7?JSON['stringify'](_0x529cf7):null});});}['delete'](_0x21a9e6,_0x2b6398){return __awaiter$2(this,void 0,void 0,function*(){const _0x5dad26=this['getUrl'](_0x21a9e6);return yield fetch(_0x5dad26,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2b6398}});});}}
|
|
10
|
-
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x4bb500,_0x5c0bbd,_0x546c4b,_0x191509){function _0x3a8bf8(_0x166232){return _0x166232 instanceof _0x546c4b?_0x166232:new _0x546c4b(function(_0x2a0fe6){_0x2a0fe6(_0x166232);});}return new(_0x546c4b||(_0x546c4b=Promise))(function(_0xd3f1a5,_0xebcad6){function _0x62a7db(_0x321a1c){try{_0x461fbf(_0x191509['next'](_0x321a1c));}catch(_0x30d3b1){_0xebcad6(_0x30d3b1);}}function _0x1f044b(_0x51bc23){try{_0x461fbf(_0x191509['throw'](_0x51bc23));}catch(_0x2a4a3a){_0xebcad6(_0x2a4a3a);}}function _0x461fbf(_0x5183fc){_0x5183fc['done']?_0xd3f1a5(_0x5183fc['value']):_0x3a8bf8(_0x5183fc['value'])['then'](_0x62a7db,_0x1f044b);}_0x461fbf((_0x191509=_0x191509['apply'](_0x4bb500,_0x5c0bbd||[]))['next']());});};class SearchServersService{constructor(_0x3e8c95){this['fetch']=_0x3e8c95,this['path']='search-services';}['create'](_0x388f27,_0x31f50e,_0x44872f,_0x2e5a9a,_0x448a0b,_0x26135e,_0xb813e0,_0x558458){return __awaiter$1(this,void 0,void 0,function*(){const _0x3339c5={'account_name':_0x388f27,'search_service_name':_0x31f50e,'endpoint':_0x44872f,'key':_0x2e5a9a,'country':_0x448a0b,'provider':_0x26135e,'index_name':_0xb813e0};try{const _0xa6595b=yield this['fetch']['post'](this['path'],_0x558458,_0x3339c5);if(_0xa6595b['status']>0xc7&&_0xa6595b['status']<0x12c){const _0x2cfeac=yield _0xa6595b['json']();return new SuccessfulSearchServiceResponse(_0x2cfeac);}const _0x2ec447=yield _0xa6595b['json']();return new FailedSearchServiceResponse(_0x2ec447);}catch(_0x2b4ac2){if(_0x2b4ac2 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x2b4ac2['message'],'title':_0x2b4ac2['name'],'status':0x1f4,'instance':'','type':''});throw _0x2b4ac2;}});}['delete'](_0x2a1f60,_0x47d332,_0x3c6bed){return __awaiter$1(this,void 0,void 0,function*(){const _0x4a2c2a=this['path']+'/'+_0x2a1f60+'/'+_0x47d332;try{const _0x3bf763=yield this['fetch']['delete'](_0x4a2c2a,_0x3c6bed);if(_0x3bf763['status']>0xc7&&_0x3bf763['status']<0x12c)return new SuccessfulResponse({});const _0x27ba00=yield _0x3bf763['json']();return new FailedResponse(_0x27ba00);}catch(_0x4c7495){if(_0x4c7495 instanceof Error)return new FailedResponse({'detail':_0x4c7495['message'],'title':_0x4c7495['name'],'status':0x1f4,'instance':'','type':''});throw _0x4c7495;}});}['view'](_0x3ea289,_0x57ad7a,_0x5a56df){return __awaiter$1(this,void 0,void 0,function*(){const _0x35079a=this['path']+'/'+_0x3ea289+'/'+_0x57ad7a;try{const _0x182ff6=yield this['fetch']['get'](_0x35079a,_0x5a56df);if(_0x182ff6['status']>0xc7&&_0x182ff6['status']<0x12c){const _0x528479=yield _0x182ff6['json']();return new SuccessfulViewSearchServiceResponse(_0x528479);}const _0x3de575=yield _0x182ff6['json']();return new FailedViewSearchServiceResponse(_0x3de575);}catch(_0x3beb58){if(_0x3beb58 instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x3beb58['message'],'title':_0x3beb58['name'],'status':0x1f4,'instance':'','type':''});throw _0x3beb58;}});}}
|
|
12
|
-
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x1f4b52,_0x4bc822,_0x1f57f5,_0x3a1e38){function _0x49cf99(_0x32ccce){return _0x32ccce instanceof _0x1f57f5?_0x32ccce:new _0x1f57f5(function(_0x5dbd7a){_0x5dbd7a(_0x32ccce);});}return new(_0x1f57f5||(_0x1f57f5=Promise))(function(_0x4adc17,_0x462789){function _0x4d2859(_0x1d5ae0){try{_0x591986(_0x3a1e38['next'](_0x1d5ae0));}catch(_0x8d5c55){_0x462789(_0x8d5c55);}}function _0x5b1d31(_0x3a1a3e){try{_0x591986(_0x3a1e38['throw'](_0x3a1a3e));}catch(_0x5554aa){_0x462789(_0x5554aa);}}function _0x591986(_0x4a6613){_0x4a6613['done']?_0x4adc17(_0x4a6613['value']):_0x49cf99(_0x4a6613['value'])['then'](_0x4d2859,_0x5b1d31);}_0x591986((_0x3a1e38=_0x3a1e38['apply'](_0x1f4b52,_0x4bc822||[]))['next']());});};class AdminClient{constructor(_0x5c9139='https://admin.searchability.dev/'){var _0x2f1a39=new Fetch(_0x5c9139);this['Accounts']=new AccountService(_0x2f1a39),this['Lists']=new ListService(_0x2f1a39),this['ApiKeys']=new ApiKeyService(_0x2f1a39),this['SearchServices']=new SearchServersService(_0x2f1a39);}}class AuthClient{constructor(_0x4e5fd5='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x4e5fd5);}['login'](_0x1e56df){return __awaiter(this,void 0,void 0,function*(){var _0x5fb48a='login/'+_0x1e56df;try{const _0x9d86e1=yield yield fetch(_0x5fb48a);if(_0x9d86e1['status']>0xc7&&_0x9d86e1['status']<0x12c){const _0x3af293=yield _0x9d86e1['json']();return new SuccessfulAuthResponse(_0x3af293);}const _0x5e13d5=yield _0x9d86e1['json']();return new FailedAuthResponse(_0x5e13d5);}catch(_0x227fb7){if(_0x227fb7 instanceof Error)return new FailedAuthResponse({'detail':_0x227fb7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x227fb7;}});}['refresh'](_0x51ac00){return __awaiter(this,void 0,void 0,function*(){var _0x10b43d='refresh';try{const _0x4ce44d=yield this['fetch']['post'](_0x10b43d,_0x51ac00,null);if(_0x4ce44d['status']>0xc7&&_0x4ce44d['status']<0x12c){const _0x2eb36c=yield _0x4ce44d['json']();return new SuccessfulAuthResponse(_0x2eb36c);}const _0x152751=yield _0x4ce44d['json']();return new FailedAuthResponse(_0x152751);}catch(_0x392f4d){if(_0x392f4d instanceof Error)return new FailedAuthResponse({'detail':_0x392f4d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x392f4d;}});}['getTokenStatus'](_0x3990fb){if(Date['now']()<_0x3990fb['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x3990fb['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
14
|
-
|
|
15
|
-
export { AdminClient, AuthClient, TokenStatus, Tokens };
|