@searchability/admin-client 0.0.9 → 0.0.11

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,17 @@
1
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x1d13b0,_0x3d42ae,_0xab9ec7,_0x73414a){function _0x532105(_0x390b2e){return _0x390b2e instanceof _0xab9ec7?_0x390b2e:new _0xab9ec7(function(_0x14b4f8){_0x14b4f8(_0x390b2e);});}return new(_0xab9ec7||(_0xab9ec7=Promise))(function(_0x466613,_0xc71abf){function _0x5cd4c4(_0x4fe3fc){try{_0x4bf9ff(_0x73414a['next'](_0x4fe3fc));}catch(_0x24aca9){_0xc71abf(_0x24aca9);}}function _0x44db0b(_0x5b3d3e){try{_0x4bf9ff(_0x73414a['throw'](_0x5b3d3e));}catch(_0xcf233c){_0xc71abf(_0xcf233c);}}function _0x4bf9ff(_0x5628f5){_0x5628f5['done']?_0x466613(_0x5628f5['value']):_0x532105(_0x5628f5['value'])['then'](_0x5cd4c4,_0x44db0b);}_0x4bf9ff((_0x73414a=_0x73414a['apply'](_0x1d13b0,_0x3d42ae||[]))['next']());});};class Fetch{static['get'](_0x3caf43,_0x51d334){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x3caf43,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x51d334}});});}static['post'](_0x32d54c,_0x1a5b83,_0x3b8dc3){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x32d54c,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1a5b83},'body':_0x3b8dc3?JSON['stringify'](_0x3b8dc3):null});});}static['put'](_0x1019f1,_0x44faea,_0x7fd7da){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x1019f1,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x44faea},'body':_0x7fd7da?JSON['stringify'](_0x7fd7da):null});});}static['delete'](_0x129902,_0x5947cc){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x129902,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5947cc}});});}}
2
+
3
+ class Response{constructor(_0x4fd06a){this['isSuccess']=_0x4fd06a;}}class SuccessfulAccountResponse extends Response{constructor(_0x26533b){super(!![]),this['account']=_0x26533b;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x282b89){super(![]),this['problem']=_0x282b89;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x1eb133){super(!![]),this['tokens']=_0x1eb133;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x48b16b){super(![]),this['problem']=_0x48b16b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x5cf265){super(!![]),this['apiKey']=_0x5cf265;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x2dc79e){super(![]),this['problem']=_0x2dc79e;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
+
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4ffa3f,_0xa4cf47,_0x44af39,_0x1fd39d){function _0x5a1266(_0x3d4fad){return _0x3d4fad instanceof _0x44af39?_0x3d4fad:new _0x44af39(function(_0x3f6718){_0x3f6718(_0x3d4fad);});}return new(_0x44af39||(_0x44af39=Promise))(function(_0xa12953,_0x22c6c2){function _0x54c0b3(_0x533fc0){try{_0x29d943(_0x1fd39d['next'](_0x533fc0));}catch(_0x543c97){_0x22c6c2(_0x543c97);}}function _0x5db6ee(_0x3ea0fb){try{_0x29d943(_0x1fd39d['throw'](_0x3ea0fb));}catch(_0x17ba1e){_0x22c6c2(_0x17ba1e);}}function _0x29d943(_0x2d3082){_0x2d3082['done']?_0xa12953(_0x2d3082['value']):_0x5a1266(_0x2d3082['value'])['then'](_0x54c0b3,_0x5db6ee);}_0x29d943((_0x1fd39d=_0x1fd39d['apply'](_0x4ffa3f,_0xa4cf47||[]))['next']());});};class AccountService{constructor(_0x1ec366,_0x266799){this['baseUri']=_0x1ec366,this['tokenManager']=_0x266799;}['get'](_0x3c8fd1,_0x18795c){return __awaiter$4(this,arguments,void 0,function*(_0x379169,_0x299215,_0x4a8bb5={}){var _0x310721;const _0x1f5d82=yield this['tokenManager']['getTokens'](_0x299215,_0x4a8bb5);if(!_0x1f5d82['isSuccess'])return new FailedAccountResponse(_0x1f5d82['toProblem']());_0x299215=_0x1f5d82['toSuccess']();let _0x44f018=(_0x310721=_0x4a8bb5['baseUri'])!==null&&_0x310721!==void 0?_0x310721:this['baseUri'];!_0x44f018['endsWith']('/')&&(_0x44f018=_0x44f018+'/');_0x44f018=_0x44f018+'Account/'+_0x379169+'/';const _0x4744a3=yield Fetch['get'](_0x44f018,_0x299215['access_token']);try{if(_0x4744a3['status']>0xc7&&_0x4744a3['status']<0x12c){const _0x52c2ed=yield _0x4744a3['json']();return new SuccessfulAccountResponse(_0x52c2ed);}const _0x5ee3db=yield _0x4744a3['json']();return new FailedAccountResponse(_0x5ee3db);}catch(_0x32c6c8){if(_0x32c6c8 instanceof Error)return new FailedAccountResponse({'detail':_0x32c6c8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x32c6c8;}});}}
6
+
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x553fe2,_0x91110c,_0x47f4ed,_0xfc017a){function _0x29da9f(_0x3ab0f2){return _0x3ab0f2 instanceof _0x47f4ed?_0x3ab0f2:new _0x47f4ed(function(_0x57aacb){_0x57aacb(_0x3ab0f2);});}return new(_0x47f4ed||(_0x47f4ed=Promise))(function(_0x4d1929,_0x283084){function _0x11896a(_0x2161e2){try{_0x5a1e1a(_0xfc017a['next'](_0x2161e2));}catch(_0x4ed828){_0x283084(_0x4ed828);}}function _0x5aa614(_0x1edd10){try{_0x5a1e1a(_0xfc017a['throw'](_0x1edd10));}catch(_0x23a8df){_0x283084(_0x23a8df);}}function _0x5a1e1a(_0x55632e){_0x55632e['done']?_0x4d1929(_0x55632e['value']):_0x29da9f(_0x55632e['value'])['then'](_0x11896a,_0x5aa614);}_0x5a1e1a((_0xfc017a=_0xfc017a['apply'](_0x553fe2,_0x91110c||[]))['next']());});};class ApiKeyService{constructor(_0x4b0c25,_0xae10b0){this['baseUri']=_0x4b0c25,this['tokenManager']=_0xae10b0;}['create'](_0x1d9c86,_0x2ea307,_0x387b6d){return __awaiter$3(this,arguments,void 0,function*(_0x407244,_0x31d9b3,_0x4bb875,_0x5b7d61={}){var _0x153b0b;const _0x2b9a16=yield this['tokenManager']['getTokens'](_0x4bb875,_0x5b7d61);if(!_0x2b9a16['isSuccess'])return new FailedApiKeyResponse(_0x2b9a16['toProblem']());_0x4bb875=_0x2b9a16['toSuccess']();let _0x5f0442=(_0x153b0b=_0x5b7d61['baseUri'])!==null&&_0x153b0b!==void 0?_0x153b0b:this['baseUri'];!_0x5f0442['endsWith']('/')&&(_0x5f0442=_0x5f0442+'/');_0x5f0442=_0x5f0442+'ApiKey/Create';const _0x273784={'account_name':_0x407244,'name':_0x31d9b3};try{const _0x111c61=yield Fetch['post'](_0x5f0442,_0x4bb875['access_token'],_0x273784);if(_0x111c61['status']>0xc7&&_0x111c61['status']<0x12c){const _0x555697=yield _0x111c61['json']();return new SuccessfulApiKeyResponse(_0x555697);}const _0x5e6616=yield _0x111c61['json']();return new FailedApiKeyResponse(_0x5e6616);}catch(_0xd6defe){if(_0xd6defe instanceof Error)return new FailedApiKeyResponse({'detail':_0xd6defe['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xd6defe;}});}}
8
+
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x121fc3,_0x54cb5d,_0x3b5ede,_0x4aca4e){function _0x12564e(_0x54290f){return _0x54290f instanceof _0x3b5ede?_0x54290f:new _0x3b5ede(function(_0x4f05c6){_0x4f05c6(_0x54290f);});}return new(_0x3b5ede||(_0x3b5ede=Promise))(function(_0x42018f,_0x695d18){function _0x4ac83d(_0x336810){try{_0x3cac0f(_0x4aca4e['next'](_0x336810));}catch(_0x5c6951){_0x695d18(_0x5c6951);}}function _0x190539(_0x125008){try{_0x3cac0f(_0x4aca4e['throw'](_0x125008));}catch(_0x111049){_0x695d18(_0x111049);}}function _0x3cac0f(_0x1d219e){_0x1d219e['done']?_0x42018f(_0x1d219e['value']):_0x12564e(_0x1d219e['value'])['then'](_0x4ac83d,_0x190539);}_0x3cac0f((_0x4aca4e=_0x4aca4e['apply'](_0x121fc3,_0x54cb5d||[]))['next']());});};class ListService{constructor(_0x5d2027,_0x2a2d59){this['baseUri']=_0x5d2027,this['tokenManager']=_0x2a2d59;}['add'](_0x5e8b56,_0x566b66,_0x3df5cb){return __awaiter$2(this,arguments,void 0,function*(_0x2e2c1c,_0x2445b4,_0x1a5012,_0x475d9c={}){var _0x66dd87;const _0x222bdb=yield this['tokenManager']['getTokens'](_0x1a5012,_0x475d9c);if(!_0x222bdb['isSuccess'])return new FailedAccountResponse(_0x222bdb['toProblem']());_0x1a5012=_0x222bdb['toSuccess']();let _0x240e98=(_0x66dd87=_0x475d9c['baseUri'])!==null&&_0x66dd87!==void 0?_0x66dd87:this['baseUri'];!_0x240e98['endsWith']('/')&&(_0x240e98=_0x240e98+'/');_0x240e98=_0x240e98+'List';const _0x1d871a={'account_name':_0x2e2c1c,'list_name':_0x2445b4};try{const _0x14e817=yield Fetch['post'](_0x240e98,_0x1a5012['access_token'],_0x1d871a);if(_0x14e817['status']>0xc7&&_0x14e817['status']<0x12c){const _0x2ff81b=yield _0x14e817['json']();return new SuccessfulAccountResponse(_0x2ff81b);}const _0x53a8e6=yield _0x14e817['json']();return new FailedAccountResponse(_0x53a8e6);}catch(_0x39105f){if(_0x39105f instanceof Error)return new FailedAccountResponse({'detail':_0x39105f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x39105f;}});}['remove'](_0x22c985,_0x139405,_0x4e6240){return __awaiter$2(this,arguments,void 0,function*(_0x391026,_0x5837b6,_0xffd8f7,_0x18b582={}){var _0xcafa2a;const _0x106068=yield this['tokenManager']['getTokens'](_0xffd8f7,_0x18b582);if(!_0x106068['isSuccess'])return new FailedAccountResponse(_0x106068['toProblem']());_0xffd8f7=_0x106068['toSuccess']();let _0x17826c=(_0xcafa2a=_0x18b582['baseUri'])!==null&&_0xcafa2a!==void 0?_0xcafa2a:this['baseUri'];_0x17826c=_0x17826c+'/List/'+_0x391026+'/'+_0x5837b6;const _0x1e2e26=yield Fetch['delete'](_0x17826c,_0xffd8f7['access_token']);try{if(_0x1e2e26['status']>0xc7&&_0x1e2e26['status']<0x12c){const _0x768e13=yield _0x1e2e26['json']();return new SuccessfulAccountResponse(_0x768e13);}const _0x15b5c4=yield _0x1e2e26['json']();return new FailedAccountResponse(_0x15b5c4);}catch(_0x851003){if(_0x851003 instanceof Error)return new FailedAccountResponse({'detail':_0x851003['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x851003;}});}}
10
+
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0xc0fe81,_0x320b27,_0x3cb5a2,_0x1d8d0f){function _0x39806c(_0x4b2180){return _0x4b2180 instanceof _0x3cb5a2?_0x4b2180:new _0x3cb5a2(function(_0x804716){_0x804716(_0x4b2180);});}return new(_0x3cb5a2||(_0x3cb5a2=Promise))(function(_0x92e3ad,_0x5e3547){function _0x26506a(_0x437be6){try{_0x16d858(_0x1d8d0f['next'](_0x437be6));}catch(_0x1a5d1a){_0x5e3547(_0x1a5d1a);}}function _0x10faa5(_0x2fb88b){try{_0x16d858(_0x1d8d0f['throw'](_0x2fb88b));}catch(_0x1b3f12){_0x5e3547(_0x1b3f12);}}function _0x16d858(_0x281f2a){_0x281f2a['done']?_0x92e3ad(_0x281f2a['value']):_0x39806c(_0x281f2a['value'])['then'](_0x26506a,_0x10faa5);}_0x16d858((_0x1d8d0f=_0x1d8d0f['apply'](_0xc0fe81,_0x320b27||[]))['next']());});};class TokenManager{constructor(_0x16bca5){this['tokenService']=_0x16bca5,this['getTokens']=(_0x1de18b,..._0xbc9d9b)=>__awaiter$1(this,[_0x1de18b,..._0xbc9d9b],void 0,function*(_0x299c54,_0x304928={}){if(_0x299c54){var _0x1a5db1=yield this['refreshIfExpired'](_0x299c54,_0x304928);if(_0x1a5db1['isSuccess'])return _0x1a5db1;}return yield this['tokenService']['get'](_0x304928);});}['refreshIfExpired'](_0x189c32){return __awaiter$1(this,arguments,void 0,function*(_0x4a75ca,_0x1d3081={}){if(Date['now']()<_0x4a75ca['access_expires'])return new SuccessfulRefreshResponse(_0x4a75ca);if(Date['now']()>_0x4a75ca['refresh_expires']){const _0x5dd648={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x5dd648);}return yield this['tokenService']['refresh'](_0x4a75ca['refresh_token'],_0x1d3081);});}}
12
+
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x1e659c,_0x5426aa,_0x9ed6b3,_0x1e8f26){function _0x50fdb3(_0x467902){return _0x467902 instanceof _0x9ed6b3?_0x467902:new _0x9ed6b3(function(_0x430cff){_0x430cff(_0x467902);});}return new(_0x9ed6b3||(_0x9ed6b3=Promise))(function(_0x17b5ed,_0x3a433e){function _0x245631(_0xbe16d4){try{_0x2a1dca(_0x1e8f26['next'](_0xbe16d4));}catch(_0x18b443){_0x3a433e(_0x18b443);}}function _0x51aadd(_0x33650f){try{_0x2a1dca(_0x1e8f26['throw'](_0x33650f));}catch(_0x220efe){_0x3a433e(_0x220efe);}}function _0x2a1dca(_0x518f5e){_0x518f5e['done']?_0x17b5ed(_0x518f5e['value']):_0x50fdb3(_0x518f5e['value'])['then'](_0x245631,_0x51aadd);}_0x2a1dca((_0x1e8f26=_0x1e8f26['apply'](_0x1e659c,_0x5426aa||[]))['next']());});};class TokenService{constructor(_0x5cc337,_0x2fd825){this['apiKey']=_0x5cc337,this['baseUri']=_0x2fd825;}['get'](){return __awaiter(this,arguments,void 0,function*(_0x403c2c={}){var _0x3feb4d;let _0xc08cd0=(_0x3feb4d=_0x403c2c['baseUri'])!==null&&_0x3feb4d!==void 0?_0x3feb4d:this['baseUri'];!_0xc08cd0['endsWith']('/')&&(_0xc08cd0=_0xc08cd0+'/');_0xc08cd0=_0xc08cd0+'tokens/get/'+this['apiKey'];try{const _0x55cc4b=yield yield fetch(_0xc08cd0,{'method':'POST','headers':{'Content-Type':'application/json'}});if(_0x55cc4b['status']>0xc7&&_0x55cc4b['status']<0x12c){const _0x4700f5=yield _0x55cc4b['json']();return new SuccessfulRefreshResponse(_0x4700f5);}const _0x4b74c3=yield _0x55cc4b['json']();return new FailedRefreshResponse(_0x4b74c3);}catch(_0x8c9d9b){if(_0x8c9d9b instanceof Error)return new FailedRefreshResponse({'detail':_0x8c9d9b['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x8c9d9b;}});}['refresh'](_0x16c8e0){return __awaiter(this,arguments,void 0,function*(_0x5a4047,_0x34caaa={}){var _0x2b3a65;let _0x3f3701=(_0x2b3a65=_0x34caaa['baseUri'])!==null&&_0x2b3a65!==void 0?_0x2b3a65:this['baseUri'];!_0x3f3701['endsWith']('/')&&(_0x3f3701=_0x3f3701+'/');_0x3f3701=_0x3f3701+'Tokens/Refresh';try{const _0x213d7d=yield Fetch['post'](_0x3f3701,_0x5a4047,null);if(_0x213d7d['status']>0xc7&&_0x213d7d['status']<0x12c){const _0xcb9421=yield _0x213d7d['json']();return new SuccessfulRefreshResponse(_0xcb9421);}const _0x58376d=yield _0x213d7d['json']();return new FailedRefreshResponse(_0x58376d);}catch(_0x10a756){if(_0x10a756 instanceof Error)return new FailedRefreshResponse({'detail':_0x10a756['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x10a756;}});}}
14
+
15
+ class AdminClient{constructor(_0x2ab150,_0x2a6874='https://admin.searchability.dev/'){this['apiKey']=_0x2ab150,this['baseUri']=_0x2a6874,this['Tokens']=new TokenService(_0x2ab150,this['baseUri']);const _0x46c84d=new TokenManager(this['Tokens']);this['Accounts']=new AccountService(this['baseUri'],_0x46c84d),this['Lists']=new ListService(this['baseUri'],_0x46c84d),this['ApiKeys']=new ApiKeyService(this['baseUri'],_0x46c84d);}}
16
+
17
+ export { AdminClient };
@@ -1,17 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x263785,_0x1251e1,_0x4239dc,_0x29cb06){function _0x43ed29(_0x302007){return _0x302007 instanceof _0x4239dc?_0x302007:new _0x4239dc(function(_0x4172a0){_0x4172a0(_0x302007);});}return new(_0x4239dc||(_0x4239dc=Promise))(function(_0x4fc617,_0xd03815){function _0x64198c(_0x2b5f61){try{_0x3a24fb(_0x29cb06['next'](_0x2b5f61));}catch(_0x5af050){_0xd03815(_0x5af050);}}function _0xab07c1(_0x320556){try{_0x3a24fb(_0x29cb06['throw'](_0x320556));}catch(_0x1326e6){_0xd03815(_0x1326e6);}}function _0x3a24fb(_0x24bbcb){_0x24bbcb['done']?_0x4fc617(_0x24bbcb['value']):_0x43ed29(_0x24bbcb['value'])['then'](_0x64198c,_0xab07c1);}_0x3a24fb((_0x29cb06=_0x29cb06['apply'](_0x263785,_0x1251e1||[]))['next']());});};class Fetch{static['get'](_0x45bd9b,_0x3d91fa){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x45bd9b,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3d91fa}});});}static['post'](_0x506586,_0x17f638,_0x1a9d82){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x506586,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x17f638},'body':_0x1a9d82?JSON['stringify'](_0x1a9d82):null});});}static['put'](_0x419393,_0x2acc63,_0x5ae42a){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x419393,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2acc63},'body':_0x5ae42a?JSON['stringify'](_0x5ae42a):null});});}static['delete'](_0x3daa8a,_0x2c7508){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3daa8a,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2c7508}});});}}
3
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x461b16,_0x5692f7,_0x2d7e11,_0x50b24c){function _0x2ddde0(_0x4f0a79){return _0x4f0a79 instanceof _0x2d7e11?_0x4f0a79:new _0x2d7e11(function(_0x6586fe){_0x6586fe(_0x4f0a79);});}return new(_0x2d7e11||(_0x2d7e11=Promise))(function(_0x4a2b7f,_0x47d372){function _0x4f775d(_0x27b746){try{_0x50e6e7(_0x50b24c['next'](_0x27b746));}catch(_0x587f32){_0x47d372(_0x587f32);}}function _0x3e6cd5(_0x31000b){try{_0x50e6e7(_0x50b24c['throw'](_0x31000b));}catch(_0x4fcd9e){_0x47d372(_0x4fcd9e);}}function _0x50e6e7(_0x45affa){_0x45affa['done']?_0x4a2b7f(_0x45affa['value']):_0x2ddde0(_0x45affa['value'])['then'](_0x4f775d,_0x3e6cd5);}_0x50e6e7((_0x50b24c=_0x50b24c['apply'](_0x461b16,_0x5692f7||[]))['next']());});};class Fetch{static['get'](_0x12f720,_0x166be5){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x12f720,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x166be5}});});}static['post'](_0x1e2a2d,_0x13c36c,_0x4389d5){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x1e2a2d,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x13c36c},'body':_0x4389d5?JSON['stringify'](_0x4389d5):null});});}static['put'](_0x45510e,_0x4e5006,_0xf32ddf){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x45510e,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4e5006},'body':_0xf32ddf?JSON['stringify'](_0xf32ddf):null});});}static['delete'](_0xbdf614,_0x181e42){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0xbdf614,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x181e42}});});}}
4
4
 
