@searchability/admin-client 0.0.51 → 0.0.52
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(_0x27e844){_0x27e844[_0x27e844['Ok']=0x0]='Ok',_0x27e844[_0x27e844['Refresh']=0x1]='Refresh',_0x27e844[_0x27e844['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(_0x288543){this['isSuccess']=_0x288543;}}class SuccessfulAccountResponse extends Response{constructor(_0x24f984){super(!![]),this['account']=_0x24f984;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x5bc751){super(!![]),this['list']=_0x5bc751;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListResponse extends Response{constructor(_0x3416dd){super(!![]),this['list']=_0x3416dd;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0xca7f3e){super(![]),this['problem']=_0xca7f3e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x1591d6){super(![]),this['problem']=_0x1591d6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListResponse extends Response{constructor(_0x51892f){super(![]),this['problem']=_0x51892f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x4a0eca){super(!![]),this['tokens']=_0x4a0eca;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x9099c5){super(![]),this['problem']=_0x9099c5;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x3f3a32){super(!![]),this['apiKey']=_0x3f3a32;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x3c37d1){super(![]),this['problem']=_0x3c37d1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x3a3007){super(!![]),this['searchService']=_0x3a3007;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0xbfa31a){super(![]),this['problem']=_0xbfa31a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x13b5ab){super(!![]),this['searchService']=_0x13b5ab;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0x4bbb32){super(!![]),this['searchServices']=_0x4bbb32;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x239b28){super(![]),this['problem']=_0x239b28;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x164126){super(![]),this['problem']=_0x164126;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x27550a){super(!![]),this['apiKeyValue']=_0x27550a;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x34c835){super(!![]),this['obj']=_0x34c835;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x12e17d){super(![]),this['problem']=_0x12e17d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0xc2f36c){super(![]),this['problem']=_0xc2f36c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
|
+
|
|
3
|
+
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x34d04a,_0x39b68d,_0x5b14d0,_0x239d0d){function _0x25b026(_0x167de8){return _0x167de8 instanceof _0x5b14d0?_0x167de8:new _0x5b14d0(function(_0x300bfb){_0x300bfb(_0x167de8);});}return new(_0x5b14d0||(_0x5b14d0=Promise))(function(_0x3d6e0f,_0x1e9546){function _0x1060b1(_0x4439a9){try{_0x3de2ff(_0x239d0d['next'](_0x4439a9));}catch(_0xf3051c){_0x1e9546(_0xf3051c);}}function _0x160e1b(_0x33556f){try{_0x3de2ff(_0x239d0d['throw'](_0x33556f));}catch(_0x2cc6a7){_0x1e9546(_0x2cc6a7);}}function _0x3de2ff(_0xb4b441){_0xb4b441['done']?_0x3d6e0f(_0xb4b441['value']):_0x25b026(_0xb4b441['value'])['then'](_0x1060b1,_0x160e1b);}_0x3de2ff((_0x239d0d=_0x239d0d['apply'](_0x34d04a,_0x39b68d||[]))['next']());});};class AccountService{constructor(_0x53edf5){this['fetch']=_0x53edf5;}['get'](_0x141f61,_0x2e9861){return __awaiter$5(this,void 0,void 0,function*(){const _0x2c8dfd='Account/'+_0x141f61+'/',_0x43b2ab=yield this['fetch']['get'](_0x2c8dfd,_0x2e9861);try{if(_0x43b2ab['status']>0xc7&&_0x43b2ab['status']<0x12c){const _0x1783d2=yield _0x43b2ab['json']();return new SuccessfulAccountResponse(_0x1783d2);}const _0x2ce9d1=yield _0x43b2ab['json']();return new FailedAccountResponse(_0x2ce9d1);}catch(_0x44876){if(_0x44876 instanceof Error)return new FailedAccountResponse({'detail':_0x44876['message'],'title':_0x44876['name'],'status':0x1f4,'instance':'','type':''});throw _0x44876;}});}}
|
|
4
|
+
|
|
5
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4c1e2b,_0x4612cc,_0x525bd1,_0x2011cf){function _0x3fd622(_0x9514f9){return _0x9514f9 instanceof _0x525bd1?_0x9514f9:new _0x525bd1(function(_0x3e5f68){_0x3e5f68(_0x9514f9);});}return new(_0x525bd1||(_0x525bd1=Promise))(function(_0x48717b,_0x1dd05c){function _0x35c34d(_0xf27f36){try{_0x5c5f22(_0x2011cf['next'](_0xf27f36));}catch(_0x3614ca){_0x1dd05c(_0x3614ca);}}function _0x2f8f76(_0x2fc123){try{_0x5c5f22(_0x2011cf['throw'](_0x2fc123));}catch(_0x42c731){_0x1dd05c(_0x42c731);}}function _0x5c5f22(_0x5a19ee){_0x5a19ee['done']?_0x48717b(_0x5a19ee['value']):_0x3fd622(_0x5a19ee['value'])['then'](_0x35c34d,_0x2f8f76);}_0x5c5f22((_0x2011cf=_0x2011cf['apply'](_0x4c1e2b,_0x4612cc||[]))['next']());});};class ApiKeyService{constructor(_0x556478){this['fetch']=_0x556478,this['path']='api-key';}['create'](_0x4f645a,_0x427787,_0x546355){return __awaiter$4(this,void 0,void 0,function*(){const _0x3a4e3d={'account_name':_0x4f645a,'api_key_name':_0x427787};try{const _0x4d6195=yield this['fetch']['post'](this['path'],_0x546355,_0x3a4e3d);if(_0x4d6195['status']>0xc7&&_0x4d6195['status']<0x12c){const _0x4c1975=yield _0x4d6195['json']();return new SuccessfulApiKeyResponse(_0x4c1975);}const _0x43a65a=yield _0x4d6195['json']();return new FailedApiKeyResponse(_0x43a65a);}catch(_0x52a69a){if(_0x52a69a instanceof Error)return new FailedApiKeyResponse({'detail':_0x52a69a['message'],'title':_0x52a69a['name'],'status':0x1f4,'instance':'','type':''});throw _0x52a69a;}});}['view'](_0x40e76c,_0x1e1c95,_0x4ffe54){return __awaiter$4(this,void 0,void 0,function*(){const _0x2d4bf7=this['path']+'/'+_0x40e76c+'/'+_0x1e1c95;try{const _0x5931d0=yield this['fetch']['get'](_0x2d4bf7,_0x4ffe54);if(_0x5931d0['status']>0xc7&&_0x5931d0['status']<0x12c){const _0x3f03e7=yield _0x5931d0['json']();return new SuccessfulApiKeyValueResponse(_0x3f03e7);}const _0x3b7fb1=yield _0x5931d0['json']();return new FailedApiKeyValueResponse(_0x3b7fb1);}catch(_0x182e29){if(_0x182e29 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x182e29['message'],'title':_0x182e29['name'],'status':0x1f4,'instance':'','type':''});throw _0x182e29;}});}['delete'](_0x8073da,_0x404cf3,_0x27828d){return __awaiter$4(this,void 0,void 0,function*(){const _0x5ede4a=this['path']+'/'+_0x8073da+'/'+_0x404cf3;try{const _0xabff91=yield this['fetch']['delete'](_0x5ede4a,_0x27828d);if(_0xabff91['status']>0xc7&&_0xabff91['status']<0x12c)return new SuccessfulResponse({});const _0x4104d6=yield _0xabff91['json']();return new FailedResponse(_0x4104d6);}catch(_0x3ef045){if(_0x3ef045 instanceof Error)return new FailedResponse({'detail':_0x3ef045['message'],'title':_0x3ef045['name'],'status':0x1f4,'instance':'','type':''});throw _0x3ef045;}});}}
|
|
6
|
+
|
|
7
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x3a6f0c,_0x3ba789,_0x132502,_0xa75cda){function _0x40046a(_0x5a7651){return _0x5a7651 instanceof _0x132502?_0x5a7651:new _0x132502(function(_0x3c743c){_0x3c743c(_0x5a7651);});}return new(_0x132502||(_0x132502=Promise))(function(_0x43202a,_0x3f01b3){function _0x296f1d(_0x2d8184){try{_0x2884ee(_0xa75cda['next'](_0x2d8184));}catch(_0x57f4af){_0x3f01b3(_0x57f4af);}}function _0x32ddf9(_0x4a3b99){try{_0x2884ee(_0xa75cda['throw'](_0x4a3b99));}catch(_0x5bed63){_0x3f01b3(_0x5bed63);}}function _0x2884ee(_0x3e60b1){_0x3e60b1['done']?_0x43202a(_0x3e60b1['value']):_0x40046a(_0x3e60b1['value'])['then'](_0x296f1d,_0x32ddf9);}_0x2884ee((_0xa75cda=_0xa75cda['apply'](_0x3a6f0c,_0x3ba789||[]))['next']());});};class ListService{constructor(_0x322258){this['fetch']=_0x322258;}['add'](_0x21046d,_0x4f0d32,_0x770de4,_0x188d97){return __awaiter$3(this,void 0,void 0,function*(){const _0x14bb5a='List',_0x1f345e={'account_name':_0x21046d,'list_name':_0x4f0d32,'search_service_name':_0x770de4};try{const _0x13c142=yield this['fetch']['post'](_0x14bb5a,_0x188d97,_0x1f345e);if(_0x13c142['status']>0xc7&&_0x13c142['status']<0x12c){const _0x3b5590=yield _0x13c142['json']();return new SuccessfulListIdentityResponse(_0x3b5590);}const _0x9b7fac=yield _0x13c142['json']();return new FailedListIdentityResponse(_0x9b7fac);}catch(_0x3f9e1f){if(_0x3f9e1f instanceof Error)return new FailedListIdentityResponse({'detail':_0x3f9e1f['message'],'title':_0x3f9e1f['name'],'status':0x1f4,'instance':'','type':''});throw _0x3f9e1f;}});}['delete'](_0x1aef55,_0x50fc45,_0x2565b0){return __awaiter$3(this,void 0,void 0,function*(){const _0x233c7b='List/'+_0x1aef55+'/'+_0x50fc45,_0x3608db=yield this['fetch']['delete'](_0x233c7b,_0x2565b0);try{if(_0x3608db['status']>0xc7&&_0x3608db['status']<0x12c)return new SuccessfulResponse({});const _0x20c1f8=yield _0x3608db['json']();return new FailedResponse(_0x20c1f8);}catch(_0x1059e1){if(_0x1059e1 instanceof Error)return new FailedResponse({'detail':_0x1059e1['message'],'title':_0x1059e1['name'],'status':0x1f4,'instance':'','type':''});throw _0x1059e1;}});}['get'](_0x1ebcaa,_0x345cff,_0x144493){return __awaiter$3(this,void 0,void 0,function*(){const _0x1ba808='List/'+_0x1ebcaa+'/'+_0x345cff;try{const _0xf536cb=yield this['fetch']['get'](_0x1ba808,_0x144493);if(_0xf536cb['status']>0xc7&&_0xf536cb['status']<0x12c){const _0x2a3eb3=yield _0xf536cb['json']();return new SuccessfulListResponse(_0x2a3eb3);}const _0x12c309=yield _0xf536cb['json']();return new FailedListResponse(_0x12c309);}catch(_0x3a4a43){if(_0x3a4a43 instanceof Error)return new FailedListResponse({'detail':_0x3a4a43['message'],'title':_0x3a4a43['name'],'status':0x1f4,'instance':'','type':''});throw _0x3a4a43;}});}}
|
|
8
|
+
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x200ce1,_0x4cc81c,_0x3f3509,_0x4855d5){function _0x540635(_0x1417ee){return _0x1417ee instanceof _0x3f3509?_0x1417ee:new _0x3f3509(function(_0xf6c4c2){_0xf6c4c2(_0x1417ee);});}return new(_0x3f3509||(_0x3f3509=Promise))(function(_0x3c0193,_0x3ba3fd){function _0x378609(_0x85a497){try{_0x4627c9(_0x4855d5['next'](_0x85a497));}catch(_0x15142b){_0x3ba3fd(_0x15142b);}}function _0x140ab0(_0xf8ea9d){try{_0x4627c9(_0x4855d5['throw'](_0xf8ea9d));}catch(_0x27e474){_0x3ba3fd(_0x27e474);}}function _0x4627c9(_0x11bd97){_0x11bd97['done']?_0x3c0193(_0x11bd97['value']):_0x540635(_0x11bd97['value'])['then'](_0x378609,_0x140ab0);}_0x4627c9((_0x4855d5=_0x4855d5['apply'](_0x200ce1,_0x4cc81c||[]))['next']());});};class Fetch{constructor(_0x4f1705){this['baseUri']=_0x4f1705,this['getUrl']=_0x5810e2=>{return _0x5810e2['startsWith']('/')&&(_0x5810e2=_0x5810e2['replace']('/','')),''+this['baseUri']+_0x5810e2;},!_0x4f1705['endsWith']('/')&&(_0x4f1705=_0x4f1705+'/');}['get'](_0xccc257,_0x56a225){return __awaiter$2(this,void 0,void 0,function*(){const _0x201fae=this['getUrl'](_0xccc257);return yield fetch(_0x201fae,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x56a225}});});}['post'](_0x10fdda,_0x5064a0,_0x4fe66f){return __awaiter$2(this,void 0,void 0,function*(){const _0x54dbf3=this['getUrl'](_0x10fdda);return yield fetch(_0x54dbf3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5064a0},'body':_0x4fe66f?JSON['stringify'](_0x4fe66f):null});});}['PostNoAuth'](_0x16d6db,_0x1ac101){return __awaiter$2(this,void 0,void 0,function*(){const _0x35da47=this['getUrl'](_0x16d6db);return yield fetch(_0x35da47,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x1ac101?JSON['stringify'](_0x1ac101):null});});}['put'](_0x8f237f,_0x2bf8de,_0x5d2ca2){return __awaiter$2(this,void 0,void 0,function*(){const _0x4a9c53=this['getUrl'](_0x8f237f);return yield fetch(_0x4a9c53,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2bf8de},'body':_0x5d2ca2?JSON['stringify'](_0x5d2ca2):null});});}['delete'](_0x2edd0a,_0xe94f66){return __awaiter$2(this,void 0,void 0,function*(){const _0x3abce0=this['getUrl'](_0x2edd0a);return yield fetch(_0x3abce0,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xe94f66}});});}}
|
|
10
|
+
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xa807cd,_0xc7e6f7,_0x2f051f,_0x20381a){function _0x2c4c19(_0xbc922d){return _0xbc922d instanceof _0x2f051f?_0xbc922d:new _0x2f051f(function(_0x1f60f5){_0x1f60f5(_0xbc922d);});}return new(_0x2f051f||(_0x2f051f=Promise))(function(_0x5e5e04,_0x241c90){function _0x4abd5e(_0x1c67cf){try{_0x15802c(_0x20381a['next'](_0x1c67cf));}catch(_0x3db402){_0x241c90(_0x3db402);}}function _0x4b5bdd(_0x116fd6){try{_0x15802c(_0x20381a['throw'](_0x116fd6));}catch(_0x5daa48){_0x241c90(_0x5daa48);}}function _0x15802c(_0x31d6c6){_0x31d6c6['done']?_0x5e5e04(_0x31d6c6['value']):_0x2c4c19(_0x31d6c6['value'])['then'](_0x4abd5e,_0x4b5bdd);}_0x15802c((_0x20381a=_0x20381a['apply'](_0xa807cd,_0xc7e6f7||[]))['next']());});};class SearchServersService{constructor(_0x440d99){this['fetch']=_0x440d99,this['path']='search-services';}['create'](_0x5b5523,_0x15c917,_0x59ccc6,_0x5cf9e7,_0x1042d2,_0x3c7d9d,_0x1434d5,_0x1cac66){return __awaiter$1(this,void 0,void 0,function*(){const _0x521af1={'account_name':_0x5b5523,'search_service_name':_0x15c917,'endpoint':_0x59ccc6,'key':_0x5cf9e7,'country':_0x1042d2,'provider':_0x3c7d9d,'index_name':_0x1434d5};try{const _0x4513c8=yield this['fetch']['post'](this['path'],_0x1cac66,_0x521af1);if(_0x4513c8['status']>0xc7&&_0x4513c8['status']<0x12c){const _0x208e6e=yield _0x4513c8['json']();return new SuccessfulSearchServiceResponse(_0x208e6e);}const _0x225a9d=yield _0x4513c8['json']();return new FailedSearchServiceResponse(_0x225a9d);}catch(_0x15fc24){if(_0x15fc24 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x15fc24['message'],'title':_0x15fc24['name'],'status':0x1f4,'instance':'','type':''});throw _0x15fc24;}});}['delete'](_0x359a3f,_0x485bd0,_0x497b11){return __awaiter$1(this,void 0,void 0,function*(){const _0x1fd7a1=this['path']+'/'+_0x359a3f+'/'+_0x485bd0;try{const _0x4b2b17=yield this['fetch']['delete'](_0x1fd7a1,_0x497b11);if(_0x4b2b17['status']>0xc7&&_0x4b2b17['status']<0x12c)return new SuccessfulResponse({});const _0x162c58=yield _0x4b2b17['json']();return new FailedResponse(_0x162c58);}catch(_0x5d84b4){if(_0x5d84b4 instanceof Error)return new FailedResponse({'detail':_0x5d84b4['message'],'title':_0x5d84b4['name'],'status':0x1f4,'instance':'','type':''});throw _0x5d84b4;}});}['view'](_0x42b04c,_0x476e42,_0x124585){return __awaiter$1(this,void 0,void 0,function*(){const _0x338638=this['path']+'/'+_0x42b04c+'/'+_0x476e42;try{const _0x1547c9=yield this['fetch']['get'](_0x338638,_0x124585);if(_0x1547c9['status']>0xc7&&_0x1547c9['status']<0x12c){const _0x330d4b=yield _0x1547c9['json']();return new SuccessfulViewSearchServiceResponse(_0x330d4b);}const _0x3bb7ee=yield _0x1547c9['json']();return new FailedViewSearchServiceResponse(_0x3bb7ee);}catch(_0x11e356){if(_0x11e356 instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x11e356['message'],'title':_0x11e356['name'],'status':0x1f4,'instance':'','type':''});throw _0x11e356;}});}['edit'](_0x1a0fb6,_0x4ccf6d,_0xf37c0c,_0x2f2758,_0x41c0e3,_0x495936){return __awaiter$1(this,void 0,void 0,function*(){const _0x13e1b9={'account_name':_0x1a0fb6,'search_service_name':_0x4ccf6d,'new_search_service_name':_0xf37c0c,'key':_0x2f2758,'country':_0x41c0e3};try{const _0x14219b=yield this['fetch']['put'](this['path'],_0x495936,_0x13e1b9);if(_0x14219b['status']>0xc7&&_0x14219b['status']<0x12c){const _0x23b1c9=yield _0x14219b['json']();return new SuccessfulSearchServiceResponse(_0x23b1c9);}const _0x591cfd=yield _0x14219b['json']();return new FailedSearchServiceResponse(_0x591cfd);}catch(_0x77036b){if(_0x77036b instanceof Error)return new FailedSearchServiceResponse({'detail':_0x77036b['message'],'title':_0x77036b['name'],'status':0x1f4,'instance':'','type':''});throw _0x77036b;}});}['list'](_0x5d063f,_0x58a5ef){return __awaiter$1(this,void 0,void 0,function*(){const _0x249262=this['path']+'/'+_0x5d063f;try{const _0x551a9b=yield this['fetch']['get'](_0x249262,_0x58a5ef);if(_0x551a9b['status']>0xc7&&_0x551a9b['status']<0x12c){const _0x3378fb=yield _0x551a9b['json']();return new SuccessfulListSearchServiceResponse(_0x3378fb);}const _0x13cbc1=yield _0x551a9b['json']();return new FailedViewSearchServicesResponse(_0x13cbc1);}catch(_0x578b0f){if(_0x578b0f instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x578b0f['message'],'title':_0x578b0f['name'],'status':0x1f4,'instance':'','type':''});throw _0x578b0f;}});}}
|
|
12
|
+
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x497e0c,_0x21eeda,_0xa0138e,_0xc9cdff){function _0x2ce7fb(_0x439a1a){return _0x439a1a instanceof _0xa0138e?_0x439a1a:new _0xa0138e(function(_0x27e652){_0x27e652(_0x439a1a);});}return new(_0xa0138e||(_0xa0138e=Promise))(function(_0xf9929f,_0x410019){function _0x95ea0a(_0x4ab691){try{_0x25fbf5(_0xc9cdff['next'](_0x4ab691));}catch(_0x5671c4){_0x410019(_0x5671c4);}}function _0x1b2c4e(_0x5b1178){try{_0x25fbf5(_0xc9cdff['throw'](_0x5b1178));}catch(_0x4e7cb1){_0x410019(_0x4e7cb1);}}function _0x25fbf5(_0x29d151){_0x29d151['done']?_0xf9929f(_0x29d151['value']):_0x2ce7fb(_0x29d151['value'])['then'](_0x95ea0a,_0x1b2c4e);}_0x25fbf5((_0xc9cdff=_0xc9cdff['apply'](_0x497e0c,_0x21eeda||[]))['next']());});};class AdminClient{constructor(_0x1311d5='https://admin.searchability.dev/'){var _0xf1ffac=new Fetch(_0x1311d5);this['Accounts']=new AccountService(_0xf1ffac),this['Lists']=new ListService(_0xf1ffac),this['ApiKeys']=new ApiKeyService(_0xf1ffac),this['SearchServices']=new SearchServersService(_0xf1ffac);}}class AuthClient{constructor(_0x290384='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x290384);}['login'](_0xea2ef8){return __awaiter(this,void 0,void 0,function*(){const _0x5e3c4f='login/'+_0xea2ef8;try{const _0x4e1607=yield yield fetch(_0x5e3c4f);if(_0x4e1607['status']>0xc7&&_0x4e1607['status']<0x12c){const _0x355860=yield _0x4e1607['json']();return new SuccessfulAuthResponse(_0x355860);}const _0xd2790b=yield _0x4e1607['json']();return new FailedAuthResponse(_0xd2790b);}catch(_0x34e40a){if(_0x34e40a instanceof Error)return new FailedAuthResponse({'detail':_0x34e40a['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x34e40a;}});}['refresh'](_0x3cc966){return __awaiter(this,void 0,void 0,function*(){const _0x462caf='refresh',_0x46aa4e={'refresh_token':_0x3cc966};try{const _0x4bfa1c=yield this['fetch']['PostNoAuth'](_0x462caf,_0x46aa4e);if(_0x4bfa1c['status']>0xc7&&_0x4bfa1c['status']<0x12c){const _0x4dbad8=yield _0x4bfa1c['json']();return new SuccessfulAuthResponse(_0x4dbad8);}const _0xd563e9=yield _0x4bfa1c['json']();return new FailedAuthResponse(_0xd563e9);}catch(_0x4cc547){if(_0x4cc547 instanceof Error)return new FailedAuthResponse({'detail':_0x4cc547['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4cc547;}});}['getTokenStatus'](_0x15c529){if(Date['now']()<_0x15c529['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x15c529['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(_0x1afaeb){_0x1afaeb[_0x1afaeb['Ok']=0x0]='Ok',_0x1afaeb[_0x1afaeb['Refresh']=0x1]='Refresh',_0x1afaeb[_0x1afaeb['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(_0x230e98){this['isSuccess']=_0x230e98;}}class SuccessfulAccountResponse extends Response{constructor(_0x22ac93){super(!![]),this['account']=_0x22ac93;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x4fb3b2){super(!![]),this['list']=_0x4fb3b2;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListResponse extends Response{constructor(_0x4d510b){super(!![]),this['list']=_0x4d510b;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x244286){super(![]),this['problem']=_0x244286;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x55695d){super(![]),this['problem']=_0x55695d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListResponse extends Response{constructor(_0x38a4f0){super(![]),this['problem']=_0x38a4f0;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x3b1e33){super(!![]),this['tokens']=_0x3b1e33;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x54d959){super(![]),this['problem']=_0x54d959;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x5d1fdb){super(!![]),this['apiKey']=_0x5d1fdb;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0xcc37d6){super(![]),this['problem']=_0xcc37d6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x52cbaa){super(!![]),this['searchService']=_0x52cbaa;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x2a4bc1){super(![]),this['problem']=_0x2a4bc1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0xef42a2){super(!![]),this['searchService']=_0xef42a2;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0x157a99){super(!![]),this['searchServices']=_0x157a99;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x30b462){super(![]),this['problem']=_0x30b462;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x461c76){super(![]),this['problem']=_0x461c76;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x42f3fe){super(!![]),this['apiKeyValue']=_0x42f3fe;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x3975d2){super(!![]),this['obj']=_0x3975d2;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x4e55bd){super(![]),this['problem']=_0x4e55bd;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x27c4b8){super(![]),this['problem']=_0x27c4b8;}['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(_0x24ecdd,_0x5b4108,_0x1386ca,_0x4f064f){function _0x24f79a(_0x3fde52){return _0x3fde52 instanceof _0x1386ca?_0x3fde52:new _0x1386ca(function(_0x1b20e3){_0x1b20e3(_0x3fde52);});}return new(_0x1386ca||(_0x1386ca=Promise))(function(_0x44a2bf,_0x4b82f9){function _0x2a9706(_0xb7a2cd){try{_0x1aa5f3(_0x4f064f['next'](_0xb7a2cd));}catch(_0xdbefc1){_0x4b82f9(_0xdbefc1);}}function _0x30b05b(_0xca3b63){try{_0x1aa5f3(_0x4f064f['throw'](_0xca3b63));}catch(_0x50ff54){_0x4b82f9(_0x50ff54);}}function _0x1aa5f3(_0x40bcfa){_0x40bcfa['done']?_0x44a2bf(_0x40bcfa['value']):_0x24f79a(_0x40bcfa['value'])['then'](_0x2a9706,_0x30b05b);}_0x1aa5f3((_0x4f064f=_0x4f064f['apply'](_0x24ecdd,_0x5b4108||[]))['next']());});};class AccountService{constructor(_0x4d6043){this['fetch']=_0x4d6043;}['get'](_0x2ace22,_0x50689a){return __awaiter$5(this,void 0,void 0,function*(){const _0x1b1bb3='Account/'+_0x2ace22+'/',_0x113661=yield this['fetch']['get'](_0x1b1bb3,_0x50689a);try{if(_0x113661['status']>0xc7&&_0x113661['status']<0x12c){const _0x1dba82=yield _0x113661['json']();return new SuccessfulAccountResponse(_0x1dba82);}const _0x2871d3=yield _0x113661['json']();return new FailedAccountResponse(_0x2871d3);}catch(_0x265d10){if(_0x265d10 instanceof Error)return new FailedAccountResponse({'detail':_0x265d10['message'],'title':_0x265d10['name'],'status':0x1f4,'instance':'','type':''});throw _0x265d10;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x1df396,_0x32755f,_0x10b90e,_0x54463d){function _0x368171(_0x12396e){return _0x12396e instanceof _0x10b90e?_0x12396e:new _0x10b90e(function(_0x58d5fe){_0x58d5fe(_0x12396e);});}return new(_0x10b90e||(_0x10b90e=Promise))(function(_0x57ad53,_0x474a74){function _0x448425(_0x3b0ac5){try{_0x3040ef(_0x54463d['next'](_0x3b0ac5));}catch(_0x5b8e1d){_0x474a74(_0x5b8e1d);}}function _0x319603(_0x410f9e){try{_0x3040ef(_0x54463d['throw'](_0x410f9e));}catch(_0x51e7af){_0x474a74(_0x51e7af);}}function _0x3040ef(_0x161a2b){_0x161a2b['done']?_0x57ad53(_0x161a2b['value']):_0x368171(_0x161a2b['value'])['then'](_0x448425,_0x319603);}_0x3040ef((_0x54463d=_0x54463d['apply'](_0x1df396,_0x32755f||[]))['next']());});};class ApiKeyService{constructor(_0x131e57){this['fetch']=_0x131e57,this['path']='api-key';}['create'](_0x1da47a,_0x46a05e,_0x20426b){return __awaiter$4(this,void 0,void 0,function*(){const _0x42cc28={'account_name':_0x1da47a,'api_key_name':_0x46a05e};try{const _0x410624=yield this['fetch']['post'](this['path'],_0x20426b,_0x42cc28);if(_0x410624['status']>0xc7&&_0x410624['status']<0x12c){const _0x464a73=yield _0x410624['json']();return new SuccessfulApiKeyResponse(_0x464a73);}const _0x277afd=yield _0x410624['json']();return new FailedApiKeyResponse(_0x277afd);}catch(_0x269c06){if(_0x269c06 instanceof Error)return new FailedApiKeyResponse({'detail':_0x269c06['message'],'title':_0x269c06['name'],'status':0x1f4,'instance':'','type':''});throw _0x269c06;}});}['view'](_0x501861,_0x23a238,_0x170c37){return __awaiter$4(this,void 0,void 0,function*(){const _0x1a3419=this['path']+'/'+_0x501861+'/'+_0x23a238;try{const _0x240d67=yield this['fetch']['get'](_0x1a3419,_0x170c37);if(_0x240d67['status']>0xc7&&_0x240d67['status']<0x12c){const _0x38ec01=yield _0x240d67['json']();return new SuccessfulApiKeyValueResponse(_0x38ec01);}const _0x498b8a=yield _0x240d67['json']();return new FailedApiKeyValueResponse(_0x498b8a);}catch(_0x531054){if(_0x531054 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x531054['message'],'title':_0x531054['name'],'status':0x1f4,'instance':'','type':''});throw _0x531054;}});}['delete'](_0xfe96d5,_0x269089,_0x495289){return __awaiter$4(this,void 0,void 0,function*(){const _0x46a3af=this['path']+'/'+_0xfe96d5+'/'+_0x269089;try{const _0x560192=yield this['fetch']['delete'](_0x46a3af,_0x495289);if(_0x560192['status']>0xc7&&_0x560192['status']<0x12c)return new SuccessfulResponse({});const _0x3693bb=yield _0x560192['json']();return new FailedResponse(_0x3693bb);}catch(_0x2afaec){if(_0x2afaec instanceof Error)return new FailedResponse({'detail':_0x2afaec['message'],'title':_0x2afaec['name'],'status':0x1f4,'instance':'','type':''});throw _0x2afaec;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x6a1ea7,_0x21806c,_0x411cbd,_0x187c7b){function _0x56dfc1(_0xe19732){return _0xe19732 instanceof _0x411cbd?_0xe19732:new _0x411cbd(function(_0x236255){_0x236255(_0xe19732);});}return new(_0x411cbd||(_0x411cbd=Promise))(function(_0x51eee5,_0x25a0f8){function _0x193f66(_0x1032de){try{_0x37ee3f(_0x187c7b['next'](_0x1032de));}catch(_0xf864ff){_0x25a0f8(_0xf864ff);}}function _0x1383ea(_0x11263c){try{_0x37ee3f(_0x187c7b['throw'](_0x11263c));}catch(_0x73baa9){_0x25a0f8(_0x73baa9);}}function _0x37ee3f(_0x124c8f){_0x124c8f['done']?_0x51eee5(_0x124c8f['value']):_0x56dfc1(_0x124c8f['value'])['then'](_0x193f66,_0x1383ea);}_0x37ee3f((_0x187c7b=_0x187c7b['apply'](_0x6a1ea7,_0x21806c||[]))['next']());});};class ListService{constructor(_0x55396f){this['fetch']=_0x55396f;}['add'](_0x1b9f27,_0x527452,_0x37a41b,_0x5295d5){return __awaiter$3(this,void 0,void 0,function*(){const _0xa3499b='List',_0x21208a={'account_name':_0x1b9f27,'list_name':_0x527452,'search_service_name':_0x37a41b};try{const _0x1704d9=yield this['fetch']['post'](_0xa3499b,_0x5295d5,_0x21208a);if(_0x1704d9['status']>0xc7&&_0x1704d9['status']<0x12c){const _0x2f0f0e=yield _0x1704d9['json']();return new SuccessfulListIdentityResponse(_0x2f0f0e);}const _0x1ac010=yield _0x1704d9['json']();return new FailedListIdentityResponse(_0x1ac010);}catch(_0xb3ee1a){if(_0xb3ee1a instanceof Error)return new FailedListIdentityResponse({'detail':_0xb3ee1a['message'],'title':_0xb3ee1a['name'],'status':0x1f4,'instance':'','type':''});throw _0xb3ee1a;}});}['delete'](_0x1a183c,_0x309c9d,_0x3a201b){return __awaiter$3(this,void 0,void 0,function*(){const _0x1b1fa6='List/'+_0x1a183c+'/'+_0x309c9d,_0x6027b=yield this['fetch']['delete'](_0x1b1fa6,_0x3a201b);try{if(_0x6027b['status']>0xc7&&_0x6027b['status']<0x12c)return new SuccessfulResponse({});const _0x5894e3=yield _0x6027b['json']();return new FailedResponse(_0x5894e3);}catch(_0x4072d6){if(_0x4072d6 instanceof Error)return new FailedResponse({'detail':_0x4072d6['message'],'title':_0x4072d6['name'],'status':0x1f4,'instance':'','type':''});throw _0x4072d6;}});}['get'](_0x389df7,_0x59c35e,_0x3c1051){return __awaiter$3(this,void 0,void 0,function*(){const _0x46a718='List/'+_0x389df7+'/'+_0x59c35e;try{const _0x83417f=yield this['fetch']['get'](_0x46a718,_0x3c1051);if(_0x83417f['status']>0xc7&&_0x83417f['status']<0x12c){const _0x3000b7=yield _0x83417f['json']();return new SuccessfulListResponse(_0x3000b7);}const _0x3eb1f3=yield _0x83417f['json']();return new FailedListResponse(_0x3eb1f3);}catch(_0x2d15e4){if(_0x2d15e4 instanceof Error)return new FailedListResponse({'detail':_0x2d15e4['message'],'title':_0x2d15e4['name'],'status':0x1f4,'instance':'','type':''});throw _0x2d15e4;}});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x797931,_0x125e2a,_0x5c0873,_0x474226){function _0x5c7a26(_0x1d3519){return _0x1d3519 instanceof _0x5c0873?_0x1d3519:new _0x5c0873(function(_0x46223e){_0x46223e(_0x1d3519);});}return new(_0x5c0873||(_0x5c0873=Promise))(function(_0x4c4e3e,_0x5e790c){function _0x823f21(_0x524986){try{_0x36d145(_0x474226['next'](_0x524986));}catch(_0x3cf9be){_0x5e790c(_0x3cf9be);}}function _0x1c8dc1(_0x31e6bd){try{_0x36d145(_0x474226['throw'](_0x31e6bd));}catch(_0x3e9535){_0x5e790c(_0x3e9535);}}function _0x36d145(_0x52cc5f){_0x52cc5f['done']?_0x4c4e3e(_0x52cc5f['value']):_0x5c7a26(_0x52cc5f['value'])['then'](_0x823f21,_0x1c8dc1);}_0x36d145((_0x474226=_0x474226['apply'](_0x797931,_0x125e2a||[]))['next']());});};class Fetch{constructor(_0x4f4607){this['baseUri']=_0x4f4607,this['getUrl']=_0x211770=>{return _0x211770['startsWith']('/')&&(_0x211770=_0x211770['replace']('/','')),''+this['baseUri']+_0x211770;},!_0x4f4607['endsWith']('/')&&(_0x4f4607=_0x4f4607+'/');}['get'](_0x4dce56,_0x22de44){return __awaiter$2(this,void 0,void 0,function*(){const _0x172d67=this['getUrl'](_0x4dce56);return yield fetch(_0x172d67,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x22de44}});});}['post'](_0x277c5f,_0x1c6935,_0x464f46){return __awaiter$2(this,void 0,void 0,function*(){const _0xedd20b=this['getUrl'](_0x277c5f);return yield fetch(_0xedd20b,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1c6935},'body':_0x464f46?JSON['stringify'](_0x464f46):null});});}['PostNoAuth'](_0x154ddf,_0x51195d){return __awaiter$2(this,void 0,void 0,function*(){const _0x5ab9ad=this['getUrl'](_0x154ddf);return yield fetch(_0x5ab9ad,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x51195d?JSON['stringify'](_0x51195d):null});});}['put'](_0x4473ba,_0x48a055,_0x552952){return __awaiter$2(this,void 0,void 0,function*(){const _0x119af5=this['getUrl'](_0x4473ba);return yield fetch(_0x119af5,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x48a055},'body':_0x552952?JSON['stringify'](_0x552952):null});});}['delete'](_0x3082ff,_0x46173d){return __awaiter$2(this,void 0,void 0,function*(){const _0x2988ce=this['getUrl'](_0x3082ff);return yield fetch(_0x2988ce,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x46173d}});});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x1f47bc,_0x115ae1,_0x265b47,_0x559274){function _0x181beb(_0x551e8b){return _0x551e8b instanceof _0x265b47?_0x551e8b:new _0x265b47(function(_0x511121){_0x511121(_0x551e8b);});}return new(_0x265b47||(_0x265b47=Promise))(function(_0x17ebdd,_0x422d6f){function _0x5ad00a(_0x3a64b1){try{_0x5339a5(_0x559274['next'](_0x3a64b1));}catch(_0x33c121){_0x422d6f(_0x33c121);}}function _0x313a19(_0x353eb1){try{_0x5339a5(_0x559274['throw'](_0x353eb1));}catch(_0x969a14){_0x422d6f(_0x969a14);}}function _0x5339a5(_0x503f2d){_0x503f2d['done']?_0x17ebdd(_0x503f2d['value']):_0x181beb(_0x503f2d['value'])['then'](_0x5ad00a,_0x313a19);}_0x5339a5((_0x559274=_0x559274['apply'](_0x1f47bc,_0x115ae1||[]))['next']());});};class SearchServersService{constructor(_0x46f159){this['fetch']=_0x46f159,this['path']='search-services';}['create'](_0x3909ae,_0x3acdd8,_0x4d1b23,_0x104abf,_0x307f3f,_0x433f74,_0x576810,_0x35fdff){return __awaiter$1(this,void 0,void 0,function*(){const _0x8c8f6e={'account_name':_0x3909ae,'search_service_name':_0x3acdd8,'endpoint':_0x4d1b23,'key':_0x104abf,'country':_0x307f3f,'provider':_0x433f74,'index_name':_0x576810};try{const _0x1a970e=yield this['fetch']['post'](this['path'],_0x35fdff,_0x8c8f6e);if(_0x1a970e['status']>0xc7&&_0x1a970e['status']<0x12c){const _0x3b7c30=yield _0x1a970e['json']();return new SuccessfulSearchServiceResponse(_0x3b7c30);}const _0x49ca5c=yield _0x1a970e['json']();return new FailedSearchServiceResponse(_0x49ca5c);}catch(_0x22bc5e){if(_0x22bc5e instanceof Error)return new FailedSearchServiceResponse({'detail':_0x22bc5e['message'],'title':_0x22bc5e['name'],'status':0x1f4,'instance':'','type':''});throw _0x22bc5e;}});}['delete'](_0x20a48b,_0x4878e9,_0x1b6a12){return __awaiter$1(this,void 0,void 0,function*(){const _0x224eac=this['path']+'/'+_0x20a48b+'/'+_0x4878e9;try{const _0x49cba6=yield this['fetch']['delete'](_0x224eac,_0x1b6a12);if(_0x49cba6['status']>0xc7&&_0x49cba6['status']<0x12c)return new SuccessfulResponse({});const _0x34ee7f=yield _0x49cba6['json']();return new FailedResponse(_0x34ee7f);}catch(_0x2ab864){if(_0x2ab864 instanceof Error)return new FailedResponse({'detail':_0x2ab864['message'],'title':_0x2ab864['name'],'status':0x1f4,'instance':'','type':''});throw _0x2ab864;}});}['view'](_0x30ff7e,_0x45834e,_0x1dacc4){return __awaiter$1(this,void 0,void 0,function*(){const _0x28f1b0=this['path']+'/'+_0x30ff7e+'/'+_0x45834e;try{const _0x380b5f=yield this['fetch']['get'](_0x28f1b0,_0x1dacc4);if(_0x380b5f['status']>0xc7&&_0x380b5f['status']<0x12c){const _0x5c31a6=yield _0x380b5f['json']();return new SuccessfulViewSearchServiceResponse(_0x5c31a6);}const _0x8b5e60=yield _0x380b5f['json']();return new FailedViewSearchServiceResponse(_0x8b5e60);}catch(_0x198abc){if(_0x198abc instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x198abc['message'],'title':_0x198abc['name'],'status':0x1f4,'instance':'','type':''});throw _0x198abc;}});}['edit'](_0x550412,_0x36a741,_0xfe0cdf,_0x1b8274,_0x282938,_0x1543ca){return __awaiter$1(this,void 0,void 0,function*(){const _0x3100af={'account_name':_0x550412,'search_service_name':_0x36a741,'new_search_service_name':_0xfe0cdf,'key':_0x1b8274,'country':_0x282938};try{const _0x172d1d=yield this['fetch']['put'](this['path'],_0x1543ca,_0x3100af);if(_0x172d1d['status']>0xc7&&_0x172d1d['status']<0x12c){const _0x55c900=yield _0x172d1d['json']();return new SuccessfulSearchServiceResponse(_0x55c900);}const _0x50051d=yield _0x172d1d['json']();return new FailedSearchServiceResponse(_0x50051d);}catch(_0x7174d8){if(_0x7174d8 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x7174d8['message'],'title':_0x7174d8['name'],'status':0x1f4,'instance':'','type':''});throw _0x7174d8;}});}['list'](_0x301fd5,_0xc02087){return __awaiter$1(this,void 0,void 0,function*(){const _0x5d88de=this['path']+'/'+_0x301fd5;try{const _0x51f715=yield this['fetch']['get'](_0x5d88de,_0xc02087);if(_0x51f715['status']>0xc7&&_0x51f715['status']<0x12c){const _0x2e6a32=yield _0x51f715['json']();return new SuccessfulListSearchServiceResponse(_0x2e6a32);}const _0x4942c6=yield _0x51f715['json']();return new FailedViewSearchServicesResponse(_0x4942c6);}catch(_0x27789b){if(_0x27789b instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x27789b['message'],'title':_0x27789b['name'],'status':0x1f4,'instance':'','type':''});throw _0x27789b;}});}}
|
|
14
14
|
|
|
15
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
15
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x4b9d12,_0x5776d7,_0x40530d,_0x143145){function _0x147ad7(_0x391883){return _0x391883 instanceof _0x40530d?_0x391883:new _0x40530d(function(_0x437b6d){_0x437b6d(_0x391883);});}return new(_0x40530d||(_0x40530d=Promise))(function(_0x364c2a,_0x630576){function _0x2d74d0(_0x4700db){try{_0x451031(_0x143145['next'](_0x4700db));}catch(_0x54235b){_0x630576(_0x54235b);}}function _0x378a14(_0x4bd867){try{_0x451031(_0x143145['throw'](_0x4bd867));}catch(_0x2ec174){_0x630576(_0x2ec174);}}function _0x451031(_0x17edd1){_0x17edd1['done']?_0x364c2a(_0x17edd1['value']):_0x147ad7(_0x17edd1['value'])['then'](_0x2d74d0,_0x378a14);}_0x451031((_0x143145=_0x143145['apply'](_0x4b9d12,_0x5776d7||[]))['next']());});};class AdminClient{constructor(_0x2ca57e='https://admin.searchability.dev/'){var _0x5ced33=new Fetch(_0x2ca57e);this['Accounts']=new AccountService(_0x5ced33),this['Lists']=new ListService(_0x5ced33),this['ApiKeys']=new ApiKeyService(_0x5ced33),this['SearchServices']=new SearchServersService(_0x5ced33);}}class AuthClient{constructor(_0x37ce75='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x37ce75);}['login'](_0x322ea4){return __awaiter(this,void 0,void 0,function*(){const _0x833271='login/'+_0x322ea4;try{const _0x70b64e=yield yield fetch(_0x833271);if(_0x70b64e['status']>0xc7&&_0x70b64e['status']<0x12c){const _0x1529c2=yield _0x70b64e['json']();return new SuccessfulAuthResponse(_0x1529c2);}const _0x8beb05=yield _0x70b64e['json']();return new FailedAuthResponse(_0x8beb05);}catch(_0x46634c){if(_0x46634c instanceof Error)return new FailedAuthResponse({'detail':_0x46634c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x46634c;}});}['refresh'](_0x111f85){return __awaiter(this,void 0,void 0,function*(){const _0x2a7eb5='refresh',_0x56adbd={'refresh_token':_0x111f85};try{const _0x44a4d5=yield this['fetch']['PostNoAuth'](_0x2a7eb5,_0x56adbd);if(_0x44a4d5['status']>0xc7&&_0x44a4d5['status']<0x12c){const _0x36f52b=yield _0x44a4d5['json']();return new SuccessfulAuthResponse(_0x36f52b);}const _0x1bc980=yield _0x44a4d5['json']();return new FailedAuthResponse(_0x1bc980);}catch(_0x3565aa){if(_0x3565aa instanceof Error)return new FailedAuthResponse({'detail':_0x3565aa['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3565aa;}});}['getTokenStatus'](_0x2b3176){if(Date['now']()<_0x2b3176['access_expires'])return exports.TokenStatus['Ok'];if(Date['now']()<_0x2b3176['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(_0x954cc7){_0x954cc7[_0x954cc7['Ok']=0x0]='Ok',_0x954cc7[_0x954cc7['Refresh']=0x1]='Refresh',_0x954cc7[_0x954cc7['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(_0x20f074){this['isSuccess']=_0x20f074;}}class SuccessfulAccountResponse extends Response{constructor(_0x1d06f3){super(!![]),this['account']=_0x1d06f3;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x45f67d){super(!![]),this['list']=_0x45f67d;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListResponse extends Response{constructor(_0x141a4a){super(!![]),this['list']=_0x141a4a;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x5339f9){super(![]),this['problem']=_0x5339f9;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x1ec3c4){super(![]),this['problem']=_0x1ec3c4;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListResponse extends Response{constructor(_0x14b312){super(![]),this['problem']=_0x14b312;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x44ec1d){super(!![]),this['tokens']=_0x44ec1d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x11d76a){super(![]),this['problem']=_0x11d76a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x3921e9){super(!![]),this['apiKey']=_0x3921e9;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x5f1d35){super(![]),this['problem']=_0x5f1d35;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x1bf56f){super(!![]),this['searchService']=_0x1bf56f;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x3cfaaa){super(![]),this['problem']=_0x3cfaaa;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x2dd889){super(!![]),this['searchService']=_0x2dd889;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0xbf8e11){super(!![]),this['searchServices']=_0xbf8e11;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x3ec28c){super(![]),this['problem']=_0x3ec28c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x5d4352){super(![]),this['problem']=_0x5d4352;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x33d275){super(!![]),this['apiKeyValue']=_0x33d275;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x50e7cb){super(!![]),this['obj']=_0x50e7cb;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x5fe3c2){super(![]),this['problem']=_0x5fe3c2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x30698c){super(![]),this['problem']=_0x30698c;}['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(_0x5d826b,_0xf6c046,_0x272787,_0x826ad5){function _0x21900d(_0x159792){return _0x159792 instanceof _0x272787?_0x159792:new _0x272787(function(_0x2717b5){_0x2717b5(_0x159792);});}return new(_0x272787||(_0x272787=Promise))(function(_0x4f8d64,_0x571fbf){function _0x121b01(_0x3bd247){try{_0x3a2f8c(_0x826ad5['next'](_0x3bd247));}catch(_0x4e966a){_0x571fbf(_0x4e966a);}}function _0xa306a(_0x2d599a){try{_0x3a2f8c(_0x826ad5['throw'](_0x2d599a));}catch(_0x192192){_0x571fbf(_0x192192);}}function _0x3a2f8c(_0xbf5bae){_0xbf5bae['done']?_0x4f8d64(_0xbf5bae['value']):_0x21900d(_0xbf5bae['value'])['then'](_0x121b01,_0xa306a);}_0x3a2f8c((_0x826ad5=_0x826ad5['apply'](_0x5d826b,_0xf6c046||[]))['next']());});};class AccountService{constructor(_0x470ecc){this['fetch']=_0x470ecc;}['get'](_0x5ff359,_0x5e95d6){return __awaiter$5(this,void 0,void 0,function*(){const _0xa7d57='Account/'+_0x5ff359+'/',_0x195a43=yield this['fetch']['get'](_0xa7d57,_0x5e95d6);try{if(_0x195a43['status']>0xc7&&_0x195a43['status']<0x12c){const _0x1274c4=yield _0x195a43['json']();return new SuccessfulAccountResponse(_0x1274c4);}const _0x24aa90=yield _0x195a43['json']();return new FailedAccountResponse(_0x24aa90);}catch(_0x46483b){if(_0x46483b instanceof Error)return new FailedAccountResponse({'detail':_0x46483b['message'],'title':_0x46483b['name'],'status':0x1f4,'instance':'','type':''});throw _0x46483b;}});}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x13f348,_0x2e8685,_0x2d573e,_0x40f527){function _0x3d0d09(_0x1a646d){return _0x1a646d instanceof _0x2d573e?_0x1a646d:new _0x2d573e(function(_0x59258c){_0x59258c(_0x1a646d);});}return new(_0x2d573e||(_0x2d573e=Promise))(function(_0x259b0c,_0x211d28){function _0x1aee46(_0x1df6a2){try{_0xe060fe(_0x40f527['next'](_0x1df6a2));}catch(_0x406d6e){_0x211d28(_0x406d6e);}}function _0x57aa10(_0x327aab){try{_0xe060fe(_0x40f527['throw'](_0x327aab));}catch(_0x1e3487){_0x211d28(_0x1e3487);}}function _0xe060fe(_0x48656f){_0x48656f['done']?_0x259b0c(_0x48656f['value']):_0x3d0d09(_0x48656f['value'])['then'](_0x1aee46,_0x57aa10);}_0xe060fe((_0x40f527=_0x40f527['apply'](_0x13f348,_0x2e8685||[]))['next']());});};class ApiKeyService{constructor(_0x400c69){this['fetch']=_0x400c69,this['path']='api-key';}['create'](_0x3d2d36,_0x5c368e,_0x382239){return __awaiter$4(this,void 0,void 0,function*(){const _0x56098d={'account_name':_0x3d2d36,'api_key_name':_0x5c368e};try{const _0x38b724=yield this['fetch']['post'](this['path'],_0x382239,_0x56098d);if(_0x38b724['status']>0xc7&&_0x38b724['status']<0x12c){const _0x50af16=yield _0x38b724['json']();return new SuccessfulApiKeyResponse(_0x50af16);}const _0x185e7d=yield _0x38b724['json']();return new FailedApiKeyResponse(_0x185e7d);}catch(_0x486d9b){if(_0x486d9b instanceof Error)return new FailedApiKeyResponse({'detail':_0x486d9b['message'],'title':_0x486d9b['name'],'status':0x1f4,'instance':'','type':''});throw _0x486d9b;}});}['view'](_0x52e352,_0x26ad5f,_0x155ad8){return __awaiter$4(this,void 0,void 0,function*(){const _0x55c5ee=this['path']+'/'+_0x52e352+'/'+_0x26ad5f;try{const _0x1fb52b=yield this['fetch']['get'](_0x55c5ee,_0x155ad8);if(_0x1fb52b['status']>0xc7&&_0x1fb52b['status']<0x12c){const _0x8331e=yield _0x1fb52b['json']();return new SuccessfulApiKeyValueResponse(_0x8331e);}const _0x4ea577=yield _0x1fb52b['json']();return new FailedApiKeyValueResponse(_0x4ea577);}catch(_0x50530f){if(_0x50530f instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x50530f['message'],'title':_0x50530f['name'],'status':0x1f4,'instance':'','type':''});throw _0x50530f;}});}['delete'](_0x2bfccc,_0x31d98f,_0x1d12ac){return __awaiter$4(this,void 0,void 0,function*(){const _0x3ddab1=this['path']+'/'+_0x2bfccc+'/'+_0x31d98f;try{const _0x15c899=yield this['fetch']['delete'](_0x3ddab1,_0x1d12ac);if(_0x15c899['status']>0xc7&&_0x15c899['status']<0x12c)return new SuccessfulResponse({});const _0x376aad=yield _0x15c899['json']();return new FailedResponse(_0x376aad);}catch(_0x22d8af){if(_0x22d8af instanceof Error)return new FailedResponse({'detail':_0x22d8af['message'],'title':_0x22d8af['name'],'status':0x1f4,'instance':'','type':''});throw _0x22d8af;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x33ee51,_0x1f0cd2,_0x16aacb,_0x39706f){function _0x350024(_0x312c59){return _0x312c59 instanceof _0x16aacb?_0x312c59:new _0x16aacb(function(_0x4c1494){_0x4c1494(_0x312c59);});}return new(_0x16aacb||(_0x16aacb=Promise))(function(_0x509b2c,_0x5645c9){function _0x5f1167(_0x248a9c){try{_0x2c0568(_0x39706f['next'](_0x248a9c));}catch(_0x318490){_0x5645c9(_0x318490);}}function _0x5e8fc5(_0x47759e){try{_0x2c0568(_0x39706f['throw'](_0x47759e));}catch(_0x3035fd){_0x5645c9(_0x3035fd);}}function _0x2c0568(_0x5bf5cb){_0x5bf5cb['done']?_0x509b2c(_0x5bf5cb['value']):_0x350024(_0x5bf5cb['value'])['then'](_0x5f1167,_0x5e8fc5);}_0x2c0568((_0x39706f=_0x39706f['apply'](_0x33ee51,_0x1f0cd2||[]))['next']());});};class ListService{constructor(_0x386d03){this['fetch']=_0x386d03;}['add'](_0x16781e,_0x1fbff1,_0x2d9d10,_0x2b94ec){return __awaiter$3(this,void 0,void 0,function*(){const _0x42a71a='List',_0x3c89a3={'account_name':_0x16781e,'list_name':_0x1fbff1,'search_service_name':_0x2d9d10};try{const _0x23a88e=yield this['fetch']['post'](_0x42a71a,_0x2b94ec,_0x3c89a3);if(_0x23a88e['status']>0xc7&&_0x23a88e['status']<0x12c){const _0x396dce=yield _0x23a88e['json']();return new SuccessfulListIdentityResponse(_0x396dce);}const _0x47d466=yield _0x23a88e['json']();return new FailedListIdentityResponse(_0x47d466);}catch(_0x7f40fa){if(_0x7f40fa instanceof Error)return new FailedListIdentityResponse({'detail':_0x7f40fa['message'],'title':_0x7f40fa['name'],'status':0x1f4,'instance':'','type':''});throw _0x7f40fa;}});}['delete'](_0x3bf363,_0x5baf8c,_0x2843a1){return __awaiter$3(this,void 0,void 0,function*(){const _0x58af5f='List/'+_0x3bf363+'/'+_0x5baf8c,_0x3838d7=yield this['fetch']['delete'](_0x58af5f,_0x2843a1);try{if(_0x3838d7['status']>0xc7&&_0x3838d7['status']<0x12c)return new SuccessfulResponse({});const _0x24bb71=yield _0x3838d7['json']();return new FailedResponse(_0x24bb71);}catch(_0x5b54c8){if(_0x5b54c8 instanceof Error)return new FailedResponse({'detail':_0x5b54c8['message'],'title':_0x5b54c8['name'],'status':0x1f4,'instance':'','type':''});throw _0x5b54c8;}});}['get'](_0x4aa1e4,_0x5d9364,_0x4bc909){return __awaiter$3(this,void 0,void 0,function*(){const _0x3a183e='List/'+_0x4aa1e4+'/'+_0x5d9364;try{const _0xf9f08b=yield this['fetch']['get'](_0x3a183e,_0x4bc909);if(_0xf9f08b['status']>0xc7&&_0xf9f08b['status']<0x12c){const _0x1666b8=yield _0xf9f08b['json']();return new SuccessfulListResponse(_0x1666b8);}const _0x441869=yield _0xf9f08b['json']();return new FailedListResponse(_0x441869);}catch(_0x373d88){if(_0x373d88 instanceof Error)return new FailedListResponse({'detail':_0x373d88['message'],'title':_0x373d88['name'],'status':0x1f4,'instance':'','type':''});throw _0x373d88;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x5d42e4,_0x467c06,_0x281375,_0x5f4c12){function _0x53d371(_0x141e07){return _0x141e07 instanceof _0x281375?_0x141e07:new _0x281375(function(_0x4e3621){_0x4e3621(_0x141e07);});}return new(_0x281375||(_0x281375=Promise))(function(_0x2410f6,_0xcd3dcd){function _0x15bf51(_0x7a68d5){try{_0x52c8c8(_0x5f4c12['next'](_0x7a68d5));}catch(_0xe50f98){_0xcd3dcd(_0xe50f98);}}function _0x51c878(_0xbb0cbd){try{_0x52c8c8(_0x5f4c12['throw'](_0xbb0cbd));}catch(_0x149a5f){_0xcd3dcd(_0x149a5f);}}function _0x52c8c8(_0x3b6755){_0x3b6755['done']?_0x2410f6(_0x3b6755['value']):_0x53d371(_0x3b6755['value'])['then'](_0x15bf51,_0x51c878);}_0x52c8c8((_0x5f4c12=_0x5f4c12['apply'](_0x5d42e4,_0x467c06||[]))['next']());});};class Fetch{constructor(_0x44bfaf){this['baseUri']=_0x44bfaf,this['getUrl']=_0x49afd9=>{return _0x49afd9['startsWith']('/')&&(_0x49afd9=_0x49afd9['replace']('/','')),''+this['baseUri']+_0x49afd9;},!_0x44bfaf['endsWith']('/')&&(_0x44bfaf=_0x44bfaf+'/');}['get'](_0x2f9666,_0x1714bd){return __awaiter$2(this,void 0,void 0,function*(){const _0x245583=this['getUrl'](_0x2f9666);return yield fetch(_0x245583,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1714bd}});});}['post'](_0x100655,_0x677a6f,_0x1127b9){return __awaiter$2(this,void 0,void 0,function*(){const _0x3d6221=this['getUrl'](_0x100655);return yield fetch(_0x3d6221,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x677a6f},'body':_0x1127b9?JSON['stringify'](_0x1127b9):null});});}['PostNoAuth'](_0x1cf14e,_0x7eadd){return __awaiter$2(this,void 0,void 0,function*(){const _0x4b8b44=this['getUrl'](_0x1cf14e);return yield fetch(_0x4b8b44,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x7eadd?JSON['stringify'](_0x7eadd):null});});}['put'](_0x279c44,_0x2a6152,_0x583a80){return __awaiter$2(this,void 0,void 0,function*(){const _0x2ef595=this['getUrl'](_0x279c44);return yield fetch(_0x2ef595,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2a6152},'body':_0x583a80?JSON['stringify'](_0x583a80):null});});}['delete'](_0x1951f6,_0x4264db){return __awaiter$2(this,void 0,void 0,function*(){const _0x427f5d=this['getUrl'](_0x1951f6);return yield fetch(_0x427f5d,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4264db}});});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x474c96,_0x210ae4,_0x39d2a2,_0xf614e){function _0x115234(_0x313ce6){return _0x313ce6 instanceof _0x39d2a2?_0x313ce6:new _0x39d2a2(function(_0x1a54ab){_0x1a54ab(_0x313ce6);});}return new(_0x39d2a2||(_0x39d2a2=Promise))(function(_0x2b528e,_0x146bea){function _0x2ec1cc(_0xfe44b5){try{_0x1c96e0(_0xf614e['next'](_0xfe44b5));}catch(_0xfdda67){_0x146bea(_0xfdda67);}}function _0x1b8fc4(_0x1b2b06){try{_0x1c96e0(_0xf614e['throw'](_0x1b2b06));}catch(_0x14d753){_0x146bea(_0x14d753);}}function _0x1c96e0(_0x142acc){_0x142acc['done']?_0x2b528e(_0x142acc['value']):_0x115234(_0x142acc['value'])['then'](_0x2ec1cc,_0x1b8fc4);}_0x1c96e0((_0xf614e=_0xf614e['apply'](_0x474c96,_0x210ae4||[]))['next']());});};class SearchServersService{constructor(_0x233893){this['fetch']=_0x233893,this['path']='search-services';}['create'](_0x306bdc,_0xb8dd5d,_0x14c556,_0x1aea1f,_0x455d4b,_0x43280a,_0x2a6911,_0x8b0a99){return __awaiter$1(this,void 0,void 0,function*(){const _0x159f3b={'account_name':_0x306bdc,'search_service_name':_0xb8dd5d,'endpoint':_0x14c556,'key':_0x1aea1f,'country':_0x455d4b,'provider':_0x43280a,'index_name':_0x2a6911};try{const _0x265ee2=yield this['fetch']['post'](this['path'],_0x8b0a99,_0x159f3b);if(_0x265ee2['status']>0xc7&&_0x265ee2['status']<0x12c){const _0x2c13dd=yield _0x265ee2['json']();return new SuccessfulSearchServiceResponse(_0x2c13dd);}const _0x440182=yield _0x265ee2['json']();return new FailedSearchServiceResponse(_0x440182);}catch(_0x14df38){if(_0x14df38 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x14df38['message'],'title':_0x14df38['name'],'status':0x1f4,'instance':'','type':''});throw _0x14df38;}});}['delete'](_0x3e7111,_0x30642e,_0x17ed2){return __awaiter$1(this,void 0,void 0,function*(){const _0x53c6db=this['path']+'/'+_0x3e7111+'/'+_0x30642e;try{const _0x57e3c8=yield this['fetch']['delete'](_0x53c6db,_0x17ed2);if(_0x57e3c8['status']>0xc7&&_0x57e3c8['status']<0x12c)return new SuccessfulResponse({});const _0x1939d8=yield _0x57e3c8['json']();return new FailedResponse(_0x1939d8);}catch(_0x6d6ee4){if(_0x6d6ee4 instanceof Error)return new FailedResponse({'detail':_0x6d6ee4['message'],'title':_0x6d6ee4['name'],'status':0x1f4,'instance':'','type':''});throw _0x6d6ee4;}});}['view'](_0x22b79b,_0x3b3889,_0x2ec5a0){return __awaiter$1(this,void 0,void 0,function*(){const _0x2ca117=this['path']+'/'+_0x22b79b+'/'+_0x3b3889;try{const _0x201ee9=yield this['fetch']['get'](_0x2ca117,_0x2ec5a0);if(_0x201ee9['status']>0xc7&&_0x201ee9['status']<0x12c){const _0xecefe5=yield _0x201ee9['json']();return new SuccessfulViewSearchServiceResponse(_0xecefe5);}const _0x687560=yield _0x201ee9['json']();return new FailedViewSearchServiceResponse(_0x687560);}catch(_0x67526a){if(_0x67526a instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x67526a['message'],'title':_0x67526a['name'],'status':0x1f4,'instance':'','type':''});throw _0x67526a;}});}['edit'](_0x335162,_0xe7591d,_0x606b91,_0x741435,_0x12a654,_0x440baa){return __awaiter$1(this,void 0,void 0,function*(){const _0x539034={'account_name':_0x335162,'search_service_name':_0xe7591d,'new_search_service_name':_0x606b91,'key':_0x741435,'country':_0x12a654};try{const _0x3d55e8=yield this['fetch']['put'](this['path'],_0x440baa,_0x539034);if(_0x3d55e8['status']>0xc7&&_0x3d55e8['status']<0x12c){const _0x56b92d=yield _0x3d55e8['json']();return new SuccessfulSearchServiceResponse(_0x56b92d);}const _0x308a24=yield _0x3d55e8['json']();return new FailedSearchServiceResponse(_0x308a24);}catch(_0x3074db){if(_0x3074db instanceof Error)return new FailedSearchServiceResponse({'detail':_0x3074db['message'],'title':_0x3074db['name'],'status':0x1f4,'instance':'','type':''});throw _0x3074db;}});}['list'](_0x456f14,_0x200c97){return __awaiter$1(this,void 0,void 0,function*(){const _0x58093a=this['path']+'/'+_0x456f14;try{const _0x464972=yield this['fetch']['get'](_0x58093a,_0x200c97);if(_0x464972['status']>0xc7&&_0x464972['status']<0x12c){const _0x3cf321=yield _0x464972['json']();return new SuccessfulListSearchServiceResponse(_0x3cf321);}const _0x10c647=yield _0x464972['json']();return new FailedViewSearchServicesResponse(_0x10c647);}catch(_0x18416d){if(_0x18416d instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x18416d['message'],'title':_0x18416d['name'],'status':0x1f4,'instance':'','type':''});throw _0x18416d;}});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x2bd030,_0x50fb1f,_0x43a242,_0x35a250){function _0x3fb7fa(_0x2a5661){return _0x2a5661 instanceof _0x43a242?_0x2a5661:new _0x43a242(function(_0x3f155f){_0x3f155f(_0x2a5661);});}return new(_0x43a242||(_0x43a242=Promise))(function(_0x10aa0b,_0x3fa2bf){function _0x20e4cb(_0x150ec4){try{_0x15032a(_0x35a250['next'](_0x150ec4));}catch(_0x35033d){_0x3fa2bf(_0x35033d);}}function _0x1eb6cc(_0x2a9786){try{_0x15032a(_0x35a250['throw'](_0x2a9786));}catch(_0x480921){_0x3fa2bf(_0x480921);}}function _0x15032a(_0x5c773f){_0x5c773f['done']?_0x10aa0b(_0x5c773f['value']):_0x3fb7fa(_0x5c773f['value'])['then'](_0x20e4cb,_0x1eb6cc);}_0x15032a((_0x35a250=_0x35a250['apply'](_0x2bd030,_0x50fb1f||[]))['next']());});};class AdminClient{constructor(_0x4c55f8='https://admin.searchability.dev/'){var _0x1a90ee=new Fetch(_0x4c55f8);this['Accounts']=new AccountService(_0x1a90ee),this['Lists']=new ListService(_0x1a90ee),this['ApiKeys']=new ApiKeyService(_0x1a90ee),this['SearchServices']=new SearchServersService(_0x1a90ee);}}class AuthClient{constructor(_0x30482d='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x30482d);}['login'](_0xe5da6){return __awaiter(this,void 0,void 0,function*(){const _0x173735='login/'+_0xe5da6;try{const _0x1ffad8=yield yield fetch(_0x173735);if(_0x1ffad8['status']>0xc7&&_0x1ffad8['status']<0x12c){const _0x1452cd=yield _0x1ffad8['json']();return new SuccessfulAuthResponse(_0x1452cd);}const _0x11e363=yield _0x1ffad8['json']();return new FailedAuthResponse(_0x11e363);}catch(_0x531394){if(_0x531394 instanceof Error)return new FailedAuthResponse({'detail':_0x531394['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x531394;}});}['refresh'](_0x2218b7){return __awaiter(this,void 0,void 0,function*(){const _0x423bb9='refresh',_0x85ab99={'refresh_token':_0x2218b7};try{const _0x31ea9b=yield this['fetch']['PostNoAuth'](_0x423bb9,_0x85ab99);if(_0x31ea9b['status']>0xc7&&_0x31ea9b['status']<0x12c){const _0x1d7a26=yield _0x31ea9b['json']();return new SuccessfulAuthResponse(_0x1d7a26);}const _0xb2cf1=yield _0x31ea9b['json']();return new FailedAuthResponse(_0xb2cf1);}catch(_0x455798){if(_0x455798 instanceof Error)return new FailedAuthResponse({'detail':_0x455798['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x455798;}});}['getTokenStatus'](_0x4c3631){if(Date['now']()<_0x4c3631['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x4c3631['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
14
14
|
|
|
15
15
|
export { AdminClient, AuthClient, TokenStatus, Tokens };
|
package/dist/types.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ declare class ListService {
|
|
|
29
29
|
constructor(fetch: Fetch);
|
|
30
30
|
add(account_name: string, list_name: string, search_service_name: string, access_token: string): Promise<Response<ListIdentity, Problem>>;
|
|
31
31
|
delete(accountName: string, listName: string, access_token: string): Promise<Response<any, Problem>>;
|
|
32
|
+
get(account_name: string, list_name: string, access_token: string): Promise<Response<List, Problem>>;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
declare class SearchServersService {
|
|
@@ -78,12 +79,12 @@ declare abstract class Response<S, F> {
|
|
|
78
79
|
abstract toProblem(): F;
|
|
79
80
|
}
|
|
80
81
|
type List = {
|
|
81
|
-
|
|
82
|
+
list_name: string;
|
|
82
83
|
created: number;
|
|
83
84
|
version: number;
|
|
84
85
|
};
|
|
85
86
|
type ListIdentity = {
|
|
86
|
-
|
|
87
|
+
list_name: string;
|
|
87
88
|
created: number;
|
|
88
89
|
account_name: string;
|
|
89
90
|
is_shared: boolean;
|
|
@@ -142,6 +143,12 @@ declare class SuccessfulListIdentityResponse extends Response<ListIdentity, Prob
|
|
|
142
143
|
toSuccess(): ListIdentity;
|
|
143
144
|
toProblem(): Problem;
|
|
144
145
|
}
|
|
146
|
+
declare class SuccessfulListResponse extends Response<List, Problem> {
|
|
147
|
+
readonly list: List;
|
|
148
|
+
constructor(list: List);
|
|
149
|
+
toSuccess(): List;
|
|
150
|
+
toProblem(): Problem;
|
|
151
|
+
}
|
|
145
152
|
declare class FailedAccountResponse extends Response<Account, Problem> {
|
|
146
153
|
readonly problem: Problem;
|
|
147
154
|
constructor(problem: Problem);
|
|
@@ -154,6 +161,12 @@ declare class FailedListIdentityResponse extends Response<ListIdentity, Problem>
|
|
|
154
161
|
toSuccess(): ListIdentity;
|
|
155
162
|
toProblem(): Problem;
|
|
156
163
|
}
|
|
164
|
+
declare class FailedListResponse extends Response<List, Problem> {
|
|
165
|
+
readonly problem: Problem;
|
|
166
|
+
constructor(problem: Problem);
|
|
167
|
+
toSuccess(): List;
|
|
168
|
+
toProblem(): Problem;
|
|
169
|
+
}
|
|
157
170
|
declare class SuccessfulAuthResponse extends Response<Tokens, Problem> {
|
|
158
171
|
readonly tokens: Tokens;
|
|
159
172
|
constructor(tokens: Tokens);
|
|
@@ -239,4 +252,4 @@ declare class FailedApiKeyValueResponse extends Response<ApiKeyValue, Problem> {
|
|
|
239
252
|
toProblem(): Problem;
|
|
240
253
|
}
|
|
241
254
|
|
|
242
|
-
export { type Account, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, FailedListIdentityResponse, FailedResponse, FailedSearchServiceResponse, FailedViewSearchServiceResponse, FailedViewSearchServicesResponse, type List, type ListIdentity, type Problem, type RefreshRequest, Response, type SearchService, type SearchServiceDetails, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, SuccessfulListIdentityResponse, SuccessfulListSearchServiceResponse, SuccessfulResponse, SuccessfulSearchServiceResponse, SuccessfulViewSearchServiceResponse, TokenStatus, Tokens };
|
|
255
|
+
export { type Account, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, FailedListIdentityResponse, FailedListResponse, FailedResponse, FailedSearchServiceResponse, FailedViewSearchServiceResponse, FailedViewSearchServicesResponse, type List, type ListIdentity, type Problem, type RefreshRequest, Response, type SearchService, type SearchServiceDetails, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, SuccessfulListIdentityResponse, SuccessfulListResponse, SuccessfulListSearchServiceResponse, SuccessfulResponse, SuccessfulSearchServiceResponse, SuccessfulViewSearchServiceResponse, TokenStatus, Tokens };
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var TokenStatus;(function(_0x3a3c61){_0x3a3c61[_0x3a3c61['Ok']=0x0]='Ok',_0x3a3c61[_0x3a3c61['Refresh']=0x1]='Refresh',_0x3a3c61[_0x3a3c61['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(_0x4cb7cc){this['isSuccess']=_0x4cb7cc;}}class SuccessfulAccountResponse extends Response{constructor(_0x15df36){super(!![]),this['account']=_0x15df36;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x168c68){super(!![]),this['list']=_0x168c68;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x372633){super(![]),this['problem']=_0x372633;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x52e1b8){super(![]),this['problem']=_0x52e1b8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x24dc79){super(!![]),this['tokens']=_0x24dc79;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x33eaf5){super(![]),this['problem']=_0x33eaf5;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x318ac0){super(!![]),this['apiKey']=_0x318ac0;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x28ccd7){super(![]),this['problem']=_0x28ccd7;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x9b657d){super(!![]),this['searchService']=_0x9b657d;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x3c9326){super(![]),this['problem']=_0x3c9326;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x1f59b2){super(!![]),this['searchService']=_0x1f59b2;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0x136616){super(!![]),this['searchServices']=_0x136616;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x4431bd){super(![]),this['problem']=_0x4431bd;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x1d5ba3){super(![]),this['problem']=_0x1d5ba3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x22d012){super(!![]),this['apiKeyValue']=_0x22d012;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x29fe10){super(!![]),this['obj']=_0x29fe10;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x123454){super(![]),this['problem']=_0x123454;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x18a617){super(![]),this['problem']=_0x18a617;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
|
-
|
|
3
|
-
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x41dc50,_0x1e6d53,_0x118ca2,_0x8091ff){function _0x12c9c8(_0x59a04){return _0x59a04 instanceof _0x118ca2?_0x59a04:new _0x118ca2(function(_0x539b90){_0x539b90(_0x59a04);});}return new(_0x118ca2||(_0x118ca2=Promise))(function(_0x5b1046,_0x3ccf53){function _0x477aae(_0x50ae3b){try{_0x45cf35(_0x8091ff['next'](_0x50ae3b));}catch(_0x2db49d){_0x3ccf53(_0x2db49d);}}function _0x2f98a9(_0x33420c){try{_0x45cf35(_0x8091ff['throw'](_0x33420c));}catch(_0x27423f){_0x3ccf53(_0x27423f);}}function _0x45cf35(_0x3f43a3){_0x3f43a3['done']?_0x5b1046(_0x3f43a3['value']):_0x12c9c8(_0x3f43a3['value'])['then'](_0x477aae,_0x2f98a9);}_0x45cf35((_0x8091ff=_0x8091ff['apply'](_0x41dc50,_0x1e6d53||[]))['next']());});};class AccountService{constructor(_0x490fff){this['fetch']=_0x490fff;}['get'](_0x33d833,_0xa1708c){return __awaiter$5(this,void 0,void 0,function*(){const _0x5b7ed8='Account/'+_0x33d833+'/',_0x179676=yield this['fetch']['get'](_0x5b7ed8,_0xa1708c);try{if(_0x179676['status']>0xc7&&_0x179676['status']<0x12c){const _0x52b299=yield _0x179676['json']();return new SuccessfulAccountResponse(_0x52b299);}const _0x1cbd50=yield _0x179676['json']();return new FailedAccountResponse(_0x1cbd50);}catch(_0x1bfd2b){if(_0x1bfd2b instanceof Error)return new FailedAccountResponse({'detail':_0x1bfd2b['message'],'title':_0x1bfd2b['name'],'status':0x1f4,'instance':'','type':''});throw _0x1bfd2b;}});}}
|
|
4
|
-
|
|
5
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4240c9,_0x4e13e1,_0xde722a,_0x4ba40c){function _0x11e859(_0x47b648){return _0x47b648 instanceof _0xde722a?_0x47b648:new _0xde722a(function(_0x2fb42a){_0x2fb42a(_0x47b648);});}return new(_0xde722a||(_0xde722a=Promise))(function(_0x6d089a,_0x59fac0){function _0x16c82f(_0x4d2581){try{_0xcf71f(_0x4ba40c['next'](_0x4d2581));}catch(_0x8490ac){_0x59fac0(_0x8490ac);}}function _0x4fb2cb(_0x4a8eed){try{_0xcf71f(_0x4ba40c['throw'](_0x4a8eed));}catch(_0x72fa0d){_0x59fac0(_0x72fa0d);}}function _0xcf71f(_0x3fcc58){_0x3fcc58['done']?_0x6d089a(_0x3fcc58['value']):_0x11e859(_0x3fcc58['value'])['then'](_0x16c82f,_0x4fb2cb);}_0xcf71f((_0x4ba40c=_0x4ba40c['apply'](_0x4240c9,_0x4e13e1||[]))['next']());});};class ApiKeyService{constructor(_0x15857f){this['fetch']=_0x15857f,this['path']='api-key';}['create'](_0x43d1f7,_0x371d1d,_0x2a10c8){return __awaiter$4(this,void 0,void 0,function*(){const _0xa045da={'account_name':_0x43d1f7,'api_key_name':_0x371d1d};try{const _0x25b02a=yield this['fetch']['post'](this['path'],_0x2a10c8,_0xa045da);if(_0x25b02a['status']>0xc7&&_0x25b02a['status']<0x12c){const _0x519910=yield _0x25b02a['json']();return new SuccessfulApiKeyResponse(_0x519910);}const _0x52eaa3=yield _0x25b02a['json']();return new FailedApiKeyResponse(_0x52eaa3);}catch(_0x551823){if(_0x551823 instanceof Error)return new FailedApiKeyResponse({'detail':_0x551823['message'],'title':_0x551823['name'],'status':0x1f4,'instance':'','type':''});throw _0x551823;}});}['view'](_0x1bfecd,_0x3fbc98,_0x1ef69b){return __awaiter$4(this,void 0,void 0,function*(){const _0x29c5cc=this['path']+'/'+_0x1bfecd+'/'+_0x3fbc98;try{const _0xb24d1b=yield this['fetch']['get'](_0x29c5cc,_0x1ef69b);if(_0xb24d1b['status']>0xc7&&_0xb24d1b['status']<0x12c){const _0x1bd15a=yield _0xb24d1b['json']();return new SuccessfulApiKeyValueResponse(_0x1bd15a);}const _0x599031=yield _0xb24d1b['json']();return new FailedApiKeyValueResponse(_0x599031);}catch(_0x1e9aa0){if(_0x1e9aa0 instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x1e9aa0['message'],'title':_0x1e9aa0['name'],'status':0x1f4,'instance':'','type':''});throw _0x1e9aa0;}});}['delete'](_0x39dac5,_0x5aa382,_0x53aae2){return __awaiter$4(this,void 0,void 0,function*(){const _0x211648=this['path']+'/'+_0x39dac5+'/'+_0x5aa382;try{const _0x1fbf1c=yield this['fetch']['delete'](_0x211648,_0x53aae2);if(_0x1fbf1c['status']>0xc7&&_0x1fbf1c['status']<0x12c)return new SuccessfulResponse({});const _0x10e2be=yield _0x1fbf1c['json']();return new FailedResponse(_0x10e2be);}catch(_0x3de8b8){if(_0x3de8b8 instanceof Error)return new FailedResponse({'detail':_0x3de8b8['message'],'title':_0x3de8b8['name'],'status':0x1f4,'instance':'','type':''});throw _0x3de8b8;}});}}
|
|
6
|
-
|
|
7
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x43a57b,_0x520d4e,_0x83fa6,_0xfd87ff){function _0x19ab47(_0x381508){return _0x381508 instanceof _0x83fa6?_0x381508:new _0x83fa6(function(_0x480a05){_0x480a05(_0x381508);});}return new(_0x83fa6||(_0x83fa6=Promise))(function(_0x196e9f,_0x558811){function _0x1d8e2d(_0x2bbac3){try{_0x786d43(_0xfd87ff['next'](_0x2bbac3));}catch(_0x4d2bd4){_0x558811(_0x4d2bd4);}}function _0x12c2a9(_0x2cf742){try{_0x786d43(_0xfd87ff['throw'](_0x2cf742));}catch(_0x14080d){_0x558811(_0x14080d);}}function _0x786d43(_0x4c5a75){_0x4c5a75['done']?_0x196e9f(_0x4c5a75['value']):_0x19ab47(_0x4c5a75['value'])['then'](_0x1d8e2d,_0x12c2a9);}_0x786d43((_0xfd87ff=_0xfd87ff['apply'](_0x43a57b,_0x520d4e||[]))['next']());});};class ListService{constructor(_0x96eac8){this['fetch']=_0x96eac8;}['add'](_0x519675,_0x2fc79a,_0x47fb4a,_0x2b49ae){return __awaiter$3(this,void 0,void 0,function*(){const _0x16299f='List',_0x134376={'account_name':_0x519675,'list_name':_0x2fc79a,'search_service_name':_0x47fb4a};try{const _0x445d59=yield this['fetch']['post'](_0x16299f,_0x2b49ae,_0x134376);if(_0x445d59['status']>0xc7&&_0x445d59['status']<0x12c){const _0x40a7c1=yield _0x445d59['json']();return new SuccessfulListIdentityResponse(_0x40a7c1);}const _0x5a7b90=yield _0x445d59['json']();return new FailedListIdentityResponse(_0x5a7b90);}catch(_0x18f069){if(_0x18f069 instanceof Error)return new FailedListIdentityResponse({'detail':_0x18f069['message'],'title':_0x18f069['name'],'status':0x1f4,'instance':'','type':''});throw _0x18f069;}});}['delete'](_0x474951,_0x5ac25f,_0x5053a7){return __awaiter$3(this,void 0,void 0,function*(){const _0x30a91b='List/'+_0x474951+'/'+_0x5ac25f,_0x4b84ff=yield this['fetch']['delete'](_0x30a91b,_0x5053a7);try{if(_0x4b84ff['status']>0xc7&&_0x4b84ff['status']<0x12c)return new SuccessfulResponse({});const _0x125a5f=yield _0x4b84ff['json']();return new FailedResponse(_0x125a5f);}catch(_0x278716){if(_0x278716 instanceof Error)return new FailedResponse({'detail':_0x278716['message'],'title':_0x278716['name'],'status':0x1f4,'instance':'','type':''});throw _0x278716;}});}}
|
|
8
|
-
|
|
9
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x5c14c5,_0x56b357,_0x4ba30,_0x34c639){function _0x432e2f(_0x189097){return _0x189097 instanceof _0x4ba30?_0x189097:new _0x4ba30(function(_0x3837e7){_0x3837e7(_0x189097);});}return new(_0x4ba30||(_0x4ba30=Promise))(function(_0x25f663,_0x6e28ac){function _0x2358b2(_0x523571){try{_0x9ec049(_0x34c639['next'](_0x523571));}catch(_0x2ec678){_0x6e28ac(_0x2ec678);}}function _0x59e990(_0x5ae4f7){try{_0x9ec049(_0x34c639['throw'](_0x5ae4f7));}catch(_0x2f7d73){_0x6e28ac(_0x2f7d73);}}function _0x9ec049(_0x3353a7){_0x3353a7['done']?_0x25f663(_0x3353a7['value']):_0x432e2f(_0x3353a7['value'])['then'](_0x2358b2,_0x59e990);}_0x9ec049((_0x34c639=_0x34c639['apply'](_0x5c14c5,_0x56b357||[]))['next']());});};class Fetch{constructor(_0x37ea83){this['baseUri']=_0x37ea83,this['getUrl']=_0x44b482=>{return _0x44b482['startsWith']('/')&&(_0x44b482=_0x44b482['replace']('/','')),''+this['baseUri']+_0x44b482;},!_0x37ea83['endsWith']('/')&&(_0x37ea83=_0x37ea83+'/');}['get'](_0x2eeb26,_0x1d76f7){return __awaiter$2(this,void 0,void 0,function*(){const _0x7bfd15=this['getUrl'](_0x2eeb26);return yield fetch(_0x7bfd15,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1d76f7}});});}['post'](_0xbe425a,_0x133004,_0xe1540b){return __awaiter$2(this,void 0,void 0,function*(){const _0x251414=this['getUrl'](_0xbe425a);return yield fetch(_0x251414,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x133004},'body':_0xe1540b?JSON['stringify'](_0xe1540b):null});});}['PostNoAuth'](_0x4491be,_0x40d9d9){return __awaiter$2(this,void 0,void 0,function*(){const _0xfe7b61=this['getUrl'](_0x4491be);return yield fetch(_0xfe7b61,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x40d9d9?JSON['stringify'](_0x40d9d9):null});});}['put'](_0x49b431,_0x53a195,_0x4dccfd){return __awaiter$2(this,void 0,void 0,function*(){const _0x192d05=this['getUrl'](_0x49b431);return yield fetch(_0x192d05,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x53a195},'body':_0x4dccfd?JSON['stringify'](_0x4dccfd):null});});}['delete'](_0x4b1810,_0xe124c7){return __awaiter$2(this,void 0,void 0,function*(){const _0x2537c1=this['getUrl'](_0x4b1810);return yield fetch(_0x2537c1,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xe124c7}});});}}
|
|
10
|
-
|
|
11
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x514e0c,_0x40fc3b,_0x207a93,_0x4b418f){function _0x4d6d76(_0x5b3e50){return _0x5b3e50 instanceof _0x207a93?_0x5b3e50:new _0x207a93(function(_0x296dd){_0x296dd(_0x5b3e50);});}return new(_0x207a93||(_0x207a93=Promise))(function(_0x1f817e,_0x314765){function _0x275fd3(_0x5b9cd7){try{_0x5c30a9(_0x4b418f['next'](_0x5b9cd7));}catch(_0x4a28e1){_0x314765(_0x4a28e1);}}function _0x444d6d(_0x5a3a3c){try{_0x5c30a9(_0x4b418f['throw'](_0x5a3a3c));}catch(_0x366eb5){_0x314765(_0x366eb5);}}function _0x5c30a9(_0x3f2a68){_0x3f2a68['done']?_0x1f817e(_0x3f2a68['value']):_0x4d6d76(_0x3f2a68['value'])['then'](_0x275fd3,_0x444d6d);}_0x5c30a9((_0x4b418f=_0x4b418f['apply'](_0x514e0c,_0x40fc3b||[]))['next']());});};class SearchServersService{constructor(_0x4a1d53){this['fetch']=_0x4a1d53,this['path']='search-services';}['create'](_0x4f15d3,_0x35f9e1,_0x1de1b7,_0x3acc75,_0x434b32,_0x527565,_0x1d899f,_0x53fc04){return __awaiter$1(this,void 0,void 0,function*(){const _0x405272={'account_name':_0x4f15d3,'search_service_name':_0x35f9e1,'endpoint':_0x1de1b7,'key':_0x3acc75,'country':_0x434b32,'provider':_0x527565,'index_name':_0x1d899f};try{const _0x15fe8d=yield this['fetch']['post'](this['path'],_0x53fc04,_0x405272);if(_0x15fe8d['status']>0xc7&&_0x15fe8d['status']<0x12c){const _0x3bea15=yield _0x15fe8d['json']();return new SuccessfulSearchServiceResponse(_0x3bea15);}const _0x2171b4=yield _0x15fe8d['json']();return new FailedSearchServiceResponse(_0x2171b4);}catch(_0x566ab9){if(_0x566ab9 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x566ab9['message'],'title':_0x566ab9['name'],'status':0x1f4,'instance':'','type':''});throw _0x566ab9;}});}['delete'](_0x3ebcf9,_0x5eb38d,_0x474b7d){return __awaiter$1(this,void 0,void 0,function*(){const _0x472cac=this['path']+'/'+_0x3ebcf9+'/'+_0x5eb38d;try{const _0xfd3f60=yield this['fetch']['delete'](_0x472cac,_0x474b7d);if(_0xfd3f60['status']>0xc7&&_0xfd3f60['status']<0x12c)return new SuccessfulResponse({});const _0x4fe1f7=yield _0xfd3f60['json']();return new FailedResponse(_0x4fe1f7);}catch(_0x39ce74){if(_0x39ce74 instanceof Error)return new FailedResponse({'detail':_0x39ce74['message'],'title':_0x39ce74['name'],'status':0x1f4,'instance':'','type':''});throw _0x39ce74;}});}['view'](_0x114635,_0x8983c7,_0x4c181f){return __awaiter$1(this,void 0,void 0,function*(){const _0x51e215=this['path']+'/'+_0x114635+'/'+_0x8983c7;try{const _0x4fc798=yield this['fetch']['get'](_0x51e215,_0x4c181f);if(_0x4fc798['status']>0xc7&&_0x4fc798['status']<0x12c){const _0x192f89=yield _0x4fc798['json']();return new SuccessfulViewSearchServiceResponse(_0x192f89);}const _0x32170c=yield _0x4fc798['json']();return new FailedViewSearchServiceResponse(_0x32170c);}catch(_0x45a2a1){if(_0x45a2a1 instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x45a2a1['message'],'title':_0x45a2a1['name'],'status':0x1f4,'instance':'','type':''});throw _0x45a2a1;}});}['edit'](_0x3da1ed,_0x18d41c,_0xfd5b99,_0xa26064,_0x3ddbc3,_0x51e7c7){return __awaiter$1(this,void 0,void 0,function*(){const _0x43648e={'account_name':_0x3da1ed,'search_service_name':_0x18d41c,'new_search_service_name':_0xfd5b99,'key':_0xa26064,'country':_0x3ddbc3};try{const _0x31db25=yield this['fetch']['put'](this['path'],_0x51e7c7,_0x43648e);if(_0x31db25['status']>0xc7&&_0x31db25['status']<0x12c){const _0x3c3361=yield _0x31db25['json']();return new SuccessfulSearchServiceResponse(_0x3c3361);}const _0x50f005=yield _0x31db25['json']();return new FailedSearchServiceResponse(_0x50f005);}catch(_0x2a73d8){if(_0x2a73d8 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x2a73d8['message'],'title':_0x2a73d8['name'],'status':0x1f4,'instance':'','type':''});throw _0x2a73d8;}});}['list'](_0x3bfbc6,_0x2486d8){return __awaiter$1(this,void 0,void 0,function*(){const _0x349c65=this['path']+'/'+_0x3bfbc6;try{const _0x16a15a=yield this['fetch']['get'](_0x349c65,_0x2486d8);if(_0x16a15a['status']>0xc7&&_0x16a15a['status']<0x12c){const _0x107996=yield _0x16a15a['json']();return new SuccessfulListSearchServiceResponse(_0x107996);}const _0x316ec8=yield _0x16a15a['json']();return new FailedViewSearchServicesResponse(_0x316ec8);}catch(_0x373e9a){if(_0x373e9a instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x373e9a['message'],'title':_0x373e9a['name'],'status':0x1f4,'instance':'','type':''});throw _0x373e9a;}});}}
|
|
12
|
-
|
|
13
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x36bb2c,_0x5ed8f2,_0x112abe,_0x3a9465){function _0x5c1100(_0x196e79){return _0x196e79 instanceof _0x112abe?_0x196e79:new _0x112abe(function(_0x4e1494){_0x4e1494(_0x196e79);});}return new(_0x112abe||(_0x112abe=Promise))(function(_0x356577,_0x39303e){function _0x59a786(_0x3e4460){try{_0x294a86(_0x3a9465['next'](_0x3e4460));}catch(_0x5b80b3){_0x39303e(_0x5b80b3);}}function _0x1fea99(_0x276827){try{_0x294a86(_0x3a9465['throw'](_0x276827));}catch(_0x43bc0c){_0x39303e(_0x43bc0c);}}function _0x294a86(_0xed0f4f){_0xed0f4f['done']?_0x356577(_0xed0f4f['value']):_0x5c1100(_0xed0f4f['value'])['then'](_0x59a786,_0x1fea99);}_0x294a86((_0x3a9465=_0x3a9465['apply'](_0x36bb2c,_0x5ed8f2||[]))['next']());});};class AdminClient{constructor(_0x204981='https://admin.searchability.dev/'){var _0x7b9b5a=new Fetch(_0x204981);this['Accounts']=new AccountService(_0x7b9b5a),this['Lists']=new ListService(_0x7b9b5a),this['ApiKeys']=new ApiKeyService(_0x7b9b5a),this['SearchServices']=new SearchServersService(_0x7b9b5a);}}class AuthClient{constructor(_0x80cec1='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x80cec1);}['login'](_0x5d9742){return __awaiter(this,void 0,void 0,function*(){const _0x2d37b3='login/'+_0x5d9742;try{const _0x563d31=yield yield fetch(_0x2d37b3);if(_0x563d31['status']>0xc7&&_0x563d31['status']<0x12c){const _0x16eb94=yield _0x563d31['json']();return new SuccessfulAuthResponse(_0x16eb94);}const _0x1eb7e4=yield _0x563d31['json']();return new FailedAuthResponse(_0x1eb7e4);}catch(_0x462de1){if(_0x462de1 instanceof Error)return new FailedAuthResponse({'detail':_0x462de1['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x462de1;}});}['refresh'](_0xb2d835){return __awaiter(this,void 0,void 0,function*(){const _0x116a02='refresh',_0x3dcd62={'refresh_token':_0xb2d835};try{const _0x47f712=yield this['fetch']['PostNoAuth'](_0x116a02,_0x3dcd62);if(_0x47f712['status']>0xc7&&_0x47f712['status']<0x12c){const _0x5b1025=yield _0x47f712['json']();return new SuccessfulAuthResponse(_0x5b1025);}const _0x142419=yield _0x47f712['json']();return new FailedAuthResponse(_0x142419);}catch(_0x3f095e){if(_0x3f095e instanceof Error)return new FailedAuthResponse({'detail':_0x3f095e['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3f095e;}});}['getTokenStatus'](_0xa17523){if(Date['now']()<_0xa17523['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0xa17523['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
14
|
-
|
|
15
|
-
export { AdminClient, AuthClient, TokenStatus, Tokens };
|