@searchability/admin-client 0.0.66 → 0.0.67
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,21 @@
|
|
|
1
|
+
var TokenStatus;(function(_0x3f5b8c){_0x3f5b8c[_0x3f5b8c['Ok']=0x0]='Ok',_0x3f5b8c[_0x3f5b8c['Refresh']=0x1]='Refresh',_0x3f5b8c[_0x3f5b8c['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(_0x2c1f0f){this['isSuccess']=_0x2c1f0f;}}class SuccessfulContributorResponse extends Response{constructor(_0x165fd4){super(!![]),this['contributor']=_0x165fd4;}['toSuccess'](){return this['contributor'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedContributorResponse extends Response{constructor(_0x50fcab){super(![]),this['problem']=_0x50fcab;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAccountAndImageResponse extends Response{constructor(_0x494950){super(!![]),this['accountAndImage']=_0x494950;}['toSuccess'](){return this['accountAndImage'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountAndImageResponse extends Response{constructor(_0x33aea8){super(![]),this['problem']=_0x33aea8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulFacetResponse extends Response{constructor(_0xf5faf8){super(!![]),this['facet']=_0xf5faf8;}['toSuccess'](){return this['facet'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedFacetResponse extends Response{constructor(_0xc987d1){super(![]),this['problem']=_0xc987d1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAccountResponse extends Response{constructor(_0x451bc8){super(!![]),this['account']=_0x451bc8;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulAccountImageResponse extends Response{constructor(_0x59f339){super(!![]),this['accountImage']=_0x59f339;}['toSuccess'](){return this['accountImage'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x170000){super(!![]),this['list']=_0x170000;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListResponse extends Response{constructor(_0x31d7f9){super(!![]),this['list']=_0x31d7f9;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1e112d){super(![]),this['problem']=_0x1e112d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedAccountImageResponse extends Response{constructor(_0x1a66b6){super(![]),this['problem']=_0x1a66b6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x503841){super(![]),this['problem']=_0x503841;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListResponse extends Response{constructor(_0x554d53){super(![]),this['problem']=_0x554d53;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x243e2b){super(!![]),this['tokens']=_0x243e2b;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x2f9209){super(![]),this['problem']=_0x2f9209;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x59ed7a){super(!![]),this['apiKey']=_0x59ed7a;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x5a08b5){super(![]),this['problem']=_0x5a08b5;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x147e32){super(!![]),this['searchService']=_0x147e32;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x4338a8){super(![]),this['problem']=_0x4338a8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x47d299){super(!![]),this['searchService']=_0x47d299;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulViewSearchResultResponse extends Response{constructor(_0xe75036){super(!![]),this['searchResult']=_0xe75036;}['toSuccess'](){return this['searchResult'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchResultResponse extends Response{constructor(_0x2d912f){super(![]),this['problem']=_0x2d912f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0x5b7c35){super(!![]),this['searchServices']=_0x5b7c35;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x51940c){super(![]),this['problem']=_0x51940c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x5da491){super(![]),this['problem']=_0x5da491;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x3f4e28){super(!![]),this['apiKeyValue']=_0x3f4e28;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x517625){super(!![]),this['obj']=_0x517625;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x35d5cf){super(![]),this['problem']=_0x35d5cf;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x2a7fcf){super(![]),this['problem']=_0x2a7fcf;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
|
+
|
|
3
|
+
var __awaiter$8=undefined&&undefined['__awaiter']||function(_0x9b4826,_0x24700c,_0x27af9d,_0x3a9675){function _0x553753(_0x2fc315){return _0x2fc315 instanceof _0x27af9d?_0x2fc315:new _0x27af9d(function(_0x59f072){_0x59f072(_0x2fc315);});}return new(_0x27af9d||(_0x27af9d=Promise))(function(_0x5c1ca9,_0x5f2492){function _0x251c12(_0x53c798){try{_0x4f1cf3(_0x3a9675['next'](_0x53c798));}catch(_0x2e0c8e){_0x5f2492(_0x2e0c8e);}}function _0x4fd3ca(_0x1e64d1){try{_0x4f1cf3(_0x3a9675['throw'](_0x1e64d1));}catch(_0x232d6c){_0x5f2492(_0x232d6c);}}function _0x4f1cf3(_0x5c1843){_0x5c1843['done']?_0x5c1ca9(_0x5c1843['value']):_0x553753(_0x5c1843['value'])['then'](_0x251c12,_0x4fd3ca);}_0x4f1cf3((_0x3a9675=_0x3a9675['apply'](_0x9b4826,_0x24700c||[]))['next']());});};class AccountService{constructor(_0xbfd35c){this['fetch']=_0xbfd35c;}['get'](_0x7fdec3,_0xe391af){return __awaiter$8(this,void 0,void 0,function*(){const _0x366b5d='Account/'+_0x7fdec3+'/',_0x585c3d=yield this['fetch']['get'](_0x366b5d,_0xe391af);try{if(_0x585c3d['status']>0xc7&&_0x585c3d['status']<0x12c){const _0x561817=yield _0x585c3d['json']();return new SuccessfulAccountResponse(_0x561817);}const _0x4a3ca4=yield _0x585c3d['json']();return new FailedAccountResponse(_0x4a3ca4);}catch(_0x415296){if(_0x415296 instanceof Error)return new FailedAccountResponse({'detail':_0x415296['message'],'title':_0x415296['name'],'status':0x1f4,'instance':'','type':''});throw _0x415296;}});}['getImage'](_0x4a37c9,_0x58c337){return __awaiter$8(this,void 0,void 0,function*(){const _0x2525d6='account/image/'+_0x4a37c9+'/',_0x57c77d=yield this['fetch']['get'](_0x2525d6,_0x58c337);try{if(_0x57c77d['status']>0xc7&&_0x57c77d['status']<0x12c){const _0x116a93=yield _0x57c77d['json']();return new SuccessfulAccountImageResponse(_0x116a93);}const _0x555402=yield _0x57c77d['json']();return new FailedAccountImageResponse(_0x555402);}catch(_0x4f9227){if(_0x4f9227 instanceof Error)return new FailedAccountImageResponse({'detail':_0x4f9227['message'],'title':_0x4f9227['name'],'status':0x1f4,'instance':'','type':''});throw _0x4f9227;}});}}
|
|
4
|
+
|
|
5
|
+
var __awaiter$7=undefined&&undefined['__awaiter']||function(_0x83dbeb,_0x5ae552,_0x2c2518,_0x5dce51){function _0x4991db(_0x3f4a23){return _0x3f4a23 instanceof _0x2c2518?_0x3f4a23:new _0x2c2518(function(_0xb38040){_0xb38040(_0x3f4a23);});}return new(_0x2c2518||(_0x2c2518=Promise))(function(_0x3177ef,_0x1142f4){function _0x495269(_0x48b246){try{_0x5aad52(_0x5dce51['next'](_0x48b246));}catch(_0x1cf3da){_0x1142f4(_0x1cf3da);}}function _0x2e77ea(_0x5cc1a4){try{_0x5aad52(_0x5dce51['throw'](_0x5cc1a4));}catch(_0x3b42a0){_0x1142f4(_0x3b42a0);}}function _0x5aad52(_0x169db7){_0x169db7['done']?_0x3177ef(_0x169db7['value']):_0x4991db(_0x169db7['value'])['then'](_0x495269,_0x2e77ea);}_0x5aad52((_0x5dce51=_0x5dce51['apply'](_0x83dbeb,_0x5ae552||[]))['next']());});};class ApiKeyService{constructor(_0x4c1843){this['fetch']=_0x4c1843,this['path']='api-key';}['create'](_0x21c683,_0x254111,_0x570152){return __awaiter$7(this,void 0,void 0,function*(){const _0x31ef06={'account_name':_0x21c683,'api_key_name':_0x254111};try{const _0x5f45e9=yield this['fetch']['post'](this['path'],_0x570152,_0x31ef06);if(_0x5f45e9['status']>0xc7&&_0x5f45e9['status']<0x12c){const _0x4e2684=yield _0x5f45e9['json']();return new SuccessfulApiKeyResponse(_0x4e2684);}const _0x2e8bf9=yield _0x5f45e9['json']();return new FailedApiKeyResponse(_0x2e8bf9);}catch(_0x29a51c){if(_0x29a51c instanceof Error)return new FailedApiKeyResponse({'detail':_0x29a51c['message'],'title':_0x29a51c['name'],'status':0x1f4,'instance':'','type':''});throw _0x29a51c;}});}['view'](_0x2fceed,_0x48b05c,_0x52381e){return __awaiter$7(this,void 0,void 0,function*(){const _0x5cbc83=this['path']+'/'+_0x2fceed+'/'+_0x48b05c;try{const _0x1fe864=yield this['fetch']['get'](_0x5cbc83,_0x52381e);if(_0x1fe864['status']>0xc7&&_0x1fe864['status']<0x12c){const _0x2682e3=yield _0x1fe864['json']();return new SuccessfulApiKeyValueResponse(_0x2682e3);}const _0x50a1d8=yield _0x1fe864['json']();return new FailedApiKeyValueResponse(_0x50a1d8);}catch(_0x1b202a){if(_0x1b202a instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x1b202a['message'],'title':_0x1b202a['name'],'status':0x1f4,'instance':'','type':''});throw _0x1b202a;}});}['delete'](_0x1ef344,_0x25dea8,_0x4eed21){return __awaiter$7(this,void 0,void 0,function*(){const _0x18c1b3=this['path']+'/'+_0x1ef344+'/'+_0x25dea8;try{const _0x1ea1d7=yield this['fetch']['delete'](_0x18c1b3,_0x4eed21);if(_0x1ea1d7['status']>0xc7&&_0x1ea1d7['status']<0x12c)return new SuccessfulResponse({});const _0x420ed7=yield _0x1ea1d7['json']();return new FailedResponse(_0x420ed7);}catch(_0x492761){if(_0x492761 instanceof Error)return new FailedResponse({'detail':_0x492761['message'],'title':_0x492761['name'],'status':0x1f4,'instance':'','type':''});throw _0x492761;}});}}
|
|
6
|
+
|
|
7
|
+
var __awaiter$6=undefined&&undefined['__awaiter']||function(_0x4219d6,_0x3aa566,_0x50d1fe,_0x41f21b){function _0x3e2d8d(_0x825d01){return _0x825d01 instanceof _0x50d1fe?_0x825d01:new _0x50d1fe(function(_0x4f6085){_0x4f6085(_0x825d01);});}return new(_0x50d1fe||(_0x50d1fe=Promise))(function(_0x198080,_0x451ff2){function _0xa55f5a(_0xa10458){try{_0x44d372(_0x41f21b['next'](_0xa10458));}catch(_0x5ba15c){_0x451ff2(_0x5ba15c);}}function _0x48c028(_0x51cd72){try{_0x44d372(_0x41f21b['throw'](_0x51cd72));}catch(_0x3d393c){_0x451ff2(_0x3d393c);}}function _0x44d372(_0x3b6b09){_0x3b6b09['done']?_0x198080(_0x3b6b09['value']):_0x3e2d8d(_0x3b6b09['value'])['then'](_0xa55f5a,_0x48c028);}_0x44d372((_0x41f21b=_0x41f21b['apply'](_0x4219d6,_0x3aa566||[]))['next']());});};class ListService{constructor(_0x2af2d6){this['fetch']=_0x2af2d6;}['create'](_0x2e43e4,_0x3a29c8,_0xf5cfb7,_0x1ab357){return __awaiter$6(this,void 0,void 0,function*(){const _0x30c39c='List',_0x3d7f54={'account_name':_0x2e43e4,'list_name':_0x3a29c8,'search_service_name':_0xf5cfb7};try{const _0x1f782e=yield this['fetch']['post'](_0x30c39c,_0x1ab357,_0x3d7f54);if(_0x1f782e['status']>0xc7&&_0x1f782e['status']<0x12c){const _0x4af020=yield _0x1f782e['json']();return new SuccessfulListIdentityResponse(_0x4af020);}const _0x363684=yield _0x1f782e['json']();return new FailedListIdentityResponse(_0x363684);}catch(_0x2fb821){if(_0x2fb821 instanceof Error)return new FailedListIdentityResponse({'detail':_0x2fb821['message'],'title':_0x2fb821['name'],'status':0x1f4,'instance':'','type':''});throw _0x2fb821;}});}['delete'](_0x5b51dd,_0x425b63,_0x3befe4){return __awaiter$6(this,void 0,void 0,function*(){const _0x3d5b32='List/'+_0x5b51dd+'/'+_0x425b63,_0x5429b1=yield this['fetch']['delete'](_0x3d5b32,_0x3befe4);try{if(_0x5429b1['status']>0xc7&&_0x5429b1['status']<0x12c)return new SuccessfulResponse({});const _0x2e782c=yield _0x5429b1['json']();return new FailedResponse(_0x2e782c);}catch(_0x3b70a9){if(_0x3b70a9 instanceof Error)return new FailedResponse({'detail':_0x3b70a9['message'],'title':_0x3b70a9['name'],'status':0x1f4,'instance':'','type':''});throw _0x3b70a9;}});}['get'](_0x470f7d,_0x4c48e3,_0x109fc0){return __awaiter$6(this,void 0,void 0,function*(){const _0x53bde6='List/'+_0x470f7d+'/'+_0x4c48e3;try{const _0x4d21ff=yield this['fetch']['get'](_0x53bde6,_0x109fc0);if(_0x4d21ff['status']>0xc7&&_0x4d21ff['status']<0x12c){const _0x212b71=yield _0x4d21ff['json']();return new SuccessfulListResponse(_0x212b71);}const _0x2a795b=yield _0x4d21ff['json']();return new FailedListResponse(_0x2a795b);}catch(_0x5ef497){if(_0x5ef497 instanceof Error)return new FailedListResponse({'detail':_0x5ef497['message'],'title':_0x5ef497['name'],'status':0x1f4,'instance':'','type':''});throw _0x5ef497;}});}}
|
|
8
|
+
|
|
9
|
+
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x5a0c66,_0x32b88d,_0x242425,_0x339776){function _0x4c8b19(_0x360cb6){return _0x360cb6 instanceof _0x242425?_0x360cb6:new _0x242425(function(_0x3fe5e5){_0x3fe5e5(_0x360cb6);});}return new(_0x242425||(_0x242425=Promise))(function(_0xe018b8,_0x4e4e7a){function _0x142d2b(_0xe6ee14){try{_0x359129(_0x339776['next'](_0xe6ee14));}catch(_0x183b2f){_0x4e4e7a(_0x183b2f);}}function _0x5596da(_0xf02bd6){try{_0x359129(_0x339776['throw'](_0xf02bd6));}catch(_0x4301c7){_0x4e4e7a(_0x4301c7);}}function _0x359129(_0x4d2f25){_0x4d2f25['done']?_0xe018b8(_0x4d2f25['value']):_0x4c8b19(_0x4d2f25['value'])['then'](_0x142d2b,_0x5596da);}_0x359129((_0x339776=_0x339776['apply'](_0x5a0c66,_0x32b88d||[]))['next']());});};class Fetch{constructor(_0x2b10f1){this['baseUri']=_0x2b10f1,this['getUrl']=_0x3b2658=>{return _0x3b2658['startsWith']('/')&&(_0x3b2658=_0x3b2658['replace']('/','')),''+this['baseUri']+_0x3b2658;},!_0x2b10f1['endsWith']('/')&&(_0x2b10f1=_0x2b10f1+'/');}['get'](_0x217114,_0x1b2b7d){return __awaiter$5(this,void 0,void 0,function*(){const _0x1b8dd1=this['getUrl'](_0x217114);return yield fetch(_0x1b8dd1,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1b2b7d}});});}['post'](_0x39832d,_0x54725d,_0x499a4f){return __awaiter$5(this,void 0,void 0,function*(){const _0x39e4ca=this['getUrl'](_0x39832d);return yield fetch(_0x39e4ca,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x54725d},'body':_0x499a4f?JSON['stringify'](_0x499a4f):null});});}['PostNoAuth'](_0x539f63,_0x7c09c1){return __awaiter$5(this,void 0,void 0,function*(){const _0x19373a=this['getUrl'](_0x539f63);return yield fetch(_0x19373a,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x7c09c1?JSON['stringify'](_0x7c09c1):null});});}['put'](_0x1af7e9,_0x25a92e,_0x14eca3){return __awaiter$5(this,void 0,void 0,function*(){const _0x455ec1=this['getUrl'](_0x1af7e9);return yield fetch(_0x455ec1,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x25a92e},'body':_0x14eca3?JSON['stringify'](_0x14eca3):null});});}['delete'](_0xbbd18c,_0x10761b){return __awaiter$5(this,void 0,void 0,function*(){const _0x340ae9=this['getUrl'](_0xbbd18c);return yield fetch(_0x340ae9,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x10761b}});});}}
|
|
10
|
+
|
|
11
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x2be2b9,_0x3adb94,_0x324ca5,_0xddff22){function _0x2fffd5(_0x1a76a6){return _0x1a76a6 instanceof _0x324ca5?_0x1a76a6:new _0x324ca5(function(_0xa6e860){_0xa6e860(_0x1a76a6);});}return new(_0x324ca5||(_0x324ca5=Promise))(function(_0x310e43,_0x3c211a){function _0x49bee8(_0x24e9fe){try{_0x19ae57(_0xddff22['next'](_0x24e9fe));}catch(_0x3964d6){_0x3c211a(_0x3964d6);}}function _0x21484c(_0x3f60e8){try{_0x19ae57(_0xddff22['throw'](_0x3f60e8));}catch(_0x51eb53){_0x3c211a(_0x51eb53);}}function _0x19ae57(_0x332229){_0x332229['done']?_0x310e43(_0x332229['value']):_0x2fffd5(_0x332229['value'])['then'](_0x49bee8,_0x21484c);}_0x19ae57((_0xddff22=_0xddff22['apply'](_0x2be2b9,_0x3adb94||[]))['next']());});};class SearchServersService{constructor(_0x55135f){this['fetch']=_0x55135f,this['path']='search-services';}['create'](_0x2427e1,_0x3c3b58,_0x30267a,_0x3e6edf,_0x2c9808,_0x49279a,_0x4c4770,_0x505e9b){return __awaiter$4(this,void 0,void 0,function*(){const _0x437d2c={'account_name':_0x2427e1,'search_service_name':_0x3c3b58,'endpoint':_0x30267a,'key':_0x3e6edf,'country':_0x2c9808,'provider':_0x49279a,'index_name':_0x4c4770};try{const _0x168f44=yield this['fetch']['post'](this['path'],_0x505e9b,_0x437d2c);if(_0x168f44['status']>0xc7&&_0x168f44['status']<0x12c){const _0x50c348=yield _0x168f44['json']();return new SuccessfulSearchServiceResponse(_0x50c348);}const _0x4a8d9f=yield _0x168f44['json']();return new FailedSearchServiceResponse(_0x4a8d9f);}catch(_0x5c195d){if(_0x5c195d instanceof Error)return new FailedSearchServiceResponse({'detail':_0x5c195d['message'],'title':_0x5c195d['name'],'status':0x1f4,'instance':'','type':''});throw _0x5c195d;}});}['delete'](_0x246cd5,_0x95cad9,_0x4da89d){return __awaiter$4(this,void 0,void 0,function*(){const _0x2b695e=this['path']+'/'+_0x246cd5+'/'+_0x95cad9;try{const _0x469760=yield this['fetch']['delete'](_0x2b695e,_0x4da89d);if(_0x469760['status']>0xc7&&_0x469760['status']<0x12c)return new SuccessfulResponse({});const _0x2f6a59=yield _0x469760['json']();return new FailedResponse(_0x2f6a59);}catch(_0x4051c6){if(_0x4051c6 instanceof Error)return new FailedResponse({'detail':_0x4051c6['message'],'title':_0x4051c6['name'],'status':0x1f4,'instance':'','type':''});throw _0x4051c6;}});}['view'](_0x34e7ce,_0x441b76,_0x34cbf5){return __awaiter$4(this,void 0,void 0,function*(){const _0x4acea7=this['path']+'/'+_0x34e7ce+'/'+_0x441b76;try{const _0x63f38b=yield this['fetch']['get'](_0x4acea7,_0x34cbf5);if(_0x63f38b['status']>0xc7&&_0x63f38b['status']<0x12c){const _0x5bf77a=yield _0x63f38b['json']();return new SuccessfulViewSearchServiceResponse(_0x5bf77a);}const _0x4c626=yield _0x63f38b['json']();return new FailedViewSearchServiceResponse(_0x4c626);}catch(_0xba1d4a){if(_0xba1d4a instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0xba1d4a['message'],'title':_0xba1d4a['name'],'status':0x1f4,'instance':'','type':''});throw _0xba1d4a;}});}['edit'](_0x57c56f,_0x31a16e,_0x1bd356,_0x378519,_0x272802,_0x5b1c3b){return __awaiter$4(this,void 0,void 0,function*(){const _0x3d9cb4={'account_name':_0x57c56f,'search_service_name':_0x31a16e,'new_search_service_name':_0x1bd356,'key':_0x378519,'country':_0x272802};try{const _0x42837d=yield this['fetch']['put'](this['path'],_0x5b1c3b,_0x3d9cb4);if(_0x42837d['status']>0xc7&&_0x42837d['status']<0x12c){const _0x16da17=yield _0x42837d['json']();return new SuccessfulSearchServiceResponse(_0x16da17);}const _0x5c7e1e=yield _0x42837d['json']();return new FailedSearchServiceResponse(_0x5c7e1e);}catch(_0x4723c0){if(_0x4723c0 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x4723c0['message'],'title':_0x4723c0['name'],'status':0x1f4,'instance':'','type':''});throw _0x4723c0;}});}['list'](_0x37b949,_0x37023f){return __awaiter$4(this,void 0,void 0,function*(){const _0x461125=this['path']+'/'+_0x37b949;try{const _0x3aae0c=yield this['fetch']['get'](_0x461125,_0x37023f);if(_0x3aae0c['status']>0xc7&&_0x3aae0c['status']<0x12c){const _0x598922=yield _0x3aae0c['json']();return new SuccessfulListSearchServiceResponse(_0x598922);}const _0x5c393b=yield _0x3aae0c['json']();return new FailedViewSearchServicesResponse(_0x5c393b);}catch(_0x3a5d04){if(_0x3a5d04 instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x3a5d04['message'],'title':_0x3a5d04['name'],'status':0x1f4,'instance':'','type':''});throw _0x3a5d04;}});}}
|
|
12
|
+
|
|
13
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x26bc10,_0x11d7dc,_0x3e33d,_0x37d287){function _0x259ba4(_0x2db57a){return _0x2db57a instanceof _0x3e33d?_0x2db57a:new _0x3e33d(function(_0x523830){_0x523830(_0x2db57a);});}return new(_0x3e33d||(_0x3e33d=Promise))(function(_0x386159,_0x543e58){function _0x5468f8(_0x57113d){try{_0x2221d1(_0x37d287['next'](_0x57113d));}catch(_0x19084f){_0x543e58(_0x19084f);}}function _0x22c136(_0x31304d){try{_0x2221d1(_0x37d287['throw'](_0x31304d));}catch(_0x418320){_0x543e58(_0x418320);}}function _0x2221d1(_0x1f78e4){_0x1f78e4['done']?_0x386159(_0x1f78e4['value']):_0x259ba4(_0x1f78e4['value'])['then'](_0x5468f8,_0x22c136);}_0x2221d1((_0x37d287=_0x37d287['apply'](_0x26bc10,_0x11d7dc||[]))['next']());});};class FacetService{constructor(_0x363385){this['fetch']=_0x363385,this['path']='facet';}['create'](_0x28fa63,_0x54b41a,_0x11ccf0,_0x28669b){return __awaiter$3(this,void 0,void 0,function*(){const _0x4cceb1={'account_name':_0x28fa63,'list_name':_0x54b41a,'facet_name':_0x11ccf0};try{const _0x22162a=yield this['fetch']['post'](this['path'],_0x28669b,_0x4cceb1);if(_0x22162a['status']>0xc7&&_0x22162a['status']<0x12c){const _0x19ac6a=yield _0x22162a['json']();return new SuccessfulFacetResponse(_0x19ac6a);}const _0x4ce54f=yield _0x22162a['json']();return new FailedFacetResponse(_0x4ce54f);}catch(_0x5d701a){if(_0x5d701a instanceof Error)return new FailedFacetResponse({'detail':_0x5d701a['message'],'title':_0x5d701a['name'],'status':0x1f4,'instance':'','type':''});throw _0x5d701a;}});}['remove'](_0x5176d4,_0x498d0d,_0x49fb6c,_0x178b2c){return __awaiter$3(this,void 0,void 0,function*(){const _0x29dd59='Facet/'+_0x5176d4+'/'+_0x498d0d+'/'+_0x49fb6c,_0x58671a=yield this['fetch']['delete'](_0x29dd59,_0x178b2c);try{if(_0x58671a['status']>0xc7&&_0x58671a['status']<0x12c)return new SuccessfulResponse({});const _0x276995=yield _0x58671a['json']();return new FailedResponse(_0x276995);}catch(_0x572ab5){if(_0x572ab5 instanceof Error)return new FailedResponse({'detail':_0x572ab5['message'],'title':_0x572ab5['name'],'status':0x1f4,'instance':'','type':''});throw _0x572ab5;}});}['rename'](_0x20f5e7,_0x99ea17,_0x9d6610,_0x3247f6,_0x1788f4){return __awaiter$3(this,void 0,void 0,function*(){const _0x3e1ef4={'account_name':_0x20f5e7,'list_name':_0x99ea17,'facet_name':_0x9d6610,'new_facet_name':_0x3247f6};try{const _0x5e13ab=yield this['fetch']['put'](this['path'],_0x1788f4,_0x3e1ef4);if(_0x5e13ab['status']>0xc7&&_0x5e13ab['status']<0x12c){const _0x40776d=yield _0x5e13ab['json']();return new SuccessfulFacetResponse(_0x40776d);}const _0x132e81=yield _0x5e13ab['json']();return new FailedFacetResponse(_0x132e81);}catch(_0x36f6df){if(_0x36f6df instanceof Error)return new FailedFacetResponse({'detail':_0x36f6df['message'],'title':_0x36f6df['name'],'status':0x1f4,'instance':'','type':''});throw _0x36f6df;}});}}
|
|
14
|
+
|
|
15
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4eae09,_0x1d1a5f,_0x4a5028,_0x15abdc){function _0x36b486(_0x5a8e73){return _0x5a8e73 instanceof _0x4a5028?_0x5a8e73:new _0x4a5028(function(_0x535426){_0x535426(_0x5a8e73);});}return new(_0x4a5028||(_0x4a5028=Promise))(function(_0xd87c95,_0x20fd23){function _0x2d3431(_0x355e9a){try{_0x1b9212(_0x15abdc['next'](_0x355e9a));}catch(_0x4d8012){_0x20fd23(_0x4d8012);}}function _0x412b16(_0x567149){try{_0x1b9212(_0x15abdc['throw'](_0x567149));}catch(_0x2e5c5d){_0x20fd23(_0x2e5c5d);}}function _0x1b9212(_0x485c78){_0x485c78['done']?_0xd87c95(_0x485c78['value']):_0x36b486(_0x485c78['value'])['then'](_0x2d3431,_0x412b16);}_0x1b9212((_0x15abdc=_0x15abdc['apply'](_0x4eae09,_0x1d1a5f||[]))['next']());});};class SearchResultService{constructor(_0x2ebe73){this['fetch']=_0x2ebe73,this['path']='search-result';}['create'](_0x507f2e,_0x186c1b,_0x2a7802,_0x2a9365,_0x122306){return __awaiter$2(this,void 0,void 0,function*(){_0x122306=_0x122306!==null&&_0x122306!==void 0?_0x122306:{'description':'','keywords':'','resource_1':'','resource_2':'','resource_3':'','latitude':0x0,'longitude':0x0,'facets':[]};const _0x43f42e=Object['assign']({'account_name':_0x507f2e,'search_result_name':_0x2a7802,'list_name':_0x186c1b},_0x122306);try{const _0xecd89d=yield this['fetch']['post'](this['path'],_0x2a9365,_0x43f42e);if(_0xecd89d['status']>0xc7&&_0xecd89d['status']<0x12c){const _0x34722a=yield _0xecd89d['json']();return new SuccessfulViewSearchResultResponse(_0x34722a);}const _0x4b8233=yield _0xecd89d['json']();return new FailedSearchResultResponse(_0x4b8233);}catch(_0x33b5f7){if(_0x33b5f7 instanceof Error)return new FailedSearchResultResponse({'detail':_0x33b5f7['message'],'title':_0x33b5f7['name'],'status':0x1f4,'instance':'','type':''});throw _0x33b5f7;}});}}
|
|
16
|
+
|
|
17
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5f57bd,_0x28d27b,_0x59c353,_0x4d3226){function _0x4eafc0(_0x2deea1){return _0x2deea1 instanceof _0x59c353?_0x2deea1:new _0x59c353(function(_0x508ea7){_0x508ea7(_0x2deea1);});}return new(_0x59c353||(_0x59c353=Promise))(function(_0x45ffe6,_0x135568){function _0x3263cb(_0x5c9906){try{_0x40eb3b(_0x4d3226['next'](_0x5c9906));}catch(_0x4db620){_0x135568(_0x4db620);}}function _0x530c9f(_0x7ea7f6){try{_0x40eb3b(_0x4d3226['throw'](_0x7ea7f6));}catch(_0x4a704a){_0x135568(_0x4a704a);}}function _0x40eb3b(_0x509ae3){_0x509ae3['done']?_0x45ffe6(_0x509ae3['value']):_0x4eafc0(_0x509ae3['value'])['then'](_0x3263cb,_0x530c9f);}_0x40eb3b((_0x4d3226=_0x4d3226['apply'](_0x5f57bd,_0x28d27b||[]))['next']());});};class ContributorService{constructor(_0x2db377){this['fetch']=_0x2db377,this['path']='contributor';}['create'](_0x2e20d9,_0x19d5ec,_0x41d31e,_0x262156){return __awaiter$1(this,void 0,void 0,function*(){const _0x38520f={'account_name':_0x2e20d9,'list_name':_0x19d5ec,'contributor_name':_0x41d31e};try{const _0x446b8b=yield this['fetch']['post'](this['path'],_0x262156,_0x38520f);if(_0x446b8b['status']>0xc7&&_0x446b8b['status']<0x12c){const _0x128880=yield _0x446b8b['json']();return new SuccessfulContributorResponse(_0x128880);}const _0x38ea3f=yield _0x446b8b['json']();return new FailedContributorResponse(_0x38ea3f);}catch(_0x503300){if(_0x503300 instanceof Error)return new FailedContributorResponse({'detail':_0x503300['message'],'title':_0x503300['name'],'status':0x1f4,'instance':'','type':''});throw _0x503300;}});}['remove'](_0x507aa3,_0x1d7530,_0x3a0b0d,_0x24cecd){return __awaiter$1(this,void 0,void 0,function*(){const _0x21bf58=this['path']+'/'+_0x507aa3+'/'+_0x1d7530+'/'+_0x3a0b0d,_0x27aabc=yield this['fetch']['delete'](_0x21bf58,_0x24cecd);try{if(_0x27aabc['status']>0xc7&&_0x27aabc['status']<0x12c)return new SuccessfulResponse({});const _0xaedc3c=yield _0x27aabc['json']();return new FailedResponse(_0xaedc3c);}catch(_0x3ba07a){if(_0x3ba07a instanceof Error)return new FailedResponse({'detail':_0x3ba07a['message'],'title':_0x3ba07a['name'],'status':0x1f4,'instance':'','type':''});throw _0x3ba07a;}});}['startsWith'](_0x342cdc,_0x3f5586){return __awaiter$1(this,void 0,void 0,function*(){const _0x4c53a8=this['path']+'/'+_0x342cdc;try{const _0x3a1582=yield this['fetch']['get'](_0x4c53a8,_0x3f5586);if(_0x3a1582['status']>0xc7&&_0x3a1582['status']<0x12c){const _0x239e02=yield _0x3a1582['json']();return new SuccessfulAccountAndImageResponse(_0x239e02);}const _0x5a7dc8=yield _0x3a1582['json']();return new FailedAccountAndImageResponse(_0x5a7dc8);}catch(_0x5f3c5f){if(_0x5f3c5f instanceof Error)return new FailedAccountAndImageResponse({'detail':_0x5f3c5f['message'],'title':_0x5f3c5f['name'],'status':0x1f4,'instance':'','type':''});throw _0x5f3c5f;}});}}
|
|
18
|
+
|
|
19
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0xe69dc4,_0x13a634,_0x48db86,_0x17e4bf){function _0x44e11a(_0x3ab079){return _0x3ab079 instanceof _0x48db86?_0x3ab079:new _0x48db86(function(_0x3ba00a){_0x3ba00a(_0x3ab079);});}return new(_0x48db86||(_0x48db86=Promise))(function(_0x12d16d,_0x5826a0){function _0x2400e7(_0x1b5bcd){try{_0x44d866(_0x17e4bf['next'](_0x1b5bcd));}catch(_0x3ccb8f){_0x5826a0(_0x3ccb8f);}}function _0x2ab297(_0x53580d){try{_0x44d866(_0x17e4bf['throw'](_0x53580d));}catch(_0x33ed76){_0x5826a0(_0x33ed76);}}function _0x44d866(_0x381a62){_0x381a62['done']?_0x12d16d(_0x381a62['value']):_0x44e11a(_0x381a62['value'])['then'](_0x2400e7,_0x2ab297);}_0x44d866((_0x17e4bf=_0x17e4bf['apply'](_0xe69dc4,_0x13a634||[]))['next']());});};class AdminClient{constructor(_0x26884f='https://admin.searchability.dev/'){var _0x6b54bf=new Fetch(_0x26884f);this['Accounts']=new AccountService(_0x6b54bf),this['Lists']=new ListService(_0x6b54bf),this['ApiKeys']=new ApiKeyService(_0x6b54bf),this['SearchServers']=new SearchServersService(_0x6b54bf),this['Facets']=new FacetService(_0x6b54bf),this['SearchResults']=new SearchResultService(_0x6b54bf),this['Contributors']=new ContributorService(_0x6b54bf);}}class AuthClient{constructor(_0x232be4='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x232be4);}['login'](_0x45b2df){return __awaiter(this,void 0,void 0,function*(){const _0x5b4478='login/'+_0x45b2df;try{const _0x5c2dfc=yield yield fetch(_0x5b4478);if(_0x5c2dfc['status']>0xc7&&_0x5c2dfc['status']<0x12c){const _0x502e98=yield _0x5c2dfc['json']();return new SuccessfulAuthResponse(_0x502e98);}const _0x5a8e3c=yield _0x5c2dfc['json']();return new FailedAuthResponse(_0x5a8e3c);}catch(_0x394c9f){if(_0x394c9f instanceof Error)return new FailedAuthResponse({'detail':_0x394c9f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x394c9f;}});}['refresh'](_0x4d8d81){return __awaiter(this,void 0,void 0,function*(){const _0x441444='refresh',_0x1dded5={'refresh_token':_0x4d8d81};try{const _0x4c2378=yield this['fetch']['PostNoAuth'](_0x441444,_0x1dded5);if(_0x4c2378['status']>0xc7&&_0x4c2378['status']<0x12c){const _0x57bf8a=yield _0x4c2378['json']();return new SuccessfulAuthResponse(_0x57bf8a);}const _0x1943c1=yield _0x4c2378['json']();return new FailedAuthResponse(_0x1943c1);}catch(_0x3df742){if(_0x3df742 instanceof Error)return new FailedAuthResponse({'detail':_0x3df742['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3df742;}});}['getTokenStatus'](_0x569920){if(Date['now']()<_0x569920['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x569920['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
20
|
+
|
|
21
|
+
export { AdminClient, AuthClient, TokenStatus, Tokens };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
exports.TokenStatus = void 0;(function(
|
|
3
|
+
exports.TokenStatus = void 0;(function(_0x1d5126){_0x1d5126[_0x1d5126['Ok']=0x0]='Ok',_0x1d5126[_0x1d5126['Refresh']=0x1]='Refresh',_0x1d5126[_0x1d5126['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(_0x37d296){this['isSuccess']=_0x37d296;}}class SuccessfulContributorResponse extends Response{constructor(_0xe6a7df){super(!![]),this['contributor']=_0xe6a7df;}['toSuccess'](){return this['contributor'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedContributorResponse extends Response{constructor(_0x4b1dd3){super(![]),this['problem']=_0x4b1dd3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAccountAndImageResponse extends Response{constructor(_0x1a06e7){super(!![]),this['accountAndImage']=_0x1a06e7;}['toSuccess'](){return this['accountAndImage'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountAndImageResponse extends Response{constructor(_0xf770a){super(![]),this['problem']=_0xf770a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulFacetResponse extends Response{constructor(_0x37eade){super(!![]),this['facet']=_0x37eade;}['toSuccess'](){return this['facet'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedFacetResponse extends Response{constructor(_0xb38fe4){super(![]),this['problem']=_0xb38fe4;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAccountResponse extends Response{constructor(_0x4b8fdc){super(!![]),this['account']=_0x4b8fdc;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulAccountImageResponse extends Response{constructor(_0x1c0cbd){super(!![]),this['accountImage']=_0x1c0cbd;}['toSuccess'](){return this['accountImage'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x5e6e69){super(!![]),this['list']=_0x5e6e69;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListResponse extends Response{constructor(_0x4964c){super(!![]),this['list']=_0x4964c;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1b16b8){super(![]),this['problem']=_0x1b16b8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedAccountImageResponse extends Response{constructor(_0x3efd6){super(![]),this['problem']=_0x3efd6;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x2c978d){super(![]),this['problem']=_0x2c978d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListResponse extends Response{constructor(_0x116a03){super(![]),this['problem']=_0x116a03;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x4871e5){super(!![]),this['tokens']=_0x4871e5;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x657bf7){super(![]),this['problem']=_0x657bf7;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x582d8e){super(!![]),this['apiKey']=_0x582d8e;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x53b878){super(![]),this['problem']=_0x53b878;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x1b72eb){super(!![]),this['searchService']=_0x1b72eb;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x57d8bf){super(![]),this['problem']=_0x57d8bf;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x57d3ca){super(!![]),this['searchService']=_0x57d3ca;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulViewSearchResultResponse extends Response{constructor(_0x53e0ce){super(!![]),this['searchResult']=_0x53e0ce;}['toSuccess'](){return this['searchResult'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchResultResponse extends Response{constructor(_0x16f498){super(![]),this['problem']=_0x16f498;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0x11d879){super(!![]),this['searchServices']=_0x11d879;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x428735){super(![]),this['problem']=_0x428735;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x368169){super(![]),this['problem']=_0x368169;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x30b25d){super(!![]),this['apiKeyValue']=_0x30b25d;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x4d788f){super(!![]),this['obj']=_0x4d788f;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x301446){super(![]),this['problem']=_0x301446;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x263f6d){super(![]),this['problem']=_0x263f6d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$8=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$8=undefined&&undefined['__awaiter']||function(_0x3ad986,_0x1653c7,_0x1f0e8e,_0x12b894){function _0x4aadcb(_0x2ac835){return _0x2ac835 instanceof _0x1f0e8e?_0x2ac835:new _0x1f0e8e(function(_0x43ae0e){_0x43ae0e(_0x2ac835);});}return new(_0x1f0e8e||(_0x1f0e8e=Promise))(function(_0x5136df,_0x51860c){function _0x24a0e4(_0x5462bc){try{_0x3c1adb(_0x12b894['next'](_0x5462bc));}catch(_0x276780){_0x51860c(_0x276780);}}function _0x490f07(_0xaa66ea){try{_0x3c1adb(_0x12b894['throw'](_0xaa66ea));}catch(_0x9e0bf1){_0x51860c(_0x9e0bf1);}}function _0x3c1adb(_0x47b705){_0x47b705['done']?_0x5136df(_0x47b705['value']):_0x4aadcb(_0x47b705['value'])['then'](_0x24a0e4,_0x490f07);}_0x3c1adb((_0x12b894=_0x12b894['apply'](_0x3ad986,_0x1653c7||[]))['next']());});};class AccountService{constructor(_0x243625){this['fetch']=_0x243625;}['get'](_0x179cdb,_0x4aeb7f){return __awaiter$8(this,void 0,void 0,function*(){const _0x456b08='Account/'+_0x179cdb+'/',_0x4cd071=yield this['fetch']['get'](_0x456b08,_0x4aeb7f);try{if(_0x4cd071['status']>0xc7&&_0x4cd071['status']<0x12c){const _0x4199f6=yield _0x4cd071['json']();return new SuccessfulAccountResponse(_0x4199f6);}const _0x26e7ea=yield _0x4cd071['json']();return new FailedAccountResponse(_0x26e7ea);}catch(_0x10df07){if(_0x10df07 instanceof Error)return new FailedAccountResponse({'detail':_0x10df07['message'],'title':_0x10df07['name'],'status':0x1f4,'instance':'','type':''});throw _0x10df07;}});}['getImage'](_0x3ea092,_0x41fce1){return __awaiter$8(this,void 0,void 0,function*(){const _0x14097e='account/image/'+_0x3ea092+'/',_0xd7beb3=yield this['fetch']['get'](_0x14097e,_0x41fce1);try{if(_0xd7beb3['status']>0xc7&&_0xd7beb3['status']<0x12c){const _0x339089=yield _0xd7beb3['json']();return new SuccessfulAccountImageResponse(_0x339089);}const _0x54a22b=yield _0xd7beb3['json']();return new FailedAccountImageResponse(_0x54a22b);}catch(_0x4a4e11){if(_0x4a4e11 instanceof Error)return new FailedAccountImageResponse({'detail':_0x4a4e11['message'],'title':_0x4a4e11['name'],'status':0x1f4,'instance':'','type':''});throw _0x4a4e11;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$7=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$7=undefined&&undefined['__awaiter']||function(_0x4cfdb7,_0x14bcaf,_0x46fc0c,_0x32f071){function _0x1af1fe(_0x265aab){return _0x265aab instanceof _0x46fc0c?_0x265aab:new _0x46fc0c(function(_0xbb2c36){_0xbb2c36(_0x265aab);});}return new(_0x46fc0c||(_0x46fc0c=Promise))(function(_0x466cde,_0x11db0d){function _0x16609b(_0x1054a5){try{_0xa74947(_0x32f071['next'](_0x1054a5));}catch(_0x22ef68){_0x11db0d(_0x22ef68);}}function _0x1bc1fd(_0x5e33dd){try{_0xa74947(_0x32f071['throw'](_0x5e33dd));}catch(_0x43898b){_0x11db0d(_0x43898b);}}function _0xa74947(_0x395bd0){_0x395bd0['done']?_0x466cde(_0x395bd0['value']):_0x1af1fe(_0x395bd0['value'])['then'](_0x16609b,_0x1bc1fd);}_0xa74947((_0x32f071=_0x32f071['apply'](_0x4cfdb7,_0x14bcaf||[]))['next']());});};class ApiKeyService{constructor(_0x43dc0b){this['fetch']=_0x43dc0b,this['path']='api-key';}['create'](_0x23371d,_0x34b3c0,_0x440c6c){return __awaiter$7(this,void 0,void 0,function*(){const _0x42f05c={'account_name':_0x23371d,'api_key_name':_0x34b3c0};try{const _0x5f4479=yield this['fetch']['post'](this['path'],_0x440c6c,_0x42f05c);if(_0x5f4479['status']>0xc7&&_0x5f4479['status']<0x12c){const _0x47395e=yield _0x5f4479['json']();return new SuccessfulApiKeyResponse(_0x47395e);}const _0x536f26=yield _0x5f4479['json']();return new FailedApiKeyResponse(_0x536f26);}catch(_0x565d4d){if(_0x565d4d instanceof Error)return new FailedApiKeyResponse({'detail':_0x565d4d['message'],'title':_0x565d4d['name'],'status':0x1f4,'instance':'','type':''});throw _0x565d4d;}});}['view'](_0x8471bc,_0x4770b5,_0x1d52aa){return __awaiter$7(this,void 0,void 0,function*(){const _0x893ffd=this['path']+'/'+_0x8471bc+'/'+_0x4770b5;try{const _0x521283=yield this['fetch']['get'](_0x893ffd,_0x1d52aa);if(_0x521283['status']>0xc7&&_0x521283['status']<0x12c){const _0xf0dd1e=yield _0x521283['json']();return new SuccessfulApiKeyValueResponse(_0xf0dd1e);}const _0x35e049=yield _0x521283['json']();return new FailedApiKeyValueResponse(_0x35e049);}catch(_0x579a4b){if(_0x579a4b instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x579a4b['message'],'title':_0x579a4b['name'],'status':0x1f4,'instance':'','type':''});throw _0x579a4b;}});}['delete'](_0x542c3a,_0x30fd73,_0x1921ab){return __awaiter$7(this,void 0,void 0,function*(){const _0x1000e1=this['path']+'/'+_0x542c3a+'/'+_0x30fd73;try{const _0x447689=yield this['fetch']['delete'](_0x1000e1,_0x1921ab);if(_0x447689['status']>0xc7&&_0x447689['status']<0x12c)return new SuccessfulResponse({});const _0x3e2273=yield _0x447689['json']();return new FailedResponse(_0x3e2273);}catch(_0x530039){if(_0x530039 instanceof Error)return new FailedResponse({'detail':_0x530039['message'],'title':_0x530039['name'],'status':0x1f4,'instance':'','type':''});throw _0x530039;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$6=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$6=undefined&&undefined['__awaiter']||function(_0x268251,_0x515a48,_0x2175ed,_0x4aeb00){function _0x4d2c5c(_0x6dd3a5){return _0x6dd3a5 instanceof _0x2175ed?_0x6dd3a5:new _0x2175ed(function(_0xecef38){_0xecef38(_0x6dd3a5);});}return new(_0x2175ed||(_0x2175ed=Promise))(function(_0x4d1bc5,_0x54dafc){function _0x27f16a(_0x4bdeba){try{_0x2b7ccb(_0x4aeb00['next'](_0x4bdeba));}catch(_0x18319f){_0x54dafc(_0x18319f);}}function _0x5acbe3(_0x2eae04){try{_0x2b7ccb(_0x4aeb00['throw'](_0x2eae04));}catch(_0x15a3eb){_0x54dafc(_0x15a3eb);}}function _0x2b7ccb(_0x5e461e){_0x5e461e['done']?_0x4d1bc5(_0x5e461e['value']):_0x4d2c5c(_0x5e461e['value'])['then'](_0x27f16a,_0x5acbe3);}_0x2b7ccb((_0x4aeb00=_0x4aeb00['apply'](_0x268251,_0x515a48||[]))['next']());});};class ListService{constructor(_0x54c3dc){this['fetch']=_0x54c3dc;}['create'](_0x41b967,_0x3e8c2f,_0x2b3197,_0x583946){return __awaiter$6(this,void 0,void 0,function*(){const _0x3378ce='List',_0x20874b={'account_name':_0x41b967,'list_name':_0x3e8c2f,'search_service_name':_0x2b3197};try{const _0x11fc95=yield this['fetch']['post'](_0x3378ce,_0x583946,_0x20874b);if(_0x11fc95['status']>0xc7&&_0x11fc95['status']<0x12c){const _0x5622c0=yield _0x11fc95['json']();return new SuccessfulListIdentityResponse(_0x5622c0);}const _0x256245=yield _0x11fc95['json']();return new FailedListIdentityResponse(_0x256245);}catch(_0x531019){if(_0x531019 instanceof Error)return new FailedListIdentityResponse({'detail':_0x531019['message'],'title':_0x531019['name'],'status':0x1f4,'instance':'','type':''});throw _0x531019;}});}['delete'](_0x53c9c8,_0x5a0452,_0x4ceb51){return __awaiter$6(this,void 0,void 0,function*(){const _0x4a04d2='List/'+_0x53c9c8+'/'+_0x5a0452,_0x12a5bc=yield this['fetch']['delete'](_0x4a04d2,_0x4ceb51);try{if(_0x12a5bc['status']>0xc7&&_0x12a5bc['status']<0x12c)return new SuccessfulResponse({});const _0x40dea2=yield _0x12a5bc['json']();return new FailedResponse(_0x40dea2);}catch(_0x5c0873){if(_0x5c0873 instanceof Error)return new FailedResponse({'detail':_0x5c0873['message'],'title':_0x5c0873['name'],'status':0x1f4,'instance':'','type':''});throw _0x5c0873;}});}['get'](_0x399877,_0x341a52,_0x2aa7be){return __awaiter$6(this,void 0,void 0,function*(){const _0x21123f='List/'+_0x399877+'/'+_0x341a52;try{const _0x5dce3a=yield this['fetch']['get'](_0x21123f,_0x2aa7be);if(_0x5dce3a['status']>0xc7&&_0x5dce3a['status']<0x12c){const _0x410f35=yield _0x5dce3a['json']();return new SuccessfulListResponse(_0x410f35);}const _0x29607e=yield _0x5dce3a['json']();return new FailedListResponse(_0x29607e);}catch(_0x1eb4ae){if(_0x1eb4ae instanceof Error)return new FailedListResponse({'detail':_0x1eb4ae['message'],'title':_0x1eb4ae['name'],'status':0x1f4,'instance':'','type':''});throw _0x1eb4ae;}});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$5=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x362157,_0x12d029,_0x1fae26,_0x9d14c0){function _0x1daecf(_0x96fcbe){return _0x96fcbe instanceof _0x1fae26?_0x96fcbe:new _0x1fae26(function(_0xff2fd1){_0xff2fd1(_0x96fcbe);});}return new(_0x1fae26||(_0x1fae26=Promise))(function(_0x5fd83a,_0x5af304){function _0x1024f5(_0x1badcf){try{_0x238dad(_0x9d14c0['next'](_0x1badcf));}catch(_0x3dd7a9){_0x5af304(_0x3dd7a9);}}function _0x448031(_0x32dd16){try{_0x238dad(_0x9d14c0['throw'](_0x32dd16));}catch(_0x25bfe8){_0x5af304(_0x25bfe8);}}function _0x238dad(_0x1001cf){_0x1001cf['done']?_0x5fd83a(_0x1001cf['value']):_0x1daecf(_0x1001cf['value'])['then'](_0x1024f5,_0x448031);}_0x238dad((_0x9d14c0=_0x9d14c0['apply'](_0x362157,_0x12d029||[]))['next']());});};class Fetch{constructor(_0x5bf0bb){this['baseUri']=_0x5bf0bb,this['getUrl']=_0x973936=>{return _0x973936['startsWith']('/')&&(_0x973936=_0x973936['replace']('/','')),''+this['baseUri']+_0x973936;},!_0x5bf0bb['endsWith']('/')&&(_0x5bf0bb=_0x5bf0bb+'/');}['get'](_0x57a98,_0x32d617){return __awaiter$5(this,void 0,void 0,function*(){const _0x441ce3=this['getUrl'](_0x57a98);return yield fetch(_0x441ce3,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x32d617}});});}['post'](_0x21f4b0,_0x570403,_0x2d70da){return __awaiter$5(this,void 0,void 0,function*(){const _0x314e25=this['getUrl'](_0x21f4b0);return yield fetch(_0x314e25,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x570403},'body':_0x2d70da?JSON['stringify'](_0x2d70da):null});});}['PostNoAuth'](_0x4f0d0d,_0x3fd6aa){return __awaiter$5(this,void 0,void 0,function*(){const _0x141b5a=this['getUrl'](_0x4f0d0d);return yield fetch(_0x141b5a,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x3fd6aa?JSON['stringify'](_0x3fd6aa):null});});}['put'](_0x5c47ba,_0x74295c,_0x11e731){return __awaiter$5(this,void 0,void 0,function*(){const _0x520507=this['getUrl'](_0x5c47ba);return yield fetch(_0x520507,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x74295c},'body':_0x11e731?JSON['stringify'](_0x11e731):null});});}['delete'](_0x30ac32,_0x381874){return __awaiter$5(this,void 0,void 0,function*(){const _0x225e2e=this['getUrl'](_0x30ac32);return yield fetch(_0x225e2e,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x381874}});});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x5a2961,_0x9f9caf,_0x2c5a4b,_0x5121ac){function _0x1f3b6d(_0x576890){return _0x576890 instanceof _0x2c5a4b?_0x576890:new _0x2c5a4b(function(_0x5c2b3f){_0x5c2b3f(_0x576890);});}return new(_0x2c5a4b||(_0x2c5a4b=Promise))(function(_0x182b4a,_0x5d21e5){function _0x34acce(_0x407f50){try{_0x8fac21(_0x5121ac['next'](_0x407f50));}catch(_0x1a6472){_0x5d21e5(_0x1a6472);}}function _0x52bf5(_0x10464a){try{_0x8fac21(_0x5121ac['throw'](_0x10464a));}catch(_0x58fc08){_0x5d21e5(_0x58fc08);}}function _0x8fac21(_0x13f28a){_0x13f28a['done']?_0x182b4a(_0x13f28a['value']):_0x1f3b6d(_0x13f28a['value'])['then'](_0x34acce,_0x52bf5);}_0x8fac21((_0x5121ac=_0x5121ac['apply'](_0x5a2961,_0x9f9caf||[]))['next']());});};class SearchServersService{constructor(_0x50b861){this['fetch']=_0x50b861,this['path']='search-services';}['create'](_0x231c32,_0x1324d8,_0x2d39f3,_0x56b5ff,_0x59ec54,_0x12a570,_0x5ea683,_0x12c865){return __awaiter$4(this,void 0,void 0,function*(){const _0x3ace41={'account_name':_0x231c32,'search_service_name':_0x1324d8,'endpoint':_0x2d39f3,'key':_0x56b5ff,'country':_0x59ec54,'provider':_0x12a570,'index_name':_0x5ea683};try{const _0x4fb3b0=yield this['fetch']['post'](this['path'],_0x12c865,_0x3ace41);if(_0x4fb3b0['status']>0xc7&&_0x4fb3b0['status']<0x12c){const _0x50b35a=yield _0x4fb3b0['json']();return new SuccessfulSearchServiceResponse(_0x50b35a);}const _0x19a390=yield _0x4fb3b0['json']();return new FailedSearchServiceResponse(_0x19a390);}catch(_0x4a1eec){if(_0x4a1eec instanceof Error)return new FailedSearchServiceResponse({'detail':_0x4a1eec['message'],'title':_0x4a1eec['name'],'status':0x1f4,'instance':'','type':''});throw _0x4a1eec;}});}['delete'](_0x2f9368,_0xc72f1f,_0x43bf22){return __awaiter$4(this,void 0,void 0,function*(){const _0x115e59=this['path']+'/'+_0x2f9368+'/'+_0xc72f1f;try{const _0x4eddb2=yield this['fetch']['delete'](_0x115e59,_0x43bf22);if(_0x4eddb2['status']>0xc7&&_0x4eddb2['status']<0x12c)return new SuccessfulResponse({});const _0x427e33=yield _0x4eddb2['json']();return new FailedResponse(_0x427e33);}catch(_0x553341){if(_0x553341 instanceof Error)return new FailedResponse({'detail':_0x553341['message'],'title':_0x553341['name'],'status':0x1f4,'instance':'','type':''});throw _0x553341;}});}['view'](_0x69c658,_0x251ff9,_0x47e760){return __awaiter$4(this,void 0,void 0,function*(){const _0x119ab3=this['path']+'/'+_0x69c658+'/'+_0x251ff9;try{const _0x10df93=yield this['fetch']['get'](_0x119ab3,_0x47e760);if(_0x10df93['status']>0xc7&&_0x10df93['status']<0x12c){const _0x56cdfe=yield _0x10df93['json']();return new SuccessfulViewSearchServiceResponse(_0x56cdfe);}const _0x1bb31f=yield _0x10df93['json']();return new FailedViewSearchServiceResponse(_0x1bb31f);}catch(_0x4934bc){if(_0x4934bc instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x4934bc['message'],'title':_0x4934bc['name'],'status':0x1f4,'instance':'','type':''});throw _0x4934bc;}});}['edit'](_0x457886,_0x5e3a70,_0x49bbf1,_0x5039f6,_0x51cea2,_0xe6f704){return __awaiter$4(this,void 0,void 0,function*(){const _0x597f84={'account_name':_0x457886,'search_service_name':_0x5e3a70,'new_search_service_name':_0x49bbf1,'key':_0x5039f6,'country':_0x51cea2};try{const _0x4a08c5=yield this['fetch']['put'](this['path'],_0xe6f704,_0x597f84);if(_0x4a08c5['status']>0xc7&&_0x4a08c5['status']<0x12c){const _0x57b277=yield _0x4a08c5['json']();return new SuccessfulSearchServiceResponse(_0x57b277);}const _0x29beb6=yield _0x4a08c5['json']();return new FailedSearchServiceResponse(_0x29beb6);}catch(_0x421908){if(_0x421908 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x421908['message'],'title':_0x421908['name'],'status':0x1f4,'instance':'','type':''});throw _0x421908;}});}['list'](_0x296a3c,_0x36fd30){return __awaiter$4(this,void 0,void 0,function*(){const _0x112553=this['path']+'/'+_0x296a3c;try{const _0x1c4dd2=yield this['fetch']['get'](_0x112553,_0x36fd30);if(_0x1c4dd2['status']>0xc7&&_0x1c4dd2['status']<0x12c){const _0x522943=yield _0x1c4dd2['json']();return new SuccessfulListSearchServiceResponse(_0x522943);}const _0x31dd3c=yield _0x1c4dd2['json']();return new FailedViewSearchServicesResponse(_0x31dd3c);}catch(_0x5835fc){if(_0x5835fc instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x5835fc['message'],'title':_0x5835fc['name'],'status':0x1f4,'instance':'','type':''});throw _0x5835fc;}});}}
|
|
14
14
|
|
|
15
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
15
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x75538c,_0x10c545,_0x14fc65,_0x3b2261){function _0x2df328(_0x4f5606){return _0x4f5606 instanceof _0x14fc65?_0x4f5606:new _0x14fc65(function(_0x4a5f66){_0x4a5f66(_0x4f5606);});}return new(_0x14fc65||(_0x14fc65=Promise))(function(_0x41aba3,_0x1d5632){function _0x20e2f2(_0x1181b7){try{_0x452590(_0x3b2261['next'](_0x1181b7));}catch(_0x2bf259){_0x1d5632(_0x2bf259);}}function _0x3b3540(_0x2298a9){try{_0x452590(_0x3b2261['throw'](_0x2298a9));}catch(_0x464668){_0x1d5632(_0x464668);}}function _0x452590(_0x1661a8){_0x1661a8['done']?_0x41aba3(_0x1661a8['value']):_0x2df328(_0x1661a8['value'])['then'](_0x20e2f2,_0x3b3540);}_0x452590((_0x3b2261=_0x3b2261['apply'](_0x75538c,_0x10c545||[]))['next']());});};class FacetService{constructor(_0x80fc65){this['fetch']=_0x80fc65,this['path']='facet';}['create'](_0x1f3865,_0x426455,_0x61c299,_0x22fb6d){return __awaiter$3(this,void 0,void 0,function*(){const _0x1ea3ec={'account_name':_0x1f3865,'list_name':_0x426455,'facet_name':_0x61c299};try{const _0x5b1802=yield this['fetch']['post'](this['path'],_0x22fb6d,_0x1ea3ec);if(_0x5b1802['status']>0xc7&&_0x5b1802['status']<0x12c){const _0xe2cd8a=yield _0x5b1802['json']();return new SuccessfulFacetResponse(_0xe2cd8a);}const _0x2cf67c=yield _0x5b1802['json']();return new FailedFacetResponse(_0x2cf67c);}catch(_0x2beb4b){if(_0x2beb4b instanceof Error)return new FailedFacetResponse({'detail':_0x2beb4b['message'],'title':_0x2beb4b['name'],'status':0x1f4,'instance':'','type':''});throw _0x2beb4b;}});}['remove'](_0x13e2a8,_0x164aa1,_0x149a36,_0x90ae91){return __awaiter$3(this,void 0,void 0,function*(){const _0x27e8ff='Facet/'+_0x13e2a8+'/'+_0x164aa1+'/'+_0x149a36,_0x127f44=yield this['fetch']['delete'](_0x27e8ff,_0x90ae91);try{if(_0x127f44['status']>0xc7&&_0x127f44['status']<0x12c)return new SuccessfulResponse({});const _0x2bcb56=yield _0x127f44['json']();return new FailedResponse(_0x2bcb56);}catch(_0x4827e5){if(_0x4827e5 instanceof Error)return new FailedResponse({'detail':_0x4827e5['message'],'title':_0x4827e5['name'],'status':0x1f4,'instance':'','type':''});throw _0x4827e5;}});}['rename'](_0x544661,_0xe75acd,_0x196462,_0x3b904b,_0x165ba0){return __awaiter$3(this,void 0,void 0,function*(){const _0x265fc3={'account_name':_0x544661,'list_name':_0xe75acd,'facet_name':_0x196462,'new_facet_name':_0x3b904b};try{const _0x4e5144=yield this['fetch']['put'](this['path'],_0x165ba0,_0x265fc3);if(_0x4e5144['status']>0xc7&&_0x4e5144['status']<0x12c){const _0x5a152=yield _0x4e5144['json']();return new SuccessfulFacetResponse(_0x5a152);}const _0x32a610=yield _0x4e5144['json']();return new FailedFacetResponse(_0x32a610);}catch(_0x281a54){if(_0x281a54 instanceof Error)return new FailedFacetResponse({'detail':_0x281a54['message'],'title':_0x281a54['name'],'status':0x1f4,'instance':'','type':''});throw _0x281a54;}});}}
|
|
16
16
|
|
|
17
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
17
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x29e66a,_0x3dc33a,_0x2715d0,_0x23d6a2){function _0x4cda42(_0x1ce491){return _0x1ce491 instanceof _0x2715d0?_0x1ce491:new _0x2715d0(function(_0x9f9d85){_0x9f9d85(_0x1ce491);});}return new(_0x2715d0||(_0x2715d0=Promise))(function(_0x34d8af,_0x28683d){function _0x14287b(_0x371f58){try{_0x1a37a4(_0x23d6a2['next'](_0x371f58));}catch(_0x1bf4ee){_0x28683d(_0x1bf4ee);}}function _0x4e47e6(_0x24d284){try{_0x1a37a4(_0x23d6a2['throw'](_0x24d284));}catch(_0x50540a){_0x28683d(_0x50540a);}}function _0x1a37a4(_0x52c181){_0x52c181['done']?_0x34d8af(_0x52c181['value']):_0x4cda42(_0x52c181['value'])['then'](_0x14287b,_0x4e47e6);}_0x1a37a4((_0x23d6a2=_0x23d6a2['apply'](_0x29e66a,_0x3dc33a||[]))['next']());});};class SearchResultService{constructor(_0x24ddfa){this['fetch']=_0x24ddfa,this['path']='search-result';}['create'](_0x3aa954,_0x4412f0,_0x9b9ed3,_0xadf3de,_0x22ecec){return __awaiter$2(this,void 0,void 0,function*(){_0x22ecec=_0x22ecec!==null&&_0x22ecec!==void 0?_0x22ecec:{'description':'','keywords':'','resource_1':'','resource_2':'','resource_3':'','latitude':0x0,'longitude':0x0,'facets':[]};const _0x3aa534=Object['assign']({'account_name':_0x3aa954,'search_result_name':_0x9b9ed3,'list_name':_0x4412f0},_0x22ecec);try{const _0x38afe5=yield this['fetch']['post'](this['path'],_0xadf3de,_0x3aa534);if(_0x38afe5['status']>0xc7&&_0x38afe5['status']<0x12c){const _0x32dba7=yield _0x38afe5['json']();return new SuccessfulViewSearchResultResponse(_0x32dba7);}const _0xb45248=yield _0x38afe5['json']();return new FailedSearchResultResponse(_0xb45248);}catch(_0x371e72){if(_0x371e72 instanceof Error)return new FailedSearchResultResponse({'detail':_0x371e72['message'],'title':_0x371e72['name'],'status':0x1f4,'instance':'','type':''});throw _0x371e72;}});}}
|
|
18
18
|
|
|
19
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
19
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x316225,_0x5bb6a9,_0x1bda81,_0x241529){function _0x4bc73d(_0x46f120){return _0x46f120 instanceof _0x1bda81?_0x46f120:new _0x1bda81(function(_0x5608c3){_0x5608c3(_0x46f120);});}return new(_0x1bda81||(_0x1bda81=Promise))(function(_0x1409f3,_0x3e5778){function _0x788a69(_0x34e735){try{_0x412af4(_0x241529['next'](_0x34e735));}catch(_0x4f18ac){_0x3e5778(_0x4f18ac);}}function _0x325668(_0x333ef0){try{_0x412af4(_0x241529['throw'](_0x333ef0));}catch(_0x5013da){_0x3e5778(_0x5013da);}}function _0x412af4(_0x5c17cc){_0x5c17cc['done']?_0x1409f3(_0x5c17cc['value']):_0x4bc73d(_0x5c17cc['value'])['then'](_0x788a69,_0x325668);}_0x412af4((_0x241529=_0x241529['apply'](_0x316225,_0x5bb6a9||[]))['next']());});};class ContributorService{constructor(_0x3f87d7){this['fetch']=_0x3f87d7,this['path']='contributor';}['create'](_0x5380eb,_0x37af89,_0x3c8295,_0x546ef2){return __awaiter$1(this,void 0,void 0,function*(){const _0x51d065={'account_name':_0x5380eb,'list_name':_0x37af89,'contributor_name':_0x3c8295};try{const _0x28d207=yield this['fetch']['post'](this['path'],_0x546ef2,_0x51d065);if(_0x28d207['status']>0xc7&&_0x28d207['status']<0x12c){const _0x4a19b6=yield _0x28d207['json']();return new SuccessfulContributorResponse(_0x4a19b6);}const _0x3fd0b2=yield _0x28d207['json']();return new FailedContributorResponse(_0x3fd0b2);}catch(_0x39dda1){if(_0x39dda1 instanceof Error)return new FailedContributorResponse({'detail':_0x39dda1['message'],'title':_0x39dda1['name'],'status':0x1f4,'instance':'','type':''});throw _0x39dda1;}});}['remove'](_0x475c4e,_0x189dfc,_0x1c6a2e,_0x25ad13){return __awaiter$1(this,void 0,void 0,function*(){const _0x1038dc=this['path']+'/'+_0x475c4e+'/'+_0x189dfc+'/'+_0x1c6a2e,_0x189bd9=yield this['fetch']['delete'](_0x1038dc,_0x25ad13);try{if(_0x189bd9['status']>0xc7&&_0x189bd9['status']<0x12c)return new SuccessfulResponse({});const _0x57de2a=yield _0x189bd9['json']();return new FailedResponse(_0x57de2a);}catch(_0x28476f){if(_0x28476f instanceof Error)return new FailedResponse({'detail':_0x28476f['message'],'title':_0x28476f['name'],'status':0x1f4,'instance':'','type':''});throw _0x28476f;}});}['startsWith'](_0x133787,_0x545e0d){return __awaiter$1(this,void 0,void 0,function*(){const _0x3c5557=this['path']+'/'+_0x133787;try{const _0x6844f9=yield this['fetch']['get'](_0x3c5557,_0x545e0d);if(_0x6844f9['status']>0xc7&&_0x6844f9['status']<0x12c){const _0x51e88c=yield _0x6844f9['json']();return new SuccessfulAccountAndImageResponse(_0x51e88c);}const _0x485a76=yield _0x6844f9['json']();return new FailedAccountAndImageResponse(_0x485a76);}catch(_0x590e85){if(_0x590e85 instanceof Error)return new FailedAccountAndImageResponse({'detail':_0x590e85['message'],'title':_0x590e85['name'],'status':0x1f4,'instance':'','type':''});throw _0x590e85;}});}}
|
|
20
20
|
|
|
21
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
21
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x4687e1,_0x35769b,_0x158b8a,_0x12e546){function _0x29f9ba(_0x11c928){return _0x11c928 instanceof _0x158b8a?_0x11c928:new _0x158b8a(function(_0x25629e){_0x25629e(_0x11c928);});}return new(_0x158b8a||(_0x158b8a=Promise))(function(_0x12b927,_0x1e64dd){function _0x867d34(_0x1cb176){try{_0x4cfd8d(_0x12e546['next'](_0x1cb176));}catch(_0x28c61f){_0x1e64dd(_0x28c61f);}}function _0x24d0fd(_0x29c8f9){try{_0x4cfd8d(_0x12e546['throw'](_0x29c8f9));}catch(_0xa20749){_0x1e64dd(_0xa20749);}}function _0x4cfd8d(_0x297692){_0x297692['done']?_0x12b927(_0x297692['value']):_0x29f9ba(_0x297692['value'])['then'](_0x867d34,_0x24d0fd);}_0x4cfd8d((_0x12e546=_0x12e546['apply'](_0x4687e1,_0x35769b||[]))['next']());});};class AdminClient{constructor(_0x57e6f8='https://admin.searchability.dev/'){var _0x156729=new Fetch(_0x57e6f8);this['Accounts']=new AccountService(_0x156729),this['Lists']=new ListService(_0x156729),this['ApiKeys']=new ApiKeyService(_0x156729),this['SearchServers']=new SearchServersService(_0x156729),this['Facets']=new FacetService(_0x156729),this['SearchResults']=new SearchResultService(_0x156729),this['Contributors']=new ContributorService(_0x156729);}}class AuthClient{constructor(_0x552288='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x552288);}['login'](_0x2e42e7){return __awaiter(this,void 0,void 0,function*(){const _0x3f9b80='login/'+_0x2e42e7;try{const _0xa462a=yield yield fetch(_0x3f9b80);if(_0xa462a['status']>0xc7&&_0xa462a['status']<0x12c){const _0x54ba19=yield _0xa462a['json']();return new SuccessfulAuthResponse(_0x54ba19);}const _0xe4f9f9=yield _0xa462a['json']();return new FailedAuthResponse(_0xe4f9f9);}catch(_0x5d3db1){if(_0x5d3db1 instanceof Error)return new FailedAuthResponse({'detail':_0x5d3db1['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x5d3db1;}});}['refresh'](_0x215b13){return __awaiter(this,void 0,void 0,function*(){const _0x1e2ac2='refresh',_0x57a8df={'refresh_token':_0x215b13};try{const _0x4823df=yield this['fetch']['PostNoAuth'](_0x1e2ac2,_0x57a8df);if(_0x4823df['status']>0xc7&&_0x4823df['status']<0x12c){const _0x5201a3=yield _0x4823df['json']();return new SuccessfulAuthResponse(_0x5201a3);}const _0x59b52b=yield _0x4823df['json']();return new FailedAuthResponse(_0x59b52b);}catch(_0x574904){if(_0x574904 instanceof Error)return new FailedAuthResponse({'detail':_0x574904['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x574904;}});}['getTokenStatus'](_0x274c92){if(Date['now']()<_0x274c92['access_expires'])return exports.TokenStatus['Ok'];if(Date['now']()<_0x274c92['refresh_expires'])return exports.TokenStatus['Refresh'];return exports.TokenStatus['Expired'];}}
|
|
22
22
|
|
|
23
23
|
exports.AdminClient = AdminClient;
|
|
24
24
|
exports.AuthClient = AuthClient;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var TokenStatus;(function(
|
|
1
|
+
var TokenStatus;(function(_0x543b62){_0x543b62[_0x543b62['Ok']=0x0]='Ok',_0x543b62[_0x543b62['Refresh']=0x1]='Refresh',_0x543b62[_0x543b62['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(_0x317728){this['isSuccess']=_0x317728;}}class SuccessfulContributorResponse extends Response{constructor(_0x39a935){super(!![]),this['contributor']=_0x39a935;}['toSuccess'](){return this['contributor'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedContributorResponse extends Response{constructor(_0x3875ed){super(![]),this['problem']=_0x3875ed;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAccountAndImageResponse extends Response{constructor(_0x514695){super(!![]),this['accountAndImage']=_0x514695;}['toSuccess'](){return this['accountAndImage'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountAndImageResponse extends Response{constructor(_0x37fdf1){super(![]),this['problem']=_0x37fdf1;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulFacetResponse extends Response{constructor(_0x56b564){super(!![]),this['facet']=_0x56b564;}['toSuccess'](){return this['facet'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedFacetResponse extends Response{constructor(_0x2b742b){super(![]),this['problem']=_0x2b742b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAccountResponse extends Response{constructor(_0x541bf3){super(!![]),this['account']=_0x541bf3;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulAccountImageResponse extends Response{constructor(_0x97215f){super(!![]),this['accountImage']=_0x97215f;}['toSuccess'](){return this['accountImage'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x3f9d15){super(!![]),this['list']=_0x3f9d15;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListResponse extends Response{constructor(_0x45459b){super(!![]),this['list']=_0x45459b;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2b896f){super(![]),this['problem']=_0x2b896f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedAccountImageResponse extends Response{constructor(_0x1c650e){super(![]),this['problem']=_0x1c650e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x5928a5){super(![]),this['problem']=_0x5928a5;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListResponse extends Response{constructor(_0x59b341){super(![]),this['problem']=_0x59b341;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0x108722){super(!![]),this['tokens']=_0x108722;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x5c1b5d){super(![]),this['problem']=_0x5c1b5d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x32fca3){super(!![]),this['apiKey']=_0x32fca3;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x5dfbff){super(![]),this['problem']=_0x5dfbff;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x28e6fb){super(!![]),this['searchService']=_0x28e6fb;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x389514){super(![]),this['problem']=_0x389514;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x3fc61a){super(!![]),this['searchService']=_0x3fc61a;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulViewSearchResultResponse extends Response{constructor(_0x2103ab){super(!![]),this['searchResult']=_0x2103ab;}['toSuccess'](){return this['searchResult'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchResultResponse extends Response{constructor(_0xb37545){super(![]),this['problem']=_0xb37545;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0x7ff710){super(!![]),this['searchServices']=_0x7ff710;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x515583){super(![]),this['problem']=_0x515583;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x2398ab){super(![]),this['problem']=_0x2398ab;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x3afc33){super(!![]),this['apiKeyValue']=_0x3afc33;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x3ae17d){super(!![]),this['obj']=_0x3ae17d;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x4e0e15){super(![]),this['problem']=_0x4e0e15;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x11030e){super(![]),this['problem']=_0x11030e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
2
|
|
|
3
|
-
var __awaiter$8=undefined&&undefined['__awaiter']||function(
|
|
3
|
+
var __awaiter$8=undefined&&undefined['__awaiter']||function(_0x166460,_0x1689b6,_0xdc2810,_0x5d8d24){function _0x667d55(_0x1f1d03){return _0x1f1d03 instanceof _0xdc2810?_0x1f1d03:new _0xdc2810(function(_0x6e47f0){_0x6e47f0(_0x1f1d03);});}return new(_0xdc2810||(_0xdc2810=Promise))(function(_0xe66fe2,_0x12e28f){function _0xae188b(_0x3a36f9){try{_0x2e70ad(_0x5d8d24['next'](_0x3a36f9));}catch(_0x11bcdb){_0x12e28f(_0x11bcdb);}}function _0x3102cc(_0x3908a5){try{_0x2e70ad(_0x5d8d24['throw'](_0x3908a5));}catch(_0x5e4b89){_0x12e28f(_0x5e4b89);}}function _0x2e70ad(_0x3fa7cb){_0x3fa7cb['done']?_0xe66fe2(_0x3fa7cb['value']):_0x667d55(_0x3fa7cb['value'])['then'](_0xae188b,_0x3102cc);}_0x2e70ad((_0x5d8d24=_0x5d8d24['apply'](_0x166460,_0x1689b6||[]))['next']());});};class AccountService{constructor(_0x16defe){this['fetch']=_0x16defe;}['get'](_0x50dcf1,_0x3aa55a){return __awaiter$8(this,void 0,void 0,function*(){const _0x11286b='Account/'+_0x50dcf1+'/',_0x3afa17=yield this['fetch']['get'](_0x11286b,_0x3aa55a);try{if(_0x3afa17['status']>0xc7&&_0x3afa17['status']<0x12c){const _0x317874=yield _0x3afa17['json']();return new SuccessfulAccountResponse(_0x317874);}const _0x2b7645=yield _0x3afa17['json']();return new FailedAccountResponse(_0x2b7645);}catch(_0x5396f9){if(_0x5396f9 instanceof Error)return new FailedAccountResponse({'detail':_0x5396f9['message'],'title':_0x5396f9['name'],'status':0x1f4,'instance':'','type':''});throw _0x5396f9;}});}['getImage'](_0x3b0875,_0x803a6c){return __awaiter$8(this,void 0,void 0,function*(){const _0x34bf58='account/image/'+_0x3b0875+'/',_0x430d26=yield this['fetch']['get'](_0x34bf58,_0x803a6c);try{if(_0x430d26['status']>0xc7&&_0x430d26['status']<0x12c){const _0x420edd=yield _0x430d26['json']();return new SuccessfulAccountImageResponse(_0x420edd);}const _0x14ac6e=yield _0x430d26['json']();return new FailedAccountImageResponse(_0x14ac6e);}catch(_0x5b9e64){if(_0x5b9e64 instanceof Error)return new FailedAccountImageResponse({'detail':_0x5b9e64['message'],'title':_0x5b9e64['name'],'status':0x1f4,'instance':'','type':''});throw _0x5b9e64;}});}}
|
|
4
4
|
|
|
5
|
-
var __awaiter$7=undefined&&undefined['__awaiter']||function(
|
|
5
|
+
var __awaiter$7=undefined&&undefined['__awaiter']||function(_0x3d0718,_0x86488c,_0x2ea192,_0x374f56){function _0x5c7f0d(_0x1de161){return _0x1de161 instanceof _0x2ea192?_0x1de161:new _0x2ea192(function(_0x144fcd){_0x144fcd(_0x1de161);});}return new(_0x2ea192||(_0x2ea192=Promise))(function(_0x11c586,_0x293718){function _0x366acb(_0x164819){try{_0x30229e(_0x374f56['next'](_0x164819));}catch(_0x35bb2e){_0x293718(_0x35bb2e);}}function _0x46b79b(_0x4c52ba){try{_0x30229e(_0x374f56['throw'](_0x4c52ba));}catch(_0x3dd2d1){_0x293718(_0x3dd2d1);}}function _0x30229e(_0x307a31){_0x307a31['done']?_0x11c586(_0x307a31['value']):_0x5c7f0d(_0x307a31['value'])['then'](_0x366acb,_0x46b79b);}_0x30229e((_0x374f56=_0x374f56['apply'](_0x3d0718,_0x86488c||[]))['next']());});};class ApiKeyService{constructor(_0x4f7fc0){this['fetch']=_0x4f7fc0,this['path']='api-key';}['create'](_0x2d3257,_0x13642f,_0x2a96d5){return __awaiter$7(this,void 0,void 0,function*(){const _0x454606={'account_name':_0x2d3257,'api_key_name':_0x13642f};try{const _0x13d6c3=yield this['fetch']['post'](this['path'],_0x2a96d5,_0x454606);if(_0x13d6c3['status']>0xc7&&_0x13d6c3['status']<0x12c){const _0x448f41=yield _0x13d6c3['json']();return new SuccessfulApiKeyResponse(_0x448f41);}const _0x23af50=yield _0x13d6c3['json']();return new FailedApiKeyResponse(_0x23af50);}catch(_0x42c66d){if(_0x42c66d instanceof Error)return new FailedApiKeyResponse({'detail':_0x42c66d['message'],'title':_0x42c66d['name'],'status':0x1f4,'instance':'','type':''});throw _0x42c66d;}});}['view'](_0x1246d3,_0x388291,_0x172e0c){return __awaiter$7(this,void 0,void 0,function*(){const _0x2ae6cd=this['path']+'/'+_0x1246d3+'/'+_0x388291;try{const _0x567ca2=yield this['fetch']['get'](_0x2ae6cd,_0x172e0c);if(_0x567ca2['status']>0xc7&&_0x567ca2['status']<0x12c){const _0x2cc356=yield _0x567ca2['json']();return new SuccessfulApiKeyValueResponse(_0x2cc356);}const _0xaebe30=yield _0x567ca2['json']();return new FailedApiKeyValueResponse(_0xaebe30);}catch(_0xa9049e){if(_0xa9049e instanceof Error)return new FailedApiKeyValueResponse({'detail':_0xa9049e['message'],'title':_0xa9049e['name'],'status':0x1f4,'instance':'','type':''});throw _0xa9049e;}});}['delete'](_0x33489b,_0x4e0655,_0x1c93ad){return __awaiter$7(this,void 0,void 0,function*(){const _0x42ff8d=this['path']+'/'+_0x33489b+'/'+_0x4e0655;try{const _0x2b4d07=yield this['fetch']['delete'](_0x42ff8d,_0x1c93ad);if(_0x2b4d07['status']>0xc7&&_0x2b4d07['status']<0x12c)return new SuccessfulResponse({});const _0x4bd697=yield _0x2b4d07['json']();return new FailedResponse(_0x4bd697);}catch(_0x277c33){if(_0x277c33 instanceof Error)return new FailedResponse({'detail':_0x277c33['message'],'title':_0x277c33['name'],'status':0x1f4,'instance':'','type':''});throw _0x277c33;}});}}
|
|
6
6
|
|
|
7
|
-
var __awaiter$6=undefined&&undefined['__awaiter']||function(
|
|
7
|
+
var __awaiter$6=undefined&&undefined['__awaiter']||function(_0x1d38da,_0x3c51d7,_0x53ec56,_0x34d490){function _0x1771d9(_0x4a3d6c){return _0x4a3d6c instanceof _0x53ec56?_0x4a3d6c:new _0x53ec56(function(_0x597b09){_0x597b09(_0x4a3d6c);});}return new(_0x53ec56||(_0x53ec56=Promise))(function(_0x245e98,_0xf18e8d){function _0x11a46d(_0xa9302e){try{_0x535318(_0x34d490['next'](_0xa9302e));}catch(_0x28887e){_0xf18e8d(_0x28887e);}}function _0x2aabbb(_0x2408d7){try{_0x535318(_0x34d490['throw'](_0x2408d7));}catch(_0x2974a9){_0xf18e8d(_0x2974a9);}}function _0x535318(_0x408f22){_0x408f22['done']?_0x245e98(_0x408f22['value']):_0x1771d9(_0x408f22['value'])['then'](_0x11a46d,_0x2aabbb);}_0x535318((_0x34d490=_0x34d490['apply'](_0x1d38da,_0x3c51d7||[]))['next']());});};class ListService{constructor(_0x5e81bf){this['fetch']=_0x5e81bf;}['create'](_0x1cb13f,_0x41d231,_0x3fe902,_0x2954db){return __awaiter$6(this,void 0,void 0,function*(){const _0x838411='List',_0x4e33b={'account_name':_0x1cb13f,'list_name':_0x41d231,'search_service_name':_0x3fe902};try{const _0x9a5f1d=yield this['fetch']['post'](_0x838411,_0x2954db,_0x4e33b);if(_0x9a5f1d['status']>0xc7&&_0x9a5f1d['status']<0x12c){const _0x20b37d=yield _0x9a5f1d['json']();return new SuccessfulListIdentityResponse(_0x20b37d);}const _0x293313=yield _0x9a5f1d['json']();return new FailedListIdentityResponse(_0x293313);}catch(_0x1953db){if(_0x1953db instanceof Error)return new FailedListIdentityResponse({'detail':_0x1953db['message'],'title':_0x1953db['name'],'status':0x1f4,'instance':'','type':''});throw _0x1953db;}});}['delete'](_0x1ab649,_0xc21f9d,_0x77b6b6){return __awaiter$6(this,void 0,void 0,function*(){const _0x6b52cf='List/'+_0x1ab649+'/'+_0xc21f9d,_0x1a7bfe=yield this['fetch']['delete'](_0x6b52cf,_0x77b6b6);try{if(_0x1a7bfe['status']>0xc7&&_0x1a7bfe['status']<0x12c)return new SuccessfulResponse({});const _0x551c3a=yield _0x1a7bfe['json']();return new FailedResponse(_0x551c3a);}catch(_0x2bdbb7){if(_0x2bdbb7 instanceof Error)return new FailedResponse({'detail':_0x2bdbb7['message'],'title':_0x2bdbb7['name'],'status':0x1f4,'instance':'','type':''});throw _0x2bdbb7;}});}['get'](_0x48e82b,_0x460e04,_0x258b59){return __awaiter$6(this,void 0,void 0,function*(){const _0x311d04='List/'+_0x48e82b+'/'+_0x460e04;try{const _0x3aa979=yield this['fetch']['get'](_0x311d04,_0x258b59);if(_0x3aa979['status']>0xc7&&_0x3aa979['status']<0x12c){const _0x4b23f1=yield _0x3aa979['json']();return new SuccessfulListResponse(_0x4b23f1);}const _0xe1ca5a=yield _0x3aa979['json']();return new FailedListResponse(_0xe1ca5a);}catch(_0x4f3c34){if(_0x4f3c34 instanceof Error)return new FailedListResponse({'detail':_0x4f3c34['message'],'title':_0x4f3c34['name'],'status':0x1f4,'instance':'','type':''});throw _0x4f3c34;}});}}
|
|
8
8
|
|
|
9
|
-
var __awaiter$5=undefined&&undefined['__awaiter']||function(
|
|
9
|
+
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x3b693e,_0x5cf701,_0x50612c,_0x3614a5){function _0xff428(_0x49448c){return _0x49448c instanceof _0x50612c?_0x49448c:new _0x50612c(function(_0x481e00){_0x481e00(_0x49448c);});}return new(_0x50612c||(_0x50612c=Promise))(function(_0x2f751e,_0x2f3a73){function _0x1e5e75(_0x5c40df){try{_0x55c55c(_0x3614a5['next'](_0x5c40df));}catch(_0x9fb210){_0x2f3a73(_0x9fb210);}}function _0x215fac(_0x5bd125){try{_0x55c55c(_0x3614a5['throw'](_0x5bd125));}catch(_0x3c1627){_0x2f3a73(_0x3c1627);}}function _0x55c55c(_0x3210a0){_0x3210a0['done']?_0x2f751e(_0x3210a0['value']):_0xff428(_0x3210a0['value'])['then'](_0x1e5e75,_0x215fac);}_0x55c55c((_0x3614a5=_0x3614a5['apply'](_0x3b693e,_0x5cf701||[]))['next']());});};class Fetch{constructor(_0x438d24){this['baseUri']=_0x438d24,this['getUrl']=_0x54ec76=>{return _0x54ec76['startsWith']('/')&&(_0x54ec76=_0x54ec76['replace']('/','')),''+this['baseUri']+_0x54ec76;},!_0x438d24['endsWith']('/')&&(_0x438d24=_0x438d24+'/');}['get'](_0x470583,_0x539f1d){return __awaiter$5(this,void 0,void 0,function*(){const _0x3619f6=this['getUrl'](_0x470583);return yield fetch(_0x3619f6,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x539f1d}});});}['post'](_0x2e2bbb,_0x16644a,_0x3e2b44){return __awaiter$5(this,void 0,void 0,function*(){const _0x511ab4=this['getUrl'](_0x2e2bbb);return yield fetch(_0x511ab4,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x16644a},'body':_0x3e2b44?JSON['stringify'](_0x3e2b44):null});});}['PostNoAuth'](_0x35fd3e,_0x5803df){return __awaiter$5(this,void 0,void 0,function*(){const _0x2c3125=this['getUrl'](_0x35fd3e);return yield fetch(_0x2c3125,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x5803df?JSON['stringify'](_0x5803df):null});});}['put'](_0x1f5b7f,_0xaf8b49,_0x268197){return __awaiter$5(this,void 0,void 0,function*(){const _0x35e0fb=this['getUrl'](_0x1f5b7f);return yield fetch(_0x35e0fb,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xaf8b49},'body':_0x268197?JSON['stringify'](_0x268197):null});});}['delete'](_0x3499b8,_0x258980){return __awaiter$5(this,void 0,void 0,function*(){const _0x5662da=this['getUrl'](_0x3499b8);return yield fetch(_0x5662da,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x258980}});});}}
|
|
10
10
|
|
|
11
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(
|
|
11
|
+
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x31eef5,_0xbc152f,_0x52438e,_0x565908){function _0x29abd4(_0x55d17e){return _0x55d17e instanceof _0x52438e?_0x55d17e:new _0x52438e(function(_0xe36c2a){_0xe36c2a(_0x55d17e);});}return new(_0x52438e||(_0x52438e=Promise))(function(_0x416308,_0x10c6aa){function _0x218074(_0x1eacc1){try{_0x60e7dc(_0x565908['next'](_0x1eacc1));}catch(_0x2b06a9){_0x10c6aa(_0x2b06a9);}}function _0xb9e1f5(_0x388136){try{_0x60e7dc(_0x565908['throw'](_0x388136));}catch(_0x9ad836){_0x10c6aa(_0x9ad836);}}function _0x60e7dc(_0x5c6a02){_0x5c6a02['done']?_0x416308(_0x5c6a02['value']):_0x29abd4(_0x5c6a02['value'])['then'](_0x218074,_0xb9e1f5);}_0x60e7dc((_0x565908=_0x565908['apply'](_0x31eef5,_0xbc152f||[]))['next']());});};class SearchServersService{constructor(_0x5d204f){this['fetch']=_0x5d204f,this['path']='search-services';}['create'](_0x28e043,_0x18204,_0x43df63,_0x47e718,_0x241a82,_0x47e4dd,_0x17d644,_0x4bc15a){return __awaiter$4(this,void 0,void 0,function*(){const _0x269b1e={'account_name':_0x28e043,'search_service_name':_0x18204,'endpoint':_0x43df63,'key':_0x47e718,'country':_0x241a82,'provider':_0x47e4dd,'index_name':_0x17d644};try{const _0x2e9d74=yield this['fetch']['post'](this['path'],_0x4bc15a,_0x269b1e);if(_0x2e9d74['status']>0xc7&&_0x2e9d74['status']<0x12c){const _0x4ead25=yield _0x2e9d74['json']();return new SuccessfulSearchServiceResponse(_0x4ead25);}const _0x3e73b5=yield _0x2e9d74['json']();return new FailedSearchServiceResponse(_0x3e73b5);}catch(_0x32294e){if(_0x32294e instanceof Error)return new FailedSearchServiceResponse({'detail':_0x32294e['message'],'title':_0x32294e['name'],'status':0x1f4,'instance':'','type':''});throw _0x32294e;}});}['delete'](_0xfba219,_0x8078a,_0x2182db){return __awaiter$4(this,void 0,void 0,function*(){const _0x33ecc2=this['path']+'/'+_0xfba219+'/'+_0x8078a;try{const _0x1a3bd1=yield this['fetch']['delete'](_0x33ecc2,_0x2182db);if(_0x1a3bd1['status']>0xc7&&_0x1a3bd1['status']<0x12c)return new SuccessfulResponse({});const _0xb66617=yield _0x1a3bd1['json']();return new FailedResponse(_0xb66617);}catch(_0x57de29){if(_0x57de29 instanceof Error)return new FailedResponse({'detail':_0x57de29['message'],'title':_0x57de29['name'],'status':0x1f4,'instance':'','type':''});throw _0x57de29;}});}['view'](_0xb10510,_0x33ec48,_0x17cbcd){return __awaiter$4(this,void 0,void 0,function*(){const _0x1e5870=this['path']+'/'+_0xb10510+'/'+_0x33ec48;try{const _0x46624f=yield this['fetch']['get'](_0x1e5870,_0x17cbcd);if(_0x46624f['status']>0xc7&&_0x46624f['status']<0x12c){const _0x166141=yield _0x46624f['json']();return new SuccessfulViewSearchServiceResponse(_0x166141);}const _0x675de2=yield _0x46624f['json']();return new FailedViewSearchServiceResponse(_0x675de2);}catch(_0x44f244){if(_0x44f244 instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x44f244['message'],'title':_0x44f244['name'],'status':0x1f4,'instance':'','type':''});throw _0x44f244;}});}['edit'](_0x17b0f4,_0x29b75b,_0x34c3f4,_0x4e487e,_0x5c49bc,_0x5c7890){return __awaiter$4(this,void 0,void 0,function*(){const _0x50620e={'account_name':_0x17b0f4,'search_service_name':_0x29b75b,'new_search_service_name':_0x34c3f4,'key':_0x4e487e,'country':_0x5c49bc};try{const _0x5aef1c=yield this['fetch']['put'](this['path'],_0x5c7890,_0x50620e);if(_0x5aef1c['status']>0xc7&&_0x5aef1c['status']<0x12c){const _0x41bd84=yield _0x5aef1c['json']();return new SuccessfulSearchServiceResponse(_0x41bd84);}const _0x60c9f9=yield _0x5aef1c['json']();return new FailedSearchServiceResponse(_0x60c9f9);}catch(_0x15347b){if(_0x15347b instanceof Error)return new FailedSearchServiceResponse({'detail':_0x15347b['message'],'title':_0x15347b['name'],'status':0x1f4,'instance':'','type':''});throw _0x15347b;}});}['list'](_0x1d71fc,_0x1db337){return __awaiter$4(this,void 0,void 0,function*(){const _0x3f9e46=this['path']+'/'+_0x1d71fc;try{const _0x3667fa=yield this['fetch']['get'](_0x3f9e46,_0x1db337);if(_0x3667fa['status']>0xc7&&_0x3667fa['status']<0x12c){const _0x27b3d7=yield _0x3667fa['json']();return new SuccessfulListSearchServiceResponse(_0x27b3d7);}const _0x22adfd=yield _0x3667fa['json']();return new FailedViewSearchServicesResponse(_0x22adfd);}catch(_0x53579f){if(_0x53579f instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x53579f['message'],'title':_0x53579f['name'],'status':0x1f4,'instance':'','type':''});throw _0x53579f;}});}}
|
|
12
12
|
|
|
13
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(
|
|
13
|
+
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x389644,_0x2a1b4b,_0x4b9ab2,_0x875852){function _0x4edf38(_0xce4268){return _0xce4268 instanceof _0x4b9ab2?_0xce4268:new _0x4b9ab2(function(_0x2c6ce6){_0x2c6ce6(_0xce4268);});}return new(_0x4b9ab2||(_0x4b9ab2=Promise))(function(_0x3822dd,_0x5ce80a){function _0xd9ee67(_0x51c434){try{_0x245e4b(_0x875852['next'](_0x51c434));}catch(_0x2aa25b){_0x5ce80a(_0x2aa25b);}}function _0x1f670c(_0x4d9cec){try{_0x245e4b(_0x875852['throw'](_0x4d9cec));}catch(_0x29c185){_0x5ce80a(_0x29c185);}}function _0x245e4b(_0x1cf36b){_0x1cf36b['done']?_0x3822dd(_0x1cf36b['value']):_0x4edf38(_0x1cf36b['value'])['then'](_0xd9ee67,_0x1f670c);}_0x245e4b((_0x875852=_0x875852['apply'](_0x389644,_0x2a1b4b||[]))['next']());});};class FacetService{constructor(_0x5691ee){this['fetch']=_0x5691ee,this['path']='facet';}['create'](_0x3693d1,_0x2bddda,_0xf5311,_0x17ebaa){return __awaiter$3(this,void 0,void 0,function*(){const _0x41bdf9={'account_name':_0x3693d1,'list_name':_0x2bddda,'facet_name':_0xf5311};try{const _0x1112b7=yield this['fetch']['post'](this['path'],_0x17ebaa,_0x41bdf9);if(_0x1112b7['status']>0xc7&&_0x1112b7['status']<0x12c){const _0x116e6a=yield _0x1112b7['json']();return new SuccessfulFacetResponse(_0x116e6a);}const _0x57afba=yield _0x1112b7['json']();return new FailedFacetResponse(_0x57afba);}catch(_0x4a3281){if(_0x4a3281 instanceof Error)return new FailedFacetResponse({'detail':_0x4a3281['message'],'title':_0x4a3281['name'],'status':0x1f4,'instance':'','type':''});throw _0x4a3281;}});}['remove'](_0x2cf2b5,_0x248737,_0x5dc34a,_0x1bdd5b){return __awaiter$3(this,void 0,void 0,function*(){const _0x14935f='Facet/'+_0x2cf2b5+'/'+_0x248737+'/'+_0x5dc34a,_0x8b5c42=yield this['fetch']['delete'](_0x14935f,_0x1bdd5b);try{if(_0x8b5c42['status']>0xc7&&_0x8b5c42['status']<0x12c)return new SuccessfulResponse({});const _0x3a2096=yield _0x8b5c42['json']();return new FailedResponse(_0x3a2096);}catch(_0x648807){if(_0x648807 instanceof Error)return new FailedResponse({'detail':_0x648807['message'],'title':_0x648807['name'],'status':0x1f4,'instance':'','type':''});throw _0x648807;}});}['rename'](_0x50fcca,_0x2780a3,_0x23a5aa,_0x4ce2f4,_0x3a6f99){return __awaiter$3(this,void 0,void 0,function*(){const _0x49d45c={'account_name':_0x50fcca,'list_name':_0x2780a3,'facet_name':_0x23a5aa,'new_facet_name':_0x4ce2f4};try{const _0x398055=yield this['fetch']['put'](this['path'],_0x3a6f99,_0x49d45c);if(_0x398055['status']>0xc7&&_0x398055['status']<0x12c){const _0x529f7f=yield _0x398055['json']();return new SuccessfulFacetResponse(_0x529f7f);}const _0x35306d=yield _0x398055['json']();return new FailedFacetResponse(_0x35306d);}catch(_0x276876){if(_0x276876 instanceof Error)return new FailedFacetResponse({'detail':_0x276876['message'],'title':_0x276876['name'],'status':0x1f4,'instance':'','type':''});throw _0x276876;}});}}
|
|
14
14
|
|
|
15
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(
|
|
15
|
+
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x167d90,_0x4c98ac,_0x250e7a,_0x22bcbf){function _0x41202b(_0x3ac097){return _0x3ac097 instanceof _0x250e7a?_0x3ac097:new _0x250e7a(function(_0x181b08){_0x181b08(_0x3ac097);});}return new(_0x250e7a||(_0x250e7a=Promise))(function(_0x450fa6,_0xbc774c){function _0x3130ae(_0x2e391e){try{_0x5f291d(_0x22bcbf['next'](_0x2e391e));}catch(_0x14850d){_0xbc774c(_0x14850d);}}function _0x556f45(_0x9ccd74){try{_0x5f291d(_0x22bcbf['throw'](_0x9ccd74));}catch(_0x1f79d7){_0xbc774c(_0x1f79d7);}}function _0x5f291d(_0x1a0ec5){_0x1a0ec5['done']?_0x450fa6(_0x1a0ec5['value']):_0x41202b(_0x1a0ec5['value'])['then'](_0x3130ae,_0x556f45);}_0x5f291d((_0x22bcbf=_0x22bcbf['apply'](_0x167d90,_0x4c98ac||[]))['next']());});};class SearchResultService{constructor(_0xdc09df){this['fetch']=_0xdc09df,this['path']='search-result';}['create'](_0x3ef00c,_0x171b85,_0x509e24,_0x14b1da,_0x3a80e2){return __awaiter$2(this,void 0,void 0,function*(){_0x3a80e2=_0x3a80e2!==null&&_0x3a80e2!==void 0?_0x3a80e2:{'description':'','keywords':'','resource_1':'','resource_2':'','resource_3':'','latitude':0x0,'longitude':0x0,'facets':[]};const _0x35fe3d=Object['assign']({'account_name':_0x3ef00c,'search_result_name':_0x509e24,'list_name':_0x171b85},_0x3a80e2);try{const _0x50370b=yield this['fetch']['post'](this['path'],_0x14b1da,_0x35fe3d);if(_0x50370b['status']>0xc7&&_0x50370b['status']<0x12c){const _0x2525bc=yield _0x50370b['json']();return new SuccessfulViewSearchResultResponse(_0x2525bc);}const _0x56a4c9=yield _0x50370b['json']();return new FailedSearchResultResponse(_0x56a4c9);}catch(_0xe1f775){if(_0xe1f775 instanceof Error)return new FailedSearchResultResponse({'detail':_0xe1f775['message'],'title':_0xe1f775['name'],'status':0x1f4,'instance':'','type':''});throw _0xe1f775;}});}}
|
|
16
16
|
|
|
17
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(
|
|
17
|
+
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x47f11c,_0xe1aa84,_0x2521ad,_0x1ea4f6){function _0x20ee4f(_0x2e851c){return _0x2e851c instanceof _0x2521ad?_0x2e851c:new _0x2521ad(function(_0xc5f4b8){_0xc5f4b8(_0x2e851c);});}return new(_0x2521ad||(_0x2521ad=Promise))(function(_0x48c96b,_0x5ec86e){function _0x93364f(_0x3bb4b1){try{_0x3861c9(_0x1ea4f6['next'](_0x3bb4b1));}catch(_0x1af5e5){_0x5ec86e(_0x1af5e5);}}function _0x5f0c37(_0x18dfcd){try{_0x3861c9(_0x1ea4f6['throw'](_0x18dfcd));}catch(_0x4e210b){_0x5ec86e(_0x4e210b);}}function _0x3861c9(_0x39d95b){_0x39d95b['done']?_0x48c96b(_0x39d95b['value']):_0x20ee4f(_0x39d95b['value'])['then'](_0x93364f,_0x5f0c37);}_0x3861c9((_0x1ea4f6=_0x1ea4f6['apply'](_0x47f11c,_0xe1aa84||[]))['next']());});};class ContributorService{constructor(_0x39b920){this['fetch']=_0x39b920,this['path']='contributor';}['create'](_0x14fb25,_0xfbec17,_0x213c9f,_0x17ccd8){return __awaiter$1(this,void 0,void 0,function*(){const _0x58f331={'account_name':_0x14fb25,'list_name':_0xfbec17,'contributor_name':_0x213c9f};try{const _0x551d8e=yield this['fetch']['post'](this['path'],_0x17ccd8,_0x58f331);if(_0x551d8e['status']>0xc7&&_0x551d8e['status']<0x12c){const _0x29077c=yield _0x551d8e['json']();return new SuccessfulContributorResponse(_0x29077c);}const _0x1b50f1=yield _0x551d8e['json']();return new FailedContributorResponse(_0x1b50f1);}catch(_0x266e90){if(_0x266e90 instanceof Error)return new FailedContributorResponse({'detail':_0x266e90['message'],'title':_0x266e90['name'],'status':0x1f4,'instance':'','type':''});throw _0x266e90;}});}['remove'](_0x21ffea,_0x45fbe3,_0x5d598d,_0x6542ee){return __awaiter$1(this,void 0,void 0,function*(){const _0x42850f=this['path']+'/'+_0x21ffea+'/'+_0x45fbe3+'/'+_0x5d598d,_0x355c15=yield this['fetch']['delete'](_0x42850f,_0x6542ee);try{if(_0x355c15['status']>0xc7&&_0x355c15['status']<0x12c)return new SuccessfulResponse({});const _0x275c94=yield _0x355c15['json']();return new FailedResponse(_0x275c94);}catch(_0x5c9c43){if(_0x5c9c43 instanceof Error)return new FailedResponse({'detail':_0x5c9c43['message'],'title':_0x5c9c43['name'],'status':0x1f4,'instance':'','type':''});throw _0x5c9c43;}});}['startsWith'](_0x183194,_0x235233){return __awaiter$1(this,void 0,void 0,function*(){const _0x24ec55=this['path']+'/'+_0x183194;try{const _0x214e2b=yield this['fetch']['get'](_0x24ec55,_0x235233);if(_0x214e2b['status']>0xc7&&_0x214e2b['status']<0x12c){const _0x50e2cf=yield _0x214e2b['json']();return new SuccessfulAccountAndImageResponse(_0x50e2cf);}const _0x5a86f9=yield _0x214e2b['json']();return new FailedAccountAndImageResponse(_0x5a86f9);}catch(_0x5d22ee){if(_0x5d22ee instanceof Error)return new FailedAccountAndImageResponse({'detail':_0x5d22ee['message'],'title':_0x5d22ee['name'],'status':0x1f4,'instance':'','type':''});throw _0x5d22ee;}});}}
|
|
18
18
|
|
|
19
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(
|
|
19
|
+
var __awaiter=undefined&&undefined['__awaiter']||function(_0x49bada,_0x35ed6f,_0x19b0ea,_0x4f76d4){function _0x595893(_0x47ed4b){return _0x47ed4b instanceof _0x19b0ea?_0x47ed4b:new _0x19b0ea(function(_0x41e847){_0x41e847(_0x47ed4b);});}return new(_0x19b0ea||(_0x19b0ea=Promise))(function(_0x3b0723,_0x5c6a23){function _0x54a343(_0x4c82e8){try{_0x34d9cb(_0x4f76d4['next'](_0x4c82e8));}catch(_0x13f012){_0x5c6a23(_0x13f012);}}function _0xe9f4f(_0x4a8919){try{_0x34d9cb(_0x4f76d4['throw'](_0x4a8919));}catch(_0x4bf40e){_0x5c6a23(_0x4bf40e);}}function _0x34d9cb(_0x3818a2){_0x3818a2['done']?_0x3b0723(_0x3818a2['value']):_0x595893(_0x3818a2['value'])['then'](_0x54a343,_0xe9f4f);}_0x34d9cb((_0x4f76d4=_0x4f76d4['apply'](_0x49bada,_0x35ed6f||[]))['next']());});};class AdminClient{constructor(_0x30eb1d='https://admin.searchability.dev/'){var _0x4e041d=new Fetch(_0x30eb1d);this['Accounts']=new AccountService(_0x4e041d),this['Lists']=new ListService(_0x4e041d),this['ApiKeys']=new ApiKeyService(_0x4e041d),this['SearchServers']=new SearchServersService(_0x4e041d),this['Facets']=new FacetService(_0x4e041d),this['SearchResults']=new SearchResultService(_0x4e041d),this['Contributors']=new ContributorService(_0x4e041d);}}class AuthClient{constructor(_0x2f607b='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x2f607b);}['login'](_0x4d6d5f){return __awaiter(this,void 0,void 0,function*(){const _0x6873ce='login/'+_0x4d6d5f;try{const _0x5ef9ea=yield yield fetch(_0x6873ce);if(_0x5ef9ea['status']>0xc7&&_0x5ef9ea['status']<0x12c){const _0x12fd3f=yield _0x5ef9ea['json']();return new SuccessfulAuthResponse(_0x12fd3f);}const _0x7f5d03=yield _0x5ef9ea['json']();return new FailedAuthResponse(_0x7f5d03);}catch(_0x372e38){if(_0x372e38 instanceof Error)return new FailedAuthResponse({'detail':_0x372e38['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x372e38;}});}['refresh'](_0x141a0c){return __awaiter(this,void 0,void 0,function*(){const _0x2a5d0a='refresh',_0xb6420a={'refresh_token':_0x141a0c};try{const _0x46a248=yield this['fetch']['PostNoAuth'](_0x2a5d0a,_0xb6420a);if(_0x46a248['status']>0xc7&&_0x46a248['status']<0x12c){const _0x58d7aa=yield _0x46a248['json']();return new SuccessfulAuthResponse(_0x58d7aa);}const _0x7086dd=yield _0x46a248['json']();return new FailedAuthResponse(_0x7086dd);}catch(_0x465e82){if(_0x465e82 instanceof Error)return new FailedAuthResponse({'detail':_0x465e82['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x465e82;}});}['getTokenStatus'](_0x59450c){if(Date['now']()<_0x59450c['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0x59450c['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
20
20
|
|
|
21
21
|
export { AdminClient, AuthClient, TokenStatus, Tokens };
|
package/dist/types.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ declare class ContributorService {
|
|
|
66
66
|
constructor(fetch: Fetch);
|
|
67
67
|
create(account_name: string, list_name: string, contributor_name: string, access_token: string): Promise<Response<Contributor, Problem>>;
|
|
68
68
|
remove(account_name: string, list_name: string, contributor_name: string, access_token: string): Promise<Response<any, Problem>>;
|
|
69
|
+
startsWith(account_name: string, access_token: string): Promise<Response<AccountAndImage, Problem>>;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
declare class AdminClient {
|
|
@@ -164,6 +165,10 @@ type Problem = {
|
|
|
164
165
|
instance: string;
|
|
165
166
|
detail: string;
|
|
166
167
|
};
|
|
168
|
+
type AccountAndImage = {
|
|
169
|
+
account_name: string;
|
|
170
|
+
image_path: string;
|
|
171
|
+
};
|
|
167
172
|
type Account = {
|
|
168
173
|
name: string;
|
|
169
174
|
owner: string;
|
|
@@ -203,6 +208,18 @@ declare class FailedContributorResponse extends Response<Contributor, Problem> {
|
|
|
203
208
|
toSuccess(): Contributor;
|
|
204
209
|
toProblem(): Problem;
|
|
205
210
|
}
|
|
211
|
+
declare class SuccessfulAccountAndImageResponse extends Response<AccountAndImage, Problem> {
|
|
212
|
+
readonly accountAndImage: AccountAndImage;
|
|
213
|
+
constructor(accountAndImage: AccountAndImage);
|
|
214
|
+
toSuccess(): AccountAndImage;
|
|
215
|
+
toProblem(): Problem;
|
|
216
|
+
}
|
|
217
|
+
declare class FailedAccountAndImageResponse extends Response<AccountAndImage, Problem> {
|
|
218
|
+
readonly problem: Problem;
|
|
219
|
+
constructor(problem: Problem);
|
|
220
|
+
toSuccess(): AccountAndImage;
|
|
221
|
+
toProblem(): Problem;
|
|
222
|
+
}
|
|
206
223
|
declare class SuccessfulFacetResponse extends Response<Facet, Problem> {
|
|
207
224
|
readonly facet: Facet;
|
|
208
225
|
constructor(facet: Facet);
|
|
@@ -360,4 +377,4 @@ declare class FailedApiKeyValueResponse extends Response<ApiKeyValue, Problem> {
|
|
|
360
377
|
toProblem(): Problem;
|
|
361
378
|
}
|
|
362
379
|
|
|
363
|
-
export { type Account, type AccountImage, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Contributor, type CreateSearchResultOptions, type Error, type Facet, FailedAccountImageResponse, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, FailedContributorResponse, FailedFacetResponse, FailedListIdentityResponse, FailedListResponse, FailedResponse, FailedSearchResultResponse, FailedSearchServiceResponse, FailedViewSearchServiceResponse, FailedViewSearchServicesResponse, type List, type ListIdentity, type NameAndValue, type Problem, type RefreshRequest, Response, type SearchResult, type SearchService, type SearchServiceDetails, SuccessfulAccountImageResponse, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, SuccessfulContributorResponse, SuccessfulFacetResponse, SuccessfulListIdentityResponse, SuccessfulListResponse, SuccessfulListSearchServiceResponse, SuccessfulResponse, SuccessfulSearchServiceResponse, SuccessfulViewSearchResultResponse, SuccessfulViewSearchServiceResponse, TokenStatus, Tokens };
|
|
380
|
+
export { type Account, type AccountAndImage, type AccountImage, AdminClient, type ApiKey, type ApiKeyValue, AuthClient, type Contributor, type CreateSearchResultOptions, type Error, type Facet, FailedAccountAndImageResponse, FailedAccountImageResponse, FailedAccountResponse, FailedApiKeyResponse, FailedApiKeyValueResponse, FailedAuthResponse, FailedContributorResponse, FailedFacetResponse, FailedListIdentityResponse, FailedListResponse, FailedResponse, FailedSearchResultResponse, FailedSearchServiceResponse, FailedViewSearchServiceResponse, FailedViewSearchServicesResponse, type List, type ListIdentity, type NameAndValue, type Problem, type RefreshRequest, Response, type SearchResult, type SearchService, type SearchServiceDetails, SuccessfulAccountAndImageResponse, SuccessfulAccountImageResponse, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulApiKeyValueResponse, SuccessfulAuthResponse, SuccessfulContributorResponse, SuccessfulFacetResponse, SuccessfulListIdentityResponse, SuccessfulListResponse, SuccessfulListSearchServiceResponse, SuccessfulResponse, SuccessfulSearchServiceResponse, SuccessfulViewSearchResultResponse, SuccessfulViewSearchServiceResponse, TokenStatus, Tokens };
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var TokenStatus;(function(_0x1c2b7b){_0x1c2b7b[_0x1c2b7b['Ok']=0x0]='Ok',_0x1c2b7b[_0x1c2b7b['Refresh']=0x1]='Refresh',_0x1c2b7b[_0x1c2b7b['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(_0x5c5b36){this['isSuccess']=_0x5c5b36;}}class SuccessfulContributorResponse extends Response{constructor(_0x23e3bd){super(!![]),this['contributor']=_0x23e3bd;}['toSuccess'](){return this['contributor'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedContributorResponse extends Response{constructor(_0x39d595){super(![]),this['problem']=_0x39d595;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulFacetResponse extends Response{constructor(_0x3348a1){super(!![]),this['facet']=_0x3348a1;}['toSuccess'](){return this['facet'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedFacetResponse extends Response{constructor(_0x28a766){super(![]),this['problem']=_0x28a766;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAccountResponse extends Response{constructor(_0x2bd1a4){super(!![]),this['account']=_0x2bd1a4;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulAccountImageResponse extends Response{constructor(_0x3b0a69){super(!![]),this['accountImage']=_0x3b0a69;}['toSuccess'](){return this['accountImage'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListIdentityResponse extends Response{constructor(_0x1046df){super(!![]),this['list']=_0x1046df;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulListResponse extends Response{constructor(_0x2bfc84){super(!![]),this['list']=_0x2bfc84;}['toSuccess'](){return this['list'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1d1544){super(![]),this['problem']=_0x1d1544;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedAccountImageResponse extends Response{constructor(_0x17289f){super(![]),this['problem']=_0x17289f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListIdentityResponse extends Response{constructor(_0x243c0d){super(![]),this['problem']=_0x243c0d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedListResponse extends Response{constructor(_0x2a180c){super(![]),this['problem']=_0x2a180c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulAuthResponse extends Response{constructor(_0xb4ceff){super(!![]),this['tokens']=_0xb4ceff;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAuthResponse extends Response{constructor(_0x468436){super(![]),this['problem']=_0x468436;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x470157){super(!![]),this['apiKey']=_0x470157;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0xdccd9f){super(![]),this['problem']=_0xdccd9f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulSearchServiceResponse extends Response{constructor(_0x3ebe5e){super(!![]),this['searchService']=_0x3ebe5e;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchServiceResponse extends Response{constructor(_0x2ba28c){super(![]),this['problem']=_0x2ba28c;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulViewSearchServiceResponse extends Response{constructor(_0x2e7c0b){super(!![]),this['searchService']=_0x2e7c0b;}['toSuccess'](){return this['searchService'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulViewSearchResultResponse extends Response{constructor(_0x368bda){super(!![]),this['searchResult']=_0x368bda;}['toSuccess'](){return this['searchResult'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedSearchResultResponse extends Response{constructor(_0x2b3025){super(![]),this['problem']=_0x2b3025;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulListSearchServiceResponse extends Response{constructor(_0x23450b){super(!![]),this['searchServices']=_0x23450b;}['toSuccess'](){return this['searchServices'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedViewSearchServicesResponse extends Response{constructor(_0x42ed89){super(![]),this['problem']=_0x42ed89;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedViewSearchServiceResponse extends Response{constructor(_0x3e6bd5){super(![]),this['problem']=_0x3e6bd5;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyValueResponse extends Response{constructor(_0x232746){super(!![]),this['apiKeyValue']=_0x232746;}['toSuccess'](){return this['apiKeyValue'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class SuccessfulResponse extends Response{constructor(_0x4d49f8){super(!![]),this['obj']=_0x4d49f8;}['toSuccess'](){return this['obj'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedResponse extends Response{constructor(_0x4d9f14){super(![]),this['problem']=_0x4d9f14;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class FailedApiKeyValueResponse extends Response{constructor(_0x12ee9e){super(![]),this['problem']=_0x12ee9e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
|
|
2
|
-
|
|
3
|
-
var __awaiter$8=undefined&&undefined['__awaiter']||function(_0xc49c0,_0x4edc21,_0x5e7ba5,_0x5be946){function _0x3e2f43(_0x299085){return _0x299085 instanceof _0x5e7ba5?_0x299085:new _0x5e7ba5(function(_0x419037){_0x419037(_0x299085);});}return new(_0x5e7ba5||(_0x5e7ba5=Promise))(function(_0x2b8b2d,_0x3685b4){function _0x957896(_0x4a2dac){try{_0x469e42(_0x5be946['next'](_0x4a2dac));}catch(_0x19ef88){_0x3685b4(_0x19ef88);}}function _0xe9d3d9(_0x5a1edd){try{_0x469e42(_0x5be946['throw'](_0x5a1edd));}catch(_0x3b15c2){_0x3685b4(_0x3b15c2);}}function _0x469e42(_0x1aac34){_0x1aac34['done']?_0x2b8b2d(_0x1aac34['value']):_0x3e2f43(_0x1aac34['value'])['then'](_0x957896,_0xe9d3d9);}_0x469e42((_0x5be946=_0x5be946['apply'](_0xc49c0,_0x4edc21||[]))['next']());});};class AccountService{constructor(_0x328486){this['fetch']=_0x328486;}['get'](_0x54a92e,_0x37982f){return __awaiter$8(this,void 0,void 0,function*(){const _0x213ef1='Account/'+_0x54a92e+'/',_0x1680eb=yield this['fetch']['get'](_0x213ef1,_0x37982f);try{if(_0x1680eb['status']>0xc7&&_0x1680eb['status']<0x12c){const _0x15cc2e=yield _0x1680eb['json']();return new SuccessfulAccountResponse(_0x15cc2e);}const _0x12cf46=yield _0x1680eb['json']();return new FailedAccountResponse(_0x12cf46);}catch(_0x1ad636){if(_0x1ad636 instanceof Error)return new FailedAccountResponse({'detail':_0x1ad636['message'],'title':_0x1ad636['name'],'status':0x1f4,'instance':'','type':''});throw _0x1ad636;}});}['getImage'](_0x454212,_0x159e36){return __awaiter$8(this,void 0,void 0,function*(){const _0x2ab23b='account/image/'+_0x454212+'/',_0x3d91bd=yield this['fetch']['get'](_0x2ab23b,_0x159e36);try{if(_0x3d91bd['status']>0xc7&&_0x3d91bd['status']<0x12c){const _0x47c5cd=yield _0x3d91bd['json']();return new SuccessfulAccountImageResponse(_0x47c5cd);}const _0x37a058=yield _0x3d91bd['json']();return new FailedAccountImageResponse(_0x37a058);}catch(_0x2ed954){if(_0x2ed954 instanceof Error)return new FailedAccountImageResponse({'detail':_0x2ed954['message'],'title':_0x2ed954['name'],'status':0x1f4,'instance':'','type':''});throw _0x2ed954;}});}}
|
|
4
|
-
|
|
5
|
-
var __awaiter$7=undefined&&undefined['__awaiter']||function(_0x3a0a85,_0xbe733,_0xd058f2,_0x214a97){function _0x5998cf(_0x4ab4e0){return _0x4ab4e0 instanceof _0xd058f2?_0x4ab4e0:new _0xd058f2(function(_0x109448){_0x109448(_0x4ab4e0);});}return new(_0xd058f2||(_0xd058f2=Promise))(function(_0x254c8b,_0x4c1209){function _0x30705d(_0x4c8d88){try{_0x2ba5f2(_0x214a97['next'](_0x4c8d88));}catch(_0x178fd4){_0x4c1209(_0x178fd4);}}function _0x173d83(_0x5b5164){try{_0x2ba5f2(_0x214a97['throw'](_0x5b5164));}catch(_0x828aec){_0x4c1209(_0x828aec);}}function _0x2ba5f2(_0x318d02){_0x318d02['done']?_0x254c8b(_0x318d02['value']):_0x5998cf(_0x318d02['value'])['then'](_0x30705d,_0x173d83);}_0x2ba5f2((_0x214a97=_0x214a97['apply'](_0x3a0a85,_0xbe733||[]))['next']());});};class ApiKeyService{constructor(_0x1426d8){this['fetch']=_0x1426d8,this['path']='api-key';}['create'](_0x377e81,_0x465171,_0x1d9766){return __awaiter$7(this,void 0,void 0,function*(){const _0x4dd76b={'account_name':_0x377e81,'api_key_name':_0x465171};try{const _0x16d971=yield this['fetch']['post'](this['path'],_0x1d9766,_0x4dd76b);if(_0x16d971['status']>0xc7&&_0x16d971['status']<0x12c){const _0x230d2e=yield _0x16d971['json']();return new SuccessfulApiKeyResponse(_0x230d2e);}const _0x326310=yield _0x16d971['json']();return new FailedApiKeyResponse(_0x326310);}catch(_0x2c9b90){if(_0x2c9b90 instanceof Error)return new FailedApiKeyResponse({'detail':_0x2c9b90['message'],'title':_0x2c9b90['name'],'status':0x1f4,'instance':'','type':''});throw _0x2c9b90;}});}['view'](_0x13ccc5,_0xfe1d3,_0x4508fe){return __awaiter$7(this,void 0,void 0,function*(){const _0x16fcbf=this['path']+'/'+_0x13ccc5+'/'+_0xfe1d3;try{const _0x4907f0=yield this['fetch']['get'](_0x16fcbf,_0x4508fe);if(_0x4907f0['status']>0xc7&&_0x4907f0['status']<0x12c){const _0x59a1bd=yield _0x4907f0['json']();return new SuccessfulApiKeyValueResponse(_0x59a1bd);}const _0x179fab=yield _0x4907f0['json']();return new FailedApiKeyValueResponse(_0x179fab);}catch(_0x3fbd0c){if(_0x3fbd0c instanceof Error)return new FailedApiKeyValueResponse({'detail':_0x3fbd0c['message'],'title':_0x3fbd0c['name'],'status':0x1f4,'instance':'','type':''});throw _0x3fbd0c;}});}['delete'](_0x50ee9d,_0x354fcd,_0x46a316){return __awaiter$7(this,void 0,void 0,function*(){const _0x49c21b=this['path']+'/'+_0x50ee9d+'/'+_0x354fcd;try{const _0x3eddca=yield this['fetch']['delete'](_0x49c21b,_0x46a316);if(_0x3eddca['status']>0xc7&&_0x3eddca['status']<0x12c)return new SuccessfulResponse({});const _0x5d89db=yield _0x3eddca['json']();return new FailedResponse(_0x5d89db);}catch(_0x3457e8){if(_0x3457e8 instanceof Error)return new FailedResponse({'detail':_0x3457e8['message'],'title':_0x3457e8['name'],'status':0x1f4,'instance':'','type':''});throw _0x3457e8;}});}}
|
|
6
|
-
|
|
7
|
-
var __awaiter$6=undefined&&undefined['__awaiter']||function(_0x464e7d,_0xe3f21f,_0x372e40,_0x2b1fd4){function _0x35c561(_0x335867){return _0x335867 instanceof _0x372e40?_0x335867:new _0x372e40(function(_0x12625c){_0x12625c(_0x335867);});}return new(_0x372e40||(_0x372e40=Promise))(function(_0x5494d8,_0x3cd81b){function _0x350f5b(_0x1e54c2){try{_0x346fcf(_0x2b1fd4['next'](_0x1e54c2));}catch(_0x55de71){_0x3cd81b(_0x55de71);}}function _0x385d43(_0xf26799){try{_0x346fcf(_0x2b1fd4['throw'](_0xf26799));}catch(_0x2648c9){_0x3cd81b(_0x2648c9);}}function _0x346fcf(_0xeac564){_0xeac564['done']?_0x5494d8(_0xeac564['value']):_0x35c561(_0xeac564['value'])['then'](_0x350f5b,_0x385d43);}_0x346fcf((_0x2b1fd4=_0x2b1fd4['apply'](_0x464e7d,_0xe3f21f||[]))['next']());});};class ListService{constructor(_0x423eef){this['fetch']=_0x423eef;}['create'](_0xe7502e,_0x3ebfd3,_0x42508b,_0x31564b){return __awaiter$6(this,void 0,void 0,function*(){const _0x15bc57='List',_0x4a5ff3={'account_name':_0xe7502e,'list_name':_0x3ebfd3,'search_service_name':_0x42508b};try{const _0x43b03a=yield this['fetch']['post'](_0x15bc57,_0x31564b,_0x4a5ff3);if(_0x43b03a['status']>0xc7&&_0x43b03a['status']<0x12c){const _0x401ab5=yield _0x43b03a['json']();return new SuccessfulListIdentityResponse(_0x401ab5);}const _0x3d3ae5=yield _0x43b03a['json']();return new FailedListIdentityResponse(_0x3d3ae5);}catch(_0x5ef189){if(_0x5ef189 instanceof Error)return new FailedListIdentityResponse({'detail':_0x5ef189['message'],'title':_0x5ef189['name'],'status':0x1f4,'instance':'','type':''});throw _0x5ef189;}});}['delete'](_0x4bc67a,_0x37bb04,_0x541a89){return __awaiter$6(this,void 0,void 0,function*(){const _0x5e5dd6='List/'+_0x4bc67a+'/'+_0x37bb04,_0x312b23=yield this['fetch']['delete'](_0x5e5dd6,_0x541a89);try{if(_0x312b23['status']>0xc7&&_0x312b23['status']<0x12c)return new SuccessfulResponse({});const _0x56e673=yield _0x312b23['json']();return new FailedResponse(_0x56e673);}catch(_0x394f47){if(_0x394f47 instanceof Error)return new FailedResponse({'detail':_0x394f47['message'],'title':_0x394f47['name'],'status':0x1f4,'instance':'','type':''});throw _0x394f47;}});}['get'](_0x124c51,_0x1bee6b,_0x1eb72a){return __awaiter$6(this,void 0,void 0,function*(){const _0x386bcd='List/'+_0x124c51+'/'+_0x1bee6b;try{const _0x9c476e=yield this['fetch']['get'](_0x386bcd,_0x1eb72a);if(_0x9c476e['status']>0xc7&&_0x9c476e['status']<0x12c){const _0x1c0cde=yield _0x9c476e['json']();return new SuccessfulListResponse(_0x1c0cde);}const _0x1b3b8c=yield _0x9c476e['json']();return new FailedListResponse(_0x1b3b8c);}catch(_0x28e1ff){if(_0x28e1ff instanceof Error)return new FailedListResponse({'detail':_0x28e1ff['message'],'title':_0x28e1ff['name'],'status':0x1f4,'instance':'','type':''});throw _0x28e1ff;}});}}
|
|
8
|
-
|
|
9
|
-
var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x4e41b6,_0x1d1376,_0x625139,_0x4504cc){function _0x4528c9(_0x11abb9){return _0x11abb9 instanceof _0x625139?_0x11abb9:new _0x625139(function(_0x14e2c5){_0x14e2c5(_0x11abb9);});}return new(_0x625139||(_0x625139=Promise))(function(_0x5e4256,_0x203e91){function _0x51810f(_0x37e39f){try{_0x5209e9(_0x4504cc['next'](_0x37e39f));}catch(_0x4d2024){_0x203e91(_0x4d2024);}}function _0x2015b1(_0x40db70){try{_0x5209e9(_0x4504cc['throw'](_0x40db70));}catch(_0x4dffeb){_0x203e91(_0x4dffeb);}}function _0x5209e9(_0x347f28){_0x347f28['done']?_0x5e4256(_0x347f28['value']):_0x4528c9(_0x347f28['value'])['then'](_0x51810f,_0x2015b1);}_0x5209e9((_0x4504cc=_0x4504cc['apply'](_0x4e41b6,_0x1d1376||[]))['next']());});};class Fetch{constructor(_0x40b86b){this['baseUri']=_0x40b86b,this['getUrl']=_0xd0420d=>{return _0xd0420d['startsWith']('/')&&(_0xd0420d=_0xd0420d['replace']('/','')),''+this['baseUri']+_0xd0420d;},!_0x40b86b['endsWith']('/')&&(_0x40b86b=_0x40b86b+'/');}['get'](_0x285d41,_0x208588){return __awaiter$5(this,void 0,void 0,function*(){const _0x3a61f5=this['getUrl'](_0x285d41);return yield fetch(_0x3a61f5,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x208588}});});}['post'](_0x4e5bc3,_0x3fbb0c,_0x398e07){return __awaiter$5(this,void 0,void 0,function*(){const _0x5c9240=this['getUrl'](_0x4e5bc3);return yield fetch(_0x5c9240,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3fbb0c},'body':_0x398e07?JSON['stringify'](_0x398e07):null});});}['PostNoAuth'](_0x597b48,_0x564c98){return __awaiter$5(this,void 0,void 0,function*(){const _0x505833=this['getUrl'](_0x597b48);return yield fetch(_0x505833,{'method':'POST','headers':{'Content-Type':'application/json'},'body':_0x564c98?JSON['stringify'](_0x564c98):null});});}['put'](_0xdbb966,_0x197659,_0x4fd345){return __awaiter$5(this,void 0,void 0,function*(){const _0x400836=this['getUrl'](_0xdbb966);return yield fetch(_0x400836,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x197659},'body':_0x4fd345?JSON['stringify'](_0x4fd345):null});});}['delete'](_0x231239,_0x2773d8){return __awaiter$5(this,void 0,void 0,function*(){const _0x1291ed=this['getUrl'](_0x231239);return yield fetch(_0x1291ed,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2773d8}});});}}
|
|
10
|
-
|
|
11
|
-
var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4443fc,_0x4712d1,_0xef7dee,_0x28d855){function _0x221984(_0x1bcf79){return _0x1bcf79 instanceof _0xef7dee?_0x1bcf79:new _0xef7dee(function(_0x142408){_0x142408(_0x1bcf79);});}return new(_0xef7dee||(_0xef7dee=Promise))(function(_0x3bcb3d,_0x5738c0){function _0x417779(_0x5a211b){try{_0xc4a10d(_0x28d855['next'](_0x5a211b));}catch(_0x3babfd){_0x5738c0(_0x3babfd);}}function _0xcba60c(_0x5a7436){try{_0xc4a10d(_0x28d855['throw'](_0x5a7436));}catch(_0x10d7cc){_0x5738c0(_0x10d7cc);}}function _0xc4a10d(_0x5c4804){_0x5c4804['done']?_0x3bcb3d(_0x5c4804['value']):_0x221984(_0x5c4804['value'])['then'](_0x417779,_0xcba60c);}_0xc4a10d((_0x28d855=_0x28d855['apply'](_0x4443fc,_0x4712d1||[]))['next']());});};class SearchServersService{constructor(_0x13ca65){this['fetch']=_0x13ca65,this['path']='search-services';}['create'](_0x1729e5,_0x29da3d,_0x4eb79e,_0x4cbd6a,_0x53d716,_0x20e5bf,_0x41b8be,_0x15386a){return __awaiter$4(this,void 0,void 0,function*(){const _0x269cfa={'account_name':_0x1729e5,'search_service_name':_0x29da3d,'endpoint':_0x4eb79e,'key':_0x4cbd6a,'country':_0x53d716,'provider':_0x20e5bf,'index_name':_0x41b8be};try{const _0xf9078a=yield this['fetch']['post'](this['path'],_0x15386a,_0x269cfa);if(_0xf9078a['status']>0xc7&&_0xf9078a['status']<0x12c){const _0x3557f1=yield _0xf9078a['json']();return new SuccessfulSearchServiceResponse(_0x3557f1);}const _0x229ec1=yield _0xf9078a['json']();return new FailedSearchServiceResponse(_0x229ec1);}catch(_0x33cf10){if(_0x33cf10 instanceof Error)return new FailedSearchServiceResponse({'detail':_0x33cf10['message'],'title':_0x33cf10['name'],'status':0x1f4,'instance':'','type':''});throw _0x33cf10;}});}['delete'](_0x1284e1,_0x5b5430,_0x21f659){return __awaiter$4(this,void 0,void 0,function*(){const _0x42441a=this['path']+'/'+_0x1284e1+'/'+_0x5b5430;try{const _0x43bd96=yield this['fetch']['delete'](_0x42441a,_0x21f659);if(_0x43bd96['status']>0xc7&&_0x43bd96['status']<0x12c)return new SuccessfulResponse({});const _0xc63495=yield _0x43bd96['json']();return new FailedResponse(_0xc63495);}catch(_0x2b83da){if(_0x2b83da instanceof Error)return new FailedResponse({'detail':_0x2b83da['message'],'title':_0x2b83da['name'],'status':0x1f4,'instance':'','type':''});throw _0x2b83da;}});}['view'](_0x9525f1,_0x3e7be8,_0x249ed7){return __awaiter$4(this,void 0,void 0,function*(){const _0x2f2d7a=this['path']+'/'+_0x9525f1+'/'+_0x3e7be8;try{const _0x617104=yield this['fetch']['get'](_0x2f2d7a,_0x249ed7);if(_0x617104['status']>0xc7&&_0x617104['status']<0x12c){const _0x46e7b8=yield _0x617104['json']();return new SuccessfulViewSearchServiceResponse(_0x46e7b8);}const _0x14fe2a=yield _0x617104['json']();return new FailedViewSearchServiceResponse(_0x14fe2a);}catch(_0x2b7186){if(_0x2b7186 instanceof Error)return new FailedViewSearchServiceResponse({'detail':_0x2b7186['message'],'title':_0x2b7186['name'],'status':0x1f4,'instance':'','type':''});throw _0x2b7186;}});}['edit'](_0x42c731,_0xe9b341,_0x2f593e,_0x3dc482,_0x2ce898,_0xed2d93){return __awaiter$4(this,void 0,void 0,function*(){const _0x18300f={'account_name':_0x42c731,'search_service_name':_0xe9b341,'new_search_service_name':_0x2f593e,'key':_0x3dc482,'country':_0x2ce898};try{const _0x1f2f30=yield this['fetch']['put'](this['path'],_0xed2d93,_0x18300f);if(_0x1f2f30['status']>0xc7&&_0x1f2f30['status']<0x12c){const _0x22201d=yield _0x1f2f30['json']();return new SuccessfulSearchServiceResponse(_0x22201d);}const _0x7a8261=yield _0x1f2f30['json']();return new FailedSearchServiceResponse(_0x7a8261);}catch(_0x1cfecf){if(_0x1cfecf instanceof Error)return new FailedSearchServiceResponse({'detail':_0x1cfecf['message'],'title':_0x1cfecf['name'],'status':0x1f4,'instance':'','type':''});throw _0x1cfecf;}});}['list'](_0x219a8d,_0x110c91){return __awaiter$4(this,void 0,void 0,function*(){const _0x4205f3=this['path']+'/'+_0x219a8d;try{const _0x4aa50f=yield this['fetch']['get'](_0x4205f3,_0x110c91);if(_0x4aa50f['status']>0xc7&&_0x4aa50f['status']<0x12c){const _0x5db834=yield _0x4aa50f['json']();return new SuccessfulListSearchServiceResponse(_0x5db834);}const _0xea44dd=yield _0x4aa50f['json']();return new FailedViewSearchServicesResponse(_0xea44dd);}catch(_0x239494){if(_0x239494 instanceof Error)return new FailedViewSearchServicesResponse({'detail':_0x239494['message'],'title':_0x239494['name'],'status':0x1f4,'instance':'','type':''});throw _0x239494;}});}}
|
|
12
|
-
|
|
13
|
-
var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x154874,_0x41572c,_0x37437c,_0x5f2127){function _0x3e469f(_0x5966f6){return _0x5966f6 instanceof _0x37437c?_0x5966f6:new _0x37437c(function(_0x25f764){_0x25f764(_0x5966f6);});}return new(_0x37437c||(_0x37437c=Promise))(function(_0x5e678c,_0x4ccba3){function _0x311168(_0x4dd7c3){try{_0x5eb59b(_0x5f2127['next'](_0x4dd7c3));}catch(_0x5dbb07){_0x4ccba3(_0x5dbb07);}}function _0x184511(_0x475424){try{_0x5eb59b(_0x5f2127['throw'](_0x475424));}catch(_0x49e9c9){_0x4ccba3(_0x49e9c9);}}function _0x5eb59b(_0x40be70){_0x40be70['done']?_0x5e678c(_0x40be70['value']):_0x3e469f(_0x40be70['value'])['then'](_0x311168,_0x184511);}_0x5eb59b((_0x5f2127=_0x5f2127['apply'](_0x154874,_0x41572c||[]))['next']());});};class FacetService{constructor(_0x448e54){this['fetch']=_0x448e54,this['path']='facet';}['create'](_0x23bdf8,_0x423fd0,_0x55a664,_0x41c150){return __awaiter$3(this,void 0,void 0,function*(){const _0x42eab8={'account_name':_0x23bdf8,'list_name':_0x423fd0,'facet_name':_0x55a664};try{const _0x36ef33=yield this['fetch']['post'](this['path'],_0x41c150,_0x42eab8);if(_0x36ef33['status']>0xc7&&_0x36ef33['status']<0x12c){const _0x45a596=yield _0x36ef33['json']();return new SuccessfulFacetResponse(_0x45a596);}const _0x9f0ed1=yield _0x36ef33['json']();return new FailedFacetResponse(_0x9f0ed1);}catch(_0xbca77f){if(_0xbca77f instanceof Error)return new FailedFacetResponse({'detail':_0xbca77f['message'],'title':_0xbca77f['name'],'status':0x1f4,'instance':'','type':''});throw _0xbca77f;}});}['remove'](_0x3573f6,_0x40ad4f,_0x2d82b7,_0x31aa61){return __awaiter$3(this,void 0,void 0,function*(){const _0x465474='Facet/'+_0x3573f6+'/'+_0x40ad4f+'/'+_0x2d82b7,_0x2dc1af=yield this['fetch']['delete'](_0x465474,_0x31aa61);try{if(_0x2dc1af['status']>0xc7&&_0x2dc1af['status']<0x12c)return new SuccessfulResponse({});const _0x157432=yield _0x2dc1af['json']();return new FailedResponse(_0x157432);}catch(_0x11540d){if(_0x11540d instanceof Error)return new FailedResponse({'detail':_0x11540d['message'],'title':_0x11540d['name'],'status':0x1f4,'instance':'','type':''});throw _0x11540d;}});}['rename'](_0x452b1e,_0x2d8549,_0x504178,_0x5b6da0,_0xd8d3c6){return __awaiter$3(this,void 0,void 0,function*(){const _0x4e191f={'account_name':_0x452b1e,'list_name':_0x2d8549,'facet_name':_0x504178,'new_facet_name':_0x5b6da0};try{const _0xa78d5f=yield this['fetch']['put'](this['path'],_0xd8d3c6,_0x4e191f);if(_0xa78d5f['status']>0xc7&&_0xa78d5f['status']<0x12c){const _0x4db9c3=yield _0xa78d5f['json']();return new SuccessfulFacetResponse(_0x4db9c3);}const _0x57ec5e=yield _0xa78d5f['json']();return new FailedFacetResponse(_0x57ec5e);}catch(_0x2fce4f){if(_0x2fce4f instanceof Error)return new FailedFacetResponse({'detail':_0x2fce4f['message'],'title':_0x2fce4f['name'],'status':0x1f4,'instance':'','type':''});throw _0x2fce4f;}});}}
|
|
14
|
-
|
|
15
|
-
var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x331f71,_0x10f583,_0x55e073,_0x538d3c){function _0x35a8b1(_0x10a3bc){return _0x10a3bc instanceof _0x55e073?_0x10a3bc:new _0x55e073(function(_0x526477){_0x526477(_0x10a3bc);});}return new(_0x55e073||(_0x55e073=Promise))(function(_0x5a2ebc,_0x22bb6c){function _0x32b39e(_0x4f37db){try{_0xe3463e(_0x538d3c['next'](_0x4f37db));}catch(_0x15469f){_0x22bb6c(_0x15469f);}}function _0x571bfa(_0x23fd33){try{_0xe3463e(_0x538d3c['throw'](_0x23fd33));}catch(_0xfdbc88){_0x22bb6c(_0xfdbc88);}}function _0xe3463e(_0x13c9cc){_0x13c9cc['done']?_0x5a2ebc(_0x13c9cc['value']):_0x35a8b1(_0x13c9cc['value'])['then'](_0x32b39e,_0x571bfa);}_0xe3463e((_0x538d3c=_0x538d3c['apply'](_0x331f71,_0x10f583||[]))['next']());});};class SearchResultService{constructor(_0x3a7775){this['fetch']=_0x3a7775,this['path']='search-result';}['create'](_0x2d86d4,_0x1c0d70,_0x270914,_0x372137,_0x1a98bf){return __awaiter$2(this,void 0,void 0,function*(){_0x1a98bf=_0x1a98bf!==null&&_0x1a98bf!==void 0?_0x1a98bf:{'description':'','keywords':'','resource_1':'','resource_2':'','resource_3':'','latitude':0x0,'longitude':0x0,'facets':[]};const _0x28825d=Object['assign']({'account_name':_0x2d86d4,'search_result_name':_0x270914,'list_name':_0x1c0d70},_0x1a98bf);try{const _0x3be6e6=yield this['fetch']['post'](this['path'],_0x372137,_0x28825d);if(_0x3be6e6['status']>0xc7&&_0x3be6e6['status']<0x12c){const _0x17c222=yield _0x3be6e6['json']();return new SuccessfulViewSearchResultResponse(_0x17c222);}const _0x4be31e=yield _0x3be6e6['json']();return new FailedSearchResultResponse(_0x4be31e);}catch(_0xe6bc38){if(_0xe6bc38 instanceof Error)return new FailedSearchResultResponse({'detail':_0xe6bc38['message'],'title':_0xe6bc38['name'],'status':0x1f4,'instance':'','type':''});throw _0xe6bc38;}});}}
|
|
16
|
-
|
|
17
|
-
var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5588df,_0x427dd6,_0x5325fb,_0xcceb84){function _0x5e8368(_0x2351c3){return _0x2351c3 instanceof _0x5325fb?_0x2351c3:new _0x5325fb(function(_0x3ee3bf){_0x3ee3bf(_0x2351c3);});}return new(_0x5325fb||(_0x5325fb=Promise))(function(_0x55da0e,_0x58274c){function _0x3ad9c0(_0x196211){try{_0x493817(_0xcceb84['next'](_0x196211));}catch(_0x593115){_0x58274c(_0x593115);}}function _0x29d620(_0x17ecfe){try{_0x493817(_0xcceb84['throw'](_0x17ecfe));}catch(_0x2c1b5f){_0x58274c(_0x2c1b5f);}}function _0x493817(_0x36cd63){_0x36cd63['done']?_0x55da0e(_0x36cd63['value']):_0x5e8368(_0x36cd63['value'])['then'](_0x3ad9c0,_0x29d620);}_0x493817((_0xcceb84=_0xcceb84['apply'](_0x5588df,_0x427dd6||[]))['next']());});};class ContributorService{constructor(_0x1e35ec){this['fetch']=_0x1e35ec,this['path']='contributor';}['create'](_0x40ac7b,_0x154bab,_0x328918,_0x55d140){return __awaiter$1(this,void 0,void 0,function*(){const _0x5510bc={'account_name':_0x40ac7b,'list_name':_0x154bab,'contributor_name':_0x328918};try{const _0xd548a9=yield this['fetch']['post'](this['path'],_0x55d140,_0x5510bc);if(_0xd548a9['status']>0xc7&&_0xd548a9['status']<0x12c){const _0x468c4f=yield _0xd548a9['json']();return new SuccessfulContributorResponse(_0x468c4f);}const _0x56795f=yield _0xd548a9['json']();return new FailedContributorResponse(_0x56795f);}catch(_0x5e0d92){if(_0x5e0d92 instanceof Error)return new FailedContributorResponse({'detail':_0x5e0d92['message'],'title':_0x5e0d92['name'],'status':0x1f4,'instance':'','type':''});throw _0x5e0d92;}});}['remove'](_0x5a2b72,_0x8c03e3,_0x3149eb,_0x522d64){return __awaiter$1(this,void 0,void 0,function*(){const _0x4a56c5=this['path']+'/'+_0x5a2b72+'/'+_0x8c03e3+'/'+_0x3149eb,_0x3d2f25=yield this['fetch']['delete'](_0x4a56c5,_0x522d64);try{if(_0x3d2f25['status']>0xc7&&_0x3d2f25['status']<0x12c)return new SuccessfulResponse({});const _0x117a23=yield _0x3d2f25['json']();return new FailedResponse(_0x117a23);}catch(_0x481286){if(_0x481286 instanceof Error)return new FailedResponse({'detail':_0x481286['message'],'title':_0x481286['name'],'status':0x1f4,'instance':'','type':''});throw _0x481286;}});}}
|
|
18
|
-
|
|
19
|
-
var __awaiter=undefined&&undefined['__awaiter']||function(_0x495474,_0x1c025e,_0x3a0125,_0x5c180a){function _0x280b1c(_0x3519db){return _0x3519db instanceof _0x3a0125?_0x3519db:new _0x3a0125(function(_0xc68d3d){_0xc68d3d(_0x3519db);});}return new(_0x3a0125||(_0x3a0125=Promise))(function(_0xc84dca,_0x3eecbe){function _0x3835e1(_0x58878e){try{_0xba709(_0x5c180a['next'](_0x58878e));}catch(_0x470535){_0x3eecbe(_0x470535);}}function _0x354743(_0x56c6e0){try{_0xba709(_0x5c180a['throw'](_0x56c6e0));}catch(_0x274155){_0x3eecbe(_0x274155);}}function _0xba709(_0x2529fb){_0x2529fb['done']?_0xc84dca(_0x2529fb['value']):_0x280b1c(_0x2529fb['value'])['then'](_0x3835e1,_0x354743);}_0xba709((_0x5c180a=_0x5c180a['apply'](_0x495474,_0x1c025e||[]))['next']());});};class AdminClient{constructor(_0x2a86fa='https://admin.searchability.dev/'){var _0x36191d=new Fetch(_0x2a86fa);this['Accounts']=new AccountService(_0x36191d),this['Lists']=new ListService(_0x36191d),this['ApiKeys']=new ApiKeyService(_0x36191d),this['SearchServers']=new SearchServersService(_0x36191d),this['Facets']=new FacetService(_0x36191d),this['SearchResults']=new SearchResultService(_0x36191d),this['Contributors']=new ContributorService(_0x36191d);}}class AuthClient{constructor(_0x332b45='https://auth.searchability.dev/'){this['fetch']=new Fetch(_0x332b45);}['login'](_0x557114){return __awaiter(this,void 0,void 0,function*(){const _0x39d2fe='login/'+_0x557114;try{const _0x328639=yield yield fetch(_0x39d2fe);if(_0x328639['status']>0xc7&&_0x328639['status']<0x12c){const _0x20ee7f=yield _0x328639['json']();return new SuccessfulAuthResponse(_0x20ee7f);}const _0x4e9c53=yield _0x328639['json']();return new FailedAuthResponse(_0x4e9c53);}catch(_0x21399d){if(_0x21399d instanceof Error)return new FailedAuthResponse({'detail':_0x21399d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x21399d;}});}['refresh'](_0xeffade){return __awaiter(this,void 0,void 0,function*(){const _0x3d0868='refresh',_0xca1cad={'refresh_token':_0xeffade};try{const _0x254333=yield this['fetch']['PostNoAuth'](_0x3d0868,_0xca1cad);if(_0x254333['status']>0xc7&&_0x254333['status']<0x12c){const _0x32bbca=yield _0x254333['json']();return new SuccessfulAuthResponse(_0x32bbca);}const _0x782ec7=yield _0x254333['json']();return new FailedAuthResponse(_0x782ec7);}catch(_0x3eb9d7){if(_0x3eb9d7 instanceof Error)return new FailedAuthResponse({'detail':_0x3eb9d7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3eb9d7;}});}['getTokenStatus'](_0xa9e0b4){if(Date['now']()<_0xa9e0b4['access_expires'])return TokenStatus['Ok'];if(Date['now']()<_0xa9e0b4['refresh_expires'])return TokenStatus['Refresh'];return TokenStatus['Expired'];}}
|
|
20
|
-
|
|
21
|
-
export { AdminClient, AuthClient, TokenStatus, Tokens };
|