5
- class Response{constructor(_0x5484a9){this['isSuccess']=_0x5484a9;}}class SuccessfulAccountResponse extends Response{constructor(_0x3bce59){super(!![]),this['account']=_0x3bce59;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x3cfb5a){super(![]),this['problem']=_0x3cfb5a;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x505d6d){super(!![]),this['tokens']=_0x505d6d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x34f64d){super(![]),this['problem']=_0x34f64d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
5
+ class Response{constructor(_0x81f3b3){this['isSuccess']=_0x81f3b3;}}class SuccessfulAccountResponse extends Response{constructor(_0x59fe39){super(!![]),this['account']=_0x59fe39;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x1ad066){super(![]),this['problem']=_0x1ad066;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x128015){super(!![]),this['tokens']=_0x128015;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x10ac26){super(![]),this['problem']=_0x10ac26;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x8958d7){super(!![]),this['apiKey']=_0x8958d7;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x455d0d){super(![]),this['problem']=_0x455d0d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
6
6
 
7
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x3e9056,_0x568886,_0x3d20da,_0x445d5d){function _0x11c3f4(_0x513e30){return _0x513e30 instanceof _0x3d20da?_0x513e30:new _0x3d20da(function(_0x44e8a0){_0x44e8a0(_0x513e30);});}return new(_0x3d20da||(_0x3d20da=Promise))(function(_0x3a6c3d,_0x3497e1){function _0x44e7b8(_0x1a6f22){try{_0x5833c2(_0x445d5d['next'](_0x1a6f22));}catch(_0x1c9eb6){_0x3497e1(_0x1c9eb6);}}function _0x40e923(_0x199922){try{_0x5833c2(_0x445d5d['throw'](_0x199922));}catch(_0x15ac0b){_0x3497e1(_0x15ac0b);}}function _0x5833c2(_0xccae7){_0xccae7['done']?_0x3a6c3d(_0xccae7['value']):_0x11c3f4(_0xccae7['value'])['then'](_0x44e7b8,_0x40e923);}_0x5833c2((_0x445d5d=_0x445d5d['apply'](_0x3e9056,_0x568886||[]))['next']());});};class AccountService{constructor(_0x47bc91){this['baseUri']=_0x47bc91;}['get'](_0x3f1c60,_0x37cd1a){return __awaiter$3(this,arguments,void 0,function*(_0x2a2103,_0x1a510e,_0x517c29={}){var _0xba743;let _0xb04191=(_0xba743=_0x517c29['baseUri'])!==null&&_0xba743!==void 0?_0xba743:this['baseUri'];!_0xb04191['endsWith']('/')&&(_0xb04191=_0xb04191+'/');_0xb04191=_0xb04191+'Account/'+_0x1a510e+'/';const _0xa7b4e=yield Fetch['get'](_0xb04191,_0x2a2103);try{if(_0xa7b4e['status']>0xc7&&_0xa7b4e['status']<0x12c){const _0x43f48c=yield _0xa7b4e['json']();return new SuccessfulAccountResponse(_0x43f48c);}const _0x11c92c=yield _0xa7b4e['json']();return new FailedAccountResponse(_0x11c92c);}catch(_0x226713){if(_0x226713 instanceof Error)return new FailedAccountResponse({'detail':_0x226713['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x226713;}});}}
7
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x17e940,_0x16a747,_0x500e13,_0x1bee9f){function _0x29dd84(_0x596904){return _0x596904 instanceof _0x500e13?_0x596904:new _0x500e13(function(_0x2c0100){_0x2c0100(_0x596904);});}return new(_0x500e13||(_0x500e13=Promise))(function(_0x149995,_0x23b534){function _0x1b1edb(_0x9d80b8){try{_0x1008b0(_0x1bee9f['next'](_0x9d80b8));}catch(_0x5df73e){_0x23b534(_0x5df73e);}}function _0x2e0f1a(_0x2b0335){try{_0x1008b0(_0x1bee9f['throw'](_0x2b0335));}catch(_0x4d322e){_0x23b534(_0x4d322e);}}function _0x1008b0(_0xc1669c){_0xc1669c['done']?_0x149995(_0xc1669c['value']):_0x29dd84(_0xc1669c['value'])['then'](_0x1b1edb,_0x2e0f1a);}_0x1008b0((_0x1bee9f=_0x1bee9f['apply'](_0x17e940,_0x16a747||[]))['next']());});};class AccountService{constructor(_0x359860,_0x14d8aa){this['baseUri']=_0x359860,this['tokenManager']=_0x14d8aa;}['get'](_0x25020a,_0x109587){return __awaiter$4(this,arguments,void 0,function*(_0x4fbcd9,_0x19cade,_0x59e862={}){var _0x3b6952;const _0x254bf6=yield this['tokenManager']['getTokens'](_0x19cade,_0x59e862);if(!_0x254bf6['isSuccess'])return new FailedAccountResponse(_0x254bf6['toProblem']());_0x19cade=_0x254bf6['toSuccess']();let _0x4648db=(_0x3b6952=_0x59e862['baseUri'])!==null&&_0x3b6952!==void 0?_0x3b6952:this['baseUri'];!_0x4648db['endsWith']('/')&&(_0x4648db=_0x4648db+'/');_0x4648db=_0x4648db+'Account/'+_0x4fbcd9+'/';const _0x4154ea=yield Fetch['get'](_0x4648db,_0x19cade['access_token']);try{if(_0x4154ea['status']>0xc7&&_0x4154ea['status']<0x12c){const _0x4b2dfd=yield _0x4154ea['json']();return new SuccessfulAccountResponse(_0x4b2dfd);}const _0x6d9746=yield _0x4154ea['json']();return new FailedAccountResponse(_0x6d9746);}catch(_0x42b6a3){if(_0x42b6a3 instanceof Error)return new FailedAccountResponse({'detail':_0x42b6a3['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x42b6a3;}});}}
8
8
 
9
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x2fbfd2,_0x28aeca,_0x415cdd,_0x171c1d){function _0x102a0b(_0xe2fe6e){return _0xe2fe6e instanceof _0x415cdd?_0xe2fe6e:new _0x415cdd(function(_0x14eb47){_0x14eb47(_0xe2fe6e);});}return new(_0x415cdd||(_0x415cdd=Promise))(function(_0x3cdbd4,_0xb072f6){function _0x42ce3a(_0x35cb48){try{_0x204900(_0x171c1d['next'](_0x35cb48));}catch(_0x4415fc){_0xb072f6(_0x4415fc);}}function _0x5bbe7f(_0x38182c){try{_0x204900(_0x171c1d['throw'](_0x38182c));}catch(_0x57f6f4){_0xb072f6(_0x57f6f4);}}function _0x204900(_0x3c073c){_0x3c073c['done']?_0x3cdbd4(_0x3c073c['value']):_0x102a0b(_0x3c073c['value'])['then'](_0x42ce3a,_0x5bbe7f);}_0x204900((_0x171c1d=_0x171c1d['apply'](_0x2fbfd2,_0x28aeca||[]))['next']());});};class ListService{constructor(_0x4c3fec){this['baseUri']=_0x4c3fec;}['add'](_0x143cf1,_0x294322,_0x17b2c9){return __awaiter$2(this,arguments,void 0,function*(_0x2516e4,_0x5a5f88,_0x3b92b6,_0x320b0f={}){var _0x6199fc;let _0x1504c8=(_0x6199fc=_0x320b0f['baseUri'])!==null&&_0x6199fc!==void 0?_0x6199fc:this['baseUri'];!_0x1504c8['endsWith']('/')&&(_0x1504c8=_0x1504c8+'/');_0x1504c8=_0x1504c8+'List';const _0x44dfe7={'account_name':_0x5a5f88,'list_name':_0x3b92b6};try{const _0x33db75=yield Fetch['post'](_0x1504c8,_0x2516e4,_0x44dfe7);if(_0x33db75['status']>0xc7&&_0x33db75['status']<0x12c){const _0x2afe50=yield _0x33db75['json']();return new SuccessfulAccountResponse(_0x2afe50);}const _0x522fa5=yield _0x33db75['json']();return new FailedAccountResponse(_0x522fa5);}catch(_0xd088f8){if(_0xd088f8 instanceof Error)return new FailedAccountResponse({'detail':_0xd088f8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0xd088f8;}});}['remove'](_0x2861fe,_0x416f22,_0x28ec32){return __awaiter$2(this,arguments,void 0,function*(_0x34c175,_0x104d6f,_0x2494ee,_0x27afaa={}){var _0x41117e;let _0x53cf75=(_0x41117e=_0x27afaa['baseUri'])!==null&&_0x41117e!==void 0?_0x41117e:this['baseUri'];_0x53cf75=_0x53cf75+'/List/'+_0x104d6f+'/'+_0x2494ee;const _0x48a990=yield Fetch['delete'](_0x53cf75,_0x34c175);try{if(_0x48a990['status']>0xc7&&_0x48a990['status']<0x12c){const _0x479ad8=yield _0x48a990['json']();return new SuccessfulAccountResponse(_0x479ad8);}const _0x1e4cf1=yield _0x48a990['json']();return new FailedAccountResponse(_0x1e4cf1);}catch(_0x4073df){if(_0x4073df instanceof Error)return new FailedAccountResponse({'detail':_0x4073df['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4073df;}});}}
9
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x148651,_0x3ea675,_0x2609a4,_0x425cc6){function _0x3b5e80(_0x30f5bc){return _0x30f5bc instanceof _0x2609a4?_0x30f5bc:new _0x2609a4(function(_0xd6aa5a){_0xd6aa5a(_0x30f5bc);});}return new(_0x2609a4||(_0x2609a4=Promise))(function(_0x39e9bf,_0x102157){function _0x40b71a(_0x2e32a0){try{_0x2201c9(_0x425cc6['next'](_0x2e32a0));}catch(_0xe22daf){_0x102157(_0xe22daf);}}function _0x493226(_0x4d2a36){try{_0x2201c9(_0x425cc6['throw'](_0x4d2a36));}catch(_0x164786){_0x102157(_0x164786);}}function _0x2201c9(_0x9f4c7a){_0x9f4c7a['done']?_0x39e9bf(_0x9f4c7a['value']):_0x3b5e80(_0x9f4c7a['value'])['then'](_0x40b71a,_0x493226);}_0x2201c9((_0x425cc6=_0x425cc6['apply'](_0x148651,_0x3ea675||[]))['next']());});};class ApiKeyService{constructor(_0x387766,_0x23f814){this['baseUri']=_0x387766,this['tokenManager']=_0x23f814;}['create'](_0x305fdb,_0x1ec7c3,_0x1f9b35){return __awaiter$3(this,arguments,void 0,function*(_0x5c2e98,_0x5f01a2,_0x46ffd9,_0x150cc6={}){var _0x5cb163;const _0xfe95b7=yield this['tokenManager']['getTokens'](_0x46ffd9,_0x150cc6);if(!_0xfe95b7['isSuccess'])return new FailedApiKeyResponse(_0xfe95b7['toProblem']());_0x46ffd9=_0xfe95b7['toSuccess']();let _0x3baa41=(_0x5cb163=_0x150cc6['baseUri'])!==null&&_0x5cb163!==void 0?_0x5cb163:this['baseUri'];!_0x3baa41['endsWith']('/')&&(_0x3baa41=_0x3baa41+'/');_0x3baa41=_0x3baa41+'ApiKey/Create';const _0x25e378={'account_name':_0x5c2e98,'name':_0x5f01a2};try{const _0x5297bc=yield Fetch['post'](_0x3baa41,_0x46ffd9['access_token'],_0x25e378);if(_0x5297bc['status']>0xc7&&_0x5297bc['status']<0x12c){const _0x53a7e6=yield _0x5297bc['json']();return new SuccessfulApiKeyResponse(_0x53a7e6);}const _0x336289=yield _0x5297bc['json']();return new FailedApiKeyResponse(_0x336289);}catch(_0x41acfa){if(_0x41acfa instanceof Error)return new FailedApiKeyResponse({'detail':_0x41acfa['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x41acfa;}});}}
10
10
 
11
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x49a44d,_0x4e3b10,_0x3fbf3b,_0x1df522){function _0x3c563c(_0x2a0bf1){return _0x2a0bf1 instanceof _0x3fbf3b?_0x2a0bf1:new _0x3fbf3b(function(_0x77aea7){_0x77aea7(_0x2a0bf1);});}return new(_0x3fbf3b||(_0x3fbf3b=Promise))(function(_0xd2b1f5,_0x1bc1af){function _0x1a8a86(_0x47983b){try{_0x2c3aba(_0x1df522['next'](_0x47983b));}catch(_0x44fde7){_0x1bc1af(_0x44fde7);}}function _0x4a2720(_0x5b5cde){try{_0x2c3aba(_0x1df522['throw'](_0x5b5cde));}catch(_0xf220ca){_0x1bc1af(_0xf220ca);}}function _0x2c3aba(_0x5955c1){_0x5955c1['done']?_0xd2b1f5(_0x5955c1['value']):_0x3c563c(_0x5955c1['value'])['then'](_0x1a8a86,_0x4a2720);}_0x2c3aba((_0x1df522=_0x1df522['apply'](_0x49a44d,_0x4e3b10||[]))['next']());});};class TokenManager{constructor(_0x3d46b6){this['securityService']=_0x3d46b6;}['RefreshTokens'](_0x34f16c){return __awaiter$1(this,arguments,void 0,function*(_0x954761,_0x195d5f={}){if(Date['now']()<_0x954761['access_expires'])return new SuccessfulRefreshResponse(_0x954761);if(Date['now']()>_0x954761['refresh_expires']){const _0xd34af3={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0xd34af3);}const _0x3f80a5=yield this['securityService']['refresh'](_0x954761['refresh_token'],_0x195d5f);if(!_0x3f80a5['isSuccess'])return new FailedRefreshResponse(_0x3f80a5['toProblem']());return new SuccessfulRefreshResponse(_0x3f80a5['toSuccess']());});}}
11
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x15b4a1,_0x3863c7,_0x1fcbda,_0x21cf8c){function _0x23e0bd(_0x2f9e05){return _0x2f9e05 instanceof _0x1fcbda?_0x2f9e05:new _0x1fcbda(function(_0x1fad3e){_0x1fad3e(_0x2f9e05);});}return new(_0x1fcbda||(_0x1fcbda=Promise))(function(_0x587dab,_0x268f56){function _0x555c50(_0x5d6a04){try{_0xc4e886(_0x21cf8c['next'](_0x5d6a04));}catch(_0x5c5776){_0x268f56(_0x5c5776);}}function _0x4e1d88(_0x5a01c0){try{_0xc4e886(_0x21cf8c['throw'](_0x5a01c0));}catch(_0x41ff48){_0x268f56(_0x41ff48);}}function _0xc4e886(_0x3acdbd){_0x3acdbd['done']?_0x587dab(_0x3acdbd['value']):_0x23e0bd(_0x3acdbd['value'])['then'](_0x555c50,_0x4e1d88);}_0xc4e886((_0x21cf8c=_0x21cf8c['apply'](_0x15b4a1,_0x3863c7||[]))['next']());});};class ListService{constructor(_0x271912,_0x41c158){this['baseUri']=_0x271912,this['tokenManager']=_0x41c158;}['add'](_0x482e6f,_0x139e65,_0x424e6f){return __awaiter$2(this,arguments,void 0,function*(_0x93037c,_0x37c32b,_0x339a1a,_0x64d5d1={}){var _0x19cc0f;const _0x3b4458=yield this['tokenManager']['getTokens'](_0x339a1a,_0x64d5d1);if(!_0x3b4458['isSuccess'])return new FailedAccountResponse(_0x3b4458['toProblem']());_0x339a1a=_0x3b4458['toSuccess']();let _0x2fc246=(_0x19cc0f=_0x64d5d1['baseUri'])!==null&&_0x19cc0f!==void 0?_0x19cc0f:this['baseUri'];!_0x2fc246['endsWith']('/')&&(_0x2fc246=_0x2fc246+'/');_0x2fc246=_0x2fc246+'List';const _0xa516bb={'account_name':_0x93037c,'list_name':_0x37c32b};try{const _0x3a9835=yield Fetch['post'](_0x2fc246,_0x339a1a['access_token'],_0xa516bb);if(_0x3a9835['status']>0xc7&&_0x3a9835['status']<0x12c){const _0xbb4cda=yield _0x3a9835['json']();return new SuccessfulAccountResponse(_0xbb4cda);}const _0x3a5468=yield _0x3a9835['json']();return new FailedAccountResponse(_0x3a5468);}catch(_0x4ff878){if(_0x4ff878 instanceof Error)return new FailedAccountResponse({'detail':_0x4ff878['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4ff878;}});}['remove'](_0x1d8268,_0x37ffaa,_0x203958){return __awaiter$2(this,arguments,void 0,function*(_0x5bf66a,_0x11d320,_0x1c12e6,_0x29ddf5={}){var _0x232e86;const _0xd6e2d9=yield this['tokenManager']['getTokens'](_0x1c12e6,_0x29ddf5);if(!_0xd6e2d9['isSuccess'])return new FailedAccountResponse(_0xd6e2d9['toProblem']());_0x1c12e6=_0xd6e2d9['toSuccess']();let _0x23b58f=(_0x232e86=_0x29ddf5['baseUri'])!==null&&_0x232e86!==void 0?_0x232e86:this['baseUri'];_0x23b58f=_0x23b58f+'/List/'+_0x5bf66a+'/'+_0x11d320;const _0x596803=yield Fetch['delete'](_0x23b58f,_0x1c12e6['access_token']);try{if(_0x596803['status']>0xc7&&_0x596803['status']<0x12c){const _0x1a1f9a=yield _0x596803['json']();return new SuccessfulAccountResponse(_0x1a1f9a);}const _0x546b49=yield _0x596803['json']();return new FailedAccountResponse(_0x546b49);}catch(_0x43a56f){if(_0x43a56f instanceof Error)return new FailedAccountResponse({'detail':_0x43a56f['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x43a56f;}});}}
12
12
 
13
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x544bf6,_0x316bca,_0x5a36fa,_0x17f1e3){function _0x49c918(_0x4dca5d){return _0x4dca5d instanceof _0x5a36fa?_0x4dca5d:new _0x5a36fa(function(_0x179eb7){_0x179eb7(_0x4dca5d);});}return new(_0x5a36fa||(_0x5a36fa=Promise))(function(_0x284698,_0x5d7de0){function _0x556a01(_0x429a6e){try{_0x37bbcd(_0x17f1e3['next'](_0x429a6e));}catch(_0x3739f7){_0x5d7de0(_0x3739f7);}}function _0x5440ac(_0x4f75c3){try{_0x37bbcd(_0x17f1e3['throw'](_0x4f75c3));}catch(_0x4d8548){_0x5d7de0(_0x4d8548);}}function _0x37bbcd(_0x14c476){_0x14c476['done']?_0x284698(_0x14c476['value']):_0x49c918(_0x14c476['value'])['then'](_0x556a01,_0x5440ac);}_0x37bbcd((_0x17f1e3=_0x17f1e3['apply'](_0x544bf6,_0x316bca||[]))['next']());});};class SecurityService{constructor(_0x220f28){this['baseUri']=_0x220f28,this['tokenManager']=new TokenManager(this);}['refresh'](_0x2dba4b){return __awaiter(this,arguments,void 0,function*(_0x5b9b1f,_0x9c6b56={}){var _0x40c9bd;let _0x2f1dd6=(_0x40c9bd=_0x9c6b56['baseUri'])!==null&&_0x40c9bd!==void 0?_0x40c9bd:this['baseUri'];!_0x2f1dd6['endsWith']('/')&&(_0x2f1dd6=_0x2f1dd6+'/');_0x2f1dd6=_0x2f1dd6+'Security/Refresh';try{const _0x1f2739=yield Fetch['post'](_0x2f1dd6,_0x5b9b1f,null);if(_0x1f2739['status']>0xc7&&_0x1f2739['status']<0x12c){const _0x299464=yield _0x1f2739['json']();return new SuccessfulRefreshResponse(_0x299464);}const _0x710573=yield _0x1f2739['json']();return new FailedRefreshResponse(_0x710573);}catch(_0x3d8169){if(_0x3d8169 instanceof Error)return new FailedRefreshResponse({'detail':_0x3d8169['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3d8169;}});}}
13
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x5443d2,_0x1c1907,_0x1c45b7,_0x590ccc){function _0x28b542(_0xc2410c){return _0xc2410c instanceof _0x1c45b7?_0xc2410c:new _0x1c45b7(function(_0x50fed3){_0x50fed3(_0xc2410c);});}return new(_0x1c45b7||(_0x1c45b7=Promise))(function(_0x47b93d,_0x5c8dbb){function _0x466cd0(_0x499309){try{_0xfdb540(_0x590ccc['next'](_0x499309));}catch(_0x218eef){_0x5c8dbb(_0x218eef);}}function _0x4334ac(_0x545146){try{_0xfdb540(_0x590ccc['throw'](_0x545146));}catch(_0x105040){_0x5c8dbb(_0x105040);}}function _0xfdb540(_0x53074f){_0x53074f['done']?_0x47b93d(_0x53074f['value']):_0x28b542(_0x53074f['value'])['then'](_0x466cd0,_0x4334ac);}_0xfdb540((_0x590ccc=_0x590ccc['apply'](_0x5443d2,_0x1c1907||[]))['next']());});};class TokenManager{constructor(_0x5da6b8){this['tokenService']=_0x5da6b8,this['getTokens']=(_0x42aac3,..._0x57fcf6)=>__awaiter$1(this,[_0x42aac3,..._0x57fcf6],void 0,function*(_0x79e2ab,_0x2403a0={}){if(_0x79e2ab){var _0x4bfc41=yield this['refreshIfExpired'](_0x79e2ab,_0x2403a0);if(_0x4bfc41['isSuccess'])return _0x4bfc41;}return yield this['tokenService']['get'](_0x2403a0);});}['refreshIfExpired'](_0x3944d3){return __awaiter$1(this,arguments,void 0,function*(_0x45b6eb,_0x2fa208={}){if(Date['now']()<_0x45b6eb['access_expires'])return new SuccessfulRefreshResponse(_0x45b6eb);if(Date['now']()>_0x45b6eb['refresh_expires']){const _0x2a6c4a={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x2a6c4a);}return yield this['tokenService']['refresh'](_0x45b6eb['refresh_token'],_0x2fa208);});}}
14
14
 
15
- var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
15
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x5140b8,_0xc28e8a,_0x171f52,_0x5859c1){function _0x345393(_0x23e825){return _0x23e825 instanceof _0x171f52?_0x23e825:new _0x171f52(function(_0x5d54f5){_0x5d54f5(_0x23e825);});}return new(_0x171f52||(_0x171f52=Promise))(function(_0x901ecc,_0x44e4cb){function _0x3e1fec(_0x334937){try{_0x56764d(_0x5859c1['next'](_0x334937));}catch(_0x3f773b){_0x44e4cb(_0x3f773b);}}function _0x18bc1a(_0x3d37e0){try{_0x56764d(_0x5859c1['throw'](_0x3d37e0));}catch(_0x3a867f){_0x44e4cb(_0x3a867f);}}function _0x56764d(_0x2a9270){_0x2a9270['done']?_0x901ecc(_0x2a9270['value']):_0x345393(_0x2a9270['value'])['then'](_0x3e1fec,_0x18bc1a);}_0x56764d((_0x5859c1=_0x5859c1['apply'](_0x5140b8,_0xc28e8a||[]))['next']());});};class TokenService{constructor(_0x370ae7,_0x1f930b){this['apiKey']=_0x370ae7,this['baseUri']=_0x1f930b;}['get'](){return __awaiter(this,arguments,void 0,function*(_0x3cfbd7={}){var _0x3173d8;let _0x55569d=(_0x3173d8=_0x3cfbd7['baseUri'])!==null&&_0x3173d8!==void 0?_0x3173d8:this['baseUri'];!_0x55569d['endsWith']('/')&&(_0x55569d=_0x55569d+'/');_0x55569d=_0x55569d+'tokens/get/'+this['apiKey'];try{const _0x1baffa=yield yield fetch(_0x55569d,{'method':'POST','headers':{'Content-Type':'application/json'}});if(_0x1baffa['status']>0xc7&&_0x1baffa['status']<0x12c){const _0xf33a60=yield _0x1baffa['json']();return new SuccessfulRefreshResponse(_0xf33a60);}const _0x3f70d1=yield _0x1baffa['json']();return new FailedRefreshResponse(_0x3f70d1);}catch(_0x53e1d7){if(_0x53e1d7 instanceof Error)return new FailedRefreshResponse({'detail':_0x53e1d7['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x53e1d7;}});}['refresh'](_0x587e6b){return __awaiter(this,arguments,void 0,function*(_0xe6f035,_0x40d64b={}){var _0x59fdf5;let _0x582aa2=(_0x59fdf5=_0x40d64b['baseUri'])!==null&&_0x59fdf5!==void 0?_0x59fdf5:this['baseUri'];!_0x582aa2['endsWith']('/')&&(_0x582aa2=_0x582aa2+'/');_0x582aa2=_0x582aa2+'Tokens/Refresh';try{const _0x1cde02=yield Fetch['post'](_0x582aa2,_0xe6f035,null);if(_0x1cde02['status']>0xc7&&_0x1cde02['status']<0x12c){const _0x5c9f5c=yield _0x1cde02['json']();return new SuccessfulRefreshResponse(_0x5c9f5c);}const _0x23a3ec=yield _0x1cde02['json']();return new FailedRefreshResponse(_0x23a3ec);}catch(_0x44be43){if(_0x44be43 instanceof Error)return new FailedRefreshResponse({'detail':_0x44be43['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x44be43;}});}}
16
+
17
+ class AdminClient{constructor(_0x4b94b3,_0xf16570='https://admin.searchability.dev/'){this['apiKey']=_0x4b94b3,this['baseUri']=_0xf16570,this['Tokens']=new TokenService(_0x4b94b3,this['baseUri']);const _0xe2d26e=new TokenManager(this['Tokens']);this['Accounts']=new AccountService(this['baseUri'],_0xe2d26e),this['Lists']=new ListService(this['baseUri'],_0xe2d26e),this['ApiKeys']=new ApiKeyService(this['baseUri'],_0xe2d26e);}}
16
18
 
17
19
  exports.AdminClient = AdminClient;
@@ -1,15 +1,17 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x4d1520,_0x5d7cd9,_0x597bd6,_0x201d41){function _0x4fd560(_0x431628){return _0x431628 instanceof _0x597bd6?_0x431628:new _0x597bd6(function(_0x4eb038){_0x4eb038(_0x431628);});}return new(_0x597bd6||(_0x597bd6=Promise))(function(_0x4e0554,_0x22b8fa){function _0x1aa517(_0x2ff1b5){try{_0x54e126(_0x201d41['next'](_0x2ff1b5));}catch(_0x52e590){_0x22b8fa(_0x52e590);}}function _0x8d5a81(_0x23e7e0){try{_0x54e126(_0x201d41['throw'](_0x23e7e0));}catch(_0x10c066){_0x22b8fa(_0x10c066);}}function _0x54e126(_0x1e5ef8){_0x1e5ef8['done']?_0x4e0554(_0x1e5ef8['value']):_0x4fd560(_0x1e5ef8['value'])['then'](_0x1aa517,_0x8d5a81);}_0x54e126((_0x201d41=_0x201d41['apply'](_0x4d1520,_0x5d7cd9||[]))['next']());});};class Fetch{static['get'](_0x1aa9d4,_0x2363ad){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x1aa9d4,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2363ad}});});}static['post'](_0x368c1b,_0x561709,_0x6a3419){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x368c1b,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x561709},'body':_0x6a3419?JSON['stringify'](_0x6a3419):null});});}static['put'](_0x4d81cd,_0x14469c,_0x186b56){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x4d81cd,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x14469c},'body':_0x186b56?JSON['stringify'](_0x186b56):null});});}static['delete'](_0x3ddb2d,_0xa4315a){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x3ddb2d,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0xa4315a}});});}}
1
+ var __awaiter$5=undefined&&undefined['__awaiter']||function(_0x535168,_0x28bc32,_0x5d6b8e,_0xb81fbd){function _0x50647d(_0x434fb5){return _0x434fb5 instanceof _0x5d6b8e?_0x434fb5:new _0x5d6b8e(function(_0x11866e){_0x11866e(_0x434fb5);});}return new(_0x5d6b8e||(_0x5d6b8e=Promise))(function(_0x23af66,_0x2970c1){function _0x4c2d13(_0x29b62f){try{_0x40c131(_0xb81fbd['next'](_0x29b62f));}catch(_0x58c9a8){_0x2970c1(_0x58c9a8);}}function _0x240b70(_0x29474f){try{_0x40c131(_0xb81fbd['throw'](_0x29474f));}catch(_0xdc00b){_0x2970c1(_0xdc00b);}}function _0x40c131(_0x100319){_0x100319['done']?_0x23af66(_0x100319['value']):_0x50647d(_0x100319['value'])['then'](_0x4c2d13,_0x240b70);}_0x40c131((_0xb81fbd=_0xb81fbd['apply'](_0x535168,_0x28bc32||[]))['next']());});};class Fetch{static['get'](_0x1b19b9,_0x220f8f){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x1b19b9,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x220f8f}});});}static['post'](_0x250b87,_0x8b9ee8,_0x49db19){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x250b87,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x8b9ee8},'body':_0x49db19?JSON['stringify'](_0x49db19):null});});}static['put'](_0x397bb8,_0x43d2fc,_0x13cbda){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x397bb8,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x43d2fc},'body':_0x13cbda?JSON['stringify'](_0x13cbda):null});});}static['delete'](_0x47c1fe,_0x2c5569){return __awaiter$5(this,void 0,void 0,function*(){return yield fetch(_0x47c1fe,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2c5569}});});}}
2
2
 
3
- class Response{constructor(_0x3389d3){this['isSuccess']=_0x3389d3;}}class SuccessfulAccountResponse extends Response{constructor(_0x35bd2c){super(!![]),this['account']=_0x35bd2c;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x2dc3c2){super(![]),this['problem']=_0x2dc3c2;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x273e05){super(!![]),this['tokens']=_0x273e05;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0xd399c3){super(![]),this['problem']=_0xd399c3;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
3
+ class Response{constructor(_0x32698f){this['isSuccess']=_0x32698f;}}class SuccessfulAccountResponse extends Response{constructor(_0x2057fa){super(!![]),this['account']=_0x2057fa;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x4b1c3f){super(![]),this['problem']=_0x4b1c3f;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x59db46){super(!![]),this['tokens']=_0x59db46;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x21b802){super(![]),this['problem']=_0x21b802;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulApiKeyResponse extends Response{constructor(_0x4cbe87){super(!![]),this['apiKey']=_0x4cbe87;}['toSuccess'](){return this['apiKey'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedApiKeyResponse extends Response{constructor(_0x48e7b8){super(![]),this['problem']=_0x48e7b8;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
4
 
5
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x330619,_0x26840a,_0x181502,_0x315ff1){function _0x552030(_0x5b7420){return _0x5b7420 instanceof _0x181502?_0x5b7420:new _0x181502(function(_0x35643e){_0x35643e(_0x5b7420);});}return new(_0x181502||(_0x181502=Promise))(function(_0x2d66df,_0x9f3f5){function _0x11ace0(_0x2495db){try{_0xd21853(_0x315ff1['next'](_0x2495db));}catch(_0xcd4de){_0x9f3f5(_0xcd4de);}}function _0x1e48f2(_0x31149d){try{_0xd21853(_0x315ff1['throw'](_0x31149d));}catch(_0x479705){_0x9f3f5(_0x479705);}}function _0xd21853(_0x5e9bdb){_0x5e9bdb['done']?_0x2d66df(_0x5e9bdb['value']):_0x552030(_0x5e9bdb['value'])['then'](_0x11ace0,_0x1e48f2);}_0xd21853((_0x315ff1=_0x315ff1['apply'](_0x330619,_0x26840a||[]))['next']());});};class AccountService{constructor(_0x3835c0){this['baseUri']=_0x3835c0;}['get'](_0x495c52,_0x5995d4){return __awaiter$3(this,arguments,void 0,function*(_0xeb63b3,_0x3996f8,_0x13dd8c={}){var _0x76c58;let _0x4555c3=(_0x76c58=_0x13dd8c['baseUri'])!==null&&_0x76c58!==void 0?_0x76c58:this['baseUri'];!_0x4555c3['endsWith']('/')&&(_0x4555c3=_0x4555c3+'/');_0x4555c3=_0x4555c3+'Account/'+_0x3996f8+'/';const _0x2148b9=yield Fetch['get'](_0x4555c3,_0xeb63b3);try{if(_0x2148b9['status']>0xc7&&_0x2148b9['status']<0x12c){const _0x2017b1=yield _0x2148b9['json']();return new SuccessfulAccountResponse(_0x2017b1);}const _0x229704=yield _0x2148b9['json']();return new FailedAccountResponse(_0x229704);}catch(_0x1b2690){if(_0x1b2690 instanceof Error)return new FailedAccountResponse({'detail':_0x1b2690['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1b2690;}});}}
5
+ var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x5e29a6,_0x5f24c4,_0x370e4b,_0x46e03d){function _0xe839c2(_0x3454d9){return _0x3454d9 instanceof _0x370e4b?_0x3454d9:new _0x370e4b(function(_0x18dd30){_0x18dd30(_0x3454d9);});}return new(_0x370e4b||(_0x370e4b=Promise))(function(_0x2c8a15,_0x3c6e94){function _0x1fd106(_0x11ffc9){try{_0x5a3d52(_0x46e03d['next'](_0x11ffc9));}catch(_0x80ca10){_0x3c6e94(_0x80ca10);}}function _0x5dfc4b(_0x3a18c2){try{_0x5a3d52(_0x46e03d['throw'](_0x3a18c2));}catch(_0xf0be10){_0x3c6e94(_0xf0be10);}}function _0x5a3d52(_0x334946){_0x334946['done']?_0x2c8a15(_0x334946['value']):_0xe839c2(_0x334946['value'])['then'](_0x1fd106,_0x5dfc4b);}_0x5a3d52((_0x46e03d=_0x46e03d['apply'](_0x5e29a6,_0x5f24c4||[]))['next']());});};class AccountService{constructor(_0x3fd59c,_0x2e53bb){this['baseUri']=_0x3fd59c,this['tokenManager']=_0x2e53bb;}['get'](_0x22d394,_0x504d60){return __awaiter$4(this,arguments,void 0,function*(_0xce296c,_0x7c2a43,_0x34ac95={}){var _0xc8a4fb;const _0x51c257=yield this['tokenManager']['getTokens'](_0x7c2a43,_0x34ac95);if(!_0x51c257['isSuccess'])return new FailedAccountResponse(_0x51c257['toProblem']());_0x7c2a43=_0x51c257['toSuccess']();let _0x2512d2=(_0xc8a4fb=_0x34ac95['baseUri'])!==null&&_0xc8a4fb!==void 0?_0xc8a4fb:this['baseUri'];!_0x2512d2['endsWith']('/')&&(_0x2512d2=_0x2512d2+'/');_0x2512d2=_0x2512d2+'Account/'+_0xce296c+'/';const _0x1c97bc=yield Fetch['get'](_0x2512d2,_0x7c2a43['access_token']);try{if(_0x1c97bc['status']>0xc7&&_0x1c97bc['status']<0x12c){const _0x54c3dc=yield _0x1c97bc['json']();return new SuccessfulAccountResponse(_0x54c3dc);}const _0x504690=yield _0x1c97bc['json']();return new FailedAccountResponse(_0x504690);}catch(_0x4a9009){if(_0x4a9009 instanceof Error)return new FailedAccountResponse({'detail':_0x4a9009['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x4a9009;}});}}
6
6
 
7
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x2decd7,_0x5d8cb5,_0x90caa9,_0x1ff7f1){function _0x1981c0(_0x50eb33){return _0x50eb33 instanceof _0x90caa9?_0x50eb33:new _0x90caa9(function(_0x2d62d8){_0x2d62d8(_0x50eb33);});}return new(_0x90caa9||(_0x90caa9=Promise))(function(_0x1bfbbc,_0x5b3993){function _0x2b04fa(_0x47ef71){try{_0x30f3c9(_0x1ff7f1['next'](_0x47ef71));}catch(_0x576846){_0x5b3993(_0x576846);}}function _0x592955(_0x193783){try{_0x30f3c9(_0x1ff7f1['throw'](_0x193783));}catch(_0x57d1a7){_0x5b3993(_0x57d1a7);}}function _0x30f3c9(_0xcbc45c){_0xcbc45c['done']?_0x1bfbbc(_0xcbc45c['value']):_0x1981c0(_0xcbc45c['value'])['then'](_0x2b04fa,_0x592955);}_0x30f3c9((_0x1ff7f1=_0x1ff7f1['apply'](_0x2decd7,_0x5d8cb5||[]))['next']());});};class ListService{constructor(_0x2892e0){this['baseUri']=_0x2892e0;}['add'](_0x58d1e2,_0x2e4c95,_0x2311bc){return __awaiter$2(this,arguments,void 0,function*(_0x23a54a,_0x428c1a,_0x13cf27,_0x249557={}){var _0x3533fb;let _0x40dd3a=(_0x3533fb=_0x249557['baseUri'])!==null&&_0x3533fb!==void 0?_0x3533fb:this['baseUri'];!_0x40dd3a['endsWith']('/')&&(_0x40dd3a=_0x40dd3a+'/');_0x40dd3a=_0x40dd3a+'List';const _0x7a131={'account_name':_0x428c1a,'list_name':_0x13cf27};try{const _0x1ab64b=yield Fetch['post'](_0x40dd3a,_0x23a54a,_0x7a131);if(_0x1ab64b['status']>0xc7&&_0x1ab64b['status']<0x12c){const _0x3d646d=yield _0x1ab64b['json']();return new SuccessfulAccountResponse(_0x3d646d);}const _0x1850cb=yield _0x1ab64b['json']();return new FailedAccountResponse(_0x1850cb);}catch(_0x317156){if(_0x317156 instanceof Error)return new FailedAccountResponse({'detail':_0x317156['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x317156;}});}['remove'](_0x4ccb2,_0x3983c2,_0x5e7fec){return __awaiter$2(this,arguments,void 0,function*(_0x41e0e3,_0x4aad20,_0x493b68,_0x25d7a9={}){var _0x49d098;let _0x160ccf=(_0x49d098=_0x25d7a9['baseUri'])!==null&&_0x49d098!==void 0?_0x49d098:this['baseUri'];_0x160ccf=_0x160ccf+'/List/'+_0x4aad20+'/'+_0x493b68;const _0xb06e87=yield Fetch['delete'](_0x160ccf,_0x41e0e3);try{if(_0xb06e87['status']>0xc7&&_0xb06e87['status']<0x12c){const _0x2eac87=yield _0xb06e87['json']();return new SuccessfulAccountResponse(_0x2eac87);}const _0x392295=yield _0xb06e87['json']();return new FailedAccountResponse(_0x392295);}catch(_0x538d47){if(_0x538d47 instanceof Error)return new FailedAccountResponse({'detail':_0x538d47['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x538d47;}});}}
7
+ var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x437509,_0x4c9c12,_0x363c65,_0x487d3b){function _0x1f6afb(_0x2e15c7){return _0x2e15c7 instanceof _0x363c65?_0x2e15c7:new _0x363c65(function(_0x1c0ffe){_0x1c0ffe(_0x2e15c7);});}return new(_0x363c65||(_0x363c65=Promise))(function(_0x317032,_0x480ba0){function _0x4c2ab1(_0x2ec9c3){try{_0x341045(_0x487d3b['next'](_0x2ec9c3));}catch(_0xb0706d){_0x480ba0(_0xb0706d);}}function _0x1880fc(_0x389d02){try{_0x341045(_0x487d3b['throw'](_0x389d02));}catch(_0x269262){_0x480ba0(_0x269262);}}function _0x341045(_0x4beeb8){_0x4beeb8['done']?_0x317032(_0x4beeb8['value']):_0x1f6afb(_0x4beeb8['value'])['then'](_0x4c2ab1,_0x1880fc);}_0x341045((_0x487d3b=_0x487d3b['apply'](_0x437509,_0x4c9c12||[]))['next']());});};class ApiKeyService{constructor(_0x287d43,_0x556f62){this['baseUri']=_0x287d43,this['tokenManager']=_0x556f62;}['create'](_0x19f23b,_0x1c7f4e,_0x46ada6){return __awaiter$3(this,arguments,void 0,function*(_0x16246c,_0x1966aa,_0x1e666f,_0x1750e3={}){var _0x1607f0;const _0x2445da=yield this['tokenManager']['getTokens'](_0x1e666f,_0x1750e3);if(!_0x2445da['isSuccess'])return new FailedApiKeyResponse(_0x2445da['toProblem']());_0x1e666f=_0x2445da['toSuccess']();let _0x1b4264=(_0x1607f0=_0x1750e3['baseUri'])!==null&&_0x1607f0!==void 0?_0x1607f0:this['baseUri'];!_0x1b4264['endsWith']('/')&&(_0x1b4264=_0x1b4264+'/');_0x1b4264=_0x1b4264+'ApiKey/Create';const _0x2ab476={'account_name':_0x16246c,'name':_0x1966aa};try{const _0x8ddcce=yield Fetch['post'](_0x1b4264,_0x1e666f['access_token'],_0x2ab476);if(_0x8ddcce['status']>0xc7&&_0x8ddcce['status']<0x12c){const _0x2948dd=yield _0x8ddcce['json']();return new SuccessfulApiKeyResponse(_0x2948dd);}const _0x12cd8b=yield _0x8ddcce['json']();return new FailedApiKeyResponse(_0x12cd8b);}catch(_0x3d40a8){if(_0x3d40a8 instanceof Error)return new FailedApiKeyResponse({'detail':_0x3d40a8['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x3d40a8;}});}}
8
8
 
9
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x47778c,_0x363a13,_0x3d2f66,_0x2e7ec9){function _0x169e6f(_0x3aaa49){return _0x3aaa49 instanceof _0x3d2f66?_0x3aaa49:new _0x3d2f66(function(_0xee1d8d){_0xee1d8d(_0x3aaa49);});}return new(_0x3d2f66||(_0x3d2f66=Promise))(function(_0x41ddc3,_0x572127){function _0x5922d0(_0x229bc2){try{_0x498bb2(_0x2e7ec9['next'](_0x229bc2));}catch(_0x22314a){_0x572127(_0x22314a);}}function _0x25459c(_0x34c9cc){try{_0x498bb2(_0x2e7ec9['throw'](_0x34c9cc));}catch(_0x18c65a){_0x572127(_0x18c65a);}}function _0x498bb2(_0x2c82c6){_0x2c82c6['done']?_0x41ddc3(_0x2c82c6['value']):_0x169e6f(_0x2c82c6['value'])['then'](_0x5922d0,_0x25459c);}_0x498bb2((_0x2e7ec9=_0x2e7ec9['apply'](_0x47778c,_0x363a13||[]))['next']());});};class TokenManager{constructor(_0x5b92c6){this['securityService']=_0x5b92c6;}['RefreshTokens'](_0x35c1fc){return __awaiter$1(this,arguments,void 0,function*(_0x5f02d9,_0x39b888={}){if(Date['now']()<_0x5f02d9['access_expires'])return new SuccessfulRefreshResponse(_0x5f02d9);if(Date['now']()>_0x5f02d9['refresh_expires']){const _0x2ac8e9={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x2ac8e9);}const _0x4faa76=yield this['securityService']['refresh'](_0x5f02d9['refresh_token'],_0x39b888);if(!_0x4faa76['isSuccess'])return new FailedRefreshResponse(_0x4faa76['toProblem']());return new SuccessfulRefreshResponse(_0x4faa76['toSuccess']());});}}
9
+ var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x27809c,_0x2db2b0,_0x418078,_0x4bdeb7){function _0x4950ad(_0x220e03){return _0x220e03 instanceof _0x418078?_0x220e03:new _0x418078(function(_0x22c1a0){_0x22c1a0(_0x220e03);});}return new(_0x418078||(_0x418078=Promise))(function(_0x250b57,_0x2bdd6a){function _0x5e3c0c(_0x1ab813){try{_0x5d9323(_0x4bdeb7['next'](_0x1ab813));}catch(_0x88f00d){_0x2bdd6a(_0x88f00d);}}function _0xb60d2(_0x3678ff){try{_0x5d9323(_0x4bdeb7['throw'](_0x3678ff));}catch(_0x4eee29){_0x2bdd6a(_0x4eee29);}}function _0x5d9323(_0x2f1834){_0x2f1834['done']?_0x250b57(_0x2f1834['value']):_0x4950ad(_0x2f1834['value'])['then'](_0x5e3c0c,_0xb60d2);}_0x5d9323((_0x4bdeb7=_0x4bdeb7['apply'](_0x27809c,_0x2db2b0||[]))['next']());});};class ListService{constructor(_0x23c338,_0x11b474){this['baseUri']=_0x23c338,this['tokenManager']=_0x11b474;}['add'](_0x3c02ab,_0x34fcc2,_0xa94ad9){return __awaiter$2(this,arguments,void 0,function*(_0x38ece5,_0x10b5d7,_0x375669,_0xb27022={}){var _0x1d625a;const _0x267f55=yield this['tokenManager']['getTokens'](_0x375669,_0xb27022);if(!_0x267f55['isSuccess'])return new FailedAccountResponse(_0x267f55['toProblem']());_0x375669=_0x267f55['toSuccess']();let _0x433afa=(_0x1d625a=_0xb27022['baseUri'])!==null&&_0x1d625a!==void 0?_0x1d625a:this['baseUri'];!_0x433afa['endsWith']('/')&&(_0x433afa=_0x433afa+'/');_0x433afa=_0x433afa+'List';const _0x5e0c34={'account_name':_0x38ece5,'list_name':_0x10b5d7};try{const _0x2807c3=yield Fetch['post'](_0x433afa,_0x375669['access_token'],_0x5e0c34);if(_0x2807c3['status']>0xc7&&_0x2807c3['status']<0x12c){const _0x25c5d0=yield _0x2807c3['json']();return new SuccessfulAccountResponse(_0x25c5d0);}const _0x490fef=yield _0x2807c3['json']();return new FailedAccountResponse(_0x490fef);}catch(_0x1f0cd6){if(_0x1f0cd6 instanceof Error)return new FailedAccountResponse({'detail':_0x1f0cd6['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1f0cd6;}});}['remove'](_0x4b78f4,_0x979ff9,_0x38f236){return __awaiter$2(this,arguments,void 0,function*(_0x19fdd6,_0x570797,_0x54997b,_0x1fda81={}){var _0x4b3e0d;const _0x414cd6=yield this['tokenManager']['getTokens'](_0x54997b,_0x1fda81);if(!_0x414cd6['isSuccess'])return new FailedAccountResponse(_0x414cd6['toProblem']());_0x54997b=_0x414cd6['toSuccess']();let _0x271fd4=(_0x4b3e0d=_0x1fda81['baseUri'])!==null&&_0x4b3e0d!==void 0?_0x4b3e0d:this['baseUri'];_0x271fd4=_0x271fd4+'/List/'+_0x19fdd6+'/'+_0x570797;const _0x236633=yield Fetch['delete'](_0x271fd4,_0x54997b['access_token']);try{if(_0x236633['status']>0xc7&&_0x236633['status']<0x12c){const _0x3a99e0=yield _0x236633['json']();return new SuccessfulAccountResponse(_0x3a99e0);}const _0x29713e=yield _0x236633['json']();return new FailedAccountResponse(_0x29713e);}catch(_0x16281c){if(_0x16281c instanceof Error)return new FailedAccountResponse({'detail':_0x16281c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x16281c;}});}}
10
10
 
11
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x367cf6,_0x1299f4,_0x531813,_0x27cc36){function _0x68b187(_0xa6e51b){return _0xa6e51b instanceof _0x531813?_0xa6e51b:new _0x531813(function(_0x4f02c6){_0x4f02c6(_0xa6e51b);});}return new(_0x531813||(_0x531813=Promise))(function(_0x8df339,_0x1d5f68){function _0x1a61a1(_0x51ba71){try{_0x3a0325(_0x27cc36['next'](_0x51ba71));}catch(_0x4c077d){_0x1d5f68(_0x4c077d);}}function _0xc5d8b3(_0x9bd8dd){try{_0x3a0325(_0x27cc36['throw'](_0x9bd8dd));}catch(_0x228df6){_0x1d5f68(_0x228df6);}}function _0x3a0325(_0x3da4f3){_0x3da4f3['done']?_0x8df339(_0x3da4f3['value']):_0x68b187(_0x3da4f3['value'])['then'](_0x1a61a1,_0xc5d8b3);}_0x3a0325((_0x27cc36=_0x27cc36['apply'](_0x367cf6,_0x1299f4||[]))['next']());});};class SecurityService{constructor(_0x2c12ff){this['baseUri']=_0x2c12ff,this['tokenManager']=new TokenManager(this);}['refresh'](_0x11ea2e){return __awaiter(this,arguments,void 0,function*(_0x3712da,_0x48aebe={}){var _0x31df9e;let _0xee8de2=(_0x31df9e=_0x48aebe['baseUri'])!==null&&_0x31df9e!==void 0?_0x31df9e:this['baseUri'];!_0xee8de2['endsWith']('/')&&(_0xee8de2=_0xee8de2+'/');_0xee8de2=_0xee8de2+'Security/Refresh';try{const _0x58b38a=yield Fetch['post'](_0xee8de2,_0x3712da,null);if(_0x58b38a['status']>0xc7&&_0x58b38a['status']<0x12c){const _0x16ab6f=yield _0x58b38a['json']();return new SuccessfulRefreshResponse(_0x16ab6f);}const _0x31c82f=yield _0x58b38a['json']();return new FailedRefreshResponse(_0x31c82f);}catch(_0x174d0d){if(_0x174d0d instanceof Error)return new FailedRefreshResponse({'detail':_0x174d0d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x174d0d;}});}}
11
+ var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x3d1aec,_0x1778d3,_0xd63ef1,_0x5dd7d2){function _0x1884f1(_0x2bb879){return _0x2bb879 instanceof _0xd63ef1?_0x2bb879:new _0xd63ef1(function(_0x5ad107){_0x5ad107(_0x2bb879);});}return new(_0xd63ef1||(_0xd63ef1=Promise))(function(_0x1662ab,_0x26546e){function _0x4d10fe(_0x4d6629){try{_0x463c7f(_0x5dd7d2['next'](_0x4d6629));}catch(_0x1ba557){_0x26546e(_0x1ba557);}}function _0x7a112b(_0x397f12){try{_0x463c7f(_0x5dd7d2['throw'](_0x397f12));}catch(_0x40e2f9){_0x26546e(_0x40e2f9);}}function _0x463c7f(_0x4d68b2){_0x4d68b2['done']?_0x1662ab(_0x4d68b2['value']):_0x1884f1(_0x4d68b2['value'])['then'](_0x4d10fe,_0x7a112b);}_0x463c7f((_0x5dd7d2=_0x5dd7d2['apply'](_0x3d1aec,_0x1778d3||[]))['next']());});};class TokenManager{constructor(_0x2c1d12){this['tokenService']=_0x2c1d12,this['getTokens']=(_0xa082d0,..._0x341d7c)=>__awaiter$1(this,[_0xa082d0,..._0x341d7c],void 0,function*(_0x5a54d9,_0x284c17={}){if(_0x5a54d9){var _0x5b4bbf=yield this['refreshIfExpired'](_0x5a54d9,_0x284c17);if(_0x5b4bbf['isSuccess'])return _0x5b4bbf;}return yield this['tokenService']['get'](_0x284c17);});}['refreshIfExpired'](_0x584585){return __awaiter$1(this,arguments,void 0,function*(_0x53829c,_0x58d971={}){if(Date['now']()<_0x53829c['access_expires'])return new SuccessfulRefreshResponse(_0x53829c);if(Date['now']()>_0x53829c['refresh_expires']){const _0x116eff={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x116eff);}return yield this['tokenService']['refresh'](_0x53829c['refresh_token'],_0x58d971);});}}
12
12
 
13
- var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
13
+ var __awaiter=undefined&&undefined['__awaiter']||function(_0x50b6d6,_0x2d7137,_0x15ff91,_0x2cd0b7){function _0x316883(_0x2d89d1){return _0x2d89d1 instanceof _0x15ff91?_0x2d89d1:new _0x15ff91(function(_0x296095){_0x296095(_0x2d89d1);});}return new(_0x15ff91||(_0x15ff91=Promise))(function(_0x581c0b,_0x3b9749){function _0x59389b(_0x565fa0){try{_0x2e4140(_0x2cd0b7['next'](_0x565fa0));}catch(_0x3d2b32){_0x3b9749(_0x3d2b32);}}function _0x1b6569(_0x514fe7){try{_0x2e4140(_0x2cd0b7['throw'](_0x514fe7));}catch(_0x3f4781){_0x3b9749(_0x3f4781);}}function _0x2e4140(_0x49b446){_0x49b446['done']?_0x581c0b(_0x49b446['value']):_0x316883(_0x49b446['value'])['then'](_0x59389b,_0x1b6569);}_0x2e4140((_0x2cd0b7=_0x2cd0b7['apply'](_0x50b6d6,_0x2d7137||[]))['next']());});};class TokenService{constructor(_0xba6950,_0x3e0736){this['apiKey']=_0xba6950,this['baseUri']=_0x3e0736;}['get'](){return __awaiter(this,arguments,void 0,function*(_0x10bc83={}){var _0xcf2473;let _0x5eb9f7=(_0xcf2473=_0x10bc83['baseUri'])!==null&&_0xcf2473!==void 0?_0xcf2473:this['baseUri'];!_0x5eb9f7['endsWith']('/')&&(_0x5eb9f7=_0x5eb9f7+'/');_0x5eb9f7=_0x5eb9f7+'tokens/get/'+this['apiKey'];try{const _0x5b7e9f=yield yield fetch(_0x5eb9f7,{'method':'POST','headers':{'Content-Type':'application/json'}});if(_0x5b7e9f['status']>0xc7&&_0x5b7e9f['status']<0x12c){const _0x3a738e=yield _0x5b7e9f['json']();return new SuccessfulRefreshResponse(_0x3a738e);}const _0x3c126d=yield _0x5b7e9f['json']();return new FailedRefreshResponse(_0x3c126d);}catch(_0x501ae5){if(_0x501ae5 instanceof Error)return new FailedRefreshResponse({'detail':_0x501ae5['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x501ae5;}});}['refresh'](_0x56a249){return __awaiter(this,arguments,void 0,function*(_0x4a698f,_0x200257={}){var _0x2044a7;let _0x200bdd=(_0x2044a7=_0x200257['baseUri'])!==null&&_0x2044a7!==void 0?_0x2044a7:this['baseUri'];!_0x200bdd['endsWith']('/')&&(_0x200bdd=_0x200bdd+'/');_0x200bdd=_0x200bdd+'Tokens/Refresh';try{const _0x2558ae=yield Fetch['post'](_0x200bdd,_0x4a698f,null);if(_0x2558ae['status']>0xc7&&_0x2558ae['status']<0x12c){const _0x22d87a=yield _0x2558ae['json']();return new SuccessfulRefreshResponse(_0x22d87a);}const _0x42d8d6=yield _0x2558ae['json']();return new FailedRefreshResponse(_0x42d8d6);}catch(_0x32152c){if(_0x32152c instanceof Error)return new FailedRefreshResponse({'detail':_0x32152c['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x32152c;}});}}
14
+
15
+ class AdminClient{constructor(_0x522afe,_0x484664='https://admin.searchability.dev/'){this['apiKey']=_0x522afe,this['baseUri']=_0x484664,this['Tokens']=new TokenService(_0x522afe,this['baseUri']);const _0x35bc3f=new TokenManager(this['Tokens']);this['Accounts']=new AccountService(this['baseUri'],_0x35bc3f),this['Lists']=new ListService(this['baseUri'],_0x35bc3f),this['ApiKeys']=new ApiKeyService(this['baseUri'],_0x35bc3f);}}
14
16
 
15
17
  export { AdminClient };
package/dist/types.d.ts CHANGED
@@ -1,34 +1,48 @@
1
- declare class AccountService {
1
+ declare class TokenService {
2
+ readonly apiKey: string;
2
3
  readonly baseUri: string;
3
- constructor(baseUri: string);
4
- get(accessToken: string, accountName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
4
+ constructor(apiKey: string, baseUri: string);
5
+ get(options?: Partial<Options>): Promise<Response<Tokens, Problem>>;
6
+ refresh(refreshToken: string, options?: Partial<Options>): Promise<Response<Tokens, Problem>>;
5
7
  }
6
8
 
7
- declare class ListService {
9
+ declare class TokenManager {
10
+ readonly tokenService: TokenService;
11
+ constructor(tokenService: TokenService);
12
+ getTokens: (tokens: Tokens | undefined, options?: Partial<Options>) => Promise<Response<Tokens, Problem>>;
13
+ private refreshIfExpired;
14
+ }
15
+
16
+ declare class AccountService {
8
17
  readonly baseUri: string;
9
- constructor(baseUri: string);
10
- add(access_token: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
11
- remove(accessToken: string, accountName: string, listName: string, options?: Partial<Options>): Promise<Response<Account, Problem>>;
18
+ readonly tokenManager: TokenManager;
19
+ constructor(baseUri: string, tokenManager: TokenManager);
20
+ get(accountName: string, tokens?: Tokens | undefined, options?: Partial<Options>): Promise<Response<Account, Problem>>;
12
21
  }
13
22
 
14
- declare class TokenManager {
15
- readonly securityService: SecurityService;
16
- constructor(securityService: SecurityService);
17
- RefreshTokens(tokens: Tokens, options?: Partial<Options>): Promise<Response<Tokens, Problem>>;
23
+ declare class ApiKeyService {
24
+ readonly baseUri: string;
25
+ readonly tokenManager: TokenManager;
26
+ constructor(baseUri: string, tokenManager: TokenManager);
27
+ create(accountName: string, apiKeyName: string, tokens?: Tokens | undefined, options?: Partial<Options>): Promise<Response<ApiKey, Problem>>;
18
28
  }
19
29
 
20
- declare class SecurityService {
30
+ declare class ListService {
21
31
  readonly baseUri: string;
22
- constructor(baseUri: string);
23
- refresh(refreshToken: string, options?: Partial<Options>): Promise<Response<Tokens, Problem>>;
24
32
  readonly tokenManager: TokenManager;
33
+ constructor(baseUri: string, tokenManager: TokenManager);
34
+ add(accountName: string, listName: string, tokens?: Tokens | undefined, options?: Partial<Options>): Promise<Response<Account, Problem>>;
35
+ remove(accountName: string, listName: string, tokens?: Tokens | undefined, options?: Partial<Options>): Promise<Response<Account, Problem>>;
25
36
  }
26
37
 
27
38
  declare class AdminClient {
28
- static baseUri: string;
29
- static Accounts: AccountService;
30
- static Lists: ListService;
31
- static Security: SecurityService;
39
+ readonly apiKey: string;
40
+ readonly baseUri: string;
41
+ constructor(apiKey: string, baseUri?: string);
42
+ readonly Tokens: TokenService;
43
+ readonly Accounts: AccountService;
44
+ readonly Lists: ListService;
45
+ readonly ApiKeys: ApiKeyService;
32
46
  }
33
47
 
34
48
  type Options = {
@@ -43,9 +57,18 @@ declare abstract class Response<S, F> {
43
57
  type List = {
44
58
  name: string;
45
59
  created: number;
46
- result_count: number;
47
60
  version: number;
48
61
  };
62
+ type ListIdentity = {
63
+ name: string;
64
+ created: number;
65
+ account_name: string;
66
+ image_path: string;
67
+ };
68
+ type ApiKey = {
69
+ name: string;
70
+ created: number;
71
+ };
49
72
  type Error = {
50
73
  [key: string]: string[];
51
74
  };
@@ -59,8 +82,10 @@ type Problem = {
59
82
  type Account = {
60
83
  name: string;
61
84
  owner: string;
62
- created_utc: number;
63
- lists: List[];
85
+ created: number;
86
+ image_path: string;
87
+ lists: ListIdentity[];
88
+ api_keys: ApiKey[];
64
89
  };
65
90
  type Tokens = {
66
91
  access_token: string;
@@ -92,5 +117,17 @@ declare class FailedRefreshResponse extends Response<Tokens, Problem> {
92
117
  toSuccess(): Tokens;
93
118
  toProblem(): Problem;
94
119
  }
120
+ declare class SuccessfulApiKeyResponse extends Response<ApiKey, Problem> {
121
+ readonly apiKey: ApiKey;
122
+ constructor(apiKey: ApiKey);
123
+ toSuccess(): ApiKey;
124
+ toProblem(): Problem;
125
+ }
126
+ declare class FailedApiKeyResponse extends Response<ApiKey, Problem> {
127
+ readonly problem: Problem;
128
+ constructor(problem: Problem);
129
+ toSuccess(): ApiKey;
130
+ toProblem(): Problem;
131
+ }
95
132
 
96
- export { type Account, AdminClient, type Error, FailedAccountResponse, FailedRefreshResponse, type List, type Options, type Problem, Response, SuccessfulAccountResponse, SuccessfulRefreshResponse, type Tokens };
133
+ export { type Account, AdminClient, type ApiKey, type Error, FailedAccountResponse, FailedApiKeyResponse, FailedRefreshResponse, type List, type ListIdentity, type Options, type Problem, Response, SuccessfulAccountResponse, SuccessfulApiKeyResponse, SuccessfulRefreshResponse, type Tokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchability/admin-client",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Searchability admin client.",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
@@ -1,15 +0,0 @@
1
- var __awaiter$4=undefined&&undefined['__awaiter']||function(_0x254144,_0x2b7ad5,_0x49efdf,_0x27bf50){function _0x4cb9da(_0x1c5a68){return _0x1c5a68 instanceof _0x49efdf?_0x1c5a68:new _0x49efdf(function(_0x307872){_0x307872(_0x1c5a68);});}return new(_0x49efdf||(_0x49efdf=Promise))(function(_0x211ff0,_0x5c14a3){function _0x1da2f3(_0x2bbde6){try{_0x4cd967(_0x27bf50['next'](_0x2bbde6));}catch(_0xdce5e5){_0x5c14a3(_0xdce5e5);}}function _0x574a0f(_0x10cf0a){try{_0x4cd967(_0x27bf50['throw'](_0x10cf0a));}catch(_0x4173a3){_0x5c14a3(_0x4173a3);}}function _0x4cd967(_0x2428bd){_0x2428bd['done']?_0x211ff0(_0x2428bd['value']):_0x4cb9da(_0x2428bd['value'])['then'](_0x1da2f3,_0x574a0f);}_0x4cd967((_0x27bf50=_0x27bf50['apply'](_0x254144,_0x2b7ad5||[]))['next']());});};class Fetch{static['get'](_0x5babca,_0x42af0b){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x5babca,{'method':'GET','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x42af0b}});});}static['post'](_0x19fa58,_0x3c06ff,_0x4d098e){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x19fa58,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3c06ff},'body':_0x4d098e?JSON['stringify'](_0x4d098e):null});});}static['put'](_0x7984e8,_0x558d2f,_0xbf9504){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x7984e8,{'method':'PUT','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x558d2f},'body':_0xbf9504?JSON['stringify'](_0xbf9504):null});});}static['delete'](_0x44b063,_0x433702){return __awaiter$4(this,void 0,void 0,function*(){return yield fetch(_0x44b063,{'method':'DELETE','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x433702}});});}}
2
-
3
- class Response{constructor(_0x42c69d){this['isSuccess']=_0x42c69d;}}class SuccessfulAccountResponse extends Response{constructor(_0x2b2093){super(!![]),this['account']=_0x2b2093;}['toSuccess'](){return this['account'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedAccountResponse extends Response{constructor(_0x46530d){super(![]),this['problem']=_0x46530d;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}class SuccessfulRefreshResponse extends Response{constructor(_0x34567d){super(!![]),this['tokens']=_0x34567d;}['toSuccess'](){return this['tokens'];}['toProblem'](){throw new Error('Did\x20not\x20fail');}}class FailedRefreshResponse extends Response{constructor(_0x17d43b){super(![]),this['problem']=_0x17d43b;}['toSuccess'](){throw new Error('Not\x20a\x20success');}['toProblem'](){return this['problem'];}}
4
-
5
- var __awaiter$3=undefined&&undefined['__awaiter']||function(_0x67fb41,_0x58f7dc,_0x33967c,_0x6c403f){function _0x48d663(_0x43f9a3){return _0x43f9a3 instanceof _0x33967c?_0x43f9a3:new _0x33967c(function(_0x17f8ca){_0x17f8ca(_0x43f9a3);});}return new(_0x33967c||(_0x33967c=Promise))(function(_0x162cd1,_0x33a0bc){function _0x5c141f(_0x202630){try{_0x5dc01f(_0x6c403f['next'](_0x202630));}catch(_0x5026ba){_0x33a0bc(_0x5026ba);}}function _0x401b2e(_0x2b4fea){try{_0x5dc01f(_0x6c403f['throw'](_0x2b4fea));}catch(_0x2dc54e){_0x33a0bc(_0x2dc54e);}}function _0x5dc01f(_0x4ab038){_0x4ab038['done']?_0x162cd1(_0x4ab038['value']):_0x48d663(_0x4ab038['value'])['then'](_0x5c141f,_0x401b2e);}_0x5dc01f((_0x6c403f=_0x6c403f['apply'](_0x67fb41,_0x58f7dc||[]))['next']());});};class AccountService{constructor(_0x6fb03e){this['baseUri']=_0x6fb03e;}['get'](_0x5e1d8a,_0x1d5300){return __awaiter$3(this,arguments,void 0,function*(_0x42bb23,_0x394994,_0x4b4e04={}){var _0x4951c9;let _0xc20b3=(_0x4951c9=_0x4b4e04['baseUri'])!==null&&_0x4951c9!==void 0?_0x4951c9:this['baseUri'];!_0xc20b3['endsWith']('/')&&(_0xc20b3=_0xc20b3+'/');_0xc20b3=_0xc20b3+'Account/'+_0x394994+'/';const _0x91889b=yield Fetch['get'](_0xc20b3,_0x42bb23);try{if(_0x91889b['status']>0xc7&&_0x91889b['status']<0x12c){const _0x5f0ce5=yield _0x91889b['json']();return new SuccessfulAccountResponse(_0x5f0ce5);}const _0x26a4ae=yield _0x91889b['json']();return new FailedAccountResponse(_0x26a4ae);}catch(_0x28e7c0){if(_0x28e7c0 instanceof Error)return new FailedAccountResponse({'detail':_0x28e7c0['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x28e7c0;}});}}
6
-
7
- var __awaiter$2=undefined&&undefined['__awaiter']||function(_0x4d2899,_0x5b0cf4,_0x58d6b9,_0x149b13){function _0x5654cb(_0x40dd24){return _0x40dd24 instanceof _0x58d6b9?_0x40dd24:new _0x58d6b9(function(_0x5eceab){_0x5eceab(_0x40dd24);});}return new(_0x58d6b9||(_0x58d6b9=Promise))(function(_0x20f94b,_0x2902d1){function _0x3cbd6a(_0x32f40a){try{_0x225b02(_0x149b13['next'](_0x32f40a));}catch(_0xe815de){_0x2902d1(_0xe815de);}}function _0x4284d6(_0x40a7f1){try{_0x225b02(_0x149b13['throw'](_0x40a7f1));}catch(_0x2c6645){_0x2902d1(_0x2c6645);}}function _0x225b02(_0xc62671){_0xc62671['done']?_0x20f94b(_0xc62671['value']):_0x5654cb(_0xc62671['value'])['then'](_0x3cbd6a,_0x4284d6);}_0x225b02((_0x149b13=_0x149b13['apply'](_0x4d2899,_0x5b0cf4||[]))['next']());});};class ListService{constructor(_0x11145a){this['baseUri']=_0x11145a;}['add'](_0x5636cd,_0x3da14e,_0x466f58){return __awaiter$2(this,arguments,void 0,function*(_0x357074,_0x4225b1,_0x2a5276,_0x3d548f={}){var _0x1ef651;let _0x571cda=(_0x1ef651=_0x3d548f['baseUri'])!==null&&_0x1ef651!==void 0?_0x1ef651:this['baseUri'];!_0x571cda['endsWith']('/')&&(_0x571cda=_0x571cda+'/');_0x571cda=_0x571cda+'List';const _0x2606be={'account_name':_0x4225b1,'list_name':_0x2a5276};try{const _0x413e05=yield Fetch['post'](_0x571cda,_0x357074,_0x2606be);if(_0x413e05['status']>0xc7&&_0x413e05['status']<0x12c){const _0x524384=yield _0x413e05['json']();return new SuccessfulAccountResponse(_0x524384);}const _0x310492=yield _0x413e05['json']();return new FailedAccountResponse(_0x310492);}catch(_0x1e73f2){if(_0x1e73f2 instanceof Error)return new FailedAccountResponse({'detail':_0x1e73f2['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x1e73f2;}});}['remove'](_0x13f564,_0x2dcdfe,_0x4def68){return __awaiter$2(this,arguments,void 0,function*(_0x2e0cd2,_0x22f3a4,_0x5398c1,_0x2b4d9c={}){var _0x6eed15;let _0x4748cf=(_0x6eed15=_0x2b4d9c['baseUri'])!==null&&_0x6eed15!==void 0?_0x6eed15:this['baseUri'];_0x4748cf=_0x4748cf+'/List/'+_0x22f3a4+'/'+_0x5398c1;const _0x1a6ceb=yield Fetch['delete'](_0x4748cf,_0x2e0cd2);try{if(_0x1a6ceb['status']>0xc7&&_0x1a6ceb['status']<0x12c){const _0x40f51f=yield _0x1a6ceb['json']();return new SuccessfulAccountResponse(_0x40f51f);}const _0x3a0baf=yield _0x1a6ceb['json']();return new FailedAccountResponse(_0x3a0baf);}catch(_0x36e7e6){if(_0x36e7e6 instanceof Error)return new FailedAccountResponse({'detail':_0x36e7e6['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x36e7e6;}});}}
8
-
9
- var __awaiter$1=undefined&&undefined['__awaiter']||function(_0x336163,_0x5a80d0,_0x47b0ec,_0x33cade){function _0x2f9abd(_0x1bb423){return _0x1bb423 instanceof _0x47b0ec?_0x1bb423:new _0x47b0ec(function(_0x5982cf){_0x5982cf(_0x1bb423);});}return new(_0x47b0ec||(_0x47b0ec=Promise))(function(_0x371fdc,_0x18998d){function _0x4c2a85(_0x2532e1){try{_0x5f2c98(_0x33cade['next'](_0x2532e1));}catch(_0x8d158c){_0x18998d(_0x8d158c);}}function _0x5714ff(_0x46427e){try{_0x5f2c98(_0x33cade['throw'](_0x46427e));}catch(_0x20f020){_0x18998d(_0x20f020);}}function _0x5f2c98(_0x3b7b2f){_0x3b7b2f['done']?_0x371fdc(_0x3b7b2f['value']):_0x2f9abd(_0x3b7b2f['value'])['then'](_0x4c2a85,_0x5714ff);}_0x5f2c98((_0x33cade=_0x33cade['apply'](_0x336163,_0x5a80d0||[]))['next']());});};class TokenManager{constructor(_0x2385ed){this['securityService']=_0x2385ed;}['RefreshTokens'](_0x5e9ee6){return __awaiter$1(this,arguments,void 0,function*(_0x261552,_0x5d3489={}){if(Date['now']()<_0x261552['access_expires'])return new SuccessfulRefreshResponse(_0x261552);if(Date['now']()>_0x261552['refresh_expires']){const _0x4cc3b9={'detail':'Forbidden','type':'','status':0x193,'title':'Forbidden','instance':''};return new FailedRefreshResponse(_0x4cc3b9);}const _0x4f0e5f=yield this['securityService']['refresh'](_0x261552['refresh_token'],_0x5d3489);if(!_0x4f0e5f['isSuccess'])return new FailedRefreshResponse(_0x4f0e5f['toProblem']());return new SuccessfulRefreshResponse(_0x4f0e5f['toSuccess']());});}}
10
-
11
- var __awaiter=undefined&&undefined['__awaiter']||function(_0x35eba6,_0x4beae9,_0x54101f,_0x3f12d4){function _0x2a72cf(_0x1b78cd){return _0x1b78cd instanceof _0x54101f?_0x1b78cd:new _0x54101f(function(_0x4373de){_0x4373de(_0x1b78cd);});}return new(_0x54101f||(_0x54101f=Promise))(function(_0x219784,_0x5141e5){function _0x387607(_0x4346e4){try{_0x5d9e8b(_0x3f12d4['next'](_0x4346e4));}catch(_0xabd02d){_0x5141e5(_0xabd02d);}}function _0x5055ae(_0x33719b){try{_0x5d9e8b(_0x3f12d4['throw'](_0x33719b));}catch(_0x4122ae){_0x5141e5(_0x4122ae);}}function _0x5d9e8b(_0x1e0120){_0x1e0120['done']?_0x219784(_0x1e0120['value']):_0x2a72cf(_0x1e0120['value'])['then'](_0x387607,_0x5055ae);}_0x5d9e8b((_0x3f12d4=_0x3f12d4['apply'](_0x35eba6,_0x4beae9||[]))['next']());});};class SecurityService{constructor(_0x7846f8){this['baseUri']=_0x7846f8,this['tokenManager']=new TokenManager(this);}['refresh'](_0x4d22ec){return __awaiter(this,arguments,void 0,function*(_0x11bf35,_0x42bbff={}){var _0x166321;let _0x2ad3d9=(_0x166321=_0x42bbff['baseUri'])!==null&&_0x166321!==void 0?_0x166321:this['baseUri'];!_0x2ad3d9['endsWith']('/')&&(_0x2ad3d9=_0x2ad3d9+'/');_0x2ad3d9=_0x2ad3d9+'Security/Refresh';try{const _0x51ecf9=yield Fetch['post'](_0x2ad3d9,_0x11bf35,null);if(_0x51ecf9['status']>0xc7&&_0x51ecf9['status']<0x12c){const _0x1b0b85=yield _0x51ecf9['json']();return new SuccessfulRefreshResponse(_0x1b0b85);}const _0x3034c4=yield _0x51ecf9['json']();return new FailedRefreshResponse(_0x3034c4);}catch(_0x6dda8d){if(_0x6dda8d instanceof Error)return new FailedRefreshResponse({'detail':_0x6dda8d['message'],'title':'','status':0x1f4,'instance':'','type':''});throw _0x6dda8d;}});}}
12
-
13
- var _a;class AdminClient{}_a=AdminClient,AdminClient['baseUri']='https://admin.searchability.dev/',AdminClient['Accounts']=new AccountService(_a['baseUri']),AdminClient['Lists']=new ListService(_a['baseUri']),AdminClient['Security']=new SecurityService(_a['baseUri']);
14
-
15
- export { AdminClient